diff --git a/README.md b/README.md index ff210df2..4ba7d0a7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Certimate 是一个开源的 SSL 证书管理工具,具有以下特点: 2. 数据安全:由于是私有部署,所有数据均存储在本地,不会保存在服务商的服务器上,确保数据的安全性。 3. 操作方便:通过简单的配置即可轻松申请 SSL 证书,并且在证书即将过期时自动续期,无需人工干预。 -Certimate 旨在为用户提供一个安全、简便的 SSL 证书管理解决方案。 +Certimate 旨在为用户提供一个安全、简便的 SSL 证书管理解决方案。使用文档请访问[https://docs.certimate.fun](https://docs.certimate.fun) - [Certimate](#certimate) - [一、安装](#一安装) diff --git a/ui/dist/assets/index-zmVKcms4.js b/ui/dist/assets/index-DYbObph2.js similarity index 92% rename from ui/dist/assets/index-zmVKcms4.js rename to ui/dist/assets/index-DYbObph2.js index 2549fbb1..4ac9bbc0 100644 --- a/ui/dist/assets/index-zmVKcms4.js +++ b/ui/dist/assets/index-DYbObph2.js @@ -35,9 +35,9 @@ var PT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wU=PT((jU,Nu) `),o=n.stack.split(` `),i=s.length-1,a=o.length-1;1<=i&&0<=a&&s[i]!==o[a];)a--;for(;1<=i&&0<=a;i--,a--)if(s[i]!==o[a]){if(i!==1||a!==1)do if(i--,a--,0>a||s[i]!==o[a]){var l=` `+s[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{$f=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?La(e):""}function sR(e){switch(e.tag){case 5:return La(e.type);case 16:return La("Lazy");case 13:return La("Suspense");case 19:return La("SuspenseList");case 0:case 2:case 15:return e=Vf(e.type,!1),e;case 11:return e=Vf(e.type.render,!1),e;case 1:return e=Vf(e.type,!0),e;default:return""}}function Wh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case gi:return"Fragment";case mi:return"Portal";case Uh:return"Profiler";case bm:return"StrictMode";case $h:return"Suspense";case Vh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zw:return(e.displayName||"Context")+".Consumer";case Fw:return(e._context.displayName||"Context")+".Provider";case Sm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case km:return t=e.displayName||null,t!==null?t:Wh(e.type)||"Memo";case Ms:t=e._payload,e=e._init;try{return Wh(e(t))}catch{}}return null}function oR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Wh(t);case 8:return t===bm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function eo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $w(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iR(e){var t=$w(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rc(e){e._valueTracker||(e._valueTracker=iR(e))}function Vw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=$w(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Pu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Bh(e,t){var r=t.checked;return At({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function qv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=eo(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ww(e,t){t=t.checked,t!=null&&_m(e,"checked",t,!1)}function Hh(e,t){Ww(e,t);var r=eo(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Yh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Yh(e,t.type,eo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xv(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Yh(e,t,r){(t!=="number"||Pu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fa=Array.isArray;function ji(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function al(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ya={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aR=["Webkit","ms","Moz","O"];Object.keys(Ya).forEach(function(e){aR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ya[t]=Ya[e]})});function Zw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ya.hasOwnProperty(e)&&Ya[e]?(""+t).trim():t+"px"}function Gw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Zw(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var lR=At({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Kh(e,t){if(t){if(lR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function qh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xh=null;function Cm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qh=null,Di=null,Oi=null;function ey(e){if(e=Ql(e)){if(typeof Qh!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Md(t),Qh(e.stateNode,e.type,t))}}function Kw(e){Di?Oi?Oi.push(e):Oi=[e]:Di=e}function qw(){if(Di){var e=Di,t=Oi;if(Oi=Di=null,ey(e),t)for(e=0;e>>=0,e===0?32:31-(wR(e)/xR|0)|0}var Pc=64,jc=4194304;function za(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Au(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var a=i&~s;a!==0?n=za(a):(o&=i,o!==0&&(n=za(o)))}else i=r&~s,i!==0?n=za(i):o!==0&&(n=za(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function ql(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=r}function kR(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Ga),cy=" ",uy=!1;function gx(e,t){switch(e){case"keyup":return QR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vi=!1;function e2(e,t){switch(e){case"compositionend":return vx(t);case"keypress":return t.which!==32?null:(uy=!0,cy);case"textInput":return e=t.data,e===cy&&uy?null:e;default:return null}}function t2(e,t){if(vi)return e==="compositionend"||!Om&&gx(e,t)?(e=px(),iu=Pm=Us=null,vi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=py(r)}}function _x(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_x(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bx(){for(var e=window,t=Pu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Pu(e.document)}return t}function Am(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function u2(e){var t=bx(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&_x(r.ownerDocument.documentElement,r)){if(n!==null&&Am(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=my(r,o);var i=my(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,yi=null,sp=null,qa=null,op=!1;function gy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;op||yi==null||yi!==Pu(n)||(n=yi,"selectionStart"in n&&Am(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qa&&hl(qa,n)||(qa=n,n=Lu(sp,"onSelect"),0_i||(e.current=dp[_i],dp[_i]=null,_i--)}function vt(e,t){_i++,dp[_i]=e.current,e.current=t}var to={},lr=uo(to),Sr=uo(!1),Ao=to;function Zi(e,t){var r=e.type.contextTypes;if(!r)return to;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function kr(e){return e=e.childContextTypes,e!=null}function zu(){xt(Sr),xt(lr)}function Sy(e,t,r){if(lr.current!==to)throw Error(oe(168));vt(lr,t),vt(Sr,r)}function jx(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(oe(108,oR(e)||"Unknown",s));return At({},r,n)}function Uu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Ao=lr.current,vt(lr,e),vt(Sr,Sr.current),!0}function ky(e,t,r){var n=e.stateNode;if(!n)throw Error(oe(169));r?(e=jx(e,t,Ao),n.__reactInternalMemoizedMergedChildContext=e,xt(Sr),xt(lr),vt(lr,e)):xt(Sr),vt(Sr,r)}var es=null,Id=!1,rh=!1;function Dx(e){es===null?es=[e]:es.push(e)}function b2(e){Id=!0,Dx(e)}function fo(){if(!rh&&es!==null){rh=!0;var e=0,t=ft;try{var r=es;for(ft=1;e>=i,s-=i,ts=1<<32-un(t)+s|r<O?(j=P,P=null):j=P.sibling;var L=h(g,P,_[O],C);if(L===null){P===null&&(P=j);break}e&&P&&L.alternate===null&&t(g,P),v=o(L,v,O),T===null?E=L:T.sibling=L,T=L,P=j}if(O===_.length)return r(g,P),Tt&&yo(g,O),E;if(P===null){for(;O<_.length;O++)P=d(g,_[O],C),P!==null&&(v=o(P,v,O),T===null?E=P:T.sibling=P,T=P);return Tt&&yo(g,O),E}for(P=n(g,P);O<_.length;O++)j=p(P,g,O,_[O],C),j!==null&&(e&&j.alternate!==null&&P.delete(j.key===null?O:j.key),v=o(j,v,O),T===null?E=j:T.sibling=j,T=j);return e&&P.forEach(function(q){return t(g,q)}),Tt&&yo(g,O),E}function m(g,v,_,C){var E=_a(_);if(typeof E!="function")throw Error(oe(150));if(_=E.call(_),_==null)throw Error(oe(151));for(var T=E=null,P=v,O=v=0,j=null,L=_.next();P!==null&&!L.done;O++,L=_.next()){P.index>O?(j=P,P=null):j=P.sibling;var q=h(g,P,L.value,C);if(q===null){P===null&&(P=j);break}e&&P&&q.alternate===null&&t(g,P),v=o(q,v,O),T===null?E=q:T.sibling=q,T=q,P=j}if(L.done)return r(g,P),Tt&&yo(g,O),E;if(P===null){for(;!L.done;O++,L=_.next())L=d(g,L.value,C),L!==null&&(v=o(L,v,O),T===null?E=L:T.sibling=L,T=L);return Tt&&yo(g,O),E}for(P=n(g,P);!L.done;O++,L=_.next())L=p(P,g,O,L.value,C),L!==null&&(e&&L.alternate!==null&&P.delete(L.key===null?O:L.key),v=o(L,v,O),T===null?E=L:T.sibling=L,T=L);return e&&P.forEach(function(R){return t(g,R)}),Tt&&yo(g,O),E}function x(g,v,_,C){if(typeof _=="object"&&_!==null&&_.type===gi&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Tc:e:{for(var E=_.key,T=v;T!==null;){if(T.key===E){if(E=_.type,E===gi){if(T.tag===7){r(g,T.sibling),v=s(T,_.props.children),v.return=g,g=v;break e}}else if(T.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ms&&Ty(E)===T.type){r(g,T.sibling),v=s(T,_.props),v.ref=Ea(g,T,_),v.return=g,g=v;break e}r(g,T);break}else t(g,T);T=T.sibling}_.type===gi?(v=Po(_.props.children,g.mode,C,_.key),v.return=g,g=v):(C=pu(_.type,_.key,_.props,null,g.mode,C),C.ref=Ea(g,v,_),C.return=g,g=C)}return i(g);case mi:e:{for(T=_.key;v!==null;){if(v.key===T)if(v.tag===4&&v.stateNode.containerInfo===_.containerInfo&&v.stateNode.implementation===_.implementation){r(g,v.sibling),v=s(v,_.children||[]),v.return=g,g=v;break e}else{r(g,v);break}else t(g,v);v=v.sibling}v=uh(_,g.mode,C),v.return=g,g=v}return i(g);case Ms:return T=_._init,x(g,v,T(_._payload),C)}if(Fa(_))return w(g,v,_,C);if(_a(_))return m(g,v,_,C);Fc(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,v!==null&&v.tag===6?(r(g,v.sibling),v=s(v,_),v.return=g,g=v):(r(g,v),v=ch(_,g.mode,C),v.return=g,g=v),i(g)):r(g,v)}return x}var Ki=Ix(!0),Lx=Ix(!1),Wu=uo(null),Bu=null,ki=null,Fm=null;function zm(){Fm=ki=Bu=null}function Um(e){var t=Wu.current;xt(Wu),e._currentValue=t}function pp(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Mi(e,t){Bu=e,Fm=ki=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(br=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(Fm!==e)if(e={context:e,memoizedValue:t,next:null},ki===null){if(Bu===null)throw Error(oe(308));ki=e,Bu.dependencies={lanes:0,firstContext:e}}else ki=ki.next=e;return t}var bo=null;function $m(e){bo===null?bo=[e]:bo.push(e)}function Fx(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,$m(t)):(r.next=s.next,s.next=r),t.interleaved=r,ds(e,n)}function ds(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Is=!1;function Vm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function os(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ks(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ot&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ds(e,r)}return s=n.interleaved,s===null?(t.next=t,$m(n)):(t.next=s.next,s.next=t),n.interleaved=t,ds(e,r)}function lu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}function Ry(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Hu(e,t,r,n){var s=e.updateQueue;Is=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==i&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(o!==null){var d=s.baseState;i=0,f=c=l=null,a=o;do{var h=a.lane,p=a.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,m=a;switch(h=t,p=r,m.tag){case 1:if(w=m.payload,typeof w=="function"){d=w.call(p,d,h);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=m.payload,h=typeof w=="function"?w.call(p,d,h):w,h==null)break e;d=At({},d,h);break e;case 2:Is=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=p,l=d):f=f.next=p,i|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(f===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=f,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Lo|=i,e.lanes=i,e.memoizedState=d}}function Ny(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=sh.transition;sh.transition={};try{e(!1),t()}finally{ft=r,sh.transition=n}}function r_(){return Xr().memoizedState}function E2(e,t,r){var n=Xs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},n_(e))s_(t,r);else if(r=Fx(e,t,r,n),r!==null){var s=hr();dn(r,e,n,s),o_(r,t,n)}}function T2(e,t,r){var n=Xs(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(n_(e))s_(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,r);if(s.hasEagerState=!0,s.eagerState=a,hn(a,i)){var l=t.interleaved;l===null?(s.next=s,$m(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Fx(e,t,s,n),r!==null&&(s=hr(),dn(r,e,n,s),o_(r,t,n))}}function n_(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function s_(e,t){Xa=Zu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function o_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}var Gu={readContext:qr,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},R2={readContext:qr,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:jy,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,uu(4194308,4,Xx.bind(null,t,e),r)},useLayoutEffect:function(e,t){return uu(4194308,4,e,t)},useInsertionEffect:function(e,t){return uu(4,2,e,t)},useMemo:function(e,t){var r=kn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=kn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=E2.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:Py,useDebugValue:qm,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=Py(!1),t=e[0];return e=C2.bind(null,e[1]),kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=kn();if(Tt){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=t(),Xt===null)throw Error(oe(349));Io&30||Wx(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,jy(Hx.bind(null,n,o,e),[e]),n.flags|=2048,_l(9,Bx.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=kn(),t=Xt.identifierPrefix;if(Tt){var r=rs,n=ts;r=(n&~(1<<32-un(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=wl++,0_i||(e.current=dp[_i],dp[_i]=null,_i--)}function vt(e,t){_i++,dp[_i]=e.current,e.current=t}var to={},lr=uo(to),Sr=uo(!1),Ao=to;function Zi(e,t){var r=e.type.contextTypes;if(!r)return to;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function kr(e){return e=e.childContextTypes,e!=null}function zu(){xt(Sr),xt(lr)}function Sy(e,t,r){if(lr.current!==to)throw Error(oe(168));vt(lr,t),vt(Sr,r)}function jx(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(oe(108,oR(e)||"Unknown",s));return At({},r,n)}function Uu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Ao=lr.current,vt(lr,e),vt(Sr,Sr.current),!0}function ky(e,t,r){var n=e.stateNode;if(!n)throw Error(oe(169));r?(e=jx(e,t,Ao),n.__reactInternalMemoizedMergedChildContext=e,xt(Sr),xt(lr),vt(lr,e)):xt(Sr),vt(Sr,r)}var es=null,Id=!1,rh=!1;function Dx(e){es===null?es=[e]:es.push(e)}function b2(e){Id=!0,Dx(e)}function fo(){if(!rh&&es!==null){rh=!0;var e=0,t=ft;try{var r=es;for(ft=1;e>=i,s-=i,ts=1<<32-un(t)+s|r<O?(j=P,P=null):j=P.sibling;var L=h(g,P,_[O],C);if(L===null){P===null&&(P=j);break}e&&P&&L.alternate===null&&t(g,P),v=o(L,v,O),T===null?E=L:T.sibling=L,T=L,P=j}if(O===_.length)return r(g,P),Tt&&yo(g,O),E;if(P===null){for(;O<_.length;O++)P=d(g,_[O],C),P!==null&&(v=o(P,v,O),T===null?E=P:T.sibling=P,T=P);return Tt&&yo(g,O),E}for(P=n(g,P);O<_.length;O++)j=p(P,g,O,_[O],C),j!==null&&(e&&j.alternate!==null&&P.delete(j.key===null?O:j.key),v=o(j,v,O),T===null?E=j:T.sibling=j,T=j);return e&&P.forEach(function(q){return t(g,q)}),Tt&&yo(g,O),E}function m(g,v,_,C){var E=_a(_);if(typeof E!="function")throw Error(oe(150));if(_=E.call(_),_==null)throw Error(oe(151));for(var T=E=null,P=v,O=v=0,j=null,L=_.next();P!==null&&!L.done;O++,L=_.next()){P.index>O?(j=P,P=null):j=P.sibling;var q=h(g,P,L.value,C);if(q===null){P===null&&(P=j);break}e&&P&&q.alternate===null&&t(g,P),v=o(q,v,O),T===null?E=q:T.sibling=q,T=q,P=j}if(L.done)return r(g,P),Tt&&yo(g,O),E;if(P===null){for(;!L.done;O++,L=_.next())L=d(g,L.value,C),L!==null&&(v=o(L,v,O),T===null?E=L:T.sibling=L,T=L);return Tt&&yo(g,O),E}for(P=n(g,P);!L.done;O++,L=_.next())L=p(P,g,O,L.value,C),L!==null&&(e&&L.alternate!==null&&P.delete(L.key===null?O:L.key),v=o(L,v,O),T===null?E=L:T.sibling=L,T=L);return e&&P.forEach(function(R){return t(g,R)}),Tt&&yo(g,O),E}function x(g,v,_,C){if(typeof _=="object"&&_!==null&&_.type===gi&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Tc:e:{for(var E=_.key,T=v;T!==null;){if(T.key===E){if(E=_.type,E===gi){if(T.tag===7){r(g,T.sibling),v=s(T,_.props.children),v.return=g,g=v;break e}}else if(T.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ms&&Ty(E)===T.type){r(g,T.sibling),v=s(T,_.props),v.ref=Ea(g,T,_),v.return=g,g=v;break e}r(g,T);break}else t(g,T);T=T.sibling}_.type===gi?(v=Po(_.props.children,g.mode,C,_.key),v.return=g,g=v):(C=pu(_.type,_.key,_.props,null,g.mode,C),C.ref=Ea(g,v,_),C.return=g,g=C)}return i(g);case mi:e:{for(T=_.key;v!==null;){if(v.key===T)if(v.tag===4&&v.stateNode.containerInfo===_.containerInfo&&v.stateNode.implementation===_.implementation){r(g,v.sibling),v=s(v,_.children||[]),v.return=g,g=v;break e}else{r(g,v);break}else t(g,v);v=v.sibling}v=uh(_,g.mode,C),v.return=g,g=v}return i(g);case Ms:return T=_._init,x(g,v,T(_._payload),C)}if(Fa(_))return w(g,v,_,C);if(_a(_))return m(g,v,_,C);Fc(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,v!==null&&v.tag===6?(r(g,v.sibling),v=s(v,_),v.return=g,g=v):(r(g,v),v=ch(_,g.mode,C),v.return=g,g=v),i(g)):r(g,v)}return x}var Ki=Ix(!0),Lx=Ix(!1),Wu=uo(null),Bu=null,ki=null,Fm=null;function zm(){Fm=ki=Bu=null}function Um(e){var t=Wu.current;xt(Wu),e._currentValue=t}function pp(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Mi(e,t){Bu=e,Fm=ki=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(br=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(Fm!==e)if(e={context:e,memoizedValue:t,next:null},ki===null){if(Bu===null)throw Error(oe(308));ki=e,Bu.dependencies={lanes:0,firstContext:e}}else ki=ki.next=e;return t}var bo=null;function $m(e){bo===null?bo=[e]:bo.push(e)}function Fx(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,$m(t)):(r.next=s.next,s.next=r),t.interleaved=r,ds(e,n)}function ds(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Is=!1;function Vm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function os(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ks(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ot&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ds(e,r)}return s=n.interleaved,s===null?(t.next=t,$m(n)):(t.next=s.next,s.next=t),n.interleaved=t,ds(e,r)}function lu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}function Ry(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Hu(e,t,r,n){var s=e.updateQueue;Is=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==i&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(o!==null){var d=s.baseState;i=0,f=c=l=null,a=o;do{var h=a.lane,p=a.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,m=a;switch(h=t,p=r,m.tag){case 1:if(w=m.payload,typeof w=="function"){d=w.call(p,d,h);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=m.payload,h=typeof w=="function"?w.call(p,d,h):w,h==null)break e;d=At({},d,h);break e;case 2:Is=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=p,l=d):f=f.next=p,i|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(f===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=f,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Lo|=i,e.lanes=i,e.memoizedState=d}}function Ny(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=sh.transition;sh.transition={};try{e(!1),t()}finally{ft=r,sh.transition=n}}function r_(){return Xr().memoizedState}function E2(e,t,r){var n=Xs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},n_(e))s_(t,r);else if(r=Fx(e,t,r,n),r!==null){var s=hr();dn(r,e,n,s),o_(r,t,n)}}function T2(e,t,r){var n=Xs(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(n_(e))s_(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,r);if(s.hasEagerState=!0,s.eagerState=a,hn(a,i)){var l=t.interleaved;l===null?(s.next=s,$m(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Fx(e,t,s,n),r!==null&&(s=hr(),dn(r,e,n,s),o_(r,t,n))}}function n_(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function s_(e,t){Xa=Zu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function o_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}var Gu={readContext:qr,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},R2={readContext:qr,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:jy,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,uu(4194308,4,Xx.bind(null,t,e),r)},useLayoutEffect:function(e,t){return uu(4194308,4,e,t)},useInsertionEffect:function(e,t){return uu(4,2,e,t)},useMemo:function(e,t){var r=kn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=kn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=E2.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:Py,useDebugValue:qm,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=Py(!1),t=e[0];return e=C2.bind(null,e[1]),kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=kn();if(Tt){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=t(),Xt===null)throw Error(oe(349));Io&30||Wx(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,jy(Hx.bind(null,n,o,e),[e]),n.flags|=2048,_l(9,Bx.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=kn(),t=Xt.identifierPrefix;if(Tt){var r=rs,n=ts;r=(n&~(1<<32-un(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=wl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[Cn]=t,e[gl]=n,m_(e,t,!1,!1),t.stateNode=e;e:{switch(i=qh(r,n),r){case"dialog":wt("cancel",e),wt("close",e),s=n;break;case"iframe":case"object":case"embed":wt("load",e),s=n;break;case"video":case"audio":for(s=0;sQi&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304)}else{if(!n)if(e=Yu(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ta(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Tt)return or(t),null}else 2*zt()-o.renderingStartTime>Qi&&r!==1073741824&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=zt(),t.sibling=null,r=Pt.current,vt(Pt,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return rg(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Pr&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function I2(e,t){switch(Im(t),t.tag){case 1:return kr(t.type)&&zu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(),xt(Sr),xt(lr),Hm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bm(t),null;case 13:if(xt(Pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(Pt),null;case 4:return qi(),null;case 10:return Um(t.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var Uc=!1,ir=!1,L2=typeof WeakSet=="function"?WeakSet:Set,_e=null;function Ci(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){It(e,t,n)}else r.current=null}function Sp(e,t,r){try{r()}catch(n){It(e,t,n)}}var Vy=!1;function F2(e,t){if(ip=Mu,e=bx(),Am(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,l=-1,c=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||s!==0&&d.nodeType!==3||(a=i+s),d!==o||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++c===s&&(a=i),h===o&&++f===n&&(l=i),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ap={focusedElem:e,selectionRange:r},Mu=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var m=w.memoizedProps,x=w.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:rn(t.type,m),x);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(C){It(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return w=Vy,Vy=!1,w}function Qa(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Sp(t,r,o)}s=s.next}while(s!==n)}}function zd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function kp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function y_(e){var t=e.alternate;t!==null&&(e.alternate=null,y_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cn],delete t[gl],delete t[up],delete t[x2],delete t[_2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function w_(e){return e.tag===5||e.tag===3||e.tag===4}function Wy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||w_(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Fu));else if(n!==4&&(e=e.child,e!==null))for(Cp(e,t,r),e=e.sibling;e!==null;)Cp(e,t,r),e=e.sibling}function Ep(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Ep(e,t,r),e=e.sibling;e!==null;)Ep(e,t,r),e=e.sibling}var er=null,nn=!1;function Ps(e,t,r){for(r=r.child;r!==null;)x_(e,t,r),r=r.sibling}function x_(e,t,r){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(jd,r)}catch{}switch(r.tag){case 5:ir||Ci(r,t);case 6:var n=er,s=nn;er=null,Ps(e,t,r),er=n,nn=s,er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):er.removeChild(r.stateNode));break;case 18:er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?th(e.parentNode,r):e.nodeType===1&&th(e,r),dl(e)):th(er,r.stateNode));break;case 4:n=er,s=nn,er=r.stateNode.containerInfo,nn=!0,Ps(e,t,r),er=n,nn=s;break;case 0:case 11:case 14:case 15:if(!ir&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Sp(r,t,i),s=s.next}while(s!==n)}Ps(e,t,r);break;case 1:if(!ir&&(Ci(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){It(r,t,a)}Ps(e,t,r);break;case 21:Ps(e,t,r);break;case 22:r.mode&1?(ir=(n=ir)||r.memoizedState!==null,Ps(e,t,r),ir=n):Ps(e,t,r);break;default:Ps(e,t,r)}}function By(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new L2),t.forEach(function(n){var s=Z2.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}if(n=s,n=zt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*U2(n/1960))-n,10e?16:e,$s===null)var n=!1;else{if(e=$s,$s=null,Xu=0,ot&6)throw Error(oe(331));var s=ot;for(ot|=4,_e=e.current;_e!==null;){var o=_e,i=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lzt()-eg?No(e,0):Jm|=r),Cr(e,t)}function R_(e,t){t===0&&(e.mode&1?(t=jc,jc<<=1,!(jc&130023424)&&(jc=4194304)):t=1);var r=hr();e=ds(e,t),e!==null&&(ql(e,t,r),Cr(e,r))}function Y2(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),R_(e,r)}function Z2(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(oe(314))}n!==null&&n.delete(t),R_(e,r)}var N_;N_=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Sr.current)br=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return br=!1,A2(e,t,r);br=!!(e.flags&131072)}else br=!1,Tt&&t.flags&1048576&&Ox(t,Vu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;du(e,t),e=t.pendingProps;var s=Zi(t,lr.current);Mi(t,r),s=Zm(null,t,n,e,s,r);var o=Gm();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kr(n)?(o=!0,Uu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Vm(t),s.updater=Fd,t.stateNode=s,s._reactInternals=t,gp(t,n,e,r),t=wp(null,t,n,!0,o,r)):(t.tag=0,Tt&&o&&Mm(t),dr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(du(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=K2(n),e=rn(n,e),s){case 0:t=yp(null,t,n,e,r);break e;case 1:t=zy(null,t,n,e,r);break e;case 11:t=Ly(null,t,n,e,r);break e;case 14:t=Fy(null,t,n,rn(n.type,e),r);break e}throw Error(oe(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),yp(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),zy(e,t,n,s,r);case 3:e:{if(f_(t),e===null)throw Error(oe(387));n=t.pendingProps,o=t.memoizedState,s=o.element,zx(e,t),Hu(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Xi(Error(oe(423)),t),t=Uy(e,t,n,r,s);break e}else if(n!==s){s=Xi(Error(oe(424)),t),t=Uy(e,t,n,r,s);break e}else for(Or=Gs(t.stateNode.containerInfo.firstChild),Ar=t,Tt=!0,on=null,r=Lx(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Gi(),n===s){t=fs(e,t,r);break e}dr(e,t,n,r)}t=t.child}return t;case 5:return Ux(t),e===null&&hp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,lp(n,s)?i=null:o!==null&&lp(n,o)&&(t.flags|=32),d_(e,t),dr(e,t,i,r),t.child;case 6:return e===null&&hp(t),null;case 13:return h_(e,t,r);case 4:return Wm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ki(t,null,n,r):dr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),Ly(e,t,n,s,r);case 7:return dr(e,t,t.pendingProps,r),t.child;case 8:return dr(e,t,t.pendingProps.children,r),t.child;case 12:return dr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,vt(Wu,n._currentValue),n._currentValue=i,o!==null)if(hn(o.value,i)){if(o.children===s.children&&!Sr.current){t=fs(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=os(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),pp(o.return,r,t),a.lanes|=r;break}l=l.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(oe(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),pp(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}dr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Mi(t,r),s=qr(s),n=n(s),t.flags|=1,dr(e,t,n,r),t.child;case 14:return n=t.type,s=rn(n,t.pendingProps),s=rn(n.type,s),Fy(e,t,n,s,r);case 15:return c_(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),du(e,t),t.tag=1,kr(n)?(e=!0,Uu(t)):e=!1,Mi(t,r),i_(t,n,s),gp(t,n,s,r),wp(null,t,n,!0,e,r);case 19:return p_(e,t,r);case 22:return u_(e,t,r)}throw Error(oe(156,t.tag))};function P_(e,t){return nx(e,t)}function G2(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(e,t,r,n){return new G2(e,t,r,n)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function K2(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sm)return 11;if(e===km)return 14}return 2}function Qs(e,t){var r=e.alternate;return r===null?(r=Zr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")sg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case gi:return Po(r.children,s,o,t);case bm:i=8,s|=8;break;case Uh:return e=Zr(12,r,t,s|2),e.elementType=Uh,e.lanes=o,e;case $h:return e=Zr(13,r,t,s),e.elementType=$h,e.lanes=o,e;case Vh:return e=Zr(19,r,t,s),e.elementType=Vh,e.lanes=o,e;case Uw:return $d(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fw:i=10;break e;case zw:i=9;break e;case Sm:i=11;break e;case km:i=14;break e;case Ms:i=16,n=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Zr(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Po(e,t,r,n){return e=Zr(7,e,n,t),e.lanes=r,e}function $d(e,t,r,n){return e=Zr(22,e,n,t),e.elementType=Uw,e.lanes=r,e.stateNode={isHidden:!1},e}function ch(e,t,r){return e=Zr(6,e,null,t),e.lanes=r,e}function uh(e,t,r){return t=Zr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function q2(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bf(0),this.expirationTimes=Bf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function og(e,t,r,n,s,o,i,a,l){return e=new q2(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Zr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vm(o),e}function X2(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A_)}catch(e){console.error(e)}}A_(),Aw.exports=zr;var xs=Aw.exports;const M_=pm(xs),rN=_w({__proto__:null,default:M_},[xs]);var Qy=xs;Fh.createRoot=Qy.createRoot,Fh.hydrateRoot=Qy.hydrateRoot;/** +`+o.stack}return{value:e,source:t,stack:s,digest:null}}function ah(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function vp(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var j2=typeof WeakMap=="function"?WeakMap:Map;function a_(e,t,r){r=os(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){qu||(qu=!0,Tp=n),vp(e,t)},r}function l_(e,t,r){r=os(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){vp(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){vp(e,t),typeof n!="function"&&(qs===null?qs=new Set([this]):qs.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function Ay(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new j2;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=H2.bind(null,e,t,r),t.then(e,e))}function My(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Iy(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=os(-1,1),t.tag=2,Ks(r,t,1))),r.lanes|=1),e)}var D2=ws.ReactCurrentOwner,br=!1;function dr(e,t,r,n){t.child=e===null?Lx(t,null,r,n):Ki(t,e.child,r,n)}function Ly(e,t,r,n,s){r=r.render;var o=t.ref;return Mi(t,s),n=Zm(e,t,r,n,o,s),r=Gm(),e!==null&&!br?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,fs(e,t,s)):(Tt&&r&&Mm(t),t.flags|=1,dr(e,t,n,s),t.child)}function Fy(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!sg(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,c_(e,t,o,n,s)):(e=pu(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(r=r.compare,r=r!==null?r:hl,r(i,n)&&e.ref===t.ref)return fs(e,t,s)}return t.flags|=1,e=Qs(o,n),e.ref=t.ref,e.return=t,t.child=e}function c_(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(hl(o,n)&&e.ref===t.ref)if(br=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(br=!0);else return t.lanes=e.lanes,fs(e,t,s)}return yp(e,t,r,n,s)}function u_(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},vt(Ei,Pr),Pr|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,vt(Ei,Pr),Pr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,vt(Ei,Pr),Pr|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,vt(Ei,Pr),Pr|=n;return dr(e,t,s,r),t.child}function d_(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function yp(e,t,r,n,s){var o=kr(r)?Ao:lr.current;return o=Zi(t,o),Mi(t,s),r=Zm(e,t,r,n,o,s),n=Gm(),e!==null&&!br?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,fs(e,t,s)):(Tt&&n&&Mm(t),t.flags|=1,dr(e,t,r,s),t.child)}function zy(e,t,r,n,s){if(kr(r)){var o=!0;Uu(t)}else o=!1;if(Mi(t,s),t.stateNode===null)du(e,t),i_(t,r,n),gp(t,r,n,s),n=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=r.contextType;typeof c=="object"&&c!==null?c=qr(c):(c=kr(r)?Ao:lr.current,c=Zi(t,c));var f=r.getDerivedStateFromProps,d=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==n||l!==c)&&Oy(t,i,n,c),Is=!1;var h=t.memoizedState;i.state=h,Hu(t,n,i,s),l=t.memoizedState,a!==n||h!==l||Sr.current||Is?(typeof f=="function"&&(mp(t,r,f,n),l=t.memoizedState),(a=Is||Dy(t,r,a,n,h,l,c))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),i.props=n,i.state=l,i.context=c,n=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,zx(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:rn(t.type,a),i.props=c,d=t.pendingProps,h=i.context,l=r.contextType,typeof l=="object"&&l!==null?l=qr(l):(l=kr(r)?Ao:lr.current,l=Zi(t,l));var p=r.getDerivedStateFromProps;(f=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==d||h!==l)&&Oy(t,i,n,l),Is=!1,h=t.memoizedState,i.state=h,Hu(t,n,i,s);var w=t.memoizedState;a!==d||h!==w||Sr.current||Is?(typeof p=="function"&&(mp(t,r,p,n),w=t.memoizedState),(c=Is||Dy(t,r,c,n,h,w,l)||!1)?(f||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,w,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,w,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),i.props=n,i.state=w,i.context=l,n=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return wp(e,t,r,n,o,s)}function wp(e,t,r,n,s,o){d_(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return s&&ky(t,r,!1),fs(e,t,o);n=t.stateNode,D2.current=t;var a=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=Ki(t,e.child,null,o),t.child=Ki(t,null,a,o)):dr(e,t,a,o),t.memoizedState=n.state,s&&ky(t,r,!0),t.child}function f_(e){var t=e.stateNode;t.pendingContext?Sy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Sy(e,t.context,!1),Wm(e,t.containerInfo)}function Uy(e,t,r,n,s){return Gi(),Lm(s),t.flags|=256,dr(e,t,r,n),t.child}var xp={dehydrated:null,treeContext:null,retryLane:0};function _p(e){return{baseLanes:e,cachePool:null,transitions:null}}function h_(e,t,r){var n=t.pendingProps,s=Pt.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),vt(Pt,s&1),e===null)return hp(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,o?(n=t.mode,o=t.child,i={mode:"hidden",children:i},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=$d(i,n,0,null),e=Po(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=_p(r),t.memoizedState=xp,e):Xm(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return O2(e,t,i,n,a,s,r);if(o){o=n.fallback,i=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(i&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=Qs(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=Qs(a,o):(o=Po(o,i,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,i=e.child.memoizedState,i=i===null?_p(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~r,t.memoizedState=xp,n}return o=e.child,e=o.sibling,n=Qs(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Xm(e,t){return t=$d({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function zc(e,t,r,n){return n!==null&&Lm(n),Ki(t,e.child,null,r),e=Xm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function O2(e,t,r,n,s,o,i){if(r)return t.flags&256?(t.flags&=-257,n=ah(Error(oe(422))),zc(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=$d({mode:"visible",children:n.children},s,0,null),o=Po(o,s,i,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&Ki(t,e.child,null,i),t.child.memoizedState=_p(i),t.memoizedState=xp,o);if(!(t.mode&1))return zc(e,t,i,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(oe(419)),n=ah(o,n,void 0),zc(e,t,i,n)}if(a=(i&e.childLanes)!==0,br||a){if(n=Xt,n!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,ds(e,s),dn(n,e,s,-1))}return ng(),n=ah(Error(oe(421))),zc(e,t,i,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Y2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Or=Gs(s.nextSibling),Ar=t,Tt=!0,on=null,e!==null&&(Br[Hr++]=ts,Br[Hr++]=rs,Br[Hr++]=Mo,ts=e.id,rs=e.overflow,Mo=t),t=Xm(t,n.children),t.flags|=4096,t)}function $y(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),pp(e.return,t,r)}function lh(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function p_(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(dr(e,t,n.children,r),n=Pt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$y(e,r,t);else if(e.tag===19)$y(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(vt(Pt,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Yu(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),lh(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Yu(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}lh(t,!0,r,null,o);break;case"together":lh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function du(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function fs(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Lo|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,r=Qs(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Qs(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function A2(e,t,r){switch(t.tag){case 3:f_(t),Gi();break;case 5:Ux(t);break;case 1:kr(t.type)&&Uu(t);break;case 4:Wm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;vt(Wu,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(vt(Pt,Pt.current&1),t.flags|=128,null):r&t.child.childLanes?h_(e,t,r):(vt(Pt,Pt.current&1),e=fs(e,t,r),e!==null?e.sibling:null);vt(Pt,Pt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return p_(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),vt(Pt,Pt.current),n)break;return null;case 22:case 23:return t.lanes=0,u_(e,t,r)}return fs(e,t,r)}var m_,bp,g_,v_;m_=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};bp=function(){};g_=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,So(Dn.current);var o=null;switch(r){case"input":s=Bh(e,s),n=Bh(e,n),o=[];break;case"select":s=At({},s,{value:void 0}),n=At({},n,{value:void 0}),o=[];break;case"textarea":s=Zh(e,s),n=Zh(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Fu)}Kh(r,n);var i;r=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(i in a)a.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(il.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var l=n[c];if(a=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(r||(r={}),r[i]=l[i])}else r||(o||(o=[]),o.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(il.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&wt("scroll",e),o||a===l||(o=[])):(o=o||[]).push(c,l))}r&&(o=o||[]).push("style",r);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};v_=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ta(e,t){if(!Tt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function or(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function M2(e,t,r){var n=t.pendingProps;switch(Im(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return or(t),null;case 1:return kr(t.type)&&zu(),or(t),null;case 3:return n=t.stateNode,qi(),xt(Sr),xt(lr),Hm(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Lc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,on!==null&&(Pp(on),on=null))),bp(e,t),or(t),null;case 5:Bm(t);var s=So(yl.current);if(r=t.type,e!==null&&t.stateNode!=null)g_(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(oe(166));return or(t),null}if(e=So(Dn.current),Lc(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[Cn]=t,n[gl]=o,e=(t.mode&1)!==0,r){case"dialog":wt("cancel",n),wt("close",n);break;case"iframe":case"object":case"embed":wt("load",n);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[Cn]=t,e[gl]=n,m_(e,t,!1,!1),t.stateNode=e;e:{switch(i=qh(r,n),r){case"dialog":wt("cancel",e),wt("close",e),s=n;break;case"iframe":case"object":case"embed":wt("load",e),s=n;break;case"video":case"audio":for(s=0;sQi&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304)}else{if(!n)if(e=Yu(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ta(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Tt)return or(t),null}else 2*zt()-o.renderingStartTime>Qi&&r!==1073741824&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=zt(),t.sibling=null,r=Pt.current,vt(Pt,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return rg(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Pr&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function I2(e,t){switch(Im(t),t.tag){case 1:return kr(t.type)&&zu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(),xt(Sr),xt(lr),Hm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bm(t),null;case 13:if(xt(Pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(Pt),null;case 4:return qi(),null;case 10:return Um(t.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var Uc=!1,ir=!1,L2=typeof WeakSet=="function"?WeakSet:Set,_e=null;function Ci(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){It(e,t,n)}else r.current=null}function Sp(e,t,r){try{r()}catch(n){It(e,t,n)}}var Vy=!1;function F2(e,t){if(ip=Mu,e=bx(),Am(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,l=-1,c=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||s!==0&&d.nodeType!==3||(a=i+s),d!==o||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++c===s&&(a=i),h===o&&++f===n&&(l=i),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ap={focusedElem:e,selectionRange:r},Mu=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var m=w.memoizedProps,x=w.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:rn(t.type,m),x);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(C){It(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return w=Vy,Vy=!1,w}function Qa(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Sp(t,r,o)}s=s.next}while(s!==n)}}function zd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function kp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function y_(e){var t=e.alternate;t!==null&&(e.alternate=null,y_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cn],delete t[gl],delete t[up],delete t[x2],delete t[_2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function w_(e){return e.tag===5||e.tag===3||e.tag===4}function Wy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||w_(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Fu));else if(n!==4&&(e=e.child,e!==null))for(Cp(e,t,r),e=e.sibling;e!==null;)Cp(e,t,r),e=e.sibling}function Ep(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Ep(e,t,r),e=e.sibling;e!==null;)Ep(e,t,r),e=e.sibling}var er=null,nn=!1;function Ps(e,t,r){for(r=r.child;r!==null;)x_(e,t,r),r=r.sibling}function x_(e,t,r){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(jd,r)}catch{}switch(r.tag){case 5:ir||Ci(r,t);case 6:var n=er,s=nn;er=null,Ps(e,t,r),er=n,nn=s,er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):er.removeChild(r.stateNode));break;case 18:er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?th(e.parentNode,r):e.nodeType===1&&th(e,r),dl(e)):th(er,r.stateNode));break;case 4:n=er,s=nn,er=r.stateNode.containerInfo,nn=!0,Ps(e,t,r),er=n,nn=s;break;case 0:case 11:case 14:case 15:if(!ir&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Sp(r,t,i),s=s.next}while(s!==n)}Ps(e,t,r);break;case 1:if(!ir&&(Ci(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){It(r,t,a)}Ps(e,t,r);break;case 21:Ps(e,t,r);break;case 22:r.mode&1?(ir=(n=ir)||r.memoizedState!==null,Ps(e,t,r),ir=n):Ps(e,t,r);break;default:Ps(e,t,r)}}function By(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new L2),t.forEach(function(n){var s=Z2.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}if(n=s,n=zt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*U2(n/1960))-n,10e?16:e,$s===null)var n=!1;else{if(e=$s,$s=null,Xu=0,ot&6)throw Error(oe(331));var s=ot;for(ot|=4,_e=e.current;_e!==null;){var o=_e,i=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lzt()-eg?No(e,0):Jm|=r),Cr(e,t)}function R_(e,t){t===0&&(e.mode&1?(t=jc,jc<<=1,!(jc&130023424)&&(jc=4194304)):t=1);var r=hr();e=ds(e,t),e!==null&&(ql(e,t,r),Cr(e,r))}function Y2(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),R_(e,r)}function Z2(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(oe(314))}n!==null&&n.delete(t),R_(e,r)}var N_;N_=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Sr.current)br=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return br=!1,A2(e,t,r);br=!!(e.flags&131072)}else br=!1,Tt&&t.flags&1048576&&Ox(t,Vu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;du(e,t),e=t.pendingProps;var s=Zi(t,lr.current);Mi(t,r),s=Zm(null,t,n,e,s,r);var o=Gm();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kr(n)?(o=!0,Uu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Vm(t),s.updater=Fd,t.stateNode=s,s._reactInternals=t,gp(t,n,e,r),t=wp(null,t,n,!0,o,r)):(t.tag=0,Tt&&o&&Mm(t),dr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(du(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=K2(n),e=rn(n,e),s){case 0:t=yp(null,t,n,e,r);break e;case 1:t=zy(null,t,n,e,r);break e;case 11:t=Ly(null,t,n,e,r);break e;case 14:t=Fy(null,t,n,rn(n.type,e),r);break e}throw Error(oe(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),yp(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),zy(e,t,n,s,r);case 3:e:{if(f_(t),e===null)throw Error(oe(387));n=t.pendingProps,o=t.memoizedState,s=o.element,zx(e,t),Hu(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Xi(Error(oe(423)),t),t=Uy(e,t,n,r,s);break e}else if(n!==s){s=Xi(Error(oe(424)),t),t=Uy(e,t,n,r,s);break e}else for(Or=Gs(t.stateNode.containerInfo.firstChild),Ar=t,Tt=!0,on=null,r=Lx(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Gi(),n===s){t=fs(e,t,r);break e}dr(e,t,n,r)}t=t.child}return t;case 5:return Ux(t),e===null&&hp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,lp(n,s)?i=null:o!==null&&lp(n,o)&&(t.flags|=32),d_(e,t),dr(e,t,i,r),t.child;case 6:return e===null&&hp(t),null;case 13:return h_(e,t,r);case 4:return Wm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ki(t,null,n,r):dr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),Ly(e,t,n,s,r);case 7:return dr(e,t,t.pendingProps,r),t.child;case 8:return dr(e,t,t.pendingProps.children,r),t.child;case 12:return dr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,vt(Wu,n._currentValue),n._currentValue=i,o!==null)if(hn(o.value,i)){if(o.children===s.children&&!Sr.current){t=fs(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=os(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),pp(o.return,r,t),a.lanes|=r;break}l=l.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(oe(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),pp(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}dr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Mi(t,r),s=qr(s),n=n(s),t.flags|=1,dr(e,t,n,r),t.child;case 14:return n=t.type,s=rn(n,t.pendingProps),s=rn(n.type,s),Fy(e,t,n,s,r);case 15:return c_(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),du(e,t),t.tag=1,kr(n)?(e=!0,Uu(t)):e=!1,Mi(t,r),i_(t,n,s),gp(t,n,s,r),wp(null,t,n,!0,e,r);case 19:return p_(e,t,r);case 22:return u_(e,t,r)}throw Error(oe(156,t.tag))};function P_(e,t){return nx(e,t)}function G2(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(e,t,r,n){return new G2(e,t,r,n)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function K2(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sm)return 11;if(e===km)return 14}return 2}function Qs(e,t){var r=e.alternate;return r===null?(r=Zr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function pu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")sg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case gi:return Po(r.children,s,o,t);case bm:i=8,s|=8;break;case Uh:return e=Zr(12,r,t,s|2),e.elementType=Uh,e.lanes=o,e;case $h:return e=Zr(13,r,t,s),e.elementType=$h,e.lanes=o,e;case Vh:return e=Zr(19,r,t,s),e.elementType=Vh,e.lanes=o,e;case Uw:return $d(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fw:i=10;break e;case zw:i=9;break e;case Sm:i=11;break e;case km:i=14;break e;case Ms:i=16,n=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Zr(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Po(e,t,r,n){return e=Zr(7,e,n,t),e.lanes=r,e}function $d(e,t,r,n){return e=Zr(22,e,n,t),e.elementType=Uw,e.lanes=r,e.stateNode={isHidden:!1},e}function ch(e,t,r){return e=Zr(6,e,null,t),e.lanes=r,e}function uh(e,t,r){return t=Zr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function q2(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bf(0),this.expirationTimes=Bf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function og(e,t,r,n,s,o,i,a,l){return e=new q2(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Zr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vm(o),e}function X2(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A_)}catch(e){console.error(e)}}A_(),Aw.exports=zr;var xs=Aw.exports;const M_=pm(xs),rN=_w({__proto__:null,default:M_},[xs]);var Qy=xs;Fh.createRoot=Qy.createRoot,Fh.hydrateRoot=Qy.hydrateRoot;/** * @remix-run/router v1.18.0 * * Copyright (c) Remix Software Inc. @@ -220,7 +220,7 @@ Error generating stack: `+o.message+` If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},EM="DialogDescriptionWarning",TM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cS(EM).contentName}}.`;return y.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Zg=Kb,Gg=Xb,Kg=Jb,ic=eS,ac=tS,lc=nS,cc=oS,lf=aS;const uS=Zg,dS=Gg,RM=Kg,fS=y.forwardRef(({className:e,...t},r)=>u.jsx(ic,{className:we("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));fS.displayName=ic.displayName;const NM=ec("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),qg=y.forwardRef(({side:e="right",className:t,children:r,...n},s)=>u.jsxs(RM,{children:[u.jsx(fS,{}),u.jsxs(ac,{ref:s,className:we(NM({side:e}),t),...n,children:[r,u.jsxs(lf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[u.jsx(pg,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qg.displayName=ac.displayName;const hS=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col space-y-2 text-center sm:text-left",e),...t});hS.displayName="SheetHeader";const pS=y.forwardRef(({className:e,...t},r)=>u.jsx(lc,{ref:r,className:we("text-lg font-semibold text-foreground",e),...t}));pS.displayName=lc.displayName;const PM=y.forwardRef(({className:e,...t},r)=>u.jsx(cc,{ref:r,className:we("text-sm text-muted-foreground",e),...t}));PM.displayName=cc.displayName;class Ir extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Ir.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Ir||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const qc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function jM(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||DM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}mS=typeof atob!="function"||AM?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const X0="pb_auth";class MM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!gS(this.token)}get isAdmin(){return Ui(this.token).type==="admin"}get isAuthRecord(){return Ui(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=X0){const n=jM(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=X0){var l,c;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Ui(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=q0(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(l=o==null?void 0:o.model)==null?void 0:l.id,email:(c=o==null?void 0:o.model)==null?void 0:c.email};const f=["collectionId","username","verified"];for(const d in this.model)f.includes(d)&&(o.model[d]=this.model[d]);i=q0(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class IM extends MM{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class qo{constructor(t){this.client=t}}class LM extends qo{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class Xg extends qo{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Ir({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function Rr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Sh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class FM extends Xg{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Rr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Sh(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(c,f,d,h){Sh(c);const p=c.beforeSend,w=c.authStore.model,m=c.authStore.onChange((x,g)=>{(!x||(g==null?void 0:g.id)!=(w==null?void 0:w.id)||(g!=null&&g.collectionId||w!=null&&w.collectionId)&&(g==null?void 0:g.collectionId)!=(w==null?void 0:w.collectionId))&&Sh(c)});c._resetAutoRefresh=function(){m(),c.beforeSend=p,delete c._resetAutoRefresh},c.beforeSend=async(x,g)=>{var E;const v=c.authStore.token;if((E=g.query)!=null&&E.autoRefresh)return p?p(x,g):{url:x,sendOptions:g};let _=c.authStore.isValid;if(_&&gS(c.authStore.token,f))try{await d()}catch{_=!1}_||await h();const C=g.headers||{};for(let T in C)if(T.toLowerCase()=="authorization"&&v==C[T]&&c.authStore.token){C[T]=c.authStore.token;break}return g.headers=C,p?p(x,g):{url:x,sendOptions:g}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=Rr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Rr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Rr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const zM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function vS(e){if(e){e.query=e.query||{};for(let t in e)zM.includes(t)||(e.query[t]=e[t],delete e[t])}}class yS extends qo{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){vS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const l=a;let c;try{c=JSON.parse(l==null?void 0:l.data)}catch{}r(c||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===r&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Ir(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class UM extends Xg{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Rr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return l=Rr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",l,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then(c=>this.authResponse(c))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=Q0(void 0));const s=new yS(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var h;const c=l.authProviders.find(p=>p.name===r.provider);if(!c)throw new Ir(new Error(`Missing or invalid provider "${r.provider}".`));const f=this.client.buildUrl("/api/oauth2-redirect"),d=a?(h=this.client.cancelControllers)==null?void 0:h[a]:void 0;return d&&(d.signal.onabort=()=>{o()}),new Promise(async(p,w)=>{var m;try{await s.subscribe("@oauth2",async _=>{var E;const C=s.clientId;try{if(!_.state||C!==_.state)throw new Error("State parameters don't match.");if(_.error||!_.code)throw new Error("OAuth2 redirect error or missing code: "+_.error);const T=Object.assign({},r);delete T.provider,delete T.scopes,delete T.createData,delete T.urlCallback,(E=d==null?void 0:d.signal)!=null&&E.onabort&&(d.signal.onabort=null);const P=await this.authWithOAuth2Code(c.name,_.code,c.codeVerifier,f,r.createData,T);p(P)}catch(T){w(new Ir(T))}o()});const x={state:s.clientId};(m=r.scopes)!=null&&m.length&&(x.scope=r.scopes.join(" "));const g=this._replaceQueryParams(c.authUrl+f,x);await(r.urlCallback||function(_){n?n.location.href=_:n=Q0(_)})(g)}catch(x){o(),w(new Ir(x))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Rr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Rr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Rr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Rr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Rr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=Ui(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Rr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Rr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=Ui(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function Q0(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Ir(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class $M extends Xg{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class VM extends qo{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class WM extends qo{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class BM extends qo{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class HM extends qo{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class YM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new IM,this.admins=new FM(this),this.collections=new $M(this),this.files=new BM(this),this.logs=new VM(this),this.settings=new LM(this),this.realtime=new yS(this),this.health=new WM(this),this.backups=new HM(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new UM(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Ir({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Ir(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),vS(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var ZM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const GM=ZM.VITE_API_DOMAIN;console.log(GM);let Xc;const Dt=()=>Xc||(Xc=new YM("/"),Xc);//! moment.js +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},EM="DialogDescriptionWarning",TM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cS(EM).contentName}}.`;return y.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Zg=Kb,Gg=Xb,Kg=Jb,ic=eS,ac=tS,lc=nS,cc=oS,lf=aS;const uS=Zg,dS=Gg,RM=Kg,fS=y.forwardRef(({className:e,...t},r)=>u.jsx(ic,{className:we("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));fS.displayName=ic.displayName;const NM=ec("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),qg=y.forwardRef(({side:e="right",className:t,children:r,...n},s)=>u.jsxs(RM,{children:[u.jsx(fS,{}),u.jsxs(ac,{ref:s,className:we(NM({side:e}),t),...n,children:[r,u.jsxs(lf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[u.jsx(pg,{className:"h-4 w-4 dark:text-stone-200"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qg.displayName=ac.displayName;const hS=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col space-y-2 text-center sm:text-left",e),...t});hS.displayName="SheetHeader";const pS=y.forwardRef(({className:e,...t},r)=>u.jsx(lc,{ref:r,className:we("text-lg font-semibold text-foreground",e),...t}));pS.displayName=lc.displayName;const PM=y.forwardRef(({className:e,...t},r)=>u.jsx(cc,{ref:r,className:we("text-sm text-muted-foreground",e),...t}));PM.displayName=cc.displayName;class Ir extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Ir.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Ir||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const qc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function jM(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||DM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}mS=typeof atob!="function"||AM?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const X0="pb_auth";class MM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!gS(this.token)}get isAdmin(){return Ui(this.token).type==="admin"}get isAuthRecord(){return Ui(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=X0){const n=jM(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=X0){var l,c;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Ui(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=q0(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(l=o==null?void 0:o.model)==null?void 0:l.id,email:(c=o==null?void 0:o.model)==null?void 0:c.email};const f=["collectionId","username","verified"];for(const d in this.model)f.includes(d)&&(o.model[d]=this.model[d]);i=q0(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class IM extends MM{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class qo{constructor(t){this.client=t}}class LM extends qo{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class Xg extends qo{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Ir({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function Rr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Sh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class FM extends Xg{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Rr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Sh(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(c,f,d,h){Sh(c);const p=c.beforeSend,w=c.authStore.model,m=c.authStore.onChange((x,g)=>{(!x||(g==null?void 0:g.id)!=(w==null?void 0:w.id)||(g!=null&&g.collectionId||w!=null&&w.collectionId)&&(g==null?void 0:g.collectionId)!=(w==null?void 0:w.collectionId))&&Sh(c)});c._resetAutoRefresh=function(){m(),c.beforeSend=p,delete c._resetAutoRefresh},c.beforeSend=async(x,g)=>{var E;const v=c.authStore.token;if((E=g.query)!=null&&E.autoRefresh)return p?p(x,g):{url:x,sendOptions:g};let _=c.authStore.isValid;if(_&&gS(c.authStore.token,f))try{await d()}catch{_=!1}_||await h();const C=g.headers||{};for(let T in C)if(T.toLowerCase()=="authorization"&&v==C[T]&&c.authStore.token){C[T]=c.authStore.token;break}return g.headers=C,p?p(x,g):{url:x,sendOptions:g}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=Rr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Rr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Rr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const zM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function vS(e){if(e){e.query=e.query||{};for(let t in e)zM.includes(t)||(e.query[t]=e[t],delete e[t])}}class yS extends qo{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){vS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const l=a;let c;try{c=JSON.parse(l==null?void 0:l.data)}catch{}r(c||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===r&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Ir(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class UM extends Xg{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Rr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return l=Rr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",l,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then(c=>this.authResponse(c))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=Q0(void 0));const s=new yS(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var h;const c=l.authProviders.find(p=>p.name===r.provider);if(!c)throw new Ir(new Error(`Missing or invalid provider "${r.provider}".`));const f=this.client.buildUrl("/api/oauth2-redirect"),d=a?(h=this.client.cancelControllers)==null?void 0:h[a]:void 0;return d&&(d.signal.onabort=()=>{o()}),new Promise(async(p,w)=>{var m;try{await s.subscribe("@oauth2",async _=>{var E;const C=s.clientId;try{if(!_.state||C!==_.state)throw new Error("State parameters don't match.");if(_.error||!_.code)throw new Error("OAuth2 redirect error or missing code: "+_.error);const T=Object.assign({},r);delete T.provider,delete T.scopes,delete T.createData,delete T.urlCallback,(E=d==null?void 0:d.signal)!=null&&E.onabort&&(d.signal.onabort=null);const P=await this.authWithOAuth2Code(c.name,_.code,c.codeVerifier,f,r.createData,T);p(P)}catch(T){w(new Ir(T))}o()});const x={state:s.clientId};(m=r.scopes)!=null&&m.length&&(x.scope=r.scopes.join(" "));const g=this._replaceQueryParams(c.authUrl+f,x);await(r.urlCallback||function(_){n?n.location.href=_:n=Q0(_)})(g)}catch(x){o(),w(new Ir(x))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Rr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Rr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Rr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Rr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Rr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=Ui(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Rr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Rr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=Ui(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function Q0(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Ir(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class $M extends Xg{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class VM extends qo{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class WM extends qo{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class BM extends qo{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class HM extends qo{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class YM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new IM,this.admins=new FM(this),this.collections=new $M(this),this.files=new BM(this),this.logs=new VM(this),this.settings=new LM(this),this.realtime=new yS(this),this.health=new WM(this),this.backups=new HM(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new UM(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Ir({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Ir(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),vS(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var ZM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const GM=ZM.VITE_API_DOMAIN;console.log(GM);let Xc;const Dt=()=>Xc||(Xc=new YM("/"),Xc);//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT @@ -228,8 +228,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do var wS;function me(){return wS.apply(null,arguments)}function KM(e){wS=e}function gn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function jo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function at(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Qg(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(at(e,t))return!1;return!0}function wr(e){return e===void 0}function vs(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function uc(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function xS(e,t){var r=[],n,s=e.length;for(n=0;n>>0,n;for(n=0;n0)for(r=0;r=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var rv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Qc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ch={},$i={};function Re(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&($i[e]=s),t&&($i[t[0]]=function(){return In(s.apply(this,arguments),t[1],t[2])}),r&&($i[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function eI(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function tI(e){var t=e.match(rv),r,n;for(r=0,n=t.length;r=0&&Qc.test(e);)e=e.replace(Qc,n),Qc.lastIndex=0,r-=1;return e}var rI={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function nI(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(rv).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var sI="Invalid date";function oI(){return this._invalidDate}var iI="%d",aI=/\d{1,2}/;function lI(e){return this._ordinal.replace("%d",e)}var cI={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function uI(e,t,r,n){var s=this._relativeTime[r];return Un(s)?s(e,t,r,n):s.replace(/%d/i,e)}function dI(e,t){var r=this._relativeTime[e>0?"future":"past"];return Un(r)?r(t):r.replace(/%s/i,t)}var tw={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jr(e){return typeof e=="string"?tw[e]||tw[e.toLowerCase()]:void 0}function nv(e){var t={},r,n;for(n in e)at(e,n)&&(r=Jr(n),r&&(t[r]=e[n]));return t}var fI={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function hI(e){var t=[],r;for(r in e)at(e,r)&&t.push({unit:r,priority:fI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var kS=/\d/,$r=/\d\d/,CS=/\d{3}/,sv=/\d{4}/,uf=/[+-]?\d{6}/,bt=/\d\d?/,ES=/\d\d\d\d?/,TS=/\d\d\d\d\d\d?/,df=/\d{1,3}/,ov=/\d{1,4}/,ff=/[+-]?\d{1,6}/,ma=/\d+/,hf=/[+-]?\d+/,pI=/Z|[+-]\d\d:?\d\d/gi,pf=/Z|[+-]\d\d(?::?\d\d)?/gi,mI=/[+-]?\d+(\.\d{1,3})?/,fc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ga=/^[1-9]\d?/,iv=/^([1-9]\d|\d)/,cd;cd={};function xe(e,t,r){cd[e]=Un(t)?t:function(n,s){return n&&r?r:t}}function gI(e,t){return at(cd,e)?cd[e](t._strict,t._locale):new RegExp(vI(e))}function vI(e){return as(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function as(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Yr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Je(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=Yr(t)),r}var Yp={};function pt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),vs(t)&&(n=function(o,i){i[t]=Je(o)}),s=e.length,r=0;r68?1900:2e3)};var RS=va("FullYear",!0);function _I(){return mf(this.year())}function va(e,t){return function(r){return r!=null?(NS(this,e,r),me.updateOffset(this,t),this):Pl(this,e)}}function Pl(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function NS(e,t,r){var n,s,o,i,a;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,i=e.month(),a=e.date(),a=a===29&&i===1&&!mf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function bI(e){return e=Jr(e),Un(this[e])?this[e]():this}function SI(e,t){if(typeof e=="object"){e=nv(e);var r=hI(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,o,i),a}function jl(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ud(e,t,r){var n=7+t-r,s=(7+jl(e,0,n).getUTCDay()-t)%7;return-s+n-1}function MS(e,t,r,n,s){var o=(7+r-n)%7,i=ud(e,n,s),a=1+7*(t-1)+o+i,l,c;return a<=0?(l=e-1,c=tl(l)+a):a>tl(e)?(l=e+1,c=a-tl(e)):(l=e,c=a),{year:l,dayOfYear:c}}function Dl(e,t,r){var n=ud(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+ls(i,t,r)):s>ls(e.year(),t,r)?(o=s-ls(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function ls(e,t,r){var n=ud(e,t,r),s=ud(e+1,t,r);return(tl(e)-n+s)/7}Re("w",["ww",2],"wo","week");Re("W",["WW",2],"Wo","isoWeek");xe("w",bt,ga);xe("ww",bt,$r);xe("W",bt,ga);xe("WW",bt,$r);hc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=Je(e)});function II(e){return Dl(e,this._week.dow,this._week.doy).week}var LI={dow:0,doy:6};function FI(){return this._week.dow}function zI(){return this._week.doy}function UI(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function $I(e){var t=Dl(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Re("d",0,"do","day");Re("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Re("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Re("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Re("e",0,0,"weekday");Re("E",0,0,"isoWeekday");xe("d",bt);xe("e",bt);xe("E",bt);xe("dd",function(e,t){return t.weekdaysMinRegex(e)});xe("ddd",function(e,t){return t.weekdaysShortRegex(e)});xe("dddd",function(e,t){return t.weekdaysRegex(e)});hc(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:We(r).invalidWeekday=e});hc(["d","e","E"],function(e,t,r,n){t[n]=Je(e)});function VI(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function WI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function lv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var BI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),IS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),HI="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),YI=fc,ZI=fc,GI=fc;function KI(e,t){var r=gn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?lv(r,this._week.dow):e?r[e.day()]:r}function qI(e){return e===!0?lv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function XI(e){return e===!0?lv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function QI(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=zn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1||(s=Ft.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=Ft.call(this._minWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function JI(e,t,r){var n,s,o;if(this._weekdaysParseExact)return QI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=zn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function eL(e){if(!this.isValid())return e!=null?this:NaN;var t=Pl(this,"Day");return e!=null?(e=VI(e,this.localeData()),this.add(e-t,"d")):t}function tL(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function rL(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=WI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function nL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||cv.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(at(this,"_weekdaysRegex")||(this._weekdaysRegex=YI),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function sL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||cv.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(at(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ZI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function oL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||cv.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(at(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=GI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function cv(){function e(f,d){return d.length-f.length}var t=[],r=[],n=[],s=[],o,i,a,l,c;for(o=0;o<7;o++)i=zn([2e3,1]).day(o),a=as(this.weekdaysMin(i,"")),l=as(this.weekdaysShort(i,"")),c=as(this.weekdays(i,"")),t.push(a),r.push(l),n.push(c),s.push(a),s.push(l),s.push(c);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function uv(){return this.hours()%12||12}function iL(){return this.hours()||24}Re("H",["HH",2],0,"hour");Re("h",["hh",2],0,uv);Re("k",["kk",2],0,iL);Re("hmm",0,0,function(){return""+uv.apply(this)+In(this.minutes(),2)});Re("hmmss",0,0,function(){return""+uv.apply(this)+In(this.minutes(),2)+In(this.seconds(),2)});Re("Hmm",0,0,function(){return""+this.hours()+In(this.minutes(),2)});Re("Hmmss",0,0,function(){return""+this.hours()+In(this.minutes(),2)+In(this.seconds(),2)});function LS(e,t){Re(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}LS("a",!0);LS("A",!1);function FS(e,t){return t._meridiemParse}xe("a",FS);xe("A",FS);xe("H",bt,iv);xe("h",bt,ga);xe("k",bt,ga);xe("HH",bt,$r);xe("hh",bt,$r);xe("kk",bt,$r);xe("hmm",ES);xe("hmmss",TS);xe("Hmm",ES);xe("Hmmss",TS);pt(["H","HH"],Zt);pt(["k","kk"],function(e,t,r){var n=Je(e);t[Zt]=n===24?0:n});pt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});pt(["h","hh"],function(e,t,r){t[Zt]=Je(e),We(r).bigHour=!0});pt("hmm",function(e,t,r){var n=e.length-2;t[Zt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n)),We(r).bigHour=!0});pt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Zt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n,2)),t[ss]=Je(e.substr(s)),We(r).bigHour=!0});pt("Hmm",function(e,t,r){var n=e.length-2;t[Zt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n))});pt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Zt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n,2)),t[ss]=Je(e.substr(s))});function aL(e){return(e+"").toLowerCase().charAt(0)==="p"}var lL=/[ap]\.?m?\.?/i,cL=va("Hours",!0);function uL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var zS={calendar:QM,longDateFormat:rI,invalidDate:sI,ordinal:iI,dayOfMonthOrdinalParse:aI,relativeTime:cI,months:CI,monthsShort:PS,week:LI,weekdays:BI,weekdaysMin:HI,weekdaysShort:IS,meridiemParse:lL},Ct={},Aa={},Ol;function dL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=gf(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&dL(o,n)>=r-1)break;r--}t++}return Ol}function hL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function gf(e){var t=null,r;if(Ct[e]===void 0&&typeof Nu<"u"&&Nu&&Nu.exports&&hL(e))try{t=Ol._abbr,r=require,r("./locale/"+e),Js(t)}catch{Ct[e]=null}return Ct[e]}function Js(e,t){var r;return e&&(wr(t)?r=Cs(e):r=dv(e,t),r?Ol=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ol._abbr}function dv(e,t){if(t!==null){var r,n=zS;if(t.abbr=e,Ct[e]!=null)bS("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ct[e]._config;else if(t.parentLocale!=null)if(Ct[t.parentLocale]!=null)n=Ct[t.parentLocale]._config;else if(r=gf(t.parentLocale),r!=null)n=r._config;else return Aa[t.parentLocale]||(Aa[t.parentLocale]=[]),Aa[t.parentLocale].push({name:e,config:t}),null;return Ct[e]=new tv(Bp(n,t)),Aa[e]&&Aa[e].forEach(function(s){dv(s.name,s.config)}),Js(e),Ct[e]}else return delete Ct[e],null}function pL(e,t){if(t!=null){var r,n,s=zS;Ct[e]!=null&&Ct[e].parentLocale!=null?Ct[e].set(Bp(Ct[e]._config,t)):(n=gf(e),n!=null&&(s=n._config),t=Bp(s,t),n==null&&(t.abbr=e),r=new tv(t),r.parentLocale=Ct[e],Ct[e]=r),Js(e)}else Ct[e]!=null&&(Ct[e].parentLocale!=null?(Ct[e]=Ct[e].parentLocale,e===Js()&&Js(e)):Ct[e]!=null&&delete Ct[e]);return Ct[e]}function Cs(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ol;if(!gn(e)){if(t=gf(e),t)return t;e=[e]}return fL(e)}function mL(){return Hp(Ct)}function fv(e){var t,r=e._a;return r&&We(e).overflow===-2&&(t=r[ns]<0||r[ns]>11?ns:r[Tn]<1||r[Tn]>av(r[ar],r[ns])?Tn:r[Zt]<0||r[Zt]>24||r[Zt]===24&&(r[ln]!==0||r[ss]!==0||r[To]!==0)?Zt:r[ln]<0||r[ln]>59?ln:r[ss]<0||r[ss]>59?ss:r[To]<0||r[To]>999?To:-1,We(e)._overflowDayOfYear&&(tTn)&&(t=Tn),We(e)._overflowWeeks&&t===-1&&(t=wI),We(e)._overflowWeekday&&t===-1&&(t=xI),We(e).overflow=t),e}var gL=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vL=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yL=/Z|[+-]\d\d(?::?\d\d)?/,Jc=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Eh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wL=/^\/?Date\((-?\d+)/i,xL=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,_L={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function US(e){var t,r,n=e._i,s=gL.exec(n)||vL.exec(n),o,i,a,l,c=Jc.length,f=Eh.length;if(s){for(We(e).iso=!0,t=0,r=c;ttl(i)||e._dayOfYear===0)&&(We(e)._overflowDayOfYear=!0),r=jl(i,0,e._dayOfYear),e._a[ns]=r.getUTCMonth(),e._a[Tn]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Zt]===24&&e._a[ln]===0&&e._a[ss]===0&&e._a[To]===0&&(e._nextDay=!0,e._a[Zt]=0),e._d=(e._useUTC?jl:MI).apply(null,n),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Zt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(We(e).weekdayMismatch=!0)}}function NL(e){var t,r,n,s,o,i,a,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=hi(t.GG,e._a[ar],Dl(_t(),1,4).year),n=hi(t.W,1),s=hi(t.E,1),(s<1||s>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=Dl(_t(),o,i),r=hi(t.gg,e._a[ar],c.year),n=hi(t.w,c.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(l=!0)):s=o),n<1||n>ls(r,o,i)?We(e)._overflowWeeks=!0:l!=null?We(e)._overflowWeekday=!0:(a=MS(r,n,s,o,i),e._a[ar]=a.year,e._dayOfYear=a.dayOfYear)}me.ISO_8601=function(){};me.RFC_2822=function(){};function pv(e){if(e._f===me.ISO_8601){US(e);return}if(e._f===me.RFC_2822){$S(e);return}e._a=[],We(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,l=0,c,f;for(s=SS(e._f,e._locale).match(rv)||[],f=s.length,r=0;r0&&We(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),$i[o]?(n?We(e).empty=!1:We(e).unusedTokens.push(o),yI(o,n,e)):e._strict&&!n&&We(e).unusedTokens.push(o);We(e).charsLeftOver=a-l,t.length>0&&We(e).unusedInput.push(t),e._a[Zt]<=12&&We(e).bigHour===!0&&e._a[Zt]>0&&(We(e).bigHour=void 0),We(e).parsedDateParts=e._a.slice(0),We(e).meridiem=e._meridiem,e._a[Zt]=PL(e._locale,e._a[Zt],e._meridiem),c=We(e).era,c!==null&&(e._a[ar]=e._locale.erasConvertYear(c,e._a[ar])),hv(e),fv(e)}function PL(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function jL(e){var t,r,n,s,o,i,a=!1,l=e._f.length;if(l===0){We(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:cf()});function BS(e,t){var r,n;if(t.length===1&&gn(t[0])&&(t=t[0]),!t.length)return _t();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function QL(){if(!wr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return ev(e,this),e=VS(e),e._a?(t=e._isUTC?zn(e._a):_t(e._a),this._isDSTShifted=this.isValid()&&WL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function JL(){return this.isValid()?!this._isUTC:!1}function eF(){return this.isValid()?this._isUTC:!1}function YS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var tF=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,rF=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xn(e,t){var r=e,n=null,s,o,i;return xu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:vs(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=tF.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:Je(n[Tn])*s,h:Je(n[Zt])*s,m:Je(n[ln])*s,s:Je(n[ss])*s,ms:Je(Zp(n[To]*1e3))*s}):(n=rF.exec(e))?(s=n[1]==="-"?-1:1,r={y:vo(n[2],s),M:vo(n[3],s),w:vo(n[4],s),d:vo(n[5],s),h:vo(n[6],s),m:vo(n[7],s),s:vo(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=nF(_t(r.from),_t(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new vf(r),xu(e)&&at(e,"_locale")&&(o._locale=e._locale),xu(e)&&at(e,"_isValid")&&(o._isValid=e._isValid),o}xn.fn=vf.prototype;xn.invalid=VL;function vo(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function nw(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function nF(e,t){var r;return e.isValid()&&t.isValid()?(t=gv(t,e),e.isBefore(t)?r=nw(e,t):(r=nw(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function ZS(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(bS(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),s=xn(r,n),GS(this,s,e),this}}function GS(e,t,r,n){var s=t._milliseconds,o=Zp(t._days),i=Zp(t._months);e.isValid()&&(n=n??!0,i&&DS(e,Pl(e,"Month")+i*r),o&&NS(e,"Date",Pl(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&me.updateOffset(e,o||i))}var sF=ZS(1,"add"),oF=ZS(-1,"subtract");function KS(e){return typeof e=="string"||e instanceof String}function iF(e){return vn(e)||uc(e)||KS(e)||vs(e)||lF(e)||aF(e)||e===null||e===void 0}function aF(e){var t=jo(e)&&!Qg(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?wu(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Un(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",wu(r,"Z")):wu(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function bF(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(r+n+s+o)}function SF(e){e||(e=this.isUtc()?me.defaultFormatUtc:me.defaultFormat);var t=wu(this,e);return this.localeData().postformat(t)}function kF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||_t(e).isValid())?xn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function CF(e){return this.from(_t(),e)}function EF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||_t(e).isValid())?xn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function TF(e){return this.to(_t(),e)}function qS(e){var t;return e===void 0?this._locale._abbr:(t=Cs(e),t!=null&&(this._locale=t),this)}var XS=Qr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function QS(){return this._locale}var dd=1e3,Vi=60*dd,fd=60*Vi,JS=(365*400+97)*24*fd;function Wi(e,t){return(e%t+t)%t}function ek(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-JS:new Date(e,t,r).valueOf()}function tk(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-JS:Date.UTC(e,t,r)}function RF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tk:ek,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Wi(t+(this._isUTC?0:this.utcOffset()*Vi),fd);break;case"minute":t=this._d.valueOf(),t-=Wi(t,Vi);break;case"second":t=this._d.valueOf(),t-=Wi(t,dd);break}return this._d.setTime(t),me.updateOffset(this,!0),this}function NF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tk:ek,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=fd-Wi(t+(this._isUTC?0:this.utcOffset()*Vi),fd)-1;break;case"minute":t=this._d.valueOf(),t+=Vi-Wi(t,Vi)-1;break;case"second":t=this._d.valueOf(),t+=dd-Wi(t,dd)-1;break}return this._d.setTime(t),me.updateOffset(this,!0),this}function PF(){return this._d.valueOf()-(this._offset||0)*6e4}function jF(){return Math.floor(this.valueOf()/1e3)}function DF(){return new Date(this.valueOf())}function OF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function AF(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function MF(){return this.isValid()?this.toISOString():null}function IF(){return Jg(this)}function LF(){return Vs({},We(this))}function FF(){return We(this).overflow}function zF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Re("N",0,0,"eraAbbr");Re("NN",0,0,"eraAbbr");Re("NNN",0,0,"eraAbbr");Re("NNNN",0,0,"eraName");Re("NNNNN",0,0,"eraNarrow");Re("y",["y",1],"yo","eraYear");Re("y",["yy",2],0,"eraYear");Re("y",["yyy",3],0,"eraYear");Re("y",["yyyy",4],0,"eraYear");xe("N",vv);xe("NN",vv);xe("NNN",vv);xe("NNNN",qF);xe("NNNNN",XF);pt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?We(r).era=s:We(r).invalidEra=e});xe("y",ma);xe("yy",ma);xe("yyy",ma);xe("yyyy",ma);xe("yo",QF);pt(["y","yy","yyy","yyyy"],ar);pt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ar]=r._locale.eraYearOrdinalParse(e,s):t[ar]=parseInt(e,10)});function UF(e,t){var r,n,s,o=this._eras||Cs("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function VF(e,t){var r=e.since<=e.until?1:-1;return t===void 0?me(e.since).year():me(e.since).year()+(t-e.offset)*r}function WF(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),o4.call(this,e,t,r,n,s))}function o4(e,t,r,n,s){var o=MS(e,t,r,n,s),i=jl(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Re("Q",0,"Qo","quarter");xe("Q",kS);pt("Q",function(e,t){t[ns]=(Je(e)-1)*3});function i4(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Re("D",["DD",2],"Do","date");xe("D",bt,ga);xe("DD",bt,$r);xe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});pt(["D","DD"],Tn);pt("Do",function(e,t){t[Tn]=Je(e.match(bt)[0])});var nk=va("Date",!0);Re("DDD",["DDDD",3],"DDDo","dayOfYear");xe("DDD",df);xe("DDDD",CS);pt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=Je(e)});function a4(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Re("m",["mm",2],0,"minute");xe("m",bt,iv);xe("mm",bt,$r);pt(["m","mm"],ln);var l4=va("Minutes",!1);Re("s",["ss",2],0,"second");xe("s",bt,iv);xe("ss",bt,$r);pt(["s","ss"],ss);var c4=va("Seconds",!1);Re("S",0,0,function(){return~~(this.millisecond()/100)});Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Re(0,["SSS",3],0,"millisecond");Re(0,["SSSS",4],0,function(){return this.millisecond()*10});Re(0,["SSSSS",5],0,function(){return this.millisecond()*100});Re(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Re(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Re(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Re(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});xe("S",df,kS);xe("SS",df,$r);xe("SSS",df,CS);var Ws,sk;for(Ws="SSSS";Ws.length<=9;Ws+="S")xe(Ws,ma);function u4(e,t){t[To]=Je(("0."+e)*1e3)}for(Ws="S";Ws.length<=9;Ws+="S")pt(Ws,u4);sk=va("Milliseconds",!1);Re("z",0,0,"zoneAbbr");Re("zz",0,0,"zoneName");function d4(){return this._isUTC?"UTC":""}function f4(){return this._isUTC?"Coordinated Universal Time":""}var ae=dc.prototype;ae.add=sF;ae.calendar=dF;ae.clone=fF;ae.diff=wF;ae.endOf=NF;ae.format=SF;ae.from=kF;ae.fromNow=CF;ae.to=EF;ae.toNow=TF;ae.get=bI;ae.invalidAt=FF;ae.isAfter=hF;ae.isBefore=pF;ae.isBetween=mF;ae.isSame=gF;ae.isSameOrAfter=vF;ae.isSameOrBefore=yF;ae.isValid=IF;ae.lang=XS;ae.locale=qS;ae.localeData=QS;ae.max=IL;ae.min=ML;ae.parsingFlags=LF;ae.set=SI;ae.startOf=RF;ae.subtract=oF;ae.toArray=OF;ae.toObject=AF;ae.toDate=DF;ae.toISOString=_F;ae.inspect=bF;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=MF;ae.toString=xF;ae.unix=jF;ae.valueOf=PF;ae.creationData=zF;ae.eraName=WF;ae.eraNarrow=BF;ae.eraAbbr=HF;ae.eraYear=YF;ae.year=RS;ae.isLeapYear=_I;ae.weekYear=JF;ae.isoWeekYear=e4;ae.quarter=ae.quarters=i4;ae.month=OS;ae.daysInMonth=DI;ae.week=ae.weeks=UI;ae.isoWeek=ae.isoWeeks=$I;ae.weeksInYear=n4;ae.weeksInWeekYear=s4;ae.isoWeeksInYear=t4;ae.isoWeeksInISOWeekYear=r4;ae.date=nk;ae.day=ae.days=eL;ae.weekday=tL;ae.isoWeekday=rL;ae.dayOfYear=a4;ae.hour=ae.hours=cL;ae.minute=ae.minutes=l4;ae.second=ae.seconds=c4;ae.millisecond=ae.milliseconds=sk;ae.utcOffset=HL;ae.utc=ZL;ae.local=GL;ae.parseZone=KL;ae.hasAlignedHourOffset=qL;ae.isDST=XL;ae.isLocal=JL;ae.isUtcOffset=eF;ae.isUtc=YS;ae.isUTC=YS;ae.zoneAbbr=d4;ae.zoneName=f4;ae.dates=Qr("dates accessor is deprecated. Use date instead.",nk);ae.months=Qr("months accessor is deprecated. Use month instead",OS);ae.years=Qr("years accessor is deprecated. Use year instead",RS);ae.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",YL);ae.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",QL);function h4(e){return _t(e*1e3)}function p4(){return _t.apply(null,arguments).parseZone()}function ok(e){return e}var lt=tv.prototype;lt.calendar=JM;lt.longDateFormat=nI;lt.invalidDate=oI;lt.ordinal=lI;lt.preparse=ok;lt.postformat=ok;lt.relativeTime=uI;lt.pastFuture=dI;lt.set=XM;lt.eras=UF;lt.erasParse=$F;lt.erasConvertYear=VF;lt.erasAbbrRegex=GF;lt.erasNameRegex=ZF;lt.erasNarrowRegex=KF;lt.months=RI;lt.monthsShort=NI;lt.monthsParse=jI;lt.monthsRegex=AI;lt.monthsShortRegex=OI;lt.week=II;lt.firstDayOfYear=zI;lt.firstDayOfWeek=FI;lt.weekdays=KI;lt.weekdaysMin=XI;lt.weekdaysShort=qI;lt.weekdaysParse=JI;lt.weekdaysRegex=nL;lt.weekdaysShortRegex=sL;lt.weekdaysMinRegex=oL;lt.isPM=aL;lt.meridiem=uL;function hd(e,t,r,n){var s=Cs(),o=zn().set(n,t);return s[r](o,e)}function ik(e,t,r){if(vs(e)&&(t=e,e=void 0),e=e||"",t!=null)return hd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=hd(e,n,r,"month");return s}function wv(e,t,r,n){typeof e=="boolean"?(vs(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,vs(t)&&(r=t,t=void 0),t=t||"");var s=Cs(),o=e?s._week.dow:0,i,a=[];if(r!=null)return hd(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=hd(t,(i+o)%7,n,"day");return a}function m4(e,t){return ik(e,t,"months")}function g4(e,t){return ik(e,t,"monthsShort")}function v4(e,t,r){return wv(e,t,r,"weekdays")}function y4(e,t,r){return wv(e,t,r,"weekdaysShort")}function w4(e,t,r){return wv(e,t,r,"weekdaysMin")}Js("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=Je(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});me.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",Js);me.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",Cs);var Zn=Math.abs;function x4(){var e=this._data;return this._milliseconds=Zn(this._milliseconds),this._days=Zn(this._days),this._months=Zn(this._months),e.milliseconds=Zn(e.milliseconds),e.seconds=Zn(e.seconds),e.minutes=Zn(e.minutes),e.hours=Zn(e.hours),e.months=Zn(e.months),e.years=Zn(e.years),this}function ak(e,t,r,n){var s=xn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function _4(e,t){return ak(this,e,t,1)}function b4(e,t){return ak(this,e,t,-1)}function sw(e){return e<0?Math.floor(e):Math.ceil(e)}function S4(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,a,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=sw(Kp(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=Yr(e/1e3),n.seconds=s%60,o=Yr(s/60),n.minutes=o%60,i=Yr(o/60),n.hours=i%24,t+=Yr(i/24),l=Yr(lk(t)),r+=l,t-=sw(Kp(l)),a=Yr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function lk(e){return e*4800/146097}function Kp(e){return e*146097/4800}function k4(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=Jr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+lk(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Kp(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Es(e){return function(){return this.as(e)}}var ck=Es("ms"),C4=Es("s"),E4=Es("m"),T4=Es("h"),R4=Es("d"),N4=Es("w"),P4=Es("M"),j4=Es("Q"),D4=Es("y"),O4=ck;function A4(){return xn(this)}function M4(e){return e=Jr(e),this.isValid()?this[e+"s"]():NaN}function Xo(e){return function(){return this.isValid()?this._data[e]:NaN}}var I4=Xo("milliseconds"),L4=Xo("seconds"),F4=Xo("minutes"),z4=Xo("hours"),U4=Xo("days"),$4=Xo("months"),V4=Xo("years");function W4(){return Yr(this.days()/7)}var Qn=Math.round,Ri={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function B4(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function H4(e,t,r,n){var s=xn(e).abs(),o=Qn(s.as("s")),i=Qn(s.as("m")),a=Qn(s.as("h")),l=Qn(s.as("d")),c=Qn(s.as("M")),f=Qn(s.as("w")),d=Qn(s.as("y")),h=o<=r.ss&&["s",o]||o0,h[4]=n,B4.apply(null,h)}function Y4(e){return e===void 0?Qn:typeof e=="function"?(Qn=e,!0):!1}function Z4(e,t){return Ri[e]===void 0?!1:t===void 0?Ri[e]:(Ri[e]=t,e==="s"&&(Ri.ss=t-1),!0)}function G4(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Ri,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Ri,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=H4(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Th=Math.abs;function di(e){return(e>0)-(e<0)||+e}function wf(){if(!this.isValid())return this.localeData().invalidDate();var e=Th(this._milliseconds)/1e3,t=Th(this._days),r=Th(this._months),n,s,o,i,a=this.asSeconds(),l,c,f,d;return a?(n=Yr(e/60),s=Yr(n/60),e%=60,n%=60,o=Yr(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=di(this._months)!==di(a)?"-":"",f=di(this._days)!==di(a)?"-":"",d=di(this._milliseconds)!==di(a)?"-":"",l+"P"+(o?c+o+"Y":"")+(r?c+r+"M":"")+(t?f+t+"D":"")+(s||n||e?"T":"")+(s?d+s+"H":"")+(n?d+n+"M":"")+(e?d+i+"S":"")):"P0D"}var nt=vf.prototype;nt.isValid=$L;nt.abs=x4;nt.add=_4;nt.subtract=b4;nt.as=k4;nt.asMilliseconds=ck;nt.asSeconds=C4;nt.asMinutes=E4;nt.asHours=T4;nt.asDays=R4;nt.asWeeks=N4;nt.asMonths=P4;nt.asQuarters=j4;nt.asYears=D4;nt.valueOf=O4;nt._bubble=S4;nt.clone=A4;nt.get=M4;nt.milliseconds=I4;nt.seconds=L4;nt.minutes=F4;nt.hours=z4;nt.days=U4;nt.weeks=W4;nt.months=$4;nt.years=V4;nt.humanize=G4;nt.toISOString=wf;nt.toString=wf;nt.toJSON=wf;nt.locale=qS;nt.localeData=QS;nt.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",wf);nt.lang=XS;Re("X",0,0,"unix");Re("x",0,0,"valueOf");xe("x",hf);xe("X",mI);pt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});pt("x",function(e,t,r){r._d=new Date(Je(e))});//! moment.js -me.version="2.30.1";KM(_t);me.fn=ae;me.min=LL;me.max=FL;me.now=zL;me.utc=zn;me.unix=h4;me.months=m4;me.isDate=uc;me.locale=Js;me.invalid=cf;me.duration=xn;me.isMoment=vn;me.weekdays=v4;me.parseZone=p4;me.localeData=Cs;me.isDuration=xu;me.monthsShort=g4;me.weekdaysMin=w4;me.defineLocale=dv;me.updateLocale=pL;me.locales=mL;me.weekdaysShort=y4;me.normalizeUnits=Jr;me.relativeTimeRounding=Y4;me.relativeTimeThreshold=Z4;me.calendarFormat=uF;me.prototype=ae;me.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const K4=async()=>await Dt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),xf=async e=>e.id?await Dt().collection("access").update(e.id,e):await Dt().collection("access").create(e),q4=async e=>(e.deleted=me.utc().format("YYYY-MM-DD HH:mm:ss"),await Dt().collection("access").update(e.id,e)),X4=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};default:return e}},uk=y.createContext({}),ya=()=>y.useContext(uk),Q4=({children:e})=>{const[t,r]=y.useReducer(X4,{accesses:[]});y.useEffect(()=>{(async()=>{const a=await K4();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=y.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=y.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=y.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return u.jsx(uk.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})},J4={theme:"system",setTheme:()=>null},dk=y.createContext(J4);function e3({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=y.useState(()=>localStorage.getItem(r)||t);y.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(s)},[s]);const i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return u.jsx(dk.Provider,{...n,value:i,children:e})}const t3=()=>{const e=y.useContext(dk);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function r3(){const{setTheme:e}=t3();return u.jsxs(Wb,{children:[u.jsx(Bb,{asChild:!0,children:u.jsxs(Et,{variant:"outline",size:"icon",children:[u.jsx(KP,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),u.jsx(ZP,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),u.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),u.jsxs(Vg,{align:"end",children:[u.jsx(zi,{onClick:()=>e("light"),children:"浅色"}),u.jsx(zi,{onClick:()=>e("dark"),children:"暗黑"}),u.jsx(zi,{onClick:()=>e("system"),children:"系统"})]})]})}function n3(){const e=Ss(),t=po();if(!Dt().authStore.isValid||!Dt().authStore.isAdmin)return u.jsx(Q_,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{Dt().authStore.clear(),e("/login")},o=()=>{e("/setting/password")};return u.jsx(u.Fragment,{children:u.jsx(Q4,{children:u.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[u.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:u.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[u.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:u.jsxs(Kn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),u.jsx("div",{className:"flex-1",children:u.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[u.jsxs(Kn,{to:"/",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[u.jsx(Ap,{className:"h-4 w-4"}),"域名列表"]}),u.jsxs(Kn,{to:"/access",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[u.jsx(S0,{className:"h-4 w-4"}),"授权管理"]}),u.jsxs(Kn,{to:"/history",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[u.jsx(_0,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),u.jsxs("div",{className:"flex flex-col",children:[u.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[u.jsxs(uS,{children:[u.jsx(dS,{asChild:!0,children:u.jsxs(Et,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[u.jsx(YP,{className:"h-5 w-5"}),u.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),u.jsx(qg,{side:"left",className:"flex flex-col",children:u.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[u.jsxs(Kn,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"",children:"Certimate"}),u.jsx("span",{className:"sr-only",children:"Certimate"})]}),u.jsxs(Kn,{to:"/",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[u.jsx(Ap,{className:"h-5 w-5"}),"域名列表"]}),u.jsxs(Kn,{to:"/access",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[u.jsx(S0,{className:"h-5 w-5"}),"授权管理"]}),u.jsxs(Kn,{to:"/history",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[u.jsx(_0,{className:"h-5 w-5"}),"部署历史"]})]})})]}),u.jsx("div",{className:"w-full flex-1"}),u.jsx(r3,{}),u.jsxs(Wb,{children:[u.jsx(Bb,{asChild:!0,children:u.jsxs(Et,{variant:"secondary",size:"icon",className:"rounded-full",children:[u.jsx(BP,{className:"h-5 w-5"}),u.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),u.jsxs(Vg,{align:"end",children:[u.jsx(Hb,{children:"账户"}),u.jsx(Yb,{}),u.jsx(zi,{onClick:o,children:"设置"}),u.jsx(zi,{onClick:s,children:"退出"})]})]})]}),u.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[u.jsx(hg,{}),u.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[u.jsx("div",{className:""}),u.jsx("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200",children:u.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.0.10"})})]})]})]})]})})})}var s3="Separator",ow="horizontal",o3=["horizontal","vertical"],fk=y.forwardRef((e,t)=>{const{decorative:r,orientation:n=ow,...s}=e,o=i3(n)?n:ow,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(De.div,{"data-orientation":o,...a,...s,ref:t})});fk.displayName=s3;function i3(e){return o3.includes(e)}var hk=fk;const Kt=y.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>u.jsx(hk,{ref:s,decorative:r,orientation:t,className:we("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Kt.displayName=hk.displayName;const pk=({phase:e,phaseSuccess:t})=>{let r=u.jsx(u.Fragment,{children:" "});return e==="check"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Kt,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Kt,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),u.jsx(Kt,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Kt,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Kt,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Kt,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Kt,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),u.jsx(Kt,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Kt,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Kt,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Kt,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Kt,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},iw=({when:e,children:t,fallback:r})=>e?t:r;var mk="AlertDialog",[a3,SU]=Er(mk,[Gb]),Ts=Gb(),gk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Zg,{...n,...r,modal:!0})};gk.displayName=mk;var l3="AlertDialogTrigger",vk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(Gg,{...s,...n,ref:t})});vk.displayName=l3;var c3="AlertDialogPortal",yk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Kg,{...n,...r})};yk.displayName=c3;var u3="AlertDialogOverlay",wk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(ic,{...s,...n,ref:t})});wk.displayName=u3;var Bi="AlertDialogContent",[d3,f3]=a3(Bi),xk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ts(r),i=y.useRef(null),a=Ue(t,i),l=y.useRef(null);return u.jsx(kM,{contentName:Bi,titleName:_k,docsSlug:"alert-dialog",children:u.jsx(d3,{scope:r,cancelRef:l,children:u.jsxs(ac,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:le(s.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=l.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(mg,{children:n}),u.jsx(p3,{contentRef:i})]})})})});xk.displayName=Bi;var _k="AlertDialogTitle",bk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(lc,{...s,...n,ref:t})});bk.displayName=_k;var Sk="AlertDialogDescription",kk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(cc,{...s,...n,ref:t})});kk.displayName=Sk;var h3="AlertDialogAction",Ck=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(lf,{...s,...n,ref:t})});Ck.displayName=h3;var Ek="AlertDialogCancel",Tk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=f3(Ek,r),o=Ts(r),i=Ue(t,s);return u.jsx(lf,{...o,...n,ref:i})});Tk.displayName=Ek;var p3=({contentRef:e})=>{const t=`\`${Bi}\` requires a description for the component to be accessible for screen reader users. +`+new Error().stack),r=!1}return t.apply(this,arguments)},t)}var ew={};function bS(e,t){me.deprecationHandler!=null&&me.deprecationHandler(e,t),ew[e]||(_S(t),ew[e]=!0)}me.suppressDeprecationWarnings=!1;me.deprecationHandler=null;function Un(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function XM(e){var t,r;for(r in e)at(e,r)&&(t=e[r],Un(t)?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Bp(e,t){var r=Vs({},e),n;for(n in t)at(t,n)&&(jo(e[n])&&jo(t[n])?(r[n]={},Vs(r[n],e[n]),Vs(r[n],t[n])):t[n]!=null?r[n]=t[n]:delete r[n]);for(n in e)at(e,n)&&!at(t,n)&&jo(e[n])&&(r[n]=Vs({},r[n]));return r}function tv(e){e!=null&&this.set(e)}var Hp;Object.keys?Hp=Object.keys:Hp=function(e){var t,r=[];for(t in e)at(e,t)&&r.push(t);return r};var QM={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function JM(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return Un(n)?n.call(t,r):n}function In(e,t,r){var n=""+Math.abs(e),s=t-n.length,o=e>=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var rv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Qc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ch={},$i={};function Re(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&($i[e]=s),t&&($i[t[0]]=function(){return In(s.apply(this,arguments),t[1],t[2])}),r&&($i[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function eI(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function tI(e){var t=e.match(rv),r,n;for(r=0,n=t.length;r=0&&Qc.test(e);)e=e.replace(Qc,n),Qc.lastIndex=0,r-=1;return e}var rI={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function nI(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(rv).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var sI="Invalid date";function oI(){return this._invalidDate}var iI="%d",aI=/\d{1,2}/;function lI(e){return this._ordinal.replace("%d",e)}var cI={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function uI(e,t,r,n){var s=this._relativeTime[r];return Un(s)?s(e,t,r,n):s.replace(/%d/i,e)}function dI(e,t){var r=this._relativeTime[e>0?"future":"past"];return Un(r)?r(t):r.replace(/%s/i,t)}var tw={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jr(e){return typeof e=="string"?tw[e]||tw[e.toLowerCase()]:void 0}function nv(e){var t={},r,n;for(n in e)at(e,n)&&(r=Jr(n),r&&(t[r]=e[n]));return t}var fI={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function hI(e){var t=[],r;for(r in e)at(e,r)&&t.push({unit:r,priority:fI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var kS=/\d/,$r=/\d\d/,CS=/\d{3}/,sv=/\d{4}/,uf=/[+-]?\d{6}/,bt=/\d\d?/,ES=/\d\d\d\d?/,TS=/\d\d\d\d\d\d?/,df=/\d{1,3}/,ov=/\d{1,4}/,ff=/[+-]?\d{1,6}/,ma=/\d+/,hf=/[+-]?\d+/,pI=/Z|[+-]\d\d:?\d\d/gi,pf=/Z|[+-]\d\d(?::?\d\d)?/gi,mI=/[+-]?\d+(\.\d{1,3})?/,fc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ga=/^[1-9]\d?/,iv=/^([1-9]\d|\d)/,cd;cd={};function xe(e,t,r){cd[e]=Un(t)?t:function(n,s){return n&&r?r:t}}function gI(e,t){return at(cd,e)?cd[e](t._strict,t._locale):new RegExp(vI(e))}function vI(e){return as(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function as(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Yr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Je(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=Yr(t)),r}var Yp={};function pt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),vs(t)&&(n=function(o,i){i[t]=Je(o)}),s=e.length,r=0;r68?1900:2e3)};var RS=va("FullYear",!0);function _I(){return mf(this.year())}function va(e,t){return function(r){return r!=null?(NS(this,e,r),me.updateOffset(this,t),this):Pl(this,e)}}function Pl(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function NS(e,t,r){var n,s,o,i,a;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,i=e.month(),a=e.date(),a=a===29&&i===1&&!mf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function bI(e){return e=Jr(e),Un(this[e])?this[e]():this}function SI(e,t){if(typeof e=="object"){e=nv(e);var r=hI(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,o,i),a}function jl(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ud(e,t,r){var n=7+t-r,s=(7+jl(e,0,n).getUTCDay()-t)%7;return-s+n-1}function MS(e,t,r,n,s){var o=(7+r-n)%7,i=ud(e,n,s),a=1+7*(t-1)+o+i,l,c;return a<=0?(l=e-1,c=tl(l)+a):a>tl(e)?(l=e+1,c=a-tl(e)):(l=e,c=a),{year:l,dayOfYear:c}}function Dl(e,t,r){var n=ud(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+ls(i,t,r)):s>ls(e.year(),t,r)?(o=s-ls(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function ls(e,t,r){var n=ud(e,t,r),s=ud(e+1,t,r);return(tl(e)-n+s)/7}Re("w",["ww",2],"wo","week");Re("W",["WW",2],"Wo","isoWeek");xe("w",bt,ga);xe("ww",bt,$r);xe("W",bt,ga);xe("WW",bt,$r);hc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=Je(e)});function II(e){return Dl(e,this._week.dow,this._week.doy).week}var LI={dow:0,doy:6};function FI(){return this._week.dow}function zI(){return this._week.doy}function UI(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function $I(e){var t=Dl(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Re("d",0,"do","day");Re("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Re("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Re("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Re("e",0,0,"weekday");Re("E",0,0,"isoWeekday");xe("d",bt);xe("e",bt);xe("E",bt);xe("dd",function(e,t){return t.weekdaysMinRegex(e)});xe("ddd",function(e,t){return t.weekdaysShortRegex(e)});xe("dddd",function(e,t){return t.weekdaysRegex(e)});hc(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:We(r).invalidWeekday=e});hc(["d","e","E"],function(e,t,r,n){t[n]=Je(e)});function VI(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function WI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function lv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var BI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),IS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),HI="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),YI=fc,ZI=fc,GI=fc;function KI(e,t){var r=gn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?lv(r,this._week.dow):e?r[e.day()]:r}function qI(e){return e===!0?lv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function XI(e){return e===!0?lv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function QI(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=zn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1||(s=Ft.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=Ft.call(this._minWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function JI(e,t,r){var n,s,o;if(this._weekdaysParseExact)return QI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=zn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function eL(e){if(!this.isValid())return e!=null?this:NaN;var t=Pl(this,"Day");return e!=null?(e=VI(e,this.localeData()),this.add(e-t,"d")):t}function tL(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function rL(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=WI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function nL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||cv.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(at(this,"_weekdaysRegex")||(this._weekdaysRegex=YI),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function sL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||cv.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(at(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ZI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function oL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||cv.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(at(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=GI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function cv(){function e(f,d){return d.length-f.length}var t=[],r=[],n=[],s=[],o,i,a,l,c;for(o=0;o<7;o++)i=zn([2e3,1]).day(o),a=as(this.weekdaysMin(i,"")),l=as(this.weekdaysShort(i,"")),c=as(this.weekdays(i,"")),t.push(a),r.push(l),n.push(c),s.push(a),s.push(l),s.push(c);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function uv(){return this.hours()%12||12}function iL(){return this.hours()||24}Re("H",["HH",2],0,"hour");Re("h",["hh",2],0,uv);Re("k",["kk",2],0,iL);Re("hmm",0,0,function(){return""+uv.apply(this)+In(this.minutes(),2)});Re("hmmss",0,0,function(){return""+uv.apply(this)+In(this.minutes(),2)+In(this.seconds(),2)});Re("Hmm",0,0,function(){return""+this.hours()+In(this.minutes(),2)});Re("Hmmss",0,0,function(){return""+this.hours()+In(this.minutes(),2)+In(this.seconds(),2)});function LS(e,t){Re(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}LS("a",!0);LS("A",!1);function FS(e,t){return t._meridiemParse}xe("a",FS);xe("A",FS);xe("H",bt,iv);xe("h",bt,ga);xe("k",bt,ga);xe("HH",bt,$r);xe("hh",bt,$r);xe("kk",bt,$r);xe("hmm",ES);xe("hmmss",TS);xe("Hmm",ES);xe("Hmmss",TS);pt(["H","HH"],Gt);pt(["k","kk"],function(e,t,r){var n=Je(e);t[Gt]=n===24?0:n});pt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});pt(["h","hh"],function(e,t,r){t[Gt]=Je(e),We(r).bigHour=!0});pt("hmm",function(e,t,r){var n=e.length-2;t[Gt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n)),We(r).bigHour=!0});pt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n,2)),t[ss]=Je(e.substr(s)),We(r).bigHour=!0});pt("Hmm",function(e,t,r){var n=e.length-2;t[Gt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n))});pt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=Je(e.substr(0,n)),t[ln]=Je(e.substr(n,2)),t[ss]=Je(e.substr(s))});function aL(e){return(e+"").toLowerCase().charAt(0)==="p"}var lL=/[ap]\.?m?\.?/i,cL=va("Hours",!0);function uL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var zS={calendar:QM,longDateFormat:rI,invalidDate:sI,ordinal:iI,dayOfMonthOrdinalParse:aI,relativeTime:cI,months:CI,monthsShort:PS,week:LI,weekdays:BI,weekdaysMin:HI,weekdaysShort:IS,meridiemParse:lL},Ct={},Aa={},Ol;function dL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=gf(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&dL(o,n)>=r-1)break;r--}t++}return Ol}function hL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function gf(e){var t=null,r;if(Ct[e]===void 0&&typeof Nu<"u"&&Nu&&Nu.exports&&hL(e))try{t=Ol._abbr,r=require,r("./locale/"+e),Js(t)}catch{Ct[e]=null}return Ct[e]}function Js(e,t){var r;return e&&(wr(t)?r=Cs(e):r=dv(e,t),r?Ol=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ol._abbr}function dv(e,t){if(t!==null){var r,n=zS;if(t.abbr=e,Ct[e]!=null)bS("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ct[e]._config;else if(t.parentLocale!=null)if(Ct[t.parentLocale]!=null)n=Ct[t.parentLocale]._config;else if(r=gf(t.parentLocale),r!=null)n=r._config;else return Aa[t.parentLocale]||(Aa[t.parentLocale]=[]),Aa[t.parentLocale].push({name:e,config:t}),null;return Ct[e]=new tv(Bp(n,t)),Aa[e]&&Aa[e].forEach(function(s){dv(s.name,s.config)}),Js(e),Ct[e]}else return delete Ct[e],null}function pL(e,t){if(t!=null){var r,n,s=zS;Ct[e]!=null&&Ct[e].parentLocale!=null?Ct[e].set(Bp(Ct[e]._config,t)):(n=gf(e),n!=null&&(s=n._config),t=Bp(s,t),n==null&&(t.abbr=e),r=new tv(t),r.parentLocale=Ct[e],Ct[e]=r),Js(e)}else Ct[e]!=null&&(Ct[e].parentLocale!=null?(Ct[e]=Ct[e].parentLocale,e===Js()&&Js(e)):Ct[e]!=null&&delete Ct[e]);return Ct[e]}function Cs(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ol;if(!gn(e)){if(t=gf(e),t)return t;e=[e]}return fL(e)}function mL(){return Hp(Ct)}function fv(e){var t,r=e._a;return r&&We(e).overflow===-2&&(t=r[ns]<0||r[ns]>11?ns:r[Tn]<1||r[Tn]>av(r[ar],r[ns])?Tn:r[Gt]<0||r[Gt]>24||r[Gt]===24&&(r[ln]!==0||r[ss]!==0||r[To]!==0)?Gt:r[ln]<0||r[ln]>59?ln:r[ss]<0||r[ss]>59?ss:r[To]<0||r[To]>999?To:-1,We(e)._overflowDayOfYear&&(tTn)&&(t=Tn),We(e)._overflowWeeks&&t===-1&&(t=wI),We(e)._overflowWeekday&&t===-1&&(t=xI),We(e).overflow=t),e}var gL=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vL=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yL=/Z|[+-]\d\d(?::?\d\d)?/,Jc=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Eh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wL=/^\/?Date\((-?\d+)/i,xL=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,_L={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function US(e){var t,r,n=e._i,s=gL.exec(n)||vL.exec(n),o,i,a,l,c=Jc.length,f=Eh.length;if(s){for(We(e).iso=!0,t=0,r=c;ttl(i)||e._dayOfYear===0)&&(We(e)._overflowDayOfYear=!0),r=jl(i,0,e._dayOfYear),e._a[ns]=r.getUTCMonth(),e._a[Tn]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Gt]===24&&e._a[ln]===0&&e._a[ss]===0&&e._a[To]===0&&(e._nextDay=!0,e._a[Gt]=0),e._d=(e._useUTC?jl:MI).apply(null,n),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Gt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(We(e).weekdayMismatch=!0)}}function NL(e){var t,r,n,s,o,i,a,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=hi(t.GG,e._a[ar],Dl(_t(),1,4).year),n=hi(t.W,1),s=hi(t.E,1),(s<1||s>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=Dl(_t(),o,i),r=hi(t.gg,e._a[ar],c.year),n=hi(t.w,c.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(l=!0)):s=o),n<1||n>ls(r,o,i)?We(e)._overflowWeeks=!0:l!=null?We(e)._overflowWeekday=!0:(a=MS(r,n,s,o,i),e._a[ar]=a.year,e._dayOfYear=a.dayOfYear)}me.ISO_8601=function(){};me.RFC_2822=function(){};function pv(e){if(e._f===me.ISO_8601){US(e);return}if(e._f===me.RFC_2822){$S(e);return}e._a=[],We(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,l=0,c,f;for(s=SS(e._f,e._locale).match(rv)||[],f=s.length,r=0;r0&&We(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),$i[o]?(n?We(e).empty=!1:We(e).unusedTokens.push(o),yI(o,n,e)):e._strict&&!n&&We(e).unusedTokens.push(o);We(e).charsLeftOver=a-l,t.length>0&&We(e).unusedInput.push(t),e._a[Gt]<=12&&We(e).bigHour===!0&&e._a[Gt]>0&&(We(e).bigHour=void 0),We(e).parsedDateParts=e._a.slice(0),We(e).meridiem=e._meridiem,e._a[Gt]=PL(e._locale,e._a[Gt],e._meridiem),c=We(e).era,c!==null&&(e._a[ar]=e._locale.erasConvertYear(c,e._a[ar])),hv(e),fv(e)}function PL(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function jL(e){var t,r,n,s,o,i,a=!1,l=e._f.length;if(l===0){We(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:cf()});function BS(e,t){var r,n;if(t.length===1&&gn(t[0])&&(t=t[0]),!t.length)return _t();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function QL(){if(!wr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return ev(e,this),e=VS(e),e._a?(t=e._isUTC?zn(e._a):_t(e._a),this._isDSTShifted=this.isValid()&&WL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function JL(){return this.isValid()?!this._isUTC:!1}function eF(){return this.isValid()?this._isUTC:!1}function YS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var tF=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,rF=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xn(e,t){var r=e,n=null,s,o,i;return xu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:vs(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=tF.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:Je(n[Tn])*s,h:Je(n[Gt])*s,m:Je(n[ln])*s,s:Je(n[ss])*s,ms:Je(Zp(n[To]*1e3))*s}):(n=rF.exec(e))?(s=n[1]==="-"?-1:1,r={y:vo(n[2],s),M:vo(n[3],s),w:vo(n[4],s),d:vo(n[5],s),h:vo(n[6],s),m:vo(n[7],s),s:vo(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=nF(_t(r.from),_t(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new vf(r),xu(e)&&at(e,"_locale")&&(o._locale=e._locale),xu(e)&&at(e,"_isValid")&&(o._isValid=e._isValid),o}xn.fn=vf.prototype;xn.invalid=VL;function vo(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function nw(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function nF(e,t){var r;return e.isValid()&&t.isValid()?(t=gv(t,e),e.isBefore(t)?r=nw(e,t):(r=nw(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function ZS(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(bS(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),s=xn(r,n),GS(this,s,e),this}}function GS(e,t,r,n){var s=t._milliseconds,o=Zp(t._days),i=Zp(t._months);e.isValid()&&(n=n??!0,i&&DS(e,Pl(e,"Month")+i*r),o&&NS(e,"Date",Pl(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&me.updateOffset(e,o||i))}var sF=ZS(1,"add"),oF=ZS(-1,"subtract");function KS(e){return typeof e=="string"||e instanceof String}function iF(e){return vn(e)||uc(e)||KS(e)||vs(e)||lF(e)||aF(e)||e===null||e===void 0}function aF(e){var t=jo(e)&&!Qg(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?wu(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Un(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",wu(r,"Z")):wu(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function bF(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(r+n+s+o)}function SF(e){e||(e=this.isUtc()?me.defaultFormatUtc:me.defaultFormat);var t=wu(this,e);return this.localeData().postformat(t)}function kF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||_t(e).isValid())?xn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function CF(e){return this.from(_t(),e)}function EF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||_t(e).isValid())?xn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function TF(e){return this.to(_t(),e)}function qS(e){var t;return e===void 0?this._locale._abbr:(t=Cs(e),t!=null&&(this._locale=t),this)}var XS=Qr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function QS(){return this._locale}var dd=1e3,Vi=60*dd,fd=60*Vi,JS=(365*400+97)*24*fd;function Wi(e,t){return(e%t+t)%t}function ek(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-JS:new Date(e,t,r).valueOf()}function tk(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-JS:Date.UTC(e,t,r)}function RF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tk:ek,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Wi(t+(this._isUTC?0:this.utcOffset()*Vi),fd);break;case"minute":t=this._d.valueOf(),t-=Wi(t,Vi);break;case"second":t=this._d.valueOf(),t-=Wi(t,dd);break}return this._d.setTime(t),me.updateOffset(this,!0),this}function NF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?tk:ek,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=fd-Wi(t+(this._isUTC?0:this.utcOffset()*Vi),fd)-1;break;case"minute":t=this._d.valueOf(),t+=Vi-Wi(t,Vi)-1;break;case"second":t=this._d.valueOf(),t+=dd-Wi(t,dd)-1;break}return this._d.setTime(t),me.updateOffset(this,!0),this}function PF(){return this._d.valueOf()-(this._offset||0)*6e4}function jF(){return Math.floor(this.valueOf()/1e3)}function DF(){return new Date(this.valueOf())}function OF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function AF(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function MF(){return this.isValid()?this.toISOString():null}function IF(){return Jg(this)}function LF(){return Vs({},We(this))}function FF(){return We(this).overflow}function zF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Re("N",0,0,"eraAbbr");Re("NN",0,0,"eraAbbr");Re("NNN",0,0,"eraAbbr");Re("NNNN",0,0,"eraName");Re("NNNNN",0,0,"eraNarrow");Re("y",["y",1],"yo","eraYear");Re("y",["yy",2],0,"eraYear");Re("y",["yyy",3],0,"eraYear");Re("y",["yyyy",4],0,"eraYear");xe("N",vv);xe("NN",vv);xe("NNN",vv);xe("NNNN",qF);xe("NNNNN",XF);pt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?We(r).era=s:We(r).invalidEra=e});xe("y",ma);xe("yy",ma);xe("yyy",ma);xe("yyyy",ma);xe("yo",QF);pt(["y","yy","yyy","yyyy"],ar);pt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ar]=r._locale.eraYearOrdinalParse(e,s):t[ar]=parseInt(e,10)});function UF(e,t){var r,n,s,o=this._eras||Cs("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function VF(e,t){var r=e.since<=e.until?1:-1;return t===void 0?me(e.since).year():me(e.since).year()+(t-e.offset)*r}function WF(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),o4.call(this,e,t,r,n,s))}function o4(e,t,r,n,s){var o=MS(e,t,r,n,s),i=jl(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Re("Q",0,"Qo","quarter");xe("Q",kS);pt("Q",function(e,t){t[ns]=(Je(e)-1)*3});function i4(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Re("D",["DD",2],"Do","date");xe("D",bt,ga);xe("DD",bt,$r);xe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});pt(["D","DD"],Tn);pt("Do",function(e,t){t[Tn]=Je(e.match(bt)[0])});var nk=va("Date",!0);Re("DDD",["DDDD",3],"DDDo","dayOfYear");xe("DDD",df);xe("DDDD",CS);pt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=Je(e)});function a4(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Re("m",["mm",2],0,"minute");xe("m",bt,iv);xe("mm",bt,$r);pt(["m","mm"],ln);var l4=va("Minutes",!1);Re("s",["ss",2],0,"second");xe("s",bt,iv);xe("ss",bt,$r);pt(["s","ss"],ss);var c4=va("Seconds",!1);Re("S",0,0,function(){return~~(this.millisecond()/100)});Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Re(0,["SSS",3],0,"millisecond");Re(0,["SSSS",4],0,function(){return this.millisecond()*10});Re(0,["SSSSS",5],0,function(){return this.millisecond()*100});Re(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Re(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Re(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Re(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});xe("S",df,kS);xe("SS",df,$r);xe("SSS",df,CS);var Ws,sk;for(Ws="SSSS";Ws.length<=9;Ws+="S")xe(Ws,ma);function u4(e,t){t[To]=Je(("0."+e)*1e3)}for(Ws="S";Ws.length<=9;Ws+="S")pt(Ws,u4);sk=va("Milliseconds",!1);Re("z",0,0,"zoneAbbr");Re("zz",0,0,"zoneName");function d4(){return this._isUTC?"UTC":""}function f4(){return this._isUTC?"Coordinated Universal Time":""}var ae=dc.prototype;ae.add=sF;ae.calendar=dF;ae.clone=fF;ae.diff=wF;ae.endOf=NF;ae.format=SF;ae.from=kF;ae.fromNow=CF;ae.to=EF;ae.toNow=TF;ae.get=bI;ae.invalidAt=FF;ae.isAfter=hF;ae.isBefore=pF;ae.isBetween=mF;ae.isSame=gF;ae.isSameOrAfter=vF;ae.isSameOrBefore=yF;ae.isValid=IF;ae.lang=XS;ae.locale=qS;ae.localeData=QS;ae.max=IL;ae.min=ML;ae.parsingFlags=LF;ae.set=SI;ae.startOf=RF;ae.subtract=oF;ae.toArray=OF;ae.toObject=AF;ae.toDate=DF;ae.toISOString=_F;ae.inspect=bF;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=MF;ae.toString=xF;ae.unix=jF;ae.valueOf=PF;ae.creationData=zF;ae.eraName=WF;ae.eraNarrow=BF;ae.eraAbbr=HF;ae.eraYear=YF;ae.year=RS;ae.isLeapYear=_I;ae.weekYear=JF;ae.isoWeekYear=e4;ae.quarter=ae.quarters=i4;ae.month=OS;ae.daysInMonth=DI;ae.week=ae.weeks=UI;ae.isoWeek=ae.isoWeeks=$I;ae.weeksInYear=n4;ae.weeksInWeekYear=s4;ae.isoWeeksInYear=t4;ae.isoWeeksInISOWeekYear=r4;ae.date=nk;ae.day=ae.days=eL;ae.weekday=tL;ae.isoWeekday=rL;ae.dayOfYear=a4;ae.hour=ae.hours=cL;ae.minute=ae.minutes=l4;ae.second=ae.seconds=c4;ae.millisecond=ae.milliseconds=sk;ae.utcOffset=HL;ae.utc=ZL;ae.local=GL;ae.parseZone=KL;ae.hasAlignedHourOffset=qL;ae.isDST=XL;ae.isLocal=JL;ae.isUtcOffset=eF;ae.isUtc=YS;ae.isUTC=YS;ae.zoneAbbr=d4;ae.zoneName=f4;ae.dates=Qr("dates accessor is deprecated. Use date instead.",nk);ae.months=Qr("months accessor is deprecated. Use month instead",OS);ae.years=Qr("years accessor is deprecated. Use year instead",RS);ae.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",YL);ae.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",QL);function h4(e){return _t(e*1e3)}function p4(){return _t.apply(null,arguments).parseZone()}function ok(e){return e}var lt=tv.prototype;lt.calendar=JM;lt.longDateFormat=nI;lt.invalidDate=oI;lt.ordinal=lI;lt.preparse=ok;lt.postformat=ok;lt.relativeTime=uI;lt.pastFuture=dI;lt.set=XM;lt.eras=UF;lt.erasParse=$F;lt.erasConvertYear=VF;lt.erasAbbrRegex=GF;lt.erasNameRegex=ZF;lt.erasNarrowRegex=KF;lt.months=RI;lt.monthsShort=NI;lt.monthsParse=jI;lt.monthsRegex=AI;lt.monthsShortRegex=OI;lt.week=II;lt.firstDayOfYear=zI;lt.firstDayOfWeek=FI;lt.weekdays=KI;lt.weekdaysMin=XI;lt.weekdaysShort=qI;lt.weekdaysParse=JI;lt.weekdaysRegex=nL;lt.weekdaysShortRegex=sL;lt.weekdaysMinRegex=oL;lt.isPM=aL;lt.meridiem=uL;function hd(e,t,r,n){var s=Cs(),o=zn().set(n,t);return s[r](o,e)}function ik(e,t,r){if(vs(e)&&(t=e,e=void 0),e=e||"",t!=null)return hd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=hd(e,n,r,"month");return s}function wv(e,t,r,n){typeof e=="boolean"?(vs(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,vs(t)&&(r=t,t=void 0),t=t||"");var s=Cs(),o=e?s._week.dow:0,i,a=[];if(r!=null)return hd(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=hd(t,(i+o)%7,n,"day");return a}function m4(e,t){return ik(e,t,"months")}function g4(e,t){return ik(e,t,"monthsShort")}function v4(e,t,r){return wv(e,t,r,"weekdays")}function y4(e,t,r){return wv(e,t,r,"weekdaysShort")}function w4(e,t,r){return wv(e,t,r,"weekdaysMin")}Js("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=Je(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});me.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",Js);me.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",Cs);var Zn=Math.abs;function x4(){var e=this._data;return this._milliseconds=Zn(this._milliseconds),this._days=Zn(this._days),this._months=Zn(this._months),e.milliseconds=Zn(e.milliseconds),e.seconds=Zn(e.seconds),e.minutes=Zn(e.minutes),e.hours=Zn(e.hours),e.months=Zn(e.months),e.years=Zn(e.years),this}function ak(e,t,r,n){var s=xn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function _4(e,t){return ak(this,e,t,1)}function b4(e,t){return ak(this,e,t,-1)}function sw(e){return e<0?Math.floor(e):Math.ceil(e)}function S4(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,a,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=sw(Kp(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=Yr(e/1e3),n.seconds=s%60,o=Yr(s/60),n.minutes=o%60,i=Yr(o/60),n.hours=i%24,t+=Yr(i/24),l=Yr(lk(t)),r+=l,t-=sw(Kp(l)),a=Yr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function lk(e){return e*4800/146097}function Kp(e){return e*146097/4800}function k4(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=Jr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+lk(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Kp(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Es(e){return function(){return this.as(e)}}var ck=Es("ms"),C4=Es("s"),E4=Es("m"),T4=Es("h"),R4=Es("d"),N4=Es("w"),P4=Es("M"),j4=Es("Q"),D4=Es("y"),O4=ck;function A4(){return xn(this)}function M4(e){return e=Jr(e),this.isValid()?this[e+"s"]():NaN}function Xo(e){return function(){return this.isValid()?this._data[e]:NaN}}var I4=Xo("milliseconds"),L4=Xo("seconds"),F4=Xo("minutes"),z4=Xo("hours"),U4=Xo("days"),$4=Xo("months"),V4=Xo("years");function W4(){return Yr(this.days()/7)}var Qn=Math.round,Ri={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function B4(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function H4(e,t,r,n){var s=xn(e).abs(),o=Qn(s.as("s")),i=Qn(s.as("m")),a=Qn(s.as("h")),l=Qn(s.as("d")),c=Qn(s.as("M")),f=Qn(s.as("w")),d=Qn(s.as("y")),h=o<=r.ss&&["s",o]||o0,h[4]=n,B4.apply(null,h)}function Y4(e){return e===void 0?Qn:typeof e=="function"?(Qn=e,!0):!1}function Z4(e,t){return Ri[e]===void 0?!1:t===void 0?Ri[e]:(Ri[e]=t,e==="s"&&(Ri.ss=t-1),!0)}function G4(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Ri,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Ri,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=H4(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Th=Math.abs;function di(e){return(e>0)-(e<0)||+e}function wf(){if(!this.isValid())return this.localeData().invalidDate();var e=Th(this._milliseconds)/1e3,t=Th(this._days),r=Th(this._months),n,s,o,i,a=this.asSeconds(),l,c,f,d;return a?(n=Yr(e/60),s=Yr(n/60),e%=60,n%=60,o=Yr(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=di(this._months)!==di(a)?"-":"",f=di(this._days)!==di(a)?"-":"",d=di(this._milliseconds)!==di(a)?"-":"",l+"P"+(o?c+o+"Y":"")+(r?c+r+"M":"")+(t?f+t+"D":"")+(s||n||e?"T":"")+(s?d+s+"H":"")+(n?d+n+"M":"")+(e?d+i+"S":"")):"P0D"}var nt=vf.prototype;nt.isValid=$L;nt.abs=x4;nt.add=_4;nt.subtract=b4;nt.as=k4;nt.asMilliseconds=ck;nt.asSeconds=C4;nt.asMinutes=E4;nt.asHours=T4;nt.asDays=R4;nt.asWeeks=N4;nt.asMonths=P4;nt.asQuarters=j4;nt.asYears=D4;nt.valueOf=O4;nt._bubble=S4;nt.clone=A4;nt.get=M4;nt.milliseconds=I4;nt.seconds=L4;nt.minutes=F4;nt.hours=z4;nt.days=U4;nt.weeks=W4;nt.months=$4;nt.years=V4;nt.humanize=G4;nt.toISOString=wf;nt.toString=wf;nt.toJSON=wf;nt.locale=qS;nt.localeData=QS;nt.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",wf);nt.lang=XS;Re("X",0,0,"unix");Re("x",0,0,"valueOf");xe("x",hf);xe("X",mI);pt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});pt("x",function(e,t,r){r._d=new Date(Je(e))});//! moment.js +me.version="2.30.1";KM(_t);me.fn=ae;me.min=LL;me.max=FL;me.now=zL;me.utc=zn;me.unix=h4;me.months=m4;me.isDate=uc;me.locale=Js;me.invalid=cf;me.duration=xn;me.isMoment=vn;me.weekdays=v4;me.parseZone=p4;me.localeData=Cs;me.isDuration=xu;me.monthsShort=g4;me.weekdaysMin=w4;me.defineLocale=dv;me.updateLocale=pL;me.locales=mL;me.weekdaysShort=y4;me.normalizeUnits=Jr;me.relativeTimeRounding=Y4;me.relativeTimeThreshold=Z4;me.calendarFormat=uF;me.prototype=ae;me.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const K4=async()=>await Dt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),xf=async e=>e.id?await Dt().collection("access").update(e.id,e):await Dt().collection("access").create(e),q4=async e=>(e.deleted=me.utc().format("YYYY-MM-DD HH:mm:ss"),await Dt().collection("access").update(e.id,e)),X4=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};default:return e}},uk=y.createContext({}),ya=()=>y.useContext(uk),Q4=({children:e})=>{const[t,r]=y.useReducer(X4,{accesses:[]});y.useEffect(()=>{(async()=>{const a=await K4();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=y.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=y.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=y.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return u.jsx(uk.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})},J4={theme:"system",setTheme:()=>null},dk=y.createContext(J4);function e3({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=y.useState(()=>localStorage.getItem(r)||t);y.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(s)},[s]);const i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return u.jsx(dk.Provider,{...n,value:i,children:e})}const t3=()=>{const e=y.useContext(dk);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function r3(){const{setTheme:e}=t3();return u.jsxs(Wb,{children:[u.jsx(Bb,{asChild:!0,children:u.jsxs(Et,{variant:"outline",size:"icon",children:[u.jsx(KP,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),u.jsx(ZP,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),u.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),u.jsxs(Vg,{align:"end",children:[u.jsx(zi,{onClick:()=>e("light"),children:"浅色"}),u.jsx(zi,{onClick:()=>e("dark"),children:"暗黑"}),u.jsx(zi,{onClick:()=>e("system"),children:"系统"})]})]})}var n3="Separator",ow="horizontal",s3=["horizontal","vertical"],fk=y.forwardRef((e,t)=>{const{decorative:r,orientation:n=ow,...s}=e,o=o3(n)?n:ow,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(De.div,{"data-orientation":o,...a,...s,ref:t})});fk.displayName=n3;function o3(e){return s3.includes(e)}var hk=fk;const Ht=y.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>u.jsx(hk,{ref:s,decorative:r,orientation:t,className:we("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Ht.displayName=hk.displayName;function i3(){const e=Ss(),t=po();if(!Dt().authStore.isValid||!Dt().authStore.isAdmin)return u.jsx(Q_,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{Dt().authStore.clear(),e("/login")},o=()=>{e("/setting/password")};return u.jsx(u.Fragment,{children:u.jsx(Q4,{children:u.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[u.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:u.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[u.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:u.jsxs(Kn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),u.jsx("div",{className:"flex-1",children:u.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[u.jsxs(Kn,{to:"/",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[u.jsx(Ap,{className:"h-4 w-4"}),"域名列表"]}),u.jsxs(Kn,{to:"/access",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[u.jsx(S0,{className:"h-4 w-4"}),"授权管理"]}),u.jsxs(Kn,{to:"/history",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[u.jsx(_0,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),u.jsxs("div",{className:"flex flex-col",children:[u.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[u.jsxs(uS,{children:[u.jsx(dS,{asChild:!0,children:u.jsxs(Et,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[u.jsx(YP,{className:"h-5 w-5 dark:text-white"}),u.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),u.jsx(qg,{side:"left",className:"flex flex-col",children:u.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[u.jsxs(Kn,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"dark:text-white",children:"Certimate"}),u.jsx("span",{className:"sr-only",children:"Certimate"})]}),u.jsxs(Kn,{to:"/",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[u.jsx(Ap,{className:"h-5 w-5"}),"域名列表"]}),u.jsxs(Kn,{to:"/access",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[u.jsx(S0,{className:"h-5 w-5"}),"授权管理"]}),u.jsxs(Kn,{to:"/history",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[u.jsx(_0,{className:"h-5 w-5"}),"部署历史"]})]})})]}),u.jsx("div",{className:"w-full flex-1"}),u.jsx(r3,{}),u.jsxs(Wb,{children:[u.jsx(Bb,{asChild:!0,children:u.jsxs(Et,{variant:"secondary",size:"icon",className:"rounded-full",children:[u.jsx(BP,{className:"h-5 w-5"}),u.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),u.jsxs(Vg,{align:"end",children:[u.jsx(Hb,{children:"账户"}),u.jsx(Yb,{}),u.jsx(zi,{onClick:o,children:"设置"}),u.jsx(zi,{onClick:s,children:"退出"})]})]})]}),u.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[u.jsx(hg,{}),u.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[u.jsx("div",{className:""}),u.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[u.jsx("a",{href:"https://docs.certimate.fun",target:"_blank",children:"文档"}),u.jsx(Ht,{orientation:"vertical",className:"mx-2"}),u.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.0.11"})]})]})]})]})]})})})}const pk=({phase:e,phaseSuccess:t})=>{let r=u.jsx(u.Fragment,{children:" "});return e==="check"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},iw=({when:e,children:t,fallback:r})=>e?t:r;var mk="AlertDialog",[a3,SU]=Er(mk,[Gb]),Ts=Gb(),gk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Zg,{...n,...r,modal:!0})};gk.displayName=mk;var l3="AlertDialogTrigger",vk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(Gg,{...s,...n,ref:t})});vk.displayName=l3;var c3="AlertDialogPortal",yk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Kg,{...n,...r})};yk.displayName=c3;var u3="AlertDialogOverlay",wk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(ic,{...s,...n,ref:t})});wk.displayName=u3;var Bi="AlertDialogContent",[d3,f3]=a3(Bi),xk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ts(r),i=y.useRef(null),a=Ue(t,i),l=y.useRef(null);return u.jsx(kM,{contentName:Bi,titleName:_k,docsSlug:"alert-dialog",children:u.jsx(d3,{scope:r,cancelRef:l,children:u.jsxs(ac,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:le(s.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=l.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(mg,{children:n}),u.jsx(p3,{contentRef:i})]})})})});xk.displayName=Bi;var _k="AlertDialogTitle",bk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(lc,{...s,...n,ref:t})});bk.displayName=_k;var Sk="AlertDialogDescription",kk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(cc,{...s,...n,ref:t})});kk.displayName=Sk;var h3="AlertDialogAction",Ck=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(lf,{...s,...n,ref:t})});Ck.displayName=h3;var Ek="AlertDialogCancel",Tk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=f3(Ek,r),o=Ts(r),i=Ue(t,s);return u.jsx(lf,{...o,...n,ref:i})});Tk.displayName=Ek;var p3=({contentRef:e})=>{const t=`\`${Bi}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Bi}\` by passing a \`${Sk}\` component as a child, which also benefits sighted users by adding visible context to the dialog. @@ -246,4 +246,4 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,s,o){function i(c,f){if(!s[c]){if(!n[c]){var d=typeof tu=="function"&&tu;if(!f&&d)return d(c,!0);if(a)return a(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var p=s[c]={exports:{}};n[c][0].call(p.exports,function(w){var m=n[c][1][w];return i(m||w)},p,p.exports,r,n,s,o)}return s[c].exports}for(var a=typeof tu=="function"&&tu,l=0;l>2,p=(3&c)<<4|f>>4,w=1<_?(15&f)<<2|d>>6:64,m=2<_?63&d:64,x.push(a.charAt(h)+a.charAt(p)+a.charAt(w)+a.charAt(m));return x.join("")},s.decode=function(l){var c,f,d,h,p,w,m=0,x=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,_=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&_--,l.charAt(l.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=i.uint8array?new Uint8Array(0|_):new Array(0|_);m>4,f=(15&h)<<4|(p=a.indexOf(l.charAt(m++)))>>2,d=(3&p)<<6|(w=a.indexOf(l.charAt(m++))),v[x++]=c,p!==64&&(v[x++]=f),w!==64&&(v[x++]=d);return v}},{"./support":30,"./utils":32}],2:[function(r,n,s){var o=r("./external"),i=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(f,d,h,p,w){this.compressedSize=f,this.uncompressedSize=d,this.crc32=h,this.compression=p,this.compressedContent=w}c.prototype={getContentWorker:function(){var f=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return f.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new i(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(f,d,h){return f.pipe(new a).pipe(new l("uncompressedSize")).pipe(d.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,s){var o=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var o=r("./utils"),i=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var f=0;f<8;f++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,f,d,h){var p=i,w=h+d;c^=-1;for(var m=h;m>>8^p[255&(c^f[m])];return-1^c}(0|l,a,a.length,0):function(c,f,d,h){var p=i,w=h+d;c^=-1;for(var m=h;m>>8^p[255&(c^f.charCodeAt(m))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,n,s){var o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=o?"uint8array":"array";function f(d,h){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=h,this.meta={}}s.magic="\b\0",a.inherits(f,l),f.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,d.data),!1)},f.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(h){d.push({data:h,meta:d.meta})}},s.compressWorker=function(d){return new f("Deflate",d)},s.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function o(p,w){var m,x="";for(m=0;m>>=8;return x}function i(p,w,m,x,g,v){var _,C,E=p.file,T=p.compression,P=v!==c.utf8encode,O=a.transformTo("string",v(E.name)),j=a.transformTo("string",c.utf8encode(E.name)),L=E.comment,q=a.transformTo("string",v(L)),R=a.transformTo("string",c.utf8encode(L)),F=j.length!==E.name.length,b=R.length!==L.length,V="",te="",W="",Z=E.dir,I=E.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};w&&!m||(Q.crc32=p.crc32,Q.compressedSize=p.compressedSize,Q.uncompressedSize=p.uncompressedSize);var z=0;w&&(z|=8),P||!F&&!b||(z|=2048);var $=0,de=0;Z&&($|=16),g==="UNIX"?(de=798,$|=function(se,Ee){var fe=se;return se||(fe=Ee?16893:33204),(65535&fe)<<16}(E.unixPermissions,Z)):(de=20,$|=function(se){return 63&(se||0)}(E.dosPermissions)),_=I.getUTCHours(),_<<=6,_|=I.getUTCMinutes(),_<<=5,_|=I.getUTCSeconds()/2,C=I.getUTCFullYear()-1980,C<<=4,C|=I.getUTCMonth()+1,C<<=5,C|=I.getUTCDate(),F&&(te=o(1,1)+o(f(O),4)+j,V+="up"+o(te.length,2)+te),b&&(W=o(1,1)+o(f(q),4)+R,V+="uc"+o(W.length,2)+W);var ne="";return ne+=` -\0`,ne+=o(z,2),ne+=T.magic,ne+=o(_,2),ne+=o(C,2),ne+=o(Q.crc32,4),ne+=o(Q.compressedSize,4),ne+=o(Q.uncompressedSize,4),ne+=o(O.length,2),ne+=o(V.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ne+O+V,dirRecord:d.CENTRAL_FILE_HEADER+o(de,2)+ne+o(q.length,2)+"\0\0\0\0"+o($,4)+o(x,4)+O+V+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),f=r("../crc32"),d=r("../signature");function h(p,w,m,x){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=m,this.encodeFileName=x,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,l),h.prototype.push=function(p){var w=p.meta.percent||0,m=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,l.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:m?(w+100*(m-x-1))/m:100}}))},h.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var w=this.streamFiles&&!p.file.dir;if(w){var m=i(p,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(p){this.accumulate=!1;var w=this.streamFiles&&!p.file.dir,m=i(p,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),w)this.push({data:function(x){return d.DATA_DESCRIPTOR+o(x.crc32,4)+o(x.compressedSize,4)+o(x.uncompressedSize,4)}(p),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var p=this.bytesWritten,w=0;w=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=i},{"../utils":32}],19:[function(r,n,s){var o=r("./Uint8ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var o=r("./DataReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var o=r("./ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var o=r("../utils"),i=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),f=r("./Uint8ArrayReader");n.exports=function(d){var h=o.getTypeOf(d);return o.checkSupport(h),h!=="string"||i.uint8array?h==="nodebuffer"?new c(d):i.uint8array?new f(o.transformTo("uint8array",d)):new a(o.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var o=r("./GenericWorker"),i=r("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}i.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:i.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var o=r("./GenericWorker"),i=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=i(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,i),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}i.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(f){c.dataIsReady=!0,c.data=f,c.max=f&&f.length||0,c.type=o.getTypeOf(f),c.isPaused||c._tickAndRepeat()},function(f){c.error(f)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var l=0;l "+i:i}},n.exports=o},{}],29:[function(r,n,s){var o=r("../utils"),i=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),f=r("../external"),d=null;if(c.nodestream)try{d=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(w,m){return new f.Promise(function(x,g){var v=[],_=w._internalType,C=w._outputType,E=w._mimeType;w.on("data",function(T,P){v.push(T),m&&m(P)}).on("error",function(T){v=[],g(T)}).on("end",function(){try{var T=function(P,O,j){switch(P){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),j);case"base64":return l.encode(O);default:return o.transformTo(P,O)}}(C,function(P,O){var j,L=0,q=null,R=0;for(j=0;j"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var o=r("./utils"),i=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}s.utf8encode=function(p){return i.nodebuffer?a.newBufferFrom(p,"utf-8"):function(w){var m,x,g,v,_,C=w.length,E=0;for(v=0;v>>6:(x<65536?m[_++]=224|x>>>12:(m[_++]=240|x>>>18,m[_++]=128|x>>>12&63),m[_++]=128|x>>>6&63),m[_++]=128|63&x);return m}(p)},s.utf8decode=function(p){return i.nodebuffer?o.transformTo("nodebuffer",p).toString("utf-8"):function(w){var m,x,g,v,_=w.length,C=new Array(2*_);for(m=x=0;m<_;)if((g=w[m++])<128)C[x++]=g;else if(4<(v=c[g]))C[x++]=65533,m+=v-1;else{for(g&=v===2?31:v===3?15:7;1>10&1023,C[x++]=56320|1023&g)}return C.length!==x&&(C.subarray?C=C.subarray(0,x):C.length=x),o.applyFromCharCode(C)}(p=o.transformTo(i.uint8array?"uint8array":"array",p))},o.inherits(d,l),d.prototype.processChunk=function(p){var w=o.transformTo(i.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=w;(w=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),w.set(m,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var x=function(v,_){var C;for((_=_||v.length)>v.length&&(_=v.length),C=_-1;0<=C&&(192&v[C])==128;)C--;return C<0||C===0?_:C+c[v[C]]>_?C:_}(w),g=w;x!==w.length&&(i.uint8array?(g=w.subarray(0,x),this.leftOver=w.subarray(x,w.length)):(g=w.slice(0,x),this.leftOver=w.slice(x,w.length))),this.push({data:s.utf8decode(g),meta:p.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=d,o.inherits(h,l),h.prototype.processChunk=function(p){this.push({data:s.utf8encode(p.data),meta:p.meta})},s.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var o=r("./support"),i=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(m){return m}function f(m,x){for(var g=0;g>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var w,m,x,g=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4>>6:(p<65536?h[x++]=224|p>>>12:(h[x++]=240|p>>>18,h[x++]=128|p>>>12&63),h[x++]=128|p>>>6&63),h[x++]=128|63&p);return h},s.buf2binstring=function(d){return f(d,d.length)},s.binstring2buf=function(d){for(var h=new o.Buf8(d.length),p=0,w=h.length;p>10&1023,v[w++]=56320|1023&m)}return f(v,w)},s.utf8border=function(d,h){var p;for((h=h||d.length)>d.length&&(h=d.length),p=h-1;0<=p&&(192&d[p])==128;)p--;return p<0||p===0?h:p+l[d[p]]>h?p:h}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,a,l){for(var c=65535&o|0,f=o>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3>>1:i>>>1;a[l]=i}return a}();n.exports=function(i,a,l,c){var f=o,d=c+l;i^=-1;for(var h=c;h>>8^f[255&(i^a[h])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),f=r("./messages"),d=0,h=4,p=0,w=-2,m=-1,x=4,g=2,v=8,_=9,C=286,E=30,T=19,P=2*C+1,O=15,j=3,L=258,q=L+j+1,R=42,F=113,b=1,V=2,te=3,W=4;function Z(k,J){return k.msg=f[J],J}function I(k){return(k<<1)-(4k.avail_out&&(G=k.avail_out),G!==0&&(i.arraySet(k.output,J.pending_buf,J.pending_out,G,k.next_out),k.next_out+=G,J.pending_out+=G,k.total_out+=G,k.avail_out-=G,J.pending-=G,J.pending===0&&(J.pending_out=0))}function $(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function de(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var G,D,S=k.max_chain_length,N=k.strstart,A=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,he=k.strstart+L,Le=H[N+A-1],Oe=H[N+A];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(G=J)+A]===Oe&&H[G+A-1]===Le&&H[G]===H[N]&&H[++G]===H[N+1]){N+=2,G++;do;while(H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&NM&&--S!=0);return A<=k.lookahead?A:k.lookahead}function Ee(k){var J,G,D,S,N,A,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(i.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=G=k.hash_size;D=k.head[--J],k.head[J]=ee<=D?D-ee:0,--G;);for(J=G=ee;D=k.prev[--J],k.prev[J]=ee<=D?D-ee:0,--G;);S+=ee}if(k.strm.avail_in===0)break;if(A=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=A.avail_in,H=j)for(N=k.strstart-k.insert,k.ins_h=k.window[N],k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j)if(D=a._tr_tally(k,k.strstart-k.match_start,k.match_length-j),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=j){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-j,D=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-j),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(G=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Ee(k),k.lookahead===0&&J===d)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var D=k.block_start+G;if((k.strstart===0||k.strstart>=D)&&(k.lookahead=k.strstart-D,k.strstart=D,$(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&($(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===h?($(k,!0),k.strm.avail_out===0?te:W):(k.strstart>k.block_start&&($(k,!1),k.strm.avail_out),b)}),new be(4,4,8,4,fe),new be(4,5,16,8,fe),new be(4,6,32,32,fe),new be(4,4,16,16,ge),new be(8,16,32,32,ge),new be(8,16,128,128,ge),new be(8,32,128,256,ge),new be(32,128,258,1024,ge),new be(32,258,258,4096,ge)],s.deflateInit=function(k,J){return et(k,J,v,15,8,0)},s.deflateInit2=et,s.deflateReset=Se,s.deflateResetKeep=Te,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?w:(k.state.gzhead=J,p):w},s.deflate=function(k,J){var G,D,S,N;if(!k||!k.state||5>8&255),de(D,D.gzhead.time>>16&255),de(D,D.gzhead.time>>24&255),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(de(D,255&D.gzhead.extra.length),de(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(k.adler=c(k.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(de(D,0),de(D,0),de(D,0),de(D,0),de(D,0),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,3),D.status=F);else{var A=v+(D.w_bits-8<<4)<<8;A|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(A|=32),A+=31-A%31,D.status=F,ne(D,A),D.strstart!==0&&(ne(D,k.adler>>>16),ne(D,65535&k.adler)),k.adler=1}if(D.status===69)if(D.gzhead.extra){for(S=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending!==D.pending_buf_size));)de(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){N=1;break}N=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),N===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){N=1;break}N=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),N===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&z(k),D.pending+2<=D.pending_buf_size&&(de(D,255&k.adler),de(D,k.adler>>8&255),k.adler=0,D.status=F)):D.status=F),D.pending!==0){if(z(k),k.avail_out===0)return D.last_flush=-1,p}else if(k.avail_in===0&&I(J)<=I(G)&&J!==h)return Z(k,-5);if(D.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||D.lookahead!==0||J!==d&&D.status!==666){var Y=D.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Ee(M),M.lookahead===0)){if(H===d)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===h?($(M,!0),M.strm.avail_out===0?te:W):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):D.strategy===3?function(M,H){for(var X,ee,he,Le,Oe=M.window;;){if(M.lookahead<=L){if(Ee(M),M.lookahead<=L&&H===d)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=j&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=j?(X=a._tr_tally(M,1,M.match_length-j),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===h?($(M,!0),M.strm.avail_out===0?te:W):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):o[D.level].func(D,J);if(Y!==te&&Y!==W||(D.status=666),Y===b||Y===te)return k.avail_out===0&&(D.last_flush=-1),p;if(Y===V&&(J===1?a._tr_align(D):J!==5&&(a._tr_stored_block(D,0,0,!1),J===3&&(Q(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),z(k),k.avail_out===0))return D.last_flush=-1,p}return J!==h?p:D.wrap<=0?1:(D.wrap===2?(de(D,255&k.adler),de(D,k.adler>>8&255),de(D,k.adler>>16&255),de(D,k.adler>>24&255),de(D,255&k.total_in),de(D,k.total_in>>8&255),de(D,k.total_in>>16&255),de(D,k.total_in>>24&255)):(ne(D,k.adler>>>16),ne(D,65535&k.adler)),z(k),0=G.w_size&&(N===0&&(Q(G.head),G.strstart=0,G.block_start=0,G.insert=0),H=new i.Buf8(G.w_size),i.arraySet(H,J,X-G.w_size,G.w_size,0),J=H,X=G.w_size),A=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Ee(G);G.lookahead>=j;){for(D=G.strstart,S=G.lookahead-(j-1);G.ins_h=(G.ins_h<>>=j=O>>>24,_-=j,(j=O>>>16&255)===0)V[f++]=65535&O;else{if(!(16&j)){if(!(64&j)){O=C[(65535&O)+(v&(1<>>=j,_-=j),_<15&&(v+=b[l++]<<_,_+=8,v+=b[l++]<<_,_+=8),O=E[v&P];r:for(;;){if(v>>>=j=O>>>24,_-=j,!(16&(j=O>>>16&255))){if(!(64&j)){O=E[(65535&O)+(v&(1<>>=j,_-=j,(j=f-d)>3,v&=(1<<(_-=L<<3))-1,o.next_in=l,o.next_out=f,o.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(R){var F;return R&&R.state?(F=R.state,R.total_in=R.total_out=F.total=0,R.msg="",F.wrap&&(R.adler=1&F.wrap),F.mode=w,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(m),F.distcode=F.distdyn=new o.Buf32(x),F.sane=1,F.back=-1,h):p}function C(R){var F;return R&&R.state?((F=R.state).wsize=0,F.whave=0,F.wnext=0,_(R)):p}function E(R,F){var b,V;return R&&R.state?(V=R.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=W.wsize?(o.arraySet(W.window,F,b-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(V<(te=W.wsize-W.wnext)&&(te=V),o.arraySet(W.window,F,b-V,te,W.wnext),(V-=te)?(o.arraySet(W.window,F,b-V,V,0),W.wnext=V,W.whave=W.wsize):(W.wnext+=te,W.wnext===W.wsize&&(W.wnext=0),W.whave>>8&255,b.check=a(b.check,N,2,0),$=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){R.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){R.msg="unknown compression method",b.mode=30;break}if($-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){R.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=z=0,b.mode=3;case 3:for(;$<32;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}b.head&&(b.head.time=z),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,N[2]=z>>>16&255,N[3]=z>>>24&255,b.check=a(b.check,N,4,0)),$=z=0,b.mode=4;case 4:for(;$<16;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}b.head&&(b.head.xflags=255&z,b.head.os=z>>8),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=z=0,b.mode=5;case 5:if(1024&b.flags){for(;$<16;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}b.length=z,b.head&&(b.head.extra_len=z),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),o.arraySet(b.head.extra,V,W,se,k)),512&b.flags&&(b.check=a(b.check,V,se,W)),I-=se,W+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=V[W+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),R.adler=b.check=0,b.mode=12;break;case 10:for(;$<32;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}R.adler=b.check=g(z),$=z=0,b.mode=11;case 11:if(b.havedict===0)return R.next_out=Z,R.avail_out=Q,R.next_in=W,R.avail_in=I,b.hold=z,b.bits=$,2;R.adler=b.check=1,b.mode=12;case 12:if(F===5||F===6)break e;case 13:if(b.last){z>>>=7&$,$-=7&$,b.mode=27;break}for(;$<3;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}switch(b.last=1&z,$-=1,3&(z>>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,$-=2;break e;case 2:b.mode=17;break;case 3:R.msg="invalid block type",b.mode=30}z>>>=2,$-=2;break;case 14:for(z>>>=7&$,$-=7&$;$<32;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if((65535&z)!=(z>>>16^65535)){R.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,$=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,$-=5,b.ndist=1+(31&z),z>>>=5,$-=5,b.ncode=4+(15&z),z>>>=4,$-=4,286>>=3,$-=3}for(;b.have<19;)b.lens[A[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,G={bits:b.lenbits},J=c(0,b.lens,0,19,b.lencode,0,b.work,G),b.lenbits=G.bits,J){R.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Pe=65535&S,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if(Pe<16)z>>>=ge,$-=ge,b.lens[b.have++]=Pe;else{if(Pe===16){for(D=ge+2;$>>=ge,$-=ge,b.have===0){R.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,$-=2}else if(Pe===17){for(D=ge+3;$>>=ge)),z>>>=3,$-=3}else{for(D=ge+7;$>>=ge)),z>>>=7,$-=7}if(b.have+se>b.nlen+b.ndist){R.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){R.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,G={bits:b.lenbits},J=c(f,b.lens,0,b.nlen,b.lencode,0,b.work,G),b.lenbits=G.bits,J){R.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,G={bits:b.distbits},J=c(d,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,G),b.distbits=G.bits,J){R.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){R.next_out=Z,R.avail_out=Q,R.next_in=W,R.avail_in=I,b.hold=z,b.bits=$,l(R,ne),Z=R.next_out,te=R.output,Q=R.avail_out,W=R.next_in,V=R.input,I=R.avail_in,z=b.hold,$=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;be=(S=b.lencode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if(be&&!(240&be)){for(Te=ge,Se=be,et=Pe;be=(S=b.lencode[et+((z&(1<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}z>>>=Te,$-=Te,b.back+=Te}if(z>>>=ge,$-=ge,b.back+=ge,b.length=Pe,be===0){b.mode=26;break}if(32&be){b.back=-1,b.mode=12;break}if(64&be){R.msg="invalid literal/length code",b.mode=30;break}b.extra=15&be,b.mode=22;case 22:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;be=(S=b.distcode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if(!(240&be)){for(Te=ge,Se=be,et=Pe;be=(S=b.distcode[et+((z&(1<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}z>>>=Te,$-=Te,b.back+=Te}if(z>>>=ge,$-=ge,b.back+=ge,64&be){R.msg="invalid distance code",b.mode=30;break}b.offset=Pe,b.extra=15&be,b.mode=24;case 24:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){R.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){R.msg="invalid distance too far back",b.mode=30;break}Ee=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Ee=Z-b.offset,se=b.length;for(QP?(j=Ee[fe+x[F]],$[de+x[F]]):(j=96,0),v=1<>Z)+(_-=v)]=O<<24|j<<16|L|0,_!==0;);for(v=1<>=1;if(v!==0?(z&=v-1,z+=v):z=0,F++,--ne[R]==0){if(R===V)break;R=d[h+x[F]]}if(te>>7)]}function de(S,N){S.pending_buf[S.pending++]=255&N,S.pending_buf[S.pending++]=N>>>8&255}function ne(S,N,A){S.bi_valid>g-A?(S.bi_buf|=N<>g-S.bi_valid,S.bi_valid+=A-g):(S.bi_buf|=N<>>=1,A<<=1,0<--N;);return A>>>1}function fe(S,N,A){var Y,M,H=new Array(x+1),X=0;for(Y=1;Y<=x;Y++)H[Y]=X=X+A[Y-1]<<1;for(M=0;M<=N;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Ee(H[ee]++,ee))}}function ge(S){var N;for(N=0;N>1;1<=A;A--)Te(S,H,A);for(M=he;A=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Te(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=A,S.heap[--S.heap_max]=Y,H[2*M]=H[2*A]+H[2*Y],S.depth[M]=(S.depth[A]>=S.depth[Y]?S.depth[A]:S.depth[Y])+1,H[2*A+1]=H[2*Y+1]=M,S.heap[1]=M++,Te(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Oe,St){var Vr,Wt,Vn,st,Wn,Bn,Wr=St.dyn_tree,yc=St.max_code,wc=St.stat_desc.static_tree,ti=St.stat_desc.has_stree,xc=St.stat_desc.extra_bits,ri=St.stat_desc.extra_base,_n=St.stat_desc.max_length,Rs=0;for(st=0;st<=x;st++)Oe.bl_count[st]=0;for(Wr[2*Oe.heap[Oe.heap_max]+1]=0,Vr=Oe.heap_max+1;Vr>=7;M>>=1)if(1&Le&&ee.dyn_ltree[2*he]!==0)return i;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(he=32;he>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=A+5,A+4<=M&&N!==-1?D(S,N,A,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Se(S,q,R)):(ne(S,4+(Y?1:0),3),function(ee,he,Le,Oe){var St;for(ne(ee,he-257,5),ne(ee,Le-1,5),ne(ee,Oe-4,4),St=0;St>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&N,S.pending_buf[S.l_buf+S.last_lit]=255&A,S.last_lit++,N===0?S.dyn_ltree[2*A]++:(S.matches++,N--,S.dyn_ltree[2*(b[A]+d+1)]++,S.dyn_dtree[2*$(N)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,_,q),function(N){N.bi_valid===16?(de(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):8<=N.bi_valid&&(N.pending_buf[N.pending++]=255&N.bi_buf,N.bi_buf>>=8,N.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(o){(function(i,a){if(!i.setImmediate){var l,c,f,d,h=1,p={},w=!1,m=i.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(i);x=x&&x.setTimeout?x:i,l={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){v(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,E=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=E,C}}()?(d="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(C){i.postMessage(d+C,"*")}):i.MessageChannel?((f=new MessageChannel).port1.onmessage=function(C){v(C.data)},function(C){f.port2.postMessage(C)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(C){var E=m.createElement("script");E.onreadystatechange=function(){v(C),E.onreadystatechange=null,c.removeChild(E),E=null},c.appendChild(E)}):function(C){setTimeout(v,0,C)},x.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var E=new Array(arguments.length-1),T=0;T"u"?o===void 0?this:o:self)}).call(this,typeof Cc<"u"?Cc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(CC);var x5=CC.exports;const _5=pm(x5);function b5(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const S5=async(e,t)=>{const r=new _5;t.forEach(o=>{r.file(o.name,o.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},Al=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},k5=e=>Al(e).split(" ")[0],C5=async()=>Dt().collection("domains").getFullList({sort:"-created",expand:"lastDeployment"}),E5=async e=>await Dt().collection("domains").getOne(e),tm=async e=>e.id?await Dt().collection("domains").update(e.id,e):await Dt().collection("domains").create(e),T5=async e=>await Dt().collection("domains").delete(e),R5=(e,t)=>Dt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),N5=e=>{Dt().collection("domains").unsubscribe(e)},P5=()=>{const e=Sf(),t=Ss(),r=()=>{t("/edit")},n=d=>{t(`/edit?id=${d}`)},s=d=>{t(`/history?domain=${d}`)},o=async d=>{try{await T5(d),a(i.filter(h=>h.id!==d))}catch(h){console.error("Error deleting domain:",h)}},[i,a]=y.useState([]);y.useEffect(()=>{(async()=>{const h=await C5();a(h)})()},[]);const l=async d=>{const h=i.filter(x=>x.id===d),p=h[0].enabled,w=h[0];w.enabled=!p,await tm(w);const m=i.map(x=>x.id===d?{...x,checked:!p}:x);a(m)},c=async d=>{try{N5(d.id),R5(d.id,h=>{console.log(h);const p=i.map(w=>w.id===h.id?{...h}:w);a(p)}),d.rightnow=!0,await tm(d),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:u.jsxs(u.Fragment,{children:["执行失败,请查看",u.jsx(Kn,{to:`/history?domain=${d.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},f=async d=>{const h=`${d.id}-${d.domain}.zip`,p=[{name:`${d.domain}.pem`,content:d.certificate?d.certificate:""},{name:`${d.domain}.key`,content:d.privateKey?d.privateKey:""}];await S5(h,p)};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(Cv,{}),u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),u.jsx(Et,{onClick:r,children:"新增域名"})]}),i.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-40",children:"域名"}),u.jsx("div",{className:"w-48",children:"有效期限"}),u.jsx("div",{className:"w-32",children:"最近执行状态"}),u.jsx("div",{className:"w-64",children:"最近执行阶段"}),u.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),u.jsx("div",{className:"w-32",children:"是否启用"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),i.map(d=>{var h,p,w,m,x,g;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:d.domain}),u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx("div",{children:d.expiredAt?u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"有效期90天"}),u.jsxs("div",{children:[k5(d.expiredAt),"到期"]})]}):"---"})}),u.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:d.lastDeployedAt&&((h=d.expand)!=null&&h.lastDeployment)?u.jsx(u.Fragment,{children:((p=d.expand.lastDeployment)==null?void 0:p.phase)==="deploy"&&((w=d.expand.lastDeployment)!=null&&w.phaseSuccess)?u.jsx(r1,{size:16,className:"text-green-700"}):u.jsx(n1,{size:16,className:"text-red-700"})}):"---"}),u.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:d.lastDeployedAt&&((m=d.expand)!=null&&m.lastDeployment)?u.jsx(pk,{phase:(x=d.expand.lastDeployment)==null?void 0:x.phase,phaseSuccess:(g=d.expand.lastDeployment)==null?void 0:g.phaseSuccess}):"---"}),u.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:d.lastDeployedAt?Al(d.lastDeployedAt):"---"}),u.jsx("div",{className:"sm:w-32 flex items-center",children:u.jsx(wC,{children:u.jsxs(v5,{children:[u.jsx(y5,{children:u.jsx(Zk,{checked:d.enabled,onCheckedChange:()=>{l(d.id)}})}),u.jsx(Tv,{children:u.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:d.enabled?"禁用":"启用"})})]})})}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>s(d.id),children:"部署历史"}),u.jsxs(iw,{when:!!d.enabled,children:[u.jsx(Kt,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>c(d),children:"立即部署"})]}),u.jsxs(iw,{when:!!d.expiredAt,children:[u.jsx(Kt,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>f(d),children:"下载"})]}),!d.enabled&&u.jsxs(u.Fragment,{children:[u.jsx(Kt,{orientation:"vertical",className:"h-4 mx-2"}),u.jsxs(y3,{children:[u.jsx(w3,{asChild:!0,children:u.jsx(Et,{variant:"link",className:"p-0",children:"删除"})}),u.jsxs(Mk,{children:[u.jsxs(Ik,{children:[u.jsx(Fk,{children:"删除域名"}),u.jsx(zk,{children:"确定要删除域名吗?"})]}),u.jsxs(Lk,{children:[u.jsx($k,{children:"取消"}),u.jsx(Uk,{onClick:()=>{o(d.id)},children:"确认"})]})]})]}),u.jsx(Kt,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>n(d.id),children:"编辑"})]})]})]},d.id)})]}):u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(Ap,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),u.jsx(Et,{onClick:r,className:"mt-3",children:"添加域名"})]})})]})})},it=y.forwardRef(({className:e,type:t,...r},n)=>u.jsx("input",{type:t,className:we("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));it.displayName="Input";var mc=e=>e.type==="checkbox",Ni=e=>e instanceof Date,fr=e=>e==null;const EC=e=>typeof e=="object";var Gt=e=>!fr(e)&&!Array.isArray(e)&&EC(e)&&!Ni(e),TC=e=>Gt(e)&&e.target?mc(e.target)?e.target.checked:e.target.value:e,j5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,RC=(e,t)=>e.has(j5(t)),D5=e=>{const t=e.constructor&&e.constructor.prototype;return Gt(t)&&t.hasOwnProperty("isPrototypeOf")},Rv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function xr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Rv&&(e instanceof Blob||e instanceof FileList))&&(r||Gt(e)))if(t=r?[]:{},!r&&!D5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=xr(e[n]));else return e;return t}var Rf=e=>Array.isArray(e)?e.filter(Boolean):[],Lt=e=>e===void 0,ce=(e,t,r)=>{if(!t||!Gt(e))return r;const n=Rf(t.split(/[,[\].]+?/)).reduce((s,o)=>fr(s)?s:s[o],e);return Lt(n)||n===e?Lt(e[t])?r:e[t]:n},Rn=e=>typeof e=="boolean",Nv=e=>/^\w*$/.test(e),NC=e=>Rf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ut=(e,t,r)=>{let n=-1;const s=Nv(t)?[t]:NC(t),o=s.length,i=o-1;for(;++nQe.useContext(PC),O5=e=>{const{children:t,...r}=e;return Qe.createElement(PC.Provider,{value:r},t)};var jC=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==an.all&&(t._proxyFormState[i]=!n||an.all),r&&(r[i]=!0),e[i]}});return s},Nr=e=>Gt(e)&&!Object.keys(e).length,DC=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||an.all))},nl=e=>Array.isArray(e)?e:[e],OC=(e,t,r)=>!e||!t||e===t||nl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Pv(e){const t=Qe.useRef(e);t.current=e,Qe.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function A5(e){const t=Nf(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,a]=Qe.useState(r._formState),l=Qe.useRef(!0),c=Qe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=Qe.useRef(s);return f.current=s,Pv({disabled:n,next:d=>l.current&&OC(f.current,d.name,o)&&DC(d,c.current,r._updateFormState)&&a({...r._formState,...d}),subject:r._subjects.state}),Qe.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),jC(i,r,c.current,!1)}var Pn=e=>typeof e=="string",AC=(e,t,r,n,s)=>Pn(e)?(n&&t.watch.add(e),ce(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),ce(r,o))):(n&&(t.watchAll=!0),r);function M5(e){const t=Nf(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},a=Qe.useRef(n);a.current=n,Pv({disabled:o,subject:r._subjects.values,next:f=>{OC(a.current,f.name,i)&&c(xr(AC(a.current,r._names,f.values||r._formValues,!1,s)))}});const[l,c]=Qe.useState(r._getWatch(n,s));return Qe.useEffect(()=>r._removeUnmounted()),l}function I5(e){const t=Nf(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=RC(s._names.array,r),a=M5({control:s,name:r,defaultValue:ce(s._formValues,r,ce(s._defaultValues,r,e.defaultValue)),exact:!0}),l=A5({control:s,name:r}),c=Qe.useRef(s.register(r,{...e.rules,value:a,...Rn(e.disabled)?{disabled:e.disabled}:{}}));return Qe.useEffect(()=>{const f=s._options.shouldUnregister||o,d=(h,p)=>{const w=ce(s._fields,h);w&&w._f&&(w._f.mount=p)};if(d(r,!0),f){const h=xr(ce(s._options.defaultValues,r));ut(s._defaultValues,r,h),Lt(ce(s._formValues,r))&&ut(s._formValues,r,h)}return()=>{(i?f&&!s._state.action:f)?s.unregister(r):d(r,!1)}},[r,s,i,o]),Qe.useEffect(()=>{ce(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:ce(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...Rn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:Qe.useCallback(f=>c.current.onChange({target:{value:TC(f),name:r},type:pd.CHANGE}),[r]),onBlur:Qe.useCallback(()=>c.current.onBlur({target:{value:ce(s._formValues,r),name:r},type:pd.BLUR}),[r,s]),ref:f=>{const d=ce(s._fields,r);d&&f&&(d._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:h=>f.setCustomValidity(h),reportValidity:()=>f.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ce(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!ce(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ce(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ce(l.validatingFields,r)},error:{enumerable:!0,get:()=>ce(l.errors,r)}})}}const L5=e=>e.render(I5(e));var MC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},cw=e=>({isOnSubmit:!e||e===an.onSubmit,isOnBlur:e===an.onBlur,isOnChange:e===an.onChange,isOnAll:e===an.all,isOnTouch:e===an.onTouched}),uw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const sl=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=ce(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)break;if(i.ref&&t(i.ref,i.name)&&!n)break;sl(a,t)}else Gt(a)&&sl(a,t)}}};var F5=(e,t,r)=>{const n=nl(ce(e,r));return ut(n,"root",t[r]),ut(e,r,n),e},jv=e=>e.type==="file",Bs=e=>typeof e=="function",md=e=>{if(!Rv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ku=e=>Pn(e),Dv=e=>e.type==="radio",gd=e=>e instanceof RegExp;const dw={value:!1,isValid:!1},fw={value:!0,isValid:!0};var IC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Lt(e[0].attributes.value)?Lt(e[0].value)||e[0].value===""?fw:{value:e[0].value,isValid:!0}:fw:dw}return dw};const hw={isValid:!1,value:null};var LC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,hw):hw;function pw(e,t,r="validate"){if(ku(e)||Array.isArray(e)&&e.every(ku)||Rn(e)&&!e)return{type:r,message:ku(e)?e:"",ref:t}}var fi=e=>Gt(e)&&!gd(e)?e:{value:e,message:""},mw=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:l,minLength:c,min:f,max:d,pattern:h,validate:p,name:w,valueAsNumber:m,mount:x,disabled:g}=e._f,v=ce(t,w);if(!x||g)return{};const _=i?i[0]:o,C=R=>{n&&_.reportValidity&&(_.setCustomValidity(Rn(R)?"":R||""),_.reportValidity())},E={},T=Dv(o),P=mc(o),O=T||P,j=(m||jv(o))&&Lt(o.value)&&Lt(v)||md(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,L=MC.bind(null,w,r,E),q=(R,F,b,V=Gn.maxLength,te=Gn.minLength)=>{const W=R?F:b;E[w]={type:R?V:te,message:W,ref:o,...L(R?V:te,W)}};if(s?!Array.isArray(v)||!v.length:a&&(!O&&(j||fr(v))||Rn(v)&&!v||P&&!IC(i).isValid||T&&!LC(i).isValid)){const{value:R,message:F}=ku(a)?{value:!!a,message:a}:fi(a);if(R&&(E[w]={type:Gn.required,message:F,ref:_,...L(Gn.required,F)},!r))return C(F),E}if(!j&&(!fr(f)||!fr(d))){let R,F;const b=fi(d),V=fi(f);if(!fr(v)&&!isNaN(v)){const te=o.valueAsNumber||v&&+v;fr(b.value)||(R=te>b.value),fr(V.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=o.type=="time",I=o.type=="week";Pn(b.value)&&v&&(R=Z?W(v)>W(b.value):I?v>b.value:te>new Date(b.value)),Pn(V.value)&&v&&(F=Z?W(v)+R.value,V=!fr(F.value)&&v.length<+F.value;if((b||V)&&(q(b,R.message,F.message),!r))return C(E[w].message),E}if(h&&!j&&Pn(v)){const{value:R,message:F}=fi(h);if(gd(R)&&!v.match(R)&&(E[w]={type:Gn.pattern,message:F,ref:o,...L(Gn.pattern,F)},!r))return C(F),E}if(p){if(Bs(p)){const R=await p(v,t),F=pw(R,_);if(F&&(E[w]={...F,...L(Gn.validate,F.message)},!r))return C(F.message),E}else if(Gt(p)){let R={};for(const F in p){if(!Nr(R)&&!r)break;const b=pw(await p[F](v,t),_,F);b&&(R={...b,...L(F,b.message)},C(b.message),r&&(E[w]=R))}if(!Nr(R)&&(E[w]={ref:_,...R},!r))return E}}return C(!0),E};function z5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},vd=e=>fr(e)||!EC(e);function Ro(e,t){if(vd(e)||vd(t))return e===t;if(Ni(e)&&Ni(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const o=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Ni(o)&&Ni(i)||Gt(o)&&Gt(i)||Array.isArray(o)&&Array.isArray(i)?!Ro(o,i):o!==i)return!1}}return!0}var FC=e=>e.type==="select-multiple",$5=e=>Dv(e)||mc(e),Dh=e=>md(e)&&e.isConnected,zC=e=>{for(const t in e)if(Bs(e[t]))return!0;return!1};function yd(e,t={}){const r=Array.isArray(e);if(Gt(e)||r)for(const n in e)Array.isArray(e[n])||Gt(e[n])&&!zC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},yd(e[n],t[n])):fr(e[n])||(t[n]=!0);return t}function UC(e,t,r){const n=Array.isArray(e);if(Gt(e)||n)for(const s in e)Array.isArray(e[s])||Gt(e[s])&&!zC(e[s])?Lt(t)||vd(r[s])?r[s]=Array.isArray(e[s])?yd(e[s],[]):{...yd(e[s])}:UC(e[s],fr(t)?{}:t[s],r[s]):r[s]=!Ro(e[s],t[s]);return r}var ru=(e,t)=>UC(e,t,yd(t)),$C=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Lt(e)?e:t?e===""?NaN:e&&+e:r&&Pn(e)?new Date(e):n?n(e):e;function Oh(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return jv(t)?t.files:Dv(t)?LC(e.refs).value:FC(t)?[...t.selectedOptions].map(({value:r})=>r):mc(t)?IC(e.refs).value:$C(Lt(t.value)?e.ref.value:t.value,e)}var V5=(e,t,r,n)=>{const s={};for(const o of e){const i=ce(t,o);i&&ut(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ia=e=>Lt(e)?e:gd(e)?e.source:Gt(e)?gd(e.value)?e.value.source:e.value:e,W5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function gw(e,t,r){const n=ce(e,r);if(n||Nv(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=ce(t,o),a=ce(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:r}}var B5=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,H5=(e,t)=>!Rf(ce(e,t)).length&&Bt(e,t);const Y5={mode:an.onSubmit,reValidateMode:an.onChange,shouldFocusError:!0};function Z5(e={}){let t={...Y5,...e},r={submitCount:0,isDirty:!1,isLoading:Bs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Gt(t.defaultValues)||Gt(t.values)?xr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:xr(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:jh(),array:jh(),state:jh()},h=cw(t.mode),p=cw(t.reValidateMode),w=t.criteriaMode===an.all,m=S=>N=>{clearTimeout(c),c=setTimeout(S,N)},x=async S=>{if(f.isValid||S){const N=t.resolver?Nr((await O()).errors):await L(n,!0);N!==r.isValid&&d.state.next({isValid:N})}},g=(S,N)=>{(f.isValidating||f.validatingFields)&&((S||Array.from(a.mount)).forEach(A=>{A&&(N?ut(r.validatingFields,A,N):Bt(r.validatingFields,A))}),d.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},v=(S,N=[],A,Y,M=!0,H=!0)=>{if(Y&&A){if(i.action=!0,H&&Array.isArray(ce(n,S))){const X=A(ce(n,S),Y.argA,Y.argB);M&&ut(n,S,X)}if(H&&Array.isArray(ce(r.errors,S))){const X=A(ce(r.errors,S),Y.argA,Y.argB);M&&ut(r.errors,S,X),H5(r.errors,S)}if(f.touchedFields&&H&&Array.isArray(ce(r.touchedFields,S))){const X=A(ce(r.touchedFields,S),Y.argA,Y.argB);M&&ut(r.touchedFields,S,X)}f.dirtyFields&&(r.dirtyFields=ru(s,o)),d.state.next({name:S,isDirty:R(S,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(o,S,N)},_=(S,N)=>{ut(r.errors,S,N),d.state.next({errors:r.errors})},C=S=>{r.errors=S,d.state.next({errors:r.errors,isValid:!1})},E=(S,N,A,Y)=>{const M=ce(n,S);if(M){const H=ce(o,S,Lt(A)?ce(s,S):A);Lt(H)||Y&&Y.defaultChecked||N?ut(o,S,N?H:Oh(M._f)):V(S,H),i.mount&&x()}},T=(S,N,A,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(ce(n,S)&&ce(n,S)._f&&ce(n,S)._f.disabled);if(!A||Y){f.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=R(),H=X!==ee.isDirty);const Le=he||Ro(ce(s,S),N);X=!!(!he&&ce(r.dirtyFields,S)),Le||he?Bt(r.dirtyFields,S):ut(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||f.dirtyFields&&X!==!Le}if(A){const Le=ce(r.touchedFields,S);Le||(ut(r.touchedFields,S,A),ee.touchedFields=r.touchedFields,H=H||f.touchedFields&&Le!==A)}return H&&M&&d.state.next(ee),H?ee:{}},P=(S,N,A,Y)=>{const M=ce(r.errors,S),H=f.isValid&&Rn(N)&&r.isValid!==N;if(e.delayError&&A?(l=m(()=>_(S,A)),l(e.delayError)):(clearTimeout(c),l=null,A?ut(r.errors,S,A):Bt(r.errors,S)),(A?!Ro(M,A):M)||!Nr(Y)||H){const X={...Y,...H&&Rn(N)?{isValid:N}:{},errors:r.errors,name:S};r={...r,...X},d.state.next(X)}},O=async S=>{g(S,!0);const N=await t.resolver(o,t.context,V5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(S),N},j=async S=>{const{errors:N}=await O(S);if(S)for(const A of S){const Y=ce(N,A);Y?ut(r.errors,A,Y):Bt(r.errors,A)}else r.errors=N;return N},L=async(S,N,A={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);g([Y],!0);const he=await mw(M,o,w,t.shouldUseNativeValidation&&!N,ee);if(g([Y]),he[H.name]&&(A.valid=!1,N))break;!N&&(ce(he,H.name)?ee?F5(r.errors,he,H.name):ut(r.errors,H.name,he[H.name]):Bt(r.errors,H.name))}X&&await L(X,N,A)}}return A.valid},q=()=>{for(const S of a.unMount){const N=ce(n,S);N&&(N._f.refs?N._f.refs.every(A=>!Dh(A)):!Dh(N._f.ref))&&Ee(S)}a.unMount=new Set},R=(S,N)=>(S&&N&&ut(o,S,N),!Ro(z(),s)),F=(S,N,A)=>AC(S,a,{...i.mount?o:Lt(N)?s:Pn(S)?{[S]:N}:N},A,N),b=S=>Rf(ce(i.mount?o:s,S,e.shouldUnregister?ce(s,S,[]):[])),V=(S,N,A={})=>{const Y=ce(n,S);let M=N;if(Y){const H=Y._f;H&&(!H.disabled&&ut(o,S,$C(N,H)),M=md(H.ref)&&fr(N)?"":N,FC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?mc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):jv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||d.values.next({name:S,values:{...o}})))}(A.shouldDirty||A.shouldTouch)&&T(S,M,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&Q(S)},te=(S,N,A)=>{for(const Y in N){const M=N[Y],H=`${S}.${Y}`,X=ce(n,H);(a.array.has(S)||!vd(M)||X&&!X._f)&&!Ni(M)?te(H,M,A):V(H,M,A)}},W=(S,N,A={})=>{const Y=ce(n,S),M=a.array.has(S),H=xr(N);ut(o,S,H),M?(d.array.next({name:S,values:{...o}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&d.state.next({name:S,dirtyFields:ru(s,o),isDirty:R(S,H)})):Y&&!Y._f&&!fr(H)?te(S,H,A):V(S,H,A),uw(S,a)&&d.state.next({...r}),d.values.next({name:i.mount?S:void 0,values:{...o}})},Z=async S=>{i.mount=!0;const N=S.target;let A=N.name,Y=!0;const M=ce(n,A),H=()=>N.type?Oh(M._f):TC(S),X=ee=>{Y=Number.isNaN(ee)||ee===ce(o,A,ee)};if(M){let ee,he;const Le=H(),Oe=S.type===pd.BLUR||S.type===pd.FOCUS_OUT,St=!W5(M._f)&&!t.resolver&&!ce(r.errors,A)&&!M._f.deps||B5(Oe,ce(r.touchedFields,A),r.isSubmitted,p,h),Vr=uw(A,a,Oe);ut(o,A,Le),Oe?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const Wt=T(A,Le,Oe,!1),Vn=!Nr(Wt)||Vr;if(!Oe&&d.values.next({name:A,type:S.type,values:{...o}}),St)return f.isValid&&x(),Vn&&d.state.next({name:A,...Vr?{}:Wt});if(!Oe&&Vr&&d.state.next({...r}),t.resolver){const{errors:st}=await O([A]);if(X(Le),Y){const Wn=gw(r.errors,n,A),Bn=gw(st,n,Wn.name||A);ee=Bn.error,A=Bn.name,he=Nr(st)}}else g([A],!0),ee=(await mw(M,o,w,t.shouldUseNativeValidation))[A],g([A]),X(Le),Y&&(ee?he=!1:f.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),P(A,he,ee,Wt))}},I=(S,N)=>{if(ce(r.errors,N)&&S.focus)return S.focus(),1},Q=async(S,N={})=>{let A,Y;const M=nl(S);if(t.resolver){const H=await j(Lt(S)?S:M);A=Nr(H),Y=S?!M.some(X=>ce(H,X)):A}else S?(Y=(await Promise.all(M.map(async H=>{const X=ce(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&x()):Y=A=await L(n);return d.state.next({...!Pn(S)||f.isValid&&A!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:A}:{},errors:r.errors}),N.shouldFocus&&!Y&&sl(n,I,S?M:a.mount),Y},z=S=>{const N={...i.mount?o:s};return Lt(S)?N:Pn(S)?ce(N,S):S.map(A=>ce(N,A))},$=(S,N)=>({invalid:!!ce((N||r).errors,S),isDirty:!!ce((N||r).dirtyFields,S),error:ce((N||r).errors,S),isValidating:!!ce(r.validatingFields,S),isTouched:!!ce((N||r).touchedFields,S)}),de=S=>{S&&nl(S).forEach(N=>Bt(r.errors,N)),d.state.next({errors:S?r.errors:{}})},ne=(S,N,A)=>{const Y=(ce(n,S,{_f:{}})._f||{}).ref,M=ce(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;ut(r.errors,S,{...he,...N,ref:Y}),d.state.next({name:S,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,N)=>Bs(S)?d.values.subscribe({next:A=>S(F(void 0,N),A)}):F(S,N,!0),Ee=(S,N={})=>{for(const A of S?nl(S):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(Bt(n,A),Bt(o,A)),!N.keepError&&Bt(r.errors,A),!N.keepDirty&&Bt(r.dirtyFields,A),!N.keepTouched&&Bt(r.touchedFields,A),!N.keepIsValidating&&Bt(r.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&Bt(s,A);d.values.next({values:{...o}}),d.state.next({...r,...N.keepDirty?{isDirty:R()}:{}}),!N.keepIsValid&&x()},fe=({disabled:S,name:N,field:A,fields:Y,value:M})=>{if(Rn(S)&&i.mount||S){const H=S?void 0:Lt(M)?Oh(A?A._f:ce(Y,N)._f):M;ut(o,N,H),T(N,H,!1,!1,!0)}},ge=(S,N={})=>{let A=ce(n,S);const Y=Rn(N.disabled);return ut(n,S,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:S}},name:S,mount:!0,...N}}),a.mount.add(S),A?fe({field:A,disabled:N.disabled,name:S,value:N.value}):E(S,!0,N.value),{...Y?{disabled:N.disabled}:{},...t.progressive?{required:!!N.required,min:Ia(N.min),max:Ia(N.max),minLength:Ia(N.minLength),maxLength:Ia(N.maxLength),pattern:Ia(N.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ge(S,N),A=ce(n,S);const H=Lt(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=$5(H),ee=A._f.refs||[];if(X?ee.find(he=>he===H):H===A._f.ref)return;ut(n,S,{_f:{...A._f,...X?{refs:[...ee.filter(Dh),H,...Array.isArray(ce(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),E(S,!1,void 0,H)}else A=ce(n,S,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(RC(a.array,S)&&i.action)&&a.unMount.add(S)}}},be=()=>t.shouldFocusError&&sl(n,I,a.mount),Pe=S=>{Rn(S)&&(d.state.next({disabled:S}),sl(n,(N,A)=>{const Y=ce(n,A);Y&&(N.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},Te=(S,N)=>async A=>{let Y;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let M=xr(o);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await O();r.errors=H,M=X}else await L(n);if(Bt(r.errors,"root"),Nr(r.errors)){d.state.next({errors:{}});try{await S(M,A)}catch(H){Y=H}}else N&&await N({...r.errors},A),be(),setTimeout(be);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Se=(S,N={})=>{ce(n,S)&&(Lt(N.defaultValue)?W(S,xr(ce(s,S))):(W(S,N.defaultValue),ut(s,S,xr(N.defaultValue))),N.keepTouched||Bt(r.touchedFields,S),N.keepDirty||(Bt(r.dirtyFields,S),r.isDirty=N.defaultValue?R(S,xr(ce(s,S))):R()),N.keepError||(Bt(r.errors,S),f.isValid&&x()),d.state.next({...r}))},et=(S,N={})=>{const A=S?xr(S):s,Y=xr(A),M=Nr(S),H=M?s:Y;if(N.keepDefaultValues||(s=A),!N.keepValues){if(N.keepDirtyValues)for(const X of a.mount)ce(r.dirtyFields,X)?ut(H,X,ce(o,X)):W(X,ce(H,X));else{if(Rv&&Lt(S))for(const X of a.mount){const ee=ce(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(md(he)){const Le=he.closest("form");if(Le){Le.reset();break}}}}n={}}o=e.shouldUnregister?N.keepDefaultValues?xr(s):{}:xr(H),d.array.next({values:{...H}}),d.values.next({values:{...H}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!e.shouldUnregister,d.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:M?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Ro(S,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:N.keepDirtyValues?N.keepDefaultValues&&o?ru(s,o):r.dirtyFields:N.keepDefaultValues&&S?ru(s,S):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,N)=>et(Bs(S)?S(o):S,N);return{control:{register:ge,unregister:Ee,getFieldState:$,handleSubmit:Te,setError:ne,_executeSchema:O,_getWatch:F,_getDirty:R,_updateValid:x,_removeUnmounted:q,_updateFieldArray:v,_updateDisabledField:fe,_getFieldArray:b,_reset:et,_resetDefaultValues:()=>Bs(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Pe,_subjects:d,_proxyFormState:f,_setErrors:C,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(S){i=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ge,handleSubmit:Te,watch:se,setValue:W,getValues:z,reset:k,resetField:Se,clearErrors:de,unregister:Ee,setError:ne,setFocus:(S,N={})=>{const A=ce(n,S),Y=A&&A._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),N.shouldSelect&&M.select())}},getFieldState:$}}function Qo(e={}){const t=Qe.useRef(),r=Qe.useRef(),[n,s]=Qe.useState({isDirty:!1,isValidating:!1,isLoading:Bs(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Bs(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Z5(e),formState:n});const o=t.current.control;return o._options=e,Pv({subject:o._subjects.state,next:i=>{DC(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),Qe.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Qe.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),Qe.useEffect(()=>{e.values&&!Ro(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),Qe.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Qe.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Qe.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=jC(n,o),t.current}const vw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ce(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},VC=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?vw(n.ref,r,e):n.refs&&n.refs.forEach(s=>vw(s,r,e))}},G5=(e,t)=>{t.shouldUseNativeValidation&&VC(e,t);const r={};for(const n in e){const s=ce(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(K5(t.names||Object.keys(e),n)){const i=Object.assign({},ce(r,n));ut(i,"root",o),ut(r,n,i)}else ut(r,n,o)}return r},K5=(e,t)=>e.some(r=>r.startsWith(t+"."));var q5=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=MC(i,t,r,s,c?[].concat(c,n.message):n.message)}e.shift()}return r},Jo=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(c){return o.shouldUseNativeValidation&&VC({},o),{errors:{},values:r.raw?n:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:G5(q5(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},rt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(rt||(rt={}));var rm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(rm||(rm={}));const ye=rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zs=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},ie=rt.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"]),X5=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Lr extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,l=0;for(;lr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Lr.create=e=>new Lr(e);const ta=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,rt.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${rt.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${rt.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${rt.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:rt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ie.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ie.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,rt.assertNever(e)}return{message:r}};let WC=ta;function Q5(e){WC=e}function wd(){return WC}const xd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},J5=[];function pe(e,t){const r=wd(),n=xd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ta?void 0:ta].filter(s=>!!s)});e.common.issues.push(n)}class cr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return Ie;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,i=await s.value;n.push({key:o,value:i})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return Ie;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}}const Ie=Object.freeze({status:"aborted"}),Pi=e=>({status:"dirty",value:e}),pr=e=>({status:"valid",value:e}),nm=e=>e.status==="aborted",sm=e=>e.status==="dirty",Ml=e=>e.status==="valid",Il=e=>typeof Promise<"u"&&e instanceof Promise;function _d(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function BC(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ce||(Ce={}));var Wa,Ba;class Ln{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}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 yw=(e,t)=>{if(Ml(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 r=new Lr(e.common.issues);return this._error=r,this._error}}};function ze(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var l,c;const{message:f}=e;return i.code==="invalid_enum_value"?{message:f??a.defaultError}:typeof a.data>"u"?{message:(l=f??n)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=f??r)!==null&&c!==void 0?c:a.defaultError}},description:s}}class He{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 zs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cr,ctx:{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Il(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},o=this._parseSync({data:t,path:s.path,parent:s});return yw(s,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Il(s)?s:Promise.resolve(s));return yw(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ie.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new yn({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return An.create(this,this._def)}nullable(){return lo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fn.create(this,this._def)}promise(){return na.create(this,this._def)}or(t){return Ul.create([this,t],this._def)}and(t){return $l.create(this,t,this._def)}transform(t){return new yn({...ze(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Yl({...ze(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new Ov({typeName:Ae.ZodBranded,type:this,...ze(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Zl({...ze(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return gc.create(this,t)}readonly(){return Gl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ez=/^c[^\s-]{8,}$/i,tz=/^[0-9a-z]+$/,rz=/^[0-9A-HJKMNP-TV-Z]{26}$/,nz=/^[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,sz=/^[a-z0-9_-]{21}$/i,oz=/^[-+]?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)?)??$/,iz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,az="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ah;const lz=/^(?:(?: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])$/,cz=/^(([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})))$/,uz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,HC="((\\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])))",dz=new RegExp(`^${HC}$`);function YC(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 fz(e){return new RegExp(`^${YC(e)}$`)}function ZC(e){let t=`${HC}T${YC(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function hz(e,t){return!!((t==="v4"||!t)&&lz.test(e)||(t==="v6"||!t)&&cz.test(e))}class cn extends He{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.string,received:o.parsedType}),Ie}const n=new cr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:r,code:ie.invalid_string,...Ce.errToObj(n)})}_addCheck(t){return new cn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}datetime(t){var r,n;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:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...Ce.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,...Ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ce.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ce.errToObj(r)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new cn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cn({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new cn({checks:[],typeName:Ae.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};function pz(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class oo extends He{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)!==ye.number){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.number,received:o.parsedType}),Ie}let n;const s=new cr;for(const o of this._def.checks)o.kind==="int"?rt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?pz(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_finite,message:o.message}),s.dirty()):rt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new oo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new oo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&rt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew oo({checks:[],typeName:Ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class io extends He{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)!==ye.bigint){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.bigint,received:o.parsedType}),Ie}let n;const s=new cr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):rt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new io({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new io({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new io({checks:[],typeName:Ae.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};class Ll extends He{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.boolean,received:n.parsedType}),Ie}return pr(t.data)}}Ll.create=e=>new Ll({typeName:Ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class Wo extends He{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.date,received:o.parsedType}),Ie}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_date}),Ie}const n=new cr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):rt.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Wo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Wo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ae.ZodDate,...ze(e)});class bd extends He{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.symbol,received:n.parsedType}),Ie}return pr(t.data)}}bd.create=e=>new bd({typeName:Ae.ZodSymbol,...ze(e)});class Fl extends He{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.undefined,received:n.parsedType}),Ie}return pr(t.data)}}Fl.create=e=>new Fl({typeName:Ae.ZodUndefined,...ze(e)});class zl extends He{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.null,received:n.parsedType}),Ie}return pr(t.data)}}zl.create=e=>new zl({typeName:Ae.ZodNull,...ze(e)});class ra extends He{constructor(){super(...arguments),this._any=!0}_parse(t){return pr(t.data)}}ra.create=e=>new ra({typeName:Ae.ZodAny,...ze(e)});class Do extends He{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pr(t.data)}}Do.create=e=>new Do({typeName:Ae.ZodUnknown,...ze(e)});class ys extends He{_parse(t){const r=this._getOrReturnCtx(t);return pe(r,{code:ie.invalid_type,expected:ye.never,received:r.parsedType}),Ie}}ys.create=e=>new ys({typeName:Ae.ZodNever,...ze(e)});class Sd extends He{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.void,received:n.parsedType}),Ie}return pr(t.data)}}Sd.create=e=>new Sd({typeName:Ae.ZodVoid,...ze(e)});class fn extends He{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==ye.array)return pe(r,{code:ie.invalid_type,expected:ye.array,received:r.parsedType}),Ie;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(pe(r,{code:ie.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Ln(r,i,r.path,a)))).then(i=>cr.mergeArray(n,i));const o=[...r.data].map((i,a)=>s.type._parseSync(new Ln(r,i,r.path,a)));return cr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new fn({...this._def,minLength:{value:t,message:Ce.toString(r)}})}max(t,r){return new fn({...this._def,maxLength:{value:t,message:Ce.toString(r)}})}length(t,r){return new fn({...this._def,exactLength:{value:t,message:Ce.toString(r)}})}nonempty(t){return this.min(1,t)}}fn.create=(e,t)=>new fn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...ze(t)});function pi(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=An.create(pi(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof fn?new fn({...e._def,type:pi(e.element)}):e instanceof An?An.create(pi(e.unwrap())):e instanceof lo?lo.create(pi(e.unwrap())):e instanceof Fn?Fn.create(e.items.map(t=>pi(t))):e}class Rt extends He{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(),r=rt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ye.object){const c=this._getOrReturnCtx(t);return pe(c,{code:ie.invalid_type,expected:ye.object,received:c.parsedType}),Ie}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ys&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const f=o[c],d=s.data[c];l.push({key:{status:"valid",value:c},value:f._parse(new Ln(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof ys){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(c==="strict")a.length>0&&(pe(s,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of a){const d=s.data[f];l.push({key:{status:"valid",value:f},value:c._parse(new Ln(s,d,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of l){const d=await f.key,h=await f.value;c.push({key:d,value:h,alwaysSet:f.alwaysSet})}return c}).then(c=>cr.mergeObjectSync(n,c)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Ce.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return rt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return rt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return pi(this)}partial(t){const r={};return rt.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return rt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof An;)o=o._def.innerType;r[n]=o}}),new Rt({...this._def,shape:()=>r})}keyof(){return GC(rt.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:ys.create(),typeName:Ae.ZodObject,...ze(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:ys.create(),typeName:Ae.ZodObject,...ze(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:ys.create(),typeName:Ae.ZodObject,...ze(t)});class Ul extends He{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Lr(a.ctx.common.issues));return pe(r,{code:ie.invalid_union,unionErrors:i}),Ie}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const l of n){const c={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new Lr(l));return pe(r,{code:ie.invalid_union,unionErrors:a}),Ie}}get options(){return this._def.options}}Ul.create=(e,t)=>new Ul({options:e,typeName:Ae.ZodUnion,...ze(t)});const qn=e=>e instanceof Wl?qn(e.schema):e instanceof yn?qn(e.innerType()):e instanceof Bl?[e.value]:e instanceof ao?e.options:e instanceof Hl?rt.objectValues(e.enum):e instanceof Yl?qn(e._def.innerType):e instanceof Fl?[void 0]:e instanceof zl?[null]:e instanceof An?[void 0,...qn(e.unwrap())]:e instanceof lo?[null,...qn(e.unwrap())]:e instanceof Ov||e instanceof Gl?qn(e.unwrap()):e instanceof Zl?qn(e._def.innerType):[];class Pf extends He{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.object)return pe(r,{code:ie.invalid_type,expected:ye.object,received:r.parsedType}),Ie;const n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(pe(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ie)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const o of r){const i=qn(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Pf({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...ze(n)})}}function om(e,t){const r=zs(e),n=zs(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const s=rt.objectKeys(t),o=rt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const l=om(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(nm(o)||nm(i))return Ie;const a=om(o.value,i.value);return a.valid?((sm(o)||sm(i))&&r.dirty(),{status:r.value,value:a.data}):(pe(n,{code:ie.invalid_intersection_types}),Ie)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}$l.create=(e,t,r)=>new $l({left:e,right:t,typeName:Ae.ZodIntersection,...ze(r)});class Fn extends He{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return pe(n,{code:ie.invalid_type,expected:ye.array,received:n.parsedType}),Ie;if(n.data.lengththis._def.items.length&&(pe(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Ln(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>cr.mergeArray(r,i)):cr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Fn({...this._def,rest:t})}}Fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:e,typeName:Ae.ZodTuple,rest:null,...ze(t)})};class Vl extends He{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.object)return pe(n,{code:ie.invalid_type,expected:ye.object,received:n.parsedType}),Ie;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in n.data)s.push({key:o._parse(new Ln(n,a,n.path,a)),value:i._parse(new Ln(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?cr.mergeObjectAsync(r,s):cr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof He?new Vl({keyType:t,valueType:r,typeName:Ae.ZodRecord,...ze(n)}):new Vl({keyType:cn.create(),valueType:t,typeName:Ae.ZodRecord,...ze(r)})}}class kd extends He{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return pe(n,{code:ie.invalid_type,expected:ye.map,received:n.parsedType}),Ie;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,l],c)=>({key:s._parse(new Ln(n,a,n.path,[c,"key"])),value:o._parse(new Ln(n,l,n.path,[c,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,f=await l.value;if(c.status==="aborted"||f.status==="aborted")return Ie;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,f=l.value;if(c.status==="aborted"||f.status==="aborted")return Ie;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}}}}kd.create=(e,t,r)=>new kd({valueType:t,keyType:e,typeName:Ae.ZodMap,...ze(r)});class Bo extends He{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return pe(n,{code:ie.invalid_type,expected:ye.set,received:n.parsedType}),Ie;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(pe(n,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(l){const c=new Set;for(const f of l){if(f.status==="aborted")return Ie;f.status==="dirty"&&r.dirty(),c.add(f.value)}return{status:r.value,value:c}}const a=[...n.data.values()].map((l,c)=>o._parse(new Ln(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,r){return new Bo({...this._def,minSize:{value:t,message:Ce.toString(r)}})}max(t,r){return new Bo({...this._def,maxSize:{value:t,message:Ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Bo.create=(e,t)=>new Bo({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...ze(t)});class Hi extends He{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.function)return pe(r,{code:ie.invalid_type,expected:ye.function,received:r.parsedType}),Ie;function n(a,l){return xd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wd(),ta].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function s(a,l){return xd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wd(),ta].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof na){const a=this;return pr(async function(...l){const c=new Lr([]),f=await a._def.args.parseAsync(l,o).catch(p=>{throw c.addIssue(n(l,p)),c}),d=await Reflect.apply(i,this,f);return await a._def.returns._def.type.parseAsync(d,o).catch(p=>{throw c.addIssue(s(d,p)),c})})}else{const a=this;return pr(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Lr([n(l,c.error)]);const f=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(f,o);if(!d.success)throw new Lr([s(f,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Hi({...this._def,args:Fn.create(t).rest(Do.create())})}returns(t){return new Hi({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Hi({args:t||Fn.create([]).rest(Do.create()),returns:r||Do.create(),typeName:Ae.ZodFunction,...ze(n)})}}class Wl extends He{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Wl.create=(e,t)=>new Wl({getter:e,typeName:Ae.ZodLazy,...ze(t)});class Bl extends He{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return pe(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Ie}return{status:"valid",value:t.data}}get value(){return this._def.value}}Bl.create=(e,t)=>new Bl({value:e,typeName:Ae.ZodLiteral,...ze(t)});function GC(e,t){return new ao({values:e,typeName:Ae.ZodEnum,...ze(t)})}class ao extends He{constructor(){super(...arguments),Wa.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{expected:rt.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ie}if(_d(this,Wa)||BC(this,Wa,new Set(this._def.values)),!_d(this,Wa).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Ie}return pr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ao.create(t,{...this._def,...r})}exclude(t,r=this._def){return ao.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Wa=new WeakMap;ao.create=GC;class Hl extends He{constructor(){super(...arguments),Ba.set(this,void 0)}_parse(t){const r=rt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const s=rt.objectValues(r);return pe(n,{expected:rt.joinValues(s),received:n.parsedType,code:ie.invalid_type}),Ie}if(_d(this,Ba)||BC(this,Ba,new Set(rt.getValidEnumValues(this._def.values))),!_d(this,Ba).has(t.data)){const s=rt.objectValues(r);return pe(n,{received:n.data,code:ie.invalid_enum_value,options:s}),Ie}return pr(t.data)}get enum(){return this._def.values}}Ba=new WeakMap;Hl.create=(e,t)=>new Hl({values:e,typeName:Ae.ZodNativeEnum,...ze(t)});class na extends He{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return pe(r,{code:ie.invalid_type,expected:ye.promise,received:r.parsedType}),Ie;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return pr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}na.create=(e,t)=>new na({type:e,typeName:Ae.ZodPromise,...ze(t)});class yn extends He{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{pe(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return Ie;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Ie:l.status==="dirty"||r.value==="dirty"?Pi(l.value):l});{if(r.value==="aborted")return Ie;const a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?Ie:a.status==="dirty"||r.value==="dirty"?Pi(a.value):a}}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);if(n.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(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ie:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ie:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ml(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ml(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);rt.assertNever(s)}}yn.create=(e,t,r)=>new yn({schema:e,typeName:Ae.ZodEffects,effect:t,...ze(r)});yn.createWithPreprocess=(e,t,r)=>new yn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...ze(r)});class An extends He{_parse(t){return this._getType(t)===ye.undefined?pr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}An.create=(e,t)=>new An({innerType:e,typeName:Ae.ZodOptional,...ze(t)});class lo extends He{_parse(t){return this._getType(t)===ye.null?pr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}lo.create=(e,t)=>new lo({innerType:e,typeName:Ae.ZodNullable,...ze(t)});class Yl extends He{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Yl.create=(e,t)=>new Yl({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});class Zl extends He{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Il(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Zl.create=(e,t)=>new Zl({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});class Cd extends He{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.nan,received:n.parsedType}),Ie}return{status:"valid",value:t.data}}}Cd.create=e=>new Cd({typeName:Ae.ZodNaN,...ze(e)});const mz=Symbol("zod_brand");class Ov extends He{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class gc extends He{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ie:o.status==="dirty"?(r.dirty(),Pi(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ie:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new gc({in:t,out:r,typeName:Ae.ZodPipeline})}}class Gl extends He{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Ml(s)&&(s.value=Object.freeze(s.value)),s);return Il(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Gl.create=(e,t)=>new Gl({innerType:e,typeName:Ae.ZodReadonly,...ze(t)});function KC(e,t={},r){return e?ra.create().superRefine((n,s)=>{var o,i;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(i=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:l})}}):ra.create()}const gz={object:Rt.lazycreate};var Ae;(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"})(Ae||(Ae={}));const vz=(e,t={message:`Input not instance of ${e.name}`})=>KC(r=>r instanceof e,t),qC=cn.create,XC=oo.create,yz=Cd.create,wz=io.create,QC=Ll.create,xz=Wo.create,_z=bd.create,bz=Fl.create,Sz=zl.create,kz=ra.create,Cz=Do.create,Ez=ys.create,Tz=Sd.create,Rz=fn.create,Nz=Rt.create,Pz=Rt.strictCreate,jz=Ul.create,Dz=Pf.create,Oz=$l.create,Az=Fn.create,Mz=Vl.create,Iz=kd.create,Lz=Bo.create,Fz=Hi.create,zz=Wl.create,Uz=Bl.create,$z=ao.create,Vz=Hl.create,Wz=na.create,ww=yn.create,Bz=An.create,Hz=lo.create,Yz=yn.createWithPreprocess,Zz=gc.create,Gz=()=>qC().optional(),Kz=()=>XC().optional(),qz=()=>QC().optional(),Xz={string:e=>cn.create({...e,coerce:!0}),number:e=>oo.create({...e,coerce:!0}),boolean:e=>Ll.create({...e,coerce:!0}),bigint:e=>io.create({...e,coerce:!0}),date:e=>Wo.create({...e,coerce:!0})},Qz=Ie;var Fe=Object.freeze({__proto__:null,defaultErrorMap:ta,setErrorMap:Q5,getErrorMap:wd,makeIssue:xd,EMPTY_PATH:J5,addIssueToContext:pe,ParseStatus:cr,INVALID:Ie,DIRTY:Pi,OK:pr,isAborted:nm,isDirty:sm,isValid:Ml,isAsync:Il,get util(){return rt},get objectUtil(){return rm},ZodParsedType:ye,getParsedType:zs,ZodType:He,datetimeRegex:ZC,ZodString:cn,ZodNumber:oo,ZodBigInt:io,ZodBoolean:Ll,ZodDate:Wo,ZodSymbol:bd,ZodUndefined:Fl,ZodNull:zl,ZodAny:ra,ZodUnknown:Do,ZodNever:ys,ZodVoid:Sd,ZodArray:fn,ZodObject:Rt,ZodUnion:Ul,ZodDiscriminatedUnion:Pf,ZodIntersection:$l,ZodTuple:Fn,ZodRecord:Vl,ZodMap:kd,ZodSet:Bo,ZodFunction:Hi,ZodLazy:Wl,ZodLiteral:Bl,ZodEnum:ao,ZodNativeEnum:Hl,ZodPromise:na,ZodEffects:yn,ZodTransformer:yn,ZodOptional:An,ZodNullable:lo,ZodDefault:Yl,ZodCatch:Zl,ZodNaN:Cd,BRAND:mz,ZodBranded:Ov,ZodPipeline:gc,ZodReadonly:Gl,custom:KC,Schema:He,ZodSchema:He,late:gz,get ZodFirstPartyTypeKind(){return Ae},coerce:Xz,any:kz,array:Rz,bigint:wz,boolean:QC,date:xz,discriminatedUnion:Dz,effect:ww,enum:$z,function:Fz,instanceof:vz,intersection:Oz,lazy:zz,literal:Uz,map:Iz,nan:yz,nativeEnum:Vz,never:Ez,null:Sz,nullable:Hz,number:XC,object:Nz,oboolean:qz,onumber:Kz,optional:Bz,ostring:Gz,pipeline:Zz,preprocess:Yz,promise:Wz,record:Mz,set:Lz,strictObject:Pz,string:qC,symbol:_z,transformer:ww,tuple:Az,undefined:bz,union:jz,unknown:Cz,void:Tz,NEVER:Qz,ZodIssueCode:ie,quotelessJson:X5,ZodError:Lr}),Jz="Label",JC=y.forwardRef((e,t)=>u.jsx(De.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));JC.displayName=Jz;var eE=JC;const e6=ec("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ed=y.forwardRef(({className:e,...t},r)=>u.jsx(eE,{ref:r,className:we(e6(),e),...t}));Ed.displayName=eE.displayName;const ei=O5,tE=y.createContext({}),tt=({...e})=>u.jsx(tE.Provider,{value:{name:e.name},children:u.jsx(L5,{...e})}),jf=()=>{const e=y.useContext(tE),t=y.useContext(rE),{getFieldState:r,formState:n}=Nf(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},rE=y.createContext({}),Ke=y.forwardRef(({className:e,...t},r)=>{const n=y.useId();return u.jsx(rE.Provider,{value:{id:n},children:u.jsx("div",{ref:r,className:we("space-y-2",e),...t})})});Ke.displayName="FormItem";const qe=y.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=jf();return u.jsx(Ed,{ref:r,className:we(n&&"text-destructive",e),htmlFor:s,...t})});qe.displayName="FormLabel";const Xe=y.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=jf();return u.jsx(hs,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});Xe.displayName="FormControl";const t6=y.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=jf();return u.jsx("p",{ref:r,id:n,className:we("text-sm text-muted-foreground",e),...t})});t6.displayName="FormDescription";const Ze=y.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=jf(),i=s?String(s==null?void 0:s.message):t;return i?u.jsx("p",{ref:n,id:o,className:we("text-sm font-medium text-destructive",e),...r,children:i}):null});Ze.displayName="FormMessage";function im(e,[t,r]){return Math.min(r,Math.max(t,e))}var r6=[" ","Enter","ArrowUp","ArrowDown"],n6=[" ","Enter"],vc="Select",[Df,Of,s6]=Xd(vc),[wa,RU]=Er(vc,[s6,pa]),Af=pa(),[o6,mo]=wa(vc),[i6,a6]=wa(vc),nE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:f,autoComplete:d,disabled:h,required:p}=e,w=Af(t),[m,x]=y.useState(null),[g,v]=y.useState(null),[_,C]=y.useState(!1),E=tc(c),[T=!1,P]=ps({prop:n,defaultProp:s,onChange:o}),[O,j]=ps({prop:i,defaultProp:a,onChange:l}),L=y.useRef(null),q=m?!!m.closest("form"):!0,[R,F]=y.useState(new Set),b=Array.from(R).map(V=>V.props.value).join(";");return u.jsx(Ng,{...w,children:u.jsxs(o6,{required:p,scope:t,trigger:m,onTriggerChange:x,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:On(),value:O,onValueChange:j,open:T,onOpenChange:P,dir:E,triggerPointerDownPosRef:L,disabled:h,children:[u.jsx(Df.Provider,{scope:t,children:u.jsx(i6,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(V=>{F(te=>new Set(te).add(V))},[]),onNativeOptionRemove:y.useCallback(V=>{F(te=>{const W=new Set(te);return W.delete(V),W})},[]),children:r})}),q?u.jsxs(NE,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:d,value:O,onChange:V=>j(V.target.value),disabled:h,children:[O===void 0?u.jsx("option",{value:""}):null,Array.from(R)]},b):null]})})};nE.displayName=vc;var sE="SelectTrigger",oE=y.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Af(r),i=mo(sE,r),a=i.disabled||n,l=Ue(t,i.onTriggerChange),c=Of(r),[f,d,h]=PE(w=>{const m=c().filter(v=>!v.disabled),x=m.find(v=>v.value===i.value),g=jE(m,w,x);g!==void 0&&i.onValueChange(g.value)}),p=()=>{a||(i.onOpenChange(!0),h())};return u.jsx(Pg,{asChild:!0,...o,children:u.jsx(De.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":RE(i.value)?"":void 0,...s,ref:l,onClick:le(s.onClick,w=>{w.currentTarget.focus()}),onPointerDown:le(s.onPointerDown,w=>{const m=w.target;m.hasPointerCapture(w.pointerId)&&m.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&(p(),i.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)},w.preventDefault())}),onKeyDown:le(s.onKeyDown,w=>{const m=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&d(w.key),!(m&&w.key===" ")&&r6.includes(w.key)&&(p(),w.preventDefault())})})})});oE.displayName=sE;var iE="SelectValue",aE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=mo(iE,r),{onValueNodeHasChildrenChange:c}=l,f=o!==void 0,d=Ue(t,l.onValueNodeChange);return nr(()=>{c(f)},[c,f]),u.jsx(De.span,{...a,ref:d,style:{pointerEvents:"none"},children:RE(l.value)?u.jsx(u.Fragment,{children:i}):o})});aE.displayName=iE;var l6="SelectIcon",lE=y.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return u.jsx(De.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});lE.displayName=l6;var c6="SelectPortal",cE=e=>u.jsx(nc,{asChild:!0,...e});cE.displayName=c6;var Ho="SelectContent",uE=y.forwardRef((e,t)=>{const r=mo(Ho,e.__scopeSelect),[n,s]=y.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?xs.createPortal(u.jsx(dE,{scope:e.__scopeSelect,children:u.jsx(Df.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(fE,{...e,ref:t})});uE.displayName=Ho;var Jn=10,[dE,go]=wa(Ho),u6="SelectContentImpl",fE=y.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:x,...g}=e,v=mo(Ho,r),[_,C]=y.useState(null),[E,T]=y.useState(null),P=Ue(t,fe=>C(fe)),[O,j]=y.useState(null),[L,q]=y.useState(null),R=Of(r),[F,b]=y.useState(!1),V=y.useRef(!1);y.useEffect(()=>{if(_)return Og(_)},[_]),wg();const te=y.useCallback(fe=>{const[ge,...be]=R().map(Se=>Se.ref.current),[Pe]=be.slice(-1),Te=document.activeElement;for(const Se of fe)if(Se===Te||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ge&&E&&(E.scrollTop=0),Se===Pe&&E&&(E.scrollTop=E.scrollHeight),Se==null||Se.focus(),document.activeElement!==Te))return},[R,E]),W=y.useCallback(()=>te([O,_]),[te,O,_]);y.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=v;y.useEffect(()=>{if(_){let fe={x:0,y:0};const ge=Pe=>{var Te,Se;fe={x:Math.abs(Math.round(Pe.pageX)-(((Te=I.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((Se=I.current)==null?void 0:Se.y)??0))}},be=Pe=>{fe.x<=10&&fe.y<=10?Pe.preventDefault():_.contains(Pe.target)||Z(!1),document.removeEventListener("pointermove",ge),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",be,{capture:!0})}}},[_,Z,I]),y.useEffect(()=>{const fe=()=>Z(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[Z]);const[Q,z]=PE(fe=>{const ge=R().filter(Te=>!Te.disabled),be=ge.find(Te=>Te.ref.current===document.activeElement),Pe=jE(ge,fe,be);Pe&&setTimeout(()=>Pe.ref.current.focus())}),$=y.useCallback((fe,ge,be)=>{const Pe=!V.current&&!be;(v.value!==void 0&&v.value===ge||Pe)&&(j(fe),Pe&&(V.current=!0))},[v.value]),de=y.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=y.useCallback((fe,ge,be)=>{const Pe=!V.current&&!be;(v.value!==void 0&&v.value===ge||Pe)&&q(fe)},[v.value]),se=n==="popper"?am:hE,Ee=se===am?{side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:x}:{};return u.jsx(dE,{scope:r,content:_,viewport:E,onViewportChange:T,itemRefCallback:$,selectedItem:O,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:W,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:u.jsx(sf,{as:hs,allowPinchZoom:!0,children:u.jsx(Qd,{asChild:!0,trapped:v.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:le(s,fe=>{var ge;(ge=v.trigger)==null||ge.focus({preventScroll:!0}),fe.preventDefault()}),children:u.jsx(da,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:u.jsx(se,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:fe=>fe.preventDefault(),...g,...Ee,onPlaced:()=>b(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:le(g.onKeyDown,fe=>{const ge=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ge&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Pe=R().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Te=fe.target,Se=Pe.indexOf(Te);Pe=Pe.slice(Se+1)}setTimeout(()=>te(Pe)),fe.preventDefault()}})})})})})})});fE.displayName=u6;var d6="SelectItemAlignedPosition",hE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=mo(Ho,r),i=go(Ho,r),[a,l]=y.useState(null),[c,f]=y.useState(null),d=Ue(t,P=>f(P)),h=Of(r),p=y.useRef(!1),w=y.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:g,focusSelectedItem:v}=i,_=y.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&m&&x&&g){const P=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),L=g.getBoundingClientRect();if(o.dir!=="rtl"){const Te=L.left-O.left,Se=j.left-Te,et=P.left-Se,k=P.width+et,J=Math.max(k,O.width),G=window.innerWidth-Jn,D=im(Se,[Jn,G-J]);a.style.minWidth=k+"px",a.style.left=D+"px"}else{const Te=O.right-L.right,Se=window.innerWidth-j.right-Te,et=window.innerWidth-P.right-Se,k=P.width+et,J=Math.max(k,O.width),G=window.innerWidth-Jn,D=im(Se,[Jn,G-J]);a.style.minWidth=k+"px",a.style.right=D+"px"}const q=h(),R=window.innerHeight-Jn*2,F=m.scrollHeight,b=window.getComputedStyle(c),V=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),W=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=V+te+F+Z+W,Q=Math.min(x.offsetHeight*5,I),z=window.getComputedStyle(m),$=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=P.top+P.height/2-Jn,se=R-ne,Ee=x.offsetHeight/2,fe=x.offsetTop+Ee,ge=V+te+fe,be=I-ge;if(ge<=ne){const Te=x===q[q.length-1].ref.current;a.style.bottom="0px";const Se=c.clientHeight-m.offsetTop-m.offsetHeight,et=Math.max(se,Ee+(Te?de:0)+Se+W),k=ge+et;a.style.height=k+"px"}else{const Te=x===q[0].ref.current;a.style.top="0px";const et=Math.max(ne,V+m.offsetTop+(Te?$:0)+Ee)+be;a.style.height=et+"px",m.scrollTop=ge-ne+m.offsetTop}a.style.margin=`${Jn}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,a,c,m,x,g,o.dir,n]);nr(()=>_(),[_]);const[C,E]=y.useState();nr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const T=y.useCallback(P=>{P&&w.current===!0&&(_(),v==null||v(),w.current=!1)},[_,v]);return u.jsx(h6,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:u.jsx(De.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});hE.displayName=d6;var f6="SelectPopperPosition",am=y.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Jn,...o}=e,i=Af(r);return u.jsx(jg,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});am.displayName=f6;var[h6,Av]=wa(Ho,{}),lm="SelectViewport",pE=y.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=go(lm,r),i=Av(lm,r),a=Ue(t,o.onViewportChange),l=y.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),u.jsx(Df.Slot,{scope:r,children:u.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:le(s.onScroll,c=>{const f=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const p=Math.abs(l.current-f.scrollTop);if(p>0){const w=window.innerHeight-Jn*2,m=parseFloat(d.style.minHeight),x=parseFloat(d.style.height),g=Math.max(m,x);if(g0?C:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});pE.displayName=lm;var mE="SelectGroup",[p6,m6]=wa(mE),gE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=On();return u.jsx(p6,{scope:r,id:s,children:u.jsx(De.div,{role:"group","aria-labelledby":s,...n,ref:t})})});gE.displayName=mE;var vE="SelectLabel",yE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=m6(vE,r);return u.jsx(De.div,{id:s.id,...n,ref:t})});yE.displayName=vE;var Td="SelectItem",[g6,wE]=wa(Td),xE=y.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=mo(Td,r),l=go(Td,r),c=a.value===n,[f,d]=y.useState(o??""),[h,p]=y.useState(!1),w=Ue(t,g=>{var v;return(v=l.itemRefCallback)==null?void 0:v.call(l,g,n,s)}),m=On(),x=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(g6,{scope:r,value:n,disabled:s,textId:m,isSelected:c,onItemTextChange:y.useCallback(g=>{d(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:u.jsx(Df.ItemSlot,{scope:r,value:n,disabled:s,textValue:f,children:u.jsx(De.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:w,onFocus:le(i.onFocus,()=>p(!0)),onBlur:le(i.onBlur,()=>p(!1)),onPointerUp:le(i.onPointerUp,x),onPointerMove:le(i.onPointerMove,g=>{var v;s?(v=l.onItemLeave)==null||v.call(l):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:le(i.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=l.onItemLeave)==null||v.call(l))}),onKeyDown:le(i.onKeyDown,g=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&g.key===" "||(n6.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})})})})});xE.displayName=Td;var Ha="SelectItemText",_E=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=mo(Ha,r),a=go(Ha,r),l=wE(Ha,r),c=a6(Ha,r),[f,d]=y.useState(null),h=Ue(t,g=>d(g),l.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,l.value,l.disabled)}),p=f==null?void 0:f.textContent,w=y.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=c;return nr(()=>(m(w),()=>x(w)),[m,x,w]),u.jsxs(u.Fragment,{children:[u.jsx(De.span,{id:l.textId,...o,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?xs.createPortal(o.children,i.valueNode):null]})});_E.displayName=Ha;var bE="SelectItemIndicator",SE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return wE(bE,r).isSelected?u.jsx(De.span,{"aria-hidden":!0,...n,ref:t}):null});SE.displayName=bE;var cm="SelectScrollUpButton",kE=y.forwardRef((e,t)=>{const r=go(cm,e.__scopeSelect),n=Av(cm,e.__scopeSelect),[s,o]=y.useState(!1),i=Ue(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(EE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});kE.displayName=cm;var um="SelectScrollDownButton",CE=y.forwardRef((e,t)=>{const r=go(um,e.__scopeSelect),n=Av(um,e.__scopeSelect),[s,o]=y.useState(!1),i=Ue(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(EE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});CE.displayName=um;var EE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=go("SelectScrollButton",r),i=y.useRef(null),a=Of(r),l=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),nr(()=>{var f;const c=a().find(d=>d.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),u.jsx(De.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:le(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:le(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:le(s.onPointerLeave,()=>{l()})})}),v6="SelectSeparator",TE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return u.jsx(De.div,{"aria-hidden":!0,...n,ref:t})});TE.displayName=v6;var dm="SelectArrow",y6=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Af(r),o=mo(dm,r),i=go(dm,r);return o.open&&i.position==="popper"?u.jsx(Dg,{...s,...n,ref:t}):null});y6.displayName=dm;function RE(e){return e===""||e===void 0}var NE=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=y.useRef(null),o=Ue(t,s),i=xv(r);return y.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==r&&f){const d=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(d)}},[i,r]),u.jsx(pc,{asChild:!0,children:u.jsx("select",{...n,ref:o,defaultValue:r})})});NE.displayName="BubbleSelect";function PE(e){const t=jt(e),r=y.useRef(""),n=y.useRef(0),s=y.useCallback(i=>{const a=r.current+i;t(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=y.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function jE(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=w6(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function w6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var x6=nE,DE=oE,_6=aE,b6=lE,S6=cE,OE=uE,k6=pE,C6=gE,AE=yE,ME=xE,E6=_E,T6=SE,IE=kE,LE=CE,FE=TE;const Mh=x6,Ih=C6,Lh=_6,Cu=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(DE,{ref:n,className:we("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,u.jsx(b6,{asChild:!0,children:u.jsx(t1,{className:"h-4 w-4 opacity-50"})})]}));Cu.displayName=DE.displayName;const zE=y.forwardRef(({className:e,...t},r)=>u.jsx(IE,{ref:r,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(WP,{className:"h-4 w-4"})}));zE.displayName=IE.displayName;const UE=y.forwardRef(({className:e,...t},r)=>u.jsx(LE,{ref:r,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(t1,{className:"h-4 w-4"})}));UE.displayName=LE.displayName;const Eu=y.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>u.jsx(S6,{children:u.jsxs(OE,{ref:s,className:we("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[u.jsx(zE,{}),u.jsx(k6,{className:we("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(UE,{})]})}));Eu.displayName=OE.displayName;const Tu=y.forwardRef(({className:e,...t},r)=>u.jsx(AE,{ref:r,className:we("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Tu.displayName=AE.displayName;const Ru=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(ME,{ref:n,className:we("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(T6,{children:u.jsx(e1,{className:"h-4 w-4"})})}),u.jsx(E6,{children:t})]}));Ru.displayName=ME.displayName;const R6=y.forwardRef(({className:e,...t},r)=>u.jsx(FE,{ref:r,className:we("-mx-1 my-1 h-px bg-muted",e),...t}));R6.displayName=FE.displayName;const fm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),N6=Array.from(fm.keys()),P6=Zg,j6=Gg,D6=Kg,$E=y.forwardRef(({className:e,...t},r)=>u.jsx(ic,{ref:r,className:we("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));$E.displayName=ic.displayName;const VE=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(D6,{children:[u.jsx($E,{}),u.jsxs(ac,{ref:n,className:we("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,u.jsxs(lf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(pg,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));VE.displayName=ac.displayName;const WE=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});WE.displayName="DialogHeader";const BE=y.forwardRef(({className:e,...t},r)=>u.jsx(lc,{ref:r,className:we("text-lg font-semibold leading-none tracking-tight",e),...t}));BE.displayName=lc.displayName;const O6=y.forwardRef(({className:e,...t},r)=>u.jsx(cc,{ref:r,className:we("text-sm text-muted-foreground",e),...t}));O6.displayName=cc.displayName;const Oo=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),Mf=Fe.union([Fe.literal("aliyun"),Fe.literal("tencent"),Fe.literal("ssh"),Fe.literal("webhook")],{message:"请选择云服务商"}),A6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,secretId:Fe.string().min(1).max(64),secretKey:Fe.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:o.secretId,secretKey:o.secretKey}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{secretId:l.secretId,secretKey:l.secretKey}};try{const f=await xf(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,p])=>{i.setError(h,{type:"manual",message:p.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"secretId",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"SecretId"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入SecretId",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"secretKey",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"SecretKey"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入SecretKey",...l})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})},M6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,accessKeyId:Fe.string().min(1).max(64),accessSecretId:Fe.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:o.accessKeyId,accessSecretId:o.accessKeySecret}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const f=await xf(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,p])=>{i.setError(h,{type:"manual",message:p.message})});return}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"accessKeyId",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"AccessKeyId"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入AccessKeyId",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"accessSecretId",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"AccessKeySecret"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入AccessKeySecret",...l})}),u.jsx(Ze,{})]})}),u.jsx(Ze,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})};var Mv="Radio",[I6,HE]=Er(Mv),[L6,F6]=I6(Mv),YE=y.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:i,value:a="on",onCheck:l,...c}=e,[f,d]=y.useState(null),h=Ue(t,m=>d(m)),p=y.useRef(!1),w=f?!!f.closest("form"):!0;return u.jsxs(L6,{scope:r,checked:s,disabled:i,children:[u.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":KE(s),"data-disabled":i?"":void 0,disabled:i,value:a,...c,ref:h,onClick:le(e.onClick,m=>{s||l==null||l(),w&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})}),w&&u.jsx(z6,{control:f,bubbles:!p.current,name:n,value:a,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});YE.displayName=Mv;var ZE="RadioIndicator",GE=y.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=F6(ZE,r);return u.jsx(vr,{present:n||o.checked,children:u.jsx(De.span,{"data-state":KE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});GE.displayName=ZE;var z6=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=y.useRef(null),i=xv(r),a=Eg(t);return y.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==r&&d){const h=new Event("click",{bubbles:n});d.call(l,r),l.dispatchEvent(h)}},[i,r,n]),u.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function KE(e){return e?"checked":"unchecked"}var U6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Iv="RadioGroup",[$6,NU]=Er(Iv,[rf,HE]),qE=rf(),XE=HE(),[V6,W6]=$6(Iv),QE=y.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:i=!1,disabled:a=!1,orientation:l,dir:c,loop:f=!0,onValueChange:d,...h}=e,p=qE(r),w=tc(c),[m,x]=ps({prop:o,defaultProp:s,onChange:d});return u.jsx(V6,{scope:r,name:n,required:i,disabled:a,value:m,onValueChange:x,children:u.jsx(U1,{asChild:!0,...p,orientation:l,dir:w,loop:f,children:u.jsx(De.div,{role:"radiogroup","aria-required":i,"aria-orientation":l,"data-disabled":a?"":void 0,dir:w,...h,ref:t})})})});QE.displayName=Iv;var JE="RadioGroupItem",eT=y.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=W6(JE,r),i=o.disabled||n,a=qE(r),l=XE(r),c=y.useRef(null),f=Ue(t,c),d=o.value===s.value,h=y.useRef(!1);return y.useEffect(()=>{const p=m=>{U6.includes(m.key)&&(h.current=!0)},w=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",w)}},[]),u.jsx($1,{asChild:!0,...a,focusable:!i,active:d,children:u.jsx(YE,{disabled:i,required:o.required,checked:d,...l,...s,name:o.name,ref:f,onCheck:()=>o.onValueChange(s.value),onKeyDown:le(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:le(s.onFocus,()=>{var p;h.current&&((p=c.current)==null||p.click())})})})});eT.displayName=JE;var B6="RadioGroupIndicator",tT=y.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=XE(r);return u.jsx(GE,{...s,...n,ref:t})});tT.displayName=B6;var rT=QE,nT=eT,H6=tT;const sT=y.forwardRef(({className:e,...t},r)=>u.jsx(rT,{className:we("grid gap-2",e),...t,ref:r}));sT.displayName=rT.displayName;const oT=y.forwardRef(({className:e,...t},r)=>u.jsx(nT,{ref:r,className:we("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:u.jsx(H6,{className:"flex items-center justify-center",children:u.jsx(s1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));oT.displayName=nT.displayName;const iT=y.forwardRef(({className:e,...t},r)=>u.jsx("textarea",{className:we("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));iT.displayName="Textarea";const Y6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,host:Fe.string().ip({message:"请输入合法的IP地址"}),port:Fe.string().min(1).max(5),username:Fe.string().min(1).max(64),password:Fe.string().min(0).max(64),key:Fe.string().min(0).max(20480),keyFile:Fe.string().optional(),command:Fe.string().min(1).max(2048),certPath:Fe.string().min(0).max(2048),keyPath:Fe.string().min(0).max(2048)});let o={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:o.host,port:o.port,username:o.username,password:o.password,key:o.key,keyFile:o.keyFile,certPath:o.certPath,keyPath:o.keyPath,command:o.command}}),a=async c=>{console.log(c);const f={id:c.id,name:c.name,configType:c.configType,config:{host:c.host,port:c.port,username:c.username,password:c.password,key:c.key,command:c.command,certPath:c.certPath,keyPath:c.keyPath}};try{const d=await xf(f);if(t(),f.id=d.id,f.created=d.created,f.updated=d.updated,c.id){n(f);return}r(f)}catch(d){Object.entries(d.response.data).forEach(([p,w])=>{i.setError(p,{type:"manual",message:w.message})});return}},l=async c=>{var h;const f=(h=c.target.files)==null?void 0:h[0];if(!f)return;const d=await b5(f);i.setValue("key",d),i.setValue("keyFile","")};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-3",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:c})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:c})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...c})}),u.jsx(Ze,{})]})}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsx(tt,{control:i.control,name:"host",render:({field:c})=>u.jsxs(Ke,{className:"grow",children:[u.jsx(qe,{children:"服务器IP"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Host",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"port",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"SSH端口"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Port",...c,type:"number"})}),u.jsx(Ze,{})]})})]}),u.jsx(tt,{control:i.control,name:"username",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"用户名"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入用户名",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"password",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入密码",...c,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"key",render:({field:c})=>u.jsxs(Ke,{hidden:!0,children:[u.jsx(qe,{children:"Key(使用证书登录)"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Key",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"keyFile",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"Key(使用证书登录)"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Key",...c,type:"file",onChange:l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"certPath",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"证书上传路径"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入证书上传路径",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"keyPath",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"私钥上传路径"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入私钥上传路径",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"command",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"Command"}),u.jsx(Xe,{children:u.jsx(iT,{placeholder:"请输入要执行的命令",...c})}),u.jsx(Ze,{})]})}),u.jsx(Ze,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})},Z6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,url:Fe.string().url()});let o={url:""};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:o.url}}),a=async l=>{console.log(l);const c={id:l.id,name:l.name,configType:l.configType,config:{url:l.url}};try{const f=await xf(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,p])=>{i.setError(h,{type:"manual",message:p.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"url",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"Webhook Url"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Webhook Url",...l})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})};function ol({trigger:e,op:t,data:r,className:n}){const[s,o]=y.useState(!1),i=Array.from(Oo.keys()),[a,l]=y.useState((r==null?void 0:r.configType)||"");let c=u.jsx(u.Fragment,{children:" "});switch(a){case"tencent":c=u.jsx(A6,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":c=u.jsx(M6,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":c=u.jsx(Y6,{data:r,onAfterReq:()=>{o(!1)}});break;case"webhook":c=u.jsx(Z6,{data:r,onAfterReq:()=>{o(!1)}})}const f=d=>d==a?"border-primary":"";return u.jsxs(P6,{onOpenChange:o,open:s,children:[u.jsx(j6,{asChild:!0,className:we(n),children:e}),u.jsxs(VE,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[u.jsx(WE,{children:u.jsxs(BE,{children:[t=="add"?"添加":"编辑","授权"]})}),u.jsxs("div",{className:"container",children:[u.jsx(Ed,{children:"服务商"}),u.jsx(sT,{value:a,className:"flex mt-3 space-x-2",onValueChange:d=>{console.log(d),l(d)},children:i.map(d=>{var h,p;return u.jsx("div",{className:"flex items-center space-x-2",children:u.jsxs(Ed,{children:[u.jsx(oT,{value:d,hidden:!0}),u.jsxs("div",{className:we("flex items-center space-x-2 border p-2 rounded cursor-pointer",f(d)),children:[u.jsx("img",{src:(h=Oo.get(d))==null?void 0:h[1],className:"h-6"}),u.jsx("div",{children:(p=Oo.get(d))==null?void 0:p[0]})]})]})},d)})}),c]})]})]})}const G6=()=>{const{config:{accesses:e}}=ya(),[t,r]=y.useState(),n=po();y.useEffect(()=>{const p=new URLSearchParams(n.search).get("id");p&&(async()=>{const m=await E5(p);r(m)})()},[n.search]);const s=Fe.object({id:Fe.string().optional(),domain:Fe.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),access:Fe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:Fe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:Fe.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=Qo({resolver:Jo(s),defaultValues:{id:"",domain:"",access:"",targetAccess:"",targetType:""}});y.useEffect(()=>{t&&o.reset({id:t.id,domain:t.domain,access:t.access,targetAccess:t.targetAccess,targetType:t.targetType})},[t,o]);const[i,a]=y.useState(t?t.targetType:""),l=e.filter(h=>{if(i=="")return!0;const p=o.getValues().targetType.split("-");return h.configType===p[0]}),{toast:c}=Sf(),f=Ss(),d=async h=>{const p={id:h.id,crontab:"0 0 * * *",domain:h.domain,access:h.access,targetAccess:h.targetAccess,targetType:h.targetType};try{await tm(p);let w="域名编辑成功";p.id==""&&(w="域名添加成功"),c({title:"成功",description:w}),f("/")}catch(w){Object.entries(w.response.data).forEach(([x,g])=>{o.setError(x,{type:"manual",message:g.message})});return}};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(Cv,{}),u.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[t!=null&&t.id?"编辑":"新增","域名"]}),u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(d),className:"space-y-8 dark:text-stone-200",children:[u.jsx(tt,{control:o.control,name:"domain",render:({field:h})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"域名"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入域名",...h})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:o.control,name:"access",render:({field:h})=>u.jsxs(Ke,{children:[u.jsxs(qe,{className:"flex w-full justify-between",children:[u.jsx("div",{children:"DNS 服务商授权配置"}),u.jsx(ol,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(b0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Xe,{children:u.jsxs(Mh,{...h,value:h.value,onValueChange:p=>{o.setValue("access",p)},children:[u.jsx(Cu,{children:u.jsx(Lh,{placeholder:"请选择授权配置"})}),u.jsx(Eu,{children:u.jsxs(Ih,{children:[u.jsx(Tu,{children:"服务商授权配置"}),e.map(p=>{var w;return u.jsx(Ru,{value:p.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=Oo.get(p.configType))==null?void 0:w[1]}),u.jsx("div",{children:p.name})]})},p.id)})]})})]})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:o.control,name:"targetType",render:({field:h})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"部署服务类型"}),u.jsx(Xe,{children:u.jsxs(Mh,{...h,onValueChange:p=>{a(p),o.setValue("targetType",p)},children:[u.jsx(Cu,{children:u.jsx(Lh,{placeholder:"请选择部署服务类型"})}),u.jsx(Eu,{children:u.jsxs(Ih,{children:[u.jsx(Tu,{children:"部署服务类型"}),N6.map(p=>{var w,m;return u.jsx(Ru,{value:p,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=fm.get(p))==null?void 0:w[1]}),u.jsx("div",{children:(m=fm.get(p))==null?void 0:m[0]})]})},p)})]})})]})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:o.control,name:"targetAccess",render:({field:h})=>u.jsxs(Ke,{children:[u.jsxs(qe,{className:"w-full flex justify-between",children:[u.jsx("div",{children:"部署服务商授权配置"}),u.jsx(ol,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(b0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Xe,{children:u.jsxs(Mh,{...h,onValueChange:p=>{o.setValue("targetAccess",p)},children:[u.jsx(Cu,{children:u.jsx(Lh,{placeholder:"请选择授权配置"})}),u.jsx(Eu,{children:u.jsxs(Ih,{children:[u.jsx(Tu,{children:"服务商授权配置"}),l.map(p=>{var w;return u.jsx(Ru,{value:p.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=Oo.get(p.configType))==null?void 0:w[1]}),u.jsx("div",{children:p.name})]})},p.id)})]})})]})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})]})})},K6=()=>{const{config:e,deleteAccess:t}=ya(),{accesses:r}=e,n=async s=>{const o=await q4(s);t(o.id)};return u.jsxs("div",{className:"",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),u.jsx(ol,{trigger:u.jsx(Et,{children:"添加授权"}),op:"add"})]}),r.length===0?u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(HP,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),u.jsx(ol,{trigger:u.jsx(Et,{children:"添加授权"}),op:"add",className:"mt-3"})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"名称"}),u.jsx("div",{className:"w-48",children:"服务商"}),u.jsx("div",{className:"w-52",children:"创建时间"}),u.jsx("div",{className:"w-52",children:"更新时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.map(s=>{var o,i;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:s.name}),u.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[u.jsx("img",{src:(o=Oo.get(s.configType))==null?void 0:o[1],className:"w-6"}),u.jsx("div",{children:(i=Oo.get(s.configType))==null?void 0:i[0]})]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",s.created&&Al(s.created)]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",s.updated&&Al(s.updated)]}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(ol,{trigger:u.jsx(Et,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:s}),u.jsx(Kt,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>{n(s)},children:"删除"})]})]},s.id)})]})]})},q6=ec("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),aT=y.forwardRef(({className:e,variant:t,...r},n)=>u.jsx("div",{ref:n,role:"alert",className:we(q6({variant:t}),e),...r}));aT.displayName="Alert";const lT=y.forwardRef(({className:e,...t},r)=>u.jsx("h5",{ref:r,className:we("mb-1 font-medium leading-none tracking-tight",e),...t}));lT.displayName="AlertTitle";const cT=y.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:we("text-sm [&_p]:leading-relaxed",e),...t}));cT.displayName="AlertDescription";function X6(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var Lv="ScrollArea",[uT,PU]=Er(Lv),[Q6,en]=uT(Lv),dT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,l]=y.useState(null),[c,f]=y.useState(null),[d,h]=y.useState(null),[p,w]=y.useState(null),[m,x]=y.useState(null),[g,v]=y.useState(0),[_,C]=y.useState(0),[E,T]=y.useState(!1),[P,O]=y.useState(!1),j=Ue(t,q=>l(q)),L=tc(s);return u.jsx(Q6,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:d,onContentChange:h,scrollbarX:p,onScrollbarXChange:w,scrollbarXEnabled:E,onScrollbarXEnabledChange:T,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:P,onScrollbarYEnabledChange:O,onCornerWidthChange:v,onCornerHeightChange:C,children:u.jsx(De.div,{dir:L,...i,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});dT.displayName=Lv;var fT="ScrollAreaViewport",hT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=en(fT,r),a=y.useRef(null),l=Ue(t,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),u.jsx(De.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});hT.displayName=fT;var $n="ScrollAreaScrollbar",Fv=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return y.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?u.jsx(J6,{...n,ref:t,forceMount:r}):s.type==="scroll"?u.jsx(eU,{...n,ref:t,forceMount:r}):s.type==="auto"?u.jsx(pT,{...n,ref:t,forceMount:r}):s.type==="always"?u.jsx(zv,{...n,ref:t}):null});Fv.displayName=$n;var J6=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),[o,i]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},f=()=>{l=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),u.jsx(vr,{present:r||o,children:u.jsx(pT,{"data-state":o?"visible":"hidden",...n,ref:t})})}),eU=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),o=e.orientation==="horizontal",i=Lf(()=>l("SCROLL_END"),100),[a,l]=X6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,s.scrollHideDelay,l]),y.useEffect(()=>{const c=s.viewport,f=o?"scrollLeft":"scrollTop";if(c){let d=c[f];const h=()=>{const p=c[f];d!==p&&(l("SCROLL"),i()),d=p};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[s.viewport,o,l,i]),u.jsx(vr,{present:r||a!=="hidden",children:u.jsx(zv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:le(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:le(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),pT=y.forwardRef((e,t)=>{const r=en($n,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=y.useState(!1),a=e.orientation==="horizontal",l=Lf(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=en($n,e.__scopeScrollArea),o=y.useRef(null),i=y.useRef(0),[a,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=wT(a.viewport,a.content),f={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function d(h,p){return iU(h,i.current,a,p)}return r==="horizontal"?u.jsx(tU,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollLeft,p=xw(h,a,s.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=d(h,s.dir))}}):r==="vertical"?u.jsx(rU,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollTop,p=xw(h,a);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=d(h))}}):null}),tU=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Ue(t,l,o.onScrollbarXChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(gT,{"data-orientation":"horizontal",...s,ref:c,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":If(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(o.viewport){const h=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(h),_T(h,d)&&f.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Nd(i.paddingLeft),paddingEnd:Nd(i.paddingRight)}})}})}),rU=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Ue(t,l,o.onScrollbarYChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(gT,{"data-orientation":"vertical",...s,ref:c,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":If(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(o.viewport){const h=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(h),_T(h,d)&&f.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Nd(i.paddingTop),paddingEnd:Nd(i.paddingBottom)}})}})}),[nU,mT]=uT($n),gT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:f,onResize:d,...h}=e,p=en($n,r),[w,m]=y.useState(null),x=Ue(t,j=>m(j)),g=y.useRef(null),v=y.useRef(""),_=p.viewport,C=n.content-n.viewport,E=jt(f),T=jt(l),P=Lf(d,10);function O(j){if(g.current){const L=j.clientX-g.current.left,q=j.clientY-g.current.top;c({x:L,y:q})}}return y.useEffect(()=>{const j=L=>{const q=L.target;(w==null?void 0:w.contains(q))&&E(L,C)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[_,w,C,E]),y.useEffect(T,[n,T]),sa(w,P),sa(p.content,P),u.jsx(nU,{scope:r,scrollbar:w,hasThumb:s,onThumbChange:jt(o),onThumbPointerUp:jt(i),onThumbPositionChange:T,onThumbPointerDown:jt(a),children:u.jsx(De.div,{...h,ref:x,style:{position:"absolute",...h.style},onPointerDown:le(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),g.current=w.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),O(j))}),onPointerMove:le(e.onPointerMove,O),onPointerUp:le(e.onPointerUp,j=>{const L=j.target;L.hasPointerCapture(j.pointerId)&&L.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),g.current=null})})})}),Rd="ScrollAreaThumb",vT=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=mT(Rd,e.__scopeScrollArea);return u.jsx(vr,{present:r||s.hasThumb,children:u.jsx(sU,{ref:t,...n})})}),sU=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=en(Rd,r),i=mT(Rd,r),{onThumbPositionChange:a}=i,l=Ue(t,d=>i.onThumbChange(d)),c=y.useRef(),f=Lf(()=>{c.current&&(c.current(),c.current=void 0)},100);return y.useEffect(()=>{const d=o.viewport;if(d){const h=()=>{if(f(),!c.current){const p=aU(d,a);c.current=p,a()}};return a(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[o.viewport,f,a]),u.jsx(De.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:le(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),w=d.clientX-p.left,m=d.clientY-p.top;i.onThumbPointerDown({x:w,y:m})}),onPointerUp:le(e.onPointerUp,i.onThumbPointerUp)})});vT.displayName=Rd;var Uv="ScrollAreaCorner",yT=y.forwardRef((e,t)=>{const r=en(Uv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?u.jsx(oU,{...e,ref:t}):null});yT.displayName=Uv;var oU=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=en(Uv,r),[o,i]=y.useState(0),[a,l]=y.useState(0),c=!!(o&&a);return sa(s.scrollbarX,()=>{var d;const f=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(f),l(f)}),sa(s.scrollbarY,()=>{var d;const f=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(f),i(f)}),c?u.jsx(De.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Nd(e){return e?parseInt(e,10):0}function wT(e,t){const r=e/t;return isNaN(r)?0:r}function If(e){const t=wT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function iU(e,t,r,n="ltr"){const s=If(r),o=s/2,i=t||o,a=s-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,f=r.content-r.viewport,d=n==="ltr"?[0,f]:[f*-1,0];return xT([l,c],d)(e)}function xw(e,t,r="ltr"){const n=If(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-n,l=r==="ltr"?[0,i]:[i*-1,0],c=im(e,l);return xT([0,i],[0,a])(c)}function xT(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function _T(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,a=r.top!==o.top;(i||a)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Lf(e,t){const r=jt(e),n=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),y.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function sa(e,t){const r=jt(t);nr(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var bT=dT,lU=hT,cU=yT;const ST=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(bT,{ref:n,className:we("relative overflow-hidden",e),...r,children:[u.jsx(lU,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(kT,{}),u.jsx(cU,{})]}));ST.displayName=bT.displayName;const kT=y.forwardRef(({className:e,orientation:t="vertical",...r},n)=>u.jsx(Fv,{ref:n,orientation:t,className:we("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:u.jsx(vT,{className:"relative flex-1 rounded-full bg-border"})}));kT.displayName=Fv.displayName;const uU=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await Dt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},dU=()=>{const e=Ss(),[t,r]=y.useState(),[n]=FP(),s=n.get("domain");return y.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const a=await uU(i);r(a.items)})()},[s]),u.jsxs(ST,{className:"h-[80vh] overflow-hidden",children:[u.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"域名"}),u.jsx("div",{className:"w-24",children:"状态"}),u.jsx("div",{className:"w-56",children:"阶段"}),u.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,a;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),u.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:o.phase==="deploy"&&o.phaseSuccess?u.jsx(r1,{size:16,className:"text-green-700"}):u.jsx(n1,{size:16,className:"text-red-700"})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx(pk,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Al(o.deployedAt)}),u.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:u.jsxs(uS,{children:[u.jsx(dS,{asChild:!0,children:u.jsx(Et,{variant:"link",className:"p-0",children:"日志"})}),u.jsxs(qg,{className:"sm:max-w-5xl",children:[u.jsx(hS,{children:u.jsxs(pS,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),u.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&u.jsx(u.Fragment,{children:o.log.check.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.apply&&u.jsx(u.Fragment,{children:o.log.apply.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(c=>u.jsx("div",{className:"mt-1 text-green-600",children:c})),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.deploy&&u.jsx(u.Fragment,{children:o.log.deploy.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},o.id)})]}):u.jsx(u.Fragment,{children:u.jsxs(aT,{className:"max-w-[40em] mx-auto mt-20",children:[u.jsx(lT,{children:"暂无数据"}),u.jsxs(cT,{children:[u.jsxs("div",{className:"flex items-center mt-5",children:[u.jsx("div",{children:u.jsx(GP,{className:"text-yellow-400",size:36})}),u.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),u.jsx("div",{className:"mt-2 flex justify-end",children:u.jsx(Et,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},hm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",fU=Fe.object({username:Fe.string().email({message:"请输入正确的邮箱地址"}),password:Fe.string().min(10,{message:"密码至少10个字符"})}),hU=()=>{const e=Qo({resolver:Jo(fU),defaultValues:{username:"",password:""}}),t=async n=>{try{await Dt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=hm(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Ss();return u.jsxs("div",{className:"max-w-[35em] border mx-auto mt-32 p-10 rounded-md shadow-md",children:[u.jsx("div",{className:"flex justify-center mb-10",children:u.jsx("img",{src:"/vite.svg",className:"w-16"})}),u.jsx(ei,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8",children:[u.jsx(tt,{control:e.control,name:"username",render:({field:n})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"用户名"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"email",...n})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:e.control,name:"password",render:({field:n})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"shadcn",...n,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"登录"})})]})})]})},pU=()=>Dt().authStore.isValid&&Dt().authStore.isAdmin?u.jsx(Q_,{to:"/"}):u.jsx("div",{className:"container",children:u.jsx(hg,{})}),mU=Fe.object({oldPassword:Fe.string().min(10,{message:"密码至少10个字符"}),newPassword:Fe.string().min(10,{message:"密码至少10个字符"}),confirmPassword:Fe.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),gU=()=>{const{toast:e}=Sf(),t=Ss(),r=Qo({resolver:Jo(mU),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await Dt().admins.authWithPassword((o=Dt().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(a){const l=hm(a);r.setError("oldPassword",{message:l})}try{await Dt().admins.update((i=Dt().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),Dt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=hm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return u.jsx(u.Fragment,{children:u.jsx(ei,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[u.jsx(tt,{control:r.control,name:"oldPassword",render:({field:s})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"当前密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"当前密码",...s,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:r.control,name:"newPassword",render:({field:s})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"新密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"newPassword",...s,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:r.control,name:"confirmPassword",render:({field:s})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"确认密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"confirmPassword",...s,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"确认修改"})})]})})})},vU=()=>u.jsxs("div",{children:[u.jsx(Cv,{}),u.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"设置密码"}),u.jsx("div",{className:"w-full sm:w-[35em] mt-10 flex flex-col p-3 mx-auto",children:u.jsx(hg,{})})]}),yU=SP([{path:"/",element:u.jsx(n3,{}),children:[{path:"/",element:u.jsx(P5,{})},{path:"/edit",element:u.jsx(G6,{})},{path:"/access",element:u.jsx(K6,{})},{path:"/history",element:u.jsx(dU,{})},{path:"/setting",element:u.jsx(vU,{}),children:[{path:"/setting/password",element:u.jsx(gU,{})}]}]},{path:"/login",element:u.jsx(pU,{}),children:[{path:"/login",element:u.jsx(hU,{})}]},{path:"/about",element:u.jsx("div",{children:"About"})}]);Fh.createRoot(document.getElementById("root")).render(u.jsx(Qe.StrictMode,{children:u.jsx(e3,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:u.jsx(DP,{router:yU})})}))});export default wU(); +\0`,ne+=o(z,2),ne+=T.magic,ne+=o(_,2),ne+=o(C,2),ne+=o(Q.crc32,4),ne+=o(Q.compressedSize,4),ne+=o(Q.uncompressedSize,4),ne+=o(O.length,2),ne+=o(V.length,2),{fileRecord:d.LOCAL_FILE_HEADER+ne+O+V,dirRecord:d.CENTRAL_FILE_HEADER+o(de,2)+ne+o(q.length,2)+"\0\0\0\0"+o($,4)+o(x,4)+O+V+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),f=r("../crc32"),d=r("../signature");function h(p,w,m,x){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=m,this.encodeFileName=x,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,l),h.prototype.push=function(p){var w=p.meta.percent||0,m=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,l.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:m?(w+100*(m-x-1))/m:100}}))},h.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var w=this.streamFiles&&!p.file.dir;if(w){var m=i(p,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(p){this.accumulate=!1;var w=this.streamFiles&&!p.file.dir,m=i(p,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),w)this.push({data:function(x){return d.DATA_DESCRIPTOR+o(x.crc32,4)+o(x.compressedSize,4)+o(x.uncompressedSize,4)}(p),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var p=this.bytesWritten,w=0;w=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=i},{"../utils":32}],19:[function(r,n,s){var o=r("./Uint8ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var o=r("./DataReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var o=r("./ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var o=r("../utils"),i=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),f=r("./Uint8ArrayReader");n.exports=function(d){var h=o.getTypeOf(d);return o.checkSupport(h),h!=="string"||i.uint8array?h==="nodebuffer"?new c(d):i.uint8array?new f(o.transformTo("uint8array",d)):new a(o.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var o=r("./GenericWorker"),i=r("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}i.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:i.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var o=r("./GenericWorker"),i=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=i(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,i),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}i.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(f){c.dataIsReady=!0,c.data=f,c.max=f&&f.length||0,c.type=o.getTypeOf(f),c.isPaused||c._tickAndRepeat()},function(f){c.error(f)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var l=0;l "+i:i}},n.exports=o},{}],29:[function(r,n,s){var o=r("../utils"),i=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),f=r("../external"),d=null;if(c.nodestream)try{d=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(w,m){return new f.Promise(function(x,g){var v=[],_=w._internalType,C=w._outputType,E=w._mimeType;w.on("data",function(T,P){v.push(T),m&&m(P)}).on("error",function(T){v=[],g(T)}).on("end",function(){try{var T=function(P,O,j){switch(P){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),j);case"base64":return l.encode(O);default:return o.transformTo(P,O)}}(C,function(P,O){var j,L=0,q=null,R=0;for(j=0;j"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var o=r("./utils"),i=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}s.utf8encode=function(p){return i.nodebuffer?a.newBufferFrom(p,"utf-8"):function(w){var m,x,g,v,_,C=w.length,E=0;for(v=0;v>>6:(x<65536?m[_++]=224|x>>>12:(m[_++]=240|x>>>18,m[_++]=128|x>>>12&63),m[_++]=128|x>>>6&63),m[_++]=128|63&x);return m}(p)},s.utf8decode=function(p){return i.nodebuffer?o.transformTo("nodebuffer",p).toString("utf-8"):function(w){var m,x,g,v,_=w.length,C=new Array(2*_);for(m=x=0;m<_;)if((g=w[m++])<128)C[x++]=g;else if(4<(v=c[g]))C[x++]=65533,m+=v-1;else{for(g&=v===2?31:v===3?15:7;1>10&1023,C[x++]=56320|1023&g)}return C.length!==x&&(C.subarray?C=C.subarray(0,x):C.length=x),o.applyFromCharCode(C)}(p=o.transformTo(i.uint8array?"uint8array":"array",p))},o.inherits(d,l),d.prototype.processChunk=function(p){var w=o.transformTo(i.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=w;(w=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),w.set(m,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var x=function(v,_){var C;for((_=_||v.length)>v.length&&(_=v.length),C=_-1;0<=C&&(192&v[C])==128;)C--;return C<0||C===0?_:C+c[v[C]]>_?C:_}(w),g=w;x!==w.length&&(i.uint8array?(g=w.subarray(0,x),this.leftOver=w.subarray(x,w.length)):(g=w.slice(0,x),this.leftOver=w.slice(x,w.length))),this.push({data:s.utf8decode(g),meta:p.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=d,o.inherits(h,l),h.prototype.processChunk=function(p){this.push({data:s.utf8encode(p.data),meta:p.meta})},s.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var o=r("./support"),i=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(m){return m}function f(m,x){for(var g=0;g>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var w,m,x,g=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4>>6:(p<65536?h[x++]=224|p>>>12:(h[x++]=240|p>>>18,h[x++]=128|p>>>12&63),h[x++]=128|p>>>6&63),h[x++]=128|63&p);return h},s.buf2binstring=function(d){return f(d,d.length)},s.binstring2buf=function(d){for(var h=new o.Buf8(d.length),p=0,w=h.length;p>10&1023,v[w++]=56320|1023&m)}return f(v,w)},s.utf8border=function(d,h){var p;for((h=h||d.length)>d.length&&(h=d.length),p=h-1;0<=p&&(192&d[p])==128;)p--;return p<0||p===0?h:p+l[d[p]]>h?p:h}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,a,l){for(var c=65535&o|0,f=o>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3>>1:i>>>1;a[l]=i}return a}();n.exports=function(i,a,l,c){var f=o,d=c+l;i^=-1;for(var h=c;h>>8^f[255&(i^a[h])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),f=r("./messages"),d=0,h=4,p=0,w=-2,m=-1,x=4,g=2,v=8,_=9,C=286,E=30,T=19,P=2*C+1,O=15,j=3,L=258,q=L+j+1,R=42,F=113,b=1,V=2,te=3,W=4;function Z(k,J){return k.msg=f[J],J}function I(k){return(k<<1)-(4k.avail_out&&(G=k.avail_out),G!==0&&(i.arraySet(k.output,J.pending_buf,J.pending_out,G,k.next_out),k.next_out+=G,J.pending_out+=G,k.total_out+=G,k.avail_out-=G,J.pending-=G,J.pending===0&&(J.pending_out=0))}function $(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function de(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var G,D,S=k.max_chain_length,N=k.strstart,A=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,he=k.strstart+L,Le=H[N+A-1],Oe=H[N+A];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(G=J)+A]===Oe&&H[G+A-1]===Le&&H[G]===H[N]&&H[++G]===H[N+1]){N+=2,G++;do;while(H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&NM&&--S!=0);return A<=k.lookahead?A:k.lookahead}function Ee(k){var J,G,D,S,N,A,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(i.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=G=k.hash_size;D=k.head[--J],k.head[J]=ee<=D?D-ee:0,--G;);for(J=G=ee;D=k.prev[--J],k.prev[J]=ee<=D?D-ee:0,--G;);S+=ee}if(k.strm.avail_in===0)break;if(A=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=A.avail_in,H=j)for(N=k.strstart-k.insert,k.ins_h=k.window[N],k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j)if(D=a._tr_tally(k,k.strstart-k.match_start,k.match_length-j),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=j){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-j,D=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-j),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(G=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Ee(k),k.lookahead===0&&J===d)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var D=k.block_start+G;if((k.strstart===0||k.strstart>=D)&&(k.lookahead=k.strstart-D,k.strstart=D,$(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&($(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===h?($(k,!0),k.strm.avail_out===0?te:W):(k.strstart>k.block_start&&($(k,!1),k.strm.avail_out),b)}),new be(4,4,8,4,fe),new be(4,5,16,8,fe),new be(4,6,32,32,fe),new be(4,4,16,16,ge),new be(8,16,32,32,ge),new be(8,16,128,128,ge),new be(8,32,128,256,ge),new be(32,128,258,1024,ge),new be(32,258,258,4096,ge)],s.deflateInit=function(k,J){return et(k,J,v,15,8,0)},s.deflateInit2=et,s.deflateReset=Se,s.deflateResetKeep=Te,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?w:(k.state.gzhead=J,p):w},s.deflate=function(k,J){var G,D,S,N;if(!k||!k.state||5>8&255),de(D,D.gzhead.time>>16&255),de(D,D.gzhead.time>>24&255),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(de(D,255&D.gzhead.extra.length),de(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(k.adler=c(k.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(de(D,0),de(D,0),de(D,0),de(D,0),de(D,0),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,3),D.status=F);else{var A=v+(D.w_bits-8<<4)<<8;A|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(A|=32),A+=31-A%31,D.status=F,ne(D,A),D.strstart!==0&&(ne(D,k.adler>>>16),ne(D,65535&k.adler)),k.adler=1}if(D.status===69)if(D.gzhead.extra){for(S=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending!==D.pending_buf_size));)de(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){N=1;break}N=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),N===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){N=1;break}N=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),N===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&z(k),D.pending+2<=D.pending_buf_size&&(de(D,255&k.adler),de(D,k.adler>>8&255),k.adler=0,D.status=F)):D.status=F),D.pending!==0){if(z(k),k.avail_out===0)return D.last_flush=-1,p}else if(k.avail_in===0&&I(J)<=I(G)&&J!==h)return Z(k,-5);if(D.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||D.lookahead!==0||J!==d&&D.status!==666){var Y=D.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Ee(M),M.lookahead===0)){if(H===d)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===h?($(M,!0),M.strm.avail_out===0?te:W):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):D.strategy===3?function(M,H){for(var X,ee,he,Le,Oe=M.window;;){if(M.lookahead<=L){if(Ee(M),M.lookahead<=L&&H===d)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=j&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=j?(X=a._tr_tally(M,1,M.match_length-j),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===h?($(M,!0),M.strm.avail_out===0?te:W):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):o[D.level].func(D,J);if(Y!==te&&Y!==W||(D.status=666),Y===b||Y===te)return k.avail_out===0&&(D.last_flush=-1),p;if(Y===V&&(J===1?a._tr_align(D):J!==5&&(a._tr_stored_block(D,0,0,!1),J===3&&(Q(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),z(k),k.avail_out===0))return D.last_flush=-1,p}return J!==h?p:D.wrap<=0?1:(D.wrap===2?(de(D,255&k.adler),de(D,k.adler>>8&255),de(D,k.adler>>16&255),de(D,k.adler>>24&255),de(D,255&k.total_in),de(D,k.total_in>>8&255),de(D,k.total_in>>16&255),de(D,k.total_in>>24&255)):(ne(D,k.adler>>>16),ne(D,65535&k.adler)),z(k),0=G.w_size&&(N===0&&(Q(G.head),G.strstart=0,G.block_start=0,G.insert=0),H=new i.Buf8(G.w_size),i.arraySet(H,J,X-G.w_size,G.w_size,0),J=H,X=G.w_size),A=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Ee(G);G.lookahead>=j;){for(D=G.strstart,S=G.lookahead-(j-1);G.ins_h=(G.ins_h<>>=j=O>>>24,_-=j,(j=O>>>16&255)===0)V[f++]=65535&O;else{if(!(16&j)){if(!(64&j)){O=C[(65535&O)+(v&(1<>>=j,_-=j),_<15&&(v+=b[l++]<<_,_+=8,v+=b[l++]<<_,_+=8),O=E[v&P];r:for(;;){if(v>>>=j=O>>>24,_-=j,!(16&(j=O>>>16&255))){if(!(64&j)){O=E[(65535&O)+(v&(1<>>=j,_-=j,(j=f-d)>3,v&=(1<<(_-=L<<3))-1,o.next_in=l,o.next_out=f,o.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(R){var F;return R&&R.state?(F=R.state,R.total_in=R.total_out=F.total=0,R.msg="",F.wrap&&(R.adler=1&F.wrap),F.mode=w,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(m),F.distcode=F.distdyn=new o.Buf32(x),F.sane=1,F.back=-1,h):p}function C(R){var F;return R&&R.state?((F=R.state).wsize=0,F.whave=0,F.wnext=0,_(R)):p}function E(R,F){var b,V;return R&&R.state?(V=R.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=W.wsize?(o.arraySet(W.window,F,b-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(V<(te=W.wsize-W.wnext)&&(te=V),o.arraySet(W.window,F,b-V,te,W.wnext),(V-=te)?(o.arraySet(W.window,F,b-V,V,0),W.wnext=V,W.whave=W.wsize):(W.wnext+=te,W.wnext===W.wsize&&(W.wnext=0),W.whave>>8&255,b.check=a(b.check,N,2,0),$=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){R.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){R.msg="unknown compression method",b.mode=30;break}if($-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){R.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=z=0,b.mode=3;case 3:for(;$<32;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}b.head&&(b.head.time=z),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,N[2]=z>>>16&255,N[3]=z>>>24&255,b.check=a(b.check,N,4,0)),$=z=0,b.mode=4;case 4:for(;$<16;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}b.head&&(b.head.xflags=255&z,b.head.os=z>>8),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=z=0,b.mode=5;case 5:if(1024&b.flags){for(;$<16;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}b.length=z,b.head&&(b.head.extra_len=z),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),o.arraySet(b.head.extra,V,W,se,k)),512&b.flags&&(b.check=a(b.check,V,se,W)),I-=se,W+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=V[W+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),R.adler=b.check=0,b.mode=12;break;case 10:for(;$<32;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}R.adler=b.check=g(z),$=z=0,b.mode=11;case 11:if(b.havedict===0)return R.next_out=Z,R.avail_out=Q,R.next_in=W,R.avail_in=I,b.hold=z,b.bits=$,2;R.adler=b.check=1,b.mode=12;case 12:if(F===5||F===6)break e;case 13:if(b.last){z>>>=7&$,$-=7&$,b.mode=27;break}for(;$<3;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}switch(b.last=1&z,$-=1,3&(z>>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,$-=2;break e;case 2:b.mode=17;break;case 3:R.msg="invalid block type",b.mode=30}z>>>=2,$-=2;break;case 14:for(z>>>=7&$,$-=7&$;$<32;){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if((65535&z)!=(z>>>16^65535)){R.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,$=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,$-=5,b.ndist=1+(31&z),z>>>=5,$-=5,b.ncode=4+(15&z),z>>>=4,$-=4,286>>=3,$-=3}for(;b.have<19;)b.lens[A[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,G={bits:b.lenbits},J=c(0,b.lens,0,19,b.lencode,0,b.work,G),b.lenbits=G.bits,J){R.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Pe=65535&S,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if(Pe<16)z>>>=ge,$-=ge,b.lens[b.have++]=Pe;else{if(Pe===16){for(D=ge+2;$>>=ge,$-=ge,b.have===0){R.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,$-=2}else if(Pe===17){for(D=ge+3;$>>=ge)),z>>>=3,$-=3}else{for(D=ge+7;$>>=ge)),z>>>=7,$-=7}if(b.have+se>b.nlen+b.ndist){R.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){R.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,G={bits:b.lenbits},J=c(f,b.lens,0,b.nlen,b.lencode,0,b.work,G),b.lenbits=G.bits,J){R.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,G={bits:b.distbits},J=c(d,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,G),b.distbits=G.bits,J){R.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){R.next_out=Z,R.avail_out=Q,R.next_in=W,R.avail_in=I,b.hold=z,b.bits=$,l(R,ne),Z=R.next_out,te=R.output,Q=R.avail_out,W=R.next_in,V=R.input,I=R.avail_in,z=b.hold,$=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;be=(S=b.lencode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if(be&&!(240&be)){for(Te=ge,Se=be,et=Pe;be=(S=b.lencode[et+((z&(1<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}z>>>=Te,$-=Te,b.back+=Te}if(z>>>=ge,$-=ge,b.back+=ge,b.length=Pe,be===0){b.mode=26;break}if(32&be){b.back=-1,b.mode=12;break}if(64&be){R.msg="invalid literal/length code",b.mode=30;break}b.extra=15&be,b.mode=22;case 22:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;be=(S=b.distcode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}if(!(240&be)){for(Te=ge,Se=be,et=Pe;be=(S=b.distcode[et+((z&(1<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[W++]<<$,$+=8}z>>>=Te,$-=Te,b.back+=Te}if(z>>>=ge,$-=ge,b.back+=ge,64&be){R.msg="invalid distance code",b.mode=30;break}b.offset=Pe,b.extra=15&be,b.mode=24;case 24:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){R.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){R.msg="invalid distance too far back",b.mode=30;break}Ee=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Ee=Z-b.offset,se=b.length;for(QP?(j=Ee[fe+x[F]],$[de+x[F]]):(j=96,0),v=1<>Z)+(_-=v)]=O<<24|j<<16|L|0,_!==0;);for(v=1<>=1;if(v!==0?(z&=v-1,z+=v):z=0,F++,--ne[R]==0){if(R===V)break;R=d[h+x[F]]}if(te>>7)]}function de(S,N){S.pending_buf[S.pending++]=255&N,S.pending_buf[S.pending++]=N>>>8&255}function ne(S,N,A){S.bi_valid>g-A?(S.bi_buf|=N<>g-S.bi_valid,S.bi_valid+=A-g):(S.bi_buf|=N<>>=1,A<<=1,0<--N;);return A>>>1}function fe(S,N,A){var Y,M,H=new Array(x+1),X=0;for(Y=1;Y<=x;Y++)H[Y]=X=X+A[Y-1]<<1;for(M=0;M<=N;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Ee(H[ee]++,ee))}}function ge(S){var N;for(N=0;N>1;1<=A;A--)Te(S,H,A);for(M=he;A=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Te(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=A,S.heap[--S.heap_max]=Y,H[2*M]=H[2*A]+H[2*Y],S.depth[M]=(S.depth[A]>=S.depth[Y]?S.depth[A]:S.depth[Y])+1,H[2*A+1]=H[2*Y+1]=M,S.heap[1]=M++,Te(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Oe,St){var Vr,Wt,Vn,st,Wn,Bn,Wr=St.dyn_tree,yc=St.max_code,wc=St.stat_desc.static_tree,ti=St.stat_desc.has_stree,xc=St.stat_desc.extra_bits,ri=St.stat_desc.extra_base,_n=St.stat_desc.max_length,Rs=0;for(st=0;st<=x;st++)Oe.bl_count[st]=0;for(Wr[2*Oe.heap[Oe.heap_max]+1]=0,Vr=Oe.heap_max+1;Vr>=7;M>>=1)if(1&Le&&ee.dyn_ltree[2*he]!==0)return i;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(he=32;he>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=A+5,A+4<=M&&N!==-1?D(S,N,A,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Se(S,q,R)):(ne(S,4+(Y?1:0),3),function(ee,he,Le,Oe){var St;for(ne(ee,he-257,5),ne(ee,Le-1,5),ne(ee,Oe-4,4),St=0;St>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&N,S.pending_buf[S.l_buf+S.last_lit]=255&A,S.last_lit++,N===0?S.dyn_ltree[2*A]++:(S.matches++,N--,S.dyn_ltree[2*(b[A]+d+1)]++,S.dyn_dtree[2*$(N)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,_,q),function(N){N.bi_valid===16?(de(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):8<=N.bi_valid&&(N.pending_buf[N.pending++]=255&N.bi_buf,N.bi_buf>>=8,N.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(o){(function(i,a){if(!i.setImmediate){var l,c,f,d,h=1,p={},w=!1,m=i.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(i);x=x&&x.setTimeout?x:i,l={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){v(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,E=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=E,C}}()?(d="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(C){i.postMessage(d+C,"*")}):i.MessageChannel?((f=new MessageChannel).port1.onmessage=function(C){v(C.data)},function(C){f.port2.postMessage(C)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(C){var E=m.createElement("script");E.onreadystatechange=function(){v(C),E.onreadystatechange=null,c.removeChild(E),E=null},c.appendChild(E)}):function(C){setTimeout(v,0,C)},x.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var E=new Array(arguments.length-1),T=0;T"u"?o===void 0?this:o:self)}).call(this,typeof Cc<"u"?Cc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(CC);var x5=CC.exports;const _5=pm(x5);function b5(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const S5=async(e,t)=>{const r=new _5;t.forEach(o=>{r.file(o.name,o.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},Al=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},k5=e=>Al(e).split(" ")[0],C5=async()=>Dt().collection("domains").getFullList({sort:"-created",expand:"lastDeployment"}),E5=async e=>await Dt().collection("domains").getOne(e),tm=async e=>e.id?await Dt().collection("domains").update(e.id,e):await Dt().collection("domains").create(e),T5=async e=>await Dt().collection("domains").delete(e),R5=(e,t)=>Dt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),N5=e=>{Dt().collection("domains").unsubscribe(e)},P5=()=>{const e=Sf(),t=Ss(),r=()=>{t("/edit")},n=d=>{t(`/edit?id=${d}`)},s=d=>{t(`/history?domain=${d}`)},o=async d=>{try{await T5(d),a(i.filter(h=>h.id!==d))}catch(h){console.error("Error deleting domain:",h)}},[i,a]=y.useState([]);y.useEffect(()=>{(async()=>{const h=await C5();a(h)})()},[]);const l=async d=>{const h=i.filter(x=>x.id===d),p=h[0].enabled,w=h[0];w.enabled=!p,await tm(w);const m=i.map(x=>x.id===d?{...x,checked:!p}:x);a(m)},c=async d=>{try{N5(d.id),R5(d.id,h=>{console.log(h);const p=i.map(w=>w.id===h.id?{...h}:w);a(p)}),d.rightnow=!0,await tm(d),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:u.jsxs(u.Fragment,{children:["执行失败,请查看",u.jsx(Kn,{to:`/history?domain=${d.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},f=async d=>{const h=`${d.id}-${d.domain}.zip`,p=[{name:`${d.domain}.pem`,content:d.certificate?d.certificate:""},{name:`${d.domain}.key`,content:d.privateKey?d.privateKey:""}];await S5(h,p)};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(Cv,{}),u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),u.jsx(Et,{onClick:r,children:"新增域名"})]}),i.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-40",children:"域名"}),u.jsx("div",{className:"w-48",children:"有效期限"}),u.jsx("div",{className:"w-32",children:"最近执行状态"}),u.jsx("div",{className:"w-64",children:"最近执行阶段"}),u.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),u.jsx("div",{className:"w-32",children:"是否启用"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),i.map(d=>{var h,p,w,m,x,g;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:d.domain}),u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx("div",{children:d.expiredAt?u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"有效期90天"}),u.jsxs("div",{children:[k5(d.expiredAt),"到期"]})]}):"---"})}),u.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:d.lastDeployedAt&&((h=d.expand)!=null&&h.lastDeployment)?u.jsx(u.Fragment,{children:((p=d.expand.lastDeployment)==null?void 0:p.phase)==="deploy"&&((w=d.expand.lastDeployment)!=null&&w.phaseSuccess)?u.jsx(r1,{size:16,className:"text-green-700"}):u.jsx(n1,{size:16,className:"text-red-700"})}):"---"}),u.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:d.lastDeployedAt&&((m=d.expand)!=null&&m.lastDeployment)?u.jsx(pk,{phase:(x=d.expand.lastDeployment)==null?void 0:x.phase,phaseSuccess:(g=d.expand.lastDeployment)==null?void 0:g.phaseSuccess}):"---"}),u.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:d.lastDeployedAt?Al(d.lastDeployedAt):"---"}),u.jsx("div",{className:"sm:w-32 flex items-center",children:u.jsx(wC,{children:u.jsxs(v5,{children:[u.jsx(y5,{children:u.jsx(Zk,{checked:d.enabled,onCheckedChange:()=>{l(d.id)}})}),u.jsx(Tv,{children:u.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:d.enabled?"禁用":"启用"})})]})})}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>s(d.id),children:"部署历史"}),u.jsxs(iw,{when:!!d.enabled,children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>c(d),children:"立即部署"})]}),u.jsxs(iw,{when:!!d.expiredAt,children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>f(d),children:"下载"})]}),!d.enabled&&u.jsxs(u.Fragment,{children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsxs(y3,{children:[u.jsx(w3,{asChild:!0,children:u.jsx(Et,{variant:"link",className:"p-0",children:"删除"})}),u.jsxs(Mk,{children:[u.jsxs(Ik,{children:[u.jsx(Fk,{children:"删除域名"}),u.jsx(zk,{children:"确定要删除域名吗?"})]}),u.jsxs(Lk,{children:[u.jsx($k,{children:"取消"}),u.jsx(Uk,{onClick:()=>{o(d.id)},children:"确认"})]})]})]}),u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>n(d.id),children:"编辑"})]})]})]},d.id)})]}):u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(Ap,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),u.jsx(Et,{onClick:r,className:"mt-3",children:"添加域名"})]})})]})})},it=y.forwardRef(({className:e,type:t,...r},n)=>u.jsx("input",{type:t,className:we("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));it.displayName="Input";var mc=e=>e.type==="checkbox",Ni=e=>e instanceof Date,fr=e=>e==null;const EC=e=>typeof e=="object";var Kt=e=>!fr(e)&&!Array.isArray(e)&&EC(e)&&!Ni(e),TC=e=>Kt(e)&&e.target?mc(e.target)?e.target.checked:e.target.value:e,j5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,RC=(e,t)=>e.has(j5(t)),D5=e=>{const t=e.constructor&&e.constructor.prototype;return Kt(t)&&t.hasOwnProperty("isPrototypeOf")},Rv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function xr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Rv&&(e instanceof Blob||e instanceof FileList))&&(r||Kt(e)))if(t=r?[]:{},!r&&!D5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=xr(e[n]));else return e;return t}var Rf=e=>Array.isArray(e)?e.filter(Boolean):[],Lt=e=>e===void 0,ce=(e,t,r)=>{if(!t||!Kt(e))return r;const n=Rf(t.split(/[,[\].]+?/)).reduce((s,o)=>fr(s)?s:s[o],e);return Lt(n)||n===e?Lt(e[t])?r:e[t]:n},Rn=e=>typeof e=="boolean",Nv=e=>/^\w*$/.test(e),NC=e=>Rf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ut=(e,t,r)=>{let n=-1;const s=Nv(t)?[t]:NC(t),o=s.length,i=o-1;for(;++nQe.useContext(PC),O5=e=>{const{children:t,...r}=e;return Qe.createElement(PC.Provider,{value:r},t)};var jC=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==an.all&&(t._proxyFormState[i]=!n||an.all),r&&(r[i]=!0),e[i]}});return s},Nr=e=>Kt(e)&&!Object.keys(e).length,DC=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||an.all))},nl=e=>Array.isArray(e)?e:[e],OC=(e,t,r)=>!e||!t||e===t||nl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Pv(e){const t=Qe.useRef(e);t.current=e,Qe.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function A5(e){const t=Nf(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,a]=Qe.useState(r._formState),l=Qe.useRef(!0),c=Qe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=Qe.useRef(s);return f.current=s,Pv({disabled:n,next:d=>l.current&&OC(f.current,d.name,o)&&DC(d,c.current,r._updateFormState)&&a({...r._formState,...d}),subject:r._subjects.state}),Qe.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),jC(i,r,c.current,!1)}var Pn=e=>typeof e=="string",AC=(e,t,r,n,s)=>Pn(e)?(n&&t.watch.add(e),ce(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),ce(r,o))):(n&&(t.watchAll=!0),r);function M5(e){const t=Nf(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},a=Qe.useRef(n);a.current=n,Pv({disabled:o,subject:r._subjects.values,next:f=>{OC(a.current,f.name,i)&&c(xr(AC(a.current,r._names,f.values||r._formValues,!1,s)))}});const[l,c]=Qe.useState(r._getWatch(n,s));return Qe.useEffect(()=>r._removeUnmounted()),l}function I5(e){const t=Nf(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=RC(s._names.array,r),a=M5({control:s,name:r,defaultValue:ce(s._formValues,r,ce(s._defaultValues,r,e.defaultValue)),exact:!0}),l=A5({control:s,name:r}),c=Qe.useRef(s.register(r,{...e.rules,value:a,...Rn(e.disabled)?{disabled:e.disabled}:{}}));return Qe.useEffect(()=>{const f=s._options.shouldUnregister||o,d=(h,p)=>{const w=ce(s._fields,h);w&&w._f&&(w._f.mount=p)};if(d(r,!0),f){const h=xr(ce(s._options.defaultValues,r));ut(s._defaultValues,r,h),Lt(ce(s._formValues,r))&&ut(s._formValues,r,h)}return()=>{(i?f&&!s._state.action:f)?s.unregister(r):d(r,!1)}},[r,s,i,o]),Qe.useEffect(()=>{ce(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:ce(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...Rn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:Qe.useCallback(f=>c.current.onChange({target:{value:TC(f),name:r},type:pd.CHANGE}),[r]),onBlur:Qe.useCallback(()=>c.current.onBlur({target:{value:ce(s._formValues,r),name:r},type:pd.BLUR}),[r,s]),ref:f=>{const d=ce(s._fields,r);d&&f&&(d._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:h=>f.setCustomValidity(h),reportValidity:()=>f.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ce(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!ce(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ce(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ce(l.validatingFields,r)},error:{enumerable:!0,get:()=>ce(l.errors,r)}})}}const L5=e=>e.render(I5(e));var MC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},cw=e=>({isOnSubmit:!e||e===an.onSubmit,isOnBlur:e===an.onBlur,isOnChange:e===an.onChange,isOnAll:e===an.all,isOnTouch:e===an.onTouched}),uw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const sl=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=ce(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)break;if(i.ref&&t(i.ref,i.name)&&!n)break;sl(a,t)}else Kt(a)&&sl(a,t)}}};var F5=(e,t,r)=>{const n=nl(ce(e,r));return ut(n,"root",t[r]),ut(e,r,n),e},jv=e=>e.type==="file",Bs=e=>typeof e=="function",md=e=>{if(!Rv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ku=e=>Pn(e),Dv=e=>e.type==="radio",gd=e=>e instanceof RegExp;const dw={value:!1,isValid:!1},fw={value:!0,isValid:!0};var IC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Lt(e[0].attributes.value)?Lt(e[0].value)||e[0].value===""?fw:{value:e[0].value,isValid:!0}:fw:dw}return dw};const hw={isValid:!1,value:null};var LC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,hw):hw;function pw(e,t,r="validate"){if(ku(e)||Array.isArray(e)&&e.every(ku)||Rn(e)&&!e)return{type:r,message:ku(e)?e:"",ref:t}}var fi=e=>Kt(e)&&!gd(e)?e:{value:e,message:""},mw=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:l,minLength:c,min:f,max:d,pattern:h,validate:p,name:w,valueAsNumber:m,mount:x,disabled:g}=e._f,v=ce(t,w);if(!x||g)return{};const _=i?i[0]:o,C=R=>{n&&_.reportValidity&&(_.setCustomValidity(Rn(R)?"":R||""),_.reportValidity())},E={},T=Dv(o),P=mc(o),O=T||P,j=(m||jv(o))&&Lt(o.value)&&Lt(v)||md(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,L=MC.bind(null,w,r,E),q=(R,F,b,V=Gn.maxLength,te=Gn.minLength)=>{const W=R?F:b;E[w]={type:R?V:te,message:W,ref:o,...L(R?V:te,W)}};if(s?!Array.isArray(v)||!v.length:a&&(!O&&(j||fr(v))||Rn(v)&&!v||P&&!IC(i).isValid||T&&!LC(i).isValid)){const{value:R,message:F}=ku(a)?{value:!!a,message:a}:fi(a);if(R&&(E[w]={type:Gn.required,message:F,ref:_,...L(Gn.required,F)},!r))return C(F),E}if(!j&&(!fr(f)||!fr(d))){let R,F;const b=fi(d),V=fi(f);if(!fr(v)&&!isNaN(v)){const te=o.valueAsNumber||v&&+v;fr(b.value)||(R=te>b.value),fr(V.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=o.type=="time",I=o.type=="week";Pn(b.value)&&v&&(R=Z?W(v)>W(b.value):I?v>b.value:te>new Date(b.value)),Pn(V.value)&&v&&(F=Z?W(v)+R.value,V=!fr(F.value)&&v.length<+F.value;if((b||V)&&(q(b,R.message,F.message),!r))return C(E[w].message),E}if(h&&!j&&Pn(v)){const{value:R,message:F}=fi(h);if(gd(R)&&!v.match(R)&&(E[w]={type:Gn.pattern,message:F,ref:o,...L(Gn.pattern,F)},!r))return C(F),E}if(p){if(Bs(p)){const R=await p(v,t),F=pw(R,_);if(F&&(E[w]={...F,...L(Gn.validate,F.message)},!r))return C(F.message),E}else if(Kt(p)){let R={};for(const F in p){if(!Nr(R)&&!r)break;const b=pw(await p[F](v,t),_,F);b&&(R={...b,...L(F,b.message)},C(b.message),r&&(E[w]=R))}if(!Nr(R)&&(E[w]={ref:_,...R},!r))return E}}return C(!0),E};function z5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},vd=e=>fr(e)||!EC(e);function Ro(e,t){if(vd(e)||vd(t))return e===t;if(Ni(e)&&Ni(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const o=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Ni(o)&&Ni(i)||Kt(o)&&Kt(i)||Array.isArray(o)&&Array.isArray(i)?!Ro(o,i):o!==i)return!1}}return!0}var FC=e=>e.type==="select-multiple",$5=e=>Dv(e)||mc(e),Dh=e=>md(e)&&e.isConnected,zC=e=>{for(const t in e)if(Bs(e[t]))return!0;return!1};function yd(e,t={}){const r=Array.isArray(e);if(Kt(e)||r)for(const n in e)Array.isArray(e[n])||Kt(e[n])&&!zC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},yd(e[n],t[n])):fr(e[n])||(t[n]=!0);return t}function UC(e,t,r){const n=Array.isArray(e);if(Kt(e)||n)for(const s in e)Array.isArray(e[s])||Kt(e[s])&&!zC(e[s])?Lt(t)||vd(r[s])?r[s]=Array.isArray(e[s])?yd(e[s],[]):{...yd(e[s])}:UC(e[s],fr(t)?{}:t[s],r[s]):r[s]=!Ro(e[s],t[s]);return r}var ru=(e,t)=>UC(e,t,yd(t)),$C=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Lt(e)?e:t?e===""?NaN:e&&+e:r&&Pn(e)?new Date(e):n?n(e):e;function Oh(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return jv(t)?t.files:Dv(t)?LC(e.refs).value:FC(t)?[...t.selectedOptions].map(({value:r})=>r):mc(t)?IC(e.refs).value:$C(Lt(t.value)?e.ref.value:t.value,e)}var V5=(e,t,r,n)=>{const s={};for(const o of e){const i=ce(t,o);i&&ut(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ia=e=>Lt(e)?e:gd(e)?e.source:Kt(e)?gd(e.value)?e.value.source:e.value:e,W5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function gw(e,t,r){const n=ce(e,r);if(n||Nv(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=ce(t,o),a=ce(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:r}}var B5=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,H5=(e,t)=>!Rf(ce(e,t)).length&&Bt(e,t);const Y5={mode:an.onSubmit,reValidateMode:an.onChange,shouldFocusError:!0};function Z5(e={}){let t={...Y5,...e},r={submitCount:0,isDirty:!1,isLoading:Bs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Kt(t.defaultValues)||Kt(t.values)?xr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:xr(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:jh(),array:jh(),state:jh()},h=cw(t.mode),p=cw(t.reValidateMode),w=t.criteriaMode===an.all,m=S=>N=>{clearTimeout(c),c=setTimeout(S,N)},x=async S=>{if(f.isValid||S){const N=t.resolver?Nr((await O()).errors):await L(n,!0);N!==r.isValid&&d.state.next({isValid:N})}},g=(S,N)=>{(f.isValidating||f.validatingFields)&&((S||Array.from(a.mount)).forEach(A=>{A&&(N?ut(r.validatingFields,A,N):Bt(r.validatingFields,A))}),d.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},v=(S,N=[],A,Y,M=!0,H=!0)=>{if(Y&&A){if(i.action=!0,H&&Array.isArray(ce(n,S))){const X=A(ce(n,S),Y.argA,Y.argB);M&&ut(n,S,X)}if(H&&Array.isArray(ce(r.errors,S))){const X=A(ce(r.errors,S),Y.argA,Y.argB);M&&ut(r.errors,S,X),H5(r.errors,S)}if(f.touchedFields&&H&&Array.isArray(ce(r.touchedFields,S))){const X=A(ce(r.touchedFields,S),Y.argA,Y.argB);M&&ut(r.touchedFields,S,X)}f.dirtyFields&&(r.dirtyFields=ru(s,o)),d.state.next({name:S,isDirty:R(S,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(o,S,N)},_=(S,N)=>{ut(r.errors,S,N),d.state.next({errors:r.errors})},C=S=>{r.errors=S,d.state.next({errors:r.errors,isValid:!1})},E=(S,N,A,Y)=>{const M=ce(n,S);if(M){const H=ce(o,S,Lt(A)?ce(s,S):A);Lt(H)||Y&&Y.defaultChecked||N?ut(o,S,N?H:Oh(M._f)):V(S,H),i.mount&&x()}},T=(S,N,A,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(ce(n,S)&&ce(n,S)._f&&ce(n,S)._f.disabled);if(!A||Y){f.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=R(),H=X!==ee.isDirty);const Le=he||Ro(ce(s,S),N);X=!!(!he&&ce(r.dirtyFields,S)),Le||he?Bt(r.dirtyFields,S):ut(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||f.dirtyFields&&X!==!Le}if(A){const Le=ce(r.touchedFields,S);Le||(ut(r.touchedFields,S,A),ee.touchedFields=r.touchedFields,H=H||f.touchedFields&&Le!==A)}return H&&M&&d.state.next(ee),H?ee:{}},P=(S,N,A,Y)=>{const M=ce(r.errors,S),H=f.isValid&&Rn(N)&&r.isValid!==N;if(e.delayError&&A?(l=m(()=>_(S,A)),l(e.delayError)):(clearTimeout(c),l=null,A?ut(r.errors,S,A):Bt(r.errors,S)),(A?!Ro(M,A):M)||!Nr(Y)||H){const X={...Y,...H&&Rn(N)?{isValid:N}:{},errors:r.errors,name:S};r={...r,...X},d.state.next(X)}},O=async S=>{g(S,!0);const N=await t.resolver(o,t.context,V5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(S),N},j=async S=>{const{errors:N}=await O(S);if(S)for(const A of S){const Y=ce(N,A);Y?ut(r.errors,A,Y):Bt(r.errors,A)}else r.errors=N;return N},L=async(S,N,A={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);g([Y],!0);const he=await mw(M,o,w,t.shouldUseNativeValidation&&!N,ee);if(g([Y]),he[H.name]&&(A.valid=!1,N))break;!N&&(ce(he,H.name)?ee?F5(r.errors,he,H.name):ut(r.errors,H.name,he[H.name]):Bt(r.errors,H.name))}X&&await L(X,N,A)}}return A.valid},q=()=>{for(const S of a.unMount){const N=ce(n,S);N&&(N._f.refs?N._f.refs.every(A=>!Dh(A)):!Dh(N._f.ref))&&Ee(S)}a.unMount=new Set},R=(S,N)=>(S&&N&&ut(o,S,N),!Ro(z(),s)),F=(S,N,A)=>AC(S,a,{...i.mount?o:Lt(N)?s:Pn(S)?{[S]:N}:N},A,N),b=S=>Rf(ce(i.mount?o:s,S,e.shouldUnregister?ce(s,S,[]):[])),V=(S,N,A={})=>{const Y=ce(n,S);let M=N;if(Y){const H=Y._f;H&&(!H.disabled&&ut(o,S,$C(N,H)),M=md(H.ref)&&fr(N)?"":N,FC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?mc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):jv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||d.values.next({name:S,values:{...o}})))}(A.shouldDirty||A.shouldTouch)&&T(S,M,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&Q(S)},te=(S,N,A)=>{for(const Y in N){const M=N[Y],H=`${S}.${Y}`,X=ce(n,H);(a.array.has(S)||!vd(M)||X&&!X._f)&&!Ni(M)?te(H,M,A):V(H,M,A)}},W=(S,N,A={})=>{const Y=ce(n,S),M=a.array.has(S),H=xr(N);ut(o,S,H),M?(d.array.next({name:S,values:{...o}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&d.state.next({name:S,dirtyFields:ru(s,o),isDirty:R(S,H)})):Y&&!Y._f&&!fr(H)?te(S,H,A):V(S,H,A),uw(S,a)&&d.state.next({...r}),d.values.next({name:i.mount?S:void 0,values:{...o}})},Z=async S=>{i.mount=!0;const N=S.target;let A=N.name,Y=!0;const M=ce(n,A),H=()=>N.type?Oh(M._f):TC(S),X=ee=>{Y=Number.isNaN(ee)||ee===ce(o,A,ee)};if(M){let ee,he;const Le=H(),Oe=S.type===pd.BLUR||S.type===pd.FOCUS_OUT,St=!W5(M._f)&&!t.resolver&&!ce(r.errors,A)&&!M._f.deps||B5(Oe,ce(r.touchedFields,A),r.isSubmitted,p,h),Vr=uw(A,a,Oe);ut(o,A,Le),Oe?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const Wt=T(A,Le,Oe,!1),Vn=!Nr(Wt)||Vr;if(!Oe&&d.values.next({name:A,type:S.type,values:{...o}}),St)return f.isValid&&x(),Vn&&d.state.next({name:A,...Vr?{}:Wt});if(!Oe&&Vr&&d.state.next({...r}),t.resolver){const{errors:st}=await O([A]);if(X(Le),Y){const Wn=gw(r.errors,n,A),Bn=gw(st,n,Wn.name||A);ee=Bn.error,A=Bn.name,he=Nr(st)}}else g([A],!0),ee=(await mw(M,o,w,t.shouldUseNativeValidation))[A],g([A]),X(Le),Y&&(ee?he=!1:f.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),P(A,he,ee,Wt))}},I=(S,N)=>{if(ce(r.errors,N)&&S.focus)return S.focus(),1},Q=async(S,N={})=>{let A,Y;const M=nl(S);if(t.resolver){const H=await j(Lt(S)?S:M);A=Nr(H),Y=S?!M.some(X=>ce(H,X)):A}else S?(Y=(await Promise.all(M.map(async H=>{const X=ce(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&x()):Y=A=await L(n);return d.state.next({...!Pn(S)||f.isValid&&A!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:A}:{},errors:r.errors}),N.shouldFocus&&!Y&&sl(n,I,S?M:a.mount),Y},z=S=>{const N={...i.mount?o:s};return Lt(S)?N:Pn(S)?ce(N,S):S.map(A=>ce(N,A))},$=(S,N)=>({invalid:!!ce((N||r).errors,S),isDirty:!!ce((N||r).dirtyFields,S),error:ce((N||r).errors,S),isValidating:!!ce(r.validatingFields,S),isTouched:!!ce((N||r).touchedFields,S)}),de=S=>{S&&nl(S).forEach(N=>Bt(r.errors,N)),d.state.next({errors:S?r.errors:{}})},ne=(S,N,A)=>{const Y=(ce(n,S,{_f:{}})._f||{}).ref,M=ce(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;ut(r.errors,S,{...he,...N,ref:Y}),d.state.next({name:S,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,N)=>Bs(S)?d.values.subscribe({next:A=>S(F(void 0,N),A)}):F(S,N,!0),Ee=(S,N={})=>{for(const A of S?nl(S):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(Bt(n,A),Bt(o,A)),!N.keepError&&Bt(r.errors,A),!N.keepDirty&&Bt(r.dirtyFields,A),!N.keepTouched&&Bt(r.touchedFields,A),!N.keepIsValidating&&Bt(r.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&Bt(s,A);d.values.next({values:{...o}}),d.state.next({...r,...N.keepDirty?{isDirty:R()}:{}}),!N.keepIsValid&&x()},fe=({disabled:S,name:N,field:A,fields:Y,value:M})=>{if(Rn(S)&&i.mount||S){const H=S?void 0:Lt(M)?Oh(A?A._f:ce(Y,N)._f):M;ut(o,N,H),T(N,H,!1,!1,!0)}},ge=(S,N={})=>{let A=ce(n,S);const Y=Rn(N.disabled);return ut(n,S,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:S}},name:S,mount:!0,...N}}),a.mount.add(S),A?fe({field:A,disabled:N.disabled,name:S,value:N.value}):E(S,!0,N.value),{...Y?{disabled:N.disabled}:{},...t.progressive?{required:!!N.required,min:Ia(N.min),max:Ia(N.max),minLength:Ia(N.minLength),maxLength:Ia(N.maxLength),pattern:Ia(N.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ge(S,N),A=ce(n,S);const H=Lt(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=$5(H),ee=A._f.refs||[];if(X?ee.find(he=>he===H):H===A._f.ref)return;ut(n,S,{_f:{...A._f,...X?{refs:[...ee.filter(Dh),H,...Array.isArray(ce(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),E(S,!1,void 0,H)}else A=ce(n,S,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(RC(a.array,S)&&i.action)&&a.unMount.add(S)}}},be=()=>t.shouldFocusError&&sl(n,I,a.mount),Pe=S=>{Rn(S)&&(d.state.next({disabled:S}),sl(n,(N,A)=>{const Y=ce(n,A);Y&&(N.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},Te=(S,N)=>async A=>{let Y;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let M=xr(o);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await O();r.errors=H,M=X}else await L(n);if(Bt(r.errors,"root"),Nr(r.errors)){d.state.next({errors:{}});try{await S(M,A)}catch(H){Y=H}}else N&&await N({...r.errors},A),be(),setTimeout(be);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Se=(S,N={})=>{ce(n,S)&&(Lt(N.defaultValue)?W(S,xr(ce(s,S))):(W(S,N.defaultValue),ut(s,S,xr(N.defaultValue))),N.keepTouched||Bt(r.touchedFields,S),N.keepDirty||(Bt(r.dirtyFields,S),r.isDirty=N.defaultValue?R(S,xr(ce(s,S))):R()),N.keepError||(Bt(r.errors,S),f.isValid&&x()),d.state.next({...r}))},et=(S,N={})=>{const A=S?xr(S):s,Y=xr(A),M=Nr(S),H=M?s:Y;if(N.keepDefaultValues||(s=A),!N.keepValues){if(N.keepDirtyValues)for(const X of a.mount)ce(r.dirtyFields,X)?ut(H,X,ce(o,X)):W(X,ce(H,X));else{if(Rv&&Lt(S))for(const X of a.mount){const ee=ce(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(md(he)){const Le=he.closest("form");if(Le){Le.reset();break}}}}n={}}o=e.shouldUnregister?N.keepDefaultValues?xr(s):{}:xr(H),d.array.next({values:{...H}}),d.values.next({values:{...H}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!e.shouldUnregister,d.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:M?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Ro(S,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:N.keepDirtyValues?N.keepDefaultValues&&o?ru(s,o):r.dirtyFields:N.keepDefaultValues&&S?ru(s,S):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,N)=>et(Bs(S)?S(o):S,N);return{control:{register:ge,unregister:Ee,getFieldState:$,handleSubmit:Te,setError:ne,_executeSchema:O,_getWatch:F,_getDirty:R,_updateValid:x,_removeUnmounted:q,_updateFieldArray:v,_updateDisabledField:fe,_getFieldArray:b,_reset:et,_resetDefaultValues:()=>Bs(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Pe,_subjects:d,_proxyFormState:f,_setErrors:C,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(S){i=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ge,handleSubmit:Te,watch:se,setValue:W,getValues:z,reset:k,resetField:Se,clearErrors:de,unregister:Ee,setError:ne,setFocus:(S,N={})=>{const A=ce(n,S),Y=A&&A._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),N.shouldSelect&&M.select())}},getFieldState:$}}function Qo(e={}){const t=Qe.useRef(),r=Qe.useRef(),[n,s]=Qe.useState({isDirty:!1,isValidating:!1,isLoading:Bs(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Bs(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Z5(e),formState:n});const o=t.current.control;return o._options=e,Pv({subject:o._subjects.state,next:i=>{DC(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),Qe.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Qe.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),Qe.useEffect(()=>{e.values&&!Ro(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),Qe.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Qe.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Qe.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=jC(n,o),t.current}const vw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ce(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},VC=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?vw(n.ref,r,e):n.refs&&n.refs.forEach(s=>vw(s,r,e))}},G5=(e,t)=>{t.shouldUseNativeValidation&&VC(e,t);const r={};for(const n in e){const s=ce(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(K5(t.names||Object.keys(e),n)){const i=Object.assign({},ce(r,n));ut(i,"root",o),ut(r,n,i)}else ut(r,n,o)}return r},K5=(e,t)=>e.some(r=>r.startsWith(t+"."));var q5=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=MC(i,t,r,s,c?[].concat(c,n.message):n.message)}e.shift()}return r},Jo=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(c){return o.shouldUseNativeValidation&&VC({},o),{errors:{},values:r.raw?n:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:G5(q5(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},rt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(rt||(rt={}));var rm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(rm||(rm={}));const ye=rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zs=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},ie=rt.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"]),X5=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Lr extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,l=0;for(;lr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Lr.create=e=>new Lr(e);const ta=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,rt.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${rt.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${rt.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${rt.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:rt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ie.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ie.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,rt.assertNever(e)}return{message:r}};let WC=ta;function Q5(e){WC=e}function wd(){return WC}const xd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},J5=[];function pe(e,t){const r=wd(),n=xd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ta?void 0:ta].filter(s=>!!s)});e.common.issues.push(n)}class cr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return Ie;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,i=await s.value;n.push({key:o,value:i})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return Ie;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}}const Ie=Object.freeze({status:"aborted"}),Pi=e=>({status:"dirty",value:e}),pr=e=>({status:"valid",value:e}),nm=e=>e.status==="aborted",sm=e=>e.status==="dirty",Ml=e=>e.status==="valid",Il=e=>typeof Promise<"u"&&e instanceof Promise;function _d(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function BC(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ce||(Ce={}));var Wa,Ba;class Ln{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}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 yw=(e,t)=>{if(Ml(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 r=new Lr(e.common.issues);return this._error=r,this._error}}};function ze(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var l,c;const{message:f}=e;return i.code==="invalid_enum_value"?{message:f??a.defaultError}:typeof a.data>"u"?{message:(l=f??n)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=f??r)!==null&&c!==void 0?c:a.defaultError}},description:s}}class He{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 zs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cr,ctx:{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Il(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},o=this._parseSync({data:t,path:s.path,parent:s});return yw(s,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Il(s)?s:Promise.resolve(s));return yw(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ie.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new yn({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return An.create(this,this._def)}nullable(){return lo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fn.create(this,this._def)}promise(){return na.create(this,this._def)}or(t){return Ul.create([this,t],this._def)}and(t){return $l.create(this,t,this._def)}transform(t){return new yn({...ze(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Yl({...ze(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new Ov({typeName:Ae.ZodBranded,type:this,...ze(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Zl({...ze(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return gc.create(this,t)}readonly(){return Gl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ez=/^c[^\s-]{8,}$/i,tz=/^[0-9a-z]+$/,rz=/^[0-9A-HJKMNP-TV-Z]{26}$/,nz=/^[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,sz=/^[a-z0-9_-]{21}$/i,oz=/^[-+]?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)?)??$/,iz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,az="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ah;const lz=/^(?:(?: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])$/,cz=/^(([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})))$/,uz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,HC="((\\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])))",dz=new RegExp(`^${HC}$`);function YC(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 fz(e){return new RegExp(`^${YC(e)}$`)}function ZC(e){let t=`${HC}T${YC(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function hz(e,t){return!!((t==="v4"||!t)&&lz.test(e)||(t==="v6"||!t)&&cz.test(e))}class cn extends He{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.string,received:o.parsedType}),Ie}const n=new cr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:r,code:ie.invalid_string,...Ce.errToObj(n)})}_addCheck(t){return new cn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}datetime(t){var r,n;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:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...Ce.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,...Ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ce.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ce.errToObj(r)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new cn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cn({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new cn({checks:[],typeName:Ae.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};function pz(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class oo extends He{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)!==ye.number){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.number,received:o.parsedType}),Ie}let n;const s=new cr;for(const o of this._def.checks)o.kind==="int"?rt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?pz(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_finite,message:o.message}),s.dirty()):rt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new oo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new oo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&rt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew oo({checks:[],typeName:Ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class io extends He{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)!==ye.bigint){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.bigint,received:o.parsedType}),Ie}let n;const s=new cr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):rt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new io({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new io({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new io({checks:[],typeName:Ae.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};class Ll extends He{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.boolean,received:n.parsedType}),Ie}return pr(t.data)}}Ll.create=e=>new Ll({typeName:Ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class Wo extends He{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.date,received:o.parsedType}),Ie}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_date}),Ie}const n=new cr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):rt.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Wo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Wo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ae.ZodDate,...ze(e)});class bd extends He{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.symbol,received:n.parsedType}),Ie}return pr(t.data)}}bd.create=e=>new bd({typeName:Ae.ZodSymbol,...ze(e)});class Fl extends He{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.undefined,received:n.parsedType}),Ie}return pr(t.data)}}Fl.create=e=>new Fl({typeName:Ae.ZodUndefined,...ze(e)});class zl extends He{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.null,received:n.parsedType}),Ie}return pr(t.data)}}zl.create=e=>new zl({typeName:Ae.ZodNull,...ze(e)});class ra extends He{constructor(){super(...arguments),this._any=!0}_parse(t){return pr(t.data)}}ra.create=e=>new ra({typeName:Ae.ZodAny,...ze(e)});class Do extends He{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pr(t.data)}}Do.create=e=>new Do({typeName:Ae.ZodUnknown,...ze(e)});class ys extends He{_parse(t){const r=this._getOrReturnCtx(t);return pe(r,{code:ie.invalid_type,expected:ye.never,received:r.parsedType}),Ie}}ys.create=e=>new ys({typeName:Ae.ZodNever,...ze(e)});class Sd extends He{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.void,received:n.parsedType}),Ie}return pr(t.data)}}Sd.create=e=>new Sd({typeName:Ae.ZodVoid,...ze(e)});class fn extends He{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==ye.array)return pe(r,{code:ie.invalid_type,expected:ye.array,received:r.parsedType}),Ie;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(pe(r,{code:ie.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Ln(r,i,r.path,a)))).then(i=>cr.mergeArray(n,i));const o=[...r.data].map((i,a)=>s.type._parseSync(new Ln(r,i,r.path,a)));return cr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new fn({...this._def,minLength:{value:t,message:Ce.toString(r)}})}max(t,r){return new fn({...this._def,maxLength:{value:t,message:Ce.toString(r)}})}length(t,r){return new fn({...this._def,exactLength:{value:t,message:Ce.toString(r)}})}nonempty(t){return this.min(1,t)}}fn.create=(e,t)=>new fn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...ze(t)});function pi(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=An.create(pi(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof fn?new fn({...e._def,type:pi(e.element)}):e instanceof An?An.create(pi(e.unwrap())):e instanceof lo?lo.create(pi(e.unwrap())):e instanceof Fn?Fn.create(e.items.map(t=>pi(t))):e}class Rt extends He{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(),r=rt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ye.object){const c=this._getOrReturnCtx(t);return pe(c,{code:ie.invalid_type,expected:ye.object,received:c.parsedType}),Ie}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ys&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const f=o[c],d=s.data[c];l.push({key:{status:"valid",value:c},value:f._parse(new Ln(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof ys){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(c==="strict")a.length>0&&(pe(s,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of a){const d=s.data[f];l.push({key:{status:"valid",value:f},value:c._parse(new Ln(s,d,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of l){const d=await f.key,h=await f.value;c.push({key:d,value:h,alwaysSet:f.alwaysSet})}return c}).then(c=>cr.mergeObjectSync(n,c)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Ce.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return rt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return rt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return pi(this)}partial(t){const r={};return rt.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return rt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof An;)o=o._def.innerType;r[n]=o}}),new Rt({...this._def,shape:()=>r})}keyof(){return GC(rt.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:ys.create(),typeName:Ae.ZodObject,...ze(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:ys.create(),typeName:Ae.ZodObject,...ze(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:ys.create(),typeName:Ae.ZodObject,...ze(t)});class Ul extends He{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Lr(a.ctx.common.issues));return pe(r,{code:ie.invalid_union,unionErrors:i}),Ie}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const l of n){const c={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new Lr(l));return pe(r,{code:ie.invalid_union,unionErrors:a}),Ie}}get options(){return this._def.options}}Ul.create=(e,t)=>new Ul({options:e,typeName:Ae.ZodUnion,...ze(t)});const qn=e=>e instanceof Wl?qn(e.schema):e instanceof yn?qn(e.innerType()):e instanceof Bl?[e.value]:e instanceof ao?e.options:e instanceof Hl?rt.objectValues(e.enum):e instanceof Yl?qn(e._def.innerType):e instanceof Fl?[void 0]:e instanceof zl?[null]:e instanceof An?[void 0,...qn(e.unwrap())]:e instanceof lo?[null,...qn(e.unwrap())]:e instanceof Ov||e instanceof Gl?qn(e.unwrap()):e instanceof Zl?qn(e._def.innerType):[];class Pf extends He{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.object)return pe(r,{code:ie.invalid_type,expected:ye.object,received:r.parsedType}),Ie;const n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(pe(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ie)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const o of r){const i=qn(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Pf({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...ze(n)})}}function om(e,t){const r=zs(e),n=zs(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const s=rt.objectKeys(t),o=rt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const l=om(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(nm(o)||nm(i))return Ie;const a=om(o.value,i.value);return a.valid?((sm(o)||sm(i))&&r.dirty(),{status:r.value,value:a.data}):(pe(n,{code:ie.invalid_intersection_types}),Ie)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}$l.create=(e,t,r)=>new $l({left:e,right:t,typeName:Ae.ZodIntersection,...ze(r)});class Fn extends He{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return pe(n,{code:ie.invalid_type,expected:ye.array,received:n.parsedType}),Ie;if(n.data.lengththis._def.items.length&&(pe(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Ln(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>cr.mergeArray(r,i)):cr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Fn({...this._def,rest:t})}}Fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:e,typeName:Ae.ZodTuple,rest:null,...ze(t)})};class Vl extends He{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.object)return pe(n,{code:ie.invalid_type,expected:ye.object,received:n.parsedType}),Ie;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in n.data)s.push({key:o._parse(new Ln(n,a,n.path,a)),value:i._parse(new Ln(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?cr.mergeObjectAsync(r,s):cr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof He?new Vl({keyType:t,valueType:r,typeName:Ae.ZodRecord,...ze(n)}):new Vl({keyType:cn.create(),valueType:t,typeName:Ae.ZodRecord,...ze(r)})}}class kd extends He{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.map)return pe(n,{code:ie.invalid_type,expected:ye.map,received:n.parsedType}),Ie;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,l],c)=>({key:s._parse(new Ln(n,a,n.path,[c,"key"])),value:o._parse(new Ln(n,l,n.path,[c,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,f=await l.value;if(c.status==="aborted"||f.status==="aborted")return Ie;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,f=l.value;if(c.status==="aborted"||f.status==="aborted")return Ie;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}}}}kd.create=(e,t,r)=>new kd({valueType:t,keyType:e,typeName:Ae.ZodMap,...ze(r)});class Bo extends He{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return pe(n,{code:ie.invalid_type,expected:ye.set,received:n.parsedType}),Ie;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(pe(n,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(l){const c=new Set;for(const f of l){if(f.status==="aborted")return Ie;f.status==="dirty"&&r.dirty(),c.add(f.value)}return{status:r.value,value:c}}const a=[...n.data.values()].map((l,c)=>o._parse(new Ln(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,r){return new Bo({...this._def,minSize:{value:t,message:Ce.toString(r)}})}max(t,r){return new Bo({...this._def,maxSize:{value:t,message:Ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Bo.create=(e,t)=>new Bo({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...ze(t)});class Hi extends He{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.function)return pe(r,{code:ie.invalid_type,expected:ye.function,received:r.parsedType}),Ie;function n(a,l){return xd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wd(),ta].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function s(a,l){return xd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wd(),ta].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof na){const a=this;return pr(async function(...l){const c=new Lr([]),f=await a._def.args.parseAsync(l,o).catch(p=>{throw c.addIssue(n(l,p)),c}),d=await Reflect.apply(i,this,f);return await a._def.returns._def.type.parseAsync(d,o).catch(p=>{throw c.addIssue(s(d,p)),c})})}else{const a=this;return pr(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Lr([n(l,c.error)]);const f=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(f,o);if(!d.success)throw new Lr([s(f,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Hi({...this._def,args:Fn.create(t).rest(Do.create())})}returns(t){return new Hi({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Hi({args:t||Fn.create([]).rest(Do.create()),returns:r||Do.create(),typeName:Ae.ZodFunction,...ze(n)})}}class Wl extends He{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Wl.create=(e,t)=>new Wl({getter:e,typeName:Ae.ZodLazy,...ze(t)});class Bl extends He{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return pe(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Ie}return{status:"valid",value:t.data}}get value(){return this._def.value}}Bl.create=(e,t)=>new Bl({value:e,typeName:Ae.ZodLiteral,...ze(t)});function GC(e,t){return new ao({values:e,typeName:Ae.ZodEnum,...ze(t)})}class ao extends He{constructor(){super(...arguments),Wa.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{expected:rt.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ie}if(_d(this,Wa)||BC(this,Wa,new Set(this._def.values)),!_d(this,Wa).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Ie}return pr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ao.create(t,{...this._def,...r})}exclude(t,r=this._def){return ao.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Wa=new WeakMap;ao.create=GC;class Hl extends He{constructor(){super(...arguments),Ba.set(this,void 0)}_parse(t){const r=rt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const s=rt.objectValues(r);return pe(n,{expected:rt.joinValues(s),received:n.parsedType,code:ie.invalid_type}),Ie}if(_d(this,Ba)||BC(this,Ba,new Set(rt.getValidEnumValues(this._def.values))),!_d(this,Ba).has(t.data)){const s=rt.objectValues(r);return pe(n,{received:n.data,code:ie.invalid_enum_value,options:s}),Ie}return pr(t.data)}get enum(){return this._def.values}}Ba=new WeakMap;Hl.create=(e,t)=>new Hl({values:e,typeName:Ae.ZodNativeEnum,...ze(t)});class na extends He{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return pe(r,{code:ie.invalid_type,expected:ye.promise,received:r.parsedType}),Ie;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return pr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}na.create=(e,t)=>new na({type:e,typeName:Ae.ZodPromise,...ze(t)});class yn extends He{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{pe(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return Ie;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Ie:l.status==="dirty"||r.value==="dirty"?Pi(l.value):l});{if(r.value==="aborted")return Ie;const a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?Ie:a.status==="dirty"||r.value==="dirty"?Pi(a.value):a}}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);if(n.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(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ie:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ie:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ml(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ml(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);rt.assertNever(s)}}yn.create=(e,t,r)=>new yn({schema:e,typeName:Ae.ZodEffects,effect:t,...ze(r)});yn.createWithPreprocess=(e,t,r)=>new yn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...ze(r)});class An extends He{_parse(t){return this._getType(t)===ye.undefined?pr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}An.create=(e,t)=>new An({innerType:e,typeName:Ae.ZodOptional,...ze(t)});class lo extends He{_parse(t){return this._getType(t)===ye.null?pr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}lo.create=(e,t)=>new lo({innerType:e,typeName:Ae.ZodNullable,...ze(t)});class Yl extends He{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Yl.create=(e,t)=>new Yl({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});class Zl extends He{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Il(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Zl.create=(e,t)=>new Zl({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});class Cd extends He{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.nan,received:n.parsedType}),Ie}return{status:"valid",value:t.data}}}Cd.create=e=>new Cd({typeName:Ae.ZodNaN,...ze(e)});const mz=Symbol("zod_brand");class Ov extends He{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class gc extends He{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ie:o.status==="dirty"?(r.dirty(),Pi(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ie:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new gc({in:t,out:r,typeName:Ae.ZodPipeline})}}class Gl extends He{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Ml(s)&&(s.value=Object.freeze(s.value)),s);return Il(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Gl.create=(e,t)=>new Gl({innerType:e,typeName:Ae.ZodReadonly,...ze(t)});function KC(e,t={},r){return e?ra.create().superRefine((n,s)=>{var o,i;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(i=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:l})}}):ra.create()}const gz={object:Rt.lazycreate};var Ae;(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"})(Ae||(Ae={}));const vz=(e,t={message:`Input not instance of ${e.name}`})=>KC(r=>r instanceof e,t),qC=cn.create,XC=oo.create,yz=Cd.create,wz=io.create,QC=Ll.create,xz=Wo.create,_z=bd.create,bz=Fl.create,Sz=zl.create,kz=ra.create,Cz=Do.create,Ez=ys.create,Tz=Sd.create,Rz=fn.create,Nz=Rt.create,Pz=Rt.strictCreate,jz=Ul.create,Dz=Pf.create,Oz=$l.create,Az=Fn.create,Mz=Vl.create,Iz=kd.create,Lz=Bo.create,Fz=Hi.create,zz=Wl.create,Uz=Bl.create,$z=ao.create,Vz=Hl.create,Wz=na.create,ww=yn.create,Bz=An.create,Hz=lo.create,Yz=yn.createWithPreprocess,Zz=gc.create,Gz=()=>qC().optional(),Kz=()=>XC().optional(),qz=()=>QC().optional(),Xz={string:e=>cn.create({...e,coerce:!0}),number:e=>oo.create({...e,coerce:!0}),boolean:e=>Ll.create({...e,coerce:!0}),bigint:e=>io.create({...e,coerce:!0}),date:e=>Wo.create({...e,coerce:!0})},Qz=Ie;var Fe=Object.freeze({__proto__:null,defaultErrorMap:ta,setErrorMap:Q5,getErrorMap:wd,makeIssue:xd,EMPTY_PATH:J5,addIssueToContext:pe,ParseStatus:cr,INVALID:Ie,DIRTY:Pi,OK:pr,isAborted:nm,isDirty:sm,isValid:Ml,isAsync:Il,get util(){return rt},get objectUtil(){return rm},ZodParsedType:ye,getParsedType:zs,ZodType:He,datetimeRegex:ZC,ZodString:cn,ZodNumber:oo,ZodBigInt:io,ZodBoolean:Ll,ZodDate:Wo,ZodSymbol:bd,ZodUndefined:Fl,ZodNull:zl,ZodAny:ra,ZodUnknown:Do,ZodNever:ys,ZodVoid:Sd,ZodArray:fn,ZodObject:Rt,ZodUnion:Ul,ZodDiscriminatedUnion:Pf,ZodIntersection:$l,ZodTuple:Fn,ZodRecord:Vl,ZodMap:kd,ZodSet:Bo,ZodFunction:Hi,ZodLazy:Wl,ZodLiteral:Bl,ZodEnum:ao,ZodNativeEnum:Hl,ZodPromise:na,ZodEffects:yn,ZodTransformer:yn,ZodOptional:An,ZodNullable:lo,ZodDefault:Yl,ZodCatch:Zl,ZodNaN:Cd,BRAND:mz,ZodBranded:Ov,ZodPipeline:gc,ZodReadonly:Gl,custom:KC,Schema:He,ZodSchema:He,late:gz,get ZodFirstPartyTypeKind(){return Ae},coerce:Xz,any:kz,array:Rz,bigint:wz,boolean:QC,date:xz,discriminatedUnion:Dz,effect:ww,enum:$z,function:Fz,instanceof:vz,intersection:Oz,lazy:zz,literal:Uz,map:Iz,nan:yz,nativeEnum:Vz,never:Ez,null:Sz,nullable:Hz,number:XC,object:Nz,oboolean:qz,onumber:Kz,optional:Bz,ostring:Gz,pipeline:Zz,preprocess:Yz,promise:Wz,record:Mz,set:Lz,strictObject:Pz,string:qC,symbol:_z,transformer:ww,tuple:Az,undefined:bz,union:jz,unknown:Cz,void:Tz,NEVER:Qz,ZodIssueCode:ie,quotelessJson:X5,ZodError:Lr}),Jz="Label",JC=y.forwardRef((e,t)=>u.jsx(De.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));JC.displayName=Jz;var eE=JC;const e6=ec("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ed=y.forwardRef(({className:e,...t},r)=>u.jsx(eE,{ref:r,className:we(e6(),e),...t}));Ed.displayName=eE.displayName;const ei=O5,tE=y.createContext({}),tt=({...e})=>u.jsx(tE.Provider,{value:{name:e.name},children:u.jsx(L5,{...e})}),jf=()=>{const e=y.useContext(tE),t=y.useContext(rE),{getFieldState:r,formState:n}=Nf(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},rE=y.createContext({}),Ke=y.forwardRef(({className:e,...t},r)=>{const n=y.useId();return u.jsx(rE.Provider,{value:{id:n},children:u.jsx("div",{ref:r,className:we("space-y-2",e),...t})})});Ke.displayName="FormItem";const qe=y.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=jf();return u.jsx(Ed,{ref:r,className:we(n&&"text-destructive",e),htmlFor:s,...t})});qe.displayName="FormLabel";const Xe=y.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=jf();return u.jsx(hs,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});Xe.displayName="FormControl";const t6=y.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=jf();return u.jsx("p",{ref:r,id:n,className:we("text-sm text-muted-foreground",e),...t})});t6.displayName="FormDescription";const Ze=y.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=jf(),i=s?String(s==null?void 0:s.message):t;return i?u.jsx("p",{ref:n,id:o,className:we("text-sm font-medium text-destructive",e),...r,children:i}):null});Ze.displayName="FormMessage";function im(e,[t,r]){return Math.min(r,Math.max(t,e))}var r6=[" ","Enter","ArrowUp","ArrowDown"],n6=[" ","Enter"],vc="Select",[Df,Of,s6]=Xd(vc),[wa,RU]=Er(vc,[s6,pa]),Af=pa(),[o6,mo]=wa(vc),[i6,a6]=wa(vc),nE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:f,autoComplete:d,disabled:h,required:p}=e,w=Af(t),[m,x]=y.useState(null),[g,v]=y.useState(null),[_,C]=y.useState(!1),E=tc(c),[T=!1,P]=ps({prop:n,defaultProp:s,onChange:o}),[O,j]=ps({prop:i,defaultProp:a,onChange:l}),L=y.useRef(null),q=m?!!m.closest("form"):!0,[R,F]=y.useState(new Set),b=Array.from(R).map(V=>V.props.value).join(";");return u.jsx(Ng,{...w,children:u.jsxs(o6,{required:p,scope:t,trigger:m,onTriggerChange:x,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:On(),value:O,onValueChange:j,open:T,onOpenChange:P,dir:E,triggerPointerDownPosRef:L,disabled:h,children:[u.jsx(Df.Provider,{scope:t,children:u.jsx(i6,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(V=>{F(te=>new Set(te).add(V))},[]),onNativeOptionRemove:y.useCallback(V=>{F(te=>{const W=new Set(te);return W.delete(V),W})},[]),children:r})}),q?u.jsxs(NE,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:d,value:O,onChange:V=>j(V.target.value),disabled:h,children:[O===void 0?u.jsx("option",{value:""}):null,Array.from(R)]},b):null]})})};nE.displayName=vc;var sE="SelectTrigger",oE=y.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Af(r),i=mo(sE,r),a=i.disabled||n,l=Ue(t,i.onTriggerChange),c=Of(r),[f,d,h]=PE(w=>{const m=c().filter(v=>!v.disabled),x=m.find(v=>v.value===i.value),g=jE(m,w,x);g!==void 0&&i.onValueChange(g.value)}),p=()=>{a||(i.onOpenChange(!0),h())};return u.jsx(Pg,{asChild:!0,...o,children:u.jsx(De.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":RE(i.value)?"":void 0,...s,ref:l,onClick:le(s.onClick,w=>{w.currentTarget.focus()}),onPointerDown:le(s.onPointerDown,w=>{const m=w.target;m.hasPointerCapture(w.pointerId)&&m.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&(p(),i.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)},w.preventDefault())}),onKeyDown:le(s.onKeyDown,w=>{const m=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&d(w.key),!(m&&w.key===" ")&&r6.includes(w.key)&&(p(),w.preventDefault())})})})});oE.displayName=sE;var iE="SelectValue",aE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=mo(iE,r),{onValueNodeHasChildrenChange:c}=l,f=o!==void 0,d=Ue(t,l.onValueNodeChange);return nr(()=>{c(f)},[c,f]),u.jsx(De.span,{...a,ref:d,style:{pointerEvents:"none"},children:RE(l.value)?u.jsx(u.Fragment,{children:i}):o})});aE.displayName=iE;var l6="SelectIcon",lE=y.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return u.jsx(De.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});lE.displayName=l6;var c6="SelectPortal",cE=e=>u.jsx(nc,{asChild:!0,...e});cE.displayName=c6;var Ho="SelectContent",uE=y.forwardRef((e,t)=>{const r=mo(Ho,e.__scopeSelect),[n,s]=y.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?xs.createPortal(u.jsx(dE,{scope:e.__scopeSelect,children:u.jsx(Df.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(fE,{...e,ref:t})});uE.displayName=Ho;var Jn=10,[dE,go]=wa(Ho),u6="SelectContentImpl",fE=y.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:x,...g}=e,v=mo(Ho,r),[_,C]=y.useState(null),[E,T]=y.useState(null),P=Ue(t,fe=>C(fe)),[O,j]=y.useState(null),[L,q]=y.useState(null),R=Of(r),[F,b]=y.useState(!1),V=y.useRef(!1);y.useEffect(()=>{if(_)return Og(_)},[_]),wg();const te=y.useCallback(fe=>{const[ge,...be]=R().map(Se=>Se.ref.current),[Pe]=be.slice(-1),Te=document.activeElement;for(const Se of fe)if(Se===Te||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ge&&E&&(E.scrollTop=0),Se===Pe&&E&&(E.scrollTop=E.scrollHeight),Se==null||Se.focus(),document.activeElement!==Te))return},[R,E]),W=y.useCallback(()=>te([O,_]),[te,O,_]);y.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=v;y.useEffect(()=>{if(_){let fe={x:0,y:0};const ge=Pe=>{var Te,Se;fe={x:Math.abs(Math.round(Pe.pageX)-(((Te=I.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((Se=I.current)==null?void 0:Se.y)??0))}},be=Pe=>{fe.x<=10&&fe.y<=10?Pe.preventDefault():_.contains(Pe.target)||Z(!1),document.removeEventListener("pointermove",ge),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",be,{capture:!0})}}},[_,Z,I]),y.useEffect(()=>{const fe=()=>Z(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[Z]);const[Q,z]=PE(fe=>{const ge=R().filter(Te=>!Te.disabled),be=ge.find(Te=>Te.ref.current===document.activeElement),Pe=jE(ge,fe,be);Pe&&setTimeout(()=>Pe.ref.current.focus())}),$=y.useCallback((fe,ge,be)=>{const Pe=!V.current&&!be;(v.value!==void 0&&v.value===ge||Pe)&&(j(fe),Pe&&(V.current=!0))},[v.value]),de=y.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=y.useCallback((fe,ge,be)=>{const Pe=!V.current&&!be;(v.value!==void 0&&v.value===ge||Pe)&&q(fe)},[v.value]),se=n==="popper"?am:hE,Ee=se===am?{side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:x}:{};return u.jsx(dE,{scope:r,content:_,viewport:E,onViewportChange:T,itemRefCallback:$,selectedItem:O,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:W,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:u.jsx(sf,{as:hs,allowPinchZoom:!0,children:u.jsx(Qd,{asChild:!0,trapped:v.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:le(s,fe=>{var ge;(ge=v.trigger)==null||ge.focus({preventScroll:!0}),fe.preventDefault()}),children:u.jsx(da,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:u.jsx(se,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:fe=>fe.preventDefault(),...g,...Ee,onPlaced:()=>b(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:le(g.onKeyDown,fe=>{const ge=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ge&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Pe=R().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Te=fe.target,Se=Pe.indexOf(Te);Pe=Pe.slice(Se+1)}setTimeout(()=>te(Pe)),fe.preventDefault()}})})})})})})});fE.displayName=u6;var d6="SelectItemAlignedPosition",hE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=mo(Ho,r),i=go(Ho,r),[a,l]=y.useState(null),[c,f]=y.useState(null),d=Ue(t,P=>f(P)),h=Of(r),p=y.useRef(!1),w=y.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:g,focusSelectedItem:v}=i,_=y.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&m&&x&&g){const P=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),L=g.getBoundingClientRect();if(o.dir!=="rtl"){const Te=L.left-O.left,Se=j.left-Te,et=P.left-Se,k=P.width+et,J=Math.max(k,O.width),G=window.innerWidth-Jn,D=im(Se,[Jn,G-J]);a.style.minWidth=k+"px",a.style.left=D+"px"}else{const Te=O.right-L.right,Se=window.innerWidth-j.right-Te,et=window.innerWidth-P.right-Se,k=P.width+et,J=Math.max(k,O.width),G=window.innerWidth-Jn,D=im(Se,[Jn,G-J]);a.style.minWidth=k+"px",a.style.right=D+"px"}const q=h(),R=window.innerHeight-Jn*2,F=m.scrollHeight,b=window.getComputedStyle(c),V=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),W=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=V+te+F+Z+W,Q=Math.min(x.offsetHeight*5,I),z=window.getComputedStyle(m),$=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=P.top+P.height/2-Jn,se=R-ne,Ee=x.offsetHeight/2,fe=x.offsetTop+Ee,ge=V+te+fe,be=I-ge;if(ge<=ne){const Te=x===q[q.length-1].ref.current;a.style.bottom="0px";const Se=c.clientHeight-m.offsetTop-m.offsetHeight,et=Math.max(se,Ee+(Te?de:0)+Se+W),k=ge+et;a.style.height=k+"px"}else{const Te=x===q[0].ref.current;a.style.top="0px";const et=Math.max(ne,V+m.offsetTop+(Te?$:0)+Ee)+be;a.style.height=et+"px",m.scrollTop=ge-ne+m.offsetTop}a.style.margin=`${Jn}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,a,c,m,x,g,o.dir,n]);nr(()=>_(),[_]);const[C,E]=y.useState();nr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const T=y.useCallback(P=>{P&&w.current===!0&&(_(),v==null||v(),w.current=!1)},[_,v]);return u.jsx(h6,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:u.jsx(De.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});hE.displayName=d6;var f6="SelectPopperPosition",am=y.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Jn,...o}=e,i=Af(r);return u.jsx(jg,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});am.displayName=f6;var[h6,Av]=wa(Ho,{}),lm="SelectViewport",pE=y.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=go(lm,r),i=Av(lm,r),a=Ue(t,o.onViewportChange),l=y.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),u.jsx(Df.Slot,{scope:r,children:u.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:le(s.onScroll,c=>{const f=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const p=Math.abs(l.current-f.scrollTop);if(p>0){const w=window.innerHeight-Jn*2,m=parseFloat(d.style.minHeight),x=parseFloat(d.style.height),g=Math.max(m,x);if(g0?C:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});pE.displayName=lm;var mE="SelectGroup",[p6,m6]=wa(mE),gE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=On();return u.jsx(p6,{scope:r,id:s,children:u.jsx(De.div,{role:"group","aria-labelledby":s,...n,ref:t})})});gE.displayName=mE;var vE="SelectLabel",yE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=m6(vE,r);return u.jsx(De.div,{id:s.id,...n,ref:t})});yE.displayName=vE;var Td="SelectItem",[g6,wE]=wa(Td),xE=y.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=mo(Td,r),l=go(Td,r),c=a.value===n,[f,d]=y.useState(o??""),[h,p]=y.useState(!1),w=Ue(t,g=>{var v;return(v=l.itemRefCallback)==null?void 0:v.call(l,g,n,s)}),m=On(),x=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(g6,{scope:r,value:n,disabled:s,textId:m,isSelected:c,onItemTextChange:y.useCallback(g=>{d(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:u.jsx(Df.ItemSlot,{scope:r,value:n,disabled:s,textValue:f,children:u.jsx(De.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:w,onFocus:le(i.onFocus,()=>p(!0)),onBlur:le(i.onBlur,()=>p(!1)),onPointerUp:le(i.onPointerUp,x),onPointerMove:le(i.onPointerMove,g=>{var v;s?(v=l.onItemLeave)==null||v.call(l):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:le(i.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=l.onItemLeave)==null||v.call(l))}),onKeyDown:le(i.onKeyDown,g=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&g.key===" "||(n6.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})})})})});xE.displayName=Td;var Ha="SelectItemText",_E=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=mo(Ha,r),a=go(Ha,r),l=wE(Ha,r),c=a6(Ha,r),[f,d]=y.useState(null),h=Ue(t,g=>d(g),l.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,l.value,l.disabled)}),p=f==null?void 0:f.textContent,w=y.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=c;return nr(()=>(m(w),()=>x(w)),[m,x,w]),u.jsxs(u.Fragment,{children:[u.jsx(De.span,{id:l.textId,...o,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?xs.createPortal(o.children,i.valueNode):null]})});_E.displayName=Ha;var bE="SelectItemIndicator",SE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return wE(bE,r).isSelected?u.jsx(De.span,{"aria-hidden":!0,...n,ref:t}):null});SE.displayName=bE;var cm="SelectScrollUpButton",kE=y.forwardRef((e,t)=>{const r=go(cm,e.__scopeSelect),n=Av(cm,e.__scopeSelect),[s,o]=y.useState(!1),i=Ue(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(EE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});kE.displayName=cm;var um="SelectScrollDownButton",CE=y.forwardRef((e,t)=>{const r=go(um,e.__scopeSelect),n=Av(um,e.__scopeSelect),[s,o]=y.useState(!1),i=Ue(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(EE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});CE.displayName=um;var EE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=go("SelectScrollButton",r),i=y.useRef(null),a=Of(r),l=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),nr(()=>{var f;const c=a().find(d=>d.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),u.jsx(De.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:le(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:le(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:le(s.onPointerLeave,()=>{l()})})}),v6="SelectSeparator",TE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return u.jsx(De.div,{"aria-hidden":!0,...n,ref:t})});TE.displayName=v6;var dm="SelectArrow",y6=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Af(r),o=mo(dm,r),i=go(dm,r);return o.open&&i.position==="popper"?u.jsx(Dg,{...s,...n,ref:t}):null});y6.displayName=dm;function RE(e){return e===""||e===void 0}var NE=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=y.useRef(null),o=Ue(t,s),i=xv(r);return y.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==r&&f){const d=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(d)}},[i,r]),u.jsx(pc,{asChild:!0,children:u.jsx("select",{...n,ref:o,defaultValue:r})})});NE.displayName="BubbleSelect";function PE(e){const t=jt(e),r=y.useRef(""),n=y.useRef(0),s=y.useCallback(i=>{const a=r.current+i;t(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=y.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function jE(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=w6(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function w6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var x6=nE,DE=oE,_6=aE,b6=lE,S6=cE,OE=uE,k6=pE,C6=gE,AE=yE,ME=xE,E6=_E,T6=SE,IE=kE,LE=CE,FE=TE;const Mh=x6,Ih=C6,Lh=_6,Cu=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(DE,{ref:n,className:we("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,u.jsx(b6,{asChild:!0,children:u.jsx(t1,{className:"h-4 w-4 opacity-50"})})]}));Cu.displayName=DE.displayName;const zE=y.forwardRef(({className:e,...t},r)=>u.jsx(IE,{ref:r,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(WP,{className:"h-4 w-4"})}));zE.displayName=IE.displayName;const UE=y.forwardRef(({className:e,...t},r)=>u.jsx(LE,{ref:r,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(t1,{className:"h-4 w-4"})}));UE.displayName=LE.displayName;const Eu=y.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>u.jsx(S6,{children:u.jsxs(OE,{ref:s,className:we("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[u.jsx(zE,{}),u.jsx(k6,{className:we("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(UE,{})]})}));Eu.displayName=OE.displayName;const Tu=y.forwardRef(({className:e,...t},r)=>u.jsx(AE,{ref:r,className:we("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Tu.displayName=AE.displayName;const Ru=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(ME,{ref:n,className:we("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(T6,{children:u.jsx(e1,{className:"h-4 w-4"})})}),u.jsx(E6,{children:t})]}));Ru.displayName=ME.displayName;const R6=y.forwardRef(({className:e,...t},r)=>u.jsx(FE,{ref:r,className:we("-mx-1 my-1 h-px bg-muted",e),...t}));R6.displayName=FE.displayName;const fm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),N6=Array.from(fm.keys()),P6=Zg,j6=Gg,D6=Kg,$E=y.forwardRef(({className:e,...t},r)=>u.jsx(ic,{ref:r,className:we("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));$E.displayName=ic.displayName;const VE=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(D6,{children:[u.jsx($E,{}),u.jsxs(ac,{ref:n,className:we("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,u.jsxs(lf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(pg,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));VE.displayName=ac.displayName;const WE=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});WE.displayName="DialogHeader";const BE=y.forwardRef(({className:e,...t},r)=>u.jsx(lc,{ref:r,className:we("text-lg font-semibold leading-none tracking-tight",e),...t}));BE.displayName=lc.displayName;const O6=y.forwardRef(({className:e,...t},r)=>u.jsx(cc,{ref:r,className:we("text-sm text-muted-foreground",e),...t}));O6.displayName=cc.displayName;const Oo=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),Mf=Fe.union([Fe.literal("aliyun"),Fe.literal("tencent"),Fe.literal("ssh"),Fe.literal("webhook")],{message:"请选择云服务商"}),A6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,secretId:Fe.string().min(1).max(64),secretKey:Fe.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:o.secretId,secretKey:o.secretKey}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{secretId:l.secretId,secretKey:l.secretKey}};try{const f=await xf(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,p])=>{i.setError(h,{type:"manual",message:p.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"secretId",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"SecretId"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入SecretId",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"secretKey",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"SecretKey"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入SecretKey",...l})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})},M6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,accessKeyId:Fe.string().min(1).max(64),accessSecretId:Fe.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:o.accessKeyId,accessSecretId:o.accessKeySecret}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const f=await xf(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,p])=>{i.setError(h,{type:"manual",message:p.message})});return}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"accessKeyId",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"AccessKeyId"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入AccessKeyId",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"accessSecretId",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"AccessKeySecret"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入AccessKeySecret",...l})}),u.jsx(Ze,{})]})}),u.jsx(Ze,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})};var Mv="Radio",[I6,HE]=Er(Mv),[L6,F6]=I6(Mv),YE=y.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:i,value:a="on",onCheck:l,...c}=e,[f,d]=y.useState(null),h=Ue(t,m=>d(m)),p=y.useRef(!1),w=f?!!f.closest("form"):!0;return u.jsxs(L6,{scope:r,checked:s,disabled:i,children:[u.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":KE(s),"data-disabled":i?"":void 0,disabled:i,value:a,...c,ref:h,onClick:le(e.onClick,m=>{s||l==null||l(),w&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})}),w&&u.jsx(z6,{control:f,bubbles:!p.current,name:n,value:a,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});YE.displayName=Mv;var ZE="RadioIndicator",GE=y.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=F6(ZE,r);return u.jsx(vr,{present:n||o.checked,children:u.jsx(De.span,{"data-state":KE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});GE.displayName=ZE;var z6=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=y.useRef(null),i=xv(r),a=Eg(t);return y.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==r&&d){const h=new Event("click",{bubbles:n});d.call(l,r),l.dispatchEvent(h)}},[i,r,n]),u.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function KE(e){return e?"checked":"unchecked"}var U6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Iv="RadioGroup",[$6,NU]=Er(Iv,[rf,HE]),qE=rf(),XE=HE(),[V6,W6]=$6(Iv),QE=y.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:i=!1,disabled:a=!1,orientation:l,dir:c,loop:f=!0,onValueChange:d,...h}=e,p=qE(r),w=tc(c),[m,x]=ps({prop:o,defaultProp:s,onChange:d});return u.jsx(V6,{scope:r,name:n,required:i,disabled:a,value:m,onValueChange:x,children:u.jsx(U1,{asChild:!0,...p,orientation:l,dir:w,loop:f,children:u.jsx(De.div,{role:"radiogroup","aria-required":i,"aria-orientation":l,"data-disabled":a?"":void 0,dir:w,...h,ref:t})})})});QE.displayName=Iv;var JE="RadioGroupItem",eT=y.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=W6(JE,r),i=o.disabled||n,a=qE(r),l=XE(r),c=y.useRef(null),f=Ue(t,c),d=o.value===s.value,h=y.useRef(!1);return y.useEffect(()=>{const p=m=>{U6.includes(m.key)&&(h.current=!0)},w=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",w)}},[]),u.jsx($1,{asChild:!0,...a,focusable:!i,active:d,children:u.jsx(YE,{disabled:i,required:o.required,checked:d,...l,...s,name:o.name,ref:f,onCheck:()=>o.onValueChange(s.value),onKeyDown:le(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:le(s.onFocus,()=>{var p;h.current&&((p=c.current)==null||p.click())})})})});eT.displayName=JE;var B6="RadioGroupIndicator",tT=y.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=XE(r);return u.jsx(GE,{...s,...n,ref:t})});tT.displayName=B6;var rT=QE,nT=eT,H6=tT;const sT=y.forwardRef(({className:e,...t},r)=>u.jsx(rT,{className:we("grid gap-2",e),...t,ref:r}));sT.displayName=rT.displayName;const oT=y.forwardRef(({className:e,...t},r)=>u.jsx(nT,{ref:r,className:we("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:u.jsx(H6,{className:"flex items-center justify-center",children:u.jsx(s1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));oT.displayName=nT.displayName;const iT=y.forwardRef(({className:e,...t},r)=>u.jsx("textarea",{className:we("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));iT.displayName="Textarea";const Y6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,host:Fe.string().ip({message:"请输入合法的IP地址"}),port:Fe.string().min(1).max(5),username:Fe.string().min(1).max(64),password:Fe.string().min(0).max(64),key:Fe.string().min(0).max(20480),keyFile:Fe.string().optional(),command:Fe.string().min(1).max(2048),certPath:Fe.string().min(0).max(2048),keyPath:Fe.string().min(0).max(2048)});let o={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:o.host,port:o.port,username:o.username,password:o.password,key:o.key,keyFile:o.keyFile,certPath:o.certPath,keyPath:o.keyPath,command:o.command}}),a=async c=>{console.log(c);const f={id:c.id,name:c.name,configType:c.configType,config:{host:c.host,port:c.port,username:c.username,password:c.password,key:c.key,command:c.command,certPath:c.certPath,keyPath:c.keyPath}};try{const d=await xf(f);if(t(),f.id=d.id,f.created=d.created,f.updated=d.updated,c.id){n(f);return}r(f)}catch(d){Object.entries(d.response.data).forEach(([p,w])=>{i.setError(p,{type:"manual",message:w.message})});return}},l=async c=>{var h;const f=(h=c.target.files)==null?void 0:h[0];if(!f)return;const d=await b5(f);i.setValue("key",d),i.setValue("keyFile","")};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-3",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:c})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:c})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...c})}),u.jsx(Ze,{})]})}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsx(tt,{control:i.control,name:"host",render:({field:c})=>u.jsxs(Ke,{className:"grow",children:[u.jsx(qe,{children:"服务器IP"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Host",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"port",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"SSH端口"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Port",...c,type:"number"})}),u.jsx(Ze,{})]})})]}),u.jsx(tt,{control:i.control,name:"username",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"用户名"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入用户名",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"password",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入密码",...c,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"key",render:({field:c})=>u.jsxs(Ke,{hidden:!0,children:[u.jsx(qe,{children:"Key(使用证书登录)"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Key",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"keyFile",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"Key(使用证书登录)"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Key",...c,type:"file",onChange:l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"certPath",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"证书上传路径"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入证书上传路径",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"keyPath",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"私钥上传路径"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入私钥上传路径",...c})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"command",render:({field:c})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"Command"}),u.jsx(Xe,{children:u.jsx(iT,{placeholder:"请输入要执行的命令",...c})}),u.jsx(Ze,{})]})}),u.jsx(Ze,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})},Z6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ya(),s=Fe.object({id:Fe.string().optional(),name:Fe.string().min(1).max(64),configType:Mf,url:Fe.string().url()});let o={url:""};e&&(o=e.config);const i=Qo({resolver:Jo(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:o.url}}),a=async l=>{console.log(l);const c={id:l.id,name:l.name,configType:l.configType,config:{url:l.url}};try{const f=await xf(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,p])=>{i.setError(h,{type:"manual",message:p.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...i,children:u.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(tt,{control:i.control,name:"name",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"名称"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入授权名称",...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"id",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(Ke,{className:"hidden",children:[u.jsx(qe,{children:"配置类型"}),u.jsx(Xe,{children:u.jsx(it,{...l})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:i.control,name:"url",render:({field:l})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"Webhook Url"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入Webhook Url",...l})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})})};function ol({trigger:e,op:t,data:r,className:n}){const[s,o]=y.useState(!1),i=Array.from(Oo.keys()),[a,l]=y.useState((r==null?void 0:r.configType)||"");let c=u.jsx(u.Fragment,{children:" "});switch(a){case"tencent":c=u.jsx(A6,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":c=u.jsx(M6,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":c=u.jsx(Y6,{data:r,onAfterReq:()=>{o(!1)}});break;case"webhook":c=u.jsx(Z6,{data:r,onAfterReq:()=>{o(!1)}})}const f=d=>d==a?"border-primary":"";return u.jsxs(P6,{onOpenChange:o,open:s,children:[u.jsx(j6,{asChild:!0,className:we(n),children:e}),u.jsxs(VE,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[u.jsx(WE,{children:u.jsxs(BE,{children:[t=="add"?"添加":"编辑","授权"]})}),u.jsxs("div",{className:"container",children:[u.jsx(Ed,{children:"服务商"}),u.jsx(sT,{value:a,className:"flex mt-3 space-x-2",onValueChange:d=>{console.log(d),l(d)},children:i.map(d=>{var h,p;return u.jsx("div",{className:"flex items-center space-x-2",children:u.jsxs(Ed,{children:[u.jsx(oT,{value:d,hidden:!0}),u.jsxs("div",{className:we("flex items-center space-x-2 border p-2 rounded cursor-pointer",f(d)),children:[u.jsx("img",{src:(h=Oo.get(d))==null?void 0:h[1],className:"h-6"}),u.jsx("div",{children:(p=Oo.get(d))==null?void 0:p[0]})]})]})},d)})}),c]})]})]})}const G6=()=>{const{config:{accesses:e}}=ya(),[t,r]=y.useState(),n=po();y.useEffect(()=>{const p=new URLSearchParams(n.search).get("id");p&&(async()=>{const m=await E5(p);r(m)})()},[n.search]);const s=Fe.object({id:Fe.string().optional(),domain:Fe.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),access:Fe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:Fe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:Fe.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=Qo({resolver:Jo(s),defaultValues:{id:"",domain:"",access:"",targetAccess:"",targetType:""}});y.useEffect(()=>{t&&o.reset({id:t.id,domain:t.domain,access:t.access,targetAccess:t.targetAccess,targetType:t.targetType})},[t,o]);const[i,a]=y.useState(t?t.targetType:""),l=e.filter(h=>{if(i=="")return!0;const p=o.getValues().targetType.split("-");return h.configType===p[0]}),{toast:c}=Sf(),f=Ss(),d=async h=>{const p={id:h.id,crontab:"0 0 * * *",domain:h.domain,access:h.access,targetAccess:h.targetAccess,targetType:h.targetType};try{await tm(p);let w="域名编辑成功";p.id==""&&(w="域名添加成功"),c({title:"成功",description:w}),f("/")}catch(w){Object.entries(w.response.data).forEach(([x,g])=>{o.setError(x,{type:"manual",message:g.message})});return}};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(Cv,{}),u.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[t!=null&&t.id?"编辑":"新增","域名"]}),u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(ei,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(d),className:"space-y-8 dark:text-stone-200",children:[u.jsx(tt,{control:o.control,name:"domain",render:({field:h})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"域名"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"请输入域名",...h})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:o.control,name:"access",render:({field:h})=>u.jsxs(Ke,{children:[u.jsxs(qe,{className:"flex w-full justify-between",children:[u.jsx("div",{children:"DNS 服务商授权配置"}),u.jsx(ol,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(b0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Xe,{children:u.jsxs(Mh,{...h,value:h.value,onValueChange:p=>{o.setValue("access",p)},children:[u.jsx(Cu,{children:u.jsx(Lh,{placeholder:"请选择授权配置"})}),u.jsx(Eu,{children:u.jsxs(Ih,{children:[u.jsx(Tu,{children:"服务商授权配置"}),e.map(p=>{var w;return u.jsx(Ru,{value:p.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=Oo.get(p.configType))==null?void 0:w[1]}),u.jsx("div",{children:p.name})]})},p.id)})]})})]})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:o.control,name:"targetType",render:({field:h})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"部署服务类型"}),u.jsx(Xe,{children:u.jsxs(Mh,{...h,onValueChange:p=>{a(p),o.setValue("targetType",p)},children:[u.jsx(Cu,{children:u.jsx(Lh,{placeholder:"请选择部署服务类型"})}),u.jsx(Eu,{children:u.jsxs(Ih,{children:[u.jsx(Tu,{children:"部署服务类型"}),N6.map(p=>{var w,m;return u.jsx(Ru,{value:p,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=fm.get(p))==null?void 0:w[1]}),u.jsx("div",{children:(m=fm.get(p))==null?void 0:m[0]})]})},p)})]})})]})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:o.control,name:"targetAccess",render:({field:h})=>u.jsxs(Ke,{children:[u.jsxs(qe,{className:"w-full flex justify-between",children:[u.jsx("div",{children:"部署服务商授权配置"}),u.jsx(ol,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(b0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Xe,{children:u.jsxs(Mh,{...h,onValueChange:p=>{o.setValue("targetAccess",p)},children:[u.jsx(Cu,{children:u.jsx(Lh,{placeholder:"请选择授权配置"})}),u.jsx(Eu,{children:u.jsxs(Ih,{children:[u.jsx(Tu,{children:"服务商授权配置"}),l.map(p=>{var w;return u.jsx(Ru,{value:p.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=Oo.get(p.configType))==null?void 0:w[1]}),u.jsx("div",{children:p.name})]})},p.id)})]})})]})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"保存"})})]})})})]})})},K6=()=>{const{config:e,deleteAccess:t}=ya(),{accesses:r}=e,n=async s=>{const o=await q4(s);t(o.id)};return u.jsxs("div",{className:"",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),u.jsx(ol,{trigger:u.jsx(Et,{children:"添加授权"}),op:"add"})]}),r.length===0?u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(HP,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),u.jsx(ol,{trigger:u.jsx(Et,{children:"添加授权"}),op:"add",className:"mt-3"})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"名称"}),u.jsx("div",{className:"w-48",children:"服务商"}),u.jsx("div",{className:"w-52",children:"创建时间"}),u.jsx("div",{className:"w-52",children:"更新时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.map(s=>{var o,i;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:s.name}),u.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[u.jsx("img",{src:(o=Oo.get(s.configType))==null?void 0:o[1],className:"w-6"}),u.jsx("div",{children:(i=Oo.get(s.configType))==null?void 0:i[0]})]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",s.created&&Al(s.created)]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",s.updated&&Al(s.updated)]}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(ol,{trigger:u.jsx(Et,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:s}),u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(Et,{variant:"link",className:"p-0",onClick:()=>{n(s)},children:"删除"})]})]},s.id)})]})]})},q6=ec("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),aT=y.forwardRef(({className:e,variant:t,...r},n)=>u.jsx("div",{ref:n,role:"alert",className:we(q6({variant:t}),e),...r}));aT.displayName="Alert";const lT=y.forwardRef(({className:e,...t},r)=>u.jsx("h5",{ref:r,className:we("mb-1 font-medium leading-none tracking-tight",e),...t}));lT.displayName="AlertTitle";const cT=y.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:we("text-sm [&_p]:leading-relaxed",e),...t}));cT.displayName="AlertDescription";function X6(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var Lv="ScrollArea",[uT,PU]=Er(Lv),[Q6,en]=uT(Lv),dT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,l]=y.useState(null),[c,f]=y.useState(null),[d,h]=y.useState(null),[p,w]=y.useState(null),[m,x]=y.useState(null),[g,v]=y.useState(0),[_,C]=y.useState(0),[E,T]=y.useState(!1),[P,O]=y.useState(!1),j=Ue(t,q=>l(q)),L=tc(s);return u.jsx(Q6,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:d,onContentChange:h,scrollbarX:p,onScrollbarXChange:w,scrollbarXEnabled:E,onScrollbarXEnabledChange:T,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:P,onScrollbarYEnabledChange:O,onCornerWidthChange:v,onCornerHeightChange:C,children:u.jsx(De.div,{dir:L,...i,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});dT.displayName=Lv;var fT="ScrollAreaViewport",hT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=en(fT,r),a=y.useRef(null),l=Ue(t,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),u.jsx(De.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});hT.displayName=fT;var $n="ScrollAreaScrollbar",Fv=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return y.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?u.jsx(J6,{...n,ref:t,forceMount:r}):s.type==="scroll"?u.jsx(eU,{...n,ref:t,forceMount:r}):s.type==="auto"?u.jsx(pT,{...n,ref:t,forceMount:r}):s.type==="always"?u.jsx(zv,{...n,ref:t}):null});Fv.displayName=$n;var J6=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),[o,i]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},f=()=>{l=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),u.jsx(vr,{present:r||o,children:u.jsx(pT,{"data-state":o?"visible":"hidden",...n,ref:t})})}),eU=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),o=e.orientation==="horizontal",i=Lf(()=>l("SCROLL_END"),100),[a,l]=X6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,s.scrollHideDelay,l]),y.useEffect(()=>{const c=s.viewport,f=o?"scrollLeft":"scrollTop";if(c){let d=c[f];const h=()=>{const p=c[f];d!==p&&(l("SCROLL"),i()),d=p};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[s.viewport,o,l,i]),u.jsx(vr,{present:r||a!=="hidden",children:u.jsx(zv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:le(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:le(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),pT=y.forwardRef((e,t)=>{const r=en($n,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=y.useState(!1),a=e.orientation==="horizontal",l=Lf(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=en($n,e.__scopeScrollArea),o=y.useRef(null),i=y.useRef(0),[a,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=wT(a.viewport,a.content),f={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function d(h,p){return iU(h,i.current,a,p)}return r==="horizontal"?u.jsx(tU,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollLeft,p=xw(h,a,s.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=d(h,s.dir))}}):r==="vertical"?u.jsx(rU,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollTop,p=xw(h,a);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=d(h))}}):null}),tU=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Ue(t,l,o.onScrollbarXChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(gT,{"data-orientation":"horizontal",...s,ref:c,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":If(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(o.viewport){const h=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(h),_T(h,d)&&f.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Nd(i.paddingLeft),paddingEnd:Nd(i.paddingRight)}})}})}),rU=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Ue(t,l,o.onScrollbarYChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(gT,{"data-orientation":"vertical",...s,ref:c,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":If(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(o.viewport){const h=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(h),_T(h,d)&&f.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Nd(i.paddingTop),paddingEnd:Nd(i.paddingBottom)}})}})}),[nU,mT]=uT($n),gT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:f,onResize:d,...h}=e,p=en($n,r),[w,m]=y.useState(null),x=Ue(t,j=>m(j)),g=y.useRef(null),v=y.useRef(""),_=p.viewport,C=n.content-n.viewport,E=jt(f),T=jt(l),P=Lf(d,10);function O(j){if(g.current){const L=j.clientX-g.current.left,q=j.clientY-g.current.top;c({x:L,y:q})}}return y.useEffect(()=>{const j=L=>{const q=L.target;(w==null?void 0:w.contains(q))&&E(L,C)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[_,w,C,E]),y.useEffect(T,[n,T]),sa(w,P),sa(p.content,P),u.jsx(nU,{scope:r,scrollbar:w,hasThumb:s,onThumbChange:jt(o),onThumbPointerUp:jt(i),onThumbPositionChange:T,onThumbPointerDown:jt(a),children:u.jsx(De.div,{...h,ref:x,style:{position:"absolute",...h.style},onPointerDown:le(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),g.current=w.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),O(j))}),onPointerMove:le(e.onPointerMove,O),onPointerUp:le(e.onPointerUp,j=>{const L=j.target;L.hasPointerCapture(j.pointerId)&&L.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),g.current=null})})})}),Rd="ScrollAreaThumb",vT=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=mT(Rd,e.__scopeScrollArea);return u.jsx(vr,{present:r||s.hasThumb,children:u.jsx(sU,{ref:t,...n})})}),sU=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=en(Rd,r),i=mT(Rd,r),{onThumbPositionChange:a}=i,l=Ue(t,d=>i.onThumbChange(d)),c=y.useRef(),f=Lf(()=>{c.current&&(c.current(),c.current=void 0)},100);return y.useEffect(()=>{const d=o.viewport;if(d){const h=()=>{if(f(),!c.current){const p=aU(d,a);c.current=p,a()}};return a(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[o.viewport,f,a]),u.jsx(De.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:le(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),w=d.clientX-p.left,m=d.clientY-p.top;i.onThumbPointerDown({x:w,y:m})}),onPointerUp:le(e.onPointerUp,i.onThumbPointerUp)})});vT.displayName=Rd;var Uv="ScrollAreaCorner",yT=y.forwardRef((e,t)=>{const r=en(Uv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?u.jsx(oU,{...e,ref:t}):null});yT.displayName=Uv;var oU=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=en(Uv,r),[o,i]=y.useState(0),[a,l]=y.useState(0),c=!!(o&&a);return sa(s.scrollbarX,()=>{var d;const f=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(f),l(f)}),sa(s.scrollbarY,()=>{var d;const f=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(f),i(f)}),c?u.jsx(De.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Nd(e){return e?parseInt(e,10):0}function wT(e,t){const r=e/t;return isNaN(r)?0:r}function If(e){const t=wT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function iU(e,t,r,n="ltr"){const s=If(r),o=s/2,i=t||o,a=s-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,f=r.content-r.viewport,d=n==="ltr"?[0,f]:[f*-1,0];return xT([l,c],d)(e)}function xw(e,t,r="ltr"){const n=If(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-n,l=r==="ltr"?[0,i]:[i*-1,0],c=im(e,l);return xT([0,i],[0,a])(c)}function xT(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function _T(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,a=r.top!==o.top;(i||a)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Lf(e,t){const r=jt(e),n=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),y.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function sa(e,t){const r=jt(t);nr(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var bT=dT,lU=hT,cU=yT;const ST=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(bT,{ref:n,className:we("relative overflow-hidden",e),...r,children:[u.jsx(lU,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(kT,{}),u.jsx(cU,{})]}));ST.displayName=bT.displayName;const kT=y.forwardRef(({className:e,orientation:t="vertical",...r},n)=>u.jsx(Fv,{ref:n,orientation:t,className:we("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:u.jsx(vT,{className:"relative flex-1 rounded-full bg-border"})}));kT.displayName=Fv.displayName;const uU=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await Dt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},dU=()=>{const e=Ss(),[t,r]=y.useState(),[n]=FP(),s=n.get("domain");return y.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const a=await uU(i);r(a.items)})()},[s]),u.jsxs(ST,{className:"h-[80vh] overflow-hidden",children:[u.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"域名"}),u.jsx("div",{className:"w-24",children:"状态"}),u.jsx("div",{className:"w-56",children:"阶段"}),u.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,a;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),u.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:o.phase==="deploy"&&o.phaseSuccess?u.jsx(r1,{size:16,className:"text-green-700"}):u.jsx(n1,{size:16,className:"text-red-700"})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx(pk,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Al(o.deployedAt)}),u.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:u.jsxs(uS,{children:[u.jsx(dS,{asChild:!0,children:u.jsx(Et,{variant:"link",className:"p-0",children:"日志"})}),u.jsxs(qg,{className:"sm:max-w-5xl",children:[u.jsx(hS,{children:u.jsxs(pS,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),u.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&u.jsx(u.Fragment,{children:o.log.check.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.apply&&u.jsx(u.Fragment,{children:o.log.apply.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(c=>u.jsx("div",{className:"mt-1 text-green-600",children:c})),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.deploy&&u.jsx(u.Fragment,{children:o.log.deploy.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},o.id)})]}):u.jsx(u.Fragment,{children:u.jsxs(aT,{className:"max-w-[40em] mx-auto mt-20",children:[u.jsx(lT,{children:"暂无数据"}),u.jsxs(cT,{children:[u.jsxs("div",{className:"flex items-center mt-5",children:[u.jsx("div",{children:u.jsx(GP,{className:"text-yellow-400",size:36})}),u.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),u.jsx("div",{className:"mt-2 flex justify-end",children:u.jsx(Et,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},hm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",fU=Fe.object({username:Fe.string().email({message:"请输入正确的邮箱地址"}),password:Fe.string().min(10,{message:"密码至少10个字符"})}),hU=()=>{const e=Qo({resolver:Jo(fU),defaultValues:{username:"",password:""}}),t=async n=>{try{await Dt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=hm(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Ss();return u.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[u.jsx("div",{className:"flex justify-center mb-10",children:u.jsx("img",{src:"/vite.svg",className:"w-16"})}),u.jsx(ei,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[u.jsx(tt,{control:e.control,name:"username",render:({field:n})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"用户名"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"email",...n})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:e.control,name:"password",render:({field:n})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"shadcn",...n,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"登录"})})]})})]})},pU=()=>Dt().authStore.isValid&&Dt().authStore.isAdmin?u.jsx(Q_,{to:"/"}):u.jsx("div",{className:"container",children:u.jsx(hg,{})}),mU=Fe.object({oldPassword:Fe.string().min(10,{message:"密码至少10个字符"}),newPassword:Fe.string().min(10,{message:"密码至少10个字符"}),confirmPassword:Fe.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),gU=()=>{const{toast:e}=Sf(),t=Ss(),r=Qo({resolver:Jo(mU),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await Dt().admins.authWithPassword((o=Dt().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(a){const l=hm(a);r.setError("oldPassword",{message:l})}try{await Dt().admins.update((i=Dt().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),Dt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=hm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return u.jsx(u.Fragment,{children:u.jsx(ei,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[u.jsx(tt,{control:r.control,name:"oldPassword",render:({field:s})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"当前密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"当前密码",...s,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:r.control,name:"newPassword",render:({field:s})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"新密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"newPassword",...s,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx(tt,{control:r.control,name:"confirmPassword",render:({field:s})=>u.jsxs(Ke,{children:[u.jsx(qe,{children:"确认密码"}),u.jsx(Xe,{children:u.jsx(it,{placeholder:"confirmPassword",...s,type:"password"})}),u.jsx(Ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(Et,{type:"submit",children:"确认修改"})})]})})})},vU=()=>u.jsxs("div",{children:[u.jsx(Cv,{}),u.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"设置密码"}),u.jsx("div",{className:"w-full sm:w-[35em] mt-10 flex flex-col p-3 mx-auto",children:u.jsx(hg,{})})]}),yU=SP([{path:"/",element:u.jsx(i3,{}),children:[{path:"/",element:u.jsx(P5,{})},{path:"/edit",element:u.jsx(G6,{})},{path:"/access",element:u.jsx(K6,{})},{path:"/history",element:u.jsx(dU,{})},{path:"/setting",element:u.jsx(vU,{}),children:[{path:"/setting/password",element:u.jsx(gU,{})}]}]},{path:"/login",element:u.jsx(pU,{}),children:[{path:"/login",element:u.jsx(hU,{})}]},{path:"/about",element:u.jsx("div",{children:"About"})}]);Fh.createRoot(document.getElementById("root")).render(u.jsx(Qe.StrictMode,{children:u.jsx(e3,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:u.jsx(DP,{router:yU})})}))});export default wU(); diff --git a/ui/dist/index.html b/ui/dist/index.html index 6c7d9b22..52480915 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -5,7 +5,7 @@ Certimate - Your Trusted SSL Automation Partner - + diff --git a/ui/src/pages/DashboardLayout.tsx b/ui/src/pages/DashboardLayout.tsx index e3cf64aa..9c561858 100644 --- a/ui/src/pages/DashboardLayout.tsx +++ b/ui/src/pages/DashboardLayout.tsx @@ -22,6 +22,7 @@ import { cn } from "@/lib/utils"; import { ConfigProvider } from "@/providers/config"; import { getPb } from "@/repository/api"; import { ThemeToggle } from "@/components/ThemeToggle"; +import { Separator } from "@/components/ui/separator"; export default function Dashboard() { const navigate = useNavigate(); @@ -184,12 +185,16 @@ export default function Dashboard() {