p-backlog 0.11.0 → 0.12.0
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/CHANGELOG.md +7 -0
- package/README.md +6 -1
- package/README.ru.md +6 -1
- package/dist/web/assets/{CodeTab-DvhAb0kx.js → CodeTab-Ddvnjbd6.js} +1 -1
- package/dist/web/assets/{CostTab-DHmrPaIY.js → CostTab-Cu3d7ZQU.js} +1 -1
- package/dist/web/assets/{EffectTab-C-W3n29N.js → EffectTab-B5vD2IRd.js} +1 -1
- package/dist/web/assets/{Figure-DUapj1C7.js → Figure-9hmAHZdE.js} +1 -1
- package/dist/web/assets/{OverviewTab-B-6PIEfD.js → OverviewTab-6CLXNVdb.js} +1 -1
- package/dist/web/assets/{Page-U8D0vJva.js → Page-DDIe6-7m.js} +2 -2
- package/dist/web/assets/{QualityTab-B9ahq43v.js → QualityTab-DRcSKcoJ.js} +1 -1
- package/dist/web/assets/ShareBar-IQ1F0KDC.js +1 -0
- package/dist/web/assets/{StatsPage-DBqHQi5S.js → StatsPage-5bZJVJOW.js} +1 -1
- package/dist/web/assets/{StatsTabState-DlqTtrvX.js → StatsTabState-CRCdDmJS.js} +1 -1
- package/dist/web/assets/{StatsTable-ClPy3aOI.js → StatsTable-DnRbvab_.js} +1 -1
- package/dist/web/assets/UnavailableRepos-D8c8AxrV.js +1 -0
- package/dist/web/assets/{index-wzgTQj7a.js → index-kQnR69c7.js} +2 -2
- package/dist/web/assets/start-X9I0fE1J.js +42 -0
- package/dist/web/assets/{start-DPlw6J9o.css → start-h5Eo7J7Z.css} +1 -1
- package/dist/web/assets/{use-grain-panel-DpW0vjfB.js → use-grain-panel-C3ucdgrl.js} +2 -2
- package/dist/web/assets/use-grain-panel-gQnbcY1o.css +1 -0
- package/dist/web/assets/{web-paths-X1IR2jNR.js → web-paths-CMXVvb90.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +2 -1
- package/dist/web/assets/ShareBar-B-seexQa.js +0 -1
- package/dist/web/assets/UnavailableRepos-8SE6XJSM.js +0 -1
- package/dist/web/assets/start-BR6m00jS.js +0 -38
- package/dist/web/assets/use-grain-panel-nSBWtox9.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{$ as n,A as r,B as i,Ct as a,D as o,E as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,St as x,T as S,U as C,V as w,W as T,X as E,Y as D,Z as ee,_ as O,_t as k,a as A,at as j,bt as te,c as M,ct as ne,dt as N,et as re,f as ie,ft as ae,g as P,gt as oe,ht as se,i as ce,it as F,j as I,lt as L,m as R,mt as le,nt as ue,o as z,ot as de,pt as fe,q as pe,r as me,rt as he,s as ge,st as _e,tt as ve,ut as ye,vt as be,w as xe,wt as Se,x as Ce,xt as we,y as Te,yt as Ee,z as De}from"./index-wzgTQj7a.js";function Oe(){let e=this._zod;return e.message??=JSON.stringify(e.def,de,2),e.message}function ke(e){this._zod.message=e}var Ae={get:Oe,set:ke,enumerable:!0,configurable:!0},je={value:void 0,enumerable:!1},Me=new WeakSet([Object.prototype,Error.prototype]),Ne=(e,t)=>{e.name=`$ZodError`,je.value=t,Object.defineProperty(e,"issues",je),je.value=void 0,Object.defineProperty(e,"message",Ae);let n=Object.getPrototypeOf(e);Me.has(n)||(Me.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})}}))},Pe=_(`$ZodError`,Ne);_(`$ZodError`,Ne,void 0,{Parent:Error});function Fe(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 Ie(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Fe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Le(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 Re(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ze=e=>{let t=(n,i,a,o)=>{let c=a?{...a,async:!1}:{async:!1},l=n._zod.run({value:i,issues:[]},c);if(l instanceof Promise)throw new s;if(l.issues.length){let n=new((o?.Err)??e)(l.issues.map(e=>E(e,c,r())));throw De(n,o?.callee??t),n}return l.value};return t},Be=e=>{let t=async(n,i,a,o)=>{let s=a?{...a,async:!0}:{async:!0},c=n._zod.run({value:i,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let n=new((o?.Err)??e)(c.issues.map(e=>E(e,s,r())));throw De(n,o?.callee??t),n}return c.value};return t},Ve=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 s;return a.issues.length?He(e,a.issues,i):{success:!0,data:a.value}};function He(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(e=>E(e,n,r()))),t=void 0,n=void 0),i},set error(e){i=e,t=void 0,n=void 0}}}var Ue=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?He(e,a.issues,i):{success:!0,data:a.value}},We=Symbol.for(`zod.compile.invalid`),Ge=Symbol.for(`zod.compile.fallback`),Ke=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==We)return!0;if(r.definite===!0&&n===void 0)return!1}return qe(e,t,n)});function qe(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ge]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new s;return a.issues.length===0}var Je=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},Ye=e=>{let t=ze(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Re(n,a))};return n},Xe=e=>{let t=ze(e),n=(e,r,i,a)=>t(e,r,i,Re(n,a));return n},Ze=e=>{let t=Be(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Re(n,a))};return n},Qe=e=>{let t=Be(e),n=async(e,r,i,a)=>await t(e,r,i,Re(n,a));return n},$e=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ve(e)(t,n,i)},et=e=>(t,n,r)=>Ve(e)(t,n,r),tt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ue(e)(t,n,i)},nt=e=>async(t,n,r)=>Ue(e)(t,n,r),rt=/^[cC][0-9a-z]{6,}$/,it=/^[0-9a-z]+$/,at=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ot=/^[0-9a-vA-V]{20}$/,st=/^[A-Za-z0-9]{27}$/,ct=/^[a-zA-Z0-9_-]{21}$/;function lt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ut=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dt=/^([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})$/,ft=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)$/,pt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mt=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function ht(){return new RegExp(mt,`u`)}var gt=/^(?:(?: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])$/,_t=/^(([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}|:))$/,vt=/^((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])$/,yt=/^(([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])$/,bt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,St=/^https?$/,Ct=/^\+[1-9]\d{6,14}$/,wt=`(?:(?:\\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 Tt(e){return RegExp(`^${e}$`)}var Et=Tt(wt);function Dt(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 Ot(e){return RegExp(`^${Dt(e)}$`)}function kt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Dt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Dt({precision:e.precision})}`:n;return RegExp(`^${wt}T(?:${r})$`)}var At=/^[\s\S]{0,}$/,jt=/^-?\d+$/,Mt=/^-?\d+(?:\.\d+)?$/,Nt=/^(?:true|false)$/i,Pt=/^[^A-Z]*$/,Ft=/^[^a-z]*$/,It=_(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Lt=e=>{let t=e.value;return!ye(t)&&t.length!==void 0},Rt={number:`number`,bigint:`bigint`,object:`date`},zt=_(`$ZodCheckLessThan`,(e,t)=>{It.init(e,t);let n=Rt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Rt[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})}}),Bt=_(`$ZodCheckGreaterThan`,(e,t)=>{It.init(e,t);let n=Rt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Rt[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})}}),Vt=_(`$ZodCheckMultipleOf`,(e,t)=>{It.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):ee(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})}}),Ht=_(`$ZodCheckNumberFormat`,(e,t)=>{It.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=g[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})}}),Ut=_(`$ZodCheckMaxLength`,(e,t)=>{var r;It.init(e,t),(r=e._zod.def).when??(r.when=Lt),e._zod.check=r=>{let i=r.value,a=i.length;if((typeof i==`string`&&a>t.maximum?u(i):a)<=t.maximum)return;let o=n(i);r.issues.push({origin:o,code:`too_big`,maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Wt=_(`$ZodCheckMinLength`,(e,t)=>{var r;It.init(e,t),(r=e._zod.def).when??(r.when=Lt),e._zod.check=r=>{let i=r.value,a=i.length;if((typeof i==`string`&&a>=t.minimum&&a<t.minimum*2?u(i):a)>=t.minimum)return;let o=n(i);r.issues.push({origin:o,code:`too_small`,minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Gt=_(`$ZodCheckLengthEquals`,(e,t)=>{var r;It.init(e,t),(r=e._zod.def).when??(r.when=Lt),e._zod.check=r=>{let i=r.value,a=i.length,o=typeof i==`string`&&a>=t.length&&a<=t.length*2?u(i):a;if(o===t.length)return;let s=n(i),c=o>t.length;r.issues.push({origin:s,...c?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Kt=_(`$ZodCheckStringFormat`,(e,t)=>{var n,r;It.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=()=>{})}),qt=_(`$ZodCheckRegex`,(e,t)=>{Kt.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})}}),Jt=_(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Pt,Kt.init(e,t)}),Yt=_(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ft,Kt.init(e,t)}),Xt=_(`$ZodCheckIncludes`,(e,t)=>{It.init(e,t);let n=pe(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})}}),Zt=_(`$ZodCheckStartsWith`,(e,t)=>{It.init(e,t);let n=RegExp(`^${pe(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})}}),Qt=_(`$ZodCheckEndsWith`,(e,t)=>{It.init(e,t);let n=RegExp(`.*${pe(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})}}),$t=_(`$ZodCheckOverwrite`,(e,t)=>{It.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),en=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(`
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{$ as n,A as r,B as i,Ct as a,D as o,E as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,St as x,T as S,U as C,V as w,W as T,X as E,Y as D,Z as ee,_ as O,_t as k,a as A,at as j,bt as te,c as M,ct as ne,dt as N,et as re,f as ie,ft as ae,g as P,gt as oe,ht as se,i as ce,it as F,j as I,lt as L,m as R,mt as le,nt as ue,o as z,ot as de,pt as fe,q as pe,r as me,rt as he,s as ge,st as _e,tt as ve,ut as ye,vt as be,w as xe,wt as Se,x as Ce,xt as we,y as Te,yt as Ee,z as De}from"./index-kQnR69c7.js";function Oe(){let e=this._zod;return e.message??=JSON.stringify(e.def,de,2),e.message}function ke(e){this._zod.message=e}var Ae={get:Oe,set:ke,enumerable:!0,configurable:!0},je={value:void 0,enumerable:!1},Me=new WeakSet([Object.prototype,Error.prototype]),Ne=(e,t)=>{e.name=`$ZodError`,je.value=t,Object.defineProperty(e,"issues",je),je.value=void 0,Object.defineProperty(e,"message",Ae);let n=Object.getPrototypeOf(e);Me.has(n)||(Me.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})}}))},Pe=_(`$ZodError`,Ne);_(`$ZodError`,Ne,void 0,{Parent:Error});function Fe(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 Ie(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Fe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Le(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 Re(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ze=e=>{let t=(n,i,a,o)=>{let c=a?{...a,async:!1}:{async:!1},l=n._zod.run({value:i,issues:[]},c);if(l instanceof Promise)throw new s;if(l.issues.length){let n=new((o?.Err)??e)(l.issues.map(e=>E(e,c,r())));throw De(n,o?.callee??t),n}return l.value};return t},Be=e=>{let t=async(n,i,a,o)=>{let s=a?{...a,async:!0}:{async:!0},c=n._zod.run({value:i,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let n=new((o?.Err)??e)(c.issues.map(e=>E(e,s,r())));throw De(n,o?.callee??t),n}return c.value};return t},Ve=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 s;return a.issues.length?He(e,a.issues,i):{success:!0,data:a.value}};function He(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(e=>E(e,n,r()))),t=void 0,n=void 0),i},set error(e){i=e,t=void 0,n=void 0}}}var Ue=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?He(e,a.issues,i):{success:!0,data:a.value}},We=Symbol.for(`zod.compile.invalid`),Ge=Symbol.for(`zod.compile.fallback`),Ke=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==We)return!0;if(r.definite===!0&&n===void 0)return!1}return qe(e,t,n)});function qe(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ge]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new s;return a.issues.length===0}var Je=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},Ye=e=>{let t=ze(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Re(n,a))};return n},Xe=e=>{let t=ze(e),n=(e,r,i,a)=>t(e,r,i,Re(n,a));return n},Ze=e=>{let t=Be(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Re(n,a))};return n},Qe=e=>{let t=Be(e),n=async(e,r,i,a)=>await t(e,r,i,Re(n,a));return n},$e=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ve(e)(t,n,i)},et=e=>(t,n,r)=>Ve(e)(t,n,r),tt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ue(e)(t,n,i)},nt=e=>async(t,n,r)=>Ue(e)(t,n,r),rt=/^[cC][0-9a-z]{6,}$/,it=/^[0-9a-z]+$/,at=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ot=/^[0-9a-vA-V]{20}$/,st=/^[A-Za-z0-9]{27}$/,ct=/^[a-zA-Z0-9_-]{21}$/;function lt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ut=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dt=/^([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})$/,ft=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)$/,pt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mt=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function ht(){return new RegExp(mt,`u`)}var gt=/^(?:(?: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])$/,_t=/^(([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}|:))$/,vt=/^((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])$/,yt=/^(([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])$/,bt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,St=/^https?$/,Ct=/^\+[1-9]\d{6,14}$/,wt=`(?:(?:\\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 Tt(e){return RegExp(`^${e}$`)}var Et=Tt(wt);function Dt(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 Ot(e){return RegExp(`^${Dt(e)}$`)}function kt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Dt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Dt({precision:e.precision})}`:n;return RegExp(`^${wt}T(?:${r})$`)}var At=/^[\s\S]{0,}$/,jt=/^-?\d+$/,Mt=/^-?\d+(?:\.\d+)?$/,Nt=/^(?:true|false)$/i,Pt=/^[^A-Z]*$/,Ft=/^[^a-z]*$/,It=_(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Lt=e=>{let t=e.value;return!ye(t)&&t.length!==void 0},Rt={number:`number`,bigint:`bigint`,object:`date`},zt=_(`$ZodCheckLessThan`,(e,t)=>{It.init(e,t);let n=Rt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Rt[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})}}),Bt=_(`$ZodCheckGreaterThan`,(e,t)=>{It.init(e,t);let n=Rt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Rt[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})}}),Vt=_(`$ZodCheckMultipleOf`,(e,t)=>{It.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):ee(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})}}),Ht=_(`$ZodCheckNumberFormat`,(e,t)=>{It.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=g[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})}}),Ut=_(`$ZodCheckMaxLength`,(e,t)=>{var r;It.init(e,t),(r=e._zod.def).when??(r.when=Lt),e._zod.check=r=>{let i=r.value,a=i.length;if((typeof i==`string`&&a>t.maximum?u(i):a)<=t.maximum)return;let o=n(i);r.issues.push({origin:o,code:`too_big`,maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Wt=_(`$ZodCheckMinLength`,(e,t)=>{var r;It.init(e,t),(r=e._zod.def).when??(r.when=Lt),e._zod.check=r=>{let i=r.value,a=i.length;if((typeof i==`string`&&a>=t.minimum&&a<t.minimum*2?u(i):a)>=t.minimum)return;let o=n(i);r.issues.push({origin:o,code:`too_small`,minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Gt=_(`$ZodCheckLengthEquals`,(e,t)=>{var r;It.init(e,t),(r=e._zod.def).when??(r.when=Lt),e._zod.check=r=>{let i=r.value,a=i.length,o=typeof i==`string`&&a>=t.length&&a<=t.length*2?u(i):a;if(o===t.length)return;let s=n(i),c=o>t.length;r.issues.push({origin:s,...c?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Kt=_(`$ZodCheckStringFormat`,(e,t)=>{var n,r;It.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=()=>{})}),qt=_(`$ZodCheckRegex`,(e,t)=>{Kt.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})}}),Jt=_(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Pt,Kt.init(e,t)}),Yt=_(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ft,Kt.init(e,t)}),Xt=_(`$ZodCheckIncludes`,(e,t)=>{It.init(e,t);let n=pe(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})}}),Zt=_(`$ZodCheckStartsWith`,(e,t)=>{It.init(e,t);let n=RegExp(`^${pe(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})}}),Qt=_(`$ZodCheckEndsWith`,(e,t)=>{It.init(e,t);let n=RegExp(`.*${pe(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})}}),$t=_(`$ZodCheckOverwrite`,(e,t)=>{It.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),en=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
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
3
|
`)}\n};`)(...Object.values(this.closed))}},tn={major:4,minor:6,patch:5},B=_(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tn;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=v(t),a;for(let o of n){if(o._zod.def.when){if(f(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,c=o._zod.check(t);if(c instanceof Promise&&r?.async===!1)throw new s;if(a||c instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await c,t.issues.length!==n&&(m(t.issues,n,e),i||=v(t,n))});else{if(t.issues.length===n)continue;m(t.issues,n,e),i||=v(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(v(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new s;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 s;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return re(this,`~standard`,an(this))},set"~standard"(e){fe(this,`~standard`,e)}}),nn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>E(e,t,r()))}:{value:e.value};async function rn(e,t){let n={async:!0};return nn(await e._zod.run({value:t,issues:[]},n),n)}function an(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return nn(r,n)}catch{}return rn(e,t)},vendor:`zod`,version:1}}var on=_(`$ZodString`,(e,t)=>{B.init(e,t),e._zod.pattern=t.pattern??At,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}}),V=_(`$ZodStringFormat`,(e,t)=>{Kt.init(e,t),on.init(e,t)}),sn=_(`$ZodGUID`,(e,t)=>{t.pattern??=dt,V.init(e,t)}),cn=_(`$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??=ft(e)}else t.pattern??=ft();V.init(e,t)}),ln=_(`$ZodEmail`,(e,t)=>{t.pattern??=pt,V.init(e,t)});function un(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function dn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?un(e)||2:fn(e,t)}function fn(e,t){if(!t.normalize&&t.protocol?.source===St.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 pn=/[\t\n\r]/g;function mn(e){return e.replace(pn,``)}function hn(e,t){return t.lastIndex=0,t.test(e.hostname)}function gn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var _n=_(`$ZodURL`,(e,t)=>{V.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=dn(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=mn(r);return}t.hostname&&!hn(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&&!gn(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:mn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),vn=_(`$ZodEmoji`,(e,t)=>{t.pattern??=ht(),V.init(e,t)}),yn=_(`$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?ct:lt(t.length),V.init(e,t)}),bn=_(`$ZodCUID`,(e,t)=>{t.pattern??=rt,V.init(e,t)}),xn=_(`$ZodCUID2`,(e,t)=>{t.pattern??=it,V.init(e,t)}),Sn=_(`$ZodULID`,(e,t)=>{t.pattern??=at,V.init(e,t)}),Cn=_(`$ZodXID`,(e,t)=>{t.pattern??=ot,V.init(e,t)}),wn=_(`$ZodKSUID`,(e,t)=>{t.pattern??=st,V.init(e,t)}),Tn=_(`$ZodISODateTime`,(e,t)=>{t.pattern??=kt(t),V.init(e,t)}),En=_(`$ZodISODate`,(e,t)=>{t.pattern??=Et,V.init(e,t)}),Dn=_(`$ZodISOTime`,(e,t)=>{t.pattern??=Ot(t),V.init(e,t)}),On=_(`$ZodISODuration`,(e,t)=>{t.pattern??=ut,V.init(e,t)}),kn=_(`$ZodIPv4`,(e,t)=>{t.pattern??=gt,V.init(e,t)}),An=/^[0-9a-fA-F:.]+$/;function jn(e){return An.test(e)?un(`http://[${e}]`):!1}var Mn=_(`$ZodIPv6`,(e,t)=>{t.pattern??=_t,V.init(e,t),e._zod.check=n=>{jn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Nn=_(`$ZodCIDRv4`,(e,t)=>{t.pattern??=vt,V.init(e,t)});function Pn(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:jn(n)}var Fn=_(`$ZodCIDRv6`,(e,t)=>{t.pattern??=yt,V.init(e,t),e._zod.check=n=>{Pn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function In(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Ln=/^[0-9a-zA-Z+/]*={0,2}$/,Rn=_(`$ZodBase64`,(e,t)=>{t.pattern??=Ln,V.init(e,t),e._zod.check=n=>{In(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),zn=/^[A-Za-z0-9_-]*$/;function Bn(e){if(!zn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return In(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Vn=_(`$ZodBase64URL`,(e,t)=>{t.pattern??=zn,V.init(e,t),e._zod.check=n=>{Bn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Hn=_(`$ZodE164`,(e,t)=>{t.pattern??=Ct,V.init(e,t)});function Un(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 Wn=_(`$ZodJWT`,(e,t)=>{V.init(e,t),e._zod.check=n=>{Un(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Gn=_(`$ZodNumber`,(e,t)=>{B.init(e,t),e._zod.pattern=Mt,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}}),Kn=_(`$ZodNumberFormat`,(e,t)=>{Ht.init(e,t),Gn.init(e,t)}),qn=_(`$ZodBoolean`,(e,t)=>{B.init(e,t),e._zod.pattern=Nt,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}}),Jn=_(`$ZodUnknown`,(e,t)=>{B.init(e,t),e._zod.parse=e=>e}),Yn=_(`$ZodNever`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Xn(e,t,n){e.issues.length&&t.issues.push(...k(n,e.issues)),t.value[n]=e.value}var Zn=_(`$ZodArray`,(e,t)=>{B.init(e,t);let n=I.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=>Xn(t,r,e)));else if(Xn(c,r,e),s&&c.issues.length!==0&&v(c))break}return o.length?Promise.all(o).then(()=>r):r}});function Qn(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(...k(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 $n=[];function er(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:$n,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=ae(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function tr(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(v(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=>Qn(e,n,i,t,d,f))):Qn(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 nr=_(`$ZodObject`,(e,t)=>{B.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=b(()=>er(t));T(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)||d(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=ue,o=t.catchall,s,c=I.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(v(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=>Qn(n,t,e,r,a,o))):Qn(s,t,e,r,a,o)}return o?tr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),rr=_(`$ZodObjectJIT`,(e,t)=>{nr.init(e,t);let n=e._zod.parse,r=b(()=>er(t)),i=I.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new en([`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
4
|
let ${e}_ab = false;
|
|
@@ -52,7 +52,7 @@ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{$ as n,A as r,B as i
|
|
|
52
52
|
|
|
53
53
|
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ue,l=!I.jitless,u=l&&c.value,d=t.catchall,f;e._zod.parse=(i,c)=>{f??=r.value;let p=i.value;return s(p)?l&&u&&c?.async===!1&&c.jitless!==!0?(o||=a(t.shape),i=o(i,c),d?tr([],p,i,c,f,e,c?.abortEarly===!0):i):n(i,c):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ir(e,t,n,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let a=e.filter(e=>!v(e));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>E(e,i,r())))}),t)}var ar=_(`$ZodUnion`,(e,t)=>{B.init(e,t),T(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),T(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),T(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)))}),T(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=>i(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=>ir(t,r,e,i)):ir(o,r,e,i)}});function or(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var sr=_(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,ar.init(e,t);let n=e._zod.parse;T(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||d(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Ee(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=b(()=>or(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ue(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),cr=_(`$ZodIntersection`,(e,t)=>{B.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])=>ur(e,t,n)):ur(e,i,a)}});function lr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(he(e)&&he(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=lr(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=lr(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 ur(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=lr(t.value,n.value);if(!c.valid){if(v(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var dr=_(`$ZodRecord`,(e,t)=>{B.init(e,t);let n=I.memoizer;n?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!he(o))return i.issues.push({expected:`record`,code:`invalid_type`,input:o,inst:e}),i;let s=[],c=t.keyType._zod.values;if(c&&!t.partial){i.value=n?n.alloc(e,i,{},a):{};let l=new Set;for(let n of c)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(l.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let c=t.keyType._zod.run({value:n,issues:[]},a);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(c.issues.length){i.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>E(e,a,r())),input:n,path:[n],inst:e});continue}let u=c.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:o[n],issues:[]},a);d instanceof Promise?s.push(d.then(e=>{e.issues.length&&i.issues.push(...k(n,e.issues)),i.value[u]=e.value})):(d.issues.length&&i.issues.push(...k(n,d.issues)),i.value[u]=d.value)}let u;for(let e in o)if(!l.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;i.value[e]=o[e]}else u??=[],u.push(e)}u&&u.length>0&&i.issues.push({code:`unrecognized_keys`,input:o,inst:e,keys:u,continue:!0})}else{i.value=n?n.alloc(e,i,{},a):{};let l;for(let n of Reflect.ownKeys(o)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(o,n))continue;let u=t.keyType._zod.run({value:n,issues:[]},a);if(u instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Mt.test(n)&&u.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},a);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(u=e)}if(u.issues.length){t.mode===`loose`?i.value[n]=o[n]:c?(l??=[],l.push(n)):i.issues.push({code:`invalid_key`,origin:`record`,issues:u.issues.map(e=>E(e,a,r())),input:n,path:[n],inst:e});continue}let d=u.value;if(d===`__proto__`)continue;let f=t.valueType._zod.run({value:o[n],issues:[]},a);f instanceof Promise?s.push(f.then(e=>{e.issues.length&&i.issues.push(...k(n,e.issues)),i.value[d]=e.value})):(f.issues.length&&i.issues.push(...k(n,f.issues)),i.value[d]=f.value)}l&&l.length>0&&i.issues.push({code:`unrecognized_keys`,input:o,inst:e,keys:l,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),fr=_(`$ZodEnum`,(e,t)=>{B.init(e,t);let n=y(t.entries),r=new Set(n);e._zod.values=r,T(e,`pattern`,e=>{let t=y(e.def.entries).filter(e=>be.has(typeof e));return RegExp(t.length?`^(${t.map(e=>pe(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}}),pr=_(`$ZodLiteral`,(e,t)=>{B.init(e,t);let n=new Set(t.values);e._zod.values=n,T(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?pe(e):e?pe(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),mr=_(`$ZodTransform`,(e,t)=>{B.init(e,t),e._zod.optin=`optional`,I.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new o(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 s;return n.value=i,n}});function hr(e,t){return e.value=t.issues.length?void 0:t.value,e}var gr=_(`$ZodOptional`,(e,t)=>{B.init(e,t),T(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,T(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),T(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${i(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=>hr(e,t)):hr(e,r)}return t.innerType._zod.run(e,n)}}),_r=_(`$ZodExactOptional`,(e,t)=>{gr.init(e,t),T(e,`values`,e=>e.def.innerType._zod.values),T(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),vr=_(`$ZodNullable`,(e,t)=>{B.init(e,t),T(e,`optin`,e=>e.def.innerType._zod.optin),T(e,`optout`,e=>e.def.innerType._zod.optout),T(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${i(t.source)}|null)$`):void 0}),T(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)}),yr=_(`$ZodDefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,T(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=>br(e,t)):br(r,t)}});function br(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var xr=_(`$ZodPrefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,T(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))}),Sr=_(`$ZodNonOptional`,(e,t)=>{B.init(e,t),T(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=>Cr(t,e)):Cr(i,e)}});function Cr(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 wr(e,t,n,i){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>E(e,i,r()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Tr=_(`$ZodCatch`,(e,t)=>{B.init(e,t),T(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),T(e,`optout`,e=>e.def.innerType._zod.optout),T(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=>wr(e,r,t,n)):wr(e,r,t,n)}}),Er=_(`$ZodPipe`,(e,t)=>{B.init(e,t),T(e,`values`,e=>e.def.in._zod.values),T(e,`optin`,e=>e.def.in._zod.optin),T(e,`optout`,e=>e.def.out._zod.optout),T(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=>Dr(e,t.in,n)):Dr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Dr(e,t.out,n)):Dr(r,t.out,n)}});function Dr(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 Or=_(`$ZodCodec`,(e,t)=>{B.init(e,t),T(e,`values`,e=>e.def.in._zod.values),T(e,`optin`,e=>e.def.in._zod.optin),T(e,`optout`,e=>e.def.out._zod.optout),T(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>kr(e,t,n)):kr(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>kr(e,t,n)):kr(r,t,n)}}});function kr(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Ar(e,r,t.out,n)):Ar(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Ar(e,r,t.in,n)):Ar(e,r,t.in,n)}}function Ar(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var jr=_(`$ZodReadonly`,(e,t)=>{B.init(e,t),T(e,`propValues`,e=>e.def.innerType._zod.propValues),T(e,`values`,e=>e.def.innerType._zod.values),T(e,`optin`,e=>e.def.innerType?._zod?.optin),T(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(Mr):Mr(r)}});function Mr(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Nr=_(`$ZodCustom`,(e,t)=>{It.init(e,t),B.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=>Pr(t,n,r,e));Pr(i,n,r,e)}});function Pr(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(F(e))}}var Fr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Ir=`~memo`,Lr=[];function Rr(e){return typeof e==`object`&&!!e}function zr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Br=new WeakMap,Vr=0,Hr=1,Ur=2;function Wr(e,t,n){let r=Br.get(e);if(r!==void 0)return r?Ur:Vr;if(t.has(e))return Ur;t.add(e);let i=Vr,a=e=>{if(i!==Ur&&e?._zod){let r=Wr(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Vr;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Hr:o.value?._zod?Wr(o.value,t,n):Vr;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ee(c);s(e?o(e,!0):Hr),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?Wr(r,t,!1):Hr);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),Gr(e,i)}function Gr(e,t){return t!==Hr&&Br.set(e,t===Ur),t}function Kr(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var qr,Jr=[],Yr={alloc(e,t,n){let r=qr;if(!r)return n;qr=void 0;let i={value:n,issues:null};return r.set(t.value,i),Jr.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`&&Zr(n,e.value))throw new Fr;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=Wr(e,new Set,!1);if(i===Vr)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ur||r?n=!0:r=!0}let l=s.value;if(!Rr(l))return t(s,c);let u=c[Ir];u||(u={buckets:new WeakMap,backEdges:void 0},c[Ir]=u);let d;i===c?d=a:(d=Kr(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(...zr(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;qr=d;let p=Jr.length,m=t(s,c);qr=void 0;let h=Jr.length>p?Jr.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?zr(e.issues):Lr),e)):(h&&(h.issues=m.issues.length?zr(m.issues):Lr),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Xr(){return Yr}function Zr(e,t){let n=e[Ir]?.backEdges;return n!==void 0&&Rr(t)&&n.has(t)}var Qr=()=>{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(le(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Se(e.values[0])}`:`Invalid option: expected one of ${j(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`:``}: ${j(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 $r(){return{localeError:Qr()}}function ei(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}var ti=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},map:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,mac:`MAC адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,credit_card:`номер кредитной карты`,currency_code:`код валюты`,iban:`IBAN`,jwt:`JWT`,template_literal:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=le(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${Se(e.values[0])}`:`Неверный вариант: ожидалось одно из ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=ei(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=ei(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function ni(){return{localeError:ti()}}var ri,ii=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 ai(){return new ii}(ri=globalThis).__zod_globalRegistry??(ri.__zod_globalRegistry=ai());var oi=globalThis.__zod_globalRegistry;function si(e){return e.checks&&=[...e.checks],e}function ci(e,t){return new e(si({type:`string`,...L(t)}))}function li(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...L(t)})}function ui(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...L(t)})}function di(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...L(t)})}function fi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...L(t)})}function pi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...L(t)})}function mi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...L(t)})}function hi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...L(t)})}function gi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...L(t)})}function _i(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...L(t)})}function vi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...L(t)})}function yi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...L(t)})}function bi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...L(t)})}function xi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...L(t)})}function Si(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...L(t)})}function Ci(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...L(t)})}function wi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...L(t)})}function Ti(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...L(t)})}function Ei(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...L(t)})}function Di(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...L(t)})}function Oi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...L(t)})}function ki(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...L(t)})}function Ai(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...L(t)})}function ji(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...L(t)})}function Mi(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...L(t)})}function Ni(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...L(t)})}function Pi(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...L(t)})}function Fi(e,t){return new e(si({type:`number`,checks:[],...L(t)}))}function Ii(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...L(t)})}function Li(e,t){return new e({type:`boolean`,...L(t)})}function Ri(e){return new e({type:`unknown`})}function zi(e,t){return new e({type:`never`,...L(t)})}function Bi(e,t){return new zt({check:`less_than`,...L(t),value:e,inclusive:!1})}function Vi(e,t){return new zt({check:`less_than`,...L(t),value:e,inclusive:!0})}function Hi(e,t){return new Bt({check:`greater_than`,...L(t),value:e,inclusive:!1})}function Ui(e,t){return new Bt({check:`greater_than`,...L(t),value:e,inclusive:!0})}function Wi(e,t){return new Vt({check:`multiple_of`,...L(t),value:e})}function Gi(e,t){return new Ut({check:`max_length`,...L(t),maximum:e})}function Ki(e,t){return new Wt({check:`min_length`,...L(t),minimum:e})}function qi(e,t){return new Gt({check:`length_equals`,...L(t),length:e})}function Ji(e,t){return new qt({check:`string_format`,format:`regex`,...L(t),pattern:e})}function Yi(e){return new Jt({check:`string_format`,format:`lowercase`,...L(e)})}function Xi(e){return new Yt({check:`string_format`,format:`uppercase`,...L(e)})}function Zi(e,t){return new Xt({check:`string_format`,format:`includes`,...L(t),includes:e})}function Qi(e,t){return new Zt({check:`string_format`,format:`starts_with`,...L(t),prefix:e})}function $i(e,t){return new Qt({check:`string_format`,format:`ends_with`,...L(t),suffix:e})}function ea(e){return new $t({check:`overwrite`,tx:e})}function ta(e){return ea(t=>t.normalize(e))}function na(){return ea(e=>e.trim())}function ra(){return ea(e=>e.toLowerCase())}function ia(){return ea(e=>e.toUpperCase())}function aa(){return ea(e=>a(e))}function oa(e,t,n){return new e({type:`array`,element:t,...L(n)})}function sa(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...L(n)})}function ca(e,t){let n=la(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(F(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(F(r))}},e(t.value,t)),t);return n}function la(e,t){let n=new It({check:`custom`,...L(t)});return n._zod.check=e,n}function ua(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&d(e,t,n[t]);return e}function da(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??oi,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 fa(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 H(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,H(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&ua(o.schema,c),t.io===`input`&&U(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 pa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ma(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}/${pa(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+pa(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
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 ha(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;ha(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 ga=new Set([`type`,`properties`,`required`,`additionalProperties`]),_a=[`oneOf`,`anyOf`];function va(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ya(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ga.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]??va(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}let i=e.length===1?e[0]:ya(e)??{allOf:e};d(n,r,i)}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=va(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 ba(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ga)if(t in e)return;let n=t.filter(e=>_a.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ya(t);else{let e=n[0],i=_a.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=>ya([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,ua(e,r))}function xa(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)):ua(i,s),ua(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())ha(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)??[])ba(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)}ua(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,d(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:Ca(t,`input`,e.processors),output:Ca(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function U(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 U(r.element,n);if(r.type===`set`)return U(r.valueType,n);if(r.type===`lazy`)return U(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 U(r.innerType,n);if(r.type===`intersection`)return U(r.left,n)||U(r.right,n);if(r.type===`record`||r.type===`map`)return U(r.keyType,n)||U(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:U(r.in,n)||U(r.out,n);if(r.type===`object`){for(let e in r.shape)if(U(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(U(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(U(e,n))return!0;return!!(r.rest&&U(r.rest,n))}return!1}var Sa=(e,t={})=>n=>{let r=da({...n,processors:t});return H(e,r),ma(r,e),xa(r,e)},Ca=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=da({...i??{},target:a,io:t,processors:n});return H(e,o),ma(o,e),xa(o,e)},wa=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ta=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ea=(e,t)=>{wa(e,`minimum`,t),Ta(e,`maximum`,t)},Da=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Oa=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},ka=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Aa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ja=(e,t)=>wa(e,`minimum`,t.minimum),Ma=(e,t)=>Ta(e,`maximum`,t.maximum),Na=e=>(t,n)=>{Aa(t,n.format);let[r,i]=e[n.format];wa(t,`minimum`,r),Ta(t,`maximum`,i)},Pa={greater_than:(e,t)=>wa(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ta(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Da(e,t.value),number_format:Na(g),bigint_format:Na(h),min_length:ja,max_length:Ma,length_equals:(e,t)=>Ea(e,t.length),min_size:ja,max_size:Ma,size_equals:(e,t)=>Ea(e,t.size),string_format:(e,t)=>{Aa(e,t.format),t.pattern&&Oa(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)=>ka(e,t.mime)};function Fa(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Pa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&wa(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&wa(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ta(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ta(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Da(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ka(t,i.mime);for(let e of i.patterns??[])Oa(t,e);return t}var Ia={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},La=new Map([[Ln,bt],[zn,xt]]),Ra=e=>La.get(e)??e,za=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Fa(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ia[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(Ra);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}))])}},Ba=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Fa(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)):fa(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}))])}},Va=(e,t,n,r)=>{n.type=`boolean`},Ha=(e,t,n,r)=>{n.not={}},Ua=(e,t,n,r)=>{let i=e._zod.def,a=y(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},Wa=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(fa(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(fa(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ga=(e,t,n,r)=>{fa(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{fa(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},qa=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Fa(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=H(a.element,t,{...r,path:[...r.path,`items`]})};function Ja(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ja(t.out):t.type===`catch`?Ja(t.innerType):e._zod.optin}var Ya=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&fa(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)d(i.properties,e,H(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`?Ja(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=H(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Xa=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>H(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Za=(e,t,n,r)=>{let i=e._zod.def,a=H(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=H(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 Qa(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=Qa(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=>Qa(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`)?Mt:jt).source),p):p}var $a=new WeakMap;function eo(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 $a.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Qa(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 to=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Fa(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=H(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)d(i.patternProperties,Ra(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=H(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=$a.get(t);n||(n=[],$a.set(t,n),t.deferred.push(()=>eo(t))),n.push(e)}i.additionalProperties=H(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ja(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))}},no=(e,t,n,r)=>{let i=e._zod.def,a=H(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`}]},ro=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},io=Symbol();function ao(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(fa(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),io):JSON.parse(o)}var oo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n.default=o)},so=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n._prefault=o)},co=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{fa(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},lo=(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;H(o,t,r);let s=t.seen.get(e);s.ref=o},uo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},fo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},po=new WeakSet([Object.prototype,Error.prototype]);function mo(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 ho=_(`ZodError`,(e,t)=>{Pe.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);po.has(n)||(po.add(n),mo(n,`format`,e=>t=>Le(e,t)),mo(n,`flatten`,e=>t=>Ie(e,t)),mo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,de,2)}),mo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,de,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),go=ze(ho),_o=Be(ho),vo=Ve(ho),yo=Ue(ho),bo=Ye(ho),xo=Xe(ho),So=Ze(ho),Co=Qe(ho),wo=$e(ho),To=et(ho),Eo=tt(ho),Do=nt(ho);function Oo(){I.localeError||r($r())}function ko(){I.memoizer||r({memoizer:Xr()})}var W=_(`ZodType`,(e,t)=>(Oo(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ne(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 w(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ys(e,t))},superRefine(e,t){return this.check(Xs(e,t))},overwrite(e){return this.check(ea(e))},optional(){return ks(this)},exactOptional(){return js(this)},nullable(){return Ns(this)},nullish(){return ks(Ns(this))},nonoptional(e){return zs(this,e)},array(){return fs(this)},or(e){return gs([this,e])},and(e){return bs(this,e)},transform(e){return Us(this,Ds(e))},default(e){return Fs(this,e)},prefault(e){return Ls(this,e)},catch(e){return Vs(this,e)},pipe(e){return Us(this,e)},readonly(){return qs(this)},describe(e){let t=this.clone();return oi.add(t,{description:e}),t},meta(...e){if(e.length===0)return oi.get(this);let t=this.clone();return oi.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 re(this,`~standard`,{...an(this),jsonSchema:{input:Ca(this,`input`),output:Ca(this,`output`)}})},set"~standard"(e){fe(this,`~standard`,e)},parse:function e(t,n){return go(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await _o(this,t,n,{callee:e})},safeParse(e,t){return vo(this,e,t)},async safeParseAsync(e,t){return yo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){fe(this,`spa`,e)},validate(e,t){return Ke(this,e,t)},validateAsync(e,t){return Je(this,e,t)},encode:function e(t,n){return bo(this,t,n,{callee:e})},decode:function e(t,n){return xo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await So(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Co(this,t,n,{callee:e})},safeEncode(e,t){return wo(this,e,t)},safeDecode(e,t){return To(this,e,t)},async safeEncodeAsync(e,t){return Eo(this,e,t)},async safeDecodeAsync(e,t){return Do(this,e,t)},toJSONSchema(e){return Sa(this,{})(e)},get description(){return oi.get(this)?.description},get _def(){return this._zod.def}}),Ao=_(`_ZodString`,(e,t)=>{on.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r)},l({format:e=>Fa(e).format??null,minLength:e=>Fa(e).minimum??null,maxLength:e=>Fa(e).maximum??null},{regex(...e){return this.check(Ji(...e))},includes(...e){return this.check(Zi(...e))},startsWith(...e){return this.check(Qi(...e))},endsWith(...e){return this.check($i(...e))},min(...e){return this.check(Ki(...e))},max(...e){return this.check(Gi(...e))},length(...e){return this.check(qi(...e))},nonempty(...e){return this.check(Ki(1,...e))},lowercase(e){return this.check(Yi(e))},uppercase(e){return this.check(Xi(e))},trim(){return this.check(na())},normalize(...e){return this.check(ta(...e))},toLowerCase(){return this.check(ra())},toUpperCase(){return this.check(ia())},slugify(){return this.check(aa())}})),jo=_(`ZodString`,(e,t)=>{on.init(e,t),Ao.init(e,t)},{email(e){return this.check(li(Io,e))},url(e){return this.check(hi(zo,e))},jwt(e){return this.check(Ai(es,e))},emoji(e){return this.check(gi(Bo,e))},guid(e){return this.check(ui(Lo,e))},uuid(e){return this.check(di(Ro,e))},uuidv4(e){return this.check(fi(Ro,e))},uuidv6(e){return this.check(pi(Ro,e))},uuidv7(e){return this.check(mi(Ro,e))},nanoid(e){return this.check(_i(Vo,e))},cuid(e){return this.check(vi(Ho,e))},cuid2(e){return this.check(yi(Uo,e))},ulid(e){return this.check(bi(Wo,e))},base64(e){return this.check(Di(Zo,e))},base64url(e){return this.check(Oi(Qo,e))},xid(e){return this.check(xi(Go,e))},ksuid(e){return this.check(Si(Ko,e))},ipv4(e){return this.check(Ci(qo,e))},ipv6(e){return this.check(wi(Jo,e))},cidrv4(e){return this.check(Ti(Yo,e))},cidrv6(e){return this.check(Ei(Xo,e))},e164(e){return this.check(ki($o,e))},datetime(e){return this.check(ji(Mo,e))},date(e){return this.check(Mi(No,e))},time(e){return this.check(Ni(Po,e))},duration(e){return this.check(Pi(Fo,e))}});function G(e){return ci(jo,e)}var K=_(`ZodStringFormat`,(e,t)=>{V.init(e,t),Ao.init(e,t)}),Mo=_(`ZodISODateTime`,(e,t)=>{Tn.init(e,t),K.init(e,t)}),No=_(`ZodISODate`,(e,t)=>{En.init(e,t),K.init(e,t)}),Po=_(`ZodISOTime`,(e,t)=>{Dn.init(e,t),K.init(e,t)}),Fo=_(`ZodISODuration`,(e,t)=>{On.init(e,t),K.init(e,t)}),Io=_(`ZodEmail`,(e,t)=>{ln.init(e,t),K.init(e,t)}),Lo=_(`ZodGUID`,(e,t)=>{sn.init(e,t),K.init(e,t)}),Ro=_(`ZodUUID`,(e,t)=>{cn.init(e,t),K.init(e,t)}),zo=_(`ZodURL`,(e,t)=>{_n.init(e,t),K.init(e,t)}),Bo=_(`ZodEmoji`,(e,t)=>{vn.init(e,t),K.init(e,t)}),Vo=_(`ZodNanoID`,(e,t)=>{yn.init(e,t),K.init(e,t)}),Ho=_(`ZodCUID`,(e,t)=>{bn.init(e,t),K.init(e,t)}),Uo=_(`ZodCUID2`,(e,t)=>{xn.init(e,t),K.init(e,t)}),Wo=_(`ZodULID`,(e,t)=>{Sn.init(e,t),K.init(e,t)}),Go=_(`ZodXID`,(e,t)=>{Cn.init(e,t),K.init(e,t)}),Ko=_(`ZodKSUID`,(e,t)=>{wn.init(e,t),K.init(e,t)}),qo=_(`ZodIPv4`,(e,t)=>{kn.init(e,t),K.init(e,t)}),Jo=_(`ZodIPv6`,(e,t)=>{Mn.init(e,t),K.init(e,t)}),Yo=_(`ZodCIDRv4`,(e,t)=>{Nn.init(e,t),K.init(e,t)}),Xo=_(`ZodCIDRv6`,(e,t)=>{Fn.init(e,t),K.init(e,t)}),Zo=_(`ZodBase64`,(e,t)=>{Rn.init(e,t),K.init(e,t)}),Qo=_(`ZodBase64URL`,(e,t)=>{Vn.init(e,t),K.init(e,t)}),$o=_(`ZodE164`,(e,t)=>{Hn.init(e,t),K.init(e,t)}),es=_(`ZodJWT`,(e,t)=>{Wn.init(e,t),K.init(e,t)}),ts=_(`ZodNumber`,(e,t)=>{Gn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r),e.isFinite=!0},l({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Fa(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Fa(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Fa(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Fa(e).format??null},{gt(e,t){return this.check(Hi(e,t))},gte(e,t){return this.check(Ui(e,t))},min(e,t){return this.check(Ui(e,t))},lt(e,t){return this.check(Bi(e,t))},lte(e,t){return this.check(Vi(e,t))},max(e,t){return this.check(Vi(e,t))},int(e){return this.check(is(e))},safe(e){return this.check(is(e))},positive(e){return this.check(Hi(0,e))},nonnegative(e){return this.check(Ui(0,e))},negative(e){return this.check(Bi(0,e))},nonpositive(e){return this.check(Vi(0,e))},multipleOf(e,t){return this.check(Wi(e,t))},step(e,t){return this.check(Wi(e,t))},finite(){return this}}));function ns(e){return Fi(ts,e)}var rs=_(`ZodNumberFormat`,(e,t)=>{Kn.init(e,t),ts.init(e,t)});function is(e){return Ii(rs,e)}var as=_(`ZodBoolean`,(e,t)=>{qn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r)});function os(e){return Li(as,e)}var ss=_(`ZodUnknown`,(e,t)=>{Jn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function cs(){return Ri(ss)}var ls=_(`ZodNever`,(e,t)=>{Yn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r)});function us(e){return zi(ls,e)}var ds=_(`ZodArray`,(e,t)=>{ko(),Zn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ki(e,t))},nonempty(e){return this.check(Ki(1,e))},max(e,t){return this.check(Gi(e,t))},length(e,t){return this.check(qi(e,t))},unwrap(){return this.element}});function fs(e,t){return oa(ds,e,t)}var ps=_(`ZodObject`,(e,t)=>{ko(),rr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),ve(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return J(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ne(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ne(this._zod.def,{catchall:cs()}))},loose(){return this.clone(ne(this._zod.def,{catchall:cs()}))},strict(){return this.clone(ne(this._zod.def,{catchall:us()}))},strip(){return this.clone(ne(this._zod.def,{catchall:void 0}))},extend(e){return D(this,e)},safeExtend(e){return we(this,e)},merge(e){return _e(this,e)},pick(e){return oe(this,e)},omit(e){return N(this,e)},partial(...e){return se(Os,this,e[0])},exactPartial(...e){return se(As,this,e[0],`exactPartial`)},required(...e){return te(Rs,this,e[0])}});function q(e,t){return new ps({type:`object`,shape:e??{},...L(t)})}function ms(e,t){return new ps({type:`object`,shape:e,catchall:us(),...L(t)})}var hs=_(`ZodUnion`,(e,t)=>{ar.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e.options=t.options});function gs(e,t){return new hs({type:`union`,options:e,...L(t)})}var _s=_(`ZodDiscriminatedUnion`,(e,t)=>{hs.init(e,t),sr.init(e,t)});function vs(e,t,n){return new _s({type:`union`,options:t,discriminator:e,...L(n)})}var ys=_(`ZodIntersection`,(e,t)=>{cr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r)});function bs(e,t){return new ys({type:`intersection`,left:e,right:t})}var xs=_(`ZodRecord`,(e,t)=>{ko(),dr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ss(e,t,n){return!t||!t._zod?new xs({type:`record`,keyType:G(),valueType:e,...L(t)}):new xs({type:`record`,keyType:e,valueType:t,...L(n)})}var Cs=_(`ZodEnum`,(e,t)=>{fr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(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 Cs({...t,checks:[],...L(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 Cs({...t,checks:[],...L(r),entries:i})}});function J(e,t){return new Cs({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}var ws=_(`ZodLiteral`,(e,t)=>{pr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ts(e,t){return new ws({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}var Es=_(`ZodTransform`,(e,t)=>{ko(),mr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new o(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(F(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(F(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ds(e){return new Es({type:`transform`,transform:e})}var Os=_(`ZodOptional`,(e,t)=>{gr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new Os({type:`optional`,innerType:e})}var As=_(`ZodExactOptional`,(e,t)=>{_r.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`optional`,innerType:e})}var Ms=_(`ZodNullable`,(e,t)=>{vr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e){return new Ms({type:`nullable`,innerType:e})}var Ps=_(`ZodDefault`,(e,t)=>{yr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fs(e,t){return new Ps({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():x(t)}})}var Is=_(`ZodPrefault`,(e,t)=>{xr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ls(e,t){return new Is({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():x(t)}})}var Rs=_(`ZodNonOptional`,(e,t)=>{Sr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zs(e,t){return new Rs({type:`nonoptional`,innerType:e,...L(t)})}var Bs=_(`ZodCatch`,(e,t)=>{Tr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Vs(e,t){return new Bs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:C(t)})}var Hs=_(`ZodPipe`,(e,t)=>{Er.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.in=t.in,e.out=t.out});function Us(e,t){return new Hs({type:`pipe`,in:e,out:t})}var Ws=_(`ZodCodec`,(e,t)=>{Hs.init(e,t),Or.init(e,t)});function Gs(e,t,n){return new Ws({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var Ks=_(`ZodReadonly`,(e,t)=>{jr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qs(e){return new Ks({type:`readonly`,innerType:e})}var Js=_(`ZodCustom`,(e,t)=>{Nr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r)});function Ys(e,t={}){return sa(Js,e,t)}function Xs(e,t){return ca(e,t)}function Zs(e){return ji(Mo,e)}var Qs=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var P={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),$s=t(((e,t)=>{t.exports=Qs()})),ec=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),tc=t(((e,t)=>{t.exports=ec()})),Y=e($s(),1),nc=tc(),rc=Y.createContext(void 0),ic=e=>{let t=Y.useContext(rc);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ac=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,nc.jsx)(rc.Provider,{value:e,children:t})),oc={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},sc=new class{#e=oc;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function cc(e){setTimeout(e,0)}var lc=typeof window>`u`||`Deno`in globalThis;function uc(){}function dc(e,t){return typeof e==`function`?e(t):e}function fc(e){return typeof e==`number`&&e>=0&&e!==1/0}function pc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function X(e,t){return typeof e==`function`?e(t):e}function mc(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==gc(o,t.options))return!1}else if(!vc(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function hc(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_c(t.options.mutationKey)!==_c(a))return!1}else if(!vc(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function gc(e,t){return(t?.queryKeyHashFn||_c)(e)}function _c(e){return JSON.stringify(e,(e,t)=>Cc(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function vc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!vc(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!vc(e[r],t[r]))return!1;return!0}return!1}var yc=Object.prototype.hasOwnProperty;function bc(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Sc(e)&&Sc(t);if(!r&&!(Cc(e)&&Cc(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:yc.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=bc(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function xc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Sc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Cc(e){if(!wc(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!wc(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function wc(e){return Object.prototype.toString.call(e)===`[object Object]`}function Tc(e){return new Promise(t=>{sc.setTimeout(t,e)})}function Ec(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:bc(e,t)}function Dc(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Oc(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var kc=Symbol();function Ac(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===kc?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jc(e,t){return typeof e==`function`?e(...t):!!e}function Mc(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Nc=()=>lc,Pc=()=>Nc(),Fc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ic=new class extends Fc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Lc=cc;function Rc(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Lc,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var zc=Rc(),Bc=new class extends Fc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Vc(e){return Math.min(1e3*2**e,3e4)}function Hc(e){return(e??`online`)!==`online`||Bc.isOnline()}var Uc=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Wc(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(uc);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Uc(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ic.isFocused()&&(e.networkMode===`always`||Bc.isOnline())&&e.canRun(),p=()=>Hc(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Pc()?0:3),a=e.retryDelay??Vc,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),Tc(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Gc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fc(this.gcTime)&&(this.#e=sc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Pc()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(sc.clearTimeout(this.#e),this.#e=void 0)}};function Kc(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Mc(e,()=>t.signal,()=>n=!0)},u=Ac(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Oc:Dc;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Jc:qc,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:qc(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function qc(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Jc(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Yc=class extends Gc{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Qc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Qc(this.options);e.data!==void 0&&(this.setState(Zc(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ec(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(uc).catch(uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>X(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>X(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!pc(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ac(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Kc(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Wc({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Uc&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Uc){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Xc(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Zc(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),zc.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Xc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hc(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Zc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Qc(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var $c=class extends Fc{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),tl(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nl(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nl(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof X(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!xc(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&rl(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||X(this.options.staleTime,this.#t)!==X(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xc(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(uc)),t}#h(e){return!Pc()&&X(this.options.enabled,this.#t)!==!1&&fc(e)}#g(){this.#b();let e=X(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=pc(this.#r.dataUpdatedAt,e)+1;this.#u=sc.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return X(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=sc.setInterval(()=>{(this.options.refetchIntervalInBackground||Ic.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(sc.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(sc.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&tl(e,t),o=i&&rl(e,n,t,r);(a||o)&&(l={...l,...Xc(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ec(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ec(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:il(e,t),refetch:this.refetch,isEnabled:X(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),xc(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();zc.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function el(e,t){return X(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||X(t.retryOnMount,e)!==!1)}function tl(e,t){return el(e,t)||e.state.data!==void 0&&nl(e,t,t.refetchOnMount)}function nl(e,t,n){if(X(t.enabled,e)!==!1&&X(t.staleTime,e)!==`static`){let r=X(n,e);return r===`always`||r!==!1&&il(e,t)}return!1}function rl(e,t,n,r){return(e!==t||X(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&il(e,n)}function il(e,t){return X(t.enabled,e)!==!1&&e.isStaleByTime(X(t.staleTime,e))}var al=class extends Gc{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ol(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Wc({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),zc.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ol(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var sl=class extends Fc{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),xc(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&_c(t.mutationKey)!==_c(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ol();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){zc.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},cl=Y.createContext(!1),ll=()=>Y.useContext(cl);cl.Provider;function ul(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dl=Y.createContext(ul()),fl=()=>Y.useContext(dl),pl=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?jc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},ml=e=>{Y.useEffect(()=>{e.clearReset()},[e])},hl=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||jc(n,[e.error,r])),gl=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},_l=(e,t)=>e?.suspense&&t.isPending,vl=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yl(e,t,n){let r=ll(),i=fl(),a=ic(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,gl(o),pl(o,i,s),ml(i);let[l]=Y.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(Y.useSyncExternalStore(Y.useCallback(e=>{let t=d?l.subscribe(zc.batchCalls(e)):uc;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Y.useEffect(()=>{l.setOptions(o)},[o,l]),_l(o,u))throw vl(o,l,i);if(hl({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function bl(e,t){return yl(e,$c,t)}function xl(e,t){let n=ic(t),[r]=Y.useState(()=>new sl(n,e));Y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(zc.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Y.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(uc)},[r]);if(i.error&&jc(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Sl=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Cl=/^[\\/]{2}/;function wl(e,t){return t+e.replace(/\\/g,`/`)}var Tl=`popstate`;function El(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Dl(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return jl(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Ml(t)}return Pl(t,n,null,e)}function Z(e,t){if(e===!1||e==null)throw Error(t)}function Ol(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function kl(){return Math.random().toString(36).substring(2,10)}function Al(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function jl(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Nl(t):t,state:n,key:t&&t.key||r||kl(),mask:i}}function Ml({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Nl(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Pl(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=El(e)?e:jl(h.location,e,t);n&&n(r,e),l=u()+1;let d=Al(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=El(e)?e:jl(h.location,e,t);n&&n(r,e),l=u();let i=Al(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Fl(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Tl,d),c=e,()=>{i.removeEventListener(Tl,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Fl(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Z(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ml(t);return i=i.replace(/ $/,`%20`),!n&&Cl.test(i)&&(i=r+i),new URL(i,r)}var Il=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},Ll=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function Rl(e){return Ll.has(e)}var zl=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function Bl(e){return zl.has(e)}function Vl(e){return e.index===!0}function Hl(e){let t={};return e.Component&&Object.assign(t,{element:Y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:Y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:Y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Ul(e,t=Hl,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(Z(e.index!==!0||!e.children,`Cannot specify children on an index route`),Z(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Vl(e)){let n={...e,id:s};return r[s]=Wl(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Wl(n,t(n)),e.children&&(n.children=Ul(e.children,t,o,r,i)),n}})}function Wl(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Gl(e,t,n=`/`){return Kl(e,t,n,!1)}function Kl(e,t,n,r,i){let a=mu((typeof t==`string`?Nl(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Jl(e),s=null,c=pu(a);for(let e=0;s==null&&e<o.length;++e)s=lu(o[e],c,r);return s}function ql(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function Jl(e){let t=Yl(e);return Zl(t),t}function Yl(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Z(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=wu([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Z(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Yl(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:su(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=fu(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Xl(e.path))a(e,t,!0,n)}),t}function Xl(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Xl(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Zl(e){e.sort((e,t)=>e.score===t.score?cu(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ql=/^:[\w-]+$/,$l=/^:[\w-]+/,eu=3.5,tu=3,nu=2,ru=1,iu=10,au=-2,ou=e=>e===`*`;function su(e,t){let n=e.split(`/`),r=n.length;return n.some(ou)&&(r+=au),t&&(r+=nu),n.filter(e=>!ou(e)).reduce((e,t)=>e+(Ql.test(t)?tu:$l.test(t)?eu:t===``?ru:iu),r)}function cu(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function lu(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?du(u,l,s.matcher,s.compiledParams):uu(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=uu({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:wu([a,d.pathname]),pathnameBase:Eu(wu([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=wu([a,d.pathnameBase]))}return o}function uu(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fu(e.path,e.caseSensitive,e.end);return du(e,t,n,r)}function du(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Tu(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Tu(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function fu(e,t=!1,n=!0){Ol(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function pu(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ol(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function mu(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function hu({basename:e,pathname:t}){return t===`/`?e:wu([e,t])}var gu=e=>Sl.test(e);function _u(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Nl(e):e,a;return n?(n=Cu(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?vu(n.substring(1),`/`):vu(n,t)):a=t,{pathname:a,search:Du(r),hash:Ou(i)}}function vu(e,t){let n=Tu(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function yu(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function bu(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function xu(e){let t=bu(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Su(e,t,n,r=!1){let i;typeof e==`string`?i=Nl(e):(i={...e},Z(!i.pathname||!i.pathname.includes(`?`),yu(`?`,`pathname`,`search`,i)),Z(!i.pathname||!i.pathname.includes(`#`),yu(`#`,`pathname`,`hash`,i)),Z(!i.search||!i.search.includes(`#`),yu(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_u(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Cu=e=>e.replace(/[\\/]{2,}/g,`/`),wu=e=>Cu(e.join(`/`));function Tu(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Eu=e=>Tu(e).replace(/^\/*/,`/`),Du=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ou=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ku=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Au=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ju(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Mu(e){return wu(e.map(e=>e.route.path).filter(Boolean))||`/`}function Nu(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?Nl(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Pu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Fu(e,t){let n=e;if(typeof n!=`string`||!Sl.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Pu)try{let e=new URL(window.location.href),r=Cl.test(n)?new URL(wl(n,e.protocol)):new URL(n),a=mu(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ol(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Iu=Symbol(`Uninstrumented`),Lu=new WeakMap;function Ru(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>Wu(await Gu(n.lazy,void 0,()=>e(...t),Ku))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>Wu(await Gu(n[`lazy.middleware`],void 0,()=>t(...e),Ku))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Wu(await Gu(n[`lazy.loader`],void 0,()=>t(...e),Ku))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Wu(await Gu(n[`lazy.action`],void 0,()=>t(...e),Ku))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Bu(t.loader),i=async(...t)=>Wu(await Gu(n.loader,qu(t[0]),()=>e(...t),Ku));e.hydrate===!0&&(i.hydrate=!0),Vu(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Bu(t.action),i=async(...t)=>Wu(await Gu(n.action,qu(t[0]),()=>e(...t),Ku));Vu(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Bu(e),r=async(...e)=>Wu(await Gu(n.middleware,qu(e[0]),()=>t(...e),Ku));return Vu(r,t),r})),r}function zu(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Bu(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?Ml(i):`.`,...Ju(e,a??{})};return Wu(await Gu(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Hu(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Ku(e),meta:o})))};Vu(r,t),e.navigate=r}if(n.fetch.length>0){let t=Bu(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Wu(await Gu(n.fetch,{href:o??`.`,fetcherKey:i,...Ju(e,s??{})},async()=>{let n=Hu(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Ku(e),meta:c})))};Vu(r,t),e.fetch=r}return e}function Bu(e){return e[Iu]??e}function Vu(e,t){e[Iu]=t}function Hu(e,t){return Lu.set(e,t),()=>{Lu.get(e)===t&&Lu.delete(e)}}function Uu(e){let t=Lu.get(e);return Lu.delete(e),t}function Wu(e){if(e.type===`error`)throw e.value;return e.value}async function Gu(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=Gu(e,t,n,r,i,a-1),await s,Z(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function Ku(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function qu(e){let{request:t,context:n,params:r}=e;return{...e,request:Yu(t),params:{...r},context:Xu(n)}}function Ju(e,t){return{currentUrl:Ml(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Yu(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Xu(e){return{get:t=>e.get(t)}}var Zu=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=Jl(e)}match(e,t=!1){return Kl(this.#e,e,this.#n,t,this.#t)}},Qu=new URL(`http://localhost`);function $u(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Qu)}catch{return Qu}}function ed(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function td(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function nd(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!ed(i,n),s=!ed(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!td(e,i)||!ed(i,a)))throw Error(`External navigation is not allowed`)}var rd=[`POST`,`PUT`,`PATCH`,`DELETE`],id=new Set(rd),ad=[`GET`,...rd],od=new Set(ad),sd=new Set([301,302,303,307,308]),cd=new Set([307,308]),ld={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ud={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},dd={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},fd=`remix-router-transitions`,pd=Symbol(`ResetLoaderData`);function md(e,t){return e.unstable_routePatternMatching?(Z(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Zu(t)}var hd=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}};function gd(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;Z(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...Ru(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=md(o,s),l={},u=new hd(Ul(e.routes,a,void 0,l),c),d=e.dataStrategy||Nd,f=null,p=new Set,m=null,h=null,g=null,_=null,v=e.hydrationData!=null,y=c.match(e.history.location),b=!1,x=null,S,C;if(y==null&&!e.patchRoutesOnNavigation){let t=rf(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=nf(u.activeRoutes);S=!0,C=!S,y=n,x={[r.id]:t}}else if(y&&!e.hydrationData&&Ge(y,e.history.location.pathname).active&&(y=null),!y){S=!1,C=!S,y=[];let t=Ge(null,e.history.location.pathname);t.active&&t.matches&&(b=!0,y=t.matches)}else if(y.some(e=>e.route.lazy))S=!1,C=!S;else if(!y.some(e=>xd(e.route)))S=!0,C=!S;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=y;if(n){let e=y.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}C=!1,S=!0,r.forEach(e=>{let r=Sd(e.route,t,n);C||=r.renderFallback,S&&=!r.shouldLoad})}let w,T={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,renderFallback:C,navigation:ld,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=`POP`,D=null,ee=!1,O,k=!1,A=new Map,j=null,te=!1,M=!1,ne=new Set,N=new Map,re=0,ie=-1,ae=new Map,P=new Set,oe=new Map,se=new Map,ce=new Set,F=new Map,I,L=null;function R(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(I){I(),I=void 0;return}Ol(F.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=ze({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{I=e});e.history.go(r*-1),Re(i,{state:`blocked`,location:n,proceed(){Re(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(T.blockers);e.set(i,dd),z({blockers:e})}}),D?.resolve(),D=null;return}return me(t,n)}),n){Of(t,A);let e=()=>kf(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||me(`POP`,T.location,{initialHydration:!0}),w}function le(){f&&f(),j&&j(),p.clear(),O&&O.abort(),T.fetchers.forEach((e,t)=>Ae(T.fetchers,t)),T.blockers.forEach((e,t)=>Le(t))}function ue(e){if(p.add(e),m){let{newErrors:t}=m;m=null,e(T,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)}function z(e,t={}){e.matches&&=e.matches.map(e=>{let t=l[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),T={...T,...e};let n=[],r=[];T.fetchers.forEach((e,t)=>{e.state===`idle`&&(ce.has(t)?n.push(t):r.push(t))}),ce.forEach(e=>{!T.fetchers.has(e)&&!N.has(e)&&n.push(e)}),p.size===0&&(m={newErrors:e.errors??null}),[...p].forEach(r=>r(T,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ae(T.fetchers,e)),r.forEach(e=>T.fetchers.delete(e))}function de(t,n,{flushSync:r}={}){let i=T.actionData!=null&&T.navigation.formMethod!=null&&Q(T.navigation.formMethod)&&T.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?T.actionData:null;let o=n.loaderData?$d(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,s=T.blockers;s.size>0&&!te&&(s=new Map(s),s.forEach((e,t)=>s.set(t,dd)));let c=!te&&We(t,n.matches||T.matches),l=ee===!0||T.navigation.formMethod!=null&&Q(T.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),te||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!te&&t!==T.location){let e=A.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(k){let e=A.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(T.location.pathname,e)),d={currentLocation:T.location,nextLocation:t}}z({...n,actionData:a,loaderData:o,historyAction:E,location:t,initialized:!0,renderFallback:!1,navigation:ld,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,ee=!1,k=!1,te=!1,M=!1,D?.resolve(),D=null,L?.resolve(),L=null}async function fe(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=Af();let n=D.promise;return e.history.go(t),n}let r=Uu(w),{path:i,submission:a,error:o}=yd(!1,vd(T.location,T.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?Nl(n.mask):{...T.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},Cl.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),nd(typeof n.mask==`string`?n.mask:Ml(n.mask),Ml(c),e.history.createURL(`/`),`reject`)}let l=T.location,u=jl(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},nd(t==null?e.history.createHref(T.location):typeof t==`string`?t:Ml(t),e.history.createHref(u.mask||u),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Q(a.formMethod)&&a.formAction===T.location.pathname+T.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=ze({currentLocation:l,nextLocation:u,historyAction:f});if(h){Re(h,{state:`blocked`,location:u,proceed(){Re(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),fe(t,n)},reset(){let e=new Map(T.blockers);e.set(h,dd),z({blockers:e})}});return}await me(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function pe(){L||=Af(),Te(),z({revalidation:`loading`});let e=L.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(me(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(me(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:k===!0}),e)}async function me(t,n,r){O&&O.abort(),O=null,E=t,te=(r&&r.startUninterruptedRevalidation)===!0,Ue(T.location,T.matches),ee=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&T.matches&&T.matches.length>0&&!b?T.matches:c.match(n),a=(r&&r.flushSync)===!0;if(i&&T.initialized&&!M&&sf(T.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){de(n,{matches:i},{flushSync:a});return}let o=Ge(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=xf(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=Be(n.pathname);de(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;O=new AbortController;let l=Jd(e.history,n,O.signal,r&&r.submission),u=e.getContext?await e.getContext():new Il,d;if(r&&r.pendingError)d=[tf(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let c=await he(l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(c.shortCircuited)return;if(c.pendingActionResult){let[e,t]=c.pendingActionResult;if(ff(t)&&ju(t.error)&&t.error.status===404){O=null,de(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,d=c.pendingActionResult,s=Cf(n,i,t,r.submission),a=!1,o.active=!1,l=Jd(e.history,l.url,l.signal)}let{shortCircuited:f,matches:p,loaderData:m,errors:h,workingFetchers:g}=await ge(l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,d,r&&r.callSiteDefaultShouldRevalidate);f||(O=null,de(n,{matches:p||i,...ef(d),loaderData:m,errors:h,...g?{fetchers:g}:{}}))}async function he(t,n,i,o,c,d,f,p,m={}){if(Te(),z({navigation:wf(n,o,c,i)},{flushSync:m.flushSync===!0}),f){let e=await Ke(o,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=nf(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=tf(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)o=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Be(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=bf(o,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:rf(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ce(t,n,zd(a,l,t,n,o,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of o)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(pf(h)){let n;return n=m&&m.replace!=null?m.replace:qd(h.response.headers.get(`Location`),new URL(t.url),s,e.history)===T.location.pathname+T.location.search,await Se(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(ff(h)){let e=tf(o,g.route.id);return(m&&m.replace)!==!0&&(E=`PUSH`),{matches:o,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:o,pendingActionResult:[g.route.id,h]}}async function ge(t,n,i,o,s,d,f,p,m,h,g,_,v,y){let b=f||Cf(n,i,o,p),x=p||m||Sf(b),S=!te&&!g;if(d){if(S){let e=_e(v);z({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Ke(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=nf(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=tf(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Be(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let{dsMatches:C,revalidatingFetchers:w}=bd(t,s,a,l,e.history,T,i,x,n,g?[]:r,g===!0,M,ne,ce,oe,P,c,v,y);if(ie=++re,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&w.length===0){let e=new Map(T.fetchers),t=Pe(e);return de(n,{matches:i,loaderData:{},errors:v&&ff(v[1])?{[v[0]]:v[1].error}:null,...ef(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=_e(v);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=ve(w)),z(e,{flushSync:_})}w.forEach(e=>{Me(e.key),e.controller&&N.set(e.key,e.controller)});let E=()=>w.forEach(e=>Me(e.key));O&&O.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:ee}=await we(C,w,t,n,s);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,E),w.forEach(e=>N.delete(e.key));let k=af(D);if(k)return await Se(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=af(ee),k)return P.add(k.key),await Se(t,k.result,!0,{replace:h}),{shortCircuited:!0};let A=new Map(T.fetchers),{loaderData:j,errors:ae}=Qd(T,i,D,v,w,ee,A);g&&T.errors&&(ae={...T.errors,...ae});let se=Pe(A),F=Fe(ie,A),I=se||F||w.length>0;return{matches:i,loaderData:j,errors:ae,...I?{workingFetchers:A}:{}}}function _e(e){if(e&&!ff(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function ve(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Tf(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function ye(t,n,r,i){Me(t);let a=(i&&i.flushSync)===!0,o=Uu(w),l=vd(T.location,T.matches,s,r,n,i?.relative),u=c.match(l),d=Ge(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(xf(e.history,l,u)),!u){De(t,n,rf(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=yd(!0,l,i);if(m){De(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new Il,g=(i&&i.preventScrollReset)===!0;if(p&&Q(p.formMethod)){await be(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};oe.set(t,_),await xe(t,_,u,h,a,g,p)}async function be(t,n,i,o,s,u,d,f,p,m){Te(),oe.delete(t),Ee(t,Ef(p,T.fetchers.get(t)),{flushSync:d});let h=new AbortController,g=Jd(e.history,i,h.signal,p);if(u){let e=await Ke(o,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){De(t,n,e.error,{flushSync:d});return}if(e.matches)o=e.matches;else{De(t,n,rf(404,{pathname:i}),{flushSync:d});return}}let _=bf(o,i);if(!_.route.action&&!_.route.lazy){De(t,n,rf(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:d});return}N.set(t,h);let v=re,y=zd(a,l,g,i,o,_,r,s),b=await Ce(g,i,y,s,t),x=b[_.route.id];if(!x){for(let e of y)if(b[e.route.id]){x=b[e.route.id];break}}if(g.signal.aborted){N.get(t)===h&&N.delete(t);return}if(ce.has(t)){if(pf(x)||ff(x)){Ee(t,Df(void 0));return}}else{if(pf(x)){if(N.delete(t),ie>v){Ee(t,Df(void 0));return}return P.add(t),Ee(t,Tf(p)),Se(g,x,!1,{fetcherSubmission:p,preventScrollReset:f})}if(ff(x)){De(t,n,x.error);return}}let S=T.navigation.location||T.location,C=Jd(e.history,S,h.signal),w=T.navigation.state===`idle`?T.matches:c.match(T.navigation.location);Z(w,`Didn't find any matches after fetcher action`);let D=++re;ae.set(t,D);let{dsMatches:ee,revalidatingFetchers:k}=bd(C,s,a,l,e.history,T,w,p,S,r,!1,M,ne,ce,oe,P,c,[_.route.id,x],m),A=Tf(p,x.data),j=new Map(T.fetchers);j.set(t,A),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=j.get(t),r=Tf(void 0,n?n.data:void 0);j.set(t,r),Me(t),e.controller&&N.set(t,e.controller)}),z({fetchers:j});let te=()=>k.forEach(e=>Me(e.key));h.signal.addEventListener(`abort`,te);let{loaderResults:se,fetcherResults:F}=await we(ee,k,C,S,s);if(h.signal.aborted){ae.get(t)===D&&ae.delete(t);return}h.signal.removeEventListener(`abort`,te),ae.delete(t),N.delete(t),k.forEach(e=>N.delete(e.key));let I=T.fetchers.has(t),L=e=>{if(!I)return e;let n=new Map(e.fetchers);return n.set(t,Df(x.data)),{...e,fetchers:n}},R=af(se);if(R)return T=L(T),Se(C,R.result,!1,{preventScrollReset:f});if(R=af(F),R)return P.add(R.key),T=L(T),Se(C,R.result,!1,{preventScrollReset:f});let le=new Map(T.fetchers);I&&le.set(t,Df(x.data));let{loaderData:ue,errors:fe}=Qd(T,w,se,void 0,k,F,le);Fe(D,le),T.navigation.state===`loading`&&D>ie?(Z(E,`Expected pending action`),O&&O.abort(),de(T.navigation.location,{matches:w,loaderData:ue,errors:fe,fetchers:le})):(z({errors:fe,loaderData:$d(T.loaderData,ue,w,fe),fetchers:le}),M=!1)}async function xe(t,n,i,o,s,c,u){let{routeId:d,path:f}=n,p=T.fetchers.get(t);Ee(t,Tf(u,p?p.data:void 0),{flushSync:s});let m=new AbortController,h=Jd(e.history,f,m.signal);if(n.isDiscovering){let e=await Ke(i,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){De(t,d,e.error,{flushSync:s});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{De(t,d,rf(404,{pathname:f}),{flushSync:s});return}}let g=bf(i,f);N.set(t,m);let _=re,v=await Ce(h,f,zd(a,l,h,f,i,g,r,o),o,t),y=v[g.route.id];if(!y){for(let e of i)if(v[e.route.id]){y=v[e.route.id];break}}if(N.get(t)===m&&N.delete(t),!h.signal.aborted){if(ce.has(t)){Ee(t,Df(void 0));return}if(pf(y)){if(ie>_){Ee(t,Df(void 0));return}P.add(t),await Se(h,y,!1,{preventScrollReset:c});return}if(ff(y)){De(t,d,y.error);return}Ee(t,Df(y.data))}}async function Se(r,i,a,{submission:o,fetcherSubmission:c,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(M=!0);let d=i.response.headers.get(`Location`);Z(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=qd(d,p,s,e.history),nd(f,d,p,`allow-explicit`);let m=jl(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(gu(d)){let n=Fl(t,d,!0);e=n.origin!==t.location.origin||mu(n.pathname,s)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=T.navigation;!o&&!c&&g&&_&&v&&(o=Sf(T.navigation));let y=o||c;cd.has(i.response.status)&&y&&Q(y.formMethod)?await me(h,m,{submission:{...y,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?k:void 0}):await me(h,m,{overrideNavigation:Cf(m,[],h,o),fetcherSubmission:c,preventScrollReset:l||ee,enableViewTransition:a?k:void 0})}async function Ce(e,t,n,r,i){let a,o={};try{a=await Bd(d,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Q(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!T.loaderData.hasOwnProperty(e.route.id)&&(!T.errors||!T.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(df(r)){let i=r.result;o[t]={type:`redirect`,response:Wd(i,e,t,n,s)}}else o[t]=await Ud(r);return o}async function we(e,t,n,r,i){let a=Ce(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ce(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:rf(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Te(){M=!0,oe.forEach((e,t)=>{N.has(t)&&ne.add(t),Me(t)})}function Ee(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),z({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function De(e,t,n,r={}){let i=tf(T.matches,t),a=new Map(T.fetchers);Ae(a,e),z({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Oe(e){return se.set(e,(se.get(e)||0)+1),ce.has(e)&&ce.delete(e),T.fetchers.get(e)||ud}function ke(e,t){Me(e,t?.reason),Ee(e,Df(null))}function Ae(e,t){let n=T.fetchers.get(t);N.has(t)&&!(n&&n.state===`loading`&&ae.has(t))&&Me(t),oe.delete(t),ae.delete(t),P.delete(t),ce.delete(t),ne.delete(t),e.delete(t)}function je(e){let t=(se.get(e)||0)-1;t<=0?(se.delete(e),ce.add(e)):se.set(e,t),z({fetchers:new Map(T.fetchers)})}function Me(e,t){let n=N.get(e);n&&(n.abort(t),N.delete(e))}function Ne(e,t){for(let n of e){let e=t.get(n);Z(e,`Expected fetcher: ${n}`);let r=Df(e.data);t.set(n,r)}}function Pe(e){let t=[],n=!1;for(let r of P){let i=e.get(r);Z(i,`Expected fetcher: ${r}`),i.state===`loading`&&(P.delete(r),t.push(r),n=!0)}return Ne(t,e),n}function Fe(e,t){let n=[];for(let[r,i]of ae)if(i<e){let e=t.get(r);Z(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Me(r),ae.delete(r),n.push(r))}return Ne(n,t),n.length>0}function Ie(e,t){let n=T.blockers.get(e)||dd;return F.get(e)!==t&&F.set(e,t),n}function Le(e){T.blockers.delete(e),F.delete(e)}function Re(e,t){let n=T.blockers.get(e)||dd;Z(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),z({blockers:r})}function ze({currentLocation:e,nextLocation:t,historyAction:n}){if(F.size===0)return;F.size>1&&Ol(!1,`A router only supports one blocker at a time`);let r=Array.from(F.entries()),[i,a]=r[r.length-1],o=T.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Be(e){let t=rf(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=nf(n);return{notFoundMatches:r,route:i,error:t}}function Ve(e,t,n){if(h=e,_=t,g=n||null,!v&&T.navigation===ld){v=!0;let e=We(T.location,T.matches);e!=null&&z({restoreScrollPosition:e})}return()=>{h=null,_=null,g=null}}function He(e,t){return g&&g(e,t.map(e=>ql(e,T.loaderData)))||e.key}function Ue(e,t){if(h&&_){let n=He(e,t);h[n]=_()}}function We(e,t){if(h){let n=He(e,t),r=h[n];if(typeof r==`number`)return r}return null}function Ge(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:c.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:c.match(n,!0)}}return{active:!1,matches:null}}async function Ke(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let o=t;for(;;){let t=l;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:o,fetcherKey:i,patch:(e,n)=>{r.aborted||Ed(e,n,u,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:o}}if(r.aborted)return{type:`aborted`};let s=c.match(n),d=null;if(s&&(Object.keys(s[0].params).length===0||(d=c.match(n,!0),!(d&&o.length<d.length&&qe(o,d.slice(0,o.length))))))return{type:`success`,matches:s};if(d||=c.match(n,!0),!d||qe(o,d))return{type:`success`,matches:null};o=d}}function qe(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Je(e){l={},u.setHmrRoutes(Ul(e,a,void 0,l))}function Ye(e,t,n=!1){Ed(e,t,u,l,a,n),u.hasHMRRoutes||z({})}return w={get basename(){return s},get future(){return o},get state(){return T},get routes(){return u.stableRoutes},match(e){return c.match(e)},get manifest(){return l},get window(){return t},initialize:R,subscribe:ue,enableScrollRestoration:Ve,navigate:fe,fetch:ye,revalidate:pe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Oe,resetFetcher:ke,deleteFetcher:je,dispose:le,getBlocker:Ie,deleteBlocker:Le,patchRoutes:Ye,_internalFetchControllers:N,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){z(e)}},e.instrumentations&&(w=zu(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function _d(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function vd(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Su(r||`.`,xu(o),mu(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=yf(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=hu({basename:n,pathname:c.pathname})),Ml(c)}function yd(e,t,n){if(!n||!_d(n))return{path:t};if(n.formMethod&&!vf(n.formMethod))return{path:t,error:rf(405,{method:n.formMethod})};let r=()=>({path:t,error:rf(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=of(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Q(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}Z(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Yd(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Yd(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Xd(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Xd(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Q(c.formMethod))return{path:t,submission:c};let l=Nl(t);return e&&l.search&&yf(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ml(l),submission:c}}function bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?ff(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&ff(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=Mu(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!xd(s))f=!1;else if(u){let{shouldLoad:e}=Sd(s,a.loaderData,a.errors);f=e}else Cd(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Rd(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?wd(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Rd(n,r,e,c,E,i,l,t,Td(i,m),m,v)}),ee=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){ee.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=bf(_,e.path),b=new AbortController,x=Jd(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=zd(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=zd(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};Td(y,a)&&(S=zd(n,r,x,e.path,_,y,l,t,a))}S&&ee.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:ee}}function xd(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Sd(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!xd(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Cd(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function wd(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Td(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Ed(e,t,n,r,i,a){let o;if(e){let t=r[e];Z(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Dd(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Ul(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=Ul([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Dd(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Dd(e,t)))??!1}var Od=new WeakMap,kd=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Z(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Od.get(i);o||(o={},Od.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Rl(e),n=i[e]!==void 0;if(t)Ol(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)Ol(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Ad=new WeakMap;function jd(e,t,n,r,i){let a=n[e.id];if(Z(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Ad.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Z(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Bl(e),o=a[e]!==void 0;i?Ol(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?Ol(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Ad.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=kd({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Md(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Nd(e){return e.matches.some(e=>e.route.middleware)?Pd(e,()=>Md(e)):Md(e)}function Pd(e,t){return Fd(e,t,e=>{if(_f(e))throw e;return e},lf,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[tf(r,a).route.id]:{type:`error`,result:t}}}}}async function Fd(e,t,n,r,i){let{matches:a,...o}=e;return await Id(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Id(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Id(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Ld(e,t,n,r,i){let a=kd({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=jd(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Rd(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Ld(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Td(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Td(a,{...l,defaultShouldRevalidate:e}):Td(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?Vd({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function zd(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Rd(e,t,n,r,Mu(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Ld(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Bd(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Nu(t,n),pattern:Mu(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Pd(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Vd({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Nu(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw rf(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw rf(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Hd(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Ud(e){let{result:t,type:n}=e;if(hf(t)){let e;try{e=await Hd(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Au(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?mf(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:cf(t),statusCode:ju(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ju(t)?t.status:void 0}:mf(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Wd(e,t,n,r,i){let a=e.headers.get(`Location`);if(Z(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!gu(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=vd(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Gd=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Kd(e){try{return Gd.includes(new URL(e).protocol)}catch{return!1}}function qd(e,t,n,r){if(gu(e)){let r=e,i=Cl.test(r)?new URL(wl(r,t.protocol)):new URL(r);if(Kd(i.toString()))throw Error(`Invalid redirect location`);let a=mu(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Cu(i.pathname)+i.search+i.hash}try{if(Kd(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Jd(e,t,n,r){let i=e.createURL(of(t)).toString(),a={signal:n};if(r&&Q(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Yd(r.formData):r.formData}return new Request(i,a)}function Yd(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Xd(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Zd(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&ff(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(Z(!pf(f),`Cannot handle redirect results in processLoaderData`),ff(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=tf(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=pd),c||(c=!0,s=ju(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Qd(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Zd(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(Z(s,`Did not find corresponding fetcher result`),ff(s)){let t=tf(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(pf(s))Z(!1,`Unhandled fetcher revalidation redirect`);else{let e=Df(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function $d(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==pd).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function ef(e){return e?ff(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function tf(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function nf(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function rf(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Au(e||500,o,Error(s),!0)}function af(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(pf(r))return{key:n,result:r}}}function of(e){return Ml({...typeof e==`string`?Nl(e):e,hash:``})}function sf(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function cf(e){return new Au(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function lf(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&uf(t))}function uf(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function df(e){return hf(e.result)&&sd.has(e.result.status)}function ff(e){return e.type===`error`}function pf(e){return(e&&e.type)===`redirect`}function mf(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function hf(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function gf(e){return sd.has(e)}function _f(e){return hf(e)&&gf(e.status)&&e.headers.has(`Location`)}function vf(e){return od.has(e.toUpperCase())}function Q(e){return id.has(e.toUpperCase())}function yf(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function bf(e,t){let n=typeof t==`string`?Nl(t).search:t.search;if(e[e.length-1].route.index&&yf(n||``))return e[e.length-1];let r=bu(e);return r[r.length-1]}function xf(e,t,n){return{url:Nu(e.createURL(t),t),pattern:n?Mu(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Sf(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Cf(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function wf(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Tf(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ef(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Df(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Of(e,t){try{let n=e.sessionStorage.getItem(fd);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function kf(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(fd,JSON.stringify(n))}catch(e){Ol(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Af(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var jf=Y.createContext(null);jf.displayName=`DataRouter`;var Mf=Y.createContext(null);Mf.displayName=`DataRouterState`;var Nf=Y.createContext(null);Nf.displayName=`DataRouterData`;var Pf=Y.createContext(null);Pf.displayName=`DataRouterNavigation`;var Ff=Y.createContext(!1);function If(){return Y.useContext(Ff)}var Lf=Y.createContext({isTransitioning:!1});Lf.displayName=`ViewTransition`;var Rf=Y.createContext(null);Rf.displayName=`Fetchers`;var zf=Y.createContext(null);zf.displayName=`Await`;var Bf=Y.createContext(null);Bf.displayName=`Navigation`;var Vf=Y.createContext(null);Vf.displayName=`Location`;var Hf=Y.createContext({outlet:null,matches:[],isDataRoute:!1});Hf.displayName=`Route`;var Uf=Y.createContext(!1);Uf.displayName=`IsDataRoute`;var Wf=Y.createContext(void 0);Wf.displayName=`RouteId`;var Gf=Y.createContext(null);Gf.displayName=`RouteError`;var Kf=`REACT_ROUTER_ERROR`,qf=`REDIRECT`,Jf=`ROUTE_ERROR_RESPONSE`;function Yf(e){if(e.startsWith(`${Kf}:${qf}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Xf(e){if(e.startsWith(`${Kf}:${Jf}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Au(t.status,t.statusText,t.data)}catch{}}function Zf(e,{relative:t}={}){Z(Qf(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=Y.useContext(Bf),{hash:i,pathname:a,search:o}=sp(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:wu([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Qf(){return Y.useContext(Vf)!=null}function $f(){return Z(Qf(),`useLocation() may be used only in the context of a <Router> component.`),Y.useContext(Vf).location}var ep=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function tp(){return Y.useContext(Uf)?Dp():np()}function np(){Z(Qf(),`useNavigate() may be used only in the context of a <Router> component.`);let e=Y.useContext(jf),{basename:t,navigator:n}=Y.useContext(Bf),{matches:r}=Y.useContext(Hf),{pathname:i}=$f(),a=JSON.stringify(xu(r)),o=Y.useRef(!1);return Y.useLayoutEffect(()=>{o.current=!0}),Y.useCallback((r,s={})=>{if(Ol(o.current,ep),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Su(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:wu([t,c.pathname])),nd(typeof r==`string`?r:Ml(r),n.createHref(c),$u(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var rp=Y.createContext(null);function ip(){return Y.useContext(rp)}function ap(e){let t=Y.useContext(Hf).outlet;return Y.useMemo(()=>t&&Y.createElement(rp.Provider,{value:e},t),[t,e])}function op(){let{matches:e}=Y.useContext(Hf);return e[e.length-1]?.params??{}}function sp(e,{relative:t}={}){let{matches:n}=Y.useContext(Hf),{pathname:r}=$f(),i=JSON.stringify(xu(n));return Y.useMemo(()=>Su(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function cp(e,t,n){Z(Qf(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=Y.useContext(Bf),{matches:i}=Y.useContext(Hf),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=$f(),l;if(t){let e=typeof t==`string`?Nl(t):t;Z(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):Gl(e,{pathname:d});let p=hp(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:wu([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:wu([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?Y.createElement(Vf.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function lp(){let e=wp(),t=ju(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return Y.createElement(Y.Fragment,null,Y.createElement(`h2`,null,`Unexpected Application Error!`),Y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?Y.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var up=Y.createElement(lp,null),dp=class extends Y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=Ff;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Xf(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:Y.createElement(Hf.Provider,{value:this.props.routeContext},Y.createElement(Uf.Provider,{value:this.props.routeContext.isDataRoute},Y.createElement(Wf.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},Y.createElement(Gf.Provider,{value:e,children:this.props.component}))));return this.context?Y.createElement(pp,{error:e},t):t}},fp=new WeakMap;function pp({children:e,error:t}){let{basename:n,navigator:r}=Y.useContext(Bf);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Yf(t.digest);if(e){let i=fp.get(t);if(i)throw i;let a=Fu(e.location,n),o=a.absoluteURL||a.to;if(nd(e.location,o,$u(r),`allow-explicit`),Kd(o))throw Error(`Invalid redirect location`);if(Pu&&!fp.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw fp.set(t,n),n}}return Y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function mp({routeContext:e,match:t,children:n}){let r=Y.useContext(jf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Y.createElement(Hf.Provider,{value:e},Y.createElement(Uf.Provider,{value:e.isDataRoute},Y.createElement(Wf.Provider,{value:t.route.id},n)))}function hp(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Z(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Mu(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||up,o&&(s<0&&c===0?(kp(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?Y.createElement(n.route.Component,null):n.route.element?n.route.element:e,Y.createElement(mp,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?Y.createElement(dp,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function gp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _p(e){let t=Y.useContext(jf);return Z(t,gp(e)),t}function vp(e){let t=Y.useContext(Mf);return Z(t,gp(e)),t}function yp(e){let t=Y.useContext(Nf);return Z(t,gp(e)),t}function bp(e){let t=Y.useContext(Pf);return Z(t,gp(e)),t}function xp(e){let t=Y.useContext(Wf);return Z(t,`${e} can only be used on routes that contain a unique "id"`),t}function Sp(){let{navigation:e}=bp(`useNavigation`);return Y.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function Cp(){let{matches:e}=vp(`useMatches`),{loaderData:t}=yp(`useMatches`);return Y.useMemo(()=>e.map(e=>ql(e,t)),[e,t])}function wp(){let e=Y.useContext(Gf),t=yp(`useRouteError`),n=xp(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Tp=0;function Ep(e){let{router:t,basename:n}=_p(`useBlocker`),r=vp(`useBlocker`),[i,a]=Y.useState(``),o=Y.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:mu(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:mu(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return Y.useEffect(()=>{let e=String(++Tp);return a(e),()=>t.deleteBlocker(e)},[t]),Y.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):dd}function Dp(){let{router:e}=_p(`useNavigate`),t=xp(`useNavigate`),n=Y.useRef(!1);return Y.useLayoutEffect(()=>{n.current=!0}),Y.useCallback(async(r,i={})=>{Ol(n.current,ep),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Op={};function kp(e,t,n){!t&&!Op[e]&&(Op[e]=!0,Ol(!1,n))}var Ap=/:(\d+)(?:-(\d+))?$/,jp=/^(?:[A-Za-z]:\/|\/\/(?!\/)|\/)/;function Mp(e){return Ap.exec(e)?.[0]??``}function Np(e){return Fp(Pp(e))}function Pp(e){return e.replace(Ap,``).replaceAll(`\\`,`/`)}function Fp(e){let t=jp.exec(e)?.[0]??``,n=[];for(let r of e.slice(t.length).split(`/`)){if(r===``||r===`.`)continue;let e=n.at(-1);r===`..`?e!==void 0&&e!==`..`?n.pop():t===``&&n.push(r):n.push(r)}return`${t}${n.join(`/`)}`}function Ip({open:e,weeklyNet:t,weeks:n,until:r}){return e===0?{kind:`no-open`}:n!==null&&r!==null?{kind:`clears`,weeks:n,until:new Date(r)}:t===0?{kind:`not-shrinking`}:{kind:`grows`,perWeek:Ce(-t)}}function Lp(e){return e%7==0?{unit:`week`,count:e/7}:{unit:`day`,count:e}}function Rp(e){return{categoryLabel:t=>t===void 0?e.noCategory:e.category[t],categoryRowLabel:t=>e.categoryRow[t],foundRowLabel:t=>e.found[t],statusLabel:t=>e.status[t],priorityLabel:t=>e.priority[t],typeLabel:t=>e.type[t],resolutionLabel:t=>e.resolution[t],evidenceLabel:t=>e.evidence[t],checkMethodLabel:t=>e.checkMethod[t],duplicateMatchLabel:t=>e.duplicateMatch[t],graphStateLabel:t=>e.graphState[t]}}function zp(e){return t=>[...new Set(t.map(e))].join(`; `)}var Bp={number:0,nan:NaN,string:``,boolean:!1,bigint:0n,symbol:Symbol(),function:()=>void 0,undefined:void 0,null:null,array:[],object:{}};function Vp(e,{issue:t,receivedType:n}){let r=n===void 0?void 0:Hp(n),i=e({...t,input:r});return typeof i==`string`?i:i?.message??t.message}function Hp(e){return e in Bp?Bp[e]:Object.create({constructor:{name:e}})}var Up=$r().localeError,Wp={bloaters:`Bloaters`,"change-preventers":`Change preventers`,couplers:`Couplers`,"data-dealers":`Data dealers`,dispensables:`Dispensables`,"functional-abusers":`Functional abusers`,"lexical-abusers":`Lexical abusers`,"oo-abusers":`OO abusers`,obfuscators:`Obfuscators`,bug:`Bug`},Gp=`not set`,Kp={category:Wp,noCategory:Gp,categoryRow:{...Wp,unset:Gp,unknown:`unknown`},found:{review:`in review`,incidental:`incidentally`,manual:`manually`,unknown:`unknown`,unset:`not recorded`},status:{backlog:`backlog`,"in-progress":`in progress`,blocked:`blocked`,done:`done`,cancelled:`cancelled`},type:{task:`task`,epic:`epic`},priority:{low:`low`,medium:`medium`,high:`high`,critical:`critical`},resolution:{fixed:`fixed`,obsolete:`code gone`,duplicate:`duplicate`,"epic-done":`epic done`},evidence:{"source-changed":`code changed`,"source-missing":`file missing`,duplicate:`duplicate`,"no-source":`no source`,total:`Total`},checkMethod:{symbol:`by symbol`,anchor:`by source lines`,file:`by file`},duplicateMatch:{source:`by code location`,title:`by title`,symbol:`by symbol`},graphState:{none:`none`,unreadable:`unreadable`,stale:`stale`,fresh:`fresh`}},qp={task:[`task`,`tasks`],line:[`line`,`lines`],project:[`project`,`projects`],day:[`day`,`days`],week:[`week`,`weeks`],session:[`session`,`sessions`]};function Jp(e,t){let[n,r]=qp[t];return A(e,n,r)}function Yp(e){return e===null?`—`:e<1?`less than a day`:Jp(Math.round(e),`day`)}function Xp(e){return e===null?`—`:e<1?`within a day`:`within ${Yp(e)}`}function Zp(e){let t=Ip(e);switch(t.kind){case`no-open`:return`No open tasks`;case`clears`:return`Debt clears in about ${P(`en`,t.weeks)} wk. (by ${ie(`en`,t.until)})`;case`not-shrinking`:return`Debt is not shrinking`;case`grows`:return`Debt grows by ${R(`en`,t.perWeek)} ${ge(t.perWeek,...qp.task)} a week`}}function Qp({windowDays:e,closed:t,created:n}){let r=Lp(e);return`over ${Jp(r.count,r.unit)}: closed ${t}, created ${n}`}function $p(e){switch(e.kind){case`debt-growing`:return`Debt has grown for ${Jp(e.params.weeks,`week`)} straight: created ${e.params.created}, closed ${e.params.closed}`;case`urgent-stale`:return`Urgent tasks have been waiting more than ${Jp(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Stuck in progress: ${e.params.count}, longest ${e.params.id} — ${Yp(e.params.days)}`;case`done-unclosed`:return`Checklist done but the task is not closed: ${e.params.count}, longest ${e.params.id} — close it (backlog close) or add what is left`;case`noisy-check`:{let{evidence:t,method:n,percent:r,decided:i,windowDays:a}=e.params;return`Check ${n===null?`"${Kp.evidence[t]}"`:`"${Kp.evidence[t]}" ${Kp.checkMethod[n]}`} is almost always wrong: precision ${r}% on ${i} decided over ${Jp(a,`day`)}`}case`low-changed`:return`Code changed for ${Jp(e.params.count,`task`)} with low priority — re-check when convenient ("clean up the backlog")`;case`stale-low`:return`Tasks with low priority older than ${Jp(e.params.days,`day`)}: ${e.params.count} — clean them up (backlog prune)`}}function em(e){switch(e.kind){case`bad-id`:return`invalid ID`;case`empty-title`:return`empty title`;case`empty-name`:return`empty project name`;case`bad-prefix`:return`invalid prefix`;case`zod`:return Vp(Up,e)}}function tm(e){switch(e.code){case`self-block`:return`a task cannot block itself`;case`self-related`:return`a task cannot be related to itself`;case`referenced-as-epic`:return`other tasks refer to this task as their epic: ${e.children.join(`, `)}`;case`blocker-cycle`:return`blocker cycle: ${e.cycle.join(` → `)}`;case`resolution-needs-status`:return`resolution ${e.resolution} requires status ${e.status}`;case`reason-without-resolution`:return`reason can only be set together with resolution`;case`epic-self`:return`a task cannot be its own epic`;case`epic-missing`:return`epic ${e.epic} not found`;case`epic-not-epic`:return`${e.epic} is not an epic`;case`epic-foreign-project`:return`epic ${e.epic} belongs to another project — clear the epic or pick one from this project`;case`epic-in-epic`:return`an epic cannot belong to another epic`;case`reference-missing`:return`${e.id} not found`;case`no-frontmatter`:return`file does not start with frontmatter (---)`;case`frontmatter-unclosed`:return`frontmatter is not closed with a --- line`;case`yaml`:return`YAML error: ${e.detail}`;case`schema`:return e.path===``?em(e.issue):`${e.path}: ${em(e.issue)}`;case`id-mismatch`:return`id ${e.id} does not match the file name ${e.file}.md`;case`prefix-mismatch`:return`prefix of ${e.file} does not match the project prefix ${e.prefix}`;case`id-exhausted`:return`could not allocate an ID in ${e.attempts} attempts`}}var nm=zp(tm);function rm(e){return`all tasks of the epic are closed: ${e.join(`, `)}`}function im(e){switch(e.kind){case`references-removed`:return`${e.taskId}: removed references to missing tasks: ${e.ids.join(`, `)}`;case`epic-closed`:return`${e.taskId}: epic closed — ${rm(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: epic reopened — it has open tasks: ${e.childIds.join(`, `)}`;case`source-moved`:return Np(e.from)===Np(e.to)?`${e.taskId}: source moved ${Mp(e.from)} → ${Mp(e.to)}`:`${e.taskId}: task file renamed, source ${e.from} → ${e.to}`}}function am(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: could not fix — ${om(e)}`;case`task-invalid`:return`${e.taskId}: ${tm(e.problem)}`;case`file-not-parsed`:return`File ${e.path} could not be parsed: ${nm(e.problems)}`;case`epics-wait-for-files`:return`Epics ${e.epicIds.join(`, `)} are complete but will not close until the unparsed files are fixed`;case`project-without-repos`:return`Project ${e.projectId}: repos has no paths — its tasks' code cannot be checked`;case`project-repos-missing`:return`Project ${e.projectId}: none of the repos paths exist (${e.repos.join(`, `)}) — its tasks' code cannot be checked`;case`project-repo-not-git`:return`Project ${e.projectId}: ${e.repo} is not a git repository — commits and code edits of its tasks are not checked`;case`project-repo-unsafe`:return`Project ${e.projectId}: git does not trust ${e.repo} (the directory belongs to another user) — commits and code edits of its tasks are not checked. Fix: git config --global --add safe.directory "${e.repo}"`;case`project-history-unreadable`:return`Project ${e.projectId}: could not read the git history in ${e.repo} — commits and code edits of its tasks were not checked`;case`prefix-shared`:return`Projects ${e.projectIds.join(`, `)} share the prefix ${e.prefix} — their task IDs collide. Change prefix in project.md of one of them`}}function om(e){switch(e.cause){case`invalid`:return nm(e.problems);case`changed-during-check`:return`the file changed during the check`;case`gone-during-check`:return`the file disappeared during the check`;case`busy-during-check`:return`the file is locked by another process`}}var sm={hookMark:`Backlog`,languageName:`English`,problem:tm,problems:nm,schemaIssue:em,...Rp(Kp),count:Jp,days:Yp,p90:Xp,forecast:Zp,forecastTail:Qp,signal:$p,epicDoneReason:rm,fileBusy:({path:e,lock:t,seconds:n})=>`${e} has been locked by another process for more than ${P(`en`,n)} s (${t})`,checkFix:im,checkProblem:am,runsNotTrimmed:e=>`Could not trim the run log: ${e}`,journalNotCompacted:(e,t)=>`Could not compact the journal in ${e}: ${t}`,closedNotSwept:e=>`Could not delete closed tasks: ${e}`,serviceLogNotTrimmed:e=>`Could not trim the service log: ${e}`,candidatesRecordFailed:(e,t)=>`Could not record candidates to the ${e} journal: ${t}`,branchOriginsReadFailed:(e,t)=>`Could not read the ${e} journal — tasks from unmerged branches are checked as usual: ${t}`,unreadableSkipped:(e,t)=>`Could not read ${e}, skipped: ${t}`,settingsNotSaved:(e,t)=>`Could not save the language to ${e}: ${t}. It is detected again on every run — make the backlog directory writable.`,settingsFileInvalid:e=>`${e} could not be parsed, the language for this run was detected automatically. The file was not changed — fix it manually.`},cm=ni().localeError,lm={bloaters:`Разбухшее`,"change-preventers":`Мешает изменениям`,couplers:`Связанность`,"data-dealers":`Работа с данными`,dispensables:`Лишнее`,"functional-abusers":`Императивность`,"lexical-abusers":`Именование`,"oo-abusers":`ООП`,obfuscators:`Запутанность`,bug:`Ошибка`},um=`не указана`,dm={category:lm,noCategory:um,categoryRow:{...lm,unset:um,unknown:`неизвестна`},found:{review:`на ревью`,incidental:`попутно`,manual:`вручную`,unknown:`неизвестно`,unset:`не записано`},status:{backlog:`в беклоге`,"in-progress":`в работе`,blocked:`заблокирована`,done:`сделана`,cancelled:`отменена`},type:{task:`задача`,epic:`эпик`},priority:{low:`низкий`,medium:`средний`,high:`высокий`,critical:`критичный`},resolution:{fixed:`исправлено`,obsolete:`кода нет`,duplicate:`дубль`,"epic-done":`эпик завершён`},evidence:{"source-changed":`код изменился`,"source-missing":`файл пропал`,duplicate:`дубль`,"no-source":`нет source`,total:`Всего`},checkMethod:{symbol:`по символу`,anchor:`по строкам source`,file:`по файлу`},duplicateMatch:{source:`по месту в коде`,title:`по заголовку`,symbol:`по символу`},graphState:{none:`нет`,unreadable:`не читается`,stale:`устарел`,fresh:`свежий`}},fm={task:[`задача`,`задачи`,`задач`],line:[`строка`,`строки`,`строк`],project:[`проект`,`проекта`,`проектов`],day:[`день`,`дня`,`дней`],week:[`неделя`,`недели`,`недель`],session:[`сессия`,`сессии`,`сессий`]},pm={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},mm={task:[`задачи`,`задач`,`задач`],day:[`дня`,`дней`,`дней`]};function hm(e,t){let[n,r,i]=fm[t];return z(e,n,r,i)}function gm(e,t){return z(e,...pm[t])}function _m(e,t){return z(e,...mm[t])}function vm(e){return e===null?`—`:e<1?`меньше дня`:`${P(`ru`,Math.round(e))} дн.`}function ym(e){return e===null?`—`:e<1?`быстрее суток`:`за ${vm(e)}`}function bm(e){let t=Ip(e);switch(t.kind){case`no-open`:return`Открытых задач нет`;case`clears`:return`Долг разберётся примерно за ${P(`ru`,t.weeks)} нед. (к ${ie(`ru`,t.until)})`;case`not-shrinking`:return`Долг не уменьшается`;case`grows`:return`Долг растёт на ${R(`ru`,t.perWeek)} ${M(t.perWeek,...fm.task)} в неделю`}}function xm({windowDays:e,closed:t,created:n}){let{unit:r,count:i}=Lp(e);return`за ${gm(i,r)}: закрыто ${t}, создано ${n}`}function Sm(e){switch(e.kind){case`debt-growing`:return`Долг растёт ${gm(e.params.weeks,`week`)} подряд: создано ${e.params.created}, закрыто ${e.params.closed}`;case`urgent-stale`:return`Срочные задачи ждут дольше ${_m(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Застряли в работе: ${e.params.count}, дольше всех ${e.params.id} — ${vm(e.params.days)}`;case`done-unclosed`:return`Чеклист выполнен, а задача не закрыта: ${e.params.count}, дольше всех ${e.params.id} — закройте (backlog close) или допишите, что осталось`;case`noisy-check`:{let{evidence:t,method:n,percent:r,decided:i,windowDays:a}=e.params;return`Проверка ${n===null?`«${dm.evidence[t]}»`:`«${dm.evidence[t]}» ${dm.checkMethod[n]}`} почти всегда ошибается: точность ${r}% на ${i} решённых за ${gm(a,`day`)}`}case`low-changed`:return`Код менялся у ${_m(e.params.count,`task`)} с низким приоритетом — перепроверьте при случае («почисти беклог»)`;case`stale-low`:return`Задач с низким приоритетом старше ${_m(e.params.days,`day`)}: ${e.params.count} — разберите (backlog prune)`}}function Cm(e){switch(e.kind){case`bad-id`:return`некорректный ID`;case`empty-title`:return`пустой заголовок`;case`empty-name`:return`пустое имя проекта`;case`bad-prefix`:return`некорректный префикс`;case`zod`:return Vp(cm,e)}}function wm(e){switch(e.code){case`self-block`:return`задача не может блокировать саму себя`;case`self-related`:return`задача не может быть связана сама с собой`;case`referenced-as-epic`:return`на задачу ссылаются как на эпик: ${e.children.join(`, `)}`;case`blocker-cycle`:return`цикл блокеров: ${e.cycle.join(` → `)}`;case`resolution-needs-status`:return`resolution ${e.resolution} требует статус ${e.status}`;case`reason-without-resolution`:return`reason задаётся только вместе с resolution`;case`epic-self`:return`задача не может быть своим эпиком`;case`epic-missing`:return`эпик ${e.epic} не найден`;case`epic-not-epic`:return`${e.epic} не является эпиком`;case`epic-foreign-project`:return`эпик ${e.epic} из другого проекта — снимите эпик или выберите эпик этого проекта`;case`epic-in-epic`:return`эпик не может входить в другой эпик`;case`reference-missing`:return`${e.id} не найдена`;case`no-frontmatter`:return`файл не начинается с frontmatter (---)`;case`frontmatter-unclosed`:return`frontmatter не закрыт строкой ---`;case`yaml`:return`ошибка YAML: ${e.detail}`;case`schema`:return e.path===``?Cm(e.issue):`${e.path}: ${Cm(e.issue)}`;case`id-mismatch`:return`id ${e.id} не совпадает с именем файла ${e.file}.md`;case`prefix-mismatch`:return`префикс ${e.file} не совпадает с префиксом проекта ${e.prefix}`;case`id-exhausted`:return`не удалось выделить ID за ${e.attempts} попыток`}}var Tm=zp(wm);function Em(e){return`все задачи эпика закрыты: ${e.join(`, `)}`}function Dm(e){switch(e.kind){case`references-removed`:return`${e.taskId}: убраны ссылки на несуществующие задачи: ${e.ids.join(`, `)}`;case`epic-closed`:return`${e.taskId}: эпик закрыт — ${Em(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: эпик снова открыт — в нём открытые задачи: ${e.childIds.join(`, `)}`;case`source-moved`:return Np(e.from)===Np(e.to)?`${e.taskId}: source сдвинулся ${Mp(e.from)} → ${Mp(e.to)}`:`${e.taskId}: файл задачи переименован, source ${e.from} → ${e.to}`}}function Om(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: не удалось исправить — ${km(e)}`;case`task-invalid`:return`${e.taskId}: ${wm(e.problem)}`;case`file-not-parsed`:return`Файл ${e.path} не разобран: ${Tm(e.problems)}`;case`epics-wait-for-files`:return`Эпики ${e.epicIds.join(`, `)} завершены, но не закроются, пока не исправлены неразобранные файлы`;case`project-without-repos`:return`Проект ${e.projectId}: в repos нет путей — код его задач не проверить`;case`project-repos-missing`:return`Проект ${e.projectId}: ни один путь из repos не существует (${e.repos.join(`, `)}) — код его задач не проверить`;case`project-repo-not-git`:return`Проект ${e.projectId}: ${e.repo} — не git-репозиторий, коммиты и правки кода его задач не проверяются`;case`project-repo-unsafe`:return`Проект ${e.projectId}: git не доверяет ${e.repo} (каталог принадлежит другому пользователю) — коммиты и правки кода его задач не проверяются. Исправление: git config --global --add safe.directory "${e.repo}"`;case`project-history-unreadable`:return`Проект ${e.projectId}: не удалось прочитать историю git в ${e.repo} — коммиты и правки кода его задач не проверены`;case`prefix-shared`:return`У проектов ${e.projectIds.join(`, `)} один префикс ${e.prefix} — ID их задач пересекаются. Смените prefix в project.md одного из них`}}function km(e){switch(e.cause){case`invalid`:return Tm(e.problems);case`changed-during-check`:return`файл изменился во время проверки`;case`gone-during-check`:return`файл исчез во время проверки`;case`busy-during-check`:return`файл занят другим процессом`}}var Am={hookMark:`Беклог`,languageName:`Русский`,problem:wm,problems:Tm,schemaIssue:Cm,...Rp(dm),count:hm,days:vm,p90:ym,forecast:bm,forecastTail:xm,signal:Sm,epicDoneReason:Em,fileBusy:({path:e,lock:t,seconds:n})=>`${e} занят другим процессом дольше ${P(`ru`,n)} с (${t})`,checkFix:Dm,checkProblem:Om,runsNotTrimmed:e=>`Не удалось обрезать журнал запусков: ${e}`,journalNotCompacted:(e,t)=>`Не удалось уплотнить журнал в ${e}: ${t}`,closedNotSwept:e=>`Не удалось удалить закрытые задачи: ${e}`,serviceLogNotTrimmed:e=>`Не удалось обрезать лог службы: ${e}`,candidatesRecordFailed:(e,t)=>`Не удалось записать кандидатов в журнал ${e}: ${t}`,branchOriginsReadFailed:(e,t)=>`Не удалось прочитать журнал ${e} — задачи из невлитых веток проверяются как обычные: ${t}`,unreadableSkipped:(e,t)=>`Не удалось прочитать ${e}, он пропущен: ${t}`,settingsNotSaved:(e,t)=>`Не удалось сохранить язык в ${e}: ${t}. Он определяется заново при каждом запуске — разрешите запись в каталог беклога.`,settingsFileInvalid:e=>`${e} не разобран, язык для этого запуска определён автоматически. Файл не изменён — поправьте его вручную.`};function jm(e){return e===`ru`?Am:sm}var Mm={skipLink:`Skip to content`,sidebarNav:`Navigation`,brand:`backlog`,sectionsLabel:`Sections`,tasksNav:`Tasks`,statsNav:`Statistics`,signalsHidden:e=>`, alerts: ${e}`,collapseProjects:`Collapse project list`,expandProjects:`Expand project list`,projects:`Projects`,taskWord:e=>ge(e,`task`,`tasks`),checkedSuffix:`\xA0— checked`,languageSwitchLabel:`Interface language`,languageSwitchFailed:`Failed to change the language`,graphNotes:{none:{title:`No code graph`,hint:[{code:`code-review-graph build`},{text:` — check candidates are less precise`}]},stale:{title:`Code graph is stale`,hint:[{code:`code-review-graph watch`},{text:` or the `},{code:`update`},{text:` hook — without them the check can't see symbols`}]},unreadable:{title:`Code graph unreadable`,hint:[{code:`code-review-graph build`},{text:` again — the database is from a different version or path`}]}},checkboxLabel:e=>`Include project ${e} in the “Projects” scope`,setActiveFailed:e=>e?`Failed to include the project`:`Failed to exclude the project`,deleteButtonLabel:e=>`Delete project ${e}`,deleteButtonTitle:`Delete project`,deleteFailed:`Failed to delete the project`,deleteDialogTitle:e=>`Delete project “${e}”?`,deleteDialogDescriptionUnknown:`The project directory will be deleted along with all its tasks; this cannot be undone.`,deleteDialogDescription:e=>`Tasks: ${e}. The project directory will be deleted along with them; this cannot be undone.`,confirmWordLabel:e=>`Type the project id: ${e}`,confirmLabel:`Delete`},Nm={skipLink:`Перейти к содержимому`,sidebarNav:`Навигация`,brand:`беклог`,sectionsLabel:`Разделы`,tasksNav:`Задачи`,statsNav:`Статистика`,signalsHidden:e=>`, тревог: ${e}`,collapseProjects:`Свернуть список проектов`,expandProjects:`Развернуть список проектов`,projects:`Проекты`,taskWord:e=>M(e,`задача`,`задачи`,`задач`),checkedSuffix:`\xA0— с\xA0галочкой`,languageSwitchLabel:`Язык интерфейса`,languageSwitchFailed:`Не удалось изменить язык`,graphNotes:{none:{title:`Без графа кода`,hint:[{code:`code-review-graph build`},{text:` — кандидаты проверки точнее`}]},stale:{title:`Граф кода устарел`,hint:[{code:`code-review-graph watch`},{text:` или хук `},{code:`update`},{text:` — без них проверка не видит символов`}]},unreadable:{title:`Граф кода не читается`,hint:[{code:`code-review-graph build`},{text:` заново — база другой версии или от другого пути`}]}},checkboxLabel:e=>`Учитывать проект ${e} в области «Проекты»`,setActiveFailed:e=>`Не удалось ${e?`учесть`:`исключить`} проект`,deleteButtonLabel:e=>`Удалить проект ${e}`,deleteButtonTitle:`Удалить проект`,deleteFailed:`Не удалось удалить проект`,deleteDialogTitle:e=>`Удалить проект «${e}»?`,deleteDialogDescriptionUnknown:`Каталог проекта удалится со всеми задачами, отменить нельзя.`,deleteDialogDescription:e=>`Задач: ${e}. Каталог проекта удалится вместе с ними, отменить нельзя.`,confirmWordLabel:e=>`Введите id проекта: ${e}`,confirmLabel:`Удалить`},Pm=(e,t)=>`Changed ${e} of ${t}`,Fm={docTitle:e=>`${e} — Backlog`,taskDocTitle:(e,t)=>`${e} · ${t} — Backlog`,projects:`Projects`,autoClosed:`Closed by agent`,autoClosedInProject:e=>`Closed by agent · ${e}`,missingTask:e=>`Task ${e} not found — it may have been deleted after it was closed.`,parseErrorsTitle:`Failed to parse files:`,loadingTasks:`Loading tasks…`,unknownProject:`Project not found.`,hiddenOpenNote:e=>`${e} more open ${ge(e,`task`,`tasks`)} — in projects without the checkbox.`,noTasksInScope:e=>`No tasks in the included projects. ${e}`,noTasksYet:e=>[`No tasks yet. The backlog is filled by the agent: it records tasks with `,e(`backlog new`),` while it works on the code.`],noOpenTasksInScope:e=>`No open tasks in the included projects. ${e}`,noOpenTasks:`No open tasks.`,showAllStatuses:`Show all statuses`,noMatches:`Nothing matches the filters.`,resetFilters:`Reset filters`,taskCount:e=>`${A(e,`task`,`tasks`)} in the list`,status:`Status`,priority:`Priority`,type:`Type`,tags:`Tags`,task:`Task`,created:`Created`,closed:`Closed`,epicAndTags:`Epic and tags`,withoutBlockers:`no blockers`,autoClosedChip:`closed by agent`,searchPlaceholder:`Search by title, description, and ID`,searchLabel:`Search tasks`,tagsSummary:e=>`Tags (${e})`,tagsSummarySelected:(e,t)=>`Tags (${e}), ${t} selected`,findTag:`Find tag`,newBadge:`new`,epicBadge:`epic`,blockedTitle:`Has open blockers`,blockedBadge:`blockers`,epicPrefix:e=>`Epic: ${e}`,epicTitle:(e,t)=>`${e} — ${t}`,resetEpic:`Clear epic`,epics:`Epics`,anyEpic:`Any epic`,noEpic:`No epic`,epicNotFound:`epic not found`,anyEpicLabel:`any`,noEpicLabel:`no epic`,selectTask:e=>`Select ${e}`,selectionKeysHint:e=>`Space on a task selects it, Shift+Space selects a range, ${e} — to the actions on selected`,toActionsHint:e=>`${e} — to the actions`,selectAllVisible:`Select all visible`,selectionActions:`Actions on selected`,selectedCount:e=>`${e} selected`,hiddenByFilter:e=>`(${e} hidden by filter)`,closeAsObsolete:`Close as obsolete`,closeDialogTitle:e=>`Close ${A(e,`task`,`tasks`)} as obsolete?`,closeDialogDescription:e=>`Status becomes “${e}”; the reason is saved to every task.`,closeReason:`Reason`,closeConfirm:e=>`Close ${e}`,epic:`Epic`,removeFromEpic:`Remove from epic`,mixedProjects:`Tasks from different projects`,clearSelection:`Clear selection`,bulkFailed:`Couldn't change the tasks`,batchSummary:{close:(e,t)=>`Closed ${e} of ${t}`,priority:Pm,epic:Pm,restore:(e,t)=>`Restored ${e} of ${t}`},notChanged:e=>`${A(e,`task`,`tasks`)} not changed`,undo:`Undo`,undoFailed:`Couldn't undo`,collapseTags:`collapse`,showMoreTags:e=>`Show ${e} more`},Im=(e,t)=>`${M(e,`Изменена`,`Изменено`,`Изменено`)} ${e} из ${t}`,Lm={docTitle:e=>`${e} — Беклог`,taskDocTitle:(e,t)=>`${e} · ${t} — Беклог`,projects:`Проекты`,autoClosed:`Закрыты агентом`,autoClosedInProject:e=>`Закрыты агентом · ${e}`,missingTask:e=>`Задачи ${e} нет — возможно, её удалили после закрытия.`,parseErrorsTitle:`Не удалось разобрать файлы:`,loadingTasks:`Загружаем задачи…`,unknownProject:`Проект не найден.`,hiddenOpenNote:e=>`Ещё ${z(e,`открытая задача`,`открытые задачи`,`открытых задач`)} — в проектах без галочки.`,noTasksInScope:e=>`В учтённых проектах задач нет. ${e}`,noTasksYet:e=>[`Задач пока нет. Беклог наполняет агент: он записывает задачи командой `,e(`backlog new`),`, пока работает над кодом.`],noOpenTasksInScope:e=>`В учтённых проектах открытых задач нет. ${e}`,noOpenTasks:`Открытых задач нет.`,showAllStatuses:`Показать все статусы`,noMatches:`Под фильтры ничего не подходит.`,resetFilters:`Сбросить фильтры`,taskCount:e=>`В списке ${z(e,`задача`,`задачи`,`задач`)}`,status:`Статус`,priority:`Приоритет`,type:`Тип`,tags:`Теги`,task:`Задача`,created:`Создана`,closed:`Закрыта`,epicAndTags:`Эпик и теги`,withoutBlockers:`без блокеров`,autoClosedChip:`закрыты агентом`,searchPlaceholder:`Поиск по названию, описанию и ID`,searchLabel:`Поиск задач`,tagsSummary:e=>`Теги (${e})`,tagsSummarySelected:(e,t)=>`Теги (${e}), выбрано ${t}`,findTag:`Найти тег`,newBadge:`новая`,epicBadge:`эпик`,blockedTitle:`Есть открытые блокеры`,blockedBadge:`блокеры`,epicPrefix:e=>`Эпик: ${e}`,epicTitle:(e,t)=>`${e} — ${t}`,resetEpic:`Сбросить эпик`,epics:`Эпики`,anyEpic:`Любой эпик`,noEpic:`Без эпика`,epicNotFound:`эпик не найден`,anyEpicLabel:`любой`,noEpicLabel:`без эпика`,selectTask:e=>`Выбрать ${e}`,selectAllVisible:`Выбрать все видимые`,selectionKeysHint:e=>`Пробел на задаче — выбрать её, Shift+Пробел — выбрать диапазон, ${e} — к действиям с выбранными`,toActionsHint:e=>`${e} — к действиям`,selectionActions:`Действия с выбранными`,selectedCount:e=>`Выбрано ${e}`,hiddenByFilter:e=>`(${e} ${M(e,`скрыта`,`скрыты`,`скрыто`)} фильтром)`,closeAsObsolete:`Закрыть как неактуальные`,closeDialogTitle:e=>`Закрыть ${z(e,`задачу`,`задачи`,`задач`)} как неактуальные?`,closeDialogDescription:e=>`Статус станет «${e}», причина запишется в каждую задачу.`,closeReason:`Причина`,closeConfirm:e=>`Закрыть ${e}`,epic:`Эпик`,removeFromEpic:`Вынуть из эпика`,mixedProjects:`Задачи из разных проектов`,clearSelection:`Снять выбор`,bulkFailed:`Не удалось изменить задачи`,batchSummary:{close:(e,t)=>`${M(e,`Закрыта`,`Закрыто`,`Закрыто`)} ${e} из ${t}`,priority:Im,epic:Im,restore:(e,t)=>`${M(e,`Возвращена`,`Возвращено`,`Возвращено`)} ${e} из ${t}`},notChanged:e=>`${M(e,`Не изменена`,`Не изменены`,`Не изменено`)} ${e} ${M(e,`задача`,`задачи`,`задач`)}`,undo:`Отменить`,undoFailed:`Не удалось отменить`,collapseTags:`свернуть`,showMoreTags:e=>`Показать ещё ${e}`},Rm=e=>A(e,`day`,`days`),zm={day:`day`,week:`week`,sample:`sample`},Bm={week:[`week`,`weeks`],day:[`day`,`days`]},Vm={week:`a week`,day:`a day`},Hm={week:`in the latest week with decisions`,day:`on the last day with decisions`},Um=(e,t)=>A(t,...Bm[e]),Wm=e=>A(e,`task`,`tasks`),Gm=e=>A(e,`token`,`tokens`);function Km({formatted:e,count:t}){return`${e} ${ge(t,`line`,`lines`)}`}function qm(e){let t=Rm(e.churnDays),n=A(e.statsWeeks,`week`,`weeks`),r=A(e.memoryHistoryHours,`hour`,`hours`),i=`${n} (since adoption, if later)`,a=`the estimate appears after ${e.minFixesForEstimate} fixes`;return{docTitle:e=>`${e} — Backlog`,heading:e=>`Statistics · ${e}`,alerts:`Alerts`,tabsLabel:`Statistics sections`,tabs:{overview:`Overview`,code:`Code`,quality:`Quality`,effect:`Effect`,cost:`Cost`},invalidJournalLines:e=>`Could not parse journal lines: ${e}. They are left out of the statistics — check the line format in the project's journal.jsonl.`,unknownJournalLines:e=>`Journal lines with an unknown value: ${e}. A renamed value (category, how found, resolution) is shown as "unknown", but is counted in the breakdowns.`,unparsedTasks:e=>`Could not parse task files: ${e}. The statistics use their last status from the journal; fix the files — backlog check shows the errors.`,noTasks:`No tasks yet.`,projectNotFound:`Project not found.`,loading:`Calculating statistics…`,journalEmpty:`The journal is still empty; everything is built from the dates in the task files.`,journalSince:e=>`The journal has been kept since ${e}; before that, dates come from the task files. Tasks deleted before then are not in the statistics.`,unavailableRepo:e=>`No access to the repository: ${e}. Check the path in repos of project.md and that it is a git repository.`,tableLabel:e=>`Table "${e}"`,noCodeData:`No code data: the projects have no accessible repositories`,folders:`Folders`,projects:`Projects`,periodWindows:{weeks:n,days:Rm(e.statsDays),lastWeek:Rm(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`now`,chartLabel:(e,t)=>`${e}. Left and right arrows move by ${zm[t]}`,periodOf:(e,t)=>e===`week`?`week of ${t}`:t,weekTrend:(e,t)=>`${e} ${t} vs last week`,weekTrendSpeech:{decline:e=>`${e} less than a week ago — better`,growth:e=>`${e} more than a week ago — worse`},tasksToday:`Tasks today`,createdAndClosed:`created and closed`,thisWeek:`This week`,weekNote:(e,t)=>`created ${e}, closed ${t}`,debtBy:{week:`Debt by week`,day:`Debt by day`},flowCreated:`created`,flowClosed:`closed`,flowOpen:`open`,flowOpenAtEnd:{week:`open at week end`,day:`open at day end`},flowSummary:({grain:e,periodCount:t,created:n,closed:r,openNow:i})=>`${Um(e,t)}: created ${n}, closed ${r}, open now ${i}`,createdBy:{week:`Created by week`,day:`Created by day`},createdTasks:`tasks created`,intakeSummary:({grain:e,periodCount:t,created:n,perPeriod:r})=>{let i=Um(e,t);return r===null?`${i}: no tasks created`:`${i}: created ${n}, on average ${R(`en`,r)} ${Vm[e]}`},hotspots:`Where it hurts`,noSourceFolders:`Open tasks have no source`,tags:`Tags`,noTags:`Open tasks have no tags`,openAge:`Age of open tasks`,ageBuckets:{week:`up to 7 days`,month:`7–30 days`,quarter:`30–90 days`,older:`over 90 days`},priorityCounts:{critical:`critical`,high:`high`,medium:`medium`,low:`low`},urgentStale:t=>`Critical and high older than ${e.staleUrgentDays} days: ${t}`,closing:`How tasks close`,closingReasons:{done:`done`,cancelled:`cancelled`,unknown:`resolution not recognized`},noiseAndReopens:`Noise and reopens`,duplicatesAmongClosed:`Duplicates among closed`,noSourceAmongCreated:`No source among created`,reopened:`Reopened`,codeNote:`Changes are commits over ${t}; lines are at the latest commit.`,churnTitle:`Debt in frequently changed code`,churnHint:`Rank is commits over ${t} × weight of the folder's open tasks`,churnEmpty:`No debt lies in code changed over ${t}`,commits:e=>A(e,`commit`,`commits`),churnTasks:(e,t)=>`${Wm(e)}, weight ${t}`,densityTitle:`Debt density`,perKloc:e=>`${R(`en`,e)} per 1000 lines`,accuracyTitle:`Check precision`,noCandidates:`The check has not found any candidates yet`,accuracyHint:`Share of check candidates after which the task was closed; the rest were confirmed as still relevant`,accuracyTable:e=>`Check precision, ${e}`,accuracyHead:[`Evidence`,`Candidates`,`Closed`,`Confirmed`,`Undecided`,`Precision`],splitRow:e=>`└ of them ${e}`,beforeMethodRecorded:`before the method was recorded`,checkedBy:e=>`checked ${e}`,beforeMatchRecorded:`before the match was recorded`,matchedBy:e=>`matched ${e}`,decidedCandidates:`candidates decided`,precision:`precision`,accuracySummary:({grain:e,periodCount:t,decided:n,latestPrecision:r})=>r===null?`${Um(e,t)}: no decided candidates`:`${Um(e,t)}: decided ${n}, precision ${Hm[e]} ${r}`,graphTitle:`Code graph`,graphMissing:e=>[`No code graph: the check compares source lines and the whole file. `,e(`code-review-graph build`),` in the project repository enables the check by symbol`],graphHint:`The graph drops the "code changed" candidate when an edit touched another symbol of the same file, so the agent does not have to re-read the task`,filteredTitle:`Filtered out over ${n}`,nothingFiltered:`The graph has not filtered out any candidates`,filteredTable:`What happened to the filtered-out candidates`,filteredHead:[`Outcome`,`Candidates`],filteredByGraph:`Filtered out by the graph`,filteredCaught:`└ later became a candidate anyway`,filteredMissed:`└ closed without a check signal — a possible miss`,filteredQuiet:`└ no consequences`,graphByProject:`Code graph by project`,graphHead:[`Project`,`Graph`,`Tasks with source lines`,`Symbol found`],categoriesTitle:`Categories`,categoriesEmpty:`No tasks over ${n}`,categoriesHead:[`Category`,`Open`,`Weight`,`Created`,`Closed`],originTitle:`Origin`,foundTitle:`How found`,foundHead:[`How found`,`Created`,`Open`,`Fixed`],branchesTitle:`Branches`,branchesEmpty:`Branches appear for tasks recorded with backlog new inside a repository`,branchesHead:[`Branch`,`Created`,`Open`],linesText:Km,codeAndTests:({code:e,tests:t})=>`code ${e}, tests ${t}`,keptOut:`Unrelated edits deferred`,keptOutPending:t=>`fixed ${t}; the pending estimate appears after ${e.minFixesForEstimate} fixes`,keptOutEstimated:(e,t)=>`fixed ${e} + pending ${t}`,noiseWithoutBacklog:`Noise without backlog`,noiseNote:`share of unrelated edits in pull requests`,deferredToBacklog:`Deferred to backlog`,deferredNote:(e,t)=>`fixed ${e}, pending ${t}`,pullRequestLines:`Lines in pull requests`,effectWindow:`over ${i}`,chartScale:e=>`Scale of the "${e}" chart`,chartNames:{flow:`Debt`,intake:`Created`,accuracy:`Check precision`,effect:`Effect`,spend:`Usage`},grainNames:{week:`week`,day:`day`},effectTitle:`Effectiveness`,byProject:`By project`,projectsHead:[`Project`,`Tasks deferred`,`Lines fixed`,`Pending estimate`,`Lines in pull requests`,`Noise without backlog`],onTopicSeries:`on topic in pull requests`,deferredSeries:`deferred to backlog`,codeLines:`code`,testLines:`tests`,deferredTasks:`tasks deferred`,effectSummary:(e,t,n)=>`Over ${i}: ${A(e,`line`,`lines`)} in pull requests, deferred ${t}, noise without backlog ${n}`,effectDaysSummary:(e,t,n)=>`Over ${Um(`day`,e)}: ${A(t,`line`,`lines`)} on topic in pull requests, deferred ${n}`,noDeferredTasks:`No tasks moved out by the agent in passing yet, so there is no gain to measure. The agent records problems outside the current work that it notices itself (backlog new --found incidental); review and audit findings and tasks recorded at the user's request don't count here.`,explainerTitle:`How the gain is calculated`,explainerTask:`Every task the agent moved out of its work in passing is an edit it would have made in the current pull request without the backlog. The gain is the lines that did not get there. Review and audit findings and tasks recorded at the user's request are not counted — they are shown on the Quality tab under Origin.`,explainerFixed:`Fixed ones are exact: lines of the commit from the close reason, without lock files, docs and images; a commit for several tasks is split evenly. Tasks closed without a fix and fixed ones without a found commit are not counted.`,explainerPending:`Pending ones are estimated: the median of fixes in the same category (if there are at least ${e.minFixesForEstimate}), otherwise of all fixes.`,explainerTests:`Code and tests: test files are ${e.testFileGlobs.join(`, `)} and the ${e.testDirectories.join(`, `)} folders. For pending ones, the share of tests in the same fixes.`,explainerNoise:`Noise without backlog = deferred ÷ (lines in pull requests + pending estimate); fixes are already inside pull requests and are not counted twice. The window starts when the backlog was adopted in the project, no earlier than ${n} ago.`,now:`Now:`,fixedNow:(e,t)=>`${Wm(e)} — ${Km(t)}`,noPending:`nothing pending`,pendingWithoutEstimate:e=>`${Wm(e)}, ${a}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${Wm(e)} ${Km(t)}, on average ${n} per task`,estimateLater:a,noCommitsSinceAdoption:`no commits since adoption`,noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Counting usage from Claude Code transcripts…`,noTranscripts:`No Claude Code transcripts found.`,scanProgress:(e,t)=>`Counting usage from Claude Code transcripts: read ${e} of ${A(t,`file`,`files`)}`,costNote:`Tokens come from Claude Code transcripts: turns started by the backlog Stop hook are exact; output of backlog commands and the skill is estimated by text length. Money is at Claude API prices, a subscription may cost differently. Costs of other agents (Codex, Cursor) are not counted.`,backlogTokens:`Tokens due to the backlog`,backlogTokensNote:(e,t)=>`hook turns ${e}, CLI output and skill ${t}`,apiPrice:`At API prices`,unpricedNote:`excluding models with unknown prices`,hookTurns:`Turns due to the hook`,hookRunsNote:e=>`hook runs ${e}`,cliCalls:`CLI calls`,costSince:e=>`Usage data since ${e}`,byModel:`By model`,noModels:`No models yet`,modelsHead:[`Model`,`Tokens`,`At API prices`],fastModel:e=>`${e} (fast mode)`,commandsTitle:`Commands`,noCommands:`No commands yet`,commandsHead:[`Command`,`Runs`,`Average time`,`Average memory`,`Peak memory`],mebibytes:e=>`${R(`en`,e)} MiB`,milliseconds:e=>`${O(`en`,e)} ms`,spendBy:{week:`Usage by week`,day:`Usage by day`},hookTurnTokens:`hook turn tokens`,cliOutputTokens:`CLI output and skill tokens`,hookRuns:`hook runs`,otherCommands:`other commands`,hookTurnsTooltip:`hook turns`,cliOutput:`CLI output and skill`,apiPriceTooltip:`at API prices`,tokens:Gm,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,approxMoney:i,hookRuns:a,cliRuns:o})=>`Over ${Um(e,t)}: due to the hook ${Gm(n)}, CLI output and skill ${r}, ${i}; hook runs ${a}, other commands ${o}`,serverMemory:`Server memory`,memoryRestartNote:`The history starts over after the server restarts`,memorySummary:(e,t)=>`Now ${e}, peak over ${r} ${t}`,processMemory:`process memory`,jsHeap:`JavaScript heap`}}var Jm=e=>z(e,`день`,`дня`,`дней`),Ym={day:`дням`,week:`неделям`,sample:`замерам`},Xm={week:[`неделя`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},Zm={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},Qm={week:`в неделю`,day:`в день`},$m={week:`на последней неделе с решениями`,day:`в последний день с решениями`},eh=(e,t)=>z(t,...Xm[e]),th=e=>z(e,`задача`,`задачи`,`задач`),nh=e=>z(e,`токен`,`токена`,`токенов`);function rh({formatted:e,count:t}){return`${e} ${M(t,`строка`,`строки`,`строк`)}`}function ih(e){let t=Jm(e.churnDays),n=z(e.statsWeeks,`неделю`,`недели`,`недель`),r=z(e.statsWeeks,`недели`,`недель`,`недель`),i=z(e.memoryHistoryHours,`час`,`часа`,`часов`),a=`${n} (с внедрения, если оно позже)`,o=`оценка появится после ${e.minFixesForEstimate} исправлений`;return{docTitle:e=>`${e} — Беклог`,heading:e=>`Статистика · ${e}`,alerts:`Тревоги`,tabsLabel:`Разделы статистики`,tabs:{overview:`Обзор`,code:`Код`,quality:`Качество`,effect:`Эффект`,cost:`Стоимость`},invalidJournalLines:e=>`Не удалось разобрать строк журнала: ${e}. Они не входят в статистику — проверьте формат строк в journal.jsonl проекта.`,unknownJournalLines:e=>`Строк журнала с неизвестным значением: ${e}. Переименованное значение (категория, «как найдена», резолюция) показано как «неизвестно», но учтено в разбивках.`,unparsedTasks:e=>`Не удалось разобрать файлов задач: ${e}. Для них в статистике — последний статус из журнала; исправьте файлы, команда backlog check покажет ошибки.`,noTasks:`Задач пока нет.`,projectNotFound:`Проект не найден.`,loading:`Считаем статистику…`,journalEmpty:`Журнал ещё пуст; всё построено по датам в файлах задач.`,journalSince:e=>`Журнал ведётся с ${e}; раньше — по датам в файлах задач. Удалённые до этого задачи в статистику не попали.`,unavailableRepo:e=>`Нет доступа к репозиторию: ${e}. Проверьте путь в repos файла project.md и что это git-репозиторий.`,tableLabel:e=>`Таблица «${e}»`,noCodeData:`Нет данных о коде: у проектов нет доступных репозиториев`,folders:`Папки`,projects:`Проекты`,periodWindows:{weeks:z(e.statsWeeks,`неделя`,`недели`,`недель`),days:Jm(e.statsDays),lastWeek:Jm(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`сейчас`,chartLabel:(e,t)=>`${e}. Стрелки влево и вправо — по ${Ym[t]}`,periodOf:(e,t)=>e===`week`?`неделя с ${t}`:t,weekTrend:(e,t)=>`${e} ${t} за неделю`,weekTrendSpeech:{decline:e=>`на ${e} меньше, чем неделю назад — лучше`,growth:e=>`на ${e} больше, чем неделю назад — хуже`},tasksToday:`Задачи сегодня`,createdAndClosed:`создано и закрыто`,thisWeek:`За неделю`,weekNote:(e,t)=>`создано ${e}, закрыто ${t}`,debtBy:{week:`Долг по неделям`,day:`Долг по дням`},flowCreated:`создано`,flowClosed:`закрыто`,flowOpen:`открыто`,flowOpenAtEnd:{week:`открыто на конец недели`,day:`открыто на конец дня`},flowSummary:({grain:e,periodCount:t,created:n,closed:r,openNow:i})=>`${eh(e,t)}: создано ${n}, закрыто ${r}, открыто сейчас ${i}`,createdBy:{week:`Создано по неделям`,day:`Создано по дням`},createdTasks:`создано задач`,intakeSummary:({grain:e,periodCount:t,created:n,perPeriod:r})=>{let i=eh(e,t);return r===null?`${i}: задач не создавали`:`${i}: создано ${n}, в среднем ${R(`ru`,r)} ${Qm[e]}`},hotspots:`Где болит`,noSourceFolders:`У открытых задач нет source`,tags:`Теги`,noTags:`У открытых задач нет тегов`,openAge:`Возраст открытых`,ageBuckets:{week:`до 7 дней`,month:`7–30 дней`,quarter:`30–90 дней`,older:`больше 90 дней`},priorityCounts:{critical:`критичных`,high:`высоких`,medium:`средних`,low:`низких`},urgentStale:t=>`Критичные и высокие старше ${e.staleUrgentDays} дней: ${t}`,closing:`Как закрываются`,closingReasons:{done:`сделано`,cancelled:`отменено`,unknown:`резолюция не распознана`},noiseAndReopens:`Шум и возвраты`,duplicatesAmongClosed:`Дубли среди закрытых`,noSourceAmongCreated:`Без source среди созданных`,reopened:`Возвраты`,codeNote:`Изменения — коммиты за ${t}; строки — на последнем коммите.`,churnTitle:`Долг в часто меняемом коде`,churnHint:`Место в списке — коммиты за ${t} × вес открытых задач папки`,churnEmpty:`Долг не лежит в коде, который меняли за ${t}`,commits:e=>z(e,`коммит`,`коммита`,`коммитов`),churnTasks:(e,t)=>`${th(e)}, вес ${t}`,densityTitle:`Плотность долга`,perKloc:e=>`${R(`ru`,e)} на 1000 строк`,accuracyTitle:`Точность проверки`,noCandidates:`Проверка ещё не находила кандидатов`,accuracyHint:`Доля кандидатов проверки, после которых задача закрылась; остальные подтверждены как актуальные`,accuracyTable:e=>`Точность проверки, ${e}`,accuracyHead:[`Улика`,`Кандидатов`,`Закрыто`,`Подтверждено`,`Без решения`,`Точность`],splitRow:e=>`└ из них ${e}`,beforeMethodRecorded:`до записи способа`,checkedBy:e=>`проверено ${e}`,beforeMatchRecorded:`до записи признака`,matchedBy:e=>`совпали ${e}`,decidedCandidates:`решено кандидатов`,precision:`точность`,accuracySummary:({grain:e,periodCount:t,decided:n,latestPrecision:r})=>r===null?`${eh(e,t)}: решённых кандидатов нет`:`${eh(e,t)}: решено ${n}, точность ${$m[e]} ${r}`,graphTitle:`Граф кода`,graphMissing:e=>[`Графа кода нет: проверка сравнивает строки source и файл целиком. `,e(`code-review-graph build`),` в репозитории проекта включит проверку по символу`],graphHint:`Граф убирает кандидата «код изменился», если правка задела другой символ того же файла, — агенту не нужно перечитывать задачу`,filteredTitle:`Отсеяно за ${n}`,nothingFiltered:`Граф не отсеял ни одного кандидата`,filteredTable:`Что стало с отсеянными кандидатами`,filteredHead:[`Исход`,`Кандидатов`],filteredByGraph:`Отсеяно графом`,filteredCaught:`└ позже всё же стал кандидатом`,filteredMissed:`└ закрыта без сигнала проверки — возможный промах`,filteredQuiet:`└ без последствий`,graphByProject:`Граф кода по проектам`,graphHead:[`Проект`,`Граф`,`Задач со строками source`,`Символ найден`],categoriesTitle:`Категории`,categoriesEmpty:`За ${n} задач не было`,categoriesHead:[`Категория`,`Открыто`,`Вес`,`Создано`,`Закрыто`],originTitle:`Происхождение`,foundTitle:`Как найдены`,foundHead:[`Как найдена`,`Создано`,`Открыто`,`Исправлено`],branchesTitle:`Ветки`,branchesEmpty:`Ветки появятся у задач, заведённых через backlog new в репозитории`,branchesHead:[`Ветка`,`Создано`,`Открыто`],linesText:rh,codeAndTests:({code:e,tests:t})=>`код ${e}, тесты ${t}`,keptOut:`Посторонних правок вынесено`,keptOutPending:t=>`исправлено ${t}; оценка ожидающих появится после ${e.minFixesForEstimate} исправлений`,keptOutEstimated:(e,t)=>`исправлено ${e} + ожидают ${t}`,noiseWithoutBacklog:`Шум без беклога`,noiseNote:`доля посторонних правок в пулреквестах`,deferredToBacklog:`Вынесено в беклог`,deferredNote:(e,t)=>`исправлено ${e}, ожидают ${t}`,pullRequestLines:`Строк в пулреквестах`,effectWindow:`за ${a}`,chartScale:e=>`Масштаб графика «${e}»`,chartNames:{flow:`Долг`,intake:`Создано`,accuracy:`Точность проверки`,effect:`Эффект`,spend:`Расход`},grainNames:{week:`неделя`,day:`день`},effectTitle:`Эффективность`,byProject:`По проектам`,projectsHead:[`Проект`,`Вынесено задач`,`Исправлено строк`,`Оценка ожидающих`,`Строк в пулреквестах`,`Шум без беклога`],onTopicSeries:`по теме пулреквестов`,deferredSeries:`вынесено в беклог`,codeLines:`код`,testLines:`тесты`,deferredTasks:`задач вынесено`,effectSummary:(e,t,n)=>`За ${a}: в пулреквестах ${z(e,`строка`,`строки`,`строк`)}, вынесено ${t}, шум без беклога ${n}`,effectDaysSummary:(e,t,n)=>`За ${eh(`day`,e)}: по теме пулреквестов ${z(t,`строка`,`строки`,`строк`)}, вынесено ${n}`,noDeferredTasks:`Задач, вынесенных агентом попутно, пока нет — выигрыш считать не из чего. Агент выносит в беклог проблемы вне текущей работы, которые замечает сам (backlog new --found incidental); находки ревью и аудитов и задачи, заведённые по просьбе пользователя, сюда не входят.`,explainerTitle:`Как считается выигрыш`,explainerTask:`Каждая задача, которую агент попутно вынес из работы, — правка, которую без беклога он сделал бы в текущем пулреквесте. Выигрыш — строки, которые туда не попали. Не считаются находки ревью и аудитов и задачи, заведённые по просьбе пользователя, — они видны во вкладке «Качество», в «Происхождении».`,explainerFixed:`Исправленные — точно: строки коммита из причины закрытия, без lock-файлов, документации и картинок; коммит на несколько задач делится поровну. Не считаются задачи, закрытые без исправления, и исправленные без найденного коммита.`,explainerPending:`Ожидающие — оценка: медиана исправлений той же категории (если их не меньше ${e.minFixesForEstimate}), иначе всех исправлений.`,explainerTests:`Код и тесты: тестовые файлы — ${e.testFileGlobs.join(`, `)} и каталоги ${e.testDirectories.join(`, `)}. Для ожидающих — доля тестов в тех же исправлениях.`,explainerNoise:`Шум без беклога = вынесено ÷ (строк в пулреквестах + оценка ожидающих); исправления уже внутри пулреквестов и не удваиваются. Окно — с внедрения беклога в проекте, не раньше ${r} назад.`,now:`Сейчас:`,fixedNow:(e,t)=>`${th(e)} — ${rh(t)}`,noPending:`ожидающих нет`,pendingWithoutEstimate:e=>`${th(e)}, ${o}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${th(e)} ${rh(t)}, в среднем ${n} на задачу`,estimateLater:o,noCommitsSinceAdoption:`нет коммитов после внедрения`,noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Считаем расход по расшифровкам Claude Code…`,noTranscripts:`Расшифровки Claude Code не найдены.`,scanProgress:(e,t)=>`Считаем расход по расшифровкам Claude Code: прочитано ${e} из ${z(t,`файла`,`файлов`,`файлов`)}`,costNote:`Токены из расшифровок Claude Code: ходы, запущенные Stop-хуком беклога, — точно; вывод команд backlog и скилла — оценка по длине текста. Деньги — по ценам Claude API, подписка может стоить иначе. Расходы других агентов (Codex, Cursor) не учитываются.`,backlogTokens:`Токены из-за беклога`,backlogTokensNote:(e,t)=>`ходы хука ${e}, вывод CLI и скилл ${t}`,apiPrice:`По ценам API`,unpricedNote:`без моделей с неизвестной ценой`,hookTurns:`Ходов из-за хука`,hookRunsNote:e=>`запусков хука ${e}`,cliCalls:`Вызовов CLI`,costSince:e=>`Данные о расходе есть с ${e}`,byModel:`По моделям`,noModels:`Моделей пока нет`,modelsHead:[`Модель`,`Токены`,`По ценам API`],fastModel:e=>`${e} (быстрый режим)`,commandsTitle:`Команды`,noCommands:`Команд пока не было`,commandsHead:[`Команда`,`Запусков`,`Среднее время`,`Средняя память`,`Пиковая память`],mebibytes:e=>`${R(`ru`,e)} МиБ`,milliseconds:e=>`${O(`ru`,e)} мс`,spendBy:{week:`Расход по неделям`,day:`Расход по дням`},hookTurnTokens:`токены ходов хука`,cliOutputTokens:`токены вывода CLI и скилла`,hookRuns:`запуски хука`,otherCommands:`другие команды`,hookTurnsTooltip:`ходы хука`,cliOutput:`вывод CLI и скилл`,apiPriceTooltip:`по ценам API`,tokens:nh,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,approxMoney:i,hookRuns:a,cliRuns:o})=>`За ${z(t,...Zm[e])}: из-за хука ${nh(n)}, вывод CLI и скилл ${r}, ${i}; запусков хука ${a}, других команд ${o}`,serverMemory:`Память сервера`,memoryRestartNote:`После перезапуска сервера история начинается заново`,memorySummary:(e,t)=>`Сейчас ${e}, максимум за ${i} ${t}`,processMemory:`память процесса`,jsHeap:`куча JavaScript`}}var ah=5e3,oh=S,sh=[`test`,`tests`,`__tests__`,`e2e`,`spec`],ch=[{glob:`*.test.*`,pattern:/\.test\./},{glob:`*.spec.*`,pattern:/\.spec\./},{glob:`*_test.*`,pattern:/_test\./},{glob:`test_*.py`,pattern:/^test_.+\.py$/}].map(({glob:e})=>e),lh=/^\s*[-*+]\s+\[(?<mark>[ xX])\]\s+(?<text>.*)$/,uh=/^\s{0,3}(?<fence>`{3,}|~{3,})/;function dh(e){let t=[],n=null;for(let[r,i]of e.split(`
|
|
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 ha(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;ha(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 ga=new Set([`type`,`properties`,`required`,`additionalProperties`]),_a=[`oneOf`,`anyOf`];function va(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ya(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ga.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]??va(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}let i=e.length===1?e[0]:ya(e)??{allOf:e};d(n,r,i)}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=va(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 ba(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ga)if(t in e)return;let n=t.filter(e=>_a.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ya(t);else{let e=n[0],i=_a.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=>ya([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,ua(e,r))}function xa(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)):ua(i,s),ua(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())ha(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)??[])ba(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)}ua(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,d(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:Ca(t,`input`,e.processors),output:Ca(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function U(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 U(r.element,n);if(r.type===`set`)return U(r.valueType,n);if(r.type===`lazy`)return U(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 U(r.innerType,n);if(r.type===`intersection`)return U(r.left,n)||U(r.right,n);if(r.type===`record`||r.type===`map`)return U(r.keyType,n)||U(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:U(r.in,n)||U(r.out,n);if(r.type===`object`){for(let e in r.shape)if(U(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(U(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(U(e,n))return!0;return!!(r.rest&&U(r.rest,n))}return!1}var Sa=(e,t={})=>n=>{let r=da({...n,processors:t});return H(e,r),ma(r,e),xa(r,e)},Ca=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=da({...i??{},target:a,io:t,processors:n});return H(e,o),ma(o,e),xa(o,e)},wa=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ta=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ea=(e,t)=>{wa(e,`minimum`,t),Ta(e,`maximum`,t)},Da=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Oa=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},ka=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Aa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ja=(e,t)=>wa(e,`minimum`,t.minimum),Ma=(e,t)=>Ta(e,`maximum`,t.maximum),Na=e=>(t,n)=>{Aa(t,n.format);let[r,i]=e[n.format];wa(t,`minimum`,r),Ta(t,`maximum`,i)},Pa={greater_than:(e,t)=>wa(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ta(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Da(e,t.value),number_format:Na(g),bigint_format:Na(h),min_length:ja,max_length:Ma,length_equals:(e,t)=>Ea(e,t.length),min_size:ja,max_size:Ma,size_equals:(e,t)=>Ea(e,t.size),string_format:(e,t)=>{Aa(e,t.format),t.pattern&&Oa(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)=>ka(e,t.mime)};function Fa(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Pa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&wa(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&wa(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ta(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ta(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Da(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ka(t,i.mime);for(let e of i.patterns??[])Oa(t,e);return t}var Ia={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},La=new Map([[Ln,bt],[zn,xt]]),Ra=e=>La.get(e)??e,za=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Fa(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ia[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(Ra);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}))])}},Ba=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Fa(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)):fa(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}))])}},Va=(e,t,n,r)=>{n.type=`boolean`},Ha=(e,t,n,r)=>{n.not={}},Ua=(e,t,n,r)=>{let i=e._zod.def,a=y(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},Wa=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(fa(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(fa(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ga=(e,t,n,r)=>{fa(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{fa(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},qa=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Fa(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=H(a.element,t,{...r,path:[...r.path,`items`]})};function Ja(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ja(t.out):t.type===`catch`?Ja(t.innerType):e._zod.optin}var Ya=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&fa(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)d(i.properties,e,H(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`?Ja(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=H(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Xa=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>H(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Za=(e,t,n,r)=>{let i=e._zod.def,a=H(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=H(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 Qa(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=Qa(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=>Qa(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`)?Mt:jt).source),p):p}var $a=new WeakMap;function eo(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 $a.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Qa(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 to=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Fa(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=H(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)d(i.patternProperties,Ra(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=H(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=$a.get(t);n||(n=[],$a.set(t,n),t.deferred.push(()=>eo(t))),n.push(e)}i.additionalProperties=H(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ja(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))}},no=(e,t,n,r)=>{let i=e._zod.def,a=H(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`}]},ro=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},io=Symbol();function ao(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(fa(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),io):JSON.parse(o)}var oo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n.default=o)},so=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n._prefault=o)},co=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{fa(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},lo=(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;H(o,t,r);let s=t.seen.get(e);s.ref=o},uo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},fo=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},po=new WeakSet([Object.prototype,Error.prototype]);function mo(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 ho=_(`ZodError`,(e,t)=>{Pe.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);po.has(n)||(po.add(n),mo(n,`format`,e=>t=>Le(e,t)),mo(n,`flatten`,e=>t=>Ie(e,t)),mo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,de,2)}),mo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,de,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),go=ze(ho),_o=Be(ho),vo=Ve(ho),yo=Ue(ho),bo=Ye(ho),xo=Xe(ho),So=Ze(ho),Co=Qe(ho),wo=$e(ho),To=et(ho),Eo=tt(ho),Do=nt(ho);function Oo(){I.localeError||r($r())}function ko(){I.memoizer||r({memoizer:Xr()})}var W=_(`ZodType`,(e,t)=>(Oo(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ne(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 w(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ys(e,t))},superRefine(e,t){return this.check(Xs(e,t))},overwrite(e){return this.check(ea(e))},optional(){return ks(this)},exactOptional(){return js(this)},nullable(){return Ns(this)},nullish(){return ks(Ns(this))},nonoptional(e){return zs(this,e)},array(){return fs(this)},or(e){return gs([this,e])},and(e){return bs(this,e)},transform(e){return Us(this,Ds(e))},default(e){return Fs(this,e)},prefault(e){return Ls(this,e)},catch(e){return Vs(this,e)},pipe(e){return Us(this,e)},readonly(){return qs(this)},describe(e){let t=this.clone();return oi.add(t,{description:e}),t},meta(...e){if(e.length===0)return oi.get(this);let t=this.clone();return oi.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 re(this,`~standard`,{...an(this),jsonSchema:{input:Ca(this,`input`),output:Ca(this,`output`)}})},set"~standard"(e){fe(this,`~standard`,e)},parse:function e(t,n){return go(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await _o(this,t,n,{callee:e})},safeParse(e,t){return vo(this,e,t)},async safeParseAsync(e,t){return yo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){fe(this,`spa`,e)},validate(e,t){return Ke(this,e,t)},validateAsync(e,t){return Je(this,e,t)},encode:function e(t,n){return bo(this,t,n,{callee:e})},decode:function e(t,n){return xo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await So(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Co(this,t,n,{callee:e})},safeEncode(e,t){return wo(this,e,t)},safeDecode(e,t){return To(this,e,t)},async safeEncodeAsync(e,t){return Eo(this,e,t)},async safeDecodeAsync(e,t){return Do(this,e,t)},toJSONSchema(e){return Sa(this,{})(e)},get description(){return oi.get(this)?.description},get _def(){return this._zod.def}}),Ao=_(`_ZodString`,(e,t)=>{on.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r)},l({format:e=>Fa(e).format??null,minLength:e=>Fa(e).minimum??null,maxLength:e=>Fa(e).maximum??null},{regex(...e){return this.check(Ji(...e))},includes(...e){return this.check(Zi(...e))},startsWith(...e){return this.check(Qi(...e))},endsWith(...e){return this.check($i(...e))},min(...e){return this.check(Ki(...e))},max(...e){return this.check(Gi(...e))},length(...e){return this.check(qi(...e))},nonempty(...e){return this.check(Ki(1,...e))},lowercase(e){return this.check(Yi(e))},uppercase(e){return this.check(Xi(e))},trim(){return this.check(na())},normalize(...e){return this.check(ta(...e))},toLowerCase(){return this.check(ra())},toUpperCase(){return this.check(ia())},slugify(){return this.check(aa())}})),jo=_(`ZodString`,(e,t)=>{on.init(e,t),Ao.init(e,t)},{email(e){return this.check(li(Io,e))},url(e){return this.check(hi(zo,e))},jwt(e){return this.check(Ai(es,e))},emoji(e){return this.check(gi(Bo,e))},guid(e){return this.check(ui(Lo,e))},uuid(e){return this.check(di(Ro,e))},uuidv4(e){return this.check(fi(Ro,e))},uuidv6(e){return this.check(pi(Ro,e))},uuidv7(e){return this.check(mi(Ro,e))},nanoid(e){return this.check(_i(Vo,e))},cuid(e){return this.check(vi(Ho,e))},cuid2(e){return this.check(yi(Uo,e))},ulid(e){return this.check(bi(Wo,e))},base64(e){return this.check(Di(Zo,e))},base64url(e){return this.check(Oi(Qo,e))},xid(e){return this.check(xi(Go,e))},ksuid(e){return this.check(Si(Ko,e))},ipv4(e){return this.check(Ci(qo,e))},ipv6(e){return this.check(wi(Jo,e))},cidrv4(e){return this.check(Ti(Yo,e))},cidrv6(e){return this.check(Ei(Xo,e))},e164(e){return this.check(ki($o,e))},datetime(e){return this.check(ji(Mo,e))},date(e){return this.check(Mi(No,e))},time(e){return this.check(Ni(Po,e))},duration(e){return this.check(Pi(Fo,e))}});function G(e){return ci(jo,e)}var K=_(`ZodStringFormat`,(e,t)=>{V.init(e,t),Ao.init(e,t)}),Mo=_(`ZodISODateTime`,(e,t)=>{Tn.init(e,t),K.init(e,t)}),No=_(`ZodISODate`,(e,t)=>{En.init(e,t),K.init(e,t)}),Po=_(`ZodISOTime`,(e,t)=>{Dn.init(e,t),K.init(e,t)}),Fo=_(`ZodISODuration`,(e,t)=>{On.init(e,t),K.init(e,t)}),Io=_(`ZodEmail`,(e,t)=>{ln.init(e,t),K.init(e,t)}),Lo=_(`ZodGUID`,(e,t)=>{sn.init(e,t),K.init(e,t)}),Ro=_(`ZodUUID`,(e,t)=>{cn.init(e,t),K.init(e,t)}),zo=_(`ZodURL`,(e,t)=>{_n.init(e,t),K.init(e,t)}),Bo=_(`ZodEmoji`,(e,t)=>{vn.init(e,t),K.init(e,t)}),Vo=_(`ZodNanoID`,(e,t)=>{yn.init(e,t),K.init(e,t)}),Ho=_(`ZodCUID`,(e,t)=>{bn.init(e,t),K.init(e,t)}),Uo=_(`ZodCUID2`,(e,t)=>{xn.init(e,t),K.init(e,t)}),Wo=_(`ZodULID`,(e,t)=>{Sn.init(e,t),K.init(e,t)}),Go=_(`ZodXID`,(e,t)=>{Cn.init(e,t),K.init(e,t)}),Ko=_(`ZodKSUID`,(e,t)=>{wn.init(e,t),K.init(e,t)}),qo=_(`ZodIPv4`,(e,t)=>{kn.init(e,t),K.init(e,t)}),Jo=_(`ZodIPv6`,(e,t)=>{Mn.init(e,t),K.init(e,t)}),Yo=_(`ZodCIDRv4`,(e,t)=>{Nn.init(e,t),K.init(e,t)}),Xo=_(`ZodCIDRv6`,(e,t)=>{Fn.init(e,t),K.init(e,t)}),Zo=_(`ZodBase64`,(e,t)=>{Rn.init(e,t),K.init(e,t)}),Qo=_(`ZodBase64URL`,(e,t)=>{Vn.init(e,t),K.init(e,t)}),$o=_(`ZodE164`,(e,t)=>{Hn.init(e,t),K.init(e,t)}),es=_(`ZodJWT`,(e,t)=>{Wn.init(e,t),K.init(e,t)}),ts=_(`ZodNumber`,(e,t)=>{Gn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r),e.isFinite=!0},l({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Fa(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Fa(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Fa(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Fa(e).format??null},{gt(e,t){return this.check(Hi(e,t))},gte(e,t){return this.check(Ui(e,t))},min(e,t){return this.check(Ui(e,t))},lt(e,t){return this.check(Bi(e,t))},lte(e,t){return this.check(Vi(e,t))},max(e,t){return this.check(Vi(e,t))},int(e){return this.check(is(e))},safe(e){return this.check(is(e))},positive(e){return this.check(Hi(0,e))},nonnegative(e){return this.check(Ui(0,e))},negative(e){return this.check(Bi(0,e))},nonpositive(e){return this.check(Vi(0,e))},multipleOf(e,t){return this.check(Wi(e,t))},step(e,t){return this.check(Wi(e,t))},finite(){return this}}));function ns(e){return Fi(ts,e)}var rs=_(`ZodNumberFormat`,(e,t)=>{Kn.init(e,t),ts.init(e,t)});function is(e){return Ii(rs,e)}var as=_(`ZodBoolean`,(e,t)=>{qn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r)});function os(e){return Li(as,e)}var ss=_(`ZodUnknown`,(e,t)=>{Jn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function cs(){return Ri(ss)}var ls=_(`ZodNever`,(e,t)=>{Yn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r)});function us(e){return zi(ls,e)}var ds=_(`ZodArray`,(e,t)=>{ko(),Zn.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ki(e,t))},nonempty(e){return this.check(Ki(1,e))},max(e,t){return this.check(Gi(e,t))},length(e,t){return this.check(qi(e,t))},unwrap(){return this.element}});function fs(e,t){return oa(ds,e,t)}var ps=_(`ZodObject`,(e,t)=>{ko(),rr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),ve(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return J(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ne(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ne(this._zod.def,{catchall:cs()}))},loose(){return this.clone(ne(this._zod.def,{catchall:cs()}))},strict(){return this.clone(ne(this._zod.def,{catchall:us()}))},strip(){return this.clone(ne(this._zod.def,{catchall:void 0}))},extend(e){return D(this,e)},safeExtend(e){return we(this,e)},merge(e){return _e(this,e)},pick(e){return oe(this,e)},omit(e){return N(this,e)},partial(...e){return se(Os,this,e[0])},exactPartial(...e){return se(As,this,e[0],`exactPartial`)},required(...e){return te(Rs,this,e[0])}});function q(e,t){return new ps({type:`object`,shape:e??{},...L(t)})}function ms(e,t){return new ps({type:`object`,shape:e,catchall:us(),...L(t)})}var hs=_(`ZodUnion`,(e,t)=>{ar.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e.options=t.options});function gs(e,t){return new hs({type:`union`,options:e,...L(t)})}var _s=_(`ZodDiscriminatedUnion`,(e,t)=>{hs.init(e,t),sr.init(e,t)});function vs(e,t,n){return new _s({type:`union`,options:t,discriminator:e,...L(n)})}var ys=_(`ZodIntersection`,(e,t)=>{cr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r)});function bs(e,t){return new ys({type:`intersection`,left:e,right:t})}var xs=_(`ZodRecord`,(e,t)=>{ko(),dr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ss(e,t,n){return!t||!t._zod?new xs({type:`record`,keyType:G(),valueType:e,...L(t)}):new xs({type:`record`,keyType:e,valueType:t,...L(n)})}var Cs=_(`ZodEnum`,(e,t)=>{fr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(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 Cs({...t,checks:[],...L(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 Cs({...t,checks:[],...L(r),entries:i})}});function J(e,t){return new Cs({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}var ws=_(`ZodLiteral`,(e,t)=>{pr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ts(e,t){return new ws({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}var Es=_(`ZodTransform`,(e,t)=>{ko(),mr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new o(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(F(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(F(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ds(e){return new Es({type:`transform`,transform:e})}var Os=_(`ZodOptional`,(e,t)=>{gr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new Os({type:`optional`,innerType:e})}var As=_(`ZodExactOptional`,(e,t)=>{_r.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`optional`,innerType:e})}var Ms=_(`ZodNullable`,(e,t)=>{vr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e){return new Ms({type:`nullable`,innerType:e})}var Ps=_(`ZodDefault`,(e,t)=>{yr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fs(e,t){return new Ps({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():x(t)}})}var Is=_(`ZodPrefault`,(e,t)=>{xr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ls(e,t){return new Is({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():x(t)}})}var Rs=_(`ZodNonOptional`,(e,t)=>{Sr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zs(e,t){return new Rs({type:`nonoptional`,innerType:e,...L(t)})}var Bs=_(`ZodCatch`,(e,t)=>{Tr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Vs(e,t){return new Bs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:C(t)})}var Hs=_(`ZodPipe`,(e,t)=>{Er.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.in=t.in,e.out=t.out});function Us(e,t){return new Hs({type:`pipe`,in:e,out:t})}var Ws=_(`ZodCodec`,(e,t)=>{Hs.init(e,t),Or.init(e,t)});function Gs(e,t,n){return new Ws({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var Ks=_(`ZodReadonly`,(e,t)=>{jr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qs(e){return new Ks({type:`readonly`,innerType:e})}var Js=_(`ZodCustom`,(e,t)=>{Nr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r)});function Ys(e,t={}){return sa(Js,e,t)}function Xs(e,t){return ca(e,t)}function Zs(e){return ji(Mo,e)}var Qs=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var P={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),$s=t(((e,t)=>{t.exports=Qs()})),ec=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),tc=t(((e,t)=>{t.exports=ec()})),Y=e($s(),1),nc=tc(),rc=Y.createContext(void 0),ic=e=>{let t=Y.useContext(rc);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ac=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,nc.jsx)(rc.Provider,{value:e,children:t})),oc={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},sc=new class{#e=oc;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function cc(e){setTimeout(e,0)}var lc=typeof window>`u`||`Deno`in globalThis;function uc(){}function dc(e,t){return typeof e==`function`?e(t):e}function fc(e){return typeof e==`number`&&e>=0&&e!==1/0}function pc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function X(e,t){return typeof e==`function`?e(t):e}function mc(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==gc(o,t.options))return!1}else if(!vc(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function hc(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_c(t.options.mutationKey)!==_c(a))return!1}else if(!vc(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function gc(e,t){return(t?.queryKeyHashFn||_c)(e)}function _c(e){return JSON.stringify(e,(e,t)=>Cc(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function vc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!vc(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!vc(e[r],t[r]))return!1;return!0}return!1}var yc=Object.prototype.hasOwnProperty;function bc(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Sc(e)&&Sc(t);if(!r&&!(Cc(e)&&Cc(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:yc.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=bc(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function xc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Sc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Cc(e){if(!wc(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!wc(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function wc(e){return Object.prototype.toString.call(e)===`[object Object]`}function Tc(e){return new Promise(t=>{sc.setTimeout(t,e)})}function Ec(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:bc(e,t)}function Dc(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Oc(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var kc=Symbol();function Ac(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===kc?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jc(e,t){return typeof e==`function`?e(...t):!!e}function Mc(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Nc=()=>lc,Pc=()=>Nc(),Fc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ic=new class extends Fc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Lc=cc;function Rc(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Lc,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var zc=Rc(),Bc=new class extends Fc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Vc(e){return Math.min(1e3*2**e,3e4)}function Hc(e){return(e??`online`)!==`online`||Bc.isOnline()}var Uc=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Wc(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(uc);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Uc(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ic.isFocused()&&(e.networkMode===`always`||Bc.isOnline())&&e.canRun(),p=()=>Hc(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Pc()?0:3),a=e.retryDelay??Vc,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),Tc(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Gc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fc(this.gcTime)&&(this.#e=sc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Pc()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(sc.clearTimeout(this.#e),this.#e=void 0)}};function Kc(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Mc(e,()=>t.signal,()=>n=!0)},u=Ac(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Oc:Dc;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Jc:qc,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:qc(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function qc(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Jc(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Yc=class extends Gc{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Qc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Qc(this.options);e.data!==void 0&&(this.setState(Zc(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ec(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(uc).catch(uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>X(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>X(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!pc(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ac(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Kc(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Wc({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Uc&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Uc){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Xc(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Zc(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),zc.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Xc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hc(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Zc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Qc(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var $c=class extends Fc{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),tl(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nl(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nl(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof X(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!xc(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&rl(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||X(this.options.staleTime,this.#t)!==X(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xc(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(uc)),t}#h(e){return!Pc()&&X(this.options.enabled,this.#t)!==!1&&fc(e)}#g(){this.#b();let e=X(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=pc(this.#r.dataUpdatedAt,e)+1;this.#u=sc.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return X(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=sc.setInterval(()=>{(this.options.refetchIntervalInBackground||Ic.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(sc.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(sc.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&tl(e,t),o=i&&rl(e,n,t,r);(a||o)&&(l={...l,...Xc(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ec(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ec(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:il(e,t),refetch:this.refetch,isEnabled:X(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),xc(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();zc.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function el(e,t){return X(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||X(t.retryOnMount,e)!==!1)}function tl(e,t){return el(e,t)||e.state.data!==void 0&&nl(e,t,t.refetchOnMount)}function nl(e,t,n){if(X(t.enabled,e)!==!1&&X(t.staleTime,e)!==`static`){let r=X(n,e);return r===`always`||r!==!1&&il(e,t)}return!1}function rl(e,t,n,r){return(e!==t||X(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&il(e,n)}function il(e,t){return X(t.enabled,e)!==!1&&e.isStaleByTime(X(t.staleTime,e))}var al=class extends Gc{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ol(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Wc({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),zc.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ol(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var sl=class extends Fc{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),xc(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&_c(t.mutationKey)!==_c(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ol();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){zc.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},cl=Y.createContext(!1),ll=()=>Y.useContext(cl);cl.Provider;function ul(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dl=Y.createContext(ul()),fl=()=>Y.useContext(dl),pl=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?jc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},ml=e=>{Y.useEffect(()=>{e.clearReset()},[e])},hl=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||jc(n,[e.error,r])),gl=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},_l=(e,t)=>e?.suspense&&t.isPending,vl=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yl(e,t,n){let r=ll(),i=fl(),a=ic(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,gl(o),pl(o,i,s),ml(i);let[l]=Y.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(Y.useSyncExternalStore(Y.useCallback(e=>{let t=d?l.subscribe(zc.batchCalls(e)):uc;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Y.useEffect(()=>{l.setOptions(o)},[o,l]),_l(o,u))throw vl(o,l,i);if(hl({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function bl(e,t){return yl(e,$c,t)}function xl(e,t){let n=ic(t),[r]=Y.useState(()=>new sl(n,e));Y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(zc.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Y.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(uc)},[r]);if(i.error&&jc(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Sl=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Cl=/^[\\/]{2}/;function wl(e,t){return t+e.replace(/\\/g,`/`)}var Tl=`popstate`;function El(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Dl(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return jl(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Ml(t)}return Pl(t,n,null,e)}function Z(e,t){if(e===!1||e==null)throw Error(t)}function Ol(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function kl(){return Math.random().toString(36).substring(2,10)}function Al(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function jl(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Nl(t):t,state:n,key:t&&t.key||r||kl(),mask:i}}function Ml({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Nl(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Pl(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=El(e)?e:jl(h.location,e,t);n&&n(r,e),l=u()+1;let d=Al(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=El(e)?e:jl(h.location,e,t);n&&n(r,e),l=u();let i=Al(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Fl(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Tl,d),c=e,()=>{i.removeEventListener(Tl,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Fl(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Z(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ml(t);return i=i.replace(/ $/,`%20`),!n&&Cl.test(i)&&(i=r+i),new URL(i,r)}var Il=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},Ll=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function Rl(e){return Ll.has(e)}var zl=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function Bl(e){return zl.has(e)}function Vl(e){return e.index===!0}function Hl(e){let t={};return e.Component&&Object.assign(t,{element:Y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:Y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:Y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Ul(e,t=Hl,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(Z(e.index!==!0||!e.children,`Cannot specify children on an index route`),Z(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Vl(e)){let n={...e,id:s};return r[s]=Wl(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Wl(n,t(n)),e.children&&(n.children=Ul(e.children,t,o,r,i)),n}})}function Wl(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Gl(e,t,n=`/`){return Kl(e,t,n,!1)}function Kl(e,t,n,r,i){let a=mu((typeof t==`string`?Nl(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Jl(e),s=null,c=pu(a);for(let e=0;s==null&&e<o.length;++e)s=lu(o[e],c,r);return s}function ql(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function Jl(e){let t=Yl(e);return Zl(t),t}function Yl(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Z(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=wu([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Z(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Yl(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:su(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=fu(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Xl(e.path))a(e,t,!0,n)}),t}function Xl(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Xl(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Zl(e){e.sort((e,t)=>e.score===t.score?cu(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ql=/^:[\w-]+$/,$l=/^:[\w-]+/,eu=3.5,tu=3,nu=2,ru=1,iu=10,au=-2,ou=e=>e===`*`;function su(e,t){let n=e.split(`/`),r=n.length;return n.some(ou)&&(r+=au),t&&(r+=nu),n.filter(e=>!ou(e)).reduce((e,t)=>e+(Ql.test(t)?tu:$l.test(t)?eu:t===``?ru:iu),r)}function cu(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function lu(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?du(u,l,s.matcher,s.compiledParams):uu(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=uu({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:wu([a,d.pathname]),pathnameBase:Eu(wu([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=wu([a,d.pathnameBase]))}return o}function uu(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fu(e.path,e.caseSensitive,e.end);return du(e,t,n,r)}function du(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Tu(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Tu(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function fu(e,t=!1,n=!0){Ol(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function pu(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ol(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function mu(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function hu({basename:e,pathname:t}){return t===`/`?e:wu([e,t])}var gu=e=>Sl.test(e);function _u(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Nl(e):e,a;return n?(n=Cu(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?vu(n.substring(1),`/`):vu(n,t)):a=t,{pathname:a,search:Du(r),hash:Ou(i)}}function vu(e,t){let n=Tu(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function yu(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function bu(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function xu(e){let t=bu(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Su(e,t,n,r=!1){let i;typeof e==`string`?i=Nl(e):(i={...e},Z(!i.pathname||!i.pathname.includes(`?`),yu(`?`,`pathname`,`search`,i)),Z(!i.pathname||!i.pathname.includes(`#`),yu(`#`,`pathname`,`hash`,i)),Z(!i.search||!i.search.includes(`#`),yu(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_u(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Cu=e=>e.replace(/[\\/]{2,}/g,`/`),wu=e=>Cu(e.join(`/`));function Tu(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Eu=e=>Tu(e).replace(/^\/*/,`/`),Du=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ou=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ku=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Au=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ju(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Mu(e){return wu(e.map(e=>e.route.path).filter(Boolean))||`/`}function Nu(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?Nl(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Pu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Fu(e,t){let n=e;if(typeof n!=`string`||!Sl.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Pu)try{let e=new URL(window.location.href),r=Cl.test(n)?new URL(wl(n,e.protocol)):new URL(n),a=mu(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ol(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Iu=Symbol(`Uninstrumented`),Lu=new WeakMap;function Ru(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>Wu(await Gu(n.lazy,void 0,()=>e(...t),Ku))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>Wu(await Gu(n[`lazy.middleware`],void 0,()=>t(...e),Ku))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Wu(await Gu(n[`lazy.loader`],void 0,()=>t(...e),Ku))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Wu(await Gu(n[`lazy.action`],void 0,()=>t(...e),Ku))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Bu(t.loader),i=async(...t)=>Wu(await Gu(n.loader,qu(t[0]),()=>e(...t),Ku));e.hydrate===!0&&(i.hydrate=!0),Vu(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Bu(t.action),i=async(...t)=>Wu(await Gu(n.action,qu(t[0]),()=>e(...t),Ku));Vu(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Bu(e),r=async(...e)=>Wu(await Gu(n.middleware,qu(e[0]),()=>t(...e),Ku));return Vu(r,t),r})),r}function zu(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Bu(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?Ml(i):`.`,...Ju(e,a??{})};return Wu(await Gu(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Hu(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Ku(e),meta:o})))};Vu(r,t),e.navigate=r}if(n.fetch.length>0){let t=Bu(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Wu(await Gu(n.fetch,{href:o??`.`,fetcherKey:i,...Ju(e,s??{})},async()=>{let n=Hu(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Ku(e),meta:c})))};Vu(r,t),e.fetch=r}return e}function Bu(e){return e[Iu]??e}function Vu(e,t){e[Iu]=t}function Hu(e,t){return Lu.set(e,t),()=>{Lu.get(e)===t&&Lu.delete(e)}}function Uu(e){let t=Lu.get(e);return Lu.delete(e),t}function Wu(e){if(e.type===`error`)throw e.value;return e.value}async function Gu(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=Gu(e,t,n,r,i,a-1),await s,Z(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function Ku(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function qu(e){let{request:t,context:n,params:r}=e;return{...e,request:Yu(t),params:{...r},context:Xu(n)}}function Ju(e,t){return{currentUrl:Ml(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Yu(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Xu(e){return{get:t=>e.get(t)}}var Zu=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=Jl(e)}match(e,t=!1){return Kl(this.#e,e,this.#n,t,this.#t)}},Qu=new URL(`http://localhost`);function $u(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Qu)}catch{return Qu}}function ed(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function td(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function nd(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!ed(i,n),s=!ed(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!td(e,i)||!ed(i,a)))throw Error(`External navigation is not allowed`)}var rd=[`POST`,`PUT`,`PATCH`,`DELETE`],id=new Set(rd),ad=[`GET`,...rd],od=new Set(ad),sd=new Set([301,302,303,307,308]),cd=new Set([307,308]),ld={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ud={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},dd={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},fd=`remix-router-transitions`,pd=Symbol(`ResetLoaderData`);function md(e,t){return e.unstable_routePatternMatching?(Z(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Zu(t)}var hd=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}};function gd(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;Z(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...Ru(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=md(o,s),l={},u=new hd(Ul(e.routes,a,void 0,l),c),d=e.dataStrategy||Nd,f=null,p=new Set,m=null,h=null,g=null,_=null,v=e.hydrationData!=null,y=c.match(e.history.location),b=!1,x=null,S,C;if(y==null&&!e.patchRoutesOnNavigation){let t=rf(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=nf(u.activeRoutes);S=!0,C=!S,y=n,x={[r.id]:t}}else if(y&&!e.hydrationData&&Ge(y,e.history.location.pathname).active&&(y=null),!y){S=!1,C=!S,y=[];let t=Ge(null,e.history.location.pathname);t.active&&t.matches&&(b=!0,y=t.matches)}else if(y.some(e=>e.route.lazy))S=!1,C=!S;else if(!y.some(e=>xd(e.route)))S=!0,C=!S;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=y;if(n){let e=y.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}C=!1,S=!0,r.forEach(e=>{let r=Sd(e.route,t,n);C||=r.renderFallback,S&&=!r.shouldLoad})}let w,T={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,renderFallback:C,navigation:ld,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=`POP`,D=null,ee=!1,O,k=!1,A=new Map,j=null,te=!1,M=!1,ne=new Set,N=new Map,re=0,ie=-1,ae=new Map,P=new Set,oe=new Map,se=new Map,ce=new Set,F=new Map,I,L=null;function R(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(I){I(),I=void 0;return}Ol(F.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=ze({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{I=e});e.history.go(r*-1),Re(i,{state:`blocked`,location:n,proceed(){Re(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(T.blockers);e.set(i,dd),z({blockers:e})}}),D?.resolve(),D=null;return}return me(t,n)}),n){Of(t,A);let e=()=>kf(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||me(`POP`,T.location,{initialHydration:!0}),w}function le(){f&&f(),j&&j(),p.clear(),O&&O.abort(),T.fetchers.forEach((e,t)=>Ae(T.fetchers,t)),T.blockers.forEach((e,t)=>Le(t))}function ue(e){if(p.add(e),m){let{newErrors:t}=m;m=null,e(T,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)}function z(e,t={}){e.matches&&=e.matches.map(e=>{let t=l[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),T={...T,...e};let n=[],r=[];T.fetchers.forEach((e,t)=>{e.state===`idle`&&(ce.has(t)?n.push(t):r.push(t))}),ce.forEach(e=>{!T.fetchers.has(e)&&!N.has(e)&&n.push(e)}),p.size===0&&(m={newErrors:e.errors??null}),[...p].forEach(r=>r(T,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ae(T.fetchers,e)),r.forEach(e=>T.fetchers.delete(e))}function de(t,n,{flushSync:r}={}){let i=T.actionData!=null&&T.navigation.formMethod!=null&&Q(T.navigation.formMethod)&&T.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?T.actionData:null;let o=n.loaderData?$d(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,s=T.blockers;s.size>0&&!te&&(s=new Map(s),s.forEach((e,t)=>s.set(t,dd)));let c=!te&&We(t,n.matches||T.matches),l=ee===!0||T.navigation.formMethod!=null&&Q(T.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),te||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!te&&t!==T.location){let e=A.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(k){let e=A.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(T.location.pathname,e)),d={currentLocation:T.location,nextLocation:t}}z({...n,actionData:a,loaderData:o,historyAction:E,location:t,initialized:!0,renderFallback:!1,navigation:ld,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,ee=!1,k=!1,te=!1,M=!1,D?.resolve(),D=null,L?.resolve(),L=null}async function fe(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=Af();let n=D.promise;return e.history.go(t),n}let r=Uu(w),{path:i,submission:a,error:o}=yd(!1,vd(T.location,T.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?Nl(n.mask):{...T.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},Cl.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),nd(typeof n.mask==`string`?n.mask:Ml(n.mask),Ml(c),e.history.createURL(`/`),`reject`)}let l=T.location,u=jl(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},nd(t==null?e.history.createHref(T.location):typeof t==`string`?t:Ml(t),e.history.createHref(u.mask||u),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Q(a.formMethod)&&a.formAction===T.location.pathname+T.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=ze({currentLocation:l,nextLocation:u,historyAction:f});if(h){Re(h,{state:`blocked`,location:u,proceed(){Re(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),fe(t,n)},reset(){let e=new Map(T.blockers);e.set(h,dd),z({blockers:e})}});return}await me(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function pe(){L||=Af(),Te(),z({revalidation:`loading`});let e=L.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(me(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(me(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:k===!0}),e)}async function me(t,n,r){O&&O.abort(),O=null,E=t,te=(r&&r.startUninterruptedRevalidation)===!0,Ue(T.location,T.matches),ee=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&T.matches&&T.matches.length>0&&!b?T.matches:c.match(n),a=(r&&r.flushSync)===!0;if(i&&T.initialized&&!M&&sf(T.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){de(n,{matches:i},{flushSync:a});return}let o=Ge(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=xf(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=Be(n.pathname);de(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;O=new AbortController;let l=Jd(e.history,n,O.signal,r&&r.submission),u=e.getContext?await e.getContext():new Il,d;if(r&&r.pendingError)d=[tf(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let c=await he(l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(c.shortCircuited)return;if(c.pendingActionResult){let[e,t]=c.pendingActionResult;if(ff(t)&&ju(t.error)&&t.error.status===404){O=null,de(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,d=c.pendingActionResult,s=Cf(n,i,t,r.submission),a=!1,o.active=!1,l=Jd(e.history,l.url,l.signal)}let{shortCircuited:f,matches:p,loaderData:m,errors:h,workingFetchers:g}=await ge(l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,d,r&&r.callSiteDefaultShouldRevalidate);f||(O=null,de(n,{matches:p||i,...ef(d),loaderData:m,errors:h,...g?{fetchers:g}:{}}))}async function he(t,n,i,o,c,d,f,p,m={}){if(Te(),z({navigation:wf(n,o,c,i)},{flushSync:m.flushSync===!0}),f){let e=await Ke(o,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=nf(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=tf(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)o=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Be(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=bf(o,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:rf(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ce(t,n,zd(a,l,t,n,o,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of o)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(pf(h)){let n;return n=m&&m.replace!=null?m.replace:qd(h.response.headers.get(`Location`),new URL(t.url),s,e.history)===T.location.pathname+T.location.search,await Se(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(ff(h)){let e=tf(o,g.route.id);return(m&&m.replace)!==!0&&(E=`PUSH`),{matches:o,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:o,pendingActionResult:[g.route.id,h]}}async function ge(t,n,i,o,s,d,f,p,m,h,g,_,v,y){let b=f||Cf(n,i,o,p),x=p||m||Sf(b),S=!te&&!g;if(d){if(S){let e=_e(v);z({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Ke(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=nf(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=tf(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Be(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let{dsMatches:C,revalidatingFetchers:w}=bd(t,s,a,l,e.history,T,i,x,n,g?[]:r,g===!0,M,ne,ce,oe,P,c,v,y);if(ie=++re,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&w.length===0){let e=new Map(T.fetchers),t=Pe(e);return de(n,{matches:i,loaderData:{},errors:v&&ff(v[1])?{[v[0]]:v[1].error}:null,...ef(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=_e(v);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=ve(w)),z(e,{flushSync:_})}w.forEach(e=>{Me(e.key),e.controller&&N.set(e.key,e.controller)});let E=()=>w.forEach(e=>Me(e.key));O&&O.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:ee}=await we(C,w,t,n,s);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,E),w.forEach(e=>N.delete(e.key));let k=af(D);if(k)return await Se(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=af(ee),k)return P.add(k.key),await Se(t,k.result,!0,{replace:h}),{shortCircuited:!0};let A=new Map(T.fetchers),{loaderData:j,errors:ae}=Qd(T,i,D,v,w,ee,A);g&&T.errors&&(ae={...T.errors,...ae});let se=Pe(A),F=Fe(ie,A),I=se||F||w.length>0;return{matches:i,loaderData:j,errors:ae,...I?{workingFetchers:A}:{}}}function _e(e){if(e&&!ff(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function ve(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Tf(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function ye(t,n,r,i){Me(t);let a=(i&&i.flushSync)===!0,o=Uu(w),l=vd(T.location,T.matches,s,r,n,i?.relative),u=c.match(l),d=Ge(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(xf(e.history,l,u)),!u){De(t,n,rf(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=yd(!0,l,i);if(m){De(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new Il,g=(i&&i.preventScrollReset)===!0;if(p&&Q(p.formMethod)){await be(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};oe.set(t,_),await xe(t,_,u,h,a,g,p)}async function be(t,n,i,o,s,u,d,f,p,m){Te(),oe.delete(t),Ee(t,Ef(p,T.fetchers.get(t)),{flushSync:d});let h=new AbortController,g=Jd(e.history,i,h.signal,p);if(u){let e=await Ke(o,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){De(t,n,e.error,{flushSync:d});return}if(e.matches)o=e.matches;else{De(t,n,rf(404,{pathname:i}),{flushSync:d});return}}let _=bf(o,i);if(!_.route.action&&!_.route.lazy){De(t,n,rf(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:d});return}N.set(t,h);let v=re,y=zd(a,l,g,i,o,_,r,s),b=await Ce(g,i,y,s,t),x=b[_.route.id];if(!x){for(let e of y)if(b[e.route.id]){x=b[e.route.id];break}}if(g.signal.aborted){N.get(t)===h&&N.delete(t);return}if(ce.has(t)){if(pf(x)||ff(x)){Ee(t,Df(void 0));return}}else{if(pf(x)){if(N.delete(t),ie>v){Ee(t,Df(void 0));return}return P.add(t),Ee(t,Tf(p)),Se(g,x,!1,{fetcherSubmission:p,preventScrollReset:f})}if(ff(x)){De(t,n,x.error);return}}let S=T.navigation.location||T.location,C=Jd(e.history,S,h.signal),w=T.navigation.state===`idle`?T.matches:c.match(T.navigation.location);Z(w,`Didn't find any matches after fetcher action`);let D=++re;ae.set(t,D);let{dsMatches:ee,revalidatingFetchers:k}=bd(C,s,a,l,e.history,T,w,p,S,r,!1,M,ne,ce,oe,P,c,[_.route.id,x],m),A=Tf(p,x.data),j=new Map(T.fetchers);j.set(t,A),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=j.get(t),r=Tf(void 0,n?n.data:void 0);j.set(t,r),Me(t),e.controller&&N.set(t,e.controller)}),z({fetchers:j});let te=()=>k.forEach(e=>Me(e.key));h.signal.addEventListener(`abort`,te);let{loaderResults:se,fetcherResults:F}=await we(ee,k,C,S,s);if(h.signal.aborted){ae.get(t)===D&&ae.delete(t);return}h.signal.removeEventListener(`abort`,te),ae.delete(t),N.delete(t),k.forEach(e=>N.delete(e.key));let I=T.fetchers.has(t),L=e=>{if(!I)return e;let n=new Map(e.fetchers);return n.set(t,Df(x.data)),{...e,fetchers:n}},R=af(se);if(R)return T=L(T),Se(C,R.result,!1,{preventScrollReset:f});if(R=af(F),R)return P.add(R.key),T=L(T),Se(C,R.result,!1,{preventScrollReset:f});let le=new Map(T.fetchers);I&&le.set(t,Df(x.data));let{loaderData:ue,errors:fe}=Qd(T,w,se,void 0,k,F,le);Fe(D,le),T.navigation.state===`loading`&&D>ie?(Z(E,`Expected pending action`),O&&O.abort(),de(T.navigation.location,{matches:w,loaderData:ue,errors:fe,fetchers:le})):(z({errors:fe,loaderData:$d(T.loaderData,ue,w,fe),fetchers:le}),M=!1)}async function xe(t,n,i,o,s,c,u){let{routeId:d,path:f}=n,p=T.fetchers.get(t);Ee(t,Tf(u,p?p.data:void 0),{flushSync:s});let m=new AbortController,h=Jd(e.history,f,m.signal);if(n.isDiscovering){let e=await Ke(i,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){De(t,d,e.error,{flushSync:s});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{De(t,d,rf(404,{pathname:f}),{flushSync:s});return}}let g=bf(i,f);N.set(t,m);let _=re,v=await Ce(h,f,zd(a,l,h,f,i,g,r,o),o,t),y=v[g.route.id];if(!y){for(let e of i)if(v[e.route.id]){y=v[e.route.id];break}}if(N.get(t)===m&&N.delete(t),!h.signal.aborted){if(ce.has(t)){Ee(t,Df(void 0));return}if(pf(y)){if(ie>_){Ee(t,Df(void 0));return}P.add(t),await Se(h,y,!1,{preventScrollReset:c});return}if(ff(y)){De(t,d,y.error);return}Ee(t,Df(y.data))}}async function Se(r,i,a,{submission:o,fetcherSubmission:c,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(M=!0);let d=i.response.headers.get(`Location`);Z(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=qd(d,p,s,e.history),nd(f,d,p,`allow-explicit`);let m=jl(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(gu(d)){let n=Fl(t,d,!0);e=n.origin!==t.location.origin||mu(n.pathname,s)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=T.navigation;!o&&!c&&g&&_&&v&&(o=Sf(T.navigation));let y=o||c;cd.has(i.response.status)&&y&&Q(y.formMethod)?await me(h,m,{submission:{...y,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?k:void 0}):await me(h,m,{overrideNavigation:Cf(m,[],h,o),fetcherSubmission:c,preventScrollReset:l||ee,enableViewTransition:a?k:void 0})}async function Ce(e,t,n,r,i){let a,o={};try{a=await Bd(d,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Q(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!T.loaderData.hasOwnProperty(e.route.id)&&(!T.errors||!T.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(df(r)){let i=r.result;o[t]={type:`redirect`,response:Wd(i,e,t,n,s)}}else o[t]=await Ud(r);return o}async function we(e,t,n,r,i){let a=Ce(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ce(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:rf(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Te(){M=!0,oe.forEach((e,t)=>{N.has(t)&&ne.add(t),Me(t)})}function Ee(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),z({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function De(e,t,n,r={}){let i=tf(T.matches,t),a=new Map(T.fetchers);Ae(a,e),z({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Oe(e){return se.set(e,(se.get(e)||0)+1),ce.has(e)&&ce.delete(e),T.fetchers.get(e)||ud}function ke(e,t){Me(e,t?.reason),Ee(e,Df(null))}function Ae(e,t){let n=T.fetchers.get(t);N.has(t)&&!(n&&n.state===`loading`&&ae.has(t))&&Me(t),oe.delete(t),ae.delete(t),P.delete(t),ce.delete(t),ne.delete(t),e.delete(t)}function je(e){let t=(se.get(e)||0)-1;t<=0?(se.delete(e),ce.add(e)):se.set(e,t),z({fetchers:new Map(T.fetchers)})}function Me(e,t){let n=N.get(e);n&&(n.abort(t),N.delete(e))}function Ne(e,t){for(let n of e){let e=t.get(n);Z(e,`Expected fetcher: ${n}`);let r=Df(e.data);t.set(n,r)}}function Pe(e){let t=[],n=!1;for(let r of P){let i=e.get(r);Z(i,`Expected fetcher: ${r}`),i.state===`loading`&&(P.delete(r),t.push(r),n=!0)}return Ne(t,e),n}function Fe(e,t){let n=[];for(let[r,i]of ae)if(i<e){let e=t.get(r);Z(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Me(r),ae.delete(r),n.push(r))}return Ne(n,t),n.length>0}function Ie(e,t){let n=T.blockers.get(e)||dd;return F.get(e)!==t&&F.set(e,t),n}function Le(e){T.blockers.delete(e),F.delete(e)}function Re(e,t){let n=T.blockers.get(e)||dd;Z(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),z({blockers:r})}function ze({currentLocation:e,nextLocation:t,historyAction:n}){if(F.size===0)return;F.size>1&&Ol(!1,`A router only supports one blocker at a time`);let r=Array.from(F.entries()),[i,a]=r[r.length-1],o=T.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Be(e){let t=rf(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=nf(n);return{notFoundMatches:r,route:i,error:t}}function Ve(e,t,n){if(h=e,_=t,g=n||null,!v&&T.navigation===ld){v=!0;let e=We(T.location,T.matches);e!=null&&z({restoreScrollPosition:e})}return()=>{h=null,_=null,g=null}}function He(e,t){return g&&g(e,t.map(e=>ql(e,T.loaderData)))||e.key}function Ue(e,t){if(h&&_){let n=He(e,t);h[n]=_()}}function We(e,t){if(h){let n=He(e,t),r=h[n];if(typeof r==`number`)return r}return null}function Ge(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:c.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:c.match(n,!0)}}return{active:!1,matches:null}}async function Ke(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let o=t;for(;;){let t=l;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:o,fetcherKey:i,patch:(e,n)=>{r.aborted||Ed(e,n,u,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:o}}if(r.aborted)return{type:`aborted`};let s=c.match(n),d=null;if(s&&(Object.keys(s[0].params).length===0||(d=c.match(n,!0),!(d&&o.length<d.length&&qe(o,d.slice(0,o.length))))))return{type:`success`,matches:s};if(d||=c.match(n,!0),!d||qe(o,d))return{type:`success`,matches:null};o=d}}function qe(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Je(e){l={},u.setHmrRoutes(Ul(e,a,void 0,l))}function Ye(e,t,n=!1){Ed(e,t,u,l,a,n),u.hasHMRRoutes||z({})}return w={get basename(){return s},get future(){return o},get state(){return T},get routes(){return u.stableRoutes},match(e){return c.match(e)},get manifest(){return l},get window(){return t},initialize:R,subscribe:ue,enableScrollRestoration:Ve,navigate:fe,fetch:ye,revalidate:pe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Oe,resetFetcher:ke,deleteFetcher:je,dispose:le,getBlocker:Ie,deleteBlocker:Le,patchRoutes:Ye,_internalFetchControllers:N,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){z(e)}},e.instrumentations&&(w=zu(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function _d(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function vd(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Su(r||`.`,xu(o),mu(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=yf(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=hu({basename:n,pathname:c.pathname})),Ml(c)}function yd(e,t,n){if(!n||!_d(n))return{path:t};if(n.formMethod&&!vf(n.formMethod))return{path:t,error:rf(405,{method:n.formMethod})};let r=()=>({path:t,error:rf(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=of(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Q(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}Z(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Yd(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Yd(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Xd(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Xd(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Q(c.formMethod))return{path:t,submission:c};let l=Nl(t);return e&&l.search&&yf(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ml(l),submission:c}}function bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?ff(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&ff(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=Mu(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!xd(s))f=!1;else if(u){let{shouldLoad:e}=Sd(s,a.loaderData,a.errors);f=e}else Cd(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Rd(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?wd(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Rd(n,r,e,c,E,i,l,t,Td(i,m),m,v)}),ee=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){ee.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=bf(_,e.path),b=new AbortController,x=Jd(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=zd(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=zd(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};Td(y,a)&&(S=zd(n,r,x,e.path,_,y,l,t,a))}S&&ee.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:ee}}function xd(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Sd(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!xd(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Cd(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function wd(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Td(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Ed(e,t,n,r,i,a){let o;if(e){let t=r[e];Z(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Dd(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Ul(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=Ul([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Dd(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Dd(e,t)))??!1}var Od=new WeakMap,kd=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Z(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Od.get(i);o||(o={},Od.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Rl(e),n=i[e]!==void 0;if(t)Ol(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)Ol(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Ad=new WeakMap;function jd(e,t,n,r,i){let a=n[e.id];if(Z(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Ad.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Z(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Bl(e),o=a[e]!==void 0;i?Ol(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?Ol(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Ad.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=kd({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Md(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Nd(e){return e.matches.some(e=>e.route.middleware)?Pd(e,()=>Md(e)):Md(e)}function Pd(e,t){return Fd(e,t,e=>{if(_f(e))throw e;return e},lf,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[tf(r,a).route.id]:{type:`error`,result:t}}}}}async function Fd(e,t,n,r,i){let{matches:a,...o}=e;return await Id(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Id(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Id(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Ld(e,t,n,r,i){let a=kd({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=jd(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Rd(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Ld(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Td(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Td(a,{...l,defaultShouldRevalidate:e}):Td(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?Vd({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function zd(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Rd(e,t,n,r,Mu(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Ld(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Bd(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Nu(t,n),pattern:Mu(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Pd(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Vd({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Nu(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw rf(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw rf(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Hd(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Ud(e){let{result:t,type:n}=e;if(hf(t)){let e;try{e=await Hd(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Au(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?mf(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:cf(t),statusCode:ju(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ju(t)?t.status:void 0}:mf(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Wd(e,t,n,r,i){let a=e.headers.get(`Location`);if(Z(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!gu(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=vd(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Gd=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Kd(e){try{return Gd.includes(new URL(e).protocol)}catch{return!1}}function qd(e,t,n,r){if(gu(e)){let r=e,i=Cl.test(r)?new URL(wl(r,t.protocol)):new URL(r);if(Kd(i.toString()))throw Error(`Invalid redirect location`);let a=mu(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Cu(i.pathname)+i.search+i.hash}try{if(Kd(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Jd(e,t,n,r){let i=e.createURL(of(t)).toString(),a={signal:n};if(r&&Q(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Yd(r.formData):r.formData}return new Request(i,a)}function Yd(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Xd(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Zd(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&ff(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(Z(!pf(f),`Cannot handle redirect results in processLoaderData`),ff(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=tf(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=pd),c||(c=!0,s=ju(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Qd(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Zd(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(Z(s,`Did not find corresponding fetcher result`),ff(s)){let t=tf(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(pf(s))Z(!1,`Unhandled fetcher revalidation redirect`);else{let e=Df(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function $d(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==pd).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function ef(e){return e?ff(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function tf(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function nf(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function rf(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Au(e||500,o,Error(s),!0)}function af(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(pf(r))return{key:n,result:r}}}function of(e){return Ml({...typeof e==`string`?Nl(e):e,hash:``})}function sf(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function cf(e){return new Au(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function lf(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&uf(t))}function uf(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function df(e){return hf(e.result)&&sd.has(e.result.status)}function ff(e){return e.type===`error`}function pf(e){return(e&&e.type)===`redirect`}function mf(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function hf(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function gf(e){return sd.has(e)}function _f(e){return hf(e)&&gf(e.status)&&e.headers.has(`Location`)}function vf(e){return od.has(e.toUpperCase())}function Q(e){return id.has(e.toUpperCase())}function yf(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function bf(e,t){let n=typeof t==`string`?Nl(t).search:t.search;if(e[e.length-1].route.index&&yf(n||``))return e[e.length-1];let r=bu(e);return r[r.length-1]}function xf(e,t,n){return{url:Nu(e.createURL(t),t),pattern:n?Mu(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Sf(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Cf(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function wf(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Tf(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ef(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Df(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Of(e,t){try{let n=e.sessionStorage.getItem(fd);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function kf(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(fd,JSON.stringify(n))}catch(e){Ol(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Af(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var jf=Y.createContext(null);jf.displayName=`DataRouter`;var Mf=Y.createContext(null);Mf.displayName=`DataRouterState`;var Nf=Y.createContext(null);Nf.displayName=`DataRouterData`;var Pf=Y.createContext(null);Pf.displayName=`DataRouterNavigation`;var Ff=Y.createContext(!1);function If(){return Y.useContext(Ff)}var Lf=Y.createContext({isTransitioning:!1});Lf.displayName=`ViewTransition`;var Rf=Y.createContext(null);Rf.displayName=`Fetchers`;var zf=Y.createContext(null);zf.displayName=`Await`;var Bf=Y.createContext(null);Bf.displayName=`Navigation`;var Vf=Y.createContext(null);Vf.displayName=`Location`;var Hf=Y.createContext({outlet:null,matches:[],isDataRoute:!1});Hf.displayName=`Route`;var Uf=Y.createContext(!1);Uf.displayName=`IsDataRoute`;var Wf=Y.createContext(void 0);Wf.displayName=`RouteId`;var Gf=Y.createContext(null);Gf.displayName=`RouteError`;var Kf=`REACT_ROUTER_ERROR`,qf=`REDIRECT`,Jf=`ROUTE_ERROR_RESPONSE`;function Yf(e){if(e.startsWith(`${Kf}:${qf}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Xf(e){if(e.startsWith(`${Kf}:${Jf}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Au(t.status,t.statusText,t.data)}catch{}}function Zf(e,{relative:t}={}){Z(Qf(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=Y.useContext(Bf),{hash:i,pathname:a,search:o}=sp(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:wu([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Qf(){return Y.useContext(Vf)!=null}function $f(){return Z(Qf(),`useLocation() may be used only in the context of a <Router> component.`),Y.useContext(Vf).location}var ep=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function tp(){return Y.useContext(Uf)?Dp():np()}function np(){Z(Qf(),`useNavigate() may be used only in the context of a <Router> component.`);let e=Y.useContext(jf),{basename:t,navigator:n}=Y.useContext(Bf),{matches:r}=Y.useContext(Hf),{pathname:i}=$f(),a=JSON.stringify(xu(r)),o=Y.useRef(!1);return Y.useLayoutEffect(()=>{o.current=!0}),Y.useCallback((r,s={})=>{if(Ol(o.current,ep),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Su(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:wu([t,c.pathname])),nd(typeof r==`string`?r:Ml(r),n.createHref(c),$u(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var rp=Y.createContext(null);function ip(){return Y.useContext(rp)}function ap(e){let t=Y.useContext(Hf).outlet;return Y.useMemo(()=>t&&Y.createElement(rp.Provider,{value:e},t),[t,e])}function op(){let{matches:e}=Y.useContext(Hf);return e[e.length-1]?.params??{}}function sp(e,{relative:t}={}){let{matches:n}=Y.useContext(Hf),{pathname:r}=$f(),i=JSON.stringify(xu(n));return Y.useMemo(()=>Su(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function cp(e,t,n){Z(Qf(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=Y.useContext(Bf),{matches:i}=Y.useContext(Hf),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=$f(),l;if(t){let e=typeof t==`string`?Nl(t):t;Z(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):Gl(e,{pathname:d});let p=hp(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:wu([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:wu([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?Y.createElement(Vf.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function lp(){let e=wp(),t=ju(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return Y.createElement(Y.Fragment,null,Y.createElement(`h2`,null,`Unexpected Application Error!`),Y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?Y.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var up=Y.createElement(lp,null),dp=class extends Y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=Ff;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Xf(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:Y.createElement(Hf.Provider,{value:this.props.routeContext},Y.createElement(Uf.Provider,{value:this.props.routeContext.isDataRoute},Y.createElement(Wf.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},Y.createElement(Gf.Provider,{value:e,children:this.props.component}))));return this.context?Y.createElement(pp,{error:e},t):t}},fp=new WeakMap;function pp({children:e,error:t}){let{basename:n,navigator:r}=Y.useContext(Bf);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Yf(t.digest);if(e){let i=fp.get(t);if(i)throw i;let a=Fu(e.location,n),o=a.absoluteURL||a.to;if(nd(e.location,o,$u(r),`allow-explicit`),Kd(o))throw Error(`Invalid redirect location`);if(Pu&&!fp.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw fp.set(t,n),n}}return Y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function mp({routeContext:e,match:t,children:n}){let r=Y.useContext(jf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Y.createElement(Hf.Provider,{value:e},Y.createElement(Uf.Provider,{value:e.isDataRoute},Y.createElement(Wf.Provider,{value:t.route.id},n)))}function hp(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Z(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Mu(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||up,o&&(s<0&&c===0?(kp(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?Y.createElement(n.route.Component,null):n.route.element?n.route.element:e,Y.createElement(mp,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?Y.createElement(dp,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function gp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _p(e){let t=Y.useContext(jf);return Z(t,gp(e)),t}function vp(e){let t=Y.useContext(Mf);return Z(t,gp(e)),t}function yp(e){let t=Y.useContext(Nf);return Z(t,gp(e)),t}function bp(e){let t=Y.useContext(Pf);return Z(t,gp(e)),t}function xp(e){let t=Y.useContext(Wf);return Z(t,`${e} can only be used on routes that contain a unique "id"`),t}function Sp(){let{navigation:e}=bp(`useNavigation`);return Y.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function Cp(){let{matches:e}=vp(`useMatches`),{loaderData:t}=yp(`useMatches`);return Y.useMemo(()=>e.map(e=>ql(e,t)),[e,t])}function wp(){let e=Y.useContext(Gf),t=yp(`useRouteError`),n=xp(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Tp=0;function Ep(e){let{router:t,basename:n}=_p(`useBlocker`),r=vp(`useBlocker`),[i,a]=Y.useState(``),o=Y.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:mu(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:mu(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return Y.useEffect(()=>{let e=String(++Tp);return a(e),()=>t.deleteBlocker(e)},[t]),Y.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):dd}function Dp(){let{router:e}=_p(`useNavigate`),t=xp(`useNavigate`),n=Y.useRef(!1);return Y.useLayoutEffect(()=>{n.current=!0}),Y.useCallback(async(r,i={})=>{Ol(n.current,ep),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Op={};function kp(e,t,n){!t&&!Op[e]&&(Op[e]=!0,Ol(!1,n))}var Ap=/:(\d+)(?:-(\d+))?$/,jp=/^(?:[A-Za-z]:\/|\/\/(?!\/)|\/)/;function Mp(e){return Ap.exec(e)?.[0]??``}function Np(e){return Fp(Pp(e))}function Pp(e){return e.replace(Ap,``).replaceAll(`\\`,`/`)}function Fp(e){let t=jp.exec(e)?.[0]??``,n=[];for(let r of e.slice(t.length).split(`/`)){if(r===``||r===`.`)continue;let e=n.at(-1);r===`..`?e!==void 0&&e!==`..`?n.pop():t===``&&n.push(r):n.push(r)}return`${t}${n.join(`/`)}`}function Ip({open:e,weeklyNet:t,weeks:n,until:r}){return e===0?{kind:`no-open`}:n!==null&&r!==null?{kind:`clears`,weeks:n,until:new Date(r)}:t===0?{kind:`not-shrinking`}:{kind:`grows`,perWeek:Ce(-t)}}function Lp(e){return e%7==0?{unit:`week`,count:e/7}:{unit:`day`,count:e}}function Rp(e){return{categoryLabel:t=>t===void 0?e.noCategory:e.category[t],categoryRowLabel:t=>e.categoryRow[t],foundRowLabel:t=>e.found[t],statusLabel:t=>e.status[t],priorityLabel:t=>e.priority[t],typeLabel:t=>e.type[t],resolutionLabel:t=>e.resolution[t],evidenceLabel:t=>e.evidence[t],checkMethodLabel:t=>e.checkMethod[t],duplicateMatchLabel:t=>e.duplicateMatch[t],graphStateLabel:t=>e.graphState[t]}}function zp(e){return t=>[...new Set(t.map(e))].join(`; `)}var Bp={number:0,nan:NaN,string:``,boolean:!1,bigint:0n,symbol:Symbol(),function:()=>void 0,undefined:void 0,null:null,array:[],object:{}};function Vp(e,{issue:t,receivedType:n}){let r=n===void 0?void 0:Hp(n),i=e({...t,input:r});return typeof i==`string`?i:i?.message??t.message}function Hp(e){return e in Bp?Bp[e]:Object.create({constructor:{name:e}})}var Up=$r().localeError,Wp={bloaters:`Bloaters`,"change-preventers":`Change preventers`,couplers:`Couplers`,"data-dealers":`Data dealers`,dispensables:`Dispensables`,"functional-abusers":`Functional abusers`,"lexical-abusers":`Lexical abusers`,"oo-abusers":`OO abusers`,obfuscators:`Obfuscators`,bug:`Bug`},Gp=`not set`,Kp={category:Wp,noCategory:Gp,categoryRow:{...Wp,unset:Gp,unknown:`unknown`},found:{review:`in review`,incidental:`incidentally`,manual:`manually`,unknown:`unknown`,unset:`not recorded`},status:{backlog:`backlog`,"in-progress":`in progress`,blocked:`blocked`,done:`done`,cancelled:`cancelled`},type:{task:`task`,epic:`epic`},priority:{low:`low`,medium:`medium`,high:`high`,critical:`critical`},resolution:{fixed:`fixed`,obsolete:`code gone`,duplicate:`duplicate`,"epic-done":`epic done`},evidence:{"source-changed":`code changed`,"source-missing":`file missing`,duplicate:`duplicate`,"no-source":`no source`,total:`Total`},checkMethod:{symbol:`by symbol`,anchor:`by source lines`,file:`by file`},duplicateMatch:{source:`by code location`,title:`by title`,symbol:`by symbol`},graphState:{none:`none`,unreadable:`unreadable`,stale:`stale`,fresh:`fresh`}},qp={task:[`task`,`tasks`],line:[`line`,`lines`],project:[`project`,`projects`],day:[`day`,`days`],week:[`week`,`weeks`],session:[`session`,`sessions`]};function Jp(e,t){let[n,r]=qp[t];return A(e,n,r)}function Yp(e){return e===null?`—`:e<1?`less than a day`:Jp(Math.round(e),`day`)}function Xp(e){return e===null?`—`:e<1?`within a day`:`within ${Yp(e)}`}function Zp(e){let t=Ip(e);switch(t.kind){case`no-open`:return`No open tasks`;case`clears`:return`Debt clears in about ${P(`en`,t.weeks)} wk. (by ${ie(`en`,t.until)})`;case`not-shrinking`:return`Debt is not shrinking`;case`grows`:return`Debt grows by ${R(`en`,t.perWeek)} ${ge(t.perWeek,...qp.task)} a week`}}function Qp({windowDays:e,closed:t,created:n}){let r=Lp(e);return`over ${Jp(r.count,r.unit)}: closed ${t}, created ${n}`}function $p(e){switch(e.kind){case`debt-growing`:return`Debt has grown for ${Jp(e.params.weeks,`week`)} straight: created ${e.params.created}, closed ${e.params.closed}`;case`urgent-stale`:return`Urgent tasks have been waiting more than ${Jp(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Stuck in progress: ${e.params.count}, longest ${e.params.id} — ${Yp(e.params.days)}`;case`done-unclosed`:return`Checklist done but the task is not closed: ${e.params.count}, longest ${e.params.id} — close it (backlog close) or add what is left`;case`noisy-check`:{let{evidence:t,method:n,percent:r,decided:i,windowDays:a}=e.params;return`Check ${n===null?`"${Kp.evidence[t]}"`:`"${Kp.evidence[t]}" ${Kp.checkMethod[n]}`} is almost always wrong: precision ${r}% on ${i} decided over ${Jp(a,`day`)}`}case`low-changed`:return`Code changed for ${Jp(e.params.count,`task`)} with low priority — re-check when convenient ("clean up the backlog")`;case`stale-low`:return`Tasks with low priority older than ${Jp(e.params.days,`day`)}: ${e.params.count} — clean them up (backlog prune)`}}function em(e){switch(e.kind){case`bad-id`:return`invalid ID`;case`empty-title`:return`empty title`;case`empty-name`:return`empty project name`;case`bad-prefix`:return`invalid prefix`;case`zod`:return Vp(Up,e)}}function tm(e){switch(e.code){case`self-block`:return`a task cannot block itself`;case`self-related`:return`a task cannot be related to itself`;case`referenced-as-epic`:return`other tasks refer to this task as their epic: ${e.children.join(`, `)}`;case`blocker-cycle`:return`blocker cycle: ${e.cycle.join(` → `)}`;case`resolution-needs-status`:return`resolution ${e.resolution} requires status ${e.status}`;case`reason-without-resolution`:return`reason can only be set together with resolution`;case`epic-self`:return`a task cannot be its own epic`;case`epic-missing`:return`epic ${e.epic} not found`;case`epic-not-epic`:return`${e.epic} is not an epic`;case`epic-foreign-project`:return`epic ${e.epic} belongs to another project — clear the epic or pick one from this project`;case`epic-in-epic`:return`an epic cannot belong to another epic`;case`reference-missing`:return`${e.id} not found`;case`no-frontmatter`:return`file does not start with frontmatter (---)`;case`frontmatter-unclosed`:return`frontmatter is not closed with a --- line`;case`yaml`:return`YAML error: ${e.detail}`;case`schema`:return e.path===``?em(e.issue):`${e.path}: ${em(e.issue)}`;case`id-mismatch`:return`id ${e.id} does not match the file name ${e.file}.md`;case`prefix-mismatch`:return`prefix of ${e.file} does not match the project prefix ${e.prefix}`;case`id-exhausted`:return`could not allocate an ID in ${e.attempts} attempts`}}var nm=zp(tm);function rm(e){return`all tasks of the epic are closed: ${e.join(`, `)}`}function im(e){switch(e.kind){case`references-removed`:return`${e.taskId}: removed references to missing tasks: ${e.ids.join(`, `)}`;case`epic-closed`:return`${e.taskId}: epic closed — ${rm(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: epic reopened — it has open tasks: ${e.childIds.join(`, `)}`;case`source-moved`:return Np(e.from)===Np(e.to)?`${e.taskId}: source moved ${Mp(e.from)} → ${Mp(e.to)}`:`${e.taskId}: task file renamed, source ${e.from} → ${e.to}`}}function am(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: could not fix — ${om(e)}`;case`task-invalid`:return`${e.taskId}: ${tm(e.problem)}`;case`file-not-parsed`:return`File ${e.path} could not be parsed: ${nm(e.problems)}`;case`epics-wait-for-files`:return`Epics ${e.epicIds.join(`, `)} are complete but will not close until the unparsed files are fixed`;case`project-without-repos`:return`Project ${e.projectId}: repos has no paths — its tasks' code cannot be checked`;case`project-repos-missing`:return`Project ${e.projectId}: none of the repos paths exist (${e.repos.join(`, `)}) — its tasks' code cannot be checked`;case`project-repo-not-git`:return`Project ${e.projectId}: ${e.repo} is not a git repository — commits and code edits of its tasks are not checked`;case`project-repo-unsafe`:return`Project ${e.projectId}: git does not trust ${e.repo} (the directory belongs to another user) — commits and code edits of its tasks are not checked. Fix: git config --global --add safe.directory "${e.repo}"`;case`project-history-unreadable`:return`Project ${e.projectId}: could not read the git history in ${e.repo} — commits and code edits of its tasks were not checked`;case`prefix-shared`:return`Projects ${e.projectIds.join(`, `)} share the prefix ${e.prefix} — their task IDs collide. Change prefix in project.md of one of them`}}function om(e){switch(e.cause){case`invalid`:return nm(e.problems);case`changed-during-check`:return`the file changed during the check`;case`gone-during-check`:return`the file disappeared during the check`;case`busy-during-check`:return`the file is locked by another process`}}var sm={hookMark:`Backlog`,languageName:`English`,problem:tm,problems:nm,schemaIssue:em,...Rp(Kp),count:Jp,days:Yp,p90:Xp,forecast:Zp,forecastTail:Qp,signal:$p,epicDoneReason:rm,fileBusy:({path:e,lock:t,seconds:n})=>`${e} has been locked by another process for more than ${P(`en`,n)} s (${t})`,checkFix:im,checkProblem:am,runsNotTrimmed:e=>`Could not trim the run log: ${e}`,journalNotCompacted:(e,t)=>`Could not compact the journal in ${e}: ${t}`,closedNotSwept:e=>`Could not delete closed tasks: ${e}`,serviceLogNotTrimmed:e=>`Could not trim the service log: ${e}`,candidatesRecordFailed:(e,t)=>`Could not record candidates to the ${e} journal: ${t}`,branchOriginsReadFailed:(e,t)=>`Could not read the ${e} journal — tasks from unmerged branches are checked as usual: ${t}`,unreadableSkipped:(e,t)=>`Could not read ${e}, skipped: ${t}`,settingsNotSaved:(e,t)=>`Could not save the language to ${e}: ${t}. It is detected again on every run — make the backlog directory writable.`,settingsFileInvalid:e=>`${e} could not be parsed, the language for this run was detected automatically. The file was not changed — fix it manually.`},cm=ni().localeError,lm={bloaters:`Разбухшее`,"change-preventers":`Мешает изменениям`,couplers:`Связанность`,"data-dealers":`Работа с данными`,dispensables:`Лишнее`,"functional-abusers":`Императивность`,"lexical-abusers":`Именование`,"oo-abusers":`ООП`,obfuscators:`Запутанность`,bug:`Ошибка`},um=`не указана`,dm={category:lm,noCategory:um,categoryRow:{...lm,unset:um,unknown:`неизвестна`},found:{review:`на ревью`,incidental:`попутно`,manual:`вручную`,unknown:`неизвестно`,unset:`не записано`},status:{backlog:`в беклоге`,"in-progress":`в работе`,blocked:`заблокирована`,done:`сделана`,cancelled:`отменена`},type:{task:`задача`,epic:`эпик`},priority:{low:`низкий`,medium:`средний`,high:`высокий`,critical:`критичный`},resolution:{fixed:`исправлено`,obsolete:`кода нет`,duplicate:`дубль`,"epic-done":`эпик завершён`},evidence:{"source-changed":`код изменился`,"source-missing":`файл пропал`,duplicate:`дубль`,"no-source":`нет source`,total:`Всего`},checkMethod:{symbol:`по символу`,anchor:`по строкам source`,file:`по файлу`},duplicateMatch:{source:`по месту в коде`,title:`по заголовку`,symbol:`по символу`},graphState:{none:`нет`,unreadable:`не читается`,stale:`устарел`,fresh:`свежий`}},fm={task:[`задача`,`задачи`,`задач`],line:[`строка`,`строки`,`строк`],project:[`проект`,`проекта`,`проектов`],day:[`день`,`дня`,`дней`],week:[`неделя`,`недели`,`недель`],session:[`сессия`,`сессии`,`сессий`]},pm={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},mm={task:[`задачи`,`задач`,`задач`],day:[`дня`,`дней`,`дней`]};function hm(e,t){let[n,r,i]=fm[t];return z(e,n,r,i)}function gm(e,t){return z(e,...pm[t])}function _m(e,t){return z(e,...mm[t])}function vm(e){return e===null?`—`:e<1?`меньше дня`:`${P(`ru`,Math.round(e))} дн.`}function ym(e){return e===null?`—`:e<1?`быстрее суток`:`за ${vm(e)}`}function bm(e){let t=Ip(e);switch(t.kind){case`no-open`:return`Открытых задач нет`;case`clears`:return`Долг разберётся примерно за ${P(`ru`,t.weeks)} нед. (к ${ie(`ru`,t.until)})`;case`not-shrinking`:return`Долг не уменьшается`;case`grows`:return`Долг растёт на ${R(`ru`,t.perWeek)} ${M(t.perWeek,...fm.task)} в неделю`}}function xm({windowDays:e,closed:t,created:n}){let{unit:r,count:i}=Lp(e);return`за ${gm(i,r)}: закрыто ${t}, создано ${n}`}function Sm(e){switch(e.kind){case`debt-growing`:return`Долг растёт ${gm(e.params.weeks,`week`)} подряд: создано ${e.params.created}, закрыто ${e.params.closed}`;case`urgent-stale`:return`Срочные задачи ждут дольше ${_m(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Застряли в работе: ${e.params.count}, дольше всех ${e.params.id} — ${vm(e.params.days)}`;case`done-unclosed`:return`Чеклист выполнен, а задача не закрыта: ${e.params.count}, дольше всех ${e.params.id} — закройте (backlog close) или допишите, что осталось`;case`noisy-check`:{let{evidence:t,method:n,percent:r,decided:i,windowDays:a}=e.params;return`Проверка ${n===null?`«${dm.evidence[t]}»`:`«${dm.evidence[t]}» ${dm.checkMethod[n]}`} почти всегда ошибается: точность ${r}% на ${i} решённых за ${gm(a,`day`)}`}case`low-changed`:return`Код менялся у ${_m(e.params.count,`task`)} с низким приоритетом — перепроверьте при случае («почисти беклог»)`;case`stale-low`:return`Задач с низким приоритетом старше ${_m(e.params.days,`day`)}: ${e.params.count} — разберите (backlog prune)`}}function Cm(e){switch(e.kind){case`bad-id`:return`некорректный ID`;case`empty-title`:return`пустой заголовок`;case`empty-name`:return`пустое имя проекта`;case`bad-prefix`:return`некорректный префикс`;case`zod`:return Vp(cm,e)}}function wm(e){switch(e.code){case`self-block`:return`задача не может блокировать саму себя`;case`self-related`:return`задача не может быть связана сама с собой`;case`referenced-as-epic`:return`на задачу ссылаются как на эпик: ${e.children.join(`, `)}`;case`blocker-cycle`:return`цикл блокеров: ${e.cycle.join(` → `)}`;case`resolution-needs-status`:return`resolution ${e.resolution} требует статус ${e.status}`;case`reason-without-resolution`:return`reason задаётся только вместе с resolution`;case`epic-self`:return`задача не может быть своим эпиком`;case`epic-missing`:return`эпик ${e.epic} не найден`;case`epic-not-epic`:return`${e.epic} не является эпиком`;case`epic-foreign-project`:return`эпик ${e.epic} из другого проекта — снимите эпик или выберите эпик этого проекта`;case`epic-in-epic`:return`эпик не может входить в другой эпик`;case`reference-missing`:return`${e.id} не найдена`;case`no-frontmatter`:return`файл не начинается с frontmatter (---)`;case`frontmatter-unclosed`:return`frontmatter не закрыт строкой ---`;case`yaml`:return`ошибка YAML: ${e.detail}`;case`schema`:return e.path===``?Cm(e.issue):`${e.path}: ${Cm(e.issue)}`;case`id-mismatch`:return`id ${e.id} не совпадает с именем файла ${e.file}.md`;case`prefix-mismatch`:return`префикс ${e.file} не совпадает с префиксом проекта ${e.prefix}`;case`id-exhausted`:return`не удалось выделить ID за ${e.attempts} попыток`}}var Tm=zp(wm);function Em(e){return`все задачи эпика закрыты: ${e.join(`, `)}`}function Dm(e){switch(e.kind){case`references-removed`:return`${e.taskId}: убраны ссылки на несуществующие задачи: ${e.ids.join(`, `)}`;case`epic-closed`:return`${e.taskId}: эпик закрыт — ${Em(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: эпик снова открыт — в нём открытые задачи: ${e.childIds.join(`, `)}`;case`source-moved`:return Np(e.from)===Np(e.to)?`${e.taskId}: source сдвинулся ${Mp(e.from)} → ${Mp(e.to)}`:`${e.taskId}: файл задачи переименован, source ${e.from} → ${e.to}`}}function Om(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: не удалось исправить — ${km(e)}`;case`task-invalid`:return`${e.taskId}: ${wm(e.problem)}`;case`file-not-parsed`:return`Файл ${e.path} не разобран: ${Tm(e.problems)}`;case`epics-wait-for-files`:return`Эпики ${e.epicIds.join(`, `)} завершены, но не закроются, пока не исправлены неразобранные файлы`;case`project-without-repos`:return`Проект ${e.projectId}: в repos нет путей — код его задач не проверить`;case`project-repos-missing`:return`Проект ${e.projectId}: ни один путь из repos не существует (${e.repos.join(`, `)}) — код его задач не проверить`;case`project-repo-not-git`:return`Проект ${e.projectId}: ${e.repo} — не git-репозиторий, коммиты и правки кода его задач не проверяются`;case`project-repo-unsafe`:return`Проект ${e.projectId}: git не доверяет ${e.repo} (каталог принадлежит другому пользователю) — коммиты и правки кода его задач не проверяются. Исправление: git config --global --add safe.directory "${e.repo}"`;case`project-history-unreadable`:return`Проект ${e.projectId}: не удалось прочитать историю git в ${e.repo} — коммиты и правки кода его задач не проверены`;case`prefix-shared`:return`У проектов ${e.projectIds.join(`, `)} один префикс ${e.prefix} — ID их задач пересекаются. Смените prefix в project.md одного из них`}}function km(e){switch(e.cause){case`invalid`:return Tm(e.problems);case`changed-during-check`:return`файл изменился во время проверки`;case`gone-during-check`:return`файл исчез во время проверки`;case`busy-during-check`:return`файл занят другим процессом`}}var Am={hookMark:`Беклог`,languageName:`Русский`,problem:wm,problems:Tm,schemaIssue:Cm,...Rp(dm),count:hm,days:vm,p90:ym,forecast:bm,forecastTail:xm,signal:Sm,epicDoneReason:Em,fileBusy:({path:e,lock:t,seconds:n})=>`${e} занят другим процессом дольше ${P(`ru`,n)} с (${t})`,checkFix:Dm,checkProblem:Om,runsNotTrimmed:e=>`Не удалось обрезать журнал запусков: ${e}`,journalNotCompacted:(e,t)=>`Не удалось уплотнить журнал в ${e}: ${t}`,closedNotSwept:e=>`Не удалось удалить закрытые задачи: ${e}`,serviceLogNotTrimmed:e=>`Не удалось обрезать лог службы: ${e}`,candidatesRecordFailed:(e,t)=>`Не удалось записать кандидатов в журнал ${e}: ${t}`,branchOriginsReadFailed:(e,t)=>`Не удалось прочитать журнал ${e} — задачи из невлитых веток проверяются как обычные: ${t}`,unreadableSkipped:(e,t)=>`Не удалось прочитать ${e}, он пропущен: ${t}`,settingsNotSaved:(e,t)=>`Не удалось сохранить язык в ${e}: ${t}. Он определяется заново при каждом запуске — разрешите запись в каталог беклога.`,settingsFileInvalid:e=>`${e} не разобран, язык для этого запуска определён автоматически. Файл не изменён — поправьте его вручную.`};function jm(e){return e===`ru`?Am:sm}var Mm={skipLink:`Skip to content`,sidebarNav:`Navigation`,brand:`backlog`,sectionsLabel:`Sections`,tasksNav:`Tasks`,statsNav:`Statistics`,signalsHidden:e=>`, alerts: ${e}`,collapseProjects:`Collapse project list`,expandProjects:`Expand project list`,projects:`Projects`,taskWord:e=>ge(e,`task`,`tasks`),checkedSuffix:`\xA0— checked`,languageSwitchLabel:`Interface language`,languageSwitchFailed:`Failed to change the language`,graphNotes:{none:{title:`No code graph`,hint:[{code:`code-review-graph build`},{text:` — check candidates are less precise`}]},stale:{title:`Code graph is stale`,hint:[{code:`code-review-graph watch`},{text:` or the `},{code:`update`},{text:` hook — without them the check can't see symbols`}]},unreadable:{title:`Code graph unreadable`,hint:[{code:`code-review-graph build`},{text:` again — the database is from a different version or path`}]}},checkboxLabel:e=>`Include project ${e} in the “Projects” scope`,setActiveFailed:e=>e?`Failed to include the project`:`Failed to exclude the project`,deleteButtonLabel:e=>`Delete project ${e}`,deleteButtonTitle:`Delete project`,deleteFailed:`Failed to delete the project`,deleteDialogTitle:e=>`Delete project “${e}”?`,deleteDialogDescriptionUnknown:`The project directory will be deleted along with all its tasks; this cannot be undone.`,deleteDialogDescription:e=>`Tasks: ${e}. The project directory will be deleted along with them; this cannot be undone.`,confirmWordLabel:e=>`Type the project id: ${e}`,confirmLabel:`Delete`},Nm={skipLink:`Перейти к содержимому`,sidebarNav:`Навигация`,brand:`беклог`,sectionsLabel:`Разделы`,tasksNav:`Задачи`,statsNav:`Статистика`,signalsHidden:e=>`, тревог: ${e}`,collapseProjects:`Свернуть список проектов`,expandProjects:`Развернуть список проектов`,projects:`Проекты`,taskWord:e=>M(e,`задача`,`задачи`,`задач`),checkedSuffix:`\xA0— с\xA0галочкой`,languageSwitchLabel:`Язык интерфейса`,languageSwitchFailed:`Не удалось изменить язык`,graphNotes:{none:{title:`Без графа кода`,hint:[{code:`code-review-graph build`},{text:` — кандидаты проверки точнее`}]},stale:{title:`Граф кода устарел`,hint:[{code:`code-review-graph watch`},{text:` или хук `},{code:`update`},{text:` — без них проверка не видит символов`}]},unreadable:{title:`Граф кода не читается`,hint:[{code:`code-review-graph build`},{text:` заново — база другой версии или от другого пути`}]}},checkboxLabel:e=>`Учитывать проект ${e} в области «Проекты»`,setActiveFailed:e=>`Не удалось ${e?`учесть`:`исключить`} проект`,deleteButtonLabel:e=>`Удалить проект ${e}`,deleteButtonTitle:`Удалить проект`,deleteFailed:`Не удалось удалить проект`,deleteDialogTitle:e=>`Удалить проект «${e}»?`,deleteDialogDescriptionUnknown:`Каталог проекта удалится со всеми задачами, отменить нельзя.`,deleteDialogDescription:e=>`Задач: ${e}. Каталог проекта удалится вместе с ними, отменить нельзя.`,confirmWordLabel:e=>`Введите id проекта: ${e}`,confirmLabel:`Удалить`},Pm=(e,t)=>`Changed ${e} of ${t}`,Fm={docTitle:e=>`${e} — Backlog`,taskDocTitle:(e,t)=>`${e} · ${t} — Backlog`,projects:`Projects`,autoClosed:`Closed by agent`,autoClosedInProject:e=>`Closed by agent · ${e}`,missingTask:e=>`Task ${e} not found — it may have been deleted after it was closed.`,parseErrorsTitle:`Failed to parse files:`,loadingTasks:`Loading tasks…`,unknownProject:`Project not found.`,hiddenOpenNote:e=>`${e} more open ${ge(e,`task`,`tasks`)} — in projects without the checkbox.`,noTasksInScope:e=>`No tasks in the included projects. ${e}`,noTasksYet:e=>[`No tasks yet. The backlog is filled by the agent: it records tasks with `,e(`backlog new`),` while it works on the code.`],noOpenTasksInScope:e=>`No open tasks in the included projects. ${e}`,noOpenTasks:`No open tasks.`,showAllStatuses:`Show all statuses`,noMatches:`Nothing matches the filters.`,resetFilters:`Reset filters`,taskCount:e=>`${A(e,`task`,`tasks`)} in the list`,status:`Status`,priority:`Priority`,type:`Type`,tags:`Tags`,task:`Task`,created:`Created`,closed:`Closed`,epicAndTags:`Epic and tags`,withoutBlockers:`no blockers`,autoClosedChip:`closed by agent`,searchPlaceholder:`Search by title, description, and ID`,searchLabel:`Search tasks`,tagsSummary:e=>`Tags (${e})`,tagsSummarySelected:(e,t)=>`Tags (${e}), ${t} selected`,findTag:`Find tag`,newBadge:`new`,epicBadge:`epic`,blockedTitle:`Has open blockers`,blockedBadge:`blockers`,epicPrefix:e=>`Epic: ${e}`,epicTitle:(e,t)=>`${e} — ${t}`,resetEpic:`Clear epic`,epics:`Epics`,anyEpic:`Any epic`,noEpic:`No epic`,epicNotFound:`epic not found`,anyEpicLabel:`any`,noEpicLabel:`no epic`,selectTask:e=>`Select ${e}`,selectionKeysHint:e=>`Space on a task selects it, Shift+Space selects a range, ${e} — to the actions on selected`,toActionsHint:e=>`${e} — to the actions`,selectAllVisible:`Select all visible`,selectionActions:`Actions on selected`,selectedCount:e=>`${e} selected`,hiddenByFilter:e=>`(${e} hidden by filter)`,closeAsObsolete:`Close as obsolete`,closeDialogTitle:e=>`Close ${A(e,`task`,`tasks`)} as obsolete?`,closeDialogDescription:e=>`Status becomes “${e}”; the reason is saved to every task.`,closeReason:`Reason`,closeConfirm:e=>`Close ${e}`,epic:`Epic`,removeFromEpic:`Remove from epic`,mixedProjects:`Tasks from different projects`,clearSelection:`Clear selection`,bulkFailed:`Couldn't change the tasks`,batchSummary:{close:(e,t)=>`Closed ${e} of ${t}`,priority:Pm,epic:Pm,restore:(e,t)=>`Restored ${e} of ${t}`},notChanged:e=>`${A(e,`task`,`tasks`)} not changed`,undo:`Undo`,undoFailed:`Couldn't undo`,viewSwitch:`View`,listView:`List`,boardView:`Board`,board:`Task board`,columnCount:e=>A(e,`task`,`tasks`),emptyColumn:`Drag a task here`,closedHidden:`Closed tasks are hidden by the filter — drag here to close`,moved:(e,t)=>`${e}: status "${t}"`,moveFailed:e=>`Could not move ${e}`,dragInstructions:`Space picks up the task, left and right arrows choose a column, Space drops it, Esc cancels.`,dragStarted:e=>`Picked up ${e}`,dragOver:(e,t)=>`${e} is over the "${t}" column`,dragDropped:(e,t)=>`${e} dropped in the "${t}" column`,dragStayed:e=>`${e} stayed where it was`,dragCancelled:e=>`Moving ${e} was cancelled`,collapseTags:`collapse`,showMoreTags:e=>`Show ${e} more`},Im=(e,t)=>`${M(e,`Изменена`,`Изменено`,`Изменено`)} ${e} из ${t}`,Lm={docTitle:e=>`${e} — Беклог`,taskDocTitle:(e,t)=>`${e} · ${t} — Беклог`,projects:`Проекты`,autoClosed:`Закрыты агентом`,autoClosedInProject:e=>`Закрыты агентом · ${e}`,missingTask:e=>`Задачи ${e} нет — возможно, её удалили после закрытия.`,parseErrorsTitle:`Не удалось разобрать файлы:`,loadingTasks:`Загружаем задачи…`,unknownProject:`Проект не найден.`,hiddenOpenNote:e=>`Ещё ${z(e,`открытая задача`,`открытые задачи`,`открытых задач`)} — в проектах без галочки.`,noTasksInScope:e=>`В учтённых проектах задач нет. ${e}`,noTasksYet:e=>[`Задач пока нет. Беклог наполняет агент: он записывает задачи командой `,e(`backlog new`),`, пока работает над кодом.`],noOpenTasksInScope:e=>`В учтённых проектах открытых задач нет. ${e}`,noOpenTasks:`Открытых задач нет.`,showAllStatuses:`Показать все статусы`,noMatches:`Под фильтры ничего не подходит.`,resetFilters:`Сбросить фильтры`,taskCount:e=>`В списке ${z(e,`задача`,`задачи`,`задач`)}`,status:`Статус`,priority:`Приоритет`,type:`Тип`,tags:`Теги`,task:`Задача`,created:`Создана`,closed:`Закрыта`,epicAndTags:`Эпик и теги`,withoutBlockers:`без блокеров`,autoClosedChip:`закрыты агентом`,searchPlaceholder:`Поиск по названию, описанию и ID`,searchLabel:`Поиск задач`,tagsSummary:e=>`Теги (${e})`,tagsSummarySelected:(e,t)=>`Теги (${e}), выбрано ${t}`,findTag:`Найти тег`,newBadge:`новая`,epicBadge:`эпик`,blockedTitle:`Есть открытые блокеры`,blockedBadge:`блокеры`,epicPrefix:e=>`Эпик: ${e}`,epicTitle:(e,t)=>`${e} — ${t}`,resetEpic:`Сбросить эпик`,epics:`Эпики`,anyEpic:`Любой эпик`,noEpic:`Без эпика`,epicNotFound:`эпик не найден`,anyEpicLabel:`любой`,noEpicLabel:`без эпика`,selectTask:e=>`Выбрать ${e}`,selectAllVisible:`Выбрать все видимые`,selectionKeysHint:e=>`Пробел на задаче — выбрать её, Shift+Пробел — выбрать диапазон, ${e} — к действиям с выбранными`,toActionsHint:e=>`${e} — к действиям`,selectionActions:`Действия с выбранными`,selectedCount:e=>`Выбрано ${e}`,hiddenByFilter:e=>`(${e} ${M(e,`скрыта`,`скрыты`,`скрыто`)} фильтром)`,closeAsObsolete:`Закрыть как неактуальные`,closeDialogTitle:e=>`Закрыть ${z(e,`задачу`,`задачи`,`задач`)} как неактуальные?`,closeDialogDescription:e=>`Статус станет «${e}», причина запишется в каждую задачу.`,closeReason:`Причина`,closeConfirm:e=>`Закрыть ${e}`,epic:`Эпик`,removeFromEpic:`Вынуть из эпика`,mixedProjects:`Задачи из разных проектов`,clearSelection:`Снять выбор`,bulkFailed:`Не удалось изменить задачи`,batchSummary:{close:(e,t)=>`${M(e,`Закрыта`,`Закрыто`,`Закрыто`)} ${e} из ${t}`,priority:Im,epic:Im,restore:(e,t)=>`${M(e,`Возвращена`,`Возвращено`,`Возвращено`)} ${e} из ${t}`},notChanged:e=>`${M(e,`Не изменена`,`Не изменены`,`Не изменено`)} ${e} ${M(e,`задача`,`задачи`,`задач`)}`,undo:`Отменить`,undoFailed:`Не удалось отменить`,viewSwitch:`Вид`,listView:`Список`,boardView:`Доска`,board:`Доска задач`,columnCount:e=>z(e,`задача`,`задачи`,`задач`),emptyColumn:`Перетащите сюда задачу`,closedHidden:`Закрытые скрыты фильтром — перетащите сюда, чтобы закрыть`,moved:(e,t)=>`${e}: статус «${t}»`,moveFailed:e=>`Не удалось перенести ${e}`,dragInstructions:`Пробел — взять задачу, стрелки влево и вправо — выбрать колонку, пробел — положить, Esc — отменить.`,dragStarted:e=>`Задача ${e} взята`,dragOver:(e,t)=>`${e} над колонкой «${t}»`,dragDropped:(e,t)=>`${e} положена в колонку «${t}»`,dragStayed:e=>`${e} осталась на месте`,dragCancelled:e=>`Перенос ${e} отменён`,collapseTags:`свернуть`,showMoreTags:e=>`Показать ещё ${e}`},Rm=e=>A(e,`day`,`days`),zm={day:`day`,week:`week`,sample:`sample`},Bm={week:[`week`,`weeks`],day:[`day`,`days`]},Vm={week:`a week`,day:`a day`},Hm={week:`in the latest week with decisions`,day:`on the last day with decisions`},Um=(e,t)=>A(t,...Bm[e]),Wm=e=>A(e,`task`,`tasks`),Gm=e=>A(e,`token`,`tokens`);function Km({formatted:e,count:t}){return`${e} ${ge(t,`line`,`lines`)}`}function qm(e){let t=Rm(e.churnDays),n=A(e.statsWeeks,`week`,`weeks`),r=A(e.memoryHistoryHours,`hour`,`hours`),i=`${n} (since adoption, if later)`,a=`the estimate appears after ${e.minFixesForEstimate} fixes`;return{docTitle:e=>`${e} — Backlog`,heading:e=>`Statistics · ${e}`,alerts:`Alerts`,tabsLabel:`Statistics sections`,tabs:{overview:`Overview`,code:`Code`,quality:`Quality`,effect:`Effect`,cost:`Cost`},invalidJournalLines:e=>`Could not parse journal lines: ${e}. They are left out of the statistics — check the line format in the project's journal.jsonl.`,unknownJournalLines:e=>`Journal lines with an unknown value: ${e}. A renamed value (category, how found, resolution) is shown as "unknown", but is counted in the breakdowns.`,unparsedTasks:e=>`Could not parse task files: ${e}. The statistics use their last status from the journal; fix the files — backlog check shows the errors.`,noTasks:`No tasks yet.`,projectNotFound:`Project not found.`,loading:`Calculating statistics…`,journalEmpty:`The journal is still empty; everything is built from the dates in the task files.`,journalSince:e=>`The journal has been kept since ${e}; before that, dates come from the task files. Tasks deleted before then are not in the statistics.`,unavailableRepo:e=>`No access to the repository: ${e}. Check the path in repos of project.md and that it is a git repository.`,tableLabel:e=>`Table "${e}"`,noCodeData:`No code data: the projects have no accessible repositories`,folders:`Folders`,projects:`Projects`,periodWindows:{weeks:n,days:Rm(e.statsDays),lastWeek:Rm(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`now`,chartLabel:(e,t)=>`${e}. Left and right arrows move by ${zm[t]}`,periodOf:(e,t)=>e===`week`?`week of ${t}`:t,weekTrend:(e,t)=>`${e} ${t} vs last week`,weekTrendSpeech:{decline:e=>`${e} less than a week ago — better`,growth:e=>`${e} more than a week ago — worse`},tasksToday:`Tasks today`,createdAndClosed:`created and closed`,thisWeek:`This week`,weekNote:(e,t)=>`created ${e}, closed ${t}`,debtBy:{week:`Debt by week`,day:`Debt by day`},flowCreated:`created`,flowClosed:`closed`,flowOpen:`open`,flowOpenAtEnd:{week:`open at week end`,day:`open at day end`},flowSummary:({grain:e,periodCount:t,created:n,closed:r,openNow:i})=>`${Um(e,t)}: created ${n}, closed ${r}, open now ${i}`,createdBy:{week:`Created by week`,day:`Created by day`},createdTasks:`tasks created`,intakeSummary:({grain:e,periodCount:t,created:n,perPeriod:r})=>{let i=Um(e,t);return r===null?`${i}: no tasks created`:`${i}: created ${n}, on average ${R(`en`,r)} ${Vm[e]}`},hotspots:`Where it hurts`,noSourceFolders:`Open tasks have no source`,tags:`Tags`,noTags:`Open tasks have no tags`,openAge:`Age of open tasks`,ageBuckets:{week:`up to 7 days`,month:`7–30 days`,quarter:`30–90 days`,older:`over 90 days`},priorityCounts:{critical:`critical`,high:`high`,medium:`medium`,low:`low`},urgentStale:t=>`Critical and high older than ${e.staleUrgentDays} days: ${t}`,closing:`How tasks close`,closingReasons:{done:`done`,cancelled:`cancelled`,unknown:`resolution not recognized`},noiseAndReopens:`Noise and reopens`,duplicatesAmongClosed:`Duplicates among closed`,noSourceAmongCreated:`No source among created`,reopened:`Reopened`,codeNote:`Changes are commits over ${t}; lines are at the latest commit.`,churnTitle:`Debt in frequently changed code`,churnHint:`Rank is commits over ${t} × weight of the folder's open tasks`,churnEmpty:`No debt lies in code changed over ${t}`,commits:e=>A(e,`commit`,`commits`),churnTasks:(e,t)=>`${Wm(e)}, weight ${t}`,densityTitle:`Debt density`,perKloc:e=>`${R(`en`,e)} per 1000 lines`,accuracyTitle:`Check precision`,noCandidates:`The check has not found any candidates yet`,accuracyHint:`Share of check candidates after which the task was closed; the rest were confirmed as still relevant`,accuracyTable:e=>`Check precision, ${e}`,accuracyHead:[`Evidence`,`Candidates`,`Closed`,`Confirmed`,`Undecided`,`Precision`],splitRow:e=>`└ of them ${e}`,beforeMethodRecorded:`before the method was recorded`,checkedBy:e=>`checked ${e}`,beforeMatchRecorded:`before the match was recorded`,matchedBy:e=>`matched ${e}`,decidedCandidates:`candidates decided`,precision:`precision`,accuracySummary:({grain:e,periodCount:t,decided:n,latestPrecision:r})=>r===null?`${Um(e,t)}: no decided candidates`:`${Um(e,t)}: decided ${n}, precision ${Hm[e]} ${r}`,graphTitle:`Code graph`,graphMissing:e=>[`No code graph: the check compares source lines and the whole file. `,e(`code-review-graph build`),` in the project repository enables the check by symbol`],graphHint:`The graph drops the "code changed" candidate when an edit touched another symbol of the same file, so the agent does not have to re-read the task`,filteredTitle:`Filtered out over ${n}`,nothingFiltered:`The graph has not filtered out any candidates`,filteredTable:`What happened to the filtered-out candidates`,filteredHead:[`Outcome`,`Candidates`],filteredByGraph:`Filtered out by the graph`,filteredCaught:`└ later became a candidate anyway`,filteredMissed:`└ closed without a check signal — a possible miss`,filteredQuiet:`└ no consequences`,graphByProject:`Code graph by project`,graphHead:[`Project`,`Graph`,`Tasks with source lines`,`Symbol found`],categoriesTitle:`Categories`,categoriesEmpty:`No tasks over ${n}`,categoriesHead:[`Category`,`Open`,`Weight`,`Created`,`Closed`],originTitle:`Origin`,foundTitle:`How found`,foundHead:[`How found`,`Created`,`Open`,`Fixed`],branchesTitle:`Branches`,branchesEmpty:`Branches appear for tasks recorded with backlog new inside a repository`,branchesHead:[`Branch`,`Created`,`Open`],linesText:Km,codeAndTests:({code:e,tests:t})=>`code ${e}, tests ${t}`,keptOut:`Unrelated edits deferred`,keptOutPending:t=>`fixed ${t}; the pending estimate appears after ${e.minFixesForEstimate} fixes`,keptOutEstimated:(e,t)=>`fixed ${e} + pending ${t}`,noiseWithoutBacklog:`Noise without backlog`,noiseNote:`share of unrelated edits in pull requests`,deferredToBacklog:`Deferred to backlog`,deferredNote:(e,t)=>`fixed ${e}, pending ${t}`,pullRequestLines:`Lines in pull requests`,effectWindow:`over ${i}`,chartScale:e=>`Scale of the "${e}" chart`,chartNames:{flow:`Debt`,intake:`Created`,accuracy:`Check precision`,effect:`Effect`,spend:`Usage`},grainNames:{week:`week`,day:`day`},effectTitle:`Effectiveness`,byProject:`By project`,projectsHead:[`Project`,`Tasks deferred`,`Lines fixed`,`Pending estimate`,`Lines in pull requests`,`Noise without backlog`],onTopicSeries:`on topic in pull requests`,deferredSeries:`deferred to backlog`,codeLines:`code`,testLines:`tests`,deferredTasks:`tasks deferred`,effectSummary:(e,t,n)=>`Over ${i}: ${A(e,`line`,`lines`)} in pull requests, deferred ${t}, noise without backlog ${n}`,effectDaysSummary:(e,t,n)=>`Over ${Um(`day`,e)}: ${A(t,`line`,`lines`)} on topic in pull requests, deferred ${n}`,noDeferredTasks:`No tasks moved out by the agent in passing yet, so there is no gain to measure. The agent records problems outside the current work that it notices itself (backlog new --found incidental); review and audit findings and tasks recorded at the user's request don't count here.`,explainerTitle:`How the gain is calculated`,explainerTask:`Every task the agent moved out of its work in passing is an edit it would have made in the current pull request without the backlog. The gain is the lines that did not get there. Review and audit findings and tasks recorded at the user's request are not counted — they are shown on the Quality tab under Origin.`,explainerFixed:`Fixed ones are exact: lines of the commit from the close reason, without lock files, docs and images; a commit for several tasks is split evenly. Tasks closed without a fix and fixed ones without a found commit are not counted.`,explainerPending:`Pending ones are estimated: the median of fixes in the same category (if there are at least ${e.minFixesForEstimate}), otherwise of all fixes.`,explainerTests:`Code and tests: test files are ${e.testFileGlobs.join(`, `)} and the ${e.testDirectories.join(`, `)} folders. For pending ones, the share of tests in the same fixes.`,explainerNoise:`Noise without backlog = deferred ÷ (lines in pull requests + pending estimate); fixes are already inside pull requests and are not counted twice. The window starts when the backlog was adopted in the project, no earlier than ${n} ago.`,now:`Now:`,fixedNow:(e,t)=>`${Wm(e)} — ${Km(t)}`,noPending:`nothing pending`,pendingWithoutEstimate:e=>`${Wm(e)}, ${a}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${Wm(e)} ${Km(t)}, on average ${n} per task`,estimateLater:a,noCommitsSinceAdoption:`no commits since adoption`,noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Counting usage from Claude Code transcripts…`,noTranscripts:`No Claude Code transcripts found.`,scanProgress:(e,t)=>`Counting usage from Claude Code transcripts: read ${e} of ${A(t,`file`,`files`)}`,costNote:`Tokens come from Claude Code transcripts: turns started by the backlog Stop hook are exact; output of backlog commands and the skill is estimated by text length. Money is at Claude API prices, a subscription may cost differently. Costs of other agents (Codex, Cursor) are not counted.`,backlogTokens:`Tokens due to the backlog`,backlogTokensNote:(e,t)=>`hook turns ${e}, CLI output and skill ${t}`,apiPrice:`At API prices`,unpricedNote:`excluding models with unknown prices`,hookTurns:`Turns due to the hook`,hookRunsNote:e=>`hook runs ${e}`,cliCalls:`CLI calls`,costSince:e=>`Usage data since ${e}`,byModel:`By model`,noModels:`No models yet`,modelsHead:[`Model`,`Tokens`,`At API prices`],fastModel:e=>`${e} (fast mode)`,commandsTitle:`Commands`,noCommands:`No commands yet`,commandsHead:[`Command`,`Runs`,`Average time`,`Average memory`,`Peak memory`],mebibytes:e=>`${R(`en`,e)} MiB`,milliseconds:e=>`${O(`en`,e)} ms`,spendBy:{week:`Usage by week`,day:`Usage by day`},hookTurnTokens:`hook turn tokens`,cliOutputTokens:`CLI output and skill tokens`,hookRuns:`hook runs`,otherCommands:`other commands`,hookTurnsTooltip:`hook turns`,cliOutput:`CLI output and skill`,apiPriceTooltip:`at API prices`,tokens:Gm,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,approxMoney:i,hookRuns:a,cliRuns:o})=>`Over ${Um(e,t)}: due to the hook ${Gm(n)}, CLI output and skill ${r}, ${i}; hook runs ${a}, other commands ${o}`,serverMemory:`Server memory`,memoryRestartNote:`The history starts over after the server restarts`,memorySummary:(e,t)=>`Now ${e}, peak over ${r} ${t}`,processMemory:`process memory`,jsHeap:`JavaScript heap`}}var Jm=e=>z(e,`день`,`дня`,`дней`),Ym={day:`дням`,week:`неделям`,sample:`замерам`},Xm={week:[`неделя`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},Zm={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},Qm={week:`в неделю`,day:`в день`},$m={week:`на последней неделе с решениями`,day:`в последний день с решениями`},eh=(e,t)=>z(t,...Xm[e]),th=e=>z(e,`задача`,`задачи`,`задач`),nh=e=>z(e,`токен`,`токена`,`токенов`);function rh({formatted:e,count:t}){return`${e} ${M(t,`строка`,`строки`,`строк`)}`}function ih(e){let t=Jm(e.churnDays),n=z(e.statsWeeks,`неделю`,`недели`,`недель`),r=z(e.statsWeeks,`недели`,`недель`,`недель`),i=z(e.memoryHistoryHours,`час`,`часа`,`часов`),a=`${n} (с внедрения, если оно позже)`,o=`оценка появится после ${e.minFixesForEstimate} исправлений`;return{docTitle:e=>`${e} — Беклог`,heading:e=>`Статистика · ${e}`,alerts:`Тревоги`,tabsLabel:`Разделы статистики`,tabs:{overview:`Обзор`,code:`Код`,quality:`Качество`,effect:`Эффект`,cost:`Стоимость`},invalidJournalLines:e=>`Не удалось разобрать строк журнала: ${e}. Они не входят в статистику — проверьте формат строк в journal.jsonl проекта.`,unknownJournalLines:e=>`Строк журнала с неизвестным значением: ${e}. Переименованное значение (категория, «как найдена», резолюция) показано как «неизвестно», но учтено в разбивках.`,unparsedTasks:e=>`Не удалось разобрать файлов задач: ${e}. Для них в статистике — последний статус из журнала; исправьте файлы, команда backlog check покажет ошибки.`,noTasks:`Задач пока нет.`,projectNotFound:`Проект не найден.`,loading:`Считаем статистику…`,journalEmpty:`Журнал ещё пуст; всё построено по датам в файлах задач.`,journalSince:e=>`Журнал ведётся с ${e}; раньше — по датам в файлах задач. Удалённые до этого задачи в статистику не попали.`,unavailableRepo:e=>`Нет доступа к репозиторию: ${e}. Проверьте путь в repos файла project.md и что это git-репозиторий.`,tableLabel:e=>`Таблица «${e}»`,noCodeData:`Нет данных о коде: у проектов нет доступных репозиториев`,folders:`Папки`,projects:`Проекты`,periodWindows:{weeks:z(e.statsWeeks,`неделя`,`недели`,`недель`),days:Jm(e.statsDays),lastWeek:Jm(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`сейчас`,chartLabel:(e,t)=>`${e}. Стрелки влево и вправо — по ${Ym[t]}`,periodOf:(e,t)=>e===`week`?`неделя с ${t}`:t,weekTrend:(e,t)=>`${e} ${t} за неделю`,weekTrendSpeech:{decline:e=>`на ${e} меньше, чем неделю назад — лучше`,growth:e=>`на ${e} больше, чем неделю назад — хуже`},tasksToday:`Задачи сегодня`,createdAndClosed:`создано и закрыто`,thisWeek:`За неделю`,weekNote:(e,t)=>`создано ${e}, закрыто ${t}`,debtBy:{week:`Долг по неделям`,day:`Долг по дням`},flowCreated:`создано`,flowClosed:`закрыто`,flowOpen:`открыто`,flowOpenAtEnd:{week:`открыто на конец недели`,day:`открыто на конец дня`},flowSummary:({grain:e,periodCount:t,created:n,closed:r,openNow:i})=>`${eh(e,t)}: создано ${n}, закрыто ${r}, открыто сейчас ${i}`,createdBy:{week:`Создано по неделям`,day:`Создано по дням`},createdTasks:`создано задач`,intakeSummary:({grain:e,periodCount:t,created:n,perPeriod:r})=>{let i=eh(e,t);return r===null?`${i}: задач не создавали`:`${i}: создано ${n}, в среднем ${R(`ru`,r)} ${Qm[e]}`},hotspots:`Где болит`,noSourceFolders:`У открытых задач нет source`,tags:`Теги`,noTags:`У открытых задач нет тегов`,openAge:`Возраст открытых`,ageBuckets:{week:`до 7 дней`,month:`7–30 дней`,quarter:`30–90 дней`,older:`больше 90 дней`},priorityCounts:{critical:`критичных`,high:`высоких`,medium:`средних`,low:`низких`},urgentStale:t=>`Критичные и высокие старше ${e.staleUrgentDays} дней: ${t}`,closing:`Как закрываются`,closingReasons:{done:`сделано`,cancelled:`отменено`,unknown:`резолюция не распознана`},noiseAndReopens:`Шум и возвраты`,duplicatesAmongClosed:`Дубли среди закрытых`,noSourceAmongCreated:`Без source среди созданных`,reopened:`Возвраты`,codeNote:`Изменения — коммиты за ${t}; строки — на последнем коммите.`,churnTitle:`Долг в часто меняемом коде`,churnHint:`Место в списке — коммиты за ${t} × вес открытых задач папки`,churnEmpty:`Долг не лежит в коде, который меняли за ${t}`,commits:e=>z(e,`коммит`,`коммита`,`коммитов`),churnTasks:(e,t)=>`${th(e)}, вес ${t}`,densityTitle:`Плотность долга`,perKloc:e=>`${R(`ru`,e)} на 1000 строк`,accuracyTitle:`Точность проверки`,noCandidates:`Проверка ещё не находила кандидатов`,accuracyHint:`Доля кандидатов проверки, после которых задача закрылась; остальные подтверждены как актуальные`,accuracyTable:e=>`Точность проверки, ${e}`,accuracyHead:[`Улика`,`Кандидатов`,`Закрыто`,`Подтверждено`,`Без решения`,`Точность`],splitRow:e=>`└ из них ${e}`,beforeMethodRecorded:`до записи способа`,checkedBy:e=>`проверено ${e}`,beforeMatchRecorded:`до записи признака`,matchedBy:e=>`совпали ${e}`,decidedCandidates:`решено кандидатов`,precision:`точность`,accuracySummary:({grain:e,periodCount:t,decided:n,latestPrecision:r})=>r===null?`${eh(e,t)}: решённых кандидатов нет`:`${eh(e,t)}: решено ${n}, точность ${$m[e]} ${r}`,graphTitle:`Граф кода`,graphMissing:e=>[`Графа кода нет: проверка сравнивает строки source и файл целиком. `,e(`code-review-graph build`),` в репозитории проекта включит проверку по символу`],graphHint:`Граф убирает кандидата «код изменился», если правка задела другой символ того же файла, — агенту не нужно перечитывать задачу`,filteredTitle:`Отсеяно за ${n}`,nothingFiltered:`Граф не отсеял ни одного кандидата`,filteredTable:`Что стало с отсеянными кандидатами`,filteredHead:[`Исход`,`Кандидатов`],filteredByGraph:`Отсеяно графом`,filteredCaught:`└ позже всё же стал кандидатом`,filteredMissed:`└ закрыта без сигнала проверки — возможный промах`,filteredQuiet:`└ без последствий`,graphByProject:`Граф кода по проектам`,graphHead:[`Проект`,`Граф`,`Задач со строками source`,`Символ найден`],categoriesTitle:`Категории`,categoriesEmpty:`За ${n} задач не было`,categoriesHead:[`Категория`,`Открыто`,`Вес`,`Создано`,`Закрыто`],originTitle:`Происхождение`,foundTitle:`Как найдены`,foundHead:[`Как найдена`,`Создано`,`Открыто`,`Исправлено`],branchesTitle:`Ветки`,branchesEmpty:`Ветки появятся у задач, заведённых через backlog new в репозитории`,branchesHead:[`Ветка`,`Создано`,`Открыто`],linesText:rh,codeAndTests:({code:e,tests:t})=>`код ${e}, тесты ${t}`,keptOut:`Посторонних правок вынесено`,keptOutPending:t=>`исправлено ${t}; оценка ожидающих появится после ${e.minFixesForEstimate} исправлений`,keptOutEstimated:(e,t)=>`исправлено ${e} + ожидают ${t}`,noiseWithoutBacklog:`Шум без беклога`,noiseNote:`доля посторонних правок в пулреквестах`,deferredToBacklog:`Вынесено в беклог`,deferredNote:(e,t)=>`исправлено ${e}, ожидают ${t}`,pullRequestLines:`Строк в пулреквестах`,effectWindow:`за ${a}`,chartScale:e=>`Масштаб графика «${e}»`,chartNames:{flow:`Долг`,intake:`Создано`,accuracy:`Точность проверки`,effect:`Эффект`,spend:`Расход`},grainNames:{week:`неделя`,day:`день`},effectTitle:`Эффективность`,byProject:`По проектам`,projectsHead:[`Проект`,`Вынесено задач`,`Исправлено строк`,`Оценка ожидающих`,`Строк в пулреквестах`,`Шум без беклога`],onTopicSeries:`по теме пулреквестов`,deferredSeries:`вынесено в беклог`,codeLines:`код`,testLines:`тесты`,deferredTasks:`задач вынесено`,effectSummary:(e,t,n)=>`За ${a}: в пулреквестах ${z(e,`строка`,`строки`,`строк`)}, вынесено ${t}, шум без беклога ${n}`,effectDaysSummary:(e,t,n)=>`За ${eh(`day`,e)}: по теме пулреквестов ${z(t,`строка`,`строки`,`строк`)}, вынесено ${n}`,noDeferredTasks:`Задач, вынесенных агентом попутно, пока нет — выигрыш считать не из чего. Агент выносит в беклог проблемы вне текущей работы, которые замечает сам (backlog new --found incidental); находки ревью и аудитов и задачи, заведённые по просьбе пользователя, сюда не входят.`,explainerTitle:`Как считается выигрыш`,explainerTask:`Каждая задача, которую агент попутно вынес из работы, — правка, которую без беклога он сделал бы в текущем пулреквесте. Выигрыш — строки, которые туда не попали. Не считаются находки ревью и аудитов и задачи, заведённые по просьбе пользователя, — они видны во вкладке «Качество», в «Происхождении».`,explainerFixed:`Исправленные — точно: строки коммита из причины закрытия, без lock-файлов, документации и картинок; коммит на несколько задач делится поровну. Не считаются задачи, закрытые без исправления, и исправленные без найденного коммита.`,explainerPending:`Ожидающие — оценка: медиана исправлений той же категории (если их не меньше ${e.minFixesForEstimate}), иначе всех исправлений.`,explainerTests:`Код и тесты: тестовые файлы — ${e.testFileGlobs.join(`, `)} и каталоги ${e.testDirectories.join(`, `)}. Для ожидающих — доля тестов в тех же исправлениях.`,explainerNoise:`Шум без беклога = вынесено ÷ (строк в пулреквестах + оценка ожидающих); исправления уже внутри пулреквестов и не удваиваются. Окно — с внедрения беклога в проекте, не раньше ${r} назад.`,now:`Сейчас:`,fixedNow:(e,t)=>`${th(e)} — ${rh(t)}`,noPending:`ожидающих нет`,pendingWithoutEstimate:e=>`${th(e)}, ${o}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${th(e)} ${rh(t)}, в среднем ${n} на задачу`,estimateLater:o,noCommitsSinceAdoption:`нет коммитов после внедрения`,noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Считаем расход по расшифровкам Claude Code…`,noTranscripts:`Расшифровки Claude Code не найдены.`,scanProgress:(e,t)=>`Считаем расход по расшифровкам Claude Code: прочитано ${e} из ${z(t,`файла`,`файлов`,`файлов`)}`,costNote:`Токены из расшифровок Claude Code: ходы, запущенные Stop-хуком беклога, — точно; вывод команд backlog и скилла — оценка по длине текста. Деньги — по ценам Claude API, подписка может стоить иначе. Расходы других агентов (Codex, Cursor) не учитываются.`,backlogTokens:`Токены из-за беклога`,backlogTokensNote:(e,t)=>`ходы хука ${e}, вывод CLI и скилл ${t}`,apiPrice:`По ценам API`,unpricedNote:`без моделей с неизвестной ценой`,hookTurns:`Ходов из-за хука`,hookRunsNote:e=>`запусков хука ${e}`,cliCalls:`Вызовов CLI`,costSince:e=>`Данные о расходе есть с ${e}`,byModel:`По моделям`,noModels:`Моделей пока нет`,modelsHead:[`Модель`,`Токены`,`По ценам API`],fastModel:e=>`${e} (быстрый режим)`,commandsTitle:`Команды`,noCommands:`Команд пока не было`,commandsHead:[`Команда`,`Запусков`,`Среднее время`,`Средняя память`,`Пиковая память`],mebibytes:e=>`${R(`ru`,e)} МиБ`,milliseconds:e=>`${O(`ru`,e)} мс`,spendBy:{week:`Расход по неделям`,day:`Расход по дням`},hookTurnTokens:`токены ходов хука`,cliOutputTokens:`токены вывода CLI и скилла`,hookRuns:`запуски хука`,otherCommands:`другие команды`,hookTurnsTooltip:`ходы хука`,cliOutput:`вывод CLI и скилл`,apiPriceTooltip:`по ценам API`,tokens:nh,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,approxMoney:i,hookRuns:a,cliRuns:o})=>`За ${z(t,...Zm[e])}: из-за хука ${nh(n)}, вывод CLI и скилл ${r}, ${i}; запусков хука ${a}, других команд ${o}`,serverMemory:`Память сервера`,memoryRestartNote:`После перезапуска сервера история начинается заново`,memorySummary:(e,t)=>`Сейчас ${e}, максимум за ${i} ${t}`,processMemory:`память процесса`,jsHeap:`куча JavaScript`}}var ah=5e3,oh=S,sh=[`test`,`tests`,`__tests__`,`e2e`,`spec`],ch=[{glob:`*.test.*`,pattern:/\.test\./},{glob:`*.spec.*`,pattern:/\.spec\./},{glob:`*_test.*`,pattern:/_test\./},{glob:`test_*.py`,pattern:/^test_.+\.py$/}].map(({glob:e})=>e),lh=/^\s*[-*+]\s+\[(?<mark>[ xX])\]\s+(?<text>.*)$/,uh=/^\s{0,3}(?<fence>`{3,}|~{3,})/;function dh(e){let t=[],n=null;for(let[r,i]of e.split(`
|
|
56
56
|
`).entries()){let e=uh.exec(i)?.groups?.fence;if(e!==void 0){n===null?n=e:e.startsWith(n)&&(n=null);continue}if(n!==null)continue;let a=lh.exec(i)?.groups;a&&t.push({line:r,checked:a.mark!==` `,text:a.text??``})}return t}function fh(e,t){let n=dh(e).find(e=>e.line===t);if(!n)return e;let r=e.split(`
|
|
57
57
|
`);return r[t]=(r[t]??``).replace(/\[[ xX]\]/,n.checked?`[ ]`:`[x]`),r.join(`
|
|
58
58
|
`)}var ph=[`done`,`cancelled`];function mh(e){return ph.some(t=>t===e)}function hh(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let a of e){t.set(a.id,a);for(let e of a.blockedBy)wh(n,e,a);for(let e of a.related)wh(r,e,a);a.epic!==void 0&&wh(i,a.epic,a)}return{byId:t,dependentsOf:n,relatedFrom:r,childrenOf:i}}function gh(e,t){return Ch(e.blockedBy,t).filter(e=>!mh(e.status))}function _h(e,t){return gh(e,t).length>0}function vh(e,t){return[...new Set([...e.blockedBy,...e.related])].filter(e=>!t.byId.has(e))}function yh(e,t){return t.dependentsOf.get(e.id)??[]}function bh(e,t){let n=[...Ch(e.related,t),...t.relatedFrom.get(e.id)??[]];return[...new Map(n.filter(t=>t.id!==e.id).map(e=>[e.id,e])).values()]}function xh(e,t){return t.childrenOf.get(e.id)??[]}function Sh(e,t){if(e.status===`done`)return 100;if(e.type===`epic`){let n=xh(e,t).filter(e=>e.status!==`cancelled`);return n.length===0?null:Th(n.filter(e=>e.status===`done`).length,n.length)}let n=dh(e.body);return n.length===0?null:Th(n.filter(e=>e.checked).length,n.length)}function Ch(e,t){return e.flatMap(e=>t.byId.get(e)??[])}function wh(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function Th(e,t){return Math.round(e/t*100)}var Eh=/^[A-Z][A-Z0-9]{0,9}-[1-9]\d*$/,Dh=/^[A-Z][A-Z0-9]{0,9}$/;function Oh(e){if(!Eh.test(e))return null;let t=e.lastIndexOf(`-`);return{prefix:e.slice(0,t),number:Number(e.slice(t+1))}}function kh(e,t){return`${e}-${t}`}function Ah(e,t){let n=Oh(e),r=Oh(t);return!n||!r?e.localeCompare(t):n.prefix===r.prefix?n.number-r.number:n.prefix.localeCompare(r.prefix)}function jh(e){return{error:()=>e}}var Mh=[`task`,`epic`],Nh=[`backlog`,`in-progress`,`blocked`,`done`,`cancelled`],Ph=[`low`,`medium`,`high`,`critical`],Fh=[`bloaters`,`change-preventers`,`couplers`,`data-dealers`,`dispensables`,`functional-abusers`,`lexical-abusers`,`oo-abusers`,`obfuscators`,`bug`],Ih=[`fixed`,`obsolete`,`duplicate`,`epic-done`],Lh=`,`;function Rh(e){return e.trim().toLowerCase()}function zh(e){return[...new Set(e.flatMap(e=>e.split(Lh)).map(Rh).filter(Boolean))]}var Bh=G().regex(Eh,jh(`bad-id`)),Vh=fs(Bh).default([]).transform(e=>[...new Set(e)]),Hh=q({id:Bh,title:G().trim().min(1,jh(`empty-title`)),type:J(Mh).default(`task`),status:J(Nh).default(`backlog`),priority:J(Ph).default(`medium`),category:J(Fh).optional(),tags:fs(G()).default([]).transform(zh),epic:Bh.optional(),blockedBy:Vh,related:Vh,created:Zs({offset:!0}),source:G().optional(),anchor:G().optional(),closed:Zs({offset:!0}).optional(),resolution:J(Ih).optional(),reason:G().optional(),verified:Zs({offset:!0}).optional()});q({name:G().trim().min(1,jh(`empty-name`)),prefix:G().regex(Dh,jh(`bad-prefix`)),repos:fs(G()).default([]),issuedUpTo:ns().int().nonnegative().optional(),active:os().default(!0)});var Uh=[`cli`,`web`,`check`,`sweep`],Wh=`unknown`;function $(e){return J([...e,Wh]).catch(Wh)}var Gh=[`review`,`incidental`,`manual`],Kh=[`source-changed`,`source-missing`,`duplicate`,`no-source`],qh=[`full`,`changed`],Jh=[`symbol`,`anchor`,`file`];[...Jh];var Yh=[`source`,`title`,`symbol`];[...Yh];var Xh=q({bySymbol:os().optional(),byAnchor:os().optional()}),Zh={at:Zs({offset:!0}),task:G().min(1),via:$(Uh),undo:Ts(!0).optional().catch(void 0)},Qh=Hh.extend({priority:$(Ph),category:$(Fh).optional(),resolution:$(Ih).optional()});vs(`kind`,[q({...Zh,kind:Ts(`created`),type:J(Mh),priority:$(Ph),tags:fs(G()),source:G().optional(),epic:G().optional(),category:$(Fh).optional(),found:$(Gh).optional(),origin:q({branch:G().optional(),commit:G().min(1)}).optional()}),q({...Zh,kind:Ts(`status`),from:J(Nh),to:J(Nh),resolution:$(Ih).optional()}),q({...Zh,kind:Ts(`priority`),from:$(Ph),to:$(Ph)}),q({...Zh,kind:Ts(`deleted`),snapshot:Qh}),q({...Zh,kind:Ts(`category`),from:$(Fh).optional(),to:$(Fh).optional()}),q({...Zh,kind:Ts(`verified`),source:G().optional()}),q({...Zh,kind:Ts(`candidate`),evidence:J(Kh),mode:$(qh),method:$(Jh).optional(),...Xh.shape,match:$(Yh).optional()}),q({...Zh,kind:Ts(`candidate-gone`),evidence:J(Kh)}),q({...Zh,kind:Ts(`candidate-filtered`),symbol:G()})]),Object.keys(Qh.shape),q({input:ns(),cacheWrite5m:ns(),cacheWrite1h:ns(),cacheRead:ns(),output:ns()});var $h={statsWeeks:12,statsDays:30,costTotalsDays:7,churnDays:90,memoryHistoryHours:oh/S,staleUrgentDays:7,minFixesForEstimate:5,testFileGlobs:ch,testDirectories:sh},eg=ih($h),tg=qm($h),ng={ru:{app:me,layout:Nm,list:Lm,task:{cardLabel:e=>`Задача ${e}`,title:`Название задачи`,description:`Описание задачи`,leaveWithDraft:`Уйти без сохранения описания?`,leaveWithFieldEdits:`Уйти, не сохранив правку поля?`,createdLabel:`создана`,closedLabel:`Закрыта`,closedWithoutDate:`Закрыта, дата не записана`,reasonNotRecorded:`причина не записана`,restoreToBacklog:`Вернуть в беклог`,saving:`Сохраняем…`,saved:`Сохранено`,draftConflict:`Описание изменилось на диске, пока вы его правили. «Сохранить» перезапишет его вашим текстом, «Отмена» покажет актуальное.`,taskConflict:`Задача изменилась на диске, показана актуальная версия. Повторите правку.`,taskGone:e=>`Задачи ${e} больше нет в беклоге: её удалили или перенесли.`,fieldConflict:e=>`Поле «${e}» изменилось на диске, пока вы его правили. В поле остался ваш вариант: выйдите из поля ещё раз, чтобы записать его поверх.`,statusField:`Статус`,priorityField:`Приоритет`,categoryField:`Категория`,typeField:`Тип`,epicField:`Эпик`,epicPlaceholder:`ID эпика`,tagsField:`Теги через запятую`,save:`Сохранить`,editDescription:`Редактировать описание`,blockedByLabel:`Блокируется`,relatedLabel:`Связанные`,dependentsLabel:`Блокирует`,referrersLabel:`Ссылаются как на связанную`,epicChildrenLabel:`Задачи эпика`,refNotFound:`не найдена`,removeRef:e=>`Убрать ${e}`,addRefPlaceholder:`ID задачи`,addRefLabel:e=>`Добавить в «${e}»`,addRef:`Добавить`,invalidRefId:e=>`Введите ID задачи, например ${e}`,duplicateRef:e=>`${e} уже в списке`},stats:eg,ui:{cancel:`Отмена`,close:`Закрыть`,progress:`Прогресс`,retry:`Повторить`,retrying:`Повторяем…`,deletionDelayed:`удаление задержано`,deletionDelayedTitle:e=>`должна была удалиться ${e}; проход удаления держит задачу, пока её эпик не закрыт или беклог не исправлен`,deletesToday:`удалится сегодня`,deletesInDays:e=>`удалится через ${e} дн.`,deletesOn:e=>`удалится ${e}`}},en:{app:ce,layout:Mm,list:Fm,task:{cardLabel:e=>`Task ${e}`,title:`Task title`,description:`Task description`,leaveWithDraft:`Leave without saving the description?`,leaveWithFieldEdits:`Leave without saving your field edit?`,createdLabel:`created`,closedLabel:`Closed`,closedWithoutDate:`Closed, date not recorded`,reasonNotRecorded:`reason not recorded`,restoreToBacklog:`Restore to backlog`,saving:`Saving…`,saved:`Saved`,draftConflict:`The description changed on disk while you were editing it. "Save" overwrites it with your text, "Cancel" shows the current one.`,taskConflict:`The task changed on disk, the current version is shown. Repeat your edit.`,taskGone:e=>`Task ${e} is no longer in the backlog: it was deleted or moved.`,fieldConflict:e=>`"${e}" changed on disk while you were editing it. Your version is still in the field: leave the field once more to write it over.`,statusField:`Status`,priorityField:`Priority`,categoryField:`Category`,typeField:`Type`,epicField:`Epic`,epicPlaceholder:`Epic ID`,tagsField:`Comma-separated tags`,save:`Save`,editDescription:`Edit description`,blockedByLabel:`Blocked by`,relatedLabel:`Related`,dependentsLabel:`Blocks`,referrersLabel:`Referenced as related`,epicChildrenLabel:`Epic tasks`,refNotFound:`not found`,removeRef:e=>`Remove ${e}`,addRefPlaceholder:`Task ID`,addRefLabel:e=>`Add to "${e}"`,addRef:`Add`,invalidRefId:e=>`Enter a task ID, for example ${e}`,duplicateRef:e=>`${e} is already in the list`},stats:tg,ui:{cancel:`Cancel`,close:`Close`,progress:`Progress`,retry:`Retry`,retrying:`Retrying…`,deletionDelayed:`deletion delayed`,deletionDelayedTitle:e=>`was due to be deleted ${e}; the deletion pass holds the task until its epic is closed or the backlog is fixed`,deletesToday:`deletes today`,deletesInDays:e=>`deletes in ${e} d.`,deletesOn:e=>`deletes ${e}`}}},rg=(0,Y.createContext)(null),ig=(0,Y.createContext)(null),ag={ru:{...ng.ru,core:jm(`ru`)},en:{...ng.en,core:jm(`en`)}};function og({language:e,children:t}){return(0,Y.useEffect)(()=>{document.documentElement.lang=e},[e]),(0,nc.jsx)(rg.Provider,{value:e,children:(0,nc.jsx)(ig.Provider,{value:ag[e],children:t})})}function sg(){let e=(0,Y.useContext)(rg);if(e===null)throw Error(`MessagesProvider is not mounted`);return e}function cg(){let e=(0,Y.useContext)(ig);if(e===null)throw Error(`MessagesProvider is not mounted`);return e}var lg={overview:`/stats`,code:`/stats/code`,effect:`/stats/effect`,quality:`/stats/quality`,signals:`/stats/signals`,cost:`/stats/cost`},ug=`/stats/memory`,dg=class extends Error{status;errors;current;constructor(e,t,n){super(t.length>0?t.join(`; `):`backlog api error, status ${e}`),this.status=e,this.errors=t,this.current=n,this.name=`ApiError`}},fg=0,pg=404,mg=409,hg=500,gg=new Set([502,504]),_g=503;function vg(e){if(e instanceof dg)return e.status===fg?`unreachable`:e.status===pg?`notFound`:e.status===mg?`conflict`:e.status>=hg?`serverFailure`:`rejected`}function yg(e){let t=async(t,n)=>{let r=await e(t,n).catch(()=>{throw bg()});if(gg.has(r.status))throw bg();let i=await r.json().catch(()=>{throw bg()});if(r.ok)return i;let{errors:a=[],current:o}=i;throw r.status===_g&&a.length===0?bg():new dg(r.status,a,o)};return{projects:()=>t(`/api/projects`),setProjectActive:(e,n)=>t(xg(e),Sg(`PATCH`,{active:n})),deleteProject:async(e,n)=>{await t(xg(e),Sg(`DELETE`,{confirm:n}))},tasks:()=>t(`/api/tasks`),updateTask:(e,n,r)=>t(`/api/tasks/${encodeURIComponent(e)}`,Sg(`PATCH`,{version:n,changes:r})),batchTasks:e=>t(`/api/tasks/batch`,Sg(`POST`,e)),statsReport:(e,n)=>t(Cg(`/api${lg[e]}`,n)),memorySamples:()=>t(`/api${ug}`),settings:()=>t(`/api/settings`),setLanguage:e=>t(`/api/settings`,Sg(`PATCH`,{language:e}))}}function bg(){return new dg(fg,[])}function xg(e){return`/api/projects/${encodeURIComponent(e)}`}function Sg(e,t){return{method:e,body:JSON.stringify(t),headers:{"content-type":`application/json`}}}function Cg(e,t){return t===void 0?e:`${e}?project=${encodeURIComponent(t)}`}var wg={fixed:`done`,obsolete:`cancelled`,duplicate:`cancelled`,"epic-done":`done`};function Tg(e){return e.split(`
|