diff --git a/ui/v2/frontend/assets/index-BOStydLj.js b/ui/v2/frontend/assets/index-EnvA4jRc.js similarity index 89% rename from ui/v2/frontend/assets/index-BOStydLj.js rename to ui/v2/frontend/assets/index-EnvA4jRc.js index 02d8270d..5862b2ac 100644 --- a/ui/v2/frontend/assets/index-BOStydLj.js +++ b/ui/v2/frontend/assets/index-EnvA4jRc.js @@ -61,7 +61,7 @@ Error generating stack: `+s.message+` `)),[]});var pP=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(pP||{});function mP(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function gP(e,t,n,r){let[i,s]=g.useState(n),{hasFlag:o,addFlag:a,removeFlag:l}=fP(e&&i?3:0),u=g.useRef(!1),c=g.useRef(!1),d=yo();return ft(()=>{var f;if(e){if(n&&s(!0),!t){n&&a(3);return}return(f=r==null?void 0:r.start)==null||f.call(r,n),vP(t,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){c.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var h;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,l(7),n||s(!1),(h=r==null?void 0:r.end)==null||h.call(r,n))}})}},[e,n,t,d]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function vP(e,{prepare:t,run:n,done:r,inFlight:i}){let s=oi();return wP(e,{prepare:t,inFlight:i}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(yP(e,r))})}),s.dispose}function yP(e,t){var n,r;let i=oi();if(!e)return i.dispose;let s=!1;i.add(()=>{s=!0});let o=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return o.length===0?(t(),i.dispose):(Promise.allSettled(o.map(a=>a.finished)).then(()=>{s||t()}),i.dispose)}function wP(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Qp(e,t){let n=g.useRef([]),r=xe(e);g.useEffect(()=>{let i=[...n.current];for(let[s,o]of t.entries())if(n.current[s]!==o){let a=r(t,i);return n.current=t,a}},[r,...t])}function Hc(){return typeof window<"u"}function xo(e){return w1(e)?(e.nodeName||"").toLowerCase():"#document"}function At(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bn(e){var t;return(t=(w1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function w1(e){return Hc()?e instanceof Node||e instanceof At(e).Node:!1}function Sn(e){return Hc()?e instanceof Element||e instanceof At(e).Element:!1}function Vn(e){return Hc()?e instanceof HTMLElement||e instanceof At(e).HTMLElement:!1}function fv(e){return!Hc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof At(e).ShadowRoot}function gl(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function xP(e){return["table","td","th"].includes(xo(e))}function Bc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function qp(e){const t=Yp(),n=Sn(e)?_n(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function SP(e){let t=Yr(e);for(;Vn(t)&&!oo(t);){if(qp(t))return t;if(Bc(t))return null;t=Yr(t)}return null}function Yp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function oo(e){return["html","body","#document"].includes(xo(e))}function _n(e){return At(e).getComputedStyle(e)}function Uc(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yr(e){if(xo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fv(e)&&e.host||Bn(e);return fv(t)?t.host:t}function x1(e){const t=Yr(e);return oo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vn(t)&&gl(t)?t:x1(t)}function La(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=x1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=At(i);if(s){const a=Ch(o);return t.concat(o,o.visualViewport||[],gl(i)?i:[],a&&n?La(a):[])}return t.concat(i,La(i,[],n))}function Ch(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ao=Math.min,Fi=Math.max,rc=Math.round,Ql=Math.floor,An=e=>({x:e,y:e}),_P={left:"right",right:"left",bottom:"top",top:"bottom"},CP={start:"end",end:"start"};function Eh(e,t,n){return Fi(e,ao(t,n))}function vl(e,t){return typeof e=="function"?e(t):e}function Ui(e){return e.split("-")[0]}function yl(e){return e.split("-")[1]}function S1(e){return e==="x"?"y":"x"}function Xp(e){return e==="y"?"height":"width"}function lo(e){return["top","bottom"].includes(Ui(e))?"y":"x"}function Jp(e){return S1(lo(e))}function EP(e,t,n){n===void 0&&(n=!1);const r=yl(e),i=Jp(e),s=Xp(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ic(o)),[o,ic(o)]}function kP(e){const t=ic(e);return[kh(e),t,kh(t)]}function kh(e){return e.replace(/start|end/g,t=>CP[t])}function bP(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function PP(e,t,n,r){const i=yl(e);let s=bP(Ui(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(kh)))),s}function ic(e){return e.replace(/left|right|bottom|top/g,t=>_P[t])}function RP(e){return{top:0,right:0,bottom:0,left:0,...e}}function _1(e){return typeof e!="number"?RP(e):{top:e,right:e,bottom:e,left:e}}function sc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function hv(e,t,n){let{reference:r,floating:i}=e;const s=lo(t),o=Jp(t),a=Xp(o),l=Ui(t),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(yl(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const MP=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=hv(u,r,l),f=r,h={},m=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=vl(e,t)||{};if(u==null)return{};const d=_1(c),f={x:n,y:r},h=Jp(i),m=Xp(h),y=await o.getDimensions(u),S=h==="y",v=S?"top":"left",w=S?"bottom":"right",x=S?"clientHeight":"clientWidth",_=s.reference[m]+s.reference[h]-f[h]-s.floating[m],C=f[h]-s.reference[h],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let b=P?P[x]:0;(!b||!await(o.isElement==null?void 0:o.isElement(P)))&&(b=a.floating[x]||s.floating[m]);const k=_/2-C/2,M=b/2-y[m]/2-1,$=ao(d[v],M),T=ao(d[w],M),O=$,K=b-y[m]-T,U=b/2-y[m]/2+k,I=Eh(O,U,K),Z=!l.arrow&&yl(i)!=null&&U!==I&&s.reference[m]/2-(UU<=0)){var T,O;const U=(((T=s.flip)==null?void 0:T.index)||0)+1,I=b[U];if(I)return{data:{index:U,overflows:$},reset:{placement:I}};let Z=(O=$.filter(ie=>ie.overflows[0]<=0).sort((ie,j)=>ie.overflows[1]-j.overflows[1])[0])==null?void 0:O.placement;if(!Z)switch(h){case"bestFit":{var K;const ie=(K=$.filter(j=>{if(P){const A=lo(j.placement);return A===w||A==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(A=>A>0).reduce((A,B)=>A+B,0)]).sort((j,A)=>j[1]-A[1])[0])==null?void 0:K[0];ie&&(Z=ie);break}case"initialPlacement":Z=a;break}if(i!==Z)return{reset:{placement:Z}}}return{}}}};async function jP(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ui(n),a=yl(n),l=lo(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=vl(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const FP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await jP(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},NP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:S=>{let{x:v,y:w}=S;return{x:v,y:w}}},...l}=vl(e,t),u={x:n,y:r},c=await C1(t,l),d=lo(Ui(i)),f=S1(d);let h=u[f],m=u[d];if(s){const S=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=h+c[S],x=h-c[v];h=Eh(w,h,x)}if(o){const S=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=m+c[S],x=m-c[v];m=Eh(w,m,x)}const y=a.fn({...t,[f]:h,[d]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:s,[d]:o}}}}}};function E1(e){const t=_n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=rc(n)!==s||rc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function em(e){return Sn(e)?e:e.contextElement}function Fs(e){const t=em(e);if(!Vn(t))return An(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=E1(t);let o=(s?rc(n.width):n.width)/r,a=(s?rc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const IP=An(0);function k1(e){const t=At(e);return!Yp()||!t.visualViewport?IP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==At(e)?!1:t}function Wi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=em(e);let o=An(1);t&&(r?Sn(r)&&(o=Fs(r)):o=Fs(e));const a=OP(s,n,r)?k1(s):An(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=At(s),h=r&&Sn(r)?At(r):r;let m=f,y=Ch(m);for(;y&&r&&h!==m;){const S=Fs(y),v=y.getBoundingClientRect(),w=_n(y),x=v.left+(y.clientLeft+parseFloat(w.paddingLeft))*S.x,_=v.top+(y.clientTop+parseFloat(w.paddingTop))*S.y;l*=S.x,u*=S.y,c*=S.x,d*=S.y,l+=x,u+=_,m=At(y),y=Ch(m)}}return sc({width:c,height:d,x:l,y:u})}function tm(e,t){const n=Uc(e).scrollLeft;return t?t.left+n:Wi(Bn(e)).left+n}function b1(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:tm(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function LP(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Bn(r),a=t?Bc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=An(1);const c=An(0),d=Vn(r);if((d||!d&&!s)&&((xo(r)!=="body"||gl(o))&&(l=Uc(r)),Vn(r))){const h=Wi(r);u=Fs(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=o&&!d&&!s?b1(o,l,!0):An(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function AP(e){return Array.from(e.getClientRects())}function DP(e){const t=Bn(e),n=Uc(e),r=e.ownerDocument.body,i=Fi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Fi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+tm(e);const a=-n.scrollTop;return _n(r).direction==="rtl"&&(o+=Fi(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function VP(e,t){const n=At(e),r=Bn(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=Yp();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function zP(e,t){const n=Wi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Vn(e)?Fs(e):An(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function pv(e,t,n){let r;if(t==="viewport")r=VP(e,n);else if(t==="document")r=DP(Bn(e));else if(Sn(t))r=zP(t,n);else{const i=k1(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return sc(r)}function P1(e,t){const n=Yr(e);return n===t||!Sn(n)||oo(n)?!1:_n(n).position==="fixed"||P1(n,t)}function HP(e,t){const n=t.get(e);if(n)return n;let r=La(e,[],!1).filter(a=>Sn(a)&&xo(a)!=="body"),i=null;const s=_n(e).position==="fixed";let o=s?Yr(e):e;for(;Sn(o)&&!oo(o);){const a=_n(o),l=qp(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||gl(o)&&!l&&P1(e,o))?r=r.filter(c=>c!==o):i=a,o=Yr(o)}return t.set(e,r),r}function BP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Bc(t)?[]:HP(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=pv(t,c,i);return u.top=Fi(d.top,u.top),u.right=ao(d.right,u.right),u.bottom=ao(d.bottom,u.bottom),u.left=Fi(d.left,u.left),u},pv(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function UP(e){const{width:t,height:n}=E1(e);return{width:t,height:n}}function WP(e,t,n){const r=Vn(t),i=Bn(t),s=n==="fixed",o=Wi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=An(0);if(r||!r&&!s)if((xo(t)!=="body"||gl(i))&&(a=Uc(t)),r){const f=Wi(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=tm(i));const u=i&&!r&&!s?b1(i,a):An(0),c=o.left+a.scrollLeft-l.x-u.x,d=o.top+a.scrollTop-l.y-u.y;return{x:c,y:d,width:o.width,height:o.height}}function Kd(e){return _n(e).position==="static"}function mv(e,t){if(!Vn(e)||_n(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bn(e)===n&&(n=n.ownerDocument.body),n}function R1(e,t){const n=At(e);if(Bc(e))return n;if(!Vn(e)){let i=Yr(e);for(;i&&!oo(i);){if(Sn(i)&&!Kd(i))return i;i=Yr(i)}return n}let r=mv(e,t);for(;r&&xP(r)&&Kd(r);)r=mv(r,t);return r&&oo(r)&&Kd(r)&&!qp(r)?n:r||SP(e)||n}const GP=async function(e){const t=this.getOffsetParent||R1,n=this.getDimensions,r=await n(e.floating);return{reference:WP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ZP(e){return _n(e).direction==="rtl"}const KP={convertOffsetParentRelativeRectToViewportRelativeRect:LP,getDocumentElement:Bn,getClippingRect:BP,getOffsetParent:R1,getElementRects:GP,getClientRects:AP,getDimensions:UP,getScale:Fs,isElement:Sn,isRTL:ZP};function QP(e,t){let n=null,r;const i=Bn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Ql(c),m=Ql(i.clientWidth-(u+d)),y=Ql(i.clientHeight-(c+f)),S=Ql(u),w={rootMargin:-h+"px "+-m+"px "+-y+"px "+-S+"px",threshold:Fi(0,ao(1,l))||1};let x=!0;function _(C){const P=C[0].intersectionRatio;if(P!==l){if(!x)return o();P?o(!1,P):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(_,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return o(!0),s}function qP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=em(e),c=i||s?[...u?La(u):[],...La(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?QP(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,y=l?Wi(e):null;l&&S();function S(){const v=Wi(e);y&&(v.x!==y.x||v.y!==y.y||v.width!==y.width||v.height!==y.height)&&n(),y=v,m=requestAnimationFrame(S)}return n(),()=>{var v;c.forEach(w=>{i&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const YP=FP,XP=NP,JP=TP,eR=$P,gv=(e,t,n)=>{const r=new Map,i={platform:KP,...n},s={...i.platform,_c:r};return MP(e,t,{...i,platform:s})};let Wc=g.createContext(null);Wc.displayName="OpenClosedContext";var pn=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(pn||{});function Gc(){return g.useContext(Wc)}function tR({value:e,children:t}){return L.createElement(Wc.Provider,{value:e},t)}function nR({children:e}){return L.createElement(Wc.Provider,{value:null},e)}function rR(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let kr=[];rR(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||kr[0]===t.target)return;let n=t.target;n=n.closest(nc),kr.unshift(n??t.target),kr=kr.filter(r=>r!=null&&r.isConnected),kr.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function M1(e){let t=xe(e),n=g.useRef(!1);g.useEffect(()=>(n.current=!1,()=>{n.current=!0,Dc(()=>{n.current&&t()})}),[t])}function iR(){let e=typeof document>"u";return"useSyncExternalStore"in jm?(t=>t.useSyncExternalStore)(jm)(()=>()=>{},()=>!1,()=>!e):!1}function wl(){let e=iR(),[t,n]=g.useState(ji.isHandoffComplete);return t&&ji.isHandoffComplete===!1&&n(!1),g.useEffect(()=>{t!==!0&&n(!0)},[t]),g.useEffect(()=>ji.handoff(),[]),e?!1:t}let $1=g.createContext(!1);function sR(){return g.useContext($1)}function vv(e){return L.createElement($1.Provider,{value:e.force},e.children)}function oR(e){let t=sR(),n=g.useContext(j1),r=ml(e),[i,s]=g.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(ji.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return g.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),g.useEffect(()=>{t||n!==null&&s(n.current)},[n,s,t]),i}let T1=g.Fragment,aR=Ye(function(e,t){let n=e,r=g.useRef(null),i=rn(Fb(d=>{r.current=d}),t),s=ml(r),o=oR(r),[a]=g.useState(()=>{var d;return ji.isServer?null:(d=s==null?void 0:s.createElement("div"))!=null?d:null}),l=g.useContext(bh),u=wl();ft(()=>{!o||!a||o.contains(a)||(a.setAttribute("data-headlessui-portal",""),o.appendChild(a))},[o,a]),ft(()=>{if(a&&l)return l.register(a)},[l,a]),M1(()=>{var d;!o||!a||(a instanceof Node&&o.contains(a)&&o.removeChild(a),o.childNodes.length<=0&&((d=o.parentElement)==null||d.removeChild(o)))});let c=st();return u?!o||!a?null:Lc.createPortal(c({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:T1,name:"Portal"}),a):null});function lR(e,t){let n=rn(t),{enabled:r=!0,...i}=e,s=st();return r?L.createElement(aR,{...i,ref:n}):s({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:T1,name:"Portal"})}let uR=g.Fragment,j1=g.createContext(null);function cR(e,t){let{target:n,...r}=e,i={ref:rn(t)},s=st();return L.createElement(j1.Provider,{value:n},s({ourProps:i,theirProps:r,defaultTag:uR,name:"Popover.Group"}))}let bh=g.createContext(null);function dR(){let e=g.useContext(bh),t=g.useRef([]),n=xe(s=>(t.current.push(s),e&&e.register(s),()=>r(s))),r=xe(s=>{let o=t.current.indexOf(s);o!==-1&&t.current.splice(o,1),e&&e.unregister(s)}),i=g.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,g.useMemo(()=>function({children:s}){return L.createElement(bh.Provider,{value:i},s)},[i])]}let fR=Ye(lR),F1=Ye(cR),hR=Object.assign(fR,{Group:F1});function pR(e,t=typeof document<"u"?document.defaultView:null,n){let r=wo(e,"escape");y1(t,"keydown",i=>{r&&(i.defaultPrevented||i.key===tc.Escape&&n(i))})}function mR(){var e;let[t]=g.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=g.useState((e=t==null?void 0:t.matches)!=null?e:!1);return ft(()=>{if(!t)return;function i(s){r(s.matches)}return t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[t]),n}function gR({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=ml(n),i=xe(()=>{var s,o;let a=[];for(let l of e)l!==null&&(l instanceof HTMLElement?a.push(l):"current"in l&&l.current instanceof HTMLElement&&a.push(l.current));if(t!=null&&t.current)for(let l of t.current)a.push(l);for(let l of(s=r==null?void 0:r.querySelectorAll("html > *, body > *"))!=null?s:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(n&&(l.contains(n)||l.contains((o=n==null?void 0:n.getRootNode())==null?void 0:o.host))||a.some(u=>l.contains(u))||a.push(l));return a});return{resolveContainers:i,contains:xe(s=>i().some(o=>o.contains(s)))}}let N1=g.createContext(null);function yv({children:e,node:t}){let[n,r]=g.useState(null),i=I1(t??n);return L.createElement(N1.Provider,{value:i},e,i===null&&L.createElement(so,{features:Bi.Hidden,ref:s=>{var o,a;if(s){for(let l of(a=(o=hl(s))==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])if(l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l!=null&&l.contains(s)){r(l);break}}}}))}function I1(e=null){var t;return(t=g.useContext(N1))!=null?t:e}function nm(){let e=g.useRef(!1);return ft(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Qo=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Qo||{});function vR(){let e=g.useRef(0);return v1(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function O1(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let yR="div";var pi=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(pi||{});function wR(e,t){let n=g.useRef(null),r=rn(n,t),{initialFocus:i,initialFocusFallback:s,containers:o,features:a=15,...l}=e;wl()||(a=0);let u=ml(n);CR(a,{ownerDocument:u});let c=ER(a,{ownerDocument:u,container:n,initialFocus:i,initialFocusFallback:s});kR(a,{ownerDocument:u,container:n,containers:o,previousActiveElement:c});let d=vR(),f=xe(w=>{let x=n.current;x&&(_=>_())(()=>{qr(d.current,{[Qo.Forwards]:()=>{fa(x,Xn.First,{skipElements:[w.relatedTarget,s]})},[Qo.Backwards]:()=>{fa(x,Xn.Last,{skipElements:[w.relatedTarget,s]})}})})}),h=wo(!!(a&2),"focus-trap#tab-lock"),m=yo(),y=g.useRef(!1),S={ref:r,onKeyDown(w){w.key=="Tab"&&(y.current=!0,m.requestAnimationFrame(()=>{y.current=!1}))},onBlur(w){if(!(a&4))return;let x=O1(o);n.current instanceof HTMLElement&&x.add(n.current);let _=w.relatedTarget;_ instanceof HTMLElement&&_.dataset.headlessuiFocusGuard!=="true"&&(L1(x,_)||(y.current?fa(n.current,qr(d.current,{[Qo.Forwards]:()=>Xn.Next,[Qo.Backwards]:()=>Xn.Previous})|Xn.WrapAround,{relativeTo:w.target}):w.target instanceof HTMLElement&&ir(w.target)))}},v=st();return L.createElement(L.Fragment,null,h&&L.createElement(so,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Bi.Focusable}),v({ourProps:S,theirProps:l,defaultTag:yR,name:"FocusTrap"}),h&&L.createElement(so,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Bi.Focusable}))}let xR=Ye(wR),SR=Object.assign(xR,{features:pi});function _R(e=!0){let t=g.useRef(kr.slice());return Qp(([n],[r])=>{r===!0&&n===!1&&Dc(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=kr.slice())},[e,kr,t]),xe(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function CR(e,{ownerDocument:t}){let n=!!(e&8),r=_R(n);Qp(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&ir(r())},[n]),M1(()=>{n&&ir(r())})}function ER(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let s=g.useRef(null),o=wo(!!(e&1),"focus-trap#initial-focus"),a=nm();return Qp(()=>{if(e===0)return;if(!o){i!=null&&i.current&&ir(i.current);return}let l=n.current;l&&Dc(()=>{if(!a.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){s.current=u;return}}else if(l.contains(u)){s.current=u;return}if(r!=null&&r.current)ir(r.current);else{if(e&16){if(fa(l,Xn.First|Xn.AutoFocus)!==_h.Error)return}else if(fa(l,Xn.First)!==_h.Error)return;if(i!=null&&i.current&&(ir(i.current),(t==null?void 0:t.activeElement)===i.current))return;console.warn("There are no focusable elements inside the ")}s.current=t==null?void 0:t.activeElement})},[i,o,e]),s}function kR(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let s=nm(),o=!!(e&4);y1(t==null?void 0:t.defaultView,"focus",a=>{if(!o||!s.current)return;let l=O1(r);n.current instanceof HTMLElement&&l.add(n.current);let u=i.current;if(!u)return;let c=a.target;c&&c instanceof HTMLElement?L1(l,c)?(i.current=c,ir(c)):(a.preventDefault(),a.stopPropagation(),ir(u)):ir(i.current)},!0)}function L1(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function A1(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:V1)!==g.Fragment||L.Children.count(e.children)===1}let Zc=g.createContext(null);Zc.displayName="TransitionContext";var bR=(e=>(e.Visible="visible",e.Hidden="hidden",e))(bR||{});function PR(){let e=g.useContext(Zc);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function RR(){let e=g.useContext(Kc);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let Kc=g.createContext(null);Kc.displayName="NestingContext";function Qc(e){return"children"in e?Qc(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function D1(e,t){let n=qi(e),r=g.useRef([]),i=nm(),s=yo(),o=xe((h,m=Lr.Hidden)=>{let y=r.current.findIndex(({el:S})=>S===h);y!==-1&&(qr(m,{[Lr.Unmount](){r.current.splice(y,1)},[Lr.Hidden](){r.current[y].state="hidden"}}),s.microTask(()=>{var S;!Qc(r)&&i.current&&((S=n.current)==null||S.call(n))}))}),a=xe(h=>{let m=r.current.find(({el:y})=>y===h);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:h,state:"visible"}),()=>o(h,Lr.Unmount)}),l=g.useRef([]),u=g.useRef(Promise.resolve()),c=g.useRef({enter:[],leave:[]}),d=xe((h,m,y)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([S])=>S!==h)),t==null||t.chains.current[m].push([h,new Promise(S=>{l.current.push(S)})]),t==null||t.chains.current[m].push([h,new Promise(S=>{Promise.all(c.current[m].map(([v,w])=>w)).then(()=>S())})]),m==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(m)):y(m)}),f=xe((h,m,y)=>{Promise.all(c.current[m].splice(0).map(([S,v])=>v)).then(()=>{var S;(S=l.current.shift())==null||S()}).then(()=>y(m))});return g.useMemo(()=>({children:r,register:a,unregister:o,onStart:d,onStop:f,wait:u,chains:c}),[a,o,r,d,f,c,u])}let V1=g.Fragment,z1=ec.RenderStrategy;function MR(e,t){var n,r;let{transition:i=!0,beforeEnter:s,afterEnter:o,beforeLeave:a,afterLeave:l,enter:u,enterFrom:c,enterTo:d,entered:f,leave:h,leaveFrom:m,leaveTo:y,...S}=e,[v,w]=g.useState(null),x=g.useRef(null),_=A1(e),C=rn(..._?[x,t,w]:t===null?[]:[t]),P=(n=S.unmount)==null||n?Lr.Unmount:Lr.Hidden,{show:b,appear:k,initial:M}=PR(),[$,T]=g.useState(b?"visible":"hidden"),O=RR(),{register:K,unregister:U}=O;ft(()=>K(x),[K,x]),ft(()=>{if(P===Lr.Hidden&&x.current){if(b&&$!=="visible"){T("visible");return}return qr($,{hidden:()=>U(x),visible:()=>K(x)})}},[$,x,K,U,b,P]);let I=wl();ft(()=>{if(_&&I&&$==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,$,I,_]);let Z=M&&!k,ie=k&&b&&M,j=g.useRef(!1),A=D1(()=>{j.current||(T("hidden"),U(x))},O),B=xe(ce=>{j.current=!0;let we=ce?"enter":"leave";A.onStart(x,we,Xe=>{Xe==="enter"?s==null||s():Xe==="leave"&&(a==null||a())})}),D=xe(ce=>{let we=ce?"enter":"leave";j.current=!1,A.onStop(x,we,Xe=>{Xe==="enter"?o==null||o():Xe==="leave"&&(l==null||l())}),we==="leave"&&!Qc(A)&&(T("hidden"),U(x))});g.useEffect(()=>{_&&i||(B(b),D(b))},[b,_,i]);let q=!(!i||!_||!I||Z),[,se]=gP(q,v,b,{start:B,end:D}),de=_r({ref:C,className:((r=xh(S.className,ie&&u,ie&&c,se.enter&&u,se.enter&&se.closed&&c,se.enter&&!se.closed&&d,se.leave&&h,se.leave&&!se.closed&&m,se.leave&&se.closed&&y,!se.transition&&b&&f))==null?void 0:r.trim())||void 0,...mP(se)}),ue=0;$==="visible"&&(ue|=pn.Open),$==="hidden"&&(ue|=pn.Closed),se.enter&&(ue|=pn.Opening),se.leave&&(ue|=pn.Closing);let me=st();return L.createElement(Kc.Provider,{value:A},L.createElement(tR,{value:ue},me({ourProps:de,theirProps:S,defaultTag:V1,features:z1,visible:$==="visible",name:"Transition.Child"})))}function $R(e,t){let{show:n,appear:r=!1,unmount:i=!0,...s}=e,o=g.useRef(null),a=A1(e),l=rn(...a?[o,t]:t===null?[]:[t]);wl();let u=Gc();if(n===void 0&&u!==null&&(n=(u&pn.Open)===pn.Open),n===void 0)throw new Error("A is used but it is missing a `show={true | false}` prop.");let[c,d]=g.useState(n?"visible":"hidden"),f=D1(()=>{n||d("hidden")}),[h,m]=g.useState(!0),y=g.useRef([n]);ft(()=>{h!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),m(!1))},[y,n]);let S=g.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);ft(()=>{n?d("visible"):!Qc(f)&&o.current!==null&&d("hidden")},[n,f]);let v={unmount:i},w=xe(()=>{var C;h&&m(!1),(C=e.beforeEnter)==null||C.call(e)}),x=xe(()=>{var C;h&&m(!1),(C=e.beforeLeave)==null||C.call(e)}),_=st();return L.createElement(Kc.Provider,{value:f},L.createElement(Zc.Provider,{value:S},_({ourProps:{...v,as:g.Fragment,children:L.createElement(H1,{ref:l,...v,...s,beforeEnter:w,beforeLeave:x})},theirProps:{},defaultTag:g.Fragment,features:z1,visible:c==="visible",name:"Transition"})))}function TR(e,t){let n=g.useContext(Zc)!==null,r=Gc()!==null;return L.createElement(L.Fragment,null,!n&&r?L.createElement(Ph,{ref:t,...e}):L.createElement(H1,{ref:t,...e}))}let Ph=Ye($R),H1=Ye(MR),qc=Ye(TR),jR=Object.assign(Ph,{Child:qc,Root:Ph});var FR=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(FR||{}),NR=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(NR||{});let IR={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},rm=g.createContext(null);rm.displayName="DialogContext";function Yc(e){let t=g.useContext(rm);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yc),n}return t}function OR(e,t){return qr(t.type,IR,e,t)}let wv=Ye(function(e,t){let n=g.useId(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:s,initialFocus:o,role:a="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:c=!1,...d}=e,f=g.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(f.current||(f.current=!0,console.warn(`Invalid role [${a}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let h=Gc();i===void 0&&h!==null&&(i=(h&pn.Open)===pn.Open);let m=g.useRef(null),y=rn(m,t),S=ml(m),v=i?0:1,[w,x]=g.useReducer(OR,{titleId:null,descriptionId:null,panelRef:g.createRef()}),_=xe(()=>s(!1)),C=xe(D=>x({type:0,id:D})),P=wl()?v===0:!1,[b,k]=dR(),M={get current(){var D;return(D=w.panelRef.current)!=null?D:m.current}},$=I1(),{resolveContainers:T}=gR({mainTreeNode:$,portals:b,defaultContainers:[M]}),O=h!==null?(h&pn.Closing)===pn.Closing:!1;Wb(u||O?!1:P,{allowed:xe(()=>{var D,q;return[(q=(D=m.current)==null?void 0:D.closest("[data-headlessui-portal]"))!=null?q:null]}),disallowed:xe(()=>{var D;return[(D=$==null?void 0:$.closest("body > *:not(#headlessui-portal-root)"))!=null?D:null]})}),iP(P,T,D=>{D.preventDefault(),_()}),pR(P,S==null?void 0:S.defaultView,D=>{D.preventDefault(),D.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),_()}),dP(u||O?!1:P,S,T),Gb(P,m,_);let[K,U]=Kp(),I=g.useMemo(()=>[{dialogState:v,close:_,setTitleId:C,unmount:c},w],[v,w,_,C,c]),Z=g.useMemo(()=>({open:v===0}),[v]),ie={ref:y,id:r,role:a,tabIndex:-1,"aria-modal":u?void 0:v===0?!0:void 0,"aria-labelledby":w.titleId,"aria-describedby":K,unmount:c},j=!mR(),A=pi.None;P&&!u&&(A|=pi.RestoreFocus,A|=pi.TabLock,l&&(A|=pi.AutoFocus),j&&(A|=pi.InitialFocus));let B=st();return L.createElement(nR,null,L.createElement(vv,{force:!0},L.createElement(hR,null,L.createElement(rm.Provider,{value:I},L.createElement(F1,{target:m},L.createElement(vv,{force:!1},L.createElement(U,{slot:Z},L.createElement(k,null,L.createElement(SR,{initialFocus:o,initialFocusFallback:m,containers:T,features:A},L.createElement(Hb,{value:_},B({ourProps:ie,theirProps:d,slot:Z,defaultTag:LR,features:AR,visible:v===0,name:"Dialog"})))))))))))}),LR="div",AR=ec.RenderStrategy|ec.Static;function DR(e,t){let{transition:n=!1,open:r,...i}=e,s=Gc(),o=e.hasOwnProperty("open")||s!==null,a=e.hasOwnProperty("onClose");if(!o&&!a)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!a)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?L.createElement(yv,null,L.createElement(jR,{show:r,transition:n,unmount:i.unmount},L.createElement(wv,{ref:t,...i}))):L.createElement(yv,null,L.createElement(wv,{ref:t,open:r,...i}))}let VR="div";function zR(e,t){let n=g.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...s}=e,[{dialogState:o,unmount:a},l]=Yc("Dialog.Panel"),u=rn(t,l.panelRef),c=g.useMemo(()=>({open:o===0}),[o]),d=xe(S=>{S.stopPropagation()}),f={ref:u,id:r,onClick:d},h=i?qc:g.Fragment,m=i?{unmount:a}:{},y=st();return L.createElement(h,{...m},y({ourProps:f,theirProps:s,slot:c,defaultTag:VR,name:"Dialog.Panel"}))}let HR="div";function BR(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:s}]=Yc("Dialog.Backdrop"),o=g.useMemo(()=>({open:i===0}),[i]),a={ref:t,"aria-hidden":!0},l=n?qc:g.Fragment,u=n?{unmount:s}:{},c=st();return L.createElement(l,{...u},c({ourProps:a,theirProps:r,slot:o,defaultTag:HR,name:"Dialog.Backdrop"}))}let UR="h2";function WR(e,t){let n=g.useId(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:s,setTitleId:o}]=Yc("Dialog.Title"),a=rn(t);g.useEffect(()=>(o(r),()=>o(null)),[r,o]);let l=g.useMemo(()=>({open:s===0}),[s]),u={ref:a,id:r};return st()({ourProps:u,theirProps:i,slot:l,defaultTag:UR,name:"Dialog.Title"})}let GR=Ye(DR),B1=Ye(zR),ZR=Ye(BR),KR=Ye(WR),QR=Object.assign(GR,{Panel:B1,Title:KR,Description:l1}),qR="div";function YR(e,t){let n=`headlessui-control-${g.useId()}`,[r,i]=d1(),[s,o]=Kp(),a=pl(),{disabled:l=a||!1,...u}=e,c=g.useMemo(()=>({disabled:l}),[l]),d={ref:t,disabled:l||void 0,"aria-disabled":l||void 0},f=st();return L.createElement(pb,{value:l},L.createElement(i,{value:r},L.createElement(o,{value:s},L.createElement($b,{id:n},f({ourProps:d,theirProps:{...u,children:L.createElement(bb,null,typeof u.children=="function"?u.children(c):u.children)},slot:c,defaultTag:qR,name:"Field"})))))}let XR=Ye(YR),im=g.createContext(null);im.displayName="GroupContext";let JR=g.Fragment;function eM(e){var t;let[n,r]=g.useState(null),[i,s]=d1(),[o,a]=Kp(),l=g.useMemo(()=>({switch:n,setSwitch:r}),[n,r]),u={},c=e,d=st();return L.createElement(a,{name:"Switch.Description",value:o},L.createElement(s,{name:"Switch.Label",value:i,props:{htmlFor:(t=l.switch)==null?void 0:t.id,onClick(f){n&&(f.currentTarget instanceof HTMLLabelElement&&f.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},L.createElement(im.Provider,{value:l},d({ourProps:u,theirProps:c,slot:{},defaultTag:JR,name:"Switch.Group"}))))}let tM="button";function nM(e,t){var n;let r=g.useId(),i=s1(),s=pl(),{id:o=i||`headlessui-switch-${r}`,disabled:a=s||!1,checked:l,defaultChecked:u,onChange:c,name:d,value:f,form:h,autoFocus:m=!1,...y}=e,S=g.useContext(im),[v,w]=g.useState(null),x=g.useRef(null),_=rn(x,t,S===null?null:S.setSwitch,w),C=_b(u),[P,b]=Sb(l,c,C??!1),k=yo(),[M,$]=g.useState(!1),T=xe(()=>{$(!0),b==null||b(!P),k.nextFrame(()=>{$(!1)})}),O=xe(ce=>{if(Tb(ce.currentTarget))return ce.preventDefault();ce.preventDefault(),T()}),K=xe(ce=>{ce.key===tc.Space?(ce.preventDefault(),T()):ce.key===tc.Enter&&Cb(ce.currentTarget)}),U=xe(ce=>ce.preventDefault()),I=c1(),Z=Nb(),{isFocusVisible:ie,focusProps:j}=Kw({autoFocus:m}),{isHovered:A,hoverProps:B}=Zw({isDisabled:a}),{pressed:D,pressProps:q}=Qw({disabled:a}),se=g.useMemo(()=>({checked:P,disabled:a,hover:A,focus:ie,active:D,autofocus:m,changing:M}),[P,A,ie,D,a,M,m]),de=Xw({id:o,ref:_,role:"switch",type:sP(e,v),tabIndex:e.tabIndex===-1?0:(n=e.tabIndex)!=null?n:0,"aria-checked":P,"aria-labelledby":I,"aria-describedby":Z,disabled:a||void 0,autoFocus:m,onClick:O,onKeyUp:K,onKeyPress:U},j,B,q),ue=g.useCallback(()=>{if(C!==void 0)return b==null?void 0:b(C)},[b,C]),me=st();return L.createElement(L.Fragment,null,d!=null&&L.createElement(Rb,{disabled:a,data:{[d]:f||"on"},overrides:{type:"checkbox",checked:P},form:h,onReset:ue}),me({ourProps:de,theirProps:y,slot:se,defaultTag:tM,name:"Switch"}))}let rM=Ye(nM),iM=eM,sM=f1,oM=l1,aM=Object.assign(rM,{Group:iM,Label:sM,Description:oM});const uo={size:{xs:"rounded text-xs px-2 py-1",sm:"rounded text-sm px-2 py-1",md:"rounded-md text-sm px-2.5 py-1.5",lg:"rounded-md text-sm px-3 py-2",xl:"rounded-md text-sm px-3.5 py-2.5"},variant:{primary:"bg-indigo-600 text-white hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 disabled:bg-gray-300 disabled:text-gray-500 disabled:cursor-not-allowed",secondary:"bg-white text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 disabled:bg-gray-300 disabled:text-gray-500 disabled:cursor-not-allowed"}},co=g.forwardRef(({size:e="md",variant:t="primary",...n},r)=>{const i=uo.size[e],s=uo.variant[t];return p.jsx(Jw,{...n,ref:r,className:Be("px-2 py-1 font-semibold shadow-sm",i,s,n.className)})}),lM=g.forwardRef(({size:e="md",variant:t="primary",...n},r)=>{const i=uo.size[e],s=uo.variant[t];return p.jsx("a",{...n,ref:r,className:Be("inline-block cursor-pointer px-2 py-1 text-center font-semibold shadow-sm",i,s,n.className)})}),uM=g.forwardRef(({size:e="md",variant:t="primary",...n},r)=>{const i=uo.size[e],s=uo.variant[t];return p.jsx(Qr,{...n,ref:r,className:Be("inline-block cursor-pointer px-2 py-1 text-center font-semibold shadow-sm",i,s,n.className)})});function U1(){return p.jsxs("div",{className:"text-center",children:[p.jsx("p",{className:"text-base font-semibold",children:"404"}),p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:"Page not found"}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:"Sorry, we couldn't find the page you're looking for."}),p.jsx("p",{className:"flex justify-center",children:p.jsx("img",{src:Lw,className:"w-64"})}),p.jsx("div",{className:"mt-10 flex items-center justify-center gap-x-6",children:p.jsx(uM,{to:"/",size:"lg",children:"Go back home"})})]})}const Ns=new WeakMap,wu=new WeakMap,oc={current:[]};let Qd=!1,ha=0;const qo=new Set,ql=new Map;function W1(e){const t=Array.from(e).sort((n,r)=>n instanceof sr&&n.options.deps.includes(r)?1:r instanceof sr&&r.options.deps.includes(n)?-1:0);for(const n of t){if(oc.current.includes(n))continue;oc.current.push(n),n.recompute();const r=wu.get(n);if(r)for(const i of r){const s=Ns.get(i);s&&W1(s)}}}function cM(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}function dM(e){e.listeners.forEach(t=>t({prevVal:e.prevState,currentVal:e.state}))}function G1(e){if(ha>0&&!ql.has(e)&&ql.set(e,e.prevState),qo.add(e),!(ha>0)&&!Qd)try{for(Qd=!0;qo.size>0;){const t=Array.from(qo);qo.clear();for(const n of t){const r=ql.get(n)??n.prevState;n.prevState=r,cM(n)}for(const n of t){const r=Ns.get(n);r&&(oc.current.push(n),W1(r))}for(const n of t){const r=Ns.get(n);if(r)for(const i of r)dM(i)}}}finally{Qd=!1,oc.current=[],ql.clear()}}function wr(e){ha++;try{e()}finally{if(ha--,ha===0){const t=Array.from(qo)[0];t&&G1(t)}}}class Rh{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var i,s;this.listeners.add(r);const o=(s=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:s.call(i,r,this);return()=>{this.listeners.delete(r),o==null||o()}},this.setState=r=>{var i,s,o;this.prevState=this.state,this.state=(i=this.options)!=null&&i.updateFn?this.options.updateFn(this.prevState)(r):r(this.prevState),(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),G1(this)},this.prevState=t,this.state=t,this.options=n}}class sr{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=[],r=[];for(const i of this.options.deps)n.push(i.prevState),r.push(i.state);return this.lastSeenDepValues=r,{prevDepVals:n,currDepVals:r,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,r;this.prevState=this.state;const{prevDepVals:i,currDepVals:s,prevVal:o}=this.getDepVals();this.state=this.options.fn({prevDepVals:i,currDepVals:s,prevVal:o}),(r=(n=this.options).onUpdate)==null||r.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const s of this.options.deps)s instanceof sr&&s.checkIfRecalculationNeededDeeply();let n=!1;const r=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let s=0;s(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var r,i;this.listeners.add(n);const s=(i=(r=this.options).onSubscribe)==null?void 0:i.call(r,n,this);return()=>{this.listeners.delete(n),s==null||s()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const n of t)if(n instanceof sr)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof Rh){let r=Ns.get(n);r||(r=new Set,Ns.set(n,r)),r.add(this);let i=wu.get(this);i||(i=new Set,wu.set(this,i)),i.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof sr)this.unregisterFromGraph(n.options.deps);else if(n instanceof Rh){const r=Ns.get(n);r&&r.delete(this);const i=wu.get(this);i&&i.delete(n)}}}function Xc(e,t){return typeof e=="function"?e(t):e}function Z1(e,t){return sm(t).reduce((r,i)=>{if(r===null)return null;if(typeof r<"u")return r[i]},e)}function qd(e,t,n){const r=sm(t);function i(s){if(!r.length)return Xc(n,s);const o=r.shift();if(typeof o=="string"||typeof o=="number"&&!Array.isArray(s))return typeof s=="object"?(s===null&&(s={}),{...s,[o]:i(s[o])}):{[o]:i()};if(Array.isArray(s)&&typeof o=="number"){const a=s.slice(0,o);return[...a.length?a:new Array(o),i(s[o]),...s.slice(o+1)]}return[...new Array(o),i()]}return i(e)}function fM(e,t){const n=sm(t);function r(i){if(!i)return;if(n.length===1){const o=n[0];if(Array.isArray(i)&&typeof o=="number")return i.filter((u,c)=>c!==o);const{[o]:a,...l}=i;return l}const s=n.shift();if(typeof s=="string"&&typeof i=="object")return{...i,[s]:r(i[s])};if(typeof s=="number"&&Array.isArray(i)){if(s>=i.length)return i;const o=i.slice(0,s);return[...o.length?o:new Array(s),r(i[s]),...i.slice(s+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return r(e)}const hM=/^(\d*)$/gm,pM=/\.(\d*)\./gm,mM=/^(\d*)\./gm,gM=/\.(\d*$)/gm,vM=/\.{2,}/gm,Mh="__int__",Yl=`${Mh}$1`;function sm(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replaceAll("[",".").replaceAll("]","").replace(hM,Yl).replace(pM,`.${Yl}.`).replace(mM,`${Yl}.`).replace(gM,`.${Yl}`).replace(vM,".").split(".").map(t=>t.indexOf(Mh)===0?parseInt(t.substring(Mh.length),10):t)}function yM(e){return!(Array.isArray(e)&&e.length===0)}function $h(e,t){const{asyncDebounceMs:n}=t,{onChangeAsync:r,onBlurAsync:i,onSubmitAsync:s,onBlurAsyncDebounceMs:o,onChangeAsyncDebounceMs:a}=t.validators||{},l=n??0,u={cause:"change",validate:r,debounceMs:a??l},c={cause:"blur",validate:i,debounceMs:o??l},d={cause:"submit",validate:s,debounceMs:0},f=h=>({...h,debounceMs:0});switch(e){case"submit":return[f(u),f(c),d];case"blur":return[c];case"change":return[u];case"server":default:return[]}}function Th(e,t){const{onChange:n,onBlur:r,onSubmit:i,onMount:s}=t.validators||{},o={cause:"change",validate:n},a={cause:"blur",validate:r},l={cause:"submit",validate:i},u={cause:"mount",validate:s},c={cause:"server",validate:()=>{}};switch(e){case"mount":return[u];case"submit":return[o,a,l,c];case"server":return[c];case"blur":return[a,c];case"change":default:return[o,c]}}function wM(e,t){const n=new Map;for(const i of e){const s=[...i.path??[]].map(o=>{const a=typeof o=="object"?o.key:o;return typeof a=="number"?`[${a}]`:a}).join(".").replace(/\.\[/g,"[");n.set(s,(n.get(s)??[]).concat(i))}const r={};return n.forEach((i,s)=>{r[s]=t(i)}),r}function xM(e){return t=>({form:e(t),fields:wM(t,e)})}const K1=(e={})=>()=>{const t=e.transformErrors??(r=>r.map(i=>i.message).join(", ")),n=r=>r==="form"?xM(t):t;return{validate({value:r,validationSource:i},s){const o=s["~standard"].validate(r);if(o instanceof Promise)throw new Error("async function passed to sync validator");return o.issues?n(i)(o.issues):void 0},async validateAsync({value:r,validationSource:i},s){const o=await s["~standard"].validate(r);return o.issues?n(i)(o.issues):void 0}}},Q1=e=>!!e&&"~standard"in e;function Yd(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}}}const SM=e=>typeof e=="object";class _M{constructor(t){var n;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const r=this.fieldMetaDerived.mount(),i=this.store.mount(),s=()=>{r(),i()},{onMount:o}=this.options.validators||{};return o&&this.validateSync("mount"),s},this.update=r=>{if(!r)return;const i=this.options;this.options=r,wr(()=>{const s=r.defaultValues&&r.defaultValues!==i.defaultValues&&!this.state.isTouched,o=r.defaultState!==i.defaultState&&!this.state.isTouched;this.baseStore.setState(()=>Yd(Object.assign({},this.state,o?r.defaultState:{},s?{values:r.defaultValues}:{})))})},this.reset=(r,i)=>{const{fieldMeta:s}=this.state,o=this.resetFieldMeta(s);r&&!(i!=null&&i.keepDefaultValues)&&(this.options={...this.options,defaultValues:r}),this.baseStore.setState(()=>{var a;return Yd({...this.options.defaultState,values:r??this.options.defaultValues??((a=this.options.defaultState)==null?void 0:a.values),fieldMetaBase:o})})},this.validateAllFields=async r=>{const i=[];return wr(()=>{Object.values(this.fieldInfo).forEach(o=>{if(!o.instance)return;const a=o.instance;i.push(Promise.resolve().then(()=>a.validate(r))),o.instance.state.meta.isTouched||o.instance.setMeta(l=>({...l,isTouched:!0}))})}),(await Promise.all(i)).flat()},this.validateArrayFieldsStartingFrom=async(r,i,s)=>{const o=this.getFieldValue(r),a=Array.isArray(o)?Math.max(o.length-1,0):null,l=[`${r}[${i}]`];for(let f=i+1;f<=(a??0);f++)l.push(`${r}[${f}]`);const u=Object.keys(this.fieldInfo).filter(f=>l.some(h=>f.startsWith(h))),c=[];return wr(()=>{u.forEach(f=>{c.push(Promise.resolve().then(()=>this.validateField(f,s)))})}),(await Promise.all(c)).flat()},this.validateField=(r,i)=>{var s;const o=(s=this.fieldInfo[r])==null?void 0:s.instance;return o?(o.state.meta.isTouched||o.setMeta(a=>({...a,isTouched:!0})),o.validate(i)):[]},this.validateSync=r=>{const i=Th(r,this.options);let s=!1;const o={};wr(()=>{for(const l of i){if(!l.validate)continue;const u=this.runValidator({validate:l.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:c,fieldErrors:d}=jh(u),f=Xl(l.cause);if(d)for(const[h,m]of Object.entries(d)){const S={...o[h]||{},[f]:m};o[h]=S;const v=this.getFieldMeta(h);v&&v.errorMap[f]!==m&&this.setFieldMeta(h,w=>({...w,errorMap:{...w.errorMap,[f]:m}}))}this.state.errorMap[f]!==c&&this.baseStore.setState(h=>({...h,errorMap:{...h.errorMap,[f]:c}})),(c||d)&&(s=!0)}});const a=Xl("submit");return this.state.errorMap[a]&&r!=="submit"&&!s&&this.baseStore.setState(l=>({...l,errorMap:{...l.errorMap,[a]:void 0}})),{hasErrored:s,fieldsErrorMap:o}},this.validateAsync=async r=>{const i=$h(r,this.options);this.state.isFormValidating||this.baseStore.setState(u=>({...u,isFormValidating:!0}));const s=[];let o;for(const u of i){if(!u.validate)continue;const c=Xl(u.cause),d=this.state.validationMetaMap[c];d==null||d.lastAbortController.abort();const f=new AbortController;this.state.validationMetaMap[c]={lastAbortController:f},s.push(new Promise(async h=>{let m;try{m=await new Promise((w,x)=>{setTimeout(async()=>{if(f.signal.aborted)return w(void 0);try{w(await this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:f.signal},type:"validateAsync"}))}catch(_){x(_)}},u.debounceMs)})}catch(w){m=w}const{formError:y,fieldErrors:S}=jh(m);S&&(o=o?{...o,...S}:S);const v=Xl(u.cause);if(o)for(const[w,x]of Object.entries(o)){const _=this.getFieldMeta(w);_&&_.errorMap[v]!==x&&this.setFieldMeta(w,C=>({...C,errorMap:{...C.errorMap,[v]:x}}))}this.baseStore.setState(w=>({...w,errorMap:{...w.errorMap,[v]:y}})),h(o?{fieldErrors:o,errorMapKey:v}:void 0)}))}let a=[];const l={};if(s.length){a=await Promise.all(s);for(const u of a)if(u!=null&&u.fieldErrors){const{errorMapKey:c}=u;for(const[d,f]of Object.entries(u.fieldErrors)){const m={...l[d]||{},[c]:f};l[d]=m}}}return this.baseStore.setState(u=>({...u,isFormValidating:!1})),l},this.validate=r=>{const{hasErrored:i,fieldsErrorMap:s}=this.validateSync(r);return i&&!this.options.asyncAlways?s:this.validateAsync(r)},this.handleSubmit=async()=>{var r,i,s,o;if(this.baseStore.setState(l=>({...l,isSubmitted:!1,submissionAttempts:l.submissionAttempts+1})),!this.state.canSubmit)return;this.baseStore.setState(l=>({...l,isSubmitting:!0}));const a=()=>{this.baseStore.setState(l=>({...l,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isValid){a(),(i=(r=this.options).onSubmitInvalid)==null||i.call(r,{value:this.state.values,formApi:this});return}wr(()=>{Object.values(this.fieldInfo).forEach(l=>{var u,c,d;(d=(c=(u=l.instance)==null?void 0:u.options.listeners)==null?void 0:c.onSubmit)==null||d.call(c,{value:l.instance.state.value,fieldApi:l.instance})})});try{await((o=(s=this.options).onSubmit)==null?void 0:o.call(s,{value:this.state.values,formApi:this})),wr(()=>{this.baseStore.setState(l=>({...l,isSubmitted:!0})),a()})}catch(l){throw a(),l}},this.getFieldValue=r=>Z1(this.state.values,r),this.getFieldMeta=r=>this.state.fieldMeta[r],this.getFieldInfo=r=>{var i;return(i=this.fieldInfo)[r]||(i[r]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}})},this.setFieldMeta=(r,i)=>{this.baseStore.setState(s=>({...s,fieldMetaBase:{...s.fieldMetaBase,[r]:Xc(i,s.fieldMetaBase[r])}}))},this.resetFieldMeta=r=>Object.keys(r).reduce((i,s)=>{const o=s;return i[o]={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{}},i},{}),this.setFieldValue=(r,i,s)=>{const o=(s==null?void 0:s.dontUpdateMeta)??!1;wr(()=>{o||this.setFieldMeta(r,a=>({...a,isTouched:!0,isDirty:!0,errorMap:{...a==null?void 0:a.errorMap,onMount:void 0}})),this.baseStore.setState(a=>({...a,values:qd(a.values,r,i)}))})},this.deleteField=r=>{this.baseStore.setState(i=>{const s={...i};return s.values=fM(s.values,r),delete s.fieldMetaBase[r],s}),delete this.fieldInfo[r]},this.pushFieldValue=(r,i,s)=>{this.setFieldValue(r,o=>[...Array.isArray(o)?o:[],i],s),this.validateField(r,"change")},this.insertFieldValue=async(r,i,s,o)=>{this.setFieldValue(r,a=>[...a.slice(0,i),s,...a.slice(i)],o),await this.validateField(r,"change")},this.replaceFieldValue=async(r,i,s,o)=>{this.setFieldValue(r,a=>a.map((l,u)=>u===i?s:l),o),await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,i,"change")},this.removeFieldValue=async(r,i,s)=>{const o=this.getFieldValue(r),a=Array.isArray(o)?Math.max(o.length-1,0):null;if(this.setFieldValue(r,l=>l.filter((u,c)=>c!==i),s),a!==null){const l=`${r}[${a}]`;Object.keys(this.fieldInfo).filter(c=>c.startsWith(l)).forEach(c=>this.deleteField(c))}await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,i,"change")},this.swapFieldValues=(r,i,s,o)=>{this.setFieldValue(r,a=>{const l=a[i],u=a[s];return qd(qd(a,`${i}`,u),`${s}`,l)},o),this.validateField(r,"change"),this.validateField(`${r}[${i}]`,"change"),this.validateField(`${r}[${s}]`,"change")},this.moveFieldValues=(r,i,s,o)=>{this.setFieldValue(r,a=>(a.splice(s,0,a.splice(i,1)[0]),a),o),this.validateField(r,"change"),this.validateField(`${r}[${i}]`,"change"),this.validateField(`${r}[${s}]`,"change")},this.baseStore=new Rh(Yd({...t==null?void 0:t.defaultState,values:(t==null?void 0:t.defaultValues)??((n=t==null?void 0:t.defaultState)==null?void 0:n.values),isFormValid:!0})),this.fieldMetaDerived=new sr({deps:[this.baseStore],fn:({prevDepVals:r,currDepVals:i,prevVal:s})=>{var o;const a=s,l=r==null?void 0:r[0],u=i[0],c={};for(const d of Object.keys(u.fieldMetaBase)){const f=u.fieldMetaBase[d],h=l==null?void 0:l.fieldMetaBase[d];let m=(o=a==null?void 0:a[d])==null?void 0:o.errors;(!h||f.errorMap!==h.errorMap)&&(m=Object.values(f.errorMap??{}).filter(S=>S!==void 0));const y=!f.isDirty;c[d]={...f,errors:m,isPristine:y}}return c}}),this.store=new sr({deps:[this.baseStore,this.fieldMetaDerived],fn:({prevDepVals:r,currDepVals:i,prevVal:s})=>{var o,a,l,u;const c=s,d=r==null?void 0:r[0],f=i[0],h=Object.values(f.fieldMetaBase),m=h.some(I=>I==null?void 0:I.isValidating),y=!h.some(I=>(I==null?void 0:I.errorMap)&&yM(Object.values(I.errorMap).filter(Boolean))),S=h.some(I=>I==null?void 0:I.isTouched),v=h.some(I=>I==null?void 0:I.isBlurred),w=S&&((o=f==null?void 0:f.errorMap)==null?void 0:o.onMount),x=h.some(I=>I==null?void 0:I.isDirty),_=!x,C=!!((a=f.errorMap)!=null&&a.onMount||h.some(I=>{var Z;return(Z=I==null?void 0:I.errorMap)==null?void 0:Z.onMount})),P=!!m;let b=(c==null?void 0:c.errors)??[];(!d||f.errorMap!==d.errorMap)&&(b=Object.values(f.errorMap).reduce((I,Z)=>Z===void 0?I:typeof Z=="string"?(I.push(Z),I):(Z&&SM(Z)&&I.push(Z.form),I),[]));const k=b.length===0,M=y&&k,$=f.submissionAttempts===0&&!S&&!C||!P&&!f.isSubmitting&&M;let T=f.errorMap;w&&(b=b.filter(I=>I!==f.errorMap.onMount),T=Object.assign(T,{onMount:void 0}));let O={...f,errorMap:T,fieldMeta:this.fieldMetaDerived.state,errors:b,isFieldsValidating:m,isFieldsValid:y,isFormValid:k,isValid:M,canSubmit:$,isTouched:S,isBlurred:v,isPristine:_,isDirty:x};const K=((l=this.options.transform)==null?void 0:l.deps)??[];if(K.length!==this.prevTransformArray.length||K.some((I,Z)=>I!==this.prevTransformArray[Z])){const I=Object.assign({},this,{state:O});(u=this.options.transform)==null||u.fn(I),O=I.state,this.prevTransformArray=K}return O}}),this.update(t||{})}get state(){return this.store.state}runValidator(t){const n=this.options.validatorAdapter;return n&&(typeof t.validate!="function"||"~standard"in t.validate)?n()[t.type](t.value,t.validate):Q1(t.validate)?K1()()[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.baseStore.setState(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function jh(e){if(e){if(typeof e=="object"){const t=jh(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return typeof e!="string"?{formError:"Invalid Form Values"}:{formError:e}}return{formError:void 0}}function Xl(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}class CM{constructor(t){this.options={},this.mount=()=>{var n,r;const i=this.store.mount(),s=this.getInfo();s.instance=this,this.update(this.options);const{onMount:o}=this.options.validators||{};if(o){const a=this.runValidator({validate:o,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});a&&this.setMeta(l=>({...l,errorMap:{...l==null?void 0:l.errorMap,onMount:a}}))}return(r=(n=this.options.listeners)==null?void 0:n.onMount)==null||r.call(n,{value:this.state.value,fieldApi:this}),i},this.update=n=>{if(this.state.value===void 0){const r=Z1(n.form.options.defaultValues,n.name);n.defaultValue!==void 0?this.setValue(n.defaultValue,{dontUpdateMeta:!0}):r!==void 0&&this.setValue(r,{dontUpdateMeta:!0})}this.form.getFieldMeta(this.name)===void 0&&this.setMeta(this.state.meta),this.options=n},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,r)=>{var i,s;this.form.setFieldValue(this.name,n,r),(s=(i=this.options.listeners)==null?void 0:i.onChange)==null||s.call(i,{value:this.state.value,fieldApi:this}),this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=n=>this.form.setFieldMeta(this.name,n),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(n,r)=>this.form.pushFieldValue(this.name,n,r),this.insertValue=(n,r,i)=>this.form.insertFieldValue(this.name,n,r,i),this.replaceValue=(n,r,i)=>this.form.replaceFieldValue(this.name,n,r,i),this.removeValue=(n,r)=>this.form.removeFieldValue(this.name,n,r),this.swapValues=(n,r,i)=>this.form.swapFieldValues(this.name,n,r,i),this.moveValue=(n,r,i)=>this.form.moveFieldValues(this.name,n,r,i),this.getLinkedFields=n=>{const r=Object.values(this.form.fieldInfo),i=[];for(const s of r){if(!s.instance)continue;const{onChangeListenTo:o,onBlurListenTo:a}=s.instance.options.validators||{};n==="change"&&(o!=null&&o.includes(this.name))&&i.push(s.instance),n==="blur"&&(a!=null&&a.includes(this.name))&&i.push(s.instance)}return i},this.validateSync=(n,r)=>{const i=Th(n,this.options),o=this.getLinkedFields(n).reduce((u,c)=>{const d=Th(n,c.options);return d.forEach(f=>{f.field=c}),u.concat(d)},[]);let a=!1;wr(()=>{const u=(c,d)=>{const f=Do(d.cause),h=d.validate?xv(c.runValidator({validate:d.validate,value:{value:c.store.state.value,validationSource:"field",fieldApi:c},type:"validate"})):r[f];c.state.meta.errorMap[f]!==h&&c.setMeta(m=>({...m,errorMap:{...m.errorMap,[Do(d.cause)]:h||r[f]}})),(h||r[f])&&(a=!0)};for(const c of i)u(this,c);for(const c of o)c.validate&&u(c.field,c)});const l=Do("submit");return this.state.meta.errorMap[l]&&n!=="submit"&&!a&&this.setMeta(u=>({...u,errorMap:{...u.errorMap,[l]:void 0}})),{hasErrored:a}},this.validateAsync=async(n,r)=>{const i=$h(n,this.options),s=await r,o=this.getLinkedFields(n),a=o.reduce((f,h)=>{const m=$h(n,h.options);return m.forEach(y=>{y.field=h}),f.concat(m)},[]);this.state.meta.isValidating||this.setMeta(f=>({...f,isValidating:!0}));for(const f of o)f.setMeta(h=>({...h,isValidating:!0}));const l=[],u=[],c=(f,h,m)=>{const y=Do(h.cause),S=f.getInfo().validationMetaMap[y];S==null||S.lastAbortController.abort();const v=new AbortController;this.getInfo().validationMetaMap[y]={lastAbortController:v},m.push(new Promise(async w=>{var x;let _;try{_=await new Promise((k,M)=>{this.timeoutIds[h.cause]&&clearTimeout(this.timeoutIds[h.cause]),this.timeoutIds[h.cause]=setTimeout(async()=>{if(v.signal.aborted)return k(void 0);try{k(await this.runValidator({validate:h.validate,value:{value:f.store.state.value,fieldApi:f,signal:v.signal,validationSource:"field"},type:"validateAsync"}))}catch($){M($)}},h.debounceMs)})}catch(k){_=k}if(v.signal.aborted)return w(void 0);const C=xv(_),P=(x=s[this.name])==null?void 0:x[y],b=C||P;f.setMeta(k=>({...k,errorMap:{...k==null?void 0:k.errorMap,[y]:b}})),w(b)}))};for(const f of i)f.validate&&c(this,f,l);for(const f of a)f.validate&&c(f.field,f,u);let d=[];(l.length||u.length)&&(d=await Promise.all(l),await Promise.all(u)),this.setMeta(f=>({...f,isValidating:!1}));for(const f of o)f.setMeta(h=>({...h,isValidating:!1}));return d.filter(Boolean)},this.validate=n=>{var r;if(!this.state.meta.isTouched)return[];const{fieldsErrorMap:i}=this.form.validateSync(n),{hasErrored:s}=this.validateSync(n,i[this.name]??{});if(s&&!this.options.asyncAlways)return(r=this.getInfo().validationMetaMap[Do(n)])==null||r.lastAbortController.abort(),this.state.meta.errors;const o=this.form.validateAsync(n);return this.validateAsync(n,o)},this.handleChange=n=>{this.setValue(n)},this.handleBlur=()=>{var n,r;this.state.meta.isTouched||(this.setMeta(s=>({...s,isTouched:!0})),this.validate("change")),this.state.meta.isBlurred||this.setMeta(s=>({...s,isBlurred:!0})),this.validate("blur"),(r=(n=this.options.listeners)==null?void 0:n.onBlur)==null||r.call(n,{value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.timeoutIds={},t.defaultValue!==void 0&&this.form.setFieldValue(this.name,t.defaultValue,{dontUpdateMeta:!0}),this.store=new sr({deps:[this.form.store],fn:()=>{const n=this.form.getFieldValue(this.name),r=this.form.getFieldMeta(this.name)??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...t.defaultMeta};return{value:n,meta:r}}}),this.options=t}get state(){return this.store.state}runValidator(t){const n=[this.form.options.validatorAdapter,this.options.validatorAdapter];for(const r of n)if(r&&(typeof t.validate!="function"||"~standard"in t.validate))return r()[t.type](t.value,t.validate);return Q1(t.validate)?K1()()[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function xv(e){if(e)return typeof e!="string"?"Invalid Form Values":e}function Do(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}function om(e,t=n=>n){return Sy.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,EM)}function EM(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r{const r=new CM({...e,form:e.form,name:e.name});return r.Field=q1,r});return ac(t.mount,[t]),ac(()=>{t.update(e)}),om(t.store,e.mode==="array"?n=>[n.meta,Object.keys(n.value??[]).length]:void 0),t}const q1=({children:e,...t})=>{const n=kM(t),r=g.useMemo(()=>Xc(e,n),[e,n,n.state.value,n.state.meta]);return p.jsx(p.Fragment,{children:r})};function bM({form:e,selector:t,children:n}){const r=om(e.store,t);return Xc(n,r)}function PM(e){const[t]=g.useState(()=>{const n=new _M(e),r=n;return r.Field=function(s){return p.jsx(q1,{...s,form:n})},r.Subscribe=i=>p.jsx(bM,{form:n,selector:i.selector,children:i.children}),r});return ac(t.mount,[]),om(t.store,n=>n.isSubmitting),ac(()=>{t.update(e)}),t}function RM({startAdornment:e,endAdornment:t,name:n,...r}){return p.jsxs("div",{className:"flex items-center rounded-md bg-primary-light pl-3 pr-3 outline outline-1 -outline-offset-1 outline-primary focus-within:outline focus-within:outline-2 focus-within:-outline-offset-2 focus-within:outline-focus",children:[e&&p.jsx("div",{className:"shrink-0 select-none text-base text-primary-light sm:text-sm/6",children:e}),p.jsx("input",{name:n,className:"block min-w-0 grow bg-primary-light py-1.5 pl-1 pr-3 text-base text-primary placeholder:text-primary-light focus:outline focus:outline-0 sm:text-sm/6",...r}),t&&p.jsx("div",{className:"shrink-0 select-none text-base text-primary-light sm:text-sm/6",children:t})]})}function lc({icon:e,label:t,...n}){return p.jsx(Jw,{...n,"aria-label":t,className:"rounded-full text-primary-light hover:text-primary-dark",onClick:r=>{var i;(i=n.onClick)==null||i.call(n,r),r.preventDefault(),r.stopPropagation()},children:e})}function Y1(e,t){localStorage.setItem(e,JSON.stringify(t))}function MM(e){const t=localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return console.error(`Failed to parse localStorage item for key "${e}"`),null}}function $M(){const[e,t]=g.useState(!1),n=dr(),r=hy(),i=PM({defaultValues:{token:""},onSubmit:({value:s})=>{Y1("token",s.token),r.removeQueries(),n.invalidate()}});return p.jsxs("form",{onSubmit:s=>{s.preventDefault(),s.stopPropagation(),i.handleSubmit()},className:"flex gap-2",children:[p.jsx(i.Field,{name:"token",validators:{onChange:s=>{if(!s)return"Token is required"}},children:s=>p.jsx(RM,{required:!0,name:s.name,type:e?"text":"password",autoComplete:"off",autoCorrect:"off",placeholder:"API token",startAdornment:p.jsx(Dk,{}),value:s.state.value,onBlur:s.handleBlur,onChange:o=>s.handleChange(o.target.value),endAdornment:p.jsx(lc,{label:"Show password",icon:e?p.jsx(Lk,{}):p.jsx(Ak,{}),onClick:()=>t(o=>!o)})})}),p.jsx(co,{type:"submit",variant:"primary",children:"Submit"})]})}class X1 extends Error{constructor(n,r,i){super(i);gr(this,"method");gr(this,"url");this.name="APIError",this.method=n,this.url=r,Object.setPrototypeOf(this,new.target.prototype)}}class am extends X1{constructor(n,r,i,s){super(n,r,i);gr(this,"originalError");this.originalError=s}}class Jc extends X1{constructor(n,r,i,s){super(n,r,i);gr(this,"code");this.code=s,this.name="APIResponseError"}}class ed extends Jc{constructor(t,n){super(t,n,"Unauthorized",401),this.name="APIResponseUnauthorizedError"}}class J1 extends Jc{constructor(t,n){super(t,n,"Forbiden",403),this.name="APIResponseForbiddenError"}}class ex extends Jc{constructor(t,n){super(t,n,"Not found",404),this.name="APIResponseNotFoundError"}}class tx extends Jc{constructor(t,n){super(t,n,"Internal server error",500),this.name="APIInternalError"}}const lm="";async function Yi(e,t){const n=`${lm}${e}`,r=(t==null?void 0:t.method)??"GET",i=MM("token");i&&(t={...t,headers:{...t==null?void 0:t.headers,Authorization:`Bearer ${i}`}});try{const s=await fetch(n,t);switch(s.status){case 401:throw new ed(r,n);case 403:throw new J1(r,n);case 404:throw new ex(r,n);case 500:throw new tx(r,n)}return s}catch(s){throw s instanceof TypeError&&s.message.includes("NetworkError")?new am(r,n,"Network error",s):s}}function TM({title:e,titleId:t,...n},r){return g.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?g.createElement("title",{id:t},e):null,g.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const jM=g.forwardRef(TM);function FM({title:e,titleId:t,...n},r){return g.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?g.createElement("title",{id:t},e):null,g.createElement("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const NM=g.forwardRef(FM);function IM({title:e,titleId:t,...n},r){return g.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?g.createElement("title",{id:t},e):null,g.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const OM=g.forwardRef(IM);function LM({title:e,titleId:t,...n},r){return g.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?g.createElement("title",{id:t},e):null,g.createElement("path",{fillRule:"evenodd",d:"M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z",clipRule:"evenodd"}))}const AM=g.forwardRef(LM);function DM({title:e,titleId:t,...n},r){return g.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?g.createElement("title",{id:t},e):null,g.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))}const VM=g.forwardRef(DM);function zM({title:e,titleId:t,...n},r){return g.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?g.createElement("title",{id:t},e):null,g.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z",clipRule:"evenodd"}))}const HM=g.forwardRef(zM),td={error:{style:{background:"bg-error",text:"text-contrast-error"},icon:p.jsx(HM,{"aria-hidden":"true",className:"size-5 text-red-400"})},warning:{style:{background:"bg-warning",text:"text-contrast-warning"},icon:p.jsx(OM,{"aria-hidden":"true",className:"size-5 text-contrast-warning"})},info:{style:{background:"bg-info",text:"text-contrast-info"},icon:p.jsx(VM,{"aria-hidden":"true",className:"size-5 text-contrast-info"})},success:{style:{background:"bg-success",text:"text-contrast-success"},icon:p.jsx(jM,{"aria-hidden":"true",className:"size-5 text-contrast-success"})}},nd=g.createContext(void 0);function pa({level:e,children:t}){const n=td[e];return p.jsx(nd.Provider,{value:e,children:p.jsx("div",{className:Be("rounded-md p-4",n.style.background),children:p.jsxs("div",{className:"flex",children:[p.jsx("div",{className:"shrink-0",children:n.icon}),p.jsx("div",{className:"ml-3",children:t})]})})})}function ma({children:e}){const t=g.useContext(nd),n=td[t];return p.jsx("h3",{className:Be("text-left text-sm font-medium",n.style.text),children:e})}function um({children:e}){const t=g.useContext(nd),n=td[t];return p.jsx("div",{className:Be("mt-2 text-left text-sm",n.style.text),children:e})}function BM({children:e}){const t=g.useContext(nd),n=td[t];return p.jsx("div",{className:Be("mt-2 text-sm",n.style.text),children:p.jsx("ul",{role:"list",className:"list-disc space-y-1 pl-5",children:e})})}function UM({children:e}){return p.jsx("li",{children:e})}function WM({children:e}){return p.jsx("div",{className:"mt-4",children:p.jsx("div",{className:"-mx-2 -my-1.5 flex gap-2",children:e})})}function GM({error:e}){return e instanceof ex?p.jsx(U1,{}):p.jsx("div",{className:"relative isolate pt-14",children:p.jsx("div",{className:"py-24 sm:py-32 lg:pb-40",children:p.jsx("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:e instanceof am?p.jsx(KM,{error:e}):e instanceof tx?p.jsx(QM,{}):e instanceof ed?p.jsx(Sv,{error:e}):e instanceof J1?p.jsx(Sv,{error:e}):p.jsx(ZM,{error:e})})})})}function ZM({error:e}){const t=new URLSearchParams({title:"Unexpected error on Plakar UI",body:`\`\`\` ${e.name}: ${e.message} -${e.stack}\`\`\``});return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:p.jsx("div",{className:"flex items-center justify-center gap-2",children:"Oops, something went wrong (and it's our fault)"})}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:"You should never have seen this page: we failed to catch an error and this fallback error is displayed. We would appreciate if you could fill a bug report with the error message below, and possibly everything we need to reproduce the issue."}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:p.jsx("a",{target:"_blank",href:`https://github.com/PlakarKorp/plakar/issues/new?${t.toString()}`,className:"text-4xl text-blue-500 underline",children:"Click to send a bug report on GitHub"})})]}),p.jsxs("pre",{className:"mt-8 w-full overflow-auto border p-2",children:[e.name,": ",e.message,p.jsx("br",{}),p.jsx("br",{}),e.stack]})]})}function KM({error:e}){return new URL(e.url),p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:"Network error"}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:"Unable to establish a connection to the Plakar API. Please verify that the API service is still running."})]}),p.jsx("div",{className:"mt-16 flow-root sm:mt-24",children:!1})]})}function QM(){const e=new URLSearchParams({title:"Plakar API returned HTTP/500",body:"The Plakar API returned a HTTP/500 Internal Server Error response. To reproduce the issue, …"});return p.jsx(p.Fragment,{children:p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:p.jsxs("div",{className:"flex items-center justify-center gap-2",children:[p.jsx(Gp,{size:64}),"Internal error"]})}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:"The Plakar API encountered an unexpected HTTP/500 Internal Server Error. This shouldn't happen, and it's something we need to fix. We'd greatly appreciate it if you could submit a bug report with details to help us reproduce and resolve the issue. Thank you!"}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:p.jsx("a",{target:"_blank",href:`https://github.com/PlakarKorp/plakar/issues/new?${e.toString()}`,className:"text-4xl text-blue-500 underline",children:"Click to send a bug report on GitHub"})})]})})}function Sv({error:e}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:p.jsxs("div",{className:"flex items-center justify-center gap-2",children:[p.jsx(Vk,{size:64}),"Invalid token"]})}),p.jsxs("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:["The Plakar API returned a"," ",p.jsxs("span",{className:"text-nowrap",children:["HTTP/",e.code," ",e.message]})," ","response. It usually means that the token stored in the local storage of your browser is invalid or missing. Use the form below to enter a valid token."]})]}),p.jsx("div",{className:"mt-8 flex justify-center",children:p.jsx($M,{})})]})}const qM={size:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8"}};function rd({size:e="md"}){return p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx("div",{className:Be(qM.size[e],"animate-spin rounded-full border-4 border-blue-500 border-t-transparent")})})}var ve;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));var Fh;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Fh||(Fh={}));const H=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),br=e=>{switch(typeof e){case"undefined":return H.undefined;case"string":return H.string;case"number":return isNaN(e)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":return Array.isArray(e)?H.array:e===null?H.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?H.promise:typeof Map<"u"&&e instanceof Map?H.map:typeof Set<"u"&&e instanceof Set?H.set:typeof Date<"u"&&e instanceof Date?H.date:H.object;default:return H.unknown}},N=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),YM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Dt extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Dt.create=e=>new Dt(e);const fo=(e,t)=>{let n;switch(e.code){case N.invalid_type:e.received===H.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case N.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ve.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:n=`Unrecognized key(s) in object: ${ve.joinValues(e.keys,", ")}`;break;case N.invalid_union:n="Invalid input";break;case N.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ve.joinValues(e.options)}`;break;case N.invalid_enum_value:n=`Invalid enum value. Expected ${ve.joinValues(e.options)}, received '${e.received}'`;break;case N.invalid_arguments:n="Invalid function arguments";break;case N.invalid_return_type:n="Invalid function return type";break;case N.invalid_date:n="Invalid date";break;case N.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ve.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case N.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case N.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case N.custom:n="Invalid input";break;case N.invalid_intersection_types:n="Intersection results could not be merged";break;case N.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case N.not_finite:n="Number must be finite";break;default:n=t.defaultError,ve.assertNever(e)}return{message:n}};let nx=fo;function XM(e){nx=e}function uc(){return nx}const cc=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}},JM=[];function V(e,t){const n=uc(),r=cc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fo?void 0:fo].filter(i=>!!i)});e.common.issues.push(r)}class pt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return J;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return pt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return J;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const J=Object.freeze({status:"aborted"}),Cs=e=>({status:"dirty",value:e}),_t=e=>({status:"valid",value:e}),Nh=e=>e.status==="aborted",Ih=e=>e.status==="dirty",Aa=e=>e.status==="valid",Da=e=>typeof Promise<"u"&&e instanceof Promise;function dc(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function rx(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Q;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Q||(Q={}));var Yo,Xo;class zn{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _v=(e,t)=>{if(Aa(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Dt(e.common.issues);return this._error=n,this._error}}};function ae(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{var l,u;const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}},description:i}}class le{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return br(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:br(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new pt,ctx:{common:t.parent.common,data:t.data,parsedType:br(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Da(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:br(t)},s=this._parseSync({data:t,path:i.path,parent:i});return _v(i,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:br(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Da(i)?i:Promise.resolve(i));return _v(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:N.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Cn({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Dn.create(this,this._def)}nullable(){return ti.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yn.create(this,this._def)}promise(){return po.create(this,this._def)}or(t){return Ba.create([this,t],this._def)}and(t){return Ua.create(this,t,this._def)}transform(t){return new Cn({...ae(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Qa({...ae(this._def),innerType:this,defaultValue:n,typeName:X.ZodDefault})}brand(){return new cm({typeName:X.ZodBranded,type:this,...ae(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new qa({...ae(this._def),innerType:this,catchValue:n,typeName:X.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return xl.create(this,t)}readonly(){return Ya.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const e2=/^c[^\s-]{8,}$/i,t2=/^[0-9a-z]+$/,n2=/^[0-9A-HJKMNP-TV-Z]{26}$/,r2=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,i2=/^[a-z0-9_-]{21}$/i,s2=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,o2=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,a2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Xd;const l2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,u2=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,c2=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ix="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",d2=new RegExp(`^${ix}$`);function sx(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function f2(e){return new RegExp(`^${sx(e)}$`)}function ox(e){let t=`${ix}T${sx(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function h2(e,t){return!!((t==="v4"||!t)&&l2.test(e)||(t==="v6"||!t)&&u2.test(e))}class mn extends le{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==H.string){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.string,received:s.parsedType}),J}const r=new pt;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),V(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.lengtht.test(i),{validation:n,code:N.invalid_string,...Q.errToObj(r)})}_addCheck(t){return new mn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Q.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Q.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Q.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Q.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Q.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Q.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Q.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Q.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Q.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Q.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Q.errToObj(n)})}nonempty(t){return this.min(1,Q.errToObj(t))}trim(){return new mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new mn({checks:[],typeName:X.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ae(e)})};function p2(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Xr extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==H.number){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.number,received:s.parsedType}),J}let r;const i=new pt;for(const s of this._def.checks)s.kind==="int"?ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),V(r,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?p2(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),V(r,{code:N.not_finite,message:s.message}),i.dirty()):ve.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Q.toString(n))}setLimit(t,n,r,i){return new Xr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]})}_addCheck(t){return new Xr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&ve.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Xr({checks:[],typeName:X.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ae(e)});class Jr extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==H.bigint){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.bigint,received:s.parsedType}),J}let r;const i=new pt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ve.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Q.toString(n))}setLimit(t,n,r,i){return new Jr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]})}_addCheck(t){return new Jr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Jr({checks:[],typeName:X.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ae(e)})};class Va extends le{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==H.boolean){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.boolean,received:r.parsedType}),J}return _t(t.data)}}Va.create=e=>new Va({typeName:X.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ae(e)});class Gi extends le{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==H.date){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.date,received:s.parsedType}),J}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_date}),J}const r=new pt;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),V(i,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ve.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Gi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Q.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Q.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Gi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:X.ZodDate,...ae(e)});class fc extends le{_parse(t){if(this._getType(t)!==H.symbol){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.symbol,received:r.parsedType}),J}return _t(t.data)}}fc.create=e=>new fc({typeName:X.ZodSymbol,...ae(e)});class za extends le{_parse(t){if(this._getType(t)!==H.undefined){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.undefined,received:r.parsedType}),J}return _t(t.data)}}za.create=e=>new za({typeName:X.ZodUndefined,...ae(e)});class Ha extends le{_parse(t){if(this._getType(t)!==H.null){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.null,received:r.parsedType}),J}return _t(t.data)}}Ha.create=e=>new Ha({typeName:X.ZodNull,...ae(e)});class ho extends le{constructor(){super(...arguments),this._any=!0}_parse(t){return _t(t.data)}}ho.create=e=>new ho({typeName:X.ZodAny,...ae(e)});class Ni extends le{constructor(){super(...arguments),this._unknown=!0}_parse(t){return _t(t.data)}}Ni.create=e=>new Ni({typeName:X.ZodUnknown,...ae(e)});class cr extends le{_parse(t){const n=this._getOrReturnCtx(t);return V(n,{code:N.invalid_type,expected:H.never,received:n.parsedType}),J}}cr.create=e=>new cr({typeName:X.ZodNever,...ae(e)});class hc extends le{_parse(t){if(this._getType(t)!==H.undefined){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.void,received:r.parsedType}),J}return _t(t.data)}}hc.create=e=>new hc({typeName:X.ZodVoid,...ae(e)});class yn extends le{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==H.array)return V(n,{code:N.invalid_type,expected:H.array,received:n.parsedType}),J;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.lengthi.maxLength.value&&(V(n,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new zn(n,o,n.path,a)))).then(o=>pt.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new zn(n,o,n.path,a)));return pt.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new yn({...this._def,minLength:{value:t,message:Q.toString(n)}})}max(t,n){return new yn({...this._def,maxLength:{value:t,message:Q.toString(n)}})}length(t,n){return new yn({...this._def,exactLength:{value:t,message:Q.toString(n)}})}nonempty(t){return this.min(1,t)}}yn.create=(e,t)=>new yn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...ae(t)});function ls(e){if(e instanceof Fe){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Dn.create(ls(r))}return new Fe({...e._def,shape:()=>t})}else return e instanceof yn?new yn({...e._def,type:ls(e.element)}):e instanceof Dn?Dn.create(ls(e.unwrap())):e instanceof ti?ti.create(ls(e.unwrap())):e instanceof Hn?Hn.create(e.items.map(t=>ls(t))):e}class Fe extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ve.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==H.object){const u=this._getOrReturnCtx(t);return V(u,{code:N.invalid_type,expected:H.object,received:u.parsedType}),J}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof cr&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const c=s[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new zn(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof cr){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(V(i,{code:N.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new zn(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>pt.mergeObjectSync(r,u)):pt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Q.errToObj,new Fe({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Q.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Fe({...this._def,unknownKeys:"strip"})}passthrough(){return new Fe({...this._def,unknownKeys:"passthrough"})}extend(t){return new Fe({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Fe({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:X.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Fe({...this._def,catchall:t})}pick(t){const n={};return ve.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Fe({...this._def,shape:()=>n})}omit(t){const n={};return ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Fe({...this._def,shape:()=>n})}deepPartial(){return ls(this)}partial(t){const n={};return ve.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Fe({...this._def,shape:()=>n})}required(t){const n={};return ve.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Dn;)s=s._def.innerType;n[r]=s}}),new Fe({...this._def,shape:()=>n})}keyof(){return ax(ve.objectKeys(this.shape))}}Fe.create=(e,t)=>new Fe({shape:()=>e,unknownKeys:"strip",catchall:cr.create(),typeName:X.ZodObject,...ae(t)});Fe.strictCreate=(e,t)=>new Fe({shape:()=>e,unknownKeys:"strict",catchall:cr.create(),typeName:X.ZodObject,...ae(t)});Fe.lazycreate=(e,t)=>new Fe({shape:e,unknownKeys:"strip",catchall:cr.create(),typeName:X.ZodObject,...ae(t)});class Ba extends le{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Dt(a.ctx.common.issues));return V(n,{code:N.invalid_union,unionErrors:o}),J}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Dt(l));return V(n,{code:N.invalid_union,unionErrors:a}),J}}get options(){return this._def.options}}Ba.create=(e,t)=>new Ba({options:e,typeName:X.ZodUnion,...ae(t)});const Zn=e=>e instanceof Ga?Zn(e.schema):e instanceof Cn?Zn(e.innerType()):e instanceof Za?[e.value]:e instanceof ei?e.options:e instanceof Ka?ve.objectValues(e.enum):e instanceof Qa?Zn(e._def.innerType):e instanceof za?[void 0]:e instanceof Ha?[null]:e instanceof Dn?[void 0,...Zn(e.unwrap())]:e instanceof ti?[null,...Zn(e.unwrap())]:e instanceof cm||e instanceof Ya?Zn(e.unwrap()):e instanceof qa?Zn(e._def.innerType):[];class id extends le{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==H.object)return V(n,{code:N.invalid_type,expected:H.object,received:n.parsedType}),J;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(V(n,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=Zn(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new id({typeName:X.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ae(r)})}}function Oh(e,t){const n=br(e),r=br(t);if(e===t)return{valid:!0,data:e};if(n===H.object&&r===H.object){const i=ve.objectKeys(t),s=ve.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=Oh(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===H.array&&r===H.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(Nh(s)||Nh(o))return J;const a=Oh(s.value,o.value);return a.valid?((Ih(s)||Ih(o))&&n.dirty(),{status:n.value,value:a.data}):(V(r,{code:N.invalid_intersection_types}),J)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ua.create=(e,t,n)=>new Ua({left:e,right:t,typeName:X.ZodIntersection,...ae(n)});class Hn extends le{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.array)return V(r,{code:N.invalid_type,expected:H.array,received:r.parsedType}),J;if(r.data.lengththis._def.items.length&&(V(r,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new zn(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>pt.mergeArray(n,o)):pt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Hn({...this._def,rest:t})}}Hn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Hn({items:e,typeName:X.ZodTuple,rest:null,...ae(t)})};class Wa extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.object)return V(r,{code:N.invalid_type,expected:H.object,received:r.parsedType}),J;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new zn(r,a,r.path,a)),value:o._parse(new zn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?pt.mergeObjectAsync(n,i):pt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof le?new Wa({keyType:t,valueType:n,typeName:X.ZodRecord,...ae(r)}):new Wa({keyType:mn.create(),valueType:t,typeName:X.ZodRecord,...ae(n)})}}class pc extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.map)return V(r,{code:N.invalid_type,expected:H.map,received:r.parsedType}),J;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new zn(r,a,r.path,[u,"key"])),value:s._parse(new zn(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}pc.create=(e,t,n)=>new pc({valueType:t,keyType:e,typeName:X.ZodMap,...ae(n)});class Zi extends le{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.set)return V(r,{code:N.invalid_type,expected:H.set,received:r.parsedType}),J;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(V(r,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const c of l){if(c.status==="aborted")return J;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new zn(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Zi({...this._def,minSize:{value:t,message:Q.toString(n)}})}max(t,n){return new Zi({...this._def,maxSize:{value:t,message:Q.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Zi.create=(e,t)=>new Zi({valueType:e,minSize:null,maxSize:null,typeName:X.ZodSet,...ae(t)});class Is extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==H.function)return V(n,{code:N.invalid_type,expected:H.function,received:n.parsedType}),J;function r(a,l){return cc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uc(),fo].filter(u=>!!u),issueData:{code:N.invalid_arguments,argumentsError:l}})}function i(a,l){return cc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uc(),fo].filter(u=>!!u),issueData:{code:N.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof po){const a=this;return _t(async function(...l){const u=new Dt([]),c=await a._def.args.parseAsync(l,s).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(d,s).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const a=this;return _t(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Dt([r(l,u.error)]);const c=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(c,s);if(!d.success)throw new Dt([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Is({...this._def,args:Hn.create(t).rest(Ni.create())})}returns(t){return new Is({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Is({args:t||Hn.create([]).rest(Ni.create()),returns:n||Ni.create(),typeName:X.ZodFunction,...ae(r)})}}class Ga extends le{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ga.create=(e,t)=>new Ga({getter:e,typeName:X.ZodLazy,...ae(t)});class Za extends le{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return V(n,{received:n.data,code:N.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:t.data}}get value(){return this._def.value}}Za.create=(e,t)=>new Za({value:e,typeName:X.ZodLiteral,...ae(t)});function ax(e,t){return new ei({values:e,typeName:X.ZodEnum,...ae(t)})}class ei extends le{constructor(){super(...arguments),Yo.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return V(n,{expected:ve.joinValues(r),received:n.parsedType,code:N.invalid_type}),J}if(dc(this,Yo)||rx(this,Yo,new Set(this._def.values)),!dc(this,Yo).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return V(n,{received:n.data,code:N.invalid_enum_value,options:r}),J}return _t(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ei.create(t,{...this._def,...n})}exclude(t,n=this._def){return ei.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Yo=new WeakMap;ei.create=ax;class Ka extends le{constructor(){super(...arguments),Xo.set(this,void 0)}_parse(t){const n=ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==H.string&&r.parsedType!==H.number){const i=ve.objectValues(n);return V(r,{expected:ve.joinValues(i),received:r.parsedType,code:N.invalid_type}),J}if(dc(this,Xo)||rx(this,Xo,new Set(ve.getValidEnumValues(this._def.values))),!dc(this,Xo).has(t.data)){const i=ve.objectValues(n);return V(r,{received:r.data,code:N.invalid_enum_value,options:i}),J}return _t(t.data)}get enum(){return this._def.values}}Xo=new WeakMap;Ka.create=(e,t)=>new Ka({values:e,typeName:X.ZodNativeEnum,...ae(t)});class po extends le{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==H.promise&&n.common.async===!1)return V(n,{code:N.invalid_type,expected:H.promise,received:n.parsedType}),J;const r=n.parsedType===H.promise?n.data:Promise.resolve(n.data);return _t(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}po.create=(e,t)=>new po({type:e,typeName:X.ZodPromise,...ae(t)});class Cn extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{V(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return J;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?J:l.status==="dirty"||n.value==="dirty"?Cs(l.value):l});{if(n.value==="aborted")return J;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?J:a.status==="dirty"||n.value==="dirty"?Cs(a.value):a}}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Aa(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Aa(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);ve.assertNever(i)}}Cn.create=(e,t,n)=>new Cn({schema:e,typeName:X.ZodEffects,effect:t,...ae(n)});Cn.createWithPreprocess=(e,t,n)=>new Cn({schema:t,effect:{type:"preprocess",transform:e},typeName:X.ZodEffects,...ae(n)});class Dn extends le{_parse(t){return this._getType(t)===H.undefined?_t(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Dn.create=(e,t)=>new Dn({innerType:e,typeName:X.ZodOptional,...ae(t)});class ti extends le{_parse(t){return this._getType(t)===H.null?_t(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ti.create=(e,t)=>new ti({innerType:e,typeName:X.ZodNullable,...ae(t)});class Qa extends le{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===H.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Qa.create=(e,t)=>new Qa({innerType:e,typeName:X.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ae(t)});class qa extends le{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Da(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Dt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Dt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}qa.create=(e,t)=>new qa({innerType:e,typeName:X.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ae(t)});class mc extends le{_parse(t){if(this._getType(t)!==H.nan){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.nan,received:r.parsedType}),J}return{status:"valid",value:t.data}}}mc.create=e=>new mc({typeName:X.ZodNaN,...ae(e)});const m2=Symbol("zod_brand");class cm extends le{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class xl extends le{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?J:s.status==="dirty"?(n.dirty(),Cs(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?J:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new xl({in:t,out:n,typeName:X.ZodPipeline})}}class Ya extends le{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Aa(i)&&(i.value=Object.freeze(i.value)),i);return Da(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Ya.create=(e,t)=>new Ya({innerType:e,typeName:X.ZodReadonly,...ae(t)});function lx(e,t={},n){return e?ho.create().superRefine((r,i)=>{var s,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:l})}}):ho.create()}const g2={object:Fe.lazycreate};var X;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(X||(X={}));const v2=(e,t={message:`Input not instance of ${e.name}`})=>lx(n=>n instanceof e,t),ux=mn.create,cx=Xr.create,y2=mc.create,w2=Jr.create,dx=Va.create,x2=Gi.create,S2=fc.create,_2=za.create,C2=Ha.create,E2=ho.create,k2=Ni.create,b2=cr.create,P2=hc.create,R2=yn.create,M2=Fe.create,$2=Fe.strictCreate,T2=Ba.create,j2=id.create,F2=Ua.create,N2=Hn.create,I2=Wa.create,O2=pc.create,L2=Zi.create,A2=Is.create,D2=Ga.create,V2=Za.create,z2=ei.create,H2=Ka.create,B2=po.create,Cv=Cn.create,U2=Dn.create,W2=ti.create,G2=Cn.createWithPreprocess,Z2=xl.create,K2=()=>ux().optional(),Q2=()=>cx().optional(),q2=()=>dx().optional(),Y2={string:e=>mn.create({...e,coerce:!0}),number:e=>Xr.create({...e,coerce:!0}),boolean:e=>Va.create({...e,coerce:!0}),bigint:e=>Jr.create({...e,coerce:!0}),date:e=>Gi.create({...e,coerce:!0})},X2=J;var R=Object.freeze({__proto__:null,defaultErrorMap:fo,setErrorMap:XM,getErrorMap:uc,makeIssue:cc,EMPTY_PATH:JM,addIssueToContext:V,ParseStatus:pt,INVALID:J,DIRTY:Cs,OK:_t,isAborted:Nh,isDirty:Ih,isValid:Aa,isAsync:Da,get util(){return ve},get objectUtil(){return Fh},ZodParsedType:H,getParsedType:br,ZodType:le,datetimeRegex:ox,ZodString:mn,ZodNumber:Xr,ZodBigInt:Jr,ZodBoolean:Va,ZodDate:Gi,ZodSymbol:fc,ZodUndefined:za,ZodNull:Ha,ZodAny:ho,ZodUnknown:Ni,ZodNever:cr,ZodVoid:hc,ZodArray:yn,ZodObject:Fe,ZodUnion:Ba,ZodDiscriminatedUnion:id,ZodIntersection:Ua,ZodTuple:Hn,ZodRecord:Wa,ZodMap:pc,ZodSet:Zi,ZodFunction:Is,ZodLazy:Ga,ZodLiteral:Za,ZodEnum:ei,ZodNativeEnum:Ka,ZodPromise:po,ZodEffects:Cn,ZodTransformer:Cn,ZodOptional:Dn,ZodNullable:ti,ZodDefault:Qa,ZodCatch:qa,ZodNaN:mc,BRAND:m2,ZodBranded:cm,ZodPipeline:xl,ZodReadonly:Ya,custom:lx,Schema:le,ZodSchema:le,late:g2,get ZodFirstPartyTypeKind(){return X},coerce:Y2,any:E2,array:R2,bigint:w2,boolean:dx,date:x2,discriminatedUnion:j2,effect:Cv,enum:z2,function:A2,instanceof:v2,intersection:F2,lazy:D2,literal:V2,map:O2,nan:y2,nativeEnum:H2,never:b2,null:C2,nullable:W2,number:cx,object:M2,oboolean:q2,onumber:Q2,optional:U2,ostring:K2,pipeline:Z2,preprocess:G2,promise:B2,record:I2,set:L2,strictObject:$2,string:ux,symbol:S2,transformer:Cv,tuple:N2,undefined:_2,union:T2,unknown:k2,void:P2,NEVER:X2,ZodIssueCode:N,quotelessJson:YM,ZodError:Dt});const sd=e=>{const t="input"in e?e.input:"input",n="output"in e?e.output:"output",r="schema"in e?e.schema._input:e._input,i="schema"in e?e.schema._output:e._output;return{types:{input:t==="output"?i:r,output:n==="input"?r:i},parse:s=>"schema"in e?e.schema.parse(s):e.parse(s)}},Os=(e,t)=>R.custom().pipe(e.catch(t));var fx={exports:{}};/*! +${e.stack}\`\`\``});return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:p.jsx("div",{className:"flex items-center justify-center gap-2",children:"Oops, something went wrong (and it's our fault)"})}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:"You should never have seen this page: we failed to catch an error and this fallback error is displayed. We would appreciate if you could fill a bug report with the error message below, and possibly everything we need to reproduce the issue."}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:p.jsx("a",{target:"_blank",href:`https://github.com/PlakarKorp/plakar/issues/new?${t.toString()}`,className:"text-4xl text-blue-500 underline",children:"Click to send a bug report on GitHub"})})]}),p.jsxs("pre",{className:"mt-8 w-full overflow-auto border p-2",children:[e.name,": ",e.message,p.jsx("br",{}),p.jsx("br",{}),e.stack]})]})}function KM({error:e}){let t;try{t=new URL(e.url)}catch{}return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:"Network error"}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:"Unable to establish a connection to the Plakar API. Please verify that the API service is still running."})]}),p.jsx("div",{className:"mt-16 flow-root sm:mt-24",children:!1})]})}function QM(){const e=new URLSearchParams({title:"Plakar API returned HTTP/500",body:"The Plakar API returned a HTTP/500 Internal Server Error response. To reproduce the issue, …"});return p.jsx(p.Fragment,{children:p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:p.jsxs("div",{className:"flex items-center justify-center gap-2",children:[p.jsx(Gp,{size:64}),"Internal error"]})}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:"The Plakar API encountered an unexpected HTTP/500 Internal Server Error. This shouldn't happen, and it's something we need to fix. We'd greatly appreciate it if you could submit a bug report with details to help us reproduce and resolve the issue. Thank you!"}),p.jsx("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:p.jsx("a",{target:"_blank",href:`https://github.com/PlakarKorp/plakar/issues/new?${e.toString()}`,className:"text-4xl text-blue-500 underline",children:"Click to send a bug report on GitHub"})})]})})}function Sv({error:e}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mx-auto max-w-2xl text-center",children:[p.jsx("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-primary sm:text-7xl",children:p.jsxs("div",{className:"flex items-center justify-center gap-2",children:[p.jsx(Vk,{size:64}),"Invalid token"]})}),p.jsxs("p",{className:"mt-8 text-pretty text-lg font-medium text-primary sm:text-xl/8",children:["The Plakar API returned a"," ",p.jsxs("span",{className:"text-nowrap",children:["HTTP/",e.code," ",e.message]})," ","response. It usually means that the token stored in the local storage of your browser is invalid or missing. Use the form below to enter a valid token."]})]}),p.jsx("div",{className:"mt-8 flex justify-center",children:p.jsx($M,{})})]})}const qM={size:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8"}};function rd({size:e="md"}){return p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx("div",{className:Be(qM.size[e],"animate-spin rounded-full border-4 border-blue-500 border-t-transparent")})})}var ve;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));var Fh;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Fh||(Fh={}));const H=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),br=e=>{switch(typeof e){case"undefined":return H.undefined;case"string":return H.string;case"number":return isNaN(e)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":return Array.isArray(e)?H.array:e===null?H.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?H.promise:typeof Map<"u"&&e instanceof Map?H.map:typeof Set<"u"&&e instanceof Set?H.set:typeof Date<"u"&&e instanceof Date?H.date:H.object;default:return H.unknown}},N=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),YM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Dt extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Dt.create=e=>new Dt(e);const fo=(e,t)=>{let n;switch(e.code){case N.invalid_type:e.received===H.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case N.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ve.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:n=`Unrecognized key(s) in object: ${ve.joinValues(e.keys,", ")}`;break;case N.invalid_union:n="Invalid input";break;case N.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ve.joinValues(e.options)}`;break;case N.invalid_enum_value:n=`Invalid enum value. Expected ${ve.joinValues(e.options)}, received '${e.received}'`;break;case N.invalid_arguments:n="Invalid function arguments";break;case N.invalid_return_type:n="Invalid function return type";break;case N.invalid_date:n="Invalid date";break;case N.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ve.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case N.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case N.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case N.custom:n="Invalid input";break;case N.invalid_intersection_types:n="Intersection results could not be merged";break;case N.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case N.not_finite:n="Number must be finite";break;default:n=t.defaultError,ve.assertNever(e)}return{message:n}};let nx=fo;function XM(e){nx=e}function uc(){return nx}const cc=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}},JM=[];function V(e,t){const n=uc(),r=cc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fo?void 0:fo].filter(i=>!!i)});e.common.issues.push(r)}class pt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return J;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return pt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return J;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const J=Object.freeze({status:"aborted"}),Cs=e=>({status:"dirty",value:e}),_t=e=>({status:"valid",value:e}),Nh=e=>e.status==="aborted",Ih=e=>e.status==="dirty",Aa=e=>e.status==="valid",Da=e=>typeof Promise<"u"&&e instanceof Promise;function dc(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function rx(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Q;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Q||(Q={}));var Yo,Xo;class zn{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _v=(e,t)=>{if(Aa(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Dt(e.common.issues);return this._error=n,this._error}}};function ae(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{var l,u;const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}},description:i}}class le{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return br(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:br(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new pt,ctx:{common:t.parent.common,data:t.data,parsedType:br(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Da(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:br(t)},s=this._parseSync({data:t,path:i.path,parent:i});return _v(i,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:br(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Da(i)?i:Promise.resolve(i));return _v(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:N.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Cn({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Dn.create(this,this._def)}nullable(){return ti.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yn.create(this,this._def)}promise(){return po.create(this,this._def)}or(t){return Ba.create([this,t],this._def)}and(t){return Ua.create(this,t,this._def)}transform(t){return new Cn({...ae(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Qa({...ae(this._def),innerType:this,defaultValue:n,typeName:X.ZodDefault})}brand(){return new cm({typeName:X.ZodBranded,type:this,...ae(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new qa({...ae(this._def),innerType:this,catchValue:n,typeName:X.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return xl.create(this,t)}readonly(){return Ya.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const e2=/^c[^\s-]{8,}$/i,t2=/^[0-9a-z]+$/,n2=/^[0-9A-HJKMNP-TV-Z]{26}$/,r2=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,i2=/^[a-z0-9_-]{21}$/i,s2=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,o2=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,a2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Xd;const l2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,u2=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,c2=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ix="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",d2=new RegExp(`^${ix}$`);function sx(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function f2(e){return new RegExp(`^${sx(e)}$`)}function ox(e){let t=`${ix}T${sx(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function h2(e,t){return!!((t==="v4"||!t)&&l2.test(e)||(t==="v6"||!t)&&u2.test(e))}class mn extends le{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==H.string){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.string,received:s.parsedType}),J}const r=new pt;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),V(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.lengtht.test(i),{validation:n,code:N.invalid_string,...Q.errToObj(r)})}_addCheck(t){return new mn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Q.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Q.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Q.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Q.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Q.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Q.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Q.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Q.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Q.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Q.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Q.errToObj(n)})}nonempty(t){return this.min(1,Q.errToObj(t))}trim(){return new mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new mn({checks:[],typeName:X.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ae(e)})};function p2(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Xr extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==H.number){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.number,received:s.parsedType}),J}let r;const i=new pt;for(const s of this._def.checks)s.kind==="int"?ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),V(r,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?p2(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),V(r,{code:N.not_finite,message:s.message}),i.dirty()):ve.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Q.toString(n))}setLimit(t,n,r,i){return new Xr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]})}_addCheck(t){return new Xr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&ve.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Xr({checks:[],typeName:X.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ae(e)});class Jr extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==H.bigint){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.bigint,received:s.parsedType}),J}let r;const i=new pt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),V(r,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ve.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Q.toString(n))}setLimit(t,n,r,i){return new Jr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]})}_addCheck(t){return new Jr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Jr({checks:[],typeName:X.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ae(e)})};class Va extends le{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==H.boolean){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.boolean,received:r.parsedType}),J}return _t(t.data)}}Va.create=e=>new Va({typeName:X.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ae(e)});class Gi extends le{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==H.date){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_type,expected:H.date,received:s.parsedType}),J}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return V(s,{code:N.invalid_date}),J}const r=new pt;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),V(i,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ve.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Gi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Q.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Q.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Gi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:X.ZodDate,...ae(e)});class fc extends le{_parse(t){if(this._getType(t)!==H.symbol){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.symbol,received:r.parsedType}),J}return _t(t.data)}}fc.create=e=>new fc({typeName:X.ZodSymbol,...ae(e)});class za extends le{_parse(t){if(this._getType(t)!==H.undefined){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.undefined,received:r.parsedType}),J}return _t(t.data)}}za.create=e=>new za({typeName:X.ZodUndefined,...ae(e)});class Ha extends le{_parse(t){if(this._getType(t)!==H.null){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.null,received:r.parsedType}),J}return _t(t.data)}}Ha.create=e=>new Ha({typeName:X.ZodNull,...ae(e)});class ho extends le{constructor(){super(...arguments),this._any=!0}_parse(t){return _t(t.data)}}ho.create=e=>new ho({typeName:X.ZodAny,...ae(e)});class Ni extends le{constructor(){super(...arguments),this._unknown=!0}_parse(t){return _t(t.data)}}Ni.create=e=>new Ni({typeName:X.ZodUnknown,...ae(e)});class cr extends le{_parse(t){const n=this._getOrReturnCtx(t);return V(n,{code:N.invalid_type,expected:H.never,received:n.parsedType}),J}}cr.create=e=>new cr({typeName:X.ZodNever,...ae(e)});class hc extends le{_parse(t){if(this._getType(t)!==H.undefined){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.void,received:r.parsedType}),J}return _t(t.data)}}hc.create=e=>new hc({typeName:X.ZodVoid,...ae(e)});class yn extends le{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==H.array)return V(n,{code:N.invalid_type,expected:H.array,received:n.parsedType}),J;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.lengthi.maxLength.value&&(V(n,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new zn(n,o,n.path,a)))).then(o=>pt.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new zn(n,o,n.path,a)));return pt.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new yn({...this._def,minLength:{value:t,message:Q.toString(n)}})}max(t,n){return new yn({...this._def,maxLength:{value:t,message:Q.toString(n)}})}length(t,n){return new yn({...this._def,exactLength:{value:t,message:Q.toString(n)}})}nonempty(t){return this.min(1,t)}}yn.create=(e,t)=>new yn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...ae(t)});function ls(e){if(e instanceof Fe){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Dn.create(ls(r))}return new Fe({...e._def,shape:()=>t})}else return e instanceof yn?new yn({...e._def,type:ls(e.element)}):e instanceof Dn?Dn.create(ls(e.unwrap())):e instanceof ti?ti.create(ls(e.unwrap())):e instanceof Hn?Hn.create(e.items.map(t=>ls(t))):e}class Fe extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ve.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==H.object){const u=this._getOrReturnCtx(t);return V(u,{code:N.invalid_type,expected:H.object,received:u.parsedType}),J}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof cr&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const c=s[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new zn(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof cr){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(V(i,{code:N.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new zn(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>pt.mergeObjectSync(r,u)):pt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Q.errToObj,new Fe({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Q.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Fe({...this._def,unknownKeys:"strip"})}passthrough(){return new Fe({...this._def,unknownKeys:"passthrough"})}extend(t){return new Fe({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Fe({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:X.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Fe({...this._def,catchall:t})}pick(t){const n={};return ve.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Fe({...this._def,shape:()=>n})}omit(t){const n={};return ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Fe({...this._def,shape:()=>n})}deepPartial(){return ls(this)}partial(t){const n={};return ve.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Fe({...this._def,shape:()=>n})}required(t){const n={};return ve.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Dn;)s=s._def.innerType;n[r]=s}}),new Fe({...this._def,shape:()=>n})}keyof(){return ax(ve.objectKeys(this.shape))}}Fe.create=(e,t)=>new Fe({shape:()=>e,unknownKeys:"strip",catchall:cr.create(),typeName:X.ZodObject,...ae(t)});Fe.strictCreate=(e,t)=>new Fe({shape:()=>e,unknownKeys:"strict",catchall:cr.create(),typeName:X.ZodObject,...ae(t)});Fe.lazycreate=(e,t)=>new Fe({shape:e,unknownKeys:"strip",catchall:cr.create(),typeName:X.ZodObject,...ae(t)});class Ba extends le{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Dt(a.ctx.common.issues));return V(n,{code:N.invalid_union,unionErrors:o}),J}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Dt(l));return V(n,{code:N.invalid_union,unionErrors:a}),J}}get options(){return this._def.options}}Ba.create=(e,t)=>new Ba({options:e,typeName:X.ZodUnion,...ae(t)});const Zn=e=>e instanceof Ga?Zn(e.schema):e instanceof Cn?Zn(e.innerType()):e instanceof Za?[e.value]:e instanceof ei?e.options:e instanceof Ka?ve.objectValues(e.enum):e instanceof Qa?Zn(e._def.innerType):e instanceof za?[void 0]:e instanceof Ha?[null]:e instanceof Dn?[void 0,...Zn(e.unwrap())]:e instanceof ti?[null,...Zn(e.unwrap())]:e instanceof cm||e instanceof Ya?Zn(e.unwrap()):e instanceof qa?Zn(e._def.innerType):[];class id extends le{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==H.object)return V(n,{code:N.invalid_type,expected:H.object,received:n.parsedType}),J;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(V(n,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=Zn(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new id({typeName:X.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ae(r)})}}function Oh(e,t){const n=br(e),r=br(t);if(e===t)return{valid:!0,data:e};if(n===H.object&&r===H.object){const i=ve.objectKeys(t),s=ve.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=Oh(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===H.array&&r===H.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(Nh(s)||Nh(o))return J;const a=Oh(s.value,o.value);return a.valid?((Ih(s)||Ih(o))&&n.dirty(),{status:n.value,value:a.data}):(V(r,{code:N.invalid_intersection_types}),J)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ua.create=(e,t,n)=>new Ua({left:e,right:t,typeName:X.ZodIntersection,...ae(n)});class Hn extends le{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.array)return V(r,{code:N.invalid_type,expected:H.array,received:r.parsedType}),J;if(r.data.lengththis._def.items.length&&(V(r,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new zn(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>pt.mergeArray(n,o)):pt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Hn({...this._def,rest:t})}}Hn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Hn({items:e,typeName:X.ZodTuple,rest:null,...ae(t)})};class Wa extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.object)return V(r,{code:N.invalid_type,expected:H.object,received:r.parsedType}),J;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new zn(r,a,r.path,a)),value:o._parse(new zn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?pt.mergeObjectAsync(n,i):pt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof le?new Wa({keyType:t,valueType:n,typeName:X.ZodRecord,...ae(r)}):new Wa({keyType:mn.create(),valueType:t,typeName:X.ZodRecord,...ae(n)})}}class pc extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.map)return V(r,{code:N.invalid_type,expected:H.map,received:r.parsedType}),J;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new zn(r,a,r.path,[u,"key"])),value:s._parse(new zn(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return J;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}pc.create=(e,t,n)=>new pc({valueType:t,keyType:e,typeName:X.ZodMap,...ae(n)});class Zi extends le{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==H.set)return V(r,{code:N.invalid_type,expected:H.set,received:r.parsedType}),J;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(V(r,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const c of l){if(c.status==="aborted")return J;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new zn(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Zi({...this._def,minSize:{value:t,message:Q.toString(n)}})}max(t,n){return new Zi({...this._def,maxSize:{value:t,message:Q.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Zi.create=(e,t)=>new Zi({valueType:e,minSize:null,maxSize:null,typeName:X.ZodSet,...ae(t)});class Is extends le{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==H.function)return V(n,{code:N.invalid_type,expected:H.function,received:n.parsedType}),J;function r(a,l){return cc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uc(),fo].filter(u=>!!u),issueData:{code:N.invalid_arguments,argumentsError:l}})}function i(a,l){return cc({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uc(),fo].filter(u=>!!u),issueData:{code:N.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof po){const a=this;return _t(async function(...l){const u=new Dt([]),c=await a._def.args.parseAsync(l,s).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(d,s).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const a=this;return _t(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Dt([r(l,u.error)]);const c=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(c,s);if(!d.success)throw new Dt([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Is({...this._def,args:Hn.create(t).rest(Ni.create())})}returns(t){return new Is({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Is({args:t||Hn.create([]).rest(Ni.create()),returns:n||Ni.create(),typeName:X.ZodFunction,...ae(r)})}}class Ga extends le{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ga.create=(e,t)=>new Ga({getter:e,typeName:X.ZodLazy,...ae(t)});class Za extends le{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return V(n,{received:n.data,code:N.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:t.data}}get value(){return this._def.value}}Za.create=(e,t)=>new Za({value:e,typeName:X.ZodLiteral,...ae(t)});function ax(e,t){return new ei({values:e,typeName:X.ZodEnum,...ae(t)})}class ei extends le{constructor(){super(...arguments),Yo.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return V(n,{expected:ve.joinValues(r),received:n.parsedType,code:N.invalid_type}),J}if(dc(this,Yo)||rx(this,Yo,new Set(this._def.values)),!dc(this,Yo).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return V(n,{received:n.data,code:N.invalid_enum_value,options:r}),J}return _t(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ei.create(t,{...this._def,...n})}exclude(t,n=this._def){return ei.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Yo=new WeakMap;ei.create=ax;class Ka extends le{constructor(){super(...arguments),Xo.set(this,void 0)}_parse(t){const n=ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==H.string&&r.parsedType!==H.number){const i=ve.objectValues(n);return V(r,{expected:ve.joinValues(i),received:r.parsedType,code:N.invalid_type}),J}if(dc(this,Xo)||rx(this,Xo,new Set(ve.getValidEnumValues(this._def.values))),!dc(this,Xo).has(t.data)){const i=ve.objectValues(n);return V(r,{received:r.data,code:N.invalid_enum_value,options:i}),J}return _t(t.data)}get enum(){return this._def.values}}Xo=new WeakMap;Ka.create=(e,t)=>new Ka({values:e,typeName:X.ZodNativeEnum,...ae(t)});class po extends le{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==H.promise&&n.common.async===!1)return V(n,{code:N.invalid_type,expected:H.promise,received:n.parsedType}),J;const r=n.parsedType===H.promise?n.data:Promise.resolve(n.data);return _t(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}po.create=(e,t)=>new po({type:e,typeName:X.ZodPromise,...ae(t)});class Cn extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{V(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return J;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?J:l.status==="dirty"||n.value==="dirty"?Cs(l.value):l});{if(n.value==="aborted")return J;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?J:a.status==="dirty"||n.value==="dirty"?Cs(a.value):a}}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Aa(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Aa(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);ve.assertNever(i)}}Cn.create=(e,t,n)=>new Cn({schema:e,typeName:X.ZodEffects,effect:t,...ae(n)});Cn.createWithPreprocess=(e,t,n)=>new Cn({schema:t,effect:{type:"preprocess",transform:e},typeName:X.ZodEffects,...ae(n)});class Dn extends le{_parse(t){return this._getType(t)===H.undefined?_t(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Dn.create=(e,t)=>new Dn({innerType:e,typeName:X.ZodOptional,...ae(t)});class ti extends le{_parse(t){return this._getType(t)===H.null?_t(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ti.create=(e,t)=>new ti({innerType:e,typeName:X.ZodNullable,...ae(t)});class Qa extends le{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===H.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Qa.create=(e,t)=>new Qa({innerType:e,typeName:X.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ae(t)});class qa extends le{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Da(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Dt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Dt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}qa.create=(e,t)=>new qa({innerType:e,typeName:X.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ae(t)});class mc extends le{_parse(t){if(this._getType(t)!==H.nan){const r=this._getOrReturnCtx(t);return V(r,{code:N.invalid_type,expected:H.nan,received:r.parsedType}),J}return{status:"valid",value:t.data}}}mc.create=e=>new mc({typeName:X.ZodNaN,...ae(e)});const m2=Symbol("zod_brand");class cm extends le{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class xl extends le{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?J:s.status==="dirty"?(n.dirty(),Cs(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?J:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new xl({in:t,out:n,typeName:X.ZodPipeline})}}class Ya extends le{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Aa(i)&&(i.value=Object.freeze(i.value)),i);return Da(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Ya.create=(e,t)=>new Ya({innerType:e,typeName:X.ZodReadonly,...ae(t)});function lx(e,t={},n){return e?ho.create().superRefine((r,i)=>{var s,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:l})}}):ho.create()}const g2={object:Fe.lazycreate};var X;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(X||(X={}));const v2=(e,t={message:`Input not instance of ${e.name}`})=>lx(n=>n instanceof e,t),ux=mn.create,cx=Xr.create,y2=mc.create,w2=Jr.create,dx=Va.create,x2=Gi.create,S2=fc.create,_2=za.create,C2=Ha.create,E2=ho.create,k2=Ni.create,b2=cr.create,P2=hc.create,R2=yn.create,M2=Fe.create,$2=Fe.strictCreate,T2=Ba.create,j2=id.create,F2=Ua.create,N2=Hn.create,I2=Wa.create,O2=pc.create,L2=Zi.create,A2=Is.create,D2=Ga.create,V2=Za.create,z2=ei.create,H2=Ka.create,B2=po.create,Cv=Cn.create,U2=Dn.create,W2=ti.create,G2=Cn.createWithPreprocess,Z2=xl.create,K2=()=>ux().optional(),Q2=()=>cx().optional(),q2=()=>dx().optional(),Y2={string:e=>mn.create({...e,coerce:!0}),number:e=>Xr.create({...e,coerce:!0}),boolean:e=>Va.create({...e,coerce:!0}),bigint:e=>Jr.create({...e,coerce:!0}),date:e=>Gi.create({...e,coerce:!0})},X2=J;var R=Object.freeze({__proto__:null,defaultErrorMap:fo,setErrorMap:XM,getErrorMap:uc,makeIssue:cc,EMPTY_PATH:JM,addIssueToContext:V,ParseStatus:pt,INVALID:J,DIRTY:Cs,OK:_t,isAborted:Nh,isDirty:Ih,isValid:Aa,isAsync:Da,get util(){return ve},get objectUtil(){return Fh},ZodParsedType:H,getParsedType:br,ZodType:le,datetimeRegex:ox,ZodString:mn,ZodNumber:Xr,ZodBigInt:Jr,ZodBoolean:Va,ZodDate:Gi,ZodSymbol:fc,ZodUndefined:za,ZodNull:Ha,ZodAny:ho,ZodUnknown:Ni,ZodNever:cr,ZodVoid:hc,ZodArray:yn,ZodObject:Fe,ZodUnion:Ba,ZodDiscriminatedUnion:id,ZodIntersection:Ua,ZodTuple:Hn,ZodRecord:Wa,ZodMap:pc,ZodSet:Zi,ZodFunction:Is,ZodLazy:Ga,ZodLiteral:Za,ZodEnum:ei,ZodNativeEnum:Ka,ZodPromise:po,ZodEffects:Cn,ZodTransformer:Cn,ZodOptional:Dn,ZodNullable:ti,ZodDefault:Qa,ZodCatch:qa,ZodNaN:mc,BRAND:m2,ZodBranded:cm,ZodPipeline:xl,ZodReadonly:Ya,custom:lx,Schema:le,ZodSchema:le,late:g2,get ZodFirstPartyTypeKind(){return X},coerce:Y2,any:E2,array:R2,bigint:w2,boolean:dx,date:x2,discriminatedUnion:j2,effect:Cv,enum:z2,function:A2,instanceof:v2,intersection:F2,lazy:D2,literal:V2,map:O2,nan:y2,nativeEnum:H2,never:b2,null:C2,nullable:W2,number:cx,object:M2,oboolean:q2,onumber:Q2,optional:U2,ostring:K2,pipeline:Z2,preprocess:G2,promise:B2,record:I2,set:L2,strictObject:$2,string:ux,symbol:S2,transformer:Cv,tuple:N2,undefined:_2,union:T2,unknown:k2,void:P2,NEVER:X2,ZodIssueCode:N,quotelessJson:YM,ZodError:Dt});const sd=e=>{const t="input"in e?e.input:"input",n="output"in e?e.output:"output",r="schema"in e?e.schema._input:e._input,i="schema"in e?e.schema._output:e._output;return{types:{input:t==="output"?i:r,output:n==="input"?r:i},parse:s=>"schema"in e?e.schema.parse(s):e.parse(s)}},Os=(e,t)=>R.custom().pipe(e.catch(t));var fx={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames diff --git a/ui/v2/frontend/index.html b/ui/v2/frontend/index.html index 4078645b..cfb501e7 100644 --- a/ui/v2/frontend/index.html +++ b/ui/v2/frontend/index.html @@ -5,7 +5,7 @@ Plakar UI - +