@oss-autopilot/core 3.33.0 → 3.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-pre-action.js +20 -20
- package/dist/cli-registry.js +21 -22
- package/dist/cli.bundle.cjs +99 -98
- package/dist/commands/check-integration.d.ts +2 -2
- package/dist/commands/comments.js +3 -3
- package/dist/commands/compliance-score.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/daily-render.js +6 -13
- package/dist/commands/daily.d.ts +1 -2
- package/dist/commands/daily.js +3 -3
- package/dist/commands/dashboard-cache.js +1 -1
- package/dist/commands/dashboard-data.js +5 -6
- package/dist/commands/dashboard-lifecycle.js +3 -5
- package/dist/commands/dashboard-server.js +3 -3
- package/dist/commands/detect-formatters.d.ts +1 -1
- package/dist/commands/dismiss.js +2 -2
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/features.js +1 -1
- package/dist/commands/guidelines.js +5 -5
- package/dist/commands/init.js +1 -1
- package/dist/commands/local-repos.d.ts +1 -1
- package/dist/commands/overnight.js +13 -18
- package/dist/commands/parse-list.d.ts +2 -2
- package/dist/commands/parse-list.js +7 -7
- package/dist/commands/repo-vet.js +3 -3
- package/dist/commands/search.js +9 -10
- package/dist/commands/setup.js +8 -8
- package/dist/commands/startup.js +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/vet-list.js +1 -1
- package/dist/commands/vet.js +1 -1
- package/dist/core/__fixtures__/prompt-injection-payloads.js +1 -1
- package/dist/core/anti-llm-policy.js +3 -3
- package/dist/core/checklist-analysis.d.ts +3 -0
- package/dist/core/checklist-analysis.js +67 -16
- package/dist/core/ci-analysis.js +1 -1
- package/dist/core/comment-decision.js +1 -1
- package/dist/core/compliance-score.js +2 -2
- package/dist/core/daily-logic.js +1 -2
- package/dist/core/display-utils.js +1 -1
- package/dist/core/errors.js +4 -5
- package/dist/core/follow-up-history.d.ts +1 -2
- package/dist/core/follow-up-history.js +1 -1
- package/dist/core/github-stats.js +1 -1
- package/dist/core/guidelines-store.js +2 -2
- package/dist/core/http-cache.js +1 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/issue-conversation.js +1 -1
- package/dist/core/issue-effort.js +12 -6
- package/dist/core/paths.d.ts +7 -0
- package/dist/core/paths.js +25 -3
- package/dist/core/pr-comments-fetcher.js +1 -1
- package/dist/core/review-analysis.js +5 -9
- package/dist/core/state-persistence.js +1 -1
- package/dist/core/state.js +2 -2
- package/dist/core/strategy.js +2 -3
- package/dist/core/untrusted-content.js +9 -9
- package/dist/core/urls.js +1 -1
- package/dist/dashboard/assets/chart-panel-DPKNBUts.js +3 -0
- package/dist/dashboard/assets/{confetti.module-BYDB1iN2.js → confetti.module-D2UmBLOm.js} +1 -1
- package/dist/dashboard/assets/index-B25bZOYX.js +55 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/formatters/json.d.ts +2 -2
- package/dist/formatters/json.js +2 -2
- package/package.json +1 -1
- package/dist/dashboard/assets/chart-panel-CmNIsCjO.js +0 -3
- package/dist/dashboard/assets/index-CTKGc-Ns.js +0 -55
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function x(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return S(t,s,i,a,null)}function S(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function C(e){return e.children}function w(e,t){this.props=e,this.context=t}function T(e,t){if(t==null)return e.__?T(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?T(e):null}function E(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=y({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),se(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??T(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,le(i,o,a),n.__e=n.__=null,o.__e!=r&&D(o)}}function D(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),D(e)}function ee(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!O.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(O)}function O(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,E(e)}finally{r.length=O.__r=0}}function te(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y=r&&r.__k||g,b=t.length;for(c=ne(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&y[p.__i]||h,p.__i=d,v=se(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&fe(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),4&p.__u?(c=re(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function ne(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=S(null,o,null,null,null):v(o)?o=e.__k[a]=S(C,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=S(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=ie(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=T(s)),pe(s,s));return r}function re(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=re(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=T(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ie(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ae(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||_.test(t)?n:n+`px`}function k(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ae(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ae(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function oe(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function se(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,x,S,E,D,ee,O,ne,re,ie,ae,k=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof k==`function`){f=s.length;try{if(E=n.props,D=k.prototype&&k.prototype.render,ee=(d=k.contextType)&&i[d.__c],O=d?ee?ee.props.value:d.__:i,r.__c?S=(p=n.__c=r.__c).__=p.__E:(D?n.__c=p=new k(E,O):(n.__c=p=new w(E,O),p.constructor=k,p.render=me),ee&&ee.sub(p),p.state||(p.state={}),p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),D&&p.__s==null&&(p.__s=p.state),D&&k.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,k.getDerivedStateFromProps(E,p.__s))),h=p.props,_=p.state,p.__v=n,m)D&&k.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),D&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(D&&k.getDerivedStateFromProps==null&&E!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(E,O),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(E,p.__s,O)){n.__v!=r.__v&&(p.props=E,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),g.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=T(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(E,p.__s,O),D&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,_,x)})}if(p.context=O,p.props=E,p.__P=e,p.__e=!1,ne=t.__r,re=0,D)p.state=p.__s,p.__d=!1,ne&&ne(n),d=p.render(p.props,p.state,p.context),g.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,ne&&ne(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++re<25);p.state=p.__s,p.getChildContext!=null&&(i=y(y({},i),p.getChildContext())),D&&!m&&p.getSnapshotBeforeUpdate!=null&&(x=p.getSnapshotBeforeUpdate(h,_)),ie=d!=null&&d.type===C&&d.key==null?ue(d.props.children):d,c=te(e,v(ie)?ie:[ie],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),S&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(ae=o.length;ae--;)b(o[ae])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||ce(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=de(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function ce(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ce))}function le(e,n,r){for(var i=0;i<r.length;i++)fe(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function ue(e){return typeof e!=`object`||!e||e.__b>0?e:v(e)?e.map(ue):e.constructor===void 0?y({},e):null}function de(n,r,i,a,o,s,c,l,u){var d,f,p,m,g,_,y,x=i.props||h,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||k(n,d,null,g,o);for(d in S)g=S[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?_=g:d==`checked`?y=g:l&&typeof g!=`function`||x[d]===g||k(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),te(r.type==`template`?n.content:n,v(m)?m:[m],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&T(i,0),l,u),s!=null)for(d=s.length;d--;)b(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&_==null?n.removeAttribute(`value`):_!=null&&(_!==n[d]||C==`progress`&&!_||C==`option`&&_!=x[d])&&k(n,d,_,x[d],o),d=`checked`,y!=null&&y!=n[d]&&k(n,d,y,x[d],o))}return n}function fe(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function pe(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||fe(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&pe(i[a],n,r||typeof e.type!=`function`);r||b(e.__e),e.__c=e.__=e.__e=void 0}function me(e,t,n){return this.constructor(e,n)}function he(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],se(r,n=(!a&&i||r).__k=x(C,null,[n]),o||h,h,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),le(s,n,c),n.props.children=null}function ge(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,ee(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+m++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}e=g.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,w.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=y({},this.state);typeof e==`function`&&(e=e(y({},n),this.props)),e&&y(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ee(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ee(this))},w.prototype.render=C,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=oe(!1),p=oe(!0),m=0;var _e,A,ve,ye,be=0,xe=[],j=t,Se=j.__b,Ce=j.__r,we=j.diffed,Te=j.__c,Ee=j.unmount,De=j.__;function Oe(e,t){j.__h&&j.__h(A,e,be||t),be=0;var n=A.__H||(A.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function M(e){return be=1,ke(Be,e)}function ke(e,t,n){var r=Oe(_e++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Be(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=A,!A.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};A.__f=!0;var a=A.shouldComponentUpdate,o=A.componentWillUpdate;A.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},A.shouldComponentUpdate=i}return r.__N||r.__}function N(e,t){var n=Oe(_e++,3);!j.__s&&ze(n.__H,t)&&(n.__=e,n.u=t,A.__H.__h.push(n))}function Ae(e,t){var n=Oe(_e++,4);!j.__s&&ze(n.__H,t)&&(n.__=e,n.u=t,A.__h.push(n))}function je(e){return be=5,Me(function(){return{current:e}},[])}function Me(e,t){var n=Oe(_e++,7);return ze(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function P(e,t){return be=8,Me(function(){return e},t)}function Ne(e){var t=A.context[e.__c],n=Oe(_e++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(A)),t.props.value):e.__}function Pe(){for(var e;e=xe.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Le),t.__h.some(Re),t.__h=[]}catch(n){t.__h=[],j.__e(n,e.__v)}}}j.__b=function(e){A=null,Se&&Se(e)},j.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),De&&De(e,t)},j.__r=function(e){Ce&&Ce(e),_e=0;var t=(A=e.__c).__H;t&&(ve===A?(t.__h=[],A.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Le),t.__h.some(Re),t.__h=[],_e=0)),ve=A},j.diffed=function(e){we&&we(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(xe.push(t)!==1&&ye===j.requestAnimationFrame||((ye=j.requestAnimationFrame)||Ie)(Pe)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),ve=A=null},j.__c=function(e,t){t.some(function(e){try{e.__h.some(Le),e.__h=e.__h.filter(function(e){return!e.__||Re(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],j.__e(n,e.__v)}}),Te&&Te(e,t)},j.unmount=function(e){Ee&&Ee(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Le(e)}catch(e){t=e}}),n.__H=void 0,t&&j.__e(t,n.__v))};var Fe=typeof requestAnimationFrame==`function`;function Ie(e){var t,n=function(){clearTimeout(r),Fe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Fe&&(t=requestAnimationFrame(n))}function Le(e){var t=A,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),A=t}function Re(e){var t=A;e.__c=e.__(),A=t}function ze(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Be(e,t){return typeof t==`function`?t(e):t}var Ve,He;function Ue(e){return!He||(typeof He==`string`?e.startsWith(He):He.test(e))}function We(e,t){let n=``;if(Ve=void 0,t&&t.type===`click`){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0)return e;let r=t.composedPath().find(e=>e.nodeName==`A`&&e.href),i=r&&r.getAttribute(`href`);if(!r||r.origin!=location.origin||/^#/.test(i)||!/^(_?self)?$/i.test(r.target)||!Ue(i)||r.download)return e;Ve=!0,t.preventDefault(),n=r.href.replace(location.origin,``)}else t&&t.url?(Ve=!t.replace,n=t.url):n=location.pathname+location.search;return Ve===!0?history.pushState(null,``,n):Ve===!1&&history.replaceState(null,``,n),n}function Ge(e){let[t,n]=ke(We,e.url||location.pathname+location.search);e.scope&&(He=e.scope);let r=Ve===!0,i=Me(()=>{let e=new URL(t,location.origin),i=e.pathname.replace(/\/+$/g,``)||`/`;return{url:t,path:i,query:Object.fromEntries(e.searchParams),route:(e,t)=>n({url:e,replace:t}),back:()=>{history.back()},forward:()=>{history.forward()},wasPush:r}},[t]);return Ae(()=>(addEventListener(`click`,n),addEventListener(`popstate`,n),()=>{removeEventListener(`click`,n),removeEventListener(`popstate`,n)}),[]),x(Ge.ctx.Provider,{value:i},e.children)}Promise.resolve(),Ge.ctx=ge({}),ge({});var Ke=()=>Ne(Ge.ctx),qe=`modulepreload`,Je=function(e){return`/`+e},Ye={},Xe=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Je(t,n),t=s(t),t in Ye)return;Ye[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:qe,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function Ze(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Qe(e,t=`|`){return e.map(e=>St(e)).join(t)}function $e(e,t){return typeof t==`bigint`?t.toString():t}var et=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function tt(e){return new et(e)}function nt(e){return e==null}function rt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function it(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function at(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ot(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function st(e){return ot(e._zod.def)??e._zod.def.shape}function ct(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return at(this,t,e),e},enumerable:!0,configurable:!0})}function lt(e,t,n){t in e?at(e,t,n):e[t]=n}function ut(e,t,n,r){let i=st(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ct(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):lt(e,a,r?r(n.value,a):n.value))}}function dt(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ct(e,n,()=>t[n]):lt(e,n,r.value))}}function F(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ft(e){return JSON.stringify(e)}function pt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var mt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ht(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var gt=tt(()=>{if(z.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _t(e){if(ht(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ht(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function vt(e){return _t(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var yt=new Set([`string`,`number`,`symbol`]);function bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function xt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function I(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function St(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ct(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var wt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Tt={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Et(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return ut(i,e,Dt(e,t)),xt(e,F(n,{shape:i,checks:[]}))}function Dt(e,t){let n=st(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Ot(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Dt(e,t)),a={};return ut(a,e,Reflect.ownKeys(st(e)).filter(e=>!i.has(e))),xt(e,F(n,{shape:a,checks:[]}))}function kt(e,t){if(!_t(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=st(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return xt(e,F(e._zod.def,{shape:At(e,t)}))}function At(e,t){let n={};return ut(n,e,Reflect.ownKeys(st(e))),dt(n,t),n}function jt(e,t){if(!_t(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return xt(e,F(e._zod.def,{shape:At(e,t)}))}function Mt(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return ut(n,e,Reflect.ownKeys(st(e))),ut(n,t,Reflect.ownKeys(st(t))),xt(e,F(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Nt(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Dt(t,n)):void 0,o={};return ut(o,t,Reflect.ownKeys(st(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),xt(t,F(t._zod.def,{shape:o,checks:[]}))}function Pt(e,t,n){let r=n?new Set(Dt(t,n)):void 0,i={};return ut(i,t,Reflect.ownKeys(st(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),xt(t,F(t._zod.def,{shape:i}))}function Ft(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function It(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Lt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Rt(e){return typeof e==`string`?e:e?.message}function zt(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Bt(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Vt(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Rt(e.inst?._zod.def?.error?.(e))??Rt(a?.(e))??Rt(t?.error?.(e))??Rt(n.customError?.(e))??Rt(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Ht=/[\uD800-\uDBFF]/;function Ut(e){let t=e.length;if(!Ht.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Wt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Gt(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Kt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function qt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Zt(e,n,r.value)}}function Jt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Yt(e,t,n){return Jt(e,t,n,!1)}function Xt(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Jt(this,n,r(this))},set(e){Jt(this,n,e)}})}return t}function Zt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Jt(this,t,n.bind(this))},set(e){Jt(this,t,e)}})}function Qt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var $t,en=!1,tn={configurable:!0,get(){en=!0}};function L(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&$t!==e._zod){$t=void 0;return}$t=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,tn);let e=en;en=!1;try{let r=n(this);return en?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),en||=e,r}catch(n){throw delete this[t],en||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function nn(e,t,n,r){let i=Qt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var rn=`~constantCatch`;function an(e){let t=()=>e;return t[rn]=!0,t}var on,sn={value:void 0,enumerable:!1},cn=`captureStackTrace`in Error?Error:null;function ln(e){let t=cn;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return cn=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function R(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){sn.value=new a(r);try{Object.defineProperty(n,"_zod",sn)}finally{sn.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),qt(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?ln(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var un=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},dn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(on=globalThis).__zod_globalConfig??(on.__zod_globalConfig={});var z=globalThis.__zod_globalConfig;function fn(e){return e&&Object.assign(z,e),z}function pn(){let e=this._zod;return e.message??=JSON.stringify(e.def,$e,2),e.message}function mn(e){this._zod.message=e}var hn={get:pn,set:mn,enumerable:!0,configurable:!0},gn={value:void 0,enumerable:!1},_n=new WeakSet([Object.prototype,Error.prototype]),vn=(e,t)=>{e.name=`$ZodError`,gn.value=t,Object.defineProperty(e,"issues",gn),gn.value=void 0,Object.defineProperty(e,"message",hn);let n=Object.getPrototypeOf(e);_n.has(n)||(_n.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},yn=R(`$ZodError`,vn);R(`$ZodError`,vn,void 0,{Parent:Error});function bn(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function xn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?bn(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Sn(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Cn(e,t){return{callee:t?.callee??e,Err:t?.Err}}var wn=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new un;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Vt(e,o,fn())));throw mt(n,a?.callee??t),n}return s.value};return t},Tn=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Vt(e,o,fn())));throw mt(n,a?.callee??t),n}return s.value};return t},En=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new un;return a.issues.length?Dn(e,a.issues,i):{success:!0,data:a.value}};function Dn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Vt(e,n,fn()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var On=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Dn(e,a.issues,i):{success:!0,data:a.value}},kn=Symbol.for(`zod.compile.invalid`),An=Symbol.for(`zod.compile.fallback`),jn=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==kn)return!0;if(r.definite===!0&&n===void 0)return!1}return Mn(e,t,n)});function Mn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[An]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new un;return a.issues.length===0}var Nn=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Pn=e=>{let t=wn(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Cn(n,a))};return n},Fn=e=>{let t=wn(e),n=(e,r,i,a)=>t(e,r,i,Cn(n,a));return n},In=e=>{let t=Tn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Cn(n,a))};return n},Ln=e=>{let t=Tn(e),n=async(e,r,i,a)=>await t(e,r,i,Cn(n,a));return n},Rn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return En(e)(t,n,i)},zn=e=>(t,n,r)=>En(e)(t,n,r),Bn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return On(e)(t,n,i)},Vn=e=>async(t,n,r)=>On(e)(t,n,r),Hn=/^[cC][0-9a-z]{6,}$/,Un=/^[0-9a-z]+$/,Wn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Gn=/^[0-9a-vA-V]{20}$/,Kn=/^[A-Za-z0-9]{27}$/,qn=/^[a-zA-Z0-9_-]{21}$/;function Jn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Yn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$n=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function er(){return new RegExp($n,`u`)}var tr=/^(?:(?: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])$/,nr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rr=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,ir=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ar=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,or=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,sr=/^https?$/,cr=/^\+[1-9]\d{6,14}$/,lr=`(?:(?:\\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])))`;function ur(e){return RegExp(`^${e}$`)}var dr=ur(lr);function fr(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pr(e){return RegExp(`^${fr(e)}$`)}function mr(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${fr({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${fr({precision:e.precision})}`:n;return RegExp(`^${lr}T(?:${r})$`)}var hr=/^[\s\S]{0,}$/,gr=/^-?\d+$/,_r=/^-?\d+(?:\.\d+)?$/,vr=/^(?:true|false)$/i,yr=/^[^A-Z]*$/,br=/^[^a-z]*$/,B=R(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),xr=e=>{let t=e.value;return!nt(t)&&t.length!==void 0},Sr={number:`number`,bigint:`bigint`,object:`date`},Cr=R(`$ZodCheckLessThan`,(e,t)=>{B.init(e,t);let n=Sr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Sr[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wr=R(`$ZodCheckGreaterThan`,(e,t)=>{B.init(e,t);let n=Sr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Sr[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tr=R(`$ZodCheckMultipleOf`,(e,t)=>{B.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):it(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Er=R(`$ZodCheckNumberFormat`,(e,t)=>{B.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=wt[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Dr=R(`$ZodCheckMaxLength`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=xr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ut(r):i)<=t.maximum)return;let a=Wt(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Or=R(`$ZodCheckMinLength`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=xr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ut(r):i)>=t.minimum)return;let a=Wt(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kr=R(`$ZodCheckLengthEquals`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=xr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ut(r):i;if(a===t.length)return;let o=Wt(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ar=R(`$ZodCheckStringFormat`,(e,t)=>{var n,r;B.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jr=R(`$ZodCheckRegex`,(e,t)=>{Ar.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mr=R(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=yr,Ar.init(e,t)}),Nr=R(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=br,Ar.init(e,t)}),Pr=R(`$ZodCheckIncludes`,(e,t)=>{B.init(e,t);let n=bt(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Fr=R(`$ZodCheckStartsWith`,(e,t)=>{B.init(e,t);let n=RegExp(`^${bt(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ir=R(`$ZodCheckEndsWith`,(e,t)=>{B.init(e,t);let n=RegExp(`.*${bt(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Lr=R(`$ZodCheckOverwrite`,(e,t)=>{B.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Rr=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
-
`)}\n};`)(...Object.values(this.closed))}},zr={major:4,minor:6,patch:7},V=R(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zr;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Ft(t),a;for(let o of n){if(o._zod.def.when){if(It(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new un;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Bt(t.issues,n,e),i||=Ft(t,n))});else{if(t.issues.length===n)continue;Bt(t.issues,n,e),i||=Ft(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Ft(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new un;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new un;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Yt(this,`~standard`,Hr(this))},set"~standard"(e){Jt(this,`~standard`,e)}}),Br=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Vt(e,t,fn()))}:{value:e.value};async function Vr(e,t){let n={async:!0};return Br(await e._zod.run({value:t,issues:[]},n),n)}function Hr(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Br(r,n)}catch{}return Vr(e,t)},vendor:`zod`,version:1}}var Ur=R(`$ZodString`,(e,t)=>{V.init(e,t),e._zod.pattern=t.pattern??hr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),H=R(`$ZodStringFormat`,(e,t)=>{Ar.init(e,t),Ur.init(e,t)}),Wr=R(`$ZodGUID`,(e,t)=>{t.pattern??=Xn,H.init(e,t)}),Gr=R(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Zn(e)}else t.pattern??=Zn();H.init(e,t)}),Kr=R(`$ZodEmail`,(e,t)=>{t.pattern??=Qn,H.init(e,t)});function qr(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Jr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?qr(e)||2:Yr(e,t)}function Yr(e,t){if(!t.normalize&&t.protocol?.source===sr.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Xr=/[\t\n\r]/g;function Zr(e){return e.replace(Xr,``)}function Qr(e,t){return t.lastIndex=0,t.test(e.hostname)}function $r(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var ei=R(`$ZodURL`,(e,t)=>{H.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Jr(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Zr(r);return}t.hostname&&!Qr(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!$r(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Zr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ti=R(`$ZodEmoji`,(e,t)=>{t.pattern??=er(),H.init(e,t)}),ni=R(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?qn:Jn(t.length),H.init(e,t)}),ri=R(`$ZodCUID`,(e,t)=>{t.pattern??=Hn,H.init(e,t)}),ii=R(`$ZodCUID2`,(e,t)=>{t.pattern??=Un,H.init(e,t)}),ai=R(`$ZodULID`,(e,t)=>{t.pattern??=Wn,H.init(e,t)}),oi=R(`$ZodXID`,(e,t)=>{t.pattern??=Gn,H.init(e,t)}),si=R(`$ZodKSUID`,(e,t)=>{t.pattern??=Kn,H.init(e,t)}),ci=R(`$ZodISODateTime`,(e,t)=>{t.pattern??=mr(t),H.init(e,t)}),li=R(`$ZodISODate`,(e,t)=>{t.pattern??=dr,H.init(e,t)}),ui=R(`$ZodISOTime`,(e,t)=>{t.pattern??=pr(t),H.init(e,t)}),di=R(`$ZodISODuration`,(e,t)=>{t.pattern??=Yn,H.init(e,t)}),fi=R(`$ZodIPv4`,(e,t)=>{t.pattern??=tr,H.init(e,t)}),pi=/^[0-9a-fA-F:.]+$/;function mi(e){return pi.test(e)?qr(`http://[${e}]`):!1}var hi=R(`$ZodIPv6`,(e,t)=>{t.pattern??=nr,H.init(e,t),e._zod.check=n=>{mi(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),gi=R(`$ZodCIDRv4`,(e,t)=>{t.pattern??=rr,H.init(e,t)});function _i(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:mi(n)}var vi=R(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ir,H.init(e,t),e._zod.check=n=>{_i(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function yi(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var bi=/^[0-9a-zA-Z+/]*={0,2}$/,xi=R(`$ZodBase64`,(e,t)=>{t.pattern??=bi,H.init(e,t),e._zod.check=n=>{yi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Si=/^[A-Za-z0-9_-]*$/;function Ci(e){if(!Si.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return yi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var wi=R(`$ZodBase64URL`,(e,t)=>{t.pattern??=Si,H.init(e,t),e._zod.check=n=>{Ci(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ti=R(`$ZodE164`,(e,t)=>{t.pattern??=cr,H.init(e,t)});function Ei(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Di=R(`$ZodJWT`,(e,t)=>{H.init(e,t),e._zod.check=n=>{Ei(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Oi=R(`$ZodNumber`,(e,t)=>{V.init(e,t),e._zod.pattern=_r,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),ki=R(`$ZodNumberFormat`,(e,t)=>{Er.init(e,t),Oi.init(e,t)}),Ai=R(`$ZodBoolean`,(e,t)=>{V.init(e,t),e._zod.pattern=vr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ji=R(`$ZodUnknown`,(e,t)=>{V.init(e,t),e._zod.parse=e=>e}),Mi=R(`$ZodNever`,(e,t)=>{V.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ni(e,t){let n=zt(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of zt(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Bt(n.issues,t,e),n}}return i(n,a)}}var Pi=e=>Array.isArray(e)?e.length:-1;function Fi(e,t,n){e.issues.length&&t.issues.push(...Lt(n,e.issues)),t.value[n]=e.value}var Ii=R(`$ZodArray`,(e,t)=>{V.init(e,t);let n=z.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Fi(t,r,e)));else if(Fi(c,r,e),s&&c.issues.length!==0&&Ft(c))break}return o.length?Promise.all(o).then(()=>r):r},Ni(e,Pi)});function Li(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Lt(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Ri=[];function zi(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Ri,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ct(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Bi(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Ft(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Li(e,n,i,t,d,f))):Li(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Vi=R(`$ZodObject`,(e,t)=>{V.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=tt(()=>zi(t));L(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||at(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ht,o=t.catchall,s,c=z.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Ft(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Li(n,t,e,r,a,o))):Li(s,t,e,r,a,o)}return o?Bi(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Hi=R(`$ZodObjectJIT`,(e,t)=>{Vi.init(e,t);let n=e._zod.parse,r=tt(()=>zi(t)),i=z.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Rr([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
-
let ${e}_ab = false;
|
|
5
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
-
const iss = ${e}.issues[i];
|
|
7
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
-
payload.issues.push(iss);
|
|
9
|
-
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
-
}
|
|
11
|
-
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
-
payload.value = newResult;
|
|
13
|
-
return payload;
|
|
14
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ft(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
15
|
-
const ${n}_present = ${i};
|
|
16
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (${e}) {
|
|
21
|
-
newResult[${r}] = ${n}.value;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
`)}else f?(o.write(`
|
|
26
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
-
}
|
|
28
|
-
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
-
if (${n}.value !== undefined || ${i}) {
|
|
30
|
-
newResult[${r}] = ${n}.value;
|
|
31
|
-
}
|
|
32
|
-
`)):o.write(`
|
|
33
|
-
const ${n}_present = ${i};
|
|
34
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
-
}
|
|
36
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
-
payload.issues.push({
|
|
38
|
-
code: "invalid_type",
|
|
39
|
-
expected: "nonoptional",
|
|
40
|
-
input: undefined,
|
|
41
|
-
path: [${r}]
|
|
42
|
-
});
|
|
43
|
-
if (ctx && ctx.abortEarly) {
|
|
44
|
-
payload.value = newResult;
|
|
45
|
-
return payload;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (${n}_present) {
|
|
50
|
-
newResult[${r}] = ${n}.value;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ht,c=!z.jitless,l=c&>.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Bi([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Ui(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ft(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Vt(e,r,fn())))}),t)}var Wi=R(`$ZodUnion`,(e,t)=>{V.init(e,t),L(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),L(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),L(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),L(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>rt(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Ui(t,r,e,i)):Ui(o,r,e,i)}}),Gi=R(`$ZodIntersection`,(e,t)=>{V.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>qi(e,t,n)):qi(e,i,a)}});function Ki(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_t(e)&&_t(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ki(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ki(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qi(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ki(t.value,n.value);if(!c.valid){if(Ft(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ji=R(`$ZodRecord`,(e,t)=>{V.init(e,t);let n=z.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!_t(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Vt(e,i,fn())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Lt(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Lt(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&_r.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Vt(e,i,fn())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Lt(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Lt(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Yi=R(`$ZodEnum`,(e,t)=>{V.init(e,t);let n=Ze(t.entries),r=new Set(n);e._zod.values=r,L(e,`pattern`,e=>{let t=Ze(e.def.entries).filter(e=>yt.has(typeof e));return RegExp(t.length?`^(${t.map(e=>bt(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Xi=R(`$ZodTransform`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,z.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new dn(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new un;return n.value=i,n}});function Zi(e,t){return e.value=t.issues.length?void 0:t.value,e}var Qi=R(`$ZodOptional`,(e,t)=>{V.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${rt(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Zi(e,t)):Zi(e,r)}return t.innerType._zod.run(e,n)}}),$i=R(`$ZodExactOptional`,(e,t)=>{Qi.init(e,t),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ea=R(`$ZodNullable`,(e,t)=>{V.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${rt(t.source)}|null)$`):void 0}),L(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ta=R(`$ZodDefault`,(e,t)=>{V.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>na(e,t)):na(r,t)}});function na(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ra=R(`$ZodPrefault`,(e,t)=>{V.init(e,t),e._zod.optin=`defaulted`,L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ia=R(`$ZodNonOptional`,(e,t)=>{V.init(e,t),L(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>aa(t,e)):aa(i,e)}});function aa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function oa(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Vt(e,r,fn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var sa=R(`$ZodCatch`,(e,t)=>{V.init(e,t),L(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),L(e,`optout`,e=>e.def.innerType._zod.optout),L(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>oa(e,r,t,n)):oa(e,r,t,n)}}),ca=R(`$ZodPipe`,(e,t)=>{V.init(e,t),L(e,`values`,e=>e.def.in._zod.values),L(e,`optin`,e=>e.def.in._zod.optin),L(e,`optout`,e=>e.def.out._zod.optout),L(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>la(e,t.in,n)):la(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>la(e,t.out,n)):la(r,t.out,n)}});function la(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ua=R(`$ZodReadonly`,(e,t)=>{V.init(e,t),L(e,`propValues`,e=>e.def.innerType._zod.propValues),L(e,`values`,e=>e.def.innerType._zod.values),L(e,`optin`,e=>e.def.innerType?._zod?.optin),L(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(da):da(r)}});function da(e){return e.memo||(e.value=Object.freeze(e.value)),e}var fa=R(`$ZodCustom`,(e,t)=>{B.init(e,t),V.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>pa(t,n,r,e));pa(i,n,r,e)}});function pa(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Kt(e))}}var ma=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},ha=`~memo`,ga=[];function _a(e){return typeof e==`object`&&!!e}function va(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ya=new WeakMap,ba=0,xa=1,Sa=2;function Ca(e,t,n){let r=ya.get(e);if(r!==void 0)return r?Sa:ba;if(t.has(e))return Sa;t.add(e);let i=ba,a=e=>{if(i!==Sa&&e?._zod){let r=Ca(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=ba;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?xa:o.value?._zod?Ca(o.value,t,n):ba;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=ot(c);s(e?o(e,!0):xa),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ca(r,t,!1):xa);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),wa(e,i)}function wa(e,t){return t!==xa&&ya.set(e,t===Sa),t}function Ta(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Ea,Da=[],Oa={alloc(e,t,n){let r=Ea;if(!r)return n;Ea=void 0;let i={value:n,issues:null};return r.set(t.value,i),Da.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Aa(n,e.value))throw new ma;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ca(e,new Set,!1);if(i===ba)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Sa||r?n=!0:r=!0}let l=s.value;if(!_a(l))return t(s,c);let u=c[ha];u||(u={buckets:new WeakMap,backEdges:void 0},c[ha]=u);let d;i===c?d=a:(d=Ta(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...va(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Ea=d;let p=Da.length,m=t(s,c);Ea=void 0;let h=Da.length>p?Da.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?va(e.issues):ga),e)):(h&&(h.issues=m.issues.length?va(m.issues):ga),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ka(){return Oa}function Aa(e,t){let n=e[ha]?.backEdges;return n!==void 0&&_a(t)&&n.has(t)}var ja=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Gt(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${St(e.values[0])}`:`Invalid option: expected one of ${Qe(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Qe(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ma(){return{localeError:ja()}}var Na,Pa=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Fa(){return new Pa}(Na=globalThis).__zod_globalRegistry??(Na.__zod_globalRegistry=Fa());var Ia=globalThis.__zod_globalRegistry;function La(e){return e.checks&&=[...e.checks],e}function Ra(e,t){return new e(La({type:`string`,...I(t)}))}function za(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function Ba(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function Va(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function Ha(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function Ua(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function Wa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function Ga(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function Ka(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function qa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function Ja(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function Ya(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function Xa(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function Za(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function Qa(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function $a(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function eo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function to(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function no(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function ro(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function io(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function ao(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function oo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function so(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function co(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function lo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function uo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function fo(e,t){return new e(La({type:`number`,checks:[],...I(t)}))}function po(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...I(t)})}function mo(e,t){return new e({type:`boolean`,...I(t)})}function ho(e){return new e({type:`unknown`})}function go(e,t){return new e({type:`never`,...I(t)})}function _o(e,t){return new Cr({check:`less_than`,...I(t),value:e,inclusive:!1})}function vo(e,t){return new Cr({check:`less_than`,...I(t),value:e,inclusive:!0})}function yo(e,t){return new wr({check:`greater_than`,...I(t),value:e,inclusive:!1})}function bo(e,t){return new wr({check:`greater_than`,...I(t),value:e,inclusive:!0})}function xo(e,t){return new Tr({check:`multiple_of`,...I(t),value:e})}function So(e,t){return new Dr({check:`max_length`,...I(t),maximum:e})}function Co(e,t){return new Or({check:`min_length`,...I(t),minimum:e})}function wo(e,t){return new kr({check:`length_equals`,...I(t),length:e})}function To(e,t){return new jr({check:`string_format`,format:`regex`,...I(t),pattern:e})}function Eo(e){return new Mr({check:`string_format`,format:`lowercase`,...I(e)})}function Do(e){return new Nr({check:`string_format`,format:`uppercase`,...I(e)})}function Oo(e,t){return new Pr({check:`string_format`,format:`includes`,...I(t),includes:e})}function ko(e,t){return new Fr({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function Ao(e,t){return new Ir({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function jo(e){return new Lr({check:`overwrite`,tx:e})}function Mo(e){return jo(t=>t.normalize(e))}function No(){return jo(e=>e.trim())}function Po(){return jo(e=>e.toLowerCase())}function Fo(){return jo(e=>e.toUpperCase())}function Io(){return jo(e=>pt(e))}function Lo(e,t,n){return new e({type:`array`,element:t,...I(n)})}function Ro(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function zo(e,t){let n=Bo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Kt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Kt(r))}},e(t.value,t)),t);return n}function Bo(e,t){let n=new B({check:`custom`,...I(t)});return n._zod.check=e,n}function Vo(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&at(e,t,n[t]);return e}function Ho(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ia,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Uo(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function U(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,U(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Vo(o.schema,c),t.io===`input`&&W(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Wo(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Go(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Wo(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Wo(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
|
-
|
|
55
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ko(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ko(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var qo=new Set([`type`,`properties`,`required`,`additionalProperties`]),Jo=[`oneOf`,`anyOf`];function Yo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Xo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!qo.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Yo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}at(n,r,e.length===1?e[0]:Xo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Yo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Zo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of qo)if(t in e)return;let n=t.filter(e=>Jo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Xo(t);else{let e=n[0],i=Jo.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Xo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Vo(e,r))}function Qo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Vo(i,s),Vo(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ko(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Zo(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Vo(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,at(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:es(t,`input`,e.processors),output:es(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}var $o=(e,t={})=>n=>{let r=Ho({...n,processors:t});return U(e,r),Go(r,e),Qo(r,e)},es=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ho({...i??{},target:a,io:t,processors:n});return U(e,o),Go(o,e),Qo(o,e)},ts=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ns=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},rs=(e,t)=>{ts(e,`minimum`,t),ns(e,`maximum`,t)},is=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},as=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},os=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},ss=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},cs=(e,t)=>ts(e,`minimum`,t.minimum),ls=(e,t)=>ns(e,`maximum`,t.maximum),us=e=>(t,n)=>{ss(t,n.format);let[r,i]=e[n.format];ts(t,`minimum`,r),ns(t,`maximum`,i)},ds={greater_than:(e,t)=>ts(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ns(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>is(e,t.value),number_format:us(wt),bigint_format:us(Tt),min_length:cs,max_length:ls,length_equals:(e,t)=>rs(e,t.length),min_size:cs,max_size:ls,size_equals:(e,t)=>rs(e,t.size),string_format:(e,t)=>{ss(e,t.format),t.pattern&&as(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>os(e,t.mime)};function G(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ds[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ts(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ts(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ns(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ns(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&is(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&os(t,i.mime);for(let e of i.patterns??[])as(t,e);return t}var fs={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ps=new Map([[bi,ar],[Si,or]]),ms=e=>ps.get(e)??e,hs=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=G(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=fs[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(ms);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},gs=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=G(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Uo(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},_s=(e,t,n,r)=>{n.type=`boolean`},vs=(e,t,n,r)=>{n.not={}},ys=(e,t,n,r)=>{let i=e._zod.def,a=Ze(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bs=(e,t,n,r)=>{Uo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},xs=(e,t,n,r)=>{Uo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ss=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=G(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=U(a.element,t,{...r,path:[...r.path,`items`]})};function Cs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Cs(t.out):t.type===`catch`?Cs(t.innerType):e._zod.optin}var ws=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Uo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)at(i.properties,e,U(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Cs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ts=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Es=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Ds(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Ds(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Ds(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?_r:gr).source),p):p}var Os=new WeakMap;function ks(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Os.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ds(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var As=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=G(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=U(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)at(i.patternProperties,ms(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Os.get(t);n||(n=[],Os.set(t,n),t.deferred.push(()=>ks(t))),n.push(e)}i.additionalProperties=U(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Cs(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},js=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ms=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ns=Symbol();function Ps(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Uo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ns):JSON.parse(o)}var Fs=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ps(i.defaultValue,e,t,n,r);o!==Ns&&(n.default=o)},Is=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ps(i.defaultValue,e,t,n,r);o!==Ns&&(n._prefault=o)},Ls=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Uo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Rs=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},zs=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Bs=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Vs=new WeakSet([Object.prototype,Error.prototype]);function Hs(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var K=R(`ZodError`,(e,t)=>{yn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Vs.has(n)||(Vs.add(n),Hs(n,`format`,e=>t=>Sn(e,t)),Hs(n,`flatten`,e=>t=>xn(e,t)),Hs(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,$e,2)}),Hs(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,$e,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Us=wn(K),Ws=Tn(K),Gs=En(K),Ks=On(K),qs=Pn(K),Js=Fn(K),Ys=In(K),Xs=Ln(K),Zs=Rn(K),Qs=zn(K),$s=Bn(K),ec=Vn(K);function tc(){z.localeError||fn(Ma())}function nc(){z.memoizer||fn({memoizer:ka()})}var q=R(`ZodType`,(e,t)=>(tc(),V.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(F(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return xt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ml(e,t))},superRefine(e,t){return this.check(hl(e,t))},overwrite(e){return this.check(jo(e))},optional(){return Xc(this)},exactOptional(){return Qc(this)},nullable(){return el(this)},nullish(){return Xc(el(this))},nonoptional(e){return ol(this,e)},array(){return Q(this)},or(e){return Bc([this,e])},and(e){return Hc(this,e)},transform(e){return ul(this,Jc(e))},default(e){return nl(this,e)},prefault(e){return il(this,e)},catch(e){return cl(this,e)},pipe(e){return ul(this,e)},readonly(){return fl(this)},describe(e){let t=this.clone();return Ia.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ia.get(this);let t=this.clone();return Ia.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Yt(this,`~standard`,{...Hr(this),jsonSchema:{input:es(this,`input`),output:es(this,`output`)}})},set"~standard"(e){Jt(this,`~standard`,e)},parse:function e(t,n){return Us(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ws(this,t,n,{callee:e})},safeParse(e,t){return Gs(this,e,t)},async safeParseAsync(e,t){return Ks(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Jt(this,`spa`,e)},validate(e,t){return jn(this,e,t)},validateAsync(e,t){return Nn(this,e,t)},encode:function e(t,n){return qs(this,t,n,{callee:e})},decode:function e(t,n){return Js(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ys(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Xs(this,t,n,{callee:e})},safeEncode(e,t){return Zs(this,e,t)},safeDecode(e,t){return Qs(this,e,t)},async safeEncodeAsync(e,t){return $s(this,e,t)},async safeDecodeAsync(e,t){return ec(this,e,t)},toJSONSchema(e){return $o(this,{})(e)},get description(){return Ia.get(this)?.description},get _def(){return this._zod.def}}),rc=R(`_ZodString`,(e,t)=>{Ur.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r)},Xt({format:e=>G(e).format??null,minLength:e=>G(e).minimum??null,maxLength:e=>G(e).maximum??null},{regex(...e){return this.check(To(...e))},includes(...e){return this.check(Oo(...e))},startsWith(...e){return this.check(ko(...e))},endsWith(...e){return this.check(Ao(...e))},min(...e){return this.check(Co(...e))},max(...e){return this.check(So(...e))},length(...e){return this.check(wo(...e))},nonempty(...e){return this.check(Co(1,...e))},lowercase(e){return this.check(Eo(e))},uppercase(e){return this.check(Do(e))},trim(){return this.check(No())},normalize(...e){return this.check(Mo(...e))},toLowerCase(){return this.check(Po())},toUpperCase(){return this.check(Fo())},slugify(){return this.check(Io())}})),ic=R(`ZodString`,(e,t)=>{Ur.init(e,t),rc.init(e,t)},{email(e){return this.check(za(lc,e))},url(e){return this.check(Ga(fc,e))},jwt(e){return this.check(oo(Dc,e))},emoji(e){return this.check(Ka(pc,e))},guid(e){return this.check(Ba(uc,e))},uuid(e){return this.check(Va(dc,e))},uuidv4(e){return this.check(Ha(dc,e))},uuidv6(e){return this.check(Ua(dc,e))},uuidv7(e){return this.check(Wa(dc,e))},nanoid(e){return this.check(qa(mc,e))},cuid(e){return this.check(Ja(hc,e))},cuid2(e){return this.check(Ya(gc,e))},ulid(e){return this.check(Xa(_c,e))},base64(e){return this.check(ro(wc,e))},base64url(e){return this.check(io(Tc,e))},xid(e){return this.check(Za(vc,e))},ksuid(e){return this.check(Qa(yc,e))},ipv4(e){return this.check($a(bc,e))},ipv6(e){return this.check(eo(xc,e))},cidrv4(e){return this.check(to(Sc,e))},cidrv6(e){return this.check(no(Cc,e))},e164(e){return this.check(ao(Ec,e))},datetime(e){return this.check(so(ac,e))},date(e){return this.check(co(oc,e))},time(e){return this.check(lo(sc,e))},duration(e){return this.check(uo(cc,e))}});function J(e){return Ra(ic,e)}var Y=R(`ZodStringFormat`,(e,t)=>{H.init(e,t),rc.init(e,t)}),ac=R(`ZodISODateTime`,(e,t)=>{ci.init(e,t),Y.init(e,t)}),oc=R(`ZodISODate`,(e,t)=>{li.init(e,t),Y.init(e,t)}),sc=R(`ZodISOTime`,(e,t)=>{ui.init(e,t),Y.init(e,t)}),cc=R(`ZodISODuration`,(e,t)=>{di.init(e,t),Y.init(e,t)}),lc=R(`ZodEmail`,(e,t)=>{Kr.init(e,t),Y.init(e,t)}),uc=R(`ZodGUID`,(e,t)=>{Wr.init(e,t),Y.init(e,t)}),dc=R(`ZodUUID`,(e,t)=>{Gr.init(e,t),Y.init(e,t)}),fc=R(`ZodURL`,(e,t)=>{ei.init(e,t),Y.init(e,t)}),pc=R(`ZodEmoji`,(e,t)=>{ti.init(e,t),Y.init(e,t)}),mc=R(`ZodNanoID`,(e,t)=>{ni.init(e,t),Y.init(e,t)}),hc=R(`ZodCUID`,(e,t)=>{ri.init(e,t),Y.init(e,t)}),gc=R(`ZodCUID2`,(e,t)=>{ii.init(e,t),Y.init(e,t)}),_c=R(`ZodULID`,(e,t)=>{ai.init(e,t),Y.init(e,t)}),vc=R(`ZodXID`,(e,t)=>{oi.init(e,t),Y.init(e,t)}),yc=R(`ZodKSUID`,(e,t)=>{si.init(e,t),Y.init(e,t)}),bc=R(`ZodIPv4`,(e,t)=>{fi.init(e,t),Y.init(e,t)}),xc=R(`ZodIPv6`,(e,t)=>{hi.init(e,t),Y.init(e,t)}),Sc=R(`ZodCIDRv4`,(e,t)=>{gi.init(e,t),Y.init(e,t)}),Cc=R(`ZodCIDRv6`,(e,t)=>{vi.init(e,t),Y.init(e,t)}),wc=R(`ZodBase64`,(e,t)=>{xi.init(e,t),Y.init(e,t)}),Tc=R(`ZodBase64URL`,(e,t)=>{wi.init(e,t),Y.init(e,t)}),Ec=R(`ZodE164`,(e,t)=>{Ti.init(e,t),Y.init(e,t)}),Dc=R(`ZodJWT`,(e,t)=>{Di.init(e,t),Y.init(e,t)}),Oc=R(`ZodNumber`,(e,t)=>{Oi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r),e.isFinite=!0},Xt({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=G(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=G(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=G(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>G(e).format??null},{gt(e,t){return this.check(yo(e,t))},gte(e,t){return this.check(bo(e,t))},min(e,t){return this.check(bo(e,t))},lt(e,t){return this.check(_o(e,t))},lte(e,t){return this.check(vo(e,t))},max(e,t){return this.check(vo(e,t))},int(e){return this.check(Ac(e))},safe(e){return this.check(Ac(e))},positive(e){return this.check(yo(0,e))},nonnegative(e){return this.check(bo(0,e))},negative(e){return this.check(_o(0,e))},nonpositive(e){return this.check(vo(0,e))},multipleOf(e,t){return this.check(xo(e,t))},step(e,t){return this.check(xo(e,t))},finite(){return this}}));function X(e){return fo(Oc,e)}var kc=R(`ZodNumberFormat`,(e,t)=>{ki.init(e,t),Oc.init(e,t)});function Ac(e){return po(kc,e)}var jc=R(`ZodBoolean`,(e,t)=>{Ai.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r)});function Mc(e){return mo(jc,e)}var Nc=R(`ZodUnknown`,(e,t)=>{ji.init(e,t),q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Z(){return ho(Nc)}var Pc=R(`ZodNever`,(e,t)=>{Mi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r)});function Fc(e){return go(Pc,e)}var Ic=R(`ZodArray`,(e,t)=>{nc(),Ii.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Co(e,t))},nonempty(e){return this.check(Co(1,e))},max(e,t){return this.check(So(e,t))},length(e,t){return this.check(wo(e,t))},unwrap(){return this.element}});function Q(e,t){return Lo(Ic,e,t)}var Lc=R(`ZodObject`,(e,t)=>{nc(),Hi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),nn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Kc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(F(this._zod.def,{catchall:e}))},passthrough(){return this.clone(F(this._zod.def,{catchall:Z()}))},loose(){return this.clone(F(this._zod.def,{catchall:Z()}))},strict(){return this.clone(F(this._zod.def,{catchall:Fc()}))},strip(){return this.clone(F(this._zod.def,{catchall:void 0}))},extend(e){return kt(this,e)},safeExtend(e){return jt(this,e)},merge(e){return Mt(this,e)},pick(e){return Et(this,e)},omit(e){return Ot(this,e)},partial(...e){return Nt(Yc,this,e[0])},exactPartial(...e){return Nt(Zc,this,e[0],`exactPartial`)},required(...e){return Pt(al,this,e[0])}});function Rc(e,t){return new Lc({type:`object`,shape:e??{},...I(t)})}var zc=R(`ZodUnion`,(e,t)=>{Wi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ts(e,t,n,r),e.options=t.options});function Bc(e,t){return new zc({type:`union`,options:e,...I(t)})}var Vc=R(`ZodIntersection`,(e,t)=>{Gi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Es(e,t,n,r)});function Hc(e,t){return new Vc({type:`intersection`,left:e,right:t})}var Uc=R(`ZodRecord`,(e,t)=>{nc(),Ji.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Wc(e,t,n){return!t||!t._zod?new Uc({type:`record`,keyType:J(),valueType:e,...I(t)}):new Uc({type:`record`,keyType:e,valueType:t,...I(n)})}var Gc=R(`ZodEnum`,(e,t)=>{Yi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Gc({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Gc({...t,checks:[],...I(r),entries:i})}});function Kc(e,t){return new Gc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}var qc=R(`ZodTransform`,(e,t)=>{nc(),Xi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new dn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Kt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Kt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Jc(e){return new qc({type:`transform`,transform:e})}var Yc=R(`ZodOptional`,(e,t)=>{Qi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xc(e){return new Yc({type:`optional`,innerType:e})}var Zc=R(`ZodExactOptional`,(e,t)=>{$i.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qc(e){return new Zc({type:`optional`,innerType:e})}var $c=R(`ZodNullable`,(e,t)=>{ea.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function el(e){return new $c({type:`nullable`,innerType:e})}var tl=R(`ZodDefault`,(e,t)=>{ta.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function nl(e,t){return new tl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():vt(t)}})}var rl=R(`ZodPrefault`,(e,t)=>{ra.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function il(e,t){return new rl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():vt(t)}})}var al=R(`ZodNonOptional`,(e,t)=>{ia.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ol(e,t){return new al({type:`nonoptional`,innerType:e,...I(t)})}var sl=R(`ZodCatch`,(e,t)=>{sa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cl(e,t){return new sl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:an(t)})}var ll=R(`ZodPipe`,(e,t)=>{ca.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.in=t.in,e.out=t.out});function ul(e,t){return new ll({type:`pipe`,in:e,out:t})}var dl=R(`ZodReadonly`,(e,t)=>{ua.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fl(e){return new dl({type:`readonly`,innerType:e})}var pl=R(`ZodCustom`,(e,t)=>{fa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r)});function ml(e,t={}){return Ro(pl,e,t)}function hl(e,t){return zo(e,t)}var gl=Rc({activePRs:X(),shelvedPRs:X(),mergedPRs:X(),closedPRs:X(),mergeRate:J(),availableIssues:X().optional()}),_l=Rc({active:X(),merged:X(),closed:X()}),vl=Rc({repo:J(),active:X(),merged:X(),closed:X()}),yl=Rc({stats:gl,prsByRepo:Wc(J(),_l),topRepos:Q(vl),monthlyMerged:Wc(J(),X()),monthlyOpened:Wc(J(),X()),monthlyClosed:Wc(J(),X()),activePRs:Q(Z()),shelvedPRUrls:Q(J()),recentlyMergedPRs:Q(Z()),recentlyClosedPRs:Q(Z()),autoUnshelvedPRs:Q(Z()),commentedIssues:Q(Z()),issueResponses:Q(Z()),allMergedPRs:Q(Z()),allClosedPRs:Q(Z()),repoMetadata:Wc(J(),Z()).optional(),vettedIssues:Z().nullable().optional(),offline:Mc().optional(),lastUpdated:J().optional(),partialFailures:Q(J()).optional()});function bl(e){let t=yl.safeParse(e);return t.success?{ok:!0,data:t.data}:{ok:!1,message:`Server response did not match expected shape — ${t.error.issues.slice(0,3).map(e=>`${e.path.join(`.`)||`<root>`}: ${e.message}`).join(`; `)}${t.error.issues.length>3?` (+${t.error.issues.length-3} more)`:``}`}}var xl=15e3,Sl=Symbol(`csrf-rejected`),Cl=class extends Error{kind=Sl;constructor(e){super(e)}},wl=Symbol(`conflict`),Tl=class extends Error{kind=wl;constructor(e){super(e)}};async function El(e,t){let n=await fetch(e,t);if(!n.ok){let e=(await n.json().catch(()=>null))?.error||`HTTP ${n.status}`;throw n.status===403&&typeof e==`string`&&/csrf token/i.test(e)?new Cl(e):n.status===409?new Tl(typeof e==`string`?e:`HTTP ${n.status}`):Error(e)}let r=n.headers.get(`X-CSRF-Token`),i=n.headers.get(`X-Dashboard-Stale`)===`1`,a=n.headers.get(`X-Dashboard-Stale-Reason`),o=await n.json(),s=bl(o);if(!s.ok)throw console.error(`[dashboard] /api/data schema validation failed:`,s.message,o),Error(s.message);return{data:s.data,csrfToken:r,stale:i,staleReason:a}}function Dl(){let[e,t]=M(null),[n,r]=M(!0),[i,a]=M(!1),[o,s]=M(null),[c,l]=M(null),[u,d]=M(!1),[f,p]=M(null),[m,h]=M(0),g=je(null),_=P(e=>{e.csrfToken&&(g.current=e.csrfToken),t(e.data),d(e.stale),p(e.staleReason),h(0)},[]),v=P(e=>{let t={method:`POST`},n={};return e!==void 0&&(n[`Content-Type`]=`application/json`,t.body=e),g.current&&(n[`X-CSRF-Token`]=g.current),Object.keys(n).length>0&&(t.headers=n),t},[]),y=P(async(e,t)=>{try{return await El(e,v(t))}catch(n){if(!(n instanceof Cl)&&!(n instanceof Tl))throw n;try{let e=await El(`/api/data`);e.csrfToken&&(g.current=e.csrfToken)}catch{throw n}return El(e,v(t))}},[v]),b=P(async e=>{try{r(!0),_(await e()),l(Date.now()),s(null)}catch(e){s(e instanceof Error?e.message:String(e))}finally{r(!1)}},[_]),x=P(()=>b(()=>El(`/api/data`)),[b]),S=P(()=>b(()=>y(`/api/refresh`)),[b,y]),C=P(async()=>{try{a(!0),_(await y(`/api/refresh`)),l(Date.now()),s(null)}catch(e){console.warn(`Auto-refresh failed:`,e instanceof Error?e.message:String(e)),h(e=>e+1)}finally{a(!1)}},[_,y]),w=P(async e=>{try{let t=await y(`/api/action`,JSON.stringify(e));_(t),s(null)}catch(e){try{_(await El(`/api/data`))}catch(e){console.error(`Failed to re-fetch dashboard data after action error:`,e)}throw e}},[_,y]);return N(()=>{x();let e=setTimeout(()=>{C()},5e3);return()=>clearTimeout(e)},[x,C]),N(()=>{if(m<1||m>=2)return;let e=setTimeout(()=>{C()},xl);return()=>clearTimeout(e)},[m,C]),{data:e,loading:n,refreshing:i,error:o,clearError:P(()=>s(null),[]),refresh:S,performAction:w,lastUpdated:c,stale:u,staleReason:f,autoRefreshFailures:m}}var Ol=`oss-autopilot-theme`;function kl(){try{let e=localStorage.getItem(Ol);if(e===`light`||e===`dark`)return e}catch(e){console.warn(`[useTheme] localStorage unavailable, falling back to OS preference:`,e)}return typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function Al(e){document.documentElement.setAttribute(`data-theme`,e)}function jl(){let[e,t]=M(kl);return N(()=>{Al(e)},[e]),N(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: light)`),n=e=>{try{if(localStorage.getItem(Ol))return}catch(e){console.warn(`[useTheme] Could not read localStorage to check for user override:`,e);return}t(e.matches?`light`:`dark`)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),{theme:e,toggleTheme:P(()=>{t(e=>{let t=e===`dark`?`light`:`dark`;try{localStorage.setItem(Ol,t)}catch(e){console.warn(`[useTheme] Failed to persist theme preference:`,e)}return t})},[])}}var Ml=null,Nl=null;function Pl(){return Ml?Promise.resolve(Ml):Nl||(Nl=Xe(()=>import(`./confetti.module-BYDB1iN2.js`).then(e=>(Ml=e.default,Ml)),[]).catch(e=>(console.warn(`[useCelebration] canvas-confetti import failed, skipping animation:`,e),null)),Nl)}var Fl=`oss-autopilot-merged-count`;function Il(){try{let e=localStorage.getItem(Fl);if(e===null)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:null}catch(e){if(e instanceof DOMException)return console.warn(`[useCelebration] localStorage unavailable (key=${Fl}):`,e),null;throw e}}function Ll(e){try{localStorage.setItem(Fl,String(e))}catch(t){if(t instanceof DOMException){console.warn(`[useCelebration] Failed to persist merged count (value=${e}):`,t);return}throw t}}function Rl(e){let t={startVelocity:30,spread:360,ticks:60,zIndex:9999},n=Date.now()+800;function r(){try{for(let n of[0,.7])e({...t,particleCount:50,origin:{x:n+Math.random()*.3,y:Math.random()-.2}})}catch(e){console.warn(`[useCelebration] confetti failed, aborting animation:`,e);return}Date.now()<n&&requestAnimationFrame(r)}r()}function zl(){typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0||Pl().then(e=>{e&&Rl(e)}).catch(()=>{})}function Bl(e){let[t,n]=M(null);return N(()=>{if(e===void 0)return;let t=Il();if(t===null||e<=t){t!==e&&Ll(e);return}let r=e-t;Ll(e),zl();let i=r===1?`1 new PR merged. Great work!`:`${r} new PRs merged. Great work!`;n({message:i,shownAt:Date.now()})},[e]),{celebration:t,dismiss:P(()=>n(null),[]),trigger:P((e=3)=>{zl();let t=Number.isFinite(e)&&e>0?Math.floor(e):3,r=t===1?`1 new PR merged. Great work!`:`${t} new PRs merged. Great work!`;n({message:r,shownAt:Date.now()})},[])}}function Vl(e,t){let n=t?.duration??800,[r,i]=M(0),a=je(0);a.current=r;let o=je(0),s=je(0),c=je(0);return N(()=>{if(typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0){i(e);return}if(e===0){i(0);return}c.current=a.current,s.current=0;let t=r=>{s.current||=r;let a=r-s.current,l=Math.min(a/n,1),u=1-(1-l)**3,d=Math.round(c.current+(e-c.current)*u);i(d),l<1&&(o.current=requestAnimationFrame(t))};return o.current=requestAnimationFrame(t),()=>{o.current&&cancelAnimationFrame(o.current)}},[e,n]),r}var Hl=0;Array.isArray;function $(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Hl,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}function Ul({value:e}){let t=typeof e==`string`?e.match(/^(\d+)([^\d.].*)?$/):null,n=Vl(typeof e==`number`?e:t?parseInt(t[1]??`0`,10):0);return typeof e==`number`?$(C,{children:n}):t?$(C,{children:[n,t[2]??``]}):$(C,{children:e})}function Wl({stats:e,needAttentionCount:t,stuckCICount:n=0,dormantFollowupCount:r=0,waitingCount:i,onNeedAttentionClick:a,onStuckCIClick:o,onDormantFollowupClick:s,onWaitingClick:c,onShelvedClick:l,onMergedClick:u,onClosedClick:d,onIssuesClick:f}){let p=[{label:`Need Attention`,value:t,colorClass:`red`,onClick:a},...n>0?[{label:`Stuck CI`,value:n,colorClass:`amber`,onClick:o}]:[],...r>0?[{label:`Dormant Follow-up`,value:r,colorClass:`amber`,onClick:s}]:[],{label:`Waiting on Others`,value:i,colorClass:`blue`,onClick:c},{label:`Shelved`,value:e.shelvedPRs,colorClass:`muted`,onClick:l},{label:`Merged PRs`,value:e.mergedPRs,colorClass:`purple`,onClick:u},{label:`Closed PRs`,value:e.closedPRs,colorClass:`red`,onClick:d}];return e.availableIssues!==void 0&&p.push({label:`Vetted Issues`,value:e.availableIssues,colorClass:`teal`,onClick:f}),$(`div`,{class:`stats-bar`,children:p.map(e=>$(e.onClick?`button`:`div`,{class:`stat-card ${e.colorClass}${e.onClick?` stat-card--clickable`:``}`,onClick:e.onClick,...e.onClick?{type:`button`}:{},children:[$(`span`,{class:`stat-value`,children:$(Ul,{value:e.value})}),$(`span`,{class:`stat-label`,children:e.label})]},e.label))})}var Gl={needs_addressing:`Needs Addressing`,waiting_on_maintainer:`Waiting on Maintainer`};function Kl(e){return Gl[e]??e}function ql({filters:e,onFilterChange:t,repos:n,statuses:r,totalCount:i,filteredCount:a}){return $(`div`,{class:`filter-bar`,children:[$(`select`,{class:`filter-select`,"aria-label":`Filter by status`,value:e.status,onChange:n=>t({...e,status:n.target.value}),children:[$(`option`,{value:`all`,children:`All Statuses`}),r.map(e=>$(`option`,{value:e,children:Kl(e)},e))]}),$(`select`,{class:`filter-select`,"aria-label":`Filter by repository`,value:e.repo,onChange:n=>t({...e,repo:n.target.value}),children:[$(`option`,{value:`all`,children:`All Repos`}),n.map(e=>$(`option`,{value:e,children:e},e))]}),$(`input`,{class:`filter-input`,type:`text`,"aria-label":`Search PRs`,placeholder:`Search PRs...`,value:e.search,onInput:n=>t({...e,search:n.target.value})}),i!=null&&a!=null&&$(`span`,{class:`filter-count`,children:[`Showing `,a,` of `,i,` PRs`]})]})}function Jl(e){return e.replace(/^\[|\]$/g,``)}function Yl(e){switch(Jl(e).toLowerCase()){case`needs response`:case`needs changes`:case`ci failing`:case`merge conflict`:case`missing files`:case`needs addressing`:return`pill--red`;case`incomplete checklist`:case`ci not running`:case`needs rebase`:case`ci blocked`:case`stale ci failure`:return`pill--amber`;case`waiting on maintainer`:return`pill--blue`;default:return`pill--muted`}}function Xl(e,t){return e.length>t?e.slice(0,t)+`...`:e}function Zl(e){try{let t=new Date(e);return isNaN(t.getTime())?e:t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}catch{return e}}function Ql(e){return e.attentionBucket??(e.status===`needs_addressing`?`needs_attention`:`waiting`)}function $l(e){switch(e){case`needs_addressing`:return`var(--red)`;case`waiting_on_maintainer`:return`var(--blue)`;default:return`var(--text-muted)`}}function eu(e){switch(e){case`passing`:return`var(--green)`;case`failing`:return`var(--red)`;case`pending`:return`var(--amber)`;default:return`var(--text-muted)`}}function tu(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var nu={TypeScript:`#3178c6`,JavaScript:`#f1e05a`,Python:`#3572A5`,Rust:`#dea584`,Go:`#00ADD8`,Java:`#b07219`,"C#":`#178600`,C:`#555555`,"C++":`#f34b7d`,Ruby:`#701516`,PHP:`#4F5D95`,Swift:`#F05138`,Kotlin:`#A97BFF`,Dart:`#00B4AB`,Shell:`#89e051`,HTML:`#e34c26`,CSS:`#563d7c`,Scala:`#c22d40`,Elixir:`#6e4a7e`,Lua:`#000080`};function ru(e){return e?nu[e]??`var(--text-muted)`:`var(--text-muted)`}function iu(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`Updated just now`;let n=Math.floor(t/60);return n<60?`Updated ${n}m ago`:`Updated ${Math.floor(n/60)}h ago`}function au(e,t){return e?`Refreshing...`:t?`Updating...`:`Refresh`}var ou=[{bucket:`needs_attention`,id:`action`,title:`Need Attention`,dotClass:`red`},{bucket:`stuck_ci`,id:`stuck`,title:`Stuck CI`,dotClass:`amber`},{bucket:`dormant_followup`,id:`dormant`,title:`Dormant Follow-up`,dotClass:`amber`},{bucket:`waiting`,id:`waiting`,title:`Waiting on Others`,dotClass:`blue`}];function su(e){switch(e){case`needs_addressing`:return`pr-row--need-attention`;case`waiting_on_maintainer`:return`pr-row--waiting`;default:return``}}function cu({pr:e,selected:t,onSelect:n}){return $(`div`,{class:`pr-row ${su(e.status)} ${t?`pr-row--selected`:``}`,onClick:()=>n(e.url),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.url))},role:`button`,tabIndex:0,children:[$(`span`,{class:`pr-row-dot`,style:{background:$l(e.status)}}),$(`a`,{class:`pr-row-id`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:[e.repo,`#`,e.number]}),$(`span`,{class:`pr-row-title`,children:Xl(e.title,50)}),e.displayLabel&&$(`span`,{class:`pill ${Yl(e.displayLabel)}`,children:Jl(e.displayLabel)}),$(`span`,{class:`pr-row-age`,children:[e.daysSinceActivity,`d ago`]})]})}function lu({section:e,selectedUrl:t,onSelect:n}){return $(`div`,{class:`pr-section`,id:`section-${e.id}`,children:[$(`div`,{class:`pr-section-header`,children:[$(`span`,{class:`pr-section-dot ${e.dotClass}`}),$(`span`,{class:`pr-section-title`,children:e.title}),$(`span`,{class:`pr-section-count`,children:e.prs.length})]}),e.prs.map(e=>$(cu,{pr:e,selected:e.url===t,onSelect:n},e.url))]})}function uu({prs:e,selectedUrl:t,onSelect:n,shelvedUrls:r,shelvedOpen:i,onShelvedToggle:a}){let o=e.filter(e=>!r.has(e.url)),s=e.filter(e=>r.has(e.url)),c=ou.map(({bucket:e,id:t,title:n,dotClass:r})=>({id:t,title:n,dotClass:r,prs:o.filter(t=>Ql(t)===e)})).filter(e=>e.prs.length>0);return $(`div`,{class:`pr-list`,children:[c.length===0&&s.length===0&&$(`p`,{class:`pr-list-empty`,children:`No PRs to display`}),c.map(e=>$(lu,{section:e,selectedUrl:t,onSelect:n},e.id)),s.length>0&&$(`div`,{class:`pr-section pr-section--shelved`,id:`section-shelved`,children:[$(`div`,{class:`pr-section-header pr-section-header--collapsible`,onClick:a,"aria-expanded":i,"aria-controls":`shelved-pr-list`,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},children:[$(`span`,{class:`pr-section-dot muted`}),$(`span`,{class:`pr-section-title`,children:`Shelved`}),$(`span`,{class:`pr-section-count`,children:s.length}),$(`span`,{class:`pr-section-chevron ${i?`pr-section-chevron--open`:``}`,children:`▸`})]}),$(`div`,{id:`shelved-pr-list`,children:i&&s.map(e=>$(cu,{pr:e,selected:e.url===t,onSelect:n},e.url))})]})]})}function du({pr:e,isShelved:t,onAction:n}){let[r,i]=M(!1),[a,o]=M(null);async function s(e){i(!0),o(null);try{await n(e)}catch(e){o(e instanceof Error?e.message:`Action failed`)}finally{i(!1)}}let c=e.status===`needs_addressing`?`Move to Waiting`:`Move to Need Attention`,l=e.status===`needs_addressing`?`waiting`:`attention`;return $(`div`,{class:`action-bar`,children:[a&&$(`p`,{class:`action-error`,role:`alert`,children:a}),$(`button`,{class:`action-btn ${t?`action-btn--unshelve`:`action-btn--shelve`}`,disabled:r,onClick:()=>s({action:`move`,url:e.url,target:t?`auto`:`shelved`}),children:t?`Unshelve`:`Shelve`}),$(`button`,{class:`action-btn action-btn--override`,disabled:r,onClick:()=>s({action:`move`,url:e.url,target:l}),children:c})]})}function fu(e){switch(e){case`approved`:return`Approved`;case`changes_requested`:return`Changes Requested`;case`review_required`:return`Review Required`;default:return`Unknown`}}function pu(e){switch(e){case`approved`:return`var(--green)`;case`changes_requested`:return`var(--red)`;case`review_required`:return`var(--amber)`;default:return`var(--text-muted)`}}function mu(e){switch(e){case`passing`:return`green`;case`failing`:return`red`;case`pending`:return`amber`;default:return``}}function hu(e){switch(e){case`approved`:return`green`;case`changes_requested`:return`red`;case`review_required`:return`amber`;default:return``}}function gu(e){return e>=7?`red`:e>=3?`amber`:`green`}function _u(e){switch(e){case`actionable`:return`Actionable`;case`fork_limitation`:return`Fork Limitation`;case`auth_gate`:return`Auth Gate`;case`infrastructure`:return`Infrastructure`;default:return e}}function vu({pr:e,isShelved:t,onAction:n,onClose:r}){let i=mu(e.ciStatus),a=hu(e.reviewDecision);return $(`div`,{class:`pr-detail`,children:[$(`div`,{class:`pr-detail-header`,children:[$(`h2`,{class:`pr-detail-title`,children:e.title}),$(`button`,{class:`pr-detail-close`,onClick:r,"aria-label":`Close`,children:`×`})]}),$(`div`,{class:`pr-detail-meta`,children:[$(`span`,{class:`pill ${Yl(e.displayLabel)}`,children:Jl(e.displayLabel)}),$(`span`,{class:`pr-detail-description`,children:e.displayDescription})]}),$(`div`,{class:`pr-detail-links`,children:$(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]})}),$(`div`,{class:`pr-detail-fields`,children:[$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`CI Status`}),$(`span`,{class:`pr-detail-field-value`,children:[i&&$(`span`,{class:`dot ${i}`}),$(`span`,{style:{color:eu(e.ciStatus)},children:e.ciStatus.charAt(0).toUpperCase()+e.ciStatus.slice(1)})]})]}),e.classifiedChecks.length>0&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Failing Checks`}),$(`div`,{class:`pr-detail-checks`,children:e.classifiedChecks.map(e=>$(`div`,{class:`pr-detail-check`,children:[$(`span`,{class:`pr-detail-check-name`,children:e.name}),$(`span`,{class:`pr-detail-check-badge pr-detail-check-badge--${e.category}`,children:_u(e.category)})]},e.name))})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Review`}),$(`span`,{class:`pr-detail-field-value`,children:[a&&$(`span`,{class:`dot ${a}`}),$(`span`,{style:{color:pu(e.reviewDecision)},children:fu(e.reviewDecision)})]})]}),e.lastMaintainerComment&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Maintainer Comment`}),$(`div`,{class:`pr-detail-comment`,children:[$(`div`,{class:`pr-detail-comment-header`,children:[$(`div`,{class:`pr-detail-comment-avatar`}),$(`span`,{class:`pr-detail-comment-author`,children:[`@`,e.lastMaintainerComment.author]}),$(`span`,{class:`pr-detail-comment-date`,children:[`· `,Zl(e.lastMaintainerComment.createdAt)]})]}),$(`p`,{class:`pr-detail-comment-body`,children:Xl(e.lastMaintainerComment.body,200)})]})]}),e.hasIncompleteChecklist&&e.checklistStats&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Checklist`}),$(`span`,{class:`pr-detail-field-value`,style:{color:`var(--amber)`},children:[e.checklistStats.checked,`/`,e.checklistStats.total,` checked`]})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Days Since Activity`}),$(`span`,{class:`pr-detail-field-value`,children:[$(`span`,{class:`dot ${gu(e.daysSinceActivity)}`}),$(`span`,{children:[e.daysSinceActivity,` `,e.daysSinceActivity===1?`day`:`days`]})]})]}),e.hasMergeConflict&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Merge Conflict`}),$(`span`,{class:`pr-detail-field-value`,style:{color:`var(--red)`},children:`Yes`})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Created`}),$(`span`,{class:`pr-detail-field-value`,children:Zl(e.createdAt)})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Updated`}),$(`span`,{class:`pr-detail-field-value`,children:Zl(e.updatedAt)})]})]}),$(du,{pr:e,isShelved:t,onAction:n})]})}var yu=null,bu=null;function xu(){return yu?Promise.resolve(yu):bu||(bu=Xe(()=>import(`./chart-panel-CmNIsCjO.js`).then(e=>(yu=e.ChartPanel,yu)),[]),bu)}function Su(){return $(`div`,{class:`chart-panel`,"aria-busy":`true`,"aria-label":`Loading charts`,children:[$(`div`,{class:`chart-card`,children:[$(`h3`,{class:`chart-card-title`,children:`Monthly Activity`}),$(`div`,{class:`chart-canvas-wrapper`,style:{minHeight:240}})]}),$(`div`,{class:`chart-card`,children:[$(`h3`,{class:`chart-card-title`,children:`Top Repos`}),$(`div`,{class:`chart-canvas-wrapper`,style:{minHeight:240}})]})]})}function Cu(e){let[t,n]=M(()=>yu),[r,i]=M(null);return N(()=>{if(t)return;let e=!1;return xu().then(t=>{e||n(()=>t)}).catch(t=>{e||(i(t instanceof Error?t.message:String(t)),console.error(`[dashboard] failed to load chart-panel chunk:`,t))}),()=>{e=!0}},[t]),r?$(`div`,{class:`chart-panel`,role:`status`,children:$(`p`,{style:{margin:`1rem 0`,opacity:.8},children:[`Charts failed to load (`,r,`). The rest of the dashboard is unaffected.`]})}):t?$(t,{...e}):$(Su,{})}function wu({issues:e,onAction:t}){return e.length===0?null:$(`div`,{class:`issue-list`,children:[$(`h3`,{class:`issue-list-title`,children:`Issue Responses`}),$(`div`,{class:`issue-list-items`,children:e.map(e=>$(Tu,{issue:e,onAction:t},e.url))})]})}function Tu({issue:e,onAction:t}){let[n,r]=M(!1),[i,a]=M(null);async function o(){if(t){r(!0),a(null);try{await t({action:`dismiss_issue_response`,url:e.url})}catch(e){a(e instanceof Error?e.message:`Dismiss failed`)}finally{r(!1)}}}return $(`div`,{class:`issue-item`,children:[i&&$(`p`,{class:`action-error`,role:`alert`,children:i}),t&&$(`button`,{class:`issue-item-dismiss`,"aria-label":`Dismiss`,disabled:n,onClick:o,children:`×`}),$(`div`,{class:`issue-item-header`,children:[$(`a`,{class:`issue-item-id`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`span`,{class:`issue-item-badge ${e.isFromMaintainer?`issue-item-badge--maintainer`:`issue-item-badge--community`}`,children:e.isFromMaintainer?`Maintainer`:`Community`})]}),$(`div`,{class:`issue-item-title`,children:Xl(e.title,60)}),$(`div`,{class:`issue-item-response`,children:[$(`span`,{class:`issue-item-response-author`,children:[`Response from @`,e.lastResponseAuthor]}),$(`span`,{class:`issue-item-response-date`,children:Zl(e.lastResponseAt)})]}),$(`p`,{class:`issue-item-response-body`,children:Xl(e.lastResponseBody,150)}),$(`span`,{class:`issue-item-age`,children:[e.daysSinceUserComment,`d since your comment`]})]})}function Eu({mergedPRs:e,closedPRs:t,autoUnshelvedPRs:n}){return e.length===0&&t.length===0&&n.length===0?null:$(`div`,{class:`recent-activity`,children:[$(`h3`,{class:`recent-activity-title`,children:`Recent Activity (Last 7 Days)`}),e.length>0&&$(`div`,{class:`recent-activity-section`,children:[$(`h4`,{class:`recent-activity-section-title recent-activity-section-title--merged`,children:[`Merged (`,e.length,`)`]}),$(`div`,{class:`recent-activity-items`,children:e.map(e=>$(`div`,{class:`recent-activity-item`,children:[$(`span`,{class:`recent-activity-badge recent-activity-badge--merged`,children:`Merged`}),$(`span`,{class:`recent-activity-item-title`,children:Xl(e.title,60)}),$(`a`,{class:`recent-activity-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`span`,{class:`recent-activity-date`,children:Zl(e.mergedAt)})]},e.url))})]}),t.length>0&&$(`div`,{class:`recent-activity-section`,children:[$(`h4`,{class:`recent-activity-section-title recent-activity-section-title--closed`,children:[`Closed (`,t.length,`)`]}),$(`div`,{class:`recent-activity-items`,children:t.map(e=>$(`div`,{class:`recent-activity-item`,children:[$(`span`,{class:`recent-activity-badge recent-activity-badge--closed`,children:`Closed`}),$(`span`,{class:`recent-activity-item-title`,children:Xl(e.title,60)}),$(`a`,{class:`recent-activity-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`span`,{class:`recent-activity-date`,children:Zl(e.closedAt)})]},e.url))})]}),n.length>0&&$(`div`,{class:`recent-activity-section`,children:[$(`h4`,{class:`recent-activity-section-title recent-activity-section-title--unshelved`,children:[`Auto-Unshelved (`,n.length,`)`]}),$(`div`,{class:`recent-activity-items`,children:n.map(e=>$(`div`,{class:`recent-activity-item`,children:[$(`span`,{class:`recent-activity-badge recent-activity-badge--unshelved`,children:`Unshelved`}),$(`span`,{class:`recent-activity-item-title`,children:Xl(e.title,60)}),$(`a`,{class:`recent-activity-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]})]},e.url))})]})]})}function Du({mergedPRs:e,repoMetadata:t,onBack:n}){let[r,i]=M(`date`),[a,o]=M(`desc`);function s(e){r===e?o(e=>e===`asc`?`desc`:`asc`):(i(e),o(e===`date`||e===`stars`?`desc`:`asc`))}let c=Me(()=>[...e].sort((e,n)=>{let i=0;switch(r){case`repo`:i=e.repo.localeCompare(n.repo);break;case`stars`:i=(t?.[e.repo]?.stars??0)-(t?.[n.repo]?.stars??0);break;case`language`:{let r=t?.[e.repo]?.language??``,a=t?.[n.repo]?.language??``;i=r.localeCompare(a);break}case`date`:i=e.mergedAt.localeCompare(n.mergedAt)}return a===`asc`?i:-i}),[e,t,r,a]);function l(e,t,n){let i=r===e?a===`asc`?`▲`:`▼`:null;return $(`th`,{class:n?`${n} sortable-th`:`sortable-th`,scope:`col`,onClick:()=>s(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),s(e))},tabIndex:0,role:`button`,"aria-sort":r===e?a===`asc`?`ascending`:`descending`:void 0,children:[t,` `,i&&$(`span`,{class:`sort-arrow`,children:i})]})}return $(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:n,type:`button`,children:`← Back`}),$(`div`,{children:[$(`h2`,{class:`merged-view-title`,children:`Merged PRs`}),$(`span`,{class:`merged-view-subtitle`,children:[e.length,` total`]})]})]}),e.length===0?$(`div`,{class:`merged-view-empty`,children:`No merged PRs found. Run a dashboard refresh to populate.`}):$(`table`,{class:`merged-table`,children:[$(`thead`,{children:$(`tr`,{children:[l(`repo`,`PR`),l(`stars`,`Stars`,`merged-table-col-stars`),l(`language`,`Language`,`merged-table-col-language`),l(`date`,`Date Merged`)]})}),$(`tbody`,{children:c.map(e=>{let n=t?.[e.repo];return $(`tr`,{children:[$(`td`,{children:[$(`a`,{class:`merged-table-pr-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`div`,{class:`merged-table-pr-title`,children:Xl(e.title,80)})]}),$(`td`,{class:`merged-table-col-stars`,children:$(`span`,{class:`merged-table-stars`,children:n?.stars==null?`—`:`★ ${tu(n.stars)}`})}),$(`td`,{class:`merged-table-col-language`,children:n?.language?$(`span`,{class:`merged-table-language`,children:[$(`span`,{class:`merged-table-language-dot`,style:{backgroundColor:ru(n.language)}}),n.language]}):$(`span`,{class:`merged-table-language`,children:`—`})}),$(`td`,{children:$(`span`,{class:`merged-table-date`,children:Zl(e.mergedAt)})})]},e.url)})})]})]})}function Ou({closedPRs:e,onBack:t}){return $(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:t,type:`button`,children:`← Back`}),$(`div`,{children:[$(`h2`,{class:`merged-view-title`,children:`Closed PRs`}),$(`span`,{class:`merged-view-subtitle`,children:[e.length,` total`]})]})]}),e.length===0?$(`div`,{class:`merged-view-empty`,children:`No closed PRs found. Run a dashboard refresh to populate.`}):$(`table`,{class:`merged-table`,children:[$(`thead`,{children:$(`tr`,{children:[$(`th`,{scope:`col`,children:`PR`}),$(`th`,{scope:`col`,children:`Date Closed`})]})}),$(`tbody`,{children:e.map(e=>$(`tr`,{children:[$(`td`,{children:[$(`a`,{class:`merged-table-pr-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`div`,{class:`merged-table-pr-title`,children:Xl(e.title,80)})]}),$(`td`,{children:$(`span`,{class:`merged-table-date`,children:Zl(e.closedAt)})})]},e.url))})]})]})}function ku(e){return e>=8?`vetted-score--high`:e>=6?`vetted-score--mid`:``}function Au(e){let t,n=e.match(/\(([\d.]+)(k)?★\)/i);if(n&&n[1]!==void 0){let e=parseFloat(n[1]);t=n[2]?Math.round(e*1e3):e}let r=[...e.matchAll(/\(([^\d)★][^)]*)\)/g)],i=r[r.length-1]?.[1]?.trim();return{stars:t,language:i}}function ju({vettedIssues:e,repoMetadata:t,onBack:n}){let[r,i]=M(``),a=Me(()=>e.available.filter(e=>e.score!==void 0&&e.score>=6).sort((e,t)=>(t.score??0)-(e.score??0)),[e.available]),o=Me(()=>{if(!r)return a;let e=r.toLowerCase();return a.filter(t=>`${t.title} ${t.repo} ${t.number}`.toLowerCase().includes(e))},[a,r]);return $(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:n,type:`button`,children:`← Back`}),$(`div`,{children:[$(`h2`,{class:`merged-view-title`,children:`Vetted Issues`}),$(`span`,{class:`merged-view-subtitle`,children:[a.length,` available`]})]})]}),$(`div`,{class:`vetted-search-bar`,children:$(`input`,{class:`vetted-search-input`,type:`text`,"aria-label":`Search issues`,placeholder:`Search issues...`,value:r,onInput:e=>i(e.target.value)})}),o.length===0?$(`div`,{class:`merged-view-empty`,children:a.length===0?`No vetted issues found.`:`No issues match your search.`}):$(`table`,{class:`merged-table`,children:[$(`thead`,{children:$(`tr`,{children:[$(`th`,{scope:`col`,children:`Issue`}),$(`th`,{scope:`col`,class:`merged-table-col-stars`,children:`Stars`}),$(`th`,{scope:`col`,class:`merged-table-col-language`,children:`Language`}),$(`th`,{scope:`col`,class:`vetted-col-score`,children:`Score`})]})}),$(`tbody`,{children:o.map(e=>{let n=t?.[e.repo],r=!n?.stars||!n?.language?Au(e.group??e.tier):null,i=n?.stars??r?.stars,a=n?.language??r?.language;return $(`tr`,{children:[$(`td`,{children:[$(`a`,{class:`merged-table-pr-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`div`,{class:`merged-table-pr-title`,children:Xl(e.title,80)})]}),$(`td`,{class:`merged-table-col-stars`,children:$(`span`,{class:`merged-table-stars`,children:i==null?`—`:`\u2605 ${tu(i)}`})}),$(`td`,{class:`merged-table-col-language`,children:a?$(`span`,{class:`merged-table-language`,children:[$(`span`,{class:`merged-table-language-dot`,style:{backgroundColor:ru(a)}}),a]}):$(`span`,{class:`merged-table-language`,children:`—`})}),$(`td`,{class:`vetted-col-score`,children:e.score==null?$(`span`,{class:`vetted-score`,children:`—`}):$(`span`,{class:`vetted-score ${ku(e.score)}`,children:[e.score,`/10`]})})]},e.url)})})]})]})}function Mu(){return $(`div`,{class:`skeleton-row`,children:[...[,,,,,]].map((e,t)=>$(`div`,{class:`skeleton-card`},t))})}function Nu(){return $(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,children:[$(`circle`,{cx:`12`,cy:`12`,r:`5`}),$(`line`,{x1:`12`,y1:`1`,x2:`12`,y2:`3`}),$(`line`,{x1:`12`,y1:`21`,x2:`12`,y2:`23`}),$(`line`,{x1:`4.22`,y1:`4.22`,x2:`5.64`,y2:`5.64`}),$(`line`,{x1:`18.36`,y1:`18.36`,x2:`19.78`,y2:`19.78`}),$(`line`,{x1:`1`,y1:`12`,x2:`3`,y2:`12`}),$(`line`,{x1:`21`,y1:`12`,x2:`23`,y2:`12`}),$(`line`,{x1:`4.22`,y1:`19.78`,x2:`5.64`,y2:`18.36`}),$(`line`,{x1:`18.36`,y1:`5.64`,x2:`19.78`,y2:`4.22`})]})}function Pu(){return $(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,children:$(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})})}function Fu({theme:e,onToggle:t}){return $(`button`,{class:`theme-toggle`,onClick:t,"aria-label":e===`dark`?`Switch to light mode`:`Switch to dark mode`,type:`button`,children:$(e===`dark`?Nu:Pu,{})})}var Iu=5e3;function Lu({celebration:e,onDismiss:t}){return N(()=>{if(!e)return;let n=setTimeout(t,Iu);return()=>clearTimeout(n)},[e?.shownAt,t]),e?$(`div`,{class:`celebration-toast`,role:`status`,"aria-live":`polite`,children:[$(`span`,{class:`celebration-toast-message`,children:e.message}),$(`button`,{type:`button`,class:`celebration-toast-dismiss`,"aria-label":`Dismiss celebration`,onClick:t,children:`×`})]}):null}function Ru(){return $(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,children:[$(`path`,{d:`M14 8A6 6 0 1 1 8 2`}),$(`path`,{d:`M8 2L11 2L11 5`})]})}var zu=3e4;function Bu({stats:e,loading:t,refreshing:n,lastUpdated:r,onRefresh:i,theme:a,onToggleTheme:o,onCelebrate:s}){let[,c]=M(0);return N(()=>{let e=setInterval(()=>c(e=>e+1),zu);return()=>clearInterval(e)},[]),$(`header`,{class:`dashboard-header`,children:[$(`div`,{class:`header-brand`,children:[$(`img`,{class:`header-icon`,src:`/favicon.svg`,alt:``,width:`72`,height:`72`}),$(`h1`,{children:`OSS Autopilot`})]}),$(`div`,{class:`header-bar`,children:[$(`div`,{class:`header-stats`,children:[$(`span`,{children:[$(`span`,{class:`val`,style:{color:`var(--green)`},children:e.activePRs}),` `,`active`]}),$(`span`,{class:`header-sep`}),$(`span`,{children:[$(`span`,{class:`val`,style:{color:`var(--purple)`},children:e.mergedPRs}),` `,`merged`]}),$(`span`,{class:`header-sep`}),$(`span`,{children:[$(`span`,{class:`val`,style:{color:`var(--amber)`},children:e.mergeRate}),` `,`merge rate`]})]}),$(`div`,{class:`header-right`,children:[r&&$(`span`,{class:`last-updated`,children:iu(r)}),$(Fu,{theme:a,onToggle:o}),$(`button`,{type:`button`,class:`celebrate-btn`,onClick:s,"aria-label":`Celebrate`,children:`🎉`}),$(`button`,{class:`refresh-btn`,onClick:i,disabled:t||n,children:[t||n?$(`span`,{class:`spinner`}):$(Ru,{}),au(t,n)]})]})]})]})}var Vu=new Set([`/`,`/merged`,`/closed`,`/issues`]),Hu=[];function Uu(){let{data:e,loading:t,refreshing:n,error:r,clearError:i,refresh:a,performAction:o,lastUpdated:s,stale:c,staleReason:l,autoRefreshFailures:u}=Dl(),{theme:d,toggleTheme:f}=jl(),{celebration:p,dismiss:m,trigger:h}=Bl(e?.stats.mergedPRs),[g,_]=M({status:`all`,repo:`all`,search:``}),[v,y]=M(null),[b,x]=M(!1),{path:S,route:w}=Ke(),T=je(null);N(()=>{T.current?.focus({preventScroll:!1})},[S]),N(()=>{let t=new Set(e?.shelvedPRUrls??[]),n=(e?.activePRs??[]).filter(e=>!t.has(e.url)&&Ql(e)===`needs_attention`).length;document.title=n>0?`(${n}) OSS Autopilot`:`OSS Autopilot Dashboard`},[e?.activePRs,e?.shelvedPRUrls]),N(()=>{let e=e=>{if(!e.shiftKey||e.key!==`C`)return;let t=e.target;if(t){let e=t.tagName;if(e===`INPUT`||e===`TEXTAREA`||t.isContentEditable)return}e.preventDefault(),h()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let E=Me(()=>new Set(e?.shelvedPRUrls??[]),[e?.shelvedPRUrls]),D=e?.activePRs??Hu,ee=Me(()=>[...new Set(D.map(e=>e.repo))].sort(),[D]),O=Me(()=>[...new Set(D.map(e=>e.status))].sort(),[D]),te=Me(()=>D.filter(e=>{if(g.status!==`all`&&e.status!==g.status||g.repo!==`all`&&e.repo!==g.repo)return!1;if(g.search){let t=g.search.toLowerCase();if(!`${e.title} ${e.repo} ${e.number}`.toLowerCase().includes(t))return!1}return!0}),[D,g.status,g.repo,g.search]),ne=Me(()=>D.filter(e=>!E.has(e.url)),[D,E]);if(t&&!e)return $(`div`,{class:`skeleton-wrapper`,children:[$(Mu,{}),$(`div`,{class:`shell-center shell-center--skeleton`,children:$(`p`,{class:`shell-status`,children:`Loading dashboard data...`})})]});if(r&&!e)return $(`div`,{class:`shell-center`,role:`alert`,children:[$(`p`,{class:`shell-status shell-error`,children:`Failed to load dashboard data`}),$(`p`,{class:`shell-detail`,children:r}),$(`button`,{class:`shell-retry`,onClick:()=>window.location.reload(),children:`Retry`})]});if(!e)return null;let re={stats:e.stats,loading:t,refreshing:n,lastUpdated:s,onRefresh:a,theme:d,onToggleTheme:f,onCelebrate:h},ie=e.partialFailures&&e.partialFailures.length>0?$(`div`,{class:`partial-banner`,role:`status`,"aria-live":`polite`,children:$(`span`,{children:[`Showing partial data — `,e.partialFailures.length,` background operation`,e.partialFailures.length===1?``:`s`,` failed (`,e.partialFailures.join(`, `),`). Some sections may be incomplete; try refreshing.`]})}):null,ae=c?`Dashboard data may be stale${l?` (${l})`:``} — the server is serving cached data. Try refreshing.`:u>=2?`Background refresh failed ${u} times in a row — data may be out of date. Try refreshing.`:null,k=$(C,{children:[r?$(`div`,{class:`error-banner`,role:`alert`,children:[$(`span`,{children:r}),$(`button`,{class:`error-banner-dismiss`,onClick:i,children:`Dismiss`})]}):null,ae?$(`div`,{class:`partial-banner stale-banner`,role:`status`,"aria-live":`polite`,children:$(`span`,{children:ae})}):null,ie]});if(S===`/merged`){let t=e.allMergedPRs??[];return $(`div`,{class:`dashboard`,children:[$(Bu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Merged pull requests`}),$(Du,{mergedPRs:t,repoMetadata:e.repoMetadata,onBack:()=>w(`/`)})]}),$(Lu,{celebration:p,onDismiss:m})]})}if(S===`/closed`){let t=e.allClosedPRs??[];return $(`div`,{class:`dashboard`,children:[$(Bu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Closed pull requests`}),$(Ou,{closedPRs:t,onBack:()=>w(`/`)})]}),$(Lu,{celebration:p,onDismiss:m})]})}if(S===`/issues`)return $(`div`,{class:`dashboard`,children:[$(Bu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Vetted issues`}),e.vettedIssues?$(ju,{vettedIssues:e.vettedIssues,repoMetadata:e.repoMetadata,onBack:()=>w(`/`)}):$(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:()=>w(`/`),type:`button`,children:`← Back`}),$(`div`,{children:$(`h2`,{class:`merged-view-title`,children:`Vetted Issues`})})]}),$(`div`,{class:`merged-view-empty`,children:`No vetted issue list found. Configure one via /setup-oss or create a potential-issue-list.md file.`})]})]}),$(Lu,{celebration:p,onDismiss:m})]});if(!Vu.has(S))return $(`div`,{class:`dashboard`,children:[$(Bu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,role:`alert`,children:$(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:()=>w(`/`),type:`button`,children:`← Back to dashboard`}),$(`div`,{children:$(`h2`,{ref:T,tabIndex:-1,class:`merged-view-title`,children:`Page not found`})})]}),$(`div`,{class:`merged-view-empty`,children:$(`p`,{children:[`The path `,$(`code`,{children:S}),` doesn't match any known route. Try the dashboard home, or one of the stat pills to navigate to merged / closed / issue views.`]})})]})}),$(Lu,{celebration:p,onDismiss:m})]});let oe=v?e.activePRs.find(e=>e.url===v)??null:null,se=ne.filter(e=>Ql(e)===`needs_attention`).length,ce=ne.filter(e=>Ql(e)===`stuck_ci`).length,le=ne.filter(e=>Ql(e)===`dormant_followup`).length,ue=ne.filter(e=>Ql(e)===`waiting`).length,de=e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})};return $(`div`,{class:`dashboard`,children:[$(Bu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Dashboard`}),$(`div`,{class:`animate-in delay-1`,children:$(Wl,{stats:e.stats,needAttentionCount:se,stuckCICount:ce,dormantFollowupCount:le,waitingCount:ue,onNeedAttentionClick:()=>de(`section-action`),onStuckCIClick:()=>de(`section-stuck`),onDormantFollowupClick:()=>de(`section-dormant`),onWaitingClick:()=>de(`section-waiting`),onShelvedClick:()=>{x(!0),setTimeout(()=>de(`section-shelved`),50)},onMergedClick:()=>w(`/merged`),onClosedClick:()=>w(`/closed`),onIssuesClick:()=>w(`/issues`)})}),$(`div`,{class:`animate-in delay-2`,children:$(ql,{filters:g,onFilterChange:_,repos:ee,statuses:O,totalCount:e.activePRs.length,filteredCount:te.length})}),$(`div`,{class:`dashboard-content animate-in delay-3`,children:[$(uu,{prs:te,selectedUrl:v,onSelect:y,shelvedUrls:E,shelvedOpen:b,onShelvedToggle:()=>x(!b)}),oe&&$(vu,{pr:oe,isShelved:E.has(oe.url),onAction:o,onClose:()=>y(null)})]}),$(`div`,{class:`animate-in delay-4`,children:$(Cu,{monthlyMerged:e.monthlyMerged,monthlyOpened:e.monthlyOpened,monthlyClosed:e.monthlyClosed,topRepos:e.topRepos,theme:d})}),$(`div`,{class:`animate-in delay-5`,children:$(Eu,{mergedPRs:e.recentlyMergedPRs??[],closedPRs:e.recentlyClosedPRs??[],autoUnshelvedPRs:e.autoUnshelvedPRs??[]})}),$(`div`,{class:`animate-in delay-6`,children:$(wu,{issues:e.issueResponses,onAction:o})})]}),$(Lu,{celebration:p,onDismiss:m})]})}function Wu(){return $(Ge,{children:[$(`a`,{class:`skip-link`,href:`#main-content`,children:`Skip to main content`}),$(Uu,{})]})}var Gu=class extends w{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){console.error(`[dashboard] uncaught render error:`,e,t)}retry=()=>{this.setState({error:null})};render(){let{error:e}=this.state;if(!e)return this.props.children;if(this.props.fallback){let t=this.props.fallback;return $(t,{error:e,retry:this.retry})}return $(`div`,{role:`alert`,"aria-live":`assertive`,style:{maxWidth:640,margin:`2rem auto`,padding:`1.5rem`,border:`1px solid var(--error, #c0392b)`,borderRadius:6,background:`var(--surface, #fff)`,color:`var(--text-primary, #111)`,fontFamily:`system-ui, -apple-system, sans-serif`},children:[$(`h2`,{style:{marginTop:0},children:`Dashboard crashed`}),$(`p`,{children:`Something went wrong rendering the dashboard. This usually means the server returned an unexpected response shape or a UI component hit a null field.`}),$(`details`,{style:{margin:`1rem 0`},children:[$(`summary`,{style:{cursor:`pointer`},children:`Technical details`}),$(`pre`,{style:{whiteSpace:`pre-wrap`,fontSize:`0.85em`,marginTop:`0.5rem`},children:e.message})]}),$(`p`,{style:{fontSize:`0.9em`},children:[`Troubleshooting:`,$(`br`,{}),`• Check the CLI console that started the dashboard server for errors.`,$(`br`,{}),`• Open `,$(`code`,{children:`/api/data`}),` directly in a new tab to inspect the response shape.`,$(`br`,{}),`• Rebuild the CLI with `,$(`code`,{children:`pnpm run bundle`}),` if you changed server code recently.`]}),$(`div`,{style:{display:`flex`,gap:`0.5rem`,marginTop:`1rem`},children:[$(`button`,{type:`button`,onClick:this.retry,children:`Retry`}),$(`button`,{type:`button`,onClick:()=>location.reload(),children:`Reload page`})]})]})}},Ku=document.getElementById(`app`);Ku?he($(Gu,{children:$(Wu,{})}),Ku):(console.error(`Dashboard mount point #app not found. Check that index.html contains <div id="app"></div>.`),document.body.textContent=`Dashboard failed to load: mount point not found.`);export{je as n,N as r,$ as t};
|