@medplum/app 2.1.14 → 2.1.15

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.
@@ -54,14 +54,14 @@ function I3(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
54
54
  `)},_A=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,i=f.useMemo(function(){return yA(o)},[o]);return f.createElement(xA,{styles:wA(i,!t,o,r?"":"!important")})},Vg=!1;if(typeof window<"u")try{var Gc=Object.defineProperty({},"passive",{get:function(){return Vg=!0,!0}});window.addEventListener("test",Gc,Gc),window.removeEventListener("test",Gc,Gc)}catch{Vg=!1}var Sa=Vg?{passive:!1}:!1,bA=function(e){return e.tagName==="TEXTAREA"},KC=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!bA(e)&&r[t]==="visible")},SA=function(e){return KC(e,"overflowY")},PA=function(e){return KC(e,"overflowX")},a1=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=YC(e,n);if(o){var i=XC(e,n),a=i[1],l=i[2];if(a>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},jA=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},OA=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},YC=function(e,t){return e==="v"?SA(t):PA(t)},XC=function(e,t){return e==="v"?jA(t):OA(t)},CA=function(e,t){return e==="h"&&t==="rtl"?-1:1},EA=function(e,t,r,n,o){var i=CA(e,window.getComputedStyle(t).direction),a=i*n,l=r.target,c=t.contains(l),u=!1,d=a>0,p=0,h=0;do{var m=XC(e,l),v=m[0],g=m[1],b=m[2],y=g-b-i*v;(v||y)&&YC(e,l)&&(p+=y,h+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(o&&Math.abs(p)<1||!o&&a>p)||!d&&(o&&Math.abs(h)<1||!o&&-a>h))&&(u=!0),u},qc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},s1=function(e){return[e.deltaX,e.deltaY]},l1=function(e){return e&&"current"in e?e.current:e},$A=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kA=function(e){return`
55
55
  .block-interactivity-`.concat(e,` {pointer-events: none;}
56
56
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
- `)},RA=0,Pa=[];function TA(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(RA++)[0],i=f.useState(QC)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Fg([e.lockRef.current],(e.shards||[]).map(l1),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,b){if("touches"in g&&g.touches.length===2)return!a.current.allowPinchZoom;var y=qc(g),x=r.current,_="deltaX"in g?g.deltaX:x[0]-y[0],w="deltaY"in g?g.deltaY:x[1]-y[1],O,C=g.target,P=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in g&&P==="h"&&C.type==="range")return!1;var E=a1(P,C);if(!E)return!0;if(E?O=P:(O=P==="v"?"h":"v",E=a1(P,C)),!E)return!1;if(!n.current&&"changedTouches"in g&&(_||w)&&(n.current=O),!O)return!0;var k=n.current||O;return EA(k,b,g,k==="h"?_:w,!0)},[]),c=f.useCallback(function(g){var b=g;if(!(!Pa.length||Pa[Pa.length-1]!==i)){var y="deltaY"in b?s1(b):qc(b),x=t.current.filter(function(O){return O.name===b.type&&(O.target===b.target||b.target===O.shadowParent)&&$A(O.delta,y)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var _=(a.current.shards||[]).map(l1).filter(Boolean).filter(function(O){return O.contains(b.target)}),w=_.length>0?l(b,_[0]):!a.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),u=f.useCallback(function(g,b,y,x){var _={name:g,delta:b,target:y,should:x,shadowParent:IA(y)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),d=f.useCallback(function(g){r.current=qc(g),n.current=void 0},[]),p=f.useCallback(function(g){u(g.type,s1(g),g.target,l(g,e.lockRef.current))},[]),h=f.useCallback(function(g){u(g.type,qc(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return Pa.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Sa),document.addEventListener("touchmove",c,Sa),document.addEventListener("touchstart",d,Sa),function(){Pa=Pa.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,Sa),document.removeEventListener("touchmove",c,Sa),document.removeEventListener("touchstart",d,Sa)}},[]);var m=e.removeScrollBar,v=e.inert;return f.createElement(f.Fragment,null,v?f.createElement(i,{styles:kA(o)}):null,m?f.createElement(_A,{gapMode:e.gapMode}):null)}function IA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const DA=cA(qC,TA);var JC=f.forwardRef(function(e,t){return f.createElement(gh,Hn({},e,{ref:t,sideCar:DA}))});JC.classNames=gh.classNames;const NA=JC;function pd(e,t){let r=e;for(;(r=r.parentElement)&&!r.matches(t););return r}function AA(e,t,r){for(let n=e-1;n>=0;n-=1)if(!t[n].disabled)return n;if(r){for(let n=t.length-1;n>-1;n-=1)if(!t[n].disabled)return n}return e}function MA(e,t,r){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(r){for(let n=0;n<t.length;n+=1)if(!t[n].disabled)return n}return e}function LA(e,t,r){return pd(e,r)===pd(t,r)}function ZC({parentSelector:e,siblingSelector:t,onKeyDown:r,loop:n=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:a}){return l=>{var c;r==null||r(l);const u=Array.from(((c=pd(l.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(g=>LA(l.currentTarget,g,e)),d=u.findIndex(g=>l.currentTarget===g),p=MA(d,u,n),h=AA(d,u,n),m=i==="rtl"?h:p,v=i==="rtl"?p:h;switch(l.key){case"ArrowRight":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[m].focus(),o&&u[m].click());break}case"ArrowLeft":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[v].focus(),o&&u[v].click());break}case"ArrowUp":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[h].focus(),o&&u[h].click());break}case"ArrowDown":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),o&&u[p].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const g=u.length-1;!u[g].disabled&&u[g].focus();break}}}}function zA(e,t,r){var n;return r?Array.from(((n=pd(r,t))==null?void 0:n.querySelectorAll(e))||[]).findIndex(o=>o===r):null}function ko(e){const t=f.createContext(null);return[({children:o,value:i})=>S.createElement(t.Provider,{value:i},o),()=>{const o=f.useContext(t);if(o===null)throw new Error(e);return o}]}function dc(e){return Array.isArray(e)?e:[e]}function c1(e,t){return r=>{if(typeof r!="string"||r.trim().length===0)throw new Error(t);return`${e}-${r}`}}const FA=()=>{};function VA(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||FA:r=>{var n;r.key==="Escape"&&(e(r),(n=t.onTrigger)==null||n.call(t))}}function Mr(e,t){return r=>{e==null||e(r),t==null||t(r)}}function BA(){const[e,t]=f.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function UA({data:e}){const t=[],r=[],n=e.reduce((o,i,a)=>(i.group?o[i.group]?o[i.group].push(a):o[i.group]=[a]:r.push(a),o),{});return Object.keys(n).forEach(o=>{t.push(...n[o].map(i=>e[i]))}),t.push(...r.map(o=>e[o])),t}function WA(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const HA=typeof window<"u"?f.useLayoutEffect:f.useEffect;function GA(e){function t(n){const o=Object.keys(n).reduce((i,a)=>(i[`${e}:${a}`]=l=>n[a](l.detail),i),{});HA(()=>(Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i]),window.addEventListener(i,o[i])}),()=>Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i])})),[o])}function r(n){return(...o)=>WA(`${e}:${String(n)}`,o[0])}return[t,r]}function Os(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==S.Fragment:!1}function eE(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=eE(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function tE(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=eE(t))&&(n&&(n+=" "),n+=r);return n}const qA={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function QA(e){return()=>({fontFamily:e.fontFamily||"sans-serif"})}var KA=Object.defineProperty,u1=Object.getOwnPropertySymbols,YA=Object.prototype.hasOwnProperty,XA=Object.prototype.propertyIsEnumerable,d1=(e,t,r)=>t in e?KA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f1=(e,t)=>{for(var r in t||(t={}))YA.call(t,r)&&d1(e,r,t[r]);if(u1)for(var r of u1(t))XA.call(t,r)&&d1(e,r,t[r]);return e};function JA(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 fc(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function Cy(e){const t=fc(e);return(r,n,o=!0,i=!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"&&!i?n:u]}const a=typeof n=="number"?n:t();return r in e.colors?e.colors[r][a]:o?e.colors[e.primaryColor][a]:r}}function rE(e){let t="";for(let r=1;r<e.length-1;r+=1)t+=`${e[r]} ${r/(e.length-1)*100}%, `;return`${e[0]} 0%, ${t}${e[e.length-1]} 100%`}function ZA(e,...t){return`linear-gradient(${e}deg, ${rE(t)})`}function e9(...e){return`radial-gradient(circle, ${rE(e)})`}function nE(e){const t=Cy(e),r=fc(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 oE(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 j=oE("rem"),ir=oE("em");function A({size:e,sizes:t,units:r}){return e in t?t[e]:typeof e=="number"?r==="em"?ir(e):j(e):e||t.md}function pr(e){return typeof e=="number"?e:typeof e=="string"&&e.includes("rem")?Number(e.replace("rem",""))*16:typeof e=="string"&&e.includes("em")?Number(e.replace("em",""))*16:Number(e)}function t9(e){return t=>`@media (min-width: ${ir(pr(A({size:t,sizes:e.breakpoints})))})`}function r9(e){return t=>`@media (max-width: ${ir(pr(A({size:t,sizes:e.breakpoints}))-1)})`}function n9(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function o9(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}const r=parseInt(t,16),n=r>>16&255,o=r>>8&255,i=r&255;return{r:n,g:o,b:i,a:1}}function i9(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 Ey(e){return n9(e)?o9(e):e.startsWith("rgb")?i9(e):{r:0,g:0,b:0,a:1}}function Da(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}=Ey(e);return`rgba(${r}, ${n}, ${o}, ${t})`}function a9(e=0){return{position:"absolute",top:j(e),right:j(e),left:j(e),bottom:j(e)}}function s9(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Ey(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(r)}, ${l(n)}, ${l(o)}, ${i})`}function l9(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Ey(e),a=l=>Math.round(l+(255-l)*t);return`rgba(${a(r)}, ${a(n)}, ${a(o)}, ${i})`}function c9(e){return t=>{if(typeof t=="number")return j(t);const r=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||r}}function u9(e,t){if(typeof e=="string"&&e.includes(".")){const[r,n]=e.split("."),o=parseInt(n,10);if(r in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:r,shade:o}}return{isSplittedColor:!1}}function d9(e){const t=Cy(e),r=fc(e),n=nE(e);return({variant:o,color:i,gradient:a,primaryFallback:l})=>{const c=u9(i,e);switch(o){case"light":return{border:"transparent",background:Da(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:Da(t(i,e.colorScheme==="dark"?7:1,l,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:Da(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:r("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:r("light")),hover:e.colorScheme==="dark"?Da(t(i,5,l,!1),.05):Da(t(i,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(i,r()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),background:"transparent",hover:null};case"gradient":return{background:n(a),color:e.white,border:"transparent",hover:null};default:{const u=r(),d=c.isSplittedColor?c.shade:u,p=c.isSplittedColor?c.key:i;return{border:"transparent",background:t(p,d,l),color:e.white,hover:t(p,d===9?8:d+1)}}}}}function f9(e){return t=>{const r=fc(e)(t);return e.colors[e.primaryColor][r]}}function p9(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function h9(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function m9(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const At={fontStyles:QA,themeColor:Cy,focusStyles:JA,linearGradient:ZA,radialGradient:e9,smallerThan:r9,largerThan:t9,rgba:Da,cover:a9,darken:s9,lighten:l9,radius:c9,variant:d9,primaryShade:fc,hover:p9,gradient:nE,primaryColor:f9,placeholderStyles:h9,dimmed:m9};var g9=Object.defineProperty,v9=Object.defineProperties,y9=Object.getOwnPropertyDescriptors,p1=Object.getOwnPropertySymbols,x9=Object.prototype.hasOwnProperty,w9=Object.prototype.propertyIsEnumerable,h1=(e,t,r)=>t in e?g9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_9=(e,t)=>{for(var r in t||(t={}))x9.call(t,r)&&h1(e,r,t[r]);if(p1)for(var r of p1(t))w9.call(t,r)&&h1(e,r,t[r]);return e},b9=(e,t)=>v9(e,y9(t));function iE(e){return b9(_9({},e),{fn:{fontStyles:At.fontStyles(e),themeColor:At.themeColor(e),focusStyles:At.focusStyles(e),largerThan:At.largerThan(e),smallerThan:At.smallerThan(e),radialGradient:At.radialGradient,linearGradient:At.linearGradient,gradient:At.gradient(e),rgba:At.rgba,cover:At.cover,lighten:At.lighten,darken:At.darken,primaryShade:At.primaryShade(e),radius:At.radius(e),variant:At.variant(e),hover:At.hover,primaryColor:At.primaryColor(e),placeholderStyles:At.placeholderStyles(e),dimmed:At.dimmed(e)}})}const aE=["xs","sm","md","lg","xl"],S9={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:qA,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]})}},$y=iE(S9);function P9(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function j9(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var O9=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(j9(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=P9(o);try{i.insertRule(n,i.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}(),tr="-ms-",hd="-moz-",Fe="-webkit-",sE="comm",ky="rule",Ry="decl",C9="@import",lE="@keyframes",E9="@layer",$9=Math.abs,vh=String.fromCharCode,k9=Object.assign;function R9(e,t){return Kt(e,0)^45?(((t<<2^Kt(e,0))<<2^Kt(e,1))<<2^Kt(e,2))<<2^Kt(e,3):0}function cE(e){return e.trim()}function T9(e,t){return(e=t.exec(e))?e[0]:e}function Ve(e,t,r){return e.replace(t,r)}function Bg(e,t){return e.indexOf(t)}function Kt(e,t){return e.charCodeAt(t)|0}function Ml(e,t,r){return e.slice(t,r)}function Un(e){return e.length}function Ty(e){return e.length}function Qc(e,t){return t.push(e),e}function I9(e,t){return e.map(t).join("")}var yh=1,ls=1,uE=0,Er=0,Tt=0,Cs="";function xh(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:yh,column:ls,length:a,return:""}}function Fs(e,t){return k9(xh("",null,null,"",null,null,0),e,{length:-e.length},t)}function D9(){return Tt}function N9(){return Tt=Er>0?Kt(Cs,--Er):0,ls--,Tt===10&&(ls=1,yh--),Tt}function zr(){return Tt=Er<uE?Kt(Cs,Er++):0,ls++,Tt===10&&(ls=1,yh++),Tt}function Qn(){return Kt(Cs,Er)}function qu(){return Er}function pc(e,t){return Ml(Cs,e,t)}function Ll(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 dE(e){return yh=ls=1,uE=Un(Cs=e),Er=0,[]}function fE(e){return Cs="",e}function Qu(e){return cE(pc(Er-1,Ug(e===91?e+2:e===40?e+1:e)))}function A9(e){for(;(Tt=Qn())&&Tt<33;)zr();return Ll(e)>2||Ll(Tt)>3?"":" "}function M9(e,t){for(;--t&&zr()&&!(Tt<48||Tt>102||Tt>57&&Tt<65||Tt>70&&Tt<97););return pc(e,qu()+(t<6&&Qn()==32&&zr()==32))}function Ug(e){for(;zr();)switch(Tt){case e:return Er;case 34:case 39:e!==34&&e!==39&&Ug(Tt);break;case 40:e===41&&Ug(e);break;case 92:zr();break}return Er}function L9(e,t){for(;zr()&&e+Tt!==47+10;)if(e+Tt===42+42&&Qn()===47)break;return"/*"+pc(t,Er-1)+"*"+vh(e===47?e:zr())}function z9(e){for(;!Ll(Qn());)zr();return pc(e,Er)}function F9(e){return fE(Ku("",null,null,null,[""],e=dE(e),0,[0],e))}function Ku(e,t,r,n,o,i,a,l,c){for(var u=0,d=0,p=a,h=0,m=0,v=0,g=1,b=1,y=1,x=0,_="",w=o,O=i,C=n,P=_;b;)switch(v=x,x=zr()){case 40:if(v!=108&&Kt(P,p-1)==58){Bg(P+=Ve(Qu(x),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:P+=Qu(x);break;case 9:case 10:case 13:case 32:P+=A9(v);break;case 92:P+=M9(qu()-1,7);continue;case 47:switch(Qn()){case 42:case 47:Qc(V9(L9(zr(),qu()),t,r),c);break;default:P+="/"}break;case 123*g:l[u++]=Un(P)*y;case 125*g:case 59:case 0:switch(x){case 0:case 125:b=0;case 59+d:y==-1&&(P=Ve(P,/\f/g,"")),m>0&&Un(P)-p&&Qc(m>32?g1(P+";",n,r,p-1):g1(Ve(P," ","")+";",n,r,p-2),c);break;case 59:P+=";";default:if(Qc(C=m1(P,t,r,u,d,o,l,_,w=[],O=[],p),i),x===123)if(d===0)Ku(P,t,C,C,w,i,p,l,O);else switch(h===99&&Kt(P,3)===110?100:h){case 100:case 108:case 109:case 115:Ku(e,C,C,n&&Qc(m1(e,C,C,0,0,o,l,_,o,w=[],p),O),o,O,p,l,n?w:O);break;default:Ku(P,C,C,C,[""],O,0,l,O)}}u=d=m=0,g=y=1,_=P="",p=a;break;case 58:p=1+Un(P),m=v;default:if(g<1){if(x==123)--g;else if(x==125&&g++==0&&N9()==125)continue}switch(P+=vh(x),x*g){case 38:y=d>0?1:(P+="\f",-1);break;case 44:l[u++]=(Un(P)-1)*y,y=1;break;case 64:Qn()===45&&(P+=Qu(zr())),h=Qn(),d=p=Un(_=P+=z9(qu())),x++;break;case 45:v===45&&Un(P)==2&&(g=0)}}return i}function m1(e,t,r,n,o,i,a,l,c,u,d){for(var p=o-1,h=o===0?i:[""],m=Ty(h),v=0,g=0,b=0;v<n;++v)for(var y=0,x=Ml(e,p+1,p=$9(g=a[v])),_=e;y<m;++y)(_=cE(g>0?h[y]+" "+x:Ve(x,/&\f/g,h[y])))&&(c[b++]=_);return xh(e,t,r,o===0?ky:l,c,u,d)}function V9(e,t,r){return xh(e,t,r,sE,vh(D9()),Ml(e,2,-2),0)}function g1(e,t,r,n){return xh(e,t,r,Ry,Ml(e,0,n),Ml(e,n+1,-1),n)}function Xa(e,t){for(var r="",n=Ty(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function B9(e,t,r,n){switch(e.type){case E9:if(e.children.length)break;case C9:case Ry:return e.return=e.return||e.value;case sE:return"";case lE:return e.return=e.value+"{"+Xa(e.children,n)+"}";case ky:e.value=e.props.join(",")}return Un(r=Xa(e.children,n))?e.return=e.value+"{"+r+"}":""}function U9(e){var t=Ty(e);return function(r,n,o,i){for(var a="",l=0;l<t;l++)a+=e[l](r,n,o,i)||"";return a}}function W9(e){return function(t){t.root||(t=t.return)&&e(t)}}var v1=function(t){var r=new WeakMap;return function(n){if(r.has(n))return r.get(n);var o=t(n);return r.set(n,o),o}};function H9(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var G9=function(t,r,n){for(var o=0,i=0;o=i,i=Qn(),o===38&&i===12&&(r[n]=1),!Ll(i);)zr();return pc(t,Er)},q9=function(t,r){var n=-1,o=44;do switch(Ll(o)){case 0:o===38&&Qn()===12&&(r[n]=1),t[n]+=G9(Er-1,r,n);break;case 2:t[n]+=Qu(o);break;case 4:if(o===44){t[++n]=Qn()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=vh(o)}while(o=zr());return t},Q9=function(t,r){return fE(q9(dE(t),r))},y1=new WeakMap,K9=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!y1.get(n))&&!o){y1.set(t,!0);for(var i=[],a=Q9(r,i),l=n.props,c=0,u=0;c<a.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=i[c]?a[c].replace(/&\f/g,l[d]):l[d]+" "+a[c]}}},Y9=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function pE(e,t){switch(R9(e,t)){case 5103:return Fe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Fe+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Fe+e+hd+e+tr+e+e;case 6828:case 4268:return Fe+e+tr+e+e;case 6165:return Fe+e+tr+"flex-"+e+e;case 5187:return Fe+e+Ve(e,/(\w+).+(:[^]+)/,Fe+"box-$1$2"+tr+"flex-$1$2")+e;case 5443:return Fe+e+tr+"flex-item-"+Ve(e,/flex-|-self/,"")+e;case 4675:return Fe+e+tr+"flex-line-pack"+Ve(e,/align-content|flex-|-self/,"")+e;case 5548:return Fe+e+tr+Ve(e,"shrink","negative")+e;case 5292:return Fe+e+tr+Ve(e,"basis","preferred-size")+e;case 6060:return Fe+"box-"+Ve(e,"-grow","")+Fe+e+tr+Ve(e,"grow","positive")+e;case 4554:return Fe+Ve(e,/([^-])(transform)/g,"$1"+Fe+"$2")+e;case 6187:return Ve(Ve(Ve(e,/(zoom-|grab)/,Fe+"$1"),/(image-set)/,Fe+"$1"),e,"")+e;case 5495:case 3959:return Ve(e,/(image-set\([^]*)/,Fe+"$1$`$1");case 4968:return Ve(Ve(e,/(.+:)(flex-)?(.*)/,Fe+"box-pack:$3"+tr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Fe+e+e;case 4095:case 3583:case 4068:case 2532:return Ve(e,/(.+)-inline(.+)/,Fe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Un(e)-1-t>6)switch(Kt(e,t+1)){case 109:if(Kt(e,t+4)!==45)break;case 102:return Ve(e,/(.+:)(.+)-([^]+)/,"$1"+Fe+"$2-$3$1"+hd+(Kt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Bg(e,"stretch")?pE(Ve(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Kt(e,t+1)!==115)break;case 6444:switch(Kt(e,Un(e)-3-(~Bg(e,"!important")&&10))){case 107:return Ve(e,":",":"+Fe)+e;case 101:return Ve(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Fe+(Kt(e,14)===45?"inline-":"")+"box$3$1"+Fe+"$2$3$1"+tr+"$2box$3")+e}break;case 5936:switch(Kt(e,t+11)){case 114:return Fe+e+tr+Ve(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Fe+e+tr+Ve(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Fe+e+tr+Ve(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Fe+e+tr+e+e}return e}var X9=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case Ry:t.return=pE(t.value,t.length);break;case lE:return Xa([Fs(t,{value:Ve(t.value,"@","@"+Fe)})],o);case ky:if(t.length)return I9(t.props,function(i){switch(T9(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Xa([Fs(t,{props:[Ve(i,/:(read-\w+)/,":"+hd+"$1")]})],o);case"::placeholder":return Xa([Fs(t,{props:[Ve(i,/:(plac\w+)/,":"+Fe+"input-$1")]}),Fs(t,{props:[Ve(i,/:(plac\w+)/,":"+hd+"$1")]}),Fs(t,{props:[Ve(i,/:(plac\w+)/,tr+"input-$1")]})],o)}return""})}},J9=[X9],hE=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(g){var b=g.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=t.stylisPlugins||J9,i={},a,l=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var b=g.getAttribute("data-emotion").split(" "),y=1;y<b.length;y++)i[b[y]]=!0;l.push(g)});var c,u=[K9,Y9];{var d,p=[B9,W9(function(g){d.insert(g)})],h=U9(u.concat(o,p)),m=function(b){return Xa(F9(b),h)};c=function(b,y,x,_){d=x,m(b?b+"{"+y.styles+"}":y.styles),_&&(v.inserted[y.name]=!0)}}var v={key:r,sheet:new O9({key:r,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return v.sheet.hydrate(l),v};function rt(){return rt=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},rt.apply(this,arguments)}var mE={exports:{}},qe={};/** @license React v16.13.1
57
+ `)},RA=0,Pa=[];function TA(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(RA++)[0],i=f.useState(QC)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Fg([e.lockRef.current],(e.shards||[]).map(l1),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,b){if("touches"in g&&g.touches.length===2)return!a.current.allowPinchZoom;var y=qc(g),x=r.current,_="deltaX"in g?g.deltaX:x[0]-y[0],w="deltaY"in g?g.deltaY:x[1]-y[1],O,C=g.target,P=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in g&&P==="h"&&C.type==="range")return!1;var E=a1(P,C);if(!E)return!0;if(E?O=P:(O=P==="v"?"h":"v",E=a1(P,C)),!E)return!1;if(!n.current&&"changedTouches"in g&&(_||w)&&(n.current=O),!O)return!0;var k=n.current||O;return EA(k,b,g,k==="h"?_:w,!0)},[]),c=f.useCallback(function(g){var b=g;if(!(!Pa.length||Pa[Pa.length-1]!==i)){var y="deltaY"in b?s1(b):qc(b),x=t.current.filter(function(O){return O.name===b.type&&(O.target===b.target||b.target===O.shadowParent)&&$A(O.delta,y)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var _=(a.current.shards||[]).map(l1).filter(Boolean).filter(function(O){return O.contains(b.target)}),w=_.length>0?l(b,_[0]):!a.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),u=f.useCallback(function(g,b,y,x){var _={name:g,delta:b,target:y,should:x,shadowParent:IA(y)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),d=f.useCallback(function(g){r.current=qc(g),n.current=void 0},[]),p=f.useCallback(function(g){u(g.type,s1(g),g.target,l(g,e.lockRef.current))},[]),h=f.useCallback(function(g){u(g.type,qc(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return Pa.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Sa),document.addEventListener("touchmove",c,Sa),document.addEventListener("touchstart",d,Sa),function(){Pa=Pa.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,Sa),document.removeEventListener("touchmove",c,Sa),document.removeEventListener("touchstart",d,Sa)}},[]);var m=e.removeScrollBar,v=e.inert;return f.createElement(f.Fragment,null,v?f.createElement(i,{styles:kA(o)}):null,m?f.createElement(_A,{gapMode:e.gapMode}):null)}function IA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const DA=cA(qC,TA);var JC=f.forwardRef(function(e,t){return f.createElement(gh,Hn({},e,{ref:t,sideCar:DA}))});JC.classNames=gh.classNames;const NA=JC;function pd(e,t){let r=e;for(;(r=r.parentElement)&&!r.matches(t););return r}function AA(e,t,r){for(let n=e-1;n>=0;n-=1)if(!t[n].disabled)return n;if(r){for(let n=t.length-1;n>-1;n-=1)if(!t[n].disabled)return n}return e}function MA(e,t,r){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(r){for(let n=0;n<t.length;n+=1)if(!t[n].disabled)return n}return e}function LA(e,t,r){return pd(e,r)===pd(t,r)}function ZC({parentSelector:e,siblingSelector:t,onKeyDown:r,loop:n=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:a}){return l=>{var c;r==null||r(l);const u=Array.from(((c=pd(l.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(g=>LA(l.currentTarget,g,e)),d=u.findIndex(g=>l.currentTarget===g),p=MA(d,u,n),h=AA(d,u,n),m=i==="rtl"?h:p,v=i==="rtl"?p:h;switch(l.key){case"ArrowRight":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[m].focus(),o&&u[m].click());break}case"ArrowLeft":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[v].focus(),o&&u[v].click());break}case"ArrowUp":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[h].focus(),o&&u[h].click());break}case"ArrowDown":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),o&&u[p].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const g=u.length-1;!u[g].disabled&&u[g].focus();break}}}}function zA(e,t,r){var n;return r?Array.from(((n=pd(r,t))==null?void 0:n.querySelectorAll(e))||[]).findIndex(o=>o===r):null}function ko(e){const t=f.createContext(null);return[({children:o,value:i})=>S.createElement(t.Provider,{value:i},o),()=>{const o=f.useContext(t);if(o===null)throw new Error(e);return o}]}function dc(e){return Array.isArray(e)?e:[e]}function c1(e,t){return r=>{if(typeof r!="string"||r.trim().length===0)throw new Error(t);return`${e}-${r}`}}const FA=()=>{};function VA(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||FA:r=>{var n;r.key==="Escape"&&(e(r),(n=t.onTrigger)==null||n.call(t))}}function Mr(e,t){return r=>{e==null||e(r),t==null||t(r)}}function BA(){const[e,t]=f.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function UA({data:e}){const t=[],r=[],n=e.reduce((o,i,a)=>(i.group?o[i.group]?o[i.group].push(a):o[i.group]=[a]:r.push(a),o),{});return Object.keys(n).forEach(o=>{t.push(...n[o].map(i=>e[i]))}),t.push(...r.map(o=>e[o])),t}function WA(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const HA=typeof window<"u"?f.useLayoutEffect:f.useEffect;function GA(e){function t(n){const o=Object.keys(n).reduce((i,a)=>(i[`${e}:${a}`]=l=>n[a](l.detail),i),{});HA(()=>(Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i]),window.addEventListener(i,o[i])}),()=>Object.keys(o).forEach(i=>{window.removeEventListener(i,o[i])})),[o])}function r(n){return(...o)=>WA(`${e}:${String(n)}`,o[0])}return[t,r]}function Os(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==S.Fragment:!1}function eE(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=eE(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function tE(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=eE(t))&&(n&&(n+=" "),n+=r);return n}const qA={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function QA(e){return()=>({fontFamily:e.fontFamily||"sans-serif"})}var KA=Object.defineProperty,u1=Object.getOwnPropertySymbols,YA=Object.prototype.hasOwnProperty,XA=Object.prototype.propertyIsEnumerable,d1=(e,t,r)=>t in e?KA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f1=(e,t)=>{for(var r in t||(t={}))YA.call(t,r)&&d1(e,r,t[r]);if(u1)for(var r of u1(t))XA.call(t,r)&&d1(e,r,t[r]);return e};function JA(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 fc(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function Cy(e){const t=fc(e);return(r,n,o=!0,i=!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"&&!i?n:u]}const a=typeof n=="number"?n:t();return r in e.colors?e.colors[r][a]:o?e.colors[e.primaryColor][a]:r}}function rE(e){let t="";for(let r=1;r<e.length-1;r+=1)t+=`${e[r]} ${r/(e.length-1)*100}%, `;return`${e[0]} 0%, ${t}${e[e.length-1]} 100%`}function ZA(e,...t){return`linear-gradient(${e}deg, ${rE(t)})`}function eM(...e){return`radial-gradient(circle, ${rE(e)})`}function nE(e){const t=Cy(e),r=fc(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 oE(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 j=oE("rem"),ir=oE("em");function A({size:e,sizes:t,units:r}){return e in t?t[e]:typeof e=="number"?r==="em"?ir(e):j(e):e||t.md}function pr(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 tM(e){return t=>`@media (min-width: ${ir(pr(A({size:t,sizes:e.breakpoints})))})`}function rM(e){return t=>`@media (max-width: ${ir(pr(A({size:t,sizes:e.breakpoints}))-1)})`}function nM(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function oM(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}const r=parseInt(t,16),n=r>>16&255,o=r>>8&255,i=r&255;return{r:n,g:o,b:i,a:1}}function iM(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 Ey(e){return nM(e)?oM(e):e.startsWith("rgb")?iM(e):{r:0,g:0,b:0,a:1}}function Da(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}=Ey(e);return`rgba(${r}, ${n}, ${o}, ${t})`}function aM(e=0){return{position:"absolute",top:j(e),right:j(e),left:j(e),bottom:j(e)}}function sM(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Ey(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(r)}, ${l(n)}, ${l(o)}, ${i})`}function lM(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a:i}=Ey(e),a=l=>Math.round(l+(255-l)*t);return`rgba(${a(r)}, ${a(n)}, ${a(o)}, ${i})`}function cM(e){return t=>{if(typeof t=="number")return j(t);const r=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||r}}function uM(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 dM(e){const t=Cy(e),r=fc(e),n=nE(e);return({variant:o,color:i,gradient:a,primaryFallback:l})=>{const c=uM(i,e);switch(o){case"light":return{border:"transparent",background:Da(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:Da(t(i,e.colorScheme==="dark"?7:1,l,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),hover:Da(t(i,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:r("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:r("light")),hover:e.colorScheme==="dark"?Da(t(i,5,l,!1),.05):Da(t(i,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(i,r()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:r("light")),background:"transparent",hover:null};case"gradient":return{background:n(a),color:e.white,border:"transparent",hover:null};default:{const u=r(),d=c.isSplittedColor?c.shade:u,p=c.isSplittedColor?c.key:i;return{border:"transparent",background:t(p,d,l),color:e.white,hover:t(p,d===9?8:d+1)}}}}}function fM(e){return t=>{const r=fc(e)(t);return e.colors[e.primaryColor][r]}}function pM(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function hM(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function mM(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const At={fontStyles:QA,themeColor:Cy,focusStyles:JA,linearGradient:ZA,radialGradient:eM,smallerThan:rM,largerThan:tM,rgba:Da,cover:aM,darken:sM,lighten:lM,radius:cM,variant:dM,primaryShade:fc,hover:pM,gradient:nE,primaryColor:fM,placeholderStyles:hM,dimmed:mM};var gM=Object.defineProperty,vM=Object.defineProperties,yM=Object.getOwnPropertyDescriptors,p1=Object.getOwnPropertySymbols,xM=Object.prototype.hasOwnProperty,wM=Object.prototype.propertyIsEnumerable,h1=(e,t,r)=>t in e?gM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_M=(e,t)=>{for(var r in t||(t={}))xM.call(t,r)&&h1(e,r,t[r]);if(p1)for(var r of p1(t))wM.call(t,r)&&h1(e,r,t[r]);return e},bM=(e,t)=>vM(e,yM(t));function iE(e){return bM(_M({},e),{fn:{fontStyles:At.fontStyles(e),themeColor:At.themeColor(e),focusStyles:At.focusStyles(e),largerThan:At.largerThan(e),smallerThan:At.smallerThan(e),radialGradient:At.radialGradient,linearGradient:At.linearGradient,gradient:At.gradient(e),rgba:At.rgba,cover:At.cover,lighten:At.lighten,darken:At.darken,primaryShade:At.primaryShade(e),radius:At.radius(e),variant:At.variant(e),hover:At.hover,primaryColor:At.primaryColor(e),placeholderStyles:At.placeholderStyles(e),dimmed:At.dimmed(e)}})}const aE=["xs","sm","md","lg","xl"],SM={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:qA,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]})}},$y=iE(SM);function PM(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 jM(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 OM=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),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(jM(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var i=PM(o);try{i.insertRule(n,i.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}(),tr="-ms-",hd="-moz-",Fe="-webkit-",sE="comm",ky="rule",Ry="decl",CM="@import",lE="@keyframes",EM="@layer",$M=Math.abs,vh=String.fromCharCode,kM=Object.assign;function RM(e,t){return Kt(e,0)^45?(((t<<2^Kt(e,0))<<2^Kt(e,1))<<2^Kt(e,2))<<2^Kt(e,3):0}function cE(e){return e.trim()}function TM(e,t){return(e=t.exec(e))?e[0]:e}function Ve(e,t,r){return e.replace(t,r)}function Bg(e,t){return e.indexOf(t)}function Kt(e,t){return e.charCodeAt(t)|0}function Ml(e,t,r){return e.slice(t,r)}function Un(e){return e.length}function Ty(e){return e.length}function Qc(e,t){return t.push(e),e}function IM(e,t){return e.map(t).join("")}var yh=1,ls=1,uE=0,Er=0,Tt=0,Cs="";function xh(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:yh,column:ls,length:a,return:""}}function Fs(e,t){return kM(xh("",null,null,"",null,null,0),e,{length:-e.length},t)}function DM(){return Tt}function NM(){return Tt=Er>0?Kt(Cs,--Er):0,ls--,Tt===10&&(ls=1,yh--),Tt}function zr(){return Tt=Er<uE?Kt(Cs,Er++):0,ls++,Tt===10&&(ls=1,yh++),Tt}function Qn(){return Kt(Cs,Er)}function qu(){return Er}function pc(e,t){return Ml(Cs,e,t)}function Ll(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 dE(e){return yh=ls=1,uE=Un(Cs=e),Er=0,[]}function fE(e){return Cs="",e}function Qu(e){return cE(pc(Er-1,Ug(e===91?e+2:e===40?e+1:e)))}function AM(e){for(;(Tt=Qn())&&Tt<33;)zr();return Ll(e)>2||Ll(Tt)>3?"":" "}function MM(e,t){for(;--t&&zr()&&!(Tt<48||Tt>102||Tt>57&&Tt<65||Tt>70&&Tt<97););return pc(e,qu()+(t<6&&Qn()==32&&zr()==32))}function Ug(e){for(;zr();)switch(Tt){case e:return Er;case 34:case 39:e!==34&&e!==39&&Ug(Tt);break;case 40:e===41&&Ug(e);break;case 92:zr();break}return Er}function LM(e,t){for(;zr()&&e+Tt!==47+10;)if(e+Tt===42+42&&Qn()===47)break;return"/*"+pc(t,Er-1)+"*"+vh(e===47?e:zr())}function zM(e){for(;!Ll(Qn());)zr();return pc(e,Er)}function FM(e){return fE(Ku("",null,null,null,[""],e=dE(e),0,[0],e))}function Ku(e,t,r,n,o,i,a,l,c){for(var u=0,d=0,p=a,h=0,m=0,v=0,g=1,b=1,y=1,x=0,_="",w=o,O=i,C=n,P=_;b;)switch(v=x,x=zr()){case 40:if(v!=108&&Kt(P,p-1)==58){Bg(P+=Ve(Qu(x),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:P+=Qu(x);break;case 9:case 10:case 13:case 32:P+=AM(v);break;case 92:P+=MM(qu()-1,7);continue;case 47:switch(Qn()){case 42:case 47:Qc(VM(LM(zr(),qu()),t,r),c);break;default:P+="/"}break;case 123*g:l[u++]=Un(P)*y;case 125*g:case 59:case 0:switch(x){case 0:case 125:b=0;case 59+d:y==-1&&(P=Ve(P,/\f/g,"")),m>0&&Un(P)-p&&Qc(m>32?g1(P+";",n,r,p-1):g1(Ve(P," ","")+";",n,r,p-2),c);break;case 59:P+=";";default:if(Qc(C=m1(P,t,r,u,d,o,l,_,w=[],O=[],p),i),x===123)if(d===0)Ku(P,t,C,C,w,i,p,l,O);else switch(h===99&&Kt(P,3)===110?100:h){case 100:case 108:case 109:case 115:Ku(e,C,C,n&&Qc(m1(e,C,C,0,0,o,l,_,o,w=[],p),O),o,O,p,l,n?w:O);break;default:Ku(P,C,C,C,[""],O,0,l,O)}}u=d=m=0,g=y=1,_=P="",p=a;break;case 58:p=1+Un(P),m=v;default:if(g<1){if(x==123)--g;else if(x==125&&g++==0&&NM()==125)continue}switch(P+=vh(x),x*g){case 38:y=d>0?1:(P+="\f",-1);break;case 44:l[u++]=(Un(P)-1)*y,y=1;break;case 64:Qn()===45&&(P+=Qu(zr())),h=Qn(),d=p=Un(_=P+=zM(qu())),x++;break;case 45:v===45&&Un(P)==2&&(g=0)}}return i}function m1(e,t,r,n,o,i,a,l,c,u,d){for(var p=o-1,h=o===0?i:[""],m=Ty(h),v=0,g=0,b=0;v<n;++v)for(var y=0,x=Ml(e,p+1,p=$M(g=a[v])),_=e;y<m;++y)(_=cE(g>0?h[y]+" "+x:Ve(x,/&\f/g,h[y])))&&(c[b++]=_);return xh(e,t,r,o===0?ky:l,c,u,d)}function VM(e,t,r){return xh(e,t,r,sE,vh(DM()),Ml(e,2,-2),0)}function g1(e,t,r,n){return xh(e,t,r,Ry,Ml(e,0,n),Ml(e,n+1,-1),n)}function Xa(e,t){for(var r="",n=Ty(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function BM(e,t,r,n){switch(e.type){case EM:if(e.children.length)break;case CM:case Ry:return e.return=e.return||e.value;case sE:return"";case lE:return e.return=e.value+"{"+Xa(e.children,n)+"}";case ky:e.value=e.props.join(",")}return Un(r=Xa(e.children,n))?e.return=e.value+"{"+r+"}":""}function UM(e){var t=Ty(e);return function(r,n,o,i){for(var a="",l=0;l<t;l++)a+=e[l](r,n,o,i)||"";return a}}function WM(e){return function(t){t.root||(t=t.return)&&e(t)}}var v1=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 HM(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var GM=function(t,r,n){for(var o=0,i=0;o=i,i=Qn(),o===38&&i===12&&(r[n]=1),!Ll(i);)zr();return pc(t,Er)},qM=function(t,r){var n=-1,o=44;do switch(Ll(o)){case 0:o===38&&Qn()===12&&(r[n]=1),t[n]+=GM(Er-1,r,n);break;case 2:t[n]+=Qu(o);break;case 4:if(o===44){t[++n]=Qn()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=vh(o)}while(o=zr());return t},QM=function(t,r){return fE(qM(dE(t),r))},y1=new WeakMap,KM=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&&!y1.get(n))&&!o){y1.set(t,!0);for(var i=[],a=QM(r,i),l=n.props,c=0,u=0;c<a.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=i[c]?a[c].replace(/&\f/g,l[d]):l[d]+" "+a[c]}}},YM=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function pE(e,t){switch(RM(e,t)){case 5103:return Fe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Fe+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Fe+e+hd+e+tr+e+e;case 6828:case 4268:return Fe+e+tr+e+e;case 6165:return Fe+e+tr+"flex-"+e+e;case 5187:return Fe+e+Ve(e,/(\w+).+(:[^]+)/,Fe+"box-$1$2"+tr+"flex-$1$2")+e;case 5443:return Fe+e+tr+"flex-item-"+Ve(e,/flex-|-self/,"")+e;case 4675:return Fe+e+tr+"flex-line-pack"+Ve(e,/align-content|flex-|-self/,"")+e;case 5548:return Fe+e+tr+Ve(e,"shrink","negative")+e;case 5292:return Fe+e+tr+Ve(e,"basis","preferred-size")+e;case 6060:return Fe+"box-"+Ve(e,"-grow","")+Fe+e+tr+Ve(e,"grow","positive")+e;case 4554:return Fe+Ve(e,/([^-])(transform)/g,"$1"+Fe+"$2")+e;case 6187:return Ve(Ve(Ve(e,/(zoom-|grab)/,Fe+"$1"),/(image-set)/,Fe+"$1"),e,"")+e;case 5495:case 3959:return Ve(e,/(image-set\([^]*)/,Fe+"$1$`$1");case 4968:return Ve(Ve(e,/(.+:)(flex-)?(.*)/,Fe+"box-pack:$3"+tr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Fe+e+e;case 4095:case 3583:case 4068:case 2532:return Ve(e,/(.+)-inline(.+)/,Fe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Un(e)-1-t>6)switch(Kt(e,t+1)){case 109:if(Kt(e,t+4)!==45)break;case 102:return Ve(e,/(.+:)(.+)-([^]+)/,"$1"+Fe+"$2-$3$1"+hd+(Kt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Bg(e,"stretch")?pE(Ve(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Kt(e,t+1)!==115)break;case 6444:switch(Kt(e,Un(e)-3-(~Bg(e,"!important")&&10))){case 107:return Ve(e,":",":"+Fe)+e;case 101:return Ve(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Fe+(Kt(e,14)===45?"inline-":"")+"box$3$1"+Fe+"$2$3$1"+tr+"$2box$3")+e}break;case 5936:switch(Kt(e,t+11)){case 114:return Fe+e+tr+Ve(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Fe+e+tr+Ve(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Fe+e+tr+Ve(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Fe+e+tr+e+e}return e}var XM=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case Ry:t.return=pE(t.value,t.length);break;case lE:return Xa([Fs(t,{value:Ve(t.value,"@","@"+Fe)})],o);case ky:if(t.length)return IM(t.props,function(i){switch(TM(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Xa([Fs(t,{props:[Ve(i,/:(read-\w+)/,":"+hd+"$1")]})],o);case"::placeholder":return Xa([Fs(t,{props:[Ve(i,/:(plac\w+)/,":"+Fe+"input-$1")]}),Fs(t,{props:[Ve(i,/:(plac\w+)/,":"+hd+"$1")]}),Fs(t,{props:[Ve(i,/:(plac\w+)/,tr+"input-$1")]})],o)}return""})}},JM=[XM],hE=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(g){var b=g.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=t.stylisPlugins||JM,i={},a,l=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var b=g.getAttribute("data-emotion").split(" "),y=1;y<b.length;y++)i[b[y]]=!0;l.push(g)});var c,u=[KM,YM];{var d,p=[BM,WM(function(g){d.insert(g)})],h=UM(u.concat(o,p)),m=function(b){return Xa(FM(b),h)};c=function(b,y,x,_){d=x,m(b?b+"{"+y.styles+"}":y.styles),_&&(v.inserted[y.name]=!0)}}var v={key:r,sheet:new OM({key:r,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return v.sheet.hydrate(l),v};function rt(){return rt=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},rt.apply(this,arguments)}var mE={exports:{}},qe={};/** @license React v16.13.1
58
58
  * react-is.production.min.js
59
59
  *
60
60
  * Copyright (c) Facebook, Inc. and its affiliates.
61
61
  *
62
62
  * This source code is licensed under the MIT license found in the
63
63
  * LICENSE file in the root directory of this source tree.
64
- */var Wt=typeof Symbol=="function"&&Symbol.for,Iy=Wt?Symbol.for("react.element"):60103,Dy=Wt?Symbol.for("react.portal"):60106,wh=Wt?Symbol.for("react.fragment"):60107,_h=Wt?Symbol.for("react.strict_mode"):60108,bh=Wt?Symbol.for("react.profiler"):60114,Sh=Wt?Symbol.for("react.provider"):60109,Ph=Wt?Symbol.for("react.context"):60110,Ny=Wt?Symbol.for("react.async_mode"):60111,jh=Wt?Symbol.for("react.concurrent_mode"):60111,Oh=Wt?Symbol.for("react.forward_ref"):60112,Ch=Wt?Symbol.for("react.suspense"):60113,Z9=Wt?Symbol.for("react.suspense_list"):60120,Eh=Wt?Symbol.for("react.memo"):60115,$h=Wt?Symbol.for("react.lazy"):60116,eM=Wt?Symbol.for("react.block"):60121,tM=Wt?Symbol.for("react.fundamental"):60117,rM=Wt?Symbol.for("react.responder"):60118,nM=Wt?Symbol.for("react.scope"):60119;function Ur(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Iy:switch(e=e.type,e){case Ny:case jh:case wh:case bh:case _h:case Ch:return e;default:switch(e=e&&e.$$typeof,e){case Ph:case Oh:case $h:case Eh:case Sh:return e;default:return t}}case Dy:return t}}}function gE(e){return Ur(e)===jh}qe.AsyncMode=Ny;qe.ConcurrentMode=jh;qe.ContextConsumer=Ph;qe.ContextProvider=Sh;qe.Element=Iy;qe.ForwardRef=Oh;qe.Fragment=wh;qe.Lazy=$h;qe.Memo=Eh;qe.Portal=Dy;qe.Profiler=bh;qe.StrictMode=_h;qe.Suspense=Ch;qe.isAsyncMode=function(e){return gE(e)||Ur(e)===Ny};qe.isConcurrentMode=gE;qe.isContextConsumer=function(e){return Ur(e)===Ph};qe.isContextProvider=function(e){return Ur(e)===Sh};qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Iy};qe.isForwardRef=function(e){return Ur(e)===Oh};qe.isFragment=function(e){return Ur(e)===wh};qe.isLazy=function(e){return Ur(e)===$h};qe.isMemo=function(e){return Ur(e)===Eh};qe.isPortal=function(e){return Ur(e)===Dy};qe.isProfiler=function(e){return Ur(e)===bh};qe.isStrictMode=function(e){return Ur(e)===_h};qe.isSuspense=function(e){return Ur(e)===Ch};qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wh||e===jh||e===bh||e===_h||e===Ch||e===Z9||typeof e=="object"&&e!==null&&(e.$$typeof===$h||e.$$typeof===Eh||e.$$typeof===Sh||e.$$typeof===Ph||e.$$typeof===Oh||e.$$typeof===tM||e.$$typeof===rM||e.$$typeof===nM||e.$$typeof===eM)};qe.typeOf=Ur;mE.exports=qe;var oM=mE.exports,vE=oM,iM={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},aM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},yE={};yE[vE.ForwardRef]=iM;yE[vE.Memo]=aM;var sM=!0;function lM(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):n+=o+" "}),n}var cM=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||sM===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},xE=function(t,r,n){cM(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function uM(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var dM={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fM=/[A-Z]|^ms/g,pM=/_EMO_([^_]+?)_([^]*?)_EMO_/g,wE=function(t){return t.charCodeAt(1)===45},x1=function(t){return t!=null&&typeof t!="boolean"},$m=H9(function(e){return wE(e)?e:e.replace(fM,"-$&").toLowerCase()}),w1=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(pM,function(n,o,i){return Wn={name:o,styles:i,next:Wn},o})}return dM[t]!==1&&!wE(t)&&typeof r=="number"&&r!==0?r+"px":r};function zl(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 Wn={name:r.name,styles:r.styles,next:Wn},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)Wn={name:n.name,styles:n.styles,next:Wn},n=n.next;var o=r.styles+";";return o}return hM(e,t,r)}case"function":{if(e!==void 0){var i=Wn,a=r(e);return Wn=i,zl(e,t,a)}break}}if(t==null)return r;var l=t[r];return l!==void 0?l:r}function hM(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=zl(e,t,r[o])+";";else for(var i in r){var a=r[i];if(typeof a!="object")t!=null&&t[a]!==void 0?n+=i+"{"+t[a]+"}":x1(a)&&(n+=$m(i)+":"+w1(i,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)x1(a[l])&&(n+=$m(i)+":"+w1(i,a[l])+";");else{var c=zl(e,t,a);switch(i){case"animation":case"animationName":{n+=$m(i)+":"+c+";";break}default:n+=i+"{"+c+"}"}}}return n}var _1=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Wn,Ay=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,i="";Wn=void 0;var a=t[0];a==null||a.raw===void 0?(o=!1,i+=zl(n,r,a)):i+=a[0];for(var l=1;l<t.length;l++)i+=zl(n,r,t[l]),o&&(i+=a[l]);_1.lastIndex=0;for(var c="",u;(u=_1.exec(i))!==null;)c+="-"+u[1];var d=uM(i)+c;return{name:d,styles:i,next:Wn}},mM=Al["useInsertionEffect"]?Al["useInsertionEffect"]:!1,b1=mM||f.useLayoutEffect,_E=f.createContext(typeof HTMLElement<"u"?hE({key:"css"}):null);_E.Provider;var gM=function(t){return f.forwardRef(function(r,n){var o=f.useContext(_E);return t(r,o,n)})},Wg=f.createContext({}),vM=function(t,r){if(typeof r=="function"){var n=r(t);return n}return rt({},t,r)},yM=v1(function(e){return v1(function(t){return vM(e,t)})}),xM=function(t){var r=f.useContext(Wg);return t.theme!==r&&(r=yM(r)(t.theme)),f.createElement(Wg.Provider,{value:r},t.children)},hc=gM(function(e,t){var r=e.styles,n=Ay([r],void 0,f.useContext(Wg)),o=f.useRef();return b1(function(){var i=t.key+"-global",a=new t.sheet.constructor({key:i,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,c=document.querySelector('style[data-emotion="'+i+" "+n.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),c!==null&&(l=!0,c.setAttribute("data-emotion",i),a.hydrate([c])),o.current=[a,l],function(){a.flush()}},[t]),b1(function(){var i=o.current,a=i[0],l=i[1];if(l){i[1]=!1;return}if(n.next!==void 0&&xE(t,n.next,!0),a.tags.length){var c=a.tags[a.tags.length-1].nextElementSibling;a.before=c,a.flush()}t.insert("",n,a,!1)},[t,n.name]),null});function wM(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ay(t)}var _M=Object.defineProperty,bM=Object.defineProperties,SM=Object.getOwnPropertyDescriptors,S1=Object.getOwnPropertySymbols,PM=Object.prototype.hasOwnProperty,jM=Object.prototype.propertyIsEnumerable,P1=(e,t,r)=>t in e?_M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OM=(e,t)=>{for(var r in t||(t={}))PM.call(t,r)&&P1(e,r,t[r]);if(S1)for(var r of S1(t))jM.call(t,r)&&P1(e,r,t[r]);return e},CM=(e,t)=>bM(e,SM(t));function EM({theme:e}){return S.createElement(hc,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:CM(OM({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function Vs(e,t,r,n=j){Object.keys(t).forEach(o=>{e[`--mantine-${r}-${o}`]=n(t[o])})}function $M({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":`${e.headings.fontWeight}`};Vs(t,e.shadows,"shadow"),Vs(t,e.fontSizes,"font-size"),Vs(t,e.radius,"radius"),Vs(t,e.spacing,"spacing"),Vs(t,e.breakpoints,"breakpoints",ir),Object.keys(e.colors).forEach(n=>{e.colors[n].forEach((o,i)=>{t[`--mantine-color-${n}-${i}`]=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(hc,{styles:{":root":t}})}var kM=Object.defineProperty,RM=Object.defineProperties,TM=Object.getOwnPropertyDescriptors,j1=Object.getOwnPropertySymbols,IM=Object.prototype.hasOwnProperty,DM=Object.prototype.propertyIsEnumerable,O1=(e,t,r)=>t in e?kM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mn=(e,t)=>{for(var r in t||(t={}))IM.call(t,r)&&O1(e,r,t[r]);if(j1)for(var r of j1(t))DM.call(t,r)&&O1(e,r,t[r]);return e},km=(e,t)=>RM(e,TM(t));function NM(e,t){var r;if(!t)return e;const n=Object.keys(e).reduce((o,i)=>{if(i==="headings"&&t.headings){const a=t.headings.sizes?Object.keys(e.headings.sizes).reduce((l,c)=>(l[c]=Mn(Mn({},e.headings.sizes[c]),t.headings.sizes[c]),l),{}):e.headings.sizes;return km(Mn({},o),{headings:km(Mn(Mn({},e.headings),t.headings),{sizes:a})})}if(i==="breakpoints"&&t.breakpoints){const a=Mn(Mn({},e.breakpoints),t.breakpoints);return km(Mn({},o),{breakpoints:Object.fromEntries(Object.entries(a).sort((l,c)=>pr(l[1])-pr(c[1])))})}return o[i]=typeof t[i]=="object"?Mn(Mn({},e[i]),t[i]):typeof t[i]=="number"||typeof t[i]=="boolean"||typeof t[i]=="function"?t[i]:t[i]||e[i],o},{});if(t!=null&&t.fontFamily&&!((r=t==null?void 0:t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function AM(e,t){return iE(NM(e,t))}function bE(e){return Object.keys(e).reduce((t,r)=>(e[r]!==void 0&&(t[r]=e[r]),t),{})}const MM={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${j(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function LM(){return S.createElement(hc,{styles:MM})}var zM=Object.defineProperty,C1=Object.getOwnPropertySymbols,FM=Object.prototype.hasOwnProperty,VM=Object.prototype.propertyIsEnumerable,E1=(e,t,r)=>t in e?zM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_l=(e,t)=>{for(var r in t||(t={}))FM.call(t,r)&&E1(e,r,t[r]);if(C1)for(var r of C1(t))VM.call(t,r)&&E1(e,r,t[r]);return e};const md=f.createContext({theme:$y});function Jt(){var e;return((e=f.useContext(md))==null?void 0:e.theme)||$y}function BM(e){const t=Jt(),r=n=>{var o,i,a,l;return{styles:((o=t.components[n])==null?void 0:o.styles)||{},classNames:((i=t.components[n])==null?void 0:i.classNames)||{},variants:(a=t.components[n])==null?void 0:a.variants,sizes:(l=t.components[n])==null?void 0:l.sizes}};return Array.isArray(e)?e.map(r):[r(e)]}function SE(){var e;return(e=f.useContext(md))==null?void 0:e.emotionCache}function H(e,t,r){var n;const o=Jt(),i=(n=o.components[e])==null?void 0:n.defaultProps,a=typeof i=="function"?i(o):i;return _l(_l(_l({},t),a),bE(r))}function PE({theme:e,emotionCache:t,withNormalizeCSS:r=!1,withGlobalStyles:n=!1,withCSSVariables:o=!1,inherit:i=!1,children:a}){const l=f.useContext(md),c=AM($y,i?_l(_l({},l.theme),e):e);return S.createElement(xM,{theme:c},S.createElement(md.Provider,{value:{theme:c,emotionCache:t}},r&&S.createElement(LM,null),n&&S.createElement(EM,{theme:c}),o&&S.createElement($M,{theme:c}),typeof c.globalStyles=="function"&&S.createElement(hc,{styles:c.globalStyles(c)}),a))}PE.displayName="@mantine/core/MantineProvider";const UM={app:100,modal:200,popover:300,overlay:400,max:9999};function Cn(e){return UM[e]}function WM(e,t){const r=f.useRef();return(!r.current||t.length!==r.current.prevDeps.length||r.current.prevDeps.map((n,o)=>n===t[o]).indexOf(!1)>=0)&&(r.current={v:e(),prevDeps:[...t]}),r.current.v}const HM=hE({key:"mantine",prepend:!0});function GM(){return SE()||HM}var qM=Object.defineProperty,$1=Object.getOwnPropertySymbols,QM=Object.prototype.hasOwnProperty,KM=Object.prototype.propertyIsEnumerable,k1=(e,t,r)=>t in e?qM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YM=(e,t)=>{for(var r in t||(t={}))QM.call(t,r)&&k1(e,r,t[r]);if($1)for(var r of $1(t))KM.call(t,r)&&k1(e,r,t[r]);return e};const Rm="ref";function XM(e){let t;if(e.length!==1)return{args:e,ref:t};const[r]=e;if(!(r instanceof Object))return{args:e,ref:t};if(!(Rm in r))return{args:e,ref:t};t=r[Rm];const n=YM({},r);return delete n[Rm],{args:[n],ref:t}}const{cssFactory:JM}=(()=>{function e(r,n,o){const i=[],a=lM(r,i,o);return i.length<2?o:a+n(i)}function t(r){const{cache:n}=r,o=(...a)=>{const{ref:l,args:c}=XM(a),u=Ay(c,n.registered);return xE(n,u,!1),`${n.key}-${u.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...a)=>e(n.registered,o,tE(a))}}return{cssFactory:t}})();function jE(){const e=GM();return WM(()=>JM({cache:e}),[e])}function ZM({cx:e,classes:t,context:r,classNames:n,name:o,cache:i}){const a=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],a[c],n!=null&&n[c],Array.isArray(o)?o.filter(Boolean).map(u=>`${(i==null?void 0:i.key)||"mantine"}-${u}-${c}`).join(" "):o?`${(i==null?void 0:i.key)||"mantine"}-${o}-${c}`:null),l),{})}var eL=Object.defineProperty,R1=Object.getOwnPropertySymbols,tL=Object.prototype.hasOwnProperty,rL=Object.prototype.propertyIsEnumerable,T1=(e,t,r)=>t in e?eL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tm=(e,t)=>{for(var r in t||(t={}))tL.call(t,r)&&T1(e,r,t[r]);if(R1)for(var r of R1(t))rL.call(t,r)&&T1(e,r,t[r]);return e};function Hg(e,t){return t&&Object.keys(t).forEach(r=>{e[r]?e[r]=Tm(Tm({},e[r]),t[r]):e[r]=Tm({},t[r])}),e}function I1(e,t,r,n){const o=i=>typeof i=="function"?i(t,r||{},n):i||{};return Array.isArray(e)?e.map(i=>o(i.styles)).reduce((i,a)=>Hg(i,a),{}):o(e)}function nL({ctx:e,theme:t,params:r,variant:n,size:o}){return e.reduce((i,a)=>(a.variants&&n in a.variants&&Hg(i,a.variants[n](t,r,{variant:n,size:o})),a.sizes&&o in a.sizes&&Hg(i,a.sizes[o](t,r,{variant:n,size:o})),i),{})}function W(e){const t=typeof e=="function"?e:()=>e;function r(n,o){const i=Jt(),a=BM(o==null?void 0:o.name),l=SE(),c={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:u,cx:d}=jE(),p=t(i,n,c),h=I1(o==null?void 0:o.styles,i,n,c),m=I1(a,i,n,c),v=nL({ctx:a,theme:i,params:n,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),g=Object.fromEntries(Object.keys(p).map(b=>{const y=d({[u(p[b])]:!(o!=null&&o.unstyled)},u(v[b]),u(m[b]),u(h[b]));return[b,y]}));return{classes:ZM({cx:d,classes:g,context:a,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:d,theme:i}}return r}function Vt(e){return`___ref-${e||""}`}function OE({styles:e}){const t=Jt();return S.createElement(hc,{styles:wM(typeof e=="function"?e(t):e)})}var oL=Object.defineProperty,iL=Object.defineProperties,aL=Object.getOwnPropertyDescriptors,D1=Object.getOwnPropertySymbols,sL=Object.prototype.hasOwnProperty,lL=Object.prototype.propertyIsEnumerable,N1=(e,t,r)=>t in e?oL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bs=(e,t)=>{for(var r in t||(t={}))sL.call(t,r)&&N1(e,r,t[r]);if(D1)for(var r of D1(t))lL.call(t,r)&&N1(e,r,t[r]);return e},Us=(e,t)=>iL(e,aL(t));const Ws={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${j(10)})`},transitionProperty:"transform, opacity"},Kc={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(-${j(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(${j(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(${j(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${j(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:Us(Bs({},Ws),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Us(Bs({},Ws),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Us(Bs({},Ws),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Us(Bs({},Ws),{common:{transformOrigin:"top left"}}),"pop-top-right":Us(Bs({},Ws),{common:{transformOrigin:"top right"}})},A1=["mousedown","touchstart"];function cL(e,t,r){const n=f.useRef();return f.useEffect(()=>{const o=i=>{const{target:a}=i??{};if(Array.isArray(r)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else n.current&&!n.current.contains(a)&&e()};return(t||A1).forEach(i=>document.addEventListener(i,o)),()=>{(t||A1).forEach(i=>document.removeEventListener(i,o))}},[n,e,r]),n}function uL({timeout:e=2e3}={}){const[t,r]=f.useState(null),[n,o]=f.useState(!1),[i,a]=f.useState(null),l=d=>{clearTimeout(i),a(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(i)},error:t,copied:n}}function dL(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function fL(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function pL(e,t,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[n,o]=f.useState(r?t:fL(e,t)),i=f.useRef();return f.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),dL(i.current,a=>o(a.matches))},[e]),n}const CE=typeof document<"u"?f.useLayoutEffect:f.useEffect;function rn(e,t){const r=f.useRef(!1);f.useEffect(()=>()=>{r.current=!1},[]),f.useEffect(()=>{if(r.current)return e();r.current=!0},t)}function EE({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 rn(()=>{let o=-1;const i=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?r.current=document.activeElement:t&&(o=window.setTimeout(n,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),n}const hL=/input|select|textarea|button|object/,$E="a, input, select, textarea, button, object, [tabindex]";function mL(e){return e.style.display==="none"}function gL(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(mL(r))return!1;r=r.parentNode}return!0}function kE(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Gg(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(kE(e));return(hL.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&gL(e)}function RE(e){const t=kE(e);return(Number.isNaN(t)||t>=0)&&Gg(e)}function vL(e){return Array.from(e.querySelectorAll($E)).filter(RE)}function yL(e,t){const r=vL(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();if(!(n===o.activeElement||e===o.activeElement))return;t.preventDefault();const a=r[t.shiftKey?r.length-1:0];a&&a.focus()}function kh(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function xL(e,t="body > :not(script)"){const r=kh(),n=Array.from(document.querySelectorAll(t)).map(o=>{var i;if((i=o==null?void 0:o.shadowRoot)!=null&&i.contains(e)||o.contains(e))return;const a=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",r),a===null||a==="false"?o.setAttribute("aria-hidden","true"):!l&&!c&&o.setAttribute("data-hidden",a),{node:o,ariaHidden:l||null}});return()=>{n.forEach(o=>{!o||r!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function wL(e=!0){const t=f.useRef(),r=f.useRef(null),n=i=>{let a=i.querySelector("[data-autofocus]");if(!a){const l=Array.from(i.querySelectorAll($E));a=l.find(RE)||l.find(Gg)||null,!a&&Gg(i)&&(a=i)}a&&a.focus({preventScroll:!0})},o=f.useCallback(i=>{if(e){if(i===null){r.current&&(r.current(),r.current=null);return}r.current=xL(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)}},[e]);return f.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=a=>{a.key==="Tab"&&t.current&&yL(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),r.current&&r.current()}},[e]),o}const _L=e=>(e+1)%1e6;function bL(){const[,e]=f.useReducer(_L,0);return e}const SL=S["useId".toString()]||(()=>{});function PL(){const e=SL();return e?`mantine-${e.replace(/:/g,"")}`:""}function Rr(e){const t=PL(),[r,n]=f.useState(t);return CE(()=>{n(kh())},[]),typeof e=="string"?e:typeof window>"u"?t:r}function qg(e,t,r){f.useEffect(()=>(window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)),[e,t])}function TE(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function jL(...e){return t=>{e.forEach(r=>TE(r,t))}}function Es(...e){return f.useCallback(jL(...e),e)}function $r({value:e,defaultValue:t,finalValue:r,onChange:n=()=>{}}){const[o,i]=f.useState(t!==void 0?t:r),a=l=>{i(l),n==null||n(l)};return e!==void 0?[e,n,!0]:[o,a,!1]}function Bo(e,t){const r=t-e+1;return Array.from({length:r},(n,o)=>o+e)}const Yc="dots";function OL({total:e,siblings:t=1,boundaries:r=1,page:n,initialPage:o=1,onChange:i}){const a=Math.max(Math.trunc(e),0),[l,c]=$r({value:n,onChange:i,defaultValue:o,finalValue:o}),u=g=>{g<=0?c(1):g>a?c(a):c(g)},d=()=>u(l+1),p=()=>u(l-1),h=()=>u(1),m=()=>u(a);return{range:f.useMemo(()=>{if(t*2+3+r*2>=a)return Bo(1,a);const b=Math.max(l-t,r),y=Math.min(l+t,a-r),x=b>r+2,_=y<a-(r+1);if(!x&&_){const w=t*2+r+2;return[...Bo(1,w),Yc,...Bo(a-(r-1),a)]}if(x&&!_){const w=r+1+2*t;return[...Bo(1,r),Yc,...Bo(a-w,a)]}return[...Bo(1,r),Yc,...Bo(b,y),Yc,...Bo(a-r+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:p,first:h,last:m}}function CL({initialValues:e=[],limit:t}){const[{state:r,queue:n},o]=f.useState({state:e.slice(0,t),queue:e.slice(t)});return{state:r,queue:n,add:(...c)=>o(u=>{const d=[...u.state,...u.queue,...c];return{state:d.slice(0,t),queue:d.slice(t)}}),update:c=>o(u=>{const d=c([...u.state,...u.queue]);return{state:d.slice(0,t),queue:d.slice(t)}}),cleanQueue:()=>o(c=>({state:c.state,queue:[]}))}}function Rh(e,t){return pL("(prefers-reduced-motion: reduce)",e,t)}const EL=e=>e<.5?2*e*e:-1+(4-2*e)*e,$L=({axis:e,target:t,parent:r,alignment:n,offset:o,isList:i})=>{if(!t||!r&&typeof document>"u")return 0;const a=!!r,c=(r||document.body).getBoundingClientRect(),u=t.getBoundingClientRect(),d=p=>u[p]-c[p];if(e==="y"){const p=d("top");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.height*(i?0:1)||!i?m:0}const h=a?c.height:window.innerHeight;if(n==="end"){const m=p+o-h+u.height;return m>=-u.height*(i?0:1)||!i?m:0}return n==="center"?p-h/2+u.height/2:0}if(e==="x"){const p=d("left");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.width||!i?m:0}const h=a?c.width:window.innerWidth;if(n==="end"){const m=p+o-h+u.width;return m>=-u.width||!i?m:0}return n==="center"?p-h/2+u.width/2:0}return 0},kL=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const r=e==="y"?"scrollTop":"scrollLeft";if(t)return t[r];const{body:n,documentElement:o}=document;return n[r]+o[r]},RL=({axis:e,parent:t,distance:r})=>{if(!t&&typeof document>"u")return;const n=e==="y"?"scrollTop":"scrollLeft";if(t)t[n]=r;else{const{body:o,documentElement:i}=document;o[n]=r,i[n]=r}};function TL({duration:e=1250,axis:t="y",onScrollFinish:r,easing:n=EL,offset:o=0,cancelable:i=!0,isList:a=!1}={}){const l=f.useRef(0),c=f.useRef(0),u=f.useRef(!1),d=f.useRef(null),p=f.useRef(null),h=Rh(),m=()=>{l.current&&cancelAnimationFrame(l.current)},v=f.useCallback(({alignment:b="start"}={})=>{var y;u.current=!1,l.current&&m();const x=(y=kL({parent:d.current,axis:t}))!=null?y:0,_=$L({parent:d.current,target:p.current,axis:t,alignment:b,offset:o,isList:a})-(d.current?0:x);function w(){c.current===0&&(c.current=performance.now());const C=performance.now()-c.current,P=h||e===0?1:C/e,E=x+_*n(P);RL({parent:d.current,axis:t,distance:E}),!u.current&&P<1?l.current=requestAnimationFrame(w):(typeof r=="function"&&r(),c.current=0,l.current=0,m())}w()},[t,e,n,a,o,r,h]),g=()=>{i&&(u.current=!0)};return qg("wheel",g,{passive:!0}),qg("touchmove",g,{passive:!0}),f.useEffect(()=>m,[]),{scrollableRef:d,targetRef:p,scrollIntoView:v,cancel:m}}function IL(e=!1,t){const{onOpen:r,onClose:n}=t||{},[o,i]=f.useState(e),a=f.useCallback(()=>{i(u=>u||(r==null||r(),!0))},[r]),l=f.useCallback(()=>{i(u=>u&&(n==null||n(),!1))},[n]),c=f.useCallback(()=>{o?l():a()},[l,a,o]);return[o,{open:a,close:l,toggle:c}]}function M1(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var L1=Object.getOwnPropertySymbols,DL=Object.prototype.hasOwnProperty,NL=Object.prototype.propertyIsEnumerable,AL=(e,t)=>{var r={};for(var n in e)DL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&L1)for(var n of L1(e))t.indexOf(n)<0&&NL.call(e,n)&&(r[n]=e[n]);return r};function eo(e){const t=e,{m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:b,c:y,opacity:x,ff:_,fz:w,fw:O,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:T,miw:z,maw:M,h:L,mih:q,mah:Y,bgsz:R,bgp:N,bgr:V,bga:Q,pos:ee,top:_e,left:we,bottom:Ue,right:Ae,inset:pt,display:Dt}=t,Pe=AL(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:bE({m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:b,c:y,opacity:x,ff:_,fz:w,fw:O,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:T,miw:z,maw:M,h:L,mih:q,mah:Y,bgsz:R,bgp:N,bgr:V,bga:Q,pos:ee,top:_e,left:we,bottom:Ue,right:Ae,inset:pt,display:Dt}),rest:Pe}}function ML(e,t){const r=Object.keys(e).filter(n=>n!=="base").sort((n,o)=>pr(A({size:n,sizes:t.breakpoints}))-pr(A({size:o,sizes:t.breakpoints})));return"base"in e?["base",...r]:r}function LL({value:e,theme:t,getValue:r,property:n}){if(e==null)return;if(typeof e=="object")return ML(e,t).reduce((a,l)=>{if(l==="base"&&e.base!==void 0){const u=r(e.base,t);return Array.isArray(n)?(n.forEach(d=>{a[d]=u}),a):(a[n]=u,a)}const c=r(e[l],t);return Array.isArray(n)?(a[t.fn.largerThan(l)]={},n.forEach(u=>{a[t.fn.largerThan(l)][u]=c}),a):(a[t.fn.largerThan(l)]={[n]:c},a)},{});const o=r(e,t);return Array.isArray(n)?n.reduce((i,a)=>(i[a]=o,i),{}):{[n]:o}}function zL(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function FL(e){return j(e)}function VL(e){return e}function BL(e,t){return A({size:e,sizes:t.fontSizes})}const UL=["-xs","-sm","-md","-lg","-xl"];function WL(e,t){return UL.includes(e)?`calc(${A({size:e.replace("-",""),sizes:t.spacing})} * -1)`:A({size:e,sizes:t.spacing})}const HL={identity:VL,color:zL,size:FL,fontSize:BL,spacing:WL},GL={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 qL=Object.defineProperty,z1=Object.getOwnPropertySymbols,QL=Object.prototype.hasOwnProperty,KL=Object.prototype.propertyIsEnumerable,F1=(e,t,r)=>t in e?qL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V1=(e,t)=>{for(var r in t||(t={}))QL.call(t,r)&&F1(e,r,t[r]);if(z1)for(var r of z1(t))KL.call(t,r)&&F1(e,r,t[r]);return e};function Qg(e,t,r=GL){return Object.keys(r).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push(LL({value:e[i],getValue:HL[r[i].type],property:r[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(a=>{typeof i[a]=="object"&&i[a]!==null&&a in o?o[a]=V1(V1({},o[a]),i[a]):o[a]=i[a]}),o),{})}function B1(e,t){return typeof e=="function"?e(t):e}function YL(e,t,r){const n=Jt(),{css:o,cx:i}=jE();return Array.isArray(e)?i(r,o(Qg(t,n)),e.map(a=>o(B1(a,n)))):i(r,o(B1(e,n)),o(Qg(t,n)))}var XL=Object.defineProperty,gd=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,DE=Object.prototype.propertyIsEnumerable,U1=(e,t,r)=>t in e?XL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,JL=(e,t)=>{for(var r in t||(t={}))IE.call(t,r)&&U1(e,r,t[r]);if(gd)for(var r of gd(t))DE.call(t,r)&&U1(e,r,t[r]);return e},ZL=(e,t)=>{var r={};for(var n in e)IE.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&&DE.call(e,n)&&(r[n]=e[n]);return r};const NE=f.forwardRef((e,t)=>{var r=e,{className:n,component:o,style:i,sx:a}=r,l=ZL(r,["className","component","style","sx"]);const{systemStyles:c,rest:u}=eo(l),d=o||"div";return S.createElement(d,JL({ref:t,className:YL(a,c,n),style:i},u))});NE.displayName="@mantine/core/Box";const oe=NE;var e6=Object.defineProperty,t6=Object.defineProperties,r6=Object.getOwnPropertyDescriptors,W1=Object.getOwnPropertySymbols,n6=Object.prototype.hasOwnProperty,o6=Object.prototype.propertyIsEnumerable,H1=(e,t,r)=>t in e?e6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G1=(e,t)=>{for(var r in t||(t={}))n6.call(t,r)&&H1(e,r,t[r]);if(W1)for(var r of W1(t))o6.call(t,r)&&H1(e,r,t[r]);return e},i6=(e,t)=>t6(e,r6(t)),a6=W(e=>({root:i6(G1(G1({},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 s6=a6;var l6=Object.defineProperty,vd=Object.getOwnPropertySymbols,AE=Object.prototype.hasOwnProperty,ME=Object.prototype.propertyIsEnumerable,q1=(e,t,r)=>t in e?l6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c6=(e,t)=>{for(var r in t||(t={}))AE.call(t,r)&&q1(e,r,t[r]);if(vd)for(var r of vd(t))ME.call(t,r)&&q1(e,r,t[r]);return e},u6=(e,t)=>{var r={};for(var n in e)AE.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&&ME.call(e,n)&&(r[n]=e[n]);return r};const LE=f.forwardRef((e,t)=>{const r=H("UnstyledButton",{},e),{className:n,component:o="button",unstyled:i,variant:a}=r,l=u6(r,["className","component","unstyled","variant"]),{classes:c,cx:u}=s6(null,{name:"UnstyledButton",unstyled:i,variant:a});return S.createElement(oe,c6({component:o,ref:t,className:u(c.root,n),type:o==="button"?"button":void 0},l))});LE.displayName="@mantine/core/UnstyledButton";const wo=LE;var zE={exports:{}},Wr={},FE={exports:{}},VE={};/**
64
+ */var Wt=typeof Symbol=="function"&&Symbol.for,Iy=Wt?Symbol.for("react.element"):60103,Dy=Wt?Symbol.for("react.portal"):60106,wh=Wt?Symbol.for("react.fragment"):60107,_h=Wt?Symbol.for("react.strict_mode"):60108,bh=Wt?Symbol.for("react.profiler"):60114,Sh=Wt?Symbol.for("react.provider"):60109,Ph=Wt?Symbol.for("react.context"):60110,Ny=Wt?Symbol.for("react.async_mode"):60111,jh=Wt?Symbol.for("react.concurrent_mode"):60111,Oh=Wt?Symbol.for("react.forward_ref"):60112,Ch=Wt?Symbol.for("react.suspense"):60113,ZM=Wt?Symbol.for("react.suspense_list"):60120,Eh=Wt?Symbol.for("react.memo"):60115,$h=Wt?Symbol.for("react.lazy"):60116,e9=Wt?Symbol.for("react.block"):60121,t9=Wt?Symbol.for("react.fundamental"):60117,r9=Wt?Symbol.for("react.responder"):60118,n9=Wt?Symbol.for("react.scope"):60119;function Ur(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Iy:switch(e=e.type,e){case Ny:case jh:case wh:case bh:case _h:case Ch:return e;default:switch(e=e&&e.$$typeof,e){case Ph:case Oh:case $h:case Eh:case Sh:return e;default:return t}}case Dy:return t}}}function gE(e){return Ur(e)===jh}qe.AsyncMode=Ny;qe.ConcurrentMode=jh;qe.ContextConsumer=Ph;qe.ContextProvider=Sh;qe.Element=Iy;qe.ForwardRef=Oh;qe.Fragment=wh;qe.Lazy=$h;qe.Memo=Eh;qe.Portal=Dy;qe.Profiler=bh;qe.StrictMode=_h;qe.Suspense=Ch;qe.isAsyncMode=function(e){return gE(e)||Ur(e)===Ny};qe.isConcurrentMode=gE;qe.isContextConsumer=function(e){return Ur(e)===Ph};qe.isContextProvider=function(e){return Ur(e)===Sh};qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Iy};qe.isForwardRef=function(e){return Ur(e)===Oh};qe.isFragment=function(e){return Ur(e)===wh};qe.isLazy=function(e){return Ur(e)===$h};qe.isMemo=function(e){return Ur(e)===Eh};qe.isPortal=function(e){return Ur(e)===Dy};qe.isProfiler=function(e){return Ur(e)===bh};qe.isStrictMode=function(e){return Ur(e)===_h};qe.isSuspense=function(e){return Ur(e)===Ch};qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wh||e===jh||e===bh||e===_h||e===Ch||e===ZM||typeof e=="object"&&e!==null&&(e.$$typeof===$h||e.$$typeof===Eh||e.$$typeof===Sh||e.$$typeof===Ph||e.$$typeof===Oh||e.$$typeof===t9||e.$$typeof===r9||e.$$typeof===n9||e.$$typeof===e9)};qe.typeOf=Ur;mE.exports=qe;var o9=mE.exports,vE=o9,i9={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a9={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},yE={};yE[vE.ForwardRef]=i9;yE[vE.Memo]=a9;var s9=!0;function l9(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):n+=o+" "}),n}var c9=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||s9===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},xE=function(t,r,n){c9(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+o:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function u9(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 d9={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},f9=/[A-Z]|^ms/g,p9=/_EMO_([^_]+?)_([^]*?)_EMO_/g,wE=function(t){return t.charCodeAt(1)===45},x1=function(t){return t!=null&&typeof t!="boolean"},$m=HM(function(e){return wE(e)?e:e.replace(f9,"-$&").toLowerCase()}),w1=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(p9,function(n,o,i){return Wn={name:o,styles:i,next:Wn},o})}return d9[t]!==1&&!wE(t)&&typeof r=="number"&&r!==0?r+"px":r};function zl(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 Wn={name:r.name,styles:r.styles,next:Wn},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)Wn={name:n.name,styles:n.styles,next:Wn},n=n.next;var o=r.styles+";";return o}return h9(e,t,r)}case"function":{if(e!==void 0){var i=Wn,a=r(e);return Wn=i,zl(e,t,a)}break}}if(t==null)return r;var l=t[r];return l!==void 0?l:r}function h9(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=zl(e,t,r[o])+";";else for(var i in r){var a=r[i];if(typeof a!="object")t!=null&&t[a]!==void 0?n+=i+"{"+t[a]+"}":x1(a)&&(n+=$m(i)+":"+w1(i,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)x1(a[l])&&(n+=$m(i)+":"+w1(i,a[l])+";");else{var c=zl(e,t,a);switch(i){case"animation":case"animationName":{n+=$m(i)+":"+c+";";break}default:n+=i+"{"+c+"}"}}}return n}var _1=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Wn,Ay=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,i="";Wn=void 0;var a=t[0];a==null||a.raw===void 0?(o=!1,i+=zl(n,r,a)):i+=a[0];for(var l=1;l<t.length;l++)i+=zl(n,r,t[l]),o&&(i+=a[l]);_1.lastIndex=0;for(var c="",u;(u=_1.exec(i))!==null;)c+="-"+u[1];var d=u9(i)+c;return{name:d,styles:i,next:Wn}},m9=Al["useInsertionEffect"]?Al["useInsertionEffect"]:!1,b1=m9||f.useLayoutEffect,_E=f.createContext(typeof HTMLElement<"u"?hE({key:"css"}):null);_E.Provider;var g9=function(t){return f.forwardRef(function(r,n){var o=f.useContext(_E);return t(r,o,n)})},Wg=f.createContext({}),v9=function(t,r){if(typeof r=="function"){var n=r(t);return n}return rt({},t,r)},y9=v1(function(e){return v1(function(t){return v9(e,t)})}),x9=function(t){var r=f.useContext(Wg);return t.theme!==r&&(r=y9(r)(t.theme)),f.createElement(Wg.Provider,{value:r},t.children)},hc=g9(function(e,t){var r=e.styles,n=Ay([r],void 0,f.useContext(Wg)),o=f.useRef();return b1(function(){var i=t.key+"-global",a=new t.sheet.constructor({key:i,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,c=document.querySelector('style[data-emotion="'+i+" "+n.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),c!==null&&(l=!0,c.setAttribute("data-emotion",i),a.hydrate([c])),o.current=[a,l],function(){a.flush()}},[t]),b1(function(){var i=o.current,a=i[0],l=i[1];if(l){i[1]=!1;return}if(n.next!==void 0&&xE(t,n.next,!0),a.tags.length){var c=a.tags[a.tags.length-1].nextElementSibling;a.before=c,a.flush()}t.insert("",n,a,!1)},[t,n.name]),null});function w9(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ay(t)}var _9=Object.defineProperty,b9=Object.defineProperties,S9=Object.getOwnPropertyDescriptors,S1=Object.getOwnPropertySymbols,P9=Object.prototype.hasOwnProperty,j9=Object.prototype.propertyIsEnumerable,P1=(e,t,r)=>t in e?_9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O9=(e,t)=>{for(var r in t||(t={}))P9.call(t,r)&&P1(e,r,t[r]);if(S1)for(var r of S1(t))j9.call(t,r)&&P1(e,r,t[r]);return e},C9=(e,t)=>b9(e,S9(t));function E9({theme:e}){return S.createElement(hc,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:C9(O9({},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 Vs(e,t,r,n=j){Object.keys(t).forEach(o=>{e[`--mantine-${r}-${o}`]=n(t[o])})}function $9({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}`};Vs(t,e.shadows,"shadow"),Vs(t,e.fontSizes,"font-size"),Vs(t,e.radius,"radius"),Vs(t,e.spacing,"spacing"),Vs(t,e.breakpoints,"breakpoints",ir),Object.keys(e.colors).forEach(n=>{e.colors[n].forEach((o,i)=>{t[`--mantine-color-${n}-${i}`]=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(hc,{styles:{":root":t}})}var k9=Object.defineProperty,R9=Object.defineProperties,T9=Object.getOwnPropertyDescriptors,j1=Object.getOwnPropertySymbols,I9=Object.prototype.hasOwnProperty,D9=Object.prototype.propertyIsEnumerable,O1=(e,t,r)=>t in e?k9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mn=(e,t)=>{for(var r in t||(t={}))I9.call(t,r)&&O1(e,r,t[r]);if(j1)for(var r of j1(t))D9.call(t,r)&&O1(e,r,t[r]);return e},km=(e,t)=>R9(e,T9(t));function N9(e,t){var r;if(!t)return e;const n=Object.keys(e).reduce((o,i)=>{if(i==="headings"&&t.headings){const a=t.headings.sizes?Object.keys(e.headings.sizes).reduce((l,c)=>(l[c]=Mn(Mn({},e.headings.sizes[c]),t.headings.sizes[c]),l),{}):e.headings.sizes;return km(Mn({},o),{headings:km(Mn(Mn({},e.headings),t.headings),{sizes:a})})}if(i==="breakpoints"&&t.breakpoints){const a=Mn(Mn({},e.breakpoints),t.breakpoints);return km(Mn({},o),{breakpoints:Object.fromEntries(Object.entries(a).sort((l,c)=>pr(l[1])-pr(c[1])))})}return o[i]=typeof t[i]=="object"?Mn(Mn({},e[i]),t[i]):typeof t[i]=="number"||typeof t[i]=="boolean"||typeof t[i]=="function"?t[i]:t[i]||e[i],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 A9(e,t){return iE(N9(e,t))}function bE(e){return Object.keys(e).reduce((t,r)=>(e[r]!==void 0&&(t[r]=e[r]),t),{})}const M9={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:`${j(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 L9(){return S.createElement(hc,{styles:M9})}var z9=Object.defineProperty,C1=Object.getOwnPropertySymbols,F9=Object.prototype.hasOwnProperty,V9=Object.prototype.propertyIsEnumerable,E1=(e,t,r)=>t in e?z9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_l=(e,t)=>{for(var r in t||(t={}))F9.call(t,r)&&E1(e,r,t[r]);if(C1)for(var r of C1(t))V9.call(t,r)&&E1(e,r,t[r]);return e};const md=f.createContext({theme:$y});function Jt(){var e;return((e=f.useContext(md))==null?void 0:e.theme)||$y}function B9(e){const t=Jt(),r=n=>{var o,i,a,l;return{styles:((o=t.components[n])==null?void 0:o.styles)||{},classNames:((i=t.components[n])==null?void 0:i.classNames)||{},variants:(a=t.components[n])==null?void 0:a.variants,sizes:(l=t.components[n])==null?void 0:l.sizes}};return Array.isArray(e)?e.map(r):[r(e)]}function SE(){var e;return(e=f.useContext(md))==null?void 0:e.emotionCache}function H(e,t,r){var n;const o=Jt(),i=(n=o.components[e])==null?void 0:n.defaultProps,a=typeof i=="function"?i(o):i;return _l(_l(_l({},t),a),bE(r))}function PE({theme:e,emotionCache:t,withNormalizeCSS:r=!1,withGlobalStyles:n=!1,withCSSVariables:o=!1,inherit:i=!1,children:a}){const l=f.useContext(md),c=A9($y,i?_l(_l({},l.theme),e):e);return S.createElement(x9,{theme:c},S.createElement(md.Provider,{value:{theme:c,emotionCache:t}},r&&S.createElement(L9,null),n&&S.createElement(E9,{theme:c}),o&&S.createElement($9,{theme:c}),typeof c.globalStyles=="function"&&S.createElement(hc,{styles:c.globalStyles(c)}),a))}PE.displayName="@mantine/core/MantineProvider";const U9={app:100,modal:200,popover:300,overlay:400,max:9999};function Cn(e){return U9[e]}function W9(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 H9=hE({key:"mantine",prepend:!0});function G9(){return SE()||H9}var q9=Object.defineProperty,$1=Object.getOwnPropertySymbols,Q9=Object.prototype.hasOwnProperty,K9=Object.prototype.propertyIsEnumerable,k1=(e,t,r)=>t in e?q9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y9=(e,t)=>{for(var r in t||(t={}))Q9.call(t,r)&&k1(e,r,t[r]);if($1)for(var r of $1(t))K9.call(t,r)&&k1(e,r,t[r]);return e};const Rm="ref";function X9(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(!(Rm in r))return{args:e,ref:t};t=r[Rm];const n=Y9({},r);return delete n[Rm],{args:[n],ref:t}}const{cssFactory:J9}=(()=>{function e(r,n,o){const i=[],a=l9(r,i,o);return i.length<2?o:a+n(i)}function t(r){const{cache:n}=r,o=(...a)=>{const{ref:l,args:c}=X9(a),u=Ay(c,n.registered);return xE(n,u,!1),`${n.key}-${u.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...a)=>e(n.registered,o,tE(a))}}return{cssFactory:t}})();function jE(){const e=G9();return W9(()=>J9({cache:e}),[e])}function Z9({cx:e,classes:t,context:r,classNames:n,name:o,cache:i}){const a=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],a[c],n!=null&&n[c],Array.isArray(o)?o.filter(Boolean).map(u=>`${(i==null?void 0:i.key)||"mantine"}-${u}-${c}`).join(" "):o?`${(i==null?void 0:i.key)||"mantine"}-${o}-${c}`:null),l),{})}var eL=Object.defineProperty,R1=Object.getOwnPropertySymbols,tL=Object.prototype.hasOwnProperty,rL=Object.prototype.propertyIsEnumerable,T1=(e,t,r)=>t in e?eL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tm=(e,t)=>{for(var r in t||(t={}))tL.call(t,r)&&T1(e,r,t[r]);if(R1)for(var r of R1(t))rL.call(t,r)&&T1(e,r,t[r]);return e};function Hg(e,t){return t&&Object.keys(t).forEach(r=>{e[r]?e[r]=Tm(Tm({},e[r]),t[r]):e[r]=Tm({},t[r])}),e}function I1(e,t,r,n){const o=i=>typeof i=="function"?i(t,r||{},n):i||{};return Array.isArray(e)?e.map(i=>o(i.styles)).reduce((i,a)=>Hg(i,a),{}):o(e)}function nL({ctx:e,theme:t,params:r,variant:n,size:o}){return e.reduce((i,a)=>(a.variants&&n in a.variants&&Hg(i,a.variants[n](t,r,{variant:n,size:o})),a.sizes&&o in a.sizes&&Hg(i,a.sizes[o](t,r,{variant:n,size:o})),i),{})}function W(e){const t=typeof e=="function"?e:()=>e;function r(n,o){const i=Jt(),a=B9(o==null?void 0:o.name),l=SE(),c={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:u,cx:d}=jE(),p=t(i,n,c),h=I1(o==null?void 0:o.styles,i,n,c),m=I1(a,i,n,c),v=nL({ctx:a,theme:i,params:n,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),g=Object.fromEntries(Object.keys(p).map(b=>{const y=d({[u(p[b])]:!(o!=null&&o.unstyled)},u(v[b]),u(m[b]),u(h[b]));return[b,y]}));return{classes:Z9({cx:d,classes:g,context:a,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:d,theme:i}}return r}function Vt(e){return`___ref-${e||""}`}function OE({styles:e}){const t=Jt();return S.createElement(hc,{styles:w9(typeof e=="function"?e(t):e)})}var oL=Object.defineProperty,iL=Object.defineProperties,aL=Object.getOwnPropertyDescriptors,D1=Object.getOwnPropertySymbols,sL=Object.prototype.hasOwnProperty,lL=Object.prototype.propertyIsEnumerable,N1=(e,t,r)=>t in e?oL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bs=(e,t)=>{for(var r in t||(t={}))sL.call(t,r)&&N1(e,r,t[r]);if(D1)for(var r of D1(t))lL.call(t,r)&&N1(e,r,t[r]);return e},Us=(e,t)=>iL(e,aL(t));const Ws={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${j(10)})`},transitionProperty:"transform, opacity"},Kc={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(-${j(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(${j(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(${j(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${j(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:Us(Bs({},Ws),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Us(Bs({},Ws),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Us(Bs({},Ws),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Us(Bs({},Ws),{common:{transformOrigin:"top left"}}),"pop-top-right":Us(Bs({},Ws),{common:{transformOrigin:"top right"}})},A1=["mousedown","touchstart"];function cL(e,t,r){const n=f.useRef();return f.useEffect(()=>{const o=i=>{const{target:a}=i??{};if(Array.isArray(r)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else n.current&&!n.current.contains(a)&&e()};return(t||A1).forEach(i=>document.addEventListener(i,o)),()=>{(t||A1).forEach(i=>document.removeEventListener(i,o))}},[n,e,r]),n}function uL({timeout:e=2e3}={}){const[t,r]=f.useState(null),[n,o]=f.useState(!1),[i,a]=f.useState(null),l=d=>{clearTimeout(i),a(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(i)},error:t,copied:n}}function dL(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function fL(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function pL(e,t,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[n,o]=f.useState(r?t:fL(e,t)),i=f.useRef();return f.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),dL(i.current,a=>o(a.matches))},[e]),n}const CE=typeof document<"u"?f.useLayoutEffect:f.useEffect;function rn(e,t){const r=f.useRef(!1);f.useEffect(()=>()=>{r.current=!1},[]),f.useEffect(()=>{if(r.current)return e();r.current=!0},t)}function EE({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 rn(()=>{let o=-1;const i=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?r.current=document.activeElement:t&&(o=window.setTimeout(n,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),n}const hL=/input|select|textarea|button|object/,$E="a, input, select, textarea, button, object, [tabindex]";function mL(e){return e.style.display==="none"}function gL(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(mL(r))return!1;r=r.parentNode}return!0}function kE(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Gg(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(kE(e));return(hL.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&gL(e)}function RE(e){const t=kE(e);return(Number.isNaN(t)||t>=0)&&Gg(e)}function vL(e){return Array.from(e.querySelectorAll($E)).filter(RE)}function yL(e,t){const r=vL(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();if(!(n===o.activeElement||e===o.activeElement))return;t.preventDefault();const a=r[t.shiftKey?r.length-1:0];a&&a.focus()}function kh(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function xL(e,t="body > :not(script)"){const r=kh(),n=Array.from(document.querySelectorAll(t)).map(o=>{var i;if((i=o==null?void 0:o.shadowRoot)!=null&&i.contains(e)||o.contains(e))return;const a=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",r),a===null||a==="false"?o.setAttribute("aria-hidden","true"):!l&&!c&&o.setAttribute("data-hidden",a),{node:o,ariaHidden:l||null}});return()=>{n.forEach(o=>{!o||r!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function wL(e=!0){const t=f.useRef(),r=f.useRef(null),n=i=>{let a=i.querySelector("[data-autofocus]");if(!a){const l=Array.from(i.querySelectorAll($E));a=l.find(RE)||l.find(Gg)||null,!a&&Gg(i)&&(a=i)}a&&a.focus({preventScroll:!0})},o=f.useCallback(i=>{if(e){if(i===null){r.current&&(r.current(),r.current=null);return}r.current=xL(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)}},[e]);return f.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=a=>{a.key==="Tab"&&t.current&&yL(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),r.current&&r.current()}},[e]),o}const _L=e=>(e+1)%1e6;function bL(){const[,e]=f.useReducer(_L,0);return e}const SL=S["useId".toString()]||(()=>{});function PL(){const e=SL();return e?`mantine-${e.replace(/:/g,"")}`:""}function Rr(e){const t=PL(),[r,n]=f.useState(t);return CE(()=>{n(kh())},[]),typeof e=="string"?e:typeof window>"u"?t:r}function qg(e,t,r){f.useEffect(()=>(window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)),[e,t])}function TE(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function jL(...e){return t=>{e.forEach(r=>TE(r,t))}}function Es(...e){return f.useCallback(jL(...e),e)}function $r({value:e,defaultValue:t,finalValue:r,onChange:n=()=>{}}){const[o,i]=f.useState(t!==void 0?t:r),a=l=>{i(l),n==null||n(l)};return e!==void 0?[e,n,!0]:[o,a,!1]}function Bo(e,t){const r=t-e+1;return Array.from({length:r},(n,o)=>o+e)}const Yc="dots";function OL({total:e,siblings:t=1,boundaries:r=1,page:n,initialPage:o=1,onChange:i}){const a=Math.max(Math.trunc(e),0),[l,c]=$r({value:n,onChange:i,defaultValue:o,finalValue:o}),u=g=>{g<=0?c(1):g>a?c(a):c(g)},d=()=>u(l+1),p=()=>u(l-1),h=()=>u(1),m=()=>u(a);return{range:f.useMemo(()=>{if(t*2+3+r*2>=a)return Bo(1,a);const b=Math.max(l-t,r),y=Math.min(l+t,a-r),x=b>r+2,_=y<a-(r+1);if(!x&&_){const w=t*2+r+2;return[...Bo(1,w),Yc,...Bo(a-(r-1),a)]}if(x&&!_){const w=r+1+2*t;return[...Bo(1,r),Yc,...Bo(a-w,a)]}return[...Bo(1,r),Yc,...Bo(b,y),Yc,...Bo(a-r+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:p,first:h,last:m}}function CL({initialValues:e=[],limit:t}){const[{state:r,queue:n},o]=f.useState({state:e.slice(0,t),queue:e.slice(t)});return{state:r,queue:n,add:(...c)=>o(u=>{const d=[...u.state,...u.queue,...c];return{state:d.slice(0,t),queue:d.slice(t)}}),update:c=>o(u=>{const d=c([...u.state,...u.queue]);return{state:d.slice(0,t),queue:d.slice(t)}}),cleanQueue:()=>o(c=>({state:c.state,queue:[]}))}}function Rh(e,t){return pL("(prefers-reduced-motion: reduce)",e,t)}const EL=e=>e<.5?2*e*e:-1+(4-2*e)*e,$L=({axis:e,target:t,parent:r,alignment:n,offset:o,isList:i})=>{if(!t||!r&&typeof document>"u")return 0;const a=!!r,c=(r||document.body).getBoundingClientRect(),u=t.getBoundingClientRect(),d=p=>u[p]-c[p];if(e==="y"){const p=d("top");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.height*(i?0:1)||!i?m:0}const h=a?c.height:window.innerHeight;if(n==="end"){const m=p+o-h+u.height;return m>=-u.height*(i?0:1)||!i?m:0}return n==="center"?p-h/2+u.height/2:0}if(e==="x"){const p=d("left");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.width||!i?m:0}const h=a?c.width:window.innerWidth;if(n==="end"){const m=p+o-h+u.width;return m>=-u.width||!i?m:0}return n==="center"?p-h/2+u.width/2:0}return 0},kL=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const r=e==="y"?"scrollTop":"scrollLeft";if(t)return t[r];const{body:n,documentElement:o}=document;return n[r]+o[r]},RL=({axis:e,parent:t,distance:r})=>{if(!t&&typeof document>"u")return;const n=e==="y"?"scrollTop":"scrollLeft";if(t)t[n]=r;else{const{body:o,documentElement:i}=document;o[n]=r,i[n]=r}};function TL({duration:e=1250,axis:t="y",onScrollFinish:r,easing:n=EL,offset:o=0,cancelable:i=!0,isList:a=!1}={}){const l=f.useRef(0),c=f.useRef(0),u=f.useRef(!1),d=f.useRef(null),p=f.useRef(null),h=Rh(),m=()=>{l.current&&cancelAnimationFrame(l.current)},v=f.useCallback(({alignment:b="start"}={})=>{var y;u.current=!1,l.current&&m();const x=(y=kL({parent:d.current,axis:t}))!=null?y:0,_=$L({parent:d.current,target:p.current,axis:t,alignment:b,offset:o,isList:a})-(d.current?0:x);function w(){c.current===0&&(c.current=performance.now());const C=performance.now()-c.current,P=h||e===0?1:C/e,E=x+_*n(P);RL({parent:d.current,axis:t,distance:E}),!u.current&&P<1?l.current=requestAnimationFrame(w):(typeof r=="function"&&r(),c.current=0,l.current=0,m())}w()},[t,e,n,a,o,r,h]),g=()=>{i&&(u.current=!0)};return qg("wheel",g,{passive:!0}),qg("touchmove",g,{passive:!0}),f.useEffect(()=>m,[]),{scrollableRef:d,targetRef:p,scrollIntoView:v,cancel:m}}function IL(e=!1,t){const{onOpen:r,onClose:n}=t||{},[o,i]=f.useState(e),a=f.useCallback(()=>{i(u=>u||(r==null||r(),!0))},[r]),l=f.useCallback(()=>{i(u=>u&&(n==null||n(),!1))},[n]),c=f.useCallback(()=>{o?l():a()},[l,a,o]);return[o,{open:a,close:l,toggle:c}]}function M1(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var L1=Object.getOwnPropertySymbols,DL=Object.prototype.hasOwnProperty,NL=Object.prototype.propertyIsEnumerable,AL=(e,t)=>{var r={};for(var n in e)DL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&L1)for(var n of L1(e))t.indexOf(n)<0&&NL.call(e,n)&&(r[n]=e[n]);return r};function eo(e){const t=e,{m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:b,c:y,opacity:x,ff:_,fz:w,fw:O,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:T,miw:z,maw:M,h:L,mih:q,mah:Y,bgsz:R,bgp:N,bgr:V,bga:Q,pos:ee,top:_e,left:we,bottom:Ue,right:Ae,inset:pt,display:Dt}=t,Pe=AL(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:bE({m:r,mx:n,my:o,mt:i,mb:a,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:b,c:y,opacity:x,ff:_,fz:w,fw:O,lts:C,ta:P,lh:E,fs:k,tt:$,td:I,w:T,miw:z,maw:M,h:L,mih:q,mah:Y,bgsz:R,bgp:N,bgr:V,bga:Q,pos:ee,top:_e,left:we,bottom:Ue,right:Ae,inset:pt,display:Dt}),rest:Pe}}function ML(e,t){const r=Object.keys(e).filter(n=>n!=="base").sort((n,o)=>pr(A({size:n,sizes:t.breakpoints}))-pr(A({size:o,sizes:t.breakpoints})));return"base"in e?["base",...r]:r}function LL({value:e,theme:t,getValue:r,property:n}){if(e==null)return;if(typeof e=="object")return ML(e,t).reduce((a,l)=>{if(l==="base"&&e.base!==void 0){const u=r(e.base,t);return Array.isArray(n)?(n.forEach(d=>{a[d]=u}),a):(a[n]=u,a)}const c=r(e[l],t);return Array.isArray(n)?(a[t.fn.largerThan(l)]={},n.forEach(u=>{a[t.fn.largerThan(l)][u]=c}),a):(a[t.fn.largerThan(l)]={[n]:c},a)},{});const o=r(e,t);return Array.isArray(n)?n.reduce((i,a)=>(i[a]=o,i),{}):{[n]:o}}function zL(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function FL(e){return j(e)}function VL(e){return e}function BL(e,t){return A({size:e,sizes:t.fontSizes})}const UL=["-xs","-sm","-md","-lg","-xl"];function WL(e,t){return UL.includes(e)?`calc(${A({size:e.replace("-",""),sizes:t.spacing})} * -1)`:A({size:e,sizes:t.spacing})}const HL={identity:VL,color:zL,size:FL,fontSize:BL,spacing:WL},GL={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 qL=Object.defineProperty,z1=Object.getOwnPropertySymbols,QL=Object.prototype.hasOwnProperty,KL=Object.prototype.propertyIsEnumerable,F1=(e,t,r)=>t in e?qL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V1=(e,t)=>{for(var r in t||(t={}))QL.call(t,r)&&F1(e,r,t[r]);if(z1)for(var r of z1(t))KL.call(t,r)&&F1(e,r,t[r]);return e};function Qg(e,t,r=GL){return Object.keys(r).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push(LL({value:e[i],getValue:HL[r[i].type],property:r[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(a=>{typeof i[a]=="object"&&i[a]!==null&&a in o?o[a]=V1(V1({},o[a]),i[a]):o[a]=i[a]}),o),{})}function B1(e,t){return typeof e=="function"?e(t):e}function YL(e,t,r){const n=Jt(),{css:o,cx:i}=jE();return Array.isArray(e)?i(r,o(Qg(t,n)),e.map(a=>o(B1(a,n)))):i(r,o(B1(e,n)),o(Qg(t,n)))}var XL=Object.defineProperty,gd=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,DE=Object.prototype.propertyIsEnumerable,U1=(e,t,r)=>t in e?XL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,JL=(e,t)=>{for(var r in t||(t={}))IE.call(t,r)&&U1(e,r,t[r]);if(gd)for(var r of gd(t))DE.call(t,r)&&U1(e,r,t[r]);return e},ZL=(e,t)=>{var r={};for(var n in e)IE.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&&DE.call(e,n)&&(r[n]=e[n]);return r};const NE=f.forwardRef((e,t)=>{var r=e,{className:n,component:o,style:i,sx:a}=r,l=ZL(r,["className","component","style","sx"]);const{systemStyles:c,rest:u}=eo(l),d=o||"div";return S.createElement(d,JL({ref:t,className:YL(a,c,n),style:i},u))});NE.displayName="@mantine/core/Box";const oe=NE;var ez=Object.defineProperty,tz=Object.defineProperties,rz=Object.getOwnPropertyDescriptors,W1=Object.getOwnPropertySymbols,nz=Object.prototype.hasOwnProperty,oz=Object.prototype.propertyIsEnumerable,H1=(e,t,r)=>t in e?ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G1=(e,t)=>{for(var r in t||(t={}))nz.call(t,r)&&H1(e,r,t[r]);if(W1)for(var r of W1(t))oz.call(t,r)&&H1(e,r,t[r]);return e},iz=(e,t)=>tz(e,rz(t)),az=W(e=>({root:iz(G1(G1({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const sz=az;var lz=Object.defineProperty,vd=Object.getOwnPropertySymbols,AE=Object.prototype.hasOwnProperty,ME=Object.prototype.propertyIsEnumerable,q1=(e,t,r)=>t in e?lz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cz=(e,t)=>{for(var r in t||(t={}))AE.call(t,r)&&q1(e,r,t[r]);if(vd)for(var r of vd(t))ME.call(t,r)&&q1(e,r,t[r]);return e},uz=(e,t)=>{var r={};for(var n in e)AE.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&&ME.call(e,n)&&(r[n]=e[n]);return r};const LE=f.forwardRef((e,t)=>{const r=H("UnstyledButton",{},e),{className:n,component:o="button",unstyled:i,variant:a}=r,l=uz(r,["className","component","unstyled","variant"]),{classes:c,cx:u}=sz(null,{name:"UnstyledButton",unstyled:i,variant:a});return S.createElement(oe,cz({component:o,ref:t,className:u(c.root,n),type:o==="button"?"button":void 0},l))});LE.displayName="@mantine/core/UnstyledButton";const wo=LE;var zE={exports:{}},Wr={},FE={exports:{}},VE={};/**
65
65
  * @license React
66
66
  * scheduler.production.min.js
67
67
  *
@@ -69,7 +69,7 @@ function I3(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
69
69
  *
70
70
  * This source code is licensed under the MIT license found in the
71
71
  * LICENSE file in the root directory of this source tree.
72
- */(function(e){function t(R,N){var V=R.length;R.push(N);e:for(;0<V;){var Q=V-1>>>1,ee=R[Q];if(0<o(ee,N))R[Q]=N,R[V]=ee,V=Q;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var N=R[0],V=R.pop();if(V!==N){R[0]=V;e:for(var Q=0,ee=R.length,_e=ee>>>1;Q<_e;){var we=2*(Q+1)-1,Ue=R[we],Ae=we+1,pt=R[Ae];if(0>o(Ue,V))Ae<ee&&0>o(pt,Ue)?(R[Q]=pt,R[Ae]=V,Q=Ae):(R[Q]=Ue,R[we]=V,Q=we);else if(Ae<ee&&0>o(pt,V))R[Q]=pt,R[Ae]=V,Q=Ae;else break e}}return N}function o(R,N){var V=R.sortIndex-N.sortIndex;return V!==0?V:R.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,v=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(R){for(var N=r(u);N!==null;){if(N.callback===null)n(u);else if(N.startTime<=R)n(u),N.sortIndex=N.expirationTime,t(c,N);else break;N=r(u)}}function w(R){if(g=!1,_(R),!v)if(r(c)!==null)v=!0,q(O);else{var N=r(u);N!==null&&Y(w,N.startTime-R)}}function O(R,N){v=!1,g&&(g=!1,y(E),E=-1),m=!0;var V=h;try{for(_(N),p=r(c);p!==null&&(!(p.expirationTime>N)||R&&!I());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,h=p.priorityLevel;var ee=Q(p.expirationTime<=N);N=e.unstable_now(),typeof ee=="function"?p.callback=ee:p===r(c)&&n(c),_(N)}else n(c);p=r(c)}if(p!==null)var _e=!0;else{var we=r(u);we!==null&&Y(w,we.startTime-N),_e=!1}return _e}finally{p=null,h=V,m=!1}}var C=!1,P=null,E=-1,k=5,$=-1;function I(){return!(e.unstable_now()-$<k)}function T(){if(P!==null){var R=e.unstable_now();$=R;var N=!0;try{N=P(!0,R)}finally{N?z():(C=!1,P=null)}}else C=!1}var z;if(typeof x=="function")z=function(){x(T)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,L=M.port2;M.port1.onmessage=T,z=function(){L.postMessage(null)}}else z=function(){b(T,0)};function q(R){P=R,C||(C=!0,z())}function Y(R,N){E=b(function(){R(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,q(O))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=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 N=3;break;default:N=h}var V=h;h=N;try{return R()}finally{h=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,N){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var V=h;h=R;try{return N()}finally{h=V}},e.unstable_scheduleCallback=function(R,N,V){var Q=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Q+V:Q):V=Q,R){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=V+ee,R={id:d++,callback:N,priorityLevel:R,startTime:V,expirationTime:ee,sortIndex:-1},V>Q?(R.sortIndex=V,t(u,R),r(c)===null&&R===r(u)&&(g?(y(E),E=-1):g=!0,Y(w,V-Q))):(R.sortIndex=ee,t(c,R),v||m||(v=!0,q(O))),R},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(R){var N=h;return function(){var V=h;h=N;try{return R.apply(this,arguments)}finally{h=V}}}})(VE);FE.exports=VE;var d6=FE.exports;/**
72
+ */(function(e){function t(R,N){var V=R.length;R.push(N);e:for(;0<V;){var Q=V-1>>>1,ee=R[Q];if(0<o(ee,N))R[Q]=N,R[V]=ee,V=Q;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var N=R[0],V=R.pop();if(V!==N){R[0]=V;e:for(var Q=0,ee=R.length,_e=ee>>>1;Q<_e;){var we=2*(Q+1)-1,Ue=R[we],Ae=we+1,pt=R[Ae];if(0>o(Ue,V))Ae<ee&&0>o(pt,Ue)?(R[Q]=pt,R[Ae]=V,Q=Ae):(R[Q]=Ue,R[we]=V,Q=we);else if(Ae<ee&&0>o(pt,V))R[Q]=pt,R[Ae]=V,Q=Ae;else break e}}return N}function o(R,N){var V=R.sortIndex-N.sortIndex;return V!==0?V:R.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,v=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(R){for(var N=r(u);N!==null;){if(N.callback===null)n(u);else if(N.startTime<=R)n(u),N.sortIndex=N.expirationTime,t(c,N);else break;N=r(u)}}function w(R){if(g=!1,_(R),!v)if(r(c)!==null)v=!0,q(O);else{var N=r(u);N!==null&&Y(w,N.startTime-R)}}function O(R,N){v=!1,g&&(g=!1,y(E),E=-1),m=!0;var V=h;try{for(_(N),p=r(c);p!==null&&(!(p.expirationTime>N)||R&&!I());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,h=p.priorityLevel;var ee=Q(p.expirationTime<=N);N=e.unstable_now(),typeof ee=="function"?p.callback=ee:p===r(c)&&n(c),_(N)}else n(c);p=r(c)}if(p!==null)var _e=!0;else{var we=r(u);we!==null&&Y(w,we.startTime-N),_e=!1}return _e}finally{p=null,h=V,m=!1}}var C=!1,P=null,E=-1,k=5,$=-1;function I(){return!(e.unstable_now()-$<k)}function T(){if(P!==null){var R=e.unstable_now();$=R;var N=!0;try{N=P(!0,R)}finally{N?z():(C=!1,P=null)}}else C=!1}var z;if(typeof x=="function")z=function(){x(T)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,L=M.port2;M.port1.onmessage=T,z=function(){L.postMessage(null)}}else z=function(){b(T,0)};function q(R){P=R,C||(C=!0,z())}function Y(R,N){E=b(function(){R(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,q(O))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=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 N=3;break;default:N=h}var V=h;h=N;try{return R()}finally{h=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,N){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var V=h;h=R;try{return N()}finally{h=V}},e.unstable_scheduleCallback=function(R,N,V){var Q=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Q+V:Q):V=Q,R){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=V+ee,R={id:d++,callback:N,priorityLevel:R,startTime:V,expirationTime:ee,sortIndex:-1},V>Q?(R.sortIndex=V,t(u,R),r(c)===null&&R===r(u)&&(g?(y(E),E=-1):g=!0,Y(w,V-Q))):(R.sortIndex=ee,t(c,R),v||m||(v=!0,q(O))),R},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(R){var N=h;return function(){var V=h;h=N;try{return R.apply(this,arguments)}finally{h=V}}}})(VE);FE.exports=VE;var dz=FE.exports;/**
73
73
  * @license React
74
74
  * react-dom.production.min.js
75
75
  *
@@ -77,16 +77,16 @@ function I3(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
77
77
  *
78
78
  * This source code is licensed under the MIT license found in the
79
79
  * LICENSE file in the root directory of this source tree.
80
- */var BE=f,Br=d6;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var UE=new Set,Fl={};function la(e,t){cs(e,t),cs(e+"Capture",t)}function cs(e,t){for(Fl[e]=t,e=0;e<t.length;e++)UE.add(t[e])}var _o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kg=Object.prototype.hasOwnProperty,f6=/^[: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]*$/,Q1={},K1={};function p6(e){return Kg.call(K1,e)?!0:Kg.call(Q1,e)?!1:f6.test(e)?K1[e]=!0:(Q1[e]=!0,!1)}function h6(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 m6(e,t,r,n){if(t===null||typeof t>"u"||h6(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 gr(e,t,r,n,o,i,a){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=i,this.removeEmptyString=a}var Xt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Xt[e]=new gr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Xt[t]=new gr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Xt[e]=new gr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Xt[e]=new gr(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){Xt[e]=new gr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Xt[e]=new gr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Xt[e]=new gr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Xt[e]=new gr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Xt[e]=new gr(e,5,!1,e.toLowerCase(),null,!1,!1)});var My=/[\-:]([a-z])/g;function Ly(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,Ly);Xt[t]=new gr(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,Ly);Xt[t]=new gr(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,Ly);Xt[t]=new gr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Xt[e]=new gr(e,1,!1,e.toLowerCase(),null,!1,!1)});Xt.xlinkHref=new gr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Xt[e]=new gr(e,1,!1,e.toLowerCase(),null,!0,!0)});function zy(e,t,r,n){var o=Xt.hasOwnProperty(t)?Xt[t]:null;(o!==null?o.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(m6(t,r,o,n)&&(r=null),n||o===null?p6(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 Ro=BE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xc=Symbol.for("react.element"),Aa=Symbol.for("react.portal"),Ma=Symbol.for("react.fragment"),Fy=Symbol.for("react.strict_mode"),Yg=Symbol.for("react.profiler"),WE=Symbol.for("react.provider"),HE=Symbol.for("react.context"),Vy=Symbol.for("react.forward_ref"),Xg=Symbol.for("react.suspense"),Jg=Symbol.for("react.suspense_list"),By=Symbol.for("react.memo"),qo=Symbol.for("react.lazy"),GE=Symbol.for("react.offscreen"),Y1=Symbol.iterator;function Hs(e){return e===null||typeof e!="object"?null:(e=Y1&&e[Y1]||e["@@iterator"],typeof e=="function"?e:null)}var wt=Object.assign,Im;function hl(e){if(Im===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Im=t&&t[1]||""}return`
80
+ */var BE=f,Br=dz;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var UE=new Set,Fl={};function la(e,t){cs(e,t),cs(e+"Capture",t)}function cs(e,t){for(Fl[e]=t,e=0;e<t.length;e++)UE.add(t[e])}var _o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kg=Object.prototype.hasOwnProperty,fz=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Q1={},K1={};function pz(e){return Kg.call(K1,e)?!0:Kg.call(Q1,e)?!1:fz.test(e)?K1[e]=!0:(Q1[e]=!0,!1)}function hz(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mz(e,t,r,n){if(t===null||typeof t>"u"||hz(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function gr(e,t,r,n,o,i,a){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=i,this.removeEmptyString=a}var Xt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Xt[e]=new gr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Xt[t]=new gr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Xt[e]=new gr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Xt[e]=new gr(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){Xt[e]=new gr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Xt[e]=new gr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Xt[e]=new gr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Xt[e]=new gr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Xt[e]=new gr(e,5,!1,e.toLowerCase(),null,!1,!1)});var My=/[\-:]([a-z])/g;function Ly(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,Ly);Xt[t]=new gr(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,Ly);Xt[t]=new gr(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,Ly);Xt[t]=new gr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Xt[e]=new gr(e,1,!1,e.toLowerCase(),null,!1,!1)});Xt.xlinkHref=new gr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Xt[e]=new gr(e,1,!1,e.toLowerCase(),null,!0,!0)});function zy(e,t,r,n){var o=Xt.hasOwnProperty(t)?Xt[t]:null;(o!==null?o.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(mz(t,r,o,n)&&(r=null),n||o===null?pz(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,n=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Ro=BE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xc=Symbol.for("react.element"),Aa=Symbol.for("react.portal"),Ma=Symbol.for("react.fragment"),Fy=Symbol.for("react.strict_mode"),Yg=Symbol.for("react.profiler"),WE=Symbol.for("react.provider"),HE=Symbol.for("react.context"),Vy=Symbol.for("react.forward_ref"),Xg=Symbol.for("react.suspense"),Jg=Symbol.for("react.suspense_list"),By=Symbol.for("react.memo"),qo=Symbol.for("react.lazy"),GE=Symbol.for("react.offscreen"),Y1=Symbol.iterator;function Hs(e){return e===null||typeof e!="object"?null:(e=Y1&&e[Y1]||e["@@iterator"],typeof e=="function"?e:null)}var wt=Object.assign,Im;function hl(e){if(Im===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Im=t&&t[1]||""}return`
81
81
  `+Im+e}var Dm=!1;function Nm(e,t){if(!e||Dm)return"";Dm=!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
82
  `),i=n.stack.split(`
83
83
  `),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var c=`
84
- `+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Dm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?hl(e):""}function g6(e){switch(e.tag){case 5:return hl(e.type);case 16:return hl("Lazy");case 13:return hl("Suspense");case 19:return hl("SuspenseList");case 0:case 2:case 15:return e=Nm(e.type,!1),e;case 11:return e=Nm(e.type.render,!1),e;case 1:return e=Nm(e.type,!0),e;default:return""}}function Zg(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 Ma:return"Fragment";case Aa:return"Portal";case Yg:return"Profiler";case Fy:return"StrictMode";case Xg:return"Suspense";case Jg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case HE:return(e.displayName||"Context")+".Consumer";case WE:return(e._context.displayName||"Context")+".Provider";case Vy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case By:return t=e.displayName||null,t!==null?t:Zg(e.type)||"Memo";case qo:t=e._payload,e=e._init;try{return Zg(e(t))}catch{}}return null}function v6(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 Zg(t);case 8:return t===Fy?"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 fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function y6(e){var t=qE(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jc(e){e._valueTracker||(e._valueTracker=y6(e))}function QE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=qE(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function yd(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 ev(e,t){var r=t.checked;return wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function X1(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=fi(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 KE(e,t){t=t.checked,t!=null&&zy(e,"checked",t,!1)}function tv(e,t){KE(e,t);var r=fi(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")?rv(e,t.type,r):t.hasOwnProperty("defaultValue")&&rv(e,t.type,fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function J1(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 rv(e,t,r){(t!=="number"||yd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ml=Array.isArray;function Ja(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=""+fi(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 nv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return wt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Z1(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(ml(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:fi(r)}}function YE(e,t){var r=fi(t.value),n=fi(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 ew(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function XE(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 ov(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?XE(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zc,JE=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(Zc=Zc||document.createElement("div"),Zc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bl={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},x6=["Webkit","ms","Moz","O"];Object.keys(bl).forEach(function(e){x6.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bl[t]=bl[e]})});function ZE(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||bl.hasOwnProperty(e)&&bl[e]?(""+t).trim():t+"px"}function e$(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=ZE(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var w6=wt({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 iv(e,t){if(t){if(w6[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function av(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 sv=null;function Uy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var lv=null,Za=null,es=null;function tw(e){if(e=vc(e)){if(typeof lv!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Ah(t),lv(e.stateNode,e.type,t))}}function t$(e){Za?es?es.push(e):es=[e]:Za=e}function r$(){if(Za){var e=Za,t=es;if(es=Za=null,tw(e),t)for(e=0;e<t.length;e++)tw(t[e])}}function n$(e,t){return e(t)}function o$(){}var Am=!1;function i$(e,t,r){if(Am)return e(t,r);Am=!0;try{return n$(e,t,r)}finally{Am=!1,(Za!==null||es!==null)&&(o$(),r$())}}function Bl(e,t){var r=e.stateNode;if(r===null)return null;var n=Ah(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var cv=!1;if(_o)try{var Gs={};Object.defineProperty(Gs,"passive",{get:function(){cv=!0}}),window.addEventListener("test",Gs,Gs),window.removeEventListener("test",Gs,Gs)}catch{cv=!1}function _6(e,t,r,n,o,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Sl=!1,xd=null,wd=!1,uv=null,b6={onError:function(e){Sl=!0,xd=e}};function S6(e,t,r,n,o,i,a,l,c){Sl=!1,xd=null,_6.apply(b6,arguments)}function P6(e,t,r,n,o,i,a,l,c){if(S6.apply(this,arguments),Sl){if(Sl){var u=xd;Sl=!1,xd=null}else throw Error(G(198));wd||(wd=!0,uv=u)}}function ca(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function a$(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function rw(e){if(ca(e)!==e)throw Error(G(188))}function j6(e){var t=e.alternate;if(!t){if(t=ca(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,n=t;;){var o=r.return;if(o===null)break;var i=o.alternate;if(i===null){if(n=o.return,n!==null){r=n;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===r)return rw(o),e;if(i===n)return rw(o),t;i=i.sibling}throw Error(G(188))}if(r.return!==n.return)r=o,n=i;else{for(var a=!1,l=o.child;l;){if(l===r){a=!0,r=o,n=i;break}if(l===n){a=!0,n=o,r=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===r){a=!0,r=i,n=o;break}if(l===n){a=!0,n=i,r=o;break}l=l.sibling}if(!a)throw Error(G(189))}}if(r.alternate!==n)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function s$(e){return e=j6(e),e!==null?l$(e):null}function l$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=l$(e);if(t!==null)return t;e=e.sibling}return null}var c$=Br.unstable_scheduleCallback,nw=Br.unstable_cancelCallback,O6=Br.unstable_shouldYield,C6=Br.unstable_requestPaint,$t=Br.unstable_now,E6=Br.unstable_getCurrentPriorityLevel,Wy=Br.unstable_ImmediatePriority,u$=Br.unstable_UserBlockingPriority,_d=Br.unstable_NormalPriority,$6=Br.unstable_LowPriority,d$=Br.unstable_IdlePriority,Th=null,Kn=null;function k6(e){if(Kn&&typeof Kn.onCommitFiberRoot=="function")try{Kn.onCommitFiberRoot(Th,e,void 0,(e.current.flags&128)===128)}catch{}}var wn=Math.clz32?Math.clz32:I6,R6=Math.log,T6=Math.LN2;function I6(e){return e>>>=0,e===0?32:31-(R6(e)/T6|0)|0}var eu=64,tu=4194304;function gl(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 bd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~o;l!==0?n=gl(l):(i&=a,i!==0&&(n=gl(i)))}else a=r&~o,a!==0?n=gl(a):i!==0&&(n=gl(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&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-wn(t),o=1<<r,n|=e[r],t&=~o;return n}function D6(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 N6(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-wn(i),l=1<<a,c=o[a];c===-1?(!(l&r)||l&n)&&(o[a]=D6(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function dv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function f$(){var e=eu;return eu<<=1,!(eu&4194240)&&(eu=64),e}function Mm(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function mc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wn(t),e[t]=r}function A6(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-wn(r),i=1<<o;t[o]=0,n[o]=-1,e[o]=-1,r&=~i}}function Hy(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-wn(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}var Ge=0;function p$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var h$,Gy,m$,g$,v$,fv=!1,ru=[],ni=null,oi=null,ii=null,Ul=new Map,Wl=new Map,Xo=[],M6="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 ow(e,t){switch(e){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Ul.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wl.delete(t.pointerId)}}function qs(e,t,r,n,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[o]},t!==null&&(t=vc(t),t!==null&&Gy(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function L6(e,t,r,n,o){switch(t){case"focusin":return ni=qs(ni,e,t,r,n,o),!0;case"dragenter":return oi=qs(oi,e,t,r,n,o),!0;case"mouseover":return ii=qs(ii,e,t,r,n,o),!0;case"pointerover":var i=o.pointerId;return Ul.set(i,qs(Ul.get(i)||null,e,t,r,n,o)),!0;case"gotpointercapture":return i=o.pointerId,Wl.set(i,qs(Wl.get(i)||null,e,t,r,n,o)),!0}return!1}function y$(e){var t=zi(e.target);if(t!==null){var r=ca(t);if(r!==null){if(t=r.tag,t===13){if(t=a$(r),t!==null){e.blockedOn=t,v$(e.priority,function(){m$(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 Yu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=pv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);sv=n,r.target.dispatchEvent(n),sv=null}else return t=vc(r),t!==null&&Gy(t),e.blockedOn=r,!1;t.shift()}return!0}function iw(e,t,r){Yu(e)&&r.delete(t)}function z6(){fv=!1,ni!==null&&Yu(ni)&&(ni=null),oi!==null&&Yu(oi)&&(oi=null),ii!==null&&Yu(ii)&&(ii=null),Ul.forEach(iw),Wl.forEach(iw)}function Qs(e,t){e.blockedOn===t&&(e.blockedOn=null,fv||(fv=!0,Br.unstable_scheduleCallback(Br.unstable_NormalPriority,z6)))}function Hl(e){function t(o){return Qs(o,e)}if(0<ru.length){Qs(ru[0],e);for(var r=1;r<ru.length;r++){var n=ru[r];n.blockedOn===e&&(n.blockedOn=null)}}for(ni!==null&&Qs(ni,e),oi!==null&&Qs(oi,e),ii!==null&&Qs(ii,e),Ul.forEach(t),Wl.forEach(t),r=0;r<Xo.length;r++)n=Xo[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Xo.length&&(r=Xo[0],r.blockedOn===null);)y$(r),r.blockedOn===null&&Xo.shift()}var ts=Ro.ReactCurrentBatchConfig,Sd=!0;function F6(e,t,r,n){var o=Ge,i=ts.transition;ts.transition=null;try{Ge=1,qy(e,t,r,n)}finally{Ge=o,ts.transition=i}}function V6(e,t,r,n){var o=Ge,i=ts.transition;ts.transition=null;try{Ge=4,qy(e,t,r,n)}finally{Ge=o,ts.transition=i}}function qy(e,t,r,n){if(Sd){var o=pv(e,t,r,n);if(o===null)qm(e,t,n,Pd,r),ow(e,n);else if(L6(o,e,t,r,n))n.stopPropagation();else if(ow(e,n),t&4&&-1<M6.indexOf(e)){for(;o!==null;){var i=vc(o);if(i!==null&&h$(i),i=pv(e,t,r,n),i===null&&qm(e,t,n,Pd,r),i===o)break;o=i}o!==null&&n.stopPropagation()}else qm(e,t,n,null,r)}}var Pd=null;function pv(e,t,r,n){if(Pd=null,e=Uy(n),e=zi(e),e!==null)if(t=ca(e),t===null)e=null;else if(r=t.tag,r===13){if(e=a$(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Pd=e,null}function x$(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(E6()){case Wy:return 1;case u$:return 4;case _d:case $6:return 16;case d$:return 536870912;default:return 16}default:return 16}}var Zo=null,Qy=null,Xu=null;function w$(){if(Xu)return Xu;var e,t=Qy,r=t.length,n,o="value"in Zo?Zo.value:Zo.textContent,i=o.length;for(e=0;e<r&&t[e]===o[e];e++);var a=r-e;for(n=1;n<=a&&t[r-n]===o[i-n];n++);return Xu=o.slice(e,1<n?1-n:void 0)}function Ju(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 nu(){return!0}function aw(){return!1}function Hr(e){function t(r,n,o,i,a){this._reactName=r,this._targetInst=o,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?nu:aw,this.isPropagationStopped=aw,this}return wt(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=nu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=nu)},persist:function(){},isPersistent:nu}),t}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ky=Hr($s),gc=wt({},$s,{view:0,detail:0}),B6=Hr(gc),Lm,zm,Ks,Ih=wt({},gc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yy,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!==Ks&&(Ks&&e.type==="mousemove"?(Lm=e.screenX-Ks.screenX,zm=e.screenY-Ks.screenY):zm=Lm=0,Ks=e),Lm)},movementY:function(e){return"movementY"in e?e.movementY:zm}}),sw=Hr(Ih),U6=wt({},Ih,{dataTransfer:0}),W6=Hr(U6),H6=wt({},gc,{relatedTarget:0}),Fm=Hr(H6),G6=wt({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),q6=Hr(G6),Q6=wt({},$s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),K6=Hr(Q6),Y6=wt({},$s,{data:0}),lw=Hr(Y6),X6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J6={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"},Z6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ez(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z6[e])?!!t[e]:!1}function Yy(){return ez}var tz=wt({},gc,{key:function(e){if(e.key){var t=X6[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ju(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J6[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yy,charCode:function(e){return e.type==="keypress"?Ju(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ju(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rz=Hr(tz),nz=wt({},Ih,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cw=Hr(nz),oz=wt({},gc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yy}),iz=Hr(oz),az=wt({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),sz=Hr(az),lz=wt({},Ih,{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}),cz=Hr(lz),uz=[9,13,27,32],Xy=_o&&"CompositionEvent"in window,Pl=null;_o&&"documentMode"in document&&(Pl=document.documentMode);var dz=_o&&"TextEvent"in window&&!Pl,_$=_o&&(!Xy||Pl&&8<Pl&&11>=Pl),uw=String.fromCharCode(32),dw=!1;function b$(e,t){switch(e){case"keyup":return uz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var La=!1;function fz(e,t){switch(e){case"compositionend":return S$(t);case"keypress":return t.which!==32?null:(dw=!0,uw);case"textInput":return e=t.data,e===uw&&dw?null:e;default:return null}}function pz(e,t){if(La)return e==="compositionend"||!Xy&&b$(e,t)?(e=w$(),Xu=Qy=Zo=null,La=!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 _$&&t.locale!=="ko"?null:t.data;default:return null}}var hz={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 fw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hz[e.type]:t==="textarea"}function P$(e,t,r,n){t$(n),t=jd(t,"onChange"),0<t.length&&(r=new Ky("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var jl=null,Gl=null;function mz(e){N$(e,0)}function Dh(e){var t=Va(e);if(QE(t))return e}function gz(e,t){if(e==="change")return t}var j$=!1;if(_o){var Vm;if(_o){var Bm="oninput"in document;if(!Bm){var pw=document.createElement("div");pw.setAttribute("oninput","return;"),Bm=typeof pw.oninput=="function"}Vm=Bm}else Vm=!1;j$=Vm&&(!document.documentMode||9<document.documentMode)}function hw(){jl&&(jl.detachEvent("onpropertychange",O$),Gl=jl=null)}function O$(e){if(e.propertyName==="value"&&Dh(Gl)){var t=[];P$(t,Gl,e,Uy(e)),i$(mz,t)}}function vz(e,t,r){e==="focusin"?(hw(),jl=t,Gl=r,jl.attachEvent("onpropertychange",O$)):e==="focusout"&&hw()}function yz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dh(Gl)}function xz(e,t){if(e==="click")return Dh(t)}function wz(e,t){if(e==="input"||e==="change")return Dh(t)}function _z(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bn=typeof Object.is=="function"?Object.is:_z;function ql(e,t){if(bn(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(!Kg.call(t,o)||!bn(e[o],t[o]))return!1}return!0}function mw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gw(e,t){var r=mw(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=mw(r)}}function C$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function E$(){for(var e=window,t=yd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yd(e.document)}return t}function Jy(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 bz(e){var t=E$(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&C$(r.ownerDocument.documentElement,r)){if(n!==null&&Jy(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,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=gw(r,i);var a=gw(r,n);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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 Sz=_o&&"documentMode"in document&&11>=document.documentMode,za=null,hv=null,Ol=null,mv=!1;function vw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;mv||za==null||za!==yd(n)||(n=za,"selectionStart"in n&&Jy(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}),Ol&&ql(Ol,n)||(Ol=n,n=jd(hv,"onSelect"),0<n.length&&(t=new Ky("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=za)))}function ou(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Fa={animationend:ou("Animation","AnimationEnd"),animationiteration:ou("Animation","AnimationIteration"),animationstart:ou("Animation","AnimationStart"),transitionend:ou("Transition","TransitionEnd")},Um={},$$={};_o&&($$=document.createElement("div").style,"AnimationEvent"in window||(delete Fa.animationend.animation,delete Fa.animationiteration.animation,delete Fa.animationstart.animation),"TransitionEvent"in window||delete Fa.transitionend.transition);function Nh(e){if(Um[e])return Um[e];if(!Fa[e])return e;var t=Fa[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in $$)return Um[e]=t[r];return e}var k$=Nh("animationend"),R$=Nh("animationiteration"),T$=Nh("animationstart"),I$=Nh("transitionend"),D$=new Map,yw="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 xi(e,t){D$.set(e,t),la(t,[e])}for(var Wm=0;Wm<yw.length;Wm++){var Hm=yw[Wm],Pz=Hm.toLowerCase(),jz=Hm[0].toUpperCase()+Hm.slice(1);xi(Pz,"on"+jz)}xi(k$,"onAnimationEnd");xi(R$,"onAnimationIteration");xi(T$,"onAnimationStart");xi("dblclick","onDoubleClick");xi("focusin","onFocus");xi("focusout","onBlur");xi(I$,"onTransitionEnd");cs("onMouseEnter",["mouseout","mouseover"]);cs("onMouseLeave",["mouseout","mouseover"]);cs("onPointerEnter",["pointerout","pointerover"]);cs("onPointerLeave",["pointerout","pointerover"]);la("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));la("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));la("onBeforeInput",["compositionend","keypress","textInput","paste"]);la("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));la("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));la("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vl="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(" "),Oz=new Set("cancel close invalid load scroll toggle".split(" ").concat(vl));function xw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,P6(n,t,void 0,e),e.currentTarget=null}function N$(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 i=void 0;if(t)for(var a=n.length-1;0<=a;a--){var l=n[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;xw(o,l,u),i=c}else for(a=0;a<n.length;a++){if(l=n[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;xw(o,l,u),i=c}}}if(wd)throw e=uv,wd=!1,uv=null,e}function ot(e,t){var r=t[wv];r===void 0&&(r=t[wv]=new Set);var n=e+"__bubble";r.has(n)||(A$(t,e,2,!1),r.add(n))}function Gm(e,t,r){var n=0;t&&(n|=4),A$(r,e,n,t)}var iu="_reactListening"+Math.random().toString(36).slice(2);function Ql(e){if(!e[iu]){e[iu]=!0,UE.forEach(function(r){r!=="selectionchange"&&(Oz.has(r)||Gm(r,!1,e),Gm(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[iu]||(t[iu]=!0,Gm("selectionchange",!1,t))}}function A$(e,t,r,n){switch(x$(t)){case 1:var o=F6;break;case 4:o=V6;break;default:o=qy}r=o.bind(null,t,r,e),o=void 0,!cv||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 qm(e,t,r,n,o){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var l=n.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=zi(l),a===null)return;if(c=a.tag,c===5||c===6){n=i=a;continue e}l=l.parentNode}}n=n.return}i$(function(){var u=i,d=Uy(r),p=[];e:{var h=D$.get(e);if(h!==void 0){var m=Ky,v=e;switch(e){case"keypress":if(Ju(r)===0)break e;case"keydown":case"keyup":m=rz;break;case"focusin":v="focus",m=Fm;break;case"focusout":v="blur",m=Fm;break;case"beforeblur":case"afterblur":m=Fm;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=sw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=W6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=iz;break;case k$:case R$:case T$:m=q6;break;case I$:m=sz;break;case"scroll":m=B6;break;case"wheel":m=cz;break;case"copy":case"cut":case"paste":m=K6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=cw}var g=(t&4)!==0,b=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var x=u,_;x!==null;){_=x;var w=_.stateNode;if(_.tag===5&&w!==null&&(_=w,y!==null&&(w=Bl(x,y),w!=null&&g.push(Kl(x,w,_)))),b)break;x=x.return}0<g.length&&(h=new m(h,v,null,r,d),p.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==sv&&(v=r.relatedTarget||r.fromElement)&&(zi(v)||v[bo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=r.relatedTarget||r.toElement,m=u,v=v?zi(v):null,v!==null&&(b=ca(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(g=sw,w="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=cw,w="onPointerLeave",y="onPointerEnter",x="pointer"),b=m==null?h:Va(m),_=v==null?h:Va(v),h=new g(w,x+"leave",m,r,d),h.target=b,h.relatedTarget=_,w=null,zi(d)===u&&(g=new g(y,x+"enter",v,r,d),g.target=_,g.relatedTarget=b,w=g),b=w,m&&v)t:{for(g=m,y=v,x=0,_=g;_;_=ja(_))x++;for(_=0,w=y;w;w=ja(w))_++;for(;0<x-_;)g=ja(g),x--;for(;0<_-x;)y=ja(y),_--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=ja(g),y=ja(y)}g=null}else g=null;m!==null&&ww(p,h,m,g,!1),v!==null&&b!==null&&ww(p,b,v,g,!0)}}e:{if(h=u?Va(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var O=gz;else if(fw(h))if(j$)O=wz;else{O=yz;var C=vz}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(O=xz);if(O&&(O=O(e,u))){P$(p,O,r,d);break e}C&&C(e,h,u),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&rv(h,"number",h.value)}switch(C=u?Va(u):window,e){case"focusin":(fw(C)||C.contentEditable==="true")&&(za=C,hv=u,Ol=null);break;case"focusout":Ol=hv=za=null;break;case"mousedown":mv=!0;break;case"contextmenu":case"mouseup":case"dragend":mv=!1,vw(p,r,d);break;case"selectionchange":if(Sz)break;case"keydown":case"keyup":vw(p,r,d)}var P;if(Xy)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else La?b$(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(_$&&r.locale!=="ko"&&(La||E!=="onCompositionStart"?E==="onCompositionEnd"&&La&&(P=w$()):(Zo=d,Qy="value"in Zo?Zo.value:Zo.textContent,La=!0)),C=jd(u,E),0<C.length&&(E=new lw(E,e,null,r,d),p.push({event:E,listeners:C}),P?E.data=P:(P=S$(r),P!==null&&(E.data=P)))),(P=dz?fz(e,r):pz(e,r))&&(u=jd(u,"onBeforeInput"),0<u.length&&(d=new lw("onBeforeInput","beforeinput",null,r,d),p.push({event:d,listeners:u}),d.data=P))}N$(p,t)})}function Kl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function jd(e,t){for(var r=t+"Capture",n=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Bl(e,r),i!=null&&n.unshift(Kl(e,i,o)),i=Bl(e,t),i!=null&&n.push(Kl(e,i,o))),e=e.return}return n}function ja(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ww(e,t,r,n,o){for(var i=t._reactName,a=[];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=Bl(r,i),c!=null&&a.unshift(Kl(r,c,l))):o||(c=Bl(r,i),c!=null&&a.push(Kl(r,c,l)))),r=r.return}a.length!==0&&e.push({event:t,listeners:a})}var Cz=/\r\n?/g,Ez=/\u0000|\uFFFD/g;function _w(e){return(typeof e=="string"?e:""+e).replace(Cz,`
85
- `).replace(Ez,"")}function au(e,t,r){if(t=_w(t),_w(e)!==t&&r)throw Error(G(425))}function Od(){}var gv=null,vv=null;function yv(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 xv=typeof setTimeout=="function"?setTimeout:void 0,$z=typeof clearTimeout=="function"?clearTimeout:void 0,bw=typeof Promise=="function"?Promise:void 0,kz=typeof queueMicrotask=="function"?queueMicrotask:typeof bw<"u"?function(e){return bw.resolve(null).then(e).catch(Rz)}:xv;function Rz(e){setTimeout(function(){throw e})}function Qm(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),Hl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=o}while(r);Hl(t)}function ai(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 Sw(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 ks=Math.random().toString(36).slice(2),Gn="__reactFiber$"+ks,Yl="__reactProps$"+ks,bo="__reactContainer$"+ks,wv="__reactEvents$"+ks,Tz="__reactListeners$"+ks,Iz="__reactHandles$"+ks;function zi(e){var t=e[Gn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[bo]||r[Gn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Sw(e);e!==null;){if(r=e[Gn])return r;e=Sw(e)}return t}e=r,r=e.parentNode}return null}function vc(e){return e=e[Gn]||e[bo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Va(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Ah(e){return e[Yl]||null}var _v=[],Ba=-1;function wi(e){return{current:e}}function at(e){0>Ba||(e.current=_v[Ba],_v[Ba]=null,Ba--)}function Ze(e,t){Ba++,_v[Ba]=e.current,e.current=t}var pi={},ar=wi(pi),jr=wi(!1),Qi=pi;function us(e,t){var r=e.type.contextTypes;if(!r)return pi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Or(e){return e=e.childContextTypes,e!=null}function Cd(){at(jr),at(ar)}function Pw(e,t,r){if(ar.current!==pi)throw Error(G(168));Ze(ar,t),Ze(jr,r)}function M$(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(G(108,v6(e)||"Unknown",o));return wt({},r,n)}function Ed(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pi,Qi=ar.current,Ze(ar,e),Ze(jr,jr.current),!0}function jw(e,t,r){var n=e.stateNode;if(!n)throw Error(G(169));r?(e=M$(e,t,Qi),n.__reactInternalMemoizedMergedChildContext=e,at(jr),at(ar),Ze(ar,e)):at(jr),Ze(jr,r)}var uo=null,Mh=!1,Km=!1;function L$(e){uo===null?uo=[e]:uo.push(e)}function Dz(e){Mh=!0,L$(e)}function _i(){if(!Km&&uo!==null){Km=!0;var e=0,t=Ge;try{var r=uo;for(Ge=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}uo=null,Mh=!1}catch(o){throw uo!==null&&(uo=uo.slice(e+1)),c$(Wy,_i),o}finally{Ge=t,Km=!1}}return null}var Ua=[],Wa=0,$d=null,kd=0,Jr=[],Zr=0,Ki=null,po=1,ho="";function Ii(e,t){Ua[Wa++]=kd,Ua[Wa++]=$d,$d=e,kd=t}function z$(e,t,r){Jr[Zr++]=po,Jr[Zr++]=ho,Jr[Zr++]=Ki,Ki=e;var n=po;e=ho;var o=32-wn(n)-1;n&=~(1<<o),r+=1;var i=32-wn(t)+o;if(30<i){var a=o-o%5;i=(n&(1<<a)-1).toString(32),n>>=a,o-=a,po=1<<32-wn(t)+o|r<<o|n,ho=i+e}else po=1<<i|r<<o|n,ho=e}function Zy(e){e.return!==null&&(Ii(e,1),z$(e,1,0))}function e0(e){for(;e===$d;)$d=Ua[--Wa],Ua[Wa]=null,kd=Ua[--Wa],Ua[Wa]=null;for(;e===Ki;)Ki=Jr[--Zr],Jr[Zr]=null,ho=Jr[--Zr],Jr[Zr]=null,po=Jr[--Zr],Jr[Zr]=null}var Fr=null,Lr=null,ut=!1,yn=null;function F$(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 Ow(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,Fr=e,Lr=ai(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fr=e,Lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ki!==null?{id:po,overflow:ho}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=en(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Fr=e,Lr=null,!0):!1;default:return!1}}function bv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Sv(e){if(ut){var t=Lr;if(t){var r=t;if(!Ow(e,t)){if(bv(e))throw Error(G(418));t=ai(r.nextSibling);var n=Fr;t&&Ow(e,t)?F$(n,r):(e.flags=e.flags&-4097|2,ut=!1,Fr=e)}}else{if(bv(e))throw Error(G(418));e.flags=e.flags&-4097|2,ut=!1,Fr=e}}}function Cw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fr=e}function su(e){if(e!==Fr)return!1;if(!ut)return Cw(e),ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!yv(e.type,e.memoizedProps)),t&&(t=Lr)){if(bv(e))throw V$(),Error(G(418));for(;t;)F$(e,t),t=ai(t.nextSibling)}if(Cw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Lr=ai(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Lr=null}}else Lr=Fr?ai(e.stateNode.nextSibling):null;return!0}function V$(){for(var e=Lr;e;)e=ai(e.nextSibling)}function ds(){Lr=Fr=null,ut=!1}function t0(e){yn===null?yn=[e]:yn.push(e)}var Nz=Ro.ReactCurrentBatchConfig;function mn(e,t){if(e&&e.defaultProps){t=wt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var Rd=wi(null),Td=null,Ha=null,r0=null;function n0(){r0=Ha=Td=null}function o0(e){var t=Rd.current;at(Rd),e._currentValue=t}function Pv(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 rs(e,t){Td=e,r0=Ha=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Sr=!0),e.firstContext=null)}function sn(e){var t=e._currentValue;if(r0!==e)if(e={context:e,memoizedValue:t,next:null},Ha===null){if(Td===null)throw Error(G(308));Ha=e,Td.dependencies={lanes:0,firstContext:e}}else Ha=Ha.next=e;return t}var Fi=null;function i0(e){Fi===null?Fi=[e]:Fi.push(e)}function B$(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,i0(t)):(r.next=o.next,o.next=r),t.interleaved=r,So(e,n)}function So(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 Qo=!1;function a0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U$(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 go(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ne&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,So(e,r)}return o=n.interleaved,o===null?(t.next=t,i0(n)):(t.next=o.next,o.next=t),n.interleaved=t,So(e,r)}function Zu(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,Hy(e,r)}}function Ew(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var o=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?o=i=a:i=i.next=a,r=r.next}while(r!==null);i===null?o=i=t:i=i.next=t}else o=i=t;r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 Id(e,t,r,n){var o=e.updateQueue;Qo=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var p=o.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(h=t,m=r,g.tag){case 1:if(v=g.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=wt({},p,h);break e;case 2:Qo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,a|=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 a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Xi|=a,e.lanes=a,e.memoizedState=p}}function $w(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],o=n.callback;if(o!==null){if(n.callback=null,n=r,typeof o!="function")throw Error(G(191,o));o.call(n)}}}var W$=new BE.Component().refs;function jv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:wt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Lh={isMounted:function(e){return(e=e._reactInternals)?ca(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=ur(),o=ci(e),i=go(n,o);i.payload=t,r!=null&&(i.callback=r),t=si(e,i,o),t!==null&&(_n(t,e,o,n),Zu(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=ur(),o=ci(e),i=go(n,o);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=si(e,i,o),t!==null&&(_n(t,e,o,n),Zu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ur(),n=ci(e),o=go(r,n);o.tag=2,t!=null&&(o.callback=t),t=si(e,o,n),t!==null&&(_n(t,e,n,r),Zu(t,e,n))}};function kw(e,t,r,n,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,a):t.prototype&&t.prototype.isPureReactComponent?!ql(r,n)||!ql(o,i):!0}function H$(e,t,r){var n=!1,o=pi,i=t.contextType;return typeof i=="object"&&i!==null?i=sn(i):(o=Or(t)?Qi:ar.current,n=t.contextTypes,i=(n=n!=null)?us(e,o):pi),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Rw(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&&Lh.enqueueReplaceState(t,t.state,null)}function Ov(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs=W$,a0(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=sn(i):(i=Or(t)?Qi:ar.current,o.context=us(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(jv(e,t,i,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&&Lh.enqueueReplaceState(o,o.state,null),Id(e,r,o,n),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ys(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(G(309));var n=r.stateNode}if(!n)throw Error(G(147,e));var o=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;l===W$&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function lu(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Tw(e){var t=e._init;return t(e._payload)}function G$(e){function t(y,x){if(e){var _=y.deletions;_===null?(y.deletions=[x],y.flags|=16):_.push(x)}}function r(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function n(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function o(y,x){return y=ui(y,x),y.index=0,y.sibling=null,y}function i(y,x,_){return y.index=_,e?(_=y.alternate,_!==null?(_=_.index,_<x?(y.flags|=2,x):_):(y.flags|=2,x)):(y.flags|=1048576,x)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,_,w){return x===null||x.tag!==6?(x=rg(_,y.mode,w),x.return=y,x):(x=o(x,_),x.return=y,x)}function c(y,x,_,w){var O=_.type;return O===Ma?d(y,x,_.props.children,w,_.key):x!==null&&(x.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===qo&&Tw(O)===x.type)?(w=o(x,_.props),w.ref=Ys(y,x,_),w.return=y,w):(w=id(_.type,_.key,_.props,null,y.mode,w),w.ref=Ys(y,x,_),w.return=y,w)}function u(y,x,_,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==_.containerInfo||x.stateNode.implementation!==_.implementation?(x=ng(_,y.mode,w),x.return=y,x):(x=o(x,_.children||[]),x.return=y,x)}function d(y,x,_,w,O){return x===null||x.tag!==7?(x=Hi(_,y.mode,w,O),x.return=y,x):(x=o(x,_),x.return=y,x)}function p(y,x,_){if(typeof x=="string"&&x!==""||typeof x=="number")return x=rg(""+x,y.mode,_),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Xc:return _=id(x.type,x.key,x.props,null,y.mode,_),_.ref=Ys(y,null,x),_.return=y,_;case Aa:return x=ng(x,y.mode,_),x.return=y,x;case qo:var w=x._init;return p(y,w(x._payload),_)}if(ml(x)||Hs(x))return x=Hi(x,y.mode,_,null),x.return=y,x;lu(y,x)}return null}function h(y,x,_,w){var O=x!==null?x.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return O!==null?null:l(y,x,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Xc:return _.key===O?c(y,x,_,w):null;case Aa:return _.key===O?u(y,x,_,w):null;case qo:return O=_._init,h(y,x,O(_._payload),w)}if(ml(_)||Hs(_))return O!==null?null:d(y,x,_,w,null);lu(y,_)}return null}function m(y,x,_,w,O){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(_)||null,l(x,y,""+w,O);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Xc:return y=y.get(w.key===null?_:w.key)||null,c(x,y,w,O);case Aa:return y=y.get(w.key===null?_:w.key)||null,u(x,y,w,O);case qo:var C=w._init;return m(y,x,_,C(w._payload),O)}if(ml(w)||Hs(w))return y=y.get(_)||null,d(x,y,w,O,null);lu(x,w)}return null}function v(y,x,_,w){for(var O=null,C=null,P=x,E=x=0,k=null;P!==null&&E<_.length;E++){P.index>E?(k=P,P=null):k=P.sibling;var $=h(y,P,_[E],w);if($===null){P===null&&(P=k);break}e&&P&&$.alternate===null&&t(y,P),x=i($,x,E),C===null?O=$:C.sibling=$,C=$,P=k}if(E===_.length)return r(y,P),ut&&Ii(y,E),O;if(P===null){for(;E<_.length;E++)P=p(y,_[E],w),P!==null&&(x=i(P,x,E),C===null?O=P:C.sibling=P,C=P);return ut&&Ii(y,E),O}for(P=n(y,P);E<_.length;E++)k=m(P,y,E,_[E],w),k!==null&&(e&&k.alternate!==null&&P.delete(k.key===null?E:k.key),x=i(k,x,E),C===null?O=k:C.sibling=k,C=k);return e&&P.forEach(function(I){return t(y,I)}),ut&&Ii(y,E),O}function g(y,x,_,w){var O=Hs(_);if(typeof O!="function")throw Error(G(150));if(_=O.call(_),_==null)throw Error(G(151));for(var C=O=null,P=x,E=x=0,k=null,$=_.next();P!==null&&!$.done;E++,$=_.next()){P.index>E?(k=P,P=null):k=P.sibling;var I=h(y,P,$.value,w);if(I===null){P===null&&(P=k);break}e&&P&&I.alternate===null&&t(y,P),x=i(I,x,E),C===null?O=I:C.sibling=I,C=I,P=k}if($.done)return r(y,P),ut&&Ii(y,E),O;if(P===null){for(;!$.done;E++,$=_.next())$=p(y,$.value,w),$!==null&&(x=i($,x,E),C===null?O=$:C.sibling=$,C=$);return ut&&Ii(y,E),O}for(P=n(y,P);!$.done;E++,$=_.next())$=m(P,y,E,$.value,w),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?E:$.key),x=i($,x,E),C===null?O=$:C.sibling=$,C=$);return e&&P.forEach(function(T){return t(y,T)}),ut&&Ii(y,E),O}function b(y,x,_,w){if(typeof _=="object"&&_!==null&&_.type===Ma&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Xc:e:{for(var O=_.key,C=x;C!==null;){if(C.key===O){if(O=_.type,O===Ma){if(C.tag===7){r(y,C.sibling),x=o(C,_.props.children),x.return=y,y=x;break e}}else if(C.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===qo&&Tw(O)===C.type){r(y,C.sibling),x=o(C,_.props),x.ref=Ys(y,C,_),x.return=y,y=x;break e}r(y,C);break}else t(y,C);C=C.sibling}_.type===Ma?(x=Hi(_.props.children,y.mode,w,_.key),x.return=y,y=x):(w=id(_.type,_.key,_.props,null,y.mode,w),w.ref=Ys(y,x,_),w.return=y,y=w)}return a(y);case Aa:e:{for(C=_.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===_.containerInfo&&x.stateNode.implementation===_.implementation){r(y,x.sibling),x=o(x,_.children||[]),x.return=y,y=x;break e}else{r(y,x);break}else t(y,x);x=x.sibling}x=ng(_,y.mode,w),x.return=y,y=x}return a(y);case qo:return C=_._init,b(y,x,C(_._payload),w)}if(ml(_))return v(y,x,_,w);if(Hs(_))return g(y,x,_,w);lu(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,x!==null&&x.tag===6?(r(y,x.sibling),x=o(x,_),x.return=y,y=x):(r(y,x),x=rg(_,y.mode,w),x.return=y,y=x),a(y)):r(y,x)}return b}var fs=G$(!0),q$=G$(!1),yc={},Yn=wi(yc),Xl=wi(yc),Jl=wi(yc);function Vi(e){if(e===yc)throw Error(G(174));return e}function s0(e,t){switch(Ze(Jl,t),Ze(Xl,e),Ze(Yn,yc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ov(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ov(t,e)}at(Yn),Ze(Yn,t)}function ps(){at(Yn),at(Xl),at(Jl)}function Q$(e){Vi(Jl.current);var t=Vi(Yn.current),r=ov(t,e.type);t!==r&&(Ze(Xl,e),Ze(Yn,r))}function l0(e){Xl.current===e&&(at(Yn),at(Xl))}var yt=wi(0);function Dd(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 Ym=[];function c0(){for(var e=0;e<Ym.length;e++)Ym[e]._workInProgressVersionPrimary=null;Ym.length=0}var ed=Ro.ReactCurrentDispatcher,Xm=Ro.ReactCurrentBatchConfig,Yi=0,xt=null,Mt=null,Ft=null,Nd=!1,Cl=!1,Zl=0,Az=0;function Zt(){throw Error(G(321))}function u0(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!bn(e[r],t[r]))return!1;return!0}function d0(e,t,r,n,o,i){if(Yi=i,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ed.current=e===null||e.memoizedState===null?Fz:Vz,e=r(n,o),Cl){i=0;do{if(Cl=!1,Zl=0,25<=i)throw Error(G(301));i+=1,Ft=Mt=null,t.updateQueue=null,ed.current=Bz,e=r(n,o)}while(Cl)}if(ed.current=Ad,t=Mt!==null&&Mt.next!==null,Yi=0,Ft=Mt=xt=null,Nd=!1,t)throw Error(G(300));return e}function f0(){var e=Zl!==0;return Zl=0,e}function Vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?xt.memoizedState=Ft=e:Ft=Ft.next=e,Ft}function ln(){if(Mt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=Ft===null?xt.memoizedState:Ft.next;if(t!==null)Ft=t,Mt=e;else{if(e===null)throw Error(G(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Ft===null?xt.memoizedState=Ft=e:Ft=Ft.next=e}return Ft}function ec(e,t){return typeof t=="function"?t(e):t}function Jm(e){var t=ln(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=Mt,o=n.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}n.baseQueue=o=i,r.pending=null}if(o!==null){i=o.next,n=n.baseState;var l=a=null,c=null,u=i;do{var d=u.lane;if((Yi&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,a=n):c=c.next=p,xt.lanes|=d,Xi|=d}u=u.next}while(u!==null&&u!==i);c===null?a=n:c.next=l,bn(n,t.memoizedState)||(Sr=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){o=e;do i=o.lane,xt.lanes|=i,Xi|=i,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Zm(e){var t=ln(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=r.dispatch,o=r.pending,i=t.memoizedState;if(o!==null){r.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);bn(i,t.memoizedState)||(Sr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function K$(){}function Y$(e,t){var r=xt,n=ln(),o=t(),i=!bn(n.memoizedState,o);if(i&&(n.memoizedState=o,Sr=!0),n=n.queue,p0(Z$.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Ft!==null&&Ft.memoizedState.tag&1){if(r.flags|=2048,tc(9,J$.bind(null,r,n,o,t),void 0,null),Bt===null)throw Error(G(349));Yi&30||X$(r,t,o)}return o}function X$(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function J$(e,t,r,n){t.value=r,t.getSnapshot=n,e2(t)&&t2(e)}function Z$(e,t,r){return r(function(){e2(t)&&t2(e)})}function e2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bn(e,r)}catch{return!0}}function t2(e){var t=So(e,1);t!==null&&_n(t,e,1,-1)}function Iw(e){var t=Vn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ec,lastRenderedState:e},t.queue=e,e=e.dispatch=zz.bind(null,xt,e),[t.memoizedState,e]}function tc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.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 r2(){return ln().memoizedState}function td(e,t,r,n){var o=Vn();xt.flags|=e,o.memoizedState=tc(1|t,r,void 0,n===void 0?null:n)}function zh(e,t,r,n){var o=ln();n=n===void 0?null:n;var i=void 0;if(Mt!==null){var a=Mt.memoizedState;if(i=a.destroy,n!==null&&u0(n,a.deps)){o.memoizedState=tc(t,r,i,n);return}}xt.flags|=e,o.memoizedState=tc(1|t,r,i,n)}function Dw(e,t){return td(8390656,8,e,t)}function p0(e,t){return zh(2048,8,e,t)}function n2(e,t){return zh(4,2,e,t)}function o2(e,t){return zh(4,4,e,t)}function i2(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function a2(e,t,r){return r=r!=null?r.concat([e]):null,zh(4,4,i2.bind(null,t,e),r)}function h0(){}function s2(e,t){var r=ln();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&u0(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function l2(e,t){var r=ln();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&u0(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function c2(e,t,r){return Yi&21?(bn(r,t)||(r=f$(),xt.lanes|=r,Xi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Sr=!0),e.memoizedState=r)}function Mz(e,t){var r=Ge;Ge=r!==0&&4>r?r:4,e(!0);var n=Xm.transition;Xm.transition={};try{e(!1),t()}finally{Ge=r,Xm.transition=n}}function u2(){return ln().memoizedState}function Lz(e,t,r){var n=ci(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},d2(e))f2(t,r);else if(r=B$(e,t,r,n),r!==null){var o=ur();_n(r,e,n,o),p2(r,t,n)}}function zz(e,t,r){var n=ci(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(d2(e))f2(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,r);if(o.hasEagerState=!0,o.eagerState=l,bn(l,a)){var c=t.interleaved;c===null?(o.next=o,i0(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}r=B$(e,t,o,n),r!==null&&(o=ur(),_n(r,e,n,o),p2(r,t,n))}}function d2(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function f2(e,t){Cl=Nd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function p2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Hy(e,r)}}var Ad={readContext:sn,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useInsertionEffect:Zt,useLayoutEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useMutableSource:Zt,useSyncExternalStore:Zt,useId:Zt,unstable_isNewReconciler:!1},Fz={readContext:sn,useCallback:function(e,t){return Vn().memoizedState=[e,t===void 0?null:t],e},useContext:sn,useEffect:Dw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,td(4194308,4,i2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return td(4194308,4,e,t)},useInsertionEffect:function(e,t){return td(4,2,e,t)},useMemo:function(e,t){var r=Vn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Vn();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=Lz.bind(null,xt,e),[n.memoizedState,e]},useRef:function(e){var t=Vn();return e={current:e},t.memoizedState=e},useState:Iw,useDebugValue:h0,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Iw(!1),t=e[0];return e=Mz.bind(null,e[1]),Vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=xt,o=Vn();if(ut){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Bt===null)throw Error(G(349));Yi&30||X$(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,Dw(Z$.bind(null,n,i,e),[e]),n.flags|=2048,tc(9,J$.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Vn(),t=Bt.identifierPrefix;if(ut){var r=ho,n=po;r=(n&~(1<<32-wn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Zl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Az++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Vz={readContext:sn,useCallback:s2,useContext:sn,useEffect:p0,useImperativeHandle:a2,useInsertionEffect:n2,useLayoutEffect:o2,useMemo:l2,useReducer:Jm,useRef:r2,useState:function(){return Jm(ec)},useDebugValue:h0,useDeferredValue:function(e){var t=ln();return c2(t,Mt.memoizedState,e)},useTransition:function(){var e=Jm(ec)[0],t=ln().memoizedState;return[e,t]},useMutableSource:K$,useSyncExternalStore:Y$,useId:u2,unstable_isNewReconciler:!1},Bz={readContext:sn,useCallback:s2,useContext:sn,useEffect:p0,useImperativeHandle:a2,useInsertionEffect:n2,useLayoutEffect:o2,useMemo:l2,useReducer:Zm,useRef:r2,useState:function(){return Zm(ec)},useDebugValue:h0,useDeferredValue:function(e){var t=ln();return Mt===null?t.memoizedState=e:c2(t,Mt.memoizedState,e)},useTransition:function(){var e=Zm(ec)[0],t=ln().memoizedState;return[e,t]},useMutableSource:K$,useSyncExternalStore:Y$,useId:u2,unstable_isNewReconciler:!1};function hs(e,t){try{var r="",n=t;do r+=g6(n),n=n.return;while(n);var o=r}catch(i){o=`
84
+ `+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Dm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?hl(e):""}function gz(e){switch(e.tag){case 5:return hl(e.type);case 16:return hl("Lazy");case 13:return hl("Suspense");case 19:return hl("SuspenseList");case 0:case 2:case 15:return e=Nm(e.type,!1),e;case 11:return e=Nm(e.type.render,!1),e;case 1:return e=Nm(e.type,!0),e;default:return""}}function Zg(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 Ma:return"Fragment";case Aa:return"Portal";case Yg:return"Profiler";case Fy:return"StrictMode";case Xg:return"Suspense";case Jg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case HE:return(e.displayName||"Context")+".Consumer";case WE:return(e._context.displayName||"Context")+".Provider";case Vy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case By:return t=e.displayName||null,t!==null?t:Zg(e.type)||"Memo";case qo:t=e._payload,e=e._init;try{return Zg(e(t))}catch{}}return null}function vz(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zg(t);case 8:return t===Fy?"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 fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yz(e){var t=qE(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jc(e){e._valueTracker||(e._valueTracker=yz(e))}function QE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=qE(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function yd(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 ev(e,t){var r=t.checked;return wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function X1(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=fi(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 KE(e,t){t=t.checked,t!=null&&zy(e,"checked",t,!1)}function tv(e,t){KE(e,t);var r=fi(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")?rv(e,t.type,r):t.hasOwnProperty("defaultValue")&&rv(e,t.type,fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function J1(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 rv(e,t,r){(t!=="number"||yd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ml=Array.isArray;function Ja(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=""+fi(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 nv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return wt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Z1(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(ml(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:fi(r)}}function YE(e,t){var r=fi(t.value),n=fi(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 ew(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function XE(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 ov(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?XE(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zc,JE=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(Zc=Zc||document.createElement("div"),Zc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xz=["Webkit","ms","Moz","O"];Object.keys(bl).forEach(function(e){xz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bl[t]=bl[e]})});function ZE(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||bl.hasOwnProperty(e)&&bl[e]?(""+t).trim():t+"px"}function e$(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=ZE(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var wz=wt({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 iv(e,t){if(t){if(wz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function av(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 sv=null;function Uy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var lv=null,Za=null,es=null;function tw(e){if(e=vc(e)){if(typeof lv!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Ah(t),lv(e.stateNode,e.type,t))}}function t$(e){Za?es?es.push(e):es=[e]:Za=e}function r$(){if(Za){var e=Za,t=es;if(es=Za=null,tw(e),t)for(e=0;e<t.length;e++)tw(t[e])}}function n$(e,t){return e(t)}function o$(){}var Am=!1;function i$(e,t,r){if(Am)return e(t,r);Am=!0;try{return n$(e,t,r)}finally{Am=!1,(Za!==null||es!==null)&&(o$(),r$())}}function Bl(e,t){var r=e.stateNode;if(r===null)return null;var n=Ah(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var cv=!1;if(_o)try{var Gs={};Object.defineProperty(Gs,"passive",{get:function(){cv=!0}}),window.addEventListener("test",Gs,Gs),window.removeEventListener("test",Gs,Gs)}catch{cv=!1}function _z(e,t,r,n,o,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Sl=!1,xd=null,wd=!1,uv=null,bz={onError:function(e){Sl=!0,xd=e}};function Sz(e,t,r,n,o,i,a,l,c){Sl=!1,xd=null,_z.apply(bz,arguments)}function Pz(e,t,r,n,o,i,a,l,c){if(Sz.apply(this,arguments),Sl){if(Sl){var u=xd;Sl=!1,xd=null}else throw Error(G(198));wd||(wd=!0,uv=u)}}function ca(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function a$(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function rw(e){if(ca(e)!==e)throw Error(G(188))}function jz(e){var t=e.alternate;if(!t){if(t=ca(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,n=t;;){var o=r.return;if(o===null)break;var i=o.alternate;if(i===null){if(n=o.return,n!==null){r=n;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===r)return rw(o),e;if(i===n)return rw(o),t;i=i.sibling}throw Error(G(188))}if(r.return!==n.return)r=o,n=i;else{for(var a=!1,l=o.child;l;){if(l===r){a=!0,r=o,n=i;break}if(l===n){a=!0,n=o,r=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===r){a=!0,r=i,n=o;break}if(l===n){a=!0,n=i,r=o;break}l=l.sibling}if(!a)throw Error(G(189))}}if(r.alternate!==n)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function s$(e){return e=jz(e),e!==null?l$(e):null}function l$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=l$(e);if(t!==null)return t;e=e.sibling}return null}var c$=Br.unstable_scheduleCallback,nw=Br.unstable_cancelCallback,Oz=Br.unstable_shouldYield,Cz=Br.unstable_requestPaint,$t=Br.unstable_now,Ez=Br.unstable_getCurrentPriorityLevel,Wy=Br.unstable_ImmediatePriority,u$=Br.unstable_UserBlockingPriority,_d=Br.unstable_NormalPriority,$z=Br.unstable_LowPriority,d$=Br.unstable_IdlePriority,Th=null,Kn=null;function kz(e){if(Kn&&typeof Kn.onCommitFiberRoot=="function")try{Kn.onCommitFiberRoot(Th,e,void 0,(e.current.flags&128)===128)}catch{}}var wn=Math.clz32?Math.clz32:Iz,Rz=Math.log,Tz=Math.LN2;function Iz(e){return e>>>=0,e===0?32:31-(Rz(e)/Tz|0)|0}var eu=64,tu=4194304;function gl(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 bd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~o;l!==0?n=gl(l):(i&=a,i!==0&&(n=gl(i)))}else a=r&~o,a!==0?n=gl(a):i!==0&&(n=gl(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&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-wn(t),o=1<<r,n|=e[r],t&=~o;return n}function Dz(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nz(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-wn(i),l=1<<a,c=o[a];c===-1?(!(l&r)||l&n)&&(o[a]=Dz(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function dv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function f$(){var e=eu;return eu<<=1,!(eu&4194240)&&(eu=64),e}function Mm(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function mc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wn(t),e[t]=r}function Az(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-wn(r),i=1<<o;t[o]=0,n[o]=-1,e[o]=-1,r&=~i}}function Hy(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-wn(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}var Ge=0;function p$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var h$,Gy,m$,g$,v$,fv=!1,ru=[],ni=null,oi=null,ii=null,Ul=new Map,Wl=new Map,Xo=[],Mz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ow(e,t){switch(e){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Ul.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wl.delete(t.pointerId)}}function qs(e,t,r,n,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[o]},t!==null&&(t=vc(t),t!==null&&Gy(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Lz(e,t,r,n,o){switch(t){case"focusin":return ni=qs(ni,e,t,r,n,o),!0;case"dragenter":return oi=qs(oi,e,t,r,n,o),!0;case"mouseover":return ii=qs(ii,e,t,r,n,o),!0;case"pointerover":var i=o.pointerId;return Ul.set(i,qs(Ul.get(i)||null,e,t,r,n,o)),!0;case"gotpointercapture":return i=o.pointerId,Wl.set(i,qs(Wl.get(i)||null,e,t,r,n,o)),!0}return!1}function y$(e){var t=zi(e.target);if(t!==null){var r=ca(t);if(r!==null){if(t=r.tag,t===13){if(t=a$(r),t!==null){e.blockedOn=t,v$(e.priority,function(){m$(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 Yu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=pv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);sv=n,r.target.dispatchEvent(n),sv=null}else return t=vc(r),t!==null&&Gy(t),e.blockedOn=r,!1;t.shift()}return!0}function iw(e,t,r){Yu(e)&&r.delete(t)}function zz(){fv=!1,ni!==null&&Yu(ni)&&(ni=null),oi!==null&&Yu(oi)&&(oi=null),ii!==null&&Yu(ii)&&(ii=null),Ul.forEach(iw),Wl.forEach(iw)}function Qs(e,t){e.blockedOn===t&&(e.blockedOn=null,fv||(fv=!0,Br.unstable_scheduleCallback(Br.unstable_NormalPriority,zz)))}function Hl(e){function t(o){return Qs(o,e)}if(0<ru.length){Qs(ru[0],e);for(var r=1;r<ru.length;r++){var n=ru[r];n.blockedOn===e&&(n.blockedOn=null)}}for(ni!==null&&Qs(ni,e),oi!==null&&Qs(oi,e),ii!==null&&Qs(ii,e),Ul.forEach(t),Wl.forEach(t),r=0;r<Xo.length;r++)n=Xo[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Xo.length&&(r=Xo[0],r.blockedOn===null);)y$(r),r.blockedOn===null&&Xo.shift()}var ts=Ro.ReactCurrentBatchConfig,Sd=!0;function Fz(e,t,r,n){var o=Ge,i=ts.transition;ts.transition=null;try{Ge=1,qy(e,t,r,n)}finally{Ge=o,ts.transition=i}}function Vz(e,t,r,n){var o=Ge,i=ts.transition;ts.transition=null;try{Ge=4,qy(e,t,r,n)}finally{Ge=o,ts.transition=i}}function qy(e,t,r,n){if(Sd){var o=pv(e,t,r,n);if(o===null)qm(e,t,n,Pd,r),ow(e,n);else if(Lz(o,e,t,r,n))n.stopPropagation();else if(ow(e,n),t&4&&-1<Mz.indexOf(e)){for(;o!==null;){var i=vc(o);if(i!==null&&h$(i),i=pv(e,t,r,n),i===null&&qm(e,t,n,Pd,r),i===o)break;o=i}o!==null&&n.stopPropagation()}else qm(e,t,n,null,r)}}var Pd=null;function pv(e,t,r,n){if(Pd=null,e=Uy(n),e=zi(e),e!==null)if(t=ca(e),t===null)e=null;else if(r=t.tag,r===13){if(e=a$(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Pd=e,null}function x$(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ez()){case Wy:return 1;case u$:return 4;case _d:case $z:return 16;case d$:return 536870912;default:return 16}default:return 16}}var Zo=null,Qy=null,Xu=null;function w$(){if(Xu)return Xu;var e,t=Qy,r=t.length,n,o="value"in Zo?Zo.value:Zo.textContent,i=o.length;for(e=0;e<r&&t[e]===o[e];e++);var a=r-e;for(n=1;n<=a&&t[r-n]===o[i-n];n++);return Xu=o.slice(e,1<n?1-n:void 0)}function Ju(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 nu(){return!0}function aw(){return!1}function Hr(e){function t(r,n,o,i,a){this._reactName=r,this._targetInst=o,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?nu:aw,this.isPropagationStopped=aw,this}return wt(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=nu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=nu)},persist:function(){},isPersistent:nu}),t}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ky=Hr($s),gc=wt({},$s,{view:0,detail:0}),Bz=Hr(gc),Lm,zm,Ks,Ih=wt({},gc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yy,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!==Ks&&(Ks&&e.type==="mousemove"?(Lm=e.screenX-Ks.screenX,zm=e.screenY-Ks.screenY):zm=Lm=0,Ks=e),Lm)},movementY:function(e){return"movementY"in e?e.movementY:zm}}),sw=Hr(Ih),Uz=wt({},Ih,{dataTransfer:0}),Wz=Hr(Uz),Hz=wt({},gc,{relatedTarget:0}),Fm=Hr(Hz),Gz=wt({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),qz=Hr(Gz),Qz=wt({},$s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kz=Hr(Qz),Yz=wt({},$s,{data:0}),lw=Hr(Yz),Xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jz={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Zz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e6(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zz[e])?!!t[e]:!1}function Yy(){return e6}var t6=wt({},gc,{key:function(e){if(e.key){var t=Xz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ju(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Jz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yy,charCode:function(e){return e.type==="keypress"?Ju(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ju(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),r6=Hr(t6),n6=wt({},Ih,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cw=Hr(n6),o6=wt({},gc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yy}),i6=Hr(o6),a6=wt({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),s6=Hr(a6),l6=wt({},Ih,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),c6=Hr(l6),u6=[9,13,27,32],Xy=_o&&"CompositionEvent"in window,Pl=null;_o&&"documentMode"in document&&(Pl=document.documentMode);var d6=_o&&"TextEvent"in window&&!Pl,_$=_o&&(!Xy||Pl&&8<Pl&&11>=Pl),uw=String.fromCharCode(32),dw=!1;function b$(e,t){switch(e){case"keyup":return u6.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var La=!1;function f6(e,t){switch(e){case"compositionend":return S$(t);case"keypress":return t.which!==32?null:(dw=!0,uw);case"textInput":return e=t.data,e===uw&&dw?null:e;default:return null}}function p6(e,t){if(La)return e==="compositionend"||!Xy&&b$(e,t)?(e=w$(),Xu=Qy=Zo=null,La=!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 _$&&t.locale!=="ko"?null:t.data;default:return null}}var h6={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function fw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h6[e.type]:t==="textarea"}function P$(e,t,r,n){t$(n),t=jd(t,"onChange"),0<t.length&&(r=new Ky("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var jl=null,Gl=null;function m6(e){N$(e,0)}function Dh(e){var t=Va(e);if(QE(t))return e}function g6(e,t){if(e==="change")return t}var j$=!1;if(_o){var Vm;if(_o){var Bm="oninput"in document;if(!Bm){var pw=document.createElement("div");pw.setAttribute("oninput","return;"),Bm=typeof pw.oninput=="function"}Vm=Bm}else Vm=!1;j$=Vm&&(!document.documentMode||9<document.documentMode)}function hw(){jl&&(jl.detachEvent("onpropertychange",O$),Gl=jl=null)}function O$(e){if(e.propertyName==="value"&&Dh(Gl)){var t=[];P$(t,Gl,e,Uy(e)),i$(m6,t)}}function v6(e,t,r){e==="focusin"?(hw(),jl=t,Gl=r,jl.attachEvent("onpropertychange",O$)):e==="focusout"&&hw()}function y6(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dh(Gl)}function x6(e,t){if(e==="click")return Dh(t)}function w6(e,t){if(e==="input"||e==="change")return Dh(t)}function _6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bn=typeof Object.is=="function"?Object.is:_6;function ql(e,t){if(bn(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(!Kg.call(t,o)||!bn(e[o],t[o]))return!1}return!0}function mw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gw(e,t){var r=mw(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=mw(r)}}function C$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function E$(){for(var e=window,t=yd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yd(e.document)}return t}function Jy(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 b6(e){var t=E$(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&C$(r.ownerDocument.documentElement,r)){if(n!==null&&Jy(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,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=gw(r,i);var a=gw(r,n);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var S6=_o&&"documentMode"in document&&11>=document.documentMode,za=null,hv=null,Ol=null,mv=!1;function vw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;mv||za==null||za!==yd(n)||(n=za,"selectionStart"in n&&Jy(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}),Ol&&ql(Ol,n)||(Ol=n,n=jd(hv,"onSelect"),0<n.length&&(t=new Ky("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=za)))}function ou(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Fa={animationend:ou("Animation","AnimationEnd"),animationiteration:ou("Animation","AnimationIteration"),animationstart:ou("Animation","AnimationStart"),transitionend:ou("Transition","TransitionEnd")},Um={},$$={};_o&&($$=document.createElement("div").style,"AnimationEvent"in window||(delete Fa.animationend.animation,delete Fa.animationiteration.animation,delete Fa.animationstart.animation),"TransitionEvent"in window||delete Fa.transitionend.transition);function Nh(e){if(Um[e])return Um[e];if(!Fa[e])return e;var t=Fa[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in $$)return Um[e]=t[r];return e}var k$=Nh("animationend"),R$=Nh("animationiteration"),T$=Nh("animationstart"),I$=Nh("transitionend"),D$=new Map,yw="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 xi(e,t){D$.set(e,t),la(t,[e])}for(var Wm=0;Wm<yw.length;Wm++){var Hm=yw[Wm],P6=Hm.toLowerCase(),j6=Hm[0].toUpperCase()+Hm.slice(1);xi(P6,"on"+j6)}xi(k$,"onAnimationEnd");xi(R$,"onAnimationIteration");xi(T$,"onAnimationStart");xi("dblclick","onDoubleClick");xi("focusin","onFocus");xi("focusout","onBlur");xi(I$,"onTransitionEnd");cs("onMouseEnter",["mouseout","mouseover"]);cs("onMouseLeave",["mouseout","mouseover"]);cs("onPointerEnter",["pointerout","pointerover"]);cs("onPointerLeave",["pointerout","pointerover"]);la("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));la("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));la("onBeforeInput",["compositionend","keypress","textInput","paste"]);la("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));la("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));la("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),O6=new Set("cancel close invalid load scroll toggle".split(" ").concat(vl));function xw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,Pz(n,t,void 0,e),e.currentTarget=null}function N$(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 i=void 0;if(t)for(var a=n.length-1;0<=a;a--){var l=n[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;xw(o,l,u),i=c}else for(a=0;a<n.length;a++){if(l=n[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;xw(o,l,u),i=c}}}if(wd)throw e=uv,wd=!1,uv=null,e}function ot(e,t){var r=t[wv];r===void 0&&(r=t[wv]=new Set);var n=e+"__bubble";r.has(n)||(A$(t,e,2,!1),r.add(n))}function Gm(e,t,r){var n=0;t&&(n|=4),A$(r,e,n,t)}var iu="_reactListening"+Math.random().toString(36).slice(2);function Ql(e){if(!e[iu]){e[iu]=!0,UE.forEach(function(r){r!=="selectionchange"&&(O6.has(r)||Gm(r,!1,e),Gm(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[iu]||(t[iu]=!0,Gm("selectionchange",!1,t))}}function A$(e,t,r,n){switch(x$(t)){case 1:var o=Fz;break;case 4:o=Vz;break;default:o=qy}r=o.bind(null,t,r,e),o=void 0,!cv||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 qm(e,t,r,n,o){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var l=n.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=zi(l),a===null)return;if(c=a.tag,c===5||c===6){n=i=a;continue e}l=l.parentNode}}n=n.return}i$(function(){var u=i,d=Uy(r),p=[];e:{var h=D$.get(e);if(h!==void 0){var m=Ky,v=e;switch(e){case"keypress":if(Ju(r)===0)break e;case"keydown":case"keyup":m=r6;break;case"focusin":v="focus",m=Fm;break;case"focusout":v="blur",m=Fm;break;case"beforeblur":case"afterblur":m=Fm;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=sw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=i6;break;case k$:case R$:case T$:m=qz;break;case I$:m=s6;break;case"scroll":m=Bz;break;case"wheel":m=c6;break;case"copy":case"cut":case"paste":m=Kz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=cw}var g=(t&4)!==0,b=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var x=u,_;x!==null;){_=x;var w=_.stateNode;if(_.tag===5&&w!==null&&(_=w,y!==null&&(w=Bl(x,y),w!=null&&g.push(Kl(x,w,_)))),b)break;x=x.return}0<g.length&&(h=new m(h,v,null,r,d),p.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==sv&&(v=r.relatedTarget||r.fromElement)&&(zi(v)||v[bo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=r.relatedTarget||r.toElement,m=u,v=v?zi(v):null,v!==null&&(b=ca(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(g=sw,w="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=cw,w="onPointerLeave",y="onPointerEnter",x="pointer"),b=m==null?h:Va(m),_=v==null?h:Va(v),h=new g(w,x+"leave",m,r,d),h.target=b,h.relatedTarget=_,w=null,zi(d)===u&&(g=new g(y,x+"enter",v,r,d),g.target=_,g.relatedTarget=b,w=g),b=w,m&&v)t:{for(g=m,y=v,x=0,_=g;_;_=ja(_))x++;for(_=0,w=y;w;w=ja(w))_++;for(;0<x-_;)g=ja(g),x--;for(;0<_-x;)y=ja(y),_--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=ja(g),y=ja(y)}g=null}else g=null;m!==null&&ww(p,h,m,g,!1),v!==null&&b!==null&&ww(p,b,v,g,!0)}}e:{if(h=u?Va(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var O=g6;else if(fw(h))if(j$)O=w6;else{O=y6;var C=v6}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(O=x6);if(O&&(O=O(e,u))){P$(p,O,r,d);break e}C&&C(e,h,u),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&rv(h,"number",h.value)}switch(C=u?Va(u):window,e){case"focusin":(fw(C)||C.contentEditable==="true")&&(za=C,hv=u,Ol=null);break;case"focusout":Ol=hv=za=null;break;case"mousedown":mv=!0;break;case"contextmenu":case"mouseup":case"dragend":mv=!1,vw(p,r,d);break;case"selectionchange":if(S6)break;case"keydown":case"keyup":vw(p,r,d)}var P;if(Xy)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else La?b$(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(_$&&r.locale!=="ko"&&(La||E!=="onCompositionStart"?E==="onCompositionEnd"&&La&&(P=w$()):(Zo=d,Qy="value"in Zo?Zo.value:Zo.textContent,La=!0)),C=jd(u,E),0<C.length&&(E=new lw(E,e,null,r,d),p.push({event:E,listeners:C}),P?E.data=P:(P=S$(r),P!==null&&(E.data=P)))),(P=d6?f6(e,r):p6(e,r))&&(u=jd(u,"onBeforeInput"),0<u.length&&(d=new lw("onBeforeInput","beforeinput",null,r,d),p.push({event:d,listeners:u}),d.data=P))}N$(p,t)})}function Kl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function jd(e,t){for(var r=t+"Capture",n=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Bl(e,r),i!=null&&n.unshift(Kl(e,i,o)),i=Bl(e,t),i!=null&&n.push(Kl(e,i,o))),e=e.return}return n}function ja(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ww(e,t,r,n,o){for(var i=t._reactName,a=[];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=Bl(r,i),c!=null&&a.unshift(Kl(r,c,l))):o||(c=Bl(r,i),c!=null&&a.push(Kl(r,c,l)))),r=r.return}a.length!==0&&e.push({event:t,listeners:a})}var C6=/\r\n?/g,E6=/\u0000|\uFFFD/g;function _w(e){return(typeof e=="string"?e:""+e).replace(C6,`
85
+ `).replace(E6,"")}function au(e,t,r){if(t=_w(t),_w(e)!==t&&r)throw Error(G(425))}function Od(){}var gv=null,vv=null;function yv(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 xv=typeof setTimeout=="function"?setTimeout:void 0,$6=typeof clearTimeout=="function"?clearTimeout:void 0,bw=typeof Promise=="function"?Promise:void 0,k6=typeof queueMicrotask=="function"?queueMicrotask:typeof bw<"u"?function(e){return bw.resolve(null).then(e).catch(R6)}:xv;function R6(e){setTimeout(function(){throw e})}function Qm(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),Hl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=o}while(r);Hl(t)}function ai(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 Sw(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 ks=Math.random().toString(36).slice(2),Gn="__reactFiber$"+ks,Yl="__reactProps$"+ks,bo="__reactContainer$"+ks,wv="__reactEvents$"+ks,T6="__reactListeners$"+ks,I6="__reactHandles$"+ks;function zi(e){var t=e[Gn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[bo]||r[Gn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Sw(e);e!==null;){if(r=e[Gn])return r;e=Sw(e)}return t}e=r,r=e.parentNode}return null}function vc(e){return e=e[Gn]||e[bo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Va(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Ah(e){return e[Yl]||null}var _v=[],Ba=-1;function wi(e){return{current:e}}function at(e){0>Ba||(e.current=_v[Ba],_v[Ba]=null,Ba--)}function Ze(e,t){Ba++,_v[Ba]=e.current,e.current=t}var pi={},ar=wi(pi),jr=wi(!1),Qi=pi;function us(e,t){var r=e.type.contextTypes;if(!r)return pi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Or(e){return e=e.childContextTypes,e!=null}function Cd(){at(jr),at(ar)}function Pw(e,t,r){if(ar.current!==pi)throw Error(G(168));Ze(ar,t),Ze(jr,r)}function M$(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(G(108,vz(e)||"Unknown",o));return wt({},r,n)}function Ed(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pi,Qi=ar.current,Ze(ar,e),Ze(jr,jr.current),!0}function jw(e,t,r){var n=e.stateNode;if(!n)throw Error(G(169));r?(e=M$(e,t,Qi),n.__reactInternalMemoizedMergedChildContext=e,at(jr),at(ar),Ze(ar,e)):at(jr),Ze(jr,r)}var uo=null,Mh=!1,Km=!1;function L$(e){uo===null?uo=[e]:uo.push(e)}function D6(e){Mh=!0,L$(e)}function _i(){if(!Km&&uo!==null){Km=!0;var e=0,t=Ge;try{var r=uo;for(Ge=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}uo=null,Mh=!1}catch(o){throw uo!==null&&(uo=uo.slice(e+1)),c$(Wy,_i),o}finally{Ge=t,Km=!1}}return null}var Ua=[],Wa=0,$d=null,kd=0,Jr=[],Zr=0,Ki=null,po=1,ho="";function Ii(e,t){Ua[Wa++]=kd,Ua[Wa++]=$d,$d=e,kd=t}function z$(e,t,r){Jr[Zr++]=po,Jr[Zr++]=ho,Jr[Zr++]=Ki,Ki=e;var n=po;e=ho;var o=32-wn(n)-1;n&=~(1<<o),r+=1;var i=32-wn(t)+o;if(30<i){var a=o-o%5;i=(n&(1<<a)-1).toString(32),n>>=a,o-=a,po=1<<32-wn(t)+o|r<<o|n,ho=i+e}else po=1<<i|r<<o|n,ho=e}function Zy(e){e.return!==null&&(Ii(e,1),z$(e,1,0))}function e0(e){for(;e===$d;)$d=Ua[--Wa],Ua[Wa]=null,kd=Ua[--Wa],Ua[Wa]=null;for(;e===Ki;)Ki=Jr[--Zr],Jr[Zr]=null,ho=Jr[--Zr],Jr[Zr]=null,po=Jr[--Zr],Jr[Zr]=null}var Fr=null,Lr=null,ut=!1,yn=null;function F$(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 Ow(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,Fr=e,Lr=ai(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fr=e,Lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ki!==null?{id:po,overflow:ho}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=en(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Fr=e,Lr=null,!0):!1;default:return!1}}function bv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Sv(e){if(ut){var t=Lr;if(t){var r=t;if(!Ow(e,t)){if(bv(e))throw Error(G(418));t=ai(r.nextSibling);var n=Fr;t&&Ow(e,t)?F$(n,r):(e.flags=e.flags&-4097|2,ut=!1,Fr=e)}}else{if(bv(e))throw Error(G(418));e.flags=e.flags&-4097|2,ut=!1,Fr=e}}}function Cw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fr=e}function su(e){if(e!==Fr)return!1;if(!ut)return Cw(e),ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!yv(e.type,e.memoizedProps)),t&&(t=Lr)){if(bv(e))throw V$(),Error(G(418));for(;t;)F$(e,t),t=ai(t.nextSibling)}if(Cw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Lr=ai(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Lr=null}}else Lr=Fr?ai(e.stateNode.nextSibling):null;return!0}function V$(){for(var e=Lr;e;)e=ai(e.nextSibling)}function ds(){Lr=Fr=null,ut=!1}function t0(e){yn===null?yn=[e]:yn.push(e)}var N6=Ro.ReactCurrentBatchConfig;function mn(e,t){if(e&&e.defaultProps){t=wt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var Rd=wi(null),Td=null,Ha=null,r0=null;function n0(){r0=Ha=Td=null}function o0(e){var t=Rd.current;at(Rd),e._currentValue=t}function Pv(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 rs(e,t){Td=e,r0=Ha=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Sr=!0),e.firstContext=null)}function sn(e){var t=e._currentValue;if(r0!==e)if(e={context:e,memoizedValue:t,next:null},Ha===null){if(Td===null)throw Error(G(308));Ha=e,Td.dependencies={lanes:0,firstContext:e}}else Ha=Ha.next=e;return t}var Fi=null;function i0(e){Fi===null?Fi=[e]:Fi.push(e)}function B$(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,i0(t)):(r.next=o.next,o.next=r),t.interleaved=r,So(e,n)}function So(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 Qo=!1;function a0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U$(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 go(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ne&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,So(e,r)}return o=n.interleaved,o===null?(t.next=t,i0(n)):(t.next=o.next,o.next=t),n.interleaved=t,So(e,r)}function Zu(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,Hy(e,r)}}function Ew(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var o=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?o=i=a:i=i.next=a,r=r.next}while(r!==null);i===null?o=i=t:i=i.next=t}else o=i=t;r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 Id(e,t,r,n){var o=e.updateQueue;Qo=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var p=o.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(h=t,m=r,g.tag){case 1:if(v=g.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=wt({},p,h);break e;case 2:Qo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,a|=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 a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Xi|=a,e.lanes=a,e.memoizedState=p}}function $w(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],o=n.callback;if(o!==null){if(n.callback=null,n=r,typeof o!="function")throw Error(G(191,o));o.call(n)}}}var W$=new BE.Component().refs;function jv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:wt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Lh={isMounted:function(e){return(e=e._reactInternals)?ca(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=ur(),o=ci(e),i=go(n,o);i.payload=t,r!=null&&(i.callback=r),t=si(e,i,o),t!==null&&(_n(t,e,o,n),Zu(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=ur(),o=ci(e),i=go(n,o);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=si(e,i,o),t!==null&&(_n(t,e,o,n),Zu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ur(),n=ci(e),o=go(r,n);o.tag=2,t!=null&&(o.callback=t),t=si(e,o,n),t!==null&&(_n(t,e,n,r),Zu(t,e,n))}};function kw(e,t,r,n,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,a):t.prototype&&t.prototype.isPureReactComponent?!ql(r,n)||!ql(o,i):!0}function H$(e,t,r){var n=!1,o=pi,i=t.contextType;return typeof i=="object"&&i!==null?i=sn(i):(o=Or(t)?Qi:ar.current,n=t.contextTypes,i=(n=n!=null)?us(e,o):pi),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Rw(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&&Lh.enqueueReplaceState(t,t.state,null)}function Ov(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs=W$,a0(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=sn(i):(i=Or(t)?Qi:ar.current,o.context=us(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(jv(e,t,i,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&&Lh.enqueueReplaceState(o,o.state,null),Id(e,r,o,n),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ys(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(G(309));var n=r.stateNode}if(!n)throw Error(G(147,e));var o=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;l===W$&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function lu(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Tw(e){var t=e._init;return t(e._payload)}function G$(e){function t(y,x){if(e){var _=y.deletions;_===null?(y.deletions=[x],y.flags|=16):_.push(x)}}function r(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function n(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function o(y,x){return y=ui(y,x),y.index=0,y.sibling=null,y}function i(y,x,_){return y.index=_,e?(_=y.alternate,_!==null?(_=_.index,_<x?(y.flags|=2,x):_):(y.flags|=2,x)):(y.flags|=1048576,x)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,_,w){return x===null||x.tag!==6?(x=rg(_,y.mode,w),x.return=y,x):(x=o(x,_),x.return=y,x)}function c(y,x,_,w){var O=_.type;return O===Ma?d(y,x,_.props.children,w,_.key):x!==null&&(x.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===qo&&Tw(O)===x.type)?(w=o(x,_.props),w.ref=Ys(y,x,_),w.return=y,w):(w=id(_.type,_.key,_.props,null,y.mode,w),w.ref=Ys(y,x,_),w.return=y,w)}function u(y,x,_,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==_.containerInfo||x.stateNode.implementation!==_.implementation?(x=ng(_,y.mode,w),x.return=y,x):(x=o(x,_.children||[]),x.return=y,x)}function d(y,x,_,w,O){return x===null||x.tag!==7?(x=Hi(_,y.mode,w,O),x.return=y,x):(x=o(x,_),x.return=y,x)}function p(y,x,_){if(typeof x=="string"&&x!==""||typeof x=="number")return x=rg(""+x,y.mode,_),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Xc:return _=id(x.type,x.key,x.props,null,y.mode,_),_.ref=Ys(y,null,x),_.return=y,_;case Aa:return x=ng(x,y.mode,_),x.return=y,x;case qo:var w=x._init;return p(y,w(x._payload),_)}if(ml(x)||Hs(x))return x=Hi(x,y.mode,_,null),x.return=y,x;lu(y,x)}return null}function h(y,x,_,w){var O=x!==null?x.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return O!==null?null:l(y,x,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Xc:return _.key===O?c(y,x,_,w):null;case Aa:return _.key===O?u(y,x,_,w):null;case qo:return O=_._init,h(y,x,O(_._payload),w)}if(ml(_)||Hs(_))return O!==null?null:d(y,x,_,w,null);lu(y,_)}return null}function m(y,x,_,w,O){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(_)||null,l(x,y,""+w,O);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Xc:return y=y.get(w.key===null?_:w.key)||null,c(x,y,w,O);case Aa:return y=y.get(w.key===null?_:w.key)||null,u(x,y,w,O);case qo:var C=w._init;return m(y,x,_,C(w._payload),O)}if(ml(w)||Hs(w))return y=y.get(_)||null,d(x,y,w,O,null);lu(x,w)}return null}function v(y,x,_,w){for(var O=null,C=null,P=x,E=x=0,k=null;P!==null&&E<_.length;E++){P.index>E?(k=P,P=null):k=P.sibling;var $=h(y,P,_[E],w);if($===null){P===null&&(P=k);break}e&&P&&$.alternate===null&&t(y,P),x=i($,x,E),C===null?O=$:C.sibling=$,C=$,P=k}if(E===_.length)return r(y,P),ut&&Ii(y,E),O;if(P===null){for(;E<_.length;E++)P=p(y,_[E],w),P!==null&&(x=i(P,x,E),C===null?O=P:C.sibling=P,C=P);return ut&&Ii(y,E),O}for(P=n(y,P);E<_.length;E++)k=m(P,y,E,_[E],w),k!==null&&(e&&k.alternate!==null&&P.delete(k.key===null?E:k.key),x=i(k,x,E),C===null?O=k:C.sibling=k,C=k);return e&&P.forEach(function(I){return t(y,I)}),ut&&Ii(y,E),O}function g(y,x,_,w){var O=Hs(_);if(typeof O!="function")throw Error(G(150));if(_=O.call(_),_==null)throw Error(G(151));for(var C=O=null,P=x,E=x=0,k=null,$=_.next();P!==null&&!$.done;E++,$=_.next()){P.index>E?(k=P,P=null):k=P.sibling;var I=h(y,P,$.value,w);if(I===null){P===null&&(P=k);break}e&&P&&I.alternate===null&&t(y,P),x=i(I,x,E),C===null?O=I:C.sibling=I,C=I,P=k}if($.done)return r(y,P),ut&&Ii(y,E),O;if(P===null){for(;!$.done;E++,$=_.next())$=p(y,$.value,w),$!==null&&(x=i($,x,E),C===null?O=$:C.sibling=$,C=$);return ut&&Ii(y,E),O}for(P=n(y,P);!$.done;E++,$=_.next())$=m(P,y,E,$.value,w),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?E:$.key),x=i($,x,E),C===null?O=$:C.sibling=$,C=$);return e&&P.forEach(function(T){return t(y,T)}),ut&&Ii(y,E),O}function b(y,x,_,w){if(typeof _=="object"&&_!==null&&_.type===Ma&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Xc:e:{for(var O=_.key,C=x;C!==null;){if(C.key===O){if(O=_.type,O===Ma){if(C.tag===7){r(y,C.sibling),x=o(C,_.props.children),x.return=y,y=x;break e}}else if(C.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===qo&&Tw(O)===C.type){r(y,C.sibling),x=o(C,_.props),x.ref=Ys(y,C,_),x.return=y,y=x;break e}r(y,C);break}else t(y,C);C=C.sibling}_.type===Ma?(x=Hi(_.props.children,y.mode,w,_.key),x.return=y,y=x):(w=id(_.type,_.key,_.props,null,y.mode,w),w.ref=Ys(y,x,_),w.return=y,y=w)}return a(y);case Aa:e:{for(C=_.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===_.containerInfo&&x.stateNode.implementation===_.implementation){r(y,x.sibling),x=o(x,_.children||[]),x.return=y,y=x;break e}else{r(y,x);break}else t(y,x);x=x.sibling}x=ng(_,y.mode,w),x.return=y,y=x}return a(y);case qo:return C=_._init,b(y,x,C(_._payload),w)}if(ml(_))return v(y,x,_,w);if(Hs(_))return g(y,x,_,w);lu(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,x!==null&&x.tag===6?(r(y,x.sibling),x=o(x,_),x.return=y,y=x):(r(y,x),x=rg(_,y.mode,w),x.return=y,y=x),a(y)):r(y,x)}return b}var fs=G$(!0),q$=G$(!1),yc={},Yn=wi(yc),Xl=wi(yc),Jl=wi(yc);function Vi(e){if(e===yc)throw Error(G(174));return e}function s0(e,t){switch(Ze(Jl,t),Ze(Xl,e),Ze(Yn,yc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ov(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ov(t,e)}at(Yn),Ze(Yn,t)}function ps(){at(Yn),at(Xl),at(Jl)}function Q$(e){Vi(Jl.current);var t=Vi(Yn.current),r=ov(t,e.type);t!==r&&(Ze(Xl,e),Ze(Yn,r))}function l0(e){Xl.current===e&&(at(Yn),at(Xl))}var yt=wi(0);function Dd(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 Ym=[];function c0(){for(var e=0;e<Ym.length;e++)Ym[e]._workInProgressVersionPrimary=null;Ym.length=0}var ed=Ro.ReactCurrentDispatcher,Xm=Ro.ReactCurrentBatchConfig,Yi=0,xt=null,Mt=null,Ft=null,Nd=!1,Cl=!1,Zl=0,A6=0;function Zt(){throw Error(G(321))}function u0(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!bn(e[r],t[r]))return!1;return!0}function d0(e,t,r,n,o,i){if(Yi=i,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ed.current=e===null||e.memoizedState===null?F6:V6,e=r(n,o),Cl){i=0;do{if(Cl=!1,Zl=0,25<=i)throw Error(G(301));i+=1,Ft=Mt=null,t.updateQueue=null,ed.current=B6,e=r(n,o)}while(Cl)}if(ed.current=Ad,t=Mt!==null&&Mt.next!==null,Yi=0,Ft=Mt=xt=null,Nd=!1,t)throw Error(G(300));return e}function f0(){var e=Zl!==0;return Zl=0,e}function Vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?xt.memoizedState=Ft=e:Ft=Ft.next=e,Ft}function ln(){if(Mt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=Ft===null?xt.memoizedState:Ft.next;if(t!==null)Ft=t,Mt=e;else{if(e===null)throw Error(G(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Ft===null?xt.memoizedState=Ft=e:Ft=Ft.next=e}return Ft}function ec(e,t){return typeof t=="function"?t(e):t}function Jm(e){var t=ln(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=Mt,o=n.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}n.baseQueue=o=i,r.pending=null}if(o!==null){i=o.next,n=n.baseState;var l=a=null,c=null,u=i;do{var d=u.lane;if((Yi&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,a=n):c=c.next=p,xt.lanes|=d,Xi|=d}u=u.next}while(u!==null&&u!==i);c===null?a=n:c.next=l,bn(n,t.memoizedState)||(Sr=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){o=e;do i=o.lane,xt.lanes|=i,Xi|=i,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Zm(e){var t=ln(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=r.dispatch,o=r.pending,i=t.memoizedState;if(o!==null){r.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);bn(i,t.memoizedState)||(Sr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function K$(){}function Y$(e,t){var r=xt,n=ln(),o=t(),i=!bn(n.memoizedState,o);if(i&&(n.memoizedState=o,Sr=!0),n=n.queue,p0(Z$.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Ft!==null&&Ft.memoizedState.tag&1){if(r.flags|=2048,tc(9,J$.bind(null,r,n,o,t),void 0,null),Bt===null)throw Error(G(349));Yi&30||X$(r,t,o)}return o}function X$(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function J$(e,t,r,n){t.value=r,t.getSnapshot=n,e2(t)&&t2(e)}function Z$(e,t,r){return r(function(){e2(t)&&t2(e)})}function e2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bn(e,r)}catch{return!0}}function t2(e){var t=So(e,1);t!==null&&_n(t,e,1,-1)}function Iw(e){var t=Vn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ec,lastRenderedState:e},t.queue=e,e=e.dispatch=z6.bind(null,xt,e),[t.memoizedState,e]}function tc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.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 r2(){return ln().memoizedState}function td(e,t,r,n){var o=Vn();xt.flags|=e,o.memoizedState=tc(1|t,r,void 0,n===void 0?null:n)}function zh(e,t,r,n){var o=ln();n=n===void 0?null:n;var i=void 0;if(Mt!==null){var a=Mt.memoizedState;if(i=a.destroy,n!==null&&u0(n,a.deps)){o.memoizedState=tc(t,r,i,n);return}}xt.flags|=e,o.memoizedState=tc(1|t,r,i,n)}function Dw(e,t){return td(8390656,8,e,t)}function p0(e,t){return zh(2048,8,e,t)}function n2(e,t){return zh(4,2,e,t)}function o2(e,t){return zh(4,4,e,t)}function i2(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function a2(e,t,r){return r=r!=null?r.concat([e]):null,zh(4,4,i2.bind(null,t,e),r)}function h0(){}function s2(e,t){var r=ln();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&u0(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function l2(e,t){var r=ln();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&u0(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function c2(e,t,r){return Yi&21?(bn(r,t)||(r=f$(),xt.lanes|=r,Xi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Sr=!0),e.memoizedState=r)}function M6(e,t){var r=Ge;Ge=r!==0&&4>r?r:4,e(!0);var n=Xm.transition;Xm.transition={};try{e(!1),t()}finally{Ge=r,Xm.transition=n}}function u2(){return ln().memoizedState}function L6(e,t,r){var n=ci(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},d2(e))f2(t,r);else if(r=B$(e,t,r,n),r!==null){var o=ur();_n(r,e,n,o),p2(r,t,n)}}function z6(e,t,r){var n=ci(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(d2(e))f2(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,r);if(o.hasEagerState=!0,o.eagerState=l,bn(l,a)){var c=t.interleaved;c===null?(o.next=o,i0(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}r=B$(e,t,o,n),r!==null&&(o=ur(),_n(r,e,n,o),p2(r,t,n))}}function d2(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function f2(e,t){Cl=Nd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function p2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Hy(e,r)}}var Ad={readContext:sn,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useInsertionEffect:Zt,useLayoutEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useMutableSource:Zt,useSyncExternalStore:Zt,useId:Zt,unstable_isNewReconciler:!1},F6={readContext:sn,useCallback:function(e,t){return Vn().memoizedState=[e,t===void 0?null:t],e},useContext:sn,useEffect:Dw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,td(4194308,4,i2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return td(4194308,4,e,t)},useInsertionEffect:function(e,t){return td(4,2,e,t)},useMemo:function(e,t){var r=Vn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Vn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=L6.bind(null,xt,e),[n.memoizedState,e]},useRef:function(e){var t=Vn();return e={current:e},t.memoizedState=e},useState:Iw,useDebugValue:h0,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Iw(!1),t=e[0];return e=M6.bind(null,e[1]),Vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=xt,o=Vn();if(ut){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Bt===null)throw Error(G(349));Yi&30||X$(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,Dw(Z$.bind(null,n,i,e),[e]),n.flags|=2048,tc(9,J$.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Vn(),t=Bt.identifierPrefix;if(ut){var r=ho,n=po;r=(n&~(1<<32-wn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Zl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=A6++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},V6={readContext:sn,useCallback:s2,useContext:sn,useEffect:p0,useImperativeHandle:a2,useInsertionEffect:n2,useLayoutEffect:o2,useMemo:l2,useReducer:Jm,useRef:r2,useState:function(){return Jm(ec)},useDebugValue:h0,useDeferredValue:function(e){var t=ln();return c2(t,Mt.memoizedState,e)},useTransition:function(){var e=Jm(ec)[0],t=ln().memoizedState;return[e,t]},useMutableSource:K$,useSyncExternalStore:Y$,useId:u2,unstable_isNewReconciler:!1},B6={readContext:sn,useCallback:s2,useContext:sn,useEffect:p0,useImperativeHandle:a2,useInsertionEffect:n2,useLayoutEffect:o2,useMemo:l2,useReducer:Zm,useRef:r2,useState:function(){return Zm(ec)},useDebugValue:h0,useDeferredValue:function(e){var t=ln();return Mt===null?t.memoizedState=e:c2(t,Mt.memoizedState,e)},useTransition:function(){var e=Zm(ec)[0],t=ln().memoizedState;return[e,t]},useMutableSource:K$,useSyncExternalStore:Y$,useId:u2,unstable_isNewReconciler:!1};function hs(e,t){try{var r="",n=t;do r+=gz(n),n=n.return;while(n);var o=r}catch(i){o=`
86
86
  Error generating stack: `+i.message+`
87
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function eg(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Cv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Uz=typeof WeakMap=="function"?WeakMap:Map;function h2(e,t,r){r=go(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ld||(Ld=!0,Mv=n),Cv(e,t)},r}function m2(e,t,r){r=go(-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(){Cv(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Cv(e,t),typeof n!="function"&&(li===null?li=new Set([this]):li.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),r}function Nw(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Uz;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(r)||(o.add(r),e=n7.bind(null,e,t,r),t.then(e,e))}function Aw(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 Mw(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=go(-1,1),t.tag=2,si(r,t,1))),r.lanes|=1),e)}var Wz=Ro.ReactCurrentOwner,Sr=!1;function cr(e,t,r,n){t.child=e===null?q$(t,null,r,n):fs(t,e.child,r,n)}function Lw(e,t,r,n,o){r=r.render;var i=t.ref;return rs(t,o),n=d0(e,t,r,n,i,o),r=f0(),e!==null&&!Sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Po(e,t,o)):(ut&&r&&Zy(t),t.flags|=1,cr(e,t,n,o),t.child)}function zw(e,t,r,n,o){if(e===null){var i=r.type;return typeof i=="function"&&!b0(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,g2(e,t,i,n,o)):(e=id(r.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(r=r.compare,r=r!==null?r:ql,r(a,n)&&e.ref===t.ref)return Po(e,t,o)}return t.flags|=1,e=ui(i,n),e.ref=t.ref,e.return=t,t.child=e}function g2(e,t,r,n,o){if(e!==null){var i=e.memoizedProps;if(ql(i,n)&&e.ref===t.ref)if(Sr=!1,t.pendingProps=n=i,(e.lanes&o)!==0)e.flags&131072&&(Sr=!0);else return t.lanes=e.lanes,Po(e,t,o)}return Ev(e,t,r,n,o)}function v2(e,t,r){var n=t.pendingProps,o=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(qa,Ar),Ar|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(qa,Ar),Ar|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Ze(qa,Ar),Ar|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Ze(qa,Ar),Ar|=n;return cr(e,t,o,r),t.child}function y2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ev(e,t,r,n,o){var i=Or(r)?Qi:ar.current;return i=us(t,i),rs(t,o),r=d0(e,t,r,n,i,o),n=f0(),e!==null&&!Sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Po(e,t,o)):(ut&&n&&Zy(t),t.flags|=1,cr(e,t,r,o),t.child)}function Fw(e,t,r,n,o){if(Or(r)){var i=!0;Ed(t)}else i=!1;if(rs(t,o),t.stateNode===null)rd(e,t),H$(t,r,n),Ov(t,r,n,o),n=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=sn(u):(u=Or(r)?Qi:ar.current,u=us(t,u));var d=r.getDerivedStateFromProps,p=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Rw(t,a,n,u),Qo=!1;var h=t.memoizedState;a.state=h,Id(t,n,a,o),c=t.memoizedState,l!==n||h!==c||jr.current||Qo?(typeof d=="function"&&(jv(t,r,d,n),c=t.memoizedState),(l=Qo||kw(t,r,l,n,h,c,u))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),a.props=n,a.state=c,a.context=u,n=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,U$(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:mn(t.type,l),a.props=u,p=t.pendingProps,h=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=sn(c):(c=Or(r)?Qi:ar.current,c=us(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==p||h!==c)&&Rw(t,a,n,c),Qo=!1,h=t.memoizedState,a.state=h,Id(t,n,a,o);var v=t.memoizedState;l!==p||h!==v||jr.current||Qo?(typeof m=="function"&&(jv(t,r,m,n),v=t.memoizedState),(u=Qo||kw(t,r,u,n,h,v,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,v,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,v,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),a.props=n,a.state=v,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return $v(e,t,r,n,i,o)}function $v(e,t,r,n,o,i){y2(e,t);var a=(t.flags&128)!==0;if(!n&&!a)return o&&jw(t,r,!1),Po(e,t,i);n=t.stateNode,Wz.current=t;var l=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&a?(t.child=fs(t,e.child,null,i),t.child=fs(t,null,l,i)):cr(e,t,l,i),t.memoizedState=n.state,o&&jw(t,r,!0),t.child}function x2(e){var t=e.stateNode;t.pendingContext?Pw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Pw(e,t.context,!1),s0(e,t.containerInfo)}function Vw(e,t,r,n,o){return ds(),t0(o),t.flags|=256,cr(e,t,r,n),t.child}var kv={dehydrated:null,treeContext:null,retryLane:0};function Rv(e){return{baseLanes:e,cachePool:null,transitions:null}}function w2(e,t,r){var n=t.pendingProps,o=yt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ze(yt,o&1),e===null)return Sv(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):(a=n.children,e=n.fallback,i?(n=t.mode,i=t.child,a={mode:"hidden",children:a},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Bh(a,n,0,null),e=Hi(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Rv(r),t.memoizedState=kv,e):m0(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return Hz(e,t,a,n,l,o,r);if(i){i=n.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:n.children};return!(a&1)&&t.child!==o?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=ui(o,c),n.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=ui(l,i):(i=Hi(i,a,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,a=e.child.memoizedState,a=a===null?Rv(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~r,t.memoizedState=kv,n}return i=e.child,e=i.sibling,n=ui(i,{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 m0(e,t){return t=Bh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cu(e,t,r,n){return n!==null&&t0(n),fs(t,e.child,null,r),e=m0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hz(e,t,r,n,o,i,a){if(r)return t.flags&256?(t.flags&=-257,n=eg(Error(G(422))),cu(e,t,a,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,o=t.mode,n=Bh({mode:"visible",children:n.children},o,0,null),i=Hi(i,o,a,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&fs(t,e.child,null,a),t.child.memoizedState=Rv(a),t.memoizedState=kv,i);if(!(t.mode&1))return cu(e,t,a,null);if(o.data==="$!"){if(n=o.nextSibling&&o.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(G(419)),n=eg(i,n,void 0),cu(e,t,a,n)}if(l=(a&e.childLanes)!==0,Sr||l){if(n=Bt,n!==null){switch(a&-a){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|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,So(e,o),_n(n,e,o,-1))}return _0(),n=eg(Error(G(421))),cu(e,t,a,n)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=o7.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Lr=ai(o.nextSibling),Fr=t,ut=!0,yn=null,e!==null&&(Jr[Zr++]=po,Jr[Zr++]=ho,Jr[Zr++]=Ki,po=e.id,ho=e.overflow,Ki=t),t=m0(t,n.children),t.flags|=4096,t)}function Bw(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Pv(e.return,t,r)}function tg(e,t,r,n,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=o)}function _2(e,t,r){var n=t.pendingProps,o=n.revealOrder,i=n.tail;if(cr(e,t,n.children,r),n=yt.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&&Bw(e,r,t);else if(e.tag===19)Bw(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(Ze(yt,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&&Dd(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),tg(t,!1,o,r,i);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Dd(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}tg(t,!0,r,null,i);break;case"together":tg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Po(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Xi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=ui(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ui(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Gz(e,t,r){switch(t.tag){case 3:x2(t),ds();break;case 5:Q$(t);break;case 1:Or(t.type)&&Ed(t);break;case 4:s0(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,o=t.memoizedProps.value;Ze(Rd,n._currentValue),n._currentValue=o;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(yt,yt.current&1),t.flags|=128,null):r&t.child.childLanes?w2(e,t,r):(Ze(yt,yt.current&1),e=Po(e,t,r),e!==null?e.sibling:null);Ze(yt,yt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return _2(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ze(yt,yt.current),n)break;return null;case 22:case 23:return t.lanes=0,v2(e,t,r)}return Po(e,t,r)}var b2,Tv,S2,P2;b2=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Tv=function(){};S2=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,Vi(Yn.current);var i=null;switch(r){case"input":o=ev(e,o),n=ev(e,n),i=[];break;case"select":o=wt({},o,{value:void 0}),n=wt({},n,{value:void 0}),i=[];break;case"textarea":o=nv(e,o),n=nv(e,n),i=[];break;default:typeof o.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Od)}iv(r,n);var a;r=null;for(u in o)if(!n.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).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(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Fl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ot("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};P2=function(e,t,r,n){r!==n&&(t.flags|=4)};function Xs(e,t){if(!ut)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function er(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 qz(e,t,r){var n=t.pendingProps;switch(e0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return er(t),null;case 1:return Or(t.type)&&Cd(),er(t),null;case 3:return n=t.stateNode,ps(),at(jr),at(ar),c0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(su(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,yn!==null&&(Fv(yn),yn=null))),Tv(e,t),er(t),null;case 5:l0(t);var o=Vi(Jl.current);if(r=t.type,e!==null&&t.stateNode!=null)S2(e,t,r,n,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(G(166));return er(t),null}if(e=Vi(Yn.current),su(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Gn]=t,n[Yl]=i,e=(t.mode&1)!==0,r){case"dialog":ot("cancel",n),ot("close",n);break;case"iframe":case"object":case"embed":ot("load",n);break;case"video":case"audio":for(o=0;o<vl.length;o++)ot(vl[o],n);break;case"source":ot("error",n);break;case"img":case"image":case"link":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"input":X1(n,i),ot("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ot("invalid",n);break;case"textarea":Z1(n,i),ot("invalid",n)}iv(r,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&au(n.textContent,l,e),o=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&au(n.textContent,l,e),o=["children",""+l]):Fl.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&ot("scroll",n)}switch(r){case"input":Jc(n),J1(n,i,!0);break;case"textarea":Jc(n),ew(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Od)}n=o,t.updateQueue=n,n!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=XE(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Gn]=t,e[Yl]=n,b2(e,t,!1,!1),t.stateNode=e;e:{switch(a=av(r,n),r){case"dialog":ot("cancel",e),ot("close",e),o=n;break;case"iframe":case"object":case"embed":ot("load",e),o=n;break;case"video":case"audio":for(o=0;o<vl.length;o++)ot(vl[o],e);o=n;break;case"source":ot("error",e),o=n;break;case"img":case"image":case"link":ot("error",e),ot("load",e),o=n;break;case"details":ot("toggle",e),o=n;break;case"input":X1(e,n),o=ev(e,n),ot("invalid",e);break;case"option":o=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=wt({},n,{value:void 0}),ot("invalid",e);break;case"textarea":Z1(e,n),o=nv(e,n),ot("invalid",e);break;default:o=n}iv(r,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?e$(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&JE(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Vl(e,c):typeof c=="number"&&Vl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ot("scroll",e):c!=null&&zy(e,i,c,a))}switch(r){case"input":Jc(e),J1(e,n,!1);break;case"textarea":Jc(e),ew(e);break;case"option":n.value!=null&&e.setAttribute("value",""+fi(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Ja(e,!!n.multiple,i,!1):n.defaultValue!=null&&Ja(e,!!n.multiple,n.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Od)}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 er(t),null;case 6:if(e&&t.stateNode!=null)P2(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(G(166));if(r=Vi(Jl.current),Vi(Yn.current),su(t)){if(n=t.stateNode,r=t.memoizedProps,n[Gn]=t,(i=n.nodeValue!==r)&&(e=Fr,e!==null))switch(e.tag){case 3:au(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&au(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Gn]=t,t.stateNode=n}return er(t),null;case 13:if(at(yt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ut&&Lr!==null&&t.mode&1&&!(t.flags&128))V$(),ds(),t.flags|=98560,i=!1;else if(i=su(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(G(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(G(317));i[Gn]=t}else ds(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;er(t),i=!1}else yn!==null&&(Fv(yn),yn=null),i=!0;if(!i)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||yt.current&1?Lt===0&&(Lt=3):_0())),t.updateQueue!==null&&(t.flags|=4),er(t),null);case 4:return ps(),Tv(e,t),e===null&&Ql(t.stateNode.containerInfo),er(t),null;case 10:return o0(t.type._context),er(t),null;case 17:return Or(t.type)&&Cd(),er(t),null;case 19:if(at(yt),i=t.memoizedState,i===null)return er(t),null;if(n=(t.flags&128)!==0,a=i.rendering,a===null)if(n)Xs(i,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Dd(e),a!==null){for(t.flags|=128,Xs(i,!1),n=a.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(yt,yt.current&1|2),t.child}e=e.sibling}i.tail!==null&&$t()>ms&&(t.flags|=128,n=!0,Xs(i,!1),t.lanes=4194304)}else{if(!n)if(e=Dd(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Xs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ut)return er(t),null}else 2*$t()-i.renderingStartTime>ms&&r!==1073741824&&(t.flags|=128,n=!0,Xs(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(r=i.last,r!==null?r.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$t(),t.sibling=null,r=yt.current,Ze(yt,n?r&1|2:r&1),t):(er(t),null);case 22:case 23:return w0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ar&1073741824&&(er(t),t.subtreeFlags&6&&(t.flags|=8192)):er(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function Qz(e,t){switch(e0(t),t.tag){case 1:return Or(t.type)&&Cd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ps(),at(jr),at(ar),c0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return l0(t),null;case 13:if(at(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return at(yt),null;case 4:return ps(),null;case 10:return o0(t.type._context),null;case 22:case 23:return w0(),null;case 24:return null;default:return null}}var uu=!1,rr=!1,Kz=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Ga(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){bt(e,t,n)}else r.current=null}function Iv(e,t,r){try{r()}catch(n){bt(e,t,n)}}var Uw=!1;function Yz(e,t){if(gv=Sd,e=E$(),Jy(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,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,l=-1,c=-1,u=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==r||o!==0&&p.nodeType!==3||(l=a+o),p!==i||n!==0&&p.nodeType!==3||(c=a+n),p.nodeType===3&&(a+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===r&&++u===o&&(l=a),h===i&&++d===n&&(c=a),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(vv={focusedElem:e,selectionRange:r},Sd=!1,ie=t;ie!==null;)if(t=ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ie=e;else for(;ie!==null;){t=ie;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,b=v.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:mn(t.type,g),b);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(w){bt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ie=e;break}ie=t.return}return v=Uw,Uw=!1,v}function El(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 i=o.destroy;o.destroy=void 0,i!==void 0&&Iv(t,r,i)}o=o.next}while(o!==n)}}function Fh(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 j2(e){var t=e.alternate;t!==null&&(e.alternate=null,j2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gn],delete t[Yl],delete t[wv],delete t[Tz],delete t[Iz])),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 O2(e){return e.tag===5||e.tag===3||e.tag===4}function Ww(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||O2(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 Nv(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=Od));else if(n!==4&&(e=e.child,e!==null))for(Nv(e,t,r),e=e.sibling;e!==null;)Nv(e,t,r),e=e.sibling}function Av(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(Av(e,t,r),e=e.sibling;e!==null;)Av(e,t,r),e=e.sibling}var qt=null,gn=!1;function Uo(e,t,r){for(r=r.child;r!==null;)C2(e,t,r),r=r.sibling}function C2(e,t,r){if(Kn&&typeof Kn.onCommitFiberUnmount=="function")try{Kn.onCommitFiberUnmount(Th,r)}catch{}switch(r.tag){case 5:rr||Ga(r,t);case 6:var n=qt,o=gn;qt=null,Uo(e,t,r),qt=n,gn=o,qt!==null&&(gn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(gn?(e=qt,r=r.stateNode,e.nodeType===8?Qm(e.parentNode,r):e.nodeType===1&&Qm(e,r),Hl(e)):Qm(qt,r.stateNode));break;case 4:n=qt,o=gn,qt=r.stateNode.containerInfo,gn=!0,Uo(e,t,r),qt=n,gn=o;break;case 0:case 11:case 14:case 15:if(!rr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Iv(r,t,a),o=o.next}while(o!==n)}Uo(e,t,r);break;case 1:if(!rr&&(Ga(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){bt(r,t,l)}Uo(e,t,r);break;case 21:Uo(e,t,r);break;case 22:r.mode&1?(rr=(n=rr)||r.memoizedState!==null,Uo(e,t,r),rr=n):Uo(e,t,r);break;default:Uo(e,t,r)}}function Hw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Kz),t.forEach(function(n){var o=i7.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function pn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var o=r[n];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:qt=l.stateNode,gn=!1;break e;case 3:qt=l.stateNode.containerInfo,gn=!0;break e;case 4:qt=l.stateNode.containerInfo,gn=!0;break e}l=l.return}if(qt===null)throw Error(G(160));C2(i,a,o),qt=null,gn=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){bt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)E2(t,e),t=t.sibling}function E2(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pn(t,e),Ln(e),n&4){try{El(3,e,e.return),Fh(3,e)}catch(g){bt(e,e.return,g)}try{El(5,e,e.return)}catch(g){bt(e,e.return,g)}}break;case 1:pn(t,e),Ln(e),n&512&&r!==null&&Ga(r,r.return);break;case 5:if(pn(t,e),Ln(e),n&512&&r!==null&&Ga(r,r.return),e.flags&32){var o=e.stateNode;try{Vl(o,"")}catch(g){bt(e,e.return,g)}}if(n&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&KE(o,i),av(l,a);var u=av(l,i);for(a=0;a<c.length;a+=2){var d=c[a],p=c[a+1];d==="style"?e$(o,p):d==="dangerouslySetInnerHTML"?JE(o,p):d==="children"?Vl(o,p):zy(o,d,p,u)}switch(l){case"input":tv(o,i);break;case"textarea":YE(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Ja(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?Ja(o,!!i.multiple,i.defaultValue,!0):Ja(o,!!i.multiple,i.multiple?[]:"",!1))}o[Yl]=i}catch(g){bt(e,e.return,g)}}break;case 6:if(pn(t,e),Ln(e),n&4){if(e.stateNode===null)throw Error(G(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){bt(e,e.return,g)}}break;case 3:if(pn(t,e),Ln(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Hl(t.containerInfo)}catch(g){bt(e,e.return,g)}break;case 4:pn(t,e),Ln(e);break;case 13:pn(t,e),Ln(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(y0=$t())),n&4&&Hw(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(rr=(u=rr)||d,pn(t,e),rr=u):pn(t,e),Ln(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ie=e,d=e.child;d!==null;){for(p=ie=d;ie!==null;){switch(h=ie,m=h.child,h.tag){case 0:case 11:case 14:case 15:El(4,h,h.return);break;case 1:Ga(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){bt(n,r,g)}}break;case 5:Ga(h,h.return);break;case 22:if(h.memoizedState!==null){qw(p);continue}}m!==null?(m.return=h,ie=m):qw(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=p.stateNode,c=p.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=ZE("display",a))}catch(g){bt(e,e.return,g)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(g){bt(e,e.return,g)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:pn(t,e),Ln(e),n&4&&Hw(e);break;case 21:break;default:pn(t,e),Ln(e)}}function Ln(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(O2(r)){var n=r;break e}r=r.return}throw Error(G(160))}switch(n.tag){case 5:var o=n.stateNode;n.flags&32&&(Vl(o,""),n.flags&=-33);var i=Ww(e);Av(e,i,o);break;case 3:case 4:var a=n.stateNode.containerInfo,l=Ww(e);Nv(e,l,a);break;default:throw Error(G(161))}}catch(c){bt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xz(e,t,r){ie=e,$2(e)}function $2(e,t,r){for(var n=(e.mode&1)!==0;ie!==null;){var o=ie,i=o.child;if(o.tag===22&&n){var a=o.memoizedState!==null||uu;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||rr;l=uu;var u=rr;if(uu=a,(rr=c)&&!u)for(ie=o;ie!==null;)a=ie,c=a.child,a.tag===22&&a.memoizedState!==null?Qw(o):c!==null?(c.return=a,ie=c):Qw(o);for(;i!==null;)ie=i,$2(i),i=i.sibling;ie=o,uu=l,rr=u}Gw(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ie=i):Gw(e)}}function Gw(e){for(;ie!==null;){var t=ie;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rr||Fh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!rr)if(r===null)n.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:mn(t.type,r.memoizedProps);n.componentDidUpdate(o,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&$w(t,i,n);break;case 3:var a=t.updateQueue;if(a!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}$w(t,a,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&&Hl(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}rr||t.flags&512&&Dv(t)}catch(h){bt(t,t.return,h)}}if(t===e){ie=null;break}if(r=t.sibling,r!==null){r.return=t.return,ie=r;break}ie=t.return}}function qw(e){for(;ie!==null;){var t=ie;if(t===e){ie=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ie=r;break}ie=t.return}}function Qw(e){for(;ie!==null;){var t=ie;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Fh(4,t)}catch(c){bt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var o=t.return;try{n.componentDidMount()}catch(c){bt(t,o,c)}}var i=t.return;try{Dv(t)}catch(c){bt(t,i,c)}break;case 5:var a=t.return;try{Dv(t)}catch(c){bt(t,a,c)}}}catch(c){bt(t,t.return,c)}if(t===e){ie=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ie=l;break}ie=t.return}}var Jz=Math.ceil,Md=Ro.ReactCurrentDispatcher,g0=Ro.ReactCurrentOwner,nn=Ro.ReactCurrentBatchConfig,Ne=0,Bt=null,It=null,Yt=0,Ar=0,qa=wi(0),Lt=0,rc=null,Xi=0,Vh=0,v0=0,$l=null,br=null,y0=0,ms=1/0,co=null,Ld=!1,Mv=null,li=null,du=!1,ei=null,zd=0,kl=0,Lv=null,nd=-1,od=0;function ur(){return Ne&6?$t():nd!==-1?nd:nd=$t()}function ci(e){return e.mode&1?Ne&2&&Yt!==0?Yt&-Yt:Nz.transition!==null?(od===0&&(od=f$()),od):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:x$(e.type)),e):1}function _n(e,t,r,n){if(50<kl)throw kl=0,Lv=null,Error(G(185));mc(e,r,n),(!(Ne&2)||e!==Bt)&&(e===Bt&&(!(Ne&2)&&(Vh|=r),Lt===4&&Jo(e,Yt)),Cr(e,n),r===1&&Ne===0&&!(t.mode&1)&&(ms=$t()+500,Mh&&_i()))}function Cr(e,t){var r=e.callbackNode;N6(e,t);var n=bd(e,e===Bt?Yt:0);if(n===0)r!==null&&nw(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&nw(r),t===1)e.tag===0?Dz(Kw.bind(null,e)):L$(Kw.bind(null,e)),kz(function(){!(Ne&6)&&_i()}),r=null;else{switch(p$(n)){case 1:r=Wy;break;case 4:r=u$;break;case 16:r=_d;break;case 536870912:r=d$;break;default:r=_d}r=M2(r,k2.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function k2(e,t){if(nd=-1,od=0,Ne&6)throw Error(G(327));var r=e.callbackNode;if(ns()&&e.callbackNode!==r)return null;var n=bd(e,e===Bt?Yt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Fd(e,n);else{t=n;var o=Ne;Ne|=2;var i=T2();(Bt!==e||Yt!==t)&&(co=null,ms=$t()+500,Wi(e,t));do try{t7();break}catch(l){R2(e,l)}while(1);n0(),Md.current=i,Ne=o,It!==null?t=0:(Bt=null,Yt=0,t=Lt)}if(t!==0){if(t===2&&(o=dv(e),o!==0&&(n=o,t=zv(e,o))),t===1)throw r=rc,Wi(e,0),Jo(e,n),Cr(e,$t()),r;if(t===6)Jo(e,n);else{if(o=e.current.alternate,!(n&30)&&!Zz(o)&&(t=Fd(e,n),t===2&&(i=dv(e),i!==0&&(n=i,t=zv(e,i))),t===1))throw r=rc,Wi(e,0),Jo(e,n),Cr(e,$t()),r;switch(e.finishedWork=o,e.finishedLanes=n,t){case 0:case 1:throw Error(G(345));case 2:Di(e,br,co);break;case 3:if(Jo(e,n),(n&130023424)===n&&(t=y0+500-$t(),10<t)){if(bd(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){ur(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=xv(Di.bind(null,e,br,co),t);break}Di(e,br,co);break;case 4:if(Jo(e,n),(n&4194240)===n)break;for(t=e.eventTimes,o=-1;0<n;){var a=31-wn(n);i=1<<a,a=t[a],a>o&&(o=a),n&=~i}if(n=o,n=$t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Jz(n/1960))-n,10<n){e.timeoutHandle=xv(Di.bind(null,e,br,co),n);break}Di(e,br,co);break;case 5:Di(e,br,co);break;default:throw Error(G(329))}}}return Cr(e,$t()),e.callbackNode===r?k2.bind(null,e):null}function zv(e,t){var r=$l;return e.current.memoizedState.isDehydrated&&(Wi(e,t).flags|=256),e=Fd(e,t),e!==2&&(t=br,br=r,t!==null&&Fv(t)),e}function Fv(e){br===null?br=e:br.push.apply(br,e)}function Zz(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],i=o.getSnapshot;o=o.value;try{if(!bn(i(),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 Jo(e,t){for(t&=~v0,t&=~Vh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-wn(t),n=1<<r;e[r]=-1,t&=~n}}function Kw(e){if(Ne&6)throw Error(G(327));ns();var t=bd(e,0);if(!(t&1))return Cr(e,$t()),null;var r=Fd(e,t);if(e.tag!==0&&r===2){var n=dv(e);n!==0&&(t=n,r=zv(e,n))}if(r===1)throw r=rc,Wi(e,0),Jo(e,t),Cr(e,$t()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Di(e,br,co),Cr(e,$t()),null}function x0(e,t){var r=Ne;Ne|=1;try{return e(t)}finally{Ne=r,Ne===0&&(ms=$t()+500,Mh&&_i())}}function Ji(e){ei!==null&&ei.tag===0&&!(Ne&6)&&ns();var t=Ne;Ne|=1;var r=nn.transition,n=Ge;try{if(nn.transition=null,Ge=1,e)return e()}finally{Ge=n,nn.transition=r,Ne=t,!(Ne&6)&&_i()}}function w0(){Ar=qa.current,at(qa)}function Wi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,$z(r)),It!==null)for(r=It.return;r!==null;){var n=r;switch(e0(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Cd();break;case 3:ps(),at(jr),at(ar),c0();break;case 5:l0(n);break;case 4:ps();break;case 13:at(yt);break;case 19:at(yt);break;case 10:o0(n.type._context);break;case 22:case 23:w0()}r=r.return}if(Bt=e,It=e=ui(e.current,null),Yt=Ar=t,Lt=0,rc=null,v0=Vh=Xi=0,br=$l=null,Fi!==null){for(t=0;t<Fi.length;t++)if(r=Fi[t],n=r.interleaved,n!==null){r.interleaved=null;var o=n.next,i=r.pending;if(i!==null){var a=i.next;i.next=o,n.next=a}r.pending=n}Fi=null}return e}function R2(e,t){do{var r=It;try{if(n0(),ed.current=Ad,Nd){for(var n=xt.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Nd=!1}if(Yi=0,Ft=Mt=xt=null,Cl=!1,Zl=0,g0.current=null,r===null||r.return===null){Lt=1,rc=t,It=null;break}e:{var i=e,a=r.return,l=r,c=t;if(t=Yt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Aw(a);if(m!==null){m.flags&=-257,Mw(m,a,l,i,t),m.mode&1&&Nw(i,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}else{if(!(t&1)){Nw(i,u,t),_0();break e}c=Error(G(426))}}else if(ut&&l.mode&1){var b=Aw(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Mw(b,a,l,i,t),t0(hs(c,l));break e}}i=c=hs(c,l),Lt!==4&&(Lt=2),$l===null?$l=[i]:$l.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=h2(i,c,t);Ew(i,y);break e;case 1:l=c;var x=i.type,_=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(li===null||!li.has(_)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=m2(i,l,t);Ew(i,w);break e}}i=i.return}while(i!==null)}D2(r)}catch(O){t=O,It===r&&r!==null&&(It=r=r.return);continue}break}while(1)}function T2(){var e=Md.current;return Md.current=Ad,e===null?Ad:e}function _0(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),Bt===null||!(Xi&268435455)&&!(Vh&268435455)||Jo(Bt,Yt)}function Fd(e,t){var r=Ne;Ne|=2;var n=T2();(Bt!==e||Yt!==t)&&(co=null,Wi(e,t));do try{e7();break}catch(o){R2(e,o)}while(1);if(n0(),Ne=r,Md.current=n,It!==null)throw Error(G(261));return Bt=null,Yt=0,Lt}function e7(){for(;It!==null;)I2(It)}function t7(){for(;It!==null&&!O6();)I2(It)}function I2(e){var t=A2(e.alternate,e,Ar);e.memoizedProps=e.pendingProps,t===null?D2(e):It=t,g0.current=null}function D2(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Qz(r,t),r!==null){r.flags&=32767,It=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Lt=6,It=null;return}}else if(r=qz(r,t,Ar),r!==null){It=r;return}if(t=t.sibling,t!==null){It=t;return}It=t=e}while(t!==null);Lt===0&&(Lt=5)}function Di(e,t,r){var n=Ge,o=nn.transition;try{nn.transition=null,Ge=1,r7(e,t,r,n)}finally{nn.transition=o,Ge=n}return null}function r7(e,t,r,n){do ns();while(ei!==null);if(Ne&6)throw Error(G(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(A6(e,i),e===Bt&&(It=Bt=null,Yt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||du||(du=!0,M2(_d,function(){return ns(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=nn.transition,nn.transition=null;var a=Ge;Ge=1;var l=Ne;Ne|=4,g0.current=null,Yz(e,r),E2(r,e),bz(vv),Sd=!!gv,vv=gv=null,e.current=r,Xz(r),C6(),Ne=l,Ge=a,nn.transition=i}else e.current=r;if(du&&(du=!1,ei=e,zd=o),i=e.pendingLanes,i===0&&(li=null),k6(r.stateNode),Cr(e,$t()),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(Ld)throw Ld=!1,e=Mv,Mv=null,e;return zd&1&&e.tag!==0&&ns(),i=e.pendingLanes,i&1?e===Lv?kl++:(kl=0,Lv=e):kl=0,_i(),null}function ns(){if(ei!==null){var e=p$(zd),t=nn.transition,r=Ge;try{if(nn.transition=null,Ge=16>e?16:e,ei===null)var n=!1;else{if(e=ei,ei=null,zd=0,Ne&6)throw Error(G(331));var o=Ne;for(Ne|=4,ie=e.current;ie!==null;){var i=ie,a=i.child;if(ie.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ie=u;ie!==null;){var d=ie;switch(d.tag){case 0:case 11:case 15:El(8,d,i)}var p=d.child;if(p!==null)p.return=d,ie=p;else for(;ie!==null;){d=ie;var h=d.sibling,m=d.return;if(j2(d),d===u){ie=null;break}if(h!==null){h.return=m,ie=h;break}ie=m}}}var v=i.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}ie=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,ie=a;else e:for(;ie!==null;){if(i=ie,i.flags&2048)switch(i.tag){case 0:case 11:case 15:El(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ie=y;break e}ie=i.return}}var x=e.current;for(ie=x;ie!==null;){a=ie;var _=a.child;if(a.subtreeFlags&2064&&_!==null)_.return=a,ie=_;else e:for(a=x;ie!==null;){if(l=ie,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Fh(9,l)}}catch(O){bt(l,l.return,O)}if(l===a){ie=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ie=w;break e}ie=l.return}}if(Ne=o,_i(),Kn&&typeof Kn.onPostCommitFiberRoot=="function")try{Kn.onPostCommitFiberRoot(Th,e)}catch{}n=!0}return n}finally{Ge=r,nn.transition=t}}return!1}function Yw(e,t,r){t=hs(r,t),t=h2(e,t,1),e=si(e,t,1),t=ur(),e!==null&&(mc(e,1,t),Cr(e,t))}function bt(e,t,r){if(e.tag===3)Yw(e,e,r);else for(;t!==null;){if(t.tag===3){Yw(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(li===null||!li.has(n))){e=hs(r,e),e=m2(t,e,1),t=si(t,e,1),e=ur(),t!==null&&(mc(t,1,e),Cr(t,e));break}}t=t.return}}function n7(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=ur(),e.pingedLanes|=e.suspendedLanes&r,Bt===e&&(Yt&r)===r&&(Lt===4||Lt===3&&(Yt&130023424)===Yt&&500>$t()-y0?Wi(e,0):v0|=r),Cr(e,t)}function N2(e,t){t===0&&(e.mode&1?(t=tu,tu<<=1,!(tu&130023424)&&(tu=4194304)):t=1);var r=ur();e=So(e,t),e!==null&&(mc(e,t,r),Cr(e,r))}function o7(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),N2(e,r)}function i7(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(G(314))}n!==null&&n.delete(t),N2(e,r)}var A2;A2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||jr.current)Sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Sr=!1,Gz(e,t,r);Sr=!!(e.flags&131072)}else Sr=!1,ut&&t.flags&1048576&&z$(t,kd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;rd(e,t),e=t.pendingProps;var o=us(t,ar.current);rs(t,r),o=d0(null,t,n,e,o,r);var i=f0();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,Or(n)?(i=!0,Ed(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,a0(t),o.updater=Lh,t.stateNode=o,o._reactInternals=t,Ov(t,n,e,r),t=$v(null,t,n,!0,i,r)):(t.tag=0,ut&&i&&Zy(t),cr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(rd(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=s7(n),e=mn(n,e),o){case 0:t=Ev(null,t,n,e,r);break e;case 1:t=Fw(null,t,n,e,r);break e;case 11:t=Lw(null,t,n,e,r);break e;case 14:t=zw(null,t,n,mn(n.type,e),r);break e}throw Error(G(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),Ev(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),Fw(e,t,n,o,r);case 3:e:{if(x2(t),e===null)throw Error(G(387));n=t.pendingProps,i=t.memoizedState,o=i.element,U$(e,t),Id(t,n,null,r);var a=t.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=hs(Error(G(423)),t),t=Vw(e,t,n,r,o);break e}else if(n!==o){o=hs(Error(G(424)),t),t=Vw(e,t,n,r,o);break e}else for(Lr=ai(t.stateNode.containerInfo.firstChild),Fr=t,ut=!0,yn=null,r=q$(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ds(),n===o){t=Po(e,t,r);break e}cr(e,t,n,r)}t=t.child}return t;case 5:return Q$(t),e===null&&Sv(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,yv(n,o)?a=null:i!==null&&yv(n,i)&&(t.flags|=32),y2(e,t),cr(e,t,a,r),t.child;case 6:return e===null&&Sv(t),null;case 13:return w2(e,t,r);case 4:return s0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=fs(t,null,n,r):cr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),Lw(e,t,n,o,r);case 7:return cr(e,t,t.pendingProps,r),t.child;case 8:return cr(e,t,t.pendingProps.children,r),t.child;case 12:return cr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ze(Rd,n._currentValue),n._currentValue=a,i!==null)if(bn(i.value,a)){if(i.children===o.children&&!jr.current){t=Po(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=go(-1,r&-r),c.tag=2;var u=i.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}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Pv(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(G(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Pv(a,r,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}cr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,rs(t,r),o=sn(o),n=n(o),t.flags|=1,cr(e,t,n,r),t.child;case 14:return n=t.type,o=mn(n,t.pendingProps),o=mn(n.type,o),zw(e,t,n,o,r);case 15:return g2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),rd(e,t),t.tag=1,Or(n)?(e=!0,Ed(t)):e=!1,rs(t,r),H$(t,n,o),Ov(t,n,o,r),$v(null,t,n,!0,e,r);case 19:return _2(e,t,r);case 22:return v2(e,t,r)}throw Error(G(156,t.tag))};function M2(e,t){return c$(e,t)}function a7(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 a7(e,t,r,n)}function b0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function s7(e){if(typeof e=="function")return b0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Vy)return 11;if(e===By)return 14}return 2}function ui(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 id(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")b0(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ma:return Hi(r.children,o,i,t);case Fy:a=8,o|=8;break;case Yg:return e=en(12,r,t,o|2),e.elementType=Yg,e.lanes=i,e;case Xg:return e=en(13,r,t,o),e.elementType=Xg,e.lanes=i,e;case Jg:return e=en(19,r,t,o),e.elementType=Jg,e.lanes=i,e;case GE:return Bh(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case WE:a=10;break e;case HE:a=9;break e;case Vy:a=11;break e;case By:a=14;break e;case qo:a=16,n=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=en(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Hi(e,t,r,n){return e=en(7,e,n,t),e.lanes=r,e}function Bh(e,t,r,n){return e=en(22,e,n,t),e.elementType=GE,e.lanes=r,e.stateNode={isHidden:!1},e}function rg(e,t,r){return e=en(6,e,null,t),e.lanes=r,e}function ng(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 l7(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mm(0),this.expirationTimes=Mm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mm(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function S0(e,t,r,n,o,i,a,l,c){return e=new l7(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=en(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},a0(i),e}function c7(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Aa,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function L2(e){if(!e)return pi;e=e._reactInternals;e:{if(ca(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(Or(r))return M$(e,r,t)}return t}function z2(e,t,r,n,o,i,a,l,c){return e=S0(r,n,!0,e,o,i,a,l,c),e.context=L2(null),r=e.current,n=ur(),o=ci(r),i=go(n,o),i.callback=t??null,si(r,i,o),e.current.lanes=o,mc(e,o,n),Cr(e,n),e}function Uh(e,t,r,n){var o=t.current,i=ur(),a=ci(o);return r=L2(r),t.context===null?t.context=r:t.pendingContext=r,t=go(i,a),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=si(o,t,a),e!==null&&(_n(e,o,a,i),Zu(e,o,a)),a}function Vd(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 Xw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function P0(e,t){Xw(e,t),(e=e.alternate)&&Xw(e,t)}function u7(){return null}var F2=typeof reportError=="function"?reportError:function(e){console.error(e)};function j0(e){this._internalRoot=e}Wh.prototype.render=j0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Uh(e,t,null,null)};Wh.prototype.unmount=j0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ji(function(){Uh(null,e,null,null)}),t[bo]=null}};function Wh(e){this._internalRoot=e}Wh.prototype.unstable_scheduleHydration=function(e){if(e){var t=g$();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Xo.length&&t!==0&&t<Xo[r].priority;r++);Xo.splice(r,0,e),r===0&&y$(e)}};function O0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jw(){}function d7(e,t,r,n,o){if(o){if(typeof n=="function"){var i=n;n=function(){var u=Vd(a);i.call(u)}}var a=z2(t,n,e,0,null,!1,!1,"",Jw);return e._reactRootContainer=a,e[bo]=a.current,Ql(e.nodeType===8?e.parentNode:e),Ji(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof n=="function"){var l=n;n=function(){var u=Vd(c);l.call(u)}}var c=S0(e,0,!1,null,null,!1,!1,"",Jw);return e._reactRootContainer=c,e[bo]=c.current,Ql(e.nodeType===8?e.parentNode:e),Ji(function(){Uh(t,c,r,n)}),c}function Gh(e,t,r,n,o){var i=r._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=Vd(a);l.call(c)}}Uh(t,a,e,o)}else a=d7(r,t,e,o,n);return Vd(a)}h$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=gl(t.pendingLanes);r!==0&&(Hy(t,r|1),Cr(t,$t()),!(Ne&6)&&(ms=$t()+500,_i()))}break;case 13:Ji(function(){var n=So(e,1);if(n!==null){var o=ur();_n(n,e,1,o)}}),P0(e,1)}};Gy=function(e){if(e.tag===13){var t=So(e,134217728);if(t!==null){var r=ur();_n(t,e,134217728,r)}P0(e,134217728)}};m$=function(e){if(e.tag===13){var t=ci(e),r=So(e,t);if(r!==null){var n=ur();_n(r,e,t,n)}P0(e,t)}};g$=function(){return Ge};v$=function(e,t){var r=Ge;try{return Ge=e,t()}finally{Ge=r}};lv=function(e,t,r){switch(t){case"input":if(tv(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=Ah(n);if(!o)throw Error(G(90));QE(n),tv(n,o)}}}break;case"textarea":YE(e,r);break;case"select":t=r.value,t!=null&&Ja(e,!!r.multiple,t,!1)}};n$=x0;o$=Ji;var f7={usingClientEntryPoint:!1,Events:[vc,Va,Ah,t$,r$,x0]},Js={findFiberByHostInstance:zi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},p7={bundleType:Js.bundleType,version:Js.version,rendererPackageName:Js.rendererPackageName,rendererConfig:Js.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ro.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=s$(e),e===null?null:e.stateNode},findFiberByHostInstance:Js.findFiberByHostInstance||u7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fu.isDisabled&&fu.supportsFiber)try{Th=fu.inject(p7),Kn=fu}catch{}}Wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f7;Wr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!O0(t))throw Error(G(200));return c7(e,t,null,r)};Wr.createRoot=function(e,t){if(!O0(e))throw Error(G(299));var r=!1,n="",o=F2;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=S0(e,1,!1,null,null,r,!1,n,o),e[bo]=t.current,Ql(e.nodeType===8?e.parentNode:e),new j0(t)};Wr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=s$(t),e=e===null?null:e.stateNode,e};Wr.flushSync=function(e){return Ji(e)};Wr.hydrate=function(e,t,r){if(!Hh(t))throw Error(G(200));return Gh(null,e,t,!0,r)};Wr.hydrateRoot=function(e,t,r){if(!O0(e))throw Error(G(405));var n=r!=null&&r.hydratedSources||null,o=!1,i="",a=F2;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),t=z2(t,null,e,1,r??null,o,!1,i,a),e[bo]=t.current,Ql(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 Wh(t)};Wr.render=function(e,t,r){if(!Hh(t))throw Error(G(200));return Gh(null,e,t,!1,r)};Wr.unmountComponentAtNode=function(e){if(!Hh(e))throw Error(G(40));return e._reactRootContainer?(Ji(function(){Gh(null,null,e,!1,function(){e._reactRootContainer=null,e[bo]=null})}),!0):!1};Wr.unstable_batchedUpdates=x0;Wr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Hh(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Gh(e,t,r,!1,n)};Wr.version="18.2.0-next-9e3b772b8-20220608";function V2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V2)}catch(e){console.error(e)}}V2(),zE.exports=Wr;var xc=zE.exports;const og=by(xc);var h7=Object.defineProperty,m7=Object.defineProperties,g7=Object.getOwnPropertyDescriptors,Zw=Object.getOwnPropertySymbols,v7=Object.prototype.hasOwnProperty,y7=Object.prototype.propertyIsEnumerable,e_=(e,t,r)=>t in e?h7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vv=(e,t)=>{for(var r in t||(t={}))v7.call(t,r)&&e_(e,r,t[r]);if(Zw)for(var r of Zw(t))y7.call(t,r)&&e_(e,r,t[r]);return e},t_=(e,t)=>m7(e,g7(t));const x7=["subtle","filled","outline","light","default","transparent","gradient"],pu={xs:j(18),sm:j(22),md:j(28),lg:j(34),xl:j(44)};function w7({variant:e,theme:t,color:r,gradient:n}){const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:x7.includes(e)?Vv({border:`${j(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var _7=W((e,{radius:t,color:r,gradient:n},{variant:o,size:i})=>({root:t_(Vv({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:A({size:i,sizes:pu}),minHeight:A({size:i,sizes:pu}),width:A({size:i,sizes:pu}),minWidth:A({size:i,sizes:pu})},w7({variant:o,theme:e,color:r,gradient:n})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":t_(Vv({content:'""'},e.fn.cover(j(-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 b7=_7;var S7=Object.defineProperty,Bd=Object.getOwnPropertySymbols,B2=Object.prototype.hasOwnProperty,U2=Object.prototype.propertyIsEnumerable,r_=(e,t,r)=>t in e?S7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n_=(e,t)=>{for(var r in t||(t={}))B2.call(t,r)&&r_(e,r,t[r]);if(Bd)for(var r of Bd(t))U2.call(t,r)&&r_(e,r,t[r]);return e},o_=(e,t)=>{var r={};for(var n in e)B2.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&&U2.call(e,n)&&(r[n]=e[n]);return r};function P7(e){var t=e,{size:r,color:n}=t,o=o_(t,["size","color"]);const i=o,{style:a}=i,l=o_(i,["style"]);return S.createElement("svg",n_({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:n,style:n_({width:r},a)},l),S.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var j7=Object.defineProperty,Ud=Object.getOwnPropertySymbols,W2=Object.prototype.hasOwnProperty,H2=Object.prototype.propertyIsEnumerable,i_=(e,t,r)=>t in e?j7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a_=(e,t)=>{for(var r in t||(t={}))W2.call(t,r)&&i_(e,r,t[r]);if(Ud)for(var r of Ud(t))H2.call(t,r)&&i_(e,r,t[r]);return e},s_=(e,t)=>{var r={};for(var n in e)W2.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&&H2.call(e,n)&&(r[n]=e[n]);return r};function O7(e){var t=e,{size:r,color:n}=t,o=s_(t,["size","color"]);const i=o,{style:a}=i,l=s_(i,["style"]);return S.createElement("svg",a_({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:n,style:a_({width:r,height:r},a)},l),S.createElement("g",{fill:"none",fillRule:"evenodd"},S.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},S.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),S.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},S.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var C7=Object.defineProperty,Wd=Object.getOwnPropertySymbols,G2=Object.prototype.hasOwnProperty,q2=Object.prototype.propertyIsEnumerable,l_=(e,t,r)=>t in e?C7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c_=(e,t)=>{for(var r in t||(t={}))G2.call(t,r)&&l_(e,r,t[r]);if(Wd)for(var r of Wd(t))q2.call(t,r)&&l_(e,r,t[r]);return e},u_=(e,t)=>{var r={};for(var n in e)G2.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&&q2.call(e,n)&&(r[n]=e[n]);return r};function E7(e){var t=e,{size:r,color:n}=t,o=u_(t,["size","color"]);const i=o,{style:a}=i,l=u_(i,["style"]);return S.createElement("svg",c_({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:n,style:c_({width:r},a)},l),S.createElement("circle",{cx:"15",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},S.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"105",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var $7=Object.defineProperty,Hd=Object.getOwnPropertySymbols,Q2=Object.prototype.hasOwnProperty,K2=Object.prototype.propertyIsEnumerable,d_=(e,t,r)=>t in e?$7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k7=(e,t)=>{for(var r in t||(t={}))Q2.call(t,r)&&d_(e,r,t[r]);if(Hd)for(var r of Hd(t))K2.call(t,r)&&d_(e,r,t[r]);return e},R7=(e,t)=>{var r={};for(var n in e)Q2.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&&K2.call(e,n)&&(r[n]=e[n]);return r};const ig={bars:P7,oval:O7,dots:E7},T7={xs:j(18),sm:j(22),md:j(36),lg:j(44),xl:j(58)},I7={size:"md"};function cn(e){const t=H("Loader",I7,e),{size:r,color:n,variant:o}=t,i=R7(t,["size","color","variant"]),a=Jt(),l=o in ig?o:a.loader;return S.createElement(oe,k7({role:"presentation",component:ig[l]||ig.bars,size:A({size:r,sizes:T7}),color:a.fn.variant({variant:"filled",primaryFallback:!1,color:n||a.primaryColor}).background},i))}cn.displayName="@mantine/core/Loader";var D7=Object.defineProperty,Gd=Object.getOwnPropertySymbols,Y2=Object.prototype.hasOwnProperty,X2=Object.prototype.propertyIsEnumerable,f_=(e,t,r)=>t in e?D7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p_=(e,t)=>{for(var r in t||(t={}))Y2.call(t,r)&&f_(e,r,t[r]);if(Gd)for(var r of Gd(t))X2.call(t,r)&&f_(e,r,t[r]);return e},N7=(e,t)=>{var r={};for(var n in e)Y2.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&&X2.call(e,n)&&(r[n]=e[n]);return r};const A7={color:"gray",size:"md",variant:"subtle"},J2=f.forwardRef((e,t)=>{const r=H("ActionIcon",A7,e),{className:n,color:o,children:i,radius:a,size:l,variant:c,gradient:u,disabled:d,loaderProps:p,loading:h,unstyled:m,__staticSelector:v}=r,g=N7(r,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:b,cx:y,theme:x}=b7({radius:a,color:o,gradient:u},{name:["ActionIcon",v],unstyled:m,size:l,variant:c}),_=S.createElement(cn,p_({color:x.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},p));return S.createElement(wo,p_({className:y(b.root,n),ref:t,disabled:d,"data-disabled":d||void 0,"data-loading":h||void 0,unstyled:m},g),h?_:i)});J2.displayName="@mantine/core/ActionIcon";const dr=J2;var M7=Object.defineProperty,L7=Object.defineProperties,z7=Object.getOwnPropertyDescriptors,qd=Object.getOwnPropertySymbols,Z2=Object.prototype.hasOwnProperty,ek=Object.prototype.propertyIsEnumerable,h_=(e,t,r)=>t in e?M7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F7=(e,t)=>{for(var r in t||(t={}))Z2.call(t,r)&&h_(e,r,t[r]);if(qd)for(var r of qd(t))ek.call(t,r)&&h_(e,r,t[r]);return e},V7=(e,t)=>L7(e,z7(t)),B7=(e,t)=>{var r={};for(var n in e)Z2.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&&ek.call(e,n)&&(r[n]=e[n]);return r};function C0(e){const t=H("Portal",{},e),{children:r,target:n,className:o,innerRef:i}=t,a=B7(t,["children","target","className","innerRef"]),l=Jt(),[c,u]=f.useState(!1),d=f.useRef();return CE(()=>(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?xc.createPortal(S.createElement("div",V7(F7({className:o,dir:l.dir},a),{ref:i}),r),d.current):null}C0.displayName="@mantine/core/Portal";var U7=Object.defineProperty,Qd=Object.getOwnPropertySymbols,tk=Object.prototype.hasOwnProperty,rk=Object.prototype.propertyIsEnumerable,m_=(e,t,r)=>t in e?U7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W7=(e,t)=>{for(var r in t||(t={}))tk.call(t,r)&&m_(e,r,t[r]);if(Qd)for(var r of Qd(t))rk.call(t,r)&&m_(e,r,t[r]);return e},H7=(e,t)=>{var r={};for(var n in e)tk.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&&rk.call(e,n)&&(r[n]=e[n]);return r};function Rs(e){var t=e,{withinPortal:r=!0,children:n}=t,o=H7(t,["withinPortal","children"]);return r?S.createElement(C0,W7({},o),n):S.createElement(S.Fragment,null,n)}Rs.displayName="@mantine/core/OptionalPortal";var G7=Object.defineProperty,q7=Object.defineProperties,Q7=Object.getOwnPropertyDescriptors,g_=Object.getOwnPropertySymbols,K7=Object.prototype.hasOwnProperty,Y7=Object.prototype.propertyIsEnumerable,v_=(e,t,r)=>t in e?G7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ag=(e,t)=>{for(var r in t||(t={}))K7.call(t,r)&&v_(e,r,t[r]);if(g_)for(var r of g_(t))Y7.call(t,r)&&v_(e,r,t[r]);return e},y_=(e,t)=>q7(e,Q7(t));function X7({variant:e,color:t,theme:r}){if(e==="filled")return{backgroundColor:r.fn.variant({variant:"filled",color:t}).background,color:r.white};if(e==="outline"){const n=r.fn.variant({variant:"outline",color:t});return{color:n.color,borderColor:n.border,backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.white}}if(e==="light"){const n=r.fn.variant({variant:"light",color:t});return{backgroundColor:n.background,color:n.color}}return null}var J7=W((e,{radius:t,color:r},{variant:n})=>({root:ag(y_(ag({},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:`${j(1)} solid transparent`}),X7({variant:n,color:r,theme:e})),wrapper:{display:"flex"},body:{flex:1},title:{boxSizing:"border-box",margin:0,marginBottom:e.spacing.xs,display:"flex",alignItems:"center",justifyContent:"space-between",lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,fontWeight:700,"&[data-with-close-button]":{paddingRight:e.spacing.md}},label:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},icon:{lineHeight:1,width:j(20),height:j(20),display:"flex",alignItems:"center",justifyContent:"flex-start",marginRight:e.spacing.md,marginTop:1},message:y_(ag({},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:j(10),height:j(10),color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}}));const Z7=J7;var e8=Object.defineProperty,Kd=Object.getOwnPropertySymbols,nk=Object.prototype.hasOwnProperty,ok=Object.prototype.propertyIsEnumerable,x_=(e,t,r)=>t in e?e8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w_=(e,t)=>{for(var r in t||(t={}))nk.call(t,r)&&x_(e,r,t[r]);if(Kd)for(var r of Kd(t))ok.call(t,r)&&x_(e,r,t[r]);return e},t8=(e,t)=>{var r={};for(var n in e)nk.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&&ok.call(e,n)&&(r[n]=e[n]);return r};function ik(e){const t=e,{width:r,height:n,style:o}=t,i=t8(t,["width","height","style"]);return S.createElement("svg",w_({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:w_({width:r,height:n},o)},i),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"}))}ik.displayName="@mantine/core/CloseIcon";var r8=Object.defineProperty,Yd=Object.getOwnPropertySymbols,ak=Object.prototype.hasOwnProperty,sk=Object.prototype.propertyIsEnumerable,__=(e,t,r)=>t in e?r8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n8=(e,t)=>{for(var r in t||(t={}))ak.call(t,r)&&__(e,r,t[r]);if(Yd)for(var r of Yd(t))sk.call(t,r)&&__(e,r,t[r]);return e},o8=(e,t)=>{var r={};for(var n in e)ak.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yd)for(var n of Yd(e))t.indexOf(n)<0&&sk.call(e,n)&&(r[n]=e[n]);return r};const i8={xs:j(12),sm:j(16),md:j(20),lg:j(28),xl:j(34)},a8={size:"sm"},lk=f.forwardRef((e,t)=>{const r=H("CloseButton",a8,e),{iconSize:n,size:o,children:i}=r,a=o8(r,["iconSize","size","children"]),l=j(n||i8[o]);return S.createElement(dr,n8({ref:t,__staticSelector:"CloseButton",size:o},a),i||S.createElement(ik,{width:l,height:l}))});lk.displayName="@mantine/core/CloseButton";const wc=lk;var s8=Object.defineProperty,Xd=Object.getOwnPropertySymbols,ck=Object.prototype.hasOwnProperty,uk=Object.prototype.propertyIsEnumerable,b_=(e,t,r)=>t in e?s8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l8=(e,t)=>{for(var r in t||(t={}))ck.call(t,r)&&b_(e,r,t[r]);if(Xd)for(var r of Xd(t))uk.call(t,r)&&b_(e,r,t[r]);return e},c8=(e,t)=>{var r={};for(var n in e)ck.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xd)for(var n of Xd(e))t.indexOf(n)<0&&uk.call(e,n)&&(r[n]=e[n]);return r};const u8={variant:"light"},_c=f.forwardRef((e,t)=>{const r=H("Alert",u8,e),{id:n,className:o,title:i,variant:a,children:l,color:c,classNames:u,icon:d,styles:p,onClose:h,radius:m,withCloseButton:v,closeButtonLabel:g,unstyled:b}=r,y=c8(r,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:x,cx:_}=Z7({color:c,radius:m},{classNames:u,styles:p,unstyled:b,variant:a,name:"Alert"}),w=Rr(n),O=i&&`${w}-title`,C=`${w}-body`;return S.createElement(oe,l8({id:w,role:"alert","aria-labelledby":O,"aria-describedby":C,className:_(x.root,x[a],o),ref:t},y),S.createElement("div",{className:x.wrapper},d&&S.createElement("div",{className:x.icon},d),S.createElement("div",{className:x.body},i&&S.createElement("div",{className:x.title,"data-with-close-button":v||void 0},S.createElement("span",{id:O,className:x.label},i)),S.createElement("div",{id:C,className:x.message},l)),v&&S.createElement(wc,{className:x.closeButton,onClick:h,variant:"transparent",size:16,iconSize:16,"aria-label":g})))});_c.displayName="@mantine/core/Alert";var d8=Object.defineProperty,f8=Object.defineProperties,p8=Object.getOwnPropertyDescriptors,S_=Object.getOwnPropertySymbols,h8=Object.prototype.hasOwnProperty,m8=Object.prototype.propertyIsEnumerable,P_=(e,t,r)=>t in e?d8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hu=(e,t)=>{for(var r in t||(t={}))h8.call(t,r)&&P_(e,r,t[r]);if(S_)for(var r of S_(t))m8.call(t,r)&&P_(e,r,t[r]);return e},g8=(e,t)=>f8(e,p8(t));function v8({underline:e,strikethrough:t}){const r=[];return e&&r.push("underline"),t&&r.push("line-through"),r.length>0?r.join(" "):"none"}function y8({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function x8(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function w8({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var _8=W((e,{color:t,lineClamp:r,truncate:n,inline:o,inherit:i,underline:a,gradient:l,weight:c,transform:u,align:d,strikethrough:p,italic:h},{size:m})=>{const v=e.fn.variant({variant:"gradient",gradient:l});return{root:g8(hu(hu(hu(hu({},e.fn.fontStyles()),e.fn.focusStyles()),x8(r)),w8({theme:e,truncate:n})),{color:y8({color:t,theme:e}),fontFamily:i?"inherit":e.fontFamily,fontSize:i||m===void 0?"inherit":A({size:m,sizes:e.fontSizes}),lineHeight:i?"inherit":o?1:e.lineHeight,textDecoration:v8({underline:a,strikethrough:p}),WebkitTapHighlightColor:"transparent",fontWeight:i?"inherit":c,textTransform:u,textAlign:d,fontStyle:h?"italic":void 0}),gradient:{backgroundImage:v.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const b8=_8;var S8=Object.defineProperty,Jd=Object.getOwnPropertySymbols,dk=Object.prototype.hasOwnProperty,fk=Object.prototype.propertyIsEnumerable,j_=(e,t,r)=>t in e?S8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P8=(e,t)=>{for(var r in t||(t={}))dk.call(t,r)&&j_(e,r,t[r]);if(Jd)for(var r of Jd(t))fk.call(t,r)&&j_(e,r,t[r]);return e},j8=(e,t)=>{var r={};for(var n in e)dk.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&&fk.call(e,n)&&(r[n]=e[n]);return r};const O8={variant:"text"},pk=f.forwardRef((e,t)=>{const r=H("Text",O8,e),{className:n,size:o,weight:i,transform:a,color:l,align:c,variant:u,lineClamp:d,truncate:p,gradient:h,inline:m,inherit:v,underline:g,strikethrough:b,italic:y,classNames:x,styles:_,unstyled:w,span:O,__staticSelector:C}=r,P=j8(r,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:E,cx:k}=b8({color:l,lineClamp:d,truncate:p,inline:m,inherit:v,underline:g,strikethrough:b,italic:y,weight:i,transform:a,align:c,gradient:h},{unstyled:w,name:C||"Text",variant:u,size:o});return S.createElement(oe,P8({ref:t,className:k(E.root,{[E.gradient]:u==="gradient"},n),component:O?"span":"div"},P))});pk.displayName="@mantine/core/Text";const re=pk;var C8=Object.defineProperty,O_=Object.getOwnPropertySymbols,E8=Object.prototype.hasOwnProperty,$8=Object.prototype.propertyIsEnumerable,C_=(e,t,r)=>t in e?C8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k8=(e,t)=>{for(var r in t||(t={}))E8.call(t,r)&&C_(e,r,t[r]);if(O_)for(var r of O_(t))$8.call(t,r)&&C_(e,r,t[r]);return e};function R8({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():e.fn.themeColor(t||e.primaryColor,e.colorScheme==="dark"?4:7,!1,!0)}var T8=W((e,{color:t,underline:r})=>({root:k8({backgroundColor:"transparent",cursor:"pointer",padding:0,border:0,color:R8({theme:e,color:t})},e.fn.hover({textDecoration:r?"underline":"none"}))}));const I8=T8;var D8=Object.defineProperty,Zd=Object.getOwnPropertySymbols,hk=Object.prototype.hasOwnProperty,mk=Object.prototype.propertyIsEnumerable,E_=(e,t,r)=>t in e?D8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$_=(e,t)=>{for(var r in t||(t={}))hk.call(t,r)&&E_(e,r,t[r]);if(Zd)for(var r of Zd(t))mk.call(t,r)&&E_(e,r,t[r]);return e},N8=(e,t)=>{var r={};for(var n in e)hk.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&&mk.call(e,n)&&(r[n]=e[n]);return r};const A8={underline:!0},gk=f.forwardRef((e,t)=>{const r=H("Anchor",A8,e),{component:n,className:o,unstyled:i,variant:a,size:l,color:c,underline:u}=r,d=N8(r,["component","className","unstyled","variant","size","color","underline"]),{classes:p,cx:h}=I8({color:c,underline:u},{name:"Anchor",unstyled:i,variant:a,size:l}),m=n==="button"?{type:"button"}:null;return S.createElement(re,$_($_({component:n||"a",ref:t,className:h(p.root,o),size:l},m),d))});gk.displayName="@mantine/core/Anchor";const Le=gk,vk=f.createContext({zIndex:1e3,fixed:!1,layout:"default"}),M8=vk.Provider;function yk(){return f.useContext(vk)}function qh(e,t){if(!e)return[];const r=Object.keys(e).filter(n=>n!=="base").map(n=>[A({size:n,sizes:t.breakpoints,units:"em"}),e[n]]);return r.sort((n,o)=>pr(n[0])-pr(o[0])),r}var L8=Object.defineProperty,z8=Object.defineProperties,F8=Object.getOwnPropertyDescriptors,k_=Object.getOwnPropertySymbols,V8=Object.prototype.hasOwnProperty,B8=Object.prototype.propertyIsEnumerable,R_=(e,t,r)=>t in e?L8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mu=(e,t)=>{for(var r in t||(t={}))V8.call(t,r)&&R_(e,r,t[r]);if(k_)for(var r of k_(t))B8.call(t,r)&&R_(e,r,t[r]);return e},T_=(e,t)=>z8(e,F8(t)),U8=W((e,{height:t,width:r,fixed:n,position:o,hiddenBreakpoint:i,zIndex:a,section:l,withBorder:c,layout:u})=>{const d=typeof r=="object"&&r!==null?qh(r,e).reduce((h,[m,v])=>(h[`@media (min-width: ${ir(m)})`]={width:j(v),minWidth:j(v)},h),{}):null,p=c?{[l==="navbar"?"borderRight":"borderLeft"]:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:T_(mu(mu(T_(mu(mu({},e.fn.fontStyles()),o),{top:u==="alt"?0:(o==null?void 0:o.top)||"var(--mantine-header-height)",bottom:0,zIndex:a,height:t?j(t):u==="alt"?"auto":"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))",width:r!=null&&r.base?j(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(pr(A({size:i,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const W8=U8;var H8=Object.defineProperty,ef=Object.getOwnPropertySymbols,xk=Object.prototype.hasOwnProperty,wk=Object.prototype.propertyIsEnumerable,I_=(e,t,r)=>t in e?H8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D_=(e,t)=>{for(var r in t||(t={}))xk.call(t,r)&&I_(e,r,t[r]);if(ef)for(var r of ef(t))wk.call(t,r)&&I_(e,r,t[r]);return e},G8=(e,t)=>{var r={};for(var n in e)xk.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&&wk.call(e,n)&&(r[n]=e[n]);return r};const _k=f.forwardRef((e,t)=>{var r=e,{width:n,height:o,fixed:i=!1,position:a,zIndex:l,hiddenBreakpoint:c="md",hidden:u=!1,withBorder:d=!0,className:p,classNames:h,styles:m,children:v,section:g,__staticSelector:b,unstyled:y,variant:x}=r,_=G8(r,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const w=yk(),{classes:O,cx:C,theme:P}=W8({width:n,height:o,fixed:w.fixed||i,position:a,hiddenBreakpoint:c,zIndex:l||w.zIndex||Cn("app"),section:g,withBorder:d,layout:w.layout},{classNames:h,styles:m,name:b,unstyled:y,variant:x}),E=qh(n,P).reduce((k,[$,I])=>(k[`@media (min-width: ${ir($)})`]={[`--mantine-${g}-width`]:j(I)},k),{});return S.createElement(oe,D_({component:g==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:C(O.root,p)},_),v,S.createElement(OE,{styles:()=>({":root":D_({[`--mantine-${g}-width`]:n!=null&&n.base?j(n.base):"0rem"},E)})}))});_k.displayName="@mantine/core/HorizontalSection";var q8=Object.defineProperty,tf=Object.getOwnPropertySymbols,bk=Object.prototype.hasOwnProperty,Sk=Object.prototype.propertyIsEnumerable,N_=(e,t,r)=>t in e?q8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q8=(e,t)=>{for(var r in t||(t={}))bk.call(t,r)&&N_(e,r,t[r]);if(tf)for(var r of tf(t))Sk.call(t,r)&&N_(e,r,t[r]);return e},K8=(e,t)=>{var r={};for(var n in e)bk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tf)for(var n of tf(e))t.indexOf(n)<0&&Sk.call(e,n)&&(r[n]=e[n]);return r};const Pk=f.forwardRef((e,t)=>{var r=e,{children:n,grow:o=!1,sx:i}=r,a=K8(r,["children","grow","sx"]);return S.createElement(oe,Q8({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},...dc(i)]},a),n)});Pk.displayName="@mantine/core/Section";const Y8=Pk;var X8=Object.defineProperty,A_=Object.getOwnPropertySymbols,J8=Object.prototype.hasOwnProperty,Z8=Object.prototype.propertyIsEnumerable,M_=(e,t,r)=>t in e?X8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eF=(e,t)=>{for(var r in t||(t={}))J8.call(t,r)&&M_(e,r,t[r]);if(A_)for(var r of A_(t))Z8.call(t,r)&&M_(e,r,t[r]);return e};const tF={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},Rl=f.forwardRef((e,t)=>{const r=H("Navbar",tF,e);return S.createElement(_k,eF({section:"navbar",__staticSelector:"Navbar",ref:t},r))});Rl.Section=Y8;Rl.displayName="@mantine/core/Navbar";var rF=Object.defineProperty,nF=Object.defineProperties,oF=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,iF=Object.prototype.hasOwnProperty,aF=Object.prototype.propertyIsEnumerable,z_=(e,t,r)=>t in e?rF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sg=(e,t)=>{for(var r in t||(t={}))iF.call(t,r)&&z_(e,r,t[r]);if(L_)for(var r of L_(t))aF.call(t,r)&&z_(e,r,t[r]);return e},F_=(e,t)=>nF(e,oF(t)),sF=W((e,{height:t,fixed:r,position:n,zIndex:o,borderPosition:i,layout:a})=>{const l=typeof t=="object"&&t!==null?qh(t,e).reduce((c,[u,d])=>(c[`@media (min-width: ${ir(u)})`]={height:j(d),minHeight:j(d)},c),{}):null;return{root:F_(sg(F_(sg(sg({},e.fn.fontStyles()),n),{zIndex:o,left:a==="alt"?"var(--mantine-navbar-width, 0)":0,right:a==="alt"?"var(--mantine-aside-width, 0)":0,height:typeof t=="object"?j(t==null?void 0:t.base)||"100%":j(t),maxHeight:typeof t=="object"?j(t==null?void 0:t.base)||"100%":j(t),position:r?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),l),{borderBottom:i==="bottom"?`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:i==="top"?`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const lF=sF;var cF=Object.defineProperty,rf=Object.getOwnPropertySymbols,jk=Object.prototype.hasOwnProperty,Ok=Object.prototype.propertyIsEnumerable,V_=(e,t,r)=>t in e?cF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,B_=(e,t)=>{for(var r in t||(t={}))jk.call(t,r)&&V_(e,r,t[r]);if(rf)for(var r of rf(t))Ok.call(t,r)&&V_(e,r,t[r]);return e},uF=(e,t)=>{var r={};for(var n in e)jk.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&&Ok.call(e,n)&&(r[n]=e[n]);return r};const Ck=f.forwardRef((e,t)=>{var r=e,{children:n,className:o,classNames:i,styles:a,height:l,fixed:c=!1,withBorder:u=!0,position:d,zIndex:p,section:h,unstyled:m,__staticSelector:v,variant:g}=r,b=uF(r,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector","variant"]);const y=yk(),x=p||y.zIndex||Cn("app"),{classes:_,cx:w,theme:O}=lF({height:l,fixed:y.fixed||c,position:d,zIndex:typeof x=="number"&&y.layout==="default"?x+1:x,layout:y.layout,borderPosition:u?h==="header"?"bottom":"top":"none"},{name:v,classNames:i,styles:a,unstyled:m,variant:g}),C=typeof l=="object"&&l!==null?qh(l,O).reduce((P,[E,k])=>(P[`@media (min-width: ${ir(E)})`]={[`--mantine-${h}-height`]:j(k)},P),{}):null;return S.createElement(oe,B_({component:h==="header"?"header":"footer",className:w(_.root,o),ref:t},b),n,S.createElement(OE,{styles:()=>({":root":B_({[`--mantine-${h}-height`]:typeof l=="object"?j(l==null?void 0:l.base)||"100%":j(l)},C)})}))});Ck.displayName="@mantine/core/VerticalSection";var dF=Object.defineProperty,fF=Object.defineProperties,pF=Object.getOwnPropertyDescriptors,U_=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,mF=Object.prototype.propertyIsEnumerable,W_=(e,t,r)=>t in e?dF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gF=(e,t)=>{for(var r in t||(t={}))hF.call(t,r)&&W_(e,r,t[r]);if(U_)for(var r of U_(t))mF.call(t,r)&&W_(e,r,t[r]);return e},vF=(e,t)=>fF(e,pF(t));const yF={fixed:!1,position:{top:0,left:0,right:0}},Ek=f.forwardRef((e,t)=>{const r=H("Header",yF,e);return S.createElement(Ck,vF(gF({section:"header",__staticSelector:"Header"},r),{ref:t}))});Ek.displayName="@mantine/core/Header";var xF=Object.defineProperty,H_=Object.getOwnPropertySymbols,wF=Object.prototype.hasOwnProperty,_F=Object.prototype.propertyIsEnumerable,G_=(e,t,r)=>t in e?xF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$k=(e,t)=>{for(var r in t||(t={}))wF.call(t,r)&&G_(e,r,t[r]);if(H_)for(var r of H_(t))_F.call(t,r)&&G_(e,r,t[r]);return e};function bF(e,t){const r=A({size:e.padding,sizes:t.spacing}),n=e.navbarOffsetBreakpoint?A({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?A({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;if(!e.fixed)return{padding:r};const i=pr(n),a=pr(o);return $k({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})`},i===a?{[`@media (max-width: ${ir(i-1)})`]:{paddingLeft:r,paddingRight:r}}:{[`@media (max-width: ${ir(i-1)})`]:{paddingLeft:r},[`@media (max-width: ${ir(a-1)})`]:{paddingRight:r}})}var SF=W((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:$k({flex:1,width:"100vw",boxSizing:"border-box"},bF(t,e))}));const PF=SF;var jF=Object.defineProperty,nf=Object.getOwnPropertySymbols,kk=Object.prototype.hasOwnProperty,Rk=Object.prototype.propertyIsEnumerable,q_=(e,t,r)=>t in e?jF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OF=(e,t)=>{for(var r in t||(t={}))kk.call(t,r)&&q_(e,r,t[r]);if(nf)for(var r of nf(t))Rk.call(t,r)&&q_(e,r,t[r]);return e},CF=(e,t)=>{var r={};for(var n in e)kk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nf)for(var n of nf(e))t.indexOf(n)<0&&Rk.call(e,n)&&(r[n]=e[n]);return r};const EF={fixed:!0,padding:"md"},Tk=f.forwardRef((e,t)=>{const r=H("AppShell",EF,e),{children:n,navbar:o,header:i,footer:a,aside:l,fixed:c,zIndex:u,padding:d,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h,className:m,styles:v,classNames:g,unstyled:b,hidden:y,layout:x,variant:_}=r,w=CF(r,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout","variant"]),{classes:O,cx:C}=PF({padding:d,fixed:c,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h},{styles:v,classNames:g,unstyled:b,name:"AppShell",variant:_});return y?S.createElement(S.Fragment,null,n):S.createElement(M8,{value:{fixed:c,zIndex:u,layout:x}},S.createElement(oe,OF({className:C(O.root,m),ref:t},w),i,S.createElement("div",{className:O.body},o,S.createElement("main",{className:O.main},n),l),a))});Tk.displayName="@mantine/core/AppShell";const gu={xs:j(1),sm:j(2),md:j(3),lg:j(4),xl:j(5)};function vu(e,t){const r=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?r:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $F=W((e,{color:t},{size:r,variant:n})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:j(1),borderTop:`${A({size:r,sizes:gu})} ${n} ${vu(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${A({size:r,sizes:gu})} ${n} ${vu(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:j(A({size:r,sizes:gu})),borderTopColor:vu(e,t),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:j(A({size:r,sizes:gu})),borderLeftColor:vu(e,t),borderLeftStyle:n}}));const kF=$F;var RF=Object.defineProperty,TF=Object.defineProperties,IF=Object.getOwnPropertyDescriptors,of=Object.getOwnPropertySymbols,Ik=Object.prototype.hasOwnProperty,Dk=Object.prototype.propertyIsEnumerable,Q_=(e,t,r)=>t in e?RF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K_=(e,t)=>{for(var r in t||(t={}))Ik.call(t,r)&&Q_(e,r,t[r]);if(of)for(var r of of(t))Dk.call(t,r)&&Q_(e,r,t[r]);return e},DF=(e,t)=>TF(e,IF(t)),NF=(e,t)=>{var r={};for(var n in e)Ik.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&&Dk.call(e,n)&&(r[n]=e[n]);return r};const AF={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},_r=f.forwardRef((e,t)=>{const r=H("Divider",AF,e),{className:n,color:o,orientation:i,size:a,label:l,labelPosition:c,labelProps:u,variant:d,styles:p,classNames:h,unstyled:m}=r,v=NF(r,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:g,cx:b}=kF({color:o},{classNames:h,styles:p,unstyled:m,name:"Divider",variant:d,size:a}),y=i==="vertical",x=i==="horizontal",_=!!l&&x,w=!(u!=null&&u.color);return S.createElement(oe,K_({ref:t,className:b(g.root,{[g.vertical]:y,[g.horizontal]:x,[g.withLabel]:_},n),role:"separator"},v),_&&S.createElement(re,DF(K_({},u),{size:(u==null?void 0:u.size)||"xs",mt:j(2),className:b(g.label,g[c],{[g.labelDefaultStyles]:w})}),l))});_r.displayName="@mantine/core/Divider";var MF=Object.defineProperty,LF=Object.defineProperties,zF=Object.getOwnPropertyDescriptors,Y_=Object.getOwnPropertySymbols,FF=Object.prototype.hasOwnProperty,VF=Object.prototype.propertyIsEnumerable,X_=(e,t,r)=>t in e?MF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,J_=(e,t)=>{for(var r in t||(t={}))FF.call(t,r)&&X_(e,r,t[r]);if(Y_)for(var r of Y_(t))VF.call(t,r)&&X_(e,r,t[r]);return e},BF=(e,t)=>LF(e,zF(t)),UF=W((e,t,{size:r})=>({item:BF(J_({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`,cursor:"pointer",fontSize:A({size:r,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":J_({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${A({size:r,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${A({size:r,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const WF=UF;var HF=Object.defineProperty,Z_=Object.getOwnPropertySymbols,GF=Object.prototype.hasOwnProperty,qF=Object.prototype.propertyIsEnumerable,eb=(e,t,r)=>t in e?HF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QF=(e,t)=>{for(var r in t||(t={}))GF.call(t,r)&&eb(e,r,t[r]);if(Z_)for(var r of Z_(t))qF.call(t,r)&&eb(e,r,t[r]);return e};function Nk({data:e,hovered:t,classNames:r,styles:n,isItemSelected:o,uuid:i,__staticSelector:a,onItemHover:l,onItemSelect:c,itemsRefs:u,itemComponent:d,size:p,nothingFound:h,creatable:m,createLabel:v,unstyled:g,variant:b}){const{classes:y}=WF(null,{classNames:r,styles:n,unstyled:g,name:a,variant:b,size:p}),x=[],_=[];let w=null;const O=(P,E)=>{const k=typeof o=="function"?o(P.value):!1;return S.createElement(d,QF({key:P.value,className:y.item,"data-disabled":P.disabled||void 0,"data-hovered":!P.disabled&&t===E||void 0,"data-selected":!P.disabled&&k||void 0,selected:k,onMouseEnter:()=>l(E),id:`${i}-${E}`,role:"option",tabIndex:-1,"aria-selected":t===E,ref:$=>{u&&u.current&&(u.current[P.value]=$)},onMouseDown:P.disabled?null:$=>{$.preventDefault(),c(P)},disabled:P.disabled,variant:b},P))};let C=null;if(e.forEach((P,E)=>{P.creatable?w=E:P.group?(C!==P.group&&(C=P.group,_.push(S.createElement("div",{className:y.separator,key:`__mantine-divider-${E}`},S.createElement(_r,{classNames:{label:y.separatorLabel},label:P.group})))),_.push(O(P,E))):x.push(O(P,E))}),m){const P=e[w];x.push(S.createElement("div",{key:kh(),className:y.item,"data-hovered":t===w||void 0,onMouseEnter:()=>l(w),onMouseDown:E=>{E.preventDefault(),c(P)},tabIndex:-1,ref:E=>{u&&u.current&&(u.current[P.value]=E)}},v))}return _.length>0&&x.length>0&&x.unshift(S.createElement("div",{className:y.separator,key:"empty-group-separator"},S.createElement(_r,null))),_.length>0||x.length>0?S.createElement(S.Fragment,null,_,x):S.createElement(re,{size:p,unstyled:g,className:y.nothingFound},h)}Nk.displayName="@mantine/core/SelectItems";var KF=Object.defineProperty,af=Object.getOwnPropertySymbols,Ak=Object.prototype.hasOwnProperty,Mk=Object.prototype.propertyIsEnumerable,tb=(e,t,r)=>t in e?KF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YF=(e,t)=>{for(var r in t||(t={}))Ak.call(t,r)&&tb(e,r,t[r]);if(af)for(var r of af(t))Mk.call(t,r)&&tb(e,r,t[r]);return e},XF=(e,t)=>{var r={};for(var n in e)Ak.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&&Mk.call(e,n)&&(r[n]=e[n]);return r};const Lk=f.forwardRef((e,t)=>{var r=e,{label:n,value:o}=r,i=XF(r,["label","value"]);return S.createElement("div",YF({ref:t},i),n||o)});Lk.displayName="@mantine/core/DefaultItem";function JF(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function zk(...e){return t=>e.forEach(r=>JF(r,t))}function ua(...e){return f.useCallback(zk(...e),e)}const Fk=f.forwardRef((e,t)=>{const{children:r,...n}=e,o=f.Children.toArray(r),i=o.find(eV);if(i){const a=i.props.children,l=o.map(c=>c===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:c);return f.createElement(Bv,rt({},n,{ref:t}),f.isValidElement(a)?f.cloneElement(a,void 0,l):null)}return f.createElement(Bv,rt({},n,{ref:t}),r)});Fk.displayName="Slot";const Bv=f.forwardRef((e,t)=>{const{children:r,...n}=e;return f.isValidElement(r)?f.cloneElement(r,{...tV(n,r.props),ref:zk(t,r.ref)}):f.Children.count(r)>1?f.Children.only(null):null});Bv.displayName="SlotClone";const ZF=({children:e})=>f.createElement(f.Fragment,null,e);function eV(e){return f.isValidElement(e)&&e.type===ZF}function tV(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{i(...l),o(...l)}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}const rV=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],bc=rV.reduce((e,t)=>{const r=f.forwardRef((n,o)=>{const{asChild:i,...a}=n,l=i?Fk:t;return f.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),f.createElement(l,rt({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Uv=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function nV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const Sc=e=>{const{present:t,children:r}=e,n=oV(t),o=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),i=ua(n.ref,o.ref);return typeof r=="function"||n.isPresent?f.cloneElement(o,{ref:i}):null};Sc.displayName="Presence";function oV(e){const[t,r]=f.useState(),n=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[l,c]=nV(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=yu(n.current);i.current=l==="mounted"?u:"none"},[l]),Uv(()=>{const u=n.current,d=o.current;if(d!==e){const h=i.current,m=yu(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Uv(()=>{if(t){const u=p=>{const m=yu(n.current).includes(p.animationName);p.target===t&&m&&xc.flushSync(()=>c("ANIMATION_END"))},d=p=>{p.target===t&&(i.current=yu(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 yu(e){return(e==null?void 0:e.animationName)||"none"}function iV(e,t=[]){let r=[];function n(i,a){const l=f.createContext(a),c=r.length;r=[...r,a];function u(p){const{scope:h,children:m,...v}=p,g=(h==null?void 0:h[e][c])||l,b=f.useMemo(()=>v,Object.values(v));return f.createElement(g.Provider,{value:b},m)}function d(p,h){const m=(h==null?void 0:h[e][c])||l,v=f.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=r.map(a=>f.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,aV(o,...t)]}function aV(...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(i){const a=n.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Mi(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}const sV=f.createContext(void 0);function lV(e){const t=f.useContext(sV);return e||t||"ltr"}function cV(e,[t,r]){return Math.min(r,Math.max(t,e))}function Gi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function uV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const Vk="ScrollArea",[Bk,Cve]=iV(Vk),[dV,dn]=Bk(Vk),fV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...a}=e,[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(null),[m,v]=f.useState(null),[g,b]=f.useState(null),[y,x]=f.useState(0),[_,w]=f.useState(0),[O,C]=f.useState(!1),[P,E]=f.useState(!1),k=ua(t,I=>c(I)),$=lV(o);return f.createElement(dV,{scope:r,type:n,dir:$,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:p,onContentChange:h,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:O,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:w},f.createElement(bc.div,rt({dir:$},a,{ref:k,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})))}),pV="ScrollAreaViewport",hV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,...o}=e,i=dn(pV,r),a=f.useRef(null),l=ua(t,a,i.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(bc.div,rt({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),f.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},n)))}),To="ScrollAreaScrollbar",mV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=dn(To,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return f.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?f.createElement(gV,rt({},n,{ref:t,forceMount:r})):o.type==="scroll"?f.createElement(vV,rt({},n,{ref:t,forceMount:r})):o.type==="auto"?f.createElement(Uk,rt({},n,{ref:t,forceMount:r})):o.type==="always"?f.createElement(E0,rt({},n,{ref:t})):null}),gV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=dn(To,e.__scopeScrollArea),[i,a]=f.useState(!1);return f.useEffect(()=>{const l=o.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!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||i},f.createElement(Uk,rt({"data-state":i?"visible":"hidden"},n,{ref:t})))}),vV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=dn(To,e.__scopeScrollArea),i=e.orientation==="horizontal",a=Kh(()=>c("SCROLL_END"),100),[l,c]=uV("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,o.scrollHideDelay,c]),f.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let p=u[d];const h=()=>{const m=u[d];p!==m&&(c("SCROLL"),a()),p=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c,a]),f.createElement(Sc,{present:r||l!=="hidden"},f.createElement(E0,rt({"data-state":l==="hidden"?"hidden":"visible"},n,{ref:t,onPointerEnter:Gi(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Gi(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),Uk=f.forwardRef((e,t)=>{const r=dn(To,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,a]=f.useState(!1),l=e.orientation==="horizontal",c=Kh(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(l?u:d)}},10);return gs(r.viewport,c),gs(r.content,c),f.createElement(Sc,{present:n||i},f.createElement(E0,rt({"data-state":i?"visible":"hidden"},o,{ref:t})))}),E0=f.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=dn(To,e.__scopeScrollArea),i=f.useRef(null),a=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=qk(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function p(h,m){return jV(h,a.current,l,m)}return r==="horizontal"?f.createElement(yV,rt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,m=rb(h,l,o.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=p(h,o.dir))}})):r==="vertical"?f.createElement(xV,rt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,m=rb(h,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=p(h))}})):null}),yV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=dn(To,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ua(t,c,i.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(Hk,rt({"data-orientation":"horizontal"},o,{ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Qh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),Kk(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:sf(a.paddingLeft),paddingEnd:sf(a.paddingRight)}})}}))}),xV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=dn(To,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ua(t,c,i.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(Hk,rt({"data-orientation":"vertical"},o,{ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Qh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),Kk(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:sf(a.paddingTop),paddingEnd:sf(a.paddingBottom)}})}}))}),[wV,Wk]=Bk(To),Hk=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:p,...h}=e,m=dn(To,r),[v,g]=f.useState(null),b=ua(t,k=>g(k)),y=f.useRef(null),x=f.useRef(""),_=m.viewport,w=n.content-n.viewport,O=Mi(d),C=Mi(c),P=Kh(p,10);function E(k){if(y.current){const $=k.clientX-y.current.left,I=k.clientY-y.current.top;u({x:$,y:I})}}return f.useEffect(()=>{const k=$=>{const I=$.target;(v==null?void 0:v.contains(I))&&O($,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,v,w,O]),f.useEffect(C,[n,C]),gs(v,P),gs(m.content,P),f.createElement(wV,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Mi(i),onThumbPointerUp:Mi(a),onThumbPositionChange:C,onThumbPointerDown:Mi(l)},f.createElement(bc.div,rt({},h,{ref:b,style:{position:"absolute",...h.style},onPointerDown:Gi(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),y.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E(k))}),onPointerMove:Gi(e.onPointerMove,E),onPointerUp:Gi(e.onPointerUp,k=>{const $=k.target;$.hasPointerCapture(k.pointerId)&&$.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,y.current=null})})))}),Wv="ScrollAreaThumb",_V=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Wk(Wv,e.__scopeScrollArea);return f.createElement(Sc,{present:r||o.hasThumb},f.createElement(bV,rt({ref:t},n)))}),bV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=dn(Wv,r),a=Wk(Wv,r),{onThumbPositionChange:l}=a,c=ua(t,p=>a.onThumbChange(p)),u=f.useRef(),d=Kh(()=>{u.current&&(u.current(),u.current=void 0)},100);return f.useEffect(()=>{const p=i.viewport;if(p){const h=()=>{if(d(),!u.current){const m=OV(p,l);u.current=m,l()}};return l(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[i.viewport,d,l]),f.createElement(bc.div,rt({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Gi(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),v=p.clientX-m.left,g=p.clientY-m.top;a.onThumbPointerDown({x:v,y:g})}),onPointerUp:Gi(e.onPointerUp,a.onThumbPointerUp)}))}),Gk="ScrollAreaCorner",SV=f.forwardRef((e,t)=>{const r=dn(Gk,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?f.createElement(PV,rt({},e,{ref:t})):null}),PV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=dn(Gk,r),[i,a]=f.useState(0),[l,c]=f.useState(0),u=!!(i&&l);return gs(o.scrollbarX,()=>{var d;const p=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(p),c(p)}),gs(o.scrollbarY,()=>{var d;const p=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(p),a(p)}),u?f.createElement(bc.div,rt({},n,{ref:t,style:{width:i,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function sf(e){return e?parseInt(e,10):0}function qk(e,t){const r=e/t;return isNaN(r)?0:r}function Qh(e){const t=qk(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function jV(e,t,r,n="ltr"){const o=Qh(r),i=o/2,a=t||i,l=o-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,p=n==="ltr"?[0,d]:[d*-1,0];return Qk([c,u],p)(e)}function rb(e,t,r="ltr"){const n=Qh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-n,c=r==="ltr"?[0,a]:[a*-1,0],u=cV(e,c);return Qk([0,a],[0,l])(u)}function Qk(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 Kk(e,t){return e>0&&e<t}const OV=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=r.left!==i.left,l=r.top!==i.top;(a||l)&&t(),r=i,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Kh(e,t){const r=Mi(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 gs(e,t){const r=Mi(t);Uv(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}const CV=fV,EV=hV,nb=mV,ob=_V,$V=SV;var kV=W((e,{scrollbarSize:t,offsetScrollbars:r,scrollbarHovered:n,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:r?j(t):void 0,paddingBottom:r?j(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${j(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${Vt("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:j(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:j(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:Vt("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:j(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:j(44),minHeight:j(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:n?1:0,display:o?"none":void 0}}));const RV=kV;var TV=Object.defineProperty,IV=Object.defineProperties,DV=Object.getOwnPropertyDescriptors,lf=Object.getOwnPropertySymbols,Yk=Object.prototype.hasOwnProperty,Xk=Object.prototype.propertyIsEnumerable,ib=(e,t,r)=>t in e?TV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hv=(e,t)=>{for(var r in t||(t={}))Yk.call(t,r)&&ib(e,r,t[r]);if(lf)for(var r of lf(t))Xk.call(t,r)&&ib(e,r,t[r]);return e},Jk=(e,t)=>IV(e,DV(t)),Zk=(e,t)=>{var r={};for(var n in e)Yk.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&&Xk.call(e,n)&&(r[n]=e[n]);return r};const eR={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Yh=f.forwardRef((e,t)=>{const r=H("ScrollArea",eR,e),{children:n,className:o,classNames:i,styles:a,scrollbarSize:l,scrollHideDelay:c,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:g,viewportProps:b}=r,y=Zk(r,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[x,_]=f.useState(!1),w=Jt(),{classes:O,cx:C}=RV({scrollbarSize:l,offsetScrollbars:p,scrollbarHovered:x,hidden:u==="never"},{name:"ScrollArea",classNames:i,styles:a,unstyled:v,variant:g});return S.createElement(CV,{type:u==="never"?"always":u,scrollHideDelay:c,dir:d||w.dir,ref:t,asChild:!0},S.createElement(oe,Hv({className:C(O.root,o)},y),S.createElement(EV,Jk(Hv({},b),{className:O.viewport,ref:h,onScroll:typeof m=="function"?({currentTarget:P})=>m({x:P.scrollLeft,y:P.scrollTop}):void 0}),n),S.createElement(nb,{orientation:"horizontal",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},S.createElement(ob,{className:O.thumb})),S.createElement(nb,{orientation:"vertical",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},S.createElement(ob,{className:O.thumb})),S.createElement($V,{className:O.corner})))}),tR=f.forwardRef((e,t)=>{const r=H("ScrollAreaAutosize",eR,e),{children:n,classNames:o,styles:i,scrollbarSize:a,scrollHideDelay:l,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,sx:v,variant:g,viewportProps:b}=r,y=Zk(r,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return S.createElement(oe,Jk(Hv({},y),{ref:t,sx:[{display:"flex"},...dc(v)]}),S.createElement(oe,{sx:{display:"flex",flexDirection:"column",flex:1}},S.createElement(Yh,{classNames:o,styles:i,scrollHideDelay:l,scrollbarSize:a,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,variant:g,viewportProps:b},n)))});tR.displayName="@mantine/core/ScrollAreaAutosize";Yh.displayName="@mantine/core/ScrollArea";Yh.Autosize=tR;const da=Yh;var NV=Object.defineProperty,AV=Object.defineProperties,MV=Object.getOwnPropertyDescriptors,cf=Object.getOwnPropertySymbols,rR=Object.prototype.hasOwnProperty,nR=Object.prototype.propertyIsEnumerable,ab=(e,t,r)=>t in e?NV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sb=(e,t)=>{for(var r in t||(t={}))rR.call(t,r)&&ab(e,r,t[r]);if(cf)for(var r of cf(t))nR.call(t,r)&&ab(e,r,t[r]);return e},LV=(e,t)=>AV(e,MV(t)),zV=(e,t)=>{var r={};for(var n in e)rR.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&&nR.call(e,n)&&(r[n]=e[n]);return r};const $0=f.forwardRef((e,t)=>{var r=e,{style:n}=r,o=zV(r,["style"]);return S.createElement(da,LV(sb({},o),{style:sb({width:"100%"},n),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});$0.displayName="@mantine/core/SelectScrollArea";var FV=W(()=>({dropdown:{},itemsWrapper:{padding:j(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const VV=FV,Sn=Math.min,nr=Math.max,uf=Math.round,xu=Math.floor,hi=e=>({x:e,y:e}),BV={left:"right",right:"left",bottom:"top",top:"bottom"},UV={start:"end",end:"start"};function Gv(e,t,r){return nr(e,Sn(t,r))}function jo(e,t){return typeof e=="function"?e(t):e}function Pn(e){return e.split("-")[0]}function Ts(e){return e.split("-")[1]}function k0(e){return e==="x"?"y":"x"}function R0(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Pn(e))?"y":"x"}function T0(e){return k0(fa(e))}function WV(e,t,r){r===void 0&&(r=!1);const n=Ts(e),o=T0(e),i=R0(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=df(a)),[a,df(a)]}function HV(e){const t=df(e);return[qv(e),t,qv(t)]}function qv(e){return e.replace(/start|end/g,t=>UV[t])}function GV(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:a;default:return[]}}function qV(e,t,r,n){const o=Ts(e);let i=GV(Pn(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(qv)))),i}function df(e){return e.replace(/left|right|bottom|top/g,t=>BV[t])}function QV(e){return{top:0,right:0,bottom:0,left:0,...e}}function I0(e){return typeof e!="number"?QV(e):{top:e,right:e,bottom:e,left:e}}function vs(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function lb(e,t,r){let{reference:n,floating:o}=e;const i=fa(t),a=T0(t),l=R0(a),c=Pn(t),u=i==="y",d=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-o.width,y:p};break;default:m={x:n.x,y:n.y}}switch(Ts(t)){case"start":m[a]-=h*(r&&u?-1:1);break;case"end":m[a]+=h*(r&&u?-1:1);break}return m}const KV=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=lb(u,n,c),h=n,m={},v=0;for(let g=0;g<l.length;g++){const{name:b,fn:y}=l[g],{x,y:_,data:w,reset:O}=await y({x:d,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});if(d=x??d,p=_??p,m={...m,[b]:{...m[b],...w}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(u=O.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:p}=lb(u,h,c)),g=-1;continue}}return{x:d,y:p,placement:h,strategy:o,middlewareData:m}};async function D0(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=jo(t,e),v=I0(m),b=l[h?p==="floating"?"reference":"floating":p],y=vs(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=p==="floating"?{...a.floating,x:n,y:o}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},O=vs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:c}):x);return{top:(y.top-O.top+v.top)/w.y,bottom:(O.bottom-y.bottom+v.bottom)/w.y,left:(y.left-O.left+v.left)/w.x,right:(O.right-y.right+v.right)/w.x}}const cb=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=jo(e,t)||{};if(u==null)return{};const p=I0(d),h={x:r,y:n},m=T0(o),v=R0(m),g=await a.getDimensions(u),b=m==="y",y=b?"top":"left",x=b?"bottom":"right",_=b?"clientHeight":"clientWidth",w=i.reference[v]+i.reference[m]-h[m]-i.floating[v],O=h[m]-i.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let P=C?C[_]:0;(!P||!await(a.isElement==null?void 0:a.isElement(C)))&&(P=l.floating[_]||i.floating[v]);const E=w/2-O/2,k=P/2-g[v]/2-1,$=Sn(p[y],k),I=Sn(p[x],k),T=$,z=P-g[v]-I,M=P/2-g[v]/2+E,L=Gv(T,M,z),q=!c.arrow&&Ts(o)!=null&&M!=L&&i.reference[v]/2-(M<T?$:I)-g[v]/2<0,Y=q?M<T?M-T:M-z:0;return{[m]:h[m]+Y,data:{[m]:L,centerOffset:M-L-Y,...q&&{alignmentOffset:Y}},reset:q}}}),oR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...b}=jo(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=Pn(o),x=Pn(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=h||(x||!g?[df(l)]:HV(l));!h&&v!=="none"&&w.push(...qV(l,g,v,_));const O=[l,...w],C=await D0(t,b),P=[];let E=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&P.push(C[y]),p){const T=WV(o,a,_);P.push(C[T[0]],C[T[1]])}if(E=[...E,{placement:o,overflows:P}],!P.every(T=>T<=0)){var k,$;const T=(((k=i.flip)==null?void 0:k.index)||0)+1,z=O[T];if(z)return{data:{index:T,overflows:E},reset:{placement:z}};let M=($=E.filter(L=>L.overflows[0]<=0).sort((L,q)=>L.overflows[1]-q.overflows[1])[0])==null?void 0:$.placement;if(!M)switch(m){case"bestFit":{var I;const L=(I=E.map(q=>[q.placement,q.overflows.filter(Y=>Y>0).reduce((Y,R)=>Y+R,0)]).sort((q,Y)=>q[1]-Y[1])[0])==null?void 0:I[0];L&&(M=L);break}case"initialPlacement":M=l;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function iR(e){const t=Sn(...e.map(i=>i.left)),r=Sn(...e.map(i=>i.top)),n=nr(...e.map(i=>i.right)),o=nr(...e.map(i=>i.bottom));return{x:t,y:r,width:n-t,height:o-r}}function YV(e){const t=e.slice().sort((o,i)=>o.y-i.y),r=[];let n=null;for(let o=0;o<t.length;o++){const i=t[o];!n||i.y-n.y>n.height/2?r.push([i]):r[r.length-1].push(i),n=i}return r.map(o=>vs(iR(o)))}const aR=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:i,strategy:a}=t,{padding:l=2,x:c,y:u}=jo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(n.reference))||[]),p=YV(d),h=vs(iR(d)),m=I0(l);function v(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&u!=null)return p.find(b=>c>b.left-m.left&&c<b.right+m.right&&u>b.top-m.top&&u<b.bottom+m.bottom)||h;if(p.length>=2){if(fa(r)==="y"){const $=p[0],I=p[p.length-1],T=Pn(r)==="top",z=$.top,M=I.bottom,L=T?$.left:I.left,q=T?$.right:I.right,Y=q-L,R=M-z;return{top:z,bottom:M,left:L,right:q,width:Y,height:R,x:L,y:z}}const b=Pn(r)==="left",y=nr(...p.map($=>$.right)),x=Sn(...p.map($=>$.left)),_=p.filter($=>b?$.left===x:$.right===y),w=_[0].top,O=_[_.length-1].bottom,C=x,P=y,E=P-C,k=O-w;return{top:w,bottom:O,left:C,right:P,width:E,height:k,x:C,y:w}}return h}const g=await i.getElementRects({reference:{getBoundingClientRect:v},floating:n.floating,strategy:a});return o.reference.x!==g.reference.x||o.reference.y!==g.reference.y||o.reference.width!==g.reference.width||o.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}};async function XV(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Pn(r),l=Ts(r),c=fa(r)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,p=jo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const sR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,o=await XV(t,e);return{x:r+o.x,y:n+o.y,data:o}}}},N0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...c}=jo(e,t),u={x:r,y:n},d=await D0(t,c),p=fa(Pn(o)),h=k0(p);let m=u[h],v=u[p];if(i){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=m+d[b],_=m-d[y];m=Gv(x,m,_)}if(a){const b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=v+d[b],_=v-d[y];v=Gv(x,v,_)}const g=l.fn({...t,[h]:m,[p]:v});return{...g,data:{x:g.x-r,y:g.y-n}}}}},JV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=jo(e,t),d={x:r,y:n},p=fa(o),h=k0(p);let m=d[h],v=d[p];const g=jo(l,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const _=h==="y"?"height":"width",w=i.reference[h]-i.floating[_]+b.mainAxis,O=i.reference[h]+i.reference[_]-b.mainAxis;m<w?m=w:m>O&&(m=O)}if(u){var y,x;const _=h==="y"?"width":"height",w=["top","left"].includes(Pn(o)),O=i.reference[p]-i.floating[_]+(w&&((y=a.offset)==null?void 0:y[p])||0)+(w?0:b.crossAxis),C=i.reference[p]+i.reference[_]+(w?0:((x=a.offset)==null?void 0:x[p])||0)-(w?b.crossAxis:0);v<O?v=O:v>C&&(v=C)}return{[h]:m,[p]:v}}}},ZV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:i}=t,{apply:a=()=>{},...l}=jo(e,t),c=await D0(t,l),u=Pn(r),d=Ts(r),p=fa(r)==="y",{width:h,height:m}=n.floating;let v,g;u==="top"||u==="bottom"?(v=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=u,v=d==="end"?"top":"bottom");const b=m-c[v],y=h-c[g],x=!t.middlewareData.shift;let _=b,w=y;if(p){const C=h-c.left-c.right;w=d||x?Sn(y,C):C}else{const C=m-c.top-c.bottom;_=d||x?Sn(b,C):C}if(x&&!d){const C=nr(c.left,0),P=nr(c.right,0),E=nr(c.top,0),k=nr(c.bottom,0);p?w=h-2*(C!==0||P!==0?C+P:nr(c.left,c.right)):_=m-2*(E!==0||k!==0?E+k:nr(c.top,c.bottom))}await a({...t,availableWidth:w,availableHeight:_});const O=await o.getDimensions(i.floating);return h!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function mi(e){return lR(e)?(e.nodeName||"").toLowerCase():"#document"}function Vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Io(e){var t;return(t=(lR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lR(e){return e instanceof Node||e instanceof Vr(e).Node}function Oo(e){return e instanceof Element||e instanceof Vr(e).Element}function Jn(e){return e instanceof HTMLElement||e instanceof Vr(e).HTMLElement}function ub(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vr(e).ShadowRoot}function Pc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=un(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function eB(e){return["table","td","th"].includes(mi(e))}function A0(e){const t=M0(),r=un(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function tB(e){let t=ys(e);for(;Jn(t)&&!Xh(t);){if(A0(t))return t;t=ys(t)}return null}function M0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xh(e){return["html","body","#document"].includes(mi(e))}function un(e){return Vr(e).getComputedStyle(e)}function Jh(e){return Oo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ys(e){if(mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ub(e)&&e.host||Io(e);return ub(t)?t.host:t}function cR(e){const t=ys(e);return Xh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jn(t)&&Pc(t)?t:cR(t)}function vo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=cR(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Vr(o);return i?t.concat(a,a.visualViewport||[],Pc(o)?o:[],a.frameElement&&r?vo(a.frameElement):[]):t.concat(o,vo(o,[],r))}function uR(e){const t=un(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Jn(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,l=uf(r)!==i||uf(n)!==a;return l&&(r=i,n=a),{width:r,height:n,$:l}}function L0(e){return Oo(e)?e:e.contextElement}function os(e){const t=L0(e);if(!Jn(t))return hi(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=uR(t);let a=(i?uf(r.width):r.width)/n,l=(i?uf(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const rB=hi(0);function dR(e){const t=Vr(e);return!M0()||!t.visualViewport?rB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nB(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Vr(e)?!1:t}function Zi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=L0(e);let a=hi(1);t&&(n?Oo(n)&&(a=os(n)):a=os(e));const l=nB(i,r,n)?dR(i):hi(0);let c=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,p=o.height/a.y;if(i){const h=Vr(i),m=n&&Oo(n)?Vr(n):n;let v=h.frameElement;for(;v&&n&&m!==h;){const g=os(v),b=v.getBoundingClientRect(),y=un(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,_=b.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,p*=g.y,c+=x,u+=_,v=Vr(v).frameElement}}return vs({width:d,height:p,x:c,y:u})}function oB(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=Jn(r),i=Io(r);if(r===i)return t;let a={scrollLeft:0,scrollTop:0},l=hi(1);const c=hi(0);if((o||!o&&n!=="fixed")&&((mi(r)!=="body"||Pc(i))&&(a=Jh(r)),Jn(r))){const u=Zi(r);l=os(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-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function iB(e){return Array.from(e.getClientRects())}function fR(e){return Zi(Io(e)).left+Jh(e).scrollLeft}function aB(e){const t=Io(e),r=Jh(e),n=e.ownerDocument.body,o=nr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=nr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+fR(e);const l=-r.scrollTop;return un(n).direction==="rtl"&&(a+=nr(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:l}}function sB(e,t){const r=Vr(e),n=Io(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const u=M0();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function lB(e,t){const r=Zi(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Jn(e)?os(e):hi(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=n*i.y;return{width:a,height:l,x:c,y:u}}function db(e,t,r){let n;if(t==="viewport")n=sB(e,r);else if(t==="document")n=aB(Io(e));else if(Oo(t))n=lB(t,r);else{const o=dR(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return vs(n)}function pR(e,t){const r=ys(e);return r===t||!Oo(r)||Xh(r)?!1:un(r).position==="fixed"||pR(r,t)}function cB(e,t){const r=t.get(e);if(r)return r;let n=vo(e,[],!1).filter(l=>Oo(l)&&mi(l)!=="body"),o=null;const i=un(e).position==="fixed";let a=i?ys(e):e;for(;Oo(a)&&!Xh(a);){const l=un(a),c=A0(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Pc(a)&&!c&&pR(e,a))?n=n.filter(d=>d!==a):o=l,a=ys(a)}return t.set(e,n),n}function uB(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?cB(t,this._c):[].concat(r),n],l=a[0],c=a.reduce((u,d)=>{const p=db(t,d,o);return u.top=nr(p.top,u.top),u.right=Sn(p.right,u.right),u.bottom=Sn(p.bottom,u.bottom),u.left=nr(p.left,u.left),u},db(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function dB(e){return uR(e)}function fB(e,t,r){const n=Jn(t),o=Io(t),i=r==="fixed",a=Zi(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=hi(0);if(n||!n&&!i)if((mi(t)!=="body"||Pc(o))&&(l=Jh(t)),n){const u=Zi(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else o&&(c.x=fR(o));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function fb(e,t){return!Jn(e)||un(e).position==="fixed"?null:t?t(e):e.offsetParent}function hR(e,t){const r=Vr(e);if(!Jn(e))return r;let n=fb(e,t);for(;n&&eB(n)&&un(n).position==="static";)n=fb(n,t);return n&&(mi(n)==="html"||mi(n)==="body"&&un(n).position==="static"&&!A0(n))?r:n||tB(e)||r}const pB=async function(e){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||hR,i=this.getDimensions;return{reference:fB(t,await o(r),n),floating:{x:0,y:0,...await i(r)}}};function hB(e){return un(e).direction==="rtl"}const mB={convertOffsetParentRelativeRectToViewportRelativeRect:oB,getDocumentElement:Io,getClippingRect:uB,getOffsetParent:hR,getElementRects:pB,getClientRects:iB,getDimensions:dB,getScale:os,isElement:Oo,isRTL:hB};function gB(e,t){let r=null,n;const o=Io(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:p,height:h}=e.getBoundingClientRect();if(l||t(),!p||!h)return;const m=xu(d),v=xu(o.clientWidth-(u+p)),g=xu(o.clientHeight-(d+h)),b=xu(u),x={rootMargin:-m+"px "+-v+"px "+-g+"px "+-b+"px",threshold:nr(0,Sn(1,c))||1};let _=!0;function w(O){const C=O[0].intersectionRatio;if(C!==c){if(!_)return a();C?a(!1,C):n=setTimeout(()=>{a(!1,1e-7)},100)}_=!1}try{r=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(w,x)}r.observe(e)}return a(!0),i}function vB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=L0(e),d=o||i?[...u?vo(u):[],...vo(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const p=u&&l?gB(u,r):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let v,g=c?Zi(e):null;c&&b();function b(){const y=Zi(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&r(),g=y,v=requestAnimationFrame(b)}return r(),()=>{d.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p&&p(),m&&m.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const yB=(e,t,r)=>{const n=new Map,o={platform:mB,...r},i={...o.platform,_c:n};return KV(e,t,{...o,platform:i})},mR=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?cb({element:t.current,padding:r}).fn(o):{}:t?cb({element:t,padding:r}).fn(o):{}}}};var ad=typeof document<"u"?f.useLayoutEffect:f.useEffect;function ff(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(!ff(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 i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!ff(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function pb(e){const t=f.useRef(e);return ad(()=>{t.current=e}),t}function xB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:i,open:a}=e,[l,c]=f.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[u,d]=f.useState(n);ff(u,n)||d(n);const p=f.useRef(null),h=f.useRef(null),m=f.useRef(l),v=pb(i),g=pb(o),[b,y]=f.useState(null),[x,_]=f.useState(null),w=f.useCallback($=>{p.current!==$&&(p.current=$,y($))},[]),O=f.useCallback($=>{h.current!==$&&(h.current=$,_($))},[]),C=f.useCallback(()=>{if(!p.current||!h.current)return;const $={placement:t,strategy:r,middleware:u};g.current&&($.platform=g.current),yB(p.current,h.current,$).then(I=>{const T={...I,isPositioned:!0};P.current&&!ff(m.current,T)&&(m.current=T,xc.flushSync(()=>{c(T)}))})},[u,t,r,g]);ad(()=>{a===!1&&m.current.isPositioned&&(m.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[a]);const P=f.useRef(!1);ad(()=>(P.current=!0,()=>{P.current=!1}),[]),ad(()=>{if(b&&x){if(v.current)return v.current(b,x,C);C()}},[b,x,C,v]);const E=f.useMemo(()=>({reference:p,floating:h,setReference:w,setFloating:O}),[w,O]),k=f.useMemo(()=>({reference:b,floating:x}),[b,x]);return f.useMemo(()=>({...l,update:C,refs:E,elements:k,reference:w,floating:O}),[l,C,E,k,w,O])}var xs=typeof document<"u"?f.useLayoutEffect:f.useEffect;let lg=!1,wB=0;const hb=()=>"floating-ui-"+wB++;function _B(){const[e,t]=f.useState(()=>lg?hb():void 0);return xs(()=>{e==null&&t(hb())},[]),f.useEffect(()=>{lg||(lg=!0)},[]),e}const bB=Al["useId".toString()],mb=bB||_B;function SB(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){e.set(t,(e.get(t)||[]).filter(n=>n!==r))}}}const PB=f.createContext(null),jB=f.createContext(null),gR=()=>{var e;return((e=f.useContext(PB))==null?void 0:e.id)||null},z0=()=>f.useContext(jB);function ti(e){return(e==null?void 0:e.ownerDocument)||document}function OB(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function CB(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function F0(e){return ti(e).defaultView||window}function qn(e){return e?e instanceof F0(e).Element:!1}function vR(e){return e?e instanceof F0(e).HTMLElement:!1}function EB(e){if(typeof ShadowRoot>"u")return!1;const t=F0(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $B(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(OB())||t.test(CB()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function kB(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function yR(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function gb(e){const t=f.useRef(e);return xs(()=>{t.current=e}),t}const vb="data-floating-ui-safe-polygon";function sd(e,t,r){return r&&!yR(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const RB=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:i=!1,restMs:a=0,move:l=!0}=t===void 0?{}:t;const{open:c,onOpenChange:u,dataRef:d,events:p,elements:{domReference:h,floating:m},refs:v}=e,g=z0(),b=gR(),y=gb(o),x=gb(n),_=f.useRef(),w=f.useRef(),O=f.useRef(),C=f.useRef(),P=f.useRef(!0),E=f.useRef(!1),k=f.useRef(()=>{}),$=f.useCallback(()=>{var M;const L=(M=d.current.openEvent)==null?void 0:M.type;return(L==null?void 0:L.includes("mouse"))&&L!=="mousedown"},[d]);f.useEffect(()=>{if(!r)return;function M(){clearTimeout(w.current),clearTimeout(C.current),P.current=!0}return p.on("dismiss",M),()=>{p.off("dismiss",M)}},[r,p]),f.useEffect(()=>{if(!r||!y.current||!c)return;function M(){$()&&u(!1)}const L=ti(m).documentElement;return L.addEventListener("mouseleave",M),()=>{L.removeEventListener("mouseleave",M)}},[m,c,u,r,y,d,$]);const I=f.useCallback(function(M){M===void 0&&(M=!0);const L=sd(x.current,"close",_.current);L&&!O.current?(clearTimeout(w.current),w.current=setTimeout(()=>u(!1),L)):M&&(clearTimeout(w.current),u(!1))},[x,u]),T=f.useCallback(()=>{k.current(),O.current=void 0},[]),z=f.useCallback(()=>{if(E.current){const M=ti(v.floating.current).body;M.style.pointerEvents="",M.removeAttribute(vb),E.current=!1}},[v]);return f.useEffect(()=>{if(!r)return;function M(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function L(R){if(clearTimeout(w.current),P.current=!1,i&&!yR(_.current)||a>0&&sd(x.current,"open")===0)return;d.current.openEvent=R;const N=sd(x.current,"open",_.current);N?w.current=setTimeout(()=>{u(!0)},N):u(!0)}function q(R){if(M())return;k.current();const N=ti(m);if(clearTimeout(C.current),y.current){c||clearTimeout(w.current),O.current=y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){z(),T(),I()}});const V=O.current;N.addEventListener("mousemove",V),k.current=()=>{N.removeEventListener("mousemove",V)};return}I()}function Y(R){M()||y.current==null||y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){z(),T(),I()}})(R)}if(qn(h)){const R=h;return c&&R.addEventListener("mouseleave",Y),m==null||m.addEventListener("mouseleave",Y),l&&R.addEventListener("mousemove",L,{once:!0}),R.addEventListener("mouseenter",L),R.addEventListener("mouseleave",q),()=>{c&&R.removeEventListener("mouseleave",Y),m==null||m.removeEventListener("mouseleave",Y),l&&R.removeEventListener("mousemove",L),R.removeEventListener("mouseenter",L),R.removeEventListener("mouseleave",q)}}},[h,m,r,e,i,a,l,I,T,z,u,c,g,x,y,d]),xs(()=>{var M;if(r&&c&&(M=y.current)!=null&&M.__options.blockPointerEvents&&$()){const Y=ti(m).body;if(Y.setAttribute(vb,""),Y.style.pointerEvents="none",E.current=!0,qn(h)&&m){var L,q;const R=h,N=g==null||(L=g.nodesRef.current.find(V=>V.id===b))==null||(q=L.context)==null?void 0:q.elements.floating;return N&&(N.style.pointerEvents=""),R.style.pointerEvents="auto",m.style.pointerEvents="auto",()=>{R.style.pointerEvents="",m.style.pointerEvents=""}}}},[r,c,b,m,h,g,y,d,$]),xs(()=>{c||(_.current=void 0,T(),z())},[c,T,z]),f.useEffect(()=>()=>{T(),clearTimeout(w.current),clearTimeout(C.current),z()},[r,T,z]),f.useMemo(()=>{if(!r)return{};function M(L){_.current=L.pointerType}return{reference:{onPointerDown:M,onPointerEnter:M,onMouseMove(){c||a===0||(clearTimeout(C.current),C.current=setTimeout(()=>{P.current||u(!0)},a))}},floating:{onMouseEnter(){clearTimeout(w.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),I(!1)}}}},[p,r,a,c,u,I])},xR=f.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),wR=()=>f.useContext(xR),TB=e=>{let{children:t,delay:r,timeoutMs:n=0}=e;const[o,i]=f.useReducer((c,u)=>({...c,...u}),{delay:r,timeoutMs:n,initialDelay:r,currentId:null,isInstantPhase:!1}),a=f.useRef(null),l=f.useCallback(c=>{i({currentId:c})},[]);return xs(()=>{o.currentId?a.current===null?a.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),a.current=null)},[o.currentId]),f.createElement(xR.Provider,{value:f.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,i,l])},t)},IB=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:i,setCurrentId:a,initialDelay:l,setState:c,timeoutMs:u}=wR();f.useEffect(()=>{i&&(c({delay:{open:1,close:sd(l,"close")}}),i!==o&&n(!1))},[o,n,c,i,l]),f.useEffect(()=>{function d(){n(!1),c({delay:l,currentId:null})}if(!r&&i===o)if(u){const p=window.setTimeout(d,u);return()=>{clearTimeout(p)}}else d()},[r,c,i,o,n,l,u]),f.useEffect(()=>{r&&a(o)},[r,a,o])};function DB(e){let t=e.activeElement;for(;((r=t)==null||(n=r.shadowRoot)==null?void 0:n.activeElement)!=null;){var r,n;t=t.shadowRoot.activeElement}return t}function yb(e,t){if(!e||!t)return!1;const r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&EB(r)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function cg(e,t){let r=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],n=r;for(;n.length;)n=e.filter(o=>{var i;return(i=n)==null?void 0:i.some(a=>{var l;return o.parentId===a.id&&((l=o.context)==null?void 0:l.open)})})||[],r=r.concat(n);return r}function NB(e){return"composedPath"in e?e.composedPath()[0]:e.target}const AB=Al["useInsertionEffect".toString()],MB=AB||(e=>e());function _R(e){const t=f.useRef(()=>{});return MB(()=>{t.current=e}),f.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function ld(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}const LB={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zB={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},FB=function(e){var t,r;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(r=e.outsidePress)!=null?r:!0}},VB=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:i,elements:{reference:a,domReference:l,floating:c},dataRef:u}=e,{enabled:d=!0,escapeKey:p=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:v=!1,referencePressEvent:g="pointerdown",ancestorScroll:b=!1,bubbles:y=!0}=t===void 0?{}:t;const x=z0(),_=gR()!=null,w=_R(typeof h=="function"?h:()=>!1),O=typeof h=="function"?w:h,C=f.useRef(!1),{escapeKeyBubbles:P,outsidePressBubbles:E}=FB(y);return f.useEffect(()=>{if(!r||!d)return;u.current.__escapeKeyBubbles=P,u.current.__outsidePressBubbles=E;function k(M){if(M.key==="Escape"){const L=x?cg(x.nodesRef.current,i):[];if(L.length>0){let q=!0;if(L.forEach(Y=>{var R;if((R=Y.context)!=null&&R.open&&!Y.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function $(M){const L=C.current;if(C.current=!1,L||typeof O=="function"&&!O(M))return;const q=NB(M);if(vR(q)&&c){const N=c.ownerDocument.defaultView||window,V=q.scrollWidth>q.clientWidth,Q=q.scrollHeight>q.clientHeight;let ee=Q&&M.offsetX>q.clientWidth;if(Q&&N.getComputedStyle(q).direction==="rtl"&&(ee=M.offsetX<=q.offsetWidth-q.clientWidth),ee||V&&M.offsetY>q.clientHeight)return}const Y=x&&cg(x.nodesRef.current,i).some(N=>{var V;return ld(M,(V=N.context)==null?void 0:V.elements.floating)});if(ld(M,c)||ld(M,l)||Y)return;const R=x?cg(x.nodesRef.current,i):[];if(R.length>0){let N=!0;if(R.forEach(V=>{var Q;if((Q=V.context)!=null&&Q.open&&!V.context.dataRef.current.__outsidePressBubbles){N=!1;return}}),!N)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:_?{preventScroll:!0}:$B(M)||kB(M)}}),n(!1)}function I(){n(!1)}const T=ti(c);p&&T.addEventListener("keydown",k),O&&T.addEventListener(m,$);let z=[];return b&&(qn(l)&&(z=vo(l)),qn(c)&&(z=z.concat(vo(c))),!qn(a)&&a&&a.contextElement&&(z=z.concat(vo(a.contextElement)))),z=z.filter(M=>{var L;return M!==((L=T.defaultView)==null?void 0:L.visualViewport)}),z.forEach(M=>{M.addEventListener("scroll",I,{passive:!0})}),()=>{p&&T.removeEventListener("keydown",k),O&&T.removeEventListener(m,$),z.forEach(M=>{M.removeEventListener("scroll",I)})}},[u,c,l,a,p,O,m,o,x,i,r,n,b,d,P,E,_]),f.useEffect(()=>{C.current=!1},[O,m]),f.useMemo(()=>d?{reference:{[LB[g]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[zB[m]]:()=>{C.current=!0}}}:{},[d,o,v,m,g,n])},BB=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:i,refs:a,elements:{floating:l,domReference:c}}=e,{enabled:u=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const p=f.useRef(""),h=f.useRef(!1),m=f.useRef();return f.useEffect(()=>{if(!u)return;const g=ti(l).defaultView||window;function b(){!r&&vR(c)&&c===DB(ti(c))&&(h.current=!0)}return g.addEventListener("blur",b),()=>{g.removeEventListener("blur",b)}},[l,c,r,u]),f.useEffect(()=>{if(!u)return;function v(g){(g.type==="referencePress"||g.type==="escapeKey")&&(h.current=!0)}return i.on("dismiss",v),()=>{i.off("dismiss",v)}},[i,u]),f.useEffect(()=>()=>{clearTimeout(m.current)},[]),f.useMemo(()=>u?{reference:{onPointerDown(v){let{pointerType:g}=v;p.current=g,h.current=!!(g&&d)},onMouseLeave(){h.current=!1},onFocus(v){var g;h.current||v.type==="focus"&&((g=o.current.openEvent)==null?void 0:g.type)==="mousedown"&&o.current.openEvent&&ld(o.current.openEvent,c)||(o.current.openEvent=v.nativeEvent,n(!0))},onBlur(v){h.current=!1;const g=v.relatedTarget,b=qn(g)&&g.hasAttribute("data-floating-ui-focus-guard")&&g.getAttribute("data-type")==="outside";m.current=setTimeout(()=>{yb(a.floating.current,g)||yb(c,g)||b||n(!1)})}}}:{},[u,d,c,a,o,n])},UB=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const i=mb(),a=mb();return f.useMemo(()=>{const l={id:i,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?i:void 0},floating:l}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":r?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:a}},floating:{...l,...o==="menu"&&{"aria-labelledby":a}}}:{}},[n,o,r,i,a])};function V0(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=xB(e),i=z0(),a=f.useRef(null),l=f.useRef({}),c=f.useState(()=>SB())[0],[u,d]=f.useState(null),p=f.useCallback(y=>{const x=qn(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;o.refs.setReference(x)},[o.refs]),h=f.useCallback(y=>{(qn(y)||y===null)&&(a.current=y,d(y)),(qn(o.refs.reference.current)||o.refs.reference.current===null||y!==null&&!qn(y))&&o.refs.setReference(y)},[o.refs]),m=f.useMemo(()=>({...o.refs,setReference:h,setPositionReference:p,domReference:a}),[o.refs,h,p]),v=f.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),g=_R(r),b=f.useMemo(()=>({...o,refs:m,elements:v,dataRef:l,nodeId:n,events:c,open:t,onOpenChange:g}),[o,n,c,t,g,m,v]);return xs(()=>{const y=i==null?void 0:i.nodesRef.current.find(x=>x.id===n);y&&(y.context=b)}),f.useMemo(()=>({...o,context:b,refs:m,reference:h,positionReference:p}),[o,m,b,h,p])}function ug(e,t,r){const n=new Map;return{...r==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[r]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(a=>{let[l,c]=a;if(l.indexOf("on")===0){if(n.has(l)||n.set(l,[]),typeof c=="function"){var u;(u=n.get(l))==null||u.push(c),o[l]=function(){for(var d,p=arguments.length,h=new Array(p),m=0;m<p;m++)h[m]=arguments[m];(d=n.get(l))==null||d.forEach(v=>v(...h))}}}else o[l]=c}),o),{})}}const WB=function(e){e===void 0&&(e=[]);const t=e,r=f.useCallback(i=>ug(i,e,"reference"),t),n=f.useCallback(i=>ug(i,e,"floating"),t),o=f.useCallback(i=>ug(i,e,"item"),e.map(i=>i==null?void 0:i.item));return f.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])};function bR({opened:e,floating:t,position:r,positionDependencies:n}){const[o,i]=f.useState(0);f.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return vB(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,r]),rn(()=>{t.update()},n),rn(()=>{i(a=>a+1)},[e])}function HB(e){const t=[sR(e.offset)];return e.middlewares.shift&&t.push(N0({limiter:JV()})),e.middlewares.flip&&t.push(oR()),e.middlewares.inline&&t.push(aR()),t.push(mR({element:e.arrowRef,padding:e.arrowOffset})),t}function GB(e){const[t,r]=$r({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),n=()=>{var a;(a=e.onClose)==null||a.call(e),r(!1)},o=()=>{var a,l;t?((a=e.onClose)==null||a.call(e),r(!1)):((l=e.onOpen)==null||l.call(e),r(!0))},i=V0({placement:e.position,middleware:[...HB(e),...e.width==="target"?[ZV({apply({rects:a}){var l,c;Object.assign((c=(l=i.refs.floating.current)==null?void 0:l.style)!=null?c:{},{width:`${a.reference.width}px`})}})]:[]]});return bR({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:i}),rn(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),rn(()=>{var a,l;e.opened?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:n,onToggle:o}}const SR={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"},[qB,PR]=ko(SR.context);var QB=Object.defineProperty,KB=Object.defineProperties,YB=Object.getOwnPropertyDescriptors,pf=Object.getOwnPropertySymbols,jR=Object.prototype.hasOwnProperty,OR=Object.prototype.propertyIsEnumerable,xb=(e,t,r)=>t in e?QB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wu=(e,t)=>{for(var r in t||(t={}))jR.call(t,r)&&xb(e,r,t[r]);if(pf)for(var r of pf(t))OR.call(t,r)&&xb(e,r,t[r]);return e},XB=(e,t)=>KB(e,YB(t)),JB=(e,t)=>{var r={};for(var n in e)jR.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&&OR.call(e,n)&&(r[n]=e[n]);return r};const ZB={refProp:"ref",popupType:"dialog",shouldOverrideDefaultTargetId:!0},CR=f.forwardRef((e,t)=>{const r=H("PopoverTarget",ZB,e),{children:n,refProp:o,popupType:i,shouldOverrideDefaultTargetId:a}=r,l=JB(r,["children","refProp","popupType","shouldOverrideDefaultTargetId"]);if(!Os(n))throw new Error(SR.children);const c=l,u=PR(),d=Es(u.reference,n.ref,t),p=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:a?u.getTargetId():n.props.id}:{};return f.cloneElement(n,wu(XB(wu(wu(wu({},c),p),u.targetProps),{className:tE(u.targetProps.className,c.className,n.props.className),[o]:d}),u.controlled?null:{onClick:u.onToggle}))});CR.displayName="@mantine/core/PopoverTarget";var eU=W((e,{radius:t,shadow:r})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${j(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:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const tU=eU;var rU=Object.defineProperty,wb=Object.getOwnPropertySymbols,nU=Object.prototype.hasOwnProperty,oU=Object.prototype.propertyIsEnumerable,_b=(e,t,r)=>t in e?rU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oa=(e,t)=>{for(var r in t||(t={}))nU.call(t,r)&&_b(e,r,t[r]);if(wb)for(var r of wb(t))oU.call(t,r)&&_b(e,r,t[r]);return e};const bb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function iU({transition:e,state:t,duration:r,timingFunction:n}){const o={transitionDuration:`${r}ms`,transitionTimingFunction:n};return typeof e=="string"?e in Kc?Oa(Oa(Oa({transitionProperty:Kc[e].transitionProperty},o),Kc[e].common),Kc[e][bb[t]]):null:Oa(Oa(Oa({transitionProperty:e.transitionProperty},o),e.common),e[bb[t]])}function aU({duration:e,exitDuration:t,timingFunction:r,mounted:n,onEnter:o,onExit:i,onEntered:a,onExited:l}){const c=Jt(),u=Rh(),d=c.respectReducedMotion?u:!1,[p,h]=f.useState(d?0:e),[m,v]=f.useState(n?"entered":"exited"),g=f.useRef(-1),b=y=>{const x=y?o:i,_=y?a:l;v(y?"pre-entering":"pre-exiting"),window.clearTimeout(g.current);const w=d?0:y?e:t;if(h(w),w===0)typeof x=="function"&&x(),typeof _=="function"&&_(),v(y?"entered":"exited");else{const O=window.setTimeout(()=>{typeof x=="function"&&x(),v(y?"entering":"exiting")},10);g.current=window.setTimeout(()=>{window.clearTimeout(O),typeof _=="function"&&_(),v(y?"entered":"exited")},w)}};return rn(()=>{b(n)},[n]),f.useEffect(()=>()=>window.clearTimeout(g.current),[]),{transitionDuration:p,transitionStatus:m,transitionTimingFunction:r||c.transitionTimingFunction}}function pa({keepMounted:e,transition:t,duration:r=250,exitDuration:n=r,mounted:o,children:i,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:p,transitionStatus:h,transitionTimingFunction:m}=aU({mounted:o,exitDuration:n,duration:r,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d});return p===0?o?S.createElement(S.Fragment,null,i({})):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:S.createElement(S.Fragment,null,i(iU({transition:t,duration:p,state:h,timingFunction:m})))}pa.displayName="@mantine/core/Transition";function B0({children:e,active:t=!0,refProp:r="ref"}){const n=wL(t),o=Es(n,e==null?void 0:e.ref);return Os(e)?f.cloneElement(e,{[r]:o}):e}B0.displayName="@mantine/core/FocusTrap";var sU=Object.defineProperty,lU=Object.defineProperties,cU=Object.getOwnPropertyDescriptors,Sb=Object.getOwnPropertySymbols,uU=Object.prototype.hasOwnProperty,dU=Object.prototype.propertyIsEnumerable,Pb=(e,t,r)=>t in e?sU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wo=(e,t)=>{for(var r in t||(t={}))uU.call(t,r)&&Pb(e,r,t[r]);if(Sb)for(var r of Sb(t))dU.call(t,r)&&Pb(e,r,t[r]);return e},_u=(e,t)=>lU(e,cU(t));function jb(e,t,r,n){return e==="center"||n==="center"?{top:t}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function Ob(e,t,r,n,o){return e==="center"||n==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:r}:e==="start"?{[o==="ltr"?"left":"right"]:r}:{}}const fU={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function pU({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:j(t),height:j(t),transform:"rotate(45deg)",position:"absolute",[fU[c]]:j(n)},p=j(-t/2);return c==="left"?_u(Wo(Wo({},d),jb(u,a,r,o)),{right:p,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?_u(Wo(Wo({},d),jb(u,a,r,o)),{left:p,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?_u(Wo(Wo({},d),Ob(u,i,r,o,l)),{bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?_u(Wo(Wo({},d),Ob(u,i,r,o,l)),{top:p,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var hU=Object.defineProperty,mU=Object.defineProperties,gU=Object.getOwnPropertyDescriptors,hf=Object.getOwnPropertySymbols,ER=Object.prototype.hasOwnProperty,$R=Object.prototype.propertyIsEnumerable,Cb=(e,t,r)=>t in e?hU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vU=(e,t)=>{for(var r in t||(t={}))ER.call(t,r)&&Cb(e,r,t[r]);if(hf)for(var r of hf(t))$R.call(t,r)&&Cb(e,r,t[r]);return e},yU=(e,t)=>mU(e,gU(t)),xU=(e,t)=>{var r={};for(var n in e)ER.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&&$R.call(e,n)&&(r[n]=e[n]);return r};const U0=f.forwardRef((e,t)=>{var r=e,{position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,visible:c,arrowX:u,arrowY:d}=r,p=xU(r,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const h=Jt();return c?S.createElement("div",yU(vU({},p),{ref:t,style:pU({position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,dir:h.dir,arrowX:u,arrowY:d})})):null});U0.displayName="@mantine/core/FloatingArrow";var wU=Object.defineProperty,_U=Object.defineProperties,bU=Object.getOwnPropertyDescriptors,mf=Object.getOwnPropertySymbols,kR=Object.prototype.hasOwnProperty,RR=Object.prototype.propertyIsEnumerable,Eb=(e,t,r)=>t in e?wU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ca=(e,t)=>{for(var r in t||(t={}))kR.call(t,r)&&Eb(e,r,t[r]);if(mf)for(var r of mf(t))RR.call(t,r)&&Eb(e,r,t[r]);return e},bu=(e,t)=>_U(e,bU(t)),SU=(e,t)=>{var r={};for(var n in e)kR.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&&RR.call(e,n)&&(r[n]=e[n]);return r};const PU={};function TR(e){var t;const r=H("PopoverDropdown",PU,e),{style:n,className:o,children:i,onKeyDownCapture:a}=r,l=SU(r,["style","className","children","onKeyDownCapture"]),c=PR(),{classes:u,cx:d}=tU({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),p=EE({opened:c.opened,shouldReturnFocus:c.returnFocus}),h=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:S.createElement(Rs,bu(Ca({},c.portalProps),{withinPortal:c.withinPortal}),S.createElement(pa,bu(Ca({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),m=>{var v,g;return S.createElement(B0,{active:c.trapFocus},S.createElement(oe,Ca(bu(Ca({},h),{tabIndex:-1,ref:c.floating,style:bu(Ca(Ca({},n),m),{zIndex:c.zIndex,top:(v=c.y)!=null?v:0,left:(g=c.x)!=null?g:0,width:c.width==="target"?void 0:j(c.width)}),className:d(u.dropdown,o),onKeyDownCapture:VA(c.onClose,{active:c.closeOnEscape,onTrigger:p,onKeyDown:a}),"data-position":c.placement}),l),i,S.createElement(U0,{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})))}))}TR.displayName="@mantine/core/PopoverDropdown";function IR(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 $b=Object.getOwnPropertySymbols,jU=Object.prototype.hasOwnProperty,OU=Object.prototype.propertyIsEnumerable,CU=(e,t)=>{var r={};for(var n in e)jU.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$b)for(var n of $b(e))t.indexOf(n)<0&&OU.call(e,n)&&(r[n]=e[n]);return r};const EU={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Cn("popover"),__staticSelector:"Popover",width:"max-content"};function Do(e){var t,r,n,o,i,a;const l=f.useRef(null),c=H("Popover",EU,e),{children:u,position:d,offset:p,onPositionChange:h,positionDependencies:m,opened:v,transitionProps:g,width:b,middlewares:y,withArrow:x,arrowSize:_,arrowOffset:w,arrowRadius:O,arrowPosition:C,unstyled:P,classNames:E,styles:k,closeOnClickOutside:$,withinPortal:I,portalProps:T,closeOnEscape:z,clickOutsideEvents:M,trapFocus:L,onClose:q,onOpen:Y,onChange:R,zIndex:N,radius:V,shadow:Q,id:ee,defaultOpened:_e,__staticSelector:we,withRoles:Ue,disabled:Ae,returnFocus:pt,variant:Dt,keepMounted:Pe}=c,Ht=CU(c,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[Dr,lr]=f.useState(null),[Gt,Nt]=f.useState(null),ro=Rr(ee),no=Jt(),Ye=GB({middlewares:y,width:b,position:IR(no.dir,d),offset:typeof p=="number"?p+(x?_/2:0):p,arrowRef:l,arrowOffset:w,onPositionChange:h,positionDependencies:m,opened:v,defaultOpened:_e,onChange:R,onOpen:Y,onClose:q});cL(()=>Ye.opened&&$&&Ye.onClose(),M,[Dr,Gt]);const oo=f.useCallback(zt=>{lr(zt),Ye.floating.reference(zt)},[Ye.floating.reference]),$n=f.useCallback(zt=>{Nt(zt),Ye.floating.floating(zt)},[Ye.floating.floating]);return S.createElement(qB,{value:{returnFocus:pt,disabled:Ae,controlled:Ye.controlled,reference:oo,floating:$n,x:Ye.floating.x,y:Ye.floating.y,arrowX:(n=(r=(t=Ye.floating)==null?void 0:t.middlewareData)==null?void 0:r.arrow)==null?void 0:n.x,arrowY:(a=(i=(o=Ye.floating)==null?void 0:o.middlewareData)==null?void 0:i.arrow)==null?void 0:a.y,opened:Ye.opened,arrowRef:l,transitionProps:g,width:b,withArrow:x,arrowSize:_,arrowOffset:w,arrowRadius:O,arrowPosition:C,placement:Ye.floating.placement,trapFocus:L,withinPortal:I,portalProps:T,zIndex:N,radius:V,shadow:Q,closeOnEscape:z,onClose:Ye.onClose,onToggle:Ye.onToggle,getTargetId:()=>`${ro}-target`,getDropdownId:()=>`${ro}-dropdown`,withRoles:Ue,targetProps:Ht,__staticSelector:we,classNames:E,styles:k,unstyled:P,variant:Dt,keepMounted:Pe}},u)}Do.Target=CR;Do.Dropdown=TR;Do.displayName="@mantine/core/Popover";var $U=Object.defineProperty,gf=Object.getOwnPropertySymbols,DR=Object.prototype.hasOwnProperty,NR=Object.prototype.propertyIsEnumerable,kb=(e,t,r)=>t in e?$U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kU=(e,t)=>{for(var r in t||(t={}))DR.call(t,r)&&kb(e,r,t[r]);if(gf)for(var r of gf(t))NR.call(t,r)&&kb(e,r,t[r]);return e},RU=(e,t)=>{var r={};for(var n in e)DR.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&&NR.call(e,n)&&(r[n]=e[n]);return r};function TU(e){var t=e,{children:r,component:n="div",maxHeight:o=220,direction:i="column",id:a,innerRef:l,__staticSelector:c,styles:u,classNames:d,unstyled:p}=t,h=RU(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:m}=VV(null,{name:c,styles:u,classNames:d,unstyled:p});return S.createElement(Do.Dropdown,kU({p:0,onMouseDown:v=>v.preventDefault()},h),S.createElement("div",{style:{maxHeight:j(o),display:"flex"}},S.createElement(oe,{component:n||"div",id:`${a}-items`,"aria-labelledby":`${a}-label`,role:"listbox",onMouseDown:v=>v.preventDefault(),style:{flex:1,overflowY:n!==$0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},S.createElement("div",{className:m.itemsWrapper,style:{flexDirection:i}},r))))}function Tl({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:r,withinPortal:n,portalProps:o,children:i,__staticSelector:a,onDirectionChange:l,switchDirectionOnFlip:c,zIndex:u,dropdownPosition:d,positionDependencies:p=[],classNames:h,styles:m,unstyled:v,readOnly:g,variant:b}){return S.createElement(Do,{unstyled:v,classNames:h,styles:m,width:"target",withRoles:!1,opened:e,middlewares:{flip:d==="flip",shift:!1},position:d==="flip"?"bottom":d,positionDependencies:p,zIndex:u,__staticSelector:a,withinPortal:n,portalProps:o,transitionProps:t,shadow:r,disabled:g,onPositionChange:y=>c&&(l==null?void 0:l(y==="top"?"column-reverse":"column")),variant:b},i)}Tl.Target=Do.Target;Tl.Dropdown=TU;var IU=Object.defineProperty,DU=Object.defineProperties,NU=Object.getOwnPropertyDescriptors,vf=Object.getOwnPropertySymbols,AR=Object.prototype.hasOwnProperty,MR=Object.prototype.propertyIsEnumerable,Rb=(e,t,r)=>t in e?IU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Su=(e,t)=>{for(var r in t||(t={}))AR.call(t,r)&&Rb(e,r,t[r]);if(vf)for(var r of vf(t))MR.call(t,r)&&Rb(e,r,t[r]);return e},AU=(e,t)=>DU(e,NU(t)),MU=(e,t)=>{var r={};for(var n in e)AR.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&&MR.call(e,n)&&(r[n]=e[n]);return r};function LR(e,t,r){const n=H(e,t,r),{label:o,description:i,error:a,required:l,classNames:c,styles:u,className:d,unstyled:p,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:b,wrapperProps:y,id:x,size:_,style:w,inputContainer:O,inputWrapperOrder:C,withAsterisk:P,variant:E}=n,k=MU(n,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),$=Rr(x),{systemStyles:I,rest:T}=eo(k),z=Su({label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:b,unstyled:p,styles:u,id:$,size:_,style:w,inputContainer:O,inputWrapperOrder:C,withAsterisk:P,variant:E},y);return AU(Su({},T),{classNames:c,styles:u,unstyled:p,wrapperProps:Su(Su({},z),I),inputProps:{required:l,classNames:c,styles:u,unstyled:p,id:$,size:_,__staticSelector:h,error:a,variant:E}})}var LU=W((e,t,{size:r})=>({label:{display:"inline-block",fontSize:A({size:r,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const zU=LU;var FU=Object.defineProperty,yf=Object.getOwnPropertySymbols,zR=Object.prototype.hasOwnProperty,FR=Object.prototype.propertyIsEnumerable,Tb=(e,t,r)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VU=(e,t)=>{for(var r in t||(t={}))zR.call(t,r)&&Tb(e,r,t[r]);if(yf)for(var r of yf(t))FR.call(t,r)&&Tb(e,r,t[r]);return e},BU=(e,t)=>{var r={};for(var n in e)zR.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&&FR.call(e,n)&&(r[n]=e[n]);return r};const UU={labelElement:"label",size:"sm"},W0=f.forwardRef((e,t)=>{const r=H("InputLabel",UU,e),{labelElement:n,children:o,required:i,size:a,classNames:l,styles:c,unstyled:u,className:d,htmlFor:p,__staticSelector:h,variant:m,onMouseDown:v}=r,g=BU(r,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:b,cx:y}=zU(null,{name:["InputWrapper",h],classNames:l,styles:c,unstyled:u,variant:m,size:a});return S.createElement(oe,VU({component:n,ref:t,className:y(b.label,d),htmlFor:n==="label"?p:void 0,onMouseDown:x=>{v==null||v(x),!x.defaultPrevented&&x.detail>1&&x.preventDefault()}},g),o,i&&S.createElement("span",{className:b.required,"aria-hidden":!0}," *"))});W0.displayName="@mantine/core/InputLabel";var WU=W((e,t,{size:r})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${j(2)})`,lineHeight:1.2,display:"block"}}));const HU=WU;var GU=Object.defineProperty,xf=Object.getOwnPropertySymbols,VR=Object.prototype.hasOwnProperty,BR=Object.prototype.propertyIsEnumerable,Ib=(e,t,r)=>t in e?GU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qU=(e,t)=>{for(var r in t||(t={}))VR.call(t,r)&&Ib(e,r,t[r]);if(xf)for(var r of xf(t))BR.call(t,r)&&Ib(e,r,t[r]);return e},QU=(e,t)=>{var r={};for(var n in e)VR.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&&BR.call(e,n)&&(r[n]=e[n]);return r};const KU={size:"sm"},H0=f.forwardRef((e,t)=>{const r=H("InputError",KU,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=QU(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=HU(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(re,qU({className:m(h.error,o),ref:t},p),n)});H0.displayName="@mantine/core/InputError";var YU=W((e,t,{size:r})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${j(2)})`,lineHeight:1.2,display:"block"}}));const XU=YU;var JU=Object.defineProperty,wf=Object.getOwnPropertySymbols,UR=Object.prototype.hasOwnProperty,WR=Object.prototype.propertyIsEnumerable,Db=(e,t,r)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZU=(e,t)=>{for(var r in t||(t={}))UR.call(t,r)&&Db(e,r,t[r]);if(wf)for(var r of wf(t))WR.call(t,r)&&Db(e,r,t[r]);return e},eW=(e,t)=>{var r={};for(var n in e)UR.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&&WR.call(e,n)&&(r[n]=e[n]);return r};const tW={size:"sm"},G0=f.forwardRef((e,t)=>{const r=H("InputDescription",tW,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=eW(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=XU(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(re,ZU({color:"dimmed",className:m(h.description,o),ref:t,unstyled:l},p),n)});G0.displayName="@mantine/core/InputDescription";const HR=f.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),rW=HR.Provider,nW=()=>f.useContext(HR);function oW(e,{hasDescription:t,hasError:r}){const n=e.findIndex(c=>c==="input"),o=e[n-1],i=e[n+1];return{offsetBottom:t&&i==="description"||r&&i==="error",offsetTop:t&&o==="description"||r&&o==="error"}}var iW=Object.defineProperty,aW=Object.defineProperties,sW=Object.getOwnPropertyDescriptors,Nb=Object.getOwnPropertySymbols,lW=Object.prototype.hasOwnProperty,cW=Object.prototype.propertyIsEnumerable,Ab=(e,t,r)=>t in e?iW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uW=(e,t)=>{for(var r in t||(t={}))lW.call(t,r)&&Ab(e,r,t[r]);if(Nb)for(var r of Nb(t))cW.call(t,r)&&Ab(e,r,t[r]);return e},dW=(e,t)=>aW(e,sW(t)),fW=W(e=>({root:dW(uW({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const pW=fW;var hW=Object.defineProperty,mW=Object.defineProperties,gW=Object.getOwnPropertyDescriptors,_f=Object.getOwnPropertySymbols,GR=Object.prototype.hasOwnProperty,qR=Object.prototype.propertyIsEnumerable,Mb=(e,t,r)=>t in e?hW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ho=(e,t)=>{for(var r in t||(t={}))GR.call(t,r)&&Mb(e,r,t[r]);if(_f)for(var r of _f(t))qR.call(t,r)&&Mb(e,r,t[r]);return e},Lb=(e,t)=>mW(e,gW(t)),vW=(e,t)=>{var r={};for(var n in e)GR.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&&qR.call(e,n)&&(r[n]=e[n]);return r};const yW={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},QR=f.forwardRef((e,t)=>{const r=H("InputWrapper",yW,e),{className:n,label:o,children:i,required:a,id:l,error:c,description:u,labelElement:d,labelProps:p,descriptionProps:h,errorProps:m,classNames:v,styles:g,size:b,inputContainer:y,__staticSelector:x,unstyled:_,inputWrapperOrder:w,withAsterisk:O,variant:C}=r,P=vW(r,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:E,cx:k}=pW(null,{classNames:v,styles:g,name:["InputWrapper",x],unstyled:_,variant:C,size:b}),$={classNames:v,styles:g,unstyled:_,size:b,variant:C,__staticSelector:x},I=typeof O=="boolean"?O:a,T=l?`${l}-error`:m==null?void 0:m.id,z=l?`${l}-description`:h==null?void 0:h.id,L=`${!!c&&typeof c!="boolean"?T:""} ${u?z:""}`,q=L.trim().length>0?L.trim():void 0,Y=o&&S.createElement(W0,Ho(Ho({key:"label",labelElement:d,id:l?`${l}-label`:void 0,htmlFor:l,required:I},$),p),o),R=u&&S.createElement(G0,Lb(Ho(Ho({key:"description"},h),$),{size:(h==null?void 0:h.size)||$.size,id:(h==null?void 0:h.id)||z}),u),N=S.createElement(f.Fragment,{key:"input"},y(i)),V=typeof c!="boolean"&&c&&S.createElement(H0,Lb(Ho(Ho({},m),$),{size:(m==null?void 0:m.size)||$.size,key:"error",id:(m==null?void 0:m.id)||T}),c),Q=w.map(ee=>{switch(ee){case"label":return Y;case"input":return N;case"description":return R;case"error":return V;default:return null}});return S.createElement(rW,{value:Ho({describedBy:q},oW(w,{hasDescription:!!R,hasError:!!V}))},S.createElement(oe,Ho({className:k(E.root,n),ref:t},P),Q))});QR.displayName="@mantine/core/InputWrapper";var xW=Object.defineProperty,bf=Object.getOwnPropertySymbols,KR=Object.prototype.hasOwnProperty,YR=Object.prototype.propertyIsEnumerable,zb=(e,t,r)=>t in e?xW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wW=(e,t)=>{for(var r in t||(t={}))KR.call(t,r)&&zb(e,r,t[r]);if(bf)for(var r of bf(t))YR.call(t,r)&&zb(e,r,t[r]);return e},_W=(e,t)=>{var r={};for(var n in e)KR.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&&YR.call(e,n)&&(r[n]=e[n]);return r};const bW={},XR=f.forwardRef((e,t)=>{const r=H("InputPlaceholder",bW,e),{sx:n}=r,o=_W(r,["sx"]);return S.createElement(oe,wW({component:"span",sx:[i=>i.fn.placeholderStyles(),...dc(n)],ref:t},o))});XR.displayName="@mantine/core/InputPlaceholder";var SW=Object.defineProperty,PW=Object.defineProperties,jW=Object.getOwnPropertyDescriptors,Fb=Object.getOwnPropertySymbols,OW=Object.prototype.hasOwnProperty,CW=Object.prototype.propertyIsEnumerable,Vb=(e,t,r)=>t in e?SW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pu=(e,t)=>{for(var r in t||(t={}))OW.call(t,r)&&Vb(e,r,t[r]);if(Fb)for(var r of Fb(t))CW.call(t,r)&&Vb(e,r,t[r]);return e},dg=(e,t)=>PW(e,jW(t));const Et={xs:j(30),sm:j(36),md:j(42),lg:j(50),xl:j(60)},EW=["default","filled","unstyled"];function $W({theme:e,variant:t}){return EW.includes(t)?t==="default"?{border:`${j(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:`${j(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:j(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var kW=W((e,{multiline:t,radius:r,invalid:n,rightSectionWidth:o,withRightSection:i,iconWidth:a,offsetBottom:l,offsetTop:c,pointer:u},{variant:d,size:p})=>{const h=e.fn.variant({variant:"filled",color:"red"}).background,m=d==="default"||d==="filled"?{minHeight:A({size:p,sizes:Et}),paddingLeft:`calc(${A({size:p,sizes:Et})} / 3)`,paddingRight:i?o||A({size:p,sizes:Et}):`calc(${A({size:p,sizes:Et})} / 3)`,borderRadius:e.fn.radius(r)}:d==="unstyled"&&i?{paddingRight:o||A({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:dg(Pu(Pu(dg(Pu({},e.fn.fontStyles()),{height:t?d==="unstyled"?void 0:"auto":A({size:p,sizes:Et}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${A({size:p,sizes:Et})} - ${j(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:A({size:p,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:u?"pointer":void 0}),$W({theme:e,variant:d})),m),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:h,borderColor:h,"&::placeholder":{opacity:1,color:h}},"&[data-with-icon]":{paddingLeft:typeof a=="number"?j(a):A({size:p,sizes:Et})},"&::placeholder":dg(Pu({},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:a?j(a):A({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||A({size:p,sizes:Et})}}});const RW=kW;var TW=Object.defineProperty,IW=Object.defineProperties,DW=Object.getOwnPropertyDescriptors,Sf=Object.getOwnPropertySymbols,JR=Object.prototype.hasOwnProperty,ZR=Object.prototype.propertyIsEnumerable,Bb=(e,t,r)=>t in e?TW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ju=(e,t)=>{for(var r in t||(t={}))JR.call(t,r)&&Bb(e,r,t[r]);if(Sf)for(var r of Sf(t))ZR.call(t,r)&&Bb(e,r,t[r]);return e},Ub=(e,t)=>IW(e,DW(t)),NW=(e,t)=>{var r={};for(var n in e)JR.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&&ZR.call(e,n)&&(r[n]=e[n]);return r};const AW={size:"sm",variant:"default"},ha=f.forwardRef((e,t)=>{const r=H("Input",AW,e),{className:n,error:o,required:i,disabled:a,variant:l,icon:c,style:u,rightSectionWidth:d,iconWidth:p,rightSection:h,rightSectionProps:m,radius:v,size:g,wrapperProps:b,classNames:y,styles:x,__staticSelector:_,multiline:w,sx:O,unstyled:C,pointer:P}=r,E=NW(r,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:k,offsetTop:$,describedBy:I}=nW(),{classes:T,cx:z}=RW({radius:v,multiline:w,invalid:!!o,rightSectionWidth:d?j(d):void 0,iconWidth:p,withRightSection:!!h,offsetBottom:k,offsetTop:$,pointer:P},{classNames:y,styles:x,name:["Input",_],unstyled:C,variant:l,size:g}),{systemStyles:M,rest:L}=eo(E);return S.createElement(oe,ju(ju({className:z(T.wrapper,n),sx:O,style:u},M),b),c&&S.createElement("div",{className:T.icon},c),S.createElement(oe,Ub(ju({component:"input"},L),{ref:t,required:i,"aria-invalid":!!o,"aria-describedby":I,disabled:a,"data-disabled":a||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:T.input})),h&&S.createElement("div",Ub(ju({},m),{className:T.rightSection}),h))});ha.displayName="@mantine/core/Input";ha.Wrapper=QR;ha.Label=W0;ha.Description=G0;ha.Error=H0;ha.Placeholder=XR;const Ut=ha;var MW=Object.defineProperty,Pf=Object.getOwnPropertySymbols,eT=Object.prototype.hasOwnProperty,tT=Object.prototype.propertyIsEnumerable,Wb=(e,t,r)=>t in e?MW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LW=(e,t)=>{for(var r in t||(t={}))eT.call(t,r)&&Wb(e,r,t[r]);if(Pf)for(var r of Pf(t))tT.call(t,r)&&Wb(e,r,t[r]);return e},zW=(e,t)=>{var r={};for(var n in e)eT.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&&tT.call(e,n)&&(r[n]=e[n]);return r};function FW(e){const t=e,{style:r}=t,n=zW(t,["style"]);return S.createElement("svg",LW({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r},n),S.createElement("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var VW=Object.defineProperty,BW=Object.defineProperties,UW=Object.getOwnPropertyDescriptors,Hb=Object.getOwnPropertySymbols,WW=Object.prototype.hasOwnProperty,HW=Object.prototype.propertyIsEnumerable,Gb=(e,t,r)=>t in e?VW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GW=(e,t)=>{for(var r in t||(t={}))WW.call(t,r)&&Gb(e,r,t[r]);if(Hb)for(var r of Hb(t))HW.call(t,r)&&Gb(e,r,t[r]);return e},qW=(e,t)=>BW(e,UW(t));const rT=f.createContext(null);function QW({spacing:e,children:t}){return S.createElement(rT.Provider,{value:{spacing:e}},t)}function KW(){const e=f.useContext(rT);return e?qW(GW({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var YW=W((e,{spacing:t})=>({root:{display:"flex",paddingLeft:A({size:t,sizes:e.spacing})}}));const XW=YW;var JW=Object.defineProperty,jf=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,oT=Object.prototype.propertyIsEnumerable,qb=(e,t,r)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZW=(e,t)=>{for(var r in t||(t={}))nT.call(t,r)&&qb(e,r,t[r]);if(jf)for(var r of jf(t))oT.call(t,r)&&qb(e,r,t[r]);return e},eH=(e,t)=>{var r={};for(var n in e)nT.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&&oT.call(e,n)&&(r[n]=e[n]);return r};const tH={},iT=f.forwardRef((e,t)=>{const r=H("AvatarGroup",tH,e),{children:n,spacing:o="sm",unstyled:i,className:a,variant:l}=r,c=eH(r,["children","spacing","unstyled","className","variant"]),{classes:u,cx:d}=XW({spacing:o},{name:"AvatarGroup",unstyled:i,variant:l});return S.createElement(QW,{spacing:o},S.createElement(oe,ZW({ref:t,className:d(u.root,a)},c),n))});iT.displayName="@mantine/core/AvatarGroup";var rH=Object.defineProperty,nH=Object.defineProperties,oH=Object.getOwnPropertyDescriptors,Qb=Object.getOwnPropertySymbols,iH=Object.prototype.hasOwnProperty,aH=Object.prototype.propertyIsEnumerable,Kb=(e,t,r)=>t in e?rH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zs=(e,t)=>{for(var r in t||(t={}))iH.call(t,r)&&Kb(e,r,t[r]);if(Qb)for(var r of Qb(t))aH.call(t,r)&&Kb(e,r,t[r]);return e},Yb=(e,t)=>nH(e,oH(t));const sH=["filled","light","gradient","outline"],Ou={xs:j(16),sm:j(26),md:j(38),lg:j(56),xl:j(84)};function lH({withinGroup:e,spacing:t,theme:r}){return e?{marginLeft:`calc(${A({size:t,sizes:r.spacing})} * -1)`,backgroundColor:`${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`,border:`${j(2)} solid ${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`}:null}function cH({theme:e,variant:t,color:r,gradient:n}){const o=e.fn.variant({variant:t,color:r,gradient:n});return sH.includes(t)?{placeholder:{color:o.color,backgroundColor:o.background,backgroundImage:t==="gradient"?o.background:void 0,border:`${j(t==="gradient"?0:1)} solid ${o.border}`},placeholderIcon:{color:o.color}}:{}}var uH=W((e,{radius:t,withinGroup:r,spacing:n,color:o,gradient:i},{variant:a,size:l})=>{const c=cH({theme:e,color:o,gradient:i,variant:a});return{root:Zs(Yb(Zs({},e.fn.focusStyles()),{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",display:"block",userSelect:"none",overflow:"hidden",borderRadius:e.fn.radius(t),textDecoration:"none",border:0,backgroundColor:"transparent",padding:0,width:A({size:l,sizes:Ou}),minWidth:A({size:l,sizes:Ou}),height:A({size:l,sizes:Ou})}),lH({withinGroup:r,spacing:n,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:Zs(Yb(Zs({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${A({size:l,sizes:Ou})} / 2.5)`}),c.placeholder),placeholderIcon:Zs({width:"70%",height:"70%"},c.placeholderIcon)}});const dH=uH;var fH=Object.defineProperty,pH=Object.defineProperties,hH=Object.getOwnPropertyDescriptors,Of=Object.getOwnPropertySymbols,aT=Object.prototype.hasOwnProperty,sT=Object.prototype.propertyIsEnumerable,Xb=(e,t,r)=>t in e?fH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Jb=(e,t)=>{for(var r in t||(t={}))aT.call(t,r)&&Xb(e,r,t[r]);if(Of)for(var r of Of(t))sT.call(t,r)&&Xb(e,r,t[r]);return e},mH=(e,t)=>pH(e,hH(t)),gH=(e,t)=>{var r={};for(var n in e)aT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Of)for(var n of Of(e))t.indexOf(n)<0&&sT.call(e,n)&&(r[n]=e[n]);return r};const vH={size:"md",color:"gray",variant:"light"},q0=f.forwardRef((e,t)=>{const r=H("Avatar",vH,e),{className:n,size:o,src:i,alt:a,radius:l,children:c,color:u,variant:d,gradient:p,classNames:h,styles:m,imageProps:v,unstyled:g}=r,b=gH(r,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),y=KW(),[x,_]=f.useState(!i),{classes:w,cx:O}=dH({color:u,radius:l,withinGroup:y.withinGroup,spacing:y.spacing,gradient:p},{classNames:h,styles:m,unstyled:g,name:"Avatar",variant:d,size:o});return f.useEffect(()=>{_(!i)},[i]),S.createElement(oe,Jb({component:"div",className:O(w.root,n),ref:t},b),x?S.createElement("div",{className:w.placeholder,title:a},c||S.createElement(FW,{className:w.placeholderIcon})):S.createElement("img",mH(Jb({},v),{className:w.image,src:i,alt:a,onError:()=>_(!0)})))});q0.displayName="@mantine/core/Avatar";q0.Group=iT;const Cf=q0;var yH=Object.defineProperty,xH=Object.defineProperties,wH=Object.getOwnPropertyDescriptors,Zb=Object.getOwnPropertySymbols,_H=Object.prototype.hasOwnProperty,bH=Object.prototype.propertyIsEnumerable,eS=(e,t,r)=>t in e?yH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fg=(e,t)=>{for(var r in t||(t={}))_H.call(t,r)&&eS(e,r,t[r]);if(Zb)for(var r of Zb(t))bH.call(t,r)&&eS(e,r,t[r]);return e},SH=(e,t)=>xH(e,wH(t));const PH=["light","filled","outline","dot","gradient"],pg={xs:{fontSize:j(9),height:j(16)},sm:{fontSize:j(10),height:j(18)},md:{fontSize:j(11),height:j(20)},lg:{fontSize:j(13),height:j(26)},xl:{fontSize:j(16),height:j(32)}},jH={xs:j(4),sm:j(4),md:j(6),lg:j(8),xl:j(10)};function OH({theme:e,variant:t,color:r,size:n,gradient:o}){if(!PH.includes(t))return null;if(t==="dot"){const a=A({size:n,sizes:jH});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${A({size:n,sizes:e.spacing})} / 1.5 - ${a} / 2)`,"&::before":{content:'""',display:"block",width:a,height:a,borderRadius:a,backgroundColor:e.fn.themeColor(r,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:a}}}const i=e.fn.variant({color:r,variant:t,gradient:o});return{background:i.background,color:i.color,border:`${j(t==="gradient"?0:1)} solid ${i.border}`}}var CH=W((e,{color:t,radius:r,gradient:n,fullWidth:o},{variant:i,size:a})=>{const{fontSize:l,height:c}=a in pg?pg[a]:pg.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:fg(SH(fg(fg({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${j(2)})`,textDecoration:"none",padding:`0 calc(${A({size:a,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:j(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),OH({theme:e,variant:i,color:t,size:a,gradient:n}))}});const EH=CH;var $H=Object.defineProperty,Ef=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,tS=(e,t,r)=>t in e?$H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kH=(e,t)=>{for(var r in t||(t={}))lT.call(t,r)&&tS(e,r,t[r]);if(Ef)for(var r of Ef(t))cT.call(t,r)&&tS(e,r,t[r]);return e},RH=(e,t)=>{var r={};for(var n in e)lT.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&&cT.call(e,n)&&(r[n]=e[n]);return r};const TH={variant:"light",size:"md",radius:"xl"},uT=f.forwardRef((e,t)=>{const r=H("Badge",TH,e),{className:n,color:o,variant:i,fullWidth:a,children:l,size:c,leftSection:u,rightSection:d,radius:p,gradient:h,classNames:m,styles:v,unstyled:g}=r,b=RH(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:y,cx:x}=EH({fullWidth:a,color:o,radius:p,gradient:h},{classNames:m,styles:v,name:"Badge",unstyled:g,variant:i,size:c});return S.createElement(oe,kH({className:x(y.root,n),ref:t},b),u&&S.createElement("span",{className:y.leftSection},u),S.createElement("span",{className:y.inner},l),d&&S.createElement("span",{className:y.rightSection},d))});uT.displayName="@mantine/core/Badge";const IH=uT;var DH=Object.defineProperty,$f=Object.getOwnPropertySymbols,dT=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable,rS=(e,t,r)=>t in e?DH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nS=(e,t)=>{for(var r in t||(t={}))dT.call(t,r)&&rS(e,r,t[r]);if($f)for(var r of $f(t))fT.call(t,r)&&rS(e,r,t[r]);return e},NH=(e,t)=>{var r={};for(var n in e)dT.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&&fT.call(e,n)&&(r[n]=e[n]);return r};function AH(e){const t=e,{style:r}=t,n=NH(t,["style"]);return S.createElement("svg",nS({viewBox:"0 0 409.294 409.294",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:nS({width:j(20),height:j(20)},r)},n),S.createElement("path",{d:"M0 204.647v175.412h175.412V204.647H58.471c0-64.48 52.461-116.941 116.941-116.941V29.235C78.684 29.235 0 107.919 0 204.647zM409.294 87.706V29.235c-96.728 0-175.412 78.684-175.412 175.412v175.412h175.412V204.647H292.353c0-64.48 52.461-116.941 116.941-116.941z"}))}var MH=Object.defineProperty,LH=Object.defineProperties,zH=Object.getOwnPropertyDescriptors,oS=Object.getOwnPropertySymbols,FH=Object.prototype.hasOwnProperty,VH=Object.prototype.propertyIsEnumerable,iS=(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)&&iS(e,r,t[r]);if(oS)for(var r of oS(t))VH.call(t,r)&&iS(e,r,t[r]);return e},UH=(e,t)=>LH(e,zH(t)),WH=W((e,{color:t})=>({root:UH(BH({},e.fn.fontStyles()),{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,margin:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md} ${e.spacing.lg}`}),inner:{display:"flex"},body:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},icon:{color:e.fn.variant({variant:"filled",color:t}).background,marginRight:e.spacing.lg,marginTop:j(2),width:j(22)},cite:{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}));const HH=WH;var GH=Object.defineProperty,kf=Object.getOwnPropertySymbols,pT=Object.prototype.hasOwnProperty,hT=Object.prototype.propertyIsEnumerable,aS=(e,t,r)=>t in e?GH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qH=(e,t)=>{for(var r in t||(t={}))pT.call(t,r)&&aS(e,r,t[r]);if(kf)for(var r of kf(t))hT.call(t,r)&&aS(e,r,t[r]);return e},QH=(e,t)=>{var r={};for(var n in e)pT.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&&hT.call(e,n)&&(r[n]=e[n]);return r};const KH={color:"gray",icon:S.createElement(AH,null)},mT=f.forwardRef((e,t)=>{const r=H("Blockquote",KH,e),{className:n,color:o,icon:i,cite:a,children:l,classNames:c,styles:u,unstyled:d,variant:p}=r,h=QH(r,["className","color","icon","cite","children","classNames","styles","unstyled","variant"]),{classes:m,cx:v}=HH({color:o},{classNames:c,styles:u,unstyled:d,name:"Blockquote",variant:p});return S.createElement(oe,qH({component:"blockquote",className:v(m.root,n),ref:t},h),S.createElement("div",{className:m.inner},i&&S.createElement("div",{className:m.icon},i),S.createElement("div",{className:m.body},l,a&&S.createElement("cite",{className:m.cite},a))))});mT.displayName="@mantine/core/Blockquote";var YH=W((e,{orientation:t,buttonBorderWidth:r})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type:not(:last-of-type)":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${j(r)} / 2)`},"&:last-of-type:not(:first-of-type)":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${j(r)} / 2)`},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${j(r)} / 2)`,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${j(r)} / 2)`},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:`calc(${r} * -1)`,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const XH=YH;var JH=Object.defineProperty,Rf=Object.getOwnPropertySymbols,gT=Object.prototype.hasOwnProperty,vT=Object.prototype.propertyIsEnumerable,sS=(e,t,r)=>t in e?JH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZH=(e,t)=>{for(var r in t||(t={}))gT.call(t,r)&&sS(e,r,t[r]);if(Rf)for(var r of Rf(t))vT.call(t,r)&&sS(e,r,t[r]);return e},eG=(e,t)=>{var r={};for(var n in e)gT.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&&vT.call(e,n)&&(r[n]=e[n]);return r};const tG={orientation:"horizontal",buttonBorderWidth:1},yT=f.forwardRef((e,t)=>{const r=H("ButtonGroup",tG,e),{className:n,orientation:o,buttonBorderWidth:i,unstyled:a}=r,l=eG(r,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=XH({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:a});return S.createElement(oe,ZH({className:u(c.root,n),ref:t},l))});yT.displayName="@mantine/core/ButtonGroup";var rG=Object.defineProperty,nG=Object.defineProperties,oG=Object.getOwnPropertyDescriptors,lS=Object.getOwnPropertySymbols,iG=Object.prototype.hasOwnProperty,aG=Object.prototype.propertyIsEnumerable,cS=(e,t,r)=>t in e?rG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fo=(e,t)=>{for(var r in t||(t={}))iG.call(t,r)&&cS(e,r,t[r]);if(lS)for(var r of lS(t))aG.call(t,r)&&cS(e,r,t[r]);return e},cd=(e,t)=>nG(e,oG(t));const sG=["filled","outline","light","white","default","subtle","gradient"],Qv={xs:{height:Et.xs,paddingLeft:j(14),paddingRight:j(14)},sm:{height:Et.sm,paddingLeft:j(18),paddingRight:j(18)},md:{height:Et.md,paddingLeft:j(22),paddingRight:j(22)},lg:{height:Et.lg,paddingLeft:j(26),paddingRight:j(26)},xl:{height:Et.xl,paddingLeft:j(32),paddingRight:j(32)},"compact-xs":{height:j(22),paddingLeft:j(7),paddingRight:j(7)},"compact-sm":{height:j(26),paddingLeft:j(8),paddingRight:j(8)},"compact-md":{height:j(30),paddingLeft:j(10),paddingRight:j(10)},"compact-lg":{height:j(34),paddingLeft:j(12),paddingRight:j(12)},"compact-xl":{height:j(40),paddingLeft:j(14),paddingRight:j(14)}};function lG({compact:e,size:t,withLeftIcon:r,withRightIcon:n}){if(e)return Qv[`compact-${t}`];const o=Qv[t];return o?cd(fo({},o),{paddingLeft:r?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:n?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const cG=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function uG({variant:e,theme:t,color:r,gradient:n}){if(!sG.includes(e))return null;const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?fo({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):fo({border:`${j(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var dG=W((e,{radius:t,fullWidth:r,compact:n,withLeftIcon:o,withRightIcon:i,color:a,gradient:l},{variant:c,size:u})=>({root:cd(fo(cd(fo(fo(fo(fo({},lG({compact:n,size:u,withLeftIcon:o,withRightIcon:i})),e.fn.fontStyles()),e.fn.focusStyles()),cG(r)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:A({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),uG({variant:c,theme:e,color:a,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":cd(fo({content:'""'},e.fn.cover(j(-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 fG=dG;var pG=Object.defineProperty,Tf=Object.getOwnPropertySymbols,xT=Object.prototype.hasOwnProperty,wT=Object.prototype.propertyIsEnumerable,uS=(e,t,r)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dS=(e,t)=>{for(var r in t||(t={}))xT.call(t,r)&&uS(e,r,t[r]);if(Tf)for(var r of Tf(t))wT.call(t,r)&&uS(e,r,t[r]);return e},hG=(e,t)=>{var r={};for(var n in e)xT.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&&wT.call(e,n)&&(r[n]=e[n]);return r};const mG={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},Q0=f.forwardRef((e,t)=>{const r=H("Button",mG,e),{className:n,size:o,color:i,type:a,disabled:l,children:c,leftIcon:u,rightIcon:d,fullWidth:p,variant:h,radius:m,uppercase:v,compact:g,loading:b,loaderPosition:y,loaderProps:x,gradient:_,classNames:w,styles:O,unstyled:C}=r,P=hG(r,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:E,cx:k,theme:$}=fG({radius:m,color:i,fullWidth:p,compact:g,gradient:_,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:C,classNames:w,styles:O,variant:h,size:o}),I=$.fn.variant({color:i,variant:h}),T=S.createElement(cn,dS({color:I.color,size:`calc(${A({size:o,sizes:Qv}).height} / 2)`},x));return S.createElement(wo,dS({className:k(E.root,n),type:a,disabled:l,"data-button":!0,"data-disabled":l||void 0,"data-loading":b||void 0,ref:t,unstyled:C},P),S.createElement("div",{className:E.inner},(u||b&&y==="left")&&S.createElement("span",{className:k(E.icon,E.leftIcon)},b&&y==="left"?T:u),b&&y==="center"&&S.createElement("span",{className:E.centerLoader},T),S.createElement("span",{className:E.label,style:{textTransform:v?"uppercase":void 0}},c),(d||b&&y==="right")&&S.createElement("span",{className:k(E.icon,E.rightIcon)},b&&y==="right"?T:d)))});Q0.displayName="@mantine/core/Button";Q0.Group=yT;const ne=Q0;var gG=W((e,{radius:t,shadow:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[r]||r||"none","&[data-with-border]":{border:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}}}));const vG=gG;var yG=Object.defineProperty,If=Object.getOwnPropertySymbols,_T=Object.prototype.hasOwnProperty,bT=Object.prototype.propertyIsEnumerable,fS=(e,t,r)=>t in e?yG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xG=(e,t)=>{for(var r in t||(t={}))_T.call(t,r)&&fS(e,r,t[r]);if(If)for(var r of If(t))bT.call(t,r)&&fS(e,r,t[r]);return e},wG=(e,t)=>{var r={};for(var n in e)_T.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&&bT.call(e,n)&&(r[n]=e[n]);return r};const _G={},ST=f.forwardRef((e,t)=>{const r=H("Paper",_G,e),{className:n,children:o,radius:i,withBorder:a,shadow:l,unstyled:c,variant:u}=r,d=wG(r,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:p,cx:h}=vG({radius:i,shadow:l},{name:"Paper",unstyled:c,variant:u});return S.createElement(oe,xG({className:h(p.root,n),"data-with-border":a||void 0,ref:t},d),o)});ST.displayName="@mantine/core/Paper";const on=ST;var bG=W((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const SG=bG;var PG=Object.defineProperty,Df=Object.getOwnPropertySymbols,PT=Object.prototype.hasOwnProperty,jT=Object.prototype.propertyIsEnumerable,pS=(e,t,r)=>t in e?PG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jG=(e,t)=>{for(var r in t||(t={}))PT.call(t,r)&&pS(e,r,t[r]);if(Df)for(var r of Df(t))jT.call(t,r)&&pS(e,r,t[r]);return e},OG=(e,t)=>{var r={};for(var n in e)PT.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&&jT.call(e,n)&&(r[n]=e[n]);return r};const OT=f.forwardRef((e,t)=>{const r=H("Center",{},e),{inline:n,className:o,unstyled:i,variant:a}=r,l=OG(r,["inline","className","unstyled","variant"]),{classes:c,cx:u}=SG({inline:n},{name:"Center",unstyled:i,variant:a});return S.createElement(oe,jG({ref:t,className:u(c.root,o)},l))});OT.displayName="@mantine/core/Center";const or=OT,CT=f.createContext(null),CG=CT.Provider,EG=()=>f.useContext(CT);var $G=Object.defineProperty,Nf=Object.getOwnPropertySymbols,ET=Object.prototype.hasOwnProperty,$T=Object.prototype.propertyIsEnumerable,hS=(e,t,r)=>t in e?$G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mS=(e,t)=>{for(var r in t||(t={}))ET.call(t,r)&&hS(e,r,t[r]);if(Nf)for(var r of Nf(t))$T.call(t,r)&&hS(e,r,t[r]);return e},kG=(e,t)=>{var r={};for(var n in e)ET.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&&$T.call(e,n)&&(r[n]=e[n]);return r};const RG={size:"sm"},kT=f.forwardRef((e,t)=>{const r=H("CheckboxGroup",RG,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=kG(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=$r({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(CG,{value:{value:d,onChange:h,size:l}},S.createElement(Ut.Wrapper,mS(mS({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),u),n))});kT.displayName="@mantine/core/CheckboxGroup";var TG=Object.defineProperty,Af=Object.getOwnPropertySymbols,RT=Object.prototype.hasOwnProperty,TT=Object.prototype.propertyIsEnumerable,gS=(e,t,r)=>t in e?TG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mf=(e,t)=>{for(var r in t||(t={}))RT.call(t,r)&&gS(e,r,t[r]);if(Af)for(var r of Af(t))TT.call(t,r)&&gS(e,r,t[r]);return e},IT=(e,t)=>{var r={};for(var n in e)RT.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&&TT.call(e,n)&&(r[n]=e[n]);return r};function DT(e){const t=e,{width:r,height:n,style:o}=t,i=IT(t,["width","height","style"]);return S.createElement("svg",Mf({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Mf({width:r,height:n},o)},i),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 NT(e){var t=e,{indeterminate:r}=t,n=IT(t,["indeterminate"]);return r?S.createElement("svg",Mf({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(DT,Mf({},n))}var IG=Object.defineProperty,DG=Object.defineProperties,NG=Object.getOwnPropertyDescriptors,vS=Object.getOwnPropertySymbols,AG=Object.prototype.hasOwnProperty,MG=Object.prototype.propertyIsEnumerable,yS=(e,t,r)=>t in e?IG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xS=(e,t)=>{for(var r in t||(t={}))AG.call(t,r)&&yS(e,r,t[r]);if(vS)for(var r of vS(t))MG.call(t,r)&&yS(e,r,t[r]);return e},wS=(e,t)=>DG(e,NG(t));const LG={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)};var zG=W((e,{radius:t,color:r,transitionDuration:n,labelPosition:o,error:i,indeterminate:a},{size:l})=>{const c=A({size:l,sizes:LG}),u=e.fn.variant({variant:"filled",color:r});return{icon:wS(xS({},e.fn.cover()),{ref:Vt("icon"),color:a?"inherit":e.white,transform:a?"none":`translateY(${j(5)}) scale(0.5)`,opacity:a?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:wS(xS({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${j(1)} solid ${i?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,[`& + .${Vt("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",[`& + .${Vt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const FG=zG;var VG=Object.defineProperty,BG=Object.defineProperties,UG=Object.getOwnPropertyDescriptors,_S=Object.getOwnPropertySymbols,WG=Object.prototype.hasOwnProperty,HG=Object.prototype.propertyIsEnumerable,bS=(e,t,r)=>t in e?VG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GG=(e,t)=>{for(var r in t||(t={}))WG.call(t,r)&&bS(e,r,t[r]);if(_S)for(var r of _S(t))HG.call(t,r)&&bS(e,r,t[r]);return e},qG=(e,t)=>BG(e,UG(t));const hg={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)};var QG=W((e,{labelPosition:t},{size:r})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}},labelWrapper:qG(GG({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:r in hg?A({size:r,sizes:e.fontSizes}):void 0,lineHeight:r in hg?A({size:r,sizes:hg}):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 KG=QG;var YG=Object.defineProperty,Lf=Object.getOwnPropertySymbols,AT=Object.prototype.hasOwnProperty,MT=Object.prototype.propertyIsEnumerable,SS=(e,t,r)=>t in e?YG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,XG=(e,t)=>{for(var r in t||(t={}))AT.call(t,r)&&SS(e,r,t[r]);if(Lf)for(var r of Lf(t))MT.call(t,r)&&SS(e,r,t[r]);return e},JG=(e,t)=>{var r={};for(var n in e)AT.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&&MT.call(e,n)&&(r[n]=e[n]);return r};const Zh=f.forwardRef((e,t)=>{var r=e,{__staticSelector:n,className:o,classNames:i,styles:a,unstyled:l,children:c,label:u,description:d,id:p,disabled:h,error:m,size:v,labelPosition:g,variant:b}=r,y=JG(r,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:x,cx:_}=KG({labelPosition:g},{name:n,styles:a,classNames:i,unstyled:l,variant:b,size:v});return S.createElement(oe,XG({className:_(x.root,o),ref:t},y),S.createElement("div",{className:_(x.body)},c,S.createElement("div",{className:x.labelWrapper},u!=null&&S.createElement("label",{className:x.label,"data-disabled":h||void 0,htmlFor:p},u),d&&S.createElement(Ut.Description,{className:x.description},d),m&&m!=="boolean"&&S.createElement(Ut.Error,{className:x.error},m))))});Zh.displayName="@mantine/core/InlineInput";var ZG=Object.defineProperty,zf=Object.getOwnPropertySymbols,LT=Object.prototype.hasOwnProperty,zT=Object.prototype.propertyIsEnumerable,PS=(e,t,r)=>t in e?ZG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cu=(e,t)=>{for(var r in t||(t={}))LT.call(t,r)&&PS(e,r,t[r]);if(zf)for(var r of zf(t))zT.call(t,r)&&PS(e,r,t[r]);return e},eq=(e,t)=>{var r={};for(var n in e)LT.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&&zT.call(e,n)&&(r[n]=e[n]);return r};const tq={size:"sm",transitionDuration:100,icon:NT,labelPosition:"right"},jn=f.forwardRef((e,t)=>{const r=H("Checkbox",tq,e),{className:n,style:o,sx:i,checked:a,disabled:l,color:c,label:u,indeterminate:d,id:p,size:h,radius:m,wrapperProps:v,children:g,classNames:b,styles:y,transitionDuration:x,icon:_,unstyled:w,labelPosition:O,description:C,error:P,variant:E}=r,k=eq(r,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),$=EG(),I=Rr(p),{systemStyles:T,rest:z}=eo(k),{classes:M}=FG({radius:m,color:c,transitionDuration:x,labelPosition:O,error:!!P,indeterminate:d},{name:"Checkbox",classNames:b,styles:y,unstyled:w,variant:E,size:($==null?void 0:$.size)||h}),L=$?{checked:$.value.includes(z.value),onChange:$.onChange}:{};return S.createElement(Zh,Cu(Cu({className:n,sx:i,style:o,id:I,size:($==null?void 0:$.size)||h,labelPosition:O,label:u,description:C,error:P,disabled:l,__staticSelector:"Checkbox",classNames:b,styles:y,unstyled:w,"data-checked":L.checked||void 0,variant:E},T),v),S.createElement("div",{className:M.inner},S.createElement("input",Cu(Cu({id:I,ref:t,type:"checkbox",className:M.input,checked:a,disabled:l},z),L)),S.createElement(_,{indeterminate:d,className:M.icon})))});jn.displayName="@mantine/core/Checkbox";jn.Group=kT;const FT=f.createContext(null),rq=FT.Provider,nq=()=>f.useContext(FT),oq={};function VT(e){const{value:t,defaultValue:r,onChange:n,multiple:o,children:i}=H("ChipGroup",oq,e),[a,l]=$r({value:t,defaultValue:r,finalValue:o?[]:null,onChange:n}),c=d=>Array.isArray(a)?a.includes(d):d===a,u=d=>{const p=d.currentTarget.value;Array.isArray(a)?l(a.includes(p)?a.filter(h=>h!==p):[...a,p]):l(p)};return S.createElement(rq,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}VT.displayName="@mantine/core/ChipGroup";var iq=Object.defineProperty,aq=Object.defineProperties,sq=Object.getOwnPropertyDescriptors,jS=Object.getOwnPropertySymbols,lq=Object.prototype.hasOwnProperty,cq=Object.prototype.propertyIsEnumerable,OS=(e,t,r)=>t in e?iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xn=(e,t)=>{for(var r in t||(t={}))lq.call(t,r)&&OS(e,r,t[r]);if(jS)for(var r of jS(t))cq.call(t,r)&&OS(e,r,t[r]);return e},yl=(e,t)=>aq(e,sq(t));const CS={xs:j(24),sm:j(28),md:j(32),lg:j(36),xl:j(40)},el={xs:j(10),sm:j(12),md:j(14),lg:j(16),xl:j(18)},ES={xs:j(16),sm:j(20),md:j(24),lg:j(28),xl:j(32)},Eu={xs:j(7.5),sm:j(10),md:j(11.5),lg:j(13),xl:j(15)};function uq(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:yl(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:`${j(1)} solid ${n.background}`}}:{label:null,checked:null}}var dq=W((e,{radius:t,color:r},{size:n,variant:o})=>{const i=uq(e,{color:r},o);return{root:{},label:yl(xn(yl(xn({ref:Vt("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:`${j(1)} solid transparent`,borderRadius:e.fn.radius(t),height:A({size:n,sizes:CS}),fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:`calc(${A({size:n,sizes:CS})} - ${j(2)})`,paddingLeft:A({size:n,sizes:ES}),paddingRight:A({size:n,sizes:ES}),cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 100ms ease",WebkitTapHighlightColor:"transparent"}),i.label),{"&[data-disabled]":yl(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]})),{[`& .${Vt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}),"&[data-checked]":{paddingLeft:A({size:n,sizes:Eu}),paddingRight:A({size:n,sizes:Eu}),"&:not([data-disabled])":i.checked}}),iconWrapper:{ref:Vt("iconWrapper"),color:o==="filled"?e.white:e.fn.variant({variant:"filled",color:r}).background,width:`calc(${A({size:n,sizes:el})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,maxWidth:`calc(${A({size:n,sizes:el})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,height:A({size:n,sizes:el}),display:"inline-block",verticalAlign:"middle",overflow:"hidden"},checkIcon:{width:A({size:n,sizes:el}),height:`calc(${A({size:n,sizes:el})} / 1.1)`,display:"block"},input:{width:0,height:0,padding:0,opacity:0,margin:0,"&:disabled + label":yl(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]})),{[`& .${Vt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&[data-checked]":{paddingLeft:A({size:n,sizes:Eu}),paddingRight:A({size:n,sizes:Eu}),"&: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",[`& + .${Vt("label")}`]:xn({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${Vt("label")}`]:xn({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}}}});const fq=dq;var pq=Object.defineProperty,Ff=Object.getOwnPropertySymbols,BT=Object.prototype.hasOwnProperty,UT=Object.prototype.propertyIsEnumerable,$S=(e,t,r)=>t in e?pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$u=(e,t)=>{for(var r in t||(t={}))BT.call(t,r)&&$S(e,r,t[r]);if(Ff)for(var r of Ff(t))UT.call(t,r)&&$S(e,r,t[r]);return e},hq=(e,t)=>{var r={};for(var n in e)BT.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&&UT.call(e,n)&&(r[n]=e[n]);return r};const mq={type:"checkbox",size:"sm",radius:"xl",variant:"outline"},Vf=f.forwardRef((e,t)=>{const r=H("Chip",mq,e),{radius:n,type:o,size:i,variant:a,disabled:l,id:c,color:u,children:d,className:p,classNames:h,style:m,styles:v,checked:g,defaultChecked:b,onChange:y,sx:x,wrapperProps:_,value:w,unstyled:O}=r,C=hq(r,["radius","type","size","variant","disabled","id","color","children","className","classNames","style","styles","checked","defaultChecked","onChange","sx","wrapperProps","value","unstyled"]),P=nq(),E=Rr(c),{systemStyles:k,rest:$}=eo(C),{classes:I,cx:T}=fq({radius:n,color:u},{classNames:h,styles:v,unstyled:O,name:"Chip",variant:a,size:i}),[z,M]=$r({value:g,defaultValue:b,finalValue:!1,onChange:y}),L=P?{checked:P.isChipSelected(w),onChange:P.onChange,type:P.multiple?"checkbox":"radio"}:{},q=L.checked||z;return S.createElement(oe,$u($u({className:T(I.root,p),style:m,sx:x},k),_),S.createElement("input",$u($u({type:o,className:I.input,checked:q,onChange:Y=>M(Y.currentTarget.checked),id:E,disabled:l,ref:t,value:w},L),$)),S.createElement("label",{htmlFor:E,"data-checked":q||void 0,"data-disabled":l||void 0,className:I.label},q&&S.createElement("span",{className:I.iconWrapper},S.createElement(DT,{className:I.checkIcon})),d))});Vf.displayName="@mantine/core/Chip";Vf.Group=VT;var gq=W((e,{fluid:t,sizes:r},{size:n})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":A({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const vq=gq;var yq=Object.defineProperty,Bf=Object.getOwnPropertySymbols,WT=Object.prototype.hasOwnProperty,HT=Object.prototype.propertyIsEnumerable,kS=(e,t,r)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xq=(e,t)=>{for(var r in t||(t={}))WT.call(t,r)&&kS(e,r,t[r]);if(Bf)for(var r of Bf(t))HT.call(t,r)&&kS(e,r,t[r]);return e},wq=(e,t)=>{var r={};for(var n in e)WT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bf)for(var n of Bf(e))t.indexOf(n)<0&&HT.call(e,n)&&(r[n]=e[n]);return r};const _q={sizes:{xs:j(540),sm:j(720),md:j(960),lg:j(1140),xl:j(1320)}},GT=f.forwardRef((e,t)=>{const r=H("Container",_q,e),{className:n,fluid:o,size:i,unstyled:a,sizes:l,variant:c}=r,u=wq(r,["className","fluid","size","unstyled","sizes","variant"]),{classes:d,cx:p}=vq({fluid:o,sizes:l},{unstyled:a,name:"Container",variant:c,size:i});return S.createElement(oe,xq({className:p(d.root,n),ref:t},u))});GT.displayName="@mantine/core/Container";var bq=Object.defineProperty,Uf=Object.getOwnPropertySymbols,qT=Object.prototype.hasOwnProperty,QT=Object.prototype.propertyIsEnumerable,RS=(e,t,r)=>t in e?bq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sq=(e,t)=>{for(var r in t||(t={}))qT.call(t,r)&&RS(e,r,t[r]);if(Uf)for(var r of Uf(t))QT.call(t,r)&&RS(e,r,t[r]);return e},Pq=(e,t)=>{var r={};for(var n in e)qT.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&&QT.call(e,n)&&(r[n]=e[n]);return r};const jq={timeout:1e3};function KT(e){const t=H("CopyButton",jq,e),{children:r,timeout:n,value:o}=t,i=Pq(t,["children","timeout","value"]),a=uL({timeout:n}),l=()=>a.copy(o);return S.createElement(S.Fragment,null,r(Sq({copy:l,copied:a.copied},i)))}KT.displayName="@mantine/core/CopyButton";const[Oq,Is]=ko("ModalBase component was not found in tree");var Cq=W(()=>({close:{marginLeft:"auto",marginRight:0}}));const Eq=Cq;var $q=Object.defineProperty,Wf=Object.getOwnPropertySymbols,YT=Object.prototype.hasOwnProperty,XT=Object.prototype.propertyIsEnumerable,TS=(e,t,r)=>t in e?$q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kq=(e,t)=>{for(var r in t||(t={}))YT.call(t,r)&&TS(e,r,t[r]);if(Wf)for(var r of Wf(t))XT.call(t,r)&&TS(e,r,t[r]);return e},Rq=(e,t)=>{var r={};for(var n in e)YT.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&&XT.call(e,n)&&(r[n]=e[n]);return r};const Tq={size:"sm"},Iq=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}CloseButton`,Tq,e),{className:o}=n,i=Rq(n,["className"]),{classes:a,cx:l}=Eq(null,r.stylesApi);return S.createElement(wc,kq({className:l(a.close,o),ref:t,onClick:r.onClose},i))});var Dq=W(()=>({overlay:{}}));const Nq=Dq;var Aq=Object.defineProperty,Mq=Object.defineProperties,Lq=Object.getOwnPropertyDescriptors,IS=Object.getOwnPropertySymbols,zq=Object.prototype.hasOwnProperty,Fq=Object.prototype.propertyIsEnumerable,DS=(e,t,r)=>t in e?Aq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vq=(e,t)=>{for(var r in t||(t={}))zq.call(t,r)&&DS(e,r,t[r]);if(IS)for(var r of IS(t))Fq.call(t,r)&&DS(e,r,t[r]);return e},Bq=(e,t)=>Mq(e,Lq(t)),Uq=W((e,{color:t,opacity:r,blur:n,radius:o,gradient:i,fixed:a,zIndex:l})=>({root:Bq(Vq({},e.fn.cover(0)),{position:a?"fixed":"absolute",backgroundColor:i?void 0:e.fn.rgba(t,r),backgroundImage:i,backdropFilter:n?`blur(${j(n)})`:void 0,borderRadius:e.fn.radius(o),zIndex:l,"&[data-center]":{display:"flex",alignItems:"center",justifyContent:"center"}})}));const Wq=Uq;var Hq=Object.defineProperty,Hf=Object.getOwnPropertySymbols,JT=Object.prototype.hasOwnProperty,ZT=Object.prototype.propertyIsEnumerable,NS=(e,t,r)=>t in e?Hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gq=(e,t)=>{for(var r in t||(t={}))JT.call(t,r)&&NS(e,r,t[r]);if(Hf)for(var r of Hf(t))ZT.call(t,r)&&NS(e,r,t[r]);return e},qq=(e,t)=>{var r={};for(var n in e)JT.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&&ZT.call(e,n)&&(r[n]=e[n]);return r};const Qq={opacity:.6,color:"#000",zIndex:Cn("modal"),radius:0},eI=f.forwardRef((e,t)=>{const r=H("Overlay",Qq,e),{variant:n,opacity:o,color:i,blur:a,gradient:l,zIndex:c,radius:u,children:d,className:p,classNames:h,styles:m,unstyled:v,center:g,fixed:b}=r,y=qq(r,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:x,cx:_}=Wq({color:i,opacity:o,blur:a,radius:u,gradient:l,fixed:b,zIndex:c},{name:"Overlay",classNames:h,styles:m,unstyled:v,variant:n});return S.createElement(oe,Gq({ref:t,className:_(x.root,p),"data-center":g||void 0},y),d)});eI.displayName="@mantine/core/Overlay";const tI=eI;var Kq=Object.defineProperty,Yq=Object.defineProperties,Xq=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertySymbols,rI=Object.prototype.hasOwnProperty,nI=Object.prototype.propertyIsEnumerable,AS=(e,t,r)=>t in e?Kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tl=(e,t)=>{for(var r in t||(t={}))rI.call(t,r)&&AS(e,r,t[r]);if(Gf)for(var r of Gf(t))nI.call(t,r)&&AS(e,r,t[r]);return e},Jq=(e,t)=>Yq(e,Xq(t)),Zq=(e,t)=>{var r={};for(var n in e)rI.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&&nI.call(e,n)&&(r[n]=e[n]);return r};const eQ={},tQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Overlay`,eQ,e),{onClick:o,transitionProps:i,style:a,className:l}=n,c=Zq(n,["onClick","transitionProps","style","className"]),{classes:u,cx:d}=Nq(null,r.stylesApi),p=h=>{o==null||o(h),r.closeOnClickOutside&&r.onClose()};return S.createElement(pa,Jq(tl(tl({mounted:r.opened},r.transitionProps),i),{transition:"fade"}),h=>S.createElement(tI,tl({ref:t,onClick:p,fixed:!0,style:tl(tl({},a),h),className:d(u.overlay,l),zIndex:r.zIndex},c)))});var rQ=W((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const nQ=rQ;var oQ=Object.defineProperty,qf=Object.getOwnPropertySymbols,oI=Object.prototype.hasOwnProperty,iI=Object.prototype.propertyIsEnumerable,MS=(e,t,r)=>t in e?oQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rl=(e,t)=>{for(var r in t||(t={}))oI.call(t,r)&&MS(e,r,t[r]);if(qf)for(var r of qf(t))iI.call(t,r)&&MS(e,r,t[r]);return e},iQ=(e,t)=>{var r={};for(var n in e)oI.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&&iI.call(e,n)&&(r[n]=e[n]);return r};const aQ={},sQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Content`,aQ,e),{className:o,transitionProps:i,style:a,onKeyDown:l}=n,c=iQ(n,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:d}=nQ({zIndex:r.zIndex},r.stylesApi),p=h=>{var m;((m=h.target)==null?void 0:m.getAttribute("data-mantine-stop-propagation"))!=="true"&&h.key==="Escape"&&r.closeOnEscape&&r.onClose(),l==null||l(h)};return S.createElement(pa,rl(rl({mounted:r.opened,transition:"pop"},r.transitionProps),i),h=>S.createElement("div",{className:d(u.inner)},S.createElement(B0,{active:r.opened&&r.trapFocus},S.createElement(on,rl({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:rl(rl({},a),h),shadow:r.shadow},c),c.children))))});var lQ=W((e,{padding:t})=>{const r=A({size:t,sizes:e.spacing});return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:r,paddingRight:`calc(${r} - ${j(5)})`,position:"sticky",top:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1e3}}});const cQ=lQ;var uQ=Object.defineProperty,Qf=Object.getOwnPropertySymbols,aI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,LS=(e,t,r)=>t in e?uQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dQ=(e,t)=>{for(var r in t||(t={}))aI.call(t,r)&&LS(e,r,t[r]);if(Qf)for(var r of Qf(t))sI.call(t,r)&&LS(e,r,t[r]);return e},fQ=(e,t)=>{var r={};for(var n in e)aI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qf)for(var n of Qf(e))t.indexOf(n)<0&&sI.call(e,n)&&(r[n]=e[n]);return r};const pQ={},hQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Header`,pQ,e),{className:o}=n,i=fQ(n,["className"]),{classes:a,cx:l}=cQ({padding:r.padding},r.stylesApi);return S.createElement(oe,dQ({ref:t,className:l(a.header,o)},i))});var mQ=W(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const gQ=mQ;var vQ=Object.defineProperty,Kf=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,cI=Object.prototype.propertyIsEnumerable,zS=(e,t,r)=>t in e?vQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yQ=(e,t)=>{for(var r in t||(t={}))lI.call(t,r)&&zS(e,r,t[r]);if(Kf)for(var r of Kf(t))cI.call(t,r)&&zS(e,r,t[r]);return e},xQ=(e,t)=>{var r={};for(var n in e)lI.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&&cI.call(e,n)&&(r[n]=e[n]);return r};const wQ={},_Q=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Title`,wQ,e),{className:o}=n,i=xQ(n,["className"]),{classes:a,cx:l}=gQ(null,r.stylesApi);return f.useEffect(()=>(r.setTitleMounted(!0),()=>r.setTitleMounted(!1)),[]),S.createElement(oe,yQ({component:"h2",id:r.getTitleId(),className:l(a.title,o),ref:t},i))});var bQ=W((e,{padding:t})=>({body:{padding:A({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const SQ=bQ;var PQ=Object.defineProperty,Yf=Object.getOwnPropertySymbols,uI=Object.prototype.hasOwnProperty,dI=Object.prototype.propertyIsEnumerable,FS=(e,t,r)=>t in e?PQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jQ=(e,t)=>{for(var r in t||(t={}))uI.call(t,r)&&FS(e,r,t[r]);if(Yf)for(var r of Yf(t))dI.call(t,r)&&FS(e,r,t[r]);return e},OQ=(e,t)=>{var r={};for(var n in e)uI.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&&dI.call(e,n)&&(r[n]=e[n]);return r};const CQ={},EQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Body`,CQ,e),{className:o}=n,i=OQ(n,["className"]),{classes:a,cx:l}=SQ({padding:r.padding},r.stylesApi);return f.useEffect(()=>(r.setBodyMounted(!0),()=>r.setBodyMounted(!1)),[]),S.createElement(oe,jQ({id:r.getBodyId(),className:l(a.body,o),ref:t},i))});function $Q({children:e}){return S.createElement(S.Fragment,null,e)}function kQ({opened:e,transitionDuration:t}){const[r,n]=f.useState(e),o=f.useRef(),a=Rh()?0:t;return f.useEffect(()=>(e?(n(!0),window.clearTimeout(o.current)):a===0?n(!1):o.current=window.setTimeout(()=>n(!1),a),()=>window.clearTimeout(o.current)),[e,a]),r}var RQ=W(()=>({root:{}}));const TQ=RQ;var IQ=Object.defineProperty,DQ=Object.defineProperties,NQ=Object.getOwnPropertyDescriptors,Xf=Object.getOwnPropertySymbols,fI=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,VS=(e,t,r)=>t in e?IQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mg=(e,t)=>{for(var r in t||(t={}))fI.call(t,r)&&VS(e,r,t[r]);if(Xf)for(var r of Xf(t))pI.call(t,r)&&VS(e,r,t[r]);return e},BS=(e,t)=>DQ(e,NQ(t)),AQ=(e,t)=>{var r={};for(var n in e)fI.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&&pI.call(e,n)&&(r[n]=e[n]);return r};const K0={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Cn("modal"),padding:"md",size:"md",shadow:"xl"};function kt(e){const t=H("ModalBase",K0,e),{opened:r,onClose:n,children:o,closeOnClickOutside:i,__staticSelector:a,transitionProps:l,withinPortal:c,portalProps:u,keepMounted:d,target:p,zIndex:h,lockScroll:m,trapFocus:v,closeOnEscape:g,returnFocus:b,padding:y,shadow:x,id:_,size:w,variant:O,classNames:C,unstyled:P,styles:E,className:k}=t,$=AQ(t,["opened","onClose","children","closeOnClickOutside","__staticSelector","transitionProps","withinPortal","portalProps","keepMounted","target","zIndex","lockScroll","trapFocus","closeOnEscape","returnFocus","padding","shadow","id","size","variant","classNames","unstyled","styles","className"]),{classes:I,cx:T}=TQ(null,{name:a,classNames:C,styles:E,unstyled:P,variant:O,size:w}),z=Rr(_),[M,L]=f.useState(!1),[q,Y]=f.useState(!1),R=typeof(l==null?void 0:l.duration)=="number"?l==null?void 0:l.duration:200,N=kQ({opened:r,transitionDuration:R});return qg("keydown",V=>{!v&&V.key==="Escape"&&g&&n()}),EE({opened:r,shouldReturnFocus:v&&b}),S.createElement(Rs,BS(mg({},u),{withinPortal:c,target:p}),S.createElement(Oq,{value:{__staticSelector:a,opened:r,onClose:n,closeOnClickOutside:i,transitionProps:BS(mg({},l),{duration:R,keepMounted:d}),zIndex:h,padding:y,id:z,getTitleId:()=>`${z}-title`,getBodyId:()=>`${z}-body`,titleMounted:M,bodyMounted:q,setTitleMounted:L,setBodyMounted:Y,trapFocus:v,closeOnEscape:g,shadow:x,stylesApi:{name:a,size:w,variant:O,classNames:C,styles:E,unstyled:P}}},S.createElement(NA,{enabled:N&&m},S.createElement(oe,mg({className:T(I.root,k)},$),o))))}kt.CloseButton=Iq;kt.Overlay=tQ;kt.Content=sQ;kt.Header=hQ;kt.Title=_Q;kt.Body=EQ;kt.NativeScrollArea=$Q;const MQ={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var LQ=Object.defineProperty,zQ=Object.defineProperties,FQ=Object.getOwnPropertyDescriptors,Jf=Object.getOwnPropertySymbols,hI=Object.prototype.hasOwnProperty,mI=Object.prototype.propertyIsEnumerable,US=(e,t,r)=>t in e?LQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VQ=(e,t)=>{for(var r in t||(t={}))hI.call(t,r)&&US(e,r,t[r]);if(Jf)for(var r of Jf(t))mI.call(t,r)&&US(e,r,t[r]);return e},BQ=(e,t)=>zQ(e,FQ(t)),UQ=(e,t)=>{var r={};for(var n in e)hI.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 WQ={},Zf=f.forwardRef((e,t)=>{const r=H("Flex",WQ,e),{gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u,sx:d}=r,p=UQ(r,["gap","rowGap","columnGap","align","justify","wrap","direction","sx"]);return S.createElement(oe,BQ(VQ({},p),{sx:[{display:"flex"},h=>Qg({gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u},h,MQ),...dc(d)],ref:t}))});Zf.displayName="@mantine/core/Flex";const[HQ,GQ]=ko("Grid component was not found in tree");var qQ=Object.defineProperty,WS=Object.getOwnPropertySymbols,QQ=Object.prototype.hasOwnProperty,KQ=Object.prototype.propertyIsEnumerable,HS=(e,t,r)=>t in e?qQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YQ=(e,t)=>{for(var r in t||(t={}))QQ.call(t,r)&&HS(e,r,t[r]);if(WS)for(var r of WS(t))KQ.call(t,r)&&HS(e,r,t[r]);return e};const Y0=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,gI=(e,t,r)=>r||e==="auto"||e==="content"?"unset":Y0(e,t),vI=(e,t)=>{if(e)return e==="auto"||t?1:0},yI=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0,xI=(e,t)=>typeof e<"u"?`calc(${A({size:e,sizes:t.spacing})} / 2)`:void 0;function XQ({sizes:e,offsets:t,orders:r,theme:n,columns:o,gutters:i,grow:a}){return aE.reduce((l,c)=>(l[`@media (min-width: ${ir(n.breakpoints[c])})`]={order:r[c],flexBasis:Y0(e[c],o),padding:xI(i[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:gI(e[c],o,a),marginLeft:yI(t[c],o),flexGrow:vI(e[c],a)},l),{})}var JQ=W((e,{gutter:t,gutterXs:r,gutterSm:n,gutterMd:o,gutterLg:i,gutterXl:a,grow:l,offset:c,offsetXs:u,offsetSm:d,offsetMd:p,offsetLg:h,offsetXl:m,columns:v,span:g,xs:b,sm:y,md:x,lg:_,xl:w,order:O,orderXs:C,orderSm:P,orderMd:E,orderLg:k,orderXl:$})=>({col:YQ({boxSizing:"border-box",flexGrow:vI(g,l),order:O,padding:xI(t,e),marginLeft:yI(c,v),flexBasis:Y0(g,v),flexShrink:0,width:g==="content"?"auto":void 0,maxWidth:gI(g,v,l)},XQ({sizes:{xs:b,sm:y,md:x,lg:_,xl:w},offsets:{xs:u,sm:d,md:p,lg:h,xl:m},orders:{xs:C,sm:P,md:E,lg:k,xl:$},gutters:{xs:r,sm:n,md:o,lg:i,xl:a},theme:e,columns:v,grow:l}))}));const ZQ=JQ;var eK=Object.defineProperty,ep=Object.getOwnPropertySymbols,wI=Object.prototype.hasOwnProperty,_I=Object.prototype.propertyIsEnumerable,GS=(e,t,r)=>t in e?eK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tK=(e,t)=>{for(var r in t||(t={}))wI.call(t,r)&&GS(e,r,t[r]);if(ep)for(var r of ep(t))_I.call(t,r)&&GS(e,r,t[r]);return e},rK=(e,t)=>{var r={};for(var n in e)wI.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&&_I.call(e,n)&&(r[n]=e[n]);return r};const nK={};function oK(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const bI=f.forwardRef((e,t)=>{const r=H("GridCol",nK,e),{children:n,span:o,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:b,orderXs:y,orderSm:x,orderMd:_,orderLg:w,orderXl:O,className:C,unstyled:P,variant:E}=r,k=rK(r,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","unstyled","variant"]),$=GQ(),I=o||$.columns,{classes:T,cx:z}=ZQ({gutter:$.gutter,gutterXs:$.gutterXs,gutterSm:$.gutterSm,gutterMd:$.gutterMd,gutterLg:$.gutterLg,gutterXl:$.gutterXl,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:b,orderXs:y,orderSm:x,orderMd:_,orderLg:w,orderXl:O,grow:$.grow,columns:$.columns,span:I},{unstyled:P,name:"Grid",variant:E});return!oK(I)||I>$.columns?null:S.createElement(oe,tK({className:z(T.col,C),ref:t},k),n)});bI.displayName="@mantine/core/Col";var iK=Object.defineProperty,qS=Object.getOwnPropertySymbols,aK=Object.prototype.hasOwnProperty,sK=Object.prototype.propertyIsEnumerable,QS=(e,t,r)=>t in e?iK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lK=(e,t)=>{for(var r in t||(t={}))aK.call(t,r)&&QS(e,r,t[r]);if(qS)for(var r of qS(t))sK.call(t,r)&&QS(e,r,t[r]);return e};function cK(e,t){return aE.reduce((r,n)=>(typeof e[n]<"u"&&(r[`@media (min-width: ${t.breakpoints[n]})`]={margin:`calc(-${A({size:e[n],sizes:t.spacing})} / 2)`}),r),{})}var uK=W((e,{justify:t,align:r,gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c})=>({root:lK({margin:`calc(-${A({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:r},cK({xs:o,sm:i,md:a,lg:l,xl:c},e))}));const dK=uK;var fK=Object.defineProperty,tp=Object.getOwnPropertySymbols,SI=Object.prototype.hasOwnProperty,PI=Object.prototype.propertyIsEnumerable,KS=(e,t,r)=>t in e?fK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pK=(e,t)=>{for(var r in t||(t={}))SI.call(t,r)&&KS(e,r,t[r]);if(tp)for(var r of tp(t))PI.call(t,r)&&KS(e,r,t[r]);return e},hK=(e,t)=>{var r={};for(var n in e)SI.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&&PI.call(e,n)&&(r[n]=e[n]);return r};const mK={gutter:"md",justify:"flex-start",align:"stretch",columns:12},tn=f.forwardRef((e,t)=>{const r=H("Grid",mK,e),{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,children:u,grow:d,justify:p,align:h,columns:m,className:v,unstyled:g,variant:b}=r,y=hK(r,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","unstyled","variant"]),{classes:x,cx:_}=dK({gutter:n,justify:p,align:h,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c},{unstyled:g,name:"Grid",variant:b});return S.createElement(HQ,{value:{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,grow:d,columns:m}},S.createElement(oe,pK({className:_(x.root,v),ref:t},y),u))});tn.Col=bI;tn.displayName="@mantine/core/Grid";function gK(e){return f.Children.toArray(e).filter(Boolean)}const jI={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var vK=W((e,{spacing:t,position:r,noWrap:n,grow:o,align:i,count:a})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:n?"nowrap":"wrap",justifyContent:jI[r],gap:A({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/a}% - (${j(A({size:t,sizes:e.spacing}))} - ${A({size:t,sizes:e.spacing})} / ${a}))`:void 0,flexGrow:o?1:0}}}));const yK=vK;var xK=Object.defineProperty,rp=Object.getOwnPropertySymbols,OI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,YS=(e,t,r)=>t in e?xK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wK=(e,t)=>{for(var r in t||(t={}))OI.call(t,r)&&YS(e,r,t[r]);if(rp)for(var r of rp(t))CI.call(t,r)&&YS(e,r,t[r]);return e},_K=(e,t)=>{var r={};for(var n in e)OI.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&&CI.call(e,n)&&(r[n]=e[n]);return r};const bK={position:"left",spacing:"md"},K=f.forwardRef((e,t)=>{const r=H("Group",bK,e),{className:n,position:o,align:i,children:a,noWrap:l,grow:c,spacing:u,unstyled:d,variant:p}=r,h=_K(r,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),m=gK(a),{classes:v,cx:g}=yK({align:i,grow:c,noWrap:l,spacing:u,position:o,count:m.length},{unstyled:d,name:"Group",variant:p});return S.createElement(oe,wK({className:g(v.root,n),ref:t},h),m)});K.displayName="@mantine/core/Group";function SK({open:e,close:t,openDelay:r,closeDelay:n}){const o=f.useRef(-1),i=f.useRef(-1),a=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{a(),r===0?e():o.current=window.setTimeout(e,r)},c=()=>{a(),n===0?t():i.current=window.setTimeout(t,n)};return f.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:c}}function XS(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var PK=W((e,t,{size:r})=>({input:{fontFamily:e.fontFamilyMonospace,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${j(2)})`}}));const jK=PK;function X0(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var OK=f.useLayoutEffect,CK=function(t){var r=f.useRef(t);return OK(function(){r.current=t}),r},JS=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},EK=function(t,r){var n=f.useRef();return f.useCallback(function(o){t.current=o,n.current&&JS(n.current,null),n.current=r,r&&JS(r,o)},[r])},ZS={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},eP=function(t){Object.keys(ZS).forEach(function(r){t.style.setProperty(r,ZS[r],"important")})},Nr=null,$K=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function kK(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Nr||(Nr=document.createElement("textarea"),Nr.setAttribute("tabindex","-1"),Nr.setAttribute("aria-hidden","true"),eP(Nr)),Nr.parentNode===null&&document.body.appendChild(Nr);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;Nr.style[m]=a[m]}),eP(Nr),Nr.value=t;var c=$K(Nr,e);Nr.value="x";var u=Nr.scrollHeight-o,d=u*r;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var p=u*n;return l==="border-box"&&(p=p+o+i),c=Math.min(p,c),[c,u]}var tP=function(){},RK=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},TK=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],IK=!!document.documentElement.currentStyle,DK=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=RK(TK,r),o=n.boxSizing;if(o==="")return null;IK&&o==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var i=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:i,borderSize:a}},NK=function(t){var r=CK(t);f.useLayoutEffect(function(){var n=function(i){r.current(i)};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}},[])},AK=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?tP:a,c=t.onHeightChange,u=c===void 0?tP:c,d=X0(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),p=d.value!==void 0,h=f.useRef(null),m=EK(h,r),v=f.useRef(0),g=f.useRef(),b=function(){var _=h.current,w=n&&g.current?g.current:DK(_);if(w){g.current=w;var O=kK(w,_.value||_.placeholder||"x",i,o),C=O[0],P=O[1];v.current!==C&&(v.current=C,_.style.setProperty("height",C+"px","important"),u(C,{rowHeight:P}))}},y=function(_){p||b(),l(_)};return f.useLayoutEffect(b),NK(b),f.createElement("textarea",rt({},d,{onChange:y,ref:m}))},MK=f.forwardRef(AK);const LK=MK;var zK=W(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const FK=zK;var VK=Object.defineProperty,BK=Object.defineProperties,UK=Object.getOwnPropertyDescriptors,np=Object.getOwnPropertySymbols,EI=Object.prototype.hasOwnProperty,$I=Object.prototype.propertyIsEnumerable,rP=(e,t,r)=>t in e?VK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ea=(e,t)=>{for(var r in t||(t={}))EI.call(t,r)&&rP(e,r,t[r]);if(np)for(var r of np(t))$I.call(t,r)&&rP(e,r,t[r]);return e},gg=(e,t)=>BK(e,UK(t)),WK=(e,t)=>{var r={};for(var n in e)EI.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&&$I.call(e,n)&&(r[n]=e[n]);return r};const HK={autosize:!1,size:"sm",__staticSelector:"Textarea"},jc=f.forwardRef((e,t)=>{const r=H("Textarea",HK,e),{autosize:n,maxRows:o,minRows:i,label:a,error:l,description:c,id:u,className:d,required:p,style:h,wrapperProps:m,classNames:v,styles:g,size:b,__staticSelector:y,sx:x,errorProps:_,descriptionProps:w,labelProps:O,inputWrapperOrder:C,inputContainer:P,unstyled:E,withAsterisk:k,variant:$}=r,I=WK(r,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk","variant"]),T=Rr(u),{classes:z,cx:M}=FK(),{systemStyles:L,rest:q}=eo(I),Y=Ea({required:p,ref:t,error:l,id:T,classNames:gg(Ea({},v),{input:M(z.input,v==null?void 0:v.input)}),styles:g,__staticSelector:y,size:b,multiline:!0,unstyled:E,variant:$},q);return S.createElement(Ut.Wrapper,Ea(Ea({label:a,error:l,id:T,description:c,required:p,style:h,className:d,classNames:v,styles:g,size:b,__staticSelector:y,sx:x,errorProps:_,labelProps:O,descriptionProps:w,inputContainer:P,inputWrapperOrder:C,unstyled:E,withAsterisk:k,variant:$},L),m),n?S.createElement(Ut,gg(Ea({},Y),{component:LK,maxRows:o,minRows:i})):S.createElement(Ut,gg(Ea({},Y),{component:"textarea",rows:i})))});jc.displayName="@mantine/core/Textarea";var GK=Object.defineProperty,qK=Object.defineProperties,QK=Object.getOwnPropertyDescriptors,op=Object.getOwnPropertySymbols,kI=Object.prototype.hasOwnProperty,RI=Object.prototype.propertyIsEnumerable,nP=(e,t,r)=>t in e?GK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oP=(e,t)=>{for(var r in t||(t={}))kI.call(t,r)&&nP(e,r,t[r]);if(op)for(var r of op(t))RI.call(t,r)&&nP(e,r,t[r]);return e},KK=(e,t)=>qK(e,QK(t)),YK=(e,t)=>{var r={};for(var n in e)kI.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&&RI.call(e,n)&&(r[n]=e[n]);return r};const XK={formatOnBlur:!1,size:"sm",serialize:JSON.stringify,deserialize:JSON.parse},Ds=f.forwardRef((e,t)=>{const r=H("JsonInput",XK,e),{value:n,defaultValue:o,onChange:i,onFocus:a,onBlur:l,error:c,formatOnBlur:u,size:d,validationError:p,classNames:h,unstyled:m,readOnly:v,variant:g,serialize:b,deserialize:y}=r,x=YK(r,["value","defaultValue","onChange","onFocus","onBlur","error","formatOnBlur","size","validationError","classNames","unstyled","readOnly","variant","serialize","deserialize"]),{classes:_,cx:w}=jK(null,{name:"JsonInput",unstyled:m,size:d,variant:g}),[O,C]=$r({value:n,defaultValue:o,finalValue:"",onChange:i}),[P,E]=f.useState(XS(O,y)),k=I=>{typeof a=="function"&&a(I),E(!0)},$=I=>{typeof l=="function"&&l(I);const T=XS(I.currentTarget.value,y);u&&!v&&T&&I.currentTarget.value.trim()!==""&&C(b(y(I.currentTarget.value),null,2)),E(T)};return S.createElement(jc,oP({value:O,onChange:I=>C(I.currentTarget.value),onFocus:k,onBlur:$,error:P?c:p||!0,__staticSelector:"JsonInput",classNames:KK(oP({},h),{input:w(_.input,h==null?void 0:h.input)}),autoComplete:"off",ref:t,unstyled:m,readOnly:v,size:d,variant:g},x))});Ds.displayName="@mantine/core/JsonInput";const[JK,ZK]=ko("List component was not found in tree");var eY=W((e,{spacing:t,center:r})=>({itemWrapper:{ref:Vt("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:r?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:A({size:t,sizes:e.spacing})},"&[data-with-icon]":{listStyle:"none",[`& .${Vt("itemWrapper")}`]:{display:"inline-flex",alignItems:r?"center":"flex-start",flexDirection:"row"}}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}}));const tY=eY;var rY=Object.defineProperty,ip=Object.getOwnPropertySymbols,TI=Object.prototype.hasOwnProperty,II=Object.prototype.propertyIsEnumerable,iP=(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={}))TI.call(t,r)&&iP(e,r,t[r]);if(ip)for(var r of ip(t))II.call(t,r)&&iP(e,r,t[r]);return e},oY=(e,t)=>{var r={};for(var n in e)TI.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&&II.call(e,n)&&(r[n]=e[n]);return r};const iY={},DI=f.forwardRef((e,t)=>{const r=H("ListItem",iY,e),{className:n,children:o,icon:i}=r,a=oY(r,["className","children","icon"]),{icon:l,spacing:c,center:u,listStyleType:d,size:p,withPadding:h,classNames:m,styles:v,unstyled:g,variant:b}=ZK(),y=i||l,{classes:x,cx:_}=tY({withPadding:h,listStyleType:d,center:u,spacing:c},{classNames:m,styles:v,unstyled:g,name:"List",variant:b,size:p});return S.createElement(oe,nY({component:"li",className:_(x.item,n),"data-with-icon":!!y||void 0,ref:t},a),S.createElement("div",{className:x.itemWrapper},y&&S.createElement("span",{className:x.itemIcon},y),S.createElement("span",null,o)))});DI.displayName="@mantine/core/ListItem";var aY=Object.defineProperty,sY=Object.defineProperties,lY=Object.getOwnPropertyDescriptors,aP=Object.getOwnPropertySymbols,cY=Object.prototype.hasOwnProperty,uY=Object.prototype.propertyIsEnumerable,sP=(e,t,r)=>t in e?aY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dY=(e,t)=>{for(var r in t||(t={}))cY.call(t,r)&&sP(e,r,t[r]);if(aP)for(var r of aP(t))uY.call(t,r)&&sP(e,r,t[r]);return e},fY=(e,t)=>sY(e,lY(t)),pY=W((e,{withPadding:t,listStyleType:r},{size:n})=>({root:fY(dY({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const hY=pY;var mY=Object.defineProperty,ap=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,AI=Object.prototype.propertyIsEnumerable,lP=(e,t,r)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gY=(e,t)=>{for(var r in t||(t={}))NI.call(t,r)&&lP(e,r,t[r]);if(ap)for(var r of ap(t))AI.call(t,r)&&lP(e,r,t[r]);return e},vY=(e,t)=>{var r={};for(var n in e)NI.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&&AI.call(e,n)&&(r[n]=e[n]);return r};const yY={type:"unordered",size:"md",spacing:0},Pr=f.forwardRef((e,t)=>{const r=H("List",yY,e),{children:n,type:o,size:i,listStyleType:a,withPadding:l,center:c,spacing:u,icon:d,className:p,styles:h,classNames:m,unstyled:v,variant:g}=r,b=vY(r,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:y,cx:x}=hY({withPadding:l,listStyleType:a,center:c,spacing:u},{classNames:m,styles:h,name:"List",unstyled:v,size:i,variant:g});return S.createElement(JK,{value:{spacing:u,center:c,icon:d,listStyleType:a,size:i,withPadding:l,classNames:m,styles:h,unstyled:v,variant:g}},S.createElement(oe,gY({component:o==="unordered"?"ul":"ol",className:x(y.root,p),ref:t},b),n))});Pr.Item=DI;Pr.displayName="@mantine/core/List";var xY=Object.defineProperty,wY=Object.defineProperties,_Y=Object.getOwnPropertyDescriptors,cP=Object.getOwnPropertySymbols,bY=Object.prototype.hasOwnProperty,SY=Object.prototype.propertyIsEnumerable,uP=(e,t,r)=>t in e?xY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PY=(e,t)=>{for(var r in t||(t={}))bY.call(t,r)&&uP(e,r,t[r]);if(cP)for(var r of cP(t))SY.call(t,r)&&uP(e,r,t[r]);return e},jY=(e,t)=>wY(e,_Y(t)),OY=W(e=>({root:jY(PY({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const CY=OY;var EY=Object.defineProperty,$Y=Object.defineProperties,kY=Object.getOwnPropertyDescriptors,sp=Object.getOwnPropertySymbols,MI=Object.prototype.hasOwnProperty,LI=Object.prototype.propertyIsEnumerable,dP=(e,t,r)=>t in e?EY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ku=(e,t)=>{for(var r in t||(t={}))MI.call(t,r)&&dP(e,r,t[r]);if(sp)for(var r of sp(t))LI.call(t,r)&&dP(e,r,t[r]);return e},RY=(e,t)=>$Y(e,kY(t)),TY=(e,t)=>{var r={};for(var n in e)MI.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&&LI.call(e,n)&&(r[n]=e[n]);return r};const IY={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:Cn("overlay")},zI=f.forwardRef((e,t)=>{const r=H("LoadingOverlay",IY,e),{className:n,visible:o,loaderProps:i,overlayOpacity:a,overlayColor:l,transitionDuration:c,exitTransitionDuration:u,zIndex:d,style:p,loader:h,radius:m,overlayBlur:v,unstyled:g,variant:b,keepMounted:y}=r,x=TY(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:_,cx:w,theme:O}=CY(null,{name:"LoadingOverlay",unstyled:g,variant:b}),C=`calc(${d} + 1)`;return S.createElement(pa,{keepMounted:y,duration:c,exitDuration:u,mounted:o,transition:"fade"},P=>S.createElement(oe,ku({className:w(_.root,n),style:RY(ku(ku({},P),p),{zIndex:d}),ref:t},x),h?S.createElement("div",{style:{zIndex:C}},h):S.createElement(cn,ku({style:{zIndex:C}},i)),S.createElement(tI,{opacity:a,zIndex:d,radius:m,blur:v,unstyled:g,color:l||(O.colorScheme==="dark"?O.colors.dark[5]:O.white)})))});zI.displayName="@mantine/core/LoadingOverlay";const FI={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[DY,Oc]=ko(FI.context);var NY=W(e=>({divider:{marginTop:j(4),marginBottom:j(4),borderTop:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const AY=NY;var MY=Object.defineProperty,lp=Object.getOwnPropertySymbols,VI=Object.prototype.hasOwnProperty,BI=Object.prototype.propertyIsEnumerable,fP=(e,t,r)=>t in e?MY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LY=(e,t)=>{for(var r in t||(t={}))VI.call(t,r)&&fP(e,r,t[r]);if(lp)for(var r of lp(t))BI.call(t,r)&&fP(e,r,t[r]);return e},zY=(e,t)=>{var r={};for(var n in e)VI.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&&BI.call(e,n)&&(r[n]=e[n]);return r};const FY={},UI=f.forwardRef((e,t)=>{const r=H("MenuDivider",FY,e),{children:n,className:o}=r,i=zY(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Oc(),{classes:d,cx:p}=AY(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(oe,LY({className:p(d.divider,o),ref:t},i))});UI.displayName="@mantine/core/MenuDivider";var VY=Object.defineProperty,cp=Object.getOwnPropertySymbols,WI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,pP=(e,t,r)=>t in e?VY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,BY=(e,t)=>{for(var r in t||(t={}))WI.call(t,r)&&pP(e,r,t[r]);if(cp)for(var r of cp(t))HI.call(t,r)&&pP(e,r,t[r]);return e},UY=(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 WY={};function GI(e){const t=H("MenuDropdown",WY,e),{children:r,onMouseEnter:n,onMouseLeave:o}=t,i=UY(t,["children","onMouseEnter","onMouseLeave"]),a=f.useRef(),l=Oc(),c=p=>{var h;(p.key==="ArrowUp"||p.key==="ArrowDown")&&(p.preventDefault(),(h=a.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||h.focus())},u=Mr(n,()=>l.trigger==="hover"&&l.openDropdown()),d=Mr(o,()=>l.trigger==="hover"&&l.closeDropdown());return S.createElement(Do.Dropdown,BY({onMouseEnter:u,onMouseLeave:d,role:"menu","aria-orientation":"vertical"},i),S.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:a,style:{outline:0}},r))}GI.displayName="@mantine/core/MenuDropdown";var HY=Object.defineProperty,GY=Object.defineProperties,qY=Object.getOwnPropertyDescriptors,hP=Object.getOwnPropertySymbols,QY=Object.prototype.hasOwnProperty,KY=Object.prototype.propertyIsEnumerable,mP=(e,t,r)=>t in e?HY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YY=(e,t)=>{for(var r in t||(t={}))QY.call(t,r)&&mP(e,r,t[r]);if(hP)for(var r of hP(t))KY.call(t,r)&&mP(e,r,t[r]);return e},XY=(e,t)=>GY(e,qY(t)),JY=W((e,{color:t,radius:r})=>({item:XY(YY({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(r),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const ZY=JY;var eX=Object.defineProperty,tX=Object.defineProperties,rX=Object.getOwnPropertyDescriptors,up=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,gP=(e,t,r)=>t in e?eX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nX=(e,t)=>{for(var r in t||(t={}))qI.call(t,r)&&gP(e,r,t[r]);if(up)for(var r of up(t))QI.call(t,r)&&gP(e,r,t[r]);return e},oX=(e,t)=>tX(e,rX(t)),iX=(e,t)=>{var r={};for(var n in e)qI.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 aX={},KI=f.forwardRef((e,t)=>{const r=H("MenuItem",aX,e),{children:n,className:o,color:i,closeMenuOnClick:a,icon:l,rightSection:c}=r,u=iX(r,["children","className","color","closeMenuOnClick","icon","rightSection"]),d=Oc(),{classes:p,cx:h,theme:m}=ZY({radius:d.radius,color:i},{name:"Menu",classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),v=f.useRef(),g=d.getItemIndex(v.current),b=u,y=Mr(b.onMouseLeave,()=>d.setHovered(-1)),x=Mr(b.onMouseEnter,()=>d.setHovered(d.getItemIndex(v.current))),_=Mr(b.onClick,()=>{typeof a=="boolean"?a&&d.closeDropdownImmediately():d.closeOnItemClick&&d.closeDropdownImmediately()}),w=Mr(b.onFocus,()=>d.setHovered(d.getItemIndex(v.current)));return S.createElement(oe,oX(nX({component:"button",type:"button"},u),{tabIndex:-1,onFocus:w,className:h(p.item,o),ref:Es(v,t),role:"menuitem","data-menu-item":!0,"data-hovered":d.hovered===g?!0:void 0,onMouseEnter:x,onMouseLeave:y,onClick:_,onKeyDown:ZC({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:d.loop,dir:m.dir,orientation:"vertical",onKeyDown:b.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))});KI.displayName="@mantine/core/MenuItem";const sX=KI;var lX=W(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}}));const cX=lX;var uX=Object.defineProperty,dp=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,XI=Object.prototype.propertyIsEnumerable,vP=(e,t,r)=>t in e?uX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dX=(e,t)=>{for(var r in t||(t={}))YI.call(t,r)&&vP(e,r,t[r]);if(dp)for(var r of dp(t))XI.call(t,r)&&vP(e,r,t[r]);return e},fX=(e,t)=>{var r={};for(var n in e)YI.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&&XI.call(e,n)&&(r[n]=e[n]);return r};const pX={},JI=f.forwardRef((e,t)=>{const r=H("MenuLabel",pX,e),{children:n,className:o}=r,i=fX(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Oc(),{classes:d,cx:p}=cX(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(re,dX({className:p(d.label,o),ref:t},i),n)});JI.displayName="@mantine/core/MenuLabel";var hX=Object.defineProperty,fp=Object.getOwnPropertySymbols,ZI=Object.prototype.hasOwnProperty,eD=Object.prototype.propertyIsEnumerable,yP=(e,t,r)=>t in e?hX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mX=(e,t)=>{for(var r in t||(t={}))ZI.call(t,r)&&yP(e,r,t[r]);if(fp)for(var r of fp(t))eD.call(t,r)&&yP(e,r,t[r]);return e},gX=(e,t)=>{var r={};for(var n in e)ZI.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&&eD.call(e,n)&&(r[n]=e[n]);return r};const vX={refProp:"ref"},tD=f.forwardRef((e,t)=>{const r=H("MenuTarget",vX,e),{children:n,refProp:o}=r,i=gX(r,["children","refProp"]);if(!Os(n))throw new Error(FI.children);const a=Oc(),l=Mr(n.props.onClick,()=>a.trigger==="click"&&a.toggleDropdown()),c=Mr(n.props.onMouseEnter,()=>a.trigger==="hover"&&a.openDropdown()),u=Mr(n.props.onMouseLeave,()=>a.trigger==="hover"&&a.closeDropdown());return S.createElement(Do.Target,mX({refProp:o,popupType:"menu",ref:t},i),f.cloneElement(n,{onClick:l,onMouseEnter:c,onMouseLeave:u,"data-expanded":a.opened?!0:void 0}))});tD.displayName="@mantine/core/MenuTarget";var yX=W({dropdown:{padding:j(4)}});const xX=yX;var wX=Object.defineProperty,_X=Object.defineProperties,bX=Object.getOwnPropertyDescriptors,pp=Object.getOwnPropertySymbols,rD=Object.prototype.hasOwnProperty,nD=Object.prototype.propertyIsEnumerable,xP=(e,t,r)=>t in e?wX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wP=(e,t)=>{for(var r in t||(t={}))rD.call(t,r)&&xP(e,r,t[r]);if(pp)for(var r of pp(t))nD.call(t,r)&&xP(e,r,t[r]);return e},_P=(e,t)=>_X(e,bX(t)),SX=(e,t)=>{var r={};for(var n in e)rD.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&&nD.call(e,n)&&(r[n]=e[n]);return r};const PX={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function X(e){const t=H("Menu",PX,e),{children:r,onOpen:n,onClose:o,opened:i,defaultOpened:a,onChange:l,closeOnItemClick:c,loop:u,closeOnEscape:d,trigger:p,openDelay:h,closeDelay:m,classNames:v,styles:g,unstyled:b,radius:y,variant:x}=t,_=SX(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:w,cx:O}=xX(),[C,{setHovered:P,resetHovered:E}]=BA(),[k,$]=$r({value:i,defaultValue:a,finalValue:!1,onChange:l}),I=()=>{$(!1),k&&(o==null||o())},T=()=>{$(!0),!k&&(n==null||n())},z=()=>k?I():T(),{openDropdown:M,closeDropdown:L}=SK({open:T,close:I,closeDelay:m,openDelay:h}),q=Y=>zA("[data-menu-item]","[data-menu-dropdown]",Y);return rn(()=>{E()},[k]),S.createElement(DY,{value:{opened:k,toggleDropdown:z,getItemIndex:q,hovered:C,setHovered:P,closeOnItemClick:c,closeDropdown:p==="click"?I:L,openDropdown:p==="click"?T:M,closeDropdownImmediately:I,loop:u,trigger:p,radius:y,classNames:v,styles:g,unstyled:b,variant:x}},S.createElement(Do,_P(wP({},_),{radius:y,opened:k,onChange:z,defaultOpened:a,trapFocus:p==="click",closeOnEscape:d&&p==="click",__staticSelector:"Menu",classNames:_P(wP({},v),{dropdown:O(w.dropdown,v==null?void 0:v.dropdown)}),styles:g,unstyled:b,variant:x}),r))}X.displayName="@mantine/core/Menu";X.Item=sX;X.Label=JI;X.Dropdown=GI;X.Target=tD;X.Divider=UI;const[jX,OX]=ko("Modal component was not found in tree"),CX={xs:j(320),sm:j(380),md:j(440),lg:j(620),xl:j(780)};var EX=W((e,{yOffset:t,xOffset:r,centered:n,fullScreen:o},{size:i})=>({content:{flex:o?"0 0 100%":`0 0 ${A({size:i,sizes:CX})}`,maxWidth:"100%",maxHeight:o?void 0:`calc(100dvh - (${j(t)} * 2))`,height:o?"100vh":void 0,borderRadius:o?0:void 0,overflowY:"auto"},inner:{paddingTop:o?0:t,paddingBottom:o?0:t,paddingLeft:o?0:r,paddingRight:o?0:r,display:"flex",justifyContent:"center",alignItems:n?"center":"flex-start"}}));const $X=EX;var kX=Object.defineProperty,RX=Object.defineProperties,TX=Object.getOwnPropertyDescriptors,hp=Object.getOwnPropertySymbols,oD=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable,bP=(e,t,r)=>t in e?kX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kv=(e,t)=>{for(var r in t||(t={}))oD.call(t,r)&&bP(e,r,t[r]);if(hp)for(var r of hp(t))iD.call(t,r)&&bP(e,r,t[r]);return e},aD=(e,t)=>RX(e,TX(t)),IX=(e,t)=>{var r={};for(var n in e)oD.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&&iD.call(e,n)&&(r[n]=e[n]);return r};const DX=aD(Kv({},K0),{yOffset:"5dvh",xOffset:"5vw"});function sD(e){const t=H("ModalRoot",DX,e),{classNames:r,variant:n,size:o,yOffset:i,xOffset:a,scrollAreaComponent:l,radius:c,centered:u,fullScreen:d}=t,p=IX(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:h,cx:m}=$X({yOffset:i,xOffset:a,centered:u,fullScreen:d},{name:"Modal",variant:n,size:o});return S.createElement(jX,{value:{yOffset:i,scrollAreaComponent:l,radius:c}},S.createElement(kt,Kv({__staticSelector:"Modal",size:o,variant:n,classNames:aD(Kv({},r),{content:m(h.content,r==null?void 0:r.content),inner:m(h.inner,r==null?void 0:r.inner)})},p)))}var NX=Object.defineProperty,mp=Object.getOwnPropertySymbols,lD=Object.prototype.hasOwnProperty,cD=Object.prototype.propertyIsEnumerable,SP=(e,t,r)=>t in e?NX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AX=(e,t)=>{for(var r in t||(t={}))lD.call(t,r)&&SP(e,r,t[r]);if(mp)for(var r of mp(t))cD.call(t,r)&&SP(e,r,t[r]);return e},MX=(e,t)=>{var r={};for(var n in e)lD.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&&cD.call(e,n)&&(r[n]=e[n]);return r};const LX={shadow:"xl"},uD=f.forwardRef((e,t)=>{const r=H("ModalContent",LX,e),{children:n,scrollAreaComponent:o}=r,i=MX(r,["children","scrollAreaComponent"]),a=OX(),l=o||a.scrollAreaComponent||kt.NativeScrollArea;return S.createElement(kt.Content,AX({ref:t,radius:a.radius},i),S.createElement(l,{style:{maxHeight:`calc(100dvh - (${j(a.yOffset)} * 2))`}},n))});var zX=Object.defineProperty,FX=Object.defineProperties,VX=Object.getOwnPropertyDescriptors,gp=Object.getOwnPropertySymbols,dD=Object.prototype.hasOwnProperty,fD=Object.prototype.propertyIsEnumerable,PP=(e,t,r)=>t in e?zX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ud=(e,t)=>{for(var r in t||(t={}))dD.call(t,r)&&PP(e,r,t[r]);if(gp)for(var r of gp(t))fD.call(t,r)&&PP(e,r,t[r]);return e},BX=(e,t)=>FX(e,VX(t)),UX=(e,t)=>{var r={};for(var n in e)dD.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&&fD.call(e,n)&&(r[n]=e[n]);return r};const WX=BX(ud({},K0),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Tr(e){const t=H("Modal",WX,e),{title:r,withOverlay:n,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l}=t,c=UX(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!r||i;return S.createElement(sD,ud({},c),n&&S.createElement(kt.Overlay,ud({},o)),S.createElement(uD,null,u&&S.createElement(kt.Header,null,r&&S.createElement(kt.Title,null,r),i&&S.createElement(kt.CloseButton,ud({},a))),S.createElement(kt.Body,null,l)))}Tr.Root=sD;Tr.CloseButton=kt.CloseButton;Tr.Overlay=kt.Overlay;Tr.Content=uD;Tr.Header=kt.Header;Tr.Title=kt.Title;Tr.Body=kt.Body;Tr.NativeScrollArea=kt.NativeScrollArea;const pD={xs:j(16),sm:j(22),md:j(26),lg:j(30),xl:j(36)},HX={xs:j(10),sm:j(12),md:j(14),lg:j(16),xl:j(18)};var GX=W((e,{disabled:t,radius:r,readOnly:n},{size:o,variant:i})=>({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]:i==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:A({size:o,sizes:pD}),paddingLeft:`calc(${A({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||n?A({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:A({size:o,sizes:HX}),borderRadius:A({size:r,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${j(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${A({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}})),qX=Object.defineProperty,vp=Object.getOwnPropertySymbols,hD=Object.prototype.hasOwnProperty,mD=Object.prototype.propertyIsEnumerable,jP=(e,t,r)=>t in e?qX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QX=(e,t)=>{for(var r in t||(t={}))hD.call(t,r)&&jP(e,r,t[r]);if(vp)for(var r of vp(t))mD.call(t,r)&&jP(e,r,t[r]);return e},KX=(e,t)=>{var r={};for(var n in e)hD.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&&mD.call(e,n)&&(r[n]=e[n]);return r};const YX={xs:16,sm:22,md:24,lg:26,xl:30};function gD(e){var t=e,{label:r,classNames:n,styles:o,className:i,onRemove:a,disabled:l,readOnly:c,size:u,radius:d="sm",variant:p,unstyled:h}=t,m=KX(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:v,cx:g}=GX({disabled:l,readOnly:c,radius:d},{name:"MultiSelect",classNames:n,styles:o,unstyled:h,size:u,variant:p});return S.createElement("div",QX({className:g(v.defaultValue,i)},m),S.createElement("span",{className:v.defaultValueLabel},r),!l&&!c&&S.createElement(wc,{"aria-hidden":!0,onMouseDown:a,size:YX[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:v.defaultValueRemove,tabIndex:-1,unstyled:h}))}gD.displayName="@mantine/core/MultiSelect/DefaultValue";function XX({data:e,searchable:t,limit:r,searchValue:n,filter:o,value:i,disableSelectedItemFiltering:a}){if(!t&&i.length===0)return e;if(!t){const c=[];for(let u=0;u<e.length;u+=1)(a||!i.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,!a&&i.some(u=>u===e[c].value&&!e[c].disabled),e[c])&&l.push(e[c]),!(l.length>=r));c+=1);return l}var JX=Object.defineProperty,yp=Object.getOwnPropertySymbols,vD=Object.prototype.hasOwnProperty,yD=Object.prototype.propertyIsEnumerable,OP=(e,t,r)=>t in e?JX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CP=(e,t)=>{for(var r in t||(t={}))vD.call(t,r)&&OP(e,r,t[r]);if(yp)for(var r of yp(t))yD.call(t,r)&&OP(e,r,t[r]);return e},ZX=(e,t)=>{var r={};for(var n in e)vD.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&&yD.call(e,n)&&(r[n]=e[n]);return r};const eJ={xs:j(14),sm:j(18),md:j(20),lg:j(24),xl:j(28)};function tJ(e){var t=e,{size:r,error:n,style:o}=t,i=ZX(t,["size","error","style"]);const a=Jt(),l=A({size:r,sizes:eJ});return S.createElement("svg",CP({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:CP({color:n?a.colors.red[6]:a.colors.gray[6],width:l,height:l},o),"data-chevron":!0},i),S.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var rJ=Object.defineProperty,nJ=Object.defineProperties,oJ=Object.getOwnPropertyDescriptors,EP=Object.getOwnPropertySymbols,iJ=Object.prototype.hasOwnProperty,aJ=Object.prototype.propertyIsEnumerable,$P=(e,t,r)=>t in e?rJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sJ=(e,t)=>{for(var r in t||(t={}))iJ.call(t,r)&&$P(e,r,t[r]);if(EP)for(var r of EP(t))aJ.call(t,r)&&$P(e,r,t[r]);return e},lJ=(e,t)=>nJ(e,oJ(t));function xD({shouldClear:e,clearButtonProps:t,onClear:r,size:n,error:o}){return e?S.createElement(wc,lJ(sJ({},t),{variant:"transparent",onClick:r,size:n,onMouseDown:i=>i.preventDefault()})):S.createElement(tJ,{error:o,size:n})}xD.displayName="@mantine/core/SelectRightSection";var cJ=Object.defineProperty,uJ=Object.defineProperties,dJ=Object.getOwnPropertyDescriptors,xp=Object.getOwnPropertySymbols,wD=Object.prototype.hasOwnProperty,_D=Object.prototype.propertyIsEnumerable,kP=(e,t,r)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vg=(e,t)=>{for(var r in t||(t={}))wD.call(t,r)&&kP(e,r,t[r]);if(xp)for(var r of xp(t))_D.call(t,r)&&kP(e,r,t[r]);return e},RP=(e,t)=>uJ(e,dJ(t)),fJ=(e,t)=>{var r={};for(var n in e)wD.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&&_D.call(e,n)&&(r[n]=e[n]);return r};function bD(e){var t=e,{styles:r,rightSection:n,rightSectionWidth:o,theme:i}=t,a=fJ(t,["styles","rightSection","rightSectionWidth","theme"]);if(n)return{rightSection:n,rightSectionWidth:o,styles:r};const l=typeof r=="function"?r(i):r;return{rightSection:!a.readOnly&&!(a.disabled&&a.shouldClear)&&S.createElement(xD,vg({},a)),styles:RP(vg({},l),{rightSection:RP(vg({},l==null?void 0:l.rightSection),{pointerEvents:a.shouldClear?void 0:"none"})})}}var pJ=Object.defineProperty,hJ=Object.defineProperties,mJ=Object.getOwnPropertyDescriptors,TP=Object.getOwnPropertySymbols,gJ=Object.prototype.hasOwnProperty,vJ=Object.prototype.propertyIsEnumerable,IP=(e,t,r)=>t in e?pJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yJ=(e,t)=>{for(var r in t||(t={}))gJ.call(t,r)&&IP(e,r,t[r]);if(TP)for(var r of TP(t))vJ.call(t,r)&&IP(e,r,t[r]);return e},xJ=(e,t)=>hJ(e,mJ(t)),wJ=W((e,{invalid:t},{size:r})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${A({size:r,sizes:Et})} - ${j(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:A({size:r,sizes:Et})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${j(2)}) calc(${e.spacing.xs} / 2)`},searchInput:xJ(yJ({},e.fn.fontStyles()),{flex:1,minWidth:j(60),backgroundColor:"transparent",border:0,outline:0,fontSize:A({size:r,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:A({size:r,sizes:pD}),"&::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 _J=wJ;var bJ=Object.defineProperty,SJ=Object.defineProperties,PJ=Object.getOwnPropertyDescriptors,wp=Object.getOwnPropertySymbols,SD=Object.prototype.hasOwnProperty,PD=Object.prototype.propertyIsEnumerable,DP=(e,t,r)=>t in e?bJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$a=(e,t)=>{for(var r in t||(t={}))SD.call(t,r)&&DP(e,r,t[r]);if(wp)for(var r of wp(t))PD.call(t,r)&&DP(e,r,t[r]);return e},NP=(e,t)=>SJ(e,PJ(t)),jJ=(e,t)=>{var r={};for(var n in e)SD.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&&PD.call(e,n)&&(r[n]=e[n]);return r};function OJ(e,t,r){return t?!1:r.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function CJ(e,t){return!!e&&!t.some(r=>r.value.toLowerCase()===e.toLowerCase())}function AP(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const r=t.map(n=>typeof n=="object"?n.value:n);return e.filter(n=>r.includes(n))}const EJ={size:"sm",valueComponent:gD,itemComponent:Lk,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:OJ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:CJ,switchDirectionOnFlip:!1,zIndex:Cn("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},em=f.forwardRef((e,t)=>{const r=H("MultiSelect",EJ,e),{className:n,style:o,required:i,label:a,description:l,size:c,error:u,classNames:d,styles:p,wrapperProps:h,value:m,defaultValue:v,data:g,onChange:b,valueComponent:y,itemComponent:x,id:_,transitionProps:w,maxDropdownHeight:O,shadow:C,nothingFound:P,onFocus:E,onBlur:k,searchable:$,placeholder:I,filter:T,limit:z,clearSearchOnChange:M,clearable:L,clearSearchOnBlur:q,variant:Y,onSearchChange:R,searchValue:N,disabled:V,initiallyOpened:Q,radius:ee,icon:_e,rightSection:we,rightSectionWidth:Ue,creatable:Ae,getCreateLabel:pt,shouldCreate:Dt,onCreate:Pe,sx:Ht,dropdownComponent:Dr,onDropdownClose:lr,onDropdownOpen:Gt,maxSelectedValues:Nt,withinPortal:ro,portalProps:no,switchDirectionOnFlip:Ye,zIndex:oo,selectOnBlur:$n,name:zt,dropdownPosition:_a,errorProps:Oi,labelProps:io,descriptionProps:J,form:ge,positionDependencies:ze,onKeyDown:ht,unstyled:_t,inputContainer:kn,inputWrapperOrder:Rn,readOnly:vr,withAsterisk:Tn,clearButtonProps:Lo,hoverOnSearchChange:fn,disableSelectedItemFiltering:Ci}=r,zo=jJ(r,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:yr,cx:ao,theme:Ms}=_J({invalid:!!u},{name:"MultiSelect",classNames:d,styles:p,unstyled:_t,size:c,variant:Y}),{systemStyles:D,rest:F}=eo(zo),U=f.useRef(),Z=f.useRef({}),de=Rr(_),[se,fe]=f.useState(Q),[ye,ce]=f.useState(-1),[Be,nt]=f.useState("column"),[be,Me]=$r({value:N,defaultValue:"",finalValue:void 0,onChange:R}),[jt,In]=f.useState(!1),{scrollIntoView:Gr,targetRef:Fo,scrollableRef:Ls}=TL({duration:0,offset:5,cancelable:!1,isList:!0}),qr=Ae&&typeof pt=="function";let Qr=null;const ba=g.map(xe=>typeof xe=="string"?{label:xe,value:xe}:xe),Ei=UA({data:ba}),[Xe,Dn]=$r({value:AP(m,g),defaultValue:AP(v,g),finalValue:[],onChange:b}),Ce=f.useRef(!!Nt&&Nt<Xe.length),xr=xe=>{if(!vr){const Je=Xe.filter(Kr=>Kr!==xe);Dn(Je),Nt&&Je.length<Nt&&(Ce.current=!1)}},Nn=xe=>{Me(xe.currentTarget.value),!V&&!Ce.current&&$&&fe(!0)},mt=xe=>{typeof E=="function"&&E(xe),!V&&!Ce.current&&$&&fe(!0)},gt=XX({data:Ei,searchable:$,searchValue:be,limit:z,filter:T,value:Xe,disableSelectedItemFiltering:Ci});qr&&Dt(be,Ei)&&(Qr=pt(be),gt.push({label:be,value:be,creatable:!0}));const An=Math.min(ye,gt.length-1),Bc=(xe,Je,Kr)=>{let Vo=xe;for(;Kr(Vo);)if(Vo=Je(Vo),!gt[Vo].disabled)return Vo;return xe};rn(()=>{ce(fn&&be?0:-1)},[be,fn]),rn(()=>{!V&&Xe.length>g.length&&fe(!1),Nt&&Xe.length<Nt&&(Ce.current=!1),Nt&&Xe.length>=Nt&&(Ce.current=!0,fe(!1))},[Xe]);const Uc=xe=>{if(!vr)if(M&&Me(""),Xe.includes(xe.value))xr(xe.value);else{if(xe.creatable&&typeof Pe=="function"){const Je=Pe(xe.value);typeof Je<"u"&&Je!==null&&Dn(typeof Je=="string"?[...Xe,Je]:[...Xe,Je.value])}else Dn([...Xe,xe.value]);Xe.length===Nt-1&&(Ce.current=!0,fe(!1)),gt.length===1&&fe(!1)}},E3=xe=>{typeof k=="function"&&k(xe),$n&&gt[An]&&se&&Uc(gt[An]),q&&Me(""),fe(!1)},$3=xe=>{if(jt||(ht==null||ht(xe),vr)||xe.key!=="Backspace"&&Nt&&Ce.current)return;const Je=Be==="column",Kr=()=>{ce($i=>{var so;const zs=Bc($i,ki=>ki+1,ki=>ki<gt.length-1);return se&&(Fo.current=Z.current[(so=gt[zs])==null?void 0:so.value],Gr({alignment:Je?"end":"start"})),zs})},Vo=()=>{ce($i=>{var so;const zs=Bc($i,ki=>ki-1,ki=>ki>0);return se&&(Fo.current=Z.current[(so=gt[zs])==null?void 0:so.value],Gr({alignment:Je?"start":"end"})),zs})};switch(xe.key){case"ArrowUp":{xe.preventDefault(),fe(!0),Je?Vo():Kr();break}case"ArrowDown":{xe.preventDefault(),fe(!0),Je?Kr():Vo();break}case"Enter":{xe.preventDefault(),gt[An]&&se?Uc(gt[An]):fe(!0);break}case" ":{$||(xe.preventDefault(),gt[An]&&se?Uc(gt[An]):fe(!0));break}case"Backspace":{Xe.length>0&&be.length===0&&(Dn(Xe.slice(0,-1)),fe(!0),Nt&&(Ce.current=!1));break}case"Home":{if(!$){xe.preventDefault(),se||fe(!0);const $i=gt.findIndex(so=>!so.disabled);ce($i),Gr({alignment:Je?"end":"start"})}break}case"End":{if(!$){xe.preventDefault(),se||fe(!0);const $i=gt.map(so=>!!so.disabled).lastIndexOf(!1);ce($i),Gr({alignment:Je?"end":"start"})}break}case"Escape":fe(!1)}},k3=Xe.map(xe=>{let Je=Ei.find(Kr=>Kr.value===xe&&!Kr.disabled);return!Je&&qr&&(Je={value:xe,label:xe}),Je}).filter(xe=>!!xe).map((xe,Je)=>S.createElement(y,NP($a({},xe),{variant:Y,disabled:V,className:yr.value,readOnly:vr,onRemove:Kr=>{Kr.preventDefault(),Kr.stopPropagation(),xr(xe.value)},key:xe.value,size:c,styles:p,classNames:d,radius:ee,index:Je}))),R3=xe=>Xe.includes(xe),T3=()=>{var xe;Me(""),Dn([]),(xe=U.current)==null||xe.focus(),Nt&&(Ce.current=!1)},Wc=!vr&&(gt.length>0?se:se&&!!P);return rn(()=>{const xe=Wc?Gt:lr;typeof xe=="function"&&xe()},[Wc]),S.createElement(Ut.Wrapper,$a($a({required:i,id:de,label:a,error:u,description:l,size:c,className:n,style:o,classNames:d,styles:p,__staticSelector:"MultiSelect",sx:Ht,errorProps:Oi,descriptionProps:J,labelProps:io,inputContainer:kn,inputWrapperOrder:Rn,unstyled:_t,withAsterisk:Tn,variant:Y},D),h),S.createElement(Tl,{opened:Wc,transitionProps:w,shadow:"sm",withinPortal:ro,portalProps:no,__staticSelector:"MultiSelect",onDirectionChange:nt,switchDirectionOnFlip:Ye,zIndex:oo,dropdownPosition:_a,positionDependencies:[...ze,be],classNames:d,styles:p,unstyled:_t,variant:Y},S.createElement(Tl.Target,null,S.createElement("div",{className:yr.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":se&&Wc?`${de}-items`:null,"aria-controls":de,"aria-expanded":se,onMouseLeave:()=>ce(-1),tabIndex:-1},S.createElement("input",{type:"hidden",name:zt,value:Xe.join(","),form:ge,disabled:V}),S.createElement(Ut,$a({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:Y,disabled:V,error:u,required:i,radius:ee,icon:_e,unstyled:_t,onMouseDown:xe=>{var Je;xe.preventDefault(),!V&&!Ce.current&&fe(!se),(Je=U.current)==null||Je.focus()},classNames:NP($a({},d),{input:ao({[yr.input]:!$},d==null?void 0:d.input)})},bD({theme:Ms,rightSection:we,rightSectionWidth:Ue,styles:p,size:c,shouldClear:L&&Xe.length>0,onClear:T3,error:u,disabled:V,clearButtonProps:Lo,readOnly:vr})),S.createElement("div",{className:yr.values,"data-clearable":L||void 0},k3,S.createElement("input",$a({ref:Es(t,U),type:"search",id:de,className:ao(yr.searchInput,{[yr.searchInputPointer]:!$,[yr.searchInputInputHidden]:!se&&Xe.length>0||!$&&Xe.length>0,[yr.searchInputEmpty]:Xe.length===0}),onKeyDown:$3,value:be,onChange:Nn,onFocus:mt,onBlur:E3,readOnly:!$||Ce.current||vr,placeholder:Xe.length===0?I:void 0,disabled:V,"data-mantine-stop-propagation":se,autoComplete:"off",onCompositionStart:()=>In(!0),onCompositionEnd:()=>In(!1)},F)))))),S.createElement(Tl.Dropdown,{component:Dr||$0,maxHeight:O,direction:Be,id:de,innerRef:Ls,__staticSelector:"MultiSelect",classNames:d,styles:p},S.createElement(Nk,{data:gt,hovered:An,classNames:d,styles:p,uuid:de,__staticSelector:"MultiSelect",onItemHover:ce,onItemSelect:Uc,itemsRefs:Z,itemComponent:x,size:c,nothingFound:P,isItemSelected:R3,creatable:Ae&&!!Qr,createLabel:Qr,unstyled:_t,variant:Y}))))});em.displayName="@mantine/core/MultiSelect";var $J=Object.defineProperty,kJ=Object.defineProperties,RJ=Object.getOwnPropertyDescriptors,_p=Object.getOwnPropertySymbols,jD=Object.prototype.hasOwnProperty,OD=Object.prototype.propertyIsEnumerable,MP=(e,t,r)=>t in e?$J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ru=(e,t)=>{for(var r in t||(t={}))jD.call(t,r)&&MP(e,r,t[r]);if(_p)for(var r of _p(t))OD.call(t,r)&&MP(e,r,t[r]);return e},LP=(e,t)=>kJ(e,RJ(t)),TJ=(e,t)=>{var r={};for(var n in e)jD.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 IJ={size:"sm"},ft=f.forwardRef((e,t)=>{const r=LR("NativeSelect",IJ,e),{inputProps:n,wrapperProps:o,data:i,onChange:a,value:l,classNames:c,styles:u,rightSection:d,rightSectionWidth:p}=r,h=TJ(r,["inputProps","wrapperProps","data","onChange","value","classNames","styles","rightSection","rightSectionWidth"]),m=Jt(),g=i.map(b=>typeof b=="string"?{label:b,value:b}:b).map(b=>S.createElement("option",{key:b.value,value:b.value,disabled:b.disabled},b.label));return S.createElement(Ut.Wrapper,LP(Ru({},o),{__staticSelector:"NativeSelect"}),S.createElement(Ut,Ru(LP(Ru(Ru({},n),h),{onChange:a,component:"select",ref:t,value:l===null?"":l,__staticSelector:"NativeSelect",pointer:m.cursorType==="pointer"}),bD({theme:m,rightSection:d,rightSectionWidth:p,styles:u,shouldClear:!1,size:n.size,error:o.error,readOnly:!1})),g))});ft.displayName="@mantine/core/NativeSelect";var DJ=W((e,{color:t,radius:r,withTitle:n})=>{const o=e.fn.radius(r),i=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:j(28),height:j(28),borderRadius:j(28),display:"flex",flex:"none",alignItems:"center",justifyContent:"center",backgroundColor:i.background,color:e.white},root:{overflow:"hidden",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",paddingLeft:j(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:j(6),top:o,bottom:o,left:j(4),borderRadius:o,backgroundColor:i.background},"&[data-with-icon]":{paddingLeft:e.spacing.xs,"&::before":{display:"none"}},"&[data-with-border]":{border:`${j(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:j(2),overflow:"hidden",textOverflow:"ellipsis",color:e.colorScheme==="dark"?e.white:e.colors.gray[9]},description:{color:n?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis"}}});const NJ=DJ;var AJ=Object.defineProperty,MJ=Object.defineProperties,LJ=Object.getOwnPropertyDescriptors,bp=Object.getOwnPropertySymbols,CD=Object.prototype.hasOwnProperty,ED=Object.prototype.propertyIsEnumerable,zP=(e,t,r)=>t in e?AJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,FP=(e,t)=>{for(var r in t||(t={}))CD.call(t,r)&&zP(e,r,t[r]);if(bp)for(var r of bp(t))ED.call(t,r)&&zP(e,r,t[r]);return e},zJ=(e,t)=>MJ(e,LJ(t)),FJ=(e,t)=>{var r={};for(var n in e)CD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bp)for(var n of bp(e))t.indexOf(n)<0&&ED.call(e,n)&&(r[n]=e[n]);return r};const VJ={withCloseButton:!0},$D=f.forwardRef((e,t)=>{const r=H("Notification",VJ,e),{className:n,color:o,radius:i,loading:a,withCloseButton:l,withBorder:c,title:u,icon:d,children:p,onClose:h,closeButtonProps:m,classNames:v,styles:g,unstyled:b,variant:y}=r,x=FJ(r,["className","color","radius","loading","withCloseButton","withBorder","title","icon","children","onClose","closeButtonProps","classNames","styles","unstyled","variant"]),{classes:_,cx:w}=NJ({color:o,radius:i,withTitle:!!u},{name:"Notification",classNames:v,styles:g,unstyled:b,variant:y});return S.createElement(oe,FP({className:w(_.root,n),"data-with-icon":!!d||a||void 0,"data-with-border":c||void 0,role:"alert",ref:t},x),d&&!a&&S.createElement("div",{className:_.icon},d),a&&S.createElement(cn,{size:28,color:o,className:_.loader}),S.createElement("div",{className:_.body},u&&S.createElement(re,{className:_.title,size:"sm",weight:500},u),S.createElement(re,{color:"dimmed",className:_.description,size:"sm"},p)),l&&S.createElement(wc,zJ(FP({iconSize:16,color:"gray"},m),{onClick:h,className:_.closeButton})))});$D.displayName="@mantine/core/Notification";var BJ=Object.defineProperty,UJ=Object.defineProperties,WJ=Object.getOwnPropertyDescriptors,Sp=Object.getOwnPropertySymbols,kD=Object.prototype.hasOwnProperty,RD=Object.prototype.propertyIsEnumerable,VP=(e,t,r)=>t in e?BJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yg=(e,t)=>{for(var r in t||(t={}))kD.call(t,r)&&VP(e,r,t[r]);if(Sp)for(var r of Sp(t))RD.call(t,r)&&VP(e,r,t[r]);return e},HJ=(e,t)=>UJ(e,WJ(t)),GJ=(e,t)=>{var r={};for(var n in e)kD.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&&RD.call(e,n)&&(r[n]=e[n]);return r};const qJ={type:"text",size:"sm",__staticSelector:"TextInput"},le=f.forwardRef((e,t)=>{const r=LR("TextInput",qJ,e),{inputProps:n,wrapperProps:o}=r,i=GJ(r,["inputProps","wrapperProps"]);return S.createElement(Ut.Wrapper,yg({},o),S.createElement(Ut,HJ(yg(yg({},n),i),{ref:t})))});le.displayName="@mantine/core/TextInput";const[QJ,tm]=ko("Pagination.Root component was not found in tree"),KJ={siblings:1,boundaries:1};function TD(e){const{total:t,value:r,defaultValue:n,onChange:o,disabled:i,children:a,siblings:l,boundaries:c,color:u,radius:d,onNextPage:p,onPreviousPage:h,onFirstPage:m,onLastPage:v,getItemProps:g,classNames:b,styles:y,unstyled:x,variant:_,size:w}=H("PaginationRoot",KJ,e),{range:O,setPage:C,next:P,previous:E,active:k,first:$,last:I}=OL({page:r,initialPage:n,onChange:o,total:t,siblings:l,boundaries:c}),T=Mr(p,P),z=Mr(h,E),M=Mr(m,$),L=Mr(v,I);return S.createElement(QJ,{value:{total:t,range:O,active:k,disabled:i,color:u,radius:d,getItemProps:g,onChange:C,onNext:T,onPrevious:z,onFirst:M,onLast:L,stylesApi:{name:"Pagination",classNames:b,styles:y,unstyled:x,variant:_,size:w}}},a)}const nc={xs:j(22),sm:j(26),md:j(32),lg:j(38),xl:j(44)};var YJ=W((e,{color:t,radius:r,withPadding:n},{size:o})=>{const i=e.fn.variant({color:t,variant:"filled"});return{control:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",border:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,height:A({size:o,sizes:nc}),minWidth:A({size:o,sizes:nc}),padding:n?`0 calc(${A({size:o,sizes:e.spacing})} / 2)`:void 0,fontSize:A({size:o,sizes:e.fontSizes}),borderRadius:e.fn.radius(r),lineHeight:1,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,"&:not([data-disabled])":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]}),"&:active:not([data-disabled])":e.activeStyles,"&[data-disabled]":{opacity:.4,cursor:"not-allowed",pointerEvents:"none"},"&[data-active]":{borderColor:"transparent",color:i.color,backgroundColor:i.background,"&:not([data-disabled])":e.fn.hover({backgroundColor:i.hover})}}}});const XJ=YJ;var JJ=Object.defineProperty,ZJ=Object.defineProperties,eZ=Object.getOwnPropertyDescriptors,Pp=Object.getOwnPropertySymbols,ID=Object.prototype.hasOwnProperty,DD=Object.prototype.propertyIsEnumerable,BP=(e,t,r)=>t in e?JJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tZ=(e,t)=>{for(var r in t||(t={}))ID.call(t,r)&&BP(e,r,t[r]);if(Pp)for(var r of Pp(t))DD.call(t,r)&&BP(e,r,t[r]);return e},rZ=(e,t)=>ZJ(e,eZ(t)),nZ=(e,t)=>{var r={};for(var n in e)ID.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&&DD.call(e,n)&&(r[n]=e[n]);return r};const oZ={withPadding:!0},rm=f.forwardRef((e,t)=>{const r=H("PaginationControl",oZ,e),{active:n,className:o,disabled:i,withPadding:a}=r,l=nZ(r,["active","className","disabled","withPadding"]),c=tm(),{classes:u,cx:d}=XJ({color:c.color,radius:c.radius,withPadding:a},c.stylesApi);return S.createElement(wo,rZ(tZ({},l),{disabled:i,"data-active":n||void 0,"data-disabled":i||void 0,ref:t,className:d(u.control,o)}))});rm.displayName="@mantine/core/PaginationControl";var iZ=Object.defineProperty,aZ=Object.defineProperties,sZ=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,AD=Object.prototype.propertyIsEnumerable,UP=(e,t,r)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ea=(e,t)=>{for(var r in t||(t={}))ND.call(t,r)&&UP(e,r,t[r]);if(jp)for(var r of jp(t))AD.call(t,r)&&UP(e,r,t[r]);return e},Cc=(e,t)=>aZ(e,sZ(t)),lZ=(e,t)=>{var r={};for(var n in e)ND.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&&AD.call(e,n)&&(r[n]=e[n]);return r};function MD(e){return`calc(${A({size:e,sizes:nc})} / 2)`}function Ec(e){var t=e,{size:r,style:n,children:o,path:i}=t,a=lZ(t,["size","style","children","path"]);return S.createElement("svg",ea({viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:ea({width:r,height:r},n)},a),S.createElement("path",{d:i,fill:"currentColor"}))}const cZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"})),uZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"})),dZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"})),fZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"})),pZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}));var hZ=W((e,t,{size:r})=>({dots:{height:A({size:r,sizes:nc}),minWidth:A({size:r,sizes:nc}),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"}}));const mZ=hZ;var gZ=Object.defineProperty,Op=Object.getOwnPropertySymbols,LD=Object.prototype.hasOwnProperty,zD=Object.prototype.propertyIsEnumerable,WP=(e,t,r)=>t in e?gZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vZ=(e,t)=>{for(var r in t||(t={}))LD.call(t,r)&&WP(e,r,t[r]);if(Op)for(var r of Op(t))zD.call(t,r)&&WP(e,r,t[r]);return e},yZ=(e,t)=>{var r={};for(var n in e)LD.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&&zD.call(e,n)&&(r[n]=e[n]);return r};const xZ={icon:pZ},J0=f.forwardRef((e,t)=>{const r=H("PaginationDots",xZ,e),{className:n,icon:o}=r,i=yZ(r,["className","icon"]),a=tm(),{classes:l,cx:c}=mZ(null,a.stylesApi);return S.createElement(oe,vZ({ref:t,className:c(l.dots,n)},i),S.createElement(o,{size:MD(a.stylesApi.size)}))});J0.displayName="@mantine/core/PaginationDots";var wZ=Object.defineProperty,HP=Object.getOwnPropertySymbols,_Z=Object.prototype.hasOwnProperty,bZ=Object.prototype.propertyIsEnumerable,GP=(e,t,r)=>t in e?wZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SZ=(e,t)=>{for(var r in t||(t={}))_Z.call(t,r)&&GP(e,r,t[r]);if(HP)for(var r of HP(t))bZ.call(t,r)&&GP(e,r,t[r]);return e};function Z0({dotsIcon:e}){const t=tm(),r=t.range.map((n,o)=>{var i;return n==="dots"?S.createElement(J0,{icon:e,key:o}):S.createElement(rm,SZ({key:o,active:n===t.active,"aria-current":n===t.active?"page":void 0,onClick:()=>t.onChange(n),disabled:t.disabled},(i=t.getItemProps)==null?void 0:i.call(t,n)),n)});return S.createElement(S.Fragment,null,r)}Z0.displayName="@mantine/core/PaginationItems";var PZ=W(e=>({icon:{transform:e.dir==="rtl"?"rotate(180deg)":"unset"}}));const jZ=PZ;var OZ=Object.defineProperty,Cp=Object.getOwnPropertySymbols,FD=Object.prototype.hasOwnProperty,VD=Object.prototype.propertyIsEnumerable,qP=(e,t,r)=>t in e?OZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CZ=(e,t)=>{for(var r in t||(t={}))FD.call(t,r)&&qP(e,r,t[r]);if(Cp)for(var r of Cp(t))VD.call(t,r)&&qP(e,r,t[r]);return e},EZ=(e,t)=>{var r={};for(var n in e)FD.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&&VD.call(e,n)&&(r[n]=e[n]);return r};function nm({icon:e,name:t,action:r,type:n}){const o={icon:e},i=f.forwardRef((a,l)=>{const c=H(t,o,a),{icon:u}=c,d=EZ(c,["icon"]),{classes:p}=jZ(),h=tm(),m=n==="next"?h.active===h.total:h.active===1;return S.createElement(rm,CZ({disabled:h.disabled||m,ref:l,onClick:h[r],withPadding:!1},d),S.createElement(u,{className:p.icon,size:MD(h.stylesApi.size)}))});return i.displayName=`@mantine/core/${t}`,i}const BD=nm({icon:cZ,name:"PaginationNext",action:"onNext",type:"next"}),UD=nm({icon:uZ,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),WD=nm({icon:dZ,name:"PaginationFirst",action:"onFirst",type:"previous"}),HD=nm({icon:fZ,name:"PaginationLast",action:"onLast",type:"next"});var $Z=Object.defineProperty,Ep=Object.getOwnPropertySymbols,GD=Object.prototype.hasOwnProperty,qD=Object.prototype.propertyIsEnumerable,QP=(e,t,r)=>t in e?$Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nl=(e,t)=>{for(var r in t||(t={}))GD.call(t,r)&&QP(e,r,t[r]);if(Ep)for(var r of Ep(t))qD.call(t,r)&&QP(e,r,t[r]);return e},kZ=(e,t)=>{var r={};for(var n in e)GD.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&&qD.call(e,n)&&(r[n]=e[n]);return r};const RZ={withControls:!0,siblings:1,boundaries:1};function to(e){const t=H("Pagination",RZ,e),{withEdges:r,withControls:n,classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:b,radius:y,onNextPage:x,onPreviousPage:_,onFirstPage:w,onLastPage:O,getItemProps:C,getControlProps:P,spacing:E,nextIcon:k,previousIcon:$,lastIcon:I,firstIcon:T,dotsIcon:z}=t,M=kZ(t,["withEdges","withControls","classNames","styles","unstyled","variant","size","total","value","defaultValue","onChange","disabled","siblings","boundaries","color","radius","onNextPage","onPreviousPage","onFirstPage","onLastPage","getItemProps","getControlProps","spacing","nextIcon","previousIcon","lastIcon","firstIcon","dotsIcon"]),L=Jt();return u<=0?null:S.createElement(TD,{classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:b,radius:y,onNextPage:x,onPreviousPage:_,onFirstPage:w,onLastPage:O,getItemProps:C},S.createElement(K,nl({spacing:E??`calc(${A({size:c,sizes:L.spacing})} / 2)`},M),r&&S.createElement(WD,nl({icon:T},P==null?void 0:P("first"))),n&&S.createElement(UD,nl({icon:$},P==null?void 0:P("previous"))),S.createElement(Z0,{dotsIcon:z}),n&&S.createElement(BD,nl({icon:k},P==null?void 0:P("next"))),r&&S.createElement(HD,nl({icon:I},P==null?void 0:P("last")))))}to.displayName="@mantine/core/Pagination";to.Root=TD;to.Items=Z0;to.Control=rm;to.Dots=J0;to.Next=BD;to.Previous=UD;to.Last=HD;to.First=WD;const TZ=({reveal:e,size:t})=>S.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:t,height:t}},S.createElement("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}));var IZ=Object.defineProperty,DZ=Object.defineProperties,NZ=Object.getOwnPropertyDescriptors,KP=Object.getOwnPropertySymbols,AZ=Object.prototype.hasOwnProperty,MZ=Object.prototype.propertyIsEnumerable,YP=(e,t,r)=>t in e?IZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xg=(e,t)=>{for(var r in t||(t={}))AZ.call(t,r)&&YP(e,r,t[r]);if(KP)for(var r of KP(t))MZ.call(t,r)&&YP(e,r,t[r]);return e},XP=(e,t)=>DZ(e,NZ(t)),LZ=W((e,{rightSectionWidth:t},{size:r})=>({visibilityToggle:{},input:{position:"relative",overflow:"hidden"},innerInput:XP(xg(xg({},e.fn.fontStyles()),e.fn.cover(0)),{backgroundColor:"transparent",border:`${j(1)} solid transparent`,borderLeftWidth:0,borderRightWidth:0,boxSizing:"border-box",display:"block",width:`calc(100% - ${j(t)})`,paddingLeft:`calc(${A({size:r,sizes:Et})} / 3)`,fontSize:A({size:r,sizes:e.fontSizes}),height:`calc(${A({size:r,sizes:Et})} - ${j(2)})`,lineHeight:`calc(${A({size:r,sizes:Et})} - ${j(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":XP(xg({},e.fn.placeholderStyles()),{opacity:1}),"&[data-invalid]":{color:e.fn.variant({variant:"filled",color:"red"}).background,"&::placeholder":{opacity:1,color:e.fn.variant({variant:"filled",color:"red"}).background}},"&[data-with-icon]":{paddingLeft:A({size:r,sizes:Et})}})}));const zZ=LZ;var FZ=Object.defineProperty,VZ=Object.defineProperties,BZ=Object.getOwnPropertyDescriptors,$p=Object.getOwnPropertySymbols,QD=Object.prototype.hasOwnProperty,KD=Object.prototype.propertyIsEnumerable,JP=(e,t,r)=>t in e?FZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tu=(e,t)=>{for(var r in t||(t={}))QD.call(t,r)&&JP(e,r,t[r]);if($p)for(var r of $p(t))KD.call(t,r)&&JP(e,r,t[r]);return e},UZ=(e,t)=>VZ(e,BZ(t)),WZ=(e,t)=>{var r={};for(var n in e)QD.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&&KD.call(e,n)&&(r[n]=e[n]);return r};const HZ={xs:j(22),sm:j(26),md:j(28),lg:j(32),xl:j(40)},GZ={xs:j(12),sm:j(15),md:j(17),lg:j(19),xl:j(21)},qZ={xs:j(28),sm:j(32),md:j(34),lg:j(44),xl:j(54)},QZ={size:"sm",toggleTabIndex:-1,visibilityToggleIcon:TZ,__staticSelector:"PasswordInput"},yo=f.forwardRef((e,t)=>{const r=H("PasswordInput",QZ,e),{radius:n,disabled:o,size:i,toggleTabIndex:a,className:l,id:c,label:u,error:d,required:p,style:h,icon:m,description:v,wrapperProps:g,classNames:b,styles:y,variant:x,visibilityToggleIcon:_,__staticSelector:w,sx:O,labelProps:C,descriptionProps:P,errorProps:E,unstyled:k,visibilityToggleLabel:$,withAsterisk:I,inputContainer:T,iconWidth:z,inputWrapperOrder:M,visible:L,defaultVisible:q,onVisibilityChange:Y}=r,R=WZ(r,["radius","disabled","size","toggleTabIndex","className","id","label","error","required","style","icon","description","wrapperProps","classNames","styles","variant","visibilityToggleIcon","__staticSelector","sx","labelProps","descriptionProps","errorProps","unstyled","visibilityToggleLabel","withAsterisk","inputContainer","iconWidth","inputWrapperOrder","visible","defaultVisible","onVisibilityChange"]),N=A({size:i,sizes:qZ}),{classes:V}=zZ({rightSectionWidth:N},{name:"PasswordInput",classNames:b,styles:y,unstyled:k,size:i,variant:x}),Q=Rr(c),{systemStyles:ee,rest:_e}=eo(R),[we,Ue]=$r({value:L,defaultValue:q,finalValue:!1,onChange:Y}),Ae=()=>Ue(!we),pt=S.createElement(dr,{className:V.visibilityToggle,tabIndex:a,radius:n,size:A({size:i,sizes:HZ}),"aria-hidden":!$,"aria-label":$,unstyled:k,onMouseDown:Dt=>{Dt.preventDefault(),Ae()},onKeyDown:Dt=>{Dt.key===" "&&(Dt.preventDefault(),Ae())}},S.createElement(_,{reveal:we,size:A({size:i,sizes:GZ})}));return S.createElement(Ut.Wrapper,Tu(Tu({required:p,id:Q,label:u,error:d,description:v,size:i,className:l,style:h,classNames:b,styles:y,__staticSelector:w,sx:O,errorProps:E,descriptionProps:P,labelProps:C,unstyled:k,withAsterisk:I,inputWrapperOrder:M,inputContainer:T,variant:x},ee),g),S.createElement(Ut,{component:"div",error:d,icon:m,size:i,classNames:UZ(Tu({},b),{input:V.input}),styles:y,radius:n,disabled:o,__staticSelector:w,rightSectionWidth:N,rightSection:!o&&pt,variant:x,unstyled:k,iconWidth:z},S.createElement("input",Tu({type:we?"text":"password",required:p,"data-invalid":!!d||void 0,"data-with-icon":!!m||void 0,className:V.innerInput,disabled:o,id:Q,ref:t,autoComplete:"off"},_e))))});yo.displayName="@mantine/core/PasswordInput";const YD=f.createContext(!1),KZ=YD.Provider,YZ=()=>f.useContext(YD);function XD({children:e,openDelay:t=0,closeDelay:r=0}){return S.createElement(KZ,{value:!0},S.createElement(TB,{delay:{open:t,close:r}},e))}XD.displayName="@mantine/core/TooltipGroup";var XZ=Object.defineProperty,JZ=Object.defineProperties,ZZ=Object.getOwnPropertyDescriptors,ZP=Object.getOwnPropertySymbols,eee=Object.prototype.hasOwnProperty,tee=Object.prototype.propertyIsEnumerable,ej=(e,t,r)=>t in e?XZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tj=(e,t)=>{for(var r in t||(t={}))eee.call(t,r)&&ej(e,r,t[r]);if(ZP)for(var r of ZP(t))tee.call(t,r)&&ej(e,r,t[r]);return e},ree=(e,t)=>JZ(e,ZZ(t));function nee(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.gray[2]:e.colors.gray[9],color:e.colorScheme==="dark"?e.black:e.white};const r=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:r.background,color:r.color}}var oee=W((e,{color:t,radius:r,width:n,multiline:o})=>({tooltip:ree(tj(tj({},e.fn.fontStyles()),nee(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(r),padding:`calc(${e.spacing.xs} / 2) ${e.spacing.xs}`,position:"absolute",whiteSpace:o?"unset":"nowrap",pointerEvents:"none",width:n}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const JD=oee,ZD={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 iee({offset:e,position:t}){const[r,n]=f.useState(!1),o=f.useRef(),{x:i,y:a,reference:l,floating:c,refs:u,update:d,placement:p}=V0({placement:t,middleware:[N0({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=p.includes("right")?e:t.includes("left")?e*-1:0,m=p.includes("bottom")?e:t.includes("top")?e*-1:0,v=f.useCallback(({clientX:g,clientY:b})=>{l({getBoundingClientRect(){return{width:0,height:0,x:g,y:b,left:g+h,top:b+m,right:g,bottom:b}}})},[l]);return f.useEffect(()=>{if(u.floating.current){const g=o.current;g.addEventListener("mousemove",v);const b=vo(u.floating.current);return b.forEach(y=>{y.addEventListener("scroll",d)}),()=>{g.removeEventListener("mousemove",v),b.forEach(y=>{y.removeEventListener("scroll",d)})}}},[l,u.floating.current,d,v,r]),{handleMouseMove:v,x:i,y:a,opened:r,setOpened:n,boundaryRef:o,floating:c}}var aee=Object.defineProperty,see=Object.defineProperties,lee=Object.getOwnPropertyDescriptors,kp=Object.getOwnPropertySymbols,eN=Object.prototype.hasOwnProperty,tN=Object.prototype.propertyIsEnumerable,rj=(e,t,r)=>t in e?aee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Iu=(e,t)=>{for(var r in t||(t={}))eN.call(t,r)&&rj(e,r,t[r]);if(kp)for(var r of kp(t))tN.call(t,r)&&rj(e,r,t[r]);return e},Du=(e,t)=>see(e,lee(t)),cee=(e,t)=>{var r={};for(var n in e)eN.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&&tN.call(e,n)&&(r[n]=e[n]);return r};const uee={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Cn("popover")};function rN(e){var t;const r=H("TooltipFloating",uee,e),{children:n,refProp:o,withinPortal:i,portalProps:a,style:l,className:c,classNames:u,styles:d,unstyled:p,radius:h,color:m,label:v,offset:g,position:b,multiline:y,width:x,zIndex:_,disabled:w,variant:O}=r,C=cee(r,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:P,x:E,y:k,opened:$,boundaryRef:I,floating:T,setOpened:z}=iee({offset:g,position:b}),{classes:M,cx:L}=JD({radius:h,color:m,multiline:y,width:x},{name:"TooltipFloating",classNames:u,styles:d,unstyled:p,variant:O});if(!Os(n))throw new Error(ZD.children);const q=Es(I,n.ref),Y=N=>{var V,Q;(Q=(V=n.props).onMouseEnter)==null||Q.call(V,N),P(N),z(!0)},R=N=>{var V,Q;(Q=(V=n.props).onMouseLeave)==null||Q.call(V,N),z(!1)};return S.createElement(S.Fragment,null,S.createElement(Rs,Du(Iu({},a),{withinPortal:i}),S.createElement(oe,Du(Iu({},C),{ref:T,className:L(M.tooltip,c),style:Du(Iu({},l),{zIndex:_,display:!w&&$?"block":"none",top:k??"",left:(t=Math.round(E))!=null?t:""})}),v)),f.cloneElement(n,Du(Iu({},n.props),{[o]:q,onMouseEnter:Y,onMouseLeave:R})))}rN.displayName="@mantine/core/TooltipFloating";function dee(e){const[t,r]=f.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=YZ(),a=Rr(),{delay:l,currentId:c,setCurrentId:u}=wR(),d=f.useCallback(E=>{r(E),E&&u(a)},[u,a]),{x:p,y:h,reference:m,floating:v,context:g,refs:b,update:y,placement:x,middlewareData:{arrow:{x:_,y:w}={}}}=V0({placement:e.position,open:o,onOpenChange:d,middleware:[sR(e.offset),N0({padding:8}),oR(),mR({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[aR()]:[]]}),{getReferenceProps:O,getFloatingProps:C}=WB([RB(g,{enabled:e.events.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),BB(g,{enabled:e.events.focus,keyboardOnly:!0}),UB(g,{role:"tooltip"}),VB(g,{enabled:typeof e.opened===void 0}),IB(g,{id:a})]);return bR({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:b,update:y}}),rn(()=>{var E;(E=e.onPositionChange)==null||E.call(e,x)},[x]),{x:p,y:h,arrowX:_,arrowY:w,reference:m,floating:v,getFloatingProps:C,getReferenceProps:O,isGroupPhase:o&&c&&c!==a,opened:o,placement:x}}var fee=Object.defineProperty,pee=Object.defineProperties,hee=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,nN=Object.prototype.hasOwnProperty,oN=Object.prototype.propertyIsEnumerable,nj=(e,t,r)=>t in e?fee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ri=(e,t)=>{for(var r in t||(t={}))nN.call(t,r)&&nj(e,r,t[r]);if(Rp)for(var r of Rp(t))oN.call(t,r)&&nj(e,r,t[r]);return e},wg=(e,t)=>pee(e,hee(t)),mee=(e,t)=>{var r={};for(var n in e)nN.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&&oN.call(e,n)&&(r[n]=e[n]);return r};const gee={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:Cn("popover"),positionDependencies:[]},om=f.forwardRef((e,t)=>{var r;const n=f.useRef(null),o=H("Tooltip",gee,e),{children:i,position:a,refProp:l,label:c,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,withinPortal:m,portalProps:v,radius:g,color:b,classNames:y,styles:x,unstyled:_,style:w,className:O,withArrow:C,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,offset:I,transitionProps:T,multiline:z,width:M,events:L,zIndex:q,disabled:Y,positionDependencies:R,onClick:N,onMouseEnter:V,onMouseLeave:Q,inline:ee,variant:_e,keepMounted:we}=o,Ue=mee(o,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","portalProps","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transitionProps","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline","variant","keepMounted"]),{classes:Ae,cx:pt,theme:Dt}=JD({radius:g,color:b,width:M,multiline:z},{name:"Tooltip",classNames:y,styles:x,unstyled:_,variant:_e}),Pe=dee({position:IR(Dt.dir,a),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,events:L,arrowRef:n,arrowOffset:E,offset:I+(C?P/2:0),positionDependencies:[...R,i],inline:ee});if(!Os(i))throw new Error(ZD.children);const Ht=Es(Pe.reference,i.ref,t);return S.createElement(S.Fragment,null,S.createElement(Rs,wg(Ri({},v),{withinPortal:m}),S.createElement(pa,wg(Ri({keepMounted:we,mounted:!Y&&Pe.opened},T),{transition:T.transition||"fade",duration:Pe.isGroupPhase?10:(r=T.duration)!=null?r:100}),Dr=>{var lr,Gt;return S.createElement(oe,Ri(Ri({},Ue),Pe.getFloatingProps({ref:Pe.floating,className:Ae.tooltip,style:wg(Ri(Ri({},w),Dr),{zIndex:q,top:(lr=Pe.y)!=null?lr:0,left:(Gt=Pe.x)!=null?Gt:0})})),c,S.createElement(U0,{ref:n,arrowX:Pe.arrowX,arrowY:Pe.arrowY,visible:C,position:Pe.placement,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,className:Ae.arrow}))})),f.cloneElement(i,Pe.getReferenceProps(Ri({onClick:N,onMouseEnter:V,onMouseLeave:Q,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[l]:Ht,className:pt(O,i.props.className)},i.props))))});om.Group=XD;om.Floating=rN;om.displayName="@mantine/core/Tooltip";const iN=om;var vee=Object.defineProperty,Tp=Object.getOwnPropertySymbols,aN=Object.prototype.hasOwnProperty,sN=Object.prototype.propertyIsEnumerable,oj=(e,t,r)=>t in e?vee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ij=(e,t)=>{for(var r in t||(t={}))aN.call(t,r)&&oj(e,r,t[r]);if(Tp)for(var r of Tp(t))sN.call(t,r)&&oj(e,r,t[r]);return e},yee=(e,t)=>{var r={};for(var n in e)aN.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&&sN.call(e,n)&&(r[n]=e[n]);return r};function xee(e){const t=e,{width:r,height:n,style:o}=t,i=yee(t,["width","height","style"]);return S.createElement("svg",ij({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:ij({width:r,height:n},o)},i),S.createElement("path",{fill:"currentColor",d:"M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z"}))}const lN=f.createContext(null),wee=lN.Provider,_ee=()=>f.useContext(lN);var bee=Object.defineProperty,Ip=Object.getOwnPropertySymbols,cN=Object.prototype.hasOwnProperty,uN=Object.prototype.propertyIsEnumerable,aj=(e,t,r)=>t in e?bee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sj=(e,t)=>{for(var r in t||(t={}))cN.call(t,r)&&aj(e,r,t[r]);if(Ip)for(var r of Ip(t))uN.call(t,r)&&aj(e,r,t[r]);return e},See=(e,t)=>{var r={};for(var n in e)cN.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&&uN.call(e,n)&&(r[n]=e[n]);return r};const Pee={size:"sm"},dN=f.forwardRef((e,t)=>{const r=H("RadioGroup",Pee,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c,unstyled:u,name:d}=r,p=See(r,["children","value","defaultValue","onChange","size","wrapperProps","unstyled","name"]),h=Rr(d),[m,v]=$r({value:o,defaultValue:i,finalValue:"",onChange:a}),g=b=>v(b.currentTarget.value);return S.createElement(wee,{value:{value:m,onChange:g,size:l,name:h}},S.createElement(Ut.Wrapper,sj(sj({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:u},c),p),n))});dN.displayName="@mantine/core/RadioGroup";var jee=Object.defineProperty,Oee=Object.defineProperties,Cee=Object.getOwnPropertyDescriptors,lj=Object.getOwnPropertySymbols,Eee=Object.prototype.hasOwnProperty,$ee=Object.prototype.propertyIsEnumerable,cj=(e,t,r)=>t in e?jee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kee=(e,t)=>{for(var r in t||(t={}))Eee.call(t,r)&&cj(e,r,t[r]);if(lj)for(var r of lj(t))$ee.call(t,r)&&cj(e,r,t[r]);return e},Ree=(e,t)=>Oee(e,Cee(t));const _g={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)},Nu={xs:j(6),sm:j(8),md:j(10),lg:j(14),xl:j(16)};var Tee=W((e,{color:t,transitionDuration:r,labelPosition:n,error:o},{size:i})=>{const a=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:Vt("icon"),color:e.white,opacity:0,transform:`scale(0.75) translateY(${j(2)})`,transition:`opacity ${r}ms ${e.transitionTimingFunction}`,pointerEvents:"none",width:A({sizes:Nu,size:i}),height:A({sizes:Nu,size:i}),position:"absolute",top:`calc(50% - ${A({sizes:Nu,size:i})} / 2)`,left:`calc(50% - ${A({sizes:Nu,size:i})} / 2)`},radio:Ree(kee({},e.fn.focusStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${j(1)} solid ${o?l:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,position:"relative",appearance:"none",width:A({sizes:_g,size:i}),height:A({sizes:_g,size:i}),borderRadius:A({sizes:_g,size:i}),margin:0,display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:`${r}ms`,cursor:e.cursorType,"&:checked":{background:a.background,borderColor:a.background,[`& + .${Vt("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],[`& + .${Vt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[4]}}})}});const Iee=Tee;var Dee=Object.defineProperty,Dp=Object.getOwnPropertySymbols,fN=Object.prototype.hasOwnProperty,pN=Object.prototype.propertyIsEnumerable,uj=(e,t,r)=>t in e?Dee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Au=(e,t)=>{for(var r in t||(t={}))fN.call(t,r)&&uj(e,r,t[r]);if(Dp)for(var r of Dp(t))pN.call(t,r)&&uj(e,r,t[r]);return e},Nee=(e,t)=>{var r={};for(var n in e)fN.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&&pN.call(e,n)&&(r[n]=e[n]);return r};const Aee={icon:xee,transitionDuration:100,size:"sm",labelPosition:"right"},Np=f.forwardRef((e,t)=>{var r,n;const o=H("Radio",Aee,e),{className:i,style:a,id:l,label:c,size:u,title:d,disabled:p,color:h,classNames:m,styles:v,sx:g,icon:b,transitionDuration:y,wrapperProps:x,unstyled:_,labelPosition:w,description:O,error:C,variant:P}=o,E=Nee(o,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error","variant"]),k=_ee(),$=(r=k==null?void 0:k.size)!=null?r:u,I=e.size?u:$,{classes:T}=Iee({color:h,transitionDuration:y,labelPosition:w,error:!!C},{name:"Radio",classNames:m,styles:v,unstyled:_,variant:P,size:I}),{systemStyles:z,rest:M}=eo(E),L=Rr(l),q=k?{checked:k.value===M.value,name:(n=M.name)!=null?n:k.name,onChange:k.onChange}:{};return S.createElement(Zh,Au(Au({className:i,sx:g,style:a,id:L,size:I,labelPosition:w,label:c,description:O,error:C,disabled:p,__staticSelector:"Radio",classNames:m,styles:v,unstyled:_,"data-checked":q.checked||void 0,variant:P},z),x),S.createElement("div",{className:T.inner},S.createElement("input",Au(Au({ref:t,className:T.radio,type:"radio",id:L,disabled:p},M),q)),S.createElement(b,{className:T.icon,"aria-hidden":!0})))});Np.displayName="@mantine/core/Radio";Np.Group=dN;function Mee({size:e,thickness:t,sum:r,value:n,root:o,offset:i}){const a=(e*.9-t*2)/2,l=Math.PI*a*2/100,c=o?`${(100-r)*l}, ${r*l}`:`${n*l}, ${(100-n)*l}`;return{strokeWidth:t,cx:e/2,cy:e/2,r:a,transform:o?`scale(1, -1) translate(0, -${e})`:null,strokeDasharray:c,strokeDashoffset:o?0:i}}var Lee=Object.defineProperty,zee=Object.defineProperties,Fee=Object.getOwnPropertyDescriptors,Ap=Object.getOwnPropertySymbols,hN=Object.prototype.hasOwnProperty,mN=Object.prototype.propertyIsEnumerable,dj=(e,t,r)=>t in e?Lee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fj=(e,t)=>{for(var r in t||(t={}))hN.call(t,r)&&dj(e,r,t[r]);if(Ap)for(var r of Ap(t))mN.call(t,r)&&dj(e,r,t[r]);return e},Vee=(e,t)=>zee(e,Fee(t)),Bee=(e,t)=>{var r={};for(var n in e)hN.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&&mN.call(e,n)&&(r[n]=e[n]);return r};function gN(e){var t=e,{size:r,value:n,offset:o,sum:i,thickness:a,root:l,color:c,lineRoundCaps:u,tooltip:d}=t,p=Bee(t,["size","value","offset","sum","thickness","root","color","lineRoundCaps","tooltip"]);const h=Jt(),m=h.fn.themeColor(c||(h.colorScheme==="dark"?"dark":"gray"),c?h.fn.primaryShade():h.colorScheme==="dark"?4:1,!1);return S.createElement(iN.Floating,{disabled:!d,label:d},S.createElement("circle",fj(Vee(fj({},p),{fill:"none",strokeLinecap:u?"round":"butt",stroke:m}),Mee({sum:i,size:r,thickness:a,value:n,offset:o,root:l}))))}gN.displayName="@mantine/core/Curve";var Uee=Object.defineProperty,Wee=Object.defineProperties,Hee=Object.getOwnPropertyDescriptors,pj=Object.getOwnPropertySymbols,Gee=Object.prototype.hasOwnProperty,qee=Object.prototype.propertyIsEnumerable,hj=(e,t,r)=>t in e?Uee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ol=(e,t)=>{for(var r in t||(t={}))Gee.call(t,r)&&hj(e,r,t[r]);if(pj)for(var r of pj(t))qee.call(t,r)&&hj(e,r,t[r]);return e},il=(e,t)=>Wee(e,Hee(t));function Qee({size:e,thickness:t,sections:r,renderRoundedLineCaps:n,rootColor:o}){const i=r.reduce((d,p)=>d+p.value,0),a=Math.PI*((e*.9-t*2)/2)*2;let l=a;const c=[],u=[];for(let d=0;d<r.length;d+=1)c.push({sum:i,offset:l,data:r[d],root:!1}),l-=r[d].value/100*a;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push(il(ol({},c[c.length-1]),{lineRoundCaps:!1})),c.length>2){u.push(il(ol({},c[0]),{lineRoundCaps:n})),u.push(il(ol({},c[c.length-2]),{lineRoundCaps:n}));for(let d=1;d<=c.length-3;d+=1)u.push(il(ol({},c[d]),{lineRoundCaps:!1}))}else u.push(il(ol({},c[0]),{lineRoundCaps:n}));return u}var Kee=W({root:{position:"relative"},label:{position:"absolute",top:"50%",transform:"translateY(-50%)"}});const Yee=Kee;var Xee=Object.defineProperty,Jee=Object.defineProperties,Zee=Object.getOwnPropertyDescriptors,Mp=Object.getOwnPropertySymbols,vN=Object.prototype.hasOwnProperty,yN=Object.prototype.propertyIsEnumerable,mj=(e,t,r)=>t in e?Xee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bg=(e,t)=>{for(var r in t||(t={}))vN.call(t,r)&&mj(e,r,t[r]);if(Mp)for(var r of Mp(t))yN.call(t,r)&&mj(e,r,t[r]);return e},ete=(e,t)=>Jee(e,Zee(t)),tte=(e,t)=>{var r={};for(var n in e)vN.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&&yN.call(e,n)&&(r[n]=e[n]);return r};const rte={size:120,thickness:12},ex=f.forwardRef((e,t)=>{const r=H("RingProgress",rte,e),{className:n,style:o,label:i,sections:a,size:l,thickness:c,classNames:u,styles:d,roundCaps:p,rootColor:h,unstyled:m,variant:v}=r,g=tte(r,["className","style","label","sections","size","thickness","classNames","styles","roundCaps","rootColor","unstyled","variant"]),{classes:b,cx:y}=Yee(null,{name:"RingProgress",classNames:u,styles:d,unstyled:m,variant:v}),x=Qee({size:l,thickness:c,sections:a,renderRoundedLineCaps:p,rootColor:h}).map(({data:_,sum:w,root:O,lineRoundCaps:C,offset:P},E)=>S.createElement(gN,ete(bg({},_),{key:E,size:l,thickness:c,sum:w,offset:P,color:_==null?void 0:_.color,root:O,lineRoundCaps:C})));return S.createElement(oe,bg({style:bg({width:l,height:l},o),className:y(b.root,n),ref:t},g),S.createElement("svg",{style:{width:l,height:l,transform:"rotate(-90deg)"}},x),i&&S.createElement("div",{className:b.label,style:{right:c*2,left:c*2}},i))});ex.displayName="@mantine/core/RingProgress";function nte(e,t){if(t.length===0)return t;const r="maxWidth"in t[0]?"maxWidth":"minWidth",n=[...t].sort((o,i)=>pr(A({size:i[r],sizes:e.breakpoints}))-pr(A({size:o[r],sizes:e.breakpoints})));return r==="minWidth"?n.reverse():n}var ote=Object.defineProperty,gj=Object.getOwnPropertySymbols,ite=Object.prototype.hasOwnProperty,ate=Object.prototype.propertyIsEnumerable,vj=(e,t,r)=>t in e?ote(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ste=(e,t)=>{for(var r in t||(t={}))ite.call(t,r)&&vj(e,r,t[r]);if(gj)for(var r of gj(t))ate.call(t,r)&&vj(e,r,t[r]);return e},lte=W((e,{spacing:t,breakpoints:r,cols:n,verticalSpacing:o})=>{const i=o!=null,a=nte(e,r).reduce((l,c)=>{var u,d;const p="maxWidth"in c?"max-width":"min-width",h=A({size:p==="max-width"?c.maxWidth:c.minWidth,sizes:e.breakpoints,units:"em"}),m=pr(h)-(p==="max-width"?1:0);return l[`@media (${p}: ${ir(m)})`]={gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,gap:`${A({size:(u=c.verticalSpacing)!=null?u:i?o:t,sizes:e.spacing})} ${A({size:(d=c.spacing)!=null?d:t,sizes:e.spacing})}`},l},{});return{root:ste({boxSizing:"border-box",display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:`${A({size:i?o:t,sizes:e.spacing})} ${A({size:t,sizes:e.spacing})}`},a)}});const cte=lte;var ute=Object.defineProperty,Lp=Object.getOwnPropertySymbols,xN=Object.prototype.hasOwnProperty,wN=Object.prototype.propertyIsEnumerable,yj=(e,t,r)=>t in e?ute(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dte=(e,t)=>{for(var r in t||(t={}))xN.call(t,r)&&yj(e,r,t[r]);if(Lp)for(var r of Lp(t))wN.call(t,r)&&yj(e,r,t[r]);return e},fte=(e,t)=>{var r={};for(var n in e)xN.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&&wN.call(e,n)&&(r[n]=e[n]);return r};const pte={breakpoints:[],cols:1,spacing:"md"},_N=f.forwardRef((e,t)=>{const r=H("SimpleGrid",pte,e),{className:n,breakpoints:o,cols:i,spacing:a,verticalSpacing:l,children:c,unstyled:u,variant:d}=r,p=fte(r,["className","breakpoints","cols","spacing","verticalSpacing","children","unstyled","variant"]),{classes:h,cx:m}=cte({breakpoints:o,cols:i,spacing:a,verticalSpacing:l},{name:"SimpleGrid",unstyled:u,variant:d});return S.createElement(oe,dte({className:m(h.root,n),ref:t},p),c)});_N.displayName="@mantine/core/SimpleGrid";var hte=Object.defineProperty,zp=Object.getOwnPropertySymbols,bN=Object.prototype.hasOwnProperty,SN=Object.prototype.propertyIsEnumerable,xj=(e,t,r)=>t in e?hte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mte=(e,t)=>{for(var r in t||(t={}))bN.call(t,r)&&xj(e,r,t[r]);if(zp)for(var r of zp(t))SN.call(t,r)&&xj(e,r,t[r]);return e},gte=(e,t)=>{var r={};for(var n in e)bN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zp)for(var n of zp(e))t.indexOf(n)<0&&SN.call(e,n)&&(r[n]=e[n]);return r};const vte={w:0,h:0},im=f.forwardRef((e,t)=>{const r=H("Space",vte,e),{w:n,h:o}=r,i=gte(r,["w","h"]);return S.createElement(oe,mte({ref:t,w:n,miw:n,h:o,mih:o},i))});im.displayName="@mantine/core/Space";var yte=W((e,{spacing:t,align:r,justify:n})=>({root:{display:"flex",flexDirection:"column",alignItems:r,justifyContent:n,gap:A({size:t,sizes:e.spacing})}}));const xte=yte;var wte=Object.defineProperty,Fp=Object.getOwnPropertySymbols,PN=Object.prototype.hasOwnProperty,jN=Object.prototype.propertyIsEnumerable,wj=(e,t,r)=>t in e?wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_te=(e,t)=>{for(var r in t||(t={}))PN.call(t,r)&&wj(e,r,t[r]);if(Fp)for(var r of Fp(t))jN.call(t,r)&&wj(e,r,t[r]);return e},bte=(e,t)=>{var r={};for(var n in e)PN.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&&jN.call(e,n)&&(r[n]=e[n]);return r};const Ste={spacing:"md",align:"stretch",justify:"flex-start"},Oe=f.forwardRef((e,t)=>{const r=H("Stack",Ste,e),{spacing:n,className:o,align:i,justify:a,unstyled:l,variant:c}=r,u=bte(r,["spacing","className","align","justify","unstyled","variant"]),{classes:d,cx:p}=xte({spacing:n,align:i,justify:a},{name:"Stack",unstyled:l,variant:c});return S.createElement(oe,_te({className:p(d.root,o),ref:t},u))});Oe.displayName="@mantine/core/Stack";var Pte=Object.defineProperty,jte=Object.defineProperties,Ote=Object.getOwnPropertyDescriptors,_j=Object.getOwnPropertySymbols,Cte=Object.prototype.hasOwnProperty,Ete=Object.prototype.propertyIsEnumerable,bj=(e,t,r)=>t in e?Pte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sg=(e,t)=>{for(var r in t||(t={}))Cte.call(t,r)&&bj(e,r,t[r]);if(_j)for(var r of _j(t))Ete.call(t,r)&&bj(e,r,t[r]);return e},$te=(e,t)=>jte(e,Ote(t));const ON={xs:j(34),sm:j(36),md:j(42),lg:j(48),xl:j(52)};var kte=W((e,{color:t,iconSize:r,radius:n,allowStepClick:o,iconPosition:i,orientation:a},{size:l})=>{const c=r?j(r):A({size:l,sizes:ON}),u=l==="xl"||l==="lg"?e.spacing.md:e.spacing.sm,d=e.fn.radius(n),p=e.fn.variant({variant:"filled",color:t||e.primaryColor,primaryFallback:!1}),h=`calc(${e.spacing.xs} / 2)`,m={step:{justifyContent:"flex-start",minHeight:`calc(${c} + ${e.spacing.xl} + ${h})`,marginTop:h,overflow:"hidden","&:first-of-type":{marginTop:0},[`&:last-of-type .${Vt("verticalSeparator")}`]:{display:"none"}}};return{stepLoader:{},step:Sg({display:"flex",flexDirection:i==="left"?"row":"row-reverse",cursor:o?"pointer":"default"},a==="vertical"?m.step:{alignItems:"center"}),stepWrapper:{position:"relative"},verticalSeparator:{top:`calc(${c} + ${h})`,left:`calc(${c} / 2)`,height:"100vh",position:"absolute",borderLeft:`${j(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,ref:Vt("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:`${j(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,transition:"background-color 150ms ease, border-color 150ms ease",position:"relative",fontWeight:700,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],fontSize:A({size:l,sizes:e.fontSizes}),"&[data-progress]":{borderColor:p.background},"&[data-completed]":{backgroundColor:p.background,borderColor:p.background,color:e.white}},stepCompletedIcon:$te(Sg({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.white}),stepBody:Sg({display:"flex",flexDirection:"column",marginLeft:i==="left"?u:void 0,marginRight:i==="right"?u:void 0},a==="vertical"?{marginTop:`calc(${r} / 4)`}:null),stepLabel:{textAlign:i,fontWeight:500,fontSize:A({size:l,sizes:e.fontSizes}),lineHeight:1},stepDescription:{textAlign:i,marginTop:`calc(${A({size:l,sizes:e.spacing})} / 3)`,marginBottom:`calc(${A({size:l,sizes:e.spacing})} / 3)`,fontSize:`calc(${A({size:l,sizes:e.fontSizes})} - ${j(2)})`,lineHeight:1}}});const Rte=kte;var Tte=Object.defineProperty,Vp=Object.getOwnPropertySymbols,CN=Object.prototype.hasOwnProperty,EN=Object.prototype.propertyIsEnumerable,Sj=(e,t,r)=>t in e?Tte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pg=(e,t)=>{for(var r in t||(t={}))CN.call(t,r)&&Sj(e,r,t[r]);if(Vp)for(var r of Vp(t))EN.call(t,r)&&Sj(e,r,t[r]);return e},Ite=(e,t)=>{var r={};for(var n in e)CN.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&&EN.call(e,n)&&(r[n]=e[n]);return r};const Dte={xs:16,sm:18,md:20,lg:22,xl:24},Nte={withIcon:!0,size:"md",radius:"xl",allowStepClick:!0,iconPosition:"left",__staticSelector:"Step"},Mu=(e,t)=>typeof e=="function"?S.createElement(e,{step:t}):e,$N=f.forwardRef((e,t)=>{const r=H("StepperStep",Nte,e),{className:n,step:o,state:i,color:a,icon:l,completedIcon:c,progressIcon:u,label:d,description:p,withIcon:h,iconSize:m,size:v,radius:g,loading:b,allowStepClick:y,allowStepSelect:x,iconPosition:_,__staticSelector:w,classNames:O,styles:C,unstyled:P,orientation:E,variant:k}=r,$=Ite(r,["className","step","state","color","icon","completedIcon","progressIcon","label","description","withIcon","iconSize","size","radius","loading","allowStepClick","allowStepSelect","iconPosition","__staticSelector","classNames","styles","unstyled","orientation","variant"]),{classes:I,cx:T}=Rte({color:a,iconSize:m,radius:g,allowStepClick:y,iconPosition:_,orientation:E},{name:w,classNames:O,styles:C,unstyled:P,variant:k,size:v}),z=A({size:v,sizes:Dte}),M=i==="stepCompleted"?null:i==="stepProgress"?u:l,L={"data-progress":i==="stepProgress"||void 0,"data-completed":i==="stepCompleted"||void 0};return S.createElement(wo,Pg(Pg({className:T(I.step,n),tabIndex:y?0:-1,ref:t},L),$),h&&S.createElement("div",{className:I.stepWrapper},S.createElement("div",Pg({className:I.stepIcon},L),S.createElement(pa,{mounted:i==="stepCompleted",transition:"pop",duration:200},q=>S.createElement("div",{className:I.stepCompletedIcon,style:q},b?S.createElement(cn,{color:"#fff",size:z,className:I.stepLoader}):Mu(c,o)||S.createElement(NT,{indeterminate:!1,width:z,height:z}))),i!=="stepCompleted"?b?S.createElement(cn,{size:z,color:a}):Mu(M||l,o):null),E==="vertical"&&S.createElement("div",{className:T(I.verticalSeparator,{[I.verticalSeparatorActive]:i==="stepCompleted"})})),(d||p)&&S.createElement("div",{className:I.stepBody},d&&S.createElement(re,{className:I.stepLabel},Mu(d,o)),p&&S.createElement(re,{className:I.stepDescription,color:"dimmed"},Mu(p,o))))});$N.displayName="@mantine/core/Step";function Bp(e){return null}Bp.displayName="@mantine/core/StepCompleted";var Ate=Object.defineProperty,Mte=Object.defineProperties,Lte=Object.getOwnPropertyDescriptors,Pj=Object.getOwnPropertySymbols,zte=Object.prototype.hasOwnProperty,Fte=Object.prototype.propertyIsEnumerable,jj=(e,t,r)=>t in e?Ate(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,al=(e,t)=>{for(var r in t||(t={}))zte.call(t,r)&&jj(e,r,t[r]);if(Pj)for(var r of Pj(t))Fte.call(t,r)&&jj(e,r,t[r]);return e},Vte=(e,t)=>Mte(e,Lte(t)),Bte=W((e,{contentPadding:t,color:r,orientation:n,iconPosition:o,iconSize:i,breakpoint:a},{size:l})=>{const c=typeof a<"u",u=pr(A({size:a,sizes:e.breakpoints})),d=typeof i<"u"?`calc(${j(i)} / 2 - ${j(1)})`:`calc(${A({size:l,sizes:ON})} / 2 - ${j(1)})`,p={steps:{flexDirection:"column",alignItems:o==="left"?"flex-start":"flex-end"},separator:{width:j(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} - ${j(2)})`}},h={steps:{[`@media (max-width: ${ir(u-1)})`]:p.steps},separator:{[`@media (max-width: ${ir(u-1)})`]:p.separator}};return{root:{},steps:al(al({display:"flex",boxSizing:"border-box",alignItems:"center"},n==="vertical"?p.steps:null),c?h.steps:null),separator:al(al({boxSizing:"border-box",transition:"background-color 150ms ease",flex:1,height:j(2),backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],marginLeft:e.spacing.md,marginRight:e.spacing.md},n==="vertical"?p.separator:null),c?h.separator:null),separatorActive:{backgroundColor:e.fn.variant({variant:"filled",color:r||e.primaryColor,primaryFallback:!1}).background},content:Vte(al({},e.fn.fontStyles()),{paddingTop:A({size:t,sizes:e.spacing})})}});const Ute=Bte;var Wte=Object.defineProperty,Up=Object.getOwnPropertySymbols,kN=Object.prototype.hasOwnProperty,RN=Object.prototype.propertyIsEnumerable,Oj=(e,t,r)=>t in e?Wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hte=(e,t)=>{for(var r in t||(t={}))kN.call(t,r)&&Oj(e,r,t[r]);if(Up)for(var r of Up(t))RN.call(t,r)&&Oj(e,r,t[r]);return e},Gte=(e,t)=>{var r={};for(var n in e)kN.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&&RN.call(e,n)&&(r[n]=e[n]);return r};const qte={contentPadding:"md",size:"md",radius:"xl",orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0},oc=f.forwardRef((e,t)=>{var r,n,o;const i=H("Stepper",qte,e),{className:a,children:l,onStepClick:c,active:u,icon:d,completedIcon:p,progressIcon:h,color:m,iconSize:v,contentPadding:g,size:b,radius:y,orientation:x,breakpoint:_,iconPosition:w,allowNextStepsSelect:O,classNames:C,styles:P,unstyled:E,variant:k}=i,$=Gte(i,["className","children","onStepClick","active","icon","completedIcon","progressIcon","color","iconSize","contentPadding","size","radius","orientation","breakpoint","iconPosition","allowNextStepsSelect","classNames","styles","unstyled","variant"]),{classes:I,cx:T}=Ute({contentPadding:g,color:m,orientation:x,iconPosition:w,iconSize:v,breakpoint:_},{name:"Stepper",classNames:C,styles:P,unstyled:E,variant:k,size:b}),z=f.Children.toArray(l),M=z.filter(V=>V.type!==Bp),L=z.find(V=>V.type===Bp),q=M.reduce((V,Q,ee)=>{const _e=u===ee?"stepProgress":u>ee?"stepCompleted":"stepInactive",Ue=(()=>typeof c!="function"?!1:typeof Q.props.allowStepSelect=="boolean"?Q.props.allowStepSelect:_e==="stepCompleted"||O)();return V.push(f.cloneElement(Q,{__staticSelector:"Stepper",icon:Q.props.icon||d||ee+1,key:ee,step:ee,variant:k,state:_e,onClick:()=>Ue&&c(ee),allowStepClick:Ue,completedIcon:Q.props.completedIcon||p,progressIcon:Q.props.progressIcon||h,color:Q.props.color||m,iconSize:v,size:b,radius:y,classNames:C,styles:P,iconPosition:Q.props.iconPosition||w,orientation:x,unstyled:E})),x==="horizontal"&&ee!==M.length-1&&V.push(S.createElement("div",{className:T(I.separator,{[I.separatorActive]:ee<u}),key:`separator-${ee}`})),V},[]),Y=(n=(r=M[u])==null?void 0:r.props)==null?void 0:n.children,R=(o=L==null?void 0:L.props)==null?void 0:o.children,N=u>M.length-1?R:Y;return S.createElement(oe,Hte({className:T(I.root,a),ref:t},$),S.createElement("div",{className:I.steps},q),N&&S.createElement("div",{className:I.content},N))});oc.Step=$N;oc.Completed=Bp;oc.displayName="@mantine/core/Stepper";const TN=f.createContext(null),Qte=TN.Provider,Kte=()=>f.useContext(TN);var Yte=Object.defineProperty,Wp=Object.getOwnPropertySymbols,IN=Object.prototype.hasOwnProperty,DN=Object.prototype.propertyIsEnumerable,Cj=(e,t,r)=>t in e?Yte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ej=(e,t)=>{for(var r in t||(t={}))IN.call(t,r)&&Cj(e,r,t[r]);if(Wp)for(var r of Wp(t))DN.call(t,r)&&Cj(e,r,t[r]);return e},Xte=(e,t)=>{var r={};for(var n in e)IN.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&&DN.call(e,n)&&(r[n]=e[n]);return r};const Jte={size:"sm"},NN=f.forwardRef((e,t)=>{const r=H("SwitchGroup",Jte,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=Xte(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=$r({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(Qte,{value:{value:d,onChange:h,size:l}},S.createElement(Ut.Wrapper,Ej(Ej({labelElement:"div",size:l,__staticSelector:"SwitchGroup",ref:t},c),u),n))});NN.displayName="@mantine/core/SwitchGroup";var Zte=Object.defineProperty,ere=Object.defineProperties,tre=Object.getOwnPropertyDescriptors,$j=Object.getOwnPropertySymbols,rre=Object.prototype.hasOwnProperty,nre=Object.prototype.propertyIsEnumerable,kj=(e,t,r)=>t in e?Zte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ore=(e,t)=>{for(var r in t||(t={}))rre.call(t,r)&&kj(e,r,t[r]);if($j)for(var r of $j(t))nre.call(t,r)&&kj(e,r,t[r]);return e},ire=(e,t)=>ere(e,tre(t));const are={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)},sre={xs:j(32),sm:j(38),md:j(46),lg:j(56),xl:j(72)},lre={xs:j(12),sm:j(14),md:j(18),lg:j(22),xl:j(28)},cre={xs:j(5),sm:j(6),md:j(7),lg:j(9),xl:j(11)},ure={xs:j(4),sm:j(5),md:j(6),lg:j(8),xl:j(10)};var dre=W((e,{radius:t,color:r,labelPosition:n,error:o},{size:i})=>{const a=A({size:i,sizes:lre}),l=A({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:r}),u=A({size:i,sizes:sre}),d=j(i==="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:ire(ore({},e.fn.focusStyles("input:focus + &")),{cursor:e.cursorType,overflow:"hidden",WebkitTapHighlightColor:"transparent",position:"relative",borderRadius:l,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[2],border:`${j(1)} solid ${o?p:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,height:A({size:i,sizes:are}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:A({size:i,sizes:cre}),fontWeight:600,order:n==="left"?2:1,userSelect:"none",zIndex:0,lineHeight:0,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[6],transition:`color 150ms ${e.transitionTimingFunction}`,"input:checked + &":{backgroundColor:c.background,borderColor:c.background,color:e.white,transition:`color 150ms ${e.transitionTimingFunction}`},"input:disabled + &":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],cursor:"not-allowed",pointerEvents:"none"}}),thumb:{position:"absolute",zIndex:1,borderRadius:l,boxSizing:"border-box",display:"flex",backgroundColor:e.white,height:a,width:a,border:`${j(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% - ${a} - ${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} - ${a})`,paddingInline:A({size:i,sizes:ure}),marginLeft:`calc(${a} + ${d})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${a} + ${d})`}}}});const fre=dre;var pre=Object.defineProperty,hre=Object.defineProperties,mre=Object.getOwnPropertyDescriptors,Hp=Object.getOwnPropertySymbols,AN=Object.prototype.hasOwnProperty,MN=Object.prototype.propertyIsEnumerable,Rj=(e,t,r)=>t in e?pre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jg=(e,t)=>{for(var r in t||(t={}))AN.call(t,r)&&Rj(e,r,t[r]);if(Hp)for(var r of Hp(t))MN.call(t,r)&&Rj(e,r,t[r]);return e},gre=(e,t)=>hre(e,mre(t)),vre=(e,t)=>{var r={};for(var n in e)AN.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&&MN.call(e,n)&&(r[n]=e[n]);return r};const yre={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},tx=f.forwardRef((e,t)=>{var r;const n=H("Switch",yre,e),{className:o,color:i,label:a,offLabel:l,onLabel:c,id:u,style:d,size:p,radius:h,wrapperProps:m,children:v,unstyled:g,styles:b,classNames:y,thumbIcon:x,sx:_,checked:w,defaultChecked:O,onChange:C,labelPosition:P,description:E,error:k,disabled:$,variant:I}=n,T=vre(n,["className","color","label","offLabel","onLabel","id","style","size","radius","wrapperProps","children","unstyled","styles","classNames","thumbIcon","sx","checked","defaultChecked","onChange","labelPosition","description","error","disabled","variant"]),z=Kte(),M=(z==null?void 0:z.size)||p,{classes:L,cx:q}=fre({color:i,radius:h,labelPosition:P,error:!!k},{name:"Switch",classNames:y,styles:b,unstyled:g,size:M,variant:I}),{systemStyles:Y,rest:R}=eo(T),N=Rr(u),V=z?{checked:z.value.includes(R.value),onChange:z.onChange}:{},[Q,ee]=$r({value:(r=V.checked)!=null?r:w,defaultValue:O,finalValue:!1});return S.createElement(Zh,jg(jg({className:q(o,L.root),sx:_,style:d,id:N,size:(z==null?void 0:z.size)||p,labelPosition:P,label:a,description:E,error:k,disabled:$,__staticSelector:"Switch",classNames:y,styles:b,unstyled:g,"data-checked":V.checked||void 0,variant:I},Y),m),S.createElement("input",gre(jg({},R),{disabled:$,checked:Q,onChange:_e=>{z?V.onChange(_e):C==null||C(_e),ee(_e.currentTarget.checked)},id:N,ref:t,type:"checkbox",className:L.input})),S.createElement("label",{htmlFor:N,className:L.track},S.createElement("div",{className:L.thumb},x),S.createElement("div",{className:L.trackLabel},Q?c:l)))});tx.displayName="@mantine/core/Switch";tx.Group=NN;var xre=Object.defineProperty,wre=Object.defineProperties,_re=Object.getOwnPropertyDescriptors,Tj=Object.getOwnPropertySymbols,bre=Object.prototype.hasOwnProperty,Sre=Object.prototype.propertyIsEnumerable,Ij=(e,t,r)=>t in e?xre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pre=(e,t)=>{for(var r in t||(t={}))bre.call(t,r)&&Ij(e,r,t[r]);if(Tj)for(var r of Tj(t))Sre.call(t,r)&&Ij(e,r,t[r]);return e},jre=(e,t)=>wre(e,_re(t)),Ore=W((e,{captionSide:t,horizontalSpacing:r,verticalSpacing:n,fontSize:o,withBorder:i,withColumnBorders:a})=>{const l=`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:jre(Pre({},e.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,border:i?l:void 0,"& > caption":{marginTop:t==="top"?0:e.spacing.xs,marginBottom:t==="bottom"?0:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:A({size:o,sizes:e.fontSizes}),padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:l},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:l},"& > tbody > tr > td":{padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`,borderTop:l,fontSize:A({size:o,sizes:e.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:a?l:"none","&:last-of-type":{borderRight:"none",borderLeft:a?l:"none"}},"& > tbody > tr > th":{borderRight:a?l:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]},"&[data-hover] > tbody > tr":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})})}});const Cre=Ore;var Ere=Object.defineProperty,$re=Object.defineProperties,kre=Object.getOwnPropertyDescriptors,Gp=Object.getOwnPropertySymbols,LN=Object.prototype.hasOwnProperty,zN=Object.prototype.propertyIsEnumerable,Dj=(e,t,r)=>t in e?Ere(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rre=(e,t)=>{for(var r in t||(t={}))LN.call(t,r)&&Dj(e,r,t[r]);if(Gp)for(var r of Gp(t))zN.call(t,r)&&Dj(e,r,t[r]);return e},Tre=(e,t)=>$re(e,kre(t)),Ire=(e,t)=>{var r={};for(var n in e)LN.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&&zN.call(e,n)&&(r[n]=e[n]);return r};const Dre={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},ma=f.forwardRef((e,t)=>{const r=H("Table",Dre,e),{className:n,children:o,striped:i,highlightOnHover:a,captionSide:l,horizontalSpacing:c,verticalSpacing:u,fontSize:d,unstyled:p,withBorder:h,withColumnBorders:m,variant:v}=r,g=Ire(r,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:b,cx:y}=Cre({captionSide:l,verticalSpacing:u,horizontalSpacing:c,fontSize:d,withBorder:h,withColumnBorders:m},{unstyled:p,name:"Table",variant:v});return S.createElement(oe,Tre(Rre({},g),{component:"table",ref:t,className:y(b.root,n),"data-striped":i||void 0,"data-hover":a||void 0}),o)});ma.displayName="@mantine/core/Table";const Yv={context:"Tabs component was not found in the tree",value:"Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value"},[Nre,rx]=ko(Yv.context);var Are=Object.defineProperty,Nj=Object.getOwnPropertySymbols,Mre=Object.prototype.hasOwnProperty,Lre=Object.prototype.propertyIsEnumerable,Aj=(e,t,r)=>t in e?Are(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zre=(e,t)=>{for(var r in t||(t={}))Mre.call(t,r)&&Aj(e,r,t[r]);if(Nj)for(var r of Nj(t))Lre.call(t,r)&&Aj(e,r,t[r]);return e};function Fre({orientation:e,inverted:t,placement:r},n,o){const i=e==="vertical";return o==="default"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${j(2)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="outline"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${j(1)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="pills"?{gap:`calc(${n.spacing.sm} / 2)`}:{}}var Vre=W((e,t,{variant:r})=>{const n=t.orientation==="vertical";return{tabsList:zre({display:"flex",flexWrap:"wrap",flexDirection:n?"column":"row",justifyContent:jI[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},Fre(t,e,r))}});const Bre=Vre;var Ure=Object.defineProperty,Wre=Object.defineProperties,Hre=Object.getOwnPropertyDescriptors,qp=Object.getOwnPropertySymbols,FN=Object.prototype.hasOwnProperty,VN=Object.prototype.propertyIsEnumerable,Mj=(e,t,r)=>t in e?Ure(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gre=(e,t)=>{for(var r in t||(t={}))FN.call(t,r)&&Mj(e,r,t[r]);if(qp)for(var r of qp(t))VN.call(t,r)&&Mj(e,r,t[r]);return e},qre=(e,t)=>Wre(e,Hre(t)),Qre=(e,t)=>{var r={};for(var n in e)FN.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&&VN.call(e,n)&&(r[n]=e[n]);return r};const Kre={grow:!1,position:"left"},BN=f.forwardRef((e,t)=>{const r=H("TabsList",Kre,e),{children:n,className:o,grow:i,position:a}=r,l=Qre(r,["children","className","grow","position"]),{orientation:c,variant:u,color:d,radius:p,inverted:h,placement:m,classNames:v,styles:g,unstyled:b}=rx(),{classes:y,cx:x}=Bre({orientation:c,grow:i,color:d,position:a,radius:p,inverted:h,placement:m},{name:"Tabs",unstyled:b,classNames:v,styles:g,variant:u});return S.createElement(oe,qre(Gre({},l),{className:x(y.tabsList,o),ref:t,role:"tablist","aria-orientation":c}),n)});BN.displayName="@mantine/core/TabsList";var Yre=W((e,{orientation:t})=>({panel:{flex:t==="vertical"?1:void 0}}));const Xre=Yre;var Jre=Object.defineProperty,Zre=Object.defineProperties,ene=Object.getOwnPropertyDescriptors,Qp=Object.getOwnPropertySymbols,UN=Object.prototype.hasOwnProperty,WN=Object.prototype.propertyIsEnumerable,Lj=(e,t,r)=>t in e?Jre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tne=(e,t)=>{for(var r in t||(t={}))UN.call(t,r)&&Lj(e,r,t[r]);if(Qp)for(var r of Qp(t))WN.call(t,r)&&Lj(e,r,t[r]);return e},rne=(e,t)=>Zre(e,ene(t)),nne=(e,t)=>{var r={};for(var n in e)UN.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&&WN.call(e,n)&&(r[n]=e[n]);return r};const one={},HN=f.forwardRef((e,t)=>{const r=H("TabsPanel",one,e),{value:n,children:o,sx:i,className:a}=r,l=nne(r,["value","children","sx","className"]),c=rx(),{classes:u,cx:d}=Xre({orientation:c.orientation,color:c.color,radius:c.radius,inverted:c.inverted,placement:c.placement},{name:"Tabs",unstyled:c.unstyled,classNames:c.classNames,styles:c.styles,variant:c.variant}),p=c.getPanelId(n),h=c.value===n,m=c.keepMounted||h?o:null;return f.useEffect(()=>(c.setMountedPanelIds(v=>[...v,p]),c.setMountedPanelIds(v=>v.filter(g=>g!==p))),[p]),S.createElement(oe,rne(tne({},l),{ref:t,sx:[{display:h?void 0:"none"},...dc(i)],className:d(u.panel,a),role:"tabpanel",id:p,"aria-labelledby":c.getTabId(n)}),m)});HN.displayName="@mantine/core/TabsPanel";var ine=Object.defineProperty,ane=Object.defineProperties,sne=Object.getOwnPropertyDescriptors,zj=Object.getOwnPropertySymbols,lne=Object.prototype.hasOwnProperty,cne=Object.prototype.propertyIsEnumerable,Fj=(e,t,r)=>t in e?ine(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qa=(e,t)=>{for(var r in t||(t={}))lne.call(t,r)&&Fj(e,r,t[r]);if(zj)for(var r of zj(t))cne.call(t,r)&&Fj(e,r,t[r]);return e},Vj=(e,t)=>ane(e,sne(t));function une(e,{orientation:t,color:r,radius:n,inverted:o,placement:i},a){const l=t==="vertical",c=e.fn.variant({color:r,variant:"filled"}),u=j(e.fn.radius(n)),d=t==="vertical"?i==="left"?`${u} 0 0 ${u}`:` 0 ${u} ${u} 0`:o?`0 0 ${u} ${u}`:`${u} ${u} 0 0`;return a==="default"?Vj(Qa({[l?i==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:`${j(2)} solid transparent`,[l?i==="left"?"marginRight":"marginLeft":o?"marginTop":"marginBottom"]:j(-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]":Qa({borderColor:c.background,color:e.colorScheme==="dark"?e.white:e.black},e.fn.hover({borderColor:c.background}))}):a==="outline"?{borderRadius:d,border:`${j(1)} solid transparent`,[l?i==="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":j(-1),top:l?0:o?j(-1):"unset",[l?"width":"height"]:j(1),right:l?i==="left"?j(-1):"unset":0,left:l?i==="left"?"unset":j(-1):0}}}:a==="pills"?Vj(Qa({borderRadius:e.fn.radius(n)},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Qa({backgroundColor:c.background,color:e.white},e.fn.hover({backgroundColor:c.background}))}):{}}var dne=W((e,t,{variant:r})=>({tabLabel:{},tab:Qa({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":Qa({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},une(e,t,r)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:j(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:j(7)}}}));const fne=dne;var pne=Object.defineProperty,hne=Object.defineProperties,mne=Object.getOwnPropertyDescriptors,Kp=Object.getOwnPropertySymbols,GN=Object.prototype.hasOwnProperty,qN=Object.prototype.propertyIsEnumerable,Bj=(e,t,r)=>t in e?pne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gne=(e,t)=>{for(var r in t||(t={}))GN.call(t,r)&&Bj(e,r,t[r]);if(Kp)for(var r of Kp(t))qN.call(t,r)&&Bj(e,r,t[r]);return e},vne=(e,t)=>hne(e,mne(t)),yne=(e,t)=>{var r={};for(var n in e)GN.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&&qN.call(e,n)&&(r[n]=e[n]);return r};const xne={},QN=f.forwardRef((e,t)=>{const r=H("TabsTab",xne,e),{value:n,children:o,onKeyDown:i,onClick:a,className:l,icon:c,rightSection:u,color:d}=r,p=yne(r,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),h=rx(),m=!!c,v=!!u,{theme:g,classes:b,cx:y}=fne({withIcon:m||v&&!o,withRightSection:v||m&&!o,orientation:h.orientation,color:d||h.color,radius:h.radius,inverted:h.inverted,placement:h.placement},{name:"Tabs",unstyled:h.unstyled,classNames:h.classNames,styles:h.styles,variant:h.variant}),x=n===h.value,_=h.getPanelId(n),w=h.mountedPanelIds.includes(n)?_:void 0,O=C=>{h.onTabChange(h.allowTabDeactivation&&n===h.value?null:n),a==null||a(C)};return S.createElement(wo,vne(gne({},p),{unstyled:h.unstyled,className:y(b.tab,l),"data-active":x||void 0,ref:t,type:"button",role:"tab",id:h.getTabId(n),"aria-selected":x,tabIndex:x||h.value===null?0:-1,"aria-controls":w,onClick:O,onKeyDown:ZC({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:h.activateTabWithKeyboard,loop:h.loop,dir:g.dir,orientation:h.orientation,onKeyDown:i})}),c&&S.createElement("span",{className:b.tabIcon},c),o&&S.createElement("span",{className:b.tabLabel},o),u&&S.createElement("span",{className:b.tabRightSection},u))});QN.displayName="@mantine/core/Tab";function KN({defaultValue:e,value:t,onTabChange:r,orientation:n,children:o,loop:i,id:a,activateTabWithKeyboard:l,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,placement:m,keepMounted:v=!0,classNames:g,styles:b,unstyled:y}){const x=Rr(a),[_,w]=f.useState([]),[O,C]=$r({value:t,defaultValue:e,finalValue:null,onChange:r});return S.createElement(Nre,{value:{placement:m,value:O,orientation:n,id:x,loop:i,activateTabWithKeyboard:l,getTabId:c1(`${x}-tab`,Yv.value),getPanelId:c1(`${x}-panel`,Yv.value),onTabChange:C,setMountedPanelIds:w,mountedPanelIds:_,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,keepMounted:v,classNames:g,styles:b,unstyled:y}},o)}KN.displayName="@mantine/core/TabsProvider";var wne=W((e,{orientation:t,placement:r})=>({root:{display:t==="vertical"?"flex":void 0,flexDirection:r==="right"?"row-reverse":"row"}}));const _ne=wne;var bne=Object.defineProperty,Sne=Object.defineProperties,Pne=Object.getOwnPropertyDescriptors,Yp=Object.getOwnPropertySymbols,YN=Object.prototype.hasOwnProperty,XN=Object.prototype.propertyIsEnumerable,Uj=(e,t,r)=>t in e?bne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jne=(e,t)=>{for(var r in t||(t={}))YN.call(t,r)&&Uj(e,r,t[r]);if(Yp)for(var r of Yp(t))XN.call(t,r)&&Uj(e,r,t[r]);return e},One=(e,t)=>Sne(e,Pne(t)),Cne=(e,t)=>{var r={};for(var n in e)YN.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&&XN.call(e,n)&&(r[n]=e[n]);return r};const Ene={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},He=f.forwardRef((e,t)=>{const r=H("Tabs",Ene,e),{defaultValue:n,value:o,orientation:i,loop:a,activateTabWithKeyboard:l,allowTabDeactivation:c,children:u,id:d,onTabChange:p,variant:h,color:m,className:v,unstyled:g,classNames:b,styles:y,radius:x,inverted:_,keepMounted:w,placement:O}=r,C=Cne(r,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:P,cx:E}=_ne({orientation:i,color:m,radius:x,inverted:_,placement:O},{unstyled:g,name:"Tabs",classNames:b,styles:y,variant:h});return S.createElement(KN,{activateTabWithKeyboard:l,defaultValue:n,orientation:i,onTabChange:p,value:o,id:d,loop:a,allowTabDeactivation:c,color:m,variant:h,radius:x,inverted:_,keepMounted:w,placement:O,classNames:b,styles:y,unstyled:g},S.createElement(oe,One(jne({},C),{className:E(P.root,v),id:d,ref:t}),u))});He.List=BN;He.Tab=QN;He.Panel=HN;He.displayName="@mantine/core/Tabs";var $ne=Object.defineProperty,kne=Object.defineProperties,Rne=Object.getOwnPropertyDescriptors,Wj=Object.getOwnPropertySymbols,Tne=Object.prototype.hasOwnProperty,Ine=Object.prototype.propertyIsEnumerable,Hj=(e,t,r)=>t in e?$ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dne=(e,t)=>{for(var r in t||(t={}))Tne.call(t,r)&&Hj(e,r,t[r]);if(Wj)for(var r of Wj(t))Ine.call(t,r)&&Hj(e,r,t[r]);return e},Nne=(e,t)=>kne(e,Rne(t));function Ane(e,t,r){return typeof e<"u"?e in r.headings.sizes?r.headings.sizes[e].fontSize:j(e):r.headings.sizes[t].fontSize}function Mne(e,t,r){return typeof e<"u"&&e in r.headings.sizes?r.headings.sizes[e].lineHeight:r.headings.sizes[t].lineHeight}var Lne=W((e,{element:t,weight:r,inline:n},{size:o})=>({root:Nne(Dne({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:r||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:Ane(o,t,e),lineHeight:n?1:Mne(o,t,e),margin:0})}));const zne=Lne;var Fne=Object.defineProperty,Xp=Object.getOwnPropertySymbols,JN=Object.prototype.hasOwnProperty,ZN=Object.prototype.propertyIsEnumerable,Gj=(e,t,r)=>t in e?Fne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vne=(e,t)=>{for(var r in t||(t={}))JN.call(t,r)&&Gj(e,r,t[r]);if(Xp)for(var r of Xp(t))ZN.call(t,r)&&Gj(e,r,t[r]);return e},Bne=(e,t)=>{var r={};for(var n in e)JN.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&&ZN.call(e,n)&&(r[n]=e[n]);return r};const Une={order:1},he=f.forwardRef((e,t)=>{const r=H("Title",Une,e),{className:n,order:o,children:i,unstyled:a,size:l,weight:c,inline:u,variant:d}=r,p=Bne(r,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:h,cx:m}=zne({element:`h${o}`,weight:c,inline:u},{name:"Title",unstyled:a,variant:d,size:l});return[1,2,3,4,5,6].includes(o)?S.createElement(re,Vne({variant:d,component:`h${o}`,ref:t,className:m(h.root,n)},p),i):null});he.displayName="@mantine/core/Title";function Xv(e,t){return Xv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Xv(e,t)}function e5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xv(e,t)}var t5={exports:{}},Wne="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Hne=Wne,Gne=Hne;function r5(){}function n5(){}n5.resetWarningCache=r5;var qne=function(){function e(n,o,i,a,l,c){if(c!==Gne){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:n5,resetWarningCache:r5};return r.PropTypes=r,r};t5.exports=qne();var Qne=t5.exports;const Te=by(Qne),qj={disabled:!1},Jp=S.createContext(null);var xl="unmounted",Ni="exited",Ai="entering",Na="entered",Jv="exiting",No=function(e){e5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=o,l=a&&!a.isMounting?n.enter:n.appear,c;return i.appearStatus=null,n.in?l?(c=Ni,i.appearStatus=Ai):c=Na:n.unmountOnExit||n.mountOnEnter?c=xl:c=Ni,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===xl?{status:Ni}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Ai&&a!==Na&&(i=Ai):(a===Ai||a===Na)&&(i=Jv)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},r.updateStatus=function(o,i){o===void 0&&(o=!1),i!==null?(this.cancelNextCallback(),i===Ai?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===Ni&&this.setState({status:xl})},r.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[og.findDOMNode(this),l],u=c[0],d=c[1],p=this.getTimeouts(),h=l?p.appear:p.enter;if(!o&&!a||qj.disabled){this.safeSetState({status:Na},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Ai},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Na},function(){i.props.onEntered(u,d)})})})},r.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:og.findDOMNode(this);if(!i||qj.disabled){this.safeSetState({status:Ni},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Jv},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:Ni},function(){o.props.onExited(l)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:og.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,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===xl)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=X0(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S.createElement(Jp.Provider,{value:null},typeof a=="function"?a(o,l):S.cloneElement(S.Children.only(a),l))},t}(S.Component);No.contextType=Jp;No.propTypes={};function ka(){}No.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ka,onEntering:ka,onEntered:ka,onExit:ka,onExiting:ka,onExited:ka};No.UNMOUNTED=xl;No.EXITED=Ni;No.ENTERING=Ai;No.ENTERED=Na;No.EXITING=Jv;const Kne=No;function Yne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nx(e,t){var r=function(i){return t&&f.isValidElement(i)?t(i):i},n=Object.create(null);return e&&f.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function Xne(e,t){e=e||{},t=t||{};function r(d){return d in t?t[d]:e[d]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var a,l={};for(var c in t){if(n[c])for(a=0;a<n[c].length;a++){var u=n[c][a];l[n[c][a]]=r(u)}l[c]=r(c)}for(a=0;a<o.length;a++)l[o[a]]=r(o[a]);return l}function Bi(e,t,r){return r[t]!=null?r[t]:e.props[t]}function Jne(e,t){return nx(e.children,function(r){return f.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Bi(r,"appear",e),enter:Bi(r,"enter",e),exit:Bi(r,"exit",e)})})}function Zne(e,t,r){var n=nx(e.children),o=Xne(t,n);return Object.keys(o).forEach(function(i){var a=o[i];if(f.isValidElement(a)){var l=i in t,c=i in n,u=t[i],d=f.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:!0,exit:Bi(a,"exit",e),enter:Bi(a,"enter",e)}):!c&&l&&!d?o[i]=f.cloneElement(a,{in:!1}):c&&l&&f.isValidElement(u)&&(o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:u.props.in,exit:Bi(a,"exit",e),enter:Bi(a,"enter",e)}))}}),o}var eoe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},toe={component:"div",childFactory:function(t){return t}},ox=function(e){e5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=i.handleExited.bind(Yne(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}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,i){var a=i.children,l=i.handleExited,c=i.firstRender;return{children:c?Jne(o,l):Zne(o,a,l),firstRender:!1}},r.handleExited=function(o,i){var a=nx(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=rt({},l.children);return delete c[o.key],{children:c}}))},r.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=X0(o,["component","childFactory"]),c=this.state.contextValue,u=eoe(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?S.createElement(Jp.Provider,{value:c},u):S.createElement(Jp.Provider,{value:c},S.createElement(i,l,u))},t}(S.Component);ox.propTypes={};ox.defaultProps=toe;const roe=ox,[noe,$c]=GA("mantine-notifications"),me=$c("show"),ooe=$c("hide"),ioe=$c("clean"),aoe=$c("cleanQueue"),wl=$c("update"),xo={show:me,hide:ooe,clean:ioe,cleanQueue:aoe,update:wl};function soe([e,t],r){const n={};return e==="top"&&(n.top=r),e==="bottom"&&(n.bottom=r),t==="left"&&(n.left=r),t==="right"&&(n.right=r),t==="center"&&(n.left="50%",n.transform="translateX(-50%)"),n}var loe=Object.defineProperty,Qj=Object.getOwnPropertySymbols,coe=Object.prototype.hasOwnProperty,uoe=Object.prototype.propertyIsEnumerable,Kj=(e,t,r)=>t in e?loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yj=(e,t)=>{for(var r in t||(t={}))coe.call(t,r)&&Kj(e,r,t[r]);if(Qj)for(var r of Qj(t))uoe.call(t,r)&&Kj(e,r,t[r]);return e};const Xj={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},doe={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function foe({state:e,maxHeight:t,positioning:r,transitionDuration:n}){const[o,i]=r,a=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:Xj[a],transitionDuration:`${n}ms, ${n}ms, ${n}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},c={opacity:1,transform:doe[a]},u={opacity:0,maxHeight:0,transform:Xj[a]},d={entering:c,entered:c,exiting:u,exited:u};return Yj(Yj({},l),d[e])}function poe(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}var hoe=Object.defineProperty,moe=Object.defineProperties,goe=Object.getOwnPropertyDescriptors,Zp=Object.getOwnPropertySymbols,o5=Object.prototype.hasOwnProperty,i5=Object.prototype.propertyIsEnumerable,Jj=(e,t,r)=>t in e?hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zj=(e,t)=>{for(var r in t||(t={}))o5.call(t,r)&&Jj(e,r,t[r]);if(Zp)for(var r of Zp(t))i5.call(t,r)&&Jj(e,r,t[r]);return e},voe=(e,t)=>moe(e,goe(t)),eO=(e,t)=>{var r={};for(var n in e)o5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zp)for(var n of Zp(e))t.indexOf(n)<0&&i5.call(e,n)&&(r[n]=e[n]);return r};function a5(e){var t=e,{notification:r,autoClose:n,onHide:o,innerRef:i}=t,a=eO(t,["notification","autoClose","onHide","innerRef"]);const l=r,{autoClose:c,message:u}=l,d=eO(l,["autoClose","message"]),p=poe(n,c),h=f.useRef(),m=()=>{o(r.id),window.clearTimeout(h.current)},v=()=>{clearTimeout(h.current)},g=()=>{typeof p=="number"&&(h.current=window.setTimeout(m,p))};return f.useEffect(()=>{typeof r.onOpen=="function"&&r.onOpen(r)},[]),f.useEffect(()=>(g(),v),[n,r.autoClose]),S.createElement($D,voe(Zj(Zj({},d),a),{onClose:m,onMouseEnter:v,onMouseLeave:g,ref:i}),u)}a5.displayName="@mantine/notifications/NotificationContainer";var yoe=W((e,{zIndex:t})=>({notifications:{width:`calc(100% - ${e.spacing.md} * 2)`,boxSizing:"border-box",position:"fixed",zIndex:t},notification:{"&:not(:first-of-type)":{marginTop:e.spacing.sm}}}));const xoe=yoe;var woe=Object.defineProperty,_oe=Object.defineProperties,boe=Object.getOwnPropertyDescriptors,tO=Object.getOwnPropertySymbols,Soe=Object.prototype.hasOwnProperty,Poe=Object.prototype.propertyIsEnumerable,rO=(e,t,r)=>t in e?woe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,joe=(e,t)=>{for(var r in t||(t={}))Soe.call(t,r)&&rO(e,r,t[r]);if(tO)for(var r of tO(t))Poe.call(t,r)&&rO(e,r,t[r]);return e},Ooe=(e,t)=>_oe(e,boe(t));function Coe({limit:e}){const{state:t,queue:r,update:n,cleanQueue:o}=CL({initialValues:[],limit:e});return{notifications:t,queue:r,showNotification:u=>{const d=u.id||kh();return n(p=>u.id&&p.some(h=>h.id===u.id)?p:[...p,Ooe(joe({},u),{id:d})]),d},updateNotification:u=>n(d=>{const p=d.findIndex(m=>m.id===u.id);if(p===-1)return d;const h=[...d];return h[p]=u,h}),hideNotification:u=>n(d=>d.filter(p=>p.id===u?(typeof p.onClose=="function"&&p.onClose(p),!1):!0)),cleanQueue:o,clean:()=>n(()=>[])}}var Eoe=Object.defineProperty,eh=Object.getOwnPropertySymbols,s5=Object.prototype.hasOwnProperty,l5=Object.prototype.propertyIsEnumerable,nO=(e,t,r)=>t in e?Eoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Og=(e,t)=>{for(var r in t||(t={}))s5.call(t,r)&&nO(e,r,t[r]);if(eh)for(var r of eh(t))l5.call(t,r)&&nO(e,r,t[r]);return e},$oe=(e,t)=>{var r={};for(var n in e)s5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&eh)for(var n of eh(e))t.indexOf(n)<0&&l5.call(e,n)&&(r[n]=e[n]);return r};const koe=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],ga=e=>{var t=e,{className:r,position:n="bottom-right",autoClose:o=4e3,transitionDuration:i=250,containerWidth:a=j(440),notificationMaxHeight:l=j(200),limit:c=5,zIndex:u=Cn("overlay"),style:d,children:p,target:h}=t,m=$oe(t,["className","position","autoClose","transitionDuration","containerWidth","notificationMaxHeight","limit","zIndex","style","children","target"]);const v=bL(),g=f.useRef({}),b=f.useRef(0),{notifications:y,showNotification:x,updateNotification:_,hideNotification:w,clean:O,cleanQueue:C}=Coe({limit:c}),{classes:P,cx:E,theme:k}=xoe({zIndex:u}),$=Rh(),T=(k.respectReducedMotion?$:!1)?1:i,z=(koe.includes(n)?n:"bottom-right").split("-");rn(()=>{y.length>b.current&&setTimeout(()=>v(),0),b.current=y.length},[y]),noe({show:x,hide:w,update:_,clean:O,cleanQueue:C});const M=y.map(L=>S.createElement(Kne,{key:L.id,timeout:T,onEnter:()=>g.current[L.id].offsetHeight,nodeRef:{current:g.current[L.id]}},q=>S.createElement(a5,{innerRef:Y=>{g.current[L.id]=Y},notification:L,onHide:w,className:P.notification,autoClose:o,sx:[Og({},foe({state:q,positioning:z,transitionDuration:T,maxHeight:l})),...Array.isArray(L.sx)?L.sx:[L.sx]]})));return S.createElement(C0,{target:h},S.createElement(oe,Og({className:E(P.notifications,r),style:d,sx:Og({maxWidth:a},soe(z,k.spacing.md))},m),S.createElement(roe,null,M)))};ga.displayName="@mantine/notifications/Notifications";ga.show=xo.show;ga.hide=xo.hide;ga.update=xo.update;ga.clean=xo.clean;ga.cleanQueue=xo.cleanQueue;class Roe{constructor(t,r){this.operator=t,this.child=r}toString(){return`${this.operator}(${this.child.toString()})`}}class kc{constructor(t,r,n){this.operator=t,this.left=r,this.right=n}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class Toe{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,r){return this.infixParselets[t]=r,this}registerPrefix(t,r){return this.prefixParselets[t]=r,this}prefix(t,r,n){return this.registerPrefix(t,{parse(o,i){const a=o.consumeAndParse(r);return n(i,a)}})}infixLeft(t,r,n){return this.registerInfix(t,{parse(o,i,a){const l=o.consumeAndParse(r);return n(i,a,l)},precedence:r})}construct(t){return new Ioe(t,this.prefixParselets,this.infixParselets)}}class Ioe{constructor(t,r,n){this.tokens=t,this.prefixParselets=r,this.infixParselets=n}hasMore(){return this.tokens.length>0}match(t){const r=this.peek();return(r==null?void 0:r.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const 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();){const i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const 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){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" at line ${i.line} column ${i.column}.`)}if(r&&((o=this.peek())==null?void 0:o.value)!==r){const i=this.peek();throw Error(`Expected "${r}" but got "${i.value}" at line ${i.line} column ${i.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]}}function dt(e){const t=et(e),r=Co(e);return r===t?{reference:t}:{reference:t,display:r}}function et(e){return wa(e)?e.reference:`${e.resourceType}/${e.id}`}function ix(e){if(e)return wa(e)?e.reference.split("/")[1]:e.id}function Doe(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Co(e){var t;if(Doe(e)){const r=Noe(e);if(r)return r}if(e.resourceType==="Device"){const r=Aoe(e);if(r)return r}return e.resourceType==="Observation"&&"code"in e&&(t=e.code)!=null&&t.text?e.code.text:e.resourceType==="User"&&e.email?e.email:"name"in e&&e.name&&typeof e.name=="string"?e.name:et(e)}function Noe(e){const t=e.name;if(t&&t.length>0)return Rc(t[0])}function Aoe(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function Moe(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const r of t){const n=oO(r);if(n)return n}else return oO(t)}function oO(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function c5(e,t){const r=new Date(e);r.setUTCHours(0,0,0,0);const n=t?new Date(t):new Date;n.setUTCHours(0,0,0,0);const o=r.getUTCFullYear(),i=r.getUTCMonth(),a=r.getUTCDate(),l=n.getUTCFullYear(),c=n.getUTCMonth(),u=n.getUTCDate();let d=l-o;(c<i||c===i&&u<a)&&d--;let p=l*12+c-(o*12+i);u<a&&p--;const h=Math.floor((n.getTime()-r.getTime())/(1e3*60*60*24));return{years:d,months:p,days:h}}function Loe(e,t){const{years:r,months:n,days:o}=c5(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 ax(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(i=>i.url===t[o]);return r}function sr(e,t){return JSON.stringify(e,zoe,t?2:void 0)}function zoe(e,t){return!Foe(e)&&mo(t)?void 0:t}function Foe(e){return!!/\d+$/.exec(e)}function mo(e){if(e==null)return!0;const t=typeof e;return t==="string"&&e===""||t==="object"&&Object.keys(e).length===0}function am(e,t,r){return e===t||mo(e)&&mo(t)?!0:mo(e)||mo(t)?!1:Array.isArray(e)&&Array.isArray(t)?Voe(e,t):Array.isArray(e)||Array.isArray(t)?!1:Lu(e)&&Lu(t)?Boe(e,t,r):(Lu(e)||Lu(t),!1)}function Voe(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!am(e[r],t[r]))return!1;return!0}function Boe(e,t,r){const 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(const o of n){const i=e[o],a=t[o];if(!am(i,a,o))return!1}return!0}function va(e){return JSON.parse(JSON.stringify(e))}function u5(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Lu(e){return e!==null&&typeof e=="object"}const d5=[];for(let e=0;e<256;e++)d5.push(e.toString(16).padStart(2,"0"));function Uoe(e){const t=new Uint8Array(e),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=d5[t[n]];return r.join("")}function Woe(e){const 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 hr(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Hoe(e,t){var r,n;return(n=(r=e.coding)==null?void 0:r.find(o=>o.system===t))==null?void 0:n.code}const iO=e=>new Promise(t=>{setTimeout(t,e)});function Goe(e,t){const r=[];if(e.line&&r.push(...e.line),e.city||e.state||e.postalCode){const 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 Rc(e,t){const r=[];return e.prefix&&(t==null?void 0:t.prefix)!==!1&&r.push(...e.prefix),e.given&&r.push(...e.given),e.family&&r.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&r.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.length===0&&e.text?e.text:r.join(" ").trim()}function sm(e){return e instanceof Date&&!isNaN(e.getTime())}function qoe(e,t,r){if(!e)return"";const n=new Date("2000-01-01T"+e+"Z");return sm(n)?n.toLocaleTimeString(t,r):""}function kr(e,t,r){if(!e)return"";const n=new Date(e);return sm(n)?n.toLocaleString(t,r):""}function Qoe(e,t,r){return!e||!e.start&&!e.end?"":kr(e.start,t,r)+" - "+kr(e.end,t,r)}const Koe={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},Yoe={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},Xoe={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function f5(e){if(!e)return"";const t=[];return Joe(t,e.repeat),e.event&&t.push(e.event.map(r=>kr(r)).join(", ")),hr(t.join(" ").trim())}function Joe(e,t){if(!(t!=null&&t.periodUnit))return;const r=t.frequency??1,n=t.period??1,o=t.periodUnit;r===1&&n===1?e.push(Koe[o]):(r===1?e.push("once"):e.push(r+" times"),n===1?e.push("per "+Yoe[o]):e.push("per "+n+" "+Xoe[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(hr).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>qoe(i)).join(", "))}function ic(e,t,r=!1){if(r&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const 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=tie(n.value,t),`> ${Ko(n,t)}`):`>= ${Ko(n,t)}`:(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)!==void 0?r&&t!==void 0?(o.value=eie(o.value,t),`< ${Ko(o,t)}`):`<= ${Ko(o,t)}`:((n==null?void 0:n.unit)===(o==null?void 0:o.unit)&&(n==null||delete n.unit),`${Ko(n,t)} - ${Ko(o,t)}`)}function Ko(e,t){if(!e)return"";const r=[];return e.comparator&&(r.push(e.comparator),r.push(" ")),e.value!==void 0&&(t!==void 0?r.push(e.value.toFixed(t)):r.push(e.value)),e.unit&&(e.unit!=="%"&&r[r.length-1]!==" "&&r.push(" "),r.push(e.unit)),r.join("").trim()}function Zoe(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ws(e){return e?e.text?e.text:e.coding?e.coding.map(t=>ya(t)).join(", "):"":""}function ya(e){return(e==null?void 0:e.display)??(e==null?void 0:e.code)??""}function p5(e){return e?"component"in e?e.component.map(t=>p5(t)).join(" / "):e.valueQuantity?Ko(e.valueQuantity):e.valueCodeableConcept?ws(e.valueCodeableConcept):e.valueString?e.valueString:"":""}function eie(e,t,r=1){return(h5(e,t)+r)*Math.pow(10,-t)}function tie(e,t,r=1){return(h5(e,t)-r)*Math.pow(10,-t)}function h5(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}function rie(e){const t=e.max&&e.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:e.max;return{path:"",description:"",type:e.type??[],min:e.min??0,max:t??1,isArray:!!t&&t>1,constraints:[]}}function nie(e){const t=Object.create(null);for(const[r,n]of Object.entries(e))t[r]={name:r,elements:Object.fromEntries(Object.entries(n.elements).map(([o,i])=>[o,rie(i)])),constraints:[],innerTypes:[]};return t}const oie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},iie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},aie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"code"}]},text:{type:[{code:"string"}]},line:{max:9007199254740991,type:[{code:"string"}]},city:{type:[{code:"string"}]},district:{type:[{code:"string"}]},state:{type:[{code:"string"}]},postalCode:{type:[{code:"string"}]},country:{type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},sie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},lie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"author[x]":{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]},{code:"string"}]},time:{type:[{code:"dateTime"}]},text:{min:1,type:[{code:"markdown"}]}}},cie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},contentType:{type:[{code:"code"}]},language:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]},url:{type:[{code:"url"}]},size:{type:[{code:"unsignedInt"}]},hash:{type:[{code:"base64Binary"}]},title:{type:[{code:"string"}]},creation:{type:[{code:"dateTime"}]}}},uie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},die={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},fie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},pie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"code"}]},value:{type:[{code:"string"}]},use:{type:[{code:"code"}]},rank:{type:[{code:"positiveInt"}]},period:{type:[{code:"Period"}]}}},hie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{min:1,type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]}}},mie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},gie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},vie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},yie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity"}]},maxDosePerLifetime:{type:[{code:"Quantity"}]}}},xie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},wie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},representation:{max:9007199254740991,type:[{code:"code"}]},sliceName:{type:[{code:"string"}]},sliceIsConstraining:{type:[{code:"boolean"}]},label:{type:[{code:"string"}]},code:{max:9007199254740991,type:[{code:"Coding"}]},slicing:{type:[{code:"ElementDefinitionSlicing"}]},short:{type:[{code:"string"}]},definition:{type:[{code:"markdown"}]},comment:{type:[{code:"markdown"}]},requirements:{type:[{code:"markdown"}]},alias:{max:9007199254740991,type:[{code:"string"}]},min:{type:[{code:"unsignedInt"}]},max:{type:[{code:"string"}]},base:{type:[{code:"ElementDefinitionBase"}]},contentReference:{type:[{code:"uri"}]},type:{max:9007199254740991,type:[{code:"ElementDefinitionType"}]},"defaultValue[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},meaningWhenMissing:{type:[{code:"markdown"}]},orderMeaning:{type:[{code:"string"}]},"fixed[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},"pattern[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},example:{max:9007199254740991,type:[{code:"ElementDefinitionExample"}]},"minValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},"maxValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},maxLength:{type:[{code:"integer"}]},condition:{max:9007199254740991,type:[{code:"id"}]},constraint:{max:9007199254740991,type:[{code:"ElementDefinitionConstraint"}]},mustSupport:{type:[{code:"boolean"}]},isModifier:{type:[{code:"boolean"}]},isModifierReason:{type:[{code:"string"}]},isSummary:{type:[{code:"boolean"}]},binding:{type:[{code:"ElementDefinitionBinding"}]},mapping:{max:9007199254740991,type:[{code:"ElementDefinitionMapping"}]}}},_ie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},description:{type:[{code:"string"}]},name:{type:[{code:"id"}]},language:{min:1,type:[{code:"code"}]},expression:{type:[{code:"string"}]},reference:{type:[{code:"uri"}]}}},bie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"string"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},Sie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:9007199254740991,type:[{code:"string"}]},prefix:{max:9007199254740991,type:[{code:"string"}]},suffix:{max:9007199254740991,type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},Pie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"CodeableConcept"}]},system:{type:[{code:"uri"}]},value:{type:[{code:"string"}]},period:{type:[{code:"Period"}]},assigner:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},jie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},Oie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},Cie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},Eie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},$ie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"code"}]},use:{min:1,type:[{code:"code"}]},min:{type:[{code:"integer"}]},max:{type:[{code:"string"}]},documentation:{type:[{code:"string"}]},type:{min:1,type:[{code:"code"}]},profile:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},kie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},Rie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"age[x]":{type:[{code:"Range"},{code:"CodeableConcept"}]},gender:{type:[{code:"CodeableConcept"}]},race:{type:[{code:"CodeableConcept"}]},physiologicalCondition:{type:[{code:"CodeableConcept"}]}}},Tie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},height:{type:[{code:"Quantity"}]},width:{type:[{code:"Quantity"}]},depth:{type:[{code:"Quantity"}]},weight:{type:[{code:"Quantity"}]},nominalVolume:{type:[{code:"Quantity"}]},externalDiameter:{type:[{code:"Quantity"}]},shape:{type:[{code:"string"}]},color:{max:9007199254740991,type:[{code:"string"}]},imprint:{max:9007199254740991,type:[{code:"string"}]},image:{max:9007199254740991,type:[{code:"Attachment"}]},scoring:{type:[{code:"CodeableConcept"}]}}},Iie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},identifier:{type:[{code:"Identifier"}]},type:{min:1,type:[{code:"CodeableConcept"}]},period:{min:1,type:[{code:"Quantity"}]},specialPrecautionsForStorage:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},Die={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Nie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity"}]},high:{type:[{code:"Quantity"}]}}},Aie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},Mie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},Lie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},label:{type:[{code:"string"}]},display:{type:[{code:"string"}]},citation:{type:[{code:"markdown"}]},url:{type:[{code:"url"}]},document:{type:[{code:"Attachment"}]},resource:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/Resource"]}]}}},zie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity"}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},Fie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,max:9007199254740991,type:[{code:"Coding"}]},when:{min:1,type:[{code:"instant"}]},who:{min:1,type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},onBehalfOf:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},targetFormat:{type:[{code:"code"}]},sigFormat:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]}}},Vie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"amount[x]":{type:[{code:"Quantity"},{code:"Range"},{code:"string"}]},amountType:{type:[{code:"CodeableConcept"}]},amountText:{type:[{code:"string"}]},referenceRange:{type:[{code:"SubstanceAmountReferenceRange"}]}}},Bie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},event:{max:9007199254740991,type:[{code:"dateTime"}]},repeat:{type:[{code:"TimingRepeat"}]},code:{type:[{code:"CodeableConcept"}]}}},Uie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{type:[{code:"string"}]},"timing[x]":{type:[{code:"Timing"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Schedule"]},{code:"date"},{code:"dateTime"}]},data:{max:9007199254740991,type:[{code:"DataRequirement"}]},condition:{type:[{code:"Expression"}]}}},Wie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"Coding"}]},"value[x]":{min:1,type:[{code:"CodeableConcept"},{code:"Quantity"},{code:"Range"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ResearchStudy","http://hl7.org/fhir/StructureDefinition/InsurancePlan","http://hl7.org/fhir/StructureDefinition/HealthcareService","http://hl7.org/fhir/StructureDefinition/Group","http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},Hie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Gie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},qie={elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},Qie={elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}},Kie={Element:oie,BackboneElement:iie,Address:aie,Age:sie,Annotation:lie,Attachment:cie,CodeableConcept:uie,Coding:die,ContactDetail:fie,ContactPoint:pie,Contributor:hie,Count:mie,DataRequirement:gie,Distance:vie,Dosage:yie,Duration:xie,ElementDefinition:wie,Expression:_ie,Extension:bie,HumanName:Sie,Identifier:Pie,MarketingStatus:jie,Meta:Oie,Money:Cie,Narrative:Eie,ParameterDefinition:$ie,Period:kie,Population:Rie,ProdCharacteristic:Tie,ProductShelfLife:Iie,Quantity:Die,Range:Nie,Ratio:Aie,Reference:Mie,RelatedArtifact:Lie,SampledData:zie,Signature:Fie,SubstanceAmount:Vie,Timing:Bie,TriggerDefinition:Uie,UsageContext:Wie,MoneyQuantity:Hie,SimpleQuantity:Gie,MetadataResource:qie,IdentityProvider:Qie};function ve(e){return[{type:B.boolean,value:e}]}function Zn(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:B.integer,value:e}:typeof e=="number"?{type:B.decimal,value:e}:typeof e=="boolean"?{type:B.boolean,value:e}:typeof e=="string"?{type:B.string,value:e}:an(e)?{type:B.Quantity,value:e}:Ao(e)?{type:e.resourceType,value:e}:{type:B.BackboneElement,value:e}}function ri(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 fr(e,t){if(!e.value)return;const r=xa(e.type,t);return r?Yie(e,t,r):Xie(e,t)}function Yie(e,t,r){const n=r.type;if(!n||n.length===0)return;let o,i="undefined";if(n.length===1)o=e.value[t],i=n[0].code;else for(const l of n){const c=t.replace("[x]","")+hr(l.code);if(c in e.value){o=e.value[c],i=l.code;break}}const a=e.value["_"+t];if(a&&(Array.isArray(o)?o=o.map((l,c)=>a[c]?cO(l??{},a[c]):l):o=cO(o??{},a)),!mo(o))return(i==="Element"||i==="BackboneElement")&&(i=r.type[0].code),Array.isArray(o)?o.map(l=>aO(l,i)):aO(o,i)}function aO(e,t){return t==="Resource"&&Ao(e)&&(t=e.resourceType),{type:t,value:e}}function Xie(e,t){const r=e.value;if(!r||typeof r!="object")return;let n;if(t in r)n=r[t];else for(const o in B){const i=t+hr(o);if(i in r){n=r[i];break}}if(!mo(n))return Array.isArray(n)?n.map(Zn):Zn(n)}function m5(e){const t=[];for(const r of e){let n=!1;for(const o of t)if(ri(y5(r,o))){n=!0;break}n||t.push(r)}return t}function g5(e){return ve(!ri(e))}function v5(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ve(!1):ve(e.every((r,n)=>ri(y5(r,t[n]))))}function y5(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?ve(Math.abs(r-n)<1e-8):an(r)&&an(n)?ve(_5(r,n)):ve(typeof r=="object"&&typeof n=="object"?sx(e,t):r===n)}function x5(e,t){return e.length===0&&t.length===0?ve(!0):e.length!==t.length?ve(!1):(e.sort(sO),t.sort(sO),ve(e.every((r,n)=>ri(Jie(r,t[n])))))}function Jie(e,t){const{type:r,value:n}=e,{type:o,value:i}=t,a=n==null?void 0:n.valueOf(),l=i==null?void 0:i.valueOf();return typeof a=="number"&&typeof l=="number"?ve(Math.abs(a-l)<.01):an(a)&&an(l)?ve(_5(a,l)):ve(r==="Coding"&&o==="Coding"?typeof a!="object"||typeof l!="object"?!1:a.code===l.code&&a.system===l.system:typeof a=="object"&&typeof l=="object"?sx({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function sO(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?r-n:typeof r=="string"&&typeof n=="string"?r.localeCompare(n):0}function w5(e,t){const{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 Zie(r);case"Quantity":return an(r);default:return typeof r=="object"&&(r==null?void 0:r.resourceType)===t}}function Zie(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 _5(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 sx(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r){const i=e[o],a=t[o];if(lO(i)&&lO(a)){if(!sx(i,a))return!1}else if(i!==a)return!1}return!0}function lO(e){return e!==null&&typeof e=="object"}function cO(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}const b5="ok",eae="created",tae="gone",rae="not-modified",nae="not-found",oae="forbidden",iae="accepted",aae={resourceType:"OperationOutcome",id:b5,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},sae={resourceType:"OperationOutcome",id:nae,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},lae={resourceType:"OperationOutcome",id:oae,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function qi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function Rt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function cae(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function lm(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function S5(e){return e.id===b5||e.id===eae||e.id===rae||e.id===iae}function uae(e){return e.id===tae}class Ie extends Error{constructor(t,r){super(P5(t)),this.outcome=t,this.cause=r}}function ct(e){return e instanceof Ie?e.outcome:lm(e)?e:qi(Ee(e))}function Ee(e){return e?typeof e=="string"?e:e instanceof Error?e.message:lm(e)?P5(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function P5(e){var r;const t=((r=e.issue)==null?void 0:r.map(j5))??[];return t.length>0?t.join("; "):"Unknown error"}function j5(e){var r,n;let t;return(r=e.details)!=null&&r.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(n=e.expression)!=null&&n.length&&(t+=` (${e.expression.join(", ")})`),t}function dae(e){return new mae(e).parse()}const ac=nie(Kie);function fae(e){var r;const t=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];for(const n of t)pae(n)}function pae(e){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=dae(e);ac[e.name]=t;for(const r of t.innerTypes)r.parentType=t,ac[r.name]=r}function hae(e){return!!ac[e]}function lx(e){return ac[e]}function O5(e){const t=ac[e];if(!t)throw new Ie(cae(Error("Unknown data type: "+e)));return t}class mae{constructor(t){var r;if(!((r=t.snapshot)!=null&&r.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,url:t.url,kind:t.kind,description:yae(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var r,n,o,i,a;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((r=t.id)!=null&&r.includes(":")){if((n=this.slicingContext)!=null&&n.current){const l=Cg(t,this.slicingContext.path);this.slicingContext.current.elements[l]=this.parseElementDefinition(t)}}else{const l=this.parseElementDefinition(t);this.checkFieldEnter(t,l);let c=this.backboneContext;for(;c;){if((o=t.path)!=null&&o.startsWith(c.path+".")){c.type.elements[Cg(t,c.path)]=l;break}c=c.parent}if(!c){const u=Cg(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,r){this.isInnerType(t)&&this.enterInnerType(t),t.slicing&&!this.slicingContext&&this.enterSlice(t,r)}enterInnerType(t){var r,n,o;for(;this.backboneContext&&!Ra((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:fO(t),description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Ra((n=this.backboneContext)==null?void 0:n.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,r){var n,o,i,a;vae(t)&&!((n=this.peek())!=null&&n.sliceName)||(r.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(a=t.slicing)==null?void 0:a.rules},this.slicingContext={field:r.slicing,path:t.path??""})}checkFieldExit(t=void 0){var r;if(this.backboneContext&&!Ra(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Ra(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),delete this.backboneContext;this.slicingContext&&!Ra(this.slicingContext.path,t==null?void 0:t.path)&&((r=this.slicingContext)!=null&&r.current&&this.slicingContext.field.slices.push(this.slicingContext.current),delete this.slicingContext)}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const r=this.elementIndex[t.contentReference.slice(t.contentReference.indexOf("#")+1)];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var n;const r=this.peek();return!!(Ra(t==null?void 0:t.path,r==null?void 0:r.path)&&((n=t.type)!=null&&n.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){var r;if(!this.slicingContext)throw new Error("Invalid slice start before discriminator: "+t.sliceName);this.slicingContext.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:t.sliceName??"",type:(r=t.type)==null?void 0:r.map(n=>({code:n.code??"",targetProfile:n.targetProfile})),elements:{},min:t.min??0,max:t.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(t.max,10)}}parseElementDefinition(t){var i,a;const r=uO(t.max),n=(i=t.base)!=null&&i.max?uO(t.base.max):r,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((a=t.base)==null?void 0:a.path)||"",min:t.min??0,max:r,isArray:n>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:(t.type??[]).map(l=>({code:["BackboneElement","Element"].includes(l.code)?fO(t):l.code??"",targetProfile:l.targetProfile})),fixed:dO(fr(o,"fixed")),pattern:dO(fr(o,"pattern")),binding:t.binding}}}function uO(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Cg(e,t=""){return gae(e.path,t)}function gae(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Ra(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function dO(e){return Array.isArray(e)&&e.length>0?e[0]:mo(e)?void 0:e}function vae(e){var r,n;const t=(r=e.slicing)==null?void 0:r.discriminator;return!!((n=e.type)!=null&&n.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function yae(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}const B={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function xae(e){for(const t of e.base??[]){let r=gi.types[t];r||(r={searchParamsDetails:{}},gi.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 fO(e){var r,n,o,i;const t=(n=(r=e.type)==null?void 0:r[0])==null?void 0:n.code;return t==="BackboneElement"||t==="Element"?wae((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function wae(e){return e.length===1?e[0]:e.map(hr).join("")}function cx(e){var t;return(t=gi.types[e])==null?void 0:t.searchParams}function _ae(e,t){var r,n;return(n=(r=gi.types[e])==null?void 0:r.searchParams)==null?void 0:n[t]}function th(e){return e.replaceAll("[x]","").split(".").pop().split(/(?=[A-Z])/).map(Sae).join(" ").replace("_"," ").replace(/\s+/g," ")}const bae=new Set(["ID","IP","PKCE","JWKS","URI","URL"]);function Sae(e){const t=e.toUpperCase();return bae.has(t)?t:t.charAt(0)+e.slice(1)}function xa(e,t){const r=lx(e);if(r)return r.elements[t]??r.elements[t+"[x]"]}function Ao(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function wa(e){return!!(e&&typeof e=="object"&&"reference"in e)}const gi={types:{}};function dd(e){if(e.startsWith("T"))return e+"T00:00:00.000Z".substring(e.length);if(e.length<=10)return e;try{return new Date(e).toISOString()}catch{return e}}const sl=()=>[],wr={empty:(e,t)=>ve(t.length===0),exists:(e,t,r)=>ve(r?t.filter(n=>ri(r.eval(e,[n]))).length>0:t.length>0),all:(e,t,r)=>ve(t.every(n=>ri(r.eval(e,[n])))),allTrue:(e,t)=>{for(const r of t)if(!r.value)return ve(!1);return ve(!0)},anyTrue:(e,t)=>{for(const r of t)if(r.value)return ve(!0);return ve(!1)},allFalse:(e,t)=>{for(const r of t)if(r.value)return ve(!1);return ve(!0)},anyFalse:(e,t)=>{for(const r of t)if(!r.value)return ve(!0);return ve(!1)},subsetOf:sl,supersetOf:sl,count:(e,t)=>[{type:B.integer,value:t.length}],distinct:(e,t)=>{const r=[];for(const n of t)r.some(o=>o.value===n.value)||r.push(n);return r},isDistinct:(e,t)=>ve(t.length===wr.distinct(e,t).length),where:(e,t,r)=>t.filter(n=>ri(r.eval(e,[n]))),select:(e,t,r)=>t.map(n=>r.eval(e,[n])).flat(),repeat:sl,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;const 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;const 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;const n=r.eval(e,t),o=[];for(const i of t)!o.some(a=>a.value===i.value)&&n.some(a=>a.value===i.value)&&o.push(i);return o},exclude:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t),o=[];for(const i of t)n.some(a=>a.value===i.value)||o.push(i);return o},union:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return m5([...t,...n])},combine:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return[...t,...n]},htmlChecks:(e,t,r)=>[Zn(!0)],iif:(e,t,r,n,o)=>{const i=r.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ri(i)?n.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);if(typeof r=="boolean")return[{type:B.boolean,value:r}];if(typeof r=="number"&&(r===0||r===1))return ve(!!r);if(typeof r=="string"){const n=r.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(n))return ve(!0);if(["false","f","no","n","0","0.0"].includes(n))return ve(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ve(wr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="number"?[{type:B.integer,value:r}]:typeof r=="string"&&/^[+-]?\d+$/.exec(r)?[{type:B.integer,value:parseInt(r,10)}]:typeof r=="boolean"?[{type:B.integer,value:r?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ve(wr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.date,value:dd(r)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ve(wr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.dateTime,value:dd(r)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ve(wr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="number"?[{type:B.decimal,value:r}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(r)?[{type:B.decimal,value:parseFloat(r)}]:typeof r=="boolean"?[{type:B.decimal,value:r?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ve(wr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return an(r)?[{type:B.Quantity,value:r}]:typeof r=="number"?[{type:B.Quantity,value:{value:r,unit:"1"}}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(r)?[{type:B.Quantity,value:{value:parseFloat(r),unit:"1"}}]:typeof r=="boolean"?[{type:B.Quantity,value:{value:r?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ve(wr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return r==null?[]:an(r)?[{type:B.string,value:`${r.value} '${r.unit}'`}]:[{type:B.string,value:r.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ve(wr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);if(typeof r=="string"){const n=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(r);if(n)return[{type:B.time,value:dd("T"+n[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ve(wr.toTime(e,t).length===1),indexOf:(e,t,r)=>Yr((n,o)=>n.indexOf(o),e,t,r),substring:(e,t,r,n)=>Yr((o,i,a)=>{const l=i,c=a?l+a:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,r,n),startsWith:(e,t,r)=>Yr((n,o)=>n.startsWith(o),e,t,r),endsWith:(e,t,r)=>Yr((n,o)=>n.endsWith(o),e,t,r),contains:(e,t,r)=>Yr((n,o)=>n.includes(o),e,t,r),upper:(e,t)=>Yr(r=>r.toUpperCase(),e,t),lower:(e,t)=>Yr(r=>r.toLowerCase(),e,t),replace:(e,t,r,n)=>Yr((o,i,a)=>o.replaceAll(i,a),e,t,r,n),matches:(e,t,r)=>Yr((n,o)=>!!new RegExp(o).exec(n),e,t,r),replaceMatches:(e,t,r,n)=>Yr((o,i,a)=>o.replaceAll(i,a),e,t,r,n),length:(e,t)=>Yr(r=>r.length,e,t),toChars:(e,t)=>Yr(r=>r?r.split(""):void 0,e,t),abs:(e,t)=>zn(Math.abs,e,t),ceiling:(e,t)=>zn(Math.ceil,e,t),exp:(e,t)=>zn(Math.exp,e,t),floor:(e,t)=>zn(Math.floor,e,t),ln:(e,t)=>zn(Math.log,e,t),log:(e,t,r)=>zn((n,o)=>Math.log(n)/Math.log(o),e,t,r),power:(e,t,r)=>zn(Math.pow,e,t,r),round:(e,t)=>zn(Math.round,e,t),sqrt:(e,t)=>zn(Math.sqrt,e,t),truncate:(e,t)=>zn(r=>r|0,e,t),children:sl,descendants:sl,trace:(e,t,r)=>(console.log("trace",t,r),t),now:()=>[{type:B.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:B.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:B.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,r,n,o)=>{var u;const i=wr.toDateTime(e,r.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=wr.toDateTime(e,n.eval(e,t));if(a.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=c5(i[0].value,a[0].value);return[{type:B.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,r)=>{let n="";return r instanceof ux?n=r.name:r instanceof fx&&(n=r.left.name+"."+r.right.name),n?t.map(o=>({type:B.boolean,value:w5(o,n)})):[]},not:(e,t)=>wr.toBoolean(e,t).map(r=>({type:B.boolean,value:!r.value})),resolve:(e,t)=>t.map(r=>{const n=r.value;let o;if(typeof n=="string")o=n;else if(typeof n=="object"){const i=n;if(i.resource)return Zn(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,a]=o.split("/");return{type:i,value:{resourceType:i,id:a}}}return{type:B.BackboneElement,value:void 0}}).filter(r=>!!r.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:r})=>typeof r=="boolean"?{type:B.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof r=="number"?{type:B.BackboneElement,value:{namespace:"System",name:"Integer"}}:Ao(r)?{type:B.BackboneElement,value:{namespace:"FHIR",name:r.resourceType}}:{type:B.BackboneElement,value:null}),conformsTo:(e,t,r)=>{const n=r.eval(e,t)[0].value;if(!n.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=n.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var a;return{type:B.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})}};function Yr(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=Bn(r,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...n.map(a=>{var l;return(l=a==null?void 0:a.eval(t,r)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(Zn):[Zn(i)]}function zn(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=Bn(r,1),i=an(o),a=i?o.value:o;if(typeof a!="number")throw new Error("Math function cannot be called with non-number");const l=e(a,...n.map(d=>{var p;return(p=d.eval(t,r)[0])==null?void 0:p.value})),c=i?B.Quantity:r[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function Bn(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const r of e)if(r==null)throw new Error("Expected non-null argument");return e}class Pae{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()}}class Ta{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class ux{constructor(t){this.name=t}eval(t,r){if(this.name==="$this")return r;if(this.name.startsWith("%")){const 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){const r=t.value;if(!(!r||typeof r!="object"))return Ao(r)&&r.resourceType===this.name?t:fr(t,this.name)}toString(){return this.name}}class jae{eval(){return[]}toString(){return"{}"}}class Oae extends Roe{constructor(t,r,n){super(t,r),this.impl=n}eval(t,r){return this.impl(this.child.eval(t,r))}toString(){return this.operator+this.child.toString()}}class dx extends kc{constructor(t,r){super("as",t,r)}eval(t,r){return wr.ofType(t,this.left.eval(t,r),this.right)}}class Ir extends kc{}class hn extends Ir{constructor(t,r,n,o){super(t,r,n),this.impl=o}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.eval(t,r);if(o.length!==1)return[];const i=n[0].value,a=o[0].value,l=an(i)?i.value:i,c=an(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?ve(u):an(i)?[{type:B.Quantity,value:{...i,value:u}}]:[Zn(u)]}}class Cae extends kc{constructor(t,r){super("&",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r),i=[...n,...o];return i.length>0&&i.every(a=>typeof a.value=="string")?[{type:B.string,value:i.map(a=>a.value).join("")}]:i}}class Eae extends Ir{constructor(t,r){super("contains",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return ve(n.some(i=>i.value===o[0].value))}}class $ae extends Ir{constructor(t,r){super("in",t,r)}eval(t,r){const n=Eo(this.left.eval(t,r)),o=this.right.eval(t,r);return n?ve(o.some(i=>i.value===n.value)):[]}}class fx extends kc{constructor(t,r){super(".",t,r)}eval(t,r){return this.right.eval(t,this.left.eval(t,r))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class C5 extends kc{constructor(t,r){super("|",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return m5([...n,...o])}}class kae extends Ir{constructor(t,r){super("=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return v5(n,o)}}class Rae extends Ir{constructor(t,r){super("!=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return g5(v5(n,o))}}class Tae extends Ir{constructor(t,r){super("~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return x5(n,o)}}class Iae extends Ir{constructor(t,r){super("!~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return g5(x5(n,o))}}class px extends Ir{constructor(t,r){super("is",t,r)}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.name;return ve(w5(n[0],o))}}class Dae extends Ir{constructor(t,r){super("and",t,r)}eval(t,r){const n=Eo(this.left.eval(t,r),"boolean"),o=Eo(this.right.eval(t,r),"boolean");return(n==null?void 0:n.value)===!0&&(o==null?void 0:o.value)===!0?ve(!0):(n==null?void 0:n.value)===!1||(o==null?void 0:o.value)===!1?ve(!1):[]}}class Nae extends Ir{constructor(t,r){super("or",t,r)}eval(t,r){const 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?ve(!1):n!=null&&n.value||o!=null&&o.value?ve(!0):[]}}class Aae extends Ir{constructor(t,r){super("xor",t,r)}eval(t,r){const n=Eo(this.left.eval(t,r),"boolean"),o=Eo(this.right.eval(t,r),"boolean");return!n||!o?[]:ve(n.value!==o.value)}}class Mae extends Ir{constructor(t,r){super("implies",t,r)}eval(t,r){const 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?ve(!0):!n||!o?[]:ve(!1)}}class hx{constructor(t,r){this.name=t,this.args=r}eval(t,r){const n=wr[this.name];if(!n)throw new Error("Unrecognized function: "+this.name);return n(t,r,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class mx{constructor(t,r){this.left=t,this.expr=r}eval(t,r){const n=this.expr.eval(t,r);if(n.length!==1)return[];const o=n[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const i=this.left.eval(t,r);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const Lae=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class zae{constructor(t,r,n,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=r,this.operators=n,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0:o.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const r=this.peek();return t==="/"&&r==="*"?this.consumeMultiLineComment():t==="/"&&r==="/"?this.consumeSingleLineComment():t==="'"||t==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(r)?this.consumeSymbol():this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
87
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function eg(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Cv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var U6=typeof WeakMap=="function"?WeakMap:Map;function h2(e,t,r){r=go(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ld||(Ld=!0,Mv=n),Cv(e,t)},r}function m2(e,t,r){r=go(-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(){Cv(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Cv(e,t),typeof n!="function"&&(li===null?li=new Set([this]):li.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),r}function Nw(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new U6;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(r)||(o.add(r),e=n7.bind(null,e,t,r),t.then(e,e))}function Aw(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 Mw(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=go(-1,1),t.tag=2,si(r,t,1))),r.lanes|=1),e)}var W6=Ro.ReactCurrentOwner,Sr=!1;function cr(e,t,r,n){t.child=e===null?q$(t,null,r,n):fs(t,e.child,r,n)}function Lw(e,t,r,n,o){r=r.render;var i=t.ref;return rs(t,o),n=d0(e,t,r,n,i,o),r=f0(),e!==null&&!Sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Po(e,t,o)):(ut&&r&&Zy(t),t.flags|=1,cr(e,t,n,o),t.child)}function zw(e,t,r,n,o){if(e===null){var i=r.type;return typeof i=="function"&&!b0(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,g2(e,t,i,n,o)):(e=id(r.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(r=r.compare,r=r!==null?r:ql,r(a,n)&&e.ref===t.ref)return Po(e,t,o)}return t.flags|=1,e=ui(i,n),e.ref=t.ref,e.return=t,t.child=e}function g2(e,t,r,n,o){if(e!==null){var i=e.memoizedProps;if(ql(i,n)&&e.ref===t.ref)if(Sr=!1,t.pendingProps=n=i,(e.lanes&o)!==0)e.flags&131072&&(Sr=!0);else return t.lanes=e.lanes,Po(e,t,o)}return Ev(e,t,r,n,o)}function v2(e,t,r){var n=t.pendingProps,o=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(qa,Ar),Ar|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(qa,Ar),Ar|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Ze(qa,Ar),Ar|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Ze(qa,Ar),Ar|=n;return cr(e,t,o,r),t.child}function y2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ev(e,t,r,n,o){var i=Or(r)?Qi:ar.current;return i=us(t,i),rs(t,o),r=d0(e,t,r,n,i,o),n=f0(),e!==null&&!Sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Po(e,t,o)):(ut&&n&&Zy(t),t.flags|=1,cr(e,t,r,o),t.child)}function Fw(e,t,r,n,o){if(Or(r)){var i=!0;Ed(t)}else i=!1;if(rs(t,o),t.stateNode===null)rd(e,t),H$(t,r,n),Ov(t,r,n,o),n=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=sn(u):(u=Or(r)?Qi:ar.current,u=us(t,u));var d=r.getDerivedStateFromProps,p=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";p||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Rw(t,a,n,u),Qo=!1;var h=t.memoizedState;a.state=h,Id(t,n,a,o),c=t.memoizedState,l!==n||h!==c||jr.current||Qo?(typeof d=="function"&&(jv(t,r,d,n),c=t.memoizedState),(l=Qo||kw(t,r,l,n,h,c,u))?(p||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),a.props=n,a.state=c,a.context=u,n=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,U$(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:mn(t.type,l),a.props=u,p=t.pendingProps,h=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=sn(c):(c=Or(r)?Qi:ar.current,c=us(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==p||h!==c)&&Rw(t,a,n,c),Qo=!1,h=t.memoizedState,a.state=h,Id(t,n,a,o);var v=t.memoizedState;l!==p||h!==v||jr.current||Qo?(typeof m=="function"&&(jv(t,r,m,n),v=t.memoizedState),(u=Qo||kw(t,r,u,n,h,v,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,v,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,v,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),a.props=n,a.state=v,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return $v(e,t,r,n,i,o)}function $v(e,t,r,n,o,i){y2(e,t);var a=(t.flags&128)!==0;if(!n&&!a)return o&&jw(t,r,!1),Po(e,t,i);n=t.stateNode,W6.current=t;var l=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&a?(t.child=fs(t,e.child,null,i),t.child=fs(t,null,l,i)):cr(e,t,l,i),t.memoizedState=n.state,o&&jw(t,r,!0),t.child}function x2(e){var t=e.stateNode;t.pendingContext?Pw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Pw(e,t.context,!1),s0(e,t.containerInfo)}function Vw(e,t,r,n,o){return ds(),t0(o),t.flags|=256,cr(e,t,r,n),t.child}var kv={dehydrated:null,treeContext:null,retryLane:0};function Rv(e){return{baseLanes:e,cachePool:null,transitions:null}}function w2(e,t,r){var n=t.pendingProps,o=yt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ze(yt,o&1),e===null)return Sv(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):(a=n.children,e=n.fallback,i?(n=t.mode,i=t.child,a={mode:"hidden",children:a},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Bh(a,n,0,null),e=Hi(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Rv(r),t.memoizedState=kv,e):m0(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return H6(e,t,a,n,l,o,r);if(i){i=n.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:n.children};return!(a&1)&&t.child!==o?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=ui(o,c),n.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=ui(l,i):(i=Hi(i,a,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,a=e.child.memoizedState,a=a===null?Rv(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~r,t.memoizedState=kv,n}return i=e.child,e=i.sibling,n=ui(i,{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 m0(e,t){return t=Bh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cu(e,t,r,n){return n!==null&&t0(n),fs(t,e.child,null,r),e=m0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function H6(e,t,r,n,o,i,a){if(r)return t.flags&256?(t.flags&=-257,n=eg(Error(G(422))),cu(e,t,a,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,o=t.mode,n=Bh({mode:"visible",children:n.children},o,0,null),i=Hi(i,o,a,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&fs(t,e.child,null,a),t.child.memoizedState=Rv(a),t.memoizedState=kv,i);if(!(t.mode&1))return cu(e,t,a,null);if(o.data==="$!"){if(n=o.nextSibling&&o.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(G(419)),n=eg(i,n,void 0),cu(e,t,a,n)}if(l=(a&e.childLanes)!==0,Sr||l){if(n=Bt,n!==null){switch(a&-a){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|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,So(e,o),_n(n,e,o,-1))}return _0(),n=eg(Error(G(421))),cu(e,t,a,n)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=o7.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Lr=ai(o.nextSibling),Fr=t,ut=!0,yn=null,e!==null&&(Jr[Zr++]=po,Jr[Zr++]=ho,Jr[Zr++]=Ki,po=e.id,ho=e.overflow,Ki=t),t=m0(t,n.children),t.flags|=4096,t)}function Bw(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Pv(e.return,t,r)}function tg(e,t,r,n,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=o)}function _2(e,t,r){var n=t.pendingProps,o=n.revealOrder,i=n.tail;if(cr(e,t,n.children,r),n=yt.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&&Bw(e,r,t);else if(e.tag===19)Bw(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(Ze(yt,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&&Dd(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),tg(t,!1,o,r,i);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Dd(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}tg(t,!0,r,null,i);break;case"together":tg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Po(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Xi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=ui(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ui(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function G6(e,t,r){switch(t.tag){case 3:x2(t),ds();break;case 5:Q$(t);break;case 1:Or(t.type)&&Ed(t);break;case 4:s0(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,o=t.memoizedProps.value;Ze(Rd,n._currentValue),n._currentValue=o;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(yt,yt.current&1),t.flags|=128,null):r&t.child.childLanes?w2(e,t,r):(Ze(yt,yt.current&1),e=Po(e,t,r),e!==null?e.sibling:null);Ze(yt,yt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return _2(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ze(yt,yt.current),n)break;return null;case 22:case 23:return t.lanes=0,v2(e,t,r)}return Po(e,t,r)}var b2,Tv,S2,P2;b2=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Tv=function(){};S2=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,Vi(Yn.current);var i=null;switch(r){case"input":o=ev(e,o),n=ev(e,n),i=[];break;case"select":o=wt({},o,{value:void 0}),n=wt({},n,{value:void 0}),i=[];break;case"textarea":o=nv(e,o),n=nv(e,n),i=[];break;default:typeof o.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Od)}iv(r,n);var a;r=null;for(u in o)if(!n.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).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(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Fl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ot("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};P2=function(e,t,r,n){r!==n&&(t.flags|=4)};function Xs(e,t){if(!ut)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function er(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 q6(e,t,r){var n=t.pendingProps;switch(e0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return er(t),null;case 1:return Or(t.type)&&Cd(),er(t),null;case 3:return n=t.stateNode,ps(),at(jr),at(ar),c0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(su(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,yn!==null&&(Fv(yn),yn=null))),Tv(e,t),er(t),null;case 5:l0(t);var o=Vi(Jl.current);if(r=t.type,e!==null&&t.stateNode!=null)S2(e,t,r,n,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(G(166));return er(t),null}if(e=Vi(Yn.current),su(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Gn]=t,n[Yl]=i,e=(t.mode&1)!==0,r){case"dialog":ot("cancel",n),ot("close",n);break;case"iframe":case"object":case"embed":ot("load",n);break;case"video":case"audio":for(o=0;o<vl.length;o++)ot(vl[o],n);break;case"source":ot("error",n);break;case"img":case"image":case"link":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"input":X1(n,i),ot("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ot("invalid",n);break;case"textarea":Z1(n,i),ot("invalid",n)}iv(r,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&au(n.textContent,l,e),o=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&au(n.textContent,l,e),o=["children",""+l]):Fl.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&ot("scroll",n)}switch(r){case"input":Jc(n),J1(n,i,!0);break;case"textarea":Jc(n),ew(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Od)}n=o,t.updateQueue=n,n!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=XE(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Gn]=t,e[Yl]=n,b2(e,t,!1,!1),t.stateNode=e;e:{switch(a=av(r,n),r){case"dialog":ot("cancel",e),ot("close",e),o=n;break;case"iframe":case"object":case"embed":ot("load",e),o=n;break;case"video":case"audio":for(o=0;o<vl.length;o++)ot(vl[o],e);o=n;break;case"source":ot("error",e),o=n;break;case"img":case"image":case"link":ot("error",e),ot("load",e),o=n;break;case"details":ot("toggle",e),o=n;break;case"input":X1(e,n),o=ev(e,n),ot("invalid",e);break;case"option":o=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=wt({},n,{value:void 0}),ot("invalid",e);break;case"textarea":Z1(e,n),o=nv(e,n),ot("invalid",e);break;default:o=n}iv(r,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?e$(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&JE(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Vl(e,c):typeof c=="number"&&Vl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ot("scroll",e):c!=null&&zy(e,i,c,a))}switch(r){case"input":Jc(e),J1(e,n,!1);break;case"textarea":Jc(e),ew(e);break;case"option":n.value!=null&&e.setAttribute("value",""+fi(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Ja(e,!!n.multiple,i,!1):n.defaultValue!=null&&Ja(e,!!n.multiple,n.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Od)}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 er(t),null;case 6:if(e&&t.stateNode!=null)P2(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(G(166));if(r=Vi(Jl.current),Vi(Yn.current),su(t)){if(n=t.stateNode,r=t.memoizedProps,n[Gn]=t,(i=n.nodeValue!==r)&&(e=Fr,e!==null))switch(e.tag){case 3:au(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&au(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Gn]=t,t.stateNode=n}return er(t),null;case 13:if(at(yt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ut&&Lr!==null&&t.mode&1&&!(t.flags&128))V$(),ds(),t.flags|=98560,i=!1;else if(i=su(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(G(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(G(317));i[Gn]=t}else ds(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;er(t),i=!1}else yn!==null&&(Fv(yn),yn=null),i=!0;if(!i)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||yt.current&1?Lt===0&&(Lt=3):_0())),t.updateQueue!==null&&(t.flags|=4),er(t),null);case 4:return ps(),Tv(e,t),e===null&&Ql(t.stateNode.containerInfo),er(t),null;case 10:return o0(t.type._context),er(t),null;case 17:return Or(t.type)&&Cd(),er(t),null;case 19:if(at(yt),i=t.memoizedState,i===null)return er(t),null;if(n=(t.flags&128)!==0,a=i.rendering,a===null)if(n)Xs(i,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Dd(e),a!==null){for(t.flags|=128,Xs(i,!1),n=a.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(yt,yt.current&1|2),t.child}e=e.sibling}i.tail!==null&&$t()>ms&&(t.flags|=128,n=!0,Xs(i,!1),t.lanes=4194304)}else{if(!n)if(e=Dd(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Xs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ut)return er(t),null}else 2*$t()-i.renderingStartTime>ms&&r!==1073741824&&(t.flags|=128,n=!0,Xs(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(r=i.last,r!==null?r.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$t(),t.sibling=null,r=yt.current,Ze(yt,n?r&1|2:r&1),t):(er(t),null);case 22:case 23:return w0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ar&1073741824&&(er(t),t.subtreeFlags&6&&(t.flags|=8192)):er(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function Q6(e,t){switch(e0(t),t.tag){case 1:return Or(t.type)&&Cd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ps(),at(jr),at(ar),c0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return l0(t),null;case 13:if(at(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return at(yt),null;case 4:return ps(),null;case 10:return o0(t.type._context),null;case 22:case 23:return w0(),null;case 24:return null;default:return null}}var uu=!1,rr=!1,K6=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Ga(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){bt(e,t,n)}else r.current=null}function Iv(e,t,r){try{r()}catch(n){bt(e,t,n)}}var Uw=!1;function Y6(e,t){if(gv=Sd,e=E$(),Jy(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,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,l=-1,c=-1,u=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==r||o!==0&&p.nodeType!==3||(l=a+o),p!==i||n!==0&&p.nodeType!==3||(c=a+n),p.nodeType===3&&(a+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===r&&++u===o&&(l=a),h===i&&++d===n&&(c=a),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(vv={focusedElem:e,selectionRange:r},Sd=!1,ie=t;ie!==null;)if(t=ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ie=e;else for(;ie!==null;){t=ie;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,b=v.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:mn(t.type,g),b);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(w){bt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ie=e;break}ie=t.return}return v=Uw,Uw=!1,v}function El(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 i=o.destroy;o.destroy=void 0,i!==void 0&&Iv(t,r,i)}o=o.next}while(o!==n)}}function Fh(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 j2(e){var t=e.alternate;t!==null&&(e.alternate=null,j2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gn],delete t[Yl],delete t[wv],delete t[T6],delete t[I6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function O2(e){return e.tag===5||e.tag===3||e.tag===4}function Ww(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||O2(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 Nv(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=Od));else if(n!==4&&(e=e.child,e!==null))for(Nv(e,t,r),e=e.sibling;e!==null;)Nv(e,t,r),e=e.sibling}function Av(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(Av(e,t,r),e=e.sibling;e!==null;)Av(e,t,r),e=e.sibling}var qt=null,gn=!1;function Uo(e,t,r){for(r=r.child;r!==null;)C2(e,t,r),r=r.sibling}function C2(e,t,r){if(Kn&&typeof Kn.onCommitFiberUnmount=="function")try{Kn.onCommitFiberUnmount(Th,r)}catch{}switch(r.tag){case 5:rr||Ga(r,t);case 6:var n=qt,o=gn;qt=null,Uo(e,t,r),qt=n,gn=o,qt!==null&&(gn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(gn?(e=qt,r=r.stateNode,e.nodeType===8?Qm(e.parentNode,r):e.nodeType===1&&Qm(e,r),Hl(e)):Qm(qt,r.stateNode));break;case 4:n=qt,o=gn,qt=r.stateNode.containerInfo,gn=!0,Uo(e,t,r),qt=n,gn=o;break;case 0:case 11:case 14:case 15:if(!rr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Iv(r,t,a),o=o.next}while(o!==n)}Uo(e,t,r);break;case 1:if(!rr&&(Ga(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){bt(r,t,l)}Uo(e,t,r);break;case 21:Uo(e,t,r);break;case 22:r.mode&1?(rr=(n=rr)||r.memoizedState!==null,Uo(e,t,r),rr=n):Uo(e,t,r);break;default:Uo(e,t,r)}}function Hw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new K6),t.forEach(function(n){var o=i7.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function pn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var o=r[n];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:qt=l.stateNode,gn=!1;break e;case 3:qt=l.stateNode.containerInfo,gn=!0;break e;case 4:qt=l.stateNode.containerInfo,gn=!0;break e}l=l.return}if(qt===null)throw Error(G(160));C2(i,a,o),qt=null,gn=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){bt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)E2(t,e),t=t.sibling}function E2(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pn(t,e),Ln(e),n&4){try{El(3,e,e.return),Fh(3,e)}catch(g){bt(e,e.return,g)}try{El(5,e,e.return)}catch(g){bt(e,e.return,g)}}break;case 1:pn(t,e),Ln(e),n&512&&r!==null&&Ga(r,r.return);break;case 5:if(pn(t,e),Ln(e),n&512&&r!==null&&Ga(r,r.return),e.flags&32){var o=e.stateNode;try{Vl(o,"")}catch(g){bt(e,e.return,g)}}if(n&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&KE(o,i),av(l,a);var u=av(l,i);for(a=0;a<c.length;a+=2){var d=c[a],p=c[a+1];d==="style"?e$(o,p):d==="dangerouslySetInnerHTML"?JE(o,p):d==="children"?Vl(o,p):zy(o,d,p,u)}switch(l){case"input":tv(o,i);break;case"textarea":YE(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Ja(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?Ja(o,!!i.multiple,i.defaultValue,!0):Ja(o,!!i.multiple,i.multiple?[]:"",!1))}o[Yl]=i}catch(g){bt(e,e.return,g)}}break;case 6:if(pn(t,e),Ln(e),n&4){if(e.stateNode===null)throw Error(G(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){bt(e,e.return,g)}}break;case 3:if(pn(t,e),Ln(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Hl(t.containerInfo)}catch(g){bt(e,e.return,g)}break;case 4:pn(t,e),Ln(e);break;case 13:pn(t,e),Ln(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(y0=$t())),n&4&&Hw(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(rr=(u=rr)||d,pn(t,e),rr=u):pn(t,e),Ln(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ie=e,d=e.child;d!==null;){for(p=ie=d;ie!==null;){switch(h=ie,m=h.child,h.tag){case 0:case 11:case 14:case 15:El(4,h,h.return);break;case 1:Ga(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){bt(n,r,g)}}break;case 5:Ga(h,h.return);break;case 22:if(h.memoizedState!==null){qw(p);continue}}m!==null?(m.return=h,ie=m):qw(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=p.stateNode,c=p.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=ZE("display",a))}catch(g){bt(e,e.return,g)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(g){bt(e,e.return,g)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:pn(t,e),Ln(e),n&4&&Hw(e);break;case 21:break;default:pn(t,e),Ln(e)}}function Ln(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(O2(r)){var n=r;break e}r=r.return}throw Error(G(160))}switch(n.tag){case 5:var o=n.stateNode;n.flags&32&&(Vl(o,""),n.flags&=-33);var i=Ww(e);Av(e,i,o);break;case 3:case 4:var a=n.stateNode.containerInfo,l=Ww(e);Nv(e,l,a);break;default:throw Error(G(161))}}catch(c){bt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function X6(e,t,r){ie=e,$2(e)}function $2(e,t,r){for(var n=(e.mode&1)!==0;ie!==null;){var o=ie,i=o.child;if(o.tag===22&&n){var a=o.memoizedState!==null||uu;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||rr;l=uu;var u=rr;if(uu=a,(rr=c)&&!u)for(ie=o;ie!==null;)a=ie,c=a.child,a.tag===22&&a.memoizedState!==null?Qw(o):c!==null?(c.return=a,ie=c):Qw(o);for(;i!==null;)ie=i,$2(i),i=i.sibling;ie=o,uu=l,rr=u}Gw(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ie=i):Gw(e)}}function Gw(e){for(;ie!==null;){var t=ie;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rr||Fh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!rr)if(r===null)n.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:mn(t.type,r.memoizedProps);n.componentDidUpdate(o,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&$w(t,i,n);break;case 3:var a=t.updateQueue;if(a!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}$w(t,a,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&&Hl(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}rr||t.flags&512&&Dv(t)}catch(h){bt(t,t.return,h)}}if(t===e){ie=null;break}if(r=t.sibling,r!==null){r.return=t.return,ie=r;break}ie=t.return}}function qw(e){for(;ie!==null;){var t=ie;if(t===e){ie=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ie=r;break}ie=t.return}}function Qw(e){for(;ie!==null;){var t=ie;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Fh(4,t)}catch(c){bt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var o=t.return;try{n.componentDidMount()}catch(c){bt(t,o,c)}}var i=t.return;try{Dv(t)}catch(c){bt(t,i,c)}break;case 5:var a=t.return;try{Dv(t)}catch(c){bt(t,a,c)}}}catch(c){bt(t,t.return,c)}if(t===e){ie=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ie=l;break}ie=t.return}}var J6=Math.ceil,Md=Ro.ReactCurrentDispatcher,g0=Ro.ReactCurrentOwner,nn=Ro.ReactCurrentBatchConfig,Ne=0,Bt=null,It=null,Yt=0,Ar=0,qa=wi(0),Lt=0,rc=null,Xi=0,Vh=0,v0=0,$l=null,br=null,y0=0,ms=1/0,co=null,Ld=!1,Mv=null,li=null,du=!1,ei=null,zd=0,kl=0,Lv=null,nd=-1,od=0;function ur(){return Ne&6?$t():nd!==-1?nd:nd=$t()}function ci(e){return e.mode&1?Ne&2&&Yt!==0?Yt&-Yt:N6.transition!==null?(od===0&&(od=f$()),od):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:x$(e.type)),e):1}function _n(e,t,r,n){if(50<kl)throw kl=0,Lv=null,Error(G(185));mc(e,r,n),(!(Ne&2)||e!==Bt)&&(e===Bt&&(!(Ne&2)&&(Vh|=r),Lt===4&&Jo(e,Yt)),Cr(e,n),r===1&&Ne===0&&!(t.mode&1)&&(ms=$t()+500,Mh&&_i()))}function Cr(e,t){var r=e.callbackNode;Nz(e,t);var n=bd(e,e===Bt?Yt:0);if(n===0)r!==null&&nw(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&nw(r),t===1)e.tag===0?D6(Kw.bind(null,e)):L$(Kw.bind(null,e)),k6(function(){!(Ne&6)&&_i()}),r=null;else{switch(p$(n)){case 1:r=Wy;break;case 4:r=u$;break;case 16:r=_d;break;case 536870912:r=d$;break;default:r=_d}r=M2(r,k2.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function k2(e,t){if(nd=-1,od=0,Ne&6)throw Error(G(327));var r=e.callbackNode;if(ns()&&e.callbackNode!==r)return null;var n=bd(e,e===Bt?Yt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Fd(e,n);else{t=n;var o=Ne;Ne|=2;var i=T2();(Bt!==e||Yt!==t)&&(co=null,ms=$t()+500,Wi(e,t));do try{t7();break}catch(l){R2(e,l)}while(1);n0(),Md.current=i,Ne=o,It!==null?t=0:(Bt=null,Yt=0,t=Lt)}if(t!==0){if(t===2&&(o=dv(e),o!==0&&(n=o,t=zv(e,o))),t===1)throw r=rc,Wi(e,0),Jo(e,n),Cr(e,$t()),r;if(t===6)Jo(e,n);else{if(o=e.current.alternate,!(n&30)&&!Z6(o)&&(t=Fd(e,n),t===2&&(i=dv(e),i!==0&&(n=i,t=zv(e,i))),t===1))throw r=rc,Wi(e,0),Jo(e,n),Cr(e,$t()),r;switch(e.finishedWork=o,e.finishedLanes=n,t){case 0:case 1:throw Error(G(345));case 2:Di(e,br,co);break;case 3:if(Jo(e,n),(n&130023424)===n&&(t=y0+500-$t(),10<t)){if(bd(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){ur(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=xv(Di.bind(null,e,br,co),t);break}Di(e,br,co);break;case 4:if(Jo(e,n),(n&4194240)===n)break;for(t=e.eventTimes,o=-1;0<n;){var a=31-wn(n);i=1<<a,a=t[a],a>o&&(o=a),n&=~i}if(n=o,n=$t()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*J6(n/1960))-n,10<n){e.timeoutHandle=xv(Di.bind(null,e,br,co),n);break}Di(e,br,co);break;case 5:Di(e,br,co);break;default:throw Error(G(329))}}}return Cr(e,$t()),e.callbackNode===r?k2.bind(null,e):null}function zv(e,t){var r=$l;return e.current.memoizedState.isDehydrated&&(Wi(e,t).flags|=256),e=Fd(e,t),e!==2&&(t=br,br=r,t!==null&&Fv(t)),e}function Fv(e){br===null?br=e:br.push.apply(br,e)}function Z6(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var o=r[n],i=o.getSnapshot;o=o.value;try{if(!bn(i(),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 Jo(e,t){for(t&=~v0,t&=~Vh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-wn(t),n=1<<r;e[r]=-1,t&=~n}}function Kw(e){if(Ne&6)throw Error(G(327));ns();var t=bd(e,0);if(!(t&1))return Cr(e,$t()),null;var r=Fd(e,t);if(e.tag!==0&&r===2){var n=dv(e);n!==0&&(t=n,r=zv(e,n))}if(r===1)throw r=rc,Wi(e,0),Jo(e,t),Cr(e,$t()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Di(e,br,co),Cr(e,$t()),null}function x0(e,t){var r=Ne;Ne|=1;try{return e(t)}finally{Ne=r,Ne===0&&(ms=$t()+500,Mh&&_i())}}function Ji(e){ei!==null&&ei.tag===0&&!(Ne&6)&&ns();var t=Ne;Ne|=1;var r=nn.transition,n=Ge;try{if(nn.transition=null,Ge=1,e)return e()}finally{Ge=n,nn.transition=r,Ne=t,!(Ne&6)&&_i()}}function w0(){Ar=qa.current,at(qa)}function Wi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,$6(r)),It!==null)for(r=It.return;r!==null;){var n=r;switch(e0(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Cd();break;case 3:ps(),at(jr),at(ar),c0();break;case 5:l0(n);break;case 4:ps();break;case 13:at(yt);break;case 19:at(yt);break;case 10:o0(n.type._context);break;case 22:case 23:w0()}r=r.return}if(Bt=e,It=e=ui(e.current,null),Yt=Ar=t,Lt=0,rc=null,v0=Vh=Xi=0,br=$l=null,Fi!==null){for(t=0;t<Fi.length;t++)if(r=Fi[t],n=r.interleaved,n!==null){r.interleaved=null;var o=n.next,i=r.pending;if(i!==null){var a=i.next;i.next=o,n.next=a}r.pending=n}Fi=null}return e}function R2(e,t){do{var r=It;try{if(n0(),ed.current=Ad,Nd){for(var n=xt.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Nd=!1}if(Yi=0,Ft=Mt=xt=null,Cl=!1,Zl=0,g0.current=null,r===null||r.return===null){Lt=1,rc=t,It=null;break}e:{var i=e,a=r.return,l=r,c=t;if(t=Yt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Aw(a);if(m!==null){m.flags&=-257,Mw(m,a,l,i,t),m.mode&1&&Nw(i,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}else{if(!(t&1)){Nw(i,u,t),_0();break e}c=Error(G(426))}}else if(ut&&l.mode&1){var b=Aw(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Mw(b,a,l,i,t),t0(hs(c,l));break e}}i=c=hs(c,l),Lt!==4&&(Lt=2),$l===null?$l=[i]:$l.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=h2(i,c,t);Ew(i,y);break e;case 1:l=c;var x=i.type,_=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(li===null||!li.has(_)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=m2(i,l,t);Ew(i,w);break e}}i=i.return}while(i!==null)}D2(r)}catch(O){t=O,It===r&&r!==null&&(It=r=r.return);continue}break}while(1)}function T2(){var e=Md.current;return Md.current=Ad,e===null?Ad:e}function _0(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),Bt===null||!(Xi&268435455)&&!(Vh&268435455)||Jo(Bt,Yt)}function Fd(e,t){var r=Ne;Ne|=2;var n=T2();(Bt!==e||Yt!==t)&&(co=null,Wi(e,t));do try{e7();break}catch(o){R2(e,o)}while(1);if(n0(),Ne=r,Md.current=n,It!==null)throw Error(G(261));return Bt=null,Yt=0,Lt}function e7(){for(;It!==null;)I2(It)}function t7(){for(;It!==null&&!Oz();)I2(It)}function I2(e){var t=A2(e.alternate,e,Ar);e.memoizedProps=e.pendingProps,t===null?D2(e):It=t,g0.current=null}function D2(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Q6(r,t),r!==null){r.flags&=32767,It=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Lt=6,It=null;return}}else if(r=q6(r,t,Ar),r!==null){It=r;return}if(t=t.sibling,t!==null){It=t;return}It=t=e}while(t!==null);Lt===0&&(Lt=5)}function Di(e,t,r){var n=Ge,o=nn.transition;try{nn.transition=null,Ge=1,r7(e,t,r,n)}finally{nn.transition=o,Ge=n}return null}function r7(e,t,r,n){do ns();while(ei!==null);if(Ne&6)throw Error(G(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(Az(e,i),e===Bt&&(It=Bt=null,Yt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||du||(du=!0,M2(_d,function(){return ns(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=nn.transition,nn.transition=null;var a=Ge;Ge=1;var l=Ne;Ne|=4,g0.current=null,Y6(e,r),E2(r,e),b6(vv),Sd=!!gv,vv=gv=null,e.current=r,X6(r),Cz(),Ne=l,Ge=a,nn.transition=i}else e.current=r;if(du&&(du=!1,ei=e,zd=o),i=e.pendingLanes,i===0&&(li=null),kz(r.stateNode),Cr(e,$t()),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(Ld)throw Ld=!1,e=Mv,Mv=null,e;return zd&1&&e.tag!==0&&ns(),i=e.pendingLanes,i&1?e===Lv?kl++:(kl=0,Lv=e):kl=0,_i(),null}function ns(){if(ei!==null){var e=p$(zd),t=nn.transition,r=Ge;try{if(nn.transition=null,Ge=16>e?16:e,ei===null)var n=!1;else{if(e=ei,ei=null,zd=0,Ne&6)throw Error(G(331));var o=Ne;for(Ne|=4,ie=e.current;ie!==null;){var i=ie,a=i.child;if(ie.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ie=u;ie!==null;){var d=ie;switch(d.tag){case 0:case 11:case 15:El(8,d,i)}var p=d.child;if(p!==null)p.return=d,ie=p;else for(;ie!==null;){d=ie;var h=d.sibling,m=d.return;if(j2(d),d===u){ie=null;break}if(h!==null){h.return=m,ie=h;break}ie=m}}}var v=i.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}ie=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,ie=a;else e:for(;ie!==null;){if(i=ie,i.flags&2048)switch(i.tag){case 0:case 11:case 15:El(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ie=y;break e}ie=i.return}}var x=e.current;for(ie=x;ie!==null;){a=ie;var _=a.child;if(a.subtreeFlags&2064&&_!==null)_.return=a,ie=_;else e:for(a=x;ie!==null;){if(l=ie,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Fh(9,l)}}catch(O){bt(l,l.return,O)}if(l===a){ie=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ie=w;break e}ie=l.return}}if(Ne=o,_i(),Kn&&typeof Kn.onPostCommitFiberRoot=="function")try{Kn.onPostCommitFiberRoot(Th,e)}catch{}n=!0}return n}finally{Ge=r,nn.transition=t}}return!1}function Yw(e,t,r){t=hs(r,t),t=h2(e,t,1),e=si(e,t,1),t=ur(),e!==null&&(mc(e,1,t),Cr(e,t))}function bt(e,t,r){if(e.tag===3)Yw(e,e,r);else for(;t!==null;){if(t.tag===3){Yw(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(li===null||!li.has(n))){e=hs(r,e),e=m2(t,e,1),t=si(t,e,1),e=ur(),t!==null&&(mc(t,1,e),Cr(t,e));break}}t=t.return}}function n7(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=ur(),e.pingedLanes|=e.suspendedLanes&r,Bt===e&&(Yt&r)===r&&(Lt===4||Lt===3&&(Yt&130023424)===Yt&&500>$t()-y0?Wi(e,0):v0|=r),Cr(e,t)}function N2(e,t){t===0&&(e.mode&1?(t=tu,tu<<=1,!(tu&130023424)&&(tu=4194304)):t=1);var r=ur();e=So(e,t),e!==null&&(mc(e,t,r),Cr(e,r))}function o7(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),N2(e,r)}function i7(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(G(314))}n!==null&&n.delete(t),N2(e,r)}var A2;A2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||jr.current)Sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Sr=!1,G6(e,t,r);Sr=!!(e.flags&131072)}else Sr=!1,ut&&t.flags&1048576&&z$(t,kd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;rd(e,t),e=t.pendingProps;var o=us(t,ar.current);rs(t,r),o=d0(null,t,n,e,o,r);var i=f0();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,Or(n)?(i=!0,Ed(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,a0(t),o.updater=Lh,t.stateNode=o,o._reactInternals=t,Ov(t,n,e,r),t=$v(null,t,n,!0,i,r)):(t.tag=0,ut&&i&&Zy(t),cr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(rd(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=s7(n),e=mn(n,e),o){case 0:t=Ev(null,t,n,e,r);break e;case 1:t=Fw(null,t,n,e,r);break e;case 11:t=Lw(null,t,n,e,r);break e;case 14:t=zw(null,t,n,mn(n.type,e),r);break e}throw Error(G(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),Ev(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),Fw(e,t,n,o,r);case 3:e:{if(x2(t),e===null)throw Error(G(387));n=t.pendingProps,i=t.memoizedState,o=i.element,U$(e,t),Id(t,n,null,r);var a=t.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=hs(Error(G(423)),t),t=Vw(e,t,n,r,o);break e}else if(n!==o){o=hs(Error(G(424)),t),t=Vw(e,t,n,r,o);break e}else for(Lr=ai(t.stateNode.containerInfo.firstChild),Fr=t,ut=!0,yn=null,r=q$(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ds(),n===o){t=Po(e,t,r);break e}cr(e,t,n,r)}t=t.child}return t;case 5:return Q$(t),e===null&&Sv(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,yv(n,o)?a=null:i!==null&&yv(n,i)&&(t.flags|=32),y2(e,t),cr(e,t,a,r),t.child;case 6:return e===null&&Sv(t),null;case 13:return w2(e,t,r);case 4:return s0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=fs(t,null,n,r):cr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),Lw(e,t,n,o,r);case 7:return cr(e,t,t.pendingProps,r),t.child;case 8:return cr(e,t,t.pendingProps.children,r),t.child;case 12:return cr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ze(Rd,n._currentValue),n._currentValue=a,i!==null)if(bn(i.value,a)){if(i.children===o.children&&!jr.current){t=Po(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=go(-1,r&-r),c.tag=2;var u=i.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}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Pv(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(G(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Pv(a,r,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}cr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,rs(t,r),o=sn(o),n=n(o),t.flags|=1,cr(e,t,n,r),t.child;case 14:return n=t.type,o=mn(n,t.pendingProps),o=mn(n.type,o),zw(e,t,n,o,r);case 15:return g2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:mn(n,o),rd(e,t),t.tag=1,Or(n)?(e=!0,Ed(t)):e=!1,rs(t,r),H$(t,n,o),Ov(t,n,o,r),$v(null,t,n,!0,e,r);case 19:return _2(e,t,r);case 22:return v2(e,t,r)}throw Error(G(156,t.tag))};function M2(e,t){return c$(e,t)}function a7(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 a7(e,t,r,n)}function b0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function s7(e){if(typeof e=="function")return b0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Vy)return 11;if(e===By)return 14}return 2}function ui(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 id(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")b0(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ma:return Hi(r.children,o,i,t);case Fy:a=8,o|=8;break;case Yg:return e=en(12,r,t,o|2),e.elementType=Yg,e.lanes=i,e;case Xg:return e=en(13,r,t,o),e.elementType=Xg,e.lanes=i,e;case Jg:return e=en(19,r,t,o),e.elementType=Jg,e.lanes=i,e;case GE:return Bh(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case WE:a=10;break e;case HE:a=9;break e;case Vy:a=11;break e;case By:a=14;break e;case qo:a=16,n=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=en(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Hi(e,t,r,n){return e=en(7,e,n,t),e.lanes=r,e}function Bh(e,t,r,n){return e=en(22,e,n,t),e.elementType=GE,e.lanes=r,e.stateNode={isHidden:!1},e}function rg(e,t,r){return e=en(6,e,null,t),e.lanes=r,e}function ng(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 l7(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mm(0),this.expirationTimes=Mm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mm(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function S0(e,t,r,n,o,i,a,l,c){return e=new l7(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=en(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},a0(i),e}function c7(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Aa,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function L2(e){if(!e)return pi;e=e._reactInternals;e:{if(ca(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(Or(r))return M$(e,r,t)}return t}function z2(e,t,r,n,o,i,a,l,c){return e=S0(r,n,!0,e,o,i,a,l,c),e.context=L2(null),r=e.current,n=ur(),o=ci(r),i=go(n,o),i.callback=t??null,si(r,i,o),e.current.lanes=o,mc(e,o,n),Cr(e,n),e}function Uh(e,t,r,n){var o=t.current,i=ur(),a=ci(o);return r=L2(r),t.context===null?t.context=r:t.pendingContext=r,t=go(i,a),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=si(o,t,a),e!==null&&(_n(e,o,a,i),Zu(e,o,a)),a}function Vd(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 Xw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function P0(e,t){Xw(e,t),(e=e.alternate)&&Xw(e,t)}function u7(){return null}var F2=typeof reportError=="function"?reportError:function(e){console.error(e)};function j0(e){this._internalRoot=e}Wh.prototype.render=j0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Uh(e,t,null,null)};Wh.prototype.unmount=j0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ji(function(){Uh(null,e,null,null)}),t[bo]=null}};function Wh(e){this._internalRoot=e}Wh.prototype.unstable_scheduleHydration=function(e){if(e){var t=g$();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Xo.length&&t!==0&&t<Xo[r].priority;r++);Xo.splice(r,0,e),r===0&&y$(e)}};function O0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jw(){}function d7(e,t,r,n,o){if(o){if(typeof n=="function"){var i=n;n=function(){var u=Vd(a);i.call(u)}}var a=z2(t,n,e,0,null,!1,!1,"",Jw);return e._reactRootContainer=a,e[bo]=a.current,Ql(e.nodeType===8?e.parentNode:e),Ji(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof n=="function"){var l=n;n=function(){var u=Vd(c);l.call(u)}}var c=S0(e,0,!1,null,null,!1,!1,"",Jw);return e._reactRootContainer=c,e[bo]=c.current,Ql(e.nodeType===8?e.parentNode:e),Ji(function(){Uh(t,c,r,n)}),c}function Gh(e,t,r,n,o){var i=r._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=Vd(a);l.call(c)}}Uh(t,a,e,o)}else a=d7(r,t,e,o,n);return Vd(a)}h$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=gl(t.pendingLanes);r!==0&&(Hy(t,r|1),Cr(t,$t()),!(Ne&6)&&(ms=$t()+500,_i()))}break;case 13:Ji(function(){var n=So(e,1);if(n!==null){var o=ur();_n(n,e,1,o)}}),P0(e,1)}};Gy=function(e){if(e.tag===13){var t=So(e,134217728);if(t!==null){var r=ur();_n(t,e,134217728,r)}P0(e,134217728)}};m$=function(e){if(e.tag===13){var t=ci(e),r=So(e,t);if(r!==null){var n=ur();_n(r,e,t,n)}P0(e,t)}};g$=function(){return Ge};v$=function(e,t){var r=Ge;try{return Ge=e,t()}finally{Ge=r}};lv=function(e,t,r){switch(t){case"input":if(tv(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=Ah(n);if(!o)throw Error(G(90));QE(n),tv(n,o)}}}break;case"textarea":YE(e,r);break;case"select":t=r.value,t!=null&&Ja(e,!!r.multiple,t,!1)}};n$=x0;o$=Ji;var f7={usingClientEntryPoint:!1,Events:[vc,Va,Ah,t$,r$,x0]},Js={findFiberByHostInstance:zi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},p7={bundleType:Js.bundleType,version:Js.version,rendererPackageName:Js.rendererPackageName,rendererConfig:Js.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ro.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=s$(e),e===null?null:e.stateNode},findFiberByHostInstance:Js.findFiberByHostInstance||u7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fu.isDisabled&&fu.supportsFiber)try{Th=fu.inject(p7),Kn=fu}catch{}}Wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f7;Wr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!O0(t))throw Error(G(200));return c7(e,t,null,r)};Wr.createRoot=function(e,t){if(!O0(e))throw Error(G(299));var r=!1,n="",o=F2;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=S0(e,1,!1,null,null,r,!1,n,o),e[bo]=t.current,Ql(e.nodeType===8?e.parentNode:e),new j0(t)};Wr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=s$(t),e=e===null?null:e.stateNode,e};Wr.flushSync=function(e){return Ji(e)};Wr.hydrate=function(e,t,r){if(!Hh(t))throw Error(G(200));return Gh(null,e,t,!0,r)};Wr.hydrateRoot=function(e,t,r){if(!O0(e))throw Error(G(405));var n=r!=null&&r.hydratedSources||null,o=!1,i="",a=F2;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),t=z2(t,null,e,1,r??null,o,!1,i,a),e[bo]=t.current,Ql(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 Wh(t)};Wr.render=function(e,t,r){if(!Hh(t))throw Error(G(200));return Gh(null,e,t,!1,r)};Wr.unmountComponentAtNode=function(e){if(!Hh(e))throw Error(G(40));return e._reactRootContainer?(Ji(function(){Gh(null,null,e,!1,function(){e._reactRootContainer=null,e[bo]=null})}),!0):!1};Wr.unstable_batchedUpdates=x0;Wr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Hh(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Gh(e,t,r,!1,n)};Wr.version="18.2.0-next-9e3b772b8-20220608";function V2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V2)}catch(e){console.error(e)}}V2(),zE.exports=Wr;var xc=zE.exports;const og=by(xc);var h7=Object.defineProperty,m7=Object.defineProperties,g7=Object.getOwnPropertyDescriptors,Zw=Object.getOwnPropertySymbols,v7=Object.prototype.hasOwnProperty,y7=Object.prototype.propertyIsEnumerable,e_=(e,t,r)=>t in e?h7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vv=(e,t)=>{for(var r in t||(t={}))v7.call(t,r)&&e_(e,r,t[r]);if(Zw)for(var r of Zw(t))y7.call(t,r)&&e_(e,r,t[r]);return e},t_=(e,t)=>m7(e,g7(t));const x7=["subtle","filled","outline","light","default","transparent","gradient"],pu={xs:j(18),sm:j(22),md:j(28),lg:j(34),xl:j(44)};function w7({variant:e,theme:t,color:r,gradient:n}){const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:x7.includes(e)?Vv({border:`${j(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var _7=W((e,{radius:t,color:r,gradient:n},{variant:o,size:i})=>({root:t_(Vv({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:A({size:i,sizes:pu}),minHeight:A({size:i,sizes:pu}),width:A({size:i,sizes:pu}),minWidth:A({size:i,sizes:pu})},w7({variant:o,theme:e,color:r,gradient:n})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":t_(Vv({content:'""'},e.fn.cover(j(-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 b7=_7;var S7=Object.defineProperty,Bd=Object.getOwnPropertySymbols,B2=Object.prototype.hasOwnProperty,U2=Object.prototype.propertyIsEnumerable,r_=(e,t,r)=>t in e?S7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n_=(e,t)=>{for(var r in t||(t={}))B2.call(t,r)&&r_(e,r,t[r]);if(Bd)for(var r of Bd(t))U2.call(t,r)&&r_(e,r,t[r]);return e},o_=(e,t)=>{var r={};for(var n in e)B2.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&&U2.call(e,n)&&(r[n]=e[n]);return r};function P7(e){var t=e,{size:r,color:n}=t,o=o_(t,["size","color"]);const i=o,{style:a}=i,l=o_(i,["style"]);return S.createElement("svg",n_({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:n,style:n_({width:r},a)},l),S.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var j7=Object.defineProperty,Ud=Object.getOwnPropertySymbols,W2=Object.prototype.hasOwnProperty,H2=Object.prototype.propertyIsEnumerable,i_=(e,t,r)=>t in e?j7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a_=(e,t)=>{for(var r in t||(t={}))W2.call(t,r)&&i_(e,r,t[r]);if(Ud)for(var r of Ud(t))H2.call(t,r)&&i_(e,r,t[r]);return e},s_=(e,t)=>{var r={};for(var n in e)W2.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&&H2.call(e,n)&&(r[n]=e[n]);return r};function O7(e){var t=e,{size:r,color:n}=t,o=s_(t,["size","color"]);const i=o,{style:a}=i,l=s_(i,["style"]);return S.createElement("svg",a_({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:n,style:a_({width:r,height:r},a)},l),S.createElement("g",{fill:"none",fillRule:"evenodd"},S.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},S.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),S.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},S.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var C7=Object.defineProperty,Wd=Object.getOwnPropertySymbols,G2=Object.prototype.hasOwnProperty,q2=Object.prototype.propertyIsEnumerable,l_=(e,t,r)=>t in e?C7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c_=(e,t)=>{for(var r in t||(t={}))G2.call(t,r)&&l_(e,r,t[r]);if(Wd)for(var r of Wd(t))q2.call(t,r)&&l_(e,r,t[r]);return e},u_=(e,t)=>{var r={};for(var n in e)G2.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&&q2.call(e,n)&&(r[n]=e[n]);return r};function E7(e){var t=e,{size:r,color:n}=t,o=u_(t,["size","color"]);const i=o,{style:a}=i,l=u_(i,["style"]);return S.createElement("svg",c_({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:n,style:c_({width:r},a)},l),S.createElement("circle",{cx:"15",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},S.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"105",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var $7=Object.defineProperty,Hd=Object.getOwnPropertySymbols,Q2=Object.prototype.hasOwnProperty,K2=Object.prototype.propertyIsEnumerable,d_=(e,t,r)=>t in e?$7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k7=(e,t)=>{for(var r in t||(t={}))Q2.call(t,r)&&d_(e,r,t[r]);if(Hd)for(var r of Hd(t))K2.call(t,r)&&d_(e,r,t[r]);return e},R7=(e,t)=>{var r={};for(var n in e)Q2.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&&K2.call(e,n)&&(r[n]=e[n]);return r};const ig={bars:P7,oval:O7,dots:E7},T7={xs:j(18),sm:j(22),md:j(36),lg:j(44),xl:j(58)},I7={size:"md"};function cn(e){const t=H("Loader",I7,e),{size:r,color:n,variant:o}=t,i=R7(t,["size","color","variant"]),a=Jt(),l=o in ig?o:a.loader;return S.createElement(oe,k7({role:"presentation",component:ig[l]||ig.bars,size:A({size:r,sizes:T7}),color:a.fn.variant({variant:"filled",primaryFallback:!1,color:n||a.primaryColor}).background},i))}cn.displayName="@mantine/core/Loader";var D7=Object.defineProperty,Gd=Object.getOwnPropertySymbols,Y2=Object.prototype.hasOwnProperty,X2=Object.prototype.propertyIsEnumerable,f_=(e,t,r)=>t in e?D7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p_=(e,t)=>{for(var r in t||(t={}))Y2.call(t,r)&&f_(e,r,t[r]);if(Gd)for(var r of Gd(t))X2.call(t,r)&&f_(e,r,t[r]);return e},N7=(e,t)=>{var r={};for(var n in e)Y2.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&&X2.call(e,n)&&(r[n]=e[n]);return r};const A7={color:"gray",size:"md",variant:"subtle"},J2=f.forwardRef((e,t)=>{const r=H("ActionIcon",A7,e),{className:n,color:o,children:i,radius:a,size:l,variant:c,gradient:u,disabled:d,loaderProps:p,loading:h,unstyled:m,__staticSelector:v}=r,g=N7(r,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:b,cx:y,theme:x}=b7({radius:a,color:o,gradient:u},{name:["ActionIcon",v],unstyled:m,size:l,variant:c}),_=S.createElement(cn,p_({color:x.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},p));return S.createElement(wo,p_({className:y(b.root,n),ref:t,disabled:d,"data-disabled":d||void 0,"data-loading":h||void 0,unstyled:m},g),h?_:i)});J2.displayName="@mantine/core/ActionIcon";const dr=J2;var M7=Object.defineProperty,L7=Object.defineProperties,z7=Object.getOwnPropertyDescriptors,qd=Object.getOwnPropertySymbols,Z2=Object.prototype.hasOwnProperty,ek=Object.prototype.propertyIsEnumerable,h_=(e,t,r)=>t in e?M7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F7=(e,t)=>{for(var r in t||(t={}))Z2.call(t,r)&&h_(e,r,t[r]);if(qd)for(var r of qd(t))ek.call(t,r)&&h_(e,r,t[r]);return e},V7=(e,t)=>L7(e,z7(t)),B7=(e,t)=>{var r={};for(var n in e)Z2.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&&ek.call(e,n)&&(r[n]=e[n]);return r};function C0(e){const t=H("Portal",{},e),{children:r,target:n,className:o,innerRef:i}=t,a=B7(t,["children","target","className","innerRef"]),l=Jt(),[c,u]=f.useState(!1),d=f.useRef();return CE(()=>(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?xc.createPortal(S.createElement("div",V7(F7({className:o,dir:l.dir},a),{ref:i}),r),d.current):null}C0.displayName="@mantine/core/Portal";var U7=Object.defineProperty,Qd=Object.getOwnPropertySymbols,tk=Object.prototype.hasOwnProperty,rk=Object.prototype.propertyIsEnumerable,m_=(e,t,r)=>t in e?U7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W7=(e,t)=>{for(var r in t||(t={}))tk.call(t,r)&&m_(e,r,t[r]);if(Qd)for(var r of Qd(t))rk.call(t,r)&&m_(e,r,t[r]);return e},H7=(e,t)=>{var r={};for(var n in e)tk.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&&rk.call(e,n)&&(r[n]=e[n]);return r};function Rs(e){var t=e,{withinPortal:r=!0,children:n}=t,o=H7(t,["withinPortal","children"]);return r?S.createElement(C0,W7({},o),n):S.createElement(S.Fragment,null,n)}Rs.displayName="@mantine/core/OptionalPortal";var G7=Object.defineProperty,q7=Object.defineProperties,Q7=Object.getOwnPropertyDescriptors,g_=Object.getOwnPropertySymbols,K7=Object.prototype.hasOwnProperty,Y7=Object.prototype.propertyIsEnumerable,v_=(e,t,r)=>t in e?G7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ag=(e,t)=>{for(var r in t||(t={}))K7.call(t,r)&&v_(e,r,t[r]);if(g_)for(var r of g_(t))Y7.call(t,r)&&v_(e,r,t[r]);return e},y_=(e,t)=>q7(e,Q7(t));function X7({variant:e,color:t,theme:r}){if(e==="filled")return{backgroundColor:r.fn.variant({variant:"filled",color:t}).background,color:r.white};if(e==="outline"){const n=r.fn.variant({variant:"outline",color:t});return{color:n.color,borderColor:n.border,backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.white}}if(e==="light"){const n=r.fn.variant({variant:"light",color:t});return{backgroundColor:n.background,color:n.color}}return null}var J7=W((e,{radius:t,color:r},{variant:n})=>({root:ag(y_(ag({},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:`${j(1)} solid transparent`}),X7({variant:n,color:r,theme:e})),wrapper:{display:"flex"},body:{flex:1},title:{boxSizing:"border-box",margin:0,marginBottom:e.spacing.xs,display:"flex",alignItems:"center",justifyContent:"space-between",lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,fontWeight:700,"&[data-with-close-button]":{paddingRight:e.spacing.md}},label:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},icon:{lineHeight:1,width:j(20),height:j(20),display:"flex",alignItems:"center",justifyContent:"flex-start",marginRight:e.spacing.md,marginTop:1},message:y_(ag({},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:j(10),height:j(10),color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}}));const Z7=J7;var e8=Object.defineProperty,Kd=Object.getOwnPropertySymbols,nk=Object.prototype.hasOwnProperty,ok=Object.prototype.propertyIsEnumerable,x_=(e,t,r)=>t in e?e8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w_=(e,t)=>{for(var r in t||(t={}))nk.call(t,r)&&x_(e,r,t[r]);if(Kd)for(var r of Kd(t))ok.call(t,r)&&x_(e,r,t[r]);return e},t8=(e,t)=>{var r={};for(var n in e)nk.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&&ok.call(e,n)&&(r[n]=e[n]);return r};function ik(e){const t=e,{width:r,height:n,style:o}=t,i=t8(t,["width","height","style"]);return S.createElement("svg",w_({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:w_({width:r,height:n},o)},i),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"}))}ik.displayName="@mantine/core/CloseIcon";var r8=Object.defineProperty,Yd=Object.getOwnPropertySymbols,ak=Object.prototype.hasOwnProperty,sk=Object.prototype.propertyIsEnumerable,__=(e,t,r)=>t in e?r8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n8=(e,t)=>{for(var r in t||(t={}))ak.call(t,r)&&__(e,r,t[r]);if(Yd)for(var r of Yd(t))sk.call(t,r)&&__(e,r,t[r]);return e},o8=(e,t)=>{var r={};for(var n in e)ak.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yd)for(var n of Yd(e))t.indexOf(n)<0&&sk.call(e,n)&&(r[n]=e[n]);return r};const i8={xs:j(12),sm:j(16),md:j(20),lg:j(28),xl:j(34)},a8={size:"sm"},lk=f.forwardRef((e,t)=>{const r=H("CloseButton",a8,e),{iconSize:n,size:o,children:i}=r,a=o8(r,["iconSize","size","children"]),l=j(n||i8[o]);return S.createElement(dr,n8({ref:t,__staticSelector:"CloseButton",size:o},a),i||S.createElement(ik,{width:l,height:l}))});lk.displayName="@mantine/core/CloseButton";const wc=lk;var s8=Object.defineProperty,Xd=Object.getOwnPropertySymbols,ck=Object.prototype.hasOwnProperty,uk=Object.prototype.propertyIsEnumerable,b_=(e,t,r)=>t in e?s8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l8=(e,t)=>{for(var r in t||(t={}))ck.call(t,r)&&b_(e,r,t[r]);if(Xd)for(var r of Xd(t))uk.call(t,r)&&b_(e,r,t[r]);return e},c8=(e,t)=>{var r={};for(var n in e)ck.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xd)for(var n of Xd(e))t.indexOf(n)<0&&uk.call(e,n)&&(r[n]=e[n]);return r};const u8={variant:"light"},_c=f.forwardRef((e,t)=>{const r=H("Alert",u8,e),{id:n,className:o,title:i,variant:a,children:l,color:c,classNames:u,icon:d,styles:p,onClose:h,radius:m,withCloseButton:v,closeButtonLabel:g,unstyled:b}=r,y=c8(r,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:x,cx:_}=Z7({color:c,radius:m},{classNames:u,styles:p,unstyled:b,variant:a,name:"Alert"}),w=Rr(n),O=i&&`${w}-title`,C=`${w}-body`;return S.createElement(oe,l8({id:w,role:"alert","aria-labelledby":O,"aria-describedby":C,className:_(x.root,x[a],o),ref:t},y),S.createElement("div",{className:x.wrapper},d&&S.createElement("div",{className:x.icon},d),S.createElement("div",{className:x.body},i&&S.createElement("div",{className:x.title,"data-with-close-button":v||void 0},S.createElement("span",{id:O,className:x.label},i)),S.createElement("div",{id:C,className:x.message},l)),v&&S.createElement(wc,{className:x.closeButton,onClick:h,variant:"transparent",size:16,iconSize:16,"aria-label":g})))});_c.displayName="@mantine/core/Alert";var d8=Object.defineProperty,f8=Object.defineProperties,p8=Object.getOwnPropertyDescriptors,S_=Object.getOwnPropertySymbols,h8=Object.prototype.hasOwnProperty,m8=Object.prototype.propertyIsEnumerable,P_=(e,t,r)=>t in e?d8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hu=(e,t)=>{for(var r in t||(t={}))h8.call(t,r)&&P_(e,r,t[r]);if(S_)for(var r of S_(t))m8.call(t,r)&&P_(e,r,t[r]);return e},g8=(e,t)=>f8(e,p8(t));function v8({underline:e,strikethrough:t}){const r=[];return e&&r.push("underline"),t&&r.push("line-through"),r.length>0?r.join(" "):"none"}function y8({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function x8(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function w8({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var _8=W((e,{color:t,lineClamp:r,truncate:n,inline:o,inherit:i,underline:a,gradient:l,weight:c,transform:u,align:d,strikethrough:p,italic:h},{size:m})=>{const v=e.fn.variant({variant:"gradient",gradient:l});return{root:g8(hu(hu(hu(hu({},e.fn.fontStyles()),e.fn.focusStyles()),x8(r)),w8({theme:e,truncate:n})),{color:y8({color:t,theme:e}),fontFamily:i?"inherit":e.fontFamily,fontSize:i||m===void 0?"inherit":A({size:m,sizes:e.fontSizes}),lineHeight:i?"inherit":o?1:e.lineHeight,textDecoration:v8({underline:a,strikethrough:p}),WebkitTapHighlightColor:"transparent",fontWeight:i?"inherit":c,textTransform:u,textAlign:d,fontStyle:h?"italic":void 0}),gradient:{backgroundImage:v.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const b8=_8;var S8=Object.defineProperty,Jd=Object.getOwnPropertySymbols,dk=Object.prototype.hasOwnProperty,fk=Object.prototype.propertyIsEnumerable,j_=(e,t,r)=>t in e?S8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P8=(e,t)=>{for(var r in t||(t={}))dk.call(t,r)&&j_(e,r,t[r]);if(Jd)for(var r of Jd(t))fk.call(t,r)&&j_(e,r,t[r]);return e},j8=(e,t)=>{var r={};for(var n in e)dk.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&&fk.call(e,n)&&(r[n]=e[n]);return r};const O8={variant:"text"},pk=f.forwardRef((e,t)=>{const r=H("Text",O8,e),{className:n,size:o,weight:i,transform:a,color:l,align:c,variant:u,lineClamp:d,truncate:p,gradient:h,inline:m,inherit:v,underline:g,strikethrough:b,italic:y,classNames:x,styles:_,unstyled:w,span:O,__staticSelector:C}=r,P=j8(r,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:E,cx:k}=b8({color:l,lineClamp:d,truncate:p,inline:m,inherit:v,underline:g,strikethrough:b,italic:y,weight:i,transform:a,align:c,gradient:h},{unstyled:w,name:C||"Text",variant:u,size:o});return S.createElement(oe,P8({ref:t,className:k(E.root,{[E.gradient]:u==="gradient"},n),component:O?"span":"div"},P))});pk.displayName="@mantine/core/Text";const re=pk;var C8=Object.defineProperty,O_=Object.getOwnPropertySymbols,E8=Object.prototype.hasOwnProperty,$8=Object.prototype.propertyIsEnumerable,C_=(e,t,r)=>t in e?C8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k8=(e,t)=>{for(var r in t||(t={}))E8.call(t,r)&&C_(e,r,t[r]);if(O_)for(var r of O_(t))$8.call(t,r)&&C_(e,r,t[r]);return e};function R8({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():e.fn.themeColor(t||e.primaryColor,e.colorScheme==="dark"?4:7,!1,!0)}var T8=W((e,{color:t,underline:r})=>({root:k8({backgroundColor:"transparent",cursor:"pointer",padding:0,border:0,color:R8({theme:e,color:t})},e.fn.hover({textDecoration:r?"underline":"none"}))}));const I8=T8;var D8=Object.defineProperty,Zd=Object.getOwnPropertySymbols,hk=Object.prototype.hasOwnProperty,mk=Object.prototype.propertyIsEnumerable,E_=(e,t,r)=>t in e?D8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$_=(e,t)=>{for(var r in t||(t={}))hk.call(t,r)&&E_(e,r,t[r]);if(Zd)for(var r of Zd(t))mk.call(t,r)&&E_(e,r,t[r]);return e},N8=(e,t)=>{var r={};for(var n in e)hk.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&&mk.call(e,n)&&(r[n]=e[n]);return r};const A8={underline:!0},gk=f.forwardRef((e,t)=>{const r=H("Anchor",A8,e),{component:n,className:o,unstyled:i,variant:a,size:l,color:c,underline:u}=r,d=N8(r,["component","className","unstyled","variant","size","color","underline"]),{classes:p,cx:h}=I8({color:c,underline:u},{name:"Anchor",unstyled:i,variant:a,size:l}),m=n==="button"?{type:"button"}:null;return S.createElement(re,$_($_({component:n||"a",ref:t,className:h(p.root,o),size:l},m),d))});gk.displayName="@mantine/core/Anchor";const Le=gk,vk=f.createContext({zIndex:1e3,fixed:!1,layout:"default"}),M8=vk.Provider;function yk(){return f.useContext(vk)}function qh(e,t){if(!e)return[];const r=Object.keys(e).filter(n=>n!=="base").map(n=>[A({size:n,sizes:t.breakpoints,units:"em"}),e[n]]);return r.sort((n,o)=>pr(n[0])-pr(o[0])),r}var L8=Object.defineProperty,z8=Object.defineProperties,F8=Object.getOwnPropertyDescriptors,k_=Object.getOwnPropertySymbols,V8=Object.prototype.hasOwnProperty,B8=Object.prototype.propertyIsEnumerable,R_=(e,t,r)=>t in e?L8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mu=(e,t)=>{for(var r in t||(t={}))V8.call(t,r)&&R_(e,r,t[r]);if(k_)for(var r of k_(t))B8.call(t,r)&&R_(e,r,t[r]);return e},T_=(e,t)=>z8(e,F8(t)),U8=W((e,{height:t,width:r,fixed:n,position:o,hiddenBreakpoint:i,zIndex:a,section:l,withBorder:c,layout:u})=>{const d=typeof r=="object"&&r!==null?qh(r,e).reduce((h,[m,v])=>(h[`@media (min-width: ${ir(m)})`]={width:j(v),minWidth:j(v)},h),{}):null,p=c?{[l==="navbar"?"borderRight":"borderLeft"]:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:T_(mu(mu(T_(mu(mu({},e.fn.fontStyles()),o),{top:u==="alt"?0:(o==null?void 0:o.top)||"var(--mantine-header-height)",bottom:0,zIndex:a,height:t?j(t):u==="alt"?"auto":"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))",width:r!=null&&r.base?j(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(pr(A({size:i,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const W8=U8;var H8=Object.defineProperty,ef=Object.getOwnPropertySymbols,xk=Object.prototype.hasOwnProperty,wk=Object.prototype.propertyIsEnumerable,I_=(e,t,r)=>t in e?H8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D_=(e,t)=>{for(var r in t||(t={}))xk.call(t,r)&&I_(e,r,t[r]);if(ef)for(var r of ef(t))wk.call(t,r)&&I_(e,r,t[r]);return e},G8=(e,t)=>{var r={};for(var n in e)xk.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&&wk.call(e,n)&&(r[n]=e[n]);return r};const _k=f.forwardRef((e,t)=>{var r=e,{width:n,height:o,fixed:i=!1,position:a,zIndex:l,hiddenBreakpoint:c="md",hidden:u=!1,withBorder:d=!0,className:p,classNames:h,styles:m,children:v,section:g,__staticSelector:b,unstyled:y,variant:x}=r,_=G8(r,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const w=yk(),{classes:O,cx:C,theme:P}=W8({width:n,height:o,fixed:w.fixed||i,position:a,hiddenBreakpoint:c,zIndex:l||w.zIndex||Cn("app"),section:g,withBorder:d,layout:w.layout},{classNames:h,styles:m,name:b,unstyled:y,variant:x}),E=qh(n,P).reduce((k,[$,I])=>(k[`@media (min-width: ${ir($)})`]={[`--mantine-${g}-width`]:j(I)},k),{});return S.createElement(oe,D_({component:g==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:C(O.root,p)},_),v,S.createElement(OE,{styles:()=>({":root":D_({[`--mantine-${g}-width`]:n!=null&&n.base?j(n.base):"0rem"},E)})}))});_k.displayName="@mantine/core/HorizontalSection";var q8=Object.defineProperty,tf=Object.getOwnPropertySymbols,bk=Object.prototype.hasOwnProperty,Sk=Object.prototype.propertyIsEnumerable,N_=(e,t,r)=>t in e?q8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q8=(e,t)=>{for(var r in t||(t={}))bk.call(t,r)&&N_(e,r,t[r]);if(tf)for(var r of tf(t))Sk.call(t,r)&&N_(e,r,t[r]);return e},K8=(e,t)=>{var r={};for(var n in e)bk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tf)for(var n of tf(e))t.indexOf(n)<0&&Sk.call(e,n)&&(r[n]=e[n]);return r};const Pk=f.forwardRef((e,t)=>{var r=e,{children:n,grow:o=!1,sx:i}=r,a=K8(r,["children","grow","sx"]);return S.createElement(oe,Q8({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},...dc(i)]},a),n)});Pk.displayName="@mantine/core/Section";const Y8=Pk;var X8=Object.defineProperty,A_=Object.getOwnPropertySymbols,J8=Object.prototype.hasOwnProperty,Z8=Object.prototype.propertyIsEnumerable,M_=(e,t,r)=>t in e?X8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eF=(e,t)=>{for(var r in t||(t={}))J8.call(t,r)&&M_(e,r,t[r]);if(A_)for(var r of A_(t))Z8.call(t,r)&&M_(e,r,t[r]);return e};const tF={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},Rl=f.forwardRef((e,t)=>{const r=H("Navbar",tF,e);return S.createElement(_k,eF({section:"navbar",__staticSelector:"Navbar",ref:t},r))});Rl.Section=Y8;Rl.displayName="@mantine/core/Navbar";var rF=Object.defineProperty,nF=Object.defineProperties,oF=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,iF=Object.prototype.hasOwnProperty,aF=Object.prototype.propertyIsEnumerable,z_=(e,t,r)=>t in e?rF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sg=(e,t)=>{for(var r in t||(t={}))iF.call(t,r)&&z_(e,r,t[r]);if(L_)for(var r of L_(t))aF.call(t,r)&&z_(e,r,t[r]);return e},F_=(e,t)=>nF(e,oF(t)),sF=W((e,{height:t,fixed:r,position:n,zIndex:o,borderPosition:i,layout:a})=>{const l=typeof t=="object"&&t!==null?qh(t,e).reduce((c,[u,d])=>(c[`@media (min-width: ${ir(u)})`]={height:j(d),minHeight:j(d)},c),{}):null;return{root:F_(sg(F_(sg(sg({},e.fn.fontStyles()),n),{zIndex:o,left:a==="alt"?"var(--mantine-navbar-width, 0)":0,right:a==="alt"?"var(--mantine-aside-width, 0)":0,height:typeof t=="object"?j(t==null?void 0:t.base)||"100%":j(t),maxHeight:typeof t=="object"?j(t==null?void 0:t.base)||"100%":j(t),position:r?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),l),{borderBottom:i==="bottom"?`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:i==="top"?`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const lF=sF;var cF=Object.defineProperty,rf=Object.getOwnPropertySymbols,jk=Object.prototype.hasOwnProperty,Ok=Object.prototype.propertyIsEnumerable,V_=(e,t,r)=>t in e?cF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,B_=(e,t)=>{for(var r in t||(t={}))jk.call(t,r)&&V_(e,r,t[r]);if(rf)for(var r of rf(t))Ok.call(t,r)&&V_(e,r,t[r]);return e},uF=(e,t)=>{var r={};for(var n in e)jk.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&&Ok.call(e,n)&&(r[n]=e[n]);return r};const Ck=f.forwardRef((e,t)=>{var r=e,{children:n,className:o,classNames:i,styles:a,height:l,fixed:c=!1,withBorder:u=!0,position:d,zIndex:p,section:h,unstyled:m,__staticSelector:v,variant:g}=r,b=uF(r,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector","variant"]);const y=yk(),x=p||y.zIndex||Cn("app"),{classes:_,cx:w,theme:O}=lF({height:l,fixed:y.fixed||c,position:d,zIndex:typeof x=="number"&&y.layout==="default"?x+1:x,layout:y.layout,borderPosition:u?h==="header"?"bottom":"top":"none"},{name:v,classNames:i,styles:a,unstyled:m,variant:g}),C=typeof l=="object"&&l!==null?qh(l,O).reduce((P,[E,k])=>(P[`@media (min-width: ${ir(E)})`]={[`--mantine-${h}-height`]:j(k)},P),{}):null;return S.createElement(oe,B_({component:h==="header"?"header":"footer",className:w(_.root,o),ref:t},b),n,S.createElement(OE,{styles:()=>({":root":B_({[`--mantine-${h}-height`]:typeof l=="object"?j(l==null?void 0:l.base)||"100%":j(l)},C)})}))});Ck.displayName="@mantine/core/VerticalSection";var dF=Object.defineProperty,fF=Object.defineProperties,pF=Object.getOwnPropertyDescriptors,U_=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,mF=Object.prototype.propertyIsEnumerable,W_=(e,t,r)=>t in e?dF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gF=(e,t)=>{for(var r in t||(t={}))hF.call(t,r)&&W_(e,r,t[r]);if(U_)for(var r of U_(t))mF.call(t,r)&&W_(e,r,t[r]);return e},vF=(e,t)=>fF(e,pF(t));const yF={fixed:!1,position:{top:0,left:0,right:0}},Ek=f.forwardRef((e,t)=>{const r=H("Header",yF,e);return S.createElement(Ck,vF(gF({section:"header",__staticSelector:"Header"},r),{ref:t}))});Ek.displayName="@mantine/core/Header";var xF=Object.defineProperty,H_=Object.getOwnPropertySymbols,wF=Object.prototype.hasOwnProperty,_F=Object.prototype.propertyIsEnumerable,G_=(e,t,r)=>t in e?xF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$k=(e,t)=>{for(var r in t||(t={}))wF.call(t,r)&&G_(e,r,t[r]);if(H_)for(var r of H_(t))_F.call(t,r)&&G_(e,r,t[r]);return e};function bF(e,t){const r=A({size:e.padding,sizes:t.spacing}),n=e.navbarOffsetBreakpoint?A({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?A({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;if(!e.fixed)return{padding:r};const i=pr(n),a=pr(o);return $k({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})`},i===a?{[`@media (max-width: ${ir(i-1)})`]:{paddingLeft:r,paddingRight:r}}:{[`@media (max-width: ${ir(i-1)})`]:{paddingLeft:r},[`@media (max-width: ${ir(a-1)})`]:{paddingRight:r}})}var SF=W((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:$k({flex:1,width:"100vw",boxSizing:"border-box"},bF(t,e))}));const PF=SF;var jF=Object.defineProperty,nf=Object.getOwnPropertySymbols,kk=Object.prototype.hasOwnProperty,Rk=Object.prototype.propertyIsEnumerable,q_=(e,t,r)=>t in e?jF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OF=(e,t)=>{for(var r in t||(t={}))kk.call(t,r)&&q_(e,r,t[r]);if(nf)for(var r of nf(t))Rk.call(t,r)&&q_(e,r,t[r]);return e},CF=(e,t)=>{var r={};for(var n in e)kk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nf)for(var n of nf(e))t.indexOf(n)<0&&Rk.call(e,n)&&(r[n]=e[n]);return r};const EF={fixed:!0,padding:"md"},Tk=f.forwardRef((e,t)=>{const r=H("AppShell",EF,e),{children:n,navbar:o,header:i,footer:a,aside:l,fixed:c,zIndex:u,padding:d,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h,className:m,styles:v,classNames:g,unstyled:b,hidden:y,layout:x,variant:_}=r,w=CF(r,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout","variant"]),{classes:O,cx:C}=PF({padding:d,fixed:c,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h},{styles:v,classNames:g,unstyled:b,name:"AppShell",variant:_});return y?S.createElement(S.Fragment,null,n):S.createElement(M8,{value:{fixed:c,zIndex:u,layout:x}},S.createElement(oe,OF({className:C(O.root,m),ref:t},w),i,S.createElement("div",{className:O.body},o,S.createElement("main",{className:O.main},n),l),a))});Tk.displayName="@mantine/core/AppShell";const gu={xs:j(1),sm:j(2),md:j(3),lg:j(4),xl:j(5)};function vu(e,t){const r=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?r:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $F=W((e,{color:t},{size:r,variant:n})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:j(1),borderTop:`${A({size:r,sizes:gu})} ${n} ${vu(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${A({size:r,sizes:gu})} ${n} ${vu(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:j(A({size:r,sizes:gu})),borderTopColor:vu(e,t),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:j(A({size:r,sizes:gu})),borderLeftColor:vu(e,t),borderLeftStyle:n}}));const kF=$F;var RF=Object.defineProperty,TF=Object.defineProperties,IF=Object.getOwnPropertyDescriptors,of=Object.getOwnPropertySymbols,Ik=Object.prototype.hasOwnProperty,Dk=Object.prototype.propertyIsEnumerable,Q_=(e,t,r)=>t in e?RF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K_=(e,t)=>{for(var r in t||(t={}))Ik.call(t,r)&&Q_(e,r,t[r]);if(of)for(var r of of(t))Dk.call(t,r)&&Q_(e,r,t[r]);return e},DF=(e,t)=>TF(e,IF(t)),NF=(e,t)=>{var r={};for(var n in e)Ik.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&&Dk.call(e,n)&&(r[n]=e[n]);return r};const AF={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},_r=f.forwardRef((e,t)=>{const r=H("Divider",AF,e),{className:n,color:o,orientation:i,size:a,label:l,labelPosition:c,labelProps:u,variant:d,styles:p,classNames:h,unstyled:m}=r,v=NF(r,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:g,cx:b}=kF({color:o},{classNames:h,styles:p,unstyled:m,name:"Divider",variant:d,size:a}),y=i==="vertical",x=i==="horizontal",_=!!l&&x,w=!(u!=null&&u.color);return S.createElement(oe,K_({ref:t,className:b(g.root,{[g.vertical]:y,[g.horizontal]:x,[g.withLabel]:_},n),role:"separator"},v),_&&S.createElement(re,DF(K_({},u),{size:(u==null?void 0:u.size)||"xs",mt:j(2),className:b(g.label,g[c],{[g.labelDefaultStyles]:w})}),l))});_r.displayName="@mantine/core/Divider";var MF=Object.defineProperty,LF=Object.defineProperties,zF=Object.getOwnPropertyDescriptors,Y_=Object.getOwnPropertySymbols,FF=Object.prototype.hasOwnProperty,VF=Object.prototype.propertyIsEnumerable,X_=(e,t,r)=>t in e?MF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,J_=(e,t)=>{for(var r in t||(t={}))FF.call(t,r)&&X_(e,r,t[r]);if(Y_)for(var r of Y_(t))VF.call(t,r)&&X_(e,r,t[r]);return e},BF=(e,t)=>LF(e,zF(t)),UF=W((e,t,{size:r})=>({item:BF(J_({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`,cursor:"pointer",fontSize:A({size:r,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":J_({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${A({size:r,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${A({size:r,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const WF=UF;var HF=Object.defineProperty,Z_=Object.getOwnPropertySymbols,GF=Object.prototype.hasOwnProperty,qF=Object.prototype.propertyIsEnumerable,eb=(e,t,r)=>t in e?HF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QF=(e,t)=>{for(var r in t||(t={}))GF.call(t,r)&&eb(e,r,t[r]);if(Z_)for(var r of Z_(t))qF.call(t,r)&&eb(e,r,t[r]);return e};function Nk({data:e,hovered:t,classNames:r,styles:n,isItemSelected:o,uuid:i,__staticSelector:a,onItemHover:l,onItemSelect:c,itemsRefs:u,itemComponent:d,size:p,nothingFound:h,creatable:m,createLabel:v,unstyled:g,variant:b}){const{classes:y}=WF(null,{classNames:r,styles:n,unstyled:g,name:a,variant:b,size:p}),x=[],_=[];let w=null;const O=(P,E)=>{const k=typeof o=="function"?o(P.value):!1;return S.createElement(d,QF({key:P.value,className:y.item,"data-disabled":P.disabled||void 0,"data-hovered":!P.disabled&&t===E||void 0,"data-selected":!P.disabled&&k||void 0,selected:k,onMouseEnter:()=>l(E),id:`${i}-${E}`,role:"option",tabIndex:-1,"aria-selected":t===E,ref:$=>{u&&u.current&&(u.current[P.value]=$)},onMouseDown:P.disabled?null:$=>{$.preventDefault(),c(P)},disabled:P.disabled,variant:b},P))};let C=null;if(e.forEach((P,E)=>{P.creatable?w=E:P.group?(C!==P.group&&(C=P.group,_.push(S.createElement("div",{className:y.separator,key:`__mantine-divider-${E}`},S.createElement(_r,{classNames:{label:y.separatorLabel},label:P.group})))),_.push(O(P,E))):x.push(O(P,E))}),m){const P=e[w];x.push(S.createElement("div",{key:kh(),className:y.item,"data-hovered":t===w||void 0,onMouseEnter:()=>l(w),onMouseDown:E=>{E.preventDefault(),c(P)},tabIndex:-1,ref:E=>{u&&u.current&&(u.current[P.value]=E)}},v))}return _.length>0&&x.length>0&&x.unshift(S.createElement("div",{className:y.separator,key:"empty-group-separator"},S.createElement(_r,null))),_.length>0||x.length>0?S.createElement(S.Fragment,null,_,x):S.createElement(re,{size:p,unstyled:g,className:y.nothingFound},h)}Nk.displayName="@mantine/core/SelectItems";var KF=Object.defineProperty,af=Object.getOwnPropertySymbols,Ak=Object.prototype.hasOwnProperty,Mk=Object.prototype.propertyIsEnumerable,tb=(e,t,r)=>t in e?KF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YF=(e,t)=>{for(var r in t||(t={}))Ak.call(t,r)&&tb(e,r,t[r]);if(af)for(var r of af(t))Mk.call(t,r)&&tb(e,r,t[r]);return e},XF=(e,t)=>{var r={};for(var n in e)Ak.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&&Mk.call(e,n)&&(r[n]=e[n]);return r};const Lk=f.forwardRef((e,t)=>{var r=e,{label:n,value:o}=r,i=XF(r,["label","value"]);return S.createElement("div",YF({ref:t},i),n||o)});Lk.displayName="@mantine/core/DefaultItem";function JF(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function zk(...e){return t=>e.forEach(r=>JF(r,t))}function ua(...e){return f.useCallback(zk(...e),e)}const Fk=f.forwardRef((e,t)=>{const{children:r,...n}=e,o=f.Children.toArray(r),i=o.find(eV);if(i){const a=i.props.children,l=o.map(c=>c===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:c);return f.createElement(Bv,rt({},n,{ref:t}),f.isValidElement(a)?f.cloneElement(a,void 0,l):null)}return f.createElement(Bv,rt({},n,{ref:t}),r)});Fk.displayName="Slot";const Bv=f.forwardRef((e,t)=>{const{children:r,...n}=e;return f.isValidElement(r)?f.cloneElement(r,{...tV(n,r.props),ref:zk(t,r.ref)}):f.Children.count(r)>1?f.Children.only(null):null});Bv.displayName="SlotClone";const ZF=({children:e})=>f.createElement(f.Fragment,null,e);function eV(e){return f.isValidElement(e)&&e.type===ZF}function tV(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{i(...l),o(...l)}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}const rV=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],bc=rV.reduce((e,t)=>{const r=f.forwardRef((n,o)=>{const{asChild:i,...a}=n,l=i?Fk:t;return f.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),f.createElement(l,rt({},a,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Uv=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function nV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const Sc=e=>{const{present:t,children:r}=e,n=oV(t),o=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),i=ua(n.ref,o.ref);return typeof r=="function"||n.isPresent?f.cloneElement(o,{ref:i}):null};Sc.displayName="Presence";function oV(e){const[t,r]=f.useState(),n=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),a=e?"mounted":"unmounted",[l,c]=nV(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=yu(n.current);i.current=l==="mounted"?u:"none"},[l]),Uv(()=>{const u=n.current,d=o.current;if(d!==e){const h=i.current,m=yu(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Uv(()=>{if(t){const u=p=>{const m=yu(n.current).includes(p.animationName);p.target===t&&m&&xc.flushSync(()=>c("ANIMATION_END"))},d=p=>{p.target===t&&(i.current=yu(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 yu(e){return(e==null?void 0:e.animationName)||"none"}function iV(e,t=[]){let r=[];function n(i,a){const l=f.createContext(a),c=r.length;r=[...r,a];function u(p){const{scope:h,children:m,...v}=p,g=(h==null?void 0:h[e][c])||l,b=f.useMemo(()=>v,Object.values(v));return f.createElement(g.Provider,{value:b},m)}function d(p,h){const m=(h==null?void 0:h[e][c])||l,v=f.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=r.map(a=>f.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,aV(o,...t)]}function aV(...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(i){const a=n.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Mi(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}const sV=f.createContext(void 0);function lV(e){const t=f.useContext(sV);return e||t||"ltr"}function cV(e,[t,r]){return Math.min(r,Math.max(t,e))}function Gi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function uV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const Vk="ScrollArea",[Bk,Cve]=iV(Vk),[dV,dn]=Bk(Vk),fV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:i=600,...a}=e,[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(null),[m,v]=f.useState(null),[g,b]=f.useState(null),[y,x]=f.useState(0),[_,w]=f.useState(0),[O,C]=f.useState(!1),[P,E]=f.useState(!1),k=ua(t,I=>c(I)),$=lV(o);return f.createElement(dV,{scope:r,type:n,dir:$,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:p,onContentChange:h,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:O,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:w},f.createElement(bc.div,rt({dir:$},a,{ref:k,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})))}),pV="ScrollAreaViewport",hV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,...o}=e,i=dn(pV,r),a=f.useRef(null),l=ua(t,a,i.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(bc.div,rt({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),f.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},n)))}),To="ScrollAreaScrollbar",mV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=dn(To,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return f.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?f.createElement(gV,rt({},n,{ref:t,forceMount:r})):o.type==="scroll"?f.createElement(vV,rt({},n,{ref:t,forceMount:r})):o.type==="auto"?f.createElement(Uk,rt({},n,{ref:t,forceMount:r})):o.type==="always"?f.createElement(E0,rt({},n,{ref:t})):null}),gV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=dn(To,e.__scopeScrollArea),[i,a]=f.useState(!1);return f.useEffect(()=>{const l=o.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!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||i},f.createElement(Uk,rt({"data-state":i?"visible":"hidden"},n,{ref:t})))}),vV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=dn(To,e.__scopeScrollArea),i=e.orientation==="horizontal",a=Kh(()=>c("SCROLL_END"),100),[l,c]=uV("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,o.scrollHideDelay,c]),f.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let p=u[d];const h=()=>{const m=u[d];p!==m&&(c("SCROLL"),a()),p=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c,a]),f.createElement(Sc,{present:r||l!=="hidden"},f.createElement(E0,rt({"data-state":l==="hidden"?"hidden":"visible"},n,{ref:t,onPointerEnter:Gi(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Gi(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),Uk=f.forwardRef((e,t)=>{const r=dn(To,e.__scopeScrollArea),{forceMount:n,...o}=e,[i,a]=f.useState(!1),l=e.orientation==="horizontal",c=Kh(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(l?u:d)}},10);return gs(r.viewport,c),gs(r.content,c),f.createElement(Sc,{present:n||i},f.createElement(E0,rt({"data-state":i?"visible":"hidden"},o,{ref:t})))}),E0=f.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=dn(To,e.__scopeScrollArea),i=f.useRef(null),a=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=qk(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function p(h,m){return jV(h,a.current,l,m)}return r==="horizontal"?f.createElement(yV,rt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,m=rb(h,l,o.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=p(h,o.dir))}})):r==="vertical"?f.createElement(xV,rt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,m=rb(h,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=p(h))}})):null}),yV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=dn(To,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ua(t,c,i.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(Hk,rt({"data-orientation":"horizontal"},o,{ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Qh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),Kk(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:sf(a.paddingLeft),paddingEnd:sf(a.paddingRight)}})}}))}),xV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,i=dn(To,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ua(t,c,i.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(Hk,rt({"data-orientation":"vertical"},o,{ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Qh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(i.viewport){const h=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),Kk(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:sf(a.paddingTop),paddingEnd:sf(a.paddingBottom)}})}}))}),[wV,Wk]=Bk(To),Hk=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:p,...h}=e,m=dn(To,r),[v,g]=f.useState(null),b=ua(t,k=>g(k)),y=f.useRef(null),x=f.useRef(""),_=m.viewport,w=n.content-n.viewport,O=Mi(d),C=Mi(c),P=Kh(p,10);function E(k){if(y.current){const $=k.clientX-y.current.left,I=k.clientY-y.current.top;u({x:$,y:I})}}return f.useEffect(()=>{const k=$=>{const I=$.target;(v==null?void 0:v.contains(I))&&O($,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,v,w,O]),f.useEffect(C,[n,C]),gs(v,P),gs(m.content,P),f.createElement(wV,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Mi(i),onThumbPointerUp:Mi(a),onThumbPositionChange:C,onThumbPointerDown:Mi(l)},f.createElement(bc.div,rt({},h,{ref:b,style:{position:"absolute",...h.style},onPointerDown:Gi(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),y.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E(k))}),onPointerMove:Gi(e.onPointerMove,E),onPointerUp:Gi(e.onPointerUp,k=>{const $=k.target;$.hasPointerCapture(k.pointerId)&&$.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,y.current=null})})))}),Wv="ScrollAreaThumb",_V=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Wk(Wv,e.__scopeScrollArea);return f.createElement(Sc,{present:r||o.hasThumb},f.createElement(bV,rt({ref:t},n)))}),bV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,i=dn(Wv,r),a=Wk(Wv,r),{onThumbPositionChange:l}=a,c=ua(t,p=>a.onThumbChange(p)),u=f.useRef(),d=Kh(()=>{u.current&&(u.current(),u.current=void 0)},100);return f.useEffect(()=>{const p=i.viewport;if(p){const h=()=>{if(d(),!u.current){const m=OV(p,l);u.current=m,l()}};return l(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[i.viewport,d,l]),f.createElement(bc.div,rt({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Gi(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),v=p.clientX-m.left,g=p.clientY-m.top;a.onThumbPointerDown({x:v,y:g})}),onPointerUp:Gi(e.onPointerUp,a.onThumbPointerUp)}))}),Gk="ScrollAreaCorner",SV=f.forwardRef((e,t)=>{const r=dn(Gk,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?f.createElement(PV,rt({},e,{ref:t})):null}),PV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=dn(Gk,r),[i,a]=f.useState(0),[l,c]=f.useState(0),u=!!(i&&l);return gs(o.scrollbarX,()=>{var d;const p=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(p),c(p)}),gs(o.scrollbarY,()=>{var d;const p=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(p),a(p)}),u?f.createElement(bc.div,rt({},n,{ref:t,style:{width:i,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function sf(e){return e?parseInt(e,10):0}function qk(e,t){const r=e/t;return isNaN(r)?0:r}function Qh(e){const t=qk(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function jV(e,t,r,n="ltr"){const o=Qh(r),i=o/2,a=t||i,l=o-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,p=n==="ltr"?[0,d]:[d*-1,0];return Qk([c,u],p)(e)}function rb(e,t,r="ltr"){const n=Qh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-n,c=r==="ltr"?[0,a]:[a*-1,0],u=cV(e,c);return Qk([0,a],[0,l])(u)}function Qk(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 Kk(e,t){return e>0&&e<t}const OV=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=r.left!==i.left,l=r.top!==i.top;(a||l)&&t(),r=i,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Kh(e,t){const r=Mi(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 gs(e,t){const r=Mi(t);Uv(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}const CV=fV,EV=hV,nb=mV,ob=_V,$V=SV;var kV=W((e,{scrollbarSize:t,offsetScrollbars:r,scrollbarHovered:n,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:r?j(t):void 0,paddingBottom:r?j(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${j(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${Vt("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:j(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:j(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:Vt("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:j(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:j(44),minHeight:j(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:n?1:0,display:o?"none":void 0}}));const RV=kV;var TV=Object.defineProperty,IV=Object.defineProperties,DV=Object.getOwnPropertyDescriptors,lf=Object.getOwnPropertySymbols,Yk=Object.prototype.hasOwnProperty,Xk=Object.prototype.propertyIsEnumerable,ib=(e,t,r)=>t in e?TV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hv=(e,t)=>{for(var r in t||(t={}))Yk.call(t,r)&&ib(e,r,t[r]);if(lf)for(var r of lf(t))Xk.call(t,r)&&ib(e,r,t[r]);return e},Jk=(e,t)=>IV(e,DV(t)),Zk=(e,t)=>{var r={};for(var n in e)Yk.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&&Xk.call(e,n)&&(r[n]=e[n]);return r};const eR={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Yh=f.forwardRef((e,t)=>{const r=H("ScrollArea",eR,e),{children:n,className:o,classNames:i,styles:a,scrollbarSize:l,scrollHideDelay:c,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:g,viewportProps:b}=r,y=Zk(r,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[x,_]=f.useState(!1),w=Jt(),{classes:O,cx:C}=RV({scrollbarSize:l,offsetScrollbars:p,scrollbarHovered:x,hidden:u==="never"},{name:"ScrollArea",classNames:i,styles:a,unstyled:v,variant:g});return S.createElement(CV,{type:u==="never"?"always":u,scrollHideDelay:c,dir:d||w.dir,ref:t,asChild:!0},S.createElement(oe,Hv({className:C(O.root,o)},y),S.createElement(EV,Jk(Hv({},b),{className:O.viewport,ref:h,onScroll:typeof m=="function"?({currentTarget:P})=>m({x:P.scrollLeft,y:P.scrollTop}):void 0}),n),S.createElement(nb,{orientation:"horizontal",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},S.createElement(ob,{className:O.thumb})),S.createElement(nb,{orientation:"vertical",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},S.createElement(ob,{className:O.thumb})),S.createElement($V,{className:O.corner})))}),tR=f.forwardRef((e,t)=>{const r=H("ScrollAreaAutosize",eR,e),{children:n,classNames:o,styles:i,scrollbarSize:a,scrollHideDelay:l,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,sx:v,variant:g,viewportProps:b}=r,y=Zk(r,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return S.createElement(oe,Jk(Hv({},y),{ref:t,sx:[{display:"flex"},...dc(v)]}),S.createElement(oe,{sx:{display:"flex",flexDirection:"column",flex:1}},S.createElement(Yh,{classNames:o,styles:i,scrollHideDelay:l,scrollbarSize:a,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,variant:g,viewportProps:b},n)))});tR.displayName="@mantine/core/ScrollAreaAutosize";Yh.displayName="@mantine/core/ScrollArea";Yh.Autosize=tR;const da=Yh;var NV=Object.defineProperty,AV=Object.defineProperties,MV=Object.getOwnPropertyDescriptors,cf=Object.getOwnPropertySymbols,rR=Object.prototype.hasOwnProperty,nR=Object.prototype.propertyIsEnumerable,ab=(e,t,r)=>t in e?NV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sb=(e,t)=>{for(var r in t||(t={}))rR.call(t,r)&&ab(e,r,t[r]);if(cf)for(var r of cf(t))nR.call(t,r)&&ab(e,r,t[r]);return e},LV=(e,t)=>AV(e,MV(t)),zV=(e,t)=>{var r={};for(var n in e)rR.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&&nR.call(e,n)&&(r[n]=e[n]);return r};const $0=f.forwardRef((e,t)=>{var r=e,{style:n}=r,o=zV(r,["style"]);return S.createElement(da,LV(sb({},o),{style:sb({width:"100%"},n),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});$0.displayName="@mantine/core/SelectScrollArea";var FV=W(()=>({dropdown:{},itemsWrapper:{padding:j(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const VV=FV,Sn=Math.min,nr=Math.max,uf=Math.round,xu=Math.floor,hi=e=>({x:e,y:e}),BV={left:"right",right:"left",bottom:"top",top:"bottom"},UV={start:"end",end:"start"};function Gv(e,t,r){return nr(e,Sn(t,r))}function jo(e,t){return typeof e=="function"?e(t):e}function Pn(e){return e.split("-")[0]}function Ts(e){return e.split("-")[1]}function k0(e){return e==="x"?"y":"x"}function R0(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Pn(e))?"y":"x"}function T0(e){return k0(fa(e))}function WV(e,t,r){r===void 0&&(r=!1);const n=Ts(e),o=T0(e),i=R0(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=df(a)),[a,df(a)]}function HV(e){const t=df(e);return[qv(e),t,qv(t)]}function qv(e){return e.replace(/start|end/g,t=>UV[t])}function GV(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:a;default:return[]}}function qV(e,t,r,n){const o=Ts(e);let i=GV(Pn(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(qv)))),i}function df(e){return e.replace(/left|right|bottom|top/g,t=>BV[t])}function QV(e){return{top:0,right:0,bottom:0,left:0,...e}}function I0(e){return typeof e!="number"?QV(e):{top:e,right:e,bottom:e,left:e}}function vs(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function lb(e,t,r){let{reference:n,floating:o}=e;const i=fa(t),a=T0(t),l=R0(a),c=Pn(t),u=i==="y",d=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-o.width,y:p};break;default:m={x:n.x,y:n.y}}switch(Ts(t)){case"start":m[a]-=h*(r&&u?-1:1);break;case"end":m[a]+=h*(r&&u?-1:1);break}return m}const KV=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=lb(u,n,c),h=n,m={},v=0;for(let g=0;g<l.length;g++){const{name:b,fn:y}=l[g],{x,y:_,data:w,reset:O}=await y({x:d,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});if(d=x??d,p=_??p,m={...m,[b]:{...m[b],...w}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(u=O.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:p}=lb(u,h,c)),g=-1;continue}}return{x:d,y:p,placement:h,strategy:o,middlewareData:m}};async function D0(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=jo(t,e),v=I0(m),b=l[h?p==="floating"?"reference":"floating":p],y=vs(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=p==="floating"?{...a.floating,x:n,y:o}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},O=vs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:c}):x);return{top:(y.top-O.top+v.top)/w.y,bottom:(O.bottom-y.bottom+v.bottom)/w.y,left:(y.left-O.left+v.left)/w.x,right:(O.right-y.right+v.right)/w.x}}const cb=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=jo(e,t)||{};if(u==null)return{};const p=I0(d),h={x:r,y:n},m=T0(o),v=R0(m),g=await a.getDimensions(u),b=m==="y",y=b?"top":"left",x=b?"bottom":"right",_=b?"clientHeight":"clientWidth",w=i.reference[v]+i.reference[m]-h[m]-i.floating[v],O=h[m]-i.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let P=C?C[_]:0;(!P||!await(a.isElement==null?void 0:a.isElement(C)))&&(P=l.floating[_]||i.floating[v]);const E=w/2-O/2,k=P/2-g[v]/2-1,$=Sn(p[y],k),I=Sn(p[x],k),T=$,z=P-g[v]-I,M=P/2-g[v]/2+E,L=Gv(T,M,z),q=!c.arrow&&Ts(o)!=null&&M!=L&&i.reference[v]/2-(M<T?$:I)-g[v]/2<0,Y=q?M<T?M-T:M-z:0;return{[m]:h[m]+Y,data:{[m]:L,centerOffset:M-L-Y,...q&&{alignmentOffset:Y}},reset:q}}}),oR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...b}=jo(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=Pn(o),x=Pn(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=h||(x||!g?[df(l)]:HV(l));!h&&v!=="none"&&w.push(...qV(l,g,v,_));const O=[l,...w],C=await D0(t,b),P=[];let E=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&P.push(C[y]),p){const T=WV(o,a,_);P.push(C[T[0]],C[T[1]])}if(E=[...E,{placement:o,overflows:P}],!P.every(T=>T<=0)){var k,$;const T=(((k=i.flip)==null?void 0:k.index)||0)+1,z=O[T];if(z)return{data:{index:T,overflows:E},reset:{placement:z}};let M=($=E.filter(L=>L.overflows[0]<=0).sort((L,q)=>L.overflows[1]-q.overflows[1])[0])==null?void 0:$.placement;if(!M)switch(m){case"bestFit":{var I;const L=(I=E.map(q=>[q.placement,q.overflows.filter(Y=>Y>0).reduce((Y,R)=>Y+R,0)]).sort((q,Y)=>q[1]-Y[1])[0])==null?void 0:I[0];L&&(M=L);break}case"initialPlacement":M=l;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function iR(e){const t=Sn(...e.map(i=>i.left)),r=Sn(...e.map(i=>i.top)),n=nr(...e.map(i=>i.right)),o=nr(...e.map(i=>i.bottom));return{x:t,y:r,width:n-t,height:o-r}}function YV(e){const t=e.slice().sort((o,i)=>o.y-i.y),r=[];let n=null;for(let o=0;o<t.length;o++){const i=t[o];!n||i.y-n.y>n.height/2?r.push([i]):r[r.length-1].push(i),n=i}return r.map(o=>vs(iR(o)))}const aR=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:i,strategy:a}=t,{padding:l=2,x:c,y:u}=jo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(n.reference))||[]),p=YV(d),h=vs(iR(d)),m=I0(l);function v(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&u!=null)return p.find(b=>c>b.left-m.left&&c<b.right+m.right&&u>b.top-m.top&&u<b.bottom+m.bottom)||h;if(p.length>=2){if(fa(r)==="y"){const $=p[0],I=p[p.length-1],T=Pn(r)==="top",z=$.top,M=I.bottom,L=T?$.left:I.left,q=T?$.right:I.right,Y=q-L,R=M-z;return{top:z,bottom:M,left:L,right:q,width:Y,height:R,x:L,y:z}}const b=Pn(r)==="left",y=nr(...p.map($=>$.right)),x=Sn(...p.map($=>$.left)),_=p.filter($=>b?$.left===x:$.right===y),w=_[0].top,O=_[_.length-1].bottom,C=x,P=y,E=P-C,k=O-w;return{top:w,bottom:O,left:C,right:P,width:E,height:k,x:C,y:w}}return h}const g=await i.getElementRects({reference:{getBoundingClientRect:v},floating:n.floating,strategy:a});return o.reference.x!==g.reference.x||o.reference.y!==g.reference.y||o.reference.width!==g.reference.width||o.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}};async function XV(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Pn(r),l=Ts(r),c=fa(r)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,p=jo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const sR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,o=await XV(t,e);return{x:r+o.x,y:n+o.y,data:o}}}},N0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...c}=jo(e,t),u={x:r,y:n},d=await D0(t,c),p=fa(Pn(o)),h=k0(p);let m=u[h],v=u[p];if(i){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=m+d[b],_=m-d[y];m=Gv(x,m,_)}if(a){const b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=v+d[b],_=v-d[y];v=Gv(x,v,_)}const g=l.fn({...t,[h]:m,[p]:v});return{...g,data:{x:g.x-r,y:g.y-n}}}}},JV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=jo(e,t),d={x:r,y:n},p=fa(o),h=k0(p);let m=d[h],v=d[p];const g=jo(l,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const _=h==="y"?"height":"width",w=i.reference[h]-i.floating[_]+b.mainAxis,O=i.reference[h]+i.reference[_]-b.mainAxis;m<w?m=w:m>O&&(m=O)}if(u){var y,x;const _=h==="y"?"width":"height",w=["top","left"].includes(Pn(o)),O=i.reference[p]-i.floating[_]+(w&&((y=a.offset)==null?void 0:y[p])||0)+(w?0:b.crossAxis),C=i.reference[p]+i.reference[_]+(w?0:((x=a.offset)==null?void 0:x[p])||0)-(w?b.crossAxis:0);v<O?v=O:v>C&&(v=C)}return{[h]:m,[p]:v}}}},ZV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:i}=t,{apply:a=()=>{},...l}=jo(e,t),c=await D0(t,l),u=Pn(r),d=Ts(r),p=fa(r)==="y",{width:h,height:m}=n.floating;let v,g;u==="top"||u==="bottom"?(v=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=u,v=d==="end"?"top":"bottom");const b=m-c[v],y=h-c[g],x=!t.middlewareData.shift;let _=b,w=y;if(p){const C=h-c.left-c.right;w=d||x?Sn(y,C):C}else{const C=m-c.top-c.bottom;_=d||x?Sn(b,C):C}if(x&&!d){const C=nr(c.left,0),P=nr(c.right,0),E=nr(c.top,0),k=nr(c.bottom,0);p?w=h-2*(C!==0||P!==0?C+P:nr(c.left,c.right)):_=m-2*(E!==0||k!==0?E+k:nr(c.top,c.bottom))}await a({...t,availableWidth:w,availableHeight:_});const O=await o.getDimensions(i.floating);return h!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function mi(e){return lR(e)?(e.nodeName||"").toLowerCase():"#document"}function Vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Io(e){var t;return(t=(lR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lR(e){return e instanceof Node||e instanceof Vr(e).Node}function Oo(e){return e instanceof Element||e instanceof Vr(e).Element}function Jn(e){return e instanceof HTMLElement||e instanceof Vr(e).HTMLElement}function ub(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vr(e).ShadowRoot}function Pc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=un(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function eB(e){return["table","td","th"].includes(mi(e))}function A0(e){const t=M0(),r=un(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function tB(e){let t=ys(e);for(;Jn(t)&&!Xh(t);){if(A0(t))return t;t=ys(t)}return null}function M0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xh(e){return["html","body","#document"].includes(mi(e))}function un(e){return Vr(e).getComputedStyle(e)}function Jh(e){return Oo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ys(e){if(mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ub(e)&&e.host||Io(e);return ub(t)?t.host:t}function cR(e){const t=ys(e);return Xh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jn(t)&&Pc(t)?t:cR(t)}function vo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=cR(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Vr(o);return i?t.concat(a,a.visualViewport||[],Pc(o)?o:[],a.frameElement&&r?vo(a.frameElement):[]):t.concat(o,vo(o,[],r))}function uR(e){const t=un(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Jn(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,l=uf(r)!==i||uf(n)!==a;return l&&(r=i,n=a),{width:r,height:n,$:l}}function L0(e){return Oo(e)?e:e.contextElement}function os(e){const t=L0(e);if(!Jn(t))return hi(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=uR(t);let a=(i?uf(r.width):r.width)/n,l=(i?uf(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const rB=hi(0);function dR(e){const t=Vr(e);return!M0()||!t.visualViewport?rB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nB(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Vr(e)?!1:t}function Zi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=L0(e);let a=hi(1);t&&(n?Oo(n)&&(a=os(n)):a=os(e));const l=nB(i,r,n)?dR(i):hi(0);let c=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,p=o.height/a.y;if(i){const h=Vr(i),m=n&&Oo(n)?Vr(n):n;let v=h.frameElement;for(;v&&n&&m!==h;){const g=os(v),b=v.getBoundingClientRect(),y=un(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,_=b.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,p*=g.y,c+=x,u+=_,v=Vr(v).frameElement}}return vs({width:d,height:p,x:c,y:u})}function oB(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=Jn(r),i=Io(r);if(r===i)return t;let a={scrollLeft:0,scrollTop:0},l=hi(1);const c=hi(0);if((o||!o&&n!=="fixed")&&((mi(r)!=="body"||Pc(i))&&(a=Jh(r)),Jn(r))){const u=Zi(r);l=os(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-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function iB(e){return Array.from(e.getClientRects())}function fR(e){return Zi(Io(e)).left+Jh(e).scrollLeft}function aB(e){const t=Io(e),r=Jh(e),n=e.ownerDocument.body,o=nr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=nr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+fR(e);const l=-r.scrollTop;return un(n).direction==="rtl"&&(a+=nr(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:l}}function sB(e,t){const r=Vr(e),n=Io(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const u=M0();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function lB(e,t){const r=Zi(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Jn(e)?os(e):hi(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=n*i.y;return{width:a,height:l,x:c,y:u}}function db(e,t,r){let n;if(t==="viewport")n=sB(e,r);else if(t==="document")n=aB(Io(e));else if(Oo(t))n=lB(t,r);else{const o=dR(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return vs(n)}function pR(e,t){const r=ys(e);return r===t||!Oo(r)||Xh(r)?!1:un(r).position==="fixed"||pR(r,t)}function cB(e,t){const r=t.get(e);if(r)return r;let n=vo(e,[],!1).filter(l=>Oo(l)&&mi(l)!=="body"),o=null;const i=un(e).position==="fixed";let a=i?ys(e):e;for(;Oo(a)&&!Xh(a);){const l=un(a),c=A0(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Pc(a)&&!c&&pR(e,a))?n=n.filter(d=>d!==a):o=l,a=ys(a)}return t.set(e,n),n}function uB(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?cB(t,this._c):[].concat(r),n],l=a[0],c=a.reduce((u,d)=>{const p=db(t,d,o);return u.top=nr(p.top,u.top),u.right=Sn(p.right,u.right),u.bottom=Sn(p.bottom,u.bottom),u.left=nr(p.left,u.left),u},db(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function dB(e){return uR(e)}function fB(e,t,r){const n=Jn(t),o=Io(t),i=r==="fixed",a=Zi(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=hi(0);if(n||!n&&!i)if((mi(t)!=="body"||Pc(o))&&(l=Jh(t)),n){const u=Zi(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else o&&(c.x=fR(o));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function fb(e,t){return!Jn(e)||un(e).position==="fixed"?null:t?t(e):e.offsetParent}function hR(e,t){const r=Vr(e);if(!Jn(e))return r;let n=fb(e,t);for(;n&&eB(n)&&un(n).position==="static";)n=fb(n,t);return n&&(mi(n)==="html"||mi(n)==="body"&&un(n).position==="static"&&!A0(n))?r:n||tB(e)||r}const pB=async function(e){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||hR,i=this.getDimensions;return{reference:fB(t,await o(r),n),floating:{x:0,y:0,...await i(r)}}};function hB(e){return un(e).direction==="rtl"}const mB={convertOffsetParentRelativeRectToViewportRelativeRect:oB,getDocumentElement:Io,getClippingRect:uB,getOffsetParent:hR,getElementRects:pB,getClientRects:iB,getDimensions:dB,getScale:os,isElement:Oo,isRTL:hB};function gB(e,t){let r=null,n;const o=Io(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:p,height:h}=e.getBoundingClientRect();if(l||t(),!p||!h)return;const m=xu(d),v=xu(o.clientWidth-(u+p)),g=xu(o.clientHeight-(d+h)),b=xu(u),x={rootMargin:-m+"px "+-v+"px "+-g+"px "+-b+"px",threshold:nr(0,Sn(1,c))||1};let _=!0;function w(O){const C=O[0].intersectionRatio;if(C!==c){if(!_)return a();C?a(!1,C):n=setTimeout(()=>{a(!1,1e-7)},100)}_=!1}try{r=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(w,x)}r.observe(e)}return a(!0),i}function vB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=L0(e),d=o||i?[...u?vo(u):[],...vo(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const p=u&&l?gB(u,r):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let v,g=c?Zi(e):null;c&&b();function b(){const y=Zi(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&r(),g=y,v=requestAnimationFrame(b)}return r(),()=>{d.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),p&&p(),m&&m.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const yB=(e,t,r)=>{const n=new Map,o={platform:mB,...r},i={...o.platform,_c:n};return KV(e,t,{...o,platform:i})},mR=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?cb({element:t.current,padding:r}).fn(o):{}:t?cb({element:t,padding:r}).fn(o):{}}}};var ad=typeof document<"u"?f.useLayoutEffect:f.useEffect;function ff(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(!ff(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 i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!ff(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function pb(e){const t=f.useRef(e);return ad(()=>{t.current=e}),t}function xB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:i,open:a}=e,[l,c]=f.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[u,d]=f.useState(n);ff(u,n)||d(n);const p=f.useRef(null),h=f.useRef(null),m=f.useRef(l),v=pb(i),g=pb(o),[b,y]=f.useState(null),[x,_]=f.useState(null),w=f.useCallback($=>{p.current!==$&&(p.current=$,y($))},[]),O=f.useCallback($=>{h.current!==$&&(h.current=$,_($))},[]),C=f.useCallback(()=>{if(!p.current||!h.current)return;const $={placement:t,strategy:r,middleware:u};g.current&&($.platform=g.current),yB(p.current,h.current,$).then(I=>{const T={...I,isPositioned:!0};P.current&&!ff(m.current,T)&&(m.current=T,xc.flushSync(()=>{c(T)}))})},[u,t,r,g]);ad(()=>{a===!1&&m.current.isPositioned&&(m.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[a]);const P=f.useRef(!1);ad(()=>(P.current=!0,()=>{P.current=!1}),[]),ad(()=>{if(b&&x){if(v.current)return v.current(b,x,C);C()}},[b,x,C,v]);const E=f.useMemo(()=>({reference:p,floating:h,setReference:w,setFloating:O}),[w,O]),k=f.useMemo(()=>({reference:b,floating:x}),[b,x]);return f.useMemo(()=>({...l,update:C,refs:E,elements:k,reference:w,floating:O}),[l,C,E,k,w,O])}var xs=typeof document<"u"?f.useLayoutEffect:f.useEffect;let lg=!1,wB=0;const hb=()=>"floating-ui-"+wB++;function _B(){const[e,t]=f.useState(()=>lg?hb():void 0);return xs(()=>{e==null&&t(hb())},[]),f.useEffect(()=>{lg||(lg=!0)},[]),e}const bB=Al["useId".toString()],mb=bB||_B;function SB(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){e.set(t,(e.get(t)||[]).filter(n=>n!==r))}}}const PB=f.createContext(null),jB=f.createContext(null),gR=()=>{var e;return((e=f.useContext(PB))==null?void 0:e.id)||null},z0=()=>f.useContext(jB);function ti(e){return(e==null?void 0:e.ownerDocument)||document}function OB(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function CB(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function F0(e){return ti(e).defaultView||window}function qn(e){return e?e instanceof F0(e).Element:!1}function vR(e){return e?e instanceof F0(e).HTMLElement:!1}function EB(e){if(typeof ShadowRoot>"u")return!1;const t=F0(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $B(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(OB())||t.test(CB()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function kB(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function yR(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function gb(e){const t=f.useRef(e);return xs(()=>{t.current=e}),t}const vb="data-floating-ui-safe-polygon";function sd(e,t,r){return r&&!yR(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const RB=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:i=!1,restMs:a=0,move:l=!0}=t===void 0?{}:t;const{open:c,onOpenChange:u,dataRef:d,events:p,elements:{domReference:h,floating:m},refs:v}=e,g=z0(),b=gR(),y=gb(o),x=gb(n),_=f.useRef(),w=f.useRef(),O=f.useRef(),C=f.useRef(),P=f.useRef(!0),E=f.useRef(!1),k=f.useRef(()=>{}),$=f.useCallback(()=>{var M;const L=(M=d.current.openEvent)==null?void 0:M.type;return(L==null?void 0:L.includes("mouse"))&&L!=="mousedown"},[d]);f.useEffect(()=>{if(!r)return;function M(){clearTimeout(w.current),clearTimeout(C.current),P.current=!0}return p.on("dismiss",M),()=>{p.off("dismiss",M)}},[r,p]),f.useEffect(()=>{if(!r||!y.current||!c)return;function M(){$()&&u(!1)}const L=ti(m).documentElement;return L.addEventListener("mouseleave",M),()=>{L.removeEventListener("mouseleave",M)}},[m,c,u,r,y,d,$]);const I=f.useCallback(function(M){M===void 0&&(M=!0);const L=sd(x.current,"close",_.current);L&&!O.current?(clearTimeout(w.current),w.current=setTimeout(()=>u(!1),L)):M&&(clearTimeout(w.current),u(!1))},[x,u]),T=f.useCallback(()=>{k.current(),O.current=void 0},[]),z=f.useCallback(()=>{if(E.current){const M=ti(v.floating.current).body;M.style.pointerEvents="",M.removeAttribute(vb),E.current=!1}},[v]);return f.useEffect(()=>{if(!r)return;function M(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function L(R){if(clearTimeout(w.current),P.current=!1,i&&!yR(_.current)||a>0&&sd(x.current,"open")===0)return;d.current.openEvent=R;const N=sd(x.current,"open",_.current);N?w.current=setTimeout(()=>{u(!0)},N):u(!0)}function q(R){if(M())return;k.current();const N=ti(m);if(clearTimeout(C.current),y.current){c||clearTimeout(w.current),O.current=y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){z(),T(),I()}});const V=O.current;N.addEventListener("mousemove",V),k.current=()=>{N.removeEventListener("mousemove",V)};return}I()}function Y(R){M()||y.current==null||y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){z(),T(),I()}})(R)}if(qn(h)){const R=h;return c&&R.addEventListener("mouseleave",Y),m==null||m.addEventListener("mouseleave",Y),l&&R.addEventListener("mousemove",L,{once:!0}),R.addEventListener("mouseenter",L),R.addEventListener("mouseleave",q),()=>{c&&R.removeEventListener("mouseleave",Y),m==null||m.removeEventListener("mouseleave",Y),l&&R.removeEventListener("mousemove",L),R.removeEventListener("mouseenter",L),R.removeEventListener("mouseleave",q)}}},[h,m,r,e,i,a,l,I,T,z,u,c,g,x,y,d]),xs(()=>{var M;if(r&&c&&(M=y.current)!=null&&M.__options.blockPointerEvents&&$()){const Y=ti(m).body;if(Y.setAttribute(vb,""),Y.style.pointerEvents="none",E.current=!0,qn(h)&&m){var L,q;const R=h,N=g==null||(L=g.nodesRef.current.find(V=>V.id===b))==null||(q=L.context)==null?void 0:q.elements.floating;return N&&(N.style.pointerEvents=""),R.style.pointerEvents="auto",m.style.pointerEvents="auto",()=>{R.style.pointerEvents="",m.style.pointerEvents=""}}}},[r,c,b,m,h,g,y,d,$]),xs(()=>{c||(_.current=void 0,T(),z())},[c,T,z]),f.useEffect(()=>()=>{T(),clearTimeout(w.current),clearTimeout(C.current),z()},[r,T,z]),f.useMemo(()=>{if(!r)return{};function M(L){_.current=L.pointerType}return{reference:{onPointerDown:M,onPointerEnter:M,onMouseMove(){c||a===0||(clearTimeout(C.current),C.current=setTimeout(()=>{P.current||u(!0)},a))}},floating:{onMouseEnter(){clearTimeout(w.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),I(!1)}}}},[p,r,a,c,u,I])},xR=f.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),wR=()=>f.useContext(xR),TB=e=>{let{children:t,delay:r,timeoutMs:n=0}=e;const[o,i]=f.useReducer((c,u)=>({...c,...u}),{delay:r,timeoutMs:n,initialDelay:r,currentId:null,isInstantPhase:!1}),a=f.useRef(null),l=f.useCallback(c=>{i({currentId:c})},[]);return xs(()=>{o.currentId?a.current===null?a.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),a.current=null)},[o.currentId]),f.createElement(xR.Provider,{value:f.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,i,l])},t)},IB=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:i,setCurrentId:a,initialDelay:l,setState:c,timeoutMs:u}=wR();f.useEffect(()=>{i&&(c({delay:{open:1,close:sd(l,"close")}}),i!==o&&n(!1))},[o,n,c,i,l]),f.useEffect(()=>{function d(){n(!1),c({delay:l,currentId:null})}if(!r&&i===o)if(u){const p=window.setTimeout(d,u);return()=>{clearTimeout(p)}}else d()},[r,c,i,o,n,l,u]),f.useEffect(()=>{r&&a(o)},[r,a,o])};function DB(e){let t=e.activeElement;for(;((r=t)==null||(n=r.shadowRoot)==null?void 0:n.activeElement)!=null;){var r,n;t=t.shadowRoot.activeElement}return t}function yb(e,t){if(!e||!t)return!1;const r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&EB(r)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function cg(e,t){let r=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],n=r;for(;n.length;)n=e.filter(o=>{var i;return(i=n)==null?void 0:i.some(a=>{var l;return o.parentId===a.id&&((l=o.context)==null?void 0:l.open)})})||[],r=r.concat(n);return r}function NB(e){return"composedPath"in e?e.composedPath()[0]:e.target}const AB=Al["useInsertionEffect".toString()],MB=AB||(e=>e());function _R(e){const t=f.useRef(()=>{});return MB(()=>{t.current=e}),f.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function ld(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}const LB={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zB={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},FB=function(e){var t,r;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(r=e.outsidePress)!=null?r:!0}},VB=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:i,elements:{reference:a,domReference:l,floating:c},dataRef:u}=e,{enabled:d=!0,escapeKey:p=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:v=!1,referencePressEvent:g="pointerdown",ancestorScroll:b=!1,bubbles:y=!0}=t===void 0?{}:t;const x=z0(),_=gR()!=null,w=_R(typeof h=="function"?h:()=>!1),O=typeof h=="function"?w:h,C=f.useRef(!1),{escapeKeyBubbles:P,outsidePressBubbles:E}=FB(y);return f.useEffect(()=>{if(!r||!d)return;u.current.__escapeKeyBubbles=P,u.current.__outsidePressBubbles=E;function k(M){if(M.key==="Escape"){const L=x?cg(x.nodesRef.current,i):[];if(L.length>0){let q=!0;if(L.forEach(Y=>{var R;if((R=Y.context)!=null&&R.open&&!Y.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function $(M){const L=C.current;if(C.current=!1,L||typeof O=="function"&&!O(M))return;const q=NB(M);if(vR(q)&&c){const N=c.ownerDocument.defaultView||window,V=q.scrollWidth>q.clientWidth,Q=q.scrollHeight>q.clientHeight;let ee=Q&&M.offsetX>q.clientWidth;if(Q&&N.getComputedStyle(q).direction==="rtl"&&(ee=M.offsetX<=q.offsetWidth-q.clientWidth),ee||V&&M.offsetY>q.clientHeight)return}const Y=x&&cg(x.nodesRef.current,i).some(N=>{var V;return ld(M,(V=N.context)==null?void 0:V.elements.floating)});if(ld(M,c)||ld(M,l)||Y)return;const R=x?cg(x.nodesRef.current,i):[];if(R.length>0){let N=!0;if(R.forEach(V=>{var Q;if((Q=V.context)!=null&&Q.open&&!V.context.dataRef.current.__outsidePressBubbles){N=!1;return}}),!N)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:_?{preventScroll:!0}:$B(M)||kB(M)}}),n(!1)}function I(){n(!1)}const T=ti(c);p&&T.addEventListener("keydown",k),O&&T.addEventListener(m,$);let z=[];return b&&(qn(l)&&(z=vo(l)),qn(c)&&(z=z.concat(vo(c))),!qn(a)&&a&&a.contextElement&&(z=z.concat(vo(a.contextElement)))),z=z.filter(M=>{var L;return M!==((L=T.defaultView)==null?void 0:L.visualViewport)}),z.forEach(M=>{M.addEventListener("scroll",I,{passive:!0})}),()=>{p&&T.removeEventListener("keydown",k),O&&T.removeEventListener(m,$),z.forEach(M=>{M.removeEventListener("scroll",I)})}},[u,c,l,a,p,O,m,o,x,i,r,n,b,d,P,E,_]),f.useEffect(()=>{C.current=!1},[O,m]),f.useMemo(()=>d?{reference:{[LB[g]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[zB[m]]:()=>{C.current=!0}}}:{},[d,o,v,m,g,n])},BB=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:i,refs:a,elements:{floating:l,domReference:c}}=e,{enabled:u=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const p=f.useRef(""),h=f.useRef(!1),m=f.useRef();return f.useEffect(()=>{if(!u)return;const g=ti(l).defaultView||window;function b(){!r&&vR(c)&&c===DB(ti(c))&&(h.current=!0)}return g.addEventListener("blur",b),()=>{g.removeEventListener("blur",b)}},[l,c,r,u]),f.useEffect(()=>{if(!u)return;function v(g){(g.type==="referencePress"||g.type==="escapeKey")&&(h.current=!0)}return i.on("dismiss",v),()=>{i.off("dismiss",v)}},[i,u]),f.useEffect(()=>()=>{clearTimeout(m.current)},[]),f.useMemo(()=>u?{reference:{onPointerDown(v){let{pointerType:g}=v;p.current=g,h.current=!!(g&&d)},onMouseLeave(){h.current=!1},onFocus(v){var g;h.current||v.type==="focus"&&((g=o.current.openEvent)==null?void 0:g.type)==="mousedown"&&o.current.openEvent&&ld(o.current.openEvent,c)||(o.current.openEvent=v.nativeEvent,n(!0))},onBlur(v){h.current=!1;const g=v.relatedTarget,b=qn(g)&&g.hasAttribute("data-floating-ui-focus-guard")&&g.getAttribute("data-type")==="outside";m.current=setTimeout(()=>{yb(a.floating.current,g)||yb(c,g)||b||n(!1)})}}}:{},[u,d,c,a,o,n])},UB=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const i=mb(),a=mb();return f.useMemo(()=>{const l={id:i,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?i:void 0},floating:l}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":r?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:a}},floating:{...l,...o==="menu"&&{"aria-labelledby":a}}}:{}},[n,o,r,i,a])};function V0(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=xB(e),i=z0(),a=f.useRef(null),l=f.useRef({}),c=f.useState(()=>SB())[0],[u,d]=f.useState(null),p=f.useCallback(y=>{const x=qn(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;o.refs.setReference(x)},[o.refs]),h=f.useCallback(y=>{(qn(y)||y===null)&&(a.current=y,d(y)),(qn(o.refs.reference.current)||o.refs.reference.current===null||y!==null&&!qn(y))&&o.refs.setReference(y)},[o.refs]),m=f.useMemo(()=>({...o.refs,setReference:h,setPositionReference:p,domReference:a}),[o.refs,h,p]),v=f.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),g=_R(r),b=f.useMemo(()=>({...o,refs:m,elements:v,dataRef:l,nodeId:n,events:c,open:t,onOpenChange:g}),[o,n,c,t,g,m,v]);return xs(()=>{const y=i==null?void 0:i.nodesRef.current.find(x=>x.id===n);y&&(y.context=b)}),f.useMemo(()=>({...o,context:b,refs:m,reference:h,positionReference:p}),[o,m,b,h,p])}function ug(e,t,r){const n=new Map;return{...r==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[r]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(a=>{let[l,c]=a;if(l.indexOf("on")===0){if(n.has(l)||n.set(l,[]),typeof c=="function"){var u;(u=n.get(l))==null||u.push(c),o[l]=function(){for(var d,p=arguments.length,h=new Array(p),m=0;m<p;m++)h[m]=arguments[m];(d=n.get(l))==null||d.forEach(v=>v(...h))}}}else o[l]=c}),o),{})}}const WB=function(e){e===void 0&&(e=[]);const t=e,r=f.useCallback(i=>ug(i,e,"reference"),t),n=f.useCallback(i=>ug(i,e,"floating"),t),o=f.useCallback(i=>ug(i,e,"item"),e.map(i=>i==null?void 0:i.item));return f.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])};function bR({opened:e,floating:t,position:r,positionDependencies:n}){const[o,i]=f.useState(0);f.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return vB(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,r]),rn(()=>{t.update()},n),rn(()=>{i(a=>a+1)},[e])}function HB(e){const t=[sR(e.offset)];return e.middlewares.shift&&t.push(N0({limiter:JV()})),e.middlewares.flip&&t.push(oR()),e.middlewares.inline&&t.push(aR()),t.push(mR({element:e.arrowRef,padding:e.arrowOffset})),t}function GB(e){const[t,r]=$r({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),n=()=>{var a;(a=e.onClose)==null||a.call(e),r(!1)},o=()=>{var a,l;t?((a=e.onClose)==null||a.call(e),r(!1)):((l=e.onOpen)==null||l.call(e),r(!0))},i=V0({placement:e.position,middleware:[...HB(e),...e.width==="target"?[ZV({apply({rects:a}){var l,c;Object.assign((c=(l=i.refs.floating.current)==null?void 0:l.style)!=null?c:{},{width:`${a.reference.width}px`})}})]:[]]});return bR({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:i}),rn(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),rn(()=>{var a,l;e.opened?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:n,onToggle:o}}const SR={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"},[qB,PR]=ko(SR.context);var QB=Object.defineProperty,KB=Object.defineProperties,YB=Object.getOwnPropertyDescriptors,pf=Object.getOwnPropertySymbols,jR=Object.prototype.hasOwnProperty,OR=Object.prototype.propertyIsEnumerable,xb=(e,t,r)=>t in e?QB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wu=(e,t)=>{for(var r in t||(t={}))jR.call(t,r)&&xb(e,r,t[r]);if(pf)for(var r of pf(t))OR.call(t,r)&&xb(e,r,t[r]);return e},XB=(e,t)=>KB(e,YB(t)),JB=(e,t)=>{var r={};for(var n in e)jR.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&&OR.call(e,n)&&(r[n]=e[n]);return r};const ZB={refProp:"ref",popupType:"dialog",shouldOverrideDefaultTargetId:!0},CR=f.forwardRef((e,t)=>{const r=H("PopoverTarget",ZB,e),{children:n,refProp:o,popupType:i,shouldOverrideDefaultTargetId:a}=r,l=JB(r,["children","refProp","popupType","shouldOverrideDefaultTargetId"]);if(!Os(n))throw new Error(SR.children);const c=l,u=PR(),d=Es(u.reference,n.ref,t),p=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:a?u.getTargetId():n.props.id}:{};return f.cloneElement(n,wu(XB(wu(wu(wu({},c),p),u.targetProps),{className:tE(u.targetProps.className,c.className,n.props.className),[o]:d}),u.controlled?null:{onClick:u.onToggle}))});CR.displayName="@mantine/core/PopoverTarget";var eU=W((e,{radius:t,shadow:r})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${j(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:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const tU=eU;var rU=Object.defineProperty,wb=Object.getOwnPropertySymbols,nU=Object.prototype.hasOwnProperty,oU=Object.prototype.propertyIsEnumerable,_b=(e,t,r)=>t in e?rU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oa=(e,t)=>{for(var r in t||(t={}))nU.call(t,r)&&_b(e,r,t[r]);if(wb)for(var r of wb(t))oU.call(t,r)&&_b(e,r,t[r]);return e};const bb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function iU({transition:e,state:t,duration:r,timingFunction:n}){const o={transitionDuration:`${r}ms`,transitionTimingFunction:n};return typeof e=="string"?e in Kc?Oa(Oa(Oa({transitionProperty:Kc[e].transitionProperty},o),Kc[e].common),Kc[e][bb[t]]):null:Oa(Oa(Oa({transitionProperty:e.transitionProperty},o),e.common),e[bb[t]])}function aU({duration:e,exitDuration:t,timingFunction:r,mounted:n,onEnter:o,onExit:i,onEntered:a,onExited:l}){const c=Jt(),u=Rh(),d=c.respectReducedMotion?u:!1,[p,h]=f.useState(d?0:e),[m,v]=f.useState(n?"entered":"exited"),g=f.useRef(-1),b=y=>{const x=y?o:i,_=y?a:l;v(y?"pre-entering":"pre-exiting"),window.clearTimeout(g.current);const w=d?0:y?e:t;if(h(w),w===0)typeof x=="function"&&x(),typeof _=="function"&&_(),v(y?"entered":"exited");else{const O=window.setTimeout(()=>{typeof x=="function"&&x(),v(y?"entering":"exiting")},10);g.current=window.setTimeout(()=>{window.clearTimeout(O),typeof _=="function"&&_(),v(y?"entered":"exited")},w)}};return rn(()=>{b(n)},[n]),f.useEffect(()=>()=>window.clearTimeout(g.current),[]),{transitionDuration:p,transitionStatus:m,transitionTimingFunction:r||c.transitionTimingFunction}}function pa({keepMounted:e,transition:t,duration:r=250,exitDuration:n=r,mounted:o,children:i,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:p,transitionStatus:h,transitionTimingFunction:m}=aU({mounted:o,exitDuration:n,duration:r,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d});return p===0?o?S.createElement(S.Fragment,null,i({})):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:S.createElement(S.Fragment,null,i(iU({transition:t,duration:p,state:h,timingFunction:m})))}pa.displayName="@mantine/core/Transition";function B0({children:e,active:t=!0,refProp:r="ref"}){const n=wL(t),o=Es(n,e==null?void 0:e.ref);return Os(e)?f.cloneElement(e,{[r]:o}):e}B0.displayName="@mantine/core/FocusTrap";var sU=Object.defineProperty,lU=Object.defineProperties,cU=Object.getOwnPropertyDescriptors,Sb=Object.getOwnPropertySymbols,uU=Object.prototype.hasOwnProperty,dU=Object.prototype.propertyIsEnumerable,Pb=(e,t,r)=>t in e?sU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wo=(e,t)=>{for(var r in t||(t={}))uU.call(t,r)&&Pb(e,r,t[r]);if(Sb)for(var r of Sb(t))dU.call(t,r)&&Pb(e,r,t[r]);return e},_u=(e,t)=>lU(e,cU(t));function jb(e,t,r,n){return e==="center"||n==="center"?{top:t}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function Ob(e,t,r,n,o){return e==="center"||n==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:r}:e==="start"?{[o==="ltr"?"left":"right"]:r}:{}}const fU={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function pU({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:j(t),height:j(t),transform:"rotate(45deg)",position:"absolute",[fU[c]]:j(n)},p=j(-t/2);return c==="left"?_u(Wo(Wo({},d),jb(u,a,r,o)),{right:p,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?_u(Wo(Wo({},d),jb(u,a,r,o)),{left:p,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?_u(Wo(Wo({},d),Ob(u,i,r,o,l)),{bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?_u(Wo(Wo({},d),Ob(u,i,r,o,l)),{top:p,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var hU=Object.defineProperty,mU=Object.defineProperties,gU=Object.getOwnPropertyDescriptors,hf=Object.getOwnPropertySymbols,ER=Object.prototype.hasOwnProperty,$R=Object.prototype.propertyIsEnumerable,Cb=(e,t,r)=>t in e?hU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vU=(e,t)=>{for(var r in t||(t={}))ER.call(t,r)&&Cb(e,r,t[r]);if(hf)for(var r of hf(t))$R.call(t,r)&&Cb(e,r,t[r]);return e},yU=(e,t)=>mU(e,gU(t)),xU=(e,t)=>{var r={};for(var n in e)ER.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&&$R.call(e,n)&&(r[n]=e[n]);return r};const U0=f.forwardRef((e,t)=>{var r=e,{position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,visible:c,arrowX:u,arrowY:d}=r,p=xU(r,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const h=Jt();return c?S.createElement("div",yU(vU({},p),{ref:t,style:pU({position:n,arrowSize:o,arrowOffset:i,arrowRadius:a,arrowPosition:l,dir:h.dir,arrowX:u,arrowY:d})})):null});U0.displayName="@mantine/core/FloatingArrow";var wU=Object.defineProperty,_U=Object.defineProperties,bU=Object.getOwnPropertyDescriptors,mf=Object.getOwnPropertySymbols,kR=Object.prototype.hasOwnProperty,RR=Object.prototype.propertyIsEnumerable,Eb=(e,t,r)=>t in e?wU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ca=(e,t)=>{for(var r in t||(t={}))kR.call(t,r)&&Eb(e,r,t[r]);if(mf)for(var r of mf(t))RR.call(t,r)&&Eb(e,r,t[r]);return e},bu=(e,t)=>_U(e,bU(t)),SU=(e,t)=>{var r={};for(var n in e)kR.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&&RR.call(e,n)&&(r[n]=e[n]);return r};const PU={};function TR(e){var t;const r=H("PopoverDropdown",PU,e),{style:n,className:o,children:i,onKeyDownCapture:a}=r,l=SU(r,["style","className","children","onKeyDownCapture"]),c=PR(),{classes:u,cx:d}=tU({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),p=EE({opened:c.opened,shouldReturnFocus:c.returnFocus}),h=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:S.createElement(Rs,bu(Ca({},c.portalProps),{withinPortal:c.withinPortal}),S.createElement(pa,bu(Ca({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),m=>{var v,g;return S.createElement(B0,{active:c.trapFocus},S.createElement(oe,Ca(bu(Ca({},h),{tabIndex:-1,ref:c.floating,style:bu(Ca(Ca({},n),m),{zIndex:c.zIndex,top:(v=c.y)!=null?v:0,left:(g=c.x)!=null?g:0,width:c.width==="target"?void 0:j(c.width)}),className:d(u.dropdown,o),onKeyDownCapture:VA(c.onClose,{active:c.closeOnEscape,onTrigger:p,onKeyDown:a}),"data-position":c.placement}),l),i,S.createElement(U0,{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})))}))}TR.displayName="@mantine/core/PopoverDropdown";function IR(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 $b=Object.getOwnPropertySymbols,jU=Object.prototype.hasOwnProperty,OU=Object.prototype.propertyIsEnumerable,CU=(e,t)=>{var r={};for(var n in e)jU.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$b)for(var n of $b(e))t.indexOf(n)<0&&OU.call(e,n)&&(r[n]=e[n]);return r};const EU={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Cn("popover"),__staticSelector:"Popover",width:"max-content"};function Do(e){var t,r,n,o,i,a;const l=f.useRef(null),c=H("Popover",EU,e),{children:u,position:d,offset:p,onPositionChange:h,positionDependencies:m,opened:v,transitionProps:g,width:b,middlewares:y,withArrow:x,arrowSize:_,arrowOffset:w,arrowRadius:O,arrowPosition:C,unstyled:P,classNames:E,styles:k,closeOnClickOutside:$,withinPortal:I,portalProps:T,closeOnEscape:z,clickOutsideEvents:M,trapFocus:L,onClose:q,onOpen:Y,onChange:R,zIndex:N,radius:V,shadow:Q,id:ee,defaultOpened:_e,__staticSelector:we,withRoles:Ue,disabled:Ae,returnFocus:pt,variant:Dt,keepMounted:Pe}=c,Ht=CU(c,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[Dr,lr]=f.useState(null),[Gt,Nt]=f.useState(null),ro=Rr(ee),no=Jt(),Ye=GB({middlewares:y,width:b,position:IR(no.dir,d),offset:typeof p=="number"?p+(x?_/2:0):p,arrowRef:l,arrowOffset:w,onPositionChange:h,positionDependencies:m,opened:v,defaultOpened:_e,onChange:R,onOpen:Y,onClose:q});cL(()=>Ye.opened&&$&&Ye.onClose(),M,[Dr,Gt]);const oo=f.useCallback(zt=>{lr(zt),Ye.floating.reference(zt)},[Ye.floating.reference]),$n=f.useCallback(zt=>{Nt(zt),Ye.floating.floating(zt)},[Ye.floating.floating]);return S.createElement(qB,{value:{returnFocus:pt,disabled:Ae,controlled:Ye.controlled,reference:oo,floating:$n,x:Ye.floating.x,y:Ye.floating.y,arrowX:(n=(r=(t=Ye.floating)==null?void 0:t.middlewareData)==null?void 0:r.arrow)==null?void 0:n.x,arrowY:(a=(i=(o=Ye.floating)==null?void 0:o.middlewareData)==null?void 0:i.arrow)==null?void 0:a.y,opened:Ye.opened,arrowRef:l,transitionProps:g,width:b,withArrow:x,arrowSize:_,arrowOffset:w,arrowRadius:O,arrowPosition:C,placement:Ye.floating.placement,trapFocus:L,withinPortal:I,portalProps:T,zIndex:N,radius:V,shadow:Q,closeOnEscape:z,onClose:Ye.onClose,onToggle:Ye.onToggle,getTargetId:()=>`${ro}-target`,getDropdownId:()=>`${ro}-dropdown`,withRoles:Ue,targetProps:Ht,__staticSelector:we,classNames:E,styles:k,unstyled:P,variant:Dt,keepMounted:Pe}},u)}Do.Target=CR;Do.Dropdown=TR;Do.displayName="@mantine/core/Popover";var $U=Object.defineProperty,gf=Object.getOwnPropertySymbols,DR=Object.prototype.hasOwnProperty,NR=Object.prototype.propertyIsEnumerable,kb=(e,t,r)=>t in e?$U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kU=(e,t)=>{for(var r in t||(t={}))DR.call(t,r)&&kb(e,r,t[r]);if(gf)for(var r of gf(t))NR.call(t,r)&&kb(e,r,t[r]);return e},RU=(e,t)=>{var r={};for(var n in e)DR.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&&NR.call(e,n)&&(r[n]=e[n]);return r};function TU(e){var t=e,{children:r,component:n="div",maxHeight:o=220,direction:i="column",id:a,innerRef:l,__staticSelector:c,styles:u,classNames:d,unstyled:p}=t,h=RU(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:m}=VV(null,{name:c,styles:u,classNames:d,unstyled:p});return S.createElement(Do.Dropdown,kU({p:0,onMouseDown:v=>v.preventDefault()},h),S.createElement("div",{style:{maxHeight:j(o),display:"flex"}},S.createElement(oe,{component:n||"div",id:`${a}-items`,"aria-labelledby":`${a}-label`,role:"listbox",onMouseDown:v=>v.preventDefault(),style:{flex:1,overflowY:n!==$0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},S.createElement("div",{className:m.itemsWrapper,style:{flexDirection:i}},r))))}function Tl({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:r,withinPortal:n,portalProps:o,children:i,__staticSelector:a,onDirectionChange:l,switchDirectionOnFlip:c,zIndex:u,dropdownPosition:d,positionDependencies:p=[],classNames:h,styles:m,unstyled:v,readOnly:g,variant:b}){return S.createElement(Do,{unstyled:v,classNames:h,styles:m,width:"target",withRoles:!1,opened:e,middlewares:{flip:d==="flip",shift:!1},position:d==="flip"?"bottom":d,positionDependencies:p,zIndex:u,__staticSelector:a,withinPortal:n,portalProps:o,transitionProps:t,shadow:r,disabled:g,onPositionChange:y=>c&&(l==null?void 0:l(y==="top"?"column-reverse":"column")),variant:b},i)}Tl.Target=Do.Target;Tl.Dropdown=TU;var IU=Object.defineProperty,DU=Object.defineProperties,NU=Object.getOwnPropertyDescriptors,vf=Object.getOwnPropertySymbols,AR=Object.prototype.hasOwnProperty,MR=Object.prototype.propertyIsEnumerable,Rb=(e,t,r)=>t in e?IU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Su=(e,t)=>{for(var r in t||(t={}))AR.call(t,r)&&Rb(e,r,t[r]);if(vf)for(var r of vf(t))MR.call(t,r)&&Rb(e,r,t[r]);return e},AU=(e,t)=>DU(e,NU(t)),MU=(e,t)=>{var r={};for(var n in e)AR.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&&MR.call(e,n)&&(r[n]=e[n]);return r};function LR(e,t,r){const n=H(e,t,r),{label:o,description:i,error:a,required:l,classNames:c,styles:u,className:d,unstyled:p,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:b,wrapperProps:y,id:x,size:_,style:w,inputContainer:O,inputWrapperOrder:C,withAsterisk:P,variant:E}=n,k=MU(n,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),$=Rr(x),{systemStyles:I,rest:T}=eo(k),z=Su({label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:b,unstyled:p,styles:u,id:$,size:_,style:w,inputContainer:O,inputWrapperOrder:C,withAsterisk:P,variant:E},y);return AU(Su({},T),{classNames:c,styles:u,unstyled:p,wrapperProps:Su(Su({},z),I),inputProps:{required:l,classNames:c,styles:u,unstyled:p,id:$,size:_,__staticSelector:h,error:a,variant:E}})}var LU=W((e,t,{size:r})=>({label:{display:"inline-block",fontSize:A({size:r,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const zU=LU;var FU=Object.defineProperty,yf=Object.getOwnPropertySymbols,zR=Object.prototype.hasOwnProperty,FR=Object.prototype.propertyIsEnumerable,Tb=(e,t,r)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VU=(e,t)=>{for(var r in t||(t={}))zR.call(t,r)&&Tb(e,r,t[r]);if(yf)for(var r of yf(t))FR.call(t,r)&&Tb(e,r,t[r]);return e},BU=(e,t)=>{var r={};for(var n in e)zR.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&&FR.call(e,n)&&(r[n]=e[n]);return r};const UU={labelElement:"label",size:"sm"},W0=f.forwardRef((e,t)=>{const r=H("InputLabel",UU,e),{labelElement:n,children:o,required:i,size:a,classNames:l,styles:c,unstyled:u,className:d,htmlFor:p,__staticSelector:h,variant:m,onMouseDown:v}=r,g=BU(r,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:b,cx:y}=zU(null,{name:["InputWrapper",h],classNames:l,styles:c,unstyled:u,variant:m,size:a});return S.createElement(oe,VU({component:n,ref:t,className:y(b.label,d),htmlFor:n==="label"?p:void 0,onMouseDown:x=>{v==null||v(x),!x.defaultPrevented&&x.detail>1&&x.preventDefault()}},g),o,i&&S.createElement("span",{className:b.required,"aria-hidden":!0}," *"))});W0.displayName="@mantine/core/InputLabel";var WU=W((e,t,{size:r})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${j(2)})`,lineHeight:1.2,display:"block"}}));const HU=WU;var GU=Object.defineProperty,xf=Object.getOwnPropertySymbols,VR=Object.prototype.hasOwnProperty,BR=Object.prototype.propertyIsEnumerable,Ib=(e,t,r)=>t in e?GU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qU=(e,t)=>{for(var r in t||(t={}))VR.call(t,r)&&Ib(e,r,t[r]);if(xf)for(var r of xf(t))BR.call(t,r)&&Ib(e,r,t[r]);return e},QU=(e,t)=>{var r={};for(var n in e)VR.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&&BR.call(e,n)&&(r[n]=e[n]);return r};const KU={size:"sm"},H0=f.forwardRef((e,t)=>{const r=H("InputError",KU,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=QU(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=HU(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(re,qU({className:m(h.error,o),ref:t},p),n)});H0.displayName="@mantine/core/InputError";var YU=W((e,t,{size:r})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${j(2)})`,lineHeight:1.2,display:"block"}}));const XU=YU;var JU=Object.defineProperty,wf=Object.getOwnPropertySymbols,UR=Object.prototype.hasOwnProperty,WR=Object.prototype.propertyIsEnumerable,Db=(e,t,r)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZU=(e,t)=>{for(var r in t||(t={}))UR.call(t,r)&&Db(e,r,t[r]);if(wf)for(var r of wf(t))WR.call(t,r)&&Db(e,r,t[r]);return e},eW=(e,t)=>{var r={};for(var n in e)UR.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&&WR.call(e,n)&&(r[n]=e[n]);return r};const tW={size:"sm"},G0=f.forwardRef((e,t)=>{const r=H("InputDescription",tW,e),{children:n,className:o,classNames:i,styles:a,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=eW(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=XU(null,{name:["InputWrapper",u],classNames:i,styles:a,unstyled:l,variant:d,size:c});return S.createElement(re,ZU({color:"dimmed",className:m(h.description,o),ref:t,unstyled:l},p),n)});G0.displayName="@mantine/core/InputDescription";const HR=f.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),rW=HR.Provider,nW=()=>f.useContext(HR);function oW(e,{hasDescription:t,hasError:r}){const n=e.findIndex(c=>c==="input"),o=e[n-1],i=e[n+1];return{offsetBottom:t&&i==="description"||r&&i==="error",offsetTop:t&&o==="description"||r&&o==="error"}}var iW=Object.defineProperty,aW=Object.defineProperties,sW=Object.getOwnPropertyDescriptors,Nb=Object.getOwnPropertySymbols,lW=Object.prototype.hasOwnProperty,cW=Object.prototype.propertyIsEnumerable,Ab=(e,t,r)=>t in e?iW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uW=(e,t)=>{for(var r in t||(t={}))lW.call(t,r)&&Ab(e,r,t[r]);if(Nb)for(var r of Nb(t))cW.call(t,r)&&Ab(e,r,t[r]);return e},dW=(e,t)=>aW(e,sW(t)),fW=W(e=>({root:dW(uW({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const pW=fW;var hW=Object.defineProperty,mW=Object.defineProperties,gW=Object.getOwnPropertyDescriptors,_f=Object.getOwnPropertySymbols,GR=Object.prototype.hasOwnProperty,qR=Object.prototype.propertyIsEnumerable,Mb=(e,t,r)=>t in e?hW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ho=(e,t)=>{for(var r in t||(t={}))GR.call(t,r)&&Mb(e,r,t[r]);if(_f)for(var r of _f(t))qR.call(t,r)&&Mb(e,r,t[r]);return e},Lb=(e,t)=>mW(e,gW(t)),vW=(e,t)=>{var r={};for(var n in e)GR.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&&qR.call(e,n)&&(r[n]=e[n]);return r};const yW={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},QR=f.forwardRef((e,t)=>{const r=H("InputWrapper",yW,e),{className:n,label:o,children:i,required:a,id:l,error:c,description:u,labelElement:d,labelProps:p,descriptionProps:h,errorProps:m,classNames:v,styles:g,size:b,inputContainer:y,__staticSelector:x,unstyled:_,inputWrapperOrder:w,withAsterisk:O,variant:C}=r,P=vW(r,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:E,cx:k}=pW(null,{classNames:v,styles:g,name:["InputWrapper",x],unstyled:_,variant:C,size:b}),$={classNames:v,styles:g,unstyled:_,size:b,variant:C,__staticSelector:x},I=typeof O=="boolean"?O:a,T=l?`${l}-error`:m==null?void 0:m.id,z=l?`${l}-description`:h==null?void 0:h.id,L=`${!!c&&typeof c!="boolean"?T:""} ${u?z:""}`,q=L.trim().length>0?L.trim():void 0,Y=o&&S.createElement(W0,Ho(Ho({key:"label",labelElement:d,id:l?`${l}-label`:void 0,htmlFor:l,required:I},$),p),o),R=u&&S.createElement(G0,Lb(Ho(Ho({key:"description"},h),$),{size:(h==null?void 0:h.size)||$.size,id:(h==null?void 0:h.id)||z}),u),N=S.createElement(f.Fragment,{key:"input"},y(i)),V=typeof c!="boolean"&&c&&S.createElement(H0,Lb(Ho(Ho({},m),$),{size:(m==null?void 0:m.size)||$.size,key:"error",id:(m==null?void 0:m.id)||T}),c),Q=w.map(ee=>{switch(ee){case"label":return Y;case"input":return N;case"description":return R;case"error":return V;default:return null}});return S.createElement(rW,{value:Ho({describedBy:q},oW(w,{hasDescription:!!R,hasError:!!V}))},S.createElement(oe,Ho({className:k(E.root,n),ref:t},P),Q))});QR.displayName="@mantine/core/InputWrapper";var xW=Object.defineProperty,bf=Object.getOwnPropertySymbols,KR=Object.prototype.hasOwnProperty,YR=Object.prototype.propertyIsEnumerable,zb=(e,t,r)=>t in e?xW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wW=(e,t)=>{for(var r in t||(t={}))KR.call(t,r)&&zb(e,r,t[r]);if(bf)for(var r of bf(t))YR.call(t,r)&&zb(e,r,t[r]);return e},_W=(e,t)=>{var r={};for(var n in e)KR.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&&YR.call(e,n)&&(r[n]=e[n]);return r};const bW={},XR=f.forwardRef((e,t)=>{const r=H("InputPlaceholder",bW,e),{sx:n}=r,o=_W(r,["sx"]);return S.createElement(oe,wW({component:"span",sx:[i=>i.fn.placeholderStyles(),...dc(n)],ref:t},o))});XR.displayName="@mantine/core/InputPlaceholder";var SW=Object.defineProperty,PW=Object.defineProperties,jW=Object.getOwnPropertyDescriptors,Fb=Object.getOwnPropertySymbols,OW=Object.prototype.hasOwnProperty,CW=Object.prototype.propertyIsEnumerable,Vb=(e,t,r)=>t in e?SW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pu=(e,t)=>{for(var r in t||(t={}))OW.call(t,r)&&Vb(e,r,t[r]);if(Fb)for(var r of Fb(t))CW.call(t,r)&&Vb(e,r,t[r]);return e},dg=(e,t)=>PW(e,jW(t));const Et={xs:j(30),sm:j(36),md:j(42),lg:j(50),xl:j(60)},EW=["default","filled","unstyled"];function $W({theme:e,variant:t}){return EW.includes(t)?t==="default"?{border:`${j(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:`${j(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:j(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var kW=W((e,{multiline:t,radius:r,invalid:n,rightSectionWidth:o,withRightSection:i,iconWidth:a,offsetBottom:l,offsetTop:c,pointer:u},{variant:d,size:p})=>{const h=e.fn.variant({variant:"filled",color:"red"}).background,m=d==="default"||d==="filled"?{minHeight:A({size:p,sizes:Et}),paddingLeft:`calc(${A({size:p,sizes:Et})} / 3)`,paddingRight:i?o||A({size:p,sizes:Et}):`calc(${A({size:p,sizes:Et})} / 3)`,borderRadius:e.fn.radius(r)}:d==="unstyled"&&i?{paddingRight:o||A({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:dg(Pu(Pu(dg(Pu({},e.fn.fontStyles()),{height:t?d==="unstyled"?void 0:"auto":A({size:p,sizes:Et}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${A({size:p,sizes:Et})} - ${j(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:A({size:p,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:u?"pointer":void 0}),$W({theme:e,variant:d})),m),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:h,borderColor:h,"&::placeholder":{opacity:1,color:h}},"&[data-with-icon]":{paddingLeft:typeof a=="number"?j(a):A({size:p,sizes:Et})},"&::placeholder":dg(Pu({},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:a?j(a):A({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||A({size:p,sizes:Et})}}});const RW=kW;var TW=Object.defineProperty,IW=Object.defineProperties,DW=Object.getOwnPropertyDescriptors,Sf=Object.getOwnPropertySymbols,JR=Object.prototype.hasOwnProperty,ZR=Object.prototype.propertyIsEnumerable,Bb=(e,t,r)=>t in e?TW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ju=(e,t)=>{for(var r in t||(t={}))JR.call(t,r)&&Bb(e,r,t[r]);if(Sf)for(var r of Sf(t))ZR.call(t,r)&&Bb(e,r,t[r]);return e},Ub=(e,t)=>IW(e,DW(t)),NW=(e,t)=>{var r={};for(var n in e)JR.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&&ZR.call(e,n)&&(r[n]=e[n]);return r};const AW={size:"sm",variant:"default"},ha=f.forwardRef((e,t)=>{const r=H("Input",AW,e),{className:n,error:o,required:i,disabled:a,variant:l,icon:c,style:u,rightSectionWidth:d,iconWidth:p,rightSection:h,rightSectionProps:m,radius:v,size:g,wrapperProps:b,classNames:y,styles:x,__staticSelector:_,multiline:w,sx:O,unstyled:C,pointer:P}=r,E=NW(r,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:k,offsetTop:$,describedBy:I}=nW(),{classes:T,cx:z}=RW({radius:v,multiline:w,invalid:!!o,rightSectionWidth:d?j(d):void 0,iconWidth:p,withRightSection:!!h,offsetBottom:k,offsetTop:$,pointer:P},{classNames:y,styles:x,name:["Input",_],unstyled:C,variant:l,size:g}),{systemStyles:M,rest:L}=eo(E);return S.createElement(oe,ju(ju({className:z(T.wrapper,n),sx:O,style:u},M),b),c&&S.createElement("div",{className:T.icon},c),S.createElement(oe,Ub(ju({component:"input"},L),{ref:t,required:i,"aria-invalid":!!o,"aria-describedby":I,disabled:a,"data-disabled":a||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:T.input})),h&&S.createElement("div",Ub(ju({},m),{className:T.rightSection}),h))});ha.displayName="@mantine/core/Input";ha.Wrapper=QR;ha.Label=W0;ha.Description=G0;ha.Error=H0;ha.Placeholder=XR;const Ut=ha;var MW=Object.defineProperty,Pf=Object.getOwnPropertySymbols,eT=Object.prototype.hasOwnProperty,tT=Object.prototype.propertyIsEnumerable,Wb=(e,t,r)=>t in e?MW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LW=(e,t)=>{for(var r in t||(t={}))eT.call(t,r)&&Wb(e,r,t[r]);if(Pf)for(var r of Pf(t))tT.call(t,r)&&Wb(e,r,t[r]);return e},zW=(e,t)=>{var r={};for(var n in e)eT.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&&tT.call(e,n)&&(r[n]=e[n]);return r};function FW(e){const t=e,{style:r}=t,n=zW(t,["style"]);return S.createElement("svg",LW({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r},n),S.createElement("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var VW=Object.defineProperty,BW=Object.defineProperties,UW=Object.getOwnPropertyDescriptors,Hb=Object.getOwnPropertySymbols,WW=Object.prototype.hasOwnProperty,HW=Object.prototype.propertyIsEnumerable,Gb=(e,t,r)=>t in e?VW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GW=(e,t)=>{for(var r in t||(t={}))WW.call(t,r)&&Gb(e,r,t[r]);if(Hb)for(var r of Hb(t))HW.call(t,r)&&Gb(e,r,t[r]);return e},qW=(e,t)=>BW(e,UW(t));const rT=f.createContext(null);function QW({spacing:e,children:t}){return S.createElement(rT.Provider,{value:{spacing:e}},t)}function KW(){const e=f.useContext(rT);return e?qW(GW({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var YW=W((e,{spacing:t})=>({root:{display:"flex",paddingLeft:A({size:t,sizes:e.spacing})}}));const XW=YW;var JW=Object.defineProperty,jf=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,oT=Object.prototype.propertyIsEnumerable,qb=(e,t,r)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZW=(e,t)=>{for(var r in t||(t={}))nT.call(t,r)&&qb(e,r,t[r]);if(jf)for(var r of jf(t))oT.call(t,r)&&qb(e,r,t[r]);return e},eH=(e,t)=>{var r={};for(var n in e)nT.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&&oT.call(e,n)&&(r[n]=e[n]);return r};const tH={},iT=f.forwardRef((e,t)=>{const r=H("AvatarGroup",tH,e),{children:n,spacing:o="sm",unstyled:i,className:a,variant:l}=r,c=eH(r,["children","spacing","unstyled","className","variant"]),{classes:u,cx:d}=XW({spacing:o},{name:"AvatarGroup",unstyled:i,variant:l});return S.createElement(QW,{spacing:o},S.createElement(oe,ZW({ref:t,className:d(u.root,a)},c),n))});iT.displayName="@mantine/core/AvatarGroup";var rH=Object.defineProperty,nH=Object.defineProperties,oH=Object.getOwnPropertyDescriptors,Qb=Object.getOwnPropertySymbols,iH=Object.prototype.hasOwnProperty,aH=Object.prototype.propertyIsEnumerable,Kb=(e,t,r)=>t in e?rH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zs=(e,t)=>{for(var r in t||(t={}))iH.call(t,r)&&Kb(e,r,t[r]);if(Qb)for(var r of Qb(t))aH.call(t,r)&&Kb(e,r,t[r]);return e},Yb=(e,t)=>nH(e,oH(t));const sH=["filled","light","gradient","outline"],Ou={xs:j(16),sm:j(26),md:j(38),lg:j(56),xl:j(84)};function lH({withinGroup:e,spacing:t,theme:r}){return e?{marginLeft:`calc(${A({size:t,sizes:r.spacing})} * -1)`,backgroundColor:`${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`,border:`${j(2)} solid ${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`}:null}function cH({theme:e,variant:t,color:r,gradient:n}){const o=e.fn.variant({variant:t,color:r,gradient:n});return sH.includes(t)?{placeholder:{color:o.color,backgroundColor:o.background,backgroundImage:t==="gradient"?o.background:void 0,border:`${j(t==="gradient"?0:1)} solid ${o.border}`},placeholderIcon:{color:o.color}}:{}}var uH=W((e,{radius:t,withinGroup:r,spacing:n,color:o,gradient:i},{variant:a,size:l})=>{const c=cH({theme:e,color:o,gradient:i,variant:a});return{root:Zs(Yb(Zs({},e.fn.focusStyles()),{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",display:"block",userSelect:"none",overflow:"hidden",borderRadius:e.fn.radius(t),textDecoration:"none",border:0,backgroundColor:"transparent",padding:0,width:A({size:l,sizes:Ou}),minWidth:A({size:l,sizes:Ou}),height:A({size:l,sizes:Ou})}),lH({withinGroup:r,spacing:n,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:Zs(Yb(Zs({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${A({size:l,sizes:Ou})} / 2.5)`}),c.placeholder),placeholderIcon:Zs({width:"70%",height:"70%"},c.placeholderIcon)}});const dH=uH;var fH=Object.defineProperty,pH=Object.defineProperties,hH=Object.getOwnPropertyDescriptors,Of=Object.getOwnPropertySymbols,aT=Object.prototype.hasOwnProperty,sT=Object.prototype.propertyIsEnumerable,Xb=(e,t,r)=>t in e?fH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Jb=(e,t)=>{for(var r in t||(t={}))aT.call(t,r)&&Xb(e,r,t[r]);if(Of)for(var r of Of(t))sT.call(t,r)&&Xb(e,r,t[r]);return e},mH=(e,t)=>pH(e,hH(t)),gH=(e,t)=>{var r={};for(var n in e)aT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Of)for(var n of Of(e))t.indexOf(n)<0&&sT.call(e,n)&&(r[n]=e[n]);return r};const vH={size:"md",color:"gray",variant:"light"},q0=f.forwardRef((e,t)=>{const r=H("Avatar",vH,e),{className:n,size:o,src:i,alt:a,radius:l,children:c,color:u,variant:d,gradient:p,classNames:h,styles:m,imageProps:v,unstyled:g}=r,b=gH(r,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),y=KW(),[x,_]=f.useState(!i),{classes:w,cx:O}=dH({color:u,radius:l,withinGroup:y.withinGroup,spacing:y.spacing,gradient:p},{classNames:h,styles:m,unstyled:g,name:"Avatar",variant:d,size:o});return f.useEffect(()=>{_(!i)},[i]),S.createElement(oe,Jb({component:"div",className:O(w.root,n),ref:t},b),x?S.createElement("div",{className:w.placeholder,title:a},c||S.createElement(FW,{className:w.placeholderIcon})):S.createElement("img",mH(Jb({},v),{className:w.image,src:i,alt:a,onError:()=>_(!0)})))});q0.displayName="@mantine/core/Avatar";q0.Group=iT;const Cf=q0;var yH=Object.defineProperty,xH=Object.defineProperties,wH=Object.getOwnPropertyDescriptors,Zb=Object.getOwnPropertySymbols,_H=Object.prototype.hasOwnProperty,bH=Object.prototype.propertyIsEnumerable,eS=(e,t,r)=>t in e?yH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fg=(e,t)=>{for(var r in t||(t={}))_H.call(t,r)&&eS(e,r,t[r]);if(Zb)for(var r of Zb(t))bH.call(t,r)&&eS(e,r,t[r]);return e},SH=(e,t)=>xH(e,wH(t));const PH=["light","filled","outline","dot","gradient"],pg={xs:{fontSize:j(9),height:j(16)},sm:{fontSize:j(10),height:j(18)},md:{fontSize:j(11),height:j(20)},lg:{fontSize:j(13),height:j(26)},xl:{fontSize:j(16),height:j(32)}},jH={xs:j(4),sm:j(4),md:j(6),lg:j(8),xl:j(10)};function OH({theme:e,variant:t,color:r,size:n,gradient:o}){if(!PH.includes(t))return null;if(t==="dot"){const a=A({size:n,sizes:jH});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${A({size:n,sizes:e.spacing})} / 1.5 - ${a} / 2)`,"&::before":{content:'""',display:"block",width:a,height:a,borderRadius:a,backgroundColor:e.fn.themeColor(r,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:a}}}const i=e.fn.variant({color:r,variant:t,gradient:o});return{background:i.background,color:i.color,border:`${j(t==="gradient"?0:1)} solid ${i.border}`}}var CH=W((e,{color:t,radius:r,gradient:n,fullWidth:o},{variant:i,size:a})=>{const{fontSize:l,height:c}=a in pg?pg[a]:pg.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:fg(SH(fg(fg({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${j(2)})`,textDecoration:"none",padding:`0 calc(${A({size:a,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:j(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),OH({theme:e,variant:i,color:t,size:a,gradient:n}))}});const EH=CH;var $H=Object.defineProperty,Ef=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,tS=(e,t,r)=>t in e?$H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kH=(e,t)=>{for(var r in t||(t={}))lT.call(t,r)&&tS(e,r,t[r]);if(Ef)for(var r of Ef(t))cT.call(t,r)&&tS(e,r,t[r]);return e},RH=(e,t)=>{var r={};for(var n in e)lT.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&&cT.call(e,n)&&(r[n]=e[n]);return r};const TH={variant:"light",size:"md",radius:"xl"},uT=f.forwardRef((e,t)=>{const r=H("Badge",TH,e),{className:n,color:o,variant:i,fullWidth:a,children:l,size:c,leftSection:u,rightSection:d,radius:p,gradient:h,classNames:m,styles:v,unstyled:g}=r,b=RH(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:y,cx:x}=EH({fullWidth:a,color:o,radius:p,gradient:h},{classNames:m,styles:v,name:"Badge",unstyled:g,variant:i,size:c});return S.createElement(oe,kH({className:x(y.root,n),ref:t},b),u&&S.createElement("span",{className:y.leftSection},u),S.createElement("span",{className:y.inner},l),d&&S.createElement("span",{className:y.rightSection},d))});uT.displayName="@mantine/core/Badge";const IH=uT;var DH=Object.defineProperty,$f=Object.getOwnPropertySymbols,dT=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable,rS=(e,t,r)=>t in e?DH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nS=(e,t)=>{for(var r in t||(t={}))dT.call(t,r)&&rS(e,r,t[r]);if($f)for(var r of $f(t))fT.call(t,r)&&rS(e,r,t[r]);return e},NH=(e,t)=>{var r={};for(var n in e)dT.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&&fT.call(e,n)&&(r[n]=e[n]);return r};function AH(e){const t=e,{style:r}=t,n=NH(t,["style"]);return S.createElement("svg",nS({viewBox:"0 0 409.294 409.294",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:nS({width:j(20),height:j(20)},r)},n),S.createElement("path",{d:"M0 204.647v175.412h175.412V204.647H58.471c0-64.48 52.461-116.941 116.941-116.941V29.235C78.684 29.235 0 107.919 0 204.647zM409.294 87.706V29.235c-96.728 0-175.412 78.684-175.412 175.412v175.412h175.412V204.647H292.353c0-64.48 52.461-116.941 116.941-116.941z"}))}var MH=Object.defineProperty,LH=Object.defineProperties,zH=Object.getOwnPropertyDescriptors,oS=Object.getOwnPropertySymbols,FH=Object.prototype.hasOwnProperty,VH=Object.prototype.propertyIsEnumerable,iS=(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)&&iS(e,r,t[r]);if(oS)for(var r of oS(t))VH.call(t,r)&&iS(e,r,t[r]);return e},UH=(e,t)=>LH(e,zH(t)),WH=W((e,{color:t})=>({root:UH(BH({},e.fn.fontStyles()),{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,margin:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md} ${e.spacing.lg}`}),inner:{display:"flex"},body:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},icon:{color:e.fn.variant({variant:"filled",color:t}).background,marginRight:e.spacing.lg,marginTop:j(2),width:j(22)},cite:{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}));const HH=WH;var GH=Object.defineProperty,kf=Object.getOwnPropertySymbols,pT=Object.prototype.hasOwnProperty,hT=Object.prototype.propertyIsEnumerable,aS=(e,t,r)=>t in e?GH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qH=(e,t)=>{for(var r in t||(t={}))pT.call(t,r)&&aS(e,r,t[r]);if(kf)for(var r of kf(t))hT.call(t,r)&&aS(e,r,t[r]);return e},QH=(e,t)=>{var r={};for(var n in e)pT.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&&hT.call(e,n)&&(r[n]=e[n]);return r};const KH={color:"gray",icon:S.createElement(AH,null)},mT=f.forwardRef((e,t)=>{const r=H("Blockquote",KH,e),{className:n,color:o,icon:i,cite:a,children:l,classNames:c,styles:u,unstyled:d,variant:p}=r,h=QH(r,["className","color","icon","cite","children","classNames","styles","unstyled","variant"]),{classes:m,cx:v}=HH({color:o},{classNames:c,styles:u,unstyled:d,name:"Blockquote",variant:p});return S.createElement(oe,qH({component:"blockquote",className:v(m.root,n),ref:t},h),S.createElement("div",{className:m.inner},i&&S.createElement("div",{className:m.icon},i),S.createElement("div",{className:m.body},l,a&&S.createElement("cite",{className:m.cite},a))))});mT.displayName="@mantine/core/Blockquote";var YH=W((e,{orientation:t,buttonBorderWidth:r})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type:not(:last-of-type)":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${j(r)} / 2)`},"&:last-of-type:not(:first-of-type)":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${j(r)} / 2)`},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${j(r)} / 2)`,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${j(r)} / 2)`},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:`calc(${r} * -1)`,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const XH=YH;var JH=Object.defineProperty,Rf=Object.getOwnPropertySymbols,gT=Object.prototype.hasOwnProperty,vT=Object.prototype.propertyIsEnumerable,sS=(e,t,r)=>t in e?JH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZH=(e,t)=>{for(var r in t||(t={}))gT.call(t,r)&&sS(e,r,t[r]);if(Rf)for(var r of Rf(t))vT.call(t,r)&&sS(e,r,t[r]);return e},eG=(e,t)=>{var r={};for(var n in e)gT.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&&vT.call(e,n)&&(r[n]=e[n]);return r};const tG={orientation:"horizontal",buttonBorderWidth:1},yT=f.forwardRef((e,t)=>{const r=H("ButtonGroup",tG,e),{className:n,orientation:o,buttonBorderWidth:i,unstyled:a}=r,l=eG(r,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=XH({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:a});return S.createElement(oe,ZH({className:u(c.root,n),ref:t},l))});yT.displayName="@mantine/core/ButtonGroup";var rG=Object.defineProperty,nG=Object.defineProperties,oG=Object.getOwnPropertyDescriptors,lS=Object.getOwnPropertySymbols,iG=Object.prototype.hasOwnProperty,aG=Object.prototype.propertyIsEnumerable,cS=(e,t,r)=>t in e?rG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fo=(e,t)=>{for(var r in t||(t={}))iG.call(t,r)&&cS(e,r,t[r]);if(lS)for(var r of lS(t))aG.call(t,r)&&cS(e,r,t[r]);return e},cd=(e,t)=>nG(e,oG(t));const sG=["filled","outline","light","white","default","subtle","gradient"],Qv={xs:{height:Et.xs,paddingLeft:j(14),paddingRight:j(14)},sm:{height:Et.sm,paddingLeft:j(18),paddingRight:j(18)},md:{height:Et.md,paddingLeft:j(22),paddingRight:j(22)},lg:{height:Et.lg,paddingLeft:j(26),paddingRight:j(26)},xl:{height:Et.xl,paddingLeft:j(32),paddingRight:j(32)},"compact-xs":{height:j(22),paddingLeft:j(7),paddingRight:j(7)},"compact-sm":{height:j(26),paddingLeft:j(8),paddingRight:j(8)},"compact-md":{height:j(30),paddingLeft:j(10),paddingRight:j(10)},"compact-lg":{height:j(34),paddingLeft:j(12),paddingRight:j(12)},"compact-xl":{height:j(40),paddingLeft:j(14),paddingRight:j(14)}};function lG({compact:e,size:t,withLeftIcon:r,withRightIcon:n}){if(e)return Qv[`compact-${t}`];const o=Qv[t];return o?cd(fo({},o),{paddingLeft:r?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:n?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const cG=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function uG({variant:e,theme:t,color:r,gradient:n}){if(!sG.includes(e))return null;const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?fo({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):fo({border:`${j(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var dG=W((e,{radius:t,fullWidth:r,compact:n,withLeftIcon:o,withRightIcon:i,color:a,gradient:l},{variant:c,size:u})=>({root:cd(fo(cd(fo(fo(fo(fo({},lG({compact:n,size:u,withLeftIcon:o,withRightIcon:i})),e.fn.fontStyles()),e.fn.focusStyles()),cG(r)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:A({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),uG({variant:c,theme:e,color:a,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":cd(fo({content:'""'},e.fn.cover(j(-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 fG=dG;var pG=Object.defineProperty,Tf=Object.getOwnPropertySymbols,xT=Object.prototype.hasOwnProperty,wT=Object.prototype.propertyIsEnumerable,uS=(e,t,r)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dS=(e,t)=>{for(var r in t||(t={}))xT.call(t,r)&&uS(e,r,t[r]);if(Tf)for(var r of Tf(t))wT.call(t,r)&&uS(e,r,t[r]);return e},hG=(e,t)=>{var r={};for(var n in e)xT.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&&wT.call(e,n)&&(r[n]=e[n]);return r};const mG={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},Q0=f.forwardRef((e,t)=>{const r=H("Button",mG,e),{className:n,size:o,color:i,type:a,disabled:l,children:c,leftIcon:u,rightIcon:d,fullWidth:p,variant:h,radius:m,uppercase:v,compact:g,loading:b,loaderPosition:y,loaderProps:x,gradient:_,classNames:w,styles:O,unstyled:C}=r,P=hG(r,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:E,cx:k,theme:$}=fG({radius:m,color:i,fullWidth:p,compact:g,gradient:_,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:C,classNames:w,styles:O,variant:h,size:o}),I=$.fn.variant({color:i,variant:h}),T=S.createElement(cn,dS({color:I.color,size:`calc(${A({size:o,sizes:Qv}).height} / 2)`},x));return S.createElement(wo,dS({className:k(E.root,n),type:a,disabled:l,"data-button":!0,"data-disabled":l||void 0,"data-loading":b||void 0,ref:t,unstyled:C},P),S.createElement("div",{className:E.inner},(u||b&&y==="left")&&S.createElement("span",{className:k(E.icon,E.leftIcon)},b&&y==="left"?T:u),b&&y==="center"&&S.createElement("span",{className:E.centerLoader},T),S.createElement("span",{className:E.label,style:{textTransform:v?"uppercase":void 0}},c),(d||b&&y==="right")&&S.createElement("span",{className:k(E.icon,E.rightIcon)},b&&y==="right"?T:d)))});Q0.displayName="@mantine/core/Button";Q0.Group=yT;const ne=Q0;var gG=W((e,{radius:t,shadow:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[r]||r||"none","&[data-with-border]":{border:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}}}));const vG=gG;var yG=Object.defineProperty,If=Object.getOwnPropertySymbols,_T=Object.prototype.hasOwnProperty,bT=Object.prototype.propertyIsEnumerable,fS=(e,t,r)=>t in e?yG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xG=(e,t)=>{for(var r in t||(t={}))_T.call(t,r)&&fS(e,r,t[r]);if(If)for(var r of If(t))bT.call(t,r)&&fS(e,r,t[r]);return e},wG=(e,t)=>{var r={};for(var n in e)_T.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&&bT.call(e,n)&&(r[n]=e[n]);return r};const _G={},ST=f.forwardRef((e,t)=>{const r=H("Paper",_G,e),{className:n,children:o,radius:i,withBorder:a,shadow:l,unstyled:c,variant:u}=r,d=wG(r,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:p,cx:h}=vG({radius:i,shadow:l},{name:"Paper",unstyled:c,variant:u});return S.createElement(oe,xG({className:h(p.root,n),"data-with-border":a||void 0,ref:t},d),o)});ST.displayName="@mantine/core/Paper";const on=ST;var bG=W((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const SG=bG;var PG=Object.defineProperty,Df=Object.getOwnPropertySymbols,PT=Object.prototype.hasOwnProperty,jT=Object.prototype.propertyIsEnumerable,pS=(e,t,r)=>t in e?PG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jG=(e,t)=>{for(var r in t||(t={}))PT.call(t,r)&&pS(e,r,t[r]);if(Df)for(var r of Df(t))jT.call(t,r)&&pS(e,r,t[r]);return e},OG=(e,t)=>{var r={};for(var n in e)PT.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&&jT.call(e,n)&&(r[n]=e[n]);return r};const OT=f.forwardRef((e,t)=>{const r=H("Center",{},e),{inline:n,className:o,unstyled:i,variant:a}=r,l=OG(r,["inline","className","unstyled","variant"]),{classes:c,cx:u}=SG({inline:n},{name:"Center",unstyled:i,variant:a});return S.createElement(oe,jG({ref:t,className:u(c.root,o)},l))});OT.displayName="@mantine/core/Center";const or=OT,CT=f.createContext(null),CG=CT.Provider,EG=()=>f.useContext(CT);var $G=Object.defineProperty,Nf=Object.getOwnPropertySymbols,ET=Object.prototype.hasOwnProperty,$T=Object.prototype.propertyIsEnumerable,hS=(e,t,r)=>t in e?$G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mS=(e,t)=>{for(var r in t||(t={}))ET.call(t,r)&&hS(e,r,t[r]);if(Nf)for(var r of Nf(t))$T.call(t,r)&&hS(e,r,t[r]);return e},kG=(e,t)=>{var r={};for(var n in e)ET.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&&$T.call(e,n)&&(r[n]=e[n]);return r};const RG={size:"sm"},kT=f.forwardRef((e,t)=>{const r=H("CheckboxGroup",RG,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=kG(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=$r({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(CG,{value:{value:d,onChange:h,size:l}},S.createElement(Ut.Wrapper,mS(mS({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),u),n))});kT.displayName="@mantine/core/CheckboxGroup";var TG=Object.defineProperty,Af=Object.getOwnPropertySymbols,RT=Object.prototype.hasOwnProperty,TT=Object.prototype.propertyIsEnumerable,gS=(e,t,r)=>t in e?TG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mf=(e,t)=>{for(var r in t||(t={}))RT.call(t,r)&&gS(e,r,t[r]);if(Af)for(var r of Af(t))TT.call(t,r)&&gS(e,r,t[r]);return e},IT=(e,t)=>{var r={};for(var n in e)RT.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&&TT.call(e,n)&&(r[n]=e[n]);return r};function DT(e){const t=e,{width:r,height:n,style:o}=t,i=IT(t,["width","height","style"]);return S.createElement("svg",Mf({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Mf({width:r,height:n},o)},i),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 NT(e){var t=e,{indeterminate:r}=t,n=IT(t,["indeterminate"]);return r?S.createElement("svg",Mf({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(DT,Mf({},n))}var IG=Object.defineProperty,DG=Object.defineProperties,NG=Object.getOwnPropertyDescriptors,vS=Object.getOwnPropertySymbols,AG=Object.prototype.hasOwnProperty,MG=Object.prototype.propertyIsEnumerable,yS=(e,t,r)=>t in e?IG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xS=(e,t)=>{for(var r in t||(t={}))AG.call(t,r)&&yS(e,r,t[r]);if(vS)for(var r of vS(t))MG.call(t,r)&&yS(e,r,t[r]);return e},wS=(e,t)=>DG(e,NG(t));const LG={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)};var zG=W((e,{radius:t,color:r,transitionDuration:n,labelPosition:o,error:i,indeterminate:a},{size:l})=>{const c=A({size:l,sizes:LG}),u=e.fn.variant({variant:"filled",color:r});return{icon:wS(xS({},e.fn.cover()),{ref:Vt("icon"),color:a?"inherit":e.white,transform:a?"none":`translateY(${j(5)}) scale(0.5)`,opacity:a?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:wS(xS({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${j(1)} solid ${i?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,[`& + .${Vt("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",[`& + .${Vt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const FG=zG;var VG=Object.defineProperty,BG=Object.defineProperties,UG=Object.getOwnPropertyDescriptors,_S=Object.getOwnPropertySymbols,WG=Object.prototype.hasOwnProperty,HG=Object.prototype.propertyIsEnumerable,bS=(e,t,r)=>t in e?VG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GG=(e,t)=>{for(var r in t||(t={}))WG.call(t,r)&&bS(e,r,t[r]);if(_S)for(var r of _S(t))HG.call(t,r)&&bS(e,r,t[r]);return e},qG=(e,t)=>BG(e,UG(t));const hg={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)};var QG=W((e,{labelPosition:t},{size:r})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}},labelWrapper:qG(GG({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:r in hg?A({size:r,sizes:e.fontSizes}):void 0,lineHeight:r in hg?A({size:r,sizes:hg}):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 KG=QG;var YG=Object.defineProperty,Lf=Object.getOwnPropertySymbols,AT=Object.prototype.hasOwnProperty,MT=Object.prototype.propertyIsEnumerable,SS=(e,t,r)=>t in e?YG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,XG=(e,t)=>{for(var r in t||(t={}))AT.call(t,r)&&SS(e,r,t[r]);if(Lf)for(var r of Lf(t))MT.call(t,r)&&SS(e,r,t[r]);return e},JG=(e,t)=>{var r={};for(var n in e)AT.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&&MT.call(e,n)&&(r[n]=e[n]);return r};const Zh=f.forwardRef((e,t)=>{var r=e,{__staticSelector:n,className:o,classNames:i,styles:a,unstyled:l,children:c,label:u,description:d,id:p,disabled:h,error:m,size:v,labelPosition:g,variant:b}=r,y=JG(r,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:x,cx:_}=KG({labelPosition:g},{name:n,styles:a,classNames:i,unstyled:l,variant:b,size:v});return S.createElement(oe,XG({className:_(x.root,o),ref:t},y),S.createElement("div",{className:_(x.body)},c,S.createElement("div",{className:x.labelWrapper},u!=null&&S.createElement("label",{className:x.label,"data-disabled":h||void 0,htmlFor:p},u),d&&S.createElement(Ut.Description,{className:x.description},d),m&&m!=="boolean"&&S.createElement(Ut.Error,{className:x.error},m))))});Zh.displayName="@mantine/core/InlineInput";var ZG=Object.defineProperty,zf=Object.getOwnPropertySymbols,LT=Object.prototype.hasOwnProperty,zT=Object.prototype.propertyIsEnumerable,PS=(e,t,r)=>t in e?ZG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cu=(e,t)=>{for(var r in t||(t={}))LT.call(t,r)&&PS(e,r,t[r]);if(zf)for(var r of zf(t))zT.call(t,r)&&PS(e,r,t[r]);return e},eq=(e,t)=>{var r={};for(var n in e)LT.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&&zT.call(e,n)&&(r[n]=e[n]);return r};const tq={size:"sm",transitionDuration:100,icon:NT,labelPosition:"right"},jn=f.forwardRef((e,t)=>{const r=H("Checkbox",tq,e),{className:n,style:o,sx:i,checked:a,disabled:l,color:c,label:u,indeterminate:d,id:p,size:h,radius:m,wrapperProps:v,children:g,classNames:b,styles:y,transitionDuration:x,icon:_,unstyled:w,labelPosition:O,description:C,error:P,variant:E}=r,k=eq(r,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),$=EG(),I=Rr(p),{systemStyles:T,rest:z}=eo(k),{classes:M}=FG({radius:m,color:c,transitionDuration:x,labelPosition:O,error:!!P,indeterminate:d},{name:"Checkbox",classNames:b,styles:y,unstyled:w,variant:E,size:($==null?void 0:$.size)||h}),L=$?{checked:$.value.includes(z.value),onChange:$.onChange}:{};return S.createElement(Zh,Cu(Cu({className:n,sx:i,style:o,id:I,size:($==null?void 0:$.size)||h,labelPosition:O,label:u,description:C,error:P,disabled:l,__staticSelector:"Checkbox",classNames:b,styles:y,unstyled:w,"data-checked":L.checked||void 0,variant:E},T),v),S.createElement("div",{className:M.inner},S.createElement("input",Cu(Cu({id:I,ref:t,type:"checkbox",className:M.input,checked:a,disabled:l},z),L)),S.createElement(_,{indeterminate:d,className:M.icon})))});jn.displayName="@mantine/core/Checkbox";jn.Group=kT;const FT=f.createContext(null),rq=FT.Provider,nq=()=>f.useContext(FT),oq={};function VT(e){const{value:t,defaultValue:r,onChange:n,multiple:o,children:i}=H("ChipGroup",oq,e),[a,l]=$r({value:t,defaultValue:r,finalValue:o?[]:null,onChange:n}),c=d=>Array.isArray(a)?a.includes(d):d===a,u=d=>{const p=d.currentTarget.value;Array.isArray(a)?l(a.includes(p)?a.filter(h=>h!==p):[...a,p]):l(p)};return S.createElement(rq,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}VT.displayName="@mantine/core/ChipGroup";var iq=Object.defineProperty,aq=Object.defineProperties,sq=Object.getOwnPropertyDescriptors,jS=Object.getOwnPropertySymbols,lq=Object.prototype.hasOwnProperty,cq=Object.prototype.propertyIsEnumerable,OS=(e,t,r)=>t in e?iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xn=(e,t)=>{for(var r in t||(t={}))lq.call(t,r)&&OS(e,r,t[r]);if(jS)for(var r of jS(t))cq.call(t,r)&&OS(e,r,t[r]);return e},yl=(e,t)=>aq(e,sq(t));const CS={xs:j(24),sm:j(28),md:j(32),lg:j(36),xl:j(40)},el={xs:j(10),sm:j(12),md:j(14),lg:j(16),xl:j(18)},ES={xs:j(16),sm:j(20),md:j(24),lg:j(28),xl:j(32)},Eu={xs:j(7.5),sm:j(10),md:j(11.5),lg:j(13),xl:j(15)};function uq(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:yl(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:`${j(1)} solid ${n.background}`}}:{label:null,checked:null}}var dq=W((e,{radius:t,color:r},{size:n,variant:o})=>{const i=uq(e,{color:r},o);return{root:{},label:yl(xn(yl(xn({ref:Vt("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:`${j(1)} solid transparent`,borderRadius:e.fn.radius(t),height:A({size:n,sizes:CS}),fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:`calc(${A({size:n,sizes:CS})} - ${j(2)})`,paddingLeft:A({size:n,sizes:ES}),paddingRight:A({size:n,sizes:ES}),cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 100ms ease",WebkitTapHighlightColor:"transparent"}),i.label),{"&[data-disabled]":yl(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]})),{[`& .${Vt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}),"&[data-checked]":{paddingLeft:A({size:n,sizes:Eu}),paddingRight:A({size:n,sizes:Eu}),"&:not([data-disabled])":i.checked}}),iconWrapper:{ref:Vt("iconWrapper"),color:o==="filled"?e.white:e.fn.variant({variant:"filled",color:r}).background,width:`calc(${A({size:n,sizes:el})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,maxWidth:`calc(${A({size:n,sizes:el})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,height:A({size:n,sizes:el}),display:"inline-block",verticalAlign:"middle",overflow:"hidden"},checkIcon:{width:A({size:n,sizes:el}),height:`calc(${A({size:n,sizes:el})} / 1.1)`,display:"block"},input:{width:0,height:0,padding:0,opacity:0,margin:0,"&:disabled + label":yl(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]})),{[`& .${Vt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&[data-checked]":{paddingLeft:A({size:n,sizes:Eu}),paddingRight:A({size:n,sizes:Eu}),"&: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",[`& + .${Vt("label")}`]:xn({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${Vt("label")}`]:xn({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}}}});const fq=dq;var pq=Object.defineProperty,Ff=Object.getOwnPropertySymbols,BT=Object.prototype.hasOwnProperty,UT=Object.prototype.propertyIsEnumerable,$S=(e,t,r)=>t in e?pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$u=(e,t)=>{for(var r in t||(t={}))BT.call(t,r)&&$S(e,r,t[r]);if(Ff)for(var r of Ff(t))UT.call(t,r)&&$S(e,r,t[r]);return e},hq=(e,t)=>{var r={};for(var n in e)BT.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&&UT.call(e,n)&&(r[n]=e[n]);return r};const mq={type:"checkbox",size:"sm",radius:"xl",variant:"outline"},Vf=f.forwardRef((e,t)=>{const r=H("Chip",mq,e),{radius:n,type:o,size:i,variant:a,disabled:l,id:c,color:u,children:d,className:p,classNames:h,style:m,styles:v,checked:g,defaultChecked:b,onChange:y,sx:x,wrapperProps:_,value:w,unstyled:O}=r,C=hq(r,["radius","type","size","variant","disabled","id","color","children","className","classNames","style","styles","checked","defaultChecked","onChange","sx","wrapperProps","value","unstyled"]),P=nq(),E=Rr(c),{systemStyles:k,rest:$}=eo(C),{classes:I,cx:T}=fq({radius:n,color:u},{classNames:h,styles:v,unstyled:O,name:"Chip",variant:a,size:i}),[z,M]=$r({value:g,defaultValue:b,finalValue:!1,onChange:y}),L=P?{checked:P.isChipSelected(w),onChange:P.onChange,type:P.multiple?"checkbox":"radio"}:{},q=L.checked||z;return S.createElement(oe,$u($u({className:T(I.root,p),style:m,sx:x},k),_),S.createElement("input",$u($u({type:o,className:I.input,checked:q,onChange:Y=>M(Y.currentTarget.checked),id:E,disabled:l,ref:t,value:w},L),$)),S.createElement("label",{htmlFor:E,"data-checked":q||void 0,"data-disabled":l||void 0,className:I.label},q&&S.createElement("span",{className:I.iconWrapper},S.createElement(DT,{className:I.checkIcon})),d))});Vf.displayName="@mantine/core/Chip";Vf.Group=VT;var gq=W((e,{fluid:t,sizes:r},{size:n})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":A({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const vq=gq;var yq=Object.defineProperty,Bf=Object.getOwnPropertySymbols,WT=Object.prototype.hasOwnProperty,HT=Object.prototype.propertyIsEnumerable,kS=(e,t,r)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xq=(e,t)=>{for(var r in t||(t={}))WT.call(t,r)&&kS(e,r,t[r]);if(Bf)for(var r of Bf(t))HT.call(t,r)&&kS(e,r,t[r]);return e},wq=(e,t)=>{var r={};for(var n in e)WT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bf)for(var n of Bf(e))t.indexOf(n)<0&&HT.call(e,n)&&(r[n]=e[n]);return r};const _q={sizes:{xs:j(540),sm:j(720),md:j(960),lg:j(1140),xl:j(1320)}},GT=f.forwardRef((e,t)=>{const r=H("Container",_q,e),{className:n,fluid:o,size:i,unstyled:a,sizes:l,variant:c}=r,u=wq(r,["className","fluid","size","unstyled","sizes","variant"]),{classes:d,cx:p}=vq({fluid:o,sizes:l},{unstyled:a,name:"Container",variant:c,size:i});return S.createElement(oe,xq({className:p(d.root,n),ref:t},u))});GT.displayName="@mantine/core/Container";var bq=Object.defineProperty,Uf=Object.getOwnPropertySymbols,qT=Object.prototype.hasOwnProperty,QT=Object.prototype.propertyIsEnumerable,RS=(e,t,r)=>t in e?bq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sq=(e,t)=>{for(var r in t||(t={}))qT.call(t,r)&&RS(e,r,t[r]);if(Uf)for(var r of Uf(t))QT.call(t,r)&&RS(e,r,t[r]);return e},Pq=(e,t)=>{var r={};for(var n in e)qT.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&&QT.call(e,n)&&(r[n]=e[n]);return r};const jq={timeout:1e3};function KT(e){const t=H("CopyButton",jq,e),{children:r,timeout:n,value:o}=t,i=Pq(t,["children","timeout","value"]),a=uL({timeout:n}),l=()=>a.copy(o);return S.createElement(S.Fragment,null,r(Sq({copy:l,copied:a.copied},i)))}KT.displayName="@mantine/core/CopyButton";const[Oq,Is]=ko("ModalBase component was not found in tree");var Cq=W(()=>({close:{marginLeft:"auto",marginRight:0}}));const Eq=Cq;var $q=Object.defineProperty,Wf=Object.getOwnPropertySymbols,YT=Object.prototype.hasOwnProperty,XT=Object.prototype.propertyIsEnumerable,TS=(e,t,r)=>t in e?$q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kq=(e,t)=>{for(var r in t||(t={}))YT.call(t,r)&&TS(e,r,t[r]);if(Wf)for(var r of Wf(t))XT.call(t,r)&&TS(e,r,t[r]);return e},Rq=(e,t)=>{var r={};for(var n in e)YT.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&&XT.call(e,n)&&(r[n]=e[n]);return r};const Tq={size:"sm"},Iq=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}CloseButton`,Tq,e),{className:o}=n,i=Rq(n,["className"]),{classes:a,cx:l}=Eq(null,r.stylesApi);return S.createElement(wc,kq({className:l(a.close,o),ref:t,onClick:r.onClose},i))});var Dq=W(()=>({overlay:{}}));const Nq=Dq;var Aq=Object.defineProperty,Mq=Object.defineProperties,Lq=Object.getOwnPropertyDescriptors,IS=Object.getOwnPropertySymbols,zq=Object.prototype.hasOwnProperty,Fq=Object.prototype.propertyIsEnumerable,DS=(e,t,r)=>t in e?Aq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vq=(e,t)=>{for(var r in t||(t={}))zq.call(t,r)&&DS(e,r,t[r]);if(IS)for(var r of IS(t))Fq.call(t,r)&&DS(e,r,t[r]);return e},Bq=(e,t)=>Mq(e,Lq(t)),Uq=W((e,{color:t,opacity:r,blur:n,radius:o,gradient:i,fixed:a,zIndex:l})=>({root:Bq(Vq({},e.fn.cover(0)),{position:a?"fixed":"absolute",backgroundColor:i?void 0:e.fn.rgba(t,r),backgroundImage:i,backdropFilter:n?`blur(${j(n)})`:void 0,borderRadius:e.fn.radius(o),zIndex:l,"&[data-center]":{display:"flex",alignItems:"center",justifyContent:"center"}})}));const Wq=Uq;var Hq=Object.defineProperty,Hf=Object.getOwnPropertySymbols,JT=Object.prototype.hasOwnProperty,ZT=Object.prototype.propertyIsEnumerable,NS=(e,t,r)=>t in e?Hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gq=(e,t)=>{for(var r in t||(t={}))JT.call(t,r)&&NS(e,r,t[r]);if(Hf)for(var r of Hf(t))ZT.call(t,r)&&NS(e,r,t[r]);return e},qq=(e,t)=>{var r={};for(var n in e)JT.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&&ZT.call(e,n)&&(r[n]=e[n]);return r};const Qq={opacity:.6,color:"#000",zIndex:Cn("modal"),radius:0},eI=f.forwardRef((e,t)=>{const r=H("Overlay",Qq,e),{variant:n,opacity:o,color:i,blur:a,gradient:l,zIndex:c,radius:u,children:d,className:p,classNames:h,styles:m,unstyled:v,center:g,fixed:b}=r,y=qq(r,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:x,cx:_}=Wq({color:i,opacity:o,blur:a,radius:u,gradient:l,fixed:b,zIndex:c},{name:"Overlay",classNames:h,styles:m,unstyled:v,variant:n});return S.createElement(oe,Gq({ref:t,className:_(x.root,p),"data-center":g||void 0},y),d)});eI.displayName="@mantine/core/Overlay";const tI=eI;var Kq=Object.defineProperty,Yq=Object.defineProperties,Xq=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertySymbols,rI=Object.prototype.hasOwnProperty,nI=Object.prototype.propertyIsEnumerable,AS=(e,t,r)=>t in e?Kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tl=(e,t)=>{for(var r in t||(t={}))rI.call(t,r)&&AS(e,r,t[r]);if(Gf)for(var r of Gf(t))nI.call(t,r)&&AS(e,r,t[r]);return e},Jq=(e,t)=>Yq(e,Xq(t)),Zq=(e,t)=>{var r={};for(var n in e)rI.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&&nI.call(e,n)&&(r[n]=e[n]);return r};const eQ={},tQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Overlay`,eQ,e),{onClick:o,transitionProps:i,style:a,className:l}=n,c=Zq(n,["onClick","transitionProps","style","className"]),{classes:u,cx:d}=Nq(null,r.stylesApi),p=h=>{o==null||o(h),r.closeOnClickOutside&&r.onClose()};return S.createElement(pa,Jq(tl(tl({mounted:r.opened},r.transitionProps),i),{transition:"fade"}),h=>S.createElement(tI,tl({ref:t,onClick:p,fixed:!0,style:tl(tl({},a),h),className:d(u.overlay,l),zIndex:r.zIndex},c)))});var rQ=W((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const nQ=rQ;var oQ=Object.defineProperty,qf=Object.getOwnPropertySymbols,oI=Object.prototype.hasOwnProperty,iI=Object.prototype.propertyIsEnumerable,MS=(e,t,r)=>t in e?oQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rl=(e,t)=>{for(var r in t||(t={}))oI.call(t,r)&&MS(e,r,t[r]);if(qf)for(var r of qf(t))iI.call(t,r)&&MS(e,r,t[r]);return e},iQ=(e,t)=>{var r={};for(var n in e)oI.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&&iI.call(e,n)&&(r[n]=e[n]);return r};const aQ={},sQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Content`,aQ,e),{className:o,transitionProps:i,style:a,onKeyDown:l}=n,c=iQ(n,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:d}=nQ({zIndex:r.zIndex},r.stylesApi),p=h=>{var m;((m=h.target)==null?void 0:m.getAttribute("data-mantine-stop-propagation"))!=="true"&&h.key==="Escape"&&r.closeOnEscape&&r.onClose(),l==null||l(h)};return S.createElement(pa,rl(rl({mounted:r.opened,transition:"pop"},r.transitionProps),i),h=>S.createElement("div",{className:d(u.inner)},S.createElement(B0,{active:r.opened&&r.trapFocus},S.createElement(on,rl({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:rl(rl({},a),h),shadow:r.shadow},c),c.children))))});var lQ=W((e,{padding:t})=>{const r=A({size:t,sizes:e.spacing});return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:r,paddingRight:`calc(${r} - ${j(5)})`,position:"sticky",top:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1e3}}});const cQ=lQ;var uQ=Object.defineProperty,Qf=Object.getOwnPropertySymbols,aI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,LS=(e,t,r)=>t in e?uQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dQ=(e,t)=>{for(var r in t||(t={}))aI.call(t,r)&&LS(e,r,t[r]);if(Qf)for(var r of Qf(t))sI.call(t,r)&&LS(e,r,t[r]);return e},fQ=(e,t)=>{var r={};for(var n in e)aI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qf)for(var n of Qf(e))t.indexOf(n)<0&&sI.call(e,n)&&(r[n]=e[n]);return r};const pQ={},hQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Header`,pQ,e),{className:o}=n,i=fQ(n,["className"]),{classes:a,cx:l}=cQ({padding:r.padding},r.stylesApi);return S.createElement(oe,dQ({ref:t,className:l(a.header,o)},i))});var mQ=W(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const gQ=mQ;var vQ=Object.defineProperty,Kf=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,cI=Object.prototype.propertyIsEnumerable,zS=(e,t,r)=>t in e?vQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yQ=(e,t)=>{for(var r in t||(t={}))lI.call(t,r)&&zS(e,r,t[r]);if(Kf)for(var r of Kf(t))cI.call(t,r)&&zS(e,r,t[r]);return e},xQ=(e,t)=>{var r={};for(var n in e)lI.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&&cI.call(e,n)&&(r[n]=e[n]);return r};const wQ={},_Q=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Title`,wQ,e),{className:o}=n,i=xQ(n,["className"]),{classes:a,cx:l}=gQ(null,r.stylesApi);return f.useEffect(()=>(r.setTitleMounted(!0),()=>r.setTitleMounted(!1)),[]),S.createElement(oe,yQ({component:"h2",id:r.getTitleId(),className:l(a.title,o),ref:t},i))});var bQ=W((e,{padding:t})=>({body:{padding:A({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const SQ=bQ;var PQ=Object.defineProperty,Yf=Object.getOwnPropertySymbols,uI=Object.prototype.hasOwnProperty,dI=Object.prototype.propertyIsEnumerable,FS=(e,t,r)=>t in e?PQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jQ=(e,t)=>{for(var r in t||(t={}))uI.call(t,r)&&FS(e,r,t[r]);if(Yf)for(var r of Yf(t))dI.call(t,r)&&FS(e,r,t[r]);return e},OQ=(e,t)=>{var r={};for(var n in e)uI.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&&dI.call(e,n)&&(r[n]=e[n]);return r};const CQ={},EQ=f.forwardRef((e,t)=>{const r=Is(),n=H(`${r.__staticSelector}Body`,CQ,e),{className:o}=n,i=OQ(n,["className"]),{classes:a,cx:l}=SQ({padding:r.padding},r.stylesApi);return f.useEffect(()=>(r.setBodyMounted(!0),()=>r.setBodyMounted(!1)),[]),S.createElement(oe,jQ({id:r.getBodyId(),className:l(a.body,o),ref:t},i))});function $Q({children:e}){return S.createElement(S.Fragment,null,e)}function kQ({opened:e,transitionDuration:t}){const[r,n]=f.useState(e),o=f.useRef(),a=Rh()?0:t;return f.useEffect(()=>(e?(n(!0),window.clearTimeout(o.current)):a===0?n(!1):o.current=window.setTimeout(()=>n(!1),a),()=>window.clearTimeout(o.current)),[e,a]),r}var RQ=W(()=>({root:{}}));const TQ=RQ;var IQ=Object.defineProperty,DQ=Object.defineProperties,NQ=Object.getOwnPropertyDescriptors,Xf=Object.getOwnPropertySymbols,fI=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,VS=(e,t,r)=>t in e?IQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mg=(e,t)=>{for(var r in t||(t={}))fI.call(t,r)&&VS(e,r,t[r]);if(Xf)for(var r of Xf(t))pI.call(t,r)&&VS(e,r,t[r]);return e},BS=(e,t)=>DQ(e,NQ(t)),AQ=(e,t)=>{var r={};for(var n in e)fI.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&&pI.call(e,n)&&(r[n]=e[n]);return r};const K0={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Cn("modal"),padding:"md",size:"md",shadow:"xl"};function kt(e){const t=H("ModalBase",K0,e),{opened:r,onClose:n,children:o,closeOnClickOutside:i,__staticSelector:a,transitionProps:l,withinPortal:c,portalProps:u,keepMounted:d,target:p,zIndex:h,lockScroll:m,trapFocus:v,closeOnEscape:g,returnFocus:b,padding:y,shadow:x,id:_,size:w,variant:O,classNames:C,unstyled:P,styles:E,className:k}=t,$=AQ(t,["opened","onClose","children","closeOnClickOutside","__staticSelector","transitionProps","withinPortal","portalProps","keepMounted","target","zIndex","lockScroll","trapFocus","closeOnEscape","returnFocus","padding","shadow","id","size","variant","classNames","unstyled","styles","className"]),{classes:I,cx:T}=TQ(null,{name:a,classNames:C,styles:E,unstyled:P,variant:O,size:w}),z=Rr(_),[M,L]=f.useState(!1),[q,Y]=f.useState(!1),R=typeof(l==null?void 0:l.duration)=="number"?l==null?void 0:l.duration:200,N=kQ({opened:r,transitionDuration:R});return qg("keydown",V=>{!v&&V.key==="Escape"&&g&&n()}),EE({opened:r,shouldReturnFocus:v&&b}),S.createElement(Rs,BS(mg({},u),{withinPortal:c,target:p}),S.createElement(Oq,{value:{__staticSelector:a,opened:r,onClose:n,closeOnClickOutside:i,transitionProps:BS(mg({},l),{duration:R,keepMounted:d}),zIndex:h,padding:y,id:z,getTitleId:()=>`${z}-title`,getBodyId:()=>`${z}-body`,titleMounted:M,bodyMounted:q,setTitleMounted:L,setBodyMounted:Y,trapFocus:v,closeOnEscape:g,shadow:x,stylesApi:{name:a,size:w,variant:O,classNames:C,styles:E,unstyled:P}}},S.createElement(NA,{enabled:N&&m},S.createElement(oe,mg({className:T(I.root,k)},$),o))))}kt.CloseButton=Iq;kt.Overlay=tQ;kt.Content=sQ;kt.Header=hQ;kt.Title=_Q;kt.Body=EQ;kt.NativeScrollArea=$Q;const MQ={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var LQ=Object.defineProperty,zQ=Object.defineProperties,FQ=Object.getOwnPropertyDescriptors,Jf=Object.getOwnPropertySymbols,hI=Object.prototype.hasOwnProperty,mI=Object.prototype.propertyIsEnumerable,US=(e,t,r)=>t in e?LQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VQ=(e,t)=>{for(var r in t||(t={}))hI.call(t,r)&&US(e,r,t[r]);if(Jf)for(var r of Jf(t))mI.call(t,r)&&US(e,r,t[r]);return e},BQ=(e,t)=>zQ(e,FQ(t)),UQ=(e,t)=>{var r={};for(var n in e)hI.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 WQ={},Zf=f.forwardRef((e,t)=>{const r=H("Flex",WQ,e),{gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u,sx:d}=r,p=UQ(r,["gap","rowGap","columnGap","align","justify","wrap","direction","sx"]);return S.createElement(oe,BQ(VQ({},p),{sx:[{display:"flex"},h=>Qg({gap:n,rowGap:o,columnGap:i,align:a,justify:l,wrap:c,direction:u},h,MQ),...dc(d)],ref:t}))});Zf.displayName="@mantine/core/Flex";const[HQ,GQ]=ko("Grid component was not found in tree");var qQ=Object.defineProperty,WS=Object.getOwnPropertySymbols,QQ=Object.prototype.hasOwnProperty,KQ=Object.prototype.propertyIsEnumerable,HS=(e,t,r)=>t in e?qQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YQ=(e,t)=>{for(var r in t||(t={}))QQ.call(t,r)&&HS(e,r,t[r]);if(WS)for(var r of WS(t))KQ.call(t,r)&&HS(e,r,t[r]);return e};const Y0=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,gI=(e,t,r)=>r||e==="auto"||e==="content"?"unset":Y0(e,t),vI=(e,t)=>{if(e)return e==="auto"||t?1:0},yI=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0,xI=(e,t)=>typeof e<"u"?`calc(${A({size:e,sizes:t.spacing})} / 2)`:void 0;function XQ({sizes:e,offsets:t,orders:r,theme:n,columns:o,gutters:i,grow:a}){return aE.reduce((l,c)=>(l[`@media (min-width: ${ir(n.breakpoints[c])})`]={order:r[c],flexBasis:Y0(e[c],o),padding:xI(i[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:gI(e[c],o,a),marginLeft:yI(t[c],o),flexGrow:vI(e[c],a)},l),{})}var JQ=W((e,{gutter:t,gutterXs:r,gutterSm:n,gutterMd:o,gutterLg:i,gutterXl:a,grow:l,offset:c,offsetXs:u,offsetSm:d,offsetMd:p,offsetLg:h,offsetXl:m,columns:v,span:g,xs:b,sm:y,md:x,lg:_,xl:w,order:O,orderXs:C,orderSm:P,orderMd:E,orderLg:k,orderXl:$})=>({col:YQ({boxSizing:"border-box",flexGrow:vI(g,l),order:O,padding:xI(t,e),marginLeft:yI(c,v),flexBasis:Y0(g,v),flexShrink:0,width:g==="content"?"auto":void 0,maxWidth:gI(g,v,l)},XQ({sizes:{xs:b,sm:y,md:x,lg:_,xl:w},offsets:{xs:u,sm:d,md:p,lg:h,xl:m},orders:{xs:C,sm:P,md:E,lg:k,xl:$},gutters:{xs:r,sm:n,md:o,lg:i,xl:a},theme:e,columns:v,grow:l}))}));const ZQ=JQ;var eK=Object.defineProperty,ep=Object.getOwnPropertySymbols,wI=Object.prototype.hasOwnProperty,_I=Object.prototype.propertyIsEnumerable,GS=(e,t,r)=>t in e?eK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tK=(e,t)=>{for(var r in t||(t={}))wI.call(t,r)&&GS(e,r,t[r]);if(ep)for(var r of ep(t))_I.call(t,r)&&GS(e,r,t[r]);return e},rK=(e,t)=>{var r={};for(var n in e)wI.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&&_I.call(e,n)&&(r[n]=e[n]);return r};const nK={};function oK(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const bI=f.forwardRef((e,t)=>{const r=H("GridCol",nK,e),{children:n,span:o,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:b,orderXs:y,orderSm:x,orderMd:_,orderLg:w,orderXl:O,className:C,unstyled:P,variant:E}=r,k=rK(r,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","unstyled","variant"]),$=GQ(),I=o||$.columns,{classes:T,cx:z}=ZQ({gutter:$.gutter,gutterXs:$.gutterXs,gutterSm:$.gutterSm,gutterMd:$.gutterMd,gutterLg:$.gutterLg,gutterXl:$.gutterXl,offset:i,offsetXs:a,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:b,orderXs:y,orderSm:x,orderMd:_,orderLg:w,orderXl:O,grow:$.grow,columns:$.columns,span:I},{unstyled:P,name:"Grid",variant:E});return!oK(I)||I>$.columns?null:S.createElement(oe,tK({className:z(T.col,C),ref:t},k),n)});bI.displayName="@mantine/core/Col";var iK=Object.defineProperty,qS=Object.getOwnPropertySymbols,aK=Object.prototype.hasOwnProperty,sK=Object.prototype.propertyIsEnumerable,QS=(e,t,r)=>t in e?iK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lK=(e,t)=>{for(var r in t||(t={}))aK.call(t,r)&&QS(e,r,t[r]);if(qS)for(var r of qS(t))sK.call(t,r)&&QS(e,r,t[r]);return e};function cK(e,t){return aE.reduce((r,n)=>(typeof e[n]<"u"&&(r[`@media (min-width: ${t.breakpoints[n]})`]={margin:`calc(-${A({size:e[n],sizes:t.spacing})} / 2)`}),r),{})}var uK=W((e,{justify:t,align:r,gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c})=>({root:lK({margin:`calc(-${A({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:r},cK({xs:o,sm:i,md:a,lg:l,xl:c},e))}));const dK=uK;var fK=Object.defineProperty,tp=Object.getOwnPropertySymbols,SI=Object.prototype.hasOwnProperty,PI=Object.prototype.propertyIsEnumerable,KS=(e,t,r)=>t in e?fK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pK=(e,t)=>{for(var r in t||(t={}))SI.call(t,r)&&KS(e,r,t[r]);if(tp)for(var r of tp(t))PI.call(t,r)&&KS(e,r,t[r]);return e},hK=(e,t)=>{var r={};for(var n in e)SI.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&&PI.call(e,n)&&(r[n]=e[n]);return r};const mK={gutter:"md",justify:"flex-start",align:"stretch",columns:12},tn=f.forwardRef((e,t)=>{const r=H("Grid",mK,e),{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,children:u,grow:d,justify:p,align:h,columns:m,className:v,unstyled:g,variant:b}=r,y=hK(r,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","unstyled","variant"]),{classes:x,cx:_}=dK({gutter:n,justify:p,align:h,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c},{unstyled:g,name:"Grid",variant:b});return S.createElement(HQ,{value:{gutter:n,gutterXs:o,gutterSm:i,gutterMd:a,gutterLg:l,gutterXl:c,grow:d,columns:m}},S.createElement(oe,pK({className:_(x.root,v),ref:t},y),u))});tn.Col=bI;tn.displayName="@mantine/core/Grid";function gK(e){return f.Children.toArray(e).filter(Boolean)}const jI={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var vK=W((e,{spacing:t,position:r,noWrap:n,grow:o,align:i,count:a})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:n?"nowrap":"wrap",justifyContent:jI[r],gap:A({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/a}% - (${j(A({size:t,sizes:e.spacing}))} - ${A({size:t,sizes:e.spacing})} / ${a}))`:void 0,flexGrow:o?1:0}}}));const yK=vK;var xK=Object.defineProperty,rp=Object.getOwnPropertySymbols,OI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,YS=(e,t,r)=>t in e?xK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wK=(e,t)=>{for(var r in t||(t={}))OI.call(t,r)&&YS(e,r,t[r]);if(rp)for(var r of rp(t))CI.call(t,r)&&YS(e,r,t[r]);return e},_K=(e,t)=>{var r={};for(var n in e)OI.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&&CI.call(e,n)&&(r[n]=e[n]);return r};const bK={position:"left",spacing:"md"},K=f.forwardRef((e,t)=>{const r=H("Group",bK,e),{className:n,position:o,align:i,children:a,noWrap:l,grow:c,spacing:u,unstyled:d,variant:p}=r,h=_K(r,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),m=gK(a),{classes:v,cx:g}=yK({align:i,grow:c,noWrap:l,spacing:u,position:o,count:m.length},{unstyled:d,name:"Group",variant:p});return S.createElement(oe,wK({className:g(v.root,n),ref:t},h),m)});K.displayName="@mantine/core/Group";function SK({open:e,close:t,openDelay:r,closeDelay:n}){const o=f.useRef(-1),i=f.useRef(-1),a=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{a(),r===0?e():o.current=window.setTimeout(e,r)},c=()=>{a(),n===0?t():i.current=window.setTimeout(t,n)};return f.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:c}}function XS(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var PK=W((e,t,{size:r})=>({input:{fontFamily:e.fontFamilyMonospace,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${j(2)})`}}));const jK=PK;function X0(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var OK=f.useLayoutEffect,CK=function(t){var r=f.useRef(t);return OK(function(){r.current=t}),r},JS=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},EK=function(t,r){var n=f.useRef();return f.useCallback(function(o){t.current=o,n.current&&JS(n.current,null),n.current=r,r&&JS(r,o)},[r])},ZS={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},eP=function(t){Object.keys(ZS).forEach(function(r){t.style.setProperty(r,ZS[r],"important")})},Nr=null,$K=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function kK(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Nr||(Nr=document.createElement("textarea"),Nr.setAttribute("tabindex","-1"),Nr.setAttribute("aria-hidden","true"),eP(Nr)),Nr.parentNode===null&&document.body.appendChild(Nr);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;Nr.style[m]=a[m]}),eP(Nr),Nr.value=t;var c=$K(Nr,e);Nr.value="x";var u=Nr.scrollHeight-o,d=u*r;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var p=u*n;return l==="border-box"&&(p=p+o+i),c=Math.min(p,c),[c,u]}var tP=function(){},RK=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},TK=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],IK=!!document.documentElement.currentStyle,DK=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=RK(TK,r),o=n.boxSizing;if(o==="")return null;IK&&o==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var i=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:i,borderSize:a}},NK=function(t){var r=CK(t);f.useLayoutEffect(function(){var n=function(i){r.current(i)};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}},[])},AK=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?tP:a,c=t.onHeightChange,u=c===void 0?tP:c,d=X0(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),p=d.value!==void 0,h=f.useRef(null),m=EK(h,r),v=f.useRef(0),g=f.useRef(),b=function(){var _=h.current,w=n&&g.current?g.current:DK(_);if(w){g.current=w;var O=kK(w,_.value||_.placeholder||"x",i,o),C=O[0],P=O[1];v.current!==C&&(v.current=C,_.style.setProperty("height",C+"px","important"),u(C,{rowHeight:P}))}},y=function(_){p||b(),l(_)};return f.useLayoutEffect(b),NK(b),f.createElement("textarea",rt({},d,{onChange:y,ref:m}))},MK=f.forwardRef(AK);const LK=MK;var zK=W(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const FK=zK;var VK=Object.defineProperty,BK=Object.defineProperties,UK=Object.getOwnPropertyDescriptors,np=Object.getOwnPropertySymbols,EI=Object.prototype.hasOwnProperty,$I=Object.prototype.propertyIsEnumerable,rP=(e,t,r)=>t in e?VK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ea=(e,t)=>{for(var r in t||(t={}))EI.call(t,r)&&rP(e,r,t[r]);if(np)for(var r of np(t))$I.call(t,r)&&rP(e,r,t[r]);return e},gg=(e,t)=>BK(e,UK(t)),WK=(e,t)=>{var r={};for(var n in e)EI.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&&$I.call(e,n)&&(r[n]=e[n]);return r};const HK={autosize:!1,size:"sm",__staticSelector:"Textarea"},jc=f.forwardRef((e,t)=>{const r=H("Textarea",HK,e),{autosize:n,maxRows:o,minRows:i,label:a,error:l,description:c,id:u,className:d,required:p,style:h,wrapperProps:m,classNames:v,styles:g,size:b,__staticSelector:y,sx:x,errorProps:_,descriptionProps:w,labelProps:O,inputWrapperOrder:C,inputContainer:P,unstyled:E,withAsterisk:k,variant:$}=r,I=WK(r,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk","variant"]),T=Rr(u),{classes:z,cx:M}=FK(),{systemStyles:L,rest:q}=eo(I),Y=Ea({required:p,ref:t,error:l,id:T,classNames:gg(Ea({},v),{input:M(z.input,v==null?void 0:v.input)}),styles:g,__staticSelector:y,size:b,multiline:!0,unstyled:E,variant:$},q);return S.createElement(Ut.Wrapper,Ea(Ea({label:a,error:l,id:T,description:c,required:p,style:h,className:d,classNames:v,styles:g,size:b,__staticSelector:y,sx:x,errorProps:_,labelProps:O,descriptionProps:w,inputContainer:P,inputWrapperOrder:C,unstyled:E,withAsterisk:k,variant:$},L),m),n?S.createElement(Ut,gg(Ea({},Y),{component:LK,maxRows:o,minRows:i})):S.createElement(Ut,gg(Ea({},Y),{component:"textarea",rows:i})))});jc.displayName="@mantine/core/Textarea";var GK=Object.defineProperty,qK=Object.defineProperties,QK=Object.getOwnPropertyDescriptors,op=Object.getOwnPropertySymbols,kI=Object.prototype.hasOwnProperty,RI=Object.prototype.propertyIsEnumerable,nP=(e,t,r)=>t in e?GK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oP=(e,t)=>{for(var r in t||(t={}))kI.call(t,r)&&nP(e,r,t[r]);if(op)for(var r of op(t))RI.call(t,r)&&nP(e,r,t[r]);return e},KK=(e,t)=>qK(e,QK(t)),YK=(e,t)=>{var r={};for(var n in e)kI.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&&RI.call(e,n)&&(r[n]=e[n]);return r};const XK={formatOnBlur:!1,size:"sm",serialize:JSON.stringify,deserialize:JSON.parse},Ds=f.forwardRef((e,t)=>{const r=H("JsonInput",XK,e),{value:n,defaultValue:o,onChange:i,onFocus:a,onBlur:l,error:c,formatOnBlur:u,size:d,validationError:p,classNames:h,unstyled:m,readOnly:v,variant:g,serialize:b,deserialize:y}=r,x=YK(r,["value","defaultValue","onChange","onFocus","onBlur","error","formatOnBlur","size","validationError","classNames","unstyled","readOnly","variant","serialize","deserialize"]),{classes:_,cx:w}=jK(null,{name:"JsonInput",unstyled:m,size:d,variant:g}),[O,C]=$r({value:n,defaultValue:o,finalValue:"",onChange:i}),[P,E]=f.useState(XS(O,y)),k=I=>{typeof a=="function"&&a(I),E(!0)},$=I=>{typeof l=="function"&&l(I);const T=XS(I.currentTarget.value,y);u&&!v&&T&&I.currentTarget.value.trim()!==""&&C(b(y(I.currentTarget.value),null,2)),E(T)};return S.createElement(jc,oP({value:O,onChange:I=>C(I.currentTarget.value),onFocus:k,onBlur:$,error:P?c:p||!0,__staticSelector:"JsonInput",classNames:KK(oP({},h),{input:w(_.input,h==null?void 0:h.input)}),autoComplete:"off",ref:t,unstyled:m,readOnly:v,size:d,variant:g},x))});Ds.displayName="@mantine/core/JsonInput";const[JK,ZK]=ko("List component was not found in tree");var eY=W((e,{spacing:t,center:r})=>({itemWrapper:{ref:Vt("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:r?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:A({size:t,sizes:e.spacing})},"&[data-with-icon]":{listStyle:"none",[`& .${Vt("itemWrapper")}`]:{display:"inline-flex",alignItems:r?"center":"flex-start",flexDirection:"row"}}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}}));const tY=eY;var rY=Object.defineProperty,ip=Object.getOwnPropertySymbols,TI=Object.prototype.hasOwnProperty,II=Object.prototype.propertyIsEnumerable,iP=(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={}))TI.call(t,r)&&iP(e,r,t[r]);if(ip)for(var r of ip(t))II.call(t,r)&&iP(e,r,t[r]);return e},oY=(e,t)=>{var r={};for(var n in e)TI.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&&II.call(e,n)&&(r[n]=e[n]);return r};const iY={},DI=f.forwardRef((e,t)=>{const r=H("ListItem",iY,e),{className:n,children:o,icon:i}=r,a=oY(r,["className","children","icon"]),{icon:l,spacing:c,center:u,listStyleType:d,size:p,withPadding:h,classNames:m,styles:v,unstyled:g,variant:b}=ZK(),y=i||l,{classes:x,cx:_}=tY({withPadding:h,listStyleType:d,center:u,spacing:c},{classNames:m,styles:v,unstyled:g,name:"List",variant:b,size:p});return S.createElement(oe,nY({component:"li",className:_(x.item,n),"data-with-icon":!!y||void 0,ref:t},a),S.createElement("div",{className:x.itemWrapper},y&&S.createElement("span",{className:x.itemIcon},y),S.createElement("span",null,o)))});DI.displayName="@mantine/core/ListItem";var aY=Object.defineProperty,sY=Object.defineProperties,lY=Object.getOwnPropertyDescriptors,aP=Object.getOwnPropertySymbols,cY=Object.prototype.hasOwnProperty,uY=Object.prototype.propertyIsEnumerable,sP=(e,t,r)=>t in e?aY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dY=(e,t)=>{for(var r in t||(t={}))cY.call(t,r)&&sP(e,r,t[r]);if(aP)for(var r of aP(t))uY.call(t,r)&&sP(e,r,t[r]);return e},fY=(e,t)=>sY(e,lY(t)),pY=W((e,{withPadding:t,listStyleType:r},{size:n})=>({root:fY(dY({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const hY=pY;var mY=Object.defineProperty,ap=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,AI=Object.prototype.propertyIsEnumerable,lP=(e,t,r)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gY=(e,t)=>{for(var r in t||(t={}))NI.call(t,r)&&lP(e,r,t[r]);if(ap)for(var r of ap(t))AI.call(t,r)&&lP(e,r,t[r]);return e},vY=(e,t)=>{var r={};for(var n in e)NI.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&&AI.call(e,n)&&(r[n]=e[n]);return r};const yY={type:"unordered",size:"md",spacing:0},Pr=f.forwardRef((e,t)=>{const r=H("List",yY,e),{children:n,type:o,size:i,listStyleType:a,withPadding:l,center:c,spacing:u,icon:d,className:p,styles:h,classNames:m,unstyled:v,variant:g}=r,b=vY(r,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:y,cx:x}=hY({withPadding:l,listStyleType:a,center:c,spacing:u},{classNames:m,styles:h,name:"List",unstyled:v,size:i,variant:g});return S.createElement(JK,{value:{spacing:u,center:c,icon:d,listStyleType:a,size:i,withPadding:l,classNames:m,styles:h,unstyled:v,variant:g}},S.createElement(oe,gY({component:o==="unordered"?"ul":"ol",className:x(y.root,p),ref:t},b),n))});Pr.Item=DI;Pr.displayName="@mantine/core/List";var xY=Object.defineProperty,wY=Object.defineProperties,_Y=Object.getOwnPropertyDescriptors,cP=Object.getOwnPropertySymbols,bY=Object.prototype.hasOwnProperty,SY=Object.prototype.propertyIsEnumerable,uP=(e,t,r)=>t in e?xY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PY=(e,t)=>{for(var r in t||(t={}))bY.call(t,r)&&uP(e,r,t[r]);if(cP)for(var r of cP(t))SY.call(t,r)&&uP(e,r,t[r]);return e},jY=(e,t)=>wY(e,_Y(t)),OY=W(e=>({root:jY(PY({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const CY=OY;var EY=Object.defineProperty,$Y=Object.defineProperties,kY=Object.getOwnPropertyDescriptors,sp=Object.getOwnPropertySymbols,MI=Object.prototype.hasOwnProperty,LI=Object.prototype.propertyIsEnumerable,dP=(e,t,r)=>t in e?EY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ku=(e,t)=>{for(var r in t||(t={}))MI.call(t,r)&&dP(e,r,t[r]);if(sp)for(var r of sp(t))LI.call(t,r)&&dP(e,r,t[r]);return e},RY=(e,t)=>$Y(e,kY(t)),TY=(e,t)=>{var r={};for(var n in e)MI.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&&LI.call(e,n)&&(r[n]=e[n]);return r};const IY={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:Cn("overlay")},zI=f.forwardRef((e,t)=>{const r=H("LoadingOverlay",IY,e),{className:n,visible:o,loaderProps:i,overlayOpacity:a,overlayColor:l,transitionDuration:c,exitTransitionDuration:u,zIndex:d,style:p,loader:h,radius:m,overlayBlur:v,unstyled:g,variant:b,keepMounted:y}=r,x=TY(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:_,cx:w,theme:O}=CY(null,{name:"LoadingOverlay",unstyled:g,variant:b}),C=`calc(${d} + 1)`;return S.createElement(pa,{keepMounted:y,duration:c,exitDuration:u,mounted:o,transition:"fade"},P=>S.createElement(oe,ku({className:w(_.root,n),style:RY(ku(ku({},P),p),{zIndex:d}),ref:t},x),h?S.createElement("div",{style:{zIndex:C}},h):S.createElement(cn,ku({style:{zIndex:C}},i)),S.createElement(tI,{opacity:a,zIndex:d,radius:m,blur:v,unstyled:g,color:l||(O.colorScheme==="dark"?O.colors.dark[5]:O.white)})))});zI.displayName="@mantine/core/LoadingOverlay";const FI={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[DY,Oc]=ko(FI.context);var NY=W(e=>({divider:{marginTop:j(4),marginBottom:j(4),borderTop:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const AY=NY;var MY=Object.defineProperty,lp=Object.getOwnPropertySymbols,VI=Object.prototype.hasOwnProperty,BI=Object.prototype.propertyIsEnumerable,fP=(e,t,r)=>t in e?MY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LY=(e,t)=>{for(var r in t||(t={}))VI.call(t,r)&&fP(e,r,t[r]);if(lp)for(var r of lp(t))BI.call(t,r)&&fP(e,r,t[r]);return e},zY=(e,t)=>{var r={};for(var n in e)VI.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&&BI.call(e,n)&&(r[n]=e[n]);return r};const FY={},UI=f.forwardRef((e,t)=>{const r=H("MenuDivider",FY,e),{children:n,className:o}=r,i=zY(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Oc(),{classes:d,cx:p}=AY(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(oe,LY({className:p(d.divider,o),ref:t},i))});UI.displayName="@mantine/core/MenuDivider";var VY=Object.defineProperty,cp=Object.getOwnPropertySymbols,WI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,pP=(e,t,r)=>t in e?VY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,BY=(e,t)=>{for(var r in t||(t={}))WI.call(t,r)&&pP(e,r,t[r]);if(cp)for(var r of cp(t))HI.call(t,r)&&pP(e,r,t[r]);return e},UY=(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 WY={};function GI(e){const t=H("MenuDropdown",WY,e),{children:r,onMouseEnter:n,onMouseLeave:o}=t,i=UY(t,["children","onMouseEnter","onMouseLeave"]),a=f.useRef(),l=Oc(),c=p=>{var h;(p.key==="ArrowUp"||p.key==="ArrowDown")&&(p.preventDefault(),(h=a.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||h.focus())},u=Mr(n,()=>l.trigger==="hover"&&l.openDropdown()),d=Mr(o,()=>l.trigger==="hover"&&l.closeDropdown());return S.createElement(Do.Dropdown,BY({onMouseEnter:u,onMouseLeave:d,role:"menu","aria-orientation":"vertical"},i),S.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:a,style:{outline:0}},r))}GI.displayName="@mantine/core/MenuDropdown";var HY=Object.defineProperty,GY=Object.defineProperties,qY=Object.getOwnPropertyDescriptors,hP=Object.getOwnPropertySymbols,QY=Object.prototype.hasOwnProperty,KY=Object.prototype.propertyIsEnumerable,mP=(e,t,r)=>t in e?HY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YY=(e,t)=>{for(var r in t||(t={}))QY.call(t,r)&&mP(e,r,t[r]);if(hP)for(var r of hP(t))KY.call(t,r)&&mP(e,r,t[r]);return e},XY=(e,t)=>GY(e,qY(t)),JY=W((e,{color:t,radius:r})=>({item:XY(YY({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(r),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const ZY=JY;var eX=Object.defineProperty,tX=Object.defineProperties,rX=Object.getOwnPropertyDescriptors,up=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,gP=(e,t,r)=>t in e?eX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nX=(e,t)=>{for(var r in t||(t={}))qI.call(t,r)&&gP(e,r,t[r]);if(up)for(var r of up(t))QI.call(t,r)&&gP(e,r,t[r]);return e},oX=(e,t)=>tX(e,rX(t)),iX=(e,t)=>{var r={};for(var n in e)qI.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 aX={},KI=f.forwardRef((e,t)=>{const r=H("MenuItem",aX,e),{children:n,className:o,color:i,closeMenuOnClick:a,icon:l,rightSection:c}=r,u=iX(r,["children","className","color","closeMenuOnClick","icon","rightSection"]),d=Oc(),{classes:p,cx:h,theme:m}=ZY({radius:d.radius,color:i},{name:"Menu",classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),v=f.useRef(),g=d.getItemIndex(v.current),b=u,y=Mr(b.onMouseLeave,()=>d.setHovered(-1)),x=Mr(b.onMouseEnter,()=>d.setHovered(d.getItemIndex(v.current))),_=Mr(b.onClick,()=>{typeof a=="boolean"?a&&d.closeDropdownImmediately():d.closeOnItemClick&&d.closeDropdownImmediately()}),w=Mr(b.onFocus,()=>d.setHovered(d.getItemIndex(v.current)));return S.createElement(oe,oX(nX({component:"button",type:"button"},u),{tabIndex:-1,onFocus:w,className:h(p.item,o),ref:Es(v,t),role:"menuitem","data-menu-item":!0,"data-hovered":d.hovered===g?!0:void 0,onMouseEnter:x,onMouseLeave:y,onClick:_,onKeyDown:ZC({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:d.loop,dir:m.dir,orientation:"vertical",onKeyDown:b.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))});KI.displayName="@mantine/core/MenuItem";const sX=KI;var lX=W(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}}));const cX=lX;var uX=Object.defineProperty,dp=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,XI=Object.prototype.propertyIsEnumerable,vP=(e,t,r)=>t in e?uX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dX=(e,t)=>{for(var r in t||(t={}))YI.call(t,r)&&vP(e,r,t[r]);if(dp)for(var r of dp(t))XI.call(t,r)&&vP(e,r,t[r]);return e},fX=(e,t)=>{var r={};for(var n in e)YI.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&&XI.call(e,n)&&(r[n]=e[n]);return r};const pX={},JI=f.forwardRef((e,t)=>{const r=H("MenuLabel",pX,e),{children:n,className:o}=r,i=fX(r,["children","className"]),{classNames:a,styles:l,unstyled:c,variant:u}=Oc(),{classes:d,cx:p}=cX(null,{name:"Menu",classNames:a,styles:l,unstyled:c,variant:u});return S.createElement(re,dX({className:p(d.label,o),ref:t},i),n)});JI.displayName="@mantine/core/MenuLabel";var hX=Object.defineProperty,fp=Object.getOwnPropertySymbols,ZI=Object.prototype.hasOwnProperty,eD=Object.prototype.propertyIsEnumerable,yP=(e,t,r)=>t in e?hX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mX=(e,t)=>{for(var r in t||(t={}))ZI.call(t,r)&&yP(e,r,t[r]);if(fp)for(var r of fp(t))eD.call(t,r)&&yP(e,r,t[r]);return e},gX=(e,t)=>{var r={};for(var n in e)ZI.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&&eD.call(e,n)&&(r[n]=e[n]);return r};const vX={refProp:"ref"},tD=f.forwardRef((e,t)=>{const r=H("MenuTarget",vX,e),{children:n,refProp:o}=r,i=gX(r,["children","refProp"]);if(!Os(n))throw new Error(FI.children);const a=Oc(),l=Mr(n.props.onClick,()=>a.trigger==="click"&&a.toggleDropdown()),c=Mr(n.props.onMouseEnter,()=>a.trigger==="hover"&&a.openDropdown()),u=Mr(n.props.onMouseLeave,()=>a.trigger==="hover"&&a.closeDropdown());return S.createElement(Do.Target,mX({refProp:o,popupType:"menu",ref:t},i),f.cloneElement(n,{onClick:l,onMouseEnter:c,onMouseLeave:u,"data-expanded":a.opened?!0:void 0}))});tD.displayName="@mantine/core/MenuTarget";var yX=W({dropdown:{padding:j(4)}});const xX=yX;var wX=Object.defineProperty,_X=Object.defineProperties,bX=Object.getOwnPropertyDescriptors,pp=Object.getOwnPropertySymbols,rD=Object.prototype.hasOwnProperty,nD=Object.prototype.propertyIsEnumerable,xP=(e,t,r)=>t in e?wX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wP=(e,t)=>{for(var r in t||(t={}))rD.call(t,r)&&xP(e,r,t[r]);if(pp)for(var r of pp(t))nD.call(t,r)&&xP(e,r,t[r]);return e},_P=(e,t)=>_X(e,bX(t)),SX=(e,t)=>{var r={};for(var n in e)rD.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&&nD.call(e,n)&&(r[n]=e[n]);return r};const PX={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function X(e){const t=H("Menu",PX,e),{children:r,onOpen:n,onClose:o,opened:i,defaultOpened:a,onChange:l,closeOnItemClick:c,loop:u,closeOnEscape:d,trigger:p,openDelay:h,closeDelay:m,classNames:v,styles:g,unstyled:b,radius:y,variant:x}=t,_=SX(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:w,cx:O}=xX(),[C,{setHovered:P,resetHovered:E}]=BA(),[k,$]=$r({value:i,defaultValue:a,finalValue:!1,onChange:l}),I=()=>{$(!1),k&&(o==null||o())},T=()=>{$(!0),!k&&(n==null||n())},z=()=>k?I():T(),{openDropdown:M,closeDropdown:L}=SK({open:T,close:I,closeDelay:m,openDelay:h}),q=Y=>zA("[data-menu-item]","[data-menu-dropdown]",Y);return rn(()=>{E()},[k]),S.createElement(DY,{value:{opened:k,toggleDropdown:z,getItemIndex:q,hovered:C,setHovered:P,closeOnItemClick:c,closeDropdown:p==="click"?I:L,openDropdown:p==="click"?T:M,closeDropdownImmediately:I,loop:u,trigger:p,radius:y,classNames:v,styles:g,unstyled:b,variant:x}},S.createElement(Do,_P(wP({},_),{radius:y,opened:k,onChange:z,defaultOpened:a,trapFocus:p==="click",closeOnEscape:d&&p==="click",__staticSelector:"Menu",classNames:_P(wP({},v),{dropdown:O(w.dropdown,v==null?void 0:v.dropdown)}),styles:g,unstyled:b,variant:x}),r))}X.displayName="@mantine/core/Menu";X.Item=sX;X.Label=JI;X.Dropdown=GI;X.Target=tD;X.Divider=UI;const[jX,OX]=ko("Modal component was not found in tree"),CX={xs:j(320),sm:j(380),md:j(440),lg:j(620),xl:j(780)};var EX=W((e,{yOffset:t,xOffset:r,centered:n,fullScreen:o},{size:i})=>({content:{flex:o?"0 0 100%":`0 0 ${A({size:i,sizes:CX})}`,maxWidth:"100%",maxHeight:o?void 0:`calc(100dvh - (${j(t)} * 2))`,height:o?"100vh":void 0,borderRadius:o?0:void 0,overflowY:"auto"},inner:{paddingTop:o?0:t,paddingBottom:o?0:t,paddingLeft:o?0:r,paddingRight:o?0:r,display:"flex",justifyContent:"center",alignItems:n?"center":"flex-start"}}));const $X=EX;var kX=Object.defineProperty,RX=Object.defineProperties,TX=Object.getOwnPropertyDescriptors,hp=Object.getOwnPropertySymbols,oD=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable,bP=(e,t,r)=>t in e?kX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kv=(e,t)=>{for(var r in t||(t={}))oD.call(t,r)&&bP(e,r,t[r]);if(hp)for(var r of hp(t))iD.call(t,r)&&bP(e,r,t[r]);return e},aD=(e,t)=>RX(e,TX(t)),IX=(e,t)=>{var r={};for(var n in e)oD.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&&iD.call(e,n)&&(r[n]=e[n]);return r};const DX=aD(Kv({},K0),{yOffset:"5dvh",xOffset:"5vw"});function sD(e){const t=H("ModalRoot",DX,e),{classNames:r,variant:n,size:o,yOffset:i,xOffset:a,scrollAreaComponent:l,radius:c,centered:u,fullScreen:d}=t,p=IX(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:h,cx:m}=$X({yOffset:i,xOffset:a,centered:u,fullScreen:d},{name:"Modal",variant:n,size:o});return S.createElement(jX,{value:{yOffset:i,scrollAreaComponent:l,radius:c}},S.createElement(kt,Kv({__staticSelector:"Modal",size:o,variant:n,classNames:aD(Kv({},r),{content:m(h.content,r==null?void 0:r.content),inner:m(h.inner,r==null?void 0:r.inner)})},p)))}var NX=Object.defineProperty,mp=Object.getOwnPropertySymbols,lD=Object.prototype.hasOwnProperty,cD=Object.prototype.propertyIsEnumerable,SP=(e,t,r)=>t in e?NX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AX=(e,t)=>{for(var r in t||(t={}))lD.call(t,r)&&SP(e,r,t[r]);if(mp)for(var r of mp(t))cD.call(t,r)&&SP(e,r,t[r]);return e},MX=(e,t)=>{var r={};for(var n in e)lD.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&&cD.call(e,n)&&(r[n]=e[n]);return r};const LX={shadow:"xl"},uD=f.forwardRef((e,t)=>{const r=H("ModalContent",LX,e),{children:n,scrollAreaComponent:o}=r,i=MX(r,["children","scrollAreaComponent"]),a=OX(),l=o||a.scrollAreaComponent||kt.NativeScrollArea;return S.createElement(kt.Content,AX({ref:t,radius:a.radius},i),S.createElement(l,{style:{maxHeight:`calc(100dvh - (${j(a.yOffset)} * 2))`}},n))});var zX=Object.defineProperty,FX=Object.defineProperties,VX=Object.getOwnPropertyDescriptors,gp=Object.getOwnPropertySymbols,dD=Object.prototype.hasOwnProperty,fD=Object.prototype.propertyIsEnumerable,PP=(e,t,r)=>t in e?zX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ud=(e,t)=>{for(var r in t||(t={}))dD.call(t,r)&&PP(e,r,t[r]);if(gp)for(var r of gp(t))fD.call(t,r)&&PP(e,r,t[r]);return e},BX=(e,t)=>FX(e,VX(t)),UX=(e,t)=>{var r={};for(var n in e)dD.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&&fD.call(e,n)&&(r[n]=e[n]);return r};const WX=BX(ud({},K0),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Tr(e){const t=H("Modal",WX,e),{title:r,withOverlay:n,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l}=t,c=UX(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!r||i;return S.createElement(sD,ud({},c),n&&S.createElement(kt.Overlay,ud({},o)),S.createElement(uD,null,u&&S.createElement(kt.Header,null,r&&S.createElement(kt.Title,null,r),i&&S.createElement(kt.CloseButton,ud({},a))),S.createElement(kt.Body,null,l)))}Tr.Root=sD;Tr.CloseButton=kt.CloseButton;Tr.Overlay=kt.Overlay;Tr.Content=uD;Tr.Header=kt.Header;Tr.Title=kt.Title;Tr.Body=kt.Body;Tr.NativeScrollArea=kt.NativeScrollArea;const pD={xs:j(16),sm:j(22),md:j(26),lg:j(30),xl:j(36)},HX={xs:j(10),sm:j(12),md:j(14),lg:j(16),xl:j(18)};var GX=W((e,{disabled:t,radius:r,readOnly:n},{size:o,variant:i})=>({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]:i==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:A({size:o,sizes:pD}),paddingLeft:`calc(${A({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||n?A({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:A({size:o,sizes:HX}),borderRadius:A({size:r,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${j(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${A({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}})),qX=Object.defineProperty,vp=Object.getOwnPropertySymbols,hD=Object.prototype.hasOwnProperty,mD=Object.prototype.propertyIsEnumerable,jP=(e,t,r)=>t in e?qX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QX=(e,t)=>{for(var r in t||(t={}))hD.call(t,r)&&jP(e,r,t[r]);if(vp)for(var r of vp(t))mD.call(t,r)&&jP(e,r,t[r]);return e},KX=(e,t)=>{var r={};for(var n in e)hD.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&&mD.call(e,n)&&(r[n]=e[n]);return r};const YX={xs:16,sm:22,md:24,lg:26,xl:30};function gD(e){var t=e,{label:r,classNames:n,styles:o,className:i,onRemove:a,disabled:l,readOnly:c,size:u,radius:d="sm",variant:p,unstyled:h}=t,m=KX(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:v,cx:g}=GX({disabled:l,readOnly:c,radius:d},{name:"MultiSelect",classNames:n,styles:o,unstyled:h,size:u,variant:p});return S.createElement("div",QX({className:g(v.defaultValue,i)},m),S.createElement("span",{className:v.defaultValueLabel},r),!l&&!c&&S.createElement(wc,{"aria-hidden":!0,onMouseDown:a,size:YX[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:v.defaultValueRemove,tabIndex:-1,unstyled:h}))}gD.displayName="@mantine/core/MultiSelect/DefaultValue";function XX({data:e,searchable:t,limit:r,searchValue:n,filter:o,value:i,disableSelectedItemFiltering:a}){if(!t&&i.length===0)return e;if(!t){const c=[];for(let u=0;u<e.length;u+=1)(a||!i.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,!a&&i.some(u=>u===e[c].value&&!e[c].disabled),e[c])&&l.push(e[c]),!(l.length>=r));c+=1);return l}var JX=Object.defineProperty,yp=Object.getOwnPropertySymbols,vD=Object.prototype.hasOwnProperty,yD=Object.prototype.propertyIsEnumerable,OP=(e,t,r)=>t in e?JX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CP=(e,t)=>{for(var r in t||(t={}))vD.call(t,r)&&OP(e,r,t[r]);if(yp)for(var r of yp(t))yD.call(t,r)&&OP(e,r,t[r]);return e},ZX=(e,t)=>{var r={};for(var n in e)vD.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&&yD.call(e,n)&&(r[n]=e[n]);return r};const eJ={xs:j(14),sm:j(18),md:j(20),lg:j(24),xl:j(28)};function tJ(e){var t=e,{size:r,error:n,style:o}=t,i=ZX(t,["size","error","style"]);const a=Jt(),l=A({size:r,sizes:eJ});return S.createElement("svg",CP({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:CP({color:n?a.colors.red[6]:a.colors.gray[6],width:l,height:l},o),"data-chevron":!0},i),S.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var rJ=Object.defineProperty,nJ=Object.defineProperties,oJ=Object.getOwnPropertyDescriptors,EP=Object.getOwnPropertySymbols,iJ=Object.prototype.hasOwnProperty,aJ=Object.prototype.propertyIsEnumerable,$P=(e,t,r)=>t in e?rJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sJ=(e,t)=>{for(var r in t||(t={}))iJ.call(t,r)&&$P(e,r,t[r]);if(EP)for(var r of EP(t))aJ.call(t,r)&&$P(e,r,t[r]);return e},lJ=(e,t)=>nJ(e,oJ(t));function xD({shouldClear:e,clearButtonProps:t,onClear:r,size:n,error:o}){return e?S.createElement(wc,lJ(sJ({},t),{variant:"transparent",onClick:r,size:n,onMouseDown:i=>i.preventDefault()})):S.createElement(tJ,{error:o,size:n})}xD.displayName="@mantine/core/SelectRightSection";var cJ=Object.defineProperty,uJ=Object.defineProperties,dJ=Object.getOwnPropertyDescriptors,xp=Object.getOwnPropertySymbols,wD=Object.prototype.hasOwnProperty,_D=Object.prototype.propertyIsEnumerable,kP=(e,t,r)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vg=(e,t)=>{for(var r in t||(t={}))wD.call(t,r)&&kP(e,r,t[r]);if(xp)for(var r of xp(t))_D.call(t,r)&&kP(e,r,t[r]);return e},RP=(e,t)=>uJ(e,dJ(t)),fJ=(e,t)=>{var r={};for(var n in e)wD.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&&_D.call(e,n)&&(r[n]=e[n]);return r};function bD(e){var t=e,{styles:r,rightSection:n,rightSectionWidth:o,theme:i}=t,a=fJ(t,["styles","rightSection","rightSectionWidth","theme"]);if(n)return{rightSection:n,rightSectionWidth:o,styles:r};const l=typeof r=="function"?r(i):r;return{rightSection:!a.readOnly&&!(a.disabled&&a.shouldClear)&&S.createElement(xD,vg({},a)),styles:RP(vg({},l),{rightSection:RP(vg({},l==null?void 0:l.rightSection),{pointerEvents:a.shouldClear?void 0:"none"})})}}var pJ=Object.defineProperty,hJ=Object.defineProperties,mJ=Object.getOwnPropertyDescriptors,TP=Object.getOwnPropertySymbols,gJ=Object.prototype.hasOwnProperty,vJ=Object.prototype.propertyIsEnumerable,IP=(e,t,r)=>t in e?pJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yJ=(e,t)=>{for(var r in t||(t={}))gJ.call(t,r)&&IP(e,r,t[r]);if(TP)for(var r of TP(t))vJ.call(t,r)&&IP(e,r,t[r]);return e},xJ=(e,t)=>hJ(e,mJ(t)),wJ=W((e,{invalid:t},{size:r})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${A({size:r,sizes:Et})} - ${j(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:A({size:r,sizes:Et})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${j(2)}) calc(${e.spacing.xs} / 2)`},searchInput:xJ(yJ({},e.fn.fontStyles()),{flex:1,minWidth:j(60),backgroundColor:"transparent",border:0,outline:0,fontSize:A({size:r,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:A({size:r,sizes:pD}),"&::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 _J=wJ;var bJ=Object.defineProperty,SJ=Object.defineProperties,PJ=Object.getOwnPropertyDescriptors,wp=Object.getOwnPropertySymbols,SD=Object.prototype.hasOwnProperty,PD=Object.prototype.propertyIsEnumerable,DP=(e,t,r)=>t in e?bJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$a=(e,t)=>{for(var r in t||(t={}))SD.call(t,r)&&DP(e,r,t[r]);if(wp)for(var r of wp(t))PD.call(t,r)&&DP(e,r,t[r]);return e},NP=(e,t)=>SJ(e,PJ(t)),jJ=(e,t)=>{var r={};for(var n in e)SD.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&&PD.call(e,n)&&(r[n]=e[n]);return r};function OJ(e,t,r){return t?!1:r.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function CJ(e,t){return!!e&&!t.some(r=>r.value.toLowerCase()===e.toLowerCase())}function AP(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const r=t.map(n=>typeof n=="object"?n.value:n);return e.filter(n=>r.includes(n))}const EJ={size:"sm",valueComponent:gD,itemComponent:Lk,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:OJ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:CJ,switchDirectionOnFlip:!1,zIndex:Cn("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},em=f.forwardRef((e,t)=>{const r=H("MultiSelect",EJ,e),{className:n,style:o,required:i,label:a,description:l,size:c,error:u,classNames:d,styles:p,wrapperProps:h,value:m,defaultValue:v,data:g,onChange:b,valueComponent:y,itemComponent:x,id:_,transitionProps:w,maxDropdownHeight:O,shadow:C,nothingFound:P,onFocus:E,onBlur:k,searchable:$,placeholder:I,filter:T,limit:z,clearSearchOnChange:M,clearable:L,clearSearchOnBlur:q,variant:Y,onSearchChange:R,searchValue:N,disabled:V,initiallyOpened:Q,radius:ee,icon:_e,rightSection:we,rightSectionWidth:Ue,creatable:Ae,getCreateLabel:pt,shouldCreate:Dt,onCreate:Pe,sx:Ht,dropdownComponent:Dr,onDropdownClose:lr,onDropdownOpen:Gt,maxSelectedValues:Nt,withinPortal:ro,portalProps:no,switchDirectionOnFlip:Ye,zIndex:oo,selectOnBlur:$n,name:zt,dropdownPosition:_a,errorProps:Oi,labelProps:io,descriptionProps:J,form:ge,positionDependencies:ze,onKeyDown:ht,unstyled:_t,inputContainer:kn,inputWrapperOrder:Rn,readOnly:vr,withAsterisk:Tn,clearButtonProps:Lo,hoverOnSearchChange:fn,disableSelectedItemFiltering:Ci}=r,zo=jJ(r,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:yr,cx:ao,theme:Ms}=_J({invalid:!!u},{name:"MultiSelect",classNames:d,styles:p,unstyled:_t,size:c,variant:Y}),{systemStyles:D,rest:F}=eo(zo),U=f.useRef(),Z=f.useRef({}),de=Rr(_),[se,fe]=f.useState(Q),[ye,ce]=f.useState(-1),[Be,nt]=f.useState("column"),[be,Me]=$r({value:N,defaultValue:"",finalValue:void 0,onChange:R}),[jt,In]=f.useState(!1),{scrollIntoView:Gr,targetRef:Fo,scrollableRef:Ls}=TL({duration:0,offset:5,cancelable:!1,isList:!0}),qr=Ae&&typeof pt=="function";let Qr=null;const ba=g.map(xe=>typeof xe=="string"?{label:xe,value:xe}:xe),Ei=UA({data:ba}),[Xe,Dn]=$r({value:AP(m,g),defaultValue:AP(v,g),finalValue:[],onChange:b}),Ce=f.useRef(!!Nt&&Nt<Xe.length),xr=xe=>{if(!vr){const Je=Xe.filter(Kr=>Kr!==xe);Dn(Je),Nt&&Je.length<Nt&&(Ce.current=!1)}},Nn=xe=>{Me(xe.currentTarget.value),!V&&!Ce.current&&$&&fe(!0)},mt=xe=>{typeof E=="function"&&E(xe),!V&&!Ce.current&&$&&fe(!0)},gt=XX({data:Ei,searchable:$,searchValue:be,limit:z,filter:T,value:Xe,disableSelectedItemFiltering:Ci});qr&&Dt(be,Ei)&&(Qr=pt(be),gt.push({label:be,value:be,creatable:!0}));const An=Math.min(ye,gt.length-1),Bc=(xe,Je,Kr)=>{let Vo=xe;for(;Kr(Vo);)if(Vo=Je(Vo),!gt[Vo].disabled)return Vo;return xe};rn(()=>{ce(fn&&be?0:-1)},[be,fn]),rn(()=>{!V&&Xe.length>g.length&&fe(!1),Nt&&Xe.length<Nt&&(Ce.current=!1),Nt&&Xe.length>=Nt&&(Ce.current=!0,fe(!1))},[Xe]);const Uc=xe=>{if(!vr)if(M&&Me(""),Xe.includes(xe.value))xr(xe.value);else{if(xe.creatable&&typeof Pe=="function"){const Je=Pe(xe.value);typeof Je<"u"&&Je!==null&&Dn(typeof Je=="string"?[...Xe,Je]:[...Xe,Je.value])}else Dn([...Xe,xe.value]);Xe.length===Nt-1&&(Ce.current=!0,fe(!1)),gt.length===1&&fe(!1)}},E3=xe=>{typeof k=="function"&&k(xe),$n&&gt[An]&&se&&Uc(gt[An]),q&&Me(""),fe(!1)},$3=xe=>{if(jt||(ht==null||ht(xe),vr)||xe.key!=="Backspace"&&Nt&&Ce.current)return;const Je=Be==="column",Kr=()=>{ce($i=>{var so;const zs=Bc($i,ki=>ki+1,ki=>ki<gt.length-1);return se&&(Fo.current=Z.current[(so=gt[zs])==null?void 0:so.value],Gr({alignment:Je?"end":"start"})),zs})},Vo=()=>{ce($i=>{var so;const zs=Bc($i,ki=>ki-1,ki=>ki>0);return se&&(Fo.current=Z.current[(so=gt[zs])==null?void 0:so.value],Gr({alignment:Je?"start":"end"})),zs})};switch(xe.key){case"ArrowUp":{xe.preventDefault(),fe(!0),Je?Vo():Kr();break}case"ArrowDown":{xe.preventDefault(),fe(!0),Je?Kr():Vo();break}case"Enter":{xe.preventDefault(),gt[An]&&se?Uc(gt[An]):fe(!0);break}case" ":{$||(xe.preventDefault(),gt[An]&&se?Uc(gt[An]):fe(!0));break}case"Backspace":{Xe.length>0&&be.length===0&&(Dn(Xe.slice(0,-1)),fe(!0),Nt&&(Ce.current=!1));break}case"Home":{if(!$){xe.preventDefault(),se||fe(!0);const $i=gt.findIndex(so=>!so.disabled);ce($i),Gr({alignment:Je?"end":"start"})}break}case"End":{if(!$){xe.preventDefault(),se||fe(!0);const $i=gt.map(so=>!!so.disabled).lastIndexOf(!1);ce($i),Gr({alignment:Je?"end":"start"})}break}case"Escape":fe(!1)}},k3=Xe.map(xe=>{let Je=Ei.find(Kr=>Kr.value===xe&&!Kr.disabled);return!Je&&qr&&(Je={value:xe,label:xe}),Je}).filter(xe=>!!xe).map((xe,Je)=>S.createElement(y,NP($a({},xe),{variant:Y,disabled:V,className:yr.value,readOnly:vr,onRemove:Kr=>{Kr.preventDefault(),Kr.stopPropagation(),xr(xe.value)},key:xe.value,size:c,styles:p,classNames:d,radius:ee,index:Je}))),R3=xe=>Xe.includes(xe),T3=()=>{var xe;Me(""),Dn([]),(xe=U.current)==null||xe.focus(),Nt&&(Ce.current=!1)},Wc=!vr&&(gt.length>0?se:se&&!!P);return rn(()=>{const xe=Wc?Gt:lr;typeof xe=="function"&&xe()},[Wc]),S.createElement(Ut.Wrapper,$a($a({required:i,id:de,label:a,error:u,description:l,size:c,className:n,style:o,classNames:d,styles:p,__staticSelector:"MultiSelect",sx:Ht,errorProps:Oi,descriptionProps:J,labelProps:io,inputContainer:kn,inputWrapperOrder:Rn,unstyled:_t,withAsterisk:Tn,variant:Y},D),h),S.createElement(Tl,{opened:Wc,transitionProps:w,shadow:"sm",withinPortal:ro,portalProps:no,__staticSelector:"MultiSelect",onDirectionChange:nt,switchDirectionOnFlip:Ye,zIndex:oo,dropdownPosition:_a,positionDependencies:[...ze,be],classNames:d,styles:p,unstyled:_t,variant:Y},S.createElement(Tl.Target,null,S.createElement("div",{className:yr.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":se&&Wc?`${de}-items`:null,"aria-controls":de,"aria-expanded":se,onMouseLeave:()=>ce(-1),tabIndex:-1},S.createElement("input",{type:"hidden",name:zt,value:Xe.join(","),form:ge,disabled:V}),S.createElement(Ut,$a({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:Y,disabled:V,error:u,required:i,radius:ee,icon:_e,unstyled:_t,onMouseDown:xe=>{var Je;xe.preventDefault(),!V&&!Ce.current&&fe(!se),(Je=U.current)==null||Je.focus()},classNames:NP($a({},d),{input:ao({[yr.input]:!$},d==null?void 0:d.input)})},bD({theme:Ms,rightSection:we,rightSectionWidth:Ue,styles:p,size:c,shouldClear:L&&Xe.length>0,onClear:T3,error:u,disabled:V,clearButtonProps:Lo,readOnly:vr})),S.createElement("div",{className:yr.values,"data-clearable":L||void 0},k3,S.createElement("input",$a({ref:Es(t,U),type:"search",id:de,className:ao(yr.searchInput,{[yr.searchInputPointer]:!$,[yr.searchInputInputHidden]:!se&&Xe.length>0||!$&&Xe.length>0,[yr.searchInputEmpty]:Xe.length===0}),onKeyDown:$3,value:be,onChange:Nn,onFocus:mt,onBlur:E3,readOnly:!$||Ce.current||vr,placeholder:Xe.length===0?I:void 0,disabled:V,"data-mantine-stop-propagation":se,autoComplete:"off",onCompositionStart:()=>In(!0),onCompositionEnd:()=>In(!1)},F)))))),S.createElement(Tl.Dropdown,{component:Dr||$0,maxHeight:O,direction:Be,id:de,innerRef:Ls,__staticSelector:"MultiSelect",classNames:d,styles:p},S.createElement(Nk,{data:gt,hovered:An,classNames:d,styles:p,uuid:de,__staticSelector:"MultiSelect",onItemHover:ce,onItemSelect:Uc,itemsRefs:Z,itemComponent:x,size:c,nothingFound:P,isItemSelected:R3,creatable:Ae&&!!Qr,createLabel:Qr,unstyled:_t,variant:Y}))))});em.displayName="@mantine/core/MultiSelect";var $J=Object.defineProperty,kJ=Object.defineProperties,RJ=Object.getOwnPropertyDescriptors,_p=Object.getOwnPropertySymbols,jD=Object.prototype.hasOwnProperty,OD=Object.prototype.propertyIsEnumerable,MP=(e,t,r)=>t in e?$J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ru=(e,t)=>{for(var r in t||(t={}))jD.call(t,r)&&MP(e,r,t[r]);if(_p)for(var r of _p(t))OD.call(t,r)&&MP(e,r,t[r]);return e},LP=(e,t)=>kJ(e,RJ(t)),TJ=(e,t)=>{var r={};for(var n in e)jD.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 IJ={size:"sm"},ft=f.forwardRef((e,t)=>{const r=LR("NativeSelect",IJ,e),{inputProps:n,wrapperProps:o,data:i,onChange:a,value:l,classNames:c,styles:u,rightSection:d,rightSectionWidth:p}=r,h=TJ(r,["inputProps","wrapperProps","data","onChange","value","classNames","styles","rightSection","rightSectionWidth"]),m=Jt(),g=i.map(b=>typeof b=="string"?{label:b,value:b}:b).map(b=>S.createElement("option",{key:b.value,value:b.value,disabled:b.disabled},b.label));return S.createElement(Ut.Wrapper,LP(Ru({},o),{__staticSelector:"NativeSelect"}),S.createElement(Ut,Ru(LP(Ru(Ru({},n),h),{onChange:a,component:"select",ref:t,value:l===null?"":l,__staticSelector:"NativeSelect",pointer:m.cursorType==="pointer"}),bD({theme:m,rightSection:d,rightSectionWidth:p,styles:u,shouldClear:!1,size:n.size,error:o.error,readOnly:!1})),g))});ft.displayName="@mantine/core/NativeSelect";var DJ=W((e,{color:t,radius:r,withTitle:n})=>{const o=e.fn.radius(r),i=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:j(28),height:j(28),borderRadius:j(28),display:"flex",flex:"none",alignItems:"center",justifyContent:"center",backgroundColor:i.background,color:e.white},root:{overflow:"hidden",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",paddingLeft:j(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:j(6),top:o,bottom:o,left:j(4),borderRadius:o,backgroundColor:i.background},"&[data-with-icon]":{paddingLeft:e.spacing.xs,"&::before":{display:"none"}},"&[data-with-border]":{border:`${j(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:j(2),overflow:"hidden",textOverflow:"ellipsis",color:e.colorScheme==="dark"?e.white:e.colors.gray[9]},description:{color:n?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis"}}});const NJ=DJ;var AJ=Object.defineProperty,MJ=Object.defineProperties,LJ=Object.getOwnPropertyDescriptors,bp=Object.getOwnPropertySymbols,CD=Object.prototype.hasOwnProperty,ED=Object.prototype.propertyIsEnumerable,zP=(e,t,r)=>t in e?AJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,FP=(e,t)=>{for(var r in t||(t={}))CD.call(t,r)&&zP(e,r,t[r]);if(bp)for(var r of bp(t))ED.call(t,r)&&zP(e,r,t[r]);return e},zJ=(e,t)=>MJ(e,LJ(t)),FJ=(e,t)=>{var r={};for(var n in e)CD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bp)for(var n of bp(e))t.indexOf(n)<0&&ED.call(e,n)&&(r[n]=e[n]);return r};const VJ={withCloseButton:!0},$D=f.forwardRef((e,t)=>{const r=H("Notification",VJ,e),{className:n,color:o,radius:i,loading:a,withCloseButton:l,withBorder:c,title:u,icon:d,children:p,onClose:h,closeButtonProps:m,classNames:v,styles:g,unstyled:b,variant:y}=r,x=FJ(r,["className","color","radius","loading","withCloseButton","withBorder","title","icon","children","onClose","closeButtonProps","classNames","styles","unstyled","variant"]),{classes:_,cx:w}=NJ({color:o,radius:i,withTitle:!!u},{name:"Notification",classNames:v,styles:g,unstyled:b,variant:y});return S.createElement(oe,FP({className:w(_.root,n),"data-with-icon":!!d||a||void 0,"data-with-border":c||void 0,role:"alert",ref:t},x),d&&!a&&S.createElement("div",{className:_.icon},d),a&&S.createElement(cn,{size:28,color:o,className:_.loader}),S.createElement("div",{className:_.body},u&&S.createElement(re,{className:_.title,size:"sm",weight:500},u),S.createElement(re,{color:"dimmed",className:_.description,size:"sm"},p)),l&&S.createElement(wc,zJ(FP({iconSize:16,color:"gray"},m),{onClick:h,className:_.closeButton})))});$D.displayName="@mantine/core/Notification";var BJ=Object.defineProperty,UJ=Object.defineProperties,WJ=Object.getOwnPropertyDescriptors,Sp=Object.getOwnPropertySymbols,kD=Object.prototype.hasOwnProperty,RD=Object.prototype.propertyIsEnumerable,VP=(e,t,r)=>t in e?BJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yg=(e,t)=>{for(var r in t||(t={}))kD.call(t,r)&&VP(e,r,t[r]);if(Sp)for(var r of Sp(t))RD.call(t,r)&&VP(e,r,t[r]);return e},HJ=(e,t)=>UJ(e,WJ(t)),GJ=(e,t)=>{var r={};for(var n in e)kD.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&&RD.call(e,n)&&(r[n]=e[n]);return r};const qJ={type:"text",size:"sm",__staticSelector:"TextInput"},le=f.forwardRef((e,t)=>{const r=LR("TextInput",qJ,e),{inputProps:n,wrapperProps:o}=r,i=GJ(r,["inputProps","wrapperProps"]);return S.createElement(Ut.Wrapper,yg({},o),S.createElement(Ut,HJ(yg(yg({},n),i),{ref:t})))});le.displayName="@mantine/core/TextInput";const[QJ,tm]=ko("Pagination.Root component was not found in tree"),KJ={siblings:1,boundaries:1};function TD(e){const{total:t,value:r,defaultValue:n,onChange:o,disabled:i,children:a,siblings:l,boundaries:c,color:u,radius:d,onNextPage:p,onPreviousPage:h,onFirstPage:m,onLastPage:v,getItemProps:g,classNames:b,styles:y,unstyled:x,variant:_,size:w}=H("PaginationRoot",KJ,e),{range:O,setPage:C,next:P,previous:E,active:k,first:$,last:I}=OL({page:r,initialPage:n,onChange:o,total:t,siblings:l,boundaries:c}),T=Mr(p,P),z=Mr(h,E),M=Mr(m,$),L=Mr(v,I);return S.createElement(QJ,{value:{total:t,range:O,active:k,disabled:i,color:u,radius:d,getItemProps:g,onChange:C,onNext:T,onPrevious:z,onFirst:M,onLast:L,stylesApi:{name:"Pagination",classNames:b,styles:y,unstyled:x,variant:_,size:w}}},a)}const nc={xs:j(22),sm:j(26),md:j(32),lg:j(38),xl:j(44)};var YJ=W((e,{color:t,radius:r,withPadding:n},{size:o})=>{const i=e.fn.variant({color:t,variant:"filled"});return{control:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",border:`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,height:A({size:o,sizes:nc}),minWidth:A({size:o,sizes:nc}),padding:n?`0 calc(${A({size:o,sizes:e.spacing})} / 2)`:void 0,fontSize:A({size:o,sizes:e.fontSizes}),borderRadius:e.fn.radius(r),lineHeight:1,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,"&:not([data-disabled])":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]}),"&:active:not([data-disabled])":e.activeStyles,"&[data-disabled]":{opacity:.4,cursor:"not-allowed",pointerEvents:"none"},"&[data-active]":{borderColor:"transparent",color:i.color,backgroundColor:i.background,"&:not([data-disabled])":e.fn.hover({backgroundColor:i.hover})}}}});const XJ=YJ;var JJ=Object.defineProperty,ZJ=Object.defineProperties,eZ=Object.getOwnPropertyDescriptors,Pp=Object.getOwnPropertySymbols,ID=Object.prototype.hasOwnProperty,DD=Object.prototype.propertyIsEnumerable,BP=(e,t,r)=>t in e?JJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tZ=(e,t)=>{for(var r in t||(t={}))ID.call(t,r)&&BP(e,r,t[r]);if(Pp)for(var r of Pp(t))DD.call(t,r)&&BP(e,r,t[r]);return e},rZ=(e,t)=>ZJ(e,eZ(t)),nZ=(e,t)=>{var r={};for(var n in e)ID.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&&DD.call(e,n)&&(r[n]=e[n]);return r};const oZ={withPadding:!0},rm=f.forwardRef((e,t)=>{const r=H("PaginationControl",oZ,e),{active:n,className:o,disabled:i,withPadding:a}=r,l=nZ(r,["active","className","disabled","withPadding"]),c=tm(),{classes:u,cx:d}=XJ({color:c.color,radius:c.radius,withPadding:a},c.stylesApi);return S.createElement(wo,rZ(tZ({},l),{disabled:i,"data-active":n||void 0,"data-disabled":i||void 0,ref:t,className:d(u.control,o)}))});rm.displayName="@mantine/core/PaginationControl";var iZ=Object.defineProperty,aZ=Object.defineProperties,sZ=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,AD=Object.prototype.propertyIsEnumerable,UP=(e,t,r)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ea=(e,t)=>{for(var r in t||(t={}))ND.call(t,r)&&UP(e,r,t[r]);if(jp)for(var r of jp(t))AD.call(t,r)&&UP(e,r,t[r]);return e},Cc=(e,t)=>aZ(e,sZ(t)),lZ=(e,t)=>{var r={};for(var n in e)ND.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&&AD.call(e,n)&&(r[n]=e[n]);return r};function MD(e){return`calc(${A({size:e,sizes:nc})} / 2)`}function Ec(e){var t=e,{size:r,style:n,children:o,path:i}=t,a=lZ(t,["size","style","children","path"]);return S.createElement("svg",ea({viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:ea({width:r,height:r},n)},a),S.createElement("path",{d:i,fill:"currentColor"}))}const cZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"})),uZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"})),dZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"})),fZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"})),pZ=e=>S.createElement(Ec,Cc(ea({},e),{path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}));var hZ=W((e,t,{size:r})=>({dots:{height:A({size:r,sizes:nc}),minWidth:A({size:r,sizes:nc}),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"}}));const mZ=hZ;var gZ=Object.defineProperty,Op=Object.getOwnPropertySymbols,LD=Object.prototype.hasOwnProperty,zD=Object.prototype.propertyIsEnumerable,WP=(e,t,r)=>t in e?gZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vZ=(e,t)=>{for(var r in t||(t={}))LD.call(t,r)&&WP(e,r,t[r]);if(Op)for(var r of Op(t))zD.call(t,r)&&WP(e,r,t[r]);return e},yZ=(e,t)=>{var r={};for(var n in e)LD.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&&zD.call(e,n)&&(r[n]=e[n]);return r};const xZ={icon:pZ},J0=f.forwardRef((e,t)=>{const r=H("PaginationDots",xZ,e),{className:n,icon:o}=r,i=yZ(r,["className","icon"]),a=tm(),{classes:l,cx:c}=mZ(null,a.stylesApi);return S.createElement(oe,vZ({ref:t,className:c(l.dots,n)},i),S.createElement(o,{size:MD(a.stylesApi.size)}))});J0.displayName="@mantine/core/PaginationDots";var wZ=Object.defineProperty,HP=Object.getOwnPropertySymbols,_Z=Object.prototype.hasOwnProperty,bZ=Object.prototype.propertyIsEnumerable,GP=(e,t,r)=>t in e?wZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SZ=(e,t)=>{for(var r in t||(t={}))_Z.call(t,r)&&GP(e,r,t[r]);if(HP)for(var r of HP(t))bZ.call(t,r)&&GP(e,r,t[r]);return e};function Z0({dotsIcon:e}){const t=tm(),r=t.range.map((n,o)=>{var i;return n==="dots"?S.createElement(J0,{icon:e,key:o}):S.createElement(rm,SZ({key:o,active:n===t.active,"aria-current":n===t.active?"page":void 0,onClick:()=>t.onChange(n),disabled:t.disabled},(i=t.getItemProps)==null?void 0:i.call(t,n)),n)});return S.createElement(S.Fragment,null,r)}Z0.displayName="@mantine/core/PaginationItems";var PZ=W(e=>({icon:{transform:e.dir==="rtl"?"rotate(180deg)":"unset"}}));const jZ=PZ;var OZ=Object.defineProperty,Cp=Object.getOwnPropertySymbols,FD=Object.prototype.hasOwnProperty,VD=Object.prototype.propertyIsEnumerable,qP=(e,t,r)=>t in e?OZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CZ=(e,t)=>{for(var r in t||(t={}))FD.call(t,r)&&qP(e,r,t[r]);if(Cp)for(var r of Cp(t))VD.call(t,r)&&qP(e,r,t[r]);return e},EZ=(e,t)=>{var r={};for(var n in e)FD.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&&VD.call(e,n)&&(r[n]=e[n]);return r};function nm({icon:e,name:t,action:r,type:n}){const o={icon:e},i=f.forwardRef((a,l)=>{const c=H(t,o,a),{icon:u}=c,d=EZ(c,["icon"]),{classes:p}=jZ(),h=tm(),m=n==="next"?h.active===h.total:h.active===1;return S.createElement(rm,CZ({disabled:h.disabled||m,ref:l,onClick:h[r],withPadding:!1},d),S.createElement(u,{className:p.icon,size:MD(h.stylesApi.size)}))});return i.displayName=`@mantine/core/${t}`,i}const BD=nm({icon:cZ,name:"PaginationNext",action:"onNext",type:"next"}),UD=nm({icon:uZ,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),WD=nm({icon:dZ,name:"PaginationFirst",action:"onFirst",type:"previous"}),HD=nm({icon:fZ,name:"PaginationLast",action:"onLast",type:"next"});var $Z=Object.defineProperty,Ep=Object.getOwnPropertySymbols,GD=Object.prototype.hasOwnProperty,qD=Object.prototype.propertyIsEnumerable,QP=(e,t,r)=>t in e?$Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nl=(e,t)=>{for(var r in t||(t={}))GD.call(t,r)&&QP(e,r,t[r]);if(Ep)for(var r of Ep(t))qD.call(t,r)&&QP(e,r,t[r]);return e},kZ=(e,t)=>{var r={};for(var n in e)GD.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&&qD.call(e,n)&&(r[n]=e[n]);return r};const RZ={withControls:!0,siblings:1,boundaries:1};function to(e){const t=H("Pagination",RZ,e),{withEdges:r,withControls:n,classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:b,radius:y,onNextPage:x,onPreviousPage:_,onFirstPage:w,onLastPage:O,getItemProps:C,getControlProps:P,spacing:E,nextIcon:k,previousIcon:$,lastIcon:I,firstIcon:T,dotsIcon:z}=t,M=kZ(t,["withEdges","withControls","classNames","styles","unstyled","variant","size","total","value","defaultValue","onChange","disabled","siblings","boundaries","color","radius","onNextPage","onPreviousPage","onFirstPage","onLastPage","getItemProps","getControlProps","spacing","nextIcon","previousIcon","lastIcon","firstIcon","dotsIcon"]),L=Jt();return u<=0?null:S.createElement(TD,{classNames:o,styles:i,unstyled:a,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:b,radius:y,onNextPage:x,onPreviousPage:_,onFirstPage:w,onLastPage:O,getItemProps:C},S.createElement(K,nl({spacing:E??`calc(${A({size:c,sizes:L.spacing})} / 2)`},M),r&&S.createElement(WD,nl({icon:T},P==null?void 0:P("first"))),n&&S.createElement(UD,nl({icon:$},P==null?void 0:P("previous"))),S.createElement(Z0,{dotsIcon:z}),n&&S.createElement(BD,nl({icon:k},P==null?void 0:P("next"))),r&&S.createElement(HD,nl({icon:I},P==null?void 0:P("last")))))}to.displayName="@mantine/core/Pagination";to.Root=TD;to.Items=Z0;to.Control=rm;to.Dots=J0;to.Next=BD;to.Previous=UD;to.Last=HD;to.First=WD;const TZ=({reveal:e,size:t})=>S.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:t,height:t}},S.createElement("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}));var IZ=Object.defineProperty,DZ=Object.defineProperties,NZ=Object.getOwnPropertyDescriptors,KP=Object.getOwnPropertySymbols,AZ=Object.prototype.hasOwnProperty,MZ=Object.prototype.propertyIsEnumerable,YP=(e,t,r)=>t in e?IZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xg=(e,t)=>{for(var r in t||(t={}))AZ.call(t,r)&&YP(e,r,t[r]);if(KP)for(var r of KP(t))MZ.call(t,r)&&YP(e,r,t[r]);return e},XP=(e,t)=>DZ(e,NZ(t)),LZ=W((e,{rightSectionWidth:t},{size:r})=>({visibilityToggle:{},input:{position:"relative",overflow:"hidden"},innerInput:XP(xg(xg({},e.fn.fontStyles()),e.fn.cover(0)),{backgroundColor:"transparent",border:`${j(1)} solid transparent`,borderLeftWidth:0,borderRightWidth:0,boxSizing:"border-box",display:"block",width:`calc(100% - ${j(t)})`,paddingLeft:`calc(${A({size:r,sizes:Et})} / 3)`,fontSize:A({size:r,sizes:e.fontSizes}),height:`calc(${A({size:r,sizes:Et})} - ${j(2)})`,lineHeight:`calc(${A({size:r,sizes:Et})} - ${j(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":XP(xg({},e.fn.placeholderStyles()),{opacity:1}),"&[data-invalid]":{color:e.fn.variant({variant:"filled",color:"red"}).background,"&::placeholder":{opacity:1,color:e.fn.variant({variant:"filled",color:"red"}).background}},"&[data-with-icon]":{paddingLeft:A({size:r,sizes:Et})}})}));const zZ=LZ;var FZ=Object.defineProperty,VZ=Object.defineProperties,BZ=Object.getOwnPropertyDescriptors,$p=Object.getOwnPropertySymbols,QD=Object.prototype.hasOwnProperty,KD=Object.prototype.propertyIsEnumerable,JP=(e,t,r)=>t in e?FZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tu=(e,t)=>{for(var r in t||(t={}))QD.call(t,r)&&JP(e,r,t[r]);if($p)for(var r of $p(t))KD.call(t,r)&&JP(e,r,t[r]);return e},UZ=(e,t)=>VZ(e,BZ(t)),WZ=(e,t)=>{var r={};for(var n in e)QD.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&&KD.call(e,n)&&(r[n]=e[n]);return r};const HZ={xs:j(22),sm:j(26),md:j(28),lg:j(32),xl:j(40)},GZ={xs:j(12),sm:j(15),md:j(17),lg:j(19),xl:j(21)},qZ={xs:j(28),sm:j(32),md:j(34),lg:j(44),xl:j(54)},QZ={size:"sm",toggleTabIndex:-1,visibilityToggleIcon:TZ,__staticSelector:"PasswordInput"},yo=f.forwardRef((e,t)=>{const r=H("PasswordInput",QZ,e),{radius:n,disabled:o,size:i,toggleTabIndex:a,className:l,id:c,label:u,error:d,required:p,style:h,icon:m,description:v,wrapperProps:g,classNames:b,styles:y,variant:x,visibilityToggleIcon:_,__staticSelector:w,sx:O,labelProps:C,descriptionProps:P,errorProps:E,unstyled:k,visibilityToggleLabel:$,withAsterisk:I,inputContainer:T,iconWidth:z,inputWrapperOrder:M,visible:L,defaultVisible:q,onVisibilityChange:Y}=r,R=WZ(r,["radius","disabled","size","toggleTabIndex","className","id","label","error","required","style","icon","description","wrapperProps","classNames","styles","variant","visibilityToggleIcon","__staticSelector","sx","labelProps","descriptionProps","errorProps","unstyled","visibilityToggleLabel","withAsterisk","inputContainer","iconWidth","inputWrapperOrder","visible","defaultVisible","onVisibilityChange"]),N=A({size:i,sizes:qZ}),{classes:V}=zZ({rightSectionWidth:N},{name:"PasswordInput",classNames:b,styles:y,unstyled:k,size:i,variant:x}),Q=Rr(c),{systemStyles:ee,rest:_e}=eo(R),[we,Ue]=$r({value:L,defaultValue:q,finalValue:!1,onChange:Y}),Ae=()=>Ue(!we),pt=S.createElement(dr,{className:V.visibilityToggle,tabIndex:a,radius:n,size:A({size:i,sizes:HZ}),"aria-hidden":!$,"aria-label":$,unstyled:k,onMouseDown:Dt=>{Dt.preventDefault(),Ae()},onKeyDown:Dt=>{Dt.key===" "&&(Dt.preventDefault(),Ae())}},S.createElement(_,{reveal:we,size:A({size:i,sizes:GZ})}));return S.createElement(Ut.Wrapper,Tu(Tu({required:p,id:Q,label:u,error:d,description:v,size:i,className:l,style:h,classNames:b,styles:y,__staticSelector:w,sx:O,errorProps:E,descriptionProps:P,labelProps:C,unstyled:k,withAsterisk:I,inputWrapperOrder:M,inputContainer:T,variant:x},ee),g),S.createElement(Ut,{component:"div",error:d,icon:m,size:i,classNames:UZ(Tu({},b),{input:V.input}),styles:y,radius:n,disabled:o,__staticSelector:w,rightSectionWidth:N,rightSection:!o&&pt,variant:x,unstyled:k,iconWidth:z},S.createElement("input",Tu({type:we?"text":"password",required:p,"data-invalid":!!d||void 0,"data-with-icon":!!m||void 0,className:V.innerInput,disabled:o,id:Q,ref:t,autoComplete:"off"},_e))))});yo.displayName="@mantine/core/PasswordInput";const YD=f.createContext(!1),KZ=YD.Provider,YZ=()=>f.useContext(YD);function XD({children:e,openDelay:t=0,closeDelay:r=0}){return S.createElement(KZ,{value:!0},S.createElement(TB,{delay:{open:t,close:r}},e))}XD.displayName="@mantine/core/TooltipGroup";var XZ=Object.defineProperty,JZ=Object.defineProperties,ZZ=Object.getOwnPropertyDescriptors,ZP=Object.getOwnPropertySymbols,eee=Object.prototype.hasOwnProperty,tee=Object.prototype.propertyIsEnumerable,ej=(e,t,r)=>t in e?XZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tj=(e,t)=>{for(var r in t||(t={}))eee.call(t,r)&&ej(e,r,t[r]);if(ZP)for(var r of ZP(t))tee.call(t,r)&&ej(e,r,t[r]);return e},ree=(e,t)=>JZ(e,ZZ(t));function nee(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.gray[2]:e.colors.gray[9],color:e.colorScheme==="dark"?e.black:e.white};const r=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:r.background,color:r.color}}var oee=W((e,{color:t,radius:r,width:n,multiline:o})=>({tooltip:ree(tj(tj({},e.fn.fontStyles()),nee(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(r),padding:`calc(${e.spacing.xs} / 2) ${e.spacing.xs}`,position:"absolute",whiteSpace:o?"unset":"nowrap",pointerEvents:"none",width:n}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const JD=oee,ZD={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 iee({offset:e,position:t}){const[r,n]=f.useState(!1),o=f.useRef(),{x:i,y:a,reference:l,floating:c,refs:u,update:d,placement:p}=V0({placement:t,middleware:[N0({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=p.includes("right")?e:t.includes("left")?e*-1:0,m=p.includes("bottom")?e:t.includes("top")?e*-1:0,v=f.useCallback(({clientX:g,clientY:b})=>{l({getBoundingClientRect(){return{width:0,height:0,x:g,y:b,left:g+h,top:b+m,right:g,bottom:b}}})},[l]);return f.useEffect(()=>{if(u.floating.current){const g=o.current;g.addEventListener("mousemove",v);const b=vo(u.floating.current);return b.forEach(y=>{y.addEventListener("scroll",d)}),()=>{g.removeEventListener("mousemove",v),b.forEach(y=>{y.removeEventListener("scroll",d)})}}},[l,u.floating.current,d,v,r]),{handleMouseMove:v,x:i,y:a,opened:r,setOpened:n,boundaryRef:o,floating:c}}var aee=Object.defineProperty,see=Object.defineProperties,lee=Object.getOwnPropertyDescriptors,kp=Object.getOwnPropertySymbols,eN=Object.prototype.hasOwnProperty,tN=Object.prototype.propertyIsEnumerable,rj=(e,t,r)=>t in e?aee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Iu=(e,t)=>{for(var r in t||(t={}))eN.call(t,r)&&rj(e,r,t[r]);if(kp)for(var r of kp(t))tN.call(t,r)&&rj(e,r,t[r]);return e},Du=(e,t)=>see(e,lee(t)),cee=(e,t)=>{var r={};for(var n in e)eN.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&&tN.call(e,n)&&(r[n]=e[n]);return r};const uee={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Cn("popover")};function rN(e){var t;const r=H("TooltipFloating",uee,e),{children:n,refProp:o,withinPortal:i,portalProps:a,style:l,className:c,classNames:u,styles:d,unstyled:p,radius:h,color:m,label:v,offset:g,position:b,multiline:y,width:x,zIndex:_,disabled:w,variant:O}=r,C=cee(r,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:P,x:E,y:k,opened:$,boundaryRef:I,floating:T,setOpened:z}=iee({offset:g,position:b}),{classes:M,cx:L}=JD({radius:h,color:m,multiline:y,width:x},{name:"TooltipFloating",classNames:u,styles:d,unstyled:p,variant:O});if(!Os(n))throw new Error(ZD.children);const q=Es(I,n.ref),Y=N=>{var V,Q;(Q=(V=n.props).onMouseEnter)==null||Q.call(V,N),P(N),z(!0)},R=N=>{var V,Q;(Q=(V=n.props).onMouseLeave)==null||Q.call(V,N),z(!1)};return S.createElement(S.Fragment,null,S.createElement(Rs,Du(Iu({},a),{withinPortal:i}),S.createElement(oe,Du(Iu({},C),{ref:T,className:L(M.tooltip,c),style:Du(Iu({},l),{zIndex:_,display:!w&&$?"block":"none",top:k??"",left:(t=Math.round(E))!=null?t:""})}),v)),f.cloneElement(n,Du(Iu({},n.props),{[o]:q,onMouseEnter:Y,onMouseLeave:R})))}rN.displayName="@mantine/core/TooltipFloating";function dee(e){const[t,r]=f.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=YZ(),a=Rr(),{delay:l,currentId:c,setCurrentId:u}=wR(),d=f.useCallback(E=>{r(E),E&&u(a)},[u,a]),{x:p,y:h,reference:m,floating:v,context:g,refs:b,update:y,placement:x,middlewareData:{arrow:{x:_,y:w}={}}}=V0({placement:e.position,open:o,onOpenChange:d,middleware:[sR(e.offset),N0({padding:8}),oR(),mR({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[aR()]:[]]}),{getReferenceProps:O,getFloatingProps:C}=WB([RB(g,{enabled:e.events.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),BB(g,{enabled:e.events.focus,keyboardOnly:!0}),UB(g,{role:"tooltip"}),VB(g,{enabled:typeof e.opened===void 0}),IB(g,{id:a})]);return bR({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:b,update:y}}),rn(()=>{var E;(E=e.onPositionChange)==null||E.call(e,x)},[x]),{x:p,y:h,arrowX:_,arrowY:w,reference:m,floating:v,getFloatingProps:C,getReferenceProps:O,isGroupPhase:o&&c&&c!==a,opened:o,placement:x}}var fee=Object.defineProperty,pee=Object.defineProperties,hee=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,nN=Object.prototype.hasOwnProperty,oN=Object.prototype.propertyIsEnumerable,nj=(e,t,r)=>t in e?fee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ri=(e,t)=>{for(var r in t||(t={}))nN.call(t,r)&&nj(e,r,t[r]);if(Rp)for(var r of Rp(t))oN.call(t,r)&&nj(e,r,t[r]);return e},wg=(e,t)=>pee(e,hee(t)),mee=(e,t)=>{var r={};for(var n in e)nN.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&&oN.call(e,n)&&(r[n]=e[n]);return r};const gee={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:Cn("popover"),positionDependencies:[]},om=f.forwardRef((e,t)=>{var r;const n=f.useRef(null),o=H("Tooltip",gee,e),{children:i,position:a,refProp:l,label:c,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,withinPortal:m,portalProps:v,radius:g,color:b,classNames:y,styles:x,unstyled:_,style:w,className:O,withArrow:C,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,offset:I,transitionProps:T,multiline:z,width:M,events:L,zIndex:q,disabled:Y,positionDependencies:R,onClick:N,onMouseEnter:V,onMouseLeave:Q,inline:ee,variant:_e,keepMounted:we}=o,Ue=mee(o,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","portalProps","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transitionProps","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline","variant","keepMounted"]),{classes:Ae,cx:pt,theme:Dt}=JD({radius:g,color:b,width:M,multiline:z},{name:"Tooltip",classNames:y,styles:x,unstyled:_,variant:_e}),Pe=dee({position:IR(Dt.dir,a),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,events:L,arrowRef:n,arrowOffset:E,offset:I+(C?P/2:0),positionDependencies:[...R,i],inline:ee});if(!Os(i))throw new Error(ZD.children);const Ht=Es(Pe.reference,i.ref,t);return S.createElement(S.Fragment,null,S.createElement(Rs,wg(Ri({},v),{withinPortal:m}),S.createElement(pa,wg(Ri({keepMounted:we,mounted:!Y&&Pe.opened},T),{transition:T.transition||"fade",duration:Pe.isGroupPhase?10:(r=T.duration)!=null?r:100}),Dr=>{var lr,Gt;return S.createElement(oe,Ri(Ri({},Ue),Pe.getFloatingProps({ref:Pe.floating,className:Ae.tooltip,style:wg(Ri(Ri({},w),Dr),{zIndex:q,top:(lr=Pe.y)!=null?lr:0,left:(Gt=Pe.x)!=null?Gt:0})})),c,S.createElement(U0,{ref:n,arrowX:Pe.arrowX,arrowY:Pe.arrowY,visible:C,position:Pe.placement,arrowSize:P,arrowOffset:E,arrowRadius:k,arrowPosition:$,className:Ae.arrow}))})),f.cloneElement(i,Pe.getReferenceProps(Ri({onClick:N,onMouseEnter:V,onMouseLeave:Q,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[l]:Ht,className:pt(O,i.props.className)},i.props))))});om.Group=XD;om.Floating=rN;om.displayName="@mantine/core/Tooltip";const iN=om;var vee=Object.defineProperty,Tp=Object.getOwnPropertySymbols,aN=Object.prototype.hasOwnProperty,sN=Object.prototype.propertyIsEnumerable,oj=(e,t,r)=>t in e?vee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ij=(e,t)=>{for(var r in t||(t={}))aN.call(t,r)&&oj(e,r,t[r]);if(Tp)for(var r of Tp(t))sN.call(t,r)&&oj(e,r,t[r]);return e},yee=(e,t)=>{var r={};for(var n in e)aN.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&&sN.call(e,n)&&(r[n]=e[n]);return r};function xee(e){const t=e,{width:r,height:n,style:o}=t,i=yee(t,["width","height","style"]);return S.createElement("svg",ij({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:ij({width:r,height:n},o)},i),S.createElement("path",{fill:"currentColor",d:"M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z"}))}const lN=f.createContext(null),wee=lN.Provider,_ee=()=>f.useContext(lN);var bee=Object.defineProperty,Ip=Object.getOwnPropertySymbols,cN=Object.prototype.hasOwnProperty,uN=Object.prototype.propertyIsEnumerable,aj=(e,t,r)=>t in e?bee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sj=(e,t)=>{for(var r in t||(t={}))cN.call(t,r)&&aj(e,r,t[r]);if(Ip)for(var r of Ip(t))uN.call(t,r)&&aj(e,r,t[r]);return e},See=(e,t)=>{var r={};for(var n in e)cN.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&&uN.call(e,n)&&(r[n]=e[n]);return r};const Pee={size:"sm"},dN=f.forwardRef((e,t)=>{const r=H("RadioGroup",Pee,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c,unstyled:u,name:d}=r,p=See(r,["children","value","defaultValue","onChange","size","wrapperProps","unstyled","name"]),h=Rr(d),[m,v]=$r({value:o,defaultValue:i,finalValue:"",onChange:a}),g=b=>v(b.currentTarget.value);return S.createElement(wee,{value:{value:m,onChange:g,size:l,name:h}},S.createElement(Ut.Wrapper,sj(sj({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:u},c),p),n))});dN.displayName="@mantine/core/RadioGroup";var jee=Object.defineProperty,Oee=Object.defineProperties,Cee=Object.getOwnPropertyDescriptors,lj=Object.getOwnPropertySymbols,Eee=Object.prototype.hasOwnProperty,$ee=Object.prototype.propertyIsEnumerable,cj=(e,t,r)=>t in e?jee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kee=(e,t)=>{for(var r in t||(t={}))Eee.call(t,r)&&cj(e,r,t[r]);if(lj)for(var r of lj(t))$ee.call(t,r)&&cj(e,r,t[r]);return e},Ree=(e,t)=>Oee(e,Cee(t));const _g={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)},Nu={xs:j(6),sm:j(8),md:j(10),lg:j(14),xl:j(16)};var Tee=W((e,{color:t,transitionDuration:r,labelPosition:n,error:o},{size:i})=>{const a=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:Vt("icon"),color:e.white,opacity:0,transform:`scale(0.75) translateY(${j(2)})`,transition:`opacity ${r}ms ${e.transitionTimingFunction}`,pointerEvents:"none",width:A({sizes:Nu,size:i}),height:A({sizes:Nu,size:i}),position:"absolute",top:`calc(50% - ${A({sizes:Nu,size:i})} / 2)`,left:`calc(50% - ${A({sizes:Nu,size:i})} / 2)`},radio:Ree(kee({},e.fn.focusStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${j(1)} solid ${o?l:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,position:"relative",appearance:"none",width:A({sizes:_g,size:i}),height:A({sizes:_g,size:i}),borderRadius:A({sizes:_g,size:i}),margin:0,display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:`${r}ms`,cursor:e.cursorType,"&:checked":{background:a.background,borderColor:a.background,[`& + .${Vt("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],[`& + .${Vt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[4]}}})}});const Iee=Tee;var Dee=Object.defineProperty,Dp=Object.getOwnPropertySymbols,fN=Object.prototype.hasOwnProperty,pN=Object.prototype.propertyIsEnumerable,uj=(e,t,r)=>t in e?Dee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Au=(e,t)=>{for(var r in t||(t={}))fN.call(t,r)&&uj(e,r,t[r]);if(Dp)for(var r of Dp(t))pN.call(t,r)&&uj(e,r,t[r]);return e},Nee=(e,t)=>{var r={};for(var n in e)fN.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&&pN.call(e,n)&&(r[n]=e[n]);return r};const Aee={icon:xee,transitionDuration:100,size:"sm",labelPosition:"right"},Np=f.forwardRef((e,t)=>{var r,n;const o=H("Radio",Aee,e),{className:i,style:a,id:l,label:c,size:u,title:d,disabled:p,color:h,classNames:m,styles:v,sx:g,icon:b,transitionDuration:y,wrapperProps:x,unstyled:_,labelPosition:w,description:O,error:C,variant:P}=o,E=Nee(o,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error","variant"]),k=_ee(),$=(r=k==null?void 0:k.size)!=null?r:u,I=e.size?u:$,{classes:T}=Iee({color:h,transitionDuration:y,labelPosition:w,error:!!C},{name:"Radio",classNames:m,styles:v,unstyled:_,variant:P,size:I}),{systemStyles:z,rest:M}=eo(E),L=Rr(l),q=k?{checked:k.value===M.value,name:(n=M.name)!=null?n:k.name,onChange:k.onChange}:{};return S.createElement(Zh,Au(Au({className:i,sx:g,style:a,id:L,size:I,labelPosition:w,label:c,description:O,error:C,disabled:p,__staticSelector:"Radio",classNames:m,styles:v,unstyled:_,"data-checked":q.checked||void 0,variant:P},z),x),S.createElement("div",{className:T.inner},S.createElement("input",Au(Au({ref:t,className:T.radio,type:"radio",id:L,disabled:p},M),q)),S.createElement(b,{className:T.icon,"aria-hidden":!0})))});Np.displayName="@mantine/core/Radio";Np.Group=dN;function Mee({size:e,thickness:t,sum:r,value:n,root:o,offset:i}){const a=(e*.9-t*2)/2,l=Math.PI*a*2/100,c=o?`${(100-r)*l}, ${r*l}`:`${n*l}, ${(100-n)*l}`;return{strokeWidth:t,cx:e/2,cy:e/2,r:a,transform:o?`scale(1, -1) translate(0, -${e})`:null,strokeDasharray:c,strokeDashoffset:o?0:i}}var Lee=Object.defineProperty,zee=Object.defineProperties,Fee=Object.getOwnPropertyDescriptors,Ap=Object.getOwnPropertySymbols,hN=Object.prototype.hasOwnProperty,mN=Object.prototype.propertyIsEnumerable,dj=(e,t,r)=>t in e?Lee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fj=(e,t)=>{for(var r in t||(t={}))hN.call(t,r)&&dj(e,r,t[r]);if(Ap)for(var r of Ap(t))mN.call(t,r)&&dj(e,r,t[r]);return e},Vee=(e,t)=>zee(e,Fee(t)),Bee=(e,t)=>{var r={};for(var n in e)hN.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&&mN.call(e,n)&&(r[n]=e[n]);return r};function gN(e){var t=e,{size:r,value:n,offset:o,sum:i,thickness:a,root:l,color:c,lineRoundCaps:u,tooltip:d}=t,p=Bee(t,["size","value","offset","sum","thickness","root","color","lineRoundCaps","tooltip"]);const h=Jt(),m=h.fn.themeColor(c||(h.colorScheme==="dark"?"dark":"gray"),c?h.fn.primaryShade():h.colorScheme==="dark"?4:1,!1);return S.createElement(iN.Floating,{disabled:!d,label:d},S.createElement("circle",fj(Vee(fj({},p),{fill:"none",strokeLinecap:u?"round":"butt",stroke:m}),Mee({sum:i,size:r,thickness:a,value:n,offset:o,root:l}))))}gN.displayName="@mantine/core/Curve";var Uee=Object.defineProperty,Wee=Object.defineProperties,Hee=Object.getOwnPropertyDescriptors,pj=Object.getOwnPropertySymbols,Gee=Object.prototype.hasOwnProperty,qee=Object.prototype.propertyIsEnumerable,hj=(e,t,r)=>t in e?Uee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ol=(e,t)=>{for(var r in t||(t={}))Gee.call(t,r)&&hj(e,r,t[r]);if(pj)for(var r of pj(t))qee.call(t,r)&&hj(e,r,t[r]);return e},il=(e,t)=>Wee(e,Hee(t));function Qee({size:e,thickness:t,sections:r,renderRoundedLineCaps:n,rootColor:o}){const i=r.reduce((d,p)=>d+p.value,0),a=Math.PI*((e*.9-t*2)/2)*2;let l=a;const c=[],u=[];for(let d=0;d<r.length;d+=1)c.push({sum:i,offset:l,data:r[d],root:!1}),l-=r[d].value/100*a;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push(il(ol({},c[c.length-1]),{lineRoundCaps:!1})),c.length>2){u.push(il(ol({},c[0]),{lineRoundCaps:n})),u.push(il(ol({},c[c.length-2]),{lineRoundCaps:n}));for(let d=1;d<=c.length-3;d+=1)u.push(il(ol({},c[d]),{lineRoundCaps:!1}))}else u.push(il(ol({},c[0]),{lineRoundCaps:n}));return u}var Kee=W({root:{position:"relative"},label:{position:"absolute",top:"50%",transform:"translateY(-50%)"}});const Yee=Kee;var Xee=Object.defineProperty,Jee=Object.defineProperties,Zee=Object.getOwnPropertyDescriptors,Mp=Object.getOwnPropertySymbols,vN=Object.prototype.hasOwnProperty,yN=Object.prototype.propertyIsEnumerable,mj=(e,t,r)=>t in e?Xee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bg=(e,t)=>{for(var r in t||(t={}))vN.call(t,r)&&mj(e,r,t[r]);if(Mp)for(var r of Mp(t))yN.call(t,r)&&mj(e,r,t[r]);return e},ete=(e,t)=>Jee(e,Zee(t)),tte=(e,t)=>{var r={};for(var n in e)vN.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&&yN.call(e,n)&&(r[n]=e[n]);return r};const rte={size:120,thickness:12},ex=f.forwardRef((e,t)=>{const r=H("RingProgress",rte,e),{className:n,style:o,label:i,sections:a,size:l,thickness:c,classNames:u,styles:d,roundCaps:p,rootColor:h,unstyled:m,variant:v}=r,g=tte(r,["className","style","label","sections","size","thickness","classNames","styles","roundCaps","rootColor","unstyled","variant"]),{classes:b,cx:y}=Yee(null,{name:"RingProgress",classNames:u,styles:d,unstyled:m,variant:v}),x=Qee({size:l,thickness:c,sections:a,renderRoundedLineCaps:p,rootColor:h}).map(({data:_,sum:w,root:O,lineRoundCaps:C,offset:P},E)=>S.createElement(gN,ete(bg({},_),{key:E,size:l,thickness:c,sum:w,offset:P,color:_==null?void 0:_.color,root:O,lineRoundCaps:C})));return S.createElement(oe,bg({style:bg({width:l,height:l},o),className:y(b.root,n),ref:t},g),S.createElement("svg",{style:{width:l,height:l,transform:"rotate(-90deg)"}},x),i&&S.createElement("div",{className:b.label,style:{right:c*2,left:c*2}},i))});ex.displayName="@mantine/core/RingProgress";function nte(e,t){if(t.length===0)return t;const r="maxWidth"in t[0]?"maxWidth":"minWidth",n=[...t].sort((o,i)=>pr(A({size:i[r],sizes:e.breakpoints}))-pr(A({size:o[r],sizes:e.breakpoints})));return r==="minWidth"?n.reverse():n}var ote=Object.defineProperty,gj=Object.getOwnPropertySymbols,ite=Object.prototype.hasOwnProperty,ate=Object.prototype.propertyIsEnumerable,vj=(e,t,r)=>t in e?ote(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ste=(e,t)=>{for(var r in t||(t={}))ite.call(t,r)&&vj(e,r,t[r]);if(gj)for(var r of gj(t))ate.call(t,r)&&vj(e,r,t[r]);return e},lte=W((e,{spacing:t,breakpoints:r,cols:n,verticalSpacing:o})=>{const i=o!=null,a=nte(e,r).reduce((l,c)=>{var u,d;const p="maxWidth"in c?"max-width":"min-width",h=A({size:p==="max-width"?c.maxWidth:c.minWidth,sizes:e.breakpoints,units:"em"}),m=pr(h)-(p==="max-width"?1:0);return l[`@media (${p}: ${ir(m)})`]={gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,gap:`${A({size:(u=c.verticalSpacing)!=null?u:i?o:t,sizes:e.spacing})} ${A({size:(d=c.spacing)!=null?d:t,sizes:e.spacing})}`},l},{});return{root:ste({boxSizing:"border-box",display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:`${A({size:i?o:t,sizes:e.spacing})} ${A({size:t,sizes:e.spacing})}`},a)}});const cte=lte;var ute=Object.defineProperty,Lp=Object.getOwnPropertySymbols,xN=Object.prototype.hasOwnProperty,wN=Object.prototype.propertyIsEnumerable,yj=(e,t,r)=>t in e?ute(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dte=(e,t)=>{for(var r in t||(t={}))xN.call(t,r)&&yj(e,r,t[r]);if(Lp)for(var r of Lp(t))wN.call(t,r)&&yj(e,r,t[r]);return e},fte=(e,t)=>{var r={};for(var n in e)xN.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&&wN.call(e,n)&&(r[n]=e[n]);return r};const pte={breakpoints:[],cols:1,spacing:"md"},_N=f.forwardRef((e,t)=>{const r=H("SimpleGrid",pte,e),{className:n,breakpoints:o,cols:i,spacing:a,verticalSpacing:l,children:c,unstyled:u,variant:d}=r,p=fte(r,["className","breakpoints","cols","spacing","verticalSpacing","children","unstyled","variant"]),{classes:h,cx:m}=cte({breakpoints:o,cols:i,spacing:a,verticalSpacing:l},{name:"SimpleGrid",unstyled:u,variant:d});return S.createElement(oe,dte({className:m(h.root,n),ref:t},p),c)});_N.displayName="@mantine/core/SimpleGrid";var hte=Object.defineProperty,zp=Object.getOwnPropertySymbols,bN=Object.prototype.hasOwnProperty,SN=Object.prototype.propertyIsEnumerable,xj=(e,t,r)=>t in e?hte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mte=(e,t)=>{for(var r in t||(t={}))bN.call(t,r)&&xj(e,r,t[r]);if(zp)for(var r of zp(t))SN.call(t,r)&&xj(e,r,t[r]);return e},gte=(e,t)=>{var r={};for(var n in e)bN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zp)for(var n of zp(e))t.indexOf(n)<0&&SN.call(e,n)&&(r[n]=e[n]);return r};const vte={w:0,h:0},im=f.forwardRef((e,t)=>{const r=H("Space",vte,e),{w:n,h:o}=r,i=gte(r,["w","h"]);return S.createElement(oe,mte({ref:t,w:n,miw:n,h:o,mih:o},i))});im.displayName="@mantine/core/Space";var yte=W((e,{spacing:t,align:r,justify:n})=>({root:{display:"flex",flexDirection:"column",alignItems:r,justifyContent:n,gap:A({size:t,sizes:e.spacing})}}));const xte=yte;var wte=Object.defineProperty,Fp=Object.getOwnPropertySymbols,PN=Object.prototype.hasOwnProperty,jN=Object.prototype.propertyIsEnumerable,wj=(e,t,r)=>t in e?wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_te=(e,t)=>{for(var r in t||(t={}))PN.call(t,r)&&wj(e,r,t[r]);if(Fp)for(var r of Fp(t))jN.call(t,r)&&wj(e,r,t[r]);return e},bte=(e,t)=>{var r={};for(var n in e)PN.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&&jN.call(e,n)&&(r[n]=e[n]);return r};const Ste={spacing:"md",align:"stretch",justify:"flex-start"},Oe=f.forwardRef((e,t)=>{const r=H("Stack",Ste,e),{spacing:n,className:o,align:i,justify:a,unstyled:l,variant:c}=r,u=bte(r,["spacing","className","align","justify","unstyled","variant"]),{classes:d,cx:p}=xte({spacing:n,align:i,justify:a},{name:"Stack",unstyled:l,variant:c});return S.createElement(oe,_te({className:p(d.root,o),ref:t},u))});Oe.displayName="@mantine/core/Stack";var Pte=Object.defineProperty,jte=Object.defineProperties,Ote=Object.getOwnPropertyDescriptors,_j=Object.getOwnPropertySymbols,Cte=Object.prototype.hasOwnProperty,Ete=Object.prototype.propertyIsEnumerable,bj=(e,t,r)=>t in e?Pte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sg=(e,t)=>{for(var r in t||(t={}))Cte.call(t,r)&&bj(e,r,t[r]);if(_j)for(var r of _j(t))Ete.call(t,r)&&bj(e,r,t[r]);return e},$te=(e,t)=>jte(e,Ote(t));const ON={xs:j(34),sm:j(36),md:j(42),lg:j(48),xl:j(52)};var kte=W((e,{color:t,iconSize:r,radius:n,allowStepClick:o,iconPosition:i,orientation:a},{size:l})=>{const c=r?j(r):A({size:l,sizes:ON}),u=l==="xl"||l==="lg"?e.spacing.md:e.spacing.sm,d=e.fn.radius(n),p=e.fn.variant({variant:"filled",color:t||e.primaryColor,primaryFallback:!1}),h=`calc(${e.spacing.xs} / 2)`,m={step:{justifyContent:"flex-start",minHeight:`calc(${c} + ${e.spacing.xl} + ${h})`,marginTop:h,overflow:"hidden","&:first-of-type":{marginTop:0},[`&:last-of-type .${Vt("verticalSeparator")}`]:{display:"none"}}};return{stepLoader:{},step:Sg({display:"flex",flexDirection:i==="left"?"row":"row-reverse",cursor:o?"pointer":"default"},a==="vertical"?m.step:{alignItems:"center"}),stepWrapper:{position:"relative"},verticalSeparator:{top:`calc(${c} + ${h})`,left:`calc(${c} / 2)`,height:"100vh",position:"absolute",borderLeft:`${j(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,ref:Vt("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:`${j(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,transition:"background-color 150ms ease, border-color 150ms ease",position:"relative",fontWeight:700,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],fontSize:A({size:l,sizes:e.fontSizes}),"&[data-progress]":{borderColor:p.background},"&[data-completed]":{backgroundColor:p.background,borderColor:p.background,color:e.white}},stepCompletedIcon:$te(Sg({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.white}),stepBody:Sg({display:"flex",flexDirection:"column",marginLeft:i==="left"?u:void 0,marginRight:i==="right"?u:void 0},a==="vertical"?{marginTop:`calc(${r} / 4)`}:null),stepLabel:{textAlign:i,fontWeight:500,fontSize:A({size:l,sizes:e.fontSizes}),lineHeight:1},stepDescription:{textAlign:i,marginTop:`calc(${A({size:l,sizes:e.spacing})} / 3)`,marginBottom:`calc(${A({size:l,sizes:e.spacing})} / 3)`,fontSize:`calc(${A({size:l,sizes:e.fontSizes})} - ${j(2)})`,lineHeight:1}}});const Rte=kte;var Tte=Object.defineProperty,Vp=Object.getOwnPropertySymbols,CN=Object.prototype.hasOwnProperty,EN=Object.prototype.propertyIsEnumerable,Sj=(e,t,r)=>t in e?Tte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pg=(e,t)=>{for(var r in t||(t={}))CN.call(t,r)&&Sj(e,r,t[r]);if(Vp)for(var r of Vp(t))EN.call(t,r)&&Sj(e,r,t[r]);return e},Ite=(e,t)=>{var r={};for(var n in e)CN.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&&EN.call(e,n)&&(r[n]=e[n]);return r};const Dte={xs:16,sm:18,md:20,lg:22,xl:24},Nte={withIcon:!0,size:"md",radius:"xl",allowStepClick:!0,iconPosition:"left",__staticSelector:"Step"},Mu=(e,t)=>typeof e=="function"?S.createElement(e,{step:t}):e,$N=f.forwardRef((e,t)=>{const r=H("StepperStep",Nte,e),{className:n,step:o,state:i,color:a,icon:l,completedIcon:c,progressIcon:u,label:d,description:p,withIcon:h,iconSize:m,size:v,radius:g,loading:b,allowStepClick:y,allowStepSelect:x,iconPosition:_,__staticSelector:w,classNames:O,styles:C,unstyled:P,orientation:E,variant:k}=r,$=Ite(r,["className","step","state","color","icon","completedIcon","progressIcon","label","description","withIcon","iconSize","size","radius","loading","allowStepClick","allowStepSelect","iconPosition","__staticSelector","classNames","styles","unstyled","orientation","variant"]),{classes:I,cx:T}=Rte({color:a,iconSize:m,radius:g,allowStepClick:y,iconPosition:_,orientation:E},{name:w,classNames:O,styles:C,unstyled:P,variant:k,size:v}),z=A({size:v,sizes:Dte}),M=i==="stepCompleted"?null:i==="stepProgress"?u:l,L={"data-progress":i==="stepProgress"||void 0,"data-completed":i==="stepCompleted"||void 0};return S.createElement(wo,Pg(Pg({className:T(I.step,n),tabIndex:y?0:-1,ref:t},L),$),h&&S.createElement("div",{className:I.stepWrapper},S.createElement("div",Pg({className:I.stepIcon},L),S.createElement(pa,{mounted:i==="stepCompleted",transition:"pop",duration:200},q=>S.createElement("div",{className:I.stepCompletedIcon,style:q},b?S.createElement(cn,{color:"#fff",size:z,className:I.stepLoader}):Mu(c,o)||S.createElement(NT,{indeterminate:!1,width:z,height:z}))),i!=="stepCompleted"?b?S.createElement(cn,{size:z,color:a}):Mu(M||l,o):null),E==="vertical"&&S.createElement("div",{className:T(I.verticalSeparator,{[I.verticalSeparatorActive]:i==="stepCompleted"})})),(d||p)&&S.createElement("div",{className:I.stepBody},d&&S.createElement(re,{className:I.stepLabel},Mu(d,o)),p&&S.createElement(re,{className:I.stepDescription,color:"dimmed"},Mu(p,o))))});$N.displayName="@mantine/core/Step";function Bp(e){return null}Bp.displayName="@mantine/core/StepCompleted";var Ate=Object.defineProperty,Mte=Object.defineProperties,Lte=Object.getOwnPropertyDescriptors,Pj=Object.getOwnPropertySymbols,zte=Object.prototype.hasOwnProperty,Fte=Object.prototype.propertyIsEnumerable,jj=(e,t,r)=>t in e?Ate(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,al=(e,t)=>{for(var r in t||(t={}))zte.call(t,r)&&jj(e,r,t[r]);if(Pj)for(var r of Pj(t))Fte.call(t,r)&&jj(e,r,t[r]);return e},Vte=(e,t)=>Mte(e,Lte(t)),Bte=W((e,{contentPadding:t,color:r,orientation:n,iconPosition:o,iconSize:i,breakpoint:a},{size:l})=>{const c=typeof a<"u",u=pr(A({size:a,sizes:e.breakpoints})),d=typeof i<"u"?`calc(${j(i)} / 2 - ${j(1)})`:`calc(${A({size:l,sizes:ON})} / 2 - ${j(1)})`,p={steps:{flexDirection:"column",alignItems:o==="left"?"flex-start":"flex-end"},separator:{width:j(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} - ${j(2)})`}},h={steps:{[`@media (max-width: ${ir(u-1)})`]:p.steps},separator:{[`@media (max-width: ${ir(u-1)})`]:p.separator}};return{root:{},steps:al(al({display:"flex",boxSizing:"border-box",alignItems:"center"},n==="vertical"?p.steps:null),c?h.steps:null),separator:al(al({boxSizing:"border-box",transition:"background-color 150ms ease",flex:1,height:j(2),backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],marginLeft:e.spacing.md,marginRight:e.spacing.md},n==="vertical"?p.separator:null),c?h.separator:null),separatorActive:{backgroundColor:e.fn.variant({variant:"filled",color:r||e.primaryColor,primaryFallback:!1}).background},content:Vte(al({},e.fn.fontStyles()),{paddingTop:A({size:t,sizes:e.spacing})})}});const Ute=Bte;var Wte=Object.defineProperty,Up=Object.getOwnPropertySymbols,kN=Object.prototype.hasOwnProperty,RN=Object.prototype.propertyIsEnumerable,Oj=(e,t,r)=>t in e?Wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hte=(e,t)=>{for(var r in t||(t={}))kN.call(t,r)&&Oj(e,r,t[r]);if(Up)for(var r of Up(t))RN.call(t,r)&&Oj(e,r,t[r]);return e},Gte=(e,t)=>{var r={};for(var n in e)kN.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&&RN.call(e,n)&&(r[n]=e[n]);return r};const qte={contentPadding:"md",size:"md",radius:"xl",orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0},oc=f.forwardRef((e,t)=>{var r,n,o;const i=H("Stepper",qte,e),{className:a,children:l,onStepClick:c,active:u,icon:d,completedIcon:p,progressIcon:h,color:m,iconSize:v,contentPadding:g,size:b,radius:y,orientation:x,breakpoint:_,iconPosition:w,allowNextStepsSelect:O,classNames:C,styles:P,unstyled:E,variant:k}=i,$=Gte(i,["className","children","onStepClick","active","icon","completedIcon","progressIcon","color","iconSize","contentPadding","size","radius","orientation","breakpoint","iconPosition","allowNextStepsSelect","classNames","styles","unstyled","variant"]),{classes:I,cx:T}=Ute({contentPadding:g,color:m,orientation:x,iconPosition:w,iconSize:v,breakpoint:_},{name:"Stepper",classNames:C,styles:P,unstyled:E,variant:k,size:b}),z=f.Children.toArray(l),M=z.filter(V=>V.type!==Bp),L=z.find(V=>V.type===Bp),q=M.reduce((V,Q,ee)=>{const _e=u===ee?"stepProgress":u>ee?"stepCompleted":"stepInactive",Ue=(()=>typeof c!="function"?!1:typeof Q.props.allowStepSelect=="boolean"?Q.props.allowStepSelect:_e==="stepCompleted"||O)();return V.push(f.cloneElement(Q,{__staticSelector:"Stepper",icon:Q.props.icon||d||ee+1,key:ee,step:ee,variant:k,state:_e,onClick:()=>Ue&&c(ee),allowStepClick:Ue,completedIcon:Q.props.completedIcon||p,progressIcon:Q.props.progressIcon||h,color:Q.props.color||m,iconSize:v,size:b,radius:y,classNames:C,styles:P,iconPosition:Q.props.iconPosition||w,orientation:x,unstyled:E})),x==="horizontal"&&ee!==M.length-1&&V.push(S.createElement("div",{className:T(I.separator,{[I.separatorActive]:ee<u}),key:`separator-${ee}`})),V},[]),Y=(n=(r=M[u])==null?void 0:r.props)==null?void 0:n.children,R=(o=L==null?void 0:L.props)==null?void 0:o.children,N=u>M.length-1?R:Y;return S.createElement(oe,Hte({className:T(I.root,a),ref:t},$),S.createElement("div",{className:I.steps},q),N&&S.createElement("div",{className:I.content},N))});oc.Step=$N;oc.Completed=Bp;oc.displayName="@mantine/core/Stepper";const TN=f.createContext(null),Qte=TN.Provider,Kte=()=>f.useContext(TN);var Yte=Object.defineProperty,Wp=Object.getOwnPropertySymbols,IN=Object.prototype.hasOwnProperty,DN=Object.prototype.propertyIsEnumerable,Cj=(e,t,r)=>t in e?Yte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ej=(e,t)=>{for(var r in t||(t={}))IN.call(t,r)&&Cj(e,r,t[r]);if(Wp)for(var r of Wp(t))DN.call(t,r)&&Cj(e,r,t[r]);return e},Xte=(e,t)=>{var r={};for(var n in e)IN.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&&DN.call(e,n)&&(r[n]=e[n]);return r};const Jte={size:"sm"},NN=f.forwardRef((e,t)=>{const r=H("SwitchGroup",Jte,e),{children:n,value:o,defaultValue:i,onChange:a,size:l,wrapperProps:c}=r,u=Xte(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=$r({value:o,defaultValue:i,finalValue:[],onChange:a}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(Qte,{value:{value:d,onChange:h,size:l}},S.createElement(Ut.Wrapper,Ej(Ej({labelElement:"div",size:l,__staticSelector:"SwitchGroup",ref:t},c),u),n))});NN.displayName="@mantine/core/SwitchGroup";var Zte=Object.defineProperty,ere=Object.defineProperties,tre=Object.getOwnPropertyDescriptors,$j=Object.getOwnPropertySymbols,rre=Object.prototype.hasOwnProperty,nre=Object.prototype.propertyIsEnumerable,kj=(e,t,r)=>t in e?Zte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ore=(e,t)=>{for(var r in t||(t={}))rre.call(t,r)&&kj(e,r,t[r]);if($j)for(var r of $j(t))nre.call(t,r)&&kj(e,r,t[r]);return e},ire=(e,t)=>ere(e,tre(t));const are={xs:j(16),sm:j(20),md:j(24),lg:j(30),xl:j(36)},sre={xs:j(32),sm:j(38),md:j(46),lg:j(56),xl:j(72)},lre={xs:j(12),sm:j(14),md:j(18),lg:j(22),xl:j(28)},cre={xs:j(5),sm:j(6),md:j(7),lg:j(9),xl:j(11)},ure={xs:j(4),sm:j(5),md:j(6),lg:j(8),xl:j(10)};var dre=W((e,{radius:t,color:r,labelPosition:n,error:o},{size:i})=>{const a=A({size:i,sizes:lre}),l=A({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:r}),u=A({size:i,sizes:sre}),d=j(i==="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:ire(ore({},e.fn.focusStyles("input:focus + &")),{cursor:e.cursorType,overflow:"hidden",WebkitTapHighlightColor:"transparent",position:"relative",borderRadius:l,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[2],border:`${j(1)} solid ${o?p:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,height:A({size:i,sizes:are}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:A({size:i,sizes:cre}),fontWeight:600,order:n==="left"?2:1,userSelect:"none",zIndex:0,lineHeight:0,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[6],transition:`color 150ms ${e.transitionTimingFunction}`,"input:checked + &":{backgroundColor:c.background,borderColor:c.background,color:e.white,transition:`color 150ms ${e.transitionTimingFunction}`},"input:disabled + &":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],cursor:"not-allowed",pointerEvents:"none"}}),thumb:{position:"absolute",zIndex:1,borderRadius:l,boxSizing:"border-box",display:"flex",backgroundColor:e.white,height:a,width:a,border:`${j(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% - ${a} - ${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} - ${a})`,paddingInline:A({size:i,sizes:ure}),marginLeft:`calc(${a} + ${d})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${a} + ${d})`}}}});const fre=dre;var pre=Object.defineProperty,hre=Object.defineProperties,mre=Object.getOwnPropertyDescriptors,Hp=Object.getOwnPropertySymbols,AN=Object.prototype.hasOwnProperty,MN=Object.prototype.propertyIsEnumerable,Rj=(e,t,r)=>t in e?pre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jg=(e,t)=>{for(var r in t||(t={}))AN.call(t,r)&&Rj(e,r,t[r]);if(Hp)for(var r of Hp(t))MN.call(t,r)&&Rj(e,r,t[r]);return e},gre=(e,t)=>hre(e,mre(t)),vre=(e,t)=>{var r={};for(var n in e)AN.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&&MN.call(e,n)&&(r[n]=e[n]);return r};const yre={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},tx=f.forwardRef((e,t)=>{var r;const n=H("Switch",yre,e),{className:o,color:i,label:a,offLabel:l,onLabel:c,id:u,style:d,size:p,radius:h,wrapperProps:m,children:v,unstyled:g,styles:b,classNames:y,thumbIcon:x,sx:_,checked:w,defaultChecked:O,onChange:C,labelPosition:P,description:E,error:k,disabled:$,variant:I}=n,T=vre(n,["className","color","label","offLabel","onLabel","id","style","size","radius","wrapperProps","children","unstyled","styles","classNames","thumbIcon","sx","checked","defaultChecked","onChange","labelPosition","description","error","disabled","variant"]),z=Kte(),M=(z==null?void 0:z.size)||p,{classes:L,cx:q}=fre({color:i,radius:h,labelPosition:P,error:!!k},{name:"Switch",classNames:y,styles:b,unstyled:g,size:M,variant:I}),{systemStyles:Y,rest:R}=eo(T),N=Rr(u),V=z?{checked:z.value.includes(R.value),onChange:z.onChange}:{},[Q,ee]=$r({value:(r=V.checked)!=null?r:w,defaultValue:O,finalValue:!1});return S.createElement(Zh,jg(jg({className:q(o,L.root),sx:_,style:d,id:N,size:(z==null?void 0:z.size)||p,labelPosition:P,label:a,description:E,error:k,disabled:$,__staticSelector:"Switch",classNames:y,styles:b,unstyled:g,"data-checked":V.checked||void 0,variant:I},Y),m),S.createElement("input",gre(jg({},R),{disabled:$,checked:Q,onChange:_e=>{z?V.onChange(_e):C==null||C(_e),ee(_e.currentTarget.checked)},id:N,ref:t,type:"checkbox",className:L.input})),S.createElement("label",{htmlFor:N,className:L.track},S.createElement("div",{className:L.thumb},x),S.createElement("div",{className:L.trackLabel},Q?c:l)))});tx.displayName="@mantine/core/Switch";tx.Group=NN;var xre=Object.defineProperty,wre=Object.defineProperties,_re=Object.getOwnPropertyDescriptors,Tj=Object.getOwnPropertySymbols,bre=Object.prototype.hasOwnProperty,Sre=Object.prototype.propertyIsEnumerable,Ij=(e,t,r)=>t in e?xre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pre=(e,t)=>{for(var r in t||(t={}))bre.call(t,r)&&Ij(e,r,t[r]);if(Tj)for(var r of Tj(t))Sre.call(t,r)&&Ij(e,r,t[r]);return e},jre=(e,t)=>wre(e,_re(t)),Ore=W((e,{captionSide:t,horizontalSpacing:r,verticalSpacing:n,fontSize:o,withBorder:i,withColumnBorders:a})=>{const l=`${j(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:jre(Pre({},e.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,border:i?l:void 0,"& > caption":{marginTop:t==="top"?0:e.spacing.xs,marginBottom:t==="bottom"?0:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:A({size:o,sizes:e.fontSizes}),padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:l},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:l},"& > tbody > tr > td":{padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`,borderTop:l,fontSize:A({size:o,sizes:e.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:a?l:"none","&:last-of-type":{borderRight:"none",borderLeft:a?l:"none"}},"& > tbody > tr > th":{borderRight:a?l:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]},"&[data-hover] > tbody > tr":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})})}});const Cre=Ore;var Ere=Object.defineProperty,$re=Object.defineProperties,kre=Object.getOwnPropertyDescriptors,Gp=Object.getOwnPropertySymbols,LN=Object.prototype.hasOwnProperty,zN=Object.prototype.propertyIsEnumerable,Dj=(e,t,r)=>t in e?Ere(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rre=(e,t)=>{for(var r in t||(t={}))LN.call(t,r)&&Dj(e,r,t[r]);if(Gp)for(var r of Gp(t))zN.call(t,r)&&Dj(e,r,t[r]);return e},Tre=(e,t)=>$re(e,kre(t)),Ire=(e,t)=>{var r={};for(var n in e)LN.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&&zN.call(e,n)&&(r[n]=e[n]);return r};const Dre={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},ma=f.forwardRef((e,t)=>{const r=H("Table",Dre,e),{className:n,children:o,striped:i,highlightOnHover:a,captionSide:l,horizontalSpacing:c,verticalSpacing:u,fontSize:d,unstyled:p,withBorder:h,withColumnBorders:m,variant:v}=r,g=Ire(r,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:b,cx:y}=Cre({captionSide:l,verticalSpacing:u,horizontalSpacing:c,fontSize:d,withBorder:h,withColumnBorders:m},{unstyled:p,name:"Table",variant:v});return S.createElement(oe,Tre(Rre({},g),{component:"table",ref:t,className:y(b.root,n),"data-striped":i||void 0,"data-hover":a||void 0}),o)});ma.displayName="@mantine/core/Table";const Yv={context:"Tabs component was not found in the tree",value:"Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value"},[Nre,rx]=ko(Yv.context);var Are=Object.defineProperty,Nj=Object.getOwnPropertySymbols,Mre=Object.prototype.hasOwnProperty,Lre=Object.prototype.propertyIsEnumerable,Aj=(e,t,r)=>t in e?Are(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zre=(e,t)=>{for(var r in t||(t={}))Mre.call(t,r)&&Aj(e,r,t[r]);if(Nj)for(var r of Nj(t))Lre.call(t,r)&&Aj(e,r,t[r]);return e};function Fre({orientation:e,inverted:t,placement:r},n,o){const i=e==="vertical";return o==="default"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${j(2)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="outline"?{[i?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${j(1)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="pills"?{gap:`calc(${n.spacing.sm} / 2)`}:{}}var Vre=W((e,t,{variant:r})=>{const n=t.orientation==="vertical";return{tabsList:zre({display:"flex",flexWrap:"wrap",flexDirection:n?"column":"row",justifyContent:jI[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},Fre(t,e,r))}});const Bre=Vre;var Ure=Object.defineProperty,Wre=Object.defineProperties,Hre=Object.getOwnPropertyDescriptors,qp=Object.getOwnPropertySymbols,FN=Object.prototype.hasOwnProperty,VN=Object.prototype.propertyIsEnumerable,Mj=(e,t,r)=>t in e?Ure(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gre=(e,t)=>{for(var r in t||(t={}))FN.call(t,r)&&Mj(e,r,t[r]);if(qp)for(var r of qp(t))VN.call(t,r)&&Mj(e,r,t[r]);return e},qre=(e,t)=>Wre(e,Hre(t)),Qre=(e,t)=>{var r={};for(var n in e)FN.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&&VN.call(e,n)&&(r[n]=e[n]);return r};const Kre={grow:!1,position:"left"},BN=f.forwardRef((e,t)=>{const r=H("TabsList",Kre,e),{children:n,className:o,grow:i,position:a}=r,l=Qre(r,["children","className","grow","position"]),{orientation:c,variant:u,color:d,radius:p,inverted:h,placement:m,classNames:v,styles:g,unstyled:b}=rx(),{classes:y,cx:x}=Bre({orientation:c,grow:i,color:d,position:a,radius:p,inverted:h,placement:m},{name:"Tabs",unstyled:b,classNames:v,styles:g,variant:u});return S.createElement(oe,qre(Gre({},l),{className:x(y.tabsList,o),ref:t,role:"tablist","aria-orientation":c}),n)});BN.displayName="@mantine/core/TabsList";var Yre=W((e,{orientation:t})=>({panel:{flex:t==="vertical"?1:void 0}}));const Xre=Yre;var Jre=Object.defineProperty,Zre=Object.defineProperties,ene=Object.getOwnPropertyDescriptors,Qp=Object.getOwnPropertySymbols,UN=Object.prototype.hasOwnProperty,WN=Object.prototype.propertyIsEnumerable,Lj=(e,t,r)=>t in e?Jre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tne=(e,t)=>{for(var r in t||(t={}))UN.call(t,r)&&Lj(e,r,t[r]);if(Qp)for(var r of Qp(t))WN.call(t,r)&&Lj(e,r,t[r]);return e},rne=(e,t)=>Zre(e,ene(t)),nne=(e,t)=>{var r={};for(var n in e)UN.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&&WN.call(e,n)&&(r[n]=e[n]);return r};const one={},HN=f.forwardRef((e,t)=>{const r=H("TabsPanel",one,e),{value:n,children:o,sx:i,className:a}=r,l=nne(r,["value","children","sx","className"]),c=rx(),{classes:u,cx:d}=Xre({orientation:c.orientation,color:c.color,radius:c.radius,inverted:c.inverted,placement:c.placement},{name:"Tabs",unstyled:c.unstyled,classNames:c.classNames,styles:c.styles,variant:c.variant}),p=c.getPanelId(n),h=c.value===n,m=c.keepMounted||h?o:null;return f.useEffect(()=>(c.setMountedPanelIds(v=>[...v,p]),c.setMountedPanelIds(v=>v.filter(g=>g!==p))),[p]),S.createElement(oe,rne(tne({},l),{ref:t,sx:[{display:h?void 0:"none"},...dc(i)],className:d(u.panel,a),role:"tabpanel",id:p,"aria-labelledby":c.getTabId(n)}),m)});HN.displayName="@mantine/core/TabsPanel";var ine=Object.defineProperty,ane=Object.defineProperties,sne=Object.getOwnPropertyDescriptors,zj=Object.getOwnPropertySymbols,lne=Object.prototype.hasOwnProperty,cne=Object.prototype.propertyIsEnumerable,Fj=(e,t,r)=>t in e?ine(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qa=(e,t)=>{for(var r in t||(t={}))lne.call(t,r)&&Fj(e,r,t[r]);if(zj)for(var r of zj(t))cne.call(t,r)&&Fj(e,r,t[r]);return e},Vj=(e,t)=>ane(e,sne(t));function une(e,{orientation:t,color:r,radius:n,inverted:o,placement:i},a){const l=t==="vertical",c=e.fn.variant({color:r,variant:"filled"}),u=j(e.fn.radius(n)),d=t==="vertical"?i==="left"?`${u} 0 0 ${u}`:` 0 ${u} ${u} 0`:o?`0 0 ${u} ${u}`:`${u} ${u} 0 0`;return a==="default"?Vj(Qa({[l?i==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:`${j(2)} solid transparent`,[l?i==="left"?"marginRight":"marginLeft":o?"marginTop":"marginBottom"]:j(-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]":Qa({borderColor:c.background,color:e.colorScheme==="dark"?e.white:e.black},e.fn.hover({borderColor:c.background}))}):a==="outline"?{borderRadius:d,border:`${j(1)} solid transparent`,[l?i==="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":j(-1),top:l?0:o?j(-1):"unset",[l?"width":"height"]:j(1),right:l?i==="left"?j(-1):"unset":0,left:l?i==="left"?"unset":j(-1):0}}}:a==="pills"?Vj(Qa({borderRadius:e.fn.radius(n)},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Qa({backgroundColor:c.background,color:e.white},e.fn.hover({backgroundColor:c.background}))}):{}}var dne=W((e,t,{variant:r})=>({tabLabel:{},tab:Qa({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":Qa({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},une(e,t,r)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:j(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:j(7)}}}));const fne=dne;var pne=Object.defineProperty,hne=Object.defineProperties,mne=Object.getOwnPropertyDescriptors,Kp=Object.getOwnPropertySymbols,GN=Object.prototype.hasOwnProperty,qN=Object.prototype.propertyIsEnumerable,Bj=(e,t,r)=>t in e?pne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gne=(e,t)=>{for(var r in t||(t={}))GN.call(t,r)&&Bj(e,r,t[r]);if(Kp)for(var r of Kp(t))qN.call(t,r)&&Bj(e,r,t[r]);return e},vne=(e,t)=>hne(e,mne(t)),yne=(e,t)=>{var r={};for(var n in e)GN.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&&qN.call(e,n)&&(r[n]=e[n]);return r};const xne={},QN=f.forwardRef((e,t)=>{const r=H("TabsTab",xne,e),{value:n,children:o,onKeyDown:i,onClick:a,className:l,icon:c,rightSection:u,color:d}=r,p=yne(r,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),h=rx(),m=!!c,v=!!u,{theme:g,classes:b,cx:y}=fne({withIcon:m||v&&!o,withRightSection:v||m&&!o,orientation:h.orientation,color:d||h.color,radius:h.radius,inverted:h.inverted,placement:h.placement},{name:"Tabs",unstyled:h.unstyled,classNames:h.classNames,styles:h.styles,variant:h.variant}),x=n===h.value,_=h.getPanelId(n),w=h.mountedPanelIds.includes(n)?_:void 0,O=C=>{h.onTabChange(h.allowTabDeactivation&&n===h.value?null:n),a==null||a(C)};return S.createElement(wo,vne(gne({},p),{unstyled:h.unstyled,className:y(b.tab,l),"data-active":x||void 0,ref:t,type:"button",role:"tab",id:h.getTabId(n),"aria-selected":x,tabIndex:x||h.value===null?0:-1,"aria-controls":w,onClick:O,onKeyDown:ZC({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:h.activateTabWithKeyboard,loop:h.loop,dir:g.dir,orientation:h.orientation,onKeyDown:i})}),c&&S.createElement("span",{className:b.tabIcon},c),o&&S.createElement("span",{className:b.tabLabel},o),u&&S.createElement("span",{className:b.tabRightSection},u))});QN.displayName="@mantine/core/Tab";function KN({defaultValue:e,value:t,onTabChange:r,orientation:n,children:o,loop:i,id:a,activateTabWithKeyboard:l,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,placement:m,keepMounted:v=!0,classNames:g,styles:b,unstyled:y}){const x=Rr(a),[_,w]=f.useState([]),[O,C]=$r({value:t,defaultValue:e,finalValue:null,onChange:r});return S.createElement(Nre,{value:{placement:m,value:O,orientation:n,id:x,loop:i,activateTabWithKeyboard:l,getTabId:c1(`${x}-tab`,Yv.value),getPanelId:c1(`${x}-panel`,Yv.value),onTabChange:C,setMountedPanelIds:w,mountedPanelIds:_,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,keepMounted:v,classNames:g,styles:b,unstyled:y}},o)}KN.displayName="@mantine/core/TabsProvider";var wne=W((e,{orientation:t,placement:r})=>({root:{display:t==="vertical"?"flex":void 0,flexDirection:r==="right"?"row-reverse":"row"}}));const _ne=wne;var bne=Object.defineProperty,Sne=Object.defineProperties,Pne=Object.getOwnPropertyDescriptors,Yp=Object.getOwnPropertySymbols,YN=Object.prototype.hasOwnProperty,XN=Object.prototype.propertyIsEnumerable,Uj=(e,t,r)=>t in e?bne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jne=(e,t)=>{for(var r in t||(t={}))YN.call(t,r)&&Uj(e,r,t[r]);if(Yp)for(var r of Yp(t))XN.call(t,r)&&Uj(e,r,t[r]);return e},One=(e,t)=>Sne(e,Pne(t)),Cne=(e,t)=>{var r={};for(var n in e)YN.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&&XN.call(e,n)&&(r[n]=e[n]);return r};const Ene={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},He=f.forwardRef((e,t)=>{const r=H("Tabs",Ene,e),{defaultValue:n,value:o,orientation:i,loop:a,activateTabWithKeyboard:l,allowTabDeactivation:c,children:u,id:d,onTabChange:p,variant:h,color:m,className:v,unstyled:g,classNames:b,styles:y,radius:x,inverted:_,keepMounted:w,placement:O}=r,C=Cne(r,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:P,cx:E}=_ne({orientation:i,color:m,radius:x,inverted:_,placement:O},{unstyled:g,name:"Tabs",classNames:b,styles:y,variant:h});return S.createElement(KN,{activateTabWithKeyboard:l,defaultValue:n,orientation:i,onTabChange:p,value:o,id:d,loop:a,allowTabDeactivation:c,color:m,variant:h,radius:x,inverted:_,keepMounted:w,placement:O,classNames:b,styles:y,unstyled:g},S.createElement(oe,One(jne({},C),{className:E(P.root,v),id:d,ref:t}),u))});He.List=BN;He.Tab=QN;He.Panel=HN;He.displayName="@mantine/core/Tabs";var $ne=Object.defineProperty,kne=Object.defineProperties,Rne=Object.getOwnPropertyDescriptors,Wj=Object.getOwnPropertySymbols,Tne=Object.prototype.hasOwnProperty,Ine=Object.prototype.propertyIsEnumerable,Hj=(e,t,r)=>t in e?$ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dne=(e,t)=>{for(var r in t||(t={}))Tne.call(t,r)&&Hj(e,r,t[r]);if(Wj)for(var r of Wj(t))Ine.call(t,r)&&Hj(e,r,t[r]);return e},Nne=(e,t)=>kne(e,Rne(t));function Ane(e,t,r){return typeof e<"u"?e in r.headings.sizes?r.headings.sizes[e].fontSize:j(e):r.headings.sizes[t].fontSize}function Mne(e,t,r){return typeof e<"u"&&e in r.headings.sizes?r.headings.sizes[e].lineHeight:r.headings.sizes[t].lineHeight}var Lne=W((e,{element:t,weight:r,inline:n},{size:o})=>({root:Nne(Dne({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:r||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:Ane(o,t,e),lineHeight:n?1:Mne(o,t,e),margin:0})}));const zne=Lne;var Fne=Object.defineProperty,Xp=Object.getOwnPropertySymbols,JN=Object.prototype.hasOwnProperty,ZN=Object.prototype.propertyIsEnumerable,Gj=(e,t,r)=>t in e?Fne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vne=(e,t)=>{for(var r in t||(t={}))JN.call(t,r)&&Gj(e,r,t[r]);if(Xp)for(var r of Xp(t))ZN.call(t,r)&&Gj(e,r,t[r]);return e},Bne=(e,t)=>{var r={};for(var n in e)JN.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&&ZN.call(e,n)&&(r[n]=e[n]);return r};const Une={order:1},he=f.forwardRef((e,t)=>{const r=H("Title",Une,e),{className:n,order:o,children:i,unstyled:a,size:l,weight:c,inline:u,variant:d}=r,p=Bne(r,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:h,cx:m}=zne({element:`h${o}`,weight:c,inline:u},{name:"Title",unstyled:a,variant:d,size:l});return[1,2,3,4,5,6].includes(o)?S.createElement(re,Vne({variant:d,component:`h${o}`,ref:t,className:m(h.root,n)},p),i):null});he.displayName="@mantine/core/Title";function Xv(e,t){return Xv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Xv(e,t)}function e5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xv(e,t)}var t5={exports:{}},Wne="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Hne=Wne,Gne=Hne;function r5(){}function n5(){}n5.resetWarningCache=r5;var qne=function(){function e(n,o,i,a,l,c){if(c!==Gne){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:n5,resetWarningCache:r5};return r.PropTypes=r,r};t5.exports=qne();var Qne=t5.exports;const Te=by(Qne),qj={disabled:!1},Jp=S.createContext(null);var xl="unmounted",Ni="exited",Ai="entering",Na="entered",Jv="exiting",No=function(e){e5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=o,l=a&&!a.isMounting?n.enter:n.appear,c;return i.appearStatus=null,n.in?l?(c=Ni,i.appearStatus=Ai):c=Na:n.unmountOnExit||n.mountOnEnter?c=xl:c=Ni,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===xl?{status:Ni}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Ai&&a!==Na&&(i=Ai):(a===Ai||a===Na)&&(i=Jv)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},r.updateStatus=function(o,i){o===void 0&&(o=!1),i!==null?(this.cancelNextCallback(),i===Ai?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===Ni&&this.setState({status:xl})},r.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[og.findDOMNode(this),l],u=c[0],d=c[1],p=this.getTimeouts(),h=l?p.appear:p.enter;if(!o&&!a||qj.disabled){this.safeSetState({status:Na},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Ai},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Na},function(){i.props.onEntered(u,d)})})})},r.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:og.findDOMNode(this);if(!i||qj.disabled){this.safeSetState({status:Ni},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Jv},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:Ni},function(){o.props.onExited(l)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:og.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,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===xl)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=X0(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S.createElement(Jp.Provider,{value:null},typeof a=="function"?a(o,l):S.cloneElement(S.Children.only(a),l))},t}(S.Component);No.contextType=Jp;No.propTypes={};function ka(){}No.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ka,onEntering:ka,onEntered:ka,onExit:ka,onExiting:ka,onExited:ka};No.UNMOUNTED=xl;No.EXITED=Ni;No.ENTERING=Ai;No.ENTERED=Na;No.EXITING=Jv;const Kne=No;function Yne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nx(e,t){var r=function(i){return t&&f.isValidElement(i)?t(i):i},n=Object.create(null);return e&&f.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function Xne(e,t){e=e||{},t=t||{};function r(d){return d in t?t[d]:e[d]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var a,l={};for(var c in t){if(n[c])for(a=0;a<n[c].length;a++){var u=n[c][a];l[n[c][a]]=r(u)}l[c]=r(c)}for(a=0;a<o.length;a++)l[o[a]]=r(o[a]);return l}function Bi(e,t,r){return r[t]!=null?r[t]:e.props[t]}function Jne(e,t){return nx(e.children,function(r){return f.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Bi(r,"appear",e),enter:Bi(r,"enter",e),exit:Bi(r,"exit",e)})})}function Zne(e,t,r){var n=nx(e.children),o=Xne(t,n);return Object.keys(o).forEach(function(i){var a=o[i];if(f.isValidElement(a)){var l=i in t,c=i in n,u=t[i],d=f.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:!0,exit:Bi(a,"exit",e),enter:Bi(a,"enter",e)}):!c&&l&&!d?o[i]=f.cloneElement(a,{in:!1}):c&&l&&f.isValidElement(u)&&(o[i]=f.cloneElement(a,{onExited:r.bind(null,a),in:u.props.in,exit:Bi(a,"exit",e),enter:Bi(a,"enter",e)}))}}),o}var eoe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},toe={component:"div",childFactory:function(t){return t}},ox=function(e){e5(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=i.handleExited.bind(Yne(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}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,i){var a=i.children,l=i.handleExited,c=i.firstRender;return{children:c?Jne(o,l):Zne(o,a,l),firstRender:!1}},r.handleExited=function(o,i){var a=nx(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=rt({},l.children);return delete c[o.key],{children:c}}))},r.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=X0(o,["component","childFactory"]),c=this.state.contextValue,u=eoe(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?S.createElement(Jp.Provider,{value:c},u):S.createElement(Jp.Provider,{value:c},S.createElement(i,l,u))},t}(S.Component);ox.propTypes={};ox.defaultProps=toe;const roe=ox,[noe,$c]=GA("mantine-notifications"),me=$c("show"),ooe=$c("hide"),ioe=$c("clean"),aoe=$c("cleanQueue"),wl=$c("update"),xo={show:me,hide:ooe,clean:ioe,cleanQueue:aoe,update:wl};function soe([e,t],r){const n={};return e==="top"&&(n.top=r),e==="bottom"&&(n.bottom=r),t==="left"&&(n.left=r),t==="right"&&(n.right=r),t==="center"&&(n.left="50%",n.transform="translateX(-50%)"),n}var loe=Object.defineProperty,Qj=Object.getOwnPropertySymbols,coe=Object.prototype.hasOwnProperty,uoe=Object.prototype.propertyIsEnumerable,Kj=(e,t,r)=>t in e?loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yj=(e,t)=>{for(var r in t||(t={}))coe.call(t,r)&&Kj(e,r,t[r]);if(Qj)for(var r of Qj(t))uoe.call(t,r)&&Kj(e,r,t[r]);return e};const Xj={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},doe={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function foe({state:e,maxHeight:t,positioning:r,transitionDuration:n}){const[o,i]=r,a=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:Xj[a],transitionDuration:`${n}ms, ${n}ms, ${n}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},c={opacity:1,transform:doe[a]},u={opacity:0,maxHeight:0,transform:Xj[a]},d={entering:c,entered:c,exiting:u,exited:u};return Yj(Yj({},l),d[e])}function poe(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}var hoe=Object.defineProperty,moe=Object.defineProperties,goe=Object.getOwnPropertyDescriptors,Zp=Object.getOwnPropertySymbols,o5=Object.prototype.hasOwnProperty,i5=Object.prototype.propertyIsEnumerable,Jj=(e,t,r)=>t in e?hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zj=(e,t)=>{for(var r in t||(t={}))o5.call(t,r)&&Jj(e,r,t[r]);if(Zp)for(var r of Zp(t))i5.call(t,r)&&Jj(e,r,t[r]);return e},voe=(e,t)=>moe(e,goe(t)),eO=(e,t)=>{var r={};for(var n in e)o5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zp)for(var n of Zp(e))t.indexOf(n)<0&&i5.call(e,n)&&(r[n]=e[n]);return r};function a5(e){var t=e,{notification:r,autoClose:n,onHide:o,innerRef:i}=t,a=eO(t,["notification","autoClose","onHide","innerRef"]);const l=r,{autoClose:c,message:u}=l,d=eO(l,["autoClose","message"]),p=poe(n,c),h=f.useRef(),m=()=>{o(r.id),window.clearTimeout(h.current)},v=()=>{clearTimeout(h.current)},g=()=>{typeof p=="number"&&(h.current=window.setTimeout(m,p))};return f.useEffect(()=>{typeof r.onOpen=="function"&&r.onOpen(r)},[]),f.useEffect(()=>(g(),v),[n,r.autoClose]),S.createElement($D,voe(Zj(Zj({},d),a),{onClose:m,onMouseEnter:v,onMouseLeave:g,ref:i}),u)}a5.displayName="@mantine/notifications/NotificationContainer";var yoe=W((e,{zIndex:t})=>({notifications:{width:`calc(100% - ${e.spacing.md} * 2)`,boxSizing:"border-box",position:"fixed",zIndex:t},notification:{"&:not(:first-of-type)":{marginTop:e.spacing.sm}}}));const xoe=yoe;var woe=Object.defineProperty,_oe=Object.defineProperties,boe=Object.getOwnPropertyDescriptors,tO=Object.getOwnPropertySymbols,Soe=Object.prototype.hasOwnProperty,Poe=Object.prototype.propertyIsEnumerable,rO=(e,t,r)=>t in e?woe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,joe=(e,t)=>{for(var r in t||(t={}))Soe.call(t,r)&&rO(e,r,t[r]);if(tO)for(var r of tO(t))Poe.call(t,r)&&rO(e,r,t[r]);return e},Ooe=(e,t)=>_oe(e,boe(t));function Coe({limit:e}){const{state:t,queue:r,update:n,cleanQueue:o}=CL({initialValues:[],limit:e});return{notifications:t,queue:r,showNotification:u=>{const d=u.id||kh();return n(p=>u.id&&p.some(h=>h.id===u.id)?p:[...p,Ooe(joe({},u),{id:d})]),d},updateNotification:u=>n(d=>{const p=d.findIndex(m=>m.id===u.id);if(p===-1)return d;const h=[...d];return h[p]=u,h}),hideNotification:u=>n(d=>d.filter(p=>p.id===u?(typeof p.onClose=="function"&&p.onClose(p),!1):!0)),cleanQueue:o,clean:()=>n(()=>[])}}var Eoe=Object.defineProperty,eh=Object.getOwnPropertySymbols,s5=Object.prototype.hasOwnProperty,l5=Object.prototype.propertyIsEnumerable,nO=(e,t,r)=>t in e?Eoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Og=(e,t)=>{for(var r in t||(t={}))s5.call(t,r)&&nO(e,r,t[r]);if(eh)for(var r of eh(t))l5.call(t,r)&&nO(e,r,t[r]);return e},$oe=(e,t)=>{var r={};for(var n in e)s5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&eh)for(var n of eh(e))t.indexOf(n)<0&&l5.call(e,n)&&(r[n]=e[n]);return r};const koe=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],ga=e=>{var t=e,{className:r,position:n="bottom-right",autoClose:o=4e3,transitionDuration:i=250,containerWidth:a=j(440),notificationMaxHeight:l=j(200),limit:c=5,zIndex:u=Cn("overlay"),style:d,children:p,target:h}=t,m=$oe(t,["className","position","autoClose","transitionDuration","containerWidth","notificationMaxHeight","limit","zIndex","style","children","target"]);const v=bL(),g=f.useRef({}),b=f.useRef(0),{notifications:y,showNotification:x,updateNotification:_,hideNotification:w,clean:O,cleanQueue:C}=Coe({limit:c}),{classes:P,cx:E,theme:k}=xoe({zIndex:u}),$=Rh(),T=(k.respectReducedMotion?$:!1)?1:i,z=(koe.includes(n)?n:"bottom-right").split("-");rn(()=>{y.length>b.current&&setTimeout(()=>v(),0),b.current=y.length},[y]),noe({show:x,hide:w,update:_,clean:O,cleanQueue:C});const M=y.map(L=>S.createElement(Kne,{key:L.id,timeout:T,onEnter:()=>g.current[L.id].offsetHeight,nodeRef:{current:g.current[L.id]}},q=>S.createElement(a5,{innerRef:Y=>{g.current[L.id]=Y},notification:L,onHide:w,className:P.notification,autoClose:o,sx:[Og({},foe({state:q,positioning:z,transitionDuration:T,maxHeight:l})),...Array.isArray(L.sx)?L.sx:[L.sx]]})));return S.createElement(C0,{target:h},S.createElement(oe,Og({className:E(P.notifications,r),style:d,sx:Og({maxWidth:a},soe(z,k.spacing.md))},m),S.createElement(roe,null,M)))};ga.displayName="@mantine/notifications/Notifications";ga.show=xo.show;ga.hide=xo.hide;ga.update=xo.update;ga.clean=xo.clean;ga.cleanQueue=xo.cleanQueue;class Roe{constructor(t,r){this.operator=t,this.child=r}toString(){return`${this.operator}(${this.child.toString()})`}}class kc{constructor(t,r,n){this.operator=t,this.left=r,this.right=n}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class Toe{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,r){return this.infixParselets[t]=r,this}registerPrefix(t,r){return this.prefixParselets[t]=r,this}prefix(t,r,n){return this.registerPrefix(t,{parse(o,i){const a=o.consumeAndParse(r);return n(i,a)}})}infixLeft(t,r,n){return this.registerInfix(t,{parse(o,i,a){const l=o.consumeAndParse(r);return n(i,a,l)},precedence:r})}construct(t){return new Ioe(t,this.prefixParselets,this.infixParselets)}}class Ioe{constructor(t,r,n){this.tokens=t,this.prefixParselets=r,this.infixParselets=n}hasMore(){return this.tokens.length>0}match(t){const r=this.peek();return(r==null?void 0:r.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const 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();){const i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const 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){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" at line ${i.line} column ${i.column}.`)}if(r&&((o=this.peek())==null?void 0:o.value)!==r){const i=this.peek();throw Error(`Expected "${r}" but got "${i.value}" at line ${i.line} column ${i.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]}}function dt(e){const t=et(e),r=Co(e);return r===t?{reference:t}:{reference:t,display:r}}function et(e){return wa(e)?e.reference:`${e.resourceType}/${e.id}`}function ix(e){if(e)return wa(e)?e.reference.split("/")[1]:e.id}function Doe(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Co(e){var t;if(Doe(e)){const r=Noe(e);if(r)return r}if(e.resourceType==="Device"){const r=Aoe(e);if(r)return r}return e.resourceType==="Observation"&&"code"in e&&(t=e.code)!=null&&t.text?e.code.text:e.resourceType==="User"&&e.email?e.email:"name"in e&&e.name&&typeof e.name=="string"?e.name:et(e)}function Noe(e){const t=e.name;if(t&&t.length>0)return Rc(t[0])}function Aoe(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function Moe(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const r of t){const n=oO(r);if(n)return n}else return oO(t)}function oO(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function c5(e,t){const r=new Date(e);r.setUTCHours(0,0,0,0);const n=t?new Date(t):new Date;n.setUTCHours(0,0,0,0);const o=r.getUTCFullYear(),i=r.getUTCMonth(),a=r.getUTCDate(),l=n.getUTCFullYear(),c=n.getUTCMonth(),u=n.getUTCDate();let d=l-o;(c<i||c===i&&u<a)&&d--;let p=l*12+c-(o*12+i);u<a&&p--;const h=Math.floor((n.getTime()-r.getTime())/(1e3*60*60*24));return{years:d,months:p,days:h}}function Loe(e,t){const{years:r,months:n,days:o}=c5(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 ax(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(i=>i.url===t[o]);return r}function sr(e,t){return JSON.stringify(e,zoe,t?2:void 0)}function zoe(e,t){return!Foe(e)&&mo(t)?void 0:t}function Foe(e){return!!/\d+$/.exec(e)}function mo(e){if(e==null)return!0;const t=typeof e;return t==="string"&&e===""||t==="object"&&Object.keys(e).length===0}function am(e,t,r){return e===t||mo(e)&&mo(t)?!0:mo(e)||mo(t)?!1:Array.isArray(e)&&Array.isArray(t)?Voe(e,t):Array.isArray(e)||Array.isArray(t)?!1:Lu(e)&&Lu(t)?Boe(e,t,r):(Lu(e)||Lu(t),!1)}function Voe(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!am(e[r],t[r]))return!1;return!0}function Boe(e,t,r){const 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(const o of n){const i=e[o],a=t[o];if(!am(i,a,o))return!1}return!0}function va(e){return JSON.parse(JSON.stringify(e))}function u5(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Lu(e){return e!==null&&typeof e=="object"}const d5=[];for(let e=0;e<256;e++)d5.push(e.toString(16).padStart(2,"0"));function Uoe(e){const t=new Uint8Array(e),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=d5[t[n]];return r.join("")}function Woe(e){const 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 hr(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Hoe(e,t){var r,n;return(n=(r=e.coding)==null?void 0:r.find(o=>o.system===t))==null?void 0:n.code}const iO=e=>new Promise(t=>{setTimeout(t,e)});function Goe(e,t){const r=[];if(e.line&&r.push(...e.line),e.city||e.state||e.postalCode){const 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 Rc(e,t){const r=[];return e.prefix&&(t==null?void 0:t.prefix)!==!1&&r.push(...e.prefix),e.given&&r.push(...e.given),e.family&&r.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&r.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.length===0&&e.text?e.text:r.join(" ").trim()}function sm(e){return e instanceof Date&&!isNaN(e.getTime())}function qoe(e,t,r){if(!e)return"";const n=new Date("2000-01-01T"+e+"Z");return sm(n)?n.toLocaleTimeString(t,r):""}function kr(e,t,r){if(!e)return"";const n=new Date(e);return sm(n)?n.toLocaleString(t,r):""}function Qoe(e,t,r){return!e||!e.start&&!e.end?"":kr(e.start,t,r)+" - "+kr(e.end,t,r)}const Koe={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},Yoe={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},Xoe={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function f5(e){if(!e)return"";const t=[];return Joe(t,e.repeat),e.event&&t.push(e.event.map(r=>kr(r)).join(", ")),hr(t.join(" ").trim())}function Joe(e,t){if(!(t!=null&&t.periodUnit))return;const r=t.frequency??1,n=t.period??1,o=t.periodUnit;r===1&&n===1?e.push(Koe[o]):(r===1?e.push("once"):e.push(r+" times"),n===1?e.push("per "+Yoe[o]):e.push("per "+n+" "+Xoe[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(hr).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>qoe(i)).join(", "))}function ic(e,t,r=!1){if(r&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const 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=tie(n.value,t),`> ${Ko(n,t)}`):`>= ${Ko(n,t)}`:(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)!==void 0?r&&t!==void 0?(o.value=eie(o.value,t),`< ${Ko(o,t)}`):`<= ${Ko(o,t)}`:((n==null?void 0:n.unit)===(o==null?void 0:o.unit)&&(n==null||delete n.unit),`${Ko(n,t)} - ${Ko(o,t)}`)}function Ko(e,t){if(!e)return"";const r=[];return e.comparator&&(r.push(e.comparator),r.push(" ")),e.value!==void 0&&(t!==void 0?r.push(e.value.toFixed(t)):r.push(e.value)),e.unit&&(e.unit!=="%"&&r[r.length-1]!==" "&&r.push(" "),r.push(e.unit)),r.join("").trim()}function Zoe(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ws(e){return e?e.text?e.text:e.coding?e.coding.map(t=>ya(t)).join(", "):"":""}function ya(e){return(e==null?void 0:e.display)??(e==null?void 0:e.code)??""}function p5(e){return e?"component"in e?e.component.map(t=>p5(t)).join(" / "):e.valueQuantity?Ko(e.valueQuantity):e.valueCodeableConcept?ws(e.valueCodeableConcept):e.valueString?e.valueString:"":""}function eie(e,t,r=1){return(h5(e,t)+r)*Math.pow(10,-t)}function tie(e,t,r=1){return(h5(e,t)-r)*Math.pow(10,-t)}function h5(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}function rie(e){const t=e.max&&e.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:e.max;return{path:"",description:"",type:e.type??[],min:e.min??0,max:t??1,isArray:!!t&&t>1,constraints:[]}}function nie(e){const t=Object.create(null);for(const[r,n]of Object.entries(e))t[r]={name:r,elements:Object.fromEntries(Object.entries(n.elements).map(([o,i])=>[o,rie(i)])),constraints:[],innerTypes:[]};return t}const oie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},iie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},aie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"code"}]},text:{type:[{code:"string"}]},line:{max:9007199254740991,type:[{code:"string"}]},city:{type:[{code:"string"}]},district:{type:[{code:"string"}]},state:{type:[{code:"string"}]},postalCode:{type:[{code:"string"}]},country:{type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},sie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},lie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"author[x]":{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]},{code:"string"}]},time:{type:[{code:"dateTime"}]},text:{min:1,type:[{code:"markdown"}]}}},cie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},contentType:{type:[{code:"code"}]},language:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]},url:{type:[{code:"url"}]},size:{type:[{code:"unsignedInt"}]},hash:{type:[{code:"base64Binary"}]},title:{type:[{code:"string"}]},creation:{type:[{code:"dateTime"}]}}},uie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},die={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},fie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},pie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"code"}]},value:{type:[{code:"string"}]},use:{type:[{code:"code"}]},rank:{type:[{code:"positiveInt"}]},period:{type:[{code:"Period"}]}}},hie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{min:1,type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]}}},mie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},gie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},vie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},yie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity"}]},maxDosePerLifetime:{type:[{code:"Quantity"}]}}},xie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},wie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},representation:{max:9007199254740991,type:[{code:"code"}]},sliceName:{type:[{code:"string"}]},sliceIsConstraining:{type:[{code:"boolean"}]},label:{type:[{code:"string"}]},code:{max:9007199254740991,type:[{code:"Coding"}]},slicing:{type:[{code:"ElementDefinitionSlicing"}]},short:{type:[{code:"string"}]},definition:{type:[{code:"markdown"}]},comment:{type:[{code:"markdown"}]},requirements:{type:[{code:"markdown"}]},alias:{max:9007199254740991,type:[{code:"string"}]},min:{type:[{code:"unsignedInt"}]},max:{type:[{code:"string"}]},base:{type:[{code:"ElementDefinitionBase"}]},contentReference:{type:[{code:"uri"}]},type:{max:9007199254740991,type:[{code:"ElementDefinitionType"}]},"defaultValue[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},meaningWhenMissing:{type:[{code:"markdown"}]},orderMeaning:{type:[{code:"string"}]},"fixed[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},"pattern[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},example:{max:9007199254740991,type:[{code:"ElementDefinitionExample"}]},"minValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},"maxValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},maxLength:{type:[{code:"integer"}]},condition:{max:9007199254740991,type:[{code:"id"}]},constraint:{max:9007199254740991,type:[{code:"ElementDefinitionConstraint"}]},mustSupport:{type:[{code:"boolean"}]},isModifier:{type:[{code:"boolean"}]},isModifierReason:{type:[{code:"string"}]},isSummary:{type:[{code:"boolean"}]},binding:{type:[{code:"ElementDefinitionBinding"}]},mapping:{max:9007199254740991,type:[{code:"ElementDefinitionMapping"}]}}},_ie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},description:{type:[{code:"string"}]},name:{type:[{code:"id"}]},language:{min:1,type:[{code:"code"}]},expression:{type:[{code:"string"}]},reference:{type:[{code:"uri"}]}}},bie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"string"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},Sie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:9007199254740991,type:[{code:"string"}]},prefix:{max:9007199254740991,type:[{code:"string"}]},suffix:{max:9007199254740991,type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},Pie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"CodeableConcept"}]},system:{type:[{code:"uri"}]},value:{type:[{code:"string"}]},period:{type:[{code:"Period"}]},assigner:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},jie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},Oie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},Cie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},Eie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},$ie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"code"}]},use:{min:1,type:[{code:"code"}]},min:{type:[{code:"integer"}]},max:{type:[{code:"string"}]},documentation:{type:[{code:"string"}]},type:{min:1,type:[{code:"code"}]},profile:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},kie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},Rie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"age[x]":{type:[{code:"Range"},{code:"CodeableConcept"}]},gender:{type:[{code:"CodeableConcept"}]},race:{type:[{code:"CodeableConcept"}]},physiologicalCondition:{type:[{code:"CodeableConcept"}]}}},Tie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},height:{type:[{code:"Quantity"}]},width:{type:[{code:"Quantity"}]},depth:{type:[{code:"Quantity"}]},weight:{type:[{code:"Quantity"}]},nominalVolume:{type:[{code:"Quantity"}]},externalDiameter:{type:[{code:"Quantity"}]},shape:{type:[{code:"string"}]},color:{max:9007199254740991,type:[{code:"string"}]},imprint:{max:9007199254740991,type:[{code:"string"}]},image:{max:9007199254740991,type:[{code:"Attachment"}]},scoring:{type:[{code:"CodeableConcept"}]}}},Iie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},identifier:{type:[{code:"Identifier"}]},type:{min:1,type:[{code:"CodeableConcept"}]},period:{min:1,type:[{code:"Quantity"}]},specialPrecautionsForStorage:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},Die={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Nie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity"}]},high:{type:[{code:"Quantity"}]}}},Aie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},Mie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},Lie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},label:{type:[{code:"string"}]},display:{type:[{code:"string"}]},citation:{type:[{code:"markdown"}]},url:{type:[{code:"url"}]},document:{type:[{code:"Attachment"}]},resource:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/Resource"]}]}}},zie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity"}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},Fie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,max:9007199254740991,type:[{code:"Coding"}]},when:{min:1,type:[{code:"instant"}]},who:{min:1,type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},onBehalfOf:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},targetFormat:{type:[{code:"code"}]},sigFormat:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]}}},Vie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"amount[x]":{type:[{code:"Quantity"},{code:"Range"},{code:"string"}]},amountType:{type:[{code:"CodeableConcept"}]},amountText:{type:[{code:"string"}]},referenceRange:{type:[{code:"SubstanceAmountReferenceRange"}]}}},Bie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},event:{max:9007199254740991,type:[{code:"dateTime"}]},repeat:{type:[{code:"TimingRepeat"}]},code:{type:[{code:"CodeableConcept"}]}}},Uie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{type:[{code:"string"}]},"timing[x]":{type:[{code:"Timing"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Schedule"]},{code:"date"},{code:"dateTime"}]},data:{max:9007199254740991,type:[{code:"DataRequirement"}]},condition:{type:[{code:"Expression"}]}}},Wie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"Coding"}]},"value[x]":{min:1,type:[{code:"CodeableConcept"},{code:"Quantity"},{code:"Range"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ResearchStudy","http://hl7.org/fhir/StructureDefinition/InsurancePlan","http://hl7.org/fhir/StructureDefinition/HealthcareService","http://hl7.org/fhir/StructureDefinition/Group","http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},Hie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Gie={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},qie={elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},Qie={elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}},Kie={Element:oie,BackboneElement:iie,Address:aie,Age:sie,Annotation:lie,Attachment:cie,CodeableConcept:uie,Coding:die,ContactDetail:fie,ContactPoint:pie,Contributor:hie,Count:mie,DataRequirement:gie,Distance:vie,Dosage:yie,Duration:xie,ElementDefinition:wie,Expression:_ie,Extension:bie,HumanName:Sie,Identifier:Pie,MarketingStatus:jie,Meta:Oie,Money:Cie,Narrative:Eie,ParameterDefinition:$ie,Period:kie,Population:Rie,ProdCharacteristic:Tie,ProductShelfLife:Iie,Quantity:Die,Range:Nie,Ratio:Aie,Reference:Mie,RelatedArtifact:Lie,SampledData:zie,Signature:Fie,SubstanceAmount:Vie,Timing:Bie,TriggerDefinition:Uie,UsageContext:Wie,MoneyQuantity:Hie,SimpleQuantity:Gie,MetadataResource:qie,IdentityProvider:Qie};function ve(e){return[{type:B.boolean,value:e}]}function Zn(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:B.integer,value:e}:typeof e=="number"?{type:B.decimal,value:e}:typeof e=="boolean"?{type:B.boolean,value:e}:typeof e=="string"?{type:B.string,value:e}:an(e)?{type:B.Quantity,value:e}:Ao(e)?{type:e.resourceType,value:e}:{type:B.BackboneElement,value:e}}function ri(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 fr(e,t){if(!e.value)return;const r=xa(e.type,t);return r?Yie(e,t,r):Xie(e,t)}function Yie(e,t,r){const n=r.type;if(!n||n.length===0)return;let o,i="undefined";if(n.length===1)o=e.value[t],i=n[0].code;else for(const l of n){const c=t.replace("[x]","")+hr(l.code);if(c in e.value){o=e.value[c],i=l.code;break}}const a=e.value["_"+t];if(a&&(Array.isArray(o)?o=o.map((l,c)=>a[c]?cO(l??{},a[c]):l):o=cO(o??{},a)),!mo(o))return(i==="Element"||i==="BackboneElement")&&(i=r.type[0].code),Array.isArray(o)?o.map(l=>aO(l,i)):aO(o,i)}function aO(e,t){return t==="Resource"&&Ao(e)&&(t=e.resourceType),{type:t,value:e}}function Xie(e,t){const r=e.value;if(!r||typeof r!="object")return;let n;if(t in r)n=r[t];else for(const o in B){const i=t+hr(o);if(i in r){n=r[i];break}}if(!mo(n))return Array.isArray(n)?n.map(Zn):Zn(n)}function m5(e){const t=[];for(const r of e){let n=!1;for(const o of t)if(ri(y5(r,o))){n=!0;break}n||t.push(r)}return t}function g5(e){return ve(!ri(e))}function v5(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ve(!1):ve(e.every((r,n)=>ri(y5(r,t[n]))))}function y5(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?ve(Math.abs(r-n)<1e-8):an(r)&&an(n)?ve(_5(r,n)):ve(typeof r=="object"&&typeof n=="object"?sx(e,t):r===n)}function x5(e,t){return e.length===0&&t.length===0?ve(!0):e.length!==t.length?ve(!1):(e.sort(sO),t.sort(sO),ve(e.every((r,n)=>ri(Jie(r,t[n])))))}function Jie(e,t){const{type:r,value:n}=e,{type:o,value:i}=t,a=n==null?void 0:n.valueOf(),l=i==null?void 0:i.valueOf();return typeof a=="number"&&typeof l=="number"?ve(Math.abs(a-l)<.01):an(a)&&an(l)?ve(_5(a,l)):ve(r==="Coding"&&o==="Coding"?typeof a!="object"||typeof l!="object"?!1:a.code===l.code&&a.system===l.system:typeof a=="object"&&typeof l=="object"?sx({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function sO(e,t){var o,i;const r=(o=e.value)==null?void 0:o.valueOf(),n=(i=t.value)==null?void 0:i.valueOf();return typeof r=="number"&&typeof n=="number"?r-n:typeof r=="string"&&typeof n=="string"?r.localeCompare(n):0}function w5(e,t){const{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 Zie(r);case"Quantity":return an(r);default:return typeof r=="object"&&(r==null?void 0:r.resourceType)===t}}function Zie(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 _5(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 sx(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r){const i=e[o],a=t[o];if(lO(i)&&lO(a)){if(!sx(i,a))return!1}else if(i!==a)return!1}return!0}function lO(e){return e!==null&&typeof e=="object"}function cO(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}const b5="ok",eae="created",tae="gone",rae="not-modified",nae="not-found",oae="forbidden",iae="accepted",aae={resourceType:"OperationOutcome",id:b5,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},sae={resourceType:"OperationOutcome",id:nae,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},lae={resourceType:"OperationOutcome",id:oae,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function qi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function Rt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function cae(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function lm(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function S5(e){return e.id===b5||e.id===eae||e.id===rae||e.id===iae}function uae(e){return e.id===tae}class Ie extends Error{constructor(t,r){super(P5(t)),this.outcome=t,this.cause=r}}function ct(e){return e instanceof Ie?e.outcome:lm(e)?e:qi(Ee(e))}function Ee(e){return e?typeof e=="string"?e:e instanceof Error?e.message:lm(e)?P5(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function P5(e){var r;const t=((r=e.issue)==null?void 0:r.map(j5))??[];return t.length>0?t.join("; "):"Unknown error"}function j5(e){var r,n;let t;return(r=e.details)!=null&&r.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(n=e.expression)!=null&&n.length&&(t+=` (${e.expression.join(", ")})`),t}function dae(e){return new mae(e).parse()}const ac=nie(Kie);function fae(e){var r;const t=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];for(const n of t)pae(n)}function pae(e){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=dae(e);ac[e.name]=t;for(const r of t.innerTypes)r.parentType=t,ac[r.name]=r}function hae(e){return!!ac[e]}function lx(e){return ac[e]}function O5(e){const t=ac[e];if(!t)throw new Ie(cae(Error("Unknown data type: "+e)));return t}class mae{constructor(t){var r;if(!((r=t.snapshot)!=null&&r.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,url:t.url,kind:t.kind,description:yae(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var r,n,o,i,a;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((r=t.id)!=null&&r.includes(":")){if((n=this.slicingContext)!=null&&n.current){const l=Cg(t,this.slicingContext.path);this.slicingContext.current.elements[l]=this.parseElementDefinition(t)}}else{const l=this.parseElementDefinition(t);this.checkFieldEnter(t,l);let c=this.backboneContext;for(;c;){if((o=t.path)!=null&&o.startsWith(c.path+".")){c.type.elements[Cg(t,c.path)]=l;break}c=c.parent}if(!c){const u=Cg(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,r){this.isInnerType(t)&&this.enterInnerType(t),t.slicing&&!this.slicingContext&&this.enterSlice(t,r)}enterInnerType(t){var r,n,o;for(;this.backboneContext&&!Ra((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:fO(t),description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Ra((n=this.backboneContext)==null?void 0:n.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,r){var n,o,i,a;vae(t)&&!((n=this.peek())!=null&&n.sliceName)||(r.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(a=t.slicing)==null?void 0:a.rules},this.slicingContext={field:r.slicing,path:t.path??""})}checkFieldExit(t=void 0){var r;if(this.backboneContext&&!Ra(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Ra(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),delete this.backboneContext;this.slicingContext&&!Ra(this.slicingContext.path,t==null?void 0:t.path)&&((r=this.slicingContext)!=null&&r.current&&this.slicingContext.field.slices.push(this.slicingContext.current),delete this.slicingContext)}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const r=this.elementIndex[t.contentReference.slice(t.contentReference.indexOf("#")+1)];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var n;const r=this.peek();return!!(Ra(t==null?void 0:t.path,r==null?void 0:r.path)&&((n=t.type)!=null&&n.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){var r;if(!this.slicingContext)throw new Error("Invalid slice start before discriminator: "+t.sliceName);this.slicingContext.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:t.sliceName??"",type:(r=t.type)==null?void 0:r.map(n=>({code:n.code??"",targetProfile:n.targetProfile})),elements:{},min:t.min??0,max:t.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(t.max,10)}}parseElementDefinition(t){var i,a;const r=uO(t.max),n=(i=t.base)!=null&&i.max?uO(t.base.max):r,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((a=t.base)==null?void 0:a.path)||"",min:t.min??0,max:r,isArray:n>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:(t.type??[]).map(l=>({code:["BackboneElement","Element"].includes(l.code)?fO(t):l.code??"",targetProfile:l.targetProfile})),fixed:dO(fr(o,"fixed")),pattern:dO(fr(o,"pattern")),binding:t.binding}}}function uO(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Cg(e,t=""){return gae(e.path,t)}function gae(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Ra(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function dO(e){return Array.isArray(e)&&e.length>0?e[0]:mo(e)?void 0:e}function vae(e){var r,n;const t=(r=e.slicing)==null?void 0:r.discriminator;return!!((n=e.type)!=null&&n.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function yae(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}const B={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function xae(e){for(const t of e.base??[]){let r=gi.types[t];r||(r={searchParamsDetails:{}},gi.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 fO(e){var r,n,o,i;const t=(n=(r=e.type)==null?void 0:r[0])==null?void 0:n.code;return t==="BackboneElement"||t==="Element"?wae((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function wae(e){return e.length===1?e[0]:e.map(hr).join("")}function cx(e){var t;return(t=gi.types[e])==null?void 0:t.searchParams}function _ae(e,t){var r,n;return(n=(r=gi.types[e])==null?void 0:r.searchParams)==null?void 0:n[t]}function th(e){return e.replaceAll("[x]","").split(".").pop().split(/(?=[A-Z])/).map(Sae).join(" ").replace("_"," ").replace(/\s+/g," ")}const bae=new Set(["ID","IP","PKCE","JWKS","URI","URL"]);function Sae(e){const t=e.toUpperCase();return bae.has(t)?t:t.charAt(0)+e.slice(1)}function xa(e,t){const r=lx(e);if(r)return r.elements[t]??r.elements[t+"[x]"]}function Ao(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function wa(e){return!!(e&&typeof e=="object"&&"reference"in e)}const gi={types:{}};function dd(e){if(e.startsWith("T"))return e+"T00:00:00.000Z".substring(e.length);if(e.length<=10)return e;try{return new Date(e).toISOString()}catch{return e}}const sl=()=>[],wr={empty:(e,t)=>ve(t.length===0),exists:(e,t,r)=>ve(r?t.filter(n=>ri(r.eval(e,[n]))).length>0:t.length>0),all:(e,t,r)=>ve(t.every(n=>ri(r.eval(e,[n])))),allTrue:(e,t)=>{for(const r of t)if(!r.value)return ve(!1);return ve(!0)},anyTrue:(e,t)=>{for(const r of t)if(r.value)return ve(!0);return ve(!1)},allFalse:(e,t)=>{for(const r of t)if(r.value)return ve(!1);return ve(!0)},anyFalse:(e,t)=>{for(const r of t)if(!r.value)return ve(!0);return ve(!1)},subsetOf:sl,supersetOf:sl,count:(e,t)=>[{type:B.integer,value:t.length}],distinct:(e,t)=>{const r=[];for(const n of t)r.some(o=>o.value===n.value)||r.push(n);return r},isDistinct:(e,t)=>ve(t.length===wr.distinct(e,t).length),where:(e,t,r)=>t.filter(n=>ri(r.eval(e,[n]))),select:(e,t,r)=>t.map(n=>r.eval(e,[n])).flat(),repeat:sl,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;const 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;const 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;const n=r.eval(e,t),o=[];for(const i of t)!o.some(a=>a.value===i.value)&&n.some(a=>a.value===i.value)&&o.push(i);return o},exclude:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t),o=[];for(const i of t)n.some(a=>a.value===i.value)||o.push(i);return o},union:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return m5([...t,...n])},combine:(e,t,r)=>{if(!r)return t;const n=r.eval(e,t);return[...t,...n]},htmlChecks:(e,t,r)=>[Zn(!0)],iif:(e,t,r,n,o)=>{const i=r.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ri(i)?n.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);if(typeof r=="boolean")return[{type:B.boolean,value:r}];if(typeof r=="number"&&(r===0||r===1))return ve(!!r);if(typeof r=="string"){const n=r.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(n))return ve(!0);if(["false","f","no","n","0","0.0"].includes(n))return ve(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ve(wr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="number"?[{type:B.integer,value:r}]:typeof r=="string"&&/^[+-]?\d+$/.exec(r)?[{type:B.integer,value:parseInt(r,10)}]:typeof r=="boolean"?[{type:B.integer,value:r?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ve(wr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.date,value:dd(r)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ve(wr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:B.dateTime,value:dd(r)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ve(wr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return typeof r=="number"?[{type:B.decimal,value:r}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(r)?[{type:B.decimal,value:parseFloat(r)}]:typeof r=="boolean"?[{type:B.decimal,value:r?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ve(wr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return an(r)?[{type:B.Quantity,value:r}]:typeof r=="number"?[{type:B.Quantity,value:{value:r,unit:"1"}}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(r)?[{type:B.Quantity,value:{value:parseFloat(r),unit:"1"}}]:typeof r=="boolean"?[{type:B.Quantity,value:{value:r?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ve(wr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);return r==null?[]:an(r)?[{type:B.string,value:`${r.value} '${r.unit}'`}]:[{type:B.string,value:r.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ve(wr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:r}]=Bn(t,1);if(typeof r=="string"){const n=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(r);if(n)return[{type:B.time,value:dd("T"+n[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ve(wr.toTime(e,t).length===1),indexOf:(e,t,r)=>Yr((n,o)=>n.indexOf(o),e,t,r),substring:(e,t,r,n)=>Yr((o,i,a)=>{const l=i,c=a?l+a:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,r,n),startsWith:(e,t,r)=>Yr((n,o)=>n.startsWith(o),e,t,r),endsWith:(e,t,r)=>Yr((n,o)=>n.endsWith(o),e,t,r),contains:(e,t,r)=>Yr((n,o)=>n.includes(o),e,t,r),upper:(e,t)=>Yr(r=>r.toUpperCase(),e,t),lower:(e,t)=>Yr(r=>r.toLowerCase(),e,t),replace:(e,t,r,n)=>Yr((o,i,a)=>o.replaceAll(i,a),e,t,r,n),matches:(e,t,r)=>Yr((n,o)=>!!new RegExp(o).exec(n),e,t,r),replaceMatches:(e,t,r,n)=>Yr((o,i,a)=>o.replaceAll(i,a),e,t,r,n),length:(e,t)=>Yr(r=>r.length,e,t),toChars:(e,t)=>Yr(r=>r?r.split(""):void 0,e,t),abs:(e,t)=>zn(Math.abs,e,t),ceiling:(e,t)=>zn(Math.ceil,e,t),exp:(e,t)=>zn(Math.exp,e,t),floor:(e,t)=>zn(Math.floor,e,t),ln:(e,t)=>zn(Math.log,e,t),log:(e,t,r)=>zn((n,o)=>Math.log(n)/Math.log(o),e,t,r),power:(e,t,r)=>zn(Math.pow,e,t,r),round:(e,t)=>zn(Math.round,e,t),sqrt:(e,t)=>zn(Math.sqrt,e,t),truncate:(e,t)=>zn(r=>r|0,e,t),children:sl,descendants:sl,trace:(e,t,r)=>(console.log("trace",t,r),t),now:()=>[{type:B.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:B.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:B.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,r,n,o)=>{var u;const i=wr.toDateTime(e,r.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=wr.toDateTime(e,n.eval(e,t));if(a.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=c5(i[0].value,a[0].value);return[{type:B.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,r)=>{let n="";return r instanceof ux?n=r.name:r instanceof fx&&(n=r.left.name+"."+r.right.name),n?t.map(o=>({type:B.boolean,value:w5(o,n)})):[]},not:(e,t)=>wr.toBoolean(e,t).map(r=>({type:B.boolean,value:!r.value})),resolve:(e,t)=>t.map(r=>{const n=r.value;let o;if(typeof n=="string")o=n;else if(typeof n=="object"){const i=n;if(i.resource)return Zn(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,a]=o.split("/");return{type:i,value:{resourceType:i,id:a}}}return{type:B.BackboneElement,value:void 0}}).filter(r=>!!r.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:r})=>typeof r=="boolean"?{type:B.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof r=="number"?{type:B.BackboneElement,value:{namespace:"System",name:"Integer"}}:Ao(r)?{type:B.BackboneElement,value:{namespace:"FHIR",name:r.resourceType}}:{type:B.BackboneElement,value:null}),conformsTo:(e,t,r)=>{const n=r.eval(e,t)[0].value;if(!n.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=n.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var a;return{type:B.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})}};function Yr(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=Bn(r,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...n.map(a=>{var l;return(l=a==null?void 0:a.eval(t,r)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(Zn):[Zn(i)]}function zn(e,t,r,...n){if(r.length===0)return[];const[{value:o}]=Bn(r,1),i=an(o),a=i?o.value:o;if(typeof a!="number")throw new Error("Math function cannot be called with non-number");const l=e(a,...n.map(d=>{var p;return(p=d.eval(t,r)[0])==null?void 0:p.value})),c=i?B.Quantity:r[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function Bn(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const r of e)if(r==null)throw new Error("Expected non-null argument");return e}class Pae{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()}}class Ta{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class ux{constructor(t){this.name=t}eval(t,r){if(this.name==="$this")return r;if(this.name.startsWith("%")){const 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){const r=t.value;if(!(!r||typeof r!="object"))return Ao(r)&&r.resourceType===this.name?t:fr(t,this.name)}toString(){return this.name}}class jae{eval(){return[]}toString(){return"{}"}}class Oae extends Roe{constructor(t,r,n){super(t,r),this.impl=n}eval(t,r){return this.impl(this.child.eval(t,r))}toString(){return this.operator+this.child.toString()}}class dx extends kc{constructor(t,r){super("as",t,r)}eval(t,r){return wr.ofType(t,this.left.eval(t,r),this.right)}}class Ir extends kc{}class hn extends Ir{constructor(t,r,n,o){super(t,r,n),this.impl=o}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.eval(t,r);if(o.length!==1)return[];const i=n[0].value,a=o[0].value,l=an(i)?i.value:i,c=an(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?ve(u):an(i)?[{type:B.Quantity,value:{...i,value:u}}]:[Zn(u)]}}class Cae extends kc{constructor(t,r){super("&",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r),i=[...n,...o];return i.length>0&&i.every(a=>typeof a.value=="string")?[{type:B.string,value:i.map(a=>a.value).join("")}]:i}}class Eae extends Ir{constructor(t,r){super("contains",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return ve(n.some(i=>i.value===o[0].value))}}class $ae extends Ir{constructor(t,r){super("in",t,r)}eval(t,r){const n=Eo(this.left.eval(t,r)),o=this.right.eval(t,r);return n?ve(o.some(i=>i.value===n.value)):[]}}class fx extends kc{constructor(t,r){super(".",t,r)}eval(t,r){return this.right.eval(t,this.left.eval(t,r))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class C5 extends kc{constructor(t,r){super("|",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return m5([...n,...o])}}class kae extends Ir{constructor(t,r){super("=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return v5(n,o)}}class Rae extends Ir{constructor(t,r){super("!=",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return g5(v5(n,o))}}class Tae extends Ir{constructor(t,r){super("~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return x5(n,o)}}class Iae extends Ir{constructor(t,r){super("!~",t,r)}eval(t,r){const n=this.left.eval(t,r),o=this.right.eval(t,r);return g5(x5(n,o))}}class px extends Ir{constructor(t,r){super("is",t,r)}eval(t,r){const n=this.left.eval(t,r);if(n.length!==1)return[];const o=this.right.name;return ve(w5(n[0],o))}}class Dae extends Ir{constructor(t,r){super("and",t,r)}eval(t,r){const n=Eo(this.left.eval(t,r),"boolean"),o=Eo(this.right.eval(t,r),"boolean");return(n==null?void 0:n.value)===!0&&(o==null?void 0:o.value)===!0?ve(!0):(n==null?void 0:n.value)===!1||(o==null?void 0:o.value)===!1?ve(!1):[]}}class Nae extends Ir{constructor(t,r){super("or",t,r)}eval(t,r){const 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?ve(!1):n!=null&&n.value||o!=null&&o.value?ve(!0):[]}}class Aae extends Ir{constructor(t,r){super("xor",t,r)}eval(t,r){const n=Eo(this.left.eval(t,r),"boolean"),o=Eo(this.right.eval(t,r),"boolean");return!n||!o?[]:ve(n.value!==o.value)}}class Mae extends Ir{constructor(t,r){super("implies",t,r)}eval(t,r){const 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?ve(!0):!n||!o?[]:ve(!1)}}class hx{constructor(t,r){this.name=t,this.args=r}eval(t,r){const n=wr[this.name];if(!n)throw new Error("Unrecognized function: "+this.name);return n(t,r,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class mx{constructor(t,r){this.left=t,this.expr=r}eval(t,r){const n=this.expr.eval(t,r);if(n.length!==1)return[];const o=n[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const i=this.left.eval(t,r);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const Lae=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class zae{constructor(t,r,n,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=r,this.operators=n,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0:o.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const r=this.peek();return t==="/"&&r==="*"?this.consumeMultiLineComment():t==="/"&&r==="/"?this.consumeSingleLineComment():t==="'"||t==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(r)?this.consumeSymbol():this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
88
88
  `))}consumeString(t){this.advance();const r=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),r}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}consumeDateTime(){this.advance();const t=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(t,this.pos.index))}consumeNumber(){const t=this.pos.index;let r="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&Fae(this.peekToken())&&(r="Quantity",this.consumeToken()),this.buildToken(r,this.str.substring(t,this.pos.index)))}consumeSymbol(){var r;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((r=this.prevToken())==null?void 0:r.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),r=this.peek(),n=t+r;return this.operators.includes(n)?(this.advance(),this.advance(),this.buildToken(n,n)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const r=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(r,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
89
- `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,r){const n=this.markStack.pop();if(!n)throw new Error("No mark for token");return{id:t,value:r,...n}}}function Fae(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&Lae.includes(e.value)))}const Vae=["true","false"],Bae=["!=","!~","<=",">=","{}","->"];function Uae(e){return new zae(e,Vae,Bae).tokenize()}const We={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},Wae={parse(e){var r;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((r=e.peek())==null?void 0:r.value)+"`");return t}},Hae={parse(e,t){const r=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new mx(t,r)},precedence:We.Indexer},Gae={parse(e,t){if(!(t instanceof ux))throw new Error("Unexpected parentheses");const r=[];for(;!e.match(")");)r.push(e.consumeAndParse()),e.match(",");return new hx(t.name,r)},precedence:We.FunctionCall};function qae(e){const t=e.split(" "),r=parseFloat(t[0]);let n=t[1];return n!=null&&n.startsWith("'")&&n.endsWith("'")?n=n.substring(1,n.length-1):n="{"+n+"}",{value:r,unit:n}}function Qae(){return new Toe().registerPrefix("String",{parse:(e,t)=>new Ta({type:B.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Ta({type:B.dateTime,value:dd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Ta({type:B.Quantity,value:qae(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Ta({type:B.decimal,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Ta({type:B.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Ta({type:B.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new ux(t.value)}).registerPrefix("{}",{parse:()=>new jae}).registerPrefix("(",Wae).registerInfix("[",Hae).registerInfix("(",Gae).prefix("+",We.UnaryAdd,(e,t)=>new Oae("+",t,r=>r)).prefix("-",We.UnarySubtract,(e,t)=>new hn("-",t,t,(r,n)=>-n)).infixLeft(".",We.Dot,(e,t,r)=>new fx(e,r)).infixLeft("/",We.Divide,(e,t,r)=>new hn("/",e,r,(n,o)=>n/o)).infixLeft("*",We.Multiply,(e,t,r)=>new hn("*",e,r,(n,o)=>n*o)).infixLeft("+",We.Add,(e,t,r)=>new hn("+",e,r,(n,o)=>n+o)).infixLeft("-",We.Subtract,(e,t,r)=>new hn("-",e,r,(n,o)=>n-o)).infixLeft("|",We.Union,(e,t,r)=>new C5(e,r)).infixLeft("=",We.Equals,(e,t,r)=>new kae(e,r)).infixLeft("!=",We.NotEquals,(e,t,r)=>new Rae(e,r)).infixLeft("~",We.Equivalent,(e,t,r)=>new Tae(e,r)).infixLeft("!~",We.NotEquivalent,(e,t,r)=>new Iae(e,r)).infixLeft("<",We.LessThan,(e,t,r)=>new hn("<",e,r,(n,o)=>n<o)).infixLeft("<=",We.LessThanOrEquals,(e,t,r)=>new hn("<=",e,r,(n,o)=>n<=o)).infixLeft(">",We.GreaterThan,(e,t,r)=>new hn(">",e,r,(n,o)=>n>o)).infixLeft(">=",We.GreaterThanOrEquals,(e,t,r)=>new hn(">=",e,r,(n,o)=>n>=o)).infixLeft("&",We.Ampersand,(e,t,r)=>new Cae(e,r)).infixLeft("and",We.And,(e,t,r)=>new Dae(e,r)).infixLeft("as",We.As,(e,t,r)=>new dx(e,r)).infixLeft("contains",We.Contains,(e,t,r)=>new Eae(e,r)).infixLeft("div",We.Divide,(e,t,r)=>new hn("div",e,r,(n,o)=>n/o|0)).infixLeft("in",We.In,(e,t,r)=>new $ae(e,r)).infixLeft("is",We.Is,(e,t,r)=>new px(e,r)).infixLeft("mod",We.Modulo,(e,t,r)=>new hn("mod",e,r,(n,o)=>n%o)).infixLeft("or",We.Or,(e,t,r)=>new Nae(e,r)).infixLeft("xor",We.Xor,(e,t,r)=>new Aae(e,r)).infixLeft("implies",We.Implies,(e,t,r)=>new Mae(e,r))}const Kae=Qae();function E5(e){return new Pae(e,Kae.construct(Uae(e)).consumeAndParse())}function Yae(e,t){const r=Array.isArray(t)?t:[t];for(let n=0;n<r.length;n++){const o=r[n];typeof o=="object"&&"type"in o&&"value"in o||(r[n]=Zn(r[n]))}return gx(e,r).map(n=>n.value)}function gx(e,t,r){const n=r??{};return E5(e).eval({variables:n},t).map(i=>{var a;return{type:i.type,value:(a=i.value)==null?void 0:a.valueOf()}})}var Yo=(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))(Yo||{});function vx(e,t){var n,o;let r=(o=(n=gi.types[e])==null?void 0:n.searchParamsDetails)==null?void 0:o[t.code];return r||(r=Jae(e,t)),r}function Xae(e,t,r){const n=gi.types[e];n.searchParamsDetails||(n.searchParamsDetails={}),n.searchParamsDetails[t]=r}function Jae(e,t){const r=t.code,n=tse(r),o=nse(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Il(l);c.length===1&&c[0]instanceof Ir?i.propertyTypes.add("boolean"):$5(i,Il(l),e,1)}const a={columnName:n,type:rse(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return Xae(e,r,a),a}function $5(e,t,r,n){const o=t[n];if(o instanceof dx){e.propertyTypes.add(o.right.toString());return}if(o instanceof hx){Zae(e,o);return}const i=o.toString(),a=xa(r,i);if(!a)throw new Error(`Element definition not found for ${r} ${i}`);let l=!1,c=n+1;if(c<t.length&&t[c]instanceof mx&&(l=!0,c++),a.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(a);for(const u of a.type)e.propertyTypes.add(u.code);return}for(const u of a.type){let d=u.code;ese(d)&&(d=a.type[0].code),$5(e,t,d,c)}}function Zae(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 px){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function ese(e){return e==="Element"||e==="BackboneElement"}function tse(e){return e.split("-").reduce((t,r,n)=>t+(n?hr(r):r),"")}function rse(e,t){switch(e.type){case"date":return t.size===1&&t.has(B.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(B.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(B.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function nse(e,t){const r=[],n=E5(t);return Zv(e,n.child,r),r}function Zv(e,t,r){t instanceof C5?(Zv(e,t.left,r),Zv(e,t.right,r)):t.toString().startsWith(e+".")&&r.push(t)}function Il(e){return e instanceof dx||e instanceof mx?[Il(e.left),e].flat():e instanceof Ir?[e]:e instanceof fx?[Il(e.left),Il(e.right)].flat():e instanceof hx&&e.name==="where"&&!(e.args[0]instanceof px)?[]:[e]}const Tc=20;var 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||{});const k5={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},yx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function ose(e){let t;for(const r of e.pathname.split("/"))r&&(t=r);return ase(t,e.searchParams.entries())}function ise(e){return ose(new URL(e,"https://example.com/"))}function ase(e,t){const r={resourceType:e};for(const[n,o]of t)sse(r,n,o);return r}function sse(e,t,r){var a,l;let n,o;const i=t.indexOf(":");if(i>=0?(n=t.substring(0,i),o=t.substring(i+1)):(n=t,o=""),n==="_has"||t.includes(".")){Eg(e,{code:t,operator:"eq",value:r});return}switch(n){case"_sort":lse(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":{const c=pO(r);o==="iterate"&&(c.modifier="iterate"),e.include?e.include.push(c):e.include=[c];break}case"_revinclude":{const c=pO(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:{const c=(l=(a=gi.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[n];c?Eg(e,cse(c,o,r)):Eg(e,fse(n,o,r))}}}function lse(e,t){for(const 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 cse(e,t,r){if(t==="missing")return{code:e.code,operator:"missing",value:r};switch(e.type){case"number":case"date":case"quantity":return use(e,r);case"reference":case"string":case"token":case"uri":return dse(e,t,r);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function use(e,t){const{operator:r,value:n}=pse(t);return{code:e.code,operator:r,value:n}}function dse(e,t,r){return{code:e.code,operator:hse(t),value:r}}function fse(e,t,r){var o;let n="eq";if(t)n=t;else if(r.length>=2){const i=r.substring(0,2);i in yx&&(r.length===2||(o=r.at(2))!=null&&o.match(/\d/))&&(n=i,r=r.substring(i.length))}return{code:e,operator:n,value:r}}function pse(e){const t=e.substring(0,2),r=yx[t];return r?{operator:r,value:e.substring(2)}:{operator:"eq",value:e}}function hse(e){return k5[e]??"eq"}function pO(e){const t=e.split(":");if(t.includes("*"))throw new Ie(qi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Ie(qi(`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 Ie(qi(`Invalid include value '${e}'`))}function Eg(e,t){e.filters?e.filters.push(t):e.filters=[t]}function Ka(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(r=>t.push(mse(r))),e.sortRules&&e.sortRules.length>0&&t.push(gse(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(hO("_include",r))),e.revInclude&&e.revInclude.forEach(r=>t.push(hO("_revinclude",r))),t.length===0?"":(t.sort((r,n)=>r.localeCompare(n)),"?"+t.join("&"))}function mse(e){const t=e.operator in k5?":"+e.operator:"",r=e.operator!=="eq"&&e.operator in yx?e.operator:"";return`${e.code}${t}=${r}${encodeURIComponent(e.value)}`}function gse(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function hO(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function vse(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 yse(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 mO(){const e=new Uint32Array(28);return crypto.getRandomValues(e),Uoe(e.buffer)}async function xse(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function R5(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function T5(e){var o,i,a;const t={};e=va(e);for(const l of e.entry||[]){(o=l.resource)==null||delete o.meta;const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=R5(),l.fullUrl="urn:uuid:"+t[c],(a=l.resource)==null||delete a.id)}const 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)=>wse(l,c,t),2);return _se(JSON.parse(n))}function wse(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){const o=r[n];if(o)return"urn:uuid:"+o}}return t}function _se(e){const t=Sse(e),{sorted:r,cycles:n}=bse(t),o={};for(const a of e.entry||[])a.fullUrl&&(o[a.fullUrl]=a);const i=r.map(a=>o[a]);for(const a of n)for(const l of a){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function bse(e){const t=[],r={},n=[];for(const i of Object.keys(e))r[i]=0;function o(i,a){if(r[i]===2)return!0;if(r[i]===1){const c=a.lastIndexOf(i);return c!==-1&&n.push(a.slice(c)),!0}r[i]=1,a.push(i);let l=!1;for(const c of e[i])o(c,a)||(l=!0);return r[i]=2,a.pop(),t.unshift(i),!l}for(const i in e)r[i]===0&&o(i,[]);return{sorted:t,cycles:n}}function I5(e,t){for(const r in e)if(e[r]&&typeof e[r]=="object"){const n=e[r];if(wa(n)){const o=n.reference;o.startsWith("urn:uuid:")&&t(o)}else I5(n,t)}}function Sse(e){const t={};for(const r of e.entry||[])r.fullUrl&&(t[r.fullUrl]=[]);for(const r of e.entry||[]){const n=r.fullUrl;r.resource&&I5(r.resource,o=>{t[o]&&t[o].push(n)})}return t}class Pse{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const 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}}const Qt={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"};class D5{constructor(){this.listeners={}}addEventListener(t,r){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(r)}removeEventListener(t,r){const n=this.listeners[t];if(n){for(let o=0;o<n.length;o++)if(n[o]===r){n.splice(o,1);return}}}dispatchEvent(t){const r=this.listeners[t.type];if(r)for(const n of r)n.call(this,t);return!t.defaultPrevented}}class jse{constructor(){this.emitter=new D5}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,r){this.emitter.addEventListener(t,r)}removeEventListener(t,r){this.emitter.removeEventListener(t,r)}}const ey={"Patient-open":"Patient-open","Patient-close":"Patient-close","ImagingStudy-open":"ImagingStudy-open","ImagingStudy-close":"ImagingStudy-close","Encounter-open":"Encounter-open","Encounter-close":"Encounter-close","DiagnosticReport-open":"DiagnosticReport-open","DiagnosticReport-close":"DiagnosticReport-close","DiagnosticReport-select":"DiagnosticReport-select","DiagnosticReport-update":"DiagnosticReport-update",syncerror:"syncerror"},Ose=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],xx=["DiagnosticReport-update"];function Cse(e){return xx.includes(e)}function Ese(e){if(xx.includes(e))throw new Ie(Rt(`'context.version' is required for '${e}'.`))}const $se={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function kse(e){return Ose.includes(e)}function N5(e){return!!e.endpoint}function gO(e){if(!wx(e))throw new Ie(Rt("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:r,topic:n,events:o}=e,i={"hub.channel.type":t,"hub.mode":r,"hub.topic":n,"hub.events":o.join(",")};return N5(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function wx(e){if(typeof e!="object")return!1;const{channelType:t,mode:r,topic:n,events:o}=e;if(!(t&&r&&n&&o)||typeof n!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||r!=="subscribe"&&r!=="unsubscribe")return!1;for(const i of o)if(!ey[i])return!1;return!(N5(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function vO(e,t,r,n){if(typeof t!="object")throw new Ie(Rt(`context[${r}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new Ie(Rt(`context[${r}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Ie(Rt(`context[${r}] is invalid. Resource must contain a resource type. No resource type found.`));const o=n.resourceType;if(o!=="*"){if(!kse(t.resourceType))throw new Ie(Rt(`context[${r}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new Ie(Rt(`context[${r}] is invalid. context[${r}] for the '${e}' event should contain resource of type ${o}.`))}}function Rse(e,t,r,n,o){if(o.set(t.key,(o.get(t.key)??0)+1),!n.isArray)vO(e,t.resource,r,n);else{const{resources:i}=t;if(!i)throw new Ie(Rt(`context[${r}] is invalid. context[${r}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const a of i)vO(e,a,r,n)}}function Tse(e,t){const r=new Map,n=$se[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!n[i])throw new Ie(Rt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));Rse(e,t[o],o,n[i],r)}for(const[o,i]of Object.entries(n)){if(!(i.optional||r.has(o)))throw new Ie(Rt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(r.get(o)||0)>1)throw new Ie(Rt(`${r.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function yO(e,t,r,n){if(!(e&&typeof e=="string"))throw new Ie(Rt("Must provide a topic."));if(!ey[t])throw new Ie(Rt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(ey).join(", ")}`));if(typeof r!="object")throw new Ie(Rt("context must be a context object or array of context objects."));if(xx.includes(t)&&!n)throw new Ie(Rt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(r)?r:[r];return Tse(t,o),{timestamp:new Date().toISOString(),id:R5(),event:{"hub.topic":e,"hub.event":t,context:o,...n?{"context.versionId":n}:{}}}}class Ise extends jse{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Ie(Rt("Subscription request should contain an endpoint."));if(!wx(t))throw new Ie(Rt("Subscription request failed validation."));const r=new WebSocket(t.endpoint);r.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),r.addEventListener("message",n=>{const o=JSON.parse(n.data);if(o["hub.topic"])return;const i=o;this.dispatchEvent({type:"message",payload:i}),r.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()}))}),r.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=r}disconnect(){this.websocket.close()}}function Dse(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=vse(t),n=Array.from(r).reduce((i,a)=>{const l=("00"+a.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(n);return JSON.parse(o)}function Nse(e){return e.split(".").length===3}function A5(e){const[t,r,n]=e.split(".");return Dse(r)}function Ase(e){try{return typeof A5(e).login_id=="string"}catch{return!1}}var M5;class lo{constructor(t){this[M5]="ReadablePromise",this.status="pending",this.suspender=t.then(r=>(this.status="success",this.response=r,r),r=>{throw this.status="error",this.error=r,r})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,r){return this.suspender.then(t,r)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}M5=Symbol.toStringTag;class Mse{constructor(){this.storage=typeof localStorage<"u"?localStorage:new Lse}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){const r=this.getString(t);return r?JSON.parse(r):void 0}setObject(t,r){this.setString(t,r?sr(r):void 0)}}class Lse{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]}}const zse="2.1.14-4cafb804",Fse=Qt.FHIR_JSON+", */*; q=0.1",Vse="https://api.medplum.com/",Bse=1e3,Use=6e4,xO="Binary/",wO={resourceType:"Device",id:"system",deviceName:[{name:"System"}]};class Wse extends D5{constructor(t){if(super(),t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");if(this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??Hse(),this.storage=(t==null?void 0:t.storage)??new Mse,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=bO((t==null?void 0:t.baseUrl)??Vse),this.fhirBaseUrl=bO(zu(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=zu(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=zu(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=zu(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.cacheTime=(t==null?void 0:t.cacheTime)??Use,this.cacheTime>0?this.requestCache=new Pse((t==null?void 0:t.resourceCacheSize)??Bse):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken)this.setAccessToken(t.accessToken);else{const r=this.getActiveLogin();r&&(this.setAccessToken(r.accessToken,r.refreshToken),this.refreshProfile().catch(console.log))}this.setupStorageListener()}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}clear(){this.storage.clear(),sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var r;t=t.toString(),(r=this.requestCache)==null||r.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const r=this.fhirBaseUrl+t;if(this.requestCache)for(const n of this.requestCache.keys())(n.endsWith(r)||n.includes(r+"?"))&&this.requestCache.delete(n)}get(t,r={}){t=t.toString();const n=this.getCacheEntry(t,r);if(n)return n.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue?o=new Promise((a,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:r,resolve:a,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,r);const i=new lo(o);return this.setCacheEntry(t,i),i}post(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("POST",t,o)}put(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,r,n={}){return t=t.toString(),this.setRequestBody(n,r),this.setRequestContentType(n,Qt.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,n)}delete(t,r){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,r)}async startNewUser(t,r){const{codeChallengeMethod:n,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:n,codeChallenge:o},void 0,r)}async startNewProject(t,r){return this.post("auth/newproject",t,void 0,r)}async startNewPatient(t,r){return this.post("auth/newpatient",t,void 0,r)}async startLogin(t,r){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async startGoogleLogin(t,r){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const n=new URLSearchParams(window.location.search).get("code");if(n)return this.processCode(n);await this.requestAuthorization(t)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,r,n,o,i=!0){let a=o;i&&(a=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,r,n,a,i))}async exchangeExternalAccessToken(t,r){if(r=r??this.clientId,!r)throw new Error("MedplumClient is missing clientId");const n=new URLSearchParams;return n.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),n.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),n.set("client_id",r),n.set("subject_token",t),this.fetchTokens(n)}getExternalAuthRedirectUri(t,r,n,o,i=!0){const a=new URL(t);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",r),a.searchParams.set("redirect_uri",n),a.searchParams.set("scope","openid profile email"),a.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");a.searchParams.set("code_challenge_method",c),a.searchParams.set("code_challenge",l)}return a.toString()}fhirUrl(...t){return new URL(t.join("/"),this.fhirBaseUrl)}fhirSearchUrl(t,r){const n=this.fhirUrl(t);return r&&(n.search=new URLSearchParams(r).toString()),n}search(t,r,n){const o=this.fhirSearchUrl(t,r),i=o.toString()+"-search",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new lo((async()=>{const c=await this.get(o,n);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,r,n){const o=this.fhirSearchUrl(t,r);o.searchParams.set("_count","1"),o.searchParams.sort();const i=o.toString()+"-searchOne",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new lo(this.search(t,o.searchParams,n).then(c=>{var u,d;return(d=(u=c.entry)==null?void 0:u[0])==null?void 0:d.resource}));return this.setCacheEntry(i,l),l}searchResources(t,r,n){const i=this.fhirSearchUrl(t,r).toString()+"-searchResources",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new lo(this.search(t,r,n).then(PO));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,r,n){var i,a;let o=this.fhirSearchUrl(t,r);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,n),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((a=c.entry)!=null&&a.length)&&!u)break;yield PO(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,r,n){const o=this.fhirUrl("ValueSet","$expand");return o.searchParams.set("url",t),o.searchParams.set("filter",r),this.get(o.toString(),n)}getCached(t,r){var o,i;const n=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,r).toString()))==null?void 0:i.value;return n!=null&&n.isOk()?n.read():void 0}getCachedReference(t){const r=t.reference;if(!r)return;if(r==="system")return wO;const[n,o]=r.split("/");if(!(!n||!o))return this.getCached(n,o)}readResource(t,r,n){return this.get(this.fhirUrl(t,r),n)}readReference(t,r){const n=t.reference;if(!n)return new lo(Promise.reject(new Error("Missing reference")));if(n==="system")return new lo(Promise.resolve(wO));const[o,i]=n.split("/");return!o||!i?new lo(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,r)}requestSchema(t){if(hae(t))return Promise.resolve();const r=t+"-requestSchema",n=this.getCacheEntry(r,void 0);if(n)return n.value;const o=new lo((async()=>{const i=`{
89
+ `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,r){const n=this.markStack.pop();if(!n)throw new Error("No mark for token");return{id:t,value:r,...n}}}function Fae(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&Lae.includes(e.value)))}const Vae=["true","false"],Bae=["!=","!~","<=",">=","{}","->"];function Uae(e){return new zae(e,Vae,Bae).tokenize()}const We={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},Wae={parse(e){var r;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((r=e.peek())==null?void 0:r.value)+"`");return t}},Hae={parse(e,t){const r=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new mx(t,r)},precedence:We.Indexer},Gae={parse(e,t){if(!(t instanceof ux))throw new Error("Unexpected parentheses");const r=[];for(;!e.match(")");)r.push(e.consumeAndParse()),e.match(",");return new hx(t.name,r)},precedence:We.FunctionCall};function qae(e){const t=e.split(" "),r=parseFloat(t[0]);let n=t[1];return n!=null&&n.startsWith("'")&&n.endsWith("'")?n=n.substring(1,n.length-1):n="{"+n+"}",{value:r,unit:n}}function Qae(){return new Toe().registerPrefix("String",{parse:(e,t)=>new Ta({type:B.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Ta({type:B.dateTime,value:dd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Ta({type:B.Quantity,value:qae(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Ta({type:B.decimal,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Ta({type:B.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Ta({type:B.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new ux(t.value)}).registerPrefix("{}",{parse:()=>new jae}).registerPrefix("(",Wae).registerInfix("[",Hae).registerInfix("(",Gae).prefix("+",We.UnaryAdd,(e,t)=>new Oae("+",t,r=>r)).prefix("-",We.UnarySubtract,(e,t)=>new hn("-",t,t,(r,n)=>-n)).infixLeft(".",We.Dot,(e,t,r)=>new fx(e,r)).infixLeft("/",We.Divide,(e,t,r)=>new hn("/",e,r,(n,o)=>n/o)).infixLeft("*",We.Multiply,(e,t,r)=>new hn("*",e,r,(n,o)=>n*o)).infixLeft("+",We.Add,(e,t,r)=>new hn("+",e,r,(n,o)=>n+o)).infixLeft("-",We.Subtract,(e,t,r)=>new hn("-",e,r,(n,o)=>n-o)).infixLeft("|",We.Union,(e,t,r)=>new C5(e,r)).infixLeft("=",We.Equals,(e,t,r)=>new kae(e,r)).infixLeft("!=",We.NotEquals,(e,t,r)=>new Rae(e,r)).infixLeft("~",We.Equivalent,(e,t,r)=>new Tae(e,r)).infixLeft("!~",We.NotEquivalent,(e,t,r)=>new Iae(e,r)).infixLeft("<",We.LessThan,(e,t,r)=>new hn("<",e,r,(n,o)=>n<o)).infixLeft("<=",We.LessThanOrEquals,(e,t,r)=>new hn("<=",e,r,(n,o)=>n<=o)).infixLeft(">",We.GreaterThan,(e,t,r)=>new hn(">",e,r,(n,o)=>n>o)).infixLeft(">=",We.GreaterThanOrEquals,(e,t,r)=>new hn(">=",e,r,(n,o)=>n>=o)).infixLeft("&",We.Ampersand,(e,t,r)=>new Cae(e,r)).infixLeft("and",We.And,(e,t,r)=>new Dae(e,r)).infixLeft("as",We.As,(e,t,r)=>new dx(e,r)).infixLeft("contains",We.Contains,(e,t,r)=>new Eae(e,r)).infixLeft("div",We.Divide,(e,t,r)=>new hn("div",e,r,(n,o)=>n/o|0)).infixLeft("in",We.In,(e,t,r)=>new $ae(e,r)).infixLeft("is",We.Is,(e,t,r)=>new px(e,r)).infixLeft("mod",We.Modulo,(e,t,r)=>new hn("mod",e,r,(n,o)=>n%o)).infixLeft("or",We.Or,(e,t,r)=>new Nae(e,r)).infixLeft("xor",We.Xor,(e,t,r)=>new Aae(e,r)).infixLeft("implies",We.Implies,(e,t,r)=>new Mae(e,r))}const Kae=Qae();function E5(e){return new Pae(e,Kae.construct(Uae(e)).consumeAndParse())}function Yae(e,t){const r=Array.isArray(t)?t:[t];for(let n=0;n<r.length;n++){const o=r[n];typeof o=="object"&&"type"in o&&"value"in o||(r[n]=Zn(r[n]))}return gx(e,r).map(n=>n.value)}function gx(e,t,r){const n=r??{};return E5(e).eval({variables:n},t).map(i=>{var a;return{type:i.type,value:(a=i.value)==null?void 0:a.valueOf()}})}var Yo=(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))(Yo||{});function vx(e,t){var n,o;let r=(o=(n=gi.types[e])==null?void 0:n.searchParamsDetails)==null?void 0:o[t.code];return r||(r=Jae(e,t)),r}function Xae(e,t,r){const n=gi.types[e];n.searchParamsDetails||(n.searchParamsDetails={}),n.searchParamsDetails[t]=r}function Jae(e,t){const r=t.code,n=tse(r),o=nse(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Il(l);c.length===1&&c[0]instanceof Ir?i.propertyTypes.add("boolean"):$5(i,Il(l),e,1)}const a={columnName:n,type:rse(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return Xae(e,r,a),a}function $5(e,t,r,n){const o=t[n];if(o instanceof dx){e.propertyTypes.add(o.right.toString());return}if(o instanceof hx){Zae(e,o);return}const i=o.toString(),a=xa(r,i);if(!a)throw new Error(`Element definition not found for ${r} ${i}`);let l=!1,c=n+1;if(c<t.length&&t[c]instanceof mx&&(l=!0,c++),a.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(a);for(const u of a.type)e.propertyTypes.add(u.code);return}for(const u of a.type){let d=u.code;ese(d)&&(d=a.type[0].code),$5(e,t,d,c)}}function Zae(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 px){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function ese(e){return e==="Element"||e==="BackboneElement"}function tse(e){return e.split("-").reduce((t,r,n)=>t+(n?hr(r):r),"")}function rse(e,t){switch(e.type){case"date":return t.size===1&&t.has(B.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(B.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(B.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function nse(e,t){const r=[],n=E5(t);return Zv(e,n.child,r),r}function Zv(e,t,r){t instanceof C5?(Zv(e,t.left,r),Zv(e,t.right,r)):t.toString().startsWith(e+".")&&r.push(t)}function Il(e){return e instanceof dx||e instanceof mx?[Il(e.left),e].flat():e instanceof Ir?[e]:e instanceof fx?[Il(e.left),Il(e.right)].flat():e instanceof hx&&e.name==="where"&&!(e.args[0]instanceof px)?[]:[e]}const Tc=20;var 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||{});const k5={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},yx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function ose(e){let t;for(const r of e.pathname.split("/"))r&&(t=r);return ase(t,e.searchParams.entries())}function ise(e){return ose(new URL(e,"https://example.com/"))}function ase(e,t){const r={resourceType:e};for(const[n,o]of t)sse(r,n,o);return r}function sse(e,t,r){var a,l;let n,o;const i=t.indexOf(":");if(i>=0?(n=t.substring(0,i),o=t.substring(i+1)):(n=t,o=""),n==="_has"||t.includes(".")){Eg(e,{code:t,operator:"eq",value:r});return}switch(n){case"_sort":lse(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":{const c=pO(r);o==="iterate"&&(c.modifier="iterate"),e.include?e.include.push(c):e.include=[c];break}case"_revinclude":{const c=pO(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:{const c=(l=(a=gi.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[n];c?Eg(e,cse(c,o,r)):Eg(e,fse(n,o,r))}}}function lse(e,t){for(const 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 cse(e,t,r){if(t==="missing")return{code:e.code,operator:"missing",value:r};switch(e.type){case"number":case"date":case"quantity":return use(e,r);case"reference":case"string":case"token":case"uri":return dse(e,t,r);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function use(e,t){const{operator:r,value:n}=pse(t);return{code:e.code,operator:r,value:n}}function dse(e,t,r){return{code:e.code,operator:hse(t),value:r}}function fse(e,t,r){var o;let n="eq";if(t)n=t;else if(r.length>=2){const i=r.substring(0,2);i in yx&&(r.length===2||(o=r.at(2))!=null&&o.match(/\d/))&&(n=i,r=r.substring(i.length))}return{code:e,operator:n,value:r}}function pse(e){const t=e.substring(0,2),r=yx[t];return r?{operator:r,value:e.substring(2)}:{operator:"eq",value:e}}function hse(e){return k5[e]??"eq"}function pO(e){const t=e.split(":");if(t.includes("*"))throw new Ie(qi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Ie(qi(`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 Ie(qi(`Invalid include value '${e}'`))}function Eg(e,t){e.filters?e.filters.push(t):e.filters=[t]}function Ka(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(r=>t.push(mse(r))),e.sortRules&&e.sortRules.length>0&&t.push(gse(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(hO("_include",r))),e.revInclude&&e.revInclude.forEach(r=>t.push(hO("_revinclude",r))),t.length===0?"":(t.sort((r,n)=>r.localeCompare(n)),"?"+t.join("&"))}function mse(e){const t=e.operator in k5?":"+e.operator:"",r=e.operator!=="eq"&&e.operator in yx?e.operator:"";return`${e.code}${t}=${r}${encodeURIComponent(e.value)}`}function gse(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function hO(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function vse(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 yse(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 mO(){const e=new Uint32Array(28);return crypto.getRandomValues(e),Uoe(e.buffer)}async function xse(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function R5(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function T5(e){var o,i,a;const t={};e=va(e);for(const l of e.entry||[]){(o=l.resource)==null||delete o.meta;const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=R5(),l.fullUrl="urn:uuid:"+t[c],(a=l.resource)==null||delete a.id)}const 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)=>wse(l,c,t),2);return _se(JSON.parse(n))}function wse(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){const o=r[n];if(o)return"urn:uuid:"+o}}return t}function _se(e){const t=Sse(e),{sorted:r,cycles:n}=bse(t),o={};for(const a of e.entry||[])a.fullUrl&&(o[a.fullUrl]=a);const i=r.map(a=>o[a]);for(const a of n)for(const l of a){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function bse(e){const t=[],r={},n=[];for(const i of Object.keys(e))r[i]=0;function o(i,a){if(r[i]===2)return!0;if(r[i]===1){const c=a.lastIndexOf(i);return c!==-1&&n.push(a.slice(c)),!0}r[i]=1,a.push(i);let l=!1;for(const c of e[i])o(c,a)||(l=!0);return r[i]=2,a.pop(),t.unshift(i),!l}for(const i in e)r[i]===0&&o(i,[]);return{sorted:t,cycles:n}}function I5(e,t){for(const r in e)if(e[r]&&typeof e[r]=="object"){const n=e[r];if(wa(n)){const o=n.reference;o.startsWith("urn:uuid:")&&t(o)}else I5(n,t)}}function Sse(e){const t={};for(const r of e.entry||[])r.fullUrl&&(t[r.fullUrl]=[]);for(const r of e.entry||[]){const n=r.fullUrl;r.resource&&I5(r.resource,o=>{t[o]&&t[o].push(n)})}return t}class Pse{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const 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}}const Qt={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"};class D5{constructor(){this.listeners={}}addEventListener(t,r){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(r)}removeEventListener(t,r){const n=this.listeners[t];if(n){for(let o=0;o<n.length;o++)if(n[o]===r){n.splice(o,1);return}}}dispatchEvent(t){const r=this.listeners[t.type];if(r)for(const n of r)n.call(this,t);return!t.defaultPrevented}}class jse{constructor(){this.emitter=new D5}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,r){this.emitter.addEventListener(t,r)}removeEventListener(t,r){this.emitter.removeEventListener(t,r)}}const ey={"Patient-open":"Patient-open","Patient-close":"Patient-close","ImagingStudy-open":"ImagingStudy-open","ImagingStudy-close":"ImagingStudy-close","Encounter-open":"Encounter-open","Encounter-close":"Encounter-close","DiagnosticReport-open":"DiagnosticReport-open","DiagnosticReport-close":"DiagnosticReport-close","DiagnosticReport-select":"DiagnosticReport-select","DiagnosticReport-update":"DiagnosticReport-update",syncerror:"syncerror"},Ose=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],xx=["DiagnosticReport-update"];function Cse(e){return xx.includes(e)}function Ese(e){if(xx.includes(e))throw new Ie(Rt(`'context.version' is required for '${e}'.`))}const $se={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function kse(e){return Ose.includes(e)}function N5(e){return!!e.endpoint}function gO(e){if(!wx(e))throw new Ie(Rt("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:r,topic:n,events:o}=e,i={"hub.channel.type":t,"hub.mode":r,"hub.topic":n,"hub.events":o.join(",")};return N5(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function wx(e){if(typeof e!="object")return!1;const{channelType:t,mode:r,topic:n,events:o}=e;if(!(t&&r&&n&&o)||typeof n!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||r!=="subscribe"&&r!=="unsubscribe")return!1;for(const i of o)if(!ey[i])return!1;return!(N5(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function vO(e,t,r,n){if(typeof t!="object")throw new Ie(Rt(`context[${r}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new Ie(Rt(`context[${r}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Ie(Rt(`context[${r}] is invalid. Resource must contain a resource type. No resource type found.`));const o=n.resourceType;if(o!=="*"){if(!kse(t.resourceType))throw new Ie(Rt(`context[${r}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new Ie(Rt(`context[${r}] is invalid. context[${r}] for the '${e}' event should contain resource of type ${o}.`))}}function Rse(e,t,r,n,o){if(o.set(t.key,(o.get(t.key)??0)+1),!n.isArray)vO(e,t.resource,r,n);else{const{resources:i}=t;if(!i)throw new Ie(Rt(`context[${r}] is invalid. context[${r}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const a of i)vO(e,a,r,n)}}function Tse(e,t){const r=new Map,n=$se[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!n[i])throw new Ie(Rt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));Rse(e,t[o],o,n[i],r)}for(const[o,i]of Object.entries(n)){if(!(i.optional||r.has(o)))throw new Ie(Rt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(r.get(o)||0)>1)throw new Ie(Rt(`${r.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function yO(e,t,r,n){if(!(e&&typeof e=="string"))throw new Ie(Rt("Must provide a topic."));if(!ey[t])throw new Ie(Rt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(ey).join(", ")}`));if(typeof r!="object")throw new Ie(Rt("context must be a context object or array of context objects."));if(xx.includes(t)&&!n)throw new Ie(Rt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(r)?r:[r];return Tse(t,o),{timestamp:new Date().toISOString(),id:R5(),event:{"hub.topic":e,"hub.event":t,context:o,...n?{"context.versionId":n}:{}}}}class Ise extends jse{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Ie(Rt("Subscription request should contain an endpoint."));if(!wx(t))throw new Ie(Rt("Subscription request failed validation."));const r=new WebSocket(t.endpoint);r.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),r.addEventListener("message",n=>{const o=JSON.parse(n.data);if(o["hub.topic"])return;const i=o;this.dispatchEvent({type:"message",payload:i}),r.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()}))}),r.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=r}disconnect(){this.websocket.close()}}function Dse(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=vse(t),n=Array.from(r).reduce((i,a)=>{const l=("00"+a.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(n);return JSON.parse(o)}function Nse(e){return e.split(".").length===3}function A5(e){const[t,r,n]=e.split(".");return Dse(r)}function Ase(e){try{return typeof A5(e).login_id=="string"}catch{return!1}}var M5;class lo{constructor(t){this[M5]="ReadablePromise",this.status="pending",this.suspender=t.then(r=>(this.status="success",this.response=r,r),r=>{throw this.status="error",this.error=r,r})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,r){return this.suspender.then(t,r)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}M5=Symbol.toStringTag;class Mse{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new Lse)}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){const r=this.getString(t);return r?JSON.parse(r):void 0}setObject(t,r){this.setString(t,r?sr(r):void 0)}}class Lse{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]}}const zse="2.1.15-ab33abfb",Fse=Qt.FHIR_JSON+", */*; q=0.1",Vse="https://api.medplum.com/",Bse=1e3,Use=6e4,xO="Binary/",wO={resourceType:"Device",id:"system",deviceName:[{name:"System"}]};class Wse extends D5{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");if(this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??Hse(),this.storage=(t==null?void 0:t.storage)??new Mse,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=bO((t==null?void 0:t.baseUrl)??Vse),this.fhirBaseUrl=bO(zu(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=zu(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=zu(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=zu(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.cacheTime=(t==null?void 0:t.cacheTime)??Use,this.cacheTime>0?this.requestCache=new Pse((t==null?void 0:t.resourceCacheSize)??Bse):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken)this.setAccessToken(t.accessToken),this.initPromise=Promise.resolve();else if(this.storage.getInitPromise!==void 0){const r=this.storage.getInitPromise(),n=new Promise(o=>{r.then(()=>{this.attemptResumeActiveLogin().then(o).catch(console.error),this.initComplete=!0}).catch(console.error)});this.initPromise=n,this.initComplete=!1}else this.initPromise=this.attemptResumeActiveLogin().catch(console.error);this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}clear(){this.storage.clear(),sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var r;t=t.toString(),(r=this.requestCache)==null||r.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const r=this.fhirBaseUrl+t;if(this.requestCache)for(const n of this.requestCache.keys())(n.endsWith(r)||n.includes(r+"?"))&&this.requestCache.delete(n)}get(t,r={}){t=t.toString();const n=this.getCacheEntry(t,r);if(n)return n.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue?o=new Promise((a,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:r,resolve:a,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,r);const i=new lo(o);return this.setCacheEntry(t,i),i}post(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("POST",t,o)}put(t,r,n,o={}){return t=t.toString(),this.setRequestBody(o,r),n&&this.setRequestContentType(o,n),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,r,n={}){return t=t.toString(),this.setRequestBody(n,r),this.setRequestContentType(n,Qt.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,n)}delete(t,r){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,r)}async startNewUser(t,r){const{codeChallengeMethod:n,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:n,codeChallenge:o},void 0,r)}async startNewProject(t,r){return this.post("auth/newproject",t,void 0,r)}async startNewPatient(t,r){return this.post("auth/newpatient",t,void 0,r)}async startLogin(t,r){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async startGoogleLogin(t,r){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,r)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const n=new URLSearchParams(window.location.search).get("code");if(n)return this.processCode(n);await this.requestAuthorization(t)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,r,n,o,i=!0){let a=o;i&&(a=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,r,n,a,i))}async exchangeExternalAccessToken(t,r){if(r=r??this.clientId,!r)throw new Error("MedplumClient is missing clientId");const n=new URLSearchParams;return n.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),n.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),n.set("client_id",r),n.set("subject_token",t),this.fetchTokens(n)}getExternalAuthRedirectUri(t,r,n,o,i=!0){const a=new URL(t);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",r),a.searchParams.set("redirect_uri",n),a.searchParams.set("scope","openid profile email"),a.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");a.searchParams.set("code_challenge_method",c),a.searchParams.set("code_challenge",l)}return a.toString()}fhirUrl(...t){return new URL(t.join("/"),this.fhirBaseUrl)}fhirSearchUrl(t,r){const n=this.fhirUrl(t);return r&&(n.search=new URLSearchParams(r).toString()),n}search(t,r,n){const o=this.fhirSearchUrl(t,r),i=o.toString()+"-search",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new lo((async()=>{const c=await this.get(o,n);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,r,n){const o=this.fhirSearchUrl(t,r);o.searchParams.set("_count","1"),o.searchParams.sort();const i=o.toString()+"-searchOne",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new lo(this.search(t,o.searchParams,n).then(c=>{var u,d;return(d=(u=c.entry)==null?void 0:u[0])==null?void 0:d.resource}));return this.setCacheEntry(i,l),l}searchResources(t,r,n){const i=this.fhirSearchUrl(t,r).toString()+"-searchResources",a=this.getCacheEntry(i,n);if(a)return a.value;const l=new lo(this.search(t,r,n).then(PO));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,r,n){var i,a;let o=this.fhirSearchUrl(t,r);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,n),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((a=c.entry)!=null&&a.length)&&!u)break;yield PO(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,r,n){const o=this.fhirUrl("ValueSet","$expand");return o.searchParams.set("url",t),o.searchParams.set("filter",r),this.get(o.toString(),n)}getCached(t,r){var o,i;const n=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,r).toString()))==null?void 0:i.value;return n!=null&&n.isOk()?n.read():void 0}getCachedReference(t){const r=t.reference;if(!r)return;if(r==="system")return wO;const[n,o]=r.split("/");if(!(!n||!o))return this.getCached(n,o)}readResource(t,r,n){return this.get(this.fhirUrl(t,r),n)}readReference(t,r){const n=t.reference;if(!n)return new lo(Promise.reject(new Error("Missing reference")));if(n==="system")return new lo(Promise.resolve(wO));const[o,i]=n.split("/");return!o||!i?new lo(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,r)}requestSchema(t){if(hae(t))return Promise.resolve();const r=t+"-requestSchema",n=this.getCacheEntry(r,void 0);if(n)return n.value;const o=new lo((async()=>{const i=`{
90
90
  StructureDefinitionList(name: "${t}") {
91
91
  resourceType,
92
92
  name,
@@ -123,7 +123,7 @@ Error generating stack: `+i.message+`
123
123
  expression,
124
124
  target
125
125
  }
126
- }`.replace(/\s+/g," "),a=await this.graphql(i);fae(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)xae(l)})());return this.setCacheEntry(r,o),o}readHistory(t,r,n){return this.get(this.fhirUrl(t,r,"_history"),n)}readVersion(t,r,n,o){return this.get(this.fhirUrl(t,r,"_history",n),o)}readPatientEverything(t,r){return this.get(this.fhirUrl("Patient",t,"$everything"),r)}createResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,r)}async createResourceIfNoneExist(t,r,n){return await this.searchOne(t.resourceType,r,n)??this.createResource(t,n)}async createAttachment(t,r,n,o){const i=await this.createBinary(t,r,n,o);return{contentType:n,url:i.url,title:r}}createBinary(t,r,n,o){const i=this.fhirUrl("Binary");return r&&i.searchParams.set("_filename",r),o?this.uploadwithProgress(i,t,n,o):this.post(i,t,n)}uploadwithProgress(t,r,n,o){return new Promise((i,a)=>{const l=new XMLHttpRequest;l.responseType="json",l.onabort=()=>a(new Error("Request aborted")),l.onerror=()=>a(new Error("Request error")),o&&(l.upload.onprogress=c=>o(c),l.upload.onload=c=>o(c)),l.onload=()=>{l.status>=200&&l.status<300?i(l.response):a(new Ie(ct(l.response||l.statusText)))},l.open("POST",t),l.withCredentials=!0,l.setRequestHeader("Authorization","Bearer "+this.accessToken),l.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),l.setRequestHeader("Content-Type",n),l.setRequestHeader("X-Medplum","extended"),l.send(r)})}async createPdf(t,r,n,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=await this.createPdfImpl(t,n,o);return this.createBinary(i,r,"application/pdf")}createComment(t,r,n){const o=this.getProfile();let i,a;return t.resourceType==="Encounter"&&(i=dt(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=dt(t)),this.createResource({resourceType:"Communication",basedOn:[dt(t)],encounter:i,subject:a,sender:o?dt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:r}]},n)}async updateResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");this.invalidateSearches(t.resourceType);let n=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,r);return n||(n=t),this.cacheResource(n),n}patchResource(t,r,n,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,r),n,o)}deleteResource(t,r,n){return this.deleteCacheEntry(this.fhirUrl(t,r).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,r),n)}validateResource(t,r){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,r)}executeBot(t,r,n,o){let i;if(typeof t=="string"){const a=t;i=this.fhirUrl("Bot",a,"$execute")}else{const a=t;i=this.fhirUrl("Bot","$execute")+`?identifier=${a.system}|${a.value}`}return this.post(i,r,n,o)}executeBatch(t,r){return this.post(this.fhirBaseUrl.slice(0,-1),t,void 0,r)}sendEmail(t,r){return this.post("email/v1/send",t,Qt.JSON,r)}graphql(t,r,n,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:r,variables:n},Qt.JSON,o)}readResourceGraph(t,r,n,o){return this.get(`${this.fhirUrl(t,r)}/$graph?graph=${n}`,o)}pushToAgent(t,r,n,o,i){return this.post(this.fhirUrl("Agent",ix(t),"$push"),{destination:et(r),body:n,contentType:o},Qt.FHIR_JSON,i)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var r,n;(!((r=this.sessionDetails)!=null&&r.profile)||et(this.sessionDetails.profile)!==((n=t.profile)==null?void 0:n.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}setAccessToken(t,r){this.accessToken=t,this.refreshToken=r,this.sessionDetails=void 0,this.medplumServer=Ase(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const r=this.getLogins().filter(n=>{var o,i;return((o=n.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.reference)});r.push(t),this.storage.setObject("logins",r)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,r)=>{this.get("auth/me").then(n=>{var i,a;this.profilePromise=void 0;const o=((a=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:a.id)!==n.profile.id;this.sessionDetails=n,o&&this.dispatchEvent({type:"change"}),t(n.profile)}).catch(r)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!!this.profilePromise}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,r={}){this.refreshPromise&&await this.refreshPromise;const n=t.toString();return n.startsWith(xO)&&(t=this.fhirUrl(n)),this.addFetchOptionsDefaults(r),(await this.fetchWithRetry(t.toString(),r)).blob()}async uploadMedia(t,r,n,o,i){const a=await this.createBinary(t,n,r);return this.createResource({resourceType:"Media",status:"completed",content:{contentType:r,url:xO+a.id,title:n},...o},i)}async bulkExport(t="",r,n,o){const i=t&&`${t}/`,a=this.fhirUrl(`${i}$export`);return r&&a.searchParams.set("_type",r),n&&a.searchParams.set("_since",n),this.startAsyncRequest(a.toString(),o)}async startAsyncRequest(t,r={}){this.addFetchOptionsDefaults(r);const n=r.headers;n.Prefer="respond-async";const o=await this.fetchWithRetry(t,r);if(o.status===202){const i=await SO(o);if(i)return this.pollStatus(i)}return this.parseResponse(o,"POST",t)}getCacheEntry(t,r){if(!this.requestCache||(r==null?void 0:r.cache)==="no-cache"||(r==null?void 0:r.cache)==="reload")return;const n=this.requestCache.get(t);if(!(!n||n.requestTime+this.cacheTime<Date.now()))return n}setCacheEntry(t,r){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:r})}cacheResource(t){var r,n;t!=null&&t.id&&!((n=(r=t.meta)==null?void 0:r.tag)!=null&&n.some(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new lo(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,r,n={}){this.refreshPromise&&await this.refreshPromise,n.method=t,this.addFetchOptionsDefaults(n);const o=await this.fetchWithRetry(r,n);return this.parseResponse(o,t,r,n)}async parseResponse(t,r,n,o={}){if(t.status===401)return this.handleUnauthenticated(r,n,o);if(t.status===204||t.status===304)return;const i=t.headers.get("content-type"),a=i==null?void 0:i.includes("json");if(t.status===404&&!a)throw new Ie(sae);const l=t.headers.get("content-location"),c=o.redirect??this.options.redirect;if(t.status===201&&l&&c==="follow")return this.request("GET",l,{...o,body:void 0});let u;if(a)try{u=await t.json()}catch(d){throw console.error("Error parsing response",t.status,d),d}else u=await t.text();if(t.status>=400)throw new Ie(ct(u));return u}async fetchWithRetry(t,r){t.startsWith("http")||(t=new URL(t,this.baseUrl).href);const n=3,o=200;let i;for(let a=0;a<n;a++){try{if(this.options.verbose&&this.logRequest(t,r),i=await this.fetch(t,r),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(a,n,l)}await iO(o)}return i}logRequest(t,r){if(console.log(`> ${r.method} ${t}`),r.headers){const n=r.headers,o=Object.entries(n).sort((i,a)=>i[0].localeCompare(a[0]));for(const[i,a]of o)console.log(`> ${i}: ${a}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((r,n)=>console.log(`< ${n}: ${r}`))}async pollStatus(t){let r=!0,n;const o=2e3;for(;r;){const i={};this.addFetchOptionsDefaults(i);const a=await this.fetchWithRetry(t,i);if(a.status!==202&&(r=!1,n=a,a.status===201)){const l=await SO(a);l&&(n=await this.fetchWithRetry(l,i))}await iO(o)}return this.parseResponse(n,"POST",t)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const a=t[0];try{a.resolve(await this.request(a.method,this.fhirBaseUrl+a.url,a.options))}catch(l){a.reject(new Ie(ct(l)))}return}const r={resourceType:"Bundle",type:"batch",entry:t.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},n=await this.post(this.fhirBaseUrl.slice(0,-1),r);for(let a=0;a<t.length;a++){const l=t[a],c=(o=n.entry)==null?void 0:o[a];(i=c==null?void 0:c.response)!=null&&i.outcome&&!S5(c.response.outcome)?l.reject(new Ie(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){let r=t.headers;r||(r={},t.headers=r),r.Accept||(r.Accept=Fse),r["X-Medplum"]="extended",t.body&&!r["Content-Type"]&&(r["Content-Type"]=Qt.FHIR_JSON),this.accessToken?r.Authorization="Bearer "+this.accessToken:this.basicAuth&&(r.Authorization="Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,r){t.headers||(t.headers={});const n=t.headers;n["Content-Type"]=r}setRequestBody(t,r){typeof r=="string"||typeof Blob<"u"&&r instanceof Blob||typeof File<"u"&&r instanceof File||typeof Uint8Array<"u"&&r instanceof Uint8Array?t.body=r:r&&(t.body=JSON.stringify(r))}handleUnauthenticated(t,r,n){return this.refresh()?this.request(t,r,n):(this.clearActiveLogin(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=mO();sessionStorage.setItem("pkceState",t);const r=mO();sessionStorage.setItem("codeVerifier",r);const n=await xse(r),o=Woe(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}async requestAuthorization(t){const r=await this.ensureCodeChallenge(t??{}),n=new URL(this.authorizeUrl);n.searchParams.set("response_type","code"),n.searchParams.set("state",sessionStorage.getItem("pkceState")),n.searchParams.set("client_id",r.clientId??this.clientId),n.searchParams.set("redirect_uri",r.redirectUri??_O()),n.searchParams.set("code_challenge_method",r.codeChallengeMethod),n.searchParams.set("code_challenge",r.codeChallenge),n.searchParams.set("scope",r.scope??"openid profile"),window.location.assign(n.toString())}processCode(t,r){const n=new URLSearchParams;if(n.set("grant_type","authorization_code"),n.set("code",t),n.set("client_id",(r==null?void 0:r.clientId)??this.clientId),n.set("redirect_uri",(r==null?void 0:r.redirectUri)??_O()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&n.set("code_verifier",o)}return this.fetchTokens(n)}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,r){this.clientId=t,this.clientSecret=r;const n=new URLSearchParams;return n.set("grant_type","client_credentials"),n.set("client_id",t),n.set("client_secret",r),this.fetchTokens(n)}async startJwtBearerLogin(t,r,n){this.clientId=t;const o=new URLSearchParams;return o.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),o.set("client_id",t),o.set("assertion",r),o.set("scope",n),this.fetchTokens(o)}async startJwtAssertionLogin(t){const r=new URLSearchParams;return r.append("grant_type","client_credentials"),r.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),r.append("client_assertion",t),this.fetchTokens(r)}setBasicAuth(t,r){this.clientId=t,this.clientSecret=r,this.basicAuth=yse(t+":"+r)}async fhircastSubscribe(t,r){if(!(typeof t=="string"&&t!==""))throw new Ie(Rt("Invalid topic provided. Topic must be a valid string."));if(!(typeof r=="object"&&Array.isArray(r)&&r.length>0))throw new Ie(Rt("Invalid events provided. Events must be an array of event names containing at least one event."));const n={channelType:"websocket",mode:"subscribe",topic:t,events:r},i=(await this.post("/fhircast/STU3",gO(n),Qt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return n.endpoint=i,n}async fhircastUnsubscribe(t){if(!wx(t))throw new Ie(Rt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Ie(Rt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",gO(t),Qt.FORM_URL_ENCODED)}fhircastConnect(t){return new Ise(t)}async fhircastPublish(t,r,n,o){return Cse(r)?this.post(`/fhircast/STU3/${t}`,yO(t,r,n,o),Qt.JSON):(Ese(r),this.post(`/fhircast/STU3/${t}`,yO(t,r,n),Qt.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,r){return this.post("admin/projects/"+t+"/invite",r)}async fetchTokens(t){const r={method:"POST",headers:{"Content-Type":Qt.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},n=r.headers;this.basicAuth&&(n.Authorization=`Basic ${this.basicAuth}`);const o=await this.fetchWithRetry(this.tokenUrl,r);if(!o.ok){this.clearActiveLogin();try{const a=await o.json();throw new Ie(qi(a.error_description))}catch(a){throw new Ie(qi("Failed to fetch tokens"),a)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const r=t.access_token;if(Nse(r)){const n=A5(r);if(Date.now()>=n.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(n.cid){if(n.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&n.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:r,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}setupStorageListener(){try{window.addEventListener("storage",t=>{(t.key===null||t.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(t,r,n){if(n.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=r-1)throw n}}function Hse(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function _O(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function bO(e){return e.endsWith("/")?e:e+"/"}function zu(e,t){return new URL(t,e).toString()}async function SO(e){var o,i;const t=e.headers.get("content-location");if(t)return t;const r=e.headers.get("location");if(r)return r;const n=await e.json();if(lm(n)&&((i=(o=n.issue)==null?void 0:o[0])!=null&&i.diagnostics))return n.issue[0].diagnostics}function PO(e){var r;const t=((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];return Object.assign(t,{bundle:e})}var L5=f.createContext(void 0);function cm(){return f.useContext(L5)}function ae(){return cm().medplum}function um(){return cm().navigate}function _x(){return cm().profile}function Gse(e){let t=e.medplum,r=e.navigate??qse,[n,o]=f.useState({profile:t.getProfile(),loading:!1});f.useEffect(()=>{function a(){o({...n,profile:t.getProfile()})}return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[t,n]);let i=f.useMemo(()=>({...n,medplum:t,navigate:r}),[n,t,r]);return S.createElement(L5.Provider,{value:i},e.children)}function qse(e){window.location.assign(e)}function Ke(e,t){let r=ae(),[n,o]=f.useState(jO(r,e)),i=f.useCallback(a=>{am(a,n)||o(a)},[n,o]);return f.useEffect(()=>{i(jO(r,e))},[r,e,i]),f.useEffect(()=>{let a=!0;return wa(e)&&r.readReference(e).then(l=>{a&&i(l)}).catch(l=>{a&&(i(void 0),t&&t(ct(l)))}),()=>a=!1},[r,n,e,i,t]),n}function jO(e,t){if(t){if(Ao(t))return t;if(wa(t))return e.getCachedReference(t)}}function Qse(e,t){return z5("searchOne",e,t)}function _s(e,t){return z5("searchResources",e,t)}function z5(e,t,r){let n=ae(),[o,i]=f.useState(),[a,l]=f.useState(!1),[c,u]=f.useState(),[d,p]=f.useState();return f.useEffect(()=>{let h=n.fhirSearchUrl(t,r).toString();h!==o&&(i(h),n[e](t,r).then(m=>{l(!1),u(m),p(aae)}).catch(m=>{l(!1),u(void 0),p(ct(m))}))},[n,e,t,r,o,u]),[c,a,d]}function Kse(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Goe(t)}):null}function OO(e,t){return e.line&&e.line.length>t?e.line[t]:""}function CO(e,t,r){const n=e.line||[];for(;n.length<=t;)n.push("");return n[t]=r,{...e,line:n}}function Yse(e){const[t,r]=f.useState(e.defaultValue||{}),n=f.useRef();n.current=t;function o(h){r(h),e.onChange&&e.onChange(h)}function i(h){o({...n.current,use:h})}function a(h){o({...n.current,type:h})}function l(h){o(CO(n.current||{},0,h))}function c(h){o(CO(n.current||{},1,h))}function u(h){o({...n.current,city:h})}function d(h){o({...n.current,state:h})}function p(h){o({...n.current,postalCode:h})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ft,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>a(h.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(le,{placeholder:"Line 1",defaultValue:OO(t,0),onChange:h=>l(h.currentTarget.value)}),s.jsx(le,{placeholder:"Line 2",defaultValue:OO(t,1),onChange:h=>c(h.currentTarget.value)}),s.jsx(le,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),s.jsx(le,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),s.jsx(le,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>p(h.currentTarget.value)})]})}function Xse(e){const t=_x(),[r,n]=f.useState(e.defaultValue||{}),o=f.useRef();o.current=r;function i(a){const l=a?{text:a,authorReference:t&&dt(t),time:new Date().toISOString()}:{};n(l),e.onChange&&e.onChange(l)}return s.jsx(le,{name:e.name,placeholder:"Annotation text",defaultValue:r.text,onChange:a=>i(a.currentTarget.value)})}var Jse={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"},Zse=Object.defineProperty,ele=Object.defineProperties,tle=Object.getOwnPropertyDescriptors,rh=Object.getOwnPropertySymbols,F5=Object.prototype.hasOwnProperty,V5=Object.prototype.propertyIsEnumerable,EO=(e,t,r)=>t in e?Zse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$O=(e,t)=>{for(var r in t||(t={}))F5.call(t,r)&&EO(e,r,t[r]);if(rh)for(var r of rh(t))V5.call(t,r)&&EO(e,r,t[r]);return e},rle=(e,t)=>ele(e,tle(t)),nle=(e,t)=>{var r={};for(var n in e)F5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rh)for(var n of rh(e))t.indexOf(n)<0&&V5.call(e,n)&&(r[n]=e[n]);return r},ue=(e,t,r)=>{const n=f.forwardRef((o,i)=>{var a=o,{color:l="currentColor",size:c=24,stroke:u=2,children:d}=a,p=nle(a,["color","size","stroke","children"]);return f.createElement("svg",$O(rle($O({ref:i},Jse),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),p),[...r.map(([h,m])=>f.createElement(h,m)),...d||[]])});return n.propTypes={color:Te.string,size:Te.oneOfType([Te.string,Te.number]),stroke:Te.oneOfType([Te.string,Te.number])},n.displayName=`${t}`,n},ole=ue("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"}]]),dm=ue("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"}]]),ile=ue("arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]),ale=ue("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]),sle=ue("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"}]]),lle=ue("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"}]]),cle=ue("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"}]]),ule=ue("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"}]]),dle=ue("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"}]]),fle=ue("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"}]]),ple=ue("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"}]]),hle=ue("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"}]]),Ti=ue("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"}]]),fm=ue("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),mle=ue("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"}]]),gle=ue("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),nh=ue("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"}]]),bx=ue("circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]),Sx=ue("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"}]]),vle=ue("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"}]]),yle=ue("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"}]]),xle=ue("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"}]]),wle=ue("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"}]]),_le=ue("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"}]]),ble=ue("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"}]]),pm=ue("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"}]]),hm=ue("equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]),kO=ue("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"}]]),Sle=ue("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"}]]),Ple=ue("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"}]]),jle=ue("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"}]]),Ole=ue("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"}]]),Cle=ue("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"}]]),Ele=ue("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"}]]),$le=ue("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"}]]),kle=ue("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"}]]),B5=ue("math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]),U5=ue("math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]),Rle=ue("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"}]]),Tle=ue("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"}]]),Ile=ue("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"}]]),Dle=ue("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"}]]),Nle=ue("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"}]]),Ale=ue("player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]),Mle=ue("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),Lle=ue("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"}]]),zle=ue("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"}]]),Fle=ue("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"}]]),Vle=ue("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"}]]),ty=ue("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"}]]),Px=ue("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"}]]),jx=ue("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"}]]),Ble=ue("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"}]]),Ule=ue("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"}]]),Wle=ue("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"}]]),Hle=ue("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"}]]),W5=ue("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"}]]),RO=ue("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"}]]),Gle=ue("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"}]]),oh=ue("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);class H5 extends S.Component{constructor(t){super(t),this.state={}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("Uncaught error:",t,r)}render(){return this.state.error?s.jsx(_c,{icon:s.jsx(dm,{size:16}),title:"Something went wrong",color:"red",children:Ee(this.state.error)}):this.props.children}}function On(){return s.jsx(or,{style:{width:"100%",height:"100vh"},children:s.jsx(cn,{})})}function Ox(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Rc(t,e.options)}):null}function st(e){e.preventDefault(),e.stopPropagation()}function G5(e){if(TO(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&TO(t[0]))return!0}return!1}function TO(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function ke(e){const t=um(),{to:r,suffix:n,label:o,onClick:i,children:a,...l}=e;let c=qle(r);return n&&(c+="/"+n),s.jsx(Le,{href:c,"aria-label":o,onClick:u=>{st(u),i?i(u):r&&t(c)},...l,children:a})}function qle(e){if(e){if(typeof e=="string")return Qle(e);if(Ao(e))return Kle(e);if(wa(e))return Yle(e)}return"#"}function Qle(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Kle(e){return`/${e.resourceType}/${e.id}`}function Yle(e){return`/${e.reference}`}function vi(e){const t=Ke(e.value),r=t?Co(t):e.alt??"",n=(t&&Moe(t))??e.src,o=e.radius??"xl",i={...e};return delete i.value,delete i.link,e.link?s.jsx(ke,{to:t,children:s.jsx(Cf,{src:n,alt:r,radius:o,...i})}):s.jsx(Cf,{src:n,alt:r,radius:o,...i})}function Cx(e){const{defaultValue:t,toKey:r,toOption:n,loadOptions:o,onChange:i,onCreate:a,creatable:l,...c}=e,u=Xle(t),d=f.useRef(null),[p,h]=f.useState(),[m,v]=f.useState(),[g,b]=f.useState(),[y,x]=f.useState(),[_,w]=f.useState(u.map(n)),[O,C]=f.useState([]),P=f.useRef();P.current=p;const E=f.useRef();E.current=m;const k=f.useRef();k.current=g;const $=f.useRef();$.current=y;const I=f.useRef();I.current=O;const T=f.useCallback(()=>{var V;v(void 0);const R=((V=d.current)==null?void 0:V.value.trim())||"";if(R===P.current)return;h(R);const N=new AbortController;b(N),o(R,N.signal).then(Q=>{N.signal.aborted||(C(Q.map(n)),b(void 0),$.current&&(Q.length>0&&i(Q.slice(0,1)),x(!1)))}).catch(Q=>{N.signal.aborted||Q.message.includes("aborted")||me({color:"red",message:Ee(Q)})})},[o,i,n]),z=f.useCallback(()=>{k.current&&(k.current.abort(),b(void 0)),E.current!==void 0&&window.clearTimeout(E.current);const R=window.setTimeout(()=>T(),100);v(R)},[T]),M=f.useCallback(R=>{var Q;const N=[],V=[];for(const ee of R){let _e=(Q=I.current)==null?void 0:Q.find(Ue=>Ue.value===ee),we=_e==null?void 0:_e.resource;!we&&l!==!1&&a&&(we=a(ee),_e=n(we)),we&&N.push(we),_e&&V.push(_e)}i(N),w(V)},[l,i,a,n]),L=f.useCallback(R=>{R.key==="Enter"&&(!E.current&&!k.current?(st(R),I.current&&I.current.length>0&&(C(I.current.slice(0,1)),M([I.current[0].value]))):x(!0))},[M]),q=f.useCallback(R=>{const N=n(a(R));return C([...I.current,N]),N},[a,C,n]),Y=f.useCallback((R,N)=>!N,[]);return f.useEffect(()=>()=>{k.current&&k.current.abort()},[]),s.jsx(em,{...c,ref:d,defaultValue:u.map(r),searchable:!0,onKeyDown:L,onSearchChange:z,data:[..._,...O],onFocus:T,onChange:M,onCreate:q,rightSectionWidth:40,rightSection:g?s.jsx(cn,{size:16}):null,filter:Y,creatable:!0,withinPortal:!0})}function Xle(e){return e?Array.isArray(e)?e:[e]:[]}const Jle=W(()=>({searchInput:{input:{width:220,transition:"width 0.2s"},"input:focus":{width:400},"@media (max-width: 800px)":{input:{width:150},"input:focus":{width:150}}}}));function Zle(e){return e.id}function ece(e){return{value:e.id,label:Co(e),resource:e}}function tce(e){const{classes:t}=Jle(),r=um(),n=ae(),o=f.useCallback(async(a,l)=>{const c=nce(a),u={signal:l},d=await n.graphql(c,void 0,void 0,u);return oce(d,a)},[n]),i=f.useCallback(a=>{a.length>0&&r(`/${et(a[0])}`)},[r]);return s.jsx(Cx,{size:"sm",radius:"md",className:t.searchInput,icon:s.jsx(Vle,{size:16}),placeholder:"Search",itemComponent:rce,toKey:Zle,toOption:ece,onChange:i,loadOptions:o,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const rce=f.forwardRef(({resource:e,...t},r)=>{var o;let n;return e.resourceType==="Patient"?n=e.birthDate:e.resourceType==="ServiceRequest"&&(n=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...t,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(vi,{value:e}),s.jsxs("div",{children:[s.jsx(re,{children:Co(e)}),s.jsx(re,{size:"xs",color:"dimmed",children:n})]})]})})});function nce(e){const t=JSON.stringify(e);return u5(e)?`{
126
+ }`.replace(/\s+/g," "),a=await this.graphql(i);fae(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)xae(l)})());return this.setCacheEntry(r,o),o}readHistory(t,r,n){return this.get(this.fhirUrl(t,r,"_history"),n)}readVersion(t,r,n,o){return this.get(this.fhirUrl(t,r,"_history",n),o)}readPatientEverything(t,r){return this.get(this.fhirUrl("Patient",t,"$everything"),r)}createResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,r)}async createResourceIfNoneExist(t,r,n){return await this.searchOne(t.resourceType,r,n)??this.createResource(t,n)}async createAttachment(t,r,n,o){const i=await this.createBinary(t,r,n,o);return{contentType:n,url:i.url,title:r}}createBinary(t,r,n,o){const i=this.fhirUrl("Binary");return r&&i.searchParams.set("_filename",r),o?this.uploadwithProgress(i,t,n,o):this.post(i,t,n)}uploadwithProgress(t,r,n,o){return new Promise((i,a)=>{const l=new XMLHttpRequest;l.responseType="json",l.onabort=()=>a(new Error("Request aborted")),l.onerror=()=>a(new Error("Request error")),o&&(l.upload.onprogress=c=>o(c),l.upload.onload=c=>o(c)),l.onload=()=>{l.status>=200&&l.status<300?i(l.response):a(new Ie(ct(l.response||l.statusText)))},l.open("POST",t),l.withCredentials=!0,l.setRequestHeader("Authorization","Bearer "+this.accessToken),l.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),l.setRequestHeader("Content-Type",n),l.setRequestHeader("X-Medplum","extended"),l.send(r)})}async createPdf(t,r,n,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=await this.createPdfImpl(t,n,o);return this.createBinary(i,r,"application/pdf")}createComment(t,r,n){const o=this.getProfile();let i,a;return t.resourceType==="Encounter"&&(i=dt(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=dt(t)),this.createResource({resourceType:"Communication",basedOn:[dt(t)],encounter:i,subject:a,sender:o?dt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:r}]},n)}async updateResource(t,r){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");this.invalidateSearches(t.resourceType);let n=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,r);return n||(n=t),this.cacheResource(n),n}patchResource(t,r,n,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,r),n,o)}deleteResource(t,r,n){return this.deleteCacheEntry(this.fhirUrl(t,r).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,r),n)}validateResource(t,r){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,r)}executeBot(t,r,n,o){let i;if(typeof t=="string"){const a=t;i=this.fhirUrl("Bot",a,"$execute")}else{const a=t;i=this.fhirUrl("Bot","$execute")+`?identifier=${a.system}|${a.value}`}return this.post(i,r,n,o)}executeBatch(t,r){return this.post(this.fhirBaseUrl.slice(0,-1),t,void 0,r)}sendEmail(t,r){return this.post("email/v1/send",t,Qt.JSON,r)}graphql(t,r,n,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:r,variables:n},Qt.JSON,o)}readResourceGraph(t,r,n,o){return this.get(`${this.fhirUrl(t,r)}/$graph?graph=${n}`,o)}pushToAgent(t,r,n,o,i){return this.post(this.fhirUrl("Agent",ix(t),"$push"),{destination:et(r),body:n,contentType:o},Qt.FHIR_JSON,i)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var r,n;(!((r=this.sessionDetails)!=null&&r.profile)||et(this.sessionDetails.profile)!==((n=t.profile)==null?void 0:n.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}setAccessToken(t,r){this.accessToken=t,this.refreshToken=r,this.sessionDetails=void 0,this.medplumServer=Ase(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const r=this.getLogins().filter(n=>{var o,i;return((o=n.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.reference)});r.push(t),this.storage.setObject("logins",r)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,r)=>{this.get("auth/me").then(n=>{var i,a;this.profilePromise=void 0;const o=((a=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:a.id)!==n.profile.id;this.sessionDetails=n,o&&this.dispatchEvent({type:"change"}),t(n.profile)}).catch(r)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!!this.profilePromise}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,r={}){this.refreshPromise&&await this.refreshPromise;const n=t.toString();return n.startsWith(xO)&&(t=this.fhirUrl(n)),this.addFetchOptionsDefaults(r),(await this.fetchWithRetry(t.toString(),r)).blob()}async uploadMedia(t,r,n,o,i){const a=await this.createBinary(t,n,r);return this.createResource({resourceType:"Media",status:"completed",content:{contentType:r,url:xO+a.id,title:n},...o},i)}async bulkExport(t="",r,n,o){const i=t&&`${t}/`,a=this.fhirUrl(`${i}$export`);return r&&a.searchParams.set("_type",r),n&&a.searchParams.set("_since",n),this.startAsyncRequest(a.toString(),o)}async startAsyncRequest(t,r={}){this.addFetchOptionsDefaults(r);const n=r.headers;n.Prefer="respond-async";const o=await this.fetchWithRetry(t,r);if(o.status===202){const i=await SO(o);if(i)return this.pollStatus(i)}return this.parseResponse(o,"POST",t)}getCacheEntry(t,r){if(!this.requestCache||(r==null?void 0:r.cache)==="no-cache"||(r==null?void 0:r.cache)==="reload")return;const n=this.requestCache.get(t);if(!(!n||n.requestTime+this.cacheTime<Date.now()))return n}setCacheEntry(t,r){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:r})}cacheResource(t){var r,n;t!=null&&t.id&&!((n=(r=t.meta)==null?void 0:r.tag)!=null&&n.some(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new lo(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,r,n={}){this.refreshPromise&&await this.refreshPromise,n.method=t,this.addFetchOptionsDefaults(n);const o=await this.fetchWithRetry(r,n);return this.parseResponse(o,t,r,n)}async parseResponse(t,r,n,o={}){if(t.status===401)return this.handleUnauthenticated(r,n,o);if(t.status===204||t.status===304)return;const i=t.headers.get("content-type"),a=i==null?void 0:i.includes("json");if(t.status===404&&!a)throw new Ie(sae);const l=t.headers.get("content-location"),c=o.redirect??this.options.redirect;if(t.status===201&&l&&c==="follow")return this.request("GET",l,{...o,body:void 0});let u;if(a)try{u=await t.json()}catch(d){throw console.error("Error parsing response",t.status,d),d}else u=await t.text();if(t.status>=400)throw new Ie(ct(u));return u}async fetchWithRetry(t,r){t.startsWith("http")||(t=new URL(t,this.baseUrl).href);const n=3,o=200;let i;for(let a=0;a<n;a++){try{if(this.options.verbose&&this.logRequest(t,r),i=await this.fetch(t,r),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(a,n,l)}await iO(o)}return i}logRequest(t,r){if(console.log(`> ${r.method} ${t}`),r.headers){const n=r.headers,o=Object.entries(n).sort((i,a)=>i[0].localeCompare(a[0]));for(const[i,a]of o)console.log(`> ${i}: ${a}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((r,n)=>console.log(`< ${n}: ${r}`))}async pollStatus(t){let r=!0,n;const o=2e3;for(;r;){const i={};this.addFetchOptionsDefaults(i);const a=await this.fetchWithRetry(t,i);if(a.status!==202&&(r=!1,n=a,a.status===201)){const l=await SO(a);l&&(n=await this.fetchWithRetry(l,i))}await iO(o)}return this.parseResponse(n,"POST",t)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const a=t[0];try{a.resolve(await this.request(a.method,this.fhirBaseUrl+a.url,a.options))}catch(l){a.reject(new Ie(ct(l)))}return}const r={resourceType:"Bundle",type:"batch",entry:t.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},n=await this.post(this.fhirBaseUrl.slice(0,-1),r);for(let a=0;a<t.length;a++){const l=t[a],c=(o=n.entry)==null?void 0:o[a];(i=c==null?void 0:c.response)!=null&&i.outcome&&!S5(c.response.outcome)?l.reject(new Ie(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){let r=t.headers;r||(r={},t.headers=r),r.Accept||(r.Accept=Fse),r["X-Medplum"]="extended",t.body&&!r["Content-Type"]&&(r["Content-Type"]=Qt.FHIR_JSON),this.accessToken?r.Authorization="Bearer "+this.accessToken:this.basicAuth&&(r.Authorization="Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,r){t.headers||(t.headers={});const n=t.headers;n["Content-Type"]=r}setRequestBody(t,r){typeof r=="string"||typeof Blob<"u"&&r instanceof Blob||typeof File<"u"&&r instanceof File||typeof Uint8Array<"u"&&r instanceof Uint8Array?t.body=r:r&&(t.body=JSON.stringify(r))}handleUnauthenticated(t,r,n){return this.refresh()?this.request(t,r,n):(this.clearActiveLogin(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=mO();sessionStorage.setItem("pkceState",t);const r=mO();sessionStorage.setItem("codeVerifier",r);const n=await xse(r),o=Woe(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}async requestAuthorization(t){const r=await this.ensureCodeChallenge(t??{}),n=new URL(this.authorizeUrl);n.searchParams.set("response_type","code"),n.searchParams.set("state",sessionStorage.getItem("pkceState")),n.searchParams.set("client_id",r.clientId??this.clientId),n.searchParams.set("redirect_uri",r.redirectUri??_O()),n.searchParams.set("code_challenge_method",r.codeChallengeMethod),n.searchParams.set("code_challenge",r.codeChallenge),n.searchParams.set("scope",r.scope??"openid profile"),window.location.assign(n.toString())}processCode(t,r){const n=new URLSearchParams;if(n.set("grant_type","authorization_code"),n.set("code",t),n.set("client_id",(r==null?void 0:r.clientId)??this.clientId),n.set("redirect_uri",(r==null?void 0:r.redirectUri)??_O()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&n.set("code_verifier",o)}return this.fetchTokens(n)}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,r){this.clientId=t,this.clientSecret=r;const n=new URLSearchParams;return n.set("grant_type","client_credentials"),n.set("client_id",t),n.set("client_secret",r),this.fetchTokens(n)}async startJwtBearerLogin(t,r,n){this.clientId=t;const o=new URLSearchParams;return o.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),o.set("client_id",t),o.set("assertion",r),o.set("scope",n),this.fetchTokens(o)}async startJwtAssertionLogin(t){const r=new URLSearchParams;return r.append("grant_type","client_credentials"),r.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),r.append("client_assertion",t),this.fetchTokens(r)}setBasicAuth(t,r){this.clientId=t,this.clientSecret=r,this.basicAuth=yse(t+":"+r)}async fhircastSubscribe(t,r){if(!(typeof t=="string"&&t!==""))throw new Ie(Rt("Invalid topic provided. Topic must be a valid string."));if(!(typeof r=="object"&&Array.isArray(r)&&r.length>0))throw new Ie(Rt("Invalid events provided. Events must be an array of event names containing at least one event."));const n={channelType:"websocket",mode:"subscribe",topic:t,events:r},i=(await this.post("/fhircast/STU3",gO(n),Qt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return n.endpoint=i,n}async fhircastUnsubscribe(t){if(!wx(t))throw new Ie(Rt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Ie(Rt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",gO(t),Qt.FORM_URL_ENCODED)}fhircastConnect(t){return new Ise(t)}async fhircastPublish(t,r,n,o){return Cse(r)?this.post(`/fhircast/STU3/${t}`,yO(t,r,n,o),Qt.JSON):(Ese(r),this.post(`/fhircast/STU3/${t}`,yO(t,r,n),Qt.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,r){return this.post("admin/projects/"+t+"/invite",r)}async fetchTokens(t){const r={method:"POST",headers:{"Content-Type":Qt.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},n=r.headers;this.basicAuth&&(n.Authorization=`Basic ${this.basicAuth}`);const o=await this.fetchWithRetry(this.tokenUrl,r);if(!o.ok){this.clearActiveLogin();try{const a=await o.json();throw new Ie(qi(a.error_description))}catch(a){throw new Ie(qi("Failed to fetch tokens"),a)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const r=t.access_token;if(Nse(r)){const n=A5(r);if(Date.now()>=n.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(n.cid){if(n.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&n.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:r,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}setupStorageListener(){try{window.addEventListener("storage",t=>{(t.key===null||t.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(t,r,n){if(n.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=r-1)throw n}}function Hse(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function _O(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function bO(e){return e.endsWith("/")?e:e+"/"}function zu(e,t){return new URL(t,e).toString()}async function SO(e){var o,i;const t=e.headers.get("content-location");if(t)return t;const r=e.headers.get("location");if(r)return r;const n=await e.json();if(lm(n)&&((i=(o=n.issue)==null?void 0:o[0])!=null&&i.diagnostics))return n.issue[0].diagnostics}function PO(e){var r;const t=((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];return Object.assign(t,{bundle:e})}var L5=f.createContext(void 0);function cm(){return f.useContext(L5)}function ae(){return cm().medplum}function um(){return cm().navigate}function _x(){return cm().profile}function Gse(e){let t=e.medplum,r=e.navigate??qse,[n,o]=f.useState({profile:t.getProfile(),loading:!t.isInitialized});f.useEffect(()=>{t&&(t.isInitialized||(o(a=>({...a,loading:!0})),t.getInitPromise().then(()=>o(a=>({...a,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),f.useEffect(()=>{function a(){o({...n,profile:t.getProfile()})}return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[t,n]);let i=f.useMemo(()=>({...n,medplum:t,navigate:r}),[n,t,r]);return s.jsx(L5.Provider,{value:i,children:e.children})}function qse(e){window.location.assign(e)}function Ke(e,t){let r=ae(),[n,o]=f.useState(jO(r,e)),i=f.useCallback(a=>{am(a,n)||o(a)},[n,o]);return f.useEffect(()=>{i(jO(r,e))},[r,e,i]),f.useEffect(()=>{let a=!0;return wa(e)&&r.readReference(e).then(l=>{a&&i(l)}).catch(l=>{a&&(i(void 0),t&&t(ct(l)))}),()=>a=!1},[r,n,e,i,t]),n}function jO(e,t){if(t){if(Ao(t))return t;if(wa(t))return e.getCachedReference(t)}}function Qse(e,t){return z5("searchOne",e,t)}function _s(e,t){return z5("searchResources",e,t)}function z5(e,t,r){let n=ae(),[o,i]=f.useState(),[a,l]=f.useState(!1),[c,u]=f.useState(),[d,p]=f.useState();return f.useEffect(()=>{let h=n.fhirSearchUrl(t,r).toString();h!==o&&(i(h),n[e](t,r).then(m=>{l(!1),u(m),p(aae)}).catch(m=>{l(!1),u(void 0),p(ct(m))}))},[n,e,t,r,o,u]),[c,a,d]}function Kse(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Goe(t)}):null}function OO(e,t){return e.line&&e.line.length>t?e.line[t]:""}function CO(e,t,r){const n=e.line||[];for(;n.length<=t;)n.push("");return n[t]=r,{...e,line:n}}function Yse(e){const[t,r]=f.useState(e.defaultValue||{}),n=f.useRef();n.current=t;function o(h){r(h),e.onChange&&e.onChange(h)}function i(h){o({...n.current,use:h})}function a(h){o({...n.current,type:h})}function l(h){o(CO(n.current||{},0,h))}function c(h){o(CO(n.current||{},1,h))}function u(h){o({...n.current,city:h})}function d(h){o({...n.current,state:h})}function p(h){o({...n.current,postalCode:h})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ft,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>a(h.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(le,{placeholder:"Line 1",defaultValue:OO(t,0),onChange:h=>l(h.currentTarget.value)}),s.jsx(le,{placeholder:"Line 2",defaultValue:OO(t,1),onChange:h=>c(h.currentTarget.value)}),s.jsx(le,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),s.jsx(le,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),s.jsx(le,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>p(h.currentTarget.value)})]})}function Xse(e){const t=_x(),[r,n]=f.useState(e.defaultValue||{}),o=f.useRef();o.current=r;function i(a){const l=a?{text:a,authorReference:t&&dt(t),time:new Date().toISOString()}:{};n(l),e.onChange&&e.onChange(l)}return s.jsx(le,{name:e.name,placeholder:"Annotation text",defaultValue:r.text,onChange:a=>i(a.currentTarget.value)})}var Jse={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"},Zse=Object.defineProperty,ele=Object.defineProperties,tle=Object.getOwnPropertyDescriptors,rh=Object.getOwnPropertySymbols,F5=Object.prototype.hasOwnProperty,V5=Object.prototype.propertyIsEnumerable,EO=(e,t,r)=>t in e?Zse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$O=(e,t)=>{for(var r in t||(t={}))F5.call(t,r)&&EO(e,r,t[r]);if(rh)for(var r of rh(t))V5.call(t,r)&&EO(e,r,t[r]);return e},rle=(e,t)=>ele(e,tle(t)),nle=(e,t)=>{var r={};for(var n in e)F5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rh)for(var n of rh(e))t.indexOf(n)<0&&V5.call(e,n)&&(r[n]=e[n]);return r},ue=(e,t,r)=>{const n=f.forwardRef((o,i)=>{var a=o,{color:l="currentColor",size:c=24,stroke:u=2,children:d}=a,p=nle(a,["color","size","stroke","children"]);return f.createElement("svg",$O(rle($O({ref:i},Jse),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),p),[...r.map(([h,m])=>f.createElement(h,m)),...d||[]])});return n.propTypes={color:Te.string,size:Te.oneOfType([Te.string,Te.number]),stroke:Te.oneOfType([Te.string,Te.number])},n.displayName=`${t}`,n},ole=ue("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"}]]),dm=ue("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"}]]),ile=ue("arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]),ale=ue("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]),sle=ue("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"}]]),lle=ue("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"}]]),cle=ue("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"}]]),ule=ue("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"}]]),dle=ue("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"}]]),fle=ue("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"}]]),ple=ue("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"}]]),hle=ue("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"}]]),Ti=ue("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"}]]),fm=ue("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),mle=ue("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"}]]),gle=ue("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),nh=ue("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"}]]),bx=ue("circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]),Sx=ue("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"}]]),vle=ue("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"}]]),yle=ue("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"}]]),xle=ue("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"}]]),wle=ue("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"}]]),_le=ue("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"}]]),ble=ue("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"}]]),pm=ue("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"}]]),hm=ue("equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]),kO=ue("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"}]]),Sle=ue("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"}]]),Ple=ue("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"}]]),jle=ue("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"}]]),Ole=ue("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"}]]),Cle=ue("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"}]]),Ele=ue("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"}]]),$le=ue("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"}]]),kle=ue("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"}]]),B5=ue("math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]),U5=ue("math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]),Rle=ue("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"}]]),Tle=ue("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"}]]),Ile=ue("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"}]]),Dle=ue("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"}]]),Nle=ue("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"}]]),Ale=ue("player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]),Mle=ue("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),Lle=ue("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"}]]),zle=ue("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"}]]),Fle=ue("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"}]]),Vle=ue("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"}]]),ty=ue("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"}]]),Px=ue("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"}]]),jx=ue("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"}]]),Ble=ue("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"}]]),Ule=ue("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"}]]),Wle=ue("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"}]]),Hle=ue("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"}]]),W5=ue("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"}]]),RO=ue("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"}]]),Gle=ue("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"}]]),oh=ue("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);class H5 extends f.Component{constructor(t){super(t),this.state={}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("Uncaught error:",t,r)}render(){return this.state.error?s.jsx(_c,{icon:s.jsx(dm,{size:16}),title:"Something went wrong",color:"red",children:Ee(this.state.error)}):this.props.children}}function On(){return s.jsx(or,{style:{width:"100%",height:"100vh"},children:s.jsx(cn,{})})}function Ox(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Rc(t,e.options)}):null}function st(e){e.preventDefault(),e.stopPropagation()}function G5(e){if(TO(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&TO(t[0]))return!0}return!1}function TO(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function ke(e){const t=um(),{to:r,suffix:n,label:o,onClick:i,children:a,...l}=e;let c=qle(r);return n&&(c+="/"+n),s.jsx(Le,{href:c,"aria-label":o,onClick:u=>{st(u),i?i(u):r&&t(c)},...l,children:a})}function qle(e){if(e){if(typeof e=="string")return Qle(e);if(Ao(e))return Kle(e);if(wa(e))return Yle(e)}return"#"}function Qle(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Kle(e){return`/${e.resourceType}/${e.id}`}function Yle(e){return`/${e.reference}`}function vi(e){const t=Ke(e.value),r=t?Co(t):e.alt??"",n=(t&&Moe(t))??e.src,o=e.radius??"xl",i={...e};return delete i.value,delete i.link,e.link?s.jsx(ke,{to:t,children:s.jsx(Cf,{src:n,alt:r,radius:o,...i})}):s.jsx(Cf,{src:n,alt:r,radius:o,...i})}function Cx(e){const{defaultValue:t,toKey:r,toOption:n,loadOptions:o,onChange:i,onCreate:a,creatable:l,...c}=e,u=Xle(t),d=f.useRef(null),[p,h]=f.useState(),[m,v]=f.useState(),[g,b]=f.useState(),[y,x]=f.useState(),[_,w]=f.useState(u.map(n)),[O,C]=f.useState([]),P=f.useRef();P.current=p;const E=f.useRef();E.current=m;const k=f.useRef();k.current=g;const $=f.useRef();$.current=y;const I=f.useRef();I.current=O;const T=f.useCallback(()=>{var V;v(void 0);const R=((V=d.current)==null?void 0:V.value.trim())||"";if(R===P.current)return;h(R);const N=new AbortController;b(N),o(R,N.signal).then(Q=>{N.signal.aborted||(C(Q.map(n)),b(void 0),$.current&&(Q.length>0&&i(Q.slice(0,1)),x(!1)))}).catch(Q=>{N.signal.aborted||Q.message.includes("aborted")||me({color:"red",message:Ee(Q)})})},[o,i,n]),z=f.useCallback(()=>{k.current&&(k.current.abort(),b(void 0)),E.current!==void 0&&window.clearTimeout(E.current);const R=window.setTimeout(()=>T(),100);v(R)},[T]),M=f.useCallback(R=>{var Q;const N=[],V=[];for(const ee of R){let _e=(Q=I.current)==null?void 0:Q.find(Ue=>Ue.value===ee),we=_e==null?void 0:_e.resource;!we&&l!==!1&&a&&(we=a(ee),_e=n(we)),we&&N.push(we),_e&&V.push(_e)}i(N),w(V)},[l,i,a,n]),L=f.useCallback(R=>{R.key==="Enter"&&(!E.current&&!k.current?(st(R),I.current&&I.current.length>0&&(C(I.current.slice(0,1)),M([I.current[0].value]))):x(!0))},[M]),q=f.useCallback(R=>{const N=n(a(R));return C([...I.current,N]),N},[a,C,n]),Y=f.useCallback((R,N)=>!N,[]);return f.useEffect(()=>()=>{k.current&&k.current.abort()},[]),s.jsx(em,{...c,ref:d,defaultValue:u.map(r),searchable:!0,onKeyDown:L,onSearchChange:z,data:[..._,...O],onFocus:T,onChange:M,onCreate:q,rightSectionWidth:40,rightSection:g?s.jsx(cn,{size:16}):null,filter:Y,creatable:!0,withinPortal:!0})}function Xle(e){return e?Array.isArray(e)?e:[e]:[]}const Jle=W(()=>({searchInput:{input:{width:220,transition:"width 0.2s"},"input:focus":{width:400},"@media (max-width: 800px)":{input:{width:150},"input:focus":{width:150}}}}));function Zle(e){return e.id}function ece(e){return{value:e.id,label:Co(e),resource:e}}function tce(e){const{classes:t}=Jle(),r=um(),n=ae(),o=f.useCallback(async(a,l)=>{const c=nce(a),u={signal:l},d=await n.graphql(c,void 0,void 0,u);return oce(d,a)},[n]),i=f.useCallback(a=>{a.length>0&&r(`/${et(a[0])}`)},[r]);return s.jsx(Cx,{size:"sm",radius:"md",className:t.searchInput,icon:s.jsx(Vle,{size:16}),placeholder:"Search",itemComponent:rce,toKey:Zle,toOption:ece,onChange:i,loadOptions:o,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const rce=f.forwardRef(({resource:e,...t},r)=>{var o;let n;return e.resourceType==="Patient"?n=e.birthDate:e.resourceType==="ServiceRequest"&&(n=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...t,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(vi,{value:e}),s.jsxs("div",{children:[s.jsx(re,{children:Co(e)}),s.jsx(re,{size:"xs",color:"dimmed",children:n})]})]})})});function nce(e){const t=JSON.stringify(e);return u5(e)?`{
127
127
  Patients1: PatientList(_id: ${t}, _count: 1) {
128
128
  resourceType
129
129
  id
@@ -186,8 +186,8 @@ Error generating stack: `+i.message+`
186
186
  display
187
187
  }
188
188
  }
189
- }`.replace(/\s+/g," ")}function oce(e,t){const r=[];return e.data.Patients1&&r.push(...e.data.Patients1),e.data.Patients2&&r.push(...e.data.Patients2),e.data.ServiceRequestList&&r.push(...e.data.ServiceRequestList),ace(ice(r),t).slice(0,5)}function ice(e){const t=new Set,r=[];for(const n of e)t.has(n.id)||(t.add(n.id),r.push(n));return r}function ace(e,t){return e.sort((r,n)=>IO(n,t)-IO(r,t))}function IO(e,t){let r=0;if(e.identifier)for(const n of e.identifier)r=Math.max(r,DO(n.value,t));if(e.resourceType==="Patient"&&e.name)for(const n of e.name)r=Math.max(r,DO(Rc(n),t));return r}function DO(e,t){if(!e)return 0;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?0:100-r}const sce=W(e=>({logoButton:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},user:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},userName:{fontWeight:500,lineHeight:1,marginRight:3,[e.fn.smallerThan("xs")]:{display:"none"}},userActive:{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}}));function lce(e){var d,p,h,m;const t=cm(),{medplum:r,profile:n,navigate:o}=t,i=r.getLogins(),{classes:a,cx:l}=sce(),[c,u]=f.useState(!1);return s.jsx(Ek,{height:60,p:8,style:{zIndex:101},children:s.jsxs(K,{position:"apart",children:[s.jsxs(K,{spacing:"xs",children:[s.jsx(wo,{className:a.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(tce,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(X,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:c,onClose:()=>u(!1),children:[s.jsx(X.Target,{children:s.jsx(wo,{className:l(a.user,{[a.userActive]:c}),onClick:()=>u(v=>!v),children:s.jsxs(K,{spacing:7,children:[s.jsx(vi,{value:n,radius:"xl",size:24}),s.jsx(re,{size:"sm",className:a.userName,children:Rc((d=n==null?void 0:n.name)==null?void 0:d[0])}),s.jsx(gle,{size:12,stroke:1.5})]})})}),s.jsxs(X.Dropdown,{children:[s.jsxs(Oe,{align:"center",p:"xl",children:[s.jsx(vi,{size:"xl",radius:100,value:t.profile}),s.jsx(Ox,{value:(h=(p=t.profile)==null?void 0:p.name)==null?void 0:h[0]}),s.jsx(re,{color:"dimmed",size:"xs",children:(m=r.getActiveLogin())==null?void 0:m.project.display})]}),i.length>1&&s.jsx(X.Divider,{}),i.map(v=>v.profile.reference!==et(t.profile)&&s.jsx(X.Item,{onClick:()=>{r.setActiveLogin(v).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(K,{children:[s.jsx(Cf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",weight:500,children:v.profile.display}),s.jsx(re,{color:"dimmed",size:"xs",children:v.project.display})]})]})},v.profile.reference)),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Wle,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(X.Item,{icon:s.jsx(ty,{size:14,stroke:1.5}),onClick:()=>o(`/${et(n)}`),children:"Account settings"}),s.jsx(X.Item,{icon:s.jsx(kle,{size:14,stroke:1.5}),onClick:async()=>{await r.signOut(),o("/signin")},children:"Sign out"}),s.jsx(re,{size:"xs",color:"dimmed",align:"center",children:e.version})]})]})]})})}function cce(e){const t={};for(const r of Array.from(e.elements))r instanceof HTMLInputElement?uce(t,r):r instanceof HTMLTextAreaElement?t[r.name]=r.value:r instanceof HTMLSelectElement&&dce(t,r);return t}function uce(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function dce(e,t){e[t.name]=t.value}function De(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const r=cce(t.target);e.onSubmit&&e.onSubmit(r)},children:e.children})}function fce(e){const t=ae(),r=t.getUserConfiguration();function n(o){var d,p;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=va(r),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(p=u==null?void 0:u.link)==null||p.push({name:a,target:l}),t.updateResource(c).then(h=>{r.menu=h.menu,t.dispatchEvent({type:"change"}),me({color:"green",message:"Success"}),e.onOk()}).catch(h=>{me({color:"red",message:Ee(h)})})}return s.jsx(Tr,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(De,{onSubmit:n,children:s.jsxs(Oe,{children:[s.jsx(pce,{config:r}),s.jsx(le,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(K,{position:"right",children:s.jsx(ne,{mt:"sm",type:"submit",children:"OK"})})]})})})}function pce(e){function t(n){var o;return(o=n==null?void 0:n.menu)==null?void 0:o.map(i=>i.title)}const r=t(e.config);return s.jsx(ft,{name:"menuname",defaultValue:r[0],label:"Select Menu Option",placeholder:"Menu",data:r,withAsterisk:!0})}function Ex(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function hce(e){return typeof e.display=="string"?e.display:Ex(e)}function mce(e){return{value:Ex(e),label:hce(e),resource:e}}function gce(e){return{code:e,display:e}}function $x(e){const t=ae(),{binding:r,creatable:n,clearable:o,...i}=e,a=f.useCallback(async(l,c)=>{var h;if(!r)return[];const d=(h=(await t.searchValueSet(r,l,{signal:c})).expansion)==null?void 0:h.contains,p=[];for(const m of d)m.code&&!p.some(v=>v.code===m.code)&&p.push(m);return p},[t,r]);return s.jsx(Cx,{...i,creatable:n??!0,clearable:o??!0,toKey:Ex,toOption:mce,loadOptions:a,onCreate:gce,getCreateLabel:n===!1?void 0:l=>`+ Create ${l}`})}function q5(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=yce(i);r(a),e.onChange&&e.onChange(a)}return s.jsx($x,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:vce(t),onChange:n,creatable:e.creatable,maxSelectedValues:e.maxSelectedValues??1,clearSearchOnChange:e.clearSearchOnChange,clearable:e.clearable})}function vce(e){return e?{code:e}:void 0}function yce(e){return e==null?void 0:e.code}function kx(e){const[t,r]=f.useState(e.defaultValue),n=e.onChange,o=f.useCallback(i=>{r(i),n&&n(i)},[n]);return s.jsx(q5,{"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1})}const Q5=W(e=>({menuTitle:{margin:"20px 0 4px 6px",fontSize:"9px",fontWeight:"normal",textTransform:"uppercase",letterSpacing:"2px"},link:{...e.fn.focusStyles(),display:"flex",alignItems:"center",textDecoration:"none",fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],padding:"8px 12px",borderRadius:e.radius.sm,fontWeight:500,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],color:e.colorScheme==="dark"?e.white:e.black,textDecoration:"none","& svg":{color:e.colorScheme==="dark"?e.white:e.black}},"& svg":{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginRight:e.spacing.sm,strokeWidth:1.5,width:18,height:18}},linkActive:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color,"& svg":{color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}}));function xce(e){var c;const{classes:t}=Q5(),r=um(),n=bce(e.pathname,e.searchParams,e.menus),[o,i]=f.useState(!1);function a(u,d){u.stopPropagation(),u.preventDefault(),r(d),window.innerWidth<768&&e.closeNavbar()}function l(u){u&&r(`/${u}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Rl,{width:{sm:250},p:"xs",children:s.jsxs(da,{children:[!e.resourceTypeSearchDisabled&&s.jsx(Rl.Section,{mb:"sm",children:s.jsx(kx,{name:"resourceType",placeholder:"Resource Type",onChange:u=>l(u)},window.location.pathname)}),s.jsxs(Rl.Section,{grow:!0,children:[(c=e.menus)==null?void 0:c.map(u=>{var d;return s.jsxs(S.Fragment,{children:[s.jsx(re,{className:t.menuTitle,children:u.title}),(d=u.links)==null?void 0:d.map(p=>s.jsxs(wce,{to:p.href,active:p.href===(n==null?void 0:n.href),onClick:h=>a(h,p.href),children:[s.jsx(_ce,{to:p.href,icon:p.icon}),s.jsx("span",{children:p.label})]},p.href))]},`menu-${u.title}`)}),e.displayAddBookmark&&s.jsx(ne,{variant:"subtle",size:"xs",mt:"xl",leftIcon:s.jsx(Mle,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(fce,{pathname:e.pathname,searchParams:e.searchParams,visible:o,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function wce(e){const{classes:t,cx:r}=Q5();return s.jsx(ke,{onClick:e.onClick,to:e.to,className:r(t.link,{[t.linkActive]:e.active}),children:e.children})}function _ce(e){return e.icon?e.icon:s.jsx(im,{w:30})}function bce(e,t,r){if(!e||!t||!r)return;let n,o=0;for(const i of r)if(i.links)for(const a of i.links){const l=Sce(e,t,a.href);l>o&&(o=l,n=a)}return n}function Sce(e,t,r){const n=new URL(r,"https://example.com");if(e!==n.pathname)return 0;const o=["_count","_offset"];for(const[a,l]of n.searchParams.entries())if(!o.includes(a)&&t.get(a)!==l)return 0;let i=1;for(const[a,l]of t.entries())o.includes(a)||n.searchParams.get(a)===l&&i++;return i}function Pce(e){var u;const t=Jt(),[r,n]=f.useState(localStorage.navbarOpen==="true"),o=ae(),i=_x();f.useEffect(()=>{function d(){me({color:"red",message:"No connection to server",autoClose:!1})}return o.addEventListener("offline",d),()=>o.removeEventListener("offline",d)},[o]);function a(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){a(!1)}function c(){a(!r)}return o.isLoading()?s.jsx(On,{}):s.jsx(Tk,{styles:{main:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.colors.gray[0]}},padding:0,fixed:!0,header:i&&s.jsx(lce,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:c}),navbar:i&&r?s.jsx(xce,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,children:s.jsx(H5,{children:s.jsx(f.Suspense,{fallback:s.jsx(On,{}),children:e.children})},`${e.pathname}?${(u=e.searchParams)==null?void 0:u.toString()}`)})}function Ic(e){const{contentType:t,url:r,title:n}=e.value??{};return r?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:r,alt:n}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:r})}),t==="application/pdf"&&s.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:r+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Le,{href:r,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:jce(n),children:n||"Download"})})]}):null}function jce(e){return e!=null&&e.includes(".")?e:void 0}function Oce(e){var t;return s.jsx("div",{children:(t=e.values)==null?void 0:t.map((r,n)=>s.jsx("div",{children:s.jsx(Ic,{value:r,maxWidth:e.maxWidth})},"attatchment-"+n))})}function Rx(e){const t=ae(),r=f.useRef(null);function n(a){var l;st(a),(l=r.current)==null||l.click()}function o(a){st(a);const l=a.target.files;l&&Array.from(l).forEach(i)}function i(a){if(!a||!a.name)return;e.onUploadStart&&e.onUploadStart();const c=a.name,u=a.type||"application/octet-stream";t.createBinary(a,c,u,e.onUploadProgress).then(d=>{e.onUpload({contentType:d.contentType,url:d.url,title:c})}).catch(d=>{e.onUploadError&&e.onUploadError(ct(d))})}return s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:r,onChange:a=>o(a)}),e.children({onClick:n})]})}function Cce(e){const[t,r]=f.useState(e.defaultValue??[]),n=f.useRef();n.current=t;function o(i){r(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,a)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Ic,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(dr,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(nh,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Rx,{onUpload:i=>{o([...n.current,i])},children:i=>s.jsx(dr,{...i,title:"Add",size:"sm",color:"green",children:s.jsx(Sx,{size:16})})})})]})]})]})}function K5(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(Ic,{value:t,maxWidth:200}),s.jsx(ne,{onClick:o=>{st(o),n(void 0)},children:"Remove"})]}):s.jsx(Rx,{onUpload:n,children:o=>s.jsx(ne,{...o,children:"Upload..."})})}const Y5=["meta","implicitRules","contained","extension","modifierExtension"],X5=["language","text"],Ece=W(e=>({root:{display:"grid",gridTemplateColumns:"30% 70%",margin:0,"& > dt, & > dd":{padding:`${e.spacing.sm} ${e.spacing.sm}`,borderTop:`0.1px solid ${e.colors.gray[3]}`,margin:0}},compact:{gridTemplateColumns:"20% 80%","& > dt, & > dd":{padding:`0 ${e.spacing.xs} ${e.spacing.xs} 0`,border:0}}}));function Tx(e){const{children:t,compact:r}=e,{classes:n,cx:o}=Ece();return s.jsx("dl",{className:o(n.root,{[n.compact]:r}),children:t})}function is(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function Xn(e){return s.jsx(s.Fragment,{children:ws(e.value)})}function $ce(e){return s.jsx(s.Fragment,{children:ya(e.value)})}function J5(e){const t=e.value;if(!t)return null;const r=[];return t.value&&r.push(t.value),(t.use||t.system)&&(r.push(" ["),t.use&&r.push(t.use),t.use&&t.system&&r.push(" "),t.system&&r.push(t.system),r.push("]")),s.jsx(s.Fragment,{children:r.join("").trim()})}function kce(e){var r;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(r=t.telecom)==null?void 0:r.map(n=>s.jsx(J5,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function Rce(e){var t,r;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(r=e.value)==null?void 0:r.value]})}function Tce(e){return s.jsx(s.Fragment,{children:Zoe(e.value)})}function sc(e){return s.jsx(s.Fragment,{children:Ko(e.value)})}function Ix(e){return s.jsx(s.Fragment,{children:ic(e.value)})}function Ice(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(sc,{value:t.numerator})," / ",s.jsx(sc,{value:t.denominator})]}):null}function ih(e){if(!e.value)return null;const t=e.value.display||e.value.reference||sr(e.value);return e.link!==!1&&e.value.reference?s.jsx(ke,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function Dce(e){const{property:t,values:r}=e,n=t.type[0].code;return e.values?s.jsx(s.Fragment,{children:r.map((o,i)=>s.jsx("div",{children:s.jsx($o,{arrayElement:!0,property:t,propertyType:n,value:o,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${i}-${r.length}`))}):s.jsx(s.Fragment,{})}function $o(e){var i;const{property:t,propertyType:r,value:n}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(oe,{component:"div",sx:{display:"flex",gap:3,alignItems:"center"},children:[n,!mo(n)&&s.jsx(KT,{value:n,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(iN,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(dr,{color:a?"teal":"gray",onClick:l,children:a?s.jsx(fm,{size:"1rem"}):s.jsx(yle,{size:"1rem"})})})})]});if(t!=null&&t.max&&t.max>1&&!e.arrayElement)return r===B.Attachment?s.jsx(Oce,{values:n,maxWidth:e.maxWidth}):s.jsx(Dce,{property:t,values:n,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(r){case B.boolean:return s.jsx(s.Fragment,{children:n===void 0?"":(!!n).toString()});case B.SystemString:case B.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:n});case B.code:case B.date:case B.decimal:case B.integer:case B.positiveInt:case B.unsignedInt:case B.uri:case B.url:return s.jsx(s.Fragment,{children:n});case B.canonical:return s.jsx(ih,{value:{reference:n},link:e.link});case B.dateTime:case B.instant:return s.jsx(s.Fragment,{children:kr(n)});case B.markdown:return s.jsx("pre",{children:n});case B.Address:return s.jsx(Kse,{value:n});case B.Annotation:return s.jsx(s.Fragment,{children:n==null?void 0:n.text});case B.Attachment:return s.jsx(Ic,{value:n,maxWidth:e.maxWidth});case B.CodeableConcept:return s.jsx(Xn,{value:n});case B.Coding:return s.jsx($ce,{value:n});case B.ContactDetail:return s.jsx(kce,{value:n});case B.ContactPoint:return s.jsx(J5,{value:n});case B.HumanName:return s.jsx(Ox,{value:n});case B.Identifier:return s.jsx(Rce,{value:n});case B.Money:return s.jsx(Tce,{value:n});case B.Period:return s.jsx(s.Fragment,{children:Qoe(n)});case B.Quantity:case B.Duration:return s.jsx(sc,{value:n});case B.Range:return s.jsx(Ix,{value:n});case B.Ratio:return s.jsx(Ice,{value:n});case B.Reference:return s.jsx(ih,{value:n,link:e.link});case B.Timing:return s.jsx(s.Fragment,{children:f5(n)});case B.Dosage:case B.UsageContext:return s.jsx(ry,{value:{type:r,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);return s.jsx(ry,{value:{type:t.type[0].code,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function ta(e,t){const r=fr(e,t);return r?Array.isArray(r)?[r.map(n=>n.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function ry(e){const t=e.value,r=t.value;if(!r)return null;const n=t.type,o=lx(n);return o?typeof r=="object"&&"name"in r&&Object.keys(r).length===1&&typeof r.name=="string"?s.jsx("div",{children:r.name}):s.jsx(Tx,{compact:e.compact,children:Object.entries(o.elements).map(i=>{const[a,l]=i;if(Y5.includes(a)||X5.includes(a)&&l.path.split(".").length===2)return null;const[c,u]=ta(t,a);return e.ignoreMissingValues&&(!c||Array.isArray(c)&&c.length===0)?null:s.jsx(is,{term:th(a),children:s.jsx($o,{property:l,propertyType:u,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},a)})}):s.jsxs("div",{children:[n," not implemented"]})}function Z5(e){return s.jsxs(K,{noWrap:!0,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Ut.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,children:(()=>null)()})})]})}function lt(e,t){var r,n,o;return(o=(n=(r=e==null?void 0:e.issue)==null?void 0:r.filter(i=>{var a;return e4((a=i.expression)==null?void 0:a[0],t)}))==null?void 0:n.map(i=>{var a;return(a=i.details)==null?void 0:a.text}))==null?void 0:o.join(`
190
- `)}function Dx(e,t){var r;return(r=e==null?void 0:e.issue)==null?void 0:r.filter(n=>{var o;return e4((o=n.expression)==null?void 0:o[0],t)})}function e4(e,t){if(e===t)return!0;if(!e||!t)return!1;const r=e.indexOf(".");if(r>=0&&e.substring(r+1)===t)return!0;const n=t.indexOf(".");return n>=0&&t.substring(n+1)===e}function tt(e){return s.jsx(Ut.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,error:lt(e.outcome,e.htmlFor),children:e.children})}function ny(e,t,r,n,o){const i=n.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",hr(a.code));l in e&&delete e[l]}return e[r]=o,e}function Nce(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=Mce(o);r(i),e.onChange&&e.onChange(i)}return s.jsx($x,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&Ace(t),maxSelectedValues:1,onChange:n})}function Ace(e){var t;return(t=e.coding)==null?void 0:t.map(r=>({system:r.system,code:r.code,display:r.display}))}function Mce(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function t4(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=i&&zce(i);r(a),e.onChange&&e.onChange(a)}return s.jsx($x,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&Lce(t),maxSelectedValues:1,onChange:n})}function Lce(e){return{system:e.system,code:e.code,display:e.display}}function zce(e){return{system:e.system,code:e.code,display:e.display}}function r4(e){const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){c&&Object.keys(c).length===0&&(c=void 0),r(c),e.onChange&&e.onChange(c)}function i(c){const u={...n.current,system:c};c||delete u.system,o(u)}function a(c){const u={...n.current,use:c};c||delete u.use,o(u)}function l(c){const u={...n.current,value:c};c||delete u.value,o(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"system",defaultValue:t==null?void 0:t.system,onChange:c=>i(c.currentTarget.value),data:["","email","phone","fax","pager","sms","other"]}),s.jsx(ft,{"data-testid":"use",defaultValue:t==null?void 0:t.use,onChange:c=>a(c.currentTarget.value),data:["","home","work","temp","old","mobile"]}),s.jsx(le,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:c=>l(c.currentTarget.value)})]})}function Fce(e){var l;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){r(c),e.onChange&&e.onChange(c)}function i(c){const u={...n.current,name:c};c||delete u.name,o(u)}function a(c){const u={...n.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>i(c.currentTarget.value)}),s.jsx(r4,{name:e.name+"-telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:a})]})}function Vce(e){if(!e)return"";const t=new Date(e);return sm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function n4(e){if(!e)return"";const t=new Date(e);return sm(t)?t.toISOString():""}function ra(e){return s.jsx(le,{id:e.name,name:e.name,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:Bce(),defaultValue:Vce(e.defaultValue),autoFocus:e.autoFocus,error:lt(e.outcome,e.name),onChange:t=>{if(e.onChange){const r=t.currentTarget.value;e.onChange(n4(r))}}})}function Bce(){return{}.NODE_ENV==="test"?"text":"datetime-local"}function Uce(e){return s.jsx(Ds,{id:e.name,name:e.name,"data-testid":"extension-input",defaultValue:sr(e.defaultValue),deserialize:JSON.parse,onChange:t=>{e.onChange&&e.onChange(JSON.parse(t))}})}function Wce(e){var d,p,h;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(m){r(m),e.onChange&&e.onChange(m)}function i(m){o({...n.current,use:m||void 0})}function a(m){o({...n.current,prefix:m?m.split(" "):void 0})}function l(m){o({...n.current,given:m?m.split(" "):void 0})}function c(m){o({...n.current,family:m||void 0})}function u(m){o({...n.current,suffix:m?m.split(" "):void 0})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{defaultValue:t==null?void 0:t.use,name:e.name+"-use","data-testid":"use",onChange:m=>i(m.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"]}),s.jsx(le,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(d=t==null?void 0:t.prefix)==null?void 0:d.join(" "),onChange:m=>a(m.currentTarget.value)}),s.jsx(le,{placeholder:"Given",name:e.name+"-given",defaultValue:(p=t==null?void 0:t.given)==null?void 0:p.join(" "),onChange:m=>l(m.currentTarget.value)}),s.jsx(le,{name:e.name+"-family",placeholder:"Family",defaultValue:t==null?void 0:t.family,onChange:m=>c(m.currentTarget.value)}),s.jsx(le,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(h=t==null?void 0:t.suffix)==null?void 0:h.join(" "),onChange:m=>u(m.currentTarget.value)})]})}function Hce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{placeholder:"System",defaultValue:t==null?void 0:t.system,onChange:o=>n({...t,system:o.currentTarget.value})}),s.jsx(le,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:o=>n({...t,value:o.currentTarget.value})})]})}const Gce=["USD","EUR","CAD","GBP","AUD"];function qce(e){var c;const{onChange:t}=e,[r,n]=f.useState(e.defaultValue),o=f.useCallback(u=>{n(u),t&&t(u)},[t]),i=f.useCallback(u=>{o({...r,currency:u.currentTarget.value})},[r,o]),a=f.useCallback(u=>{o({...r,value:u.currentTarget.valueAsNumber})},[r,o]),l=s.jsx(ft,{defaultValue:r==null?void 0:r.currency,data:Gce,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return s.jsx(le,{type:"number",label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=r==null?void 0:r.value)==null?void 0:c.toString())??"USD",icon:s.jsx(xle,{size:14}),rightSection:l,rightSectionWidth:92,onChange:a})}function Qce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ra,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>n({...t,start:o})}),s.jsx(ra,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>n({...t,end:o})})]})}function na(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>n({...t,comparator:o.currentTarget.value})}),s.jsx(le,{id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{n({...t,value:Kce(o.currentTarget.value)})}}),s.jsx(le,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>n({...t,unit:o.currentTarget.value})})]})}function Kce(e){if(e)return parseFloat(e)}function Nx(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(na,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>n({...t,low:o})}),s.jsx(na,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>n({...t,high:o})})]})}function Yce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(na,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>n({...t,numerator:o})}),s.jsx(na,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>n({...t,denominator:o})})]})}const Xce={Observation:"code",User:"email:contains"},Jce=["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 Zce(e){return{value:et(e),label:Co(e),resource:e}}function Ns(e){const t=ae(),r=e.resourceType,[n,o]=f.useState(),i=Ke(e.defaultValue,o),a=e.onChange,l=f.useCallback(async(u,d)=>{const p=tue(r),h=new URLSearchParams({[p]:u,_count:"10"});return await t.searchResources(r,h,{signal:d})},[t,r]),c=f.useCallback(u=>{a&&a(u[0])},[a]);return e.defaultValue&&!n&&!i?null:s.jsx(Cx,{name:e.name,required:e.required,itemComponent:eue,defaultValue:i,placeholder:e.placeholder,maxSelectedValues:1,toKey:et,toOption:Zce,loadOptions:l,onChange:c,clearable:!0})}const eue=f.forwardRef(({label:e,resource:t,...r},n)=>s.jsx("div",{ref:n,...r,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(vi,{value:t}),s.jsxs("div",{children:[s.jsx(re,{children:e}),s.jsx(re,{size:"xs",color:"dimmed",children:t.birthDate})]})]})}));function tue(e){return Xce[e]??(Jce.includes(e)?"name":"_id")}function mm(e){const t=rue(e.targetTypes),r=nue(e.defaultValue,t),[n,o]=f.useState(e.defaultValue),[i,a]=f.useState(r);function l(c){o(c),e.onChange&&e.onChange(c)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[t&&t.length>1&&s.jsx(ft,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:i,autoFocus:e.autoFocus,onChange:c=>a(c.currentTarget.value),data:t}),!t&&s.jsx(kx,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:i,onChange:a,name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(Ns,{resourceType:i,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:n,onChange:c=>{l(c?dt(c):void 0)}})]})}function rue(e){if(!(!e||e.length===0||e.length===1&&e[0]==="Resource"))return e}function nue(e,t){var n;const r=(n=e==null?void 0:e.reference)==null?void 0:n.split("/")[0];if(r)return r;if(t&&t.length>0)return t[0]}function oue(e){const[t,r]=f.useState(e.defaultValue&&Array.isArray(e.defaultValue)?e.defaultValue:[]),n=f.useRef();n.current=t;function o(i){r(i),e.onChange&&e.onChange(i)}return s.jsxs(Oe,{style:{marginTop:"1rem",marginLeft:"1rem"},children:[t.map((i,a)=>s.jsxs(K,{noWrap:!0,children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(oa,{arrayElement:!0,property:e.property,name:e.name+"."+a,defaultValue:i,onChange:l=>{const c=[...n.current];c[a]=l,o(c)}})}),s.jsx("div",{children:s.jsx(dr,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=[...n.current];c.splice(a,1),o(c)},children:s.jsx(nh,{})})})]},`${a}-${t.length}`)),s.jsx(K,{noWrap:!0,style:{justifyContent:"flex-end"},children:s.jsx("div",{children:s.jsx(dr,{title:"Add",size:"sm",color:"green",onClick:i=>{st(i);const a=[...n.current];a.push(void 0),o(a)},children:s.jsx(bx,{})})})})]})}const iue=["sun","mon","tue","wed","thu","fri","sat"];function aue(e){const[t,r]=f.useState(e.defaultValue),[n,o]=f.useState(!1),i=f.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx("span",{children:f5(i.current)||"No repeat"}),s.jsx(ne,{onClick:()=>o(!0),children:"Edit"})]}),s.jsx(sue,{visible:n,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),r(a),o(!1)},onCancel:()=>o(!1)})]})}const NO={repeat:{period:1,periodUnit:"d"}};function sue(e){const[t,r]=f.useState(e.defaultValue||NO),n=f.useRef();n.current=t;function o(u){r({...n.current,event:[u]})}function i(u){r({...n.current,repeat:u})}function a(u){var d;i({...(d=n.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=n.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=n.current)==null?void 0:d.repeat,dayOfWeek:u})}return s.jsx(Tr,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(Oe,{children:[s.jsx(tt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(ra,{name:"timing-dialog-start",onChange:u=>o(u)})}),s.jsx(tx,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?NO.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(tt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>a(parseInt(u.currentTarget.value,10)||1)}),s.jsx(ft,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx(tt,{title:"Repeat on",children:s.jsx(Vf.Group,{multiple:!0,onChange:c,children:s.jsx(K,{position:"apart",mt:"md",spacing:"xs",children:iue.map(u=>s.jsx(Vf,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),s.jsx(K,{position:"right",children:s.jsx(ne,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function oa(e){const t=e.property,r=e.defaultPropertyType??t.type[0].code,n=e.name,o=e.defaultValue;if(t.max>1&&!e.arrayElement)return r===B.Attachment?s.jsx(Cce,{name:n,defaultValue:o,onChange:e.onChange}):s.jsx(oue,{property:t,name:n,defaultValue:o,onChange:e.onChange});const i=t.type;return i.length>1?s.jsx(lue,{elementDefinitionTypes:i,...e}):s.jsx(o4,{elementDefinitionType:i[0],...e})}function lue(e){const t=e.elementDefinitionTypes;let r;e.defaultPropertyType&&(r=t.find(i=>i.code===e.defaultPropertyType)),r||(r=t[0]);const[n,o]=f.useState(r);return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:"200px"},defaultValue:n.code,onChange:i=>{o(t.find(a=>a.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(o4,{...e,elementDefinitionType:n,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",hr(n.code)))}})]})}function o4(e){var a,l,c;const t=e.property,r=e.elementDefinitionType.code,n=e.name,o=e.defaultValue,i=t.min!==void 0&&t.min>0;switch(r){case B.SystemString:case B.canonical:case B.string:case B.time:case B.uri:case B.url:return s.jsx(le,{id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case B.date:return s.jsx(le,{type:"date",id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case B.dateTime:case B.instant:return s.jsx(ra,{name:n,defaultValue:o,onChange:e.onChange,outcome:e.outcome});case B.decimal:case B.integer:case B.positiveInt:case B.unsignedInt:return s.jsx(le,{type:"number",step:r===B.decimal?"any":"1",id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.valueAsNumber)}});case B.code:return s.jsx(q5,{binding:(a=t.binding)==null?void 0:a.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.boolean:return s.jsx(jn,{id:n,name:n,"data-testid":n,defaultChecked:!!o,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.checked)}});case B.markdown:return s.jsx(jc,{id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)}});case B.Address:return s.jsx(Yse,{name:n,defaultValue:o,onChange:e.onChange});case B.Annotation:return s.jsx(Xse,{name:n,defaultValue:o,onChange:e.onChange});case B.Attachment:return s.jsx(K5,{name:n,defaultValue:o,onChange:e.onChange});case B.CodeableConcept:return s.jsx(Nce,{binding:(l=t.binding)==null?void 0:l.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.Coding:return s.jsx(t4,{binding:(c=t.binding)==null?void 0:c.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.ContactDetail:return s.jsx(Fce,{name:n,defaultValue:o,onChange:e.onChange});case B.ContactPoint:return s.jsx(r4,{name:n,defaultValue:o,onChange:e.onChange});case B.Extension:return s.jsx(Uce,{name:n,defaultValue:o,onChange:e.onChange});case B.HumanName:return s.jsx(Wce,{name:n,defaultValue:o,onChange:e.onChange});case B.Identifier:return s.jsx(Hce,{name:n,defaultValue:o,onChange:e.onChange});case B.Money:return s.jsx(qce,{name:n,defaultValue:o,onChange:e.onChange});case B.Period:return s.jsx(Qce,{name:n,defaultValue:o,onChange:e.onChange});case B.Duration:case B.Quantity:return s.jsx(na,{name:n,defaultValue:o,onChange:e.onChange});case B.Range:return s.jsx(Nx,{name:n,defaultValue:o,onChange:e.onChange});case B.Ratio:return s.jsx(Yce,{name:n,defaultValue:o,onChange:e.onChange});case B.Reference:return s.jsx(mm,{name:n,defaultValue:o,targetTypes:cue(t),onChange:e.onChange});case B.Timing:return s.jsx(aue,{name:n,defaultValue:o,onChange:e.onChange});case B.Dosage:case B.UsageContext:return s.jsx(oy,{typeName:r,defaultValue:o,onChange:e.onChange,outcome:e.outcome});default:return s.jsx(oy,{typeName:t.type[0].code,defaultValue:o,onChange:e.onChange,outcome:e.outcome})}}function cue(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 oy(e){const[t,r]=f.useState(e.defaultValue??{});function n(l){r(l),e.onChange&&e.onChange(l)}const o=e.typeName,i=lx(o);if(!i)return s.jsxs("div",{children:[o," not implemented"]});const a={type:o,value:t};return s.jsx(Oe,{children:Object.entries(i.elements).map(([l,c])=>{if(l==="id"||Y5.includes(l)||X5.includes(l)&&c.path.split(".").length===2||!c.type)return null;const[u,d]=ta(a,l),p=c.min!==void 0&&c.min>0;return c.type.length===1&&c.type[0].code==="boolean"?s.jsx(Z5,{title:th(l),description:c.description,htmlFor:l,children:s.jsx(oa,{property:c,name:l,defaultValue:u,defaultPropertyType:d,outcome:e.outcome,onChange:(h,m)=>{n(ny(t,l,m??l,c,h))}})},l):s.jsx(tt,{title:th(l),description:c.description,withAsterisk:p,htmlFor:l,outcome:e.outcome,children:s.jsx(oa,{property:c,name:l,defaultValue:u,defaultPropertyType:d,onChange:(h,m)=>{n(ny(t,l,m??l,c,h))}})},l)})})}const uue=W(()=>({root:{"@media (max-width: 800px)":{paddingLeft:4,paddingRight:4}}}));function Dc(e){const{children:t,...r}=e,{classes:n}=uue();return s.jsx(GT,{className:n.root,...r,children:t})}const due=W(e=>({noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));function i4({value:e}){const{classes:t}=due();return e?s.jsx(Oe,{justify:"flex-start",spacing:"xs",children:e.map(r=>{var n;return r.text&&s.jsx(mT,{classNames:{cite:t.noteCite,body:t.noteBody,root:t.noteRoot},cite:((n=r.authorReference)==null?void 0:n.display)||r.authorString,icon:null,children:r.text},`note-${r.text}`)})}):null}function Nc(e){const{value:t,link:r,...n}=e,[o,i]=f.useState(),a=Ke(t,i);let l;if(o&&!S5(o))l=`[${Ee(o)}]`;else if(a)l=Co(a);else return null;return r?s.jsx(ke,{to:t,...n,children:l}):s.jsx(re,{component:"span",...n,children:l})}function as(e){return s.jsxs(K,{spacing:"xs",children:[s.jsx(vi,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Nc,{value:e.value,link:e.link})]})}const fue={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red"};function a4(e){return s.jsx(IH,{color:fue[e.status],children:e.status})}const s4=W(e=>({table:{border:`0.1px solid ${e.colors.gray[5]}`,borderCollapse:"collapse","& td, & th":{border:`0.1px solid ${e.colors.gray[5]}`,padding:4}},criticalRow:{background:e.colorScheme==="dark"?e.colors.red[7]:e.colors.red[1],border:`0.1px solid ${e.colors.red[5]}`,color:e.colors.red[5],fontWeight:500,"& td":{border:`0.1px solid ${e.colors.red[5]}`}},noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));Ax.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Ax(e){var a;const t=ae(),r=Ke(e.value),[n,o]=f.useState();if(f.useEffect(()=>{r!=null&&r.specimen&&Promise.allSettled(r.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,r]),!r)return null;const i=(n==null?void 0:n.flatMap(l=>l.note||[]))||[];if(r.presentedForm&&r.presentedForm.length>0){const l=r.presentedForm[0];(a=l.contentType)!=null&&a.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return s.jsxs(Oe,{children:[s.jsx(he,{children:"Diagnostic Report"}),s.jsx(pue,{value:r}),n&&!e.hideSpecimenInfo&&hue(n),r.result&&s.jsx(mue,{hideObservationNotes:e.hideObservationNotes,value:r.result}),i.length>0&&s.jsx(i4,{value:i})]})}function pue({value:e}){var t,r;return s.jsxs(K,{mt:"md",spacing:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Subject"}),s.jsx(re,{children:s.jsx(as,{value:e.subject,link:!0})})]}),(t=e.resultsInterpreter)==null?void 0:t.map(n=>s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Interpreter"}),s.jsx(re,{children:s.jsx(as,{value:n,link:!0})})]},n.reference)),(r=e.performer)==null?void 0:r.map(n=>s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Performer"}),s.jsx(re,{children:s.jsx(as,{value:n,link:!0})})]},n.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Issued"}),s.jsx(re,{children:kr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Status"}),s.jsx(re,{children:hr(e.status)})]})]})}function hue(e){return s.jsxs(Oe,{spacing:"xs",children:[s.jsx(he,{order:2,size:"h6",children:"Specimens"}),s.jsx(Pr,{type:"ordered",children:e==null?void 0:e.map(t=>{var r;return s.jsx(Pr.Item,{ml:"sm",children:s.jsxs(K,{spacing:20,children:[s.jsxs(K,{spacing:5,children:[s.jsx(re,{fw:500,children:"Collected:"})," ",kr((r=t.collection)==null?void 0:r.collectedDateTime)]}),s.jsxs(K,{spacing:5,children:[s.jsx(re,{fw:500,children:"Received:"})," ",kr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function mue(e){const{classes:t}=s4();return s.jsxs("table",{className:t.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(l4,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function l4(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(r=>s.jsx(gue,{value:r,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${wa(r)?r.reference:r.id}`))})}function gue(e){var a,l;const{classes:t,cx:r}=s4(),n=Ke(e.value);if(!n||(a=e.ancestorIds)!=null&&a.includes(n.id))return null;const o=!e.hideObservationNotes&&n.note,i=xue(n);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:r({[t.criticalRow]:i}),children:[s.jsx("td",{rowSpan:o?2:1,children:s.jsx(ke,{to:n,children:s.jsx(Xn,{value:n.code})})}),s.jsx("td",{children:s.jsx(vue,{value:n})}),s.jsx("td",{children:s.jsx(yue,{value:n.referenceRange})}),s.jsx("td",{children:n.interpretation&&n.interpretation.length>0&&s.jsx(Xn,{value:n.interpretation[0]})}),s.jsx("td",{children:n.category&&n.category.length>0&&s.jsx(s.Fragment,{children:n.category.map(c=>s.jsx("div",{children:s.jsx(Xn,{value:c})},`category-${ws(c)}`))})}),s.jsx("td",{children:(l=n.performer)==null?void 0:l.map(c=>s.jsx(ih,{value:c},c.reference))}),s.jsx("td",{children:n.status&&s.jsx(a4,{status:n.status})})]}),n.hasMember&&s.jsx(l4,{value:n.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,n.id]:[n.id],hideObservationNotes:e.hideObservationNotes}),o&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(i4,{value:n.note})})})]})}function vue(e){const t=e.value;return s.jsx(s.Fragment,{children:p5(t)})}function yue(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(Ix,{value:t}):null}function xue(e){var r,n,o,i;const t=(i=(o=(n=(r=e.interpretation)==null?void 0:r[0])==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const wue=W((e,{width:t,fill:r})=>({paper:{maxWidth:t,margin:`${e.spacing.xl} auto`,padding:r?0:e.spacing.md,"@media (max-width: 800px)":{padding:r?0:8},"& img":{width:"100%",maxWidth:"100%"},"& video":{width:"100%",maxWidth:"100%"}}})),_ue={shadow:"xs",radius:"md",withBorder:!0};function Mx(e){const{className:t,children:r,width:n,fill:o,unstyled:i,...a}=H("Panel",_ue,e),{classes:l,cx:c}=wue({width:n,fill:o},{name:"Panel",unstyled:i});return s.jsx(on,{className:c(l.paper,t),...a,children:r})}const bue=W(e=>({root:{borderCollapse:"collapse",width:"100%","& tr":{borderTop:`0.1px solid ${e.colors.gray[3]}`},"& th, & td":{padding:`${e.spacing.sm} ${e.spacing.sm}`,verticalAlign:"top"}},removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Sue(e){const{classes:t}=bue(),r=ae(),[n,o]=f.useState(!1);if(f.useEffect(()=>{r.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.original.resourceType]),!n)return null;const i=O5(e.original.resourceType);return s.jsxs("table",{className:t.root,children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:"30%"}}),s.jsx("col",{style:{width:"35%"}}),s.jsx("col",{style:{width:"35%"}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Property"}),s.jsx("th",{children:"Before"}),s.jsx("th",{children:"After"})]})}),s.jsx("tbody",{children:Object.entries(i.elements).map(([a,l])=>{if(a==="id"||a==="meta")return null;const[c,u]=ta(Zn(e.original),a),[d,p]=ta(Zn(e.revised),a);return AO(c)&&AO(d)||sr(c)===sr(d)?null:s.jsxs("tr",{children:[s.jsx("td",{children:th(a)}),s.jsx("td",{className:t.removed,children:s.jsx($o,{property:l,propertyType:u,value:c,ignoreMissingValues:!0})}),s.jsx("td",{className:t.added,children:s.jsx($o,{property:l,propertyType:p,value:d,ignoreMissingValues:!0})})]},a)})})]})}function AO(e){return!e||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0}function Lx(e){const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1);return f.useEffect(()=>{r&&t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log)},[t,r]),!n||!r?null:s.jsx(ry,{value:{type:r.resourceType,value:e.forceUseInput?e.value:r},ignoreMissingValues:e.ignoreMissingValues})}function Pue(e){return s.jsx(Dc,{children:e.children})}function ia(e){var c,u;const{resource:t,profile:r,padding:n,popupMenuItems:o,...i}=e,a=r??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs(Mx,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(K,{position:"apart",spacing:8,mx:"xs",my:"sm",children:[s.jsx(vi,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",children:s.jsx(Nc,{color:"dark",weight:500,value:a,link:!0})}),s.jsxs(re,{size:"xs",children:[s.jsx(ke,{color:"dimmed",to:e.resource,children:kr(l)}),s.jsx(re,{component:"span",color:"dimmed",mx:8,children:"·"}),s.jsx(ke,{color:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(X,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(X.Target,{children:s.jsx(dr,{radius:"xl","aria-label":`Actions for ${et(e.resource)}`,children:s.jsx(_le,{})})}),o]})]}),s.jsxs(H5,{children:[n&&s.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!n&&s.jsx(s.Fragment,{children:e.children})]})]})}function c4(e,t){e.sort((r,n)=>{const o=MO(r,t),i=MO(n,t);return o>i?1:o<i?-1:LO(r,t)-LO(n,t)})}function MO(e,t){if(!u4(e,t)){const r=e.priority;if(typeof r=="string")return{stat:4,asap:3,urgent:2}[r]??0}return 0}function LO(e,t){var n;if(!u4(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const r=(n=e.meta)==null?void 0:n.lastUpdated;return r?new Date(r).getTime():0}function u4(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const jue=W(e=>({pinnedComment:{backgroundColor:e.colors.blue[0]}}));function gm(e){const t=ae(),r=um(),n=t.getProfile(),o=f.useRef(null),i=Ke(e.value),[a,l]=f.useState(),[c,u]=f.useState([]),d=e.loadTimelineResources,p=f.useRef(c);p.current=c;const h=f.useCallback(T=>{c4(T,i),T.reverse(),u(T)},[i]),m=f.useCallback(T=>{const z=[];for(const M of T){if(M.status!=="fulfilled")continue;const L=M.value;if(L.type==="history"&&l(L),L.entry)for(const q of L.entry)z.push(q.resource)}h(z)},[h]),v=f.useCallback(T=>h([...p.current,T]),[h]),g=f.useCallback(()=>{var M;let T,z;"resourceType"in e.value?(T=e.value.resourceType,z=e.value.id):[T,z]=(M=e.value.reference)==null?void 0:M.split("/"),d(t,T,z).then(m).catch(console.log)},[t,e.value,d,m]);f.useEffect(()=>g(),[g]);function b(T){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,T)).then(z=>v(z)).catch(console.log)}function y(T){!i||!e.createMedia||t.createResource(e.createMedia(i,n,T)).then(z=>v(z)).then(()=>wl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(fm,{size:16}),autoClose:2e3})).catch(z=>wl({id:"upload-notification",color:"red",title:"Upload error",message:Ee(z),icon:s.jsx(kO,{size:16}),autoClose:2e3}))}function x(T,z){return t.updateResource({...T,priority:z})}function _(T){x(T,"stat").then(g).catch(console.log)}function w(T){x(T,"routine").then(g).catch(console.log)}function O(T){r(`/${T.resourceType}/${T.id}`)}function C(T){r(`/${T.resourceType}/${T.id}/edit`)}function P(T){r(`/${T.resourceType}/${T.id}/delete`)}function E(T){var z;r(`/${T.resourceType}/${T.id}/_history/${(z=T.meta)==null?void 0:z.versionId}`)}function k(){me({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function $(T){wl({id:"upload-notification",loading:!0,title:"Uploading...",message:Tue(T),autoClose:!1,withCloseButton:!1})}function I(T){wl({id:"upload-notification",color:"red",title:"Upload error",message:Ee(T),icon:s.jsx(kO,{size:16}),autoClose:2e3})}return i?s.jsxs(Pue,{children:[e.createCommunication&&s.jsx(Mx,{children:s.jsx(De,{testid:"timeline-form",onSubmit:T=>{b(T.text);const z=o.current;z&&(z.value="",z.focus())},children:s.jsxs(K,{spacing:"xs",noWrap:!0,style:{width:"100%"},children:[s.jsx(vi,{value:n}),s.jsx(le,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(dr,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(Rle,{size:16})}),s.jsx(Rx,{onUpload:y,onUploadStart:k,onUploadProgress:$,onUploadError:I,children:T=>s.jsx(dr,{...T,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Sx,{size:16})})})]})})}),c.map(T=>{var M;if(!T)return null;const z=`${T.resourceType}/${T.id}/${(M=T.meta)==null?void 0:M.versionId}`;if(T.resourceType===i.resourceType&&T.id===i.id)return s.jsx(Oue,{history:a,resource:T,onDetails:E},z);switch(T.resourceType){case"AuditEvent":return s.jsx(kue,{resource:T,onDetails:O},z);case"Communication":return s.jsx(Eue,{resource:T,onPin:T.priority!=="stat"?_:void 0,onUnpin:T.priority==="stat"?w:void 0,onDetails:O,onEdit:C,onDelete:P},z);case"DiagnosticReport":return s.jsx(Rue,{resource:T,onDetails:O,onEdit:C,onDelete:P},z);case"Media":return s.jsx($ue,{resource:T,onDetails:O,onEdit:C,onDelete:P},z);default:return s.jsx(ia,{resource:T,padding:!0,children:s.jsx(Lx,{value:T,ignoreMissingValues:!0})},z)}})]}):s.jsx(or,{style:{width:"100%",height:"100%"},children:s.jsx(cn,{})})}function bs(e){return s.jsxs(X.Dropdown,{children:[s.jsx(X.Label,{children:"Resource"}),e.onPin&&s.jsx(X.Item,{icon:s.jsx(Dle,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${et(e.resource)}`,children:"Pin"}),e.onUnpin&&s.jsx(X.Item,{icon:s.jsx(Nle,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${et(e.resource)}`,children:"Unpin"}),e.onDetails&&s.jsx(X.Item,{icon:s.jsx(Cle,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${et(e.resource)}`,children:"Details"}),e.onEdit&&s.jsx(X.Item,{icon:s.jsx(ble,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${et(e.resource)}`,children:"Edit"}),e.onDelete&&s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Label,{children:"Danger zone"}),s.jsx(X.Item,{color:"red",icon:s.jsx(W5,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${et(e.resource)}`,children:"Delete"})]})]})}function Oue(e){const t=Cue(e.history,e.resource);return t?s.jsx(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(Sue,{original:t,revised:e.resource})}):s.jsxs(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:[s.jsx("h3",{children:"Created"}),s.jsx(Lx,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function Cue(e,t){const r=e.entry,n=r.findIndex(o=>{var i,a,l;return((a=(i=o.resource)==null?void 0:i.meta)==null?void 0:a.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(n>=r.length-1))return r[n+1].resource}function Eue(e){var o,i;const{classes:t}=jue(),n=!e.resource.priority||e.resource.priority==="routine"?void 0:t.pinnedComment;return s.jsx(ia,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx("p",{children:(i=(o=e.resource.payload)==null?void 0:o[0])==null?void 0:i.contentString})})}function $ue(e){var n;const t=(n=e.resource.content)==null?void 0:n.contentType,r=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(ia,{resource:e.resource,padding:!!r,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(Ic,{value:e.resource.content})})}function kue(e){return s.jsx(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(da,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function Rue(e){return s.jsx(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(Ax,{value:e.resource})})}function Tue(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${$g(e.loaded)} / ${$g(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${$g(e.loaded)}`}function $g(e){if(e===0)return"0.00 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP".charAt(t)+"B"}function Iue(e){return s.jsx(gm,{value:e.resource,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,i=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:i})])}})}function Se(e){const{children:t,...r}=e;return s.jsx(Dc,{children:s.jsx(Mx,{...r,children:t})})}function Due(e){return s.jsx(gm,{value:e.encounter,loadTimelineResources:async(t,r,n)=>Promise.allSettled([t.readHistory("Encounter",n),t.search("Communication","encounter=Encounter/"+n),t.search("Media","encounter=Encounter/"+n)]),createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",encounter:dt(t),subject:t.subject,sender:dt(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",encounter:dt(t),subject:t.subject,operator:dt(r),issued:new Date().toISOString(),content:n})})}function Nue(e){let t;try{t=Yae(e.path,e.resource)}catch(r){return console.warn("FhirPathDisplay:",r),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx($o,{value:t[0]||"",propertyType:e.propertyType})}function Aue(e){return s.jsxs(Tr,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(oe,{display:"flex",sx:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(zO,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(zO,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(re,{sx:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function zO(e){return s.jsx(ne,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const Mue={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]},Lue={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 zx(e,t){return{...e,filters:t,offset:0,name:void 0}}function Fx(e,t){return zx(e,(e.filters??[]).filter(r=>r.code!==t))}function vm(e,t,r,n,o){o&&(e=Fx(e,t));const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:r,value:n??""}),zx(e,i)}function zue(e,t){if(!e.filters)return e;const r=[...e.filters];return r.splice(t,1),{...e,filters:r,name:void 0}}function Fue(e,t){return Vx(e,t,-1)}function Vue(e,t){return Vx(e,t,0)}function Bue(e,t){return Vx(e,t,1)}function Vx(e,t,r){const n=new Date;n.setDate(n.getDate()+r),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),Ux(e,t,n,o)}function Uue(e,t){return Bx(e,t,-1)}function Wue(e,t){return Bx(e,t,0)}function Hue(e,t){return Bx(e,t,1)}function Bx(e,t,r){const n=new Date;n.setMonth(n.getMonth()+r),n.setDate(1),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),Ux(e,t,n,o)}function Gue(e,t){const r=new Date;return r.setMonth(0),r.setDate(1),r.setHours(0,0,0,0),Ux(e,t,r,new Date)}function Ux(e,t,r,n){return e=Fx(e,t),e=FO(e,t,te.GREATER_THAN_OR_EQUALS,r),e=FO(e,t,te.LESS_THAN_OR_EQUALS,n),e}function FO(e,t,r,n){return vm(e,t,r,n.toISOString())}function VO(e,t,r=!0){return vm(e,t,te.MISSING,r.toString())}function que(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function Que(e,t){const r=e.count??Tc,n=(t-1)*r;return que(e,n)}function Kue(e,t,r){return t===Yue(e)&&r!==void 0&&r===Xue(e)?e:{...e,sortRules:[{code:t,descending:!!r}],name:void 0}}function Yue(e){const t=e.sortRules;if(!t||t.length===0)return;const r=t[0].code;return r.startsWith("-")?r.substr(1):r}function Xue(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function Jue(e){return Mue[e.type]}function Wx(e){return Lue[e]??""}function yi(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(hr).join(" "))}function Zue(e,t){var n,o;const r=t.name;return r==="id"?e.id:r==="meta.versionId"?(n=e.meta)==null?void 0:n.versionId:r==="_lastUpdated"?kr((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?ede(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?tde(e,t.searchParams[0]):null}function ede(e,t){var i,a,l;const r=((l=(a=(i=t.path)==null?void 0:i.split("."))==null?void 0:a.pop())==null?void 0:l.replaceAll("[x]",""))??"",[n,o]=ta({type:e.resourceType,value:e},r);return n?s.jsx($o,{property:t,propertyType:o,value:n,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function tde(e,t){const r=gx(t.expression,[{type:e.resourceType,value:e}]);return!r||r.length===0?null:s.jsx(s.Fragment,{children:r.map((n,o)=>s.jsx($o,{propertyType:n.type,value:n.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${r.length}`))})}function rde(e){const t=f.useRef(!1),[r,n]=f.useState({search:JSON.parse(sr(e.search))}),[o,i]=f.useState(!1);f.useEffect(()=>{n({search:e.search})},[e.search]);const a=f.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=O5(c),d=cx(c);return nde(u,d).sort((p,h)=>p.localeCompare(h)).map(p=>({value:p,label:yi(p)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){n({search:{...r.search,fields:c}})}return s.jsx(Tr,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(Oe,{children:[s.jsx(em,{withinPortal:!0,style:{width:550},placeholder:"Select fields to display",data:a,value:r.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",dropdownPosition:"bottom",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(K,{position:"right",children:s.jsx(ne,{onClick:()=>e.onOk(r.search),children:"OK"})})]})})}function nde(e,t){const r=[],n=new Set,o=new Set;for(const i of Object.keys(e.elements))r.push(i),n.add(i.toLowerCase()),o.add(yi(i));if(t)for(const i of Object.keys(t)){const a=yi(i);!n.has(i)&&!o.has(a)&&(r.push(i),n.add(i),o.add(a))}return r}function d4(e){var o;const{resourceType:t,filter:r}=e,n=(o=gi.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.jsx(Nc,{value:{reference:r.value}});const i=vx(t,n);if(r.code==="_lastUpdated"||i.type===Yo.DATETIME)return s.jsx(s.Fragment,{children:kr(r.value)})}return s.jsx(s.Fragment,{children:r.value})}function f4(e){const t=vx(e.resourceType,e.searchParam),r="filter-value";switch(t.type){case Yo.REFERENCE:return s.jsx(mm,{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 Yo.BOOLEAN:return s.jsx(jn,{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 Yo.DATE:return s.jsx(le,{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 Yo.DATETIME:return s.jsx(ra,{name:r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Yo.NUMBER:return s.jsx(le,{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 Yo.QUANTITY:return s.jsx(na,{name:r,defaultValue:ode(e.defaultValue),autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(`${n.value}`):e.onChange("")}});default:return s.jsx(le,{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 ode(e){if(e){const[t,r,n]=e.split("|");if(t)return{value:parseFloat(t),system:r,unit:n}}}function ide(e){const[t,r]=f.useState(JSON.parse(sr(e.search))),[n,o]=f.useState(-1),i=f.useRef(t);i.current=t,f.useEffect(()=>{r(JSON.parse(sr(e.search)))},[e.search]);function a(d){r(vm(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=cx(l)??{},u=t.filters||[];return s.jsxs(Tr,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,p)=>p===n?s.jsx(BO,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[p]=h,r(zx(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(ade,{resourceType:l,searchParams:c,filter:d,onEdit:()=>o(p),onDelete:()=>r(zue(i.current,p))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(BO,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function ade(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:yi(t.code)}),s.jsx("td",{children:Wx(t.operator)}),s.jsx("td",{children:s.jsx(d4,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function BO(e){const[t,r]=f.useState(e.defaultValue??{}),n=f.useRef(t);n.current=t;function o(u){r({...n.current,code:u})}function i(u){r({...n.current,operator:u})}function a(u){r({...n.current,value:u})}const l=e.searchParams[t.code],c=l&&Jue(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ft,{"data-testid":"filter-field",defaultValue:n.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:yi(u)}))]})}),s.jsx("td",{children:c&&s.jsx(ft,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:Wx(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(f4,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(ne,{compact:!0,variant:"outline",onClick:()=>{e.onOk(n.current),r({})},children:e.okText}),e.onCancel&&s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function sde(e){const[t,r]=f.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function n(){e.onOk({...e.filter,value:t})}return s.jsx(Tr,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(De,{onSubmit:n,children:s.jsxs(tn,{children:[s.jsx(tn.Col,{span:10,children:s.jsx(f4,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:r})}),s.jsx(tn.Col,{span:2,children:s.jsx(ne,{onClick:n,fullWidth:!0,children:"OK"})})]})})})}function lde(e){if(!e.searchParams)return null;function t(i,a){o(Kue(e.search,i.code,a))}function r(i){o(Fx(e.search,i.code))}function n(i,a){e.onPrompt(i,{code:i.code,operator:a,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(cde,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:n,onChange:o,onClear:r}):s.jsx(X.Dropdown,{children:e.searchParams.map(i=>s.jsx(X.Item,{children:yi(i.code)},i.code))})}function cde(e){switch(e.searchParam.type){case"date":return s.jsx(ude,{...e});case"number":case"quantity":return s.jsx(dde,{...e});case"reference":return s.jsx(fde,{...e});case"string":case"token":case"uri":return s.jsx(pde,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function ude(e){const{searchParam:t}=e,r=t.code;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Px,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(X.Item,{icon:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(U5,{size:14}),onClick:()=>e.onPrompt(t,te.ENDS_BEFORE),children:"Before..."}),s.jsx(X.Item,{icon:s.jsx(B5,{size:14}),onClick:()=>e.onPrompt(t,te.STARTS_AFTER),children:"After..."}),s.jsx(X.Item,{icon:s.jsx(ule,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Between..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Bue(e.search,r)),children:"Tomorrow"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Vue(e.search,r)),children:"Today"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Fue(e.search,r)),children:"Yesterday"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Hue(e.search,r)),children:"Next Month"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Wue(e.search,r)),children:"This Month"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Uue(e.search,r)),children:"Last Month"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Gue(e.search,r)),children:"Year to date"}),s.jsx(ym,{...e})]})}function dde(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Px,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(X.Item,{icon:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(B5,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN),children:"Greater than..."}),s.jsx(X.Item,{icon:s.jsx(ty,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(X.Item,{icon:s.jsx(U5,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN),children:"Less than..."}),s.jsx(X.Item,{icon:s.jsx(ty,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(ym,{...e})]})}function fde(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(ym,{...e})]})}function pde(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Px,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(X.Item,{icon:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(ple,{size:14}),onClick:()=>e.onPrompt(t,te.CONTAINS),children:"Contains..."}),s.jsx(X.Item,{icon:s.jsx(fle,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Does not contain..."}),s.jsx(ym,{...e})]})}function ym(e){const{searchParam:t}=e,r=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(lle,{size:14}),onClick:()=>e.onChange(VO(e.search,r)),children:"Missing"}),s.jsx(X.Item,{icon:s.jsx(sle,{size:14}),onClick:()=>e.onChange(VO(e.search,r,!1)),children:"Not missing"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(oh,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function hde(e){const t=e.resourceType,r=[];for(const n of e.fields||["id","_lastUpdated"])r.push(mde(t,n));return r}function mde(e,t){var o;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const r=xa(e,t),n=_ae(e,t.toLowerCase());if(r&&n)return{name:t,elementDefinition:r,searchParams:[n]};if(r){const i=cx(e);let a;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);a=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),a.length===0&&(a=void 0)}return{name:t,elementDefinition:r,searchParams:a}}if(n){const i=vx(e,n);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[n]}}return{name:t}}class gde extends Event{constructor(t){super("change"),this.definition=t}}class vde extends Event{constructor(t){super("load"),this.response=t}}class ah extends Event{constructor(t,r){super("click"),this.resource=t,this.browserEvent=r}}const yde=W(e=>({root:{maxWidth:"100%",overflow:"auto",textAlign:"left",marginBottom:"20px"},table:{cursor:"pointer"},tr:{"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]}},th:{padding:"0 !important"},control:{width:"100%",padding:`${e.spacing.xs} ${e.spacing.md}`,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}},icon:{width:21,height:21,borderRadius:21}}));function xde(e){var L,q,Y;const{classes:t}=yde(),r=ae(),[n,o]=f.useState(!1),[i,a]=f.useState(),{search:l,onLoad:c}=e,[u,d]=f.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),p=f.useRef(u);p.current=u;const h=l.total??"accurate",m=f.useCallback(R=>{a(void 0),r.search(l.resourceType,Ka({...l,total:h,fields:void 0}),R).then(N=>{d({...p.current,searchResponse:N}),c&&c(new vde(N))}).catch(N=>{d({...p.current,searchResponse:void 0}),a(N)})},[r,l,h,c]),v=f.useCallback(()=>{d({...p.current,searchResponse:void 0}),m({cache:"reload"})},[m]);f.useEffect(()=>{m()},[m]);function g(R,N){R.stopPropagation();const Q=R.target.checked,ee={...p.current.selected};Q?ee[N]=!0:delete ee[N],d({...p.current,selected:ee})}function b(R){R.stopPropagation();const V=R.target.checked,Q={},ee=p.current.searchResponse;V&&(ee!=null&&ee.entry)&&ee.entry.forEach(_e=>{var we;(we=_e.resource)!=null&&we.id&&(Q[_e.resource.id]=!0)}),d({...p.current,selected:Q})}function y(){var N,V;const R=p.current;if(!((N=R.searchResponse)!=null&&N.entry)||R.searchResponse.entry.length===0)return!1;for(const Q of R.searchResponse.entry)if((V=Q.resource)!=null&&V.id&&!R.selected[Q.resource.id])return!1;return!0}function x(R){e.onChange&&e.onChange(new gde(R))}function _(R,N){if(G5(R.target)||R.button===2)return;st(R);const V=R.button===1||R.ctrlKey||R.metaKey;!V&&e.onClick&&e.onClick(new ah(N,R)),V&&e.onAuxClick&&e.onAuxClick(new ah(N,R))}function w(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(f.useEffect(()=>{o(!1),r.requestSchema(e.search.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.search.resourceType]),!n)return s.jsx(or,{style:{width:"100%",height:"100%"},children:s.jsx(cn,{})});const O=e.checkboxesEnabled,C=hde(l),P=l.resourceType,E=u.searchResponse,k=E==null?void 0:E.entry,$=k==null?void 0:k.map(R=>R.resource),I="subtle",T="gray",z=16,M=window.innerWidth<768;return s.jsxs("div",{className:t.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(K,{position:"apart",mb:"xl",children:[s.jsxs(K,{spacing:2,children:[s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(vle,{size:z}),onClick:()=>d({...p.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Ple,{size:z}),onClick:()=>d({...p.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Sle,{size:z}),onClick:e.onNew,children:"New..."}),!M&&w()&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Hle,{size:z}),onClick:e.onExport?e.onExport:()=>d({...p.current,exportDialogVisible:!0}),children:"Export..."}),!M&&e.onDelete&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(W5,{size:z}),onClick:()=>e.onDelete(Object.keys(u.selected)),children:"Delete..."}),!M&&e.onBulk&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(cle,{size:z}),onClick:()=>e.onBulk(Object.keys(u.selected)),children:"Bulk..."})]}),s.jsxs(K,{spacing:2,children:[E&&s.jsxs(re,{size:"xs",color:"dimmed",children:[Sde(l,E.total),"-",Pde(l,E.total)," of"," ",`${h==="estimate"?"~":""}${(L=E.total)==null?void 0:L.toLocaleString()}`]}),s.jsx(dr,{title:"Refresh",onClick:v,children:s.jsx(zle,{size:"1.125rem"})})]})]}),s.jsxs(ma,{className:t.table,children:[s.jsxs("thead",{children:[s.jsxs("tr",{children:[O&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:y(),onChange:R=>b(R)})}),C.map(R=>s.jsx("th",{children:s.jsxs(X,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(X.Target,{children:s.jsx(wo,{className:t.control,children:s.jsxs(K,{position:"apart",noWrap:!0,children:[s.jsx(re,{weight:500,size:"sm",children:yi(R.name)}),s.jsx(or,{className:t.icon,children:s.jsx(ole,{size:14,stroke:1.5})})]})})}),s.jsx(lde,{search:e.search,searchParams:R.searchParams,onPrompt:(N,V)=>{d({...p.current,filterDialogVisible:!0,filterDialogSearchParam:N,filterDialogFilter:V})},onChange:N=>{x(N)}})]})},R.name))]}),!e.hideFilters&&s.jsxs("tr",{children:[O&&s.jsx("th",{}),C.map(R=>s.jsx("th",{children:R.searchParams&&s.jsx(wde,{resourceType:P,searchParams:R.searchParams,filters:e.search.filters})},R.name))]})]}),s.jsx("tbody",{children:$==null?void 0:$.map(R=>R&&s.jsxs("tr",{className:t.tr,"data-testid":"search-control-row",onClick:N=>_(N,R),onAuxClick:N=>_(N,R),children:[O&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!u.selected[R.id],onChange:N=>g(N,R.id)})}),C.map(N=>s.jsx("td",{children:Zue(R,N)},N.name))]},R.id))})]}),($==null?void 0:$.length)===0&&s.jsx(Dc,{children:s.jsx(or,{style:{height:150},children:s.jsx(re,{size:"xl",color:"dimmed",children:"No results"})})}),(E==null?void 0:E.total)!==void 0&&E.total>0&&s.jsx(or,{m:"md",p:"md",children:s.jsx(to,{value:_de(l),total:bde(l,E.total),onChange:R=>x(Que(l,R)),getControlProps:R=>{switch(R){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),i&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),s.jsx(rde,{search:e.search,visible:p.current.fieldEditorVisible,onOk:R=>{x(R),d({...p.current,fieldEditorVisible:!1})},onCancel:()=>{d({...p.current,fieldEditorVisible:!1})}}),s.jsx(ide,{search:e.search,visible:p.current.filterEditorVisible,onOk:R=>{x(R),d({...p.current,filterEditorVisible:!1})},onCancel:()=>{d({...p.current,filterEditorVisible:!1})}}),s.jsx(Aue,{visible:p.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{d({...p.current,exportDialogVisible:!1})}}),s.jsx(sde,{visible:p.current.filterDialogVisible,title:(q=u.filterDialogSearchParam)!=null&&q.code?yi(u.filterDialogSearchParam.code):"",resourceType:P,searchParam:u.filterDialogSearchParam,filter:u.filterDialogFilter,defaultValue:"",onOk:R=>{x(vm(e.search,R.code,R.operator,R.value)),d({...p.current,filterDialogVisible:!1})},onCancel:()=>{d({...p.current,filterDialogVisible:!1})}},(Y=u.filterDialogSearchParam)==null?void 0:Y.code)]})}const Ac=S.memo(xde);function wde(e){const t=(e.filters??[]).filter(r=>e.searchParams.find(n=>n.code===r.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(r=>s.jsxs("div",{children:[Wx(r.operator)," ",s.jsx(d4,{resourceType:e.resourceType,filter:r})]},`filter-${r.code}-${r.operator}-${r.value}`))})}function _de(e){return Math.floor((e.offset??0)/(e.count??Tc))+1}function bde(e,t){const r=e.count??Tc;return Math.ceil(t/r)}function Sde(e,t){return Math.min(t,(e.offset??0)+1)}function Pde(e,t){return Math.min(t,((e.offset??0)+1)*(e.count??Tc))}function jde(e){const t=ae(),[r,n]=f.useState(!1),[o,i]=f.useState(),{query:a,fields:l}=e,[c,u]=f.useState(),[d,p]=f.useState({}),h=f.useRef();h.current=c;const m=f.useRef({});m.current=d,f.useEffect(()=>{i(void 0),t.graphql(a).then(u).catch(_=>i(ct(_)))},[t,a]);function v(_,w){_.stopPropagation();const C=_.target.checked,P={...m.current};C?P[w]=!0:delete P[w],p(P)}function g(_){var E;_.stopPropagation();const O=_.target.checked,C={},P=(E=h.current)==null?void 0:E.data.ResourceList;O&&P&&P.forEach(k=>{k.id&&(C[k.id]=!0)}),p(C)}function b(){var w;const _=(w=h.current)==null?void 0:w.data.ResourceList;if(!_||_.length===0)return!1;for(const O of _)if(O.id&&!m.current[O.id])return!1;return!0}function y(_,w){G5(_.target)||(st(_),_.button!==1&&e.onClick&&e.onClick(new ah(w,_)),_.button===1&&e.onAuxClick&&e.onAuxClick(new ah(w,_)))}if(f.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>n(!0)).catch(console.log)},[t,e.resourceType]),!r)return s.jsx(cn,{});const x=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:_=>st(_),"data-testid":"search-control",children:[s.jsxs(ma,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[x&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:b(),onChange:_=>g(_)})}),l.map(_=>s.jsx("th",{children:_.name},_.name))]})}),s.jsx("tbody",{children:c==null?void 0:c.data.ResourceList.map(_=>_&&s.jsxs("tr",{"data-testid":"search-control-row",onClick:w=>y(w,_),onAuxClick:w=>y(w,_),children:[x&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${_.id}`,checked:!!d[_.id],onChange:w=>v(w,_.id)})}),l.map(w=>s.jsx("td",{children:s.jsx(Nue,{propertyType:w.propertyType,path:w.fhirPath,resource:_})},w.name))]},_.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(ne,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const Ode=S.memo(jde);function En(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function Cde(e){const{group:t}=e;return s.jsx(on,{withBorder:!0,radius:"md",p:"xs",display:"flex",sx:{alignItems:"center",justifyContent:"center"},children:s.jsxs(K,{children:[t.measureScore&&s.jsx(kde,{group:t}),!t.measureScore&&s.jsx($de,{group:t})]})})}function Ede(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(re,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(re,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function $de(e){const{group:t}=e,r=t.population,n=r==null?void 0:r.find(c=>ws(c.code)==="numerator"),o=r==null?void 0:r.find(c=>ws(c.code)==="denominator"),i=n==null?void 0:n.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(oe,{children:[s.jsx(he,{order:3,children:"Not Applicable"}),s.jsx(re,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(oe,{children:[s.jsx(he,{order:3,children:"Insufficient Data"}),s.jsx(re,{children:`Numerator: ${i}`}),s.jsx(re,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(ex,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:p4(l)}],label:s.jsx(Zf,{justify:"center",children:s.jsxs(re,{fw:700,fz:18,children:[i," / ",a]})})})}function kde(e){var n,o,i;const{group:t}=e,r=((n=t.measureScore)==null?void 0:n.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:r==="%"?s.jsx(ex,{size:120,thickness:12,roundCaps:!0,sections:[{value:Rde(t),color:p4(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(Zf,{justify:"center",children:s.jsx(re,{fw:700,fz:18,children:s.jsx(sc,{value:t.measureScore})})})}):s.jsx(Zf,{h:120,align:"center",children:s.jsx(he,{order:3,children:s.jsx(sc,{value:t.measureScore})})})})}function Rde(e){var n,o;const t=(n=e.measureScore)==null?void 0:n.value,r=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&r==="%"?t*100:t:0}function p4(e){return e<=33?"red":e<=67?"yellow":"green"}function Tde(e){var n;const t=Ke(e.measureReport),[r]=Qse("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(oe,{children:[r&&s.jsx(Ede,{measure:r}),s.jsx(_N,{cols:3,breakpoints:[{maxWidth:"48rem",cols:2,spacing:"md"},{maxWidth:"36rem",cols:1,spacing:"sm"}],spacing:"md",children:(n=t.group)==null?void 0:n.map((o,i)=>s.jsx(Cde,{group:o},o.id??i))})]}):null}function bi(e){var r;const t=((r=e.outcome)==null?void 0:r.issue)||e.issues;return!t||t.length===0?null:s.jsx(_c,{icon:s.jsx(dm,{size:16}),color:"red",children:t.map(n=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:j5(n)},(o=n.details)==null?void 0:o.text)})})}function Ide(e){const t=f.useCallback((r,n,o)=>{const i=`${n}/${o}`,a=100;return Promise.allSettled([r.readHistory("Patient",o),r.search("Communication",{subject:i,_count:a}),r.search("Device",{patient:i,_count:a}),r.search("DeviceRequest",{patient:i,_count:a}),r.search("DiagnosticReport",{subject:i,_count:a}),r.search("Media",{subject:i,_count:a}),r.search("ServiceRequest",{subject:i,_count:a}),r.search("Task",{subject:i,_count:a})])},[]);return s.jsx(gm,{value:e.patient,loadTimelineResources:t,createCommunication:(r,n,o)=>({resourceType:"Communication",status:"completed",subject:dt(r),sender:dt(n),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,n,o)=>({resourceType:"Media",status:"completed",subject:dt(r),operator:dt(n),issued:new Date().toISOString(),content:o})})}const h4=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}}}));function Dde(e){const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){c(void 0)}function h(){a(void 0)}const m=f.useRef();if(m.current=u,f.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(d(Fde(r??{resourceType:"PlanDefinition"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!u)return null;function v(g,b){d({...m.current,[g]:b})}return s.jsx("div",{children:s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(le,{label:"Plan Title",defaultValue:u.title,onChange:g=>v("title",g.currentTarget.value)}),s.jsx(m4,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:g=>v("action",g)}),s.jsx(ne,{type:"submit",children:"Save"})]})})}function m4(e){const{classes:t}=h4(),r=f.useRef();r.current=e.actions;function n(a){e.onChange(r.current.map(l=>l.id===a.id?a:l))}function o(a){e.onChange([...r.current,a]),e.setSelectedKey(a.id)}function i(a){e.onChange(r.current.filter(l=>l!==a))}return s.jsxs("div",{className:t.section,children:[e.actions.map(a=>s.jsx("div",{children:s.jsx(Nde,{action:a,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(a)})},a.id)),s.jsx("div",{className:t.bottomActions,children:s.jsx(Le,{href:"#",onClick:a=>{st(a),o({id:v4()})},children:"Add action"})})]})}function Nde(e){const{classes:t,cx:r}=h4(),{action:n}=e,o=zde(n),i=e.selectedKey===e.action.id,a=e.hoverKey===e.action.id;function l(d){d.stopPropagation(),e.setSelectedKey(e.action.id)}function c(d){st(d),e.setHoverKey(e.action.id)}const u=r(t.section,{[t.editing]:i,[t.hovering]:a&&!i});return s.jsxs("div",{"data-testid":n.id,className:u,onClick:l,onMouseOver:c,children:[i?s.jsx(Mde,{action:n,actionType:o,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(Ade,{action:n,actionType:o}),s.jsx("div",{className:t.bottomActions,children:s.jsx(Le,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()},children:"Remove"})})]})}const iy={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function Ade(e){const{action:t,actionType:r}=e,[n,o]=g4(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",r&&`(${r})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(ih,{value:{reference:t.definitionCanonical}})}),n&&s.jsx("div",{children:s.jsx($o,{property:iy,propertyType:o,value:n})})]})}function Mde(e){const{action:t}=e,[r,n]=f.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(Oe,{spacing:"xl",children:[s.jsx(le,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(le,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(ft,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:r,onChange:i=>n(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&s.jsx(m4,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(r){case"appointment":return s.jsx(Fu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(Fu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(Fu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(Fu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(tt,{title:"Timing",description:"When the action should take place.",children:s.jsx(Lde,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Fu(e){const{id:t,definitionCanonical:r}=e.action,n=r!=null&&r.startsWith(e.resourceType+"/")?{reference:r}:void 0;return s.jsx(Ns,{name:t,resourceType:e.resourceType,defaultValue:n,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:et(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function Lde(e){const t=e.action,r="timing",[n,o]=g4(t);return s.jsx(oa,{property:iy,name:"timing[x]",defaultValue:n,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(ny(t,r,a??r,iy,i))}})}function zde(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 g4(e){return ta({type:"PlanDefinitionAction",value:e},"timing")}let kg=1;function v4(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(kg=Math.max(kg,t+1))}return e}return"id-"+kg++}function Fde(e){return{...e,action:y4(e.action)}}function y4(e){if(e)return e.map(t=>({...t,id:v4(t.id),action:y4(t.action)}))}var it=(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))(it||{});function Vde(e){return e.type==="choice"||e.type==="open-choice"}function Bde(e,t){if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const n of e.enableWhen){const o=x4(t,n.question);if(n.operator==="exists"&&!n.answerBoolean&&!(o!=null&&o.length)){if(r==="any")return!0;continue}const{anyMatch:i,allMatch:a}=Hde(n,o,r);if(r==="any"&&i)return!0;if(r==="all"&&!a)return!1}return r!=="any"}function Ude(e,t,r){return e.map(n=>{var a;const o=(a=r.answerOption)==null?void 0:a.find(l=>ya(l.valueCoding)===n||l[t]===n),i=fr({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function x4(e,t){if(e)for(const r of e){if(r.linkId===t)return r.answer;if(r.item){const n=x4(r.item,t);if(n)return n}}}function Wde(e,t,r){if(r==="exists")return!!e===t.value;if(e){const n=r==="="||r==="!="?r==null?void 0:r.replace("=","~"):r,[{value:o}]=gx(`%actualAnswer ${n} %expectedAnswer`,[e],{actualAnswer:e,expectedAnswer:t});return o}else return!1}function Hde(e,t,r){const n=t||[],o=fr({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of n){const c=fr({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(Wde(c,o,u)?i=!0:a=!1,r==="any"&&i)break}return{anyMatch:i,allMatch:a}}function w4(e){var r,n;const t=ax(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(n=(r=t.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:n.map(o=>o.code)}}function Rg(e,t){var o;const r=va(e);let n=ax(r,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(n&&(r.extension=(o=r.extension)==null?void 0:o.filter(i=>i!==n)),r):(n||(r.extension||(r.extension=[]),n={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},r.extension.push(n)),t.length===1?(n.valueCode=t[0],delete n.valueCodeableConcept):(n.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete n.valueCode),r)}function Gde(e){return{resourceType:"QuestionnaireResponse",questionnaire:et(e),item:_4(e.item)}}function _4(e){return(e==null?void 0:e.map(b4))??[]}function b4(e){var t;return{id:Qde(),linkId:e.linkId,text:e.text,item:_4(e.item),answer:((t=e.initial)==null?void 0:t.map(Kde))??[]}}let qde=1;function Qde(){return"id-"+qde++}function Kde(e){return{...e}}function Yde(e){return e.value.display||e.value.reference||sr(e.value)}function Xde(e){var r,n,o,i;const t=(r=e==null?void 0:e.item)==null?void 0:r[0];if(t){const a=ax(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(n=a==null?void 0:a.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}function ay(e){const t=e.item,r=e.response;function n(c){var d,p,h,m;let u;Array.isArray(c)?u=c:e.index>=(((p=(d=e.response)==null?void 0:d.answer)==null?void 0:p.length)??0)?u=(((h=e.response)==null?void 0:h.answer)??[]).concat([c]):u=(((m=e.response)==null?void 0:m.answer)??[]).map((g,b)=>b===e.index?c:g)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:t.text,answer:u})}const o=t.type;if(!o)return null;const i=t.linkId;if(!i)return null;const a=t.initial&&t.initial.length>0?t.initial[0]:void 0,l=Hx(r,e.index)??fr({type:"QuestionnaireItemInitial",value:a},"value");switch(o){case it.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case it.boolean:return s.jsx(Z5,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(jn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:l==null?void 0:l.value,onChange:c=>n({valueBoolean:c.currentTarget.checked})})},e.item.linkId);case it.decimal:return s.jsx(le,{type:"number",step:"any",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDecimal:c.currentTarget.valueAsNumber})});case it.integer:return s.jsx(le,{type:"number",step:1,id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueInteger:c.currentTarget.valueAsNumber})});case it.date:return s.jsx(le,{type:"date",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDate:c.currentTarget.value})});case it.dateTime:return s.jsx(ra,{name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDateTime:c})});case it.time:return s.jsx(le,{type:"time",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueTime:c.currentTarget.value})});case it.string:case it.url:return s.jsx(le,{id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case it.text:return s.jsx(jc,{id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case it.attachment:return s.jsx(K,{py:4,children:s.jsx(K5,{name:i,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueAttachment:c})})});case it.reference:return s.jsx(mm,{name:i,required:t.required,targetTypes:w4(t),defaultValue:l==null?void 0:l.value,onChange:c=>n({valueReference:c})});case it.quantity:return s.jsx(na,{name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueQuantity:c}),disableWheel:!0});case it.choice:case it.openChoice:return nfe(t)&&!t.answerValueSet?s.jsx(Jde,{name:i,item:t,initial:a,response:r,onChangeAnswer:c=>n(c)}):s.jsx(Zde,{name:i,item:t,initial:a,response:r,onChangeAnswer:c=>n(c)});default:return null}}function Jde(e){var c;const{name:t,item:r,initial:n,response:o}=e;if(!((c=r.answerOption)!=null&&c.length))return s.jsx(S4,{});const i=fr({type:"QuestionnaireItemInitial",value:n},"value"),a=[""];for(const u of r.answerOption){const d=fr({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(UO(d))}const l=Hx(o)??i;if(r.repeats){const{propertyName:u,data:d}=ofe(e.item),p=tfe(o);return s.jsx(em,{data:d,placeholder:"Select items",searchable:!0,defaultValue:p||[UO(i)],onChange:h=>{const m=Ude(h,u,r);e.onChangeAnswer(m)}})}return s.jsx(ft,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const p=r.answerOption[d-1],h=fr({type:"QuestionnaireItemAnswerOption",value:p},"value"),m="value"+hr(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:ya(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function Zde(e){var a;const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e;return!((a=r.answerOption)!=null&&a.length)&&!r.answerValueSet?s.jsx(S4,{}):r.answerValueSet?s.jsx(t4,{name:t,binding:r.answerValueSet,onChange:l=>o({valueCoding:l})}):s.jsx(efe,{name:(i==null?void 0:i.id)??t,item:r,initial:n,response:i,onChangeAnswer:o})}function efe(e){const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e,a=xa("QuestionnaireItemAnswerOption","value[x]"),l=fr({type:"QuestionnaireItemInitial",value:n},"value"),c=[];let u;if(r.answerOption)for(let h=0;h<r.answerOption.length;h++){const m=r.answerOption[h],v=`${t}-option-${h}`,g=fr({type:"QuestionnaireItemAnswerOption",value:m},"value");l&&sr(g)===sr(l)&&(u=v),c.push([v,g])}const d=Hx(i),p=rfe(c,d);return s.jsx(Np.Group,{name:t,value:p??u,onChange:h=>{const m=c.find(v=>v[0]===h);if(m){const v=m[1],g="value"+hr(v.type);o({[g]:v.value})}},children:c.map(([h,m])=>s.jsx(Np,{id:h,value:h,py:4,label:s.jsx($o,{property:a,propertyType:m.type,value:m.value})},h))})}function S4(){return s.jsx(le,{disabled:!0,placeholder:"No Answers Defined"})}function P4(e){return fr({type:"QuestionnaireItemAnswer",value:e},"value")}function Hx(e,t=0){const r=e.answer;return P4((r==null?void 0:r[t])??{})}function tfe(e){const t=e.answer;return t?t.map(n=>P4(n)).map(n=>ya(n==null?void 0:n.value)||(n==null?void 0:n.value)):[]}function rfe(e,t){var r;return(r=e.find(n=>am(n[1].value,t==null?void 0:t.value)))==null?void 0:r[0]}function UO(e){if(e)return e.type==="CodeableConcept"?ws(e.value):e.type==="Coding"?ya(e.value):e.type==="Reference"?Yde(e):e.value.toString()}function nfe(e){var t;return!!((t=e.extension)!=null&&t.some(r=>{var n,o,i;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(n=r.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function ofe(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],r=fr({type:"QuestionnaireItemAnswerOption",value:t},"value"),n="value"+hr(r.type),o=(e.answerOption??[]).map(a=>({value:WO(a,n),label:WO(a,n)}));return{propertyName:n,data:o}}function WO(e,t){var r;return ya(e.valueCoding)||((r=e[t])==null?void 0:r.toString())}const ife=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},questionBody:{maxWidth:600},topActions:{position:"absolute",right:32,top:1,padding:4,color:e.colors.gray[5],fontSize:e.fontSizes.xs},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementActions:{position:"absolute",right:8,top:0,paddingTop:8,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementIcons:{color:e.colors.gray[5]},columnAlignment:{display:"flex",flexDirection:"column"},linkIdInput:{width:100,marginBottom:4},typeSelect:{width:100}}));function afe(e){const t=ae(),r=Ke(e.questionnaire),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){d(void 0)}function h(){c(void 0)}return f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(a(ufe(r??{resourceType:"Questionnaire"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!i?null:s.jsx("div",{children:s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(j4,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:a}),s.jsx(ne,{type:"submit",children:"Save"})]})})}function j4(e){var O;const{classes:t,cx:r}=ife(),n=e.item,o=e.item,i=Ao(e.item),a=i||o.type===it.group,l=o.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=f.useRef();d.current=e.item;function p(C){st(C),e.setSelectedKey(e.item.id)}function h(C){st(C),e.setHoverKey(e.item.id)}function m(C){var E;const P=d.current;e.onChange({...P,item:(E=P.item)==null?void 0:E.map(k=>k.id===C.id?C:k)})}function v(C){e.onChange({...e.item,item:[...e.item.item??[],C]})}function g(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.filter(E=>E!==C)})}function b(C,P){e.onChange({...d.current,[C]:P})}function y(C){e.onChange({...e.item,...C})}function x(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.map(E=>E===C?{...E,repeats:!E.repeats}:E)})}function _(C,P){const E=pfe(e.item.item,C,P);e.onChange({...e.item,item:E})}const w=r(t.section,{[t.editing]:c,[t.hovering]:u&&!c});return s.jsxs("div",{"data-testid":o.linkId,className:w,onClick:p,onMouseOver:h,children:[s.jsx("div",{className:t.questionBody,children:c?s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{size:"xl",defaultValue:n.title,onChange:C=>b("title",C.currentTarget.value)}),!i&&s.jsx(jc,{autosize:!0,minRows:2,defaultValue:o.text,onChange:C=>b("text",C.currentTarget.value)}),o.type==="reference"&&s.jsx(cfe,{item:o,onChange:y}),Vde(o)&&s.jsx(sfe,{item:o,onChange:C=>y(C)})]}):s.jsxs(s.Fragment,{children:[n.title&&s.jsx(he,{children:n.title}),o.text&&s.jsx("div",{children:o.text}),!a&&s.jsx(ay,{item:o,index:0,onChange:()=>{},response:{}})]})}),(O=o.item)==null?void 0:O.map((C,P)=>s.jsx("div",{children:s.jsx(j4,{item:C,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:P===0,isLast:P===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>g(C),onRepeatable:x,onMoveUp:()=>_(P,-1),onMoveDown:()=>_(P,1)})},C.id)),!a&&s.jsx("div",{className:t.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:"xs",className:t.linkIdInput,defaultValue:o.linkId,onChange:C=>b("linkId",C.currentTarget.value)}),!a&&s.jsx(ft,{size:"xs",className:t.typeSelect,defaultValue:o.type,onChange:C=>b("type",C.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:l})}),!i&&s.jsx(oe,{className:t.movementActions,children:s.jsxs(oe,{className:t.columnAlignment,children:[!e.isFirst&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(ale,{"data-testid":"up-button",size:15,className:t.movementIcons})}),!e.isLast&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(ile,{"data-testid":"down-button",size:15,className:t.movementIcons})})]})}),s.jsxs("div",{className:t.bottomActions,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v({id:aa(),linkId:cy("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v({id:aa(),linkId:cy("g"),type:"group",text:"Group"})},children:"Add group"})]}),i&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v(ffe())},children:"Add Page"}),c&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onRepeatable&&e.onRepeatable(o)},children:o.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function sfe(e){const t=xa("QuestionnaireItemAnswerOption","value[x]"),r=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(le,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:n=>e.onChange({...e.item,answerValueSet:n.target.value})}):s.jsx(lfe,{options:r,property:t,item:e.item,onChange:e.onChange}),s.jsxs(oe,{display:"flex",children:[s.jsx(Le,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...r,{id:aa()}]})},children:"Add choice"}),s.jsx(im,{w:"lg"}),s.jsx(Le,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function lfe(e){return s.jsx("div",{children:e.options.map(t=>{const[r,n]=ta({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(oa,{name:"value[x]",property:e.property,defaultPropertyType:n,defaultValue:r,onChange:(o,i)=>{const a=[...e.options],l=a.findIndex(c=>c.id===t.id);a[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:a})}},t.id)}),s.jsx("div",{children:s.jsx(Le,{href:"#",onClick:o=>{st(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function cfe(e){const t=w4(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((r,n)=>s.jsxs(K,{children:[s.jsx(kx,{name:"resourceType",placeholder:"Resource Type",defaultValue:r,onChange:o=>{e.onChange(Rg(e.item,t.map(i=>i===r?o:i)))}}),s.jsx(Le,{href:"#",onClick:o=>{st(o),e.onChange(Rg(e.item,t.filter(i=>i!==r)))},children:"Remove"})]},`${r}-${n}`)),s.jsx(Le,{href:"#",onClick:r=>{st(r),e.onChange(Rg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let sy=1,ly=1;function cy(e){return e+sy++}function aa(){return"id-"+ly++}function ufe(e){return{...e,id:e.id||aa(),item:O4(e.item)}}function O4(e){if(e)return e.forEach(t=>{var r,n;(r=t.id)!=null&&r.match(/^id-\d+$/)&&(ly=Math.max(ly,parseInt(t.id.substring(3),10)+1)),(n=t.linkId)!=null&&n.match(/^q\d+$/)&&(sy=Math.max(sy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||aa(),item:O4(t.item),answerOption:dfe(t.answerOption)}))}function dfe(e){if(e)return e.map(t=>({...t,id:t.id||aa()}))}function ffe(){return{id:aa(),linkId:cy("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 pfe(e,t,r){const n=e??[],o=t+r;if(o<0||o>=n.length)return n;const i=[...n];return[i[t],i[o]]=[i[o],i[t]],i}function C4(e){const{item:t,response:r,onChange:n}=e,[o,i]=f.useState(hfe(t,r??{}));if(!e.checkForQuestionEnabled(t)||!r)return null;if(t.type===it.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==it.choice&&t.type!==it.openChoice;return t.type===it.boolean?s.jsx(ay,{item:t,response:r,onChange:l=>n([l]),index:0},t.linkId):s.jsxs(tt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(ay,{item:t,response:r,onChange:u=>n([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Le,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function hfe(e,t){if(e.type===it.choice||e.type===it.openChoice)return 1;const r=t.answer;return r!=null&&r.length?r.length:1}function E4(e){const[t,r]=f.useState(e.response);if(t.length===0)return null;function n(i,a){const l=t.map((c,u)=>u===a?i[0]:c);r(l),e.onChange(l)}function o(){const i=b4(e.item);r([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx($4,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>n(l,a)},i.id)),e.item.repeats&&s.jsx(Le,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function $4(e){var i;const{response:t,checkForQuestionEnabled:r,onChange:n}=e;function o(a){var d;const l=(d=t.item)==null?void 0:d.map(p=>a.find(m=>m.id===p.id)??p),c=l==null?void 0:l.concat(a.slice(1)),u={...t,item:c};n([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(he,{order:3,mb:"md",children:e.item.text}),s.jsx(Oe,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===it.group?a.repeats?s.jsx(E4,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:r,onChange:o},a.linkId):s.jsx($4,{item:a,checkForQuestionEnabled:r,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===a.linkId))??{},onChange:o},a.linkId):s.jsx(C4,{item:a,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===a.linkId),onChange:o,checkForQuestionEnabled:r},a.linkId)})})]},e.item.linkId):null}function mfe(e){const{items:t,response:r,activePage:n,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,p=t.map(h=>{var g;const m=((g=r==null?void 0:r.item)==null?void 0:g.filter(b=>b.linkId===h.linkId))??[],v=h.type===it.group?s.jsx(E4,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):s.jsx(C4,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?s.jsx(oc.Step,{label:h.text,children:v},h.linkId):v});return s.jsxs(s.Fragment,{children:[c&&s.jsx(oc,{active:n??0,allowNextStepsSelect:!1,p:6,children:p}),!c&&s.jsx(Oe,{children:p}),s.jsx(gfe,{activePage:n??0,numberOfPages:l,nextStep:i,prevStep:a,submitButtonText:u})]})}function gfe(e){const t=e.activePage>0,r=e.activePage<e.numberOfPages-1,n=e.activePage===e.numberOfPages-1;return s.jsxs(K,{position:"right",mt:"xl",spacing:"xs",children:[t&&s.jsx(ne,{onClick:e.prevStep,children:"Back"}),r&&s.jsx(ne,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),n&&s.jsx(ne,{type:"submit",children:e.submitButtonText??"Submit"})]})}function k4(e){const t=ae(),r=t.getProfile(),[n,o]=f.useState(!1),i=Ke(e.questionnaire),[a,l]=f.useState(),[c,u]=f.useState(0);f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>{l(i?Gde(i):void 0)},[i]);function d(g){const b=(a==null?void 0:a.item)??[],x={resourceType:"QuestionnaireResponse",item:R4(b,Array.isArray(g)?g:[g])};l(x)}function p(g){return Bde(g,(a==null?void 0:a.item)??[])}if(!n||!i)return null;const h=Xde(i),m=()=>u(g=>g+1),v=()=>u(g=>g-1);return s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:et(i),subject:e.subject,source:dt(r),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(he,{children:i.title}),s.jsx(mfe,{items:i.item??[],response:a,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:p,nextStep:m,prevStep:v})]})}function vfe(e,t){const r=R4(e.item??[],t.item??[]);return{...t,item:r.length>0?r:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function R4(e,t){const r=[],n=new Set;for(const o of e){const i=o.id,a=t.find(l=>l.id===i);a?(r.push(vfe(o,a)),n.add(a.id)):r.push(o)}for(const o of t)n.has(o.id)||r.push(o);return r}const yfe=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[3]}`,borderRadius:e.radius.sm,transition:"all 0.1s"}})),xfe=["gender","age","gestationalAge","context","appliesTo","category"],wfe={definition:{resourceType:"ObservationDefinition"},onSubmit:()=>{}};function _fe(e){e=Object.assign(wfe,e);const t=e.definition,[r,n]=f.useState([]),[o,i]=f.useState(1),[a,l]=f.useState(1);return f.useEffect(()=>{const v=Pfe(t,l);n(jfe(v.qualifiedInterval||[],i))},[t]),s.jsxs(De,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(Oe,{children:r.map(v=>{var g;return s.jsx(bfe,{unit:Cfe((g=t.quantitativeDetails)==null?void 0:g.unit),onChange:p,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:v},`group-${v.id}`)})}),s.jsx(dr,{title:"Add Group",size:"sm",onClick:v=>{st(v),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(g=>g+1)},children:s.jsx(bx,{})}),s.jsx(K,{position:"right",children:s.jsx(ne,{type:"submit",children:"Save"})})]});function c(){const v=r.flatMap(g=>g.intervals).filter(g=>!Efe(g));e.onSubmit({...t,qualifiedInterval:v})}function u(v){n(g=>[...g,v])}function d(v){n(g=>g.filter(b=>b.id!==v.id))}function p(v,g){n(b=>{b=[...b];const y=b.find(_=>_.id===v),x=y==null?void 0:y.intervals.findIndex(_=>_.id===g.id);return x!==void 0&&(y!=null&&y.intervals[x])&&(y.intervals[x]=g),b})}function h(v,g){g.id===void 0&&(g.id=`id-${a}`,l(b=>b+1)),n(b=>{b=[...b];const y=b.findIndex(x=>x.id===v);if(y!==-1){const x={...b[y]};g={...g,...x.filters},x.intervals=[...x.intervals,g],b[y]=x}return b})}function m(v,g){n(b=>{b=[...b];const y=b.find(x=>x.id===v);return y&&(y.intervals=y.intervals.filter(x=>x.id!==g.id)),b})}}function bfe(e){const{intervalGroup:t,unit:r}=e,{classes:n}=yfe();return s.jsx(Dc,{"data-testid":t.id,className:n.section,children:s.jsxs(Oe,{spacing:"lg",children:[s.jsx(K,{position:"right",children:s.jsx(dr,{title:"Remove Group","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:o=>{st(o),e.onRemoveGroup(t)},children:s.jsx(nh,{})},`remove-group-button-${t.id}`)}),s.jsx(Sfe,{intervalGroup:t,onChange:e.onChange}),s.jsx(_r,{}),t.intervals.map(o=>s.jsxs(Oe,{spacing:"xs",children:[s.jsxs(K,{children:[s.jsx(le,{"data-testid":`condition-${o.id}`,defaultValue:o.condition,label:"Condition: ",size:"sm",onChange:i=>{st(i),e.onChange(t.id,{...o,condition:i.currentTarget.value.trim()})}},`condition-${o.id}`),s.jsx(dr,{title:"Remove Interval",size:"sm","data-testid":`remove-interval-${o.id}`,onClick:i=>{st(i),e.onRemove(t.id,o)},children:s.jsx(nh,{})},`remove-interval-${o.id}`)]}),s.jsx(Nx,{onChange:i=>{e.onChange(t.id,{...o,range:i})},name:`range-${o.id}`,defaultValue:o.range},`range-${o.id}`)]},`interval-${o.id}`)),s.jsx(dr,{title:"Add Interval",size:"sm",onClick:o=>{st(o),e.onAdd(t.id,{range:{low:{unit:r},high:{unit:r}}})},children:s.jsx(bx,{})})]})})}function Sfe(e){var n,o;const{intervalGroup:t,onChange:r}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(n=t.filters.age[i])!=null&&n.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(Oe,{style:{maxWidth:"50%"},children:[s.jsx(K,{children:s.jsx(ft,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),r(t.id,{...a,gender:l})}}})}),s.jsxs(K,{spacing:"xs",children:[s.jsx(re,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Nx,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const a of t.intervals)r(t.id,{...a,age:i})}},`age-${t.id}`)})]}),s.jsx(ft,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,r(t.id,{...a,context:void 0})):r(t.id,{...a,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ft,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const a of t.intervals){const l=i.currentTarget.value;l===""?r(t.id,{...a,category:void 0}):r(t.id,{...a,category:l})}}})]})}function Pfe(e,t){const r=e.qualifiedInterval||[];let n=Math.max(...r.map(o=>{var a;const i=parseInt(((a=o.id)==null?void 0:a.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(n)||(n=1),e={...e,qualifiedInterval:r.map(o=>({...o,id:o.id||`id-${n++}`}))},t(n),e}function jfe(e,t){let r=1;const n={};for(const o of e){const i=Ofe(o);i in n||(n[i]={id:`group-id-${r++}`,filters:Object.fromEntries(xfe.map(a=>[a,o[a]])),intervals:[]}),n[i].intervals.push(o)}return t(r),Object.values(n)}function Ofe(e){var r,n;return[`gender=${e.gender}`,`age=${ic(e.age)}`,`gestationalAge=${ic(e.gestationalAge)}`,`context=${(r=e.context)==null?void 0:r.text}`,`appliesTo=${(n=e.appliesTo)==null?void 0:n.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function Cfe(e){return e&&(Hoe(e,"http://unitsofmeasure.org")||e.text)}function Efe(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 $fe(e){var u;const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1),[i,a]=f.useState();if(f.useEffect(()=>{r&&!n&&(t.executeBatch(l(r)).then(a).catch(console.log),o(!0))},[t,r,n]),!r||!i)return null;return s.jsx(tn,{children:(u=r.action)==null?void 0:u.map((d,p)=>{var g,b,y,x,_,w;const h=d.resource&&c(d.resource),m=(b=(g=h==null?void 0:h.input)==null?void 0:g[0])==null?void 0:b.valueReference,v=(x=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:x.valueReference;return s.jsxs(S.Fragment,{children:[s.jsx(tn.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(mle,{}):s.jsx(Ble,{color:"gray"})}),s.jsxs(tn.Col,{span:9,p:"xs",children:[s.jsx(re,{weight:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Nc,{value:(_=h==null?void 0:h.meta)==null?void 0:_.author})," on ",kr((w=h==null?void 0:h.meta)==null?void 0:w.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(a4,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(tn.Col,{span:2,p:"md",children:[m&&!v&&s.jsx(ne,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&v&&s.jsx(ne,{onClick:()=>e.onEdit(h,m,v),children:"Edit"})]})]},`action-${p}`)})});function l(d){var h;const p=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&p.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:p}}function c(d){for(const p of i==null?void 0:i.entry)if(p.resource&&d.reference===et(p.resource))return p.resource}}function T4(e,t){const r=kfe(e,t);return Rfe(r,e,t)}function kfe(e,t){const r=e.length,n=t.length,o=r+n+1,i=1+2*o,a=i/2|0,l=new Array(i);l[a+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=a+u,p=d+1,h=d-1,m=l[p],v=l[h];let g,b=0;u===-c||u!==c&&v.i<m.i?(b=m.i,g=m):(b=v.i+1,g=v),l[h]=void 0;let y=b-u,x={i:b,j:y,prev:Tfe(g),snake:!1};for(;b<r&&y<n&&e[b]===t[y];)b++,y++;if(b>x.i&&(x={i:b,j:y,prev:x,snake:!0}),l[d]=x,b>=r&&y>=n)return l[d]}l[a+c-1]=void 0}}function Rfe(e,t,r){const n=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,a=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:r.slice(c,a)};let p;u.lines.length===0&&d.lines.length>0?p="insert":u.lines.length>0&&d.lines.length===0?p="delete":p="change",n.push({original:u,revised:d,type:p}),o.snake&&(o=o.prev)}return n}function Tfe(e){return e&&!e.snake&&e.prev?e.prev:e}function Ife(e){const t=e.entry.filter(n=>!!n.resource).map(n=>{var o;return{meta:(o=n.resource)==null?void 0:o.meta,lines:sr(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 Dfe(r,t),Nfe(r),r}function Dfe(e,t){for(let r=1;r<t.length;r++){const n=T4(t[r-1].lines,t[r].lines);for(const o of n){const i=o.original.position,a=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,a.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[r].meta.versionId,meta:t[r].meta,value:l[c],span:1})}}}function Nfe(e){let t=0;for(;t<e.length;){let r=t;for(;r<e.length&&e[r].id===e[t].id;)e[r].span=-1,r++;e[t].span=r-t,t=r}}function Afe(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function Mfe(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),r=Math.floor(t/31536e3);if(r>0)return Ia(r,"year");const n=Math.floor(t/2592e3);if(n>0)return Ia(n,"month");const o=Math.floor(t/86400);if(o>0)return Ia(o,"day");const i=Math.floor(t/3600);if(i>0)return Ia(i,"hour");const a=Math.floor(t/60);return a>0?Ia(a,"minute"):Ia(t,"second")}function Ia(e,t){return`${e} ${e===1?t:t+"s"} ago`}const Lfe=W(e=>({container:{overflowX:"auto"},root:{border:`0.1px solid ${e.colors.gray[3]}`,borderCollapse:"collapse",borderRadius:e.radius.sm,borderSpacing:0,fontSize:e.fontSizes.xs,width:"100%","& td":{padding:"2px 4px 0 4px",verticalAlign:"top",whiteSpace:"nowrap"}},startRow:{borderTop:`0.1px solid ${e.colors.gray[3]}`},normalRow:{borderTop:0},author:{lineHeight:"10px"},dateTime:{borderRight:`0.1px solid ${e.colors.gray[3]}`,lineHeight:"20px"},lineNumber:{backgroundColor:e.colors.gray[1],border:0,color:e.colors.gray[5],fontFamily:e.fontFamilyMonospace,padding:`${e.spacing.xs} ${e.spacing.sm}`,textAlign:"right"},line:{fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,padding:`${e.spacing.xs} ${e.spacing.sm}`},pre:{margin:0}}));function zfe(e){var l,c;const{classes:t}=Lfe(),r=ae(),[n,o]=f.useState(e.history);if(f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&r.readHistory(e.resourceType,e.id).then(o).catch(console.log)},[r,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const i=(c=(l=n.entry)==null?void 0:l[0])==null?void 0:c.resource;if(!i)return null;const a=Ife(n);return s.jsx("div",{className:t.container,children:s.jsx("table",{className:t.root,children:s.jsx("tbody",{children:a.map((u,d)=>s.jsxs("tr",{className:u.span>0?t.startRow:t.normalRow,children:[u.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:t.author,rowSpan:u.span,children:s.jsx(as,{value:u.meta.author,link:!0})}),s.jsx("td",{className:t.dateTime,rowSpan:u.span,children:s.jsx(ke,{to:Afe(i,u.meta.versionId),children:Mfe(u.meta.lastUpdated)})})]}),s.jsx("td",{className:t.lineNumber,children:d+1}),s.jsx("td",{className:t.line,children:s.jsx("pre",{className:t.pre,children:u.value})})]},"row-"+d))})})})}const Ffe=W(e=>({removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Vfe(e){let t=e.original,r=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},r={...r,meta:void 0});const n=sr(t,!0).match(/[^\r\n]+/g),o=sr(r,!0).match(/[^\r\n]+/g),i=T4(n,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(Bfe,{delta:a},"delta"+l))})}function Bfe(e){const{classes:t}=Ffe();return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:t.removed,children:e.delta.original.lines.join(`
189
+ }`.replace(/\s+/g," ")}function oce(e,t){const r=[];return e.data.Patients1&&r.push(...e.data.Patients1),e.data.Patients2&&r.push(...e.data.Patients2),e.data.ServiceRequestList&&r.push(...e.data.ServiceRequestList),ace(ice(r),t).slice(0,5)}function ice(e){const t=new Set,r=[];for(const n of e)t.has(n.id)||(t.add(n.id),r.push(n));return r}function ace(e,t){return e.sort((r,n)=>IO(n,t)-IO(r,t))}function IO(e,t){let r=0;if(e.identifier)for(const n of e.identifier)r=Math.max(r,DO(n.value,t));if(e.resourceType==="Patient"&&e.name)for(const n of e.name)r=Math.max(r,DO(Rc(n),t));return r}function DO(e,t){if(!e)return 0;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?0:100-r}const sce=W(e=>({logoButton:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},user:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},userName:{fontWeight:500,lineHeight:1,marginRight:3,[e.fn.smallerThan("xs")]:{display:"none"}},userActive:{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}}));function lce(e){var d,p,h,m;const t=cm(),{medplum:r,profile:n,navigate:o}=t,i=r.getLogins(),{classes:a,cx:l}=sce(),[c,u]=f.useState(!1);return s.jsx(Ek,{height:60,p:8,style:{zIndex:101},children:s.jsxs(K,{position:"apart",children:[s.jsxs(K,{spacing:"xs",children:[s.jsx(wo,{className:a.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(tce,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(X,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:c,onClose:()=>u(!1),children:[s.jsx(X.Target,{children:s.jsx(wo,{className:l(a.user,{[a.userActive]:c}),onClick:()=>u(v=>!v),children:s.jsxs(K,{spacing:7,children:[s.jsx(vi,{value:n,radius:"xl",size:24}),s.jsx(re,{size:"sm",className:a.userName,children:Rc((d=n==null?void 0:n.name)==null?void 0:d[0])}),s.jsx(gle,{size:12,stroke:1.5})]})})}),s.jsxs(X.Dropdown,{children:[s.jsxs(Oe,{align:"center",p:"xl",children:[s.jsx(vi,{size:"xl",radius:100,value:t.profile}),s.jsx(Ox,{value:(h=(p=t.profile)==null?void 0:p.name)==null?void 0:h[0]}),s.jsx(re,{color:"dimmed",size:"xs",children:(m=r.getActiveLogin())==null?void 0:m.project.display})]}),i.length>1&&s.jsx(X.Divider,{}),i.map(v=>v.profile.reference!==et(t.profile)&&s.jsx(X.Item,{onClick:()=>{r.setActiveLogin(v).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(K,{children:[s.jsx(Cf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",weight:500,children:v.profile.display}),s.jsx(re,{color:"dimmed",size:"xs",children:v.project.display})]})]})},v.profile.reference)),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Wle,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(X.Item,{icon:s.jsx(ty,{size:14,stroke:1.5}),onClick:()=>o(`/${et(n)}`),children:"Account settings"}),s.jsx(X.Item,{icon:s.jsx(kle,{size:14,stroke:1.5}),onClick:async()=>{await r.signOut(),o("/signin")},children:"Sign out"}),s.jsx(re,{size:"xs",color:"dimmed",align:"center",children:e.version})]})]})]})})}function cce(e){const t={};for(const r of Array.from(e.elements))r instanceof HTMLInputElement?uce(t,r):r instanceof HTMLTextAreaElement?t[r.name]=r.value:r instanceof HTMLSelectElement&&dce(t,r);return t}function uce(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function dce(e,t){e[t.name]=t.value}function De(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const r=cce(t.target);e.onSubmit&&e.onSubmit(r)},children:e.children})}function fce(e){const t=ae(),r=t.getUserConfiguration();function n(o){var d,p;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=va(r),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(p=u==null?void 0:u.link)==null||p.push({name:a,target:l}),t.updateResource(c).then(h=>{r.menu=h.menu,t.dispatchEvent({type:"change"}),me({color:"green",message:"Success"}),e.onOk()}).catch(h=>{me({color:"red",message:Ee(h)})})}return s.jsx(Tr,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(De,{onSubmit:n,children:s.jsxs(Oe,{children:[s.jsx(pce,{config:r}),s.jsx(le,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(K,{position:"right",children:s.jsx(ne,{mt:"sm",type:"submit",children:"OK"})})]})})})}function pce(e){function t(n){var o;return(o=n==null?void 0:n.menu)==null?void 0:o.map(i=>i.title)}const r=t(e.config);return s.jsx(ft,{name:"menuname",defaultValue:r[0],label:"Select Menu Option",placeholder:"Menu",data:r,withAsterisk:!0})}function Ex(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function hce(e){return typeof e.display=="string"?e.display:Ex(e)}function mce(e){return{value:Ex(e),label:hce(e),resource:e}}function gce(e){return{code:e,display:e}}function $x(e){const t=ae(),{binding:r,creatable:n,clearable:o,...i}=e,a=f.useCallback(async(l,c)=>{var h;if(!r)return[];const d=(h=(await t.searchValueSet(r,l,{signal:c})).expansion)==null?void 0:h.contains,p=[];for(const m of d)m.code&&!p.some(v=>v.code===m.code)&&p.push(m);return p},[t,r]);return s.jsx(Cx,{...i,creatable:n??!0,clearable:o??!0,toKey:Ex,toOption:mce,loadOptions:a,onCreate:gce,getCreateLabel:n===!1?void 0:l=>`+ Create ${l}`})}function q5(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=yce(i);r(a),e.onChange&&e.onChange(a)}return s.jsx($x,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:vce(t),onChange:n,creatable:e.creatable,maxSelectedValues:e.maxSelectedValues??1,clearSearchOnChange:e.clearSearchOnChange,clearable:e.clearable})}function vce(e){return e?{code:e}:void 0}function yce(e){return e==null?void 0:e.code}function kx(e){const[t,r]=f.useState(e.defaultValue),n=e.onChange,o=f.useCallback(i=>{r(i),n&&n(i)},[n]);return s.jsx(q5,{"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1})}const Q5=W(e=>({menuTitle:{margin:"20px 0 4px 6px",fontSize:"9px",fontWeight:"normal",textTransform:"uppercase",letterSpacing:"2px"},link:{...e.fn.focusStyles(),display:"flex",alignItems:"center",textDecoration:"none",fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],padding:"8px 12px",borderRadius:e.radius.sm,fontWeight:500,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],color:e.colorScheme==="dark"?e.white:e.black,textDecoration:"none","& svg":{color:e.colorScheme==="dark"?e.white:e.black}},"& svg":{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginRight:e.spacing.sm,strokeWidth:1.5,width:18,height:18}},linkActive:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color,"& svg":{color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}}));function xce(e){var c;const{classes:t}=Q5(),r=um(),n=bce(e.pathname,e.searchParams,e.menus),[o,i]=f.useState(!1);function a(u,d){u.stopPropagation(),u.preventDefault(),r(d),window.innerWidth<768&&e.closeNavbar()}function l(u){u&&r(`/${u}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Rl,{width:{sm:250},p:"xs",children:s.jsxs(da,{children:[!e.resourceTypeSearchDisabled&&s.jsx(Rl.Section,{mb:"sm",children:s.jsx(kx,{name:"resourceType",placeholder:"Resource Type",onChange:u=>l(u)},window.location.pathname)}),s.jsxs(Rl.Section,{grow:!0,children:[(c=e.menus)==null?void 0:c.map(u=>{var d;return s.jsxs(f.Fragment,{children:[s.jsx(re,{className:t.menuTitle,children:u.title}),(d=u.links)==null?void 0:d.map(p=>s.jsxs(wce,{to:p.href,active:p.href===(n==null?void 0:n.href),onClick:h=>a(h,p.href),children:[s.jsx(_ce,{to:p.href,icon:p.icon}),s.jsx("span",{children:p.label})]},p.href))]},`menu-${u.title}`)}),e.displayAddBookmark&&s.jsx(ne,{variant:"subtle",size:"xs",mt:"xl",leftIcon:s.jsx(Mle,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(fce,{pathname:e.pathname,searchParams:e.searchParams,visible:o,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function wce(e){const{classes:t,cx:r}=Q5();return s.jsx(ke,{onClick:e.onClick,to:e.to,className:r(t.link,{[t.linkActive]:e.active}),children:e.children})}function _ce(e){return e.icon?e.icon:s.jsx(im,{w:30})}function bce(e,t,r){if(!e||!t||!r)return;let n,o=0;for(const i of r)if(i.links)for(const a of i.links){const l=Sce(e,t,a.href);l>o&&(o=l,n=a)}return n}function Sce(e,t,r){const n=new URL(r,"https://example.com");if(e!==n.pathname)return 0;const o=["_count","_offset"];for(const[a,l]of n.searchParams.entries())if(!o.includes(a)&&t.get(a)!==l)return 0;let i=1;for(const[a,l]of t.entries())o.includes(a)||n.searchParams.get(a)===l&&i++;return i}function Pce(e){var u;const t=Jt(),[r,n]=f.useState(localStorage.navbarOpen==="true"),o=ae(),i=_x();f.useEffect(()=>{function d(){me({color:"red",message:"No connection to server",autoClose:!1})}return o.addEventListener("offline",d),()=>o.removeEventListener("offline",d)},[o]);function a(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){a(!1)}function c(){a(!r)}return o.isLoading()?s.jsx(On,{}):s.jsx(Tk,{styles:{main:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.colors.gray[0]}},padding:0,fixed:!0,header:i&&s.jsx(lce,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:c}),navbar:i&&r?s.jsx(xce,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,children:s.jsx(H5,{children:s.jsx(f.Suspense,{fallback:s.jsx(On,{}),children:e.children})},`${e.pathname}?${(u=e.searchParams)==null?void 0:u.toString()}`)})}function Ic(e){const{contentType:t,url:r,title:n}=e.value??{};return r?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:r,alt:n}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:r})}),t==="application/pdf"&&s.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:r+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Le,{href:r,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:jce(n),children:n||"Download"})})]}):null}function jce(e){return e!=null&&e.includes(".")?e:void 0}function Oce(e){var t;return s.jsx("div",{children:(t=e.values)==null?void 0:t.map((r,n)=>s.jsx("div",{children:s.jsx(Ic,{value:r,maxWidth:e.maxWidth})},"attatchment-"+n))})}function Rx(e){const t=ae(),r=f.useRef(null);function n(a){var l;st(a),(l=r.current)==null||l.click()}function o(a){st(a);const l=a.target.files;l&&Array.from(l).forEach(i)}function i(a){if(!a||!a.name)return;e.onUploadStart&&e.onUploadStart();const c=a.name,u=a.type||"application/octet-stream";t.createBinary(a,c,u,e.onUploadProgress).then(d=>{e.onUpload({contentType:d.contentType,url:d.url,title:c})}).catch(d=>{e.onUploadError&&e.onUploadError(ct(d))})}return s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:r,onChange:a=>o(a)}),e.children({onClick:n})]})}function Cce(e){const[t,r]=f.useState(e.defaultValue??[]),n=f.useRef();n.current=t;function o(i){r(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,a)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Ic,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(dr,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(nh,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Rx,{onUpload:i=>{o([...n.current,i])},children:i=>s.jsx(dr,{...i,title:"Add",size:"sm",color:"green",children:s.jsx(Sx,{size:16})})})})]})]})]})}function K5(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(Ic,{value:t,maxWidth:200}),s.jsx(ne,{onClick:o=>{st(o),n(void 0)},children:"Remove"})]}):s.jsx(Rx,{onUpload:n,children:o=>s.jsx(ne,{...o,children:"Upload..."})})}const Y5=["meta","implicitRules","contained","extension","modifierExtension"],X5=["language","text"],Ece=W(e=>({root:{display:"grid",gridTemplateColumns:"30% 70%",margin:0,"& > dt, & > dd":{padding:`${e.spacing.sm} ${e.spacing.sm}`,borderTop:`0.1px solid ${e.colors.gray[3]}`,margin:0}},compact:{gridTemplateColumns:"20% 80%","& > dt, & > dd":{padding:`0 ${e.spacing.xs} ${e.spacing.xs} 0`,border:0}}}));function Tx(e){const{children:t,compact:r}=e,{classes:n,cx:o}=Ece();return s.jsx("dl",{className:o(n.root,{[n.compact]:r}),children:t})}function is(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function Xn(e){return s.jsx(s.Fragment,{children:ws(e.value)})}function $ce(e){return s.jsx(s.Fragment,{children:ya(e.value)})}function J5(e){const t=e.value;if(!t)return null;const r=[];return t.value&&r.push(t.value),(t.use||t.system)&&(r.push(" ["),t.use&&r.push(t.use),t.use&&t.system&&r.push(" "),t.system&&r.push(t.system),r.push("]")),s.jsx(s.Fragment,{children:r.join("").trim()})}function kce(e){var r;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(r=t.telecom)==null?void 0:r.map(n=>s.jsx(J5,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function Rce(e){var t,r;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(r=e.value)==null?void 0:r.value]})}function Tce(e){return s.jsx(s.Fragment,{children:Zoe(e.value)})}function sc(e){return s.jsx(s.Fragment,{children:Ko(e.value)})}function Ix(e){return s.jsx(s.Fragment,{children:ic(e.value)})}function Ice(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(sc,{value:t.numerator})," / ",s.jsx(sc,{value:t.denominator})]}):null}function ih(e){if(!e.value)return null;const t=e.value.display||e.value.reference||sr(e.value);return e.link!==!1&&e.value.reference?s.jsx(ke,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function Dce(e){const{property:t,values:r}=e,n=t.type[0].code;return e.values?s.jsx(s.Fragment,{children:r.map((o,i)=>s.jsx("div",{children:s.jsx($o,{arrayElement:!0,property:t,propertyType:n,value:o,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${i}-${r.length}`))}):s.jsx(s.Fragment,{})}function $o(e){var i;const{property:t,propertyType:r,value:n}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(oe,{component:"div",sx:{display:"flex",gap:3,alignItems:"center"},children:[n,!mo(n)&&s.jsx(KT,{value:n,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(iN,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(dr,{color:a?"teal":"gray",onClick:l,children:a?s.jsx(fm,{size:"1rem"}):s.jsx(yle,{size:"1rem"})})})})]});if(t!=null&&t.max&&t.max>1&&!e.arrayElement)return r===B.Attachment?s.jsx(Oce,{values:n,maxWidth:e.maxWidth}):s.jsx(Dce,{property:t,values:n,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(r){case B.boolean:return s.jsx(s.Fragment,{children:n===void 0?"":(!!n).toString()});case B.SystemString:case B.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:n});case B.code:case B.date:case B.decimal:case B.integer:case B.positiveInt:case B.unsignedInt:case B.uri:case B.url:return s.jsx(s.Fragment,{children:n});case B.canonical:return s.jsx(ih,{value:{reference:n},link:e.link});case B.dateTime:case B.instant:return s.jsx(s.Fragment,{children:kr(n)});case B.markdown:return s.jsx("pre",{children:n});case B.Address:return s.jsx(Kse,{value:n});case B.Annotation:return s.jsx(s.Fragment,{children:n==null?void 0:n.text});case B.Attachment:return s.jsx(Ic,{value:n,maxWidth:e.maxWidth});case B.CodeableConcept:return s.jsx(Xn,{value:n});case B.Coding:return s.jsx($ce,{value:n});case B.ContactDetail:return s.jsx(kce,{value:n});case B.ContactPoint:return s.jsx(J5,{value:n});case B.HumanName:return s.jsx(Ox,{value:n});case B.Identifier:return s.jsx(Rce,{value:n});case B.Money:return s.jsx(Tce,{value:n});case B.Period:return s.jsx(s.Fragment,{children:Qoe(n)});case B.Quantity:case B.Duration:return s.jsx(sc,{value:n});case B.Range:return s.jsx(Ix,{value:n});case B.Ratio:return s.jsx(Ice,{value:n});case B.Reference:return s.jsx(ih,{value:n,link:e.link});case B.Timing:return s.jsx(s.Fragment,{children:f5(n)});case B.Dosage:case B.UsageContext:return s.jsx(ry,{value:{type:r,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);return s.jsx(ry,{value:{type:t.type[0].code,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function ta(e,t){const r=fr(e,t);return r?Array.isArray(r)?[r.map(n=>n.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function ry(e){const t=e.value,r=t.value;if(!r)return null;const n=t.type,o=lx(n);return o?typeof r=="object"&&"name"in r&&Object.keys(r).length===1&&typeof r.name=="string"?s.jsx("div",{children:r.name}):s.jsx(Tx,{compact:e.compact,children:Object.entries(o.elements).map(i=>{const[a,l]=i;if(Y5.includes(a)||X5.includes(a)&&l.path.split(".").length===2)return null;const[c,u]=ta(t,a);return e.ignoreMissingValues&&(!c||Array.isArray(c)&&c.length===0)?null:s.jsx(is,{term:th(a),children:s.jsx($o,{property:l,propertyType:u,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},a)})}):s.jsxs("div",{children:[n," not implemented"]})}function Z5(e){return s.jsxs(K,{noWrap:!0,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Ut.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,children:(()=>null)()})})]})}function lt(e,t){var r,n,o;return(o=(n=(r=e==null?void 0:e.issue)==null?void 0:r.filter(i=>{var a;return e4((a=i.expression)==null?void 0:a[0],t)}))==null?void 0:n.map(i=>{var a;return(a=i.details)==null?void 0:a.text}))==null?void 0:o.join(`
190
+ `)}function Dx(e,t){var r;return(r=e==null?void 0:e.issue)==null?void 0:r.filter(n=>{var o;return e4((o=n.expression)==null?void 0:o[0],t)})}function e4(e,t){if(e===t)return!0;if(!e||!t)return!1;const r=e.indexOf(".");if(r>=0&&e.substring(r+1)===t)return!0;const n=t.indexOf(".");return n>=0&&t.substring(n+1)===e}function tt(e){return s.jsx(Ut.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,error:lt(e.outcome,e.htmlFor),children:e.children})}function ny(e,t,r,n,o){const i=n.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",hr(a.code));l in e&&delete e[l]}return e[r]=o,e}function Nce(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=Mce(o);r(i),e.onChange&&e.onChange(i)}return s.jsx($x,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&Ace(t),maxSelectedValues:1,onChange:n})}function Ace(e){var t;return(t=e.coding)==null?void 0:t.map(r=>({system:r.system,code:r.code,display:r.display}))}function Mce(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function t4(e){const[t,r]=f.useState(e.defaultValue);function n(o){const i=o[0],a=i&&zce(i);r(a),e.onChange&&e.onChange(a)}return s.jsx($x,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&Lce(t),maxSelectedValues:1,onChange:n})}function Lce(e){return{system:e.system,code:e.code,display:e.display}}function zce(e){return{system:e.system,code:e.code,display:e.display}}function r4(e){const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){c&&Object.keys(c).length===0&&(c=void 0),r(c),e.onChange&&e.onChange(c)}function i(c){const u={...n.current,system:c};c||delete u.system,o(u)}function a(c){const u={...n.current,use:c};c||delete u.use,o(u)}function l(c){const u={...n.current,value:c};c||delete u.value,o(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"system",defaultValue:t==null?void 0:t.system,onChange:c=>i(c.currentTarget.value),data:["","email","phone","fax","pager","sms","other"]}),s.jsx(ft,{"data-testid":"use",defaultValue:t==null?void 0:t.use,onChange:c=>a(c.currentTarget.value),data:["","home","work","temp","old","mobile"]}),s.jsx(le,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:c=>l(c.currentTarget.value)})]})}function Fce(e){var l;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){r(c),e.onChange&&e.onChange(c)}function i(c){const u={...n.current,name:c};c||delete u.name,o(u)}function a(c){const u={...n.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>i(c.currentTarget.value)}),s.jsx(r4,{name:e.name+"-telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:a})]})}function Vce(e){if(!e)return"";const t=new Date(e);return sm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function n4(e){if(!e)return"";const t=new Date(e);return sm(t)?t.toISOString():""}function ra(e){return s.jsx(le,{id:e.name,name:e.name,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:Bce(),defaultValue:Vce(e.defaultValue),autoFocus:e.autoFocus,error:lt(e.outcome,e.name),onChange:t=>{if(e.onChange){const r=t.currentTarget.value;e.onChange(n4(r))}}})}function Bce(){return{}.NODE_ENV==="test"?"text":"datetime-local"}function Uce(e){return s.jsx(Ds,{id:e.name,name:e.name,"data-testid":"extension-input",defaultValue:sr(e.defaultValue),deserialize:JSON.parse,onChange:t=>{e.onChange&&e.onChange(JSON.parse(t))}})}function Wce(e){var d,p,h;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(m){r(m),e.onChange&&e.onChange(m)}function i(m){o({...n.current,use:m||void 0})}function a(m){o({...n.current,prefix:m?m.split(" "):void 0})}function l(m){o({...n.current,given:m?m.split(" "):void 0})}function c(m){o({...n.current,family:m||void 0})}function u(m){o({...n.current,suffix:m?m.split(" "):void 0})}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{defaultValue:t==null?void 0:t.use,name:e.name+"-use","data-testid":"use",onChange:m=>i(m.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"]}),s.jsx(le,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(d=t==null?void 0:t.prefix)==null?void 0:d.join(" "),onChange:m=>a(m.currentTarget.value)}),s.jsx(le,{placeholder:"Given",name:e.name+"-given",defaultValue:(p=t==null?void 0:t.given)==null?void 0:p.join(" "),onChange:m=>l(m.currentTarget.value)}),s.jsx(le,{name:e.name+"-family",placeholder:"Family",defaultValue:t==null?void 0:t.family,onChange:m=>c(m.currentTarget.value)}),s.jsx(le,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(h=t==null?void 0:t.suffix)==null?void 0:h.join(" "),onChange:m=>u(m.currentTarget.value)})]})}function Hce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{placeholder:"System",defaultValue:t==null?void 0:t.system,onChange:o=>n({...t,system:o.currentTarget.value})}),s.jsx(le,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:o=>n({...t,value:o.currentTarget.value})})]})}const Gce=["USD","EUR","CAD","GBP","AUD"];function qce(e){var c;const{onChange:t}=e,[r,n]=f.useState(e.defaultValue),o=f.useCallback(u=>{n(u),t&&t(u)},[t]),i=f.useCallback(u=>{o({...r,currency:u.currentTarget.value})},[r,o]),a=f.useCallback(u=>{o({...r,value:u.currentTarget.valueAsNumber})},[r,o]),l=s.jsx(ft,{defaultValue:r==null?void 0:r.currency,data:Gce,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return s.jsx(le,{type:"number",label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=r==null?void 0:r.value)==null?void 0:c.toString())??"USD",icon:s.jsx(xle,{size:14}),rightSection:l,rightSectionWidth:92,onChange:a})}function Qce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ra,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>n({...t,start:o})}),s.jsx(ra,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>n({...t,end:o})})]})}function na(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>n({...t,comparator:o.currentTarget.value})}),s.jsx(le,{id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{n({...t,value:Kce(o.currentTarget.value)})}}),s.jsx(le,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>n({...t,unit:o.currentTarget.value})})]})}function Kce(e){if(e)return parseFloat(e)}function Nx(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(na,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>n({...t,low:o})}),s.jsx(na,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>n({...t,high:o})})]})}function Yce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(na,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>n({...t,numerator:o})}),s.jsx(na,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>n({...t,denominator:o})})]})}const Xce={Observation:"code",User:"email:contains"},Jce=["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 Zce(e){return{value:et(e),label:Co(e),resource:e}}function Ns(e){const t=ae(),r=e.resourceType,[n,o]=f.useState(),i=Ke(e.defaultValue,o),a=e.onChange,l=f.useCallback(async(u,d)=>{const p=tue(r),h=new URLSearchParams({[p]:u,_count:"10"});return await t.searchResources(r,h,{signal:d})},[t,r]),c=f.useCallback(u=>{a&&a(u[0])},[a]);return e.defaultValue&&!n&&!i?null:s.jsx(Cx,{name:e.name,required:e.required,itemComponent:eue,defaultValue:i,placeholder:e.placeholder,maxSelectedValues:1,toKey:et,toOption:Zce,loadOptions:l,onChange:c,clearable:!0})}const eue=f.forwardRef(({label:e,resource:t,...r},n)=>s.jsx("div",{ref:n,...r,children:s.jsxs(K,{noWrap:!0,children:[s.jsx(vi,{value:t}),s.jsxs("div",{children:[s.jsx(re,{children:e}),s.jsx(re,{size:"xs",color:"dimmed",children:t.birthDate})]})]})}));function tue(e){return Xce[e]??(Jce.includes(e)?"name":"_id")}function mm(e){const t=rue(e.targetTypes),r=nue(e.defaultValue,t),[n,o]=f.useState(e.defaultValue),[i,a]=f.useState(r);function l(c){o(c),e.onChange&&e.onChange(c)}return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[t&&t.length>1&&s.jsx(ft,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:i,autoFocus:e.autoFocus,onChange:c=>a(c.currentTarget.value),data:t}),!t&&s.jsx(kx,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:i,onChange:a,name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(Ns,{resourceType:i,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:n,onChange:c=>{l(c?dt(c):void 0)}})]})}function rue(e){if(!(!e||e.length===0||e.length===1&&e[0]==="Resource"))return e}function nue(e,t){var n;const r=(n=e==null?void 0:e.reference)==null?void 0:n.split("/")[0];if(r)return r;if(t&&t.length>0)return t[0]}function oue(e){const[t,r]=f.useState(e.defaultValue&&Array.isArray(e.defaultValue)?e.defaultValue:[]),n=f.useRef();n.current=t;function o(i){r(i),e.onChange&&e.onChange(i)}return s.jsxs(Oe,{style:{marginTop:"1rem",marginLeft:"1rem"},children:[t.map((i,a)=>s.jsxs(K,{noWrap:!0,children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(oa,{arrayElement:!0,property:e.property,name:e.name+"."+a,defaultValue:i,onChange:l=>{const c=[...n.current];c[a]=l,o(c)}})}),s.jsx("div",{children:s.jsx(dr,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=[...n.current];c.splice(a,1),o(c)},children:s.jsx(nh,{})})})]},`${a}-${t.length}`)),s.jsx(K,{noWrap:!0,style:{justifyContent:"flex-end"},children:s.jsx("div",{children:s.jsx(dr,{title:"Add",size:"sm",color:"green",onClick:i=>{st(i);const a=[...n.current];a.push(void 0),o(a)},children:s.jsx(bx,{})})})})]})}const iue=["sun","mon","tue","wed","thu","fri","sat"];function aue(e){const[t,r]=f.useState(e.defaultValue),[n,o]=f.useState(!1),i=f.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx("span",{children:f5(i.current)||"No repeat"}),s.jsx(ne,{onClick:()=>o(!0),children:"Edit"})]}),s.jsx(sue,{visible:n,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),r(a),o(!1)},onCancel:()=>o(!1)})]})}const NO={repeat:{period:1,periodUnit:"d"}};function sue(e){const[t,r]=f.useState(e.defaultValue||NO),n=f.useRef();n.current=t;function o(u){r({...n.current,event:[u]})}function i(u){r({...n.current,repeat:u})}function a(u){var d;i({...(d=n.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=n.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=n.current)==null?void 0:d.repeat,dayOfWeek:u})}return s.jsx(Tr,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(Oe,{children:[s.jsx(tt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(ra,{name:"timing-dialog-start",onChange:u=>o(u)})}),s.jsx(tx,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?NO.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(tt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(le,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>a(parseInt(u.currentTarget.value,10)||1)}),s.jsx(ft,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx(tt,{title:"Repeat on",children:s.jsx(Vf.Group,{multiple:!0,onChange:c,children:s.jsx(K,{position:"apart",mt:"md",spacing:"xs",children:iue.map(u=>s.jsx(Vf,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),s.jsx(K,{position:"right",children:s.jsx(ne,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function oa(e){const t=e.property,r=e.defaultPropertyType??t.type[0].code,n=e.name,o=e.defaultValue;if(t.max>1&&!e.arrayElement)return r===B.Attachment?s.jsx(Cce,{name:n,defaultValue:o,onChange:e.onChange}):s.jsx(oue,{property:t,name:n,defaultValue:o,onChange:e.onChange});const i=t.type;return i.length>1?s.jsx(lue,{elementDefinitionTypes:i,...e}):s.jsx(o4,{elementDefinitionType:i[0],...e})}function lue(e){const t=e.elementDefinitionTypes;let r;e.defaultPropertyType&&(r=t.find(i=>i.code===e.defaultPropertyType)),r||(r=t[0]);const[n,o]=f.useState(r);return s.jsxs(K,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:"200px"},defaultValue:n.code,onChange:i=>{o(t.find(a=>a.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(o4,{...e,elementDefinitionType:n,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",hr(n.code)))}})]})}function o4(e){var a,l,c;const t=e.property,r=e.elementDefinitionType.code,n=e.name,o=e.defaultValue,i=t.min!==void 0&&t.min>0;switch(r){case B.SystemString:case B.canonical:case B.string:case B.time:case B.uri:case B.url:return s.jsx(le,{id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case B.date:return s.jsx(le,{type:"date",id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case B.dateTime:case B.instant:return s.jsx(ra,{name:n,defaultValue:o,onChange:e.onChange,outcome:e.outcome});case B.decimal:case B.integer:case B.positiveInt:case B.unsignedInt:return s.jsx(le,{type:"number",step:r===B.decimal?"any":"1",id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.valueAsNumber)}});case B.code:return s.jsx(q5,{binding:(a=t.binding)==null?void 0:a.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.boolean:return s.jsx(jn,{id:n,name:n,"data-testid":n,defaultChecked:!!o,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.checked)}});case B.markdown:return s.jsx(jc,{id:n,name:n,"data-testid":n,defaultValue:o,required:i,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)}});case B.Address:return s.jsx(Yse,{name:n,defaultValue:o,onChange:e.onChange});case B.Annotation:return s.jsx(Xse,{name:n,defaultValue:o,onChange:e.onChange});case B.Attachment:return s.jsx(K5,{name:n,defaultValue:o,onChange:e.onChange});case B.CodeableConcept:return s.jsx(Nce,{binding:(l=t.binding)==null?void 0:l.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.Coding:return s.jsx(t4,{binding:(c=t.binding)==null?void 0:c.valueSet,name:n,defaultValue:o,onChange:e.onChange});case B.ContactDetail:return s.jsx(Fce,{name:n,defaultValue:o,onChange:e.onChange});case B.ContactPoint:return s.jsx(r4,{name:n,defaultValue:o,onChange:e.onChange});case B.Extension:return s.jsx(Uce,{name:n,defaultValue:o,onChange:e.onChange});case B.HumanName:return s.jsx(Wce,{name:n,defaultValue:o,onChange:e.onChange});case B.Identifier:return s.jsx(Hce,{name:n,defaultValue:o,onChange:e.onChange});case B.Money:return s.jsx(qce,{name:n,defaultValue:o,onChange:e.onChange});case B.Period:return s.jsx(Qce,{name:n,defaultValue:o,onChange:e.onChange});case B.Duration:case B.Quantity:return s.jsx(na,{name:n,defaultValue:o,onChange:e.onChange});case B.Range:return s.jsx(Nx,{name:n,defaultValue:o,onChange:e.onChange});case B.Ratio:return s.jsx(Yce,{name:n,defaultValue:o,onChange:e.onChange});case B.Reference:return s.jsx(mm,{name:n,defaultValue:o,targetTypes:cue(t),onChange:e.onChange});case B.Timing:return s.jsx(aue,{name:n,defaultValue:o,onChange:e.onChange});case B.Dosage:case B.UsageContext:return s.jsx(oy,{typeName:r,defaultValue:o,onChange:e.onChange,outcome:e.outcome});default:return s.jsx(oy,{typeName:t.type[0].code,defaultValue:o,onChange:e.onChange,outcome:e.outcome})}}function cue(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 oy(e){const[t,r]=f.useState(e.defaultValue??{});function n(l){r(l),e.onChange&&e.onChange(l)}const o=e.typeName,i=lx(o);if(!i)return s.jsxs("div",{children:[o," not implemented"]});const a={type:o,value:t};return s.jsx(Oe,{children:Object.entries(i.elements).map(([l,c])=>{if(l==="id"||Y5.includes(l)||X5.includes(l)&&c.path.split(".").length===2||!c.type)return null;const[u,d]=ta(a,l),p=c.min!==void 0&&c.min>0;return c.type.length===1&&c.type[0].code==="boolean"?s.jsx(Z5,{title:th(l),description:c.description,htmlFor:l,children:s.jsx(oa,{property:c,name:l,defaultValue:u,defaultPropertyType:d,outcome:e.outcome,onChange:(h,m)=>{n(ny(t,l,m??l,c,h))}})},l):s.jsx(tt,{title:th(l),description:c.description,withAsterisk:p,htmlFor:l,outcome:e.outcome,children:s.jsx(oa,{property:c,name:l,defaultValue:u,defaultPropertyType:d,onChange:(h,m)=>{n(ny(t,l,m??l,c,h))}})},l)})})}const uue=W(()=>({root:{"@media (max-width: 800px)":{paddingLeft:4,paddingRight:4}}}));function Dc(e){const{children:t,...r}=e,{classes:n}=uue();return s.jsx(GT,{className:n.root,...r,children:t})}const due=W(e=>({noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));function i4({value:e}){const{classes:t}=due();return e?s.jsx(Oe,{justify:"flex-start",spacing:"xs",children:e.map(r=>{var n;return r.text&&s.jsx(mT,{classNames:{cite:t.noteCite,body:t.noteBody,root:t.noteRoot},cite:((n=r.authorReference)==null?void 0:n.display)||r.authorString,icon:null,children:r.text},`note-${r.text}`)})}):null}function Nc(e){const{value:t,link:r,...n}=e,[o,i]=f.useState(),a=Ke(t,i);let l;if(o&&!S5(o))l=`[${Ee(o)}]`;else if(a)l=Co(a);else return null;return r?s.jsx(ke,{to:t,...n,children:l}):s.jsx(re,{component:"span",...n,children:l})}function as(e){return s.jsxs(K,{spacing:"xs",children:[s.jsx(vi,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Nc,{value:e.value,link:e.link})]})}const fue={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red"};function a4(e){return s.jsx(IH,{color:fue[e.status],children:e.status})}const s4=W(e=>({table:{border:`0.1px solid ${e.colors.gray[5]}`,borderCollapse:"collapse","& td, & th":{border:`0.1px solid ${e.colors.gray[5]}`,padding:4}},criticalRow:{background:e.colorScheme==="dark"?e.colors.red[7]:e.colors.red[1],border:`0.1px solid ${e.colors.red[5]}`,color:e.colors.red[5],fontWeight:500,"& td":{border:`0.1px solid ${e.colors.red[5]}`}},noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));Ax.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Ax(e){var a;const t=ae(),r=Ke(e.value),[n,o]=f.useState();if(f.useEffect(()=>{r!=null&&r.specimen&&Promise.allSettled(r.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,r]),!r)return null;const i=(n==null?void 0:n.flatMap(l=>l.note||[]))||[];if(r.presentedForm&&r.presentedForm.length>0){const l=r.presentedForm[0];(a=l.contentType)!=null&&a.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return s.jsxs(Oe,{children:[s.jsx(he,{children:"Diagnostic Report"}),s.jsx(pue,{value:r}),n&&!e.hideSpecimenInfo&&hue(n),r.result&&s.jsx(mue,{hideObservationNotes:e.hideObservationNotes,value:r.result}),i.length>0&&s.jsx(i4,{value:i})]})}function pue({value:e}){var t,r;return s.jsxs(K,{mt:"md",spacing:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Subject"}),s.jsx(re,{children:s.jsx(as,{value:e.subject,link:!0})})]}),(t=e.resultsInterpreter)==null?void 0:t.map(n=>s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Interpreter"}),s.jsx(re,{children:s.jsx(as,{value:n,link:!0})})]},n.reference)),(r=e.performer)==null?void 0:r.map(n=>s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Performer"}),s.jsx(re,{children:s.jsx(as,{value:n,link:!0})})]},n.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Issued"}),s.jsx(re,{children:kr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(re,{size:"xs",transform:"uppercase",color:"dimmed",children:"Status"}),s.jsx(re,{children:hr(e.status)})]})]})}function hue(e){return s.jsxs(Oe,{spacing:"xs",children:[s.jsx(he,{order:2,size:"h6",children:"Specimens"}),s.jsx(Pr,{type:"ordered",children:e==null?void 0:e.map(t=>{var r;return s.jsx(Pr.Item,{ml:"sm",children:s.jsxs(K,{spacing:20,children:[s.jsxs(K,{spacing:5,children:[s.jsx(re,{fw:500,children:"Collected:"})," ",kr((r=t.collection)==null?void 0:r.collectedDateTime)]}),s.jsxs(K,{spacing:5,children:[s.jsx(re,{fw:500,children:"Received:"})," ",kr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function mue(e){const{classes:t}=s4();return s.jsxs("table",{className:t.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(l4,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function l4(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(r=>s.jsx(gue,{value:r,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${wa(r)?r.reference:r.id}`))})}function gue(e){var a,l;const{classes:t,cx:r}=s4(),n=Ke(e.value);if(!n||(a=e.ancestorIds)!=null&&a.includes(n.id))return null;const o=!e.hideObservationNotes&&n.note,i=xue(n);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:r({[t.criticalRow]:i}),children:[s.jsx("td",{rowSpan:o?2:1,children:s.jsx(ke,{to:n,children:s.jsx(Xn,{value:n.code})})}),s.jsx("td",{children:s.jsx(vue,{value:n})}),s.jsx("td",{children:s.jsx(yue,{value:n.referenceRange})}),s.jsx("td",{children:n.interpretation&&n.interpretation.length>0&&s.jsx(Xn,{value:n.interpretation[0]})}),s.jsx("td",{children:n.category&&n.category.length>0&&s.jsx(s.Fragment,{children:n.category.map(c=>s.jsx("div",{children:s.jsx(Xn,{value:c})},`category-${ws(c)}`))})}),s.jsx("td",{children:(l=n.performer)==null?void 0:l.map(c=>s.jsx(ih,{value:c},c.reference))}),s.jsx("td",{children:n.status&&s.jsx(a4,{status:n.status})})]}),n.hasMember&&s.jsx(l4,{value:n.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,n.id]:[n.id],hideObservationNotes:e.hideObservationNotes}),o&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(i4,{value:n.note})})})]})}function vue(e){const t=e.value;return s.jsx(s.Fragment,{children:p5(t)})}function yue(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(Ix,{value:t}):null}function xue(e){var r,n,o,i;const t=(i=(o=(n=(r=e.interpretation)==null?void 0:r[0])==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const wue=W((e,{width:t,fill:r})=>({paper:{maxWidth:t,margin:`${e.spacing.xl} auto`,padding:r?0:e.spacing.md,"@media (max-width: 800px)":{padding:r?0:8},"& img":{width:"100%",maxWidth:"100%"},"& video":{width:"100%",maxWidth:"100%"}}})),_ue={shadow:"xs",radius:"md",withBorder:!0};function Mx(e){const{className:t,children:r,width:n,fill:o,unstyled:i,...a}=H("Panel",_ue,e),{classes:l,cx:c}=wue({width:n,fill:o},{name:"Panel",unstyled:i});return s.jsx(on,{className:c(l.paper,t),...a,children:r})}const bue=W(e=>({root:{borderCollapse:"collapse",width:"100%","& tr":{borderTop:`0.1px solid ${e.colors.gray[3]}`},"& th, & td":{padding:`${e.spacing.sm} ${e.spacing.sm}`,verticalAlign:"top"}},removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Sue(e){const{classes:t}=bue(),r=ae(),[n,o]=f.useState(!1);if(f.useEffect(()=>{r.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.original.resourceType]),!n)return null;const i=O5(e.original.resourceType);return s.jsxs("table",{className:t.root,children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:"30%"}}),s.jsx("col",{style:{width:"35%"}}),s.jsx("col",{style:{width:"35%"}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Property"}),s.jsx("th",{children:"Before"}),s.jsx("th",{children:"After"})]})}),s.jsx("tbody",{children:Object.entries(i.elements).map(([a,l])=>{if(a==="id"||a==="meta")return null;const[c,u]=ta(Zn(e.original),a),[d,p]=ta(Zn(e.revised),a);return AO(c)&&AO(d)||sr(c)===sr(d)?null:s.jsxs("tr",{children:[s.jsx("td",{children:th(a)}),s.jsx("td",{className:t.removed,children:s.jsx($o,{property:l,propertyType:u,value:c,ignoreMissingValues:!0})}),s.jsx("td",{className:t.added,children:s.jsx($o,{property:l,propertyType:p,value:d,ignoreMissingValues:!0})})]},a)})})]})}function AO(e){return!e||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0}function Lx(e){const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1);return f.useEffect(()=>{r&&t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log)},[t,r]),!n||!r?null:s.jsx(ry,{value:{type:r.resourceType,value:e.forceUseInput?e.value:r},ignoreMissingValues:e.ignoreMissingValues})}function Pue(e){return s.jsx(Dc,{children:e.children})}function ia(e){var c,u;const{resource:t,profile:r,padding:n,popupMenuItems:o,...i}=e,a=r??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs(Mx,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(K,{position:"apart",spacing:8,mx:"xs",my:"sm",children:[s.jsx(vi,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",children:s.jsx(Nc,{color:"dark",weight:500,value:a,link:!0})}),s.jsxs(re,{size:"xs",children:[s.jsx(ke,{color:"dimmed",to:e.resource,children:kr(l)}),s.jsx(re,{component:"span",color:"dimmed",mx:8,children:"·"}),s.jsx(ke,{color:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(X,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(X.Target,{children:s.jsx(dr,{radius:"xl","aria-label":`Actions for ${et(e.resource)}`,children:s.jsx(_le,{})})}),o]})]}),s.jsxs(H5,{children:[n&&s.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!n&&s.jsx(s.Fragment,{children:e.children})]})]})}function c4(e,t){e.sort((r,n)=>{const o=MO(r,t),i=MO(n,t);return o>i?1:o<i?-1:LO(r,t)-LO(n,t)})}function MO(e,t){if(!u4(e,t)){const r=e.priority;if(typeof r=="string")return{stat:4,asap:3,urgent:2}[r]??0}return 0}function LO(e,t){var n;if(!u4(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const r=(n=e.meta)==null?void 0:n.lastUpdated;return r?new Date(r).getTime():0}function u4(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const jue=W(e=>({pinnedComment:{backgroundColor:e.colors.blue[0]}}));function gm(e){const t=ae(),r=um(),n=t.getProfile(),o=f.useRef(null),i=Ke(e.value),[a,l]=f.useState(),[c,u]=f.useState([]),d=e.loadTimelineResources,p=f.useRef(c);p.current=c;const h=f.useCallback(T=>{c4(T,i),T.reverse(),u(T)},[i]),m=f.useCallback(T=>{const z=[];for(const M of T){if(M.status!=="fulfilled")continue;const L=M.value;if(L.type==="history"&&l(L),L.entry)for(const q of L.entry)z.push(q.resource)}h(z)},[h]),v=f.useCallback(T=>h([...p.current,T]),[h]),g=f.useCallback(()=>{var M;let T,z;"resourceType"in e.value?(T=e.value.resourceType,z=e.value.id):[T,z]=(M=e.value.reference)==null?void 0:M.split("/"),d(t,T,z).then(m).catch(console.log)},[t,e.value,d,m]);f.useEffect(()=>g(),[g]);function b(T){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,T)).then(z=>v(z)).catch(console.log)}function y(T){!i||!e.createMedia||t.createResource(e.createMedia(i,n,T)).then(z=>v(z)).then(()=>wl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(fm,{size:16}),autoClose:2e3})).catch(z=>wl({id:"upload-notification",color:"red",title:"Upload error",message:Ee(z),icon:s.jsx(kO,{size:16}),autoClose:2e3}))}function x(T,z){return t.updateResource({...T,priority:z})}function _(T){x(T,"stat").then(g).catch(console.log)}function w(T){x(T,"routine").then(g).catch(console.log)}function O(T){r(`/${T.resourceType}/${T.id}`)}function C(T){r(`/${T.resourceType}/${T.id}/edit`)}function P(T){r(`/${T.resourceType}/${T.id}/delete`)}function E(T){var z;r(`/${T.resourceType}/${T.id}/_history/${(z=T.meta)==null?void 0:z.versionId}`)}function k(){me({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function $(T){wl({id:"upload-notification",loading:!0,title:"Uploading...",message:Tue(T),autoClose:!1,withCloseButton:!1})}function I(T){wl({id:"upload-notification",color:"red",title:"Upload error",message:Ee(T),icon:s.jsx(kO,{size:16}),autoClose:2e3})}return i?s.jsxs(Pue,{children:[e.createCommunication&&s.jsx(Mx,{children:s.jsx(De,{testid:"timeline-form",onSubmit:T=>{b(T.text);const z=o.current;z&&(z.value="",z.focus())},children:s.jsxs(K,{spacing:"xs",noWrap:!0,style:{width:"100%"},children:[s.jsx(vi,{value:n}),s.jsx(le,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(dr,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(Rle,{size:16})}),s.jsx(Rx,{onUpload:y,onUploadStart:k,onUploadProgress:$,onUploadError:I,children:T=>s.jsx(dr,{...T,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Sx,{size:16})})})]})})}),c.map(T=>{var M;if(!T)return null;const z=`${T.resourceType}/${T.id}/${(M=T.meta)==null?void 0:M.versionId}`;if(T.resourceType===i.resourceType&&T.id===i.id)return s.jsx(Oue,{history:a,resource:T,onDetails:E},z);switch(T.resourceType){case"AuditEvent":return s.jsx(kue,{resource:T,onDetails:O},z);case"Communication":return s.jsx(Eue,{resource:T,onPin:T.priority!=="stat"?_:void 0,onUnpin:T.priority==="stat"?w:void 0,onDetails:O,onEdit:C,onDelete:P},z);case"DiagnosticReport":return s.jsx(Rue,{resource:T,onDetails:O,onEdit:C,onDelete:P},z);case"Media":return s.jsx($ue,{resource:T,onDetails:O,onEdit:C,onDelete:P},z);default:return s.jsx(ia,{resource:T,padding:!0,children:s.jsx(Lx,{value:T,ignoreMissingValues:!0})},z)}})]}):s.jsx(or,{style:{width:"100%",height:"100%"},children:s.jsx(cn,{})})}function bs(e){return s.jsxs(X.Dropdown,{children:[s.jsx(X.Label,{children:"Resource"}),e.onPin&&s.jsx(X.Item,{icon:s.jsx(Dle,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${et(e.resource)}`,children:"Pin"}),e.onUnpin&&s.jsx(X.Item,{icon:s.jsx(Nle,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${et(e.resource)}`,children:"Unpin"}),e.onDetails&&s.jsx(X.Item,{icon:s.jsx(Cle,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${et(e.resource)}`,children:"Details"}),e.onEdit&&s.jsx(X.Item,{icon:s.jsx(ble,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${et(e.resource)}`,children:"Edit"}),e.onDelete&&s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Label,{children:"Danger zone"}),s.jsx(X.Item,{color:"red",icon:s.jsx(W5,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${et(e.resource)}`,children:"Delete"})]})]})}function Oue(e){const t=Cue(e.history,e.resource);return t?s.jsx(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(Sue,{original:t,revised:e.resource})}):s.jsxs(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:[s.jsx("h3",{children:"Created"}),s.jsx(Lx,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function Cue(e,t){const r=e.entry,n=r.findIndex(o=>{var i,a,l;return((a=(i=o.resource)==null?void 0:i.meta)==null?void 0:a.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(n>=r.length-1))return r[n+1].resource}function Eue(e){var o,i;const{classes:t}=jue(),n=!e.resource.priority||e.resource.priority==="routine"?void 0:t.pinnedComment;return s.jsx(ia,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx("p",{children:(i=(o=e.resource.payload)==null?void 0:o[0])==null?void 0:i.contentString})})}function $ue(e){var n;const t=(n=e.resource.content)==null?void 0:n.contentType,r=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(ia,{resource:e.resource,padding:!!r,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(Ic,{value:e.resource.content})})}function kue(e){return s.jsx(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(da,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function Rue(e){return s.jsx(ia,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(bs,{...e}),children:s.jsx(Ax,{value:e.resource})})}function Tue(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${$g(e.loaded)} / ${$g(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${$g(e.loaded)}`}function $g(e){if(e===0)return"0.00 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP".charAt(t)+"B"}function Iue(e){return s.jsx(gm,{value:e.resource,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,i=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:i})])}})}function Se(e){const{children:t,...r}=e;return s.jsx(Dc,{children:s.jsx(Mx,{...r,children:t})})}function Due(e){return s.jsx(gm,{value:e.encounter,loadTimelineResources:async(t,r,n)=>Promise.allSettled([t.readHistory("Encounter",n),t.search("Communication","encounter=Encounter/"+n),t.search("Media","encounter=Encounter/"+n)]),createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",encounter:dt(t),subject:t.subject,sender:dt(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",encounter:dt(t),subject:t.subject,operator:dt(r),issued:new Date().toISOString(),content:n})})}function Nue(e){let t;try{t=Yae(e.path,e.resource)}catch(r){return console.warn("FhirPathDisplay:",r),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx($o,{value:t[0]||"",propertyType:e.propertyType})}function Aue(e){return s.jsxs(Tr,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(oe,{display:"flex",sx:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(zO,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(zO,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(re,{sx:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function zO(e){return s.jsx(ne,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const Mue={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]},Lue={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 zx(e,t){return{...e,filters:t,offset:0,name:void 0}}function Fx(e,t){return zx(e,(e.filters??[]).filter(r=>r.code!==t))}function vm(e,t,r,n,o){o&&(e=Fx(e,t));const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:r,value:n??""}),zx(e,i)}function zue(e,t){if(!e.filters)return e;const r=[...e.filters];return r.splice(t,1),{...e,filters:r,name:void 0}}function Fue(e,t){return Vx(e,t,-1)}function Vue(e,t){return Vx(e,t,0)}function Bue(e,t){return Vx(e,t,1)}function Vx(e,t,r){const n=new Date;n.setDate(n.getDate()+r),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),Ux(e,t,n,o)}function Uue(e,t){return Bx(e,t,-1)}function Wue(e,t){return Bx(e,t,0)}function Hue(e,t){return Bx(e,t,1)}function Bx(e,t,r){const n=new Date;n.setMonth(n.getMonth()+r),n.setDate(1),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),Ux(e,t,n,o)}function Gue(e,t){const r=new Date;return r.setMonth(0),r.setDate(1),r.setHours(0,0,0,0),Ux(e,t,r,new Date)}function Ux(e,t,r,n){return e=Fx(e,t),e=FO(e,t,te.GREATER_THAN_OR_EQUALS,r),e=FO(e,t,te.LESS_THAN_OR_EQUALS,n),e}function FO(e,t,r,n){return vm(e,t,r,n.toISOString())}function VO(e,t,r=!0){return vm(e,t,te.MISSING,r.toString())}function que(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function Que(e,t){const r=e.count??Tc,n=(t-1)*r;return que(e,n)}function Kue(e,t,r){return t===Yue(e)&&r!==void 0&&r===Xue(e)?e:{...e,sortRules:[{code:t,descending:!!r}],name:void 0}}function Yue(e){const t=e.sortRules;if(!t||t.length===0)return;const r=t[0].code;return r.startsWith("-")?r.substr(1):r}function Xue(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function Jue(e){return Mue[e.type]}function Wx(e){return Lue[e]??""}function yi(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(hr).join(" "))}function Zue(e,t){var n,o;const r=t.name;return r==="id"?e.id:r==="meta.versionId"?(n=e.meta)==null?void 0:n.versionId:r==="_lastUpdated"?kr((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?ede(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?tde(e,t.searchParams[0]):null}function ede(e,t){var i,a,l;const r=((l=(a=(i=t.path)==null?void 0:i.split("."))==null?void 0:a.pop())==null?void 0:l.replaceAll("[x]",""))??"",[n,o]=ta({type:e.resourceType,value:e},r);return n?s.jsx($o,{property:t,propertyType:o,value:n,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function tde(e,t){const r=gx(t.expression,[{type:e.resourceType,value:e}]);return!r||r.length===0?null:s.jsx(s.Fragment,{children:r.map((n,o)=>s.jsx($o,{propertyType:n.type,value:n.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${r.length}`))})}function rde(e){const t=f.useRef(!1),[r,n]=f.useState({search:JSON.parse(sr(e.search))}),[o,i]=f.useState(!1);f.useEffect(()=>{n({search:e.search})},[e.search]);const a=f.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=O5(c),d=cx(c);return nde(u,d).sort((p,h)=>p.localeCompare(h)).map(p=>({value:p,label:yi(p)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){n({search:{...r.search,fields:c}})}return s.jsx(Tr,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(Oe,{children:[s.jsx(em,{withinPortal:!0,style:{width:550},placeholder:"Select fields to display",data:a,value:r.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",dropdownPosition:"bottom",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(K,{position:"right",children:s.jsx(ne,{onClick:()=>e.onOk(r.search),children:"OK"})})]})})}function nde(e,t){const r=[],n=new Set,o=new Set;for(const i of Object.keys(e.elements))r.push(i),n.add(i.toLowerCase()),o.add(yi(i));if(t)for(const i of Object.keys(t)){const a=yi(i);!n.has(i)&&!o.has(a)&&(r.push(i),n.add(i),o.add(a))}return r}function d4(e){var o;const{resourceType:t,filter:r}=e,n=(o=gi.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.jsx(Nc,{value:{reference:r.value}});const i=vx(t,n);if(r.code==="_lastUpdated"||i.type===Yo.DATETIME)return s.jsx(s.Fragment,{children:kr(r.value)})}return s.jsx(s.Fragment,{children:r.value})}function f4(e){const t=vx(e.resourceType,e.searchParam),r="filter-value";switch(t.type){case Yo.REFERENCE:return s.jsx(mm,{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 Yo.BOOLEAN:return s.jsx(jn,{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 Yo.DATE:return s.jsx(le,{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 Yo.DATETIME:return s.jsx(ra,{name:r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Yo.NUMBER:return s.jsx(le,{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 Yo.QUANTITY:return s.jsx(na,{name:r,defaultValue:ode(e.defaultValue),autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(`${n.value}`):e.onChange("")}});default:return s.jsx(le,{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 ode(e){if(e){const[t,r,n]=e.split("|");if(t)return{value:parseFloat(t),system:r,unit:n}}}function ide(e){const[t,r]=f.useState(JSON.parse(sr(e.search))),[n,o]=f.useState(-1),i=f.useRef(t);i.current=t,f.useEffect(()=>{r(JSON.parse(sr(e.search)))},[e.search]);function a(d){r(vm(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=cx(l)??{},u=t.filters||[];return s.jsxs(Tr,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,p)=>p===n?s.jsx(BO,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[p]=h,r(zx(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(ade,{resourceType:l,searchParams:c,filter:d,onEdit:()=>o(p),onDelete:()=>r(zue(i.current,p))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(BO,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function ade(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:yi(t.code)}),s.jsx("td",{children:Wx(t.operator)}),s.jsx("td",{children:s.jsx(d4,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function BO(e){const[t,r]=f.useState(e.defaultValue??{}),n=f.useRef(t);n.current=t;function o(u){r({...n.current,code:u})}function i(u){r({...n.current,operator:u})}function a(u){r({...n.current,value:u})}const l=e.searchParams[t.code],c=l&&Jue(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ft,{"data-testid":"filter-field",defaultValue:n.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:yi(u)}))]})}),s.jsx("td",{children:c&&s.jsx(ft,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:Wx(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(f4,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(ne,{compact:!0,variant:"outline",onClick:()=>{e.onOk(n.current),r({})},children:e.okText}),e.onCancel&&s.jsx(ne,{compact:!0,variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function sde(e){const[t,r]=f.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function n(){e.onOk({...e.filter,value:t})}return s.jsx(Tr,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(De,{onSubmit:n,children:s.jsxs(tn,{children:[s.jsx(tn.Col,{span:10,children:s.jsx(f4,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:r})}),s.jsx(tn.Col,{span:2,children:s.jsx(ne,{onClick:n,fullWidth:!0,children:"OK"})})]})})})}function lde(e){if(!e.searchParams)return null;function t(i,a){o(Kue(e.search,i.code,a))}function r(i){o(Fx(e.search,i.code))}function n(i,a){e.onPrompt(i,{code:i.code,operator:a,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(cde,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:n,onChange:o,onClear:r}):s.jsx(X.Dropdown,{children:e.searchParams.map(i=>s.jsx(X.Item,{children:yi(i.code)},i.code))})}function cde(e){switch(e.searchParam.type){case"date":return s.jsx(ude,{...e});case"number":case"quantity":return s.jsx(dde,{...e});case"reference":return s.jsx(fde,{...e});case"string":case"token":case"uri":return s.jsx(pde,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function ude(e){const{searchParam:t}=e,r=t.code;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Px,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(X.Item,{icon:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(U5,{size:14}),onClick:()=>e.onPrompt(t,te.ENDS_BEFORE),children:"Before..."}),s.jsx(X.Item,{icon:s.jsx(B5,{size:14}),onClick:()=>e.onPrompt(t,te.STARTS_AFTER),children:"After..."}),s.jsx(X.Item,{icon:s.jsx(ule,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Between..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Bue(e.search,r)),children:"Tomorrow"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Vue(e.search,r)),children:"Today"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Fue(e.search,r)),children:"Yesterday"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Hue(e.search,r)),children:"Next Month"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Wue(e.search,r)),children:"This Month"}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Uue(e.search,r)),children:"Last Month"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ti,{size:14}),onClick:()=>e.onChange(Gue(e.search,r)),children:"Year to date"}),s.jsx(ym,{...e})]})}function dde(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Px,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(X.Item,{icon:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(B5,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN),children:"Greater than..."}),s.jsx(X.Item,{icon:s.jsx(ty,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(X.Item,{icon:s.jsx(U5,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN),children:"Less than..."}),s.jsx(X.Item,{icon:s.jsx(ty,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(ym,{...e})]})}function fde(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(ym,{...e})]})}function pde(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(Px,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(X.Item,{icon:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(hm,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(pm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(ple,{size:14}),onClick:()=>e.onPrompt(t,te.CONTAINS),children:"Contains..."}),s.jsx(X.Item,{icon:s.jsx(fle,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Does not contain..."}),s.jsx(ym,{...e})]})}function ym(e){const{searchParam:t}=e,r=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(lle,{size:14}),onClick:()=>e.onChange(VO(e.search,r)),children:"Missing"}),s.jsx(X.Item,{icon:s.jsx(sle,{size:14}),onClick:()=>e.onChange(VO(e.search,r,!1)),children:"Not missing"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(oh,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function hde(e){const t=e.resourceType,r=[];for(const n of e.fields||["id","_lastUpdated"])r.push(mde(t,n));return r}function mde(e,t){var o;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const r=xa(e,t),n=_ae(e,t.toLowerCase());if(r&&n)return{name:t,elementDefinition:r,searchParams:[n]};if(r){const i=cx(e);let a;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);a=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),a.length===0&&(a=void 0)}return{name:t,elementDefinition:r,searchParams:a}}if(n){const i=vx(e,n);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[n]}}return{name:t}}class gde extends Event{constructor(t){super("change"),this.definition=t}}class vde extends Event{constructor(t){super("load"),this.response=t}}class ah extends Event{constructor(t,r){super("click"),this.resource=t,this.browserEvent=r}}const yde=W(e=>({root:{maxWidth:"100%",overflow:"auto",textAlign:"left",marginBottom:"20px"},table:{cursor:"pointer"},tr:{"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]}},th:{padding:"0 !important"},control:{width:"100%",padding:`${e.spacing.xs} ${e.spacing.md}`,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}},icon:{width:21,height:21,borderRadius:21}}));function xde(e){var L,q,Y;const{classes:t}=yde(),r=ae(),[n,o]=f.useState(!1),[i,a]=f.useState(),{search:l,onLoad:c}=e,[u,d]=f.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),p=f.useRef(u);p.current=u;const h=l.total??"accurate",m=f.useCallback(R=>{a(void 0),r.search(l.resourceType,Ka({...l,total:h,fields:void 0}),R).then(N=>{d({...p.current,searchResponse:N}),c&&c(new vde(N))}).catch(N=>{d({...p.current,searchResponse:void 0}),a(N)})},[r,l,h,c]),v=f.useCallback(()=>{d({...p.current,searchResponse:void 0}),m({cache:"reload"})},[m]);f.useEffect(()=>{m()},[m]);function g(R,N){R.stopPropagation();const Q=R.target.checked,ee={...p.current.selected};Q?ee[N]=!0:delete ee[N],d({...p.current,selected:ee})}function b(R){R.stopPropagation();const V=R.target.checked,Q={},ee=p.current.searchResponse;V&&(ee!=null&&ee.entry)&&ee.entry.forEach(_e=>{var we;(we=_e.resource)!=null&&we.id&&(Q[_e.resource.id]=!0)}),d({...p.current,selected:Q})}function y(){var N,V;const R=p.current;if(!((N=R.searchResponse)!=null&&N.entry)||R.searchResponse.entry.length===0)return!1;for(const Q of R.searchResponse.entry)if((V=Q.resource)!=null&&V.id&&!R.selected[Q.resource.id])return!1;return!0}function x(R){e.onChange&&e.onChange(new gde(R))}function _(R,N){if(G5(R.target)||R.button===2)return;st(R);const V=R.button===1||R.ctrlKey||R.metaKey;!V&&e.onClick&&e.onClick(new ah(N,R)),V&&e.onAuxClick&&e.onAuxClick(new ah(N,R))}function w(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(f.useEffect(()=>{o(!1),r.requestSchema(e.search.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.search.resourceType]),!n)return s.jsx(or,{style:{width:"100%",height:"100%"},children:s.jsx(cn,{})});const O=e.checkboxesEnabled,C=hde(l),P=l.resourceType,E=u.searchResponse,k=E==null?void 0:E.entry,$=k==null?void 0:k.map(R=>R.resource),I="subtle",T="gray",z=16,M=window.innerWidth<768;return s.jsxs("div",{className:t.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(K,{position:"apart",mb:"xl",children:[s.jsxs(K,{spacing:2,children:[s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(vle,{size:z}),onClick:()=>d({...p.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Ple,{size:z}),onClick:()=>d({...p.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Sle,{size:z}),onClick:e.onNew,children:"New..."}),!M&&w()&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(Hle,{size:z}),onClick:e.onExport?e.onExport:()=>d({...p.current,exportDialogVisible:!0}),children:"Export..."}),!M&&e.onDelete&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(W5,{size:z}),onClick:()=>e.onDelete(Object.keys(u.selected)),children:"Delete..."}),!M&&e.onBulk&&s.jsx(ne,{compact:!0,variant:I,color:T,leftIcon:s.jsx(cle,{size:z}),onClick:()=>e.onBulk(Object.keys(u.selected)),children:"Bulk..."})]}),s.jsxs(K,{spacing:2,children:[E&&s.jsxs(re,{size:"xs",color:"dimmed",children:[Sde(l,E.total),"-",Pde(l,E.total)," of"," ",`${h==="estimate"?"~":""}${(L=E.total)==null?void 0:L.toLocaleString()}`]}),s.jsx(dr,{title:"Refresh",onClick:v,children:s.jsx(zle,{size:"1.125rem"})})]})]}),s.jsxs(ma,{className:t.table,children:[s.jsxs("thead",{children:[s.jsxs("tr",{children:[O&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:y(),onChange:R=>b(R)})}),C.map(R=>s.jsx("th",{children:s.jsxs(X,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(X.Target,{children:s.jsx(wo,{className:t.control,children:s.jsxs(K,{position:"apart",noWrap:!0,children:[s.jsx(re,{weight:500,size:"sm",children:yi(R.name)}),s.jsx(or,{className:t.icon,children:s.jsx(ole,{size:14,stroke:1.5})})]})})}),s.jsx(lde,{search:e.search,searchParams:R.searchParams,onPrompt:(N,V)=>{d({...p.current,filterDialogVisible:!0,filterDialogSearchParam:N,filterDialogFilter:V})},onChange:N=>{x(N)}})]})},R.name))]}),!e.hideFilters&&s.jsxs("tr",{children:[O&&s.jsx("th",{}),C.map(R=>s.jsx("th",{children:R.searchParams&&s.jsx(wde,{resourceType:P,searchParams:R.searchParams,filters:e.search.filters})},R.name))]})]}),s.jsx("tbody",{children:$==null?void 0:$.map(R=>R&&s.jsxs("tr",{className:t.tr,"data-testid":"search-control-row",onClick:N=>_(N,R),onAuxClick:N=>_(N,R),children:[O&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!u.selected[R.id],onChange:N=>g(N,R.id)})}),C.map(N=>s.jsx("td",{children:Zue(R,N)},N.name))]},R.id))})]}),($==null?void 0:$.length)===0&&s.jsx(Dc,{children:s.jsx(or,{style:{height:150},children:s.jsx(re,{size:"xl",color:"dimmed",children:"No results"})})}),(E==null?void 0:E.total)!==void 0&&E.total>0&&s.jsx(or,{m:"md",p:"md",children:s.jsx(to,{value:_de(l),total:bde(l,E.total),onChange:R=>x(Que(l,R)),getControlProps:R=>{switch(R){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),i&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),s.jsx(rde,{search:e.search,visible:p.current.fieldEditorVisible,onOk:R=>{x(R),d({...p.current,fieldEditorVisible:!1})},onCancel:()=>{d({...p.current,fieldEditorVisible:!1})}}),s.jsx(ide,{search:e.search,visible:p.current.filterEditorVisible,onOk:R=>{x(R),d({...p.current,filterEditorVisible:!1})},onCancel:()=>{d({...p.current,filterEditorVisible:!1})}}),s.jsx(Aue,{visible:p.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{d({...p.current,exportDialogVisible:!1})}}),s.jsx(sde,{visible:p.current.filterDialogVisible,title:(q=u.filterDialogSearchParam)!=null&&q.code?yi(u.filterDialogSearchParam.code):"",resourceType:P,searchParam:u.filterDialogSearchParam,filter:u.filterDialogFilter,defaultValue:"",onOk:R=>{x(vm(e.search,R.code,R.operator,R.value)),d({...p.current,filterDialogVisible:!1})},onCancel:()=>{d({...p.current,filterDialogVisible:!1})}},(Y=u.filterDialogSearchParam)==null?void 0:Y.code)]})}const Ac=f.memo(xde);function wde(e){const t=(e.filters??[]).filter(r=>e.searchParams.find(n=>n.code===r.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(r=>s.jsxs("div",{children:[Wx(r.operator)," ",s.jsx(d4,{resourceType:e.resourceType,filter:r})]},`filter-${r.code}-${r.operator}-${r.value}`))})}function _de(e){return Math.floor((e.offset??0)/(e.count??Tc))+1}function bde(e,t){const r=e.count??Tc;return Math.ceil(t/r)}function Sde(e,t){return Math.min(t,(e.offset??0)+1)}function Pde(e,t){return Math.min(t,((e.offset??0)+1)*(e.count??Tc))}function jde(e){const t=ae(),[r,n]=f.useState(!1),[o,i]=f.useState(),{query:a,fields:l}=e,[c,u]=f.useState(),[d,p]=f.useState({}),h=f.useRef();h.current=c;const m=f.useRef({});m.current=d,f.useEffect(()=>{i(void 0),t.graphql(a).then(u).catch(_=>i(ct(_)))},[t,a]);function v(_,w){_.stopPropagation();const C=_.target.checked,P={...m.current};C?P[w]=!0:delete P[w],p(P)}function g(_){var E;_.stopPropagation();const O=_.target.checked,C={},P=(E=h.current)==null?void 0:E.data.ResourceList;O&&P&&P.forEach(k=>{k.id&&(C[k.id]=!0)}),p(C)}function b(){var w;const _=(w=h.current)==null?void 0:w.data.ResourceList;if(!_||_.length===0)return!1;for(const O of _)if(O.id&&!m.current[O.id])return!1;return!0}function y(_,w){G5(_.target)||(st(_),_.button!==1&&e.onClick&&e.onClick(new ah(w,_)),_.button===1&&e.onAuxClick&&e.onAuxClick(new ah(w,_)))}if(f.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>n(!0)).catch(console.log)},[t,e.resourceType]),!r)return s.jsx(cn,{});const x=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:_=>st(_),"data-testid":"search-control",children:[s.jsxs(ma,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[x&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:b(),onChange:_=>g(_)})}),l.map(_=>s.jsx("th",{children:_.name},_.name))]})}),s.jsx("tbody",{children:c==null?void 0:c.data.ResourceList.map(_=>_&&s.jsxs("tr",{"data-testid":"search-control-row",onClick:w=>y(w,_),onAuxClick:w=>y(w,_),children:[x&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${_.id}`,checked:!!d[_.id],onChange:w=>v(w,_.id)})}),l.map(w=>s.jsx("td",{children:s.jsx(Nue,{propertyType:w.propertyType,path:w.fhirPath,resource:_})},w.name))]},_.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(ne,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const Ode=f.memo(jde);function En(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function Cde(e){const{group:t}=e;return s.jsx(on,{withBorder:!0,radius:"md",p:"xs",display:"flex",sx:{alignItems:"center",justifyContent:"center"},children:s.jsxs(K,{children:[t.measureScore&&s.jsx(kde,{group:t}),!t.measureScore&&s.jsx($de,{group:t})]})})}function Ede(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(re,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(re,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function $de(e){const{group:t}=e,r=t.population,n=r==null?void 0:r.find(c=>ws(c.code)==="numerator"),o=r==null?void 0:r.find(c=>ws(c.code)==="denominator"),i=n==null?void 0:n.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(oe,{children:[s.jsx(he,{order:3,children:"Not Applicable"}),s.jsx(re,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(oe,{children:[s.jsx(he,{order:3,children:"Insufficient Data"}),s.jsx(re,{children:`Numerator: ${i}`}),s.jsx(re,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(ex,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:p4(l)}],label:s.jsx(Zf,{justify:"center",children:s.jsxs(re,{fw:700,fz:18,children:[i," / ",a]})})})}function kde(e){var n,o,i;const{group:t}=e,r=((n=t.measureScore)==null?void 0:n.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:r==="%"?s.jsx(ex,{size:120,thickness:12,roundCaps:!0,sections:[{value:Rde(t),color:p4(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(Zf,{justify:"center",children:s.jsx(re,{fw:700,fz:18,children:s.jsx(sc,{value:t.measureScore})})})}):s.jsx(Zf,{h:120,align:"center",children:s.jsx(he,{order:3,children:s.jsx(sc,{value:t.measureScore})})})})}function Rde(e){var n,o;const t=(n=e.measureScore)==null?void 0:n.value,r=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&r==="%"?t*100:t:0}function p4(e){return e<=33?"red":e<=67?"yellow":"green"}function Tde(e){var n;const t=Ke(e.measureReport),[r]=Qse("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(oe,{children:[r&&s.jsx(Ede,{measure:r}),s.jsx(_N,{cols:3,breakpoints:[{maxWidth:"48rem",cols:2,spacing:"md"},{maxWidth:"36rem",cols:1,spacing:"sm"}],spacing:"md",children:(n=t.group)==null?void 0:n.map((o,i)=>s.jsx(Cde,{group:o},o.id??i))})]}):null}function bi(e){var r;const t=((r=e.outcome)==null?void 0:r.issue)||e.issues;return!t||t.length===0?null:s.jsx(_c,{icon:s.jsx(dm,{size:16}),color:"red",children:t.map(n=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:j5(n)},(o=n.details)==null?void 0:o.text)})})}function Ide(e){const t=f.useCallback((r,n,o)=>{const i=`${n}/${o}`,a=100;return Promise.allSettled([r.readHistory("Patient",o),r.search("Communication",{subject:i,_count:a}),r.search("Device",{patient:i,_count:a}),r.search("DeviceRequest",{patient:i,_count:a}),r.search("DiagnosticReport",{subject:i,_count:a}),r.search("Media",{subject:i,_count:a}),r.search("ServiceRequest",{subject:i,_count:a}),r.search("Task",{subject:i,_count:a})])},[]);return s.jsx(gm,{value:e.patient,loadTimelineResources:t,createCommunication:(r,n,o)=>({resourceType:"Communication",status:"completed",subject:dt(r),sender:dt(n),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,n,o)=>({resourceType:"Media",status:"completed",subject:dt(r),operator:dt(n),issued:new Date().toISOString(),content:o})})}const h4=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}}}));function Dde(e){const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){c(void 0)}function h(){a(void 0)}const m=f.useRef();if(m.current=u,f.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(d(Fde(r??{resourceType:"PlanDefinition"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!u)return null;function v(g,b){d({...m.current,[g]:b})}return s.jsx("div",{children:s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(le,{label:"Plan Title",defaultValue:u.title,onChange:g=>v("title",g.currentTarget.value)}),s.jsx(m4,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:g=>v("action",g)}),s.jsx(ne,{type:"submit",children:"Save"})]})})}function m4(e){const{classes:t}=h4(),r=f.useRef();r.current=e.actions;function n(a){e.onChange(r.current.map(l=>l.id===a.id?a:l))}function o(a){e.onChange([...r.current,a]),e.setSelectedKey(a.id)}function i(a){e.onChange(r.current.filter(l=>l!==a))}return s.jsxs("div",{className:t.section,children:[e.actions.map(a=>s.jsx("div",{children:s.jsx(Nde,{action:a,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(a)})},a.id)),s.jsx("div",{className:t.bottomActions,children:s.jsx(Le,{href:"#",onClick:a=>{st(a),o({id:v4()})},children:"Add action"})})]})}function Nde(e){const{classes:t,cx:r}=h4(),{action:n}=e,o=zde(n),i=e.selectedKey===e.action.id,a=e.hoverKey===e.action.id;function l(d){d.stopPropagation(),e.setSelectedKey(e.action.id)}function c(d){st(d),e.setHoverKey(e.action.id)}const u=r(t.section,{[t.editing]:i,[t.hovering]:a&&!i});return s.jsxs("div",{"data-testid":n.id,className:u,onClick:l,onMouseOver:c,children:[i?s.jsx(Mde,{action:n,actionType:o,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(Ade,{action:n,actionType:o}),s.jsx("div",{className:t.bottomActions,children:s.jsx(Le,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()},children:"Remove"})})]})}const iy={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function Ade(e){const{action:t,actionType:r}=e,[n,o]=g4(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",r&&`(${r})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(ih,{value:{reference:t.definitionCanonical}})}),n&&s.jsx("div",{children:s.jsx($o,{property:iy,propertyType:o,value:n})})]})}function Mde(e){const{action:t}=e,[r,n]=f.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(Oe,{spacing:"xl",children:[s.jsx(le,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(le,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(ft,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:r,onChange:i=>n(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&s.jsx(m4,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(r){case"appointment":return s.jsx(Fu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(Fu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(Fu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(Fu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(tt,{title:"Timing",description:"When the action should take place.",children:s.jsx(Lde,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Fu(e){const{id:t,definitionCanonical:r}=e.action,n=r!=null&&r.startsWith(e.resourceType+"/")?{reference:r}:void 0;return s.jsx(Ns,{name:t,resourceType:e.resourceType,defaultValue:n,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:et(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function Lde(e){const t=e.action,r="timing",[n,o]=g4(t);return s.jsx(oa,{property:iy,name:"timing[x]",defaultValue:n,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(ny(t,r,a??r,iy,i))}})}function zde(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 g4(e){return ta({type:"PlanDefinitionAction",value:e},"timing")}let kg=1;function v4(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(kg=Math.max(kg,t+1))}return e}return"id-"+kg++}function Fde(e){return{...e,action:y4(e.action)}}function y4(e){if(e)return e.map(t=>({...t,id:v4(t.id),action:y4(t.action)}))}var it=(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))(it||{});function Vde(e){return e.type==="choice"||e.type==="open-choice"}function Bde(e,t){if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const n of e.enableWhen){const o=x4(t,n.question);if(n.operator==="exists"&&!n.answerBoolean&&!(o!=null&&o.length)){if(r==="any")return!0;continue}const{anyMatch:i,allMatch:a}=Hde(n,o,r);if(r==="any"&&i)return!0;if(r==="all"&&!a)return!1}return r!=="any"}function Ude(e,t,r){return e.map(n=>{var a;const o=(a=r.answerOption)==null?void 0:a.find(l=>ya(l.valueCoding)===n||l[t]===n),i=fr({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function x4(e,t){if(e)for(const r of e){if(r.linkId===t)return r.answer;if(r.item){const n=x4(r.item,t);if(n)return n}}}function Wde(e,t,r){if(r==="exists")return!!e===t.value;if(e){const n=r==="="||r==="!="?r==null?void 0:r.replace("=","~"):r,[{value:o}]=gx(`%actualAnswer ${n} %expectedAnswer`,[e],{actualAnswer:e,expectedAnswer:t});return o}else return!1}function Hde(e,t,r){const n=t||[],o=fr({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of n){const c=fr({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(Wde(c,o,u)?i=!0:a=!1,r==="any"&&i)break}return{anyMatch:i,allMatch:a}}function w4(e){var r,n;const t=ax(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(n=(r=t.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:n.map(o=>o.code)}}function Rg(e,t){var o;const r=va(e);let n=ax(r,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(n&&(r.extension=(o=r.extension)==null?void 0:o.filter(i=>i!==n)),r):(n||(r.extension||(r.extension=[]),n={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},r.extension.push(n)),t.length===1?(n.valueCode=t[0],delete n.valueCodeableConcept):(n.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete n.valueCode),r)}function Gde(e){return{resourceType:"QuestionnaireResponse",questionnaire:et(e),item:_4(e.item)}}function _4(e){return(e==null?void 0:e.map(b4))??[]}function b4(e){var t;return{id:Qde(),linkId:e.linkId,text:e.text,item:_4(e.item),answer:((t=e.initial)==null?void 0:t.map(Kde))??[]}}let qde=1;function Qde(){return"id-"+qde++}function Kde(e){return{...e}}function Yde(e){return e.value.display||e.value.reference||sr(e.value)}function Xde(e){var r,n,o,i;const t=(r=e==null?void 0:e.item)==null?void 0:r[0];if(t){const a=ax(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(n=a==null?void 0:a.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}function ay(e){const t=e.item,r=e.response;function n(c){var d,p,h,m;let u;Array.isArray(c)?u=c:e.index>=(((p=(d=e.response)==null?void 0:d.answer)==null?void 0:p.length)??0)?u=(((h=e.response)==null?void 0:h.answer)??[]).concat([c]):u=(((m=e.response)==null?void 0:m.answer)??[]).map((g,b)=>b===e.index?c:g)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:t.text,answer:u})}const o=t.type;if(!o)return null;const i=t.linkId;if(!i)return null;const a=t.initial&&t.initial.length>0?t.initial[0]:void 0,l=Hx(r,e.index)??fr({type:"QuestionnaireItemInitial",value:a},"value");switch(o){case it.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case it.boolean:return s.jsx(Z5,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(jn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:l==null?void 0:l.value,onChange:c=>n({valueBoolean:c.currentTarget.checked})})},e.item.linkId);case it.decimal:return s.jsx(le,{type:"number",step:"any",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDecimal:c.currentTarget.valueAsNumber})});case it.integer:return s.jsx(le,{type:"number",step:1,id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueInteger:c.currentTarget.valueAsNumber})});case it.date:return s.jsx(le,{type:"date",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDate:c.currentTarget.value})});case it.dateTime:return s.jsx(ra,{name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDateTime:c})});case it.time:return s.jsx(le,{type:"time",id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueTime:c.currentTarget.value})});case it.string:case it.url:return s.jsx(le,{id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case it.text:return s.jsx(jc,{id:i,name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case it.attachment:return s.jsx(K,{py:4,children:s.jsx(K5,{name:i,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueAttachment:c})})});case it.reference:return s.jsx(mm,{name:i,required:t.required,targetTypes:w4(t),defaultValue:l==null?void 0:l.value,onChange:c=>n({valueReference:c})});case it.quantity:return s.jsx(na,{name:i,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueQuantity:c}),disableWheel:!0});case it.choice:case it.openChoice:return nfe(t)&&!t.answerValueSet?s.jsx(Jde,{name:i,item:t,initial:a,response:r,onChangeAnswer:c=>n(c)}):s.jsx(Zde,{name:i,item:t,initial:a,response:r,onChangeAnswer:c=>n(c)});default:return null}}function Jde(e){var c;const{name:t,item:r,initial:n,response:o}=e;if(!((c=r.answerOption)!=null&&c.length))return s.jsx(S4,{});const i=fr({type:"QuestionnaireItemInitial",value:n},"value"),a=[""];for(const u of r.answerOption){const d=fr({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(UO(d))}const l=Hx(o)??i;if(r.repeats){const{propertyName:u,data:d}=ofe(e.item),p=tfe(o);return s.jsx(em,{data:d,placeholder:"Select items",searchable:!0,defaultValue:p||[UO(i)],onChange:h=>{const m=Ude(h,u,r);e.onChangeAnswer(m)}})}return s.jsx(ft,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const p=r.answerOption[d-1],h=fr({type:"QuestionnaireItemAnswerOption",value:p},"value"),m="value"+hr(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:ya(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function Zde(e){var a;const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e;return!((a=r.answerOption)!=null&&a.length)&&!r.answerValueSet?s.jsx(S4,{}):r.answerValueSet?s.jsx(t4,{name:t,binding:r.answerValueSet,onChange:l=>o({valueCoding:l})}):s.jsx(efe,{name:(i==null?void 0:i.id)??t,item:r,initial:n,response:i,onChangeAnswer:o})}function efe(e){const{name:t,item:r,initial:n,onChangeAnswer:o,response:i}=e,a=xa("QuestionnaireItemAnswerOption","value[x]"),l=fr({type:"QuestionnaireItemInitial",value:n},"value"),c=[];let u;if(r.answerOption)for(let h=0;h<r.answerOption.length;h++){const m=r.answerOption[h],v=`${t}-option-${h}`,g=fr({type:"QuestionnaireItemAnswerOption",value:m},"value");l&&sr(g)===sr(l)&&(u=v),c.push([v,g])}const d=Hx(i),p=rfe(c,d);return s.jsx(Np.Group,{name:t,value:p??u,onChange:h=>{const m=c.find(v=>v[0]===h);if(m){const v=m[1],g="value"+hr(v.type);o({[g]:v.value})}},children:c.map(([h,m])=>s.jsx(Np,{id:h,value:h,py:4,label:s.jsx($o,{property:a,propertyType:m.type,value:m.value})},h))})}function S4(){return s.jsx(le,{disabled:!0,placeholder:"No Answers Defined"})}function P4(e){return fr({type:"QuestionnaireItemAnswer",value:e},"value")}function Hx(e,t=0){const r=e.answer;return P4((r==null?void 0:r[t])??{})}function tfe(e){const t=e.answer;return t?t.map(n=>P4(n)).map(n=>ya(n==null?void 0:n.value)||(n==null?void 0:n.value)):[]}function rfe(e,t){var r;return(r=e.find(n=>am(n[1].value,t==null?void 0:t.value)))==null?void 0:r[0]}function UO(e){if(e)return e.type==="CodeableConcept"?ws(e.value):e.type==="Coding"?ya(e.value):e.type==="Reference"?Yde(e):e.value.toString()}function nfe(e){var t;return!!((t=e.extension)!=null&&t.some(r=>{var n,o,i;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(n=r.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function ofe(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],r=fr({type:"QuestionnaireItemAnswerOption",value:t},"value"),n="value"+hr(r.type),o=(e.answerOption??[]).map(a=>({value:WO(a,n),label:WO(a,n)}));return{propertyName:n,data:o}}function WO(e,t){var r;return ya(e.valueCoding)||((r=e[t])==null?void 0:r.toString())}const ife=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},questionBody:{maxWidth:600},topActions:{position:"absolute",right:32,top:1,padding:4,color:e.colors.gray[5],fontSize:e.fontSizes.xs},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementActions:{position:"absolute",right:8,top:0,paddingTop:8,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementIcons:{color:e.colors.gray[5]},columnAlignment:{display:"flex",flexDirection:"column"},linkIdInput:{width:100,marginBottom:4},typeSelect:{width:100}}));function afe(e){const t=ae(),r=Ke(e.questionnaire),[n,o]=f.useState(!1),[i,a]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){d(void 0)}function h(){c(void 0)}return f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(a(ufe(r??{resourceType:"Questionnaire"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!i?null:s.jsx("div",{children:s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(j4,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:a}),s.jsx(ne,{type:"submit",children:"Save"})]})})}function j4(e){var O;const{classes:t,cx:r}=ife(),n=e.item,o=e.item,i=Ao(e.item),a=i||o.type===it.group,l=o.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=f.useRef();d.current=e.item;function p(C){st(C),e.setSelectedKey(e.item.id)}function h(C){st(C),e.setHoverKey(e.item.id)}function m(C){var E;const P=d.current;e.onChange({...P,item:(E=P.item)==null?void 0:E.map(k=>k.id===C.id?C:k)})}function v(C){e.onChange({...e.item,item:[...e.item.item??[],C]})}function g(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.filter(E=>E!==C)})}function b(C,P){e.onChange({...d.current,[C]:P})}function y(C){e.onChange({...e.item,...C})}function x(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.map(E=>E===C?{...E,repeats:!E.repeats}:E)})}function _(C,P){const E=pfe(e.item.item,C,P);e.onChange({...e.item,item:E})}const w=r(t.section,{[t.editing]:c,[t.hovering]:u&&!c});return s.jsxs("div",{"data-testid":o.linkId,className:w,onClick:p,onMouseOver:h,children:[s.jsx("div",{className:t.questionBody,children:c?s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{size:"xl",defaultValue:n.title,onChange:C=>b("title",C.currentTarget.value)}),!i&&s.jsx(jc,{autosize:!0,minRows:2,defaultValue:o.text,onChange:C=>b("text",C.currentTarget.value)}),o.type==="reference"&&s.jsx(cfe,{item:o,onChange:y}),Vde(o)&&s.jsx(sfe,{item:o,onChange:C=>y(C)})]}):s.jsxs(s.Fragment,{children:[n.title&&s.jsx(he,{children:n.title}),o.text&&s.jsx("div",{children:o.text}),!a&&s.jsx(ay,{item:o,index:0,onChange:()=>{},response:{}})]})}),(O=o.item)==null?void 0:O.map((C,P)=>s.jsx("div",{children:s.jsx(j4,{item:C,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:P===0,isLast:P===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>g(C),onRepeatable:x,onMoveUp:()=>_(P,-1),onMoveDown:()=>_(P,1)})},C.id)),!a&&s.jsx("div",{className:t.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:"xs",className:t.linkIdInput,defaultValue:o.linkId,onChange:C=>b("linkId",C.currentTarget.value)}),!a&&s.jsx(ft,{size:"xs",className:t.typeSelect,defaultValue:o.type,onChange:C=>b("type",C.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:l})}),!i&&s.jsx(oe,{className:t.movementActions,children:s.jsxs(oe,{className:t.columnAlignment,children:[!e.isFirst&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(ale,{"data-testid":"up-button",size:15,className:t.movementIcons})}),!e.isLast&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(ile,{"data-testid":"down-button",size:15,className:t.movementIcons})})]})}),s.jsxs("div",{className:t.bottomActions,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v({id:aa(),linkId:cy("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v({id:aa(),linkId:cy("g"),type:"group",text:"Group"})},children:"Add group"})]}),i&&s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),v(ffe())},children:"Add Page"}),c&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onRepeatable&&e.onRepeatable(o)},children:o.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Le,{href:"#",onClick:C=>{C.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function sfe(e){const t=xa("QuestionnaireItemAnswerOption","value[x]"),r=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(le,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:n=>e.onChange({...e.item,answerValueSet:n.target.value})}):s.jsx(lfe,{options:r,property:t,item:e.item,onChange:e.onChange}),s.jsxs(oe,{display:"flex",children:[s.jsx(Le,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...r,{id:aa()}]})},children:"Add choice"}),s.jsx(im,{w:"lg"}),s.jsx(Le,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function lfe(e){return s.jsx("div",{children:e.options.map(t=>{const[r,n]=ta({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(oa,{name:"value[x]",property:e.property,defaultPropertyType:n,defaultValue:r,onChange:(o,i)=>{const a=[...e.options],l=a.findIndex(c=>c.id===t.id);a[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:a})}},t.id)}),s.jsx("div",{children:s.jsx(Le,{href:"#",onClick:o=>{st(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function cfe(e){const t=w4(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((r,n)=>s.jsxs(K,{children:[s.jsx(kx,{name:"resourceType",placeholder:"Resource Type",defaultValue:r,onChange:o=>{e.onChange(Rg(e.item,t.map(i=>i===r?o:i)))}}),s.jsx(Le,{href:"#",onClick:o=>{st(o),e.onChange(Rg(e.item,t.filter(i=>i!==r)))},children:"Remove"})]},`${r}-${n}`)),s.jsx(Le,{href:"#",onClick:r=>{st(r),e.onChange(Rg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let sy=1,ly=1;function cy(e){return e+sy++}function aa(){return"id-"+ly++}function ufe(e){return{...e,id:e.id||aa(),item:O4(e.item)}}function O4(e){if(e)return e.forEach(t=>{var r,n;(r=t.id)!=null&&r.match(/^id-\d+$/)&&(ly=Math.max(ly,parseInt(t.id.substring(3),10)+1)),(n=t.linkId)!=null&&n.match(/^q\d+$/)&&(sy=Math.max(sy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||aa(),item:O4(t.item),answerOption:dfe(t.answerOption)}))}function dfe(e){if(e)return e.map(t=>({...t,id:t.id||aa()}))}function ffe(){return{id:aa(),linkId:cy("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 pfe(e,t,r){const n=e??[],o=t+r;if(o<0||o>=n.length)return n;const i=[...n];return[i[t],i[o]]=[i[o],i[t]],i}function C4(e){const{item:t,response:r,onChange:n}=e,[o,i]=f.useState(hfe(t,r??{}));if(!e.checkForQuestionEnabled(t)||!r)return null;if(t.type===it.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==it.choice&&t.type!==it.openChoice;return t.type===it.boolean?s.jsx(ay,{item:t,response:r,onChange:l=>n([l]),index:0},t.linkId):s.jsxs(tt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(ay,{item:t,response:r,onChange:u=>n([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Le,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function hfe(e,t){if(e.type===it.choice||e.type===it.openChoice)return 1;const r=t.answer;return r!=null&&r.length?r.length:1}function E4(e){const[t,r]=f.useState(e.response);if(t.length===0)return null;function n(i,a){const l=t.map((c,u)=>u===a?i[0]:c);r(l),e.onChange(l)}function o(){const i=b4(e.item);r([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx($4,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>n(l,a)},i.id)),e.item.repeats&&s.jsx(Le,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function $4(e){var i;const{response:t,checkForQuestionEnabled:r,onChange:n}=e;function o(a){var d;const l=(d=t.item)==null?void 0:d.map(p=>a.find(m=>m.id===p.id)??p),c=l==null?void 0:l.concat(a.slice(1)),u={...t,item:c};n([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(he,{order:3,mb:"md",children:e.item.text}),s.jsx(Oe,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===it.group?a.repeats?s.jsx(E4,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:r,onChange:o},a.linkId):s.jsx($4,{item:a,checkForQuestionEnabled:r,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===a.linkId))??{},onChange:o},a.linkId):s.jsx(C4,{item:a,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===a.linkId),onChange:o,checkForQuestionEnabled:r},a.linkId)})})]},e.item.linkId):null}function mfe(e){const{items:t,response:r,activePage:n,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,p=t.map(h=>{var g;const m=((g=r==null?void 0:r.item)==null?void 0:g.filter(b=>b.linkId===h.linkId))??[],v=h.type===it.group?s.jsx(E4,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):s.jsx(C4,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?s.jsx(oc.Step,{label:h.text,children:v},h.linkId):v});return s.jsxs(s.Fragment,{children:[c&&s.jsx(oc,{active:n??0,allowNextStepsSelect:!1,p:6,children:p}),!c&&s.jsx(Oe,{children:p}),s.jsx(gfe,{activePage:n??0,numberOfPages:l,nextStep:i,prevStep:a,submitButtonText:u})]})}function gfe(e){const t=e.activePage>0,r=e.activePage<e.numberOfPages-1,n=e.activePage===e.numberOfPages-1;return s.jsxs(K,{position:"right",mt:"xl",spacing:"xs",children:[t&&s.jsx(ne,{onClick:e.prevStep,children:"Back"}),r&&s.jsx(ne,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),n&&s.jsx(ne,{type:"submit",children:e.submitButtonText??"Submit"})]})}function k4(e){const t=ae(),r=t.getProfile(),[n,o]=f.useState(!1),i=Ke(e.questionnaire),[a,l]=f.useState(),[c,u]=f.useState(0);f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>{l(i?Gde(i):void 0)},[i]);function d(g){const b=(a==null?void 0:a.item)??[],x={resourceType:"QuestionnaireResponse",item:R4(b,Array.isArray(g)?g:[g])};l(x)}function p(g){return Bde(g,(a==null?void 0:a.item)??[])}if(!n||!i)return null;const h=Xde(i),m=()=>u(g=>g+1),v=()=>u(g=>g-1);return s.jsxs(De,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:et(i),subject:e.subject,source:dt(r),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(he,{children:i.title}),s.jsx(mfe,{items:i.item??[],response:a,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:p,nextStep:m,prevStep:v})]})}function vfe(e,t){const r=R4(e.item??[],t.item??[]);return{...t,item:r.length>0?r:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function R4(e,t){const r=[],n=new Set;for(const o of e){const i=o.id,a=t.find(l=>l.id===i);a?(r.push(vfe(o,a)),n.add(a.id)):r.push(o)}for(const o of t)n.has(o.id)||r.push(o);return r}const yfe=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[3]}`,borderRadius:e.radius.sm,transition:"all 0.1s"}})),xfe=["gender","age","gestationalAge","context","appliesTo","category"],wfe={definition:{resourceType:"ObservationDefinition"},onSubmit:()=>{}};function _fe(e){e=Object.assign(wfe,e);const t=e.definition,[r,n]=f.useState([]),[o,i]=f.useState(1),[a,l]=f.useState(1);return f.useEffect(()=>{const v=Pfe(t,l);n(jfe(v.qualifiedInterval||[],i))},[t]),s.jsxs(De,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(Oe,{children:r.map(v=>{var g;return s.jsx(bfe,{unit:Cfe((g=t.quantitativeDetails)==null?void 0:g.unit),onChange:p,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:v},`group-${v.id}`)})}),s.jsx(dr,{title:"Add Group",size:"sm",onClick:v=>{st(v),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(g=>g+1)},children:s.jsx(bx,{})}),s.jsx(K,{position:"right",children:s.jsx(ne,{type:"submit",children:"Save"})})]});function c(){const v=r.flatMap(g=>g.intervals).filter(g=>!Efe(g));e.onSubmit({...t,qualifiedInterval:v})}function u(v){n(g=>[...g,v])}function d(v){n(g=>g.filter(b=>b.id!==v.id))}function p(v,g){n(b=>{b=[...b];const y=b.find(_=>_.id===v),x=y==null?void 0:y.intervals.findIndex(_=>_.id===g.id);return x!==void 0&&(y!=null&&y.intervals[x])&&(y.intervals[x]=g),b})}function h(v,g){g.id===void 0&&(g.id=`id-${a}`,l(b=>b+1)),n(b=>{b=[...b];const y=b.findIndex(x=>x.id===v);if(y!==-1){const x={...b[y]};g={...g,...x.filters},x.intervals=[...x.intervals,g],b[y]=x}return b})}function m(v,g){n(b=>{b=[...b];const y=b.find(x=>x.id===v);return y&&(y.intervals=y.intervals.filter(x=>x.id!==g.id)),b})}}function bfe(e){const{intervalGroup:t,unit:r}=e,{classes:n}=yfe();return s.jsx(Dc,{"data-testid":t.id,className:n.section,children:s.jsxs(Oe,{spacing:"lg",children:[s.jsx(K,{position:"right",children:s.jsx(dr,{title:"Remove Group","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:o=>{st(o),e.onRemoveGroup(t)},children:s.jsx(nh,{})},`remove-group-button-${t.id}`)}),s.jsx(Sfe,{intervalGroup:t,onChange:e.onChange}),s.jsx(_r,{}),t.intervals.map(o=>s.jsxs(Oe,{spacing:"xs",children:[s.jsxs(K,{children:[s.jsx(le,{"data-testid":`condition-${o.id}`,defaultValue:o.condition,label:"Condition: ",size:"sm",onChange:i=>{st(i),e.onChange(t.id,{...o,condition:i.currentTarget.value.trim()})}},`condition-${o.id}`),s.jsx(dr,{title:"Remove Interval",size:"sm","data-testid":`remove-interval-${o.id}`,onClick:i=>{st(i),e.onRemove(t.id,o)},children:s.jsx(nh,{})},`remove-interval-${o.id}`)]}),s.jsx(Nx,{onChange:i=>{e.onChange(t.id,{...o,range:i})},name:`range-${o.id}`,defaultValue:o.range},`range-${o.id}`)]},`interval-${o.id}`)),s.jsx(dr,{title:"Add Interval",size:"sm",onClick:o=>{st(o),e.onAdd(t.id,{range:{low:{unit:r},high:{unit:r}}})},children:s.jsx(bx,{})})]})})}function Sfe(e){var n,o;const{intervalGroup:t,onChange:r}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(n=t.filters.age[i])!=null&&n.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(Oe,{style:{maxWidth:"50%"},children:[s.jsx(K,{children:s.jsx(ft,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),r(t.id,{...a,gender:l})}}})}),s.jsxs(K,{spacing:"xs",children:[s.jsx(re,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Nx,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const a of t.intervals)r(t.id,{...a,age:i})}},`age-${t.id}`)})]}),s.jsx(ft,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,r(t.id,{...a,context:void 0})):r(t.id,{...a,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ft,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const a of t.intervals){const l=i.currentTarget.value;l===""?r(t.id,{...a,category:void 0}):r(t.id,{...a,category:l})}}})]})}function Pfe(e,t){const r=e.qualifiedInterval||[];let n=Math.max(...r.map(o=>{var a;const i=parseInt(((a=o.id)==null?void 0:a.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(n)||(n=1),e={...e,qualifiedInterval:r.map(o=>({...o,id:o.id||`id-${n++}`}))},t(n),e}function jfe(e,t){let r=1;const n={};for(const o of e){const i=Ofe(o);i in n||(n[i]={id:`group-id-${r++}`,filters:Object.fromEntries(xfe.map(a=>[a,o[a]])),intervals:[]}),n[i].intervals.push(o)}return t(r),Object.values(n)}function Ofe(e){var r,n;return[`gender=${e.gender}`,`age=${ic(e.age)}`,`gestationalAge=${ic(e.gestationalAge)}`,`context=${(r=e.context)==null?void 0:r.text}`,`appliesTo=${(n=e.appliesTo)==null?void 0:n.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function Cfe(e){return e&&(Hoe(e,"http://unitsofmeasure.org")||e.text)}function Efe(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 $fe(e){var u;const t=ae(),r=Ke(e.value),[n,o]=f.useState(!1),[i,a]=f.useState();if(f.useEffect(()=>{r&&!n&&(t.executeBatch(l(r)).then(a).catch(console.log),o(!0))},[t,r,n]),!r||!i)return null;return s.jsx(tn,{children:(u=r.action)==null?void 0:u.map((d,p)=>{var g,b,y,x,_,w;const h=d.resource&&c(d.resource),m=(b=(g=h==null?void 0:h.input)==null?void 0:g[0])==null?void 0:b.valueReference,v=(x=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:x.valueReference;return s.jsxs(f.Fragment,{children:[s.jsx(tn.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(mle,{}):s.jsx(Ble,{color:"gray"})}),s.jsxs(tn.Col,{span:9,p:"xs",children:[s.jsx(re,{weight:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Nc,{value:(_=h==null?void 0:h.meta)==null?void 0:_.author})," on ",kr((w=h==null?void 0:h.meta)==null?void 0:w.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(a4,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(tn.Col,{span:2,p:"md",children:[m&&!v&&s.jsx(ne,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&v&&s.jsx(ne,{onClick:()=>e.onEdit(h,m,v),children:"Edit"})]})]},`action-${p}`)})});function l(d){var h;const p=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&p.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:p}}function c(d){for(const p of i==null?void 0:i.entry)if(p.resource&&d.reference===et(p.resource))return p.resource}}function T4(e,t){const r=kfe(e,t);return Rfe(r,e,t)}function kfe(e,t){const r=e.length,n=t.length,o=r+n+1,i=1+2*o,a=i/2|0,l=new Array(i);l[a+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=a+u,p=d+1,h=d-1,m=l[p],v=l[h];let g,b=0;u===-c||u!==c&&v.i<m.i?(b=m.i,g=m):(b=v.i+1,g=v),l[h]=void 0;let y=b-u,x={i:b,j:y,prev:Tfe(g),snake:!1};for(;b<r&&y<n&&e[b]===t[y];)b++,y++;if(b>x.i&&(x={i:b,j:y,prev:x,snake:!0}),l[d]=x,b>=r&&y>=n)return l[d]}l[a+c-1]=void 0}}function Rfe(e,t,r){const n=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,a=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:r.slice(c,a)};let p;u.lines.length===0&&d.lines.length>0?p="insert":u.lines.length>0&&d.lines.length===0?p="delete":p="change",n.push({original:u,revised:d,type:p}),o.snake&&(o=o.prev)}return n}function Tfe(e){return e&&!e.snake&&e.prev?e.prev:e}function Ife(e){const t=e.entry.filter(n=>!!n.resource).map(n=>{var o;return{meta:(o=n.resource)==null?void 0:o.meta,lines:sr(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 Dfe(r,t),Nfe(r),r}function Dfe(e,t){for(let r=1;r<t.length;r++){const n=T4(t[r-1].lines,t[r].lines);for(const o of n){const i=o.original.position,a=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,a.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[r].meta.versionId,meta:t[r].meta,value:l[c],span:1})}}}function Nfe(e){let t=0;for(;t<e.length;){let r=t;for(;r<e.length&&e[r].id===e[t].id;)e[r].span=-1,r++;e[t].span=r-t,t=r}}function Afe(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function Mfe(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),r=Math.floor(t/31536e3);if(r>0)return Ia(r,"year");const n=Math.floor(t/2592e3);if(n>0)return Ia(n,"month");const o=Math.floor(t/86400);if(o>0)return Ia(o,"day");const i=Math.floor(t/3600);if(i>0)return Ia(i,"hour");const a=Math.floor(t/60);return a>0?Ia(a,"minute"):Ia(t,"second")}function Ia(e,t){return`${e} ${e===1?t:t+"s"} ago`}const Lfe=W(e=>({container:{overflowX:"auto"},root:{border:`0.1px solid ${e.colors.gray[3]}`,borderCollapse:"collapse",borderRadius:e.radius.sm,borderSpacing:0,fontSize:e.fontSizes.xs,width:"100%","& td":{padding:"2px 4px 0 4px",verticalAlign:"top",whiteSpace:"nowrap"}},startRow:{borderTop:`0.1px solid ${e.colors.gray[3]}`},normalRow:{borderTop:0},author:{lineHeight:"10px"},dateTime:{borderRight:`0.1px solid ${e.colors.gray[3]}`,lineHeight:"20px"},lineNumber:{backgroundColor:e.colors.gray[1],border:0,color:e.colors.gray[5],fontFamily:e.fontFamilyMonospace,padding:`${e.spacing.xs} ${e.spacing.sm}`,textAlign:"right"},line:{fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,padding:`${e.spacing.xs} ${e.spacing.sm}`},pre:{margin:0}}));function zfe(e){var l,c;const{classes:t}=Lfe(),r=ae(),[n,o]=f.useState(e.history);if(f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&r.readHistory(e.resourceType,e.id).then(o).catch(console.log)},[r,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const i=(c=(l=n.entry)==null?void 0:l[0])==null?void 0:c.resource;if(!i)return null;const a=Ife(n);return s.jsx("div",{className:t.container,children:s.jsx("table",{className:t.root,children:s.jsx("tbody",{children:a.map((u,d)=>s.jsxs("tr",{className:u.span>0?t.startRow:t.normalRow,children:[u.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:t.author,rowSpan:u.span,children:s.jsx(as,{value:u.meta.author,link:!0})}),s.jsx("td",{className:t.dateTime,rowSpan:u.span,children:s.jsx(ke,{to:Afe(i,u.meta.versionId),children:Mfe(u.meta.lastUpdated)})})]}),s.jsx("td",{className:t.lineNumber,children:d+1}),s.jsx("td",{className:t.line,children:s.jsx("pre",{className:t.pre,children:u.value})})]},"row-"+d))})})})}const Ffe=W(e=>({removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Vfe(e){let t=e.original,r=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},r={...r,meta:void 0});const n=sr(t,!0).match(/[^\r\n]+/g),o=sr(r,!0).match(/[^\r\n]+/g),i=T4(n,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(Bfe,{delta:a},"delta"+l))})}function Bfe(e){const{classes:t}=Ffe();return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:t.removed,children:e.delta.original.lines.join(`
191
191
  `)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:t.added,children:e.delta.revised.lines.join(`
192
192
  `)}),"...",s.jsx("br",{})]})}function I4(e){const t=ae(),r=Ke(e.defaultValue),[n,o]=f.useState(!1),[i,a]=f.useState();return f.useEffect(()=>{r&&(a(va(r)),t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log))},[t,r]),!n||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.onSubmit&&e.onSubmit(i)},children:[s.jsxs(Oe,{mb:"xl",children:[s.jsx(tt,{title:"Resource Type",htmlFor:"resourceType",outcome:e.outcome,children:s.jsx(le,{name:"resourceType",defaultValue:i.resourceType,disabled:!0})}),s.jsx(tt,{title:"ID",htmlFor:"id",outcome:e.outcome,children:s.jsx(le,{name:"id",defaultValue:i.id,disabled:!0})})]}),s.jsx(oy,{typeName:i.resourceType,defaultValue:i,outcome:e.outcome,onChange:a}),s.jsxs(K,{position:"right",mt:"xl",children:[s.jsx(ne,{type:"submit",children:"OK"}),e.onDelete&&s.jsx(ne,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(i)},children:"Delete"})]})]})}function Ufe(e){var o;const t=ae(),[r,n]=f.useState(e.history);return f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(n).catch(console.log)},[t,e.history,e.resourceType,e.id]),r?s.jsxs(ma,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Author"}),s.jsx("th",{children:"Date"}),s.jsx("th",{children:"Version"})]})}),s.jsx("tbody",{children:(o=r.entry)==null?void 0:o.map((i,a)=>s.jsx(Wfe,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function Wfe(e){var n,o,i;const{response:t,resource:r}=e.entry;return r?s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(as,{value:(n=r.meta)==null?void 0:n.author,link:!0})}),s.jsx("td",{children:kr((o=r.meta)==null?void 0:o.lastUpdated)}),s.jsx("td",{children:s.jsx(ke,{to:Hfe(r),children:(i=r.meta)==null?void 0:i.versionId})})]}):s.jsx("tr",{children:s.jsx("td",{colSpan:3,children:Ee(t==null?void 0:t.outcome)})})}function Hfe(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function Gfe(e){return s.jsx(gm,{value:e.serviceRequest,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,i=100;return Promise.allSettled([t.readHistory("ServiceRequest",n),t.search("Communication",{"based-on":o,_count:i}),t.search("DiagnosticReport",{"based-on":o,_count:i}),t.search("Media",{"based-on":o,_count:i}),t.search("DocumentReference",{related:o,_count:i}),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])},createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",basedOn:[dt(t)],subject:t.subject,sender:dt(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",basedOn:[dt(t)],subject:t.subject,operator:dt(r),issued:new Date().toISOString(),content:n})})}function D4(e){const t=ae(),[r,n]=f.useState();return s.jsxs(De,{style:{maxWidth:400},onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){n(ct(i))}},children:[s.jsxs(or,{sx:{flexDirection:"column"},children:[s.jsx(En,{size:32}),s.jsx(he,{children:"Create project"})]}),s.jsxs(Oe,{spacing:"xl",children:[s.jsx(le,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:lt(r,"firstName")}),s.jsxs(re,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Le,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Le,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"Create project"})})]})}function N4(e,t){const r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.async=!0,n.src=e,n.onload=t??null,r.appendChild(n)}function A4(e){const t=ae(),{googleClientId:r,handleGoogleCredential:n}=e,o=f.useRef(null),[i,a]=f.useState(typeof google<"u"),[l,c]=f.useState(!1),[u,d]=f.useState(!1);return f.useEffect(()=>{if(typeof google>"u"){N4("https://accounts.google.com/gsi/client",()=>a(!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,i,o,u,n]),r?s.jsx("div",{ref:o}):null}function M4(e){var t;if(e)return e;if(typeof window<"u"){const r=window.location.protocol+"//"+window.location.host;if((((t={}.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(r))return"__GOOGLE_CLIENT_ID__"}}function L4(e){typeof grecaptcha>"u"&&N4("https://www.google.com/recaptcha/api.js?render="+e)}function z4(e){return new Promise((t,r)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(n){r(n)}})})}function qfe(e){const t=M4(e.googleClientId),r=e.recaptchaSiteKey,n=ae(),[o,i]=f.useState(),a=Dx(o,void 0);return f.useEffect(()=>{r&&L4(r)},[r]),s.jsxs(De,{style:{maxWidth:400},onSubmit:async l=>{try{let c="";r&&(c=await z4(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){i(ct(c))}},children:[s.jsx(or,{sx:{flexDirection:"column"},children:e.children}),s.jsx(bi,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(K,{position:"center",p:"xl",style:{height:70},children:s.jsx(A4,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await n.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,createUser:!0}))}catch(c){i(ct(c))}}})}),s.jsx(_r,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(Oe,{spacing:"xl",children:[s.jsx(le,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:lt(o,"firstName")}),s.jsx(le,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:lt(o,"lastName")}),s.jsx(le,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:lt(o,"email")}),s.jsx(yo,{name:"password",label:"Password",autoComplete:"off",required:!0,error:lt(o,"password")}),s.jsxs(re,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Le,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Le,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(re,{color:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Le,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Le,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(K,{position:"apart",mt:"xl",noWrap:!0,children:[s.jsx(jn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(ne,{type:"submit",children:"Create account"})]})]})}function Qfe(e){const{type:t,projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=ae(),[c,u]=f.useState(),[d,p]=f.useState();f.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:r}).then(m=>l.processCode(m.code)).then(()=>a()).catch(m=>p(ct(m)))},[l,t,r,c,a]);function h(m){m.code?l.processCode(m.code).then(()=>a()).catch(console.log):m.login&&u(m.login)}return s.jsxs(Se,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(qfe,{projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(D4,{login:c,handleAuthResponse:h})]})}function Kfe(e){const[t,r]=f.useState();return t?s.jsx(Xfe,{email:t,...e}):s.jsx(Yfe,{setEmail:r,...e})}function Yfe(e){const{setEmail:t,onRegister:r,handleAuthResponse:n,children:o,disableEmailAuth:i,...a}=e,l=ae(),c=!e.disableGoogleAuth&&M4(e.googleClientId),u=f.useCallback(async h=>{if(!h.authorizeUrl)return!1;const m=JSON.stringify({...await l.ensureCodeChallenge(a),domain:h.domain}),v=new URL(h.authorizeUrl);return v.searchParams.set("state",m),window.location.assign(v.toString()),!0},[l,a]),d=f.useCallback(async h=>{const m=await l.post("auth/method",{email:h.email});await u(m)||t(h.email)},[l,u,t]),p=f.useCallback(async h=>{const m=await l.startGoogleLogin({...a,googleCredential:h.credential});await u(m)||n(m)},[l,a,u,n]);return s.jsxs(De,{style:{maxWidth:400},onSubmit:d,children:[s.jsx(or,{sx:{flexDirection:"column"},children:o}),c&&s.jsxs(s.Fragment,{children:[s.jsx(K,{position:"center",p:"xl",style:{height:70},children:s.jsx(A4,{googleClientId:c,handleGoogleCredential:p})}),!i&&s.jsx(_r,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(le,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0}),s.jsxs(K,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[s.jsx("div",{children:r&&s.jsx(Le,{component:"button",type:"button",color:"dimmed",onClick:r,size:"xs",children:"Register"})}),!i&&s.jsx(ne,{type:"submit",children:"Next"})]})]})}function Xfe(e){const{onForgotPassword:t,handleAuthResponse:r,children:n,...o}=e,i=ae(),[a,l]=f.useState(),c=Dx(a,void 0),u=f.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(r).catch(p=>l(ct(p)))},[i,o,r]);return s.jsxs(De,{style:{maxWidth:400},onSubmit:u,children:[s.jsx(or,{sx:{flexDirection:"column"},children:n}),s.jsx(bi,{issues:c}),s.jsx(Oe,{spacing:"xl",children:s.jsx(yo,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:lt(a,"password")})}),s.jsxs(K,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[t&&s.jsx(Le,{component:"button",type:"button",color:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(jn,{id:"remember",name:"remember",label:"Remember me",size:"xs",sx:{lineHeight:1}}),s.jsx(ne,{type:"submit",children:"Sign in"})]})]})}function Jfe(e){const t=ae(),[r,n]=f.useState();return s.jsxs(Oe,{children:[s.jsxs(or,{sx:{flexDirection:"column"},children:[s.jsx(En,{size:32}),s.jsx(he,{order:3,children:"Choose profile"})]}),s.jsx(bi,{outcome:r}),e.memberships.map(o=>{var i,a;return s.jsx(wo,{onClick:()=>{t.post("auth/profile",{login:e.login,profile:o.id}).then(e.handleAuthResponse).catch(l=>n(ct(l)))},children:s.jsxs(K,{children:[s.jsx(Cf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(re,{size:"sm",weight:500,children:(i=o.profile)==null?void 0:i.display}),s.jsx(re,{color:"dimmed",size:"xs",children:(a=o.project)==null?void 0:a.display})]})]})},o.id)})]})}function Zfe(e){const t=ae();return s.jsx(De,{style:{maxWidth:400},onSubmit:r=>{t.post("auth/scope",{login:e.login,scope:Object.keys(r).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(Oe,{children:[s.jsxs(or,{sx:{flexDirection:"column"},children:[s.jsx(En,{size:32}),s.jsx(he,{children:"Choose scope"})]}),s.jsx(Oe,{children:(e.scope??"openid").split(" ").map(r=>s.jsx(jn,{id:r,name:r,label:r,defaultChecked:!0},r))}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{type:"submit",children:"Set scope"})})]})})}function epe(e){const t=ae(),[r,n]=f.useState();return s.jsx(De,{style:{maxWidth:400},onSubmit:o=>{n(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>n(Ee(i)))},children:s.jsxs(Oe,{children:[s.jsxs(or,{sx:{flexDirection:"column"},children:[s.jsx(En,{size:32}),s.jsx(he,{children:"Enter MFA code"})]}),r&&s.jsx(_c,{icon:s.jsx(dm,{size:16}),title:"Error",color:"red",children:r}),s.jsx(Oe,{children:s.jsx(le,{name:"token",label:"MFA code",required:!0})}),s.jsx(K,{position:"right",mt:"xl",children:s.jsx(ne,{type:"submit",children:"Submit code"})})]})})}function F4(e){const{login:t,chooseScopes:r,onSuccess:n,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=ae(),[u,d]=f.useState(),[p,h]=f.useState(!1),[m,v]=f.useState(),g=f.useCallback(x=>{a?a(x):c.processCode(x).then(()=>{n&&n()}).catch(_=>me({color:"red",message:Ee(_)}))},[c,a,n]),b=f.useCallback(x=>{h(!!x.mfaRequired),x.login&&d(x.login),x.memberships&&v(x.memberships),x.code&&(r?v(void 0):g(x.code))},[r,g]),y=f.useCallback(x=>{g(x.code)},[g]);return f.useEffect(()=>{t&&!u&&c.get("auth/login/"+t).then(b).catch(x=>me({color:"red",message:Ee(x)}))},[c,t,u,b]),s.jsx(Se,{width:450,children:(()=>u?p?s.jsx(epe,{login:u,handleAuthResponse:b}):m?s.jsx(Jfe,{login:u,memberships:m,handleAuthResponse:b}):e.projectId==="new"?s.jsx(D4,{login:u,handleAuthResponse:b}):e.chooseScopes?s.jsx(Zfe,{login:u,scope:e.scope,handleAuthResponse:y}):s.jsx("div",{children:"Success"}):s.jsx(Kfe,{onForgotPassword:o,onRegister:i,handleAuthResponse:b,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children}))()})}var V4,HO=xc;V4=HO.createRoot,HO.hydrateRoot;/**
193
193
  * @remix-run/router v1.11.0
@@ -231,5 +231,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
231
231
  "family": "Smith"
232
232
  }
233
233
  ]
234
- }`,Gge="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-",qge=W(()=>({hl7Input:{fontFamily:"monospace",fontSize:"12px",lineHeight:1.55,padding:"10px 12px",whiteSpace:"nowrap",width:"100%"}}));function Qge(){const e=ae(),{id:t}=Qe(),[r,n]=f.useState(),[o,i]=f.useState(),[a,l]=f.useState(Hge),[c,u]=f.useState(Gge),[d,p]=f.useState(Qt.FHIR_JSON),{classes:h}=qge(),m=f.useRef(null),v=f.useRef(null),[g,b]=f.useState(!1);f.useEffect(()=>{e.readResource("Bot",t).then(async P=>{n(P),i(await Kge(e,P))}).catch(P=>me({color:"red",message:Ee(P)}))},[e,t]);const y=f.useCallback(()=>fd(m.current,{command:"getValue"}),[]),x=f.useCallback(()=>fd(m.current,{command:"getOutput"}),[]),_=f.useCallback(async()=>d===Qt.FHIR_JSON?JSON.parse(a):c,[d,a,c]),w=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await y(),k=await e.createAttachment(E,"index.ts","text/typescript"),$=[];r!=null&&r.sourceCode?$.push({op:"replace",path:"/sourceCode",value:k}):$.push({op:"add",path:"/sourceCode",value:k}),await e.patchResource("Bot",t,$),me({color:"green",message:"Saved"})}catch(E){me({color:"red",message:Ee(E)})}finally{b(!1)}},[e,t,r,y]),O=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await x();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:E}),me({color:"green",message:"Deployed"})}catch(E){me({color:"red",message:Ee(E)})}finally{b(!1)}},[e,t,x]),C=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await _(),k=await e.post(e.fhirUrl("Bot",t,"$execute"),E,d);await fd(v.current,{command:"setValue",value:k}),me({color:"green",message:"Success"})}catch(E){me({color:"red",message:Ee(E)})}finally{b(!1)}},[e,t,_,d]);return!r||o===void 0?null:s.jsxs(tn,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(tn.Col,{span:8,children:s.jsxs(on,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(Wge,{iframeRef:m,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(K,{position:"right",spacing:"xs",children:[s.jsx(ne,{type:"button",onClick:w,loading:g,leftIcon:s.jsx(wle,{size:"1rem"}),children:"Save"}),s.jsx(ne,{type:"button",onClick:O,loading:g,leftIcon:s.jsx(Sx,{size:"1rem"}),children:"Deploy"}),s.jsx(ne,{type:"button",onClick:C,loading:g,leftIcon:s.jsx(Ale,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(tn.Col,{span:4,children:[s.jsxs(on,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ft,{data:[{label:"FHIR",value:Qt.FHIR_JSON},{label:"HL7",value:Qt.HL7_V2}],onChange:P=>p(P.currentTarget.value)}),d===Qt.FHIR_JSON?s.jsx(Ds,{value:a,onChange:P=>l(P),minRows:15}):s.jsx("textarea",{className:h.hl7Input,value:c,onChange:P=>u(P.currentTarget.value),rows:15})]}),s.jsx(on,{m:2,p:"xs",shadow:"md",children:s.jsx(Uge,{iframeRef:v,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Kge(e,t){var r,n,o;if((r=t.sourceCode)!=null&&r.url){const i=(o=(n=t.sourceCode.url)==null?void 0:n.split("/"))==null?void 0:o.find(u5);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Vc(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Yge(){const e=ae(),{resourceType:t,id:r}=Qe(),n={reference:t+"/"+r},o=f.useCallback(i=>{e.updateResource(Vc(i)).then(()=>{me({color:"green",message:"Success"})}).catch(a=>{me({color:"red",message:Ee(a)})})},[e]);switch(t){case"PlanDefinition":return s.jsx(Se,{children:s.jsx(Dde,{value:n,onSubmit:o})});case"Questionnaire":return s.jsx(Se,{children:s.jsx(afe,{questionnaire:n,onSubmit:o})});default:return null}}function Xge(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t}),n=Pt();return r?s.jsx(Se,{children:s.jsx($fe,{value:r,onStart:(o,i)=>n(`/forms/${ix(i)}`),onEdit:(o,i,a)=>n(`/${a.reference}}`)})}):null}function Jge(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Pt();return s.jsxs(Se,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(ne,{color:"red",onClick:()=>{e.deleteResource(t,r).then(()=>n(`/${t}`)).catch(o=>me({color:"red",message:Ee(o)}))},children:"Delete"})]})}function Zge(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t});return r?s.jsx(Se,{children:s.jsx(Lx,{value:r})}):null}function eve(){const e=ae(),{resourceType:t,id:r}=Qe(),[n,o]=f.useState(),i=Pt(),[a,l]=f.useState();f.useEffect(()=>{e.readResource(t,r).then(d=>o(va(d))).catch(d=>{l(ct(d)),me({color:"red",message:Ee(d)})})},[e,t,r]);const c=f.useCallback(d=>{l(void 0),e.updateResource(Vc(d)).then(()=>{i(`/${t}/${r}/details`),me({color:"green",message:"Success"})}).catch(p=>{l(ct(p)),me({color:"red",message:Ee(p)})})},[e,t,r,i]),u=f.useCallback(()=>i(`/${t}/${r}/delete`),[i,t,r]);return n?s.jsx(Se,{children:s.jsx(I4,{defaultValue:n,onSubmit:c,onDelete:u,outcome:a})}):null}function tve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=e.readHistory(t,r).read();return s.jsx(Se,{children:s.jsx(Ufe,{history:n})})}function rve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ke({reference:t+"/"+r}),o=Pt(),[i,a]=f.useState(),l=f.useCallback(c=>{e.updateResource(Vc(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${r}/details`),me({color:"green",message:"Success"})}).catch(u=>{me({color:"red",message:Ee(u)})})},[e,t,r,o]);return n?s.jsxs(Se,{children:[i&&s.jsx(bi,{outcome:i}),s.jsxs(De,{onSubmit:l,children:[s.jsx(Ds,{name:"resource","data-testid":"resource-json",minRows:24,defaultValue:sr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"OK"})})]})]}):null}function nve(){const{resourceType:e,id:t}=Qe();return Ke({reference:e+"/"+t})?s.jsxs(Se,{children:[s.jsxs(_c,{icon:s.jsx(dm,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Le,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(k4,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function ove(){const e=ae(),{id:t}=Qe(),[r,n]=f.useState(),[o,i]=f.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>ive(c,t));function l(){r&&e.createResource({resourceType:"Subscription",status:"active",reason:r.name,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:et(r)}}).then(()=>{n(void 0),i(Date.now()),e.invalidateSearches("Subscription"),me({color:"green",message:"Success"})}).catch(c=>me({color:"red",message:Ee(c)}))}return s.jsxs(Se,{children:[s.jsx(he,{children:"Bots"}),a.length===0&&s.jsx("p",{children:"No bots found."}),a.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Nc,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(he,{children:"Connect to bot"}),s.jsxs(K,{children:[s.jsx(Ns,{name:"bot",resourceType:"Bot",onChange:n}),s.jsx(ne,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function ive(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 ave(){const{id:e}=Qe(),t=Pt(),[r,n]=f.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:te.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(Se,{children:s.jsx(Ac,{search:r,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>n(o.definition),hideFilters:!0,hideToolbar:!0})})}function sve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ke({reference:t+"/"+r}),o=f.useCallback(i=>{e.updateResource(Vc(i)).then(()=>{me({color:"green",message:"Success"})}).catch(a=>{me({color:"red",message:Ee(a)})})},[e]);return n?s.jsx(Se,{children:s.jsx(_fe,{onSubmit:o,definition:n})}):null}function lve(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t});return r?s.jsx(Se,{children:e==="MeasureReport"?s.jsx(Tde,{measureReport:r}):s.jsx(Ax,{value:r})}):null}const cve=W(e=>({container:{position:"fixed",top:300,left:0,width:160,zIndex:5,fontSize:e.fontSizes.xs,"@media (max-width: 700px)":{display:"none"}},entry:{textAlign:"center",width:150,backgroundColor:e.colors.gray[0],border:`1px solid ${e.colors.gray[3]}`},active:{width:160,backgroundColor:e.colors.yellow[0],border:`1px solid ${e.colors.yellow[5]}`}}));function uve(e){const{classes:t,cx:r}=cve(),n=ae(),o=Ke(e.value),[i,a]=f.useState();return f.useEffect(()=>{if(!o)return;const l=Zx(o);if(!l)return;const c="reference"in l?l.reference:et(l);n.search("ServiceRequest","subject="+c).then(u=>{const p=u.entry.map(h=>h.resource);c4(p),p.reverse(),a(p)}).catch(u=>me({color:"red",message:Ee(u)}))},[n,o]),i?s.jsx("div",{"data-testid":"quick-service-requests",className:t.container,children:i.map(l=>{var c,u,d,p,h,m,v;return s.jsxs("div",{className:r(t.entry,{[t.active]:l.id===(o==null?void 0:o.id)}),children:[s.jsx("p",{children:s.jsx(ke,{to:l,children:dve(l)})}),((u=(c=l.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(d=l.category[0])==null?void 0:d.text}),((m=(h=(p=l.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&s.jsx("p",{children:(v=l.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:fve(l)})]},l.id)})}):null}function dve(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function fve(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const pve=W(()=>({container:{position:"absolute",top:65,right:5,width:200,height:50,zIndex:15}}));function hve(e){var i,a,l,c;const{classes:t}=pve(),r=Ke(e.valueSet);if(!r)return null;const n=[""],o=(c=(l=(a=(i=r.compose)==null?void 0:i.include)==null?void 0:a[0])==null?void 0:l.concept)==null?void 0:c.map(u=>u.code);return o&&n.push(...o),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:t.container,children:s.jsx(ft,{defaultValue:e.defaultValue,onChange:u=>e.onChange(u.currentTarget.value),data:n})})}function mve(e){var r,n;const t=Ke(e.specimen);return t?s.jsxs(je,{children:[s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Type"}),s.jsx(je.Value,{children:"Specimen"})]}),s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Collected"}),s.jsx(je.Value,{children:kr((r=t.collection)==null?void 0:r.collectedDateTime)})]}),s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Specimen Age"}),s.jsx(je.Value,{children:gve(t)})]}),(n=t.collection)!=null&&n.collectedDateTime&&t.receivedTime?s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Specimen Stability"}),s.jsx(je.Value,{children:vve(t)})]}):s.jsx(s.Fragment,{})]}):null}function gve(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const r=new Date(t);return j3(O3(r,new Date))}function vve(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 j3(O3(t,r))}function j3(e){return e.toString().padStart(3,"0")+"D"}function O3(e,t){const r=t.getTime()-e.getTime();return Math.floor(r/(1e3*3600*24))}function yve(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),t.push("Details","Edit","Event","History","Blame","JSON","Apps"),t}function xve(){var x,_,w,O,C,P,E;const e=ae(),{resourceType:t,id:r}=Qe(),n={reference:t+"/"+r},o=Pt(),[i,a]=f.useState(),l=Ke(n,a),c=yve(t),[u,d]=f.useState(()=>{const k=window.location.pathname.split("/").pop();return k&&c.map($=>$.toLowerCase()).includes(k)?k:c[0].toLowerCase()});async function p(){var I,T;const $=(T=(I=(await e.readHistory(t,r)).entry)==null?void 0:I.find(z=>!!z.resource))==null?void 0:T.resource;$?h($):me({color:"red",message:"No history to restore"})}function h(k){e.updateResource(Vc(k)).then(()=>{a(void 0),me({color:"green",message:"Success"})}).catch($=>{me({color:"red",message:Ee($)})})}if(i)return uae(i)?s.jsxs(Se,{children:[s.jsx(he,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(ne,{color:"red",onClick:p,children:"Restore"})]}):s.jsx(bi,{outcome:i});function m(k){d(k),o(`/${t}/${r}/${k}`)}function v(k){const $=l,I=$.orderDetail||[];I.length===0&&I.push({}),I[0].text!==k&&(I[0].text=k,h({...$,orderDetail:I}))}const g=l&&Zx(l),b=l&&rge(l),y=(w=(_=(x=e.getUserConfiguration())==null?void 0:x.option)==null?void 0:_.find(k=>k.id==="statusValueSet"))==null?void 0:w.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&y&&s.jsx(hve,{valueSet:{reference:y},defaultValue:(C=(O=l.orderDetail)==null?void 0:O[0])==null?void 0:C.text,onChange:v},et(l)+"-"+((E=(P=l.orderDetail)==null?void 0:P[0])==null?void 0:E.text)),l&&s.jsx(uve,{value:l}),l&&s.jsxs(on,{children:[g&&s.jsx(b3,{patient:g}),b&&s.jsx(mve,{specimen:b}),t!=="Patient"&&s.jsx(S3,{resource:n}),s.jsx(da,{children:s.jsx(He,{value:u.toLowerCase(),onTabChange:m,children:s.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(k=>s.jsx(He.Tab,{value:k.toLowerCase(),children:k},k))})})})]}),s.jsx(Kx,{})]})}function RC(){var y,x,_,w;const e=Pt(),{resourceType:t,id:r,versionId:n,tab:o}=Qe(),i=ae(),[a,l]=f.useState(!0),[c,u]=f.useState(),[d,p]=f.useState();if(f.useEffect(()=>{p(void 0),l(!0),i.readHistory(t,r).then(O=>u(O)).then(()=>l(!1)).catch(O=>{p(O),l(!1)})},[i,t,r]),a)return s.jsx(On,{});if(!c)return s.jsxs(Se,{children:[s.jsx(he,{children:"Resource not found"}),s.jsx(ke,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(O=>{var C,P;return((P=(C=O.resource)==null?void 0:C.meta)==null?void 0:P.versionId)===n});if(m===-1)return s.jsxs(Se,{children:[s.jsx(he,{children:"Version not found"}),s.jsx(ke,{to:`/${t}/${r}`,children:"Return to resource"})]});const v=h[m].resource,g=m<h.length-1?h[m+1].resource:void 0,b="diff";return s.jsx(s.Fragment,{children:s.jsxs(He,{value:o||b,onTabChange:O=>e(`/${t}/${r}/_history/${n}/${O}`),children:[s.jsxs(on,{children:[s.jsx(Dc,{fluid:!0,p:"md",children:s.jsx(re,{children:`${t} ${r}`})}),s.jsxs(He.List,{children:[s.jsx(He.Tab,{value:"diff",children:"Diff"}),s.jsx(He.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(Se,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(He.Panel,{value:"diff",children:g?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(y=v.meta)==null?void 0:y.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(ke,{to:`/${t}/${r}/_history/${(x=g.meta)==null?void 0:x.versionId}`,children:(_=g.meta)==null?void 0:_.versionId})]})]}),s.jsx(Vfe,{original:g,revised:v})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(w=v.meta)==null?void 0:w.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(v,void 0,2)})]})}),s.jsx(He.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(v,void 0,2)})})]})]})})}function wve(){const{resourceType:e,id:t}=Qe(),r=Pt(),[n,o]=f.useState({resourceType:"Subscription",filters:[{code:"url",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(Se,{children:s.jsx(Ac,{search:n,onClick:i=>r(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function TC(){const{resourceType:e,id:t}=Qe(),r={reference:e+"/"+t};switch(e){case"Encounter":return s.jsx(Due,{encounter:r});case"Patient":return s.jsx(Ide,{patient:r});case"ServiceRequest":return s.jsx(Gfe,{serviceRequest:r});default:return s.jsx(Iue,{resource:r})}}function C3(e,t){const r=ae(),n=Pt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),r.createResource(a).then(l=>n("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ct(l))})}}}function IC(){const{resourceType:e}=Qe(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=C3(e,r);return s.jsx(Se,{children:s.jsx(I4,{defaultValue:n,onSubmit:o,outcome:t})})}function _ve(){const{resourceType:e}=Qe(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=C3(e,r),i=f.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(Se,{children:[t&&s.jsx(bi,{outcome:t}),s.jsxs(De,{onSubmit:i,children:[s.jsx(Ds,{name:"new-resource","data-testid":"create-resource-json",minRows:24,defaultValue:sr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"OK"})})]})]})}function bve(){return s.jsx(she,{children:s.jsxs(pe,{errorElement:s.jsx(ege,{}),children:[s.jsx(pe,{path:"/signin",element:s.jsx(wge,{})}),s.jsx(pe,{path:"/oauth",element:s.jsx(mge,{})}),s.jsx(pe,{path:"/resetpassword",element:s.jsx(vge,{})}),s.jsx(pe,{path:"/setpassword/:id/:secret",element:s.jsx(xge,{})}),s.jsx(pe,{path:"/register",element:s.jsx(gge,{})}),s.jsx(pe,{path:"/changepassword",element:s.jsx(Xme,{})}),s.jsx(pe,{path:"/security",element:s.jsx(yge,{})}),s.jsx(pe,{path:"/mfa",element:s.jsx(pge,{})}),s.jsx(pe,{path:"/batch",element:s.jsx(Kme,{})}),s.jsx(pe,{path:"/bulk/:resourceType",element:s.jsx(Yme,{})}),s.jsx(pe,{path:"/smart",element:s.jsx(_ge,{})}),s.jsx(pe,{path:"/forms/:id",element:s.jsx(oge,{})}),s.jsx(pe,{path:"/admin/super",element:s.jsx(Ige,{})}),s.jsxs(pe,{path:"/admin",element:s.jsx(kge,{}),children:[s.jsx(pe,{path:"patients",element:s.jsx($ge,{})}),s.jsx(pe,{path:"bots/new",element:s.jsx(Pge,{})}),s.jsx(pe,{path:"bots",element:s.jsx(bge,{})}),s.jsx(pe,{path:"clients/new",element:s.jsx(jge,{})}),s.jsx(pe,{path:"clients",element:s.jsx(Sge,{})}),s.jsx(pe,{path:"details",element:s.jsx(EC,{})}),s.jsx(pe,{path:"invite",element:s.jsx(Ege,{})}),s.jsx(pe,{path:"users",element:s.jsx(Dge,{})}),s.jsx(pe,{path:"project",element:s.jsx(EC,{})}),s.jsx(pe,{path:"secrets",element:s.jsx(Rge,{})}),s.jsx(pe,{path:"sites",element:s.jsx(Tge,{})}),s.jsx(pe,{path:"members/:membershipId",element:s.jsx(Cge,{})})]}),s.jsx(pe,{path:"/lab/assays",element:s.jsx(Nge,{})}),s.jsx(pe,{path:"/lab/panels",element:s.jsx(Age,{})}),s.jsx(pe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(RC,{})}),s.jsx(pe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(RC,{})}),s.jsxs(pe,{path:"/:resourceType/new",element:s.jsx(Zme,{}),children:[s.jsx(pe,{index:!0,element:s.jsx(IC,{})}),s.jsx(pe,{path:"form",element:s.jsx(IC,{})}),s.jsx(pe,{path:"json",element:s.jsx(_ve,{})})]}),s.jsxs(pe,{path:"/:resourceType/:id",element:s.jsx(xve,{}),children:[s.jsx(pe,{index:!0,element:s.jsx(TC,{})}),s.jsx(pe,{path:"apply",element:s.jsx(Lge,{})}),s.jsx(pe,{path:"apps",element:s.jsx(zge,{})}),s.jsx(pe,{path:"event",element:s.jsx(Vge,{})}),s.jsx(pe,{path:"blame",element:s.jsx(Bge,{})}),s.jsx(pe,{path:"bots",element:s.jsx(ove,{})}),s.jsx(pe,{path:"builder",element:s.jsx(Yge,{})}),s.jsx(pe,{path:"checklist",element:s.jsx(Xge,{})}),s.jsx(pe,{path:"delete",element:s.jsx(Jge,{})}),s.jsx(pe,{path:"details",element:s.jsx(Zge,{})}),s.jsx(pe,{path:"edit",element:s.jsx(eve,{})}),s.jsx(pe,{path:"editor",element:s.jsx(Qge,{})}),s.jsx(pe,{path:"history",element:s.jsx(tve,{})}),s.jsx(pe,{path:"json",element:s.jsx(rve,{})}),s.jsx(pe,{path:"preview",element:s.jsx(nve,{})}),s.jsx(pe,{path:"responses",element:s.jsx(ave,{})}),s.jsx(pe,{path:"report",element:s.jsx(lve,{})}),s.jsx(pe,{path:"ranges",element:s.jsx(sve,{})}),s.jsx(pe,{path:"subscriptions",element:s.jsx(wve,{})}),s.jsx(pe,{path:"timeline",element:s.jsx(TC,{})})]}),s.jsx(pe,{path:"/:resourceType",element:s.jsx(CC,{})}),s.jsx(pe,{path:"/",element:s.jsx(CC,{})})]})})}function Sve(){const e=ae(),t=e.getUserConfiguration(),r=Pi(),[n]=Yx();return e.isLoading()?s.jsx(On,{}):s.jsx(Pce,{logo:s.jsx(En,{size:24}),pathname:r.pathname,searchParams:n,version:zse,menus:Pve(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(f.Suspense,{fallback:s.jsx(On,{}),children:s.jsx(bve,{})})})}function Pve(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(i=>({label:i.name,href:i.target,icon:jve(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx($le,{})}]}),t}const DC={Patient:Ule,Practitioner:Ole,Organization:hle,ServiceRequest:Lle,DiagnosticReport:Fle,Questionnaire:jle,admin:dle,AccessPolicy:Ele,Subscription:Gle,batch:Ile,Observation:Tle};function jve(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in DC){const r=DC[t];return s.jsx(r,{})}}catch{}return s.jsx(im,{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 Ove(){const e=Fc(),t=new Wse({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=uhe([{path:"*",element:s.jsx(Sve,{})}]),o=a=>n.navigate(a);V4(document.getElementById("root")).render(s.jsx(S.StrictMode,{children:s.jsx(Gse,{medplum:t,navigate:o,children:s.jsxs(PE,{theme:r,withGlobalStyles:!0,withNormalizeCSS:!0,children:[s.jsx(ga,{position:"bottom-right"}),s.jsx(yhe,{router:n})]})})}))}Ove().catch(console.error);
235
- //# sourceMappingURL=index-d99ba422.js.map
234
+ }`,Gge="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-",qge=W(()=>({hl7Input:{fontFamily:"monospace",fontSize:"12px",lineHeight:1.55,padding:"10px 12px",whiteSpace:"nowrap",width:"100%"}}));function Qge(){const e=ae(),{id:t}=Qe(),[r,n]=f.useState(),[o,i]=f.useState(),[a,l]=f.useState(Hge),[c,u]=f.useState(Gge),[d,p]=f.useState(Qt.FHIR_JSON),{classes:h}=qge(),m=f.useRef(null),v=f.useRef(null),[g,b]=f.useState(!1);f.useEffect(()=>{e.readResource("Bot",t).then(async P=>{n(P),i(await Kge(e,P))}).catch(P=>me({color:"red",message:Ee(P)}))},[e,t]);const y=f.useCallback(()=>fd(m.current,{command:"getValue"}),[]),x=f.useCallback(()=>fd(m.current,{command:"getOutput"}),[]),_=f.useCallback(async()=>d===Qt.FHIR_JSON?JSON.parse(a):c,[d,a,c]),w=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await y(),k=await e.createAttachment(E,"index.ts","text/typescript"),$=[];r!=null&&r.sourceCode?$.push({op:"replace",path:"/sourceCode",value:k}):$.push({op:"add",path:"/sourceCode",value:k}),await e.patchResource("Bot",t,$),me({color:"green",message:"Saved"})}catch(E){me({color:"red",message:Ee(E)})}finally{b(!1)}},[e,t,r,y]),O=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await x();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:E}),me({color:"green",message:"Deployed"})}catch(E){me({color:"red",message:Ee(E)})}finally{b(!1)}},[e,t,x]),C=f.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),b(!0);try{const E=await _(),k=await e.post(e.fhirUrl("Bot",t,"$execute"),E,d);await fd(v.current,{command:"setValue",value:k}),me({color:"green",message:"Success"})}catch(E){me({color:"red",message:Ee(E)})}finally{b(!1)}},[e,t,_,d]);return!r||o===void 0?null:s.jsxs(tn,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(tn.Col,{span:8,children:s.jsxs(on,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(Wge,{iframeRef:m,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(K,{position:"right",spacing:"xs",children:[s.jsx(ne,{type:"button",onClick:w,loading:g,leftIcon:s.jsx(wle,{size:"1rem"}),children:"Save"}),s.jsx(ne,{type:"button",onClick:O,loading:g,leftIcon:s.jsx(Sx,{size:"1rem"}),children:"Deploy"}),s.jsx(ne,{type:"button",onClick:C,loading:g,leftIcon:s.jsx(Ale,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(tn.Col,{span:4,children:[s.jsxs(on,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ft,{data:[{label:"FHIR",value:Qt.FHIR_JSON},{label:"HL7",value:Qt.HL7_V2}],onChange:P=>p(P.currentTarget.value)}),d===Qt.FHIR_JSON?s.jsx(Ds,{value:a,onChange:P=>l(P),minRows:15}):s.jsx("textarea",{className:h.hl7Input,value:c,onChange:P=>u(P.currentTarget.value),rows:15})]}),s.jsx(on,{m:2,p:"xs",shadow:"md",children:s.jsx(Uge,{iframeRef:v,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Kge(e,t){var r,n,o;if((r=t.sourceCode)!=null&&r.url){const i=(o=(n=t.sourceCode.url)==null?void 0:n.split("/"))==null?void 0:o.find(u5);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Vc(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Yge(){const e=ae(),{resourceType:t,id:r}=Qe(),n={reference:t+"/"+r},o=f.useCallback(i=>{e.updateResource(Vc(i)).then(()=>{me({color:"green",message:"Success"})}).catch(a=>{me({color:"red",message:Ee(a)})})},[e]);switch(t){case"PlanDefinition":return s.jsx(Se,{children:s.jsx(Dde,{value:n,onSubmit:o})});case"Questionnaire":return s.jsx(Se,{children:s.jsx(afe,{questionnaire:n,onSubmit:o})});default:return null}}function Xge(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t}),n=Pt();return r?s.jsx(Se,{children:s.jsx($fe,{value:r,onStart:(o,i)=>n(`/forms/${ix(i)}`),onEdit:(o,i,a)=>n(`/${a.reference}}`)})}):null}function Jge(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Pt();return s.jsxs(Se,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(ne,{color:"red",onClick:()=>{e.deleteResource(t,r).then(()=>n(`/${t}`)).catch(o=>me({color:"red",message:Ee(o)}))},children:"Delete"})]})}function Zge(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t});return r?s.jsx(Se,{children:s.jsx(Lx,{value:r})}):null}function eve(){const e=ae(),{resourceType:t,id:r}=Qe(),[n,o]=f.useState(),i=Pt(),[a,l]=f.useState();f.useEffect(()=>{e.readResource(t,r).then(d=>o(va(d))).catch(d=>{l(ct(d)),me({color:"red",message:Ee(d)})})},[e,t,r]);const c=f.useCallback(d=>{l(void 0),e.updateResource(Vc(d)).then(()=>{i(`/${t}/${r}/details`),me({color:"green",message:"Success"})}).catch(p=>{l(ct(p)),me({color:"red",message:Ee(p)})})},[e,t,r,i]),u=f.useCallback(()=>i(`/${t}/${r}/delete`),[i,t,r]);return n?s.jsx(Se,{children:s.jsx(I4,{defaultValue:n,onSubmit:c,onDelete:u,outcome:a})}):null}function tve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=e.readHistory(t,r).read();return s.jsx(Se,{children:s.jsx(Ufe,{history:n})})}function rve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ke({reference:t+"/"+r}),o=Pt(),[i,a]=f.useState(),l=f.useCallback(c=>{e.updateResource(Vc(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${r}/details`),me({color:"green",message:"Success"})}).catch(u=>{me({color:"red",message:Ee(u)})})},[e,t,r,o]);return n?s.jsxs(Se,{children:[i&&s.jsx(bi,{outcome:i}),s.jsxs(De,{onSubmit:l,children:[s.jsx(Ds,{name:"resource","data-testid":"resource-json",minRows:24,defaultValue:sr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"OK"})})]})]}):null}function nve(){const{resourceType:e,id:t}=Qe();return Ke({reference:e+"/"+t})?s.jsxs(Se,{children:[s.jsxs(_c,{icon:s.jsx(dm,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Le,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(k4,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function ove(){const e=ae(),{id:t}=Qe(),[r,n]=f.useState(),[o,i]=f.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>ive(c,t));function l(){r&&e.createResource({resourceType:"Subscription",status:"active",reason:r.name,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:et(r)}}).then(()=>{n(void 0),i(Date.now()),e.invalidateSearches("Subscription"),me({color:"green",message:"Success"})}).catch(c=>me({color:"red",message:Ee(c)}))}return s.jsxs(Se,{children:[s.jsx(he,{children:"Bots"}),a.length===0&&s.jsx("p",{children:"No bots found."}),a.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Nc,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(he,{children:"Connect to bot"}),s.jsxs(K,{children:[s.jsx(Ns,{name:"bot",resourceType:"Bot",onChange:n}),s.jsx(ne,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function ive(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 ave(){const{id:e}=Qe(),t=Pt(),[r,n]=f.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:te.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(Se,{children:s.jsx(Ac,{search:r,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>n(o.definition),hideFilters:!0,hideToolbar:!0})})}function sve(){const e=ae(),{resourceType:t,id:r}=Qe(),n=Ke({reference:t+"/"+r}),o=f.useCallback(i=>{e.updateResource(Vc(i)).then(()=>{me({color:"green",message:"Success"})}).catch(a=>{me({color:"red",message:Ee(a)})})},[e]);return n?s.jsx(Se,{children:s.jsx(_fe,{onSubmit:o,definition:n})}):null}function lve(){const{resourceType:e,id:t}=Qe(),r=Ke({reference:e+"/"+t});return r?s.jsx(Se,{children:e==="MeasureReport"?s.jsx(Tde,{measureReport:r}):s.jsx(Ax,{value:r})}):null}const cve=W(e=>({container:{position:"fixed",top:300,left:0,width:160,zIndex:5,fontSize:e.fontSizes.xs,"@media (max-width: 700px)":{display:"none"}},entry:{textAlign:"center",width:150,backgroundColor:e.colors.gray[0],border:`1px solid ${e.colors.gray[3]}`},active:{width:160,backgroundColor:e.colors.yellow[0],border:`1px solid ${e.colors.yellow[5]}`}}));function uve(e){const{classes:t,cx:r}=cve(),n=ae(),o=Ke(e.value),[i,a]=f.useState();return f.useEffect(()=>{if(!o)return;const l=Zx(o);if(!l)return;const c="reference"in l?l.reference:et(l);n.search("ServiceRequest","subject="+c).then(u=>{const p=u.entry.map(h=>h.resource);c4(p),p.reverse(),a(p)}).catch(u=>me({color:"red",message:Ee(u)}))},[n,o]),i?s.jsx("div",{"data-testid":"quick-service-requests",className:t.container,children:i.map(l=>{var c,u,d,p,h,m,v;return s.jsxs("div",{className:r(t.entry,{[t.active]:l.id===(o==null?void 0:o.id)}),children:[s.jsx("p",{children:s.jsx(ke,{to:l,children:dve(l)})}),((u=(c=l.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(d=l.category[0])==null?void 0:d.text}),((m=(h=(p=l.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&s.jsx("p",{children:(v=l.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:fve(l)})]},l.id)})}):null}function dve(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function fve(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const pve=W(()=>({container:{position:"absolute",top:65,right:5,width:200,height:50,zIndex:15}}));function hve(e){var i,a,l,c;const{classes:t}=pve(),r=Ke(e.valueSet);if(!r)return null;const n=[""],o=(c=(l=(a=(i=r.compose)==null?void 0:i.include)==null?void 0:a[0])==null?void 0:l.concept)==null?void 0:c.map(u=>u.code);return o&&n.push(...o),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:t.container,children:s.jsx(ft,{defaultValue:e.defaultValue,onChange:u=>e.onChange(u.currentTarget.value),data:n})})}function mve(e){var r,n;const t=Ke(e.specimen);return t?s.jsxs(je,{children:[s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Type"}),s.jsx(je.Value,{children:"Specimen"})]}),s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Collected"}),s.jsx(je.Value,{children:kr((r=t.collection)==null?void 0:r.collectedDateTime)})]}),s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Specimen Age"}),s.jsx(je.Value,{children:gve(t)})]}),(n=t.collection)!=null&&n.collectedDateTime&&t.receivedTime?s.jsxs(je.Entry,{children:[s.jsx(je.Key,{children:"Specimen Stability"}),s.jsx(je.Value,{children:vve(t)})]}):s.jsx(s.Fragment,{})]}):null}function gve(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const r=new Date(t);return j3(O3(r,new Date))}function vve(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 j3(O3(t,r))}function j3(e){return e.toString().padStart(3,"0")+"D"}function O3(e,t){const r=t.getTime()-e.getTime();return Math.floor(r/(1e3*3600*24))}function yve(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),t.push("Details","Edit","Event","History","Blame","JSON","Apps"),t}function xve(){var x,_,w,O,C,P,E;const e=ae(),{resourceType:t,id:r}=Qe(),n={reference:t+"/"+r},o=Pt(),[i,a]=f.useState(),l=Ke(n,a),c=yve(t),[u,d]=f.useState(()=>{const k=window.location.pathname.split("/").pop();return k&&c.map($=>$.toLowerCase()).includes(k)?k:c[0].toLowerCase()});async function p(){var I,T;const $=(T=(I=(await e.readHistory(t,r)).entry)==null?void 0:I.find(z=>!!z.resource))==null?void 0:T.resource;$?h($):me({color:"red",message:"No history to restore"})}function h(k){e.updateResource(Vc(k)).then(()=>{a(void 0),me({color:"green",message:"Success"})}).catch($=>{me({color:"red",message:Ee($)})})}if(i)return uae(i)?s.jsxs(Se,{children:[s.jsx(he,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(ne,{color:"red",onClick:p,children:"Restore"})]}):s.jsx(bi,{outcome:i});function m(k){d(k),o(`/${t}/${r}/${k}`)}function v(k){const $=l,I=$.orderDetail||[];I.length===0&&I.push({}),I[0].text!==k&&(I[0].text=k,h({...$,orderDetail:I}))}const g=l&&Zx(l),b=l&&rge(l),y=(w=(_=(x=e.getUserConfiguration())==null?void 0:x.option)==null?void 0:_.find(k=>k.id==="statusValueSet"))==null?void 0:w.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&y&&s.jsx(hve,{valueSet:{reference:y},defaultValue:(C=(O=l.orderDetail)==null?void 0:O[0])==null?void 0:C.text,onChange:v},et(l)+"-"+((E=(P=l.orderDetail)==null?void 0:P[0])==null?void 0:E.text)),l&&s.jsx(uve,{value:l}),l&&s.jsxs(on,{children:[g&&s.jsx(b3,{patient:g}),b&&s.jsx(mve,{specimen:b}),t!=="Patient"&&s.jsx(S3,{resource:n}),s.jsx(da,{children:s.jsx(He,{value:u.toLowerCase(),onTabChange:m,children:s.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(k=>s.jsx(He.Tab,{value:k.toLowerCase(),children:k},k))})})})]}),s.jsx(Kx,{})]})}function RC(){var y,x,_,w;const e=Pt(),{resourceType:t,id:r,versionId:n,tab:o}=Qe(),i=ae(),[a,l]=f.useState(!0),[c,u]=f.useState(),[d,p]=f.useState();if(f.useEffect(()=>{p(void 0),l(!0),i.readHistory(t,r).then(O=>u(O)).then(()=>l(!1)).catch(O=>{p(O),l(!1)})},[i,t,r]),a)return s.jsx(On,{});if(!c)return s.jsxs(Se,{children:[s.jsx(he,{children:"Resource not found"}),s.jsx(ke,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(O=>{var C,P;return((P=(C=O.resource)==null?void 0:C.meta)==null?void 0:P.versionId)===n});if(m===-1)return s.jsxs(Se,{children:[s.jsx(he,{children:"Version not found"}),s.jsx(ke,{to:`/${t}/${r}`,children:"Return to resource"})]});const v=h[m].resource,g=m<h.length-1?h[m+1].resource:void 0,b="diff";return s.jsx(s.Fragment,{children:s.jsxs(He,{value:o||b,onTabChange:O=>e(`/${t}/${r}/_history/${n}/${O}`),children:[s.jsxs(on,{children:[s.jsx(Dc,{fluid:!0,p:"md",children:s.jsx(re,{children:`${t} ${r}`})}),s.jsxs(He.List,{children:[s.jsx(He.Tab,{value:"diff",children:"Diff"}),s.jsx(He.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(Se,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(He.Panel,{value:"diff",children:g?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(y=v.meta)==null?void 0:y.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(ke,{to:`/${t}/${r}/_history/${(x=g.meta)==null?void 0:x.versionId}`,children:(_=g.meta)==null?void 0:_.versionId})]})]}),s.jsx(Vfe,{original:g,revised:v})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(w=v.meta)==null?void 0:w.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(v,void 0,2)})]})}),s.jsx(He.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(v,void 0,2)})})]})]})})}function wve(){const{resourceType:e,id:t}=Qe(),r=Pt(),[n,o]=f.useState({resourceType:"Subscription",filters:[{code:"url",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(Se,{children:s.jsx(Ac,{search:n,onClick:i=>r(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function TC(){const{resourceType:e,id:t}=Qe(),r={reference:e+"/"+t};switch(e){case"Encounter":return s.jsx(Due,{encounter:r});case"Patient":return s.jsx(Ide,{patient:r});case"ServiceRequest":return s.jsx(Gfe,{serviceRequest:r});default:return s.jsx(Iue,{resource:r})}}function C3(e,t){const r=ae(),n=Pt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),r.createResource(a).then(l=>n("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ct(l))})}}}function IC(){const{resourceType:e}=Qe(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=C3(e,r);return s.jsx(Se,{children:s.jsx(I4,{defaultValue:n,onSubmit:o,outcome:t})})}function _ve(){const{resourceType:e}=Qe(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=C3(e,r),i=f.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(Se,{children:[t&&s.jsx(bi,{outcome:t}),s.jsxs(De,{onSubmit:i,children:[s.jsx(Ds,{name:"new-resource","data-testid":"create-resource-json",minRows:24,defaultValue:sr(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(K,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(ne,{type:"submit",children:"OK"})})]})]})}function bve(){return s.jsx(she,{children:s.jsxs(pe,{errorElement:s.jsx(ege,{}),children:[s.jsx(pe,{path:"/signin",element:s.jsx(wge,{})}),s.jsx(pe,{path:"/oauth",element:s.jsx(mge,{})}),s.jsx(pe,{path:"/resetpassword",element:s.jsx(vge,{})}),s.jsx(pe,{path:"/setpassword/:id/:secret",element:s.jsx(xge,{})}),s.jsx(pe,{path:"/register",element:s.jsx(gge,{})}),s.jsx(pe,{path:"/changepassword",element:s.jsx(Xme,{})}),s.jsx(pe,{path:"/security",element:s.jsx(yge,{})}),s.jsx(pe,{path:"/mfa",element:s.jsx(pge,{})}),s.jsx(pe,{path:"/batch",element:s.jsx(Kme,{})}),s.jsx(pe,{path:"/bulk/:resourceType",element:s.jsx(Yme,{})}),s.jsx(pe,{path:"/smart",element:s.jsx(_ge,{})}),s.jsx(pe,{path:"/forms/:id",element:s.jsx(oge,{})}),s.jsx(pe,{path:"/admin/super",element:s.jsx(Ige,{})}),s.jsxs(pe,{path:"/admin",element:s.jsx(kge,{}),children:[s.jsx(pe,{path:"patients",element:s.jsx($ge,{})}),s.jsx(pe,{path:"bots/new",element:s.jsx(Pge,{})}),s.jsx(pe,{path:"bots",element:s.jsx(bge,{})}),s.jsx(pe,{path:"clients/new",element:s.jsx(jge,{})}),s.jsx(pe,{path:"clients",element:s.jsx(Sge,{})}),s.jsx(pe,{path:"details",element:s.jsx(EC,{})}),s.jsx(pe,{path:"invite",element:s.jsx(Ege,{})}),s.jsx(pe,{path:"users",element:s.jsx(Dge,{})}),s.jsx(pe,{path:"project",element:s.jsx(EC,{})}),s.jsx(pe,{path:"secrets",element:s.jsx(Rge,{})}),s.jsx(pe,{path:"sites",element:s.jsx(Tge,{})}),s.jsx(pe,{path:"members/:membershipId",element:s.jsx(Cge,{})})]}),s.jsx(pe,{path:"/lab/assays",element:s.jsx(Nge,{})}),s.jsx(pe,{path:"/lab/panels",element:s.jsx(Age,{})}),s.jsx(pe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(RC,{})}),s.jsx(pe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(RC,{})}),s.jsxs(pe,{path:"/:resourceType/new",element:s.jsx(Zme,{}),children:[s.jsx(pe,{index:!0,element:s.jsx(IC,{})}),s.jsx(pe,{path:"form",element:s.jsx(IC,{})}),s.jsx(pe,{path:"json",element:s.jsx(_ve,{})})]}),s.jsxs(pe,{path:"/:resourceType/:id",element:s.jsx(xve,{}),children:[s.jsx(pe,{index:!0,element:s.jsx(TC,{})}),s.jsx(pe,{path:"apply",element:s.jsx(Lge,{})}),s.jsx(pe,{path:"apps",element:s.jsx(zge,{})}),s.jsx(pe,{path:"event",element:s.jsx(Vge,{})}),s.jsx(pe,{path:"blame",element:s.jsx(Bge,{})}),s.jsx(pe,{path:"bots",element:s.jsx(ove,{})}),s.jsx(pe,{path:"builder",element:s.jsx(Yge,{})}),s.jsx(pe,{path:"checklist",element:s.jsx(Xge,{})}),s.jsx(pe,{path:"delete",element:s.jsx(Jge,{})}),s.jsx(pe,{path:"details",element:s.jsx(Zge,{})}),s.jsx(pe,{path:"edit",element:s.jsx(eve,{})}),s.jsx(pe,{path:"editor",element:s.jsx(Qge,{})}),s.jsx(pe,{path:"history",element:s.jsx(tve,{})}),s.jsx(pe,{path:"json",element:s.jsx(rve,{})}),s.jsx(pe,{path:"preview",element:s.jsx(nve,{})}),s.jsx(pe,{path:"responses",element:s.jsx(ave,{})}),s.jsx(pe,{path:"report",element:s.jsx(lve,{})}),s.jsx(pe,{path:"ranges",element:s.jsx(sve,{})}),s.jsx(pe,{path:"subscriptions",element:s.jsx(wve,{})}),s.jsx(pe,{path:"timeline",element:s.jsx(TC,{})})]}),s.jsx(pe,{path:"/:resourceType",element:s.jsx(CC,{})}),s.jsx(pe,{path:"/",element:s.jsx(CC,{})})]})})}function Sve(){const e=ae(),t=e.getUserConfiguration(),r=Pi(),[n]=Yx();return e.isLoading()?s.jsx(On,{}):s.jsx(Pce,{logo:s.jsx(En,{size:24}),pathname:r.pathname,searchParams:n,version:zse,menus:Pve(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(f.Suspense,{fallback:s.jsx(On,{}),children:s.jsx(bve,{})})})}function Pve(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(i=>({label:i.name,href:i.target,icon:jve(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx($le,{})}]}),t}const DC={Patient:Ule,Practitioner:Ole,Organization:hle,ServiceRequest:Lle,DiagnosticReport:Fle,Questionnaire:jle,admin:dle,AccessPolicy:Ele,Subscription:Gle,batch:Ile,Observation:Tle};function jve(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in DC){const r=DC[t];return s.jsx(r,{})}}catch{}return s.jsx(im,{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 Ove(){const e=Fc(),t=new Wse({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=uhe([{path:"*",element:s.jsx(Sve,{})}]),o=a=>n.navigate(a);V4(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(Gse,{medplum:t,navigate:o,children:s.jsxs(PE,{theme:r,withGlobalStyles:!0,withNormalizeCSS:!0,children:[s.jsx(ga,{position:"bottom-right"}),s.jsx(yhe,{router:n})]})})}))}Ove().catch(console.error);
235
+ //# sourceMappingURL=index-3c927a6c.js.map