p-backlog 0.14.4 → 0.14.6

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.
Files changed (25) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +3 -2
  3. package/README.ru.md +3 -2
  4. package/dist/cli.js +288 -217
  5. package/dist/web/assets/{CodeTab-rgZ3oazM.js → CodeTab-_hswvGhR.js} +1 -1
  6. package/dist/web/assets/{CostTab-DR8zJt7h.js → CostTab-B45am3iT.js} +1 -1
  7. package/dist/web/assets/{EffectTab-DHdQSIlQ.js → EffectTab-BWrxZuDh.js} +1 -1
  8. package/dist/web/assets/{Figure-C2iLoqkF.js → Figure-C7mZic1d.js} +1 -1
  9. package/dist/web/assets/{OverviewTab-uNqeJSFu.js → OverviewTab-DPfu4cwL.js} +1 -1
  10. package/dist/web/assets/{Page-lpBrfWDj.js → Page-BY5pJG0W.js} +5 -5
  11. package/dist/web/assets/{QualityTab-hbgPdBwD.js → QualityTab-CeAPraBM.js} +1 -1
  12. package/dist/web/assets/{ShareBar-BXak6vBR.js → ShareBar-Do4ChaCM.js} +1 -1
  13. package/dist/web/assets/{StatsPage-CO1e1tAe.js → StatsPage-BVEaoI_Q.js} +1 -1
  14. package/dist/web/assets/{StatsTabState-ChT0Ee4K.js → StatsTabState-BnBfyJUZ.js} +1 -1
  15. package/dist/web/assets/{StatsTable-C0PeMtyw.js → StatsTable-DvgWwXbV.js} +1 -1
  16. package/dist/web/assets/{UnavailableRepos-CykRKvjj.js → UnavailableRepos-CSItGhrg.js} +1 -1
  17. package/dist/web/assets/{index-BuEw4eHx.js → index-C3BHVlUw.js} +2 -2
  18. package/dist/web/assets/start-D7vHv3Nm.js +257 -0
  19. package/dist/web/assets/{start-BvKCcZHI.css → start-Dt9zi6Yh.css} +1 -1
  20. package/dist/web/assets/{use-grain-panel-BrOKdaLI.js → use-grain-panel-BU4IiIEr.js} +7 -7
  21. package/dist/web/assets/web-paths-CUpod7kw.js +1 -0
  22. package/dist/web/index.html +1 -1
  23. package/package.json +1 -1
  24. package/dist/web/assets/start-CmS4D9jZ.js +0 -257
  25. package/dist/web/assets/web-paths-B6f4e9Br.js +0 -1
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,B as n,Ct as r,D as i,Dt as a,Et as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,N as m,O as h,Ot as g,P as _,Q as v,R as y,St as b,T as x,Tt as S,U as C,V as w,W as T,X as E,Y as D,Z as O,_ as k,_t as A,a as j,at as M,bt as N,c as P,ct as ee,d as F,dt as te,et as ne,f as re,ft as I,g as ie,gt as ae,ht as oe,i as se,it as ce,j as L,k as R,lt as le,m as ue,mt as z,nt as de,o as B,ot as fe,pt as pe,q as V,r as me,rt as he,s as ge,st as H,tt as _e,ut as ve,vt as ye,w as be,wt as xe,x as Se,xt as Ce,y as we,yt as Te,z as Ee}from"./index-BuEw4eHx.js";var De=Object.create,Oe=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,Ae=Object.getOwnPropertyNames,je=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty,Ne=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),Pe=(e,t)=>{let n={};for(var r in e)Oe(n,r,{get:e[r],enumerable:!0});return t||Oe(n,Symbol.toStringTag,{value:`Module`}),n},Fe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Ae(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Me.call(e,s)&&s!==n&&Oe(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ke(t,s))||r.enumerable});return e},Ie=(e,t,n)=>(n=e==null?{}:De(je(e)),Fe(t||!e||!e.__esModule||!Me.call(e,`default`)?Oe(n,`default`,{value:e,enumerable:!0}):n,e));function Le(){let e=this._zod;return e.message??=JSON.stringify(e.def,le,2),e.message}function Re(e){this._zod.message=e}var ze={get:Le,set:Re,enumerable:!0,configurable:!0},Be={value:void 0,enumerable:!1},Ve=new WeakSet([Object.prototype,Error.prototype]),He=L(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Be.value=t,Object.defineProperty(e,"issues",Be),Be.value=void 0,Object.defineProperty(e,"message",ze);let n=Object.getPrototypeOf(e);Ve.has(n)||(Ve.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})}}))});function Ue(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 We(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ue(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ge(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 Ke(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qe=t=>{let n=(r,i,a,o)=>{let s=a?{...a,async:!1}:{async:!1},c=r._zod.run({value:i,issues:[]},s);if(c instanceof Promise)throw new R;if(c.issues.length){let r=new((o?.Err)??t)(c.issues.map(t=>e(t,s,m())));throw l(r,o?.callee??n),r}return c.value};return n},Je=t=>{let n=async(r,i,a,o)=>{let s=a?{...a,async:!0}:{async:!0},c=r._zod.run({value:i,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let r=new((o?.Err)??t)(c.issues.map(t=>e(t,s,m())));throw l(r,o?.callee??n),r}return c.value};return n},Ye=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 R;return a.issues.length?Xe(e,a.issues,i):{success:!0,data:a.value}};function Xe(t,n,r){let i;return{success:!1,get error(){return i||(i=new t(n.map(t=>e(t,r,m()))),n=void 0,r=void 0),i},set error(e){i=e,n=void 0,r=void 0}}}var Ze=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?Xe(e,a.issues,i):{success:!0,data:a.value}},Qe=Symbol.for(`zod.compile.invalid`),$e=Symbol.for(`zod.compile.fallback`),et=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Qe)return!0;if(r.definite===!0&&n===void 0)return!1}return tt(e,t,n)});function tt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[$e]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new R;return a.issues.length===0}var nt=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},rt=e=>{let t=qe(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ke(n,a))};return n},it=e=>{let t=qe(e),n=(e,r,i,a)=>t(e,r,i,Ke(n,a));return n},at=e=>{let t=Je(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ke(n,a))};return n},ot=e=>{let t=Je(e),n=async(e,r,i,a)=>await t(e,r,i,Ke(n,a));return n},st=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ye(e)(t,n,i)},ct=e=>(t,n,r)=>Ye(e)(t,n,r),lt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ze(e)(t,n,i)},ut=e=>async(t,n,r)=>Ze(e)(t,n,r),dt=/^[cC][0-9a-z]{6,}$/,ft=/^[0-9a-z]+$/,pt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,mt=/^[0-9a-vA-V]{20}$/,ht=/^[A-Za-z0-9]{27}$/,gt=/^[a-zA-Z0-9_-]{21}$/;function _t(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var vt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yt=/^([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})$/,bt=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)$/,xt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,St=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Ct(){return new RegExp(St,`u`)}var wt=/^(?:(?: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])$/,Tt=/^(([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}|:))$/,Et=/^((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])$/,Dt=/^(([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])$/,Ot=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,At=/^https?$/,jt=/^\+[1-9]\d{6,14}$/,Mt=`(?:(?:\\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 Nt(e){return RegExp(`^${e}$`)}var Pt=Nt(Mt);function Ft(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 It(e){return RegExp(`^${Ft(e)}$`)}function Lt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ft({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ft({precision:e.precision})}`:n;return RegExp(`^${Mt}T(?:${r})$`)}var Rt=/^[\s\S]{0,}$/,zt=/^-?\d+$/,Bt=/^-?\d+(?:\.\d+)?$/,Vt=/^(?:true|false)$/i,Ht=/^[^A-Z]*$/,Ut=/^[^a-z]*$/,Wt=L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Gt=e=>{let t=e.value;return!pe(t)&&t.length!==void 0},Kt={number:`number`,bigint:`bigint`,object:`date`},qt=L(`$ZodCheckLessThan`,(e,t)=>{Wt.init(e,t);let n=Kt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Kt[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})}}),Jt=L(`$ZodCheckGreaterThan`,(e,t)=>{Wt.init(e,t);let n=Kt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Kt[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})}}),Yt=L(`$ZodCheckMultipleOf`,(e,t)=>{Wt.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):ne(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})}}),Xt=L(`$ZodCheckNumberFormat`,(e,t)=>{Wt.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=u[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})}}),Zt=L(`$ZodCheckMaxLength`,(e,t)=>{var n;Wt.init(e,t),(n=e._zod.def).when??(n.when=Gt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?c(r):i)<=t.maximum)return;let a=de(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qt=L(`$ZodCheckMinLength`,(e,t)=>{var n;Wt.init(e,t),(n=e._zod.def).when??(n.when=Gt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?c(r):i)>=t.minimum)return;let a=de(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$t=L(`$ZodCheckLengthEquals`,(e,t)=>{var n;Wt.init(e,t),(n=e._zod.def).when??(n.when=Gt),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?c(r):i;if(a===t.length)return;let o=de(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),en=L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Wt.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=()=>{})}),tn=L(`$ZodCheckRegex`,(e,t)=>{en.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})}}),nn=L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ht,en.init(e,t)}),rn=L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ut,en.init(e,t)}),an=L(`$ZodCheckIncludes`,(e,t)=>{Wt.init(e,t);let n=E(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})}}),on=L(`$ZodCheckStartsWith`,(e,t)=>{Wt.init(e,t);let n=RegExp(`^${E(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})}}),sn=L(`$ZodCheckEndsWith`,(e,t)=>{Wt.init(e,t);let n=RegExp(`.*${E(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})}}),cn=L(`$ZodCheckOverwrite`,(e,t)=>{Wt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ln=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{$ as e,A as t,B as n,Ct as r,D as i,Dt as a,Et as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,N as m,O as h,Ot as g,P as _,Q as v,R as y,St as b,T as x,Tt as S,U as C,V as w,W as T,X as E,Y as D,Z as O,_ as k,_t as A,a as j,at as M,bt as N,c as P,ct as ee,d as F,dt as te,et as ne,f as re,ft as I,g as ie,gt as ae,ht as oe,i as se,it as ce,j as L,k as R,lt as le,m as ue,mt as z,nt as de,o as B,ot as fe,pt as pe,q as V,r as me,rt as he,s as ge,st as H,tt as _e,ut as ve,vt as ye,w as be,wt as xe,x as Se,xt as Ce,y as we,yt as Te,z as Ee}from"./index-C3BHVlUw.js";var De=Object.create,Oe=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,Ae=Object.getOwnPropertyNames,je=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty,Ne=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),Pe=(e,t)=>{let n={};for(var r in e)Oe(n,r,{get:e[r],enumerable:!0});return t||Oe(n,Symbol.toStringTag,{value:`Module`}),n},Fe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Ae(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Me.call(e,s)&&s!==n&&Oe(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ke(t,s))||r.enumerable});return e},Ie=(e,t,n)=>(n=e==null?{}:De(je(e)),Fe(t||!e||!e.__esModule||!Me.call(e,`default`)?Oe(n,`default`,{value:e,enumerable:!0}):n,e));function Le(){let e=this._zod;return e.message??=JSON.stringify(e.def,le,2),e.message}function Re(e){this._zod.message=e}var ze={get:Le,set:Re,enumerable:!0,configurable:!0},Be={value:void 0,enumerable:!1},Ve=new WeakSet([Object.prototype,Error.prototype]),He=L(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Be.value=t,Object.defineProperty(e,"issues",Be),Be.value=void 0,Object.defineProperty(e,"message",ze);let n=Object.getPrototypeOf(e);Ve.has(n)||(Ve.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})}}))});function Ue(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 We(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ue(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ge(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 Ke(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qe=t=>{let n=(r,i,a,o)=>{let s=a?{...a,async:!1}:{async:!1},c=r._zod.run({value:i,issues:[]},s);if(c instanceof Promise)throw new R;if(c.issues.length){let r=new((o?.Err)??t)(c.issues.map(t=>e(t,s,m())));throw l(r,o?.callee??n),r}return c.value};return n},Je=t=>{let n=async(r,i,a,o)=>{let s=a?{...a,async:!0}:{async:!0},c=r._zod.run({value:i,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let r=new((o?.Err)??t)(c.issues.map(t=>e(t,s,m())));throw l(r,o?.callee??n),r}return c.value};return n},Ye=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 R;return a.issues.length?Xe(e,a.issues,i):{success:!0,data:a.value}};function Xe(t,n,r){let i;return{success:!1,get error(){return i||(i=new t(n.map(t=>e(t,r,m()))),n=void 0,r=void 0),i},set error(e){i=e,n=void 0,r=void 0}}}var Ze=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?Xe(e,a.issues,i):{success:!0,data:a.value}},Qe=Symbol.for(`zod.compile.invalid`),$e=Symbol.for(`zod.compile.fallback`),et=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Qe)return!0;if(r.definite===!0&&n===void 0)return!1}return tt(e,t,n)});function tt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[$e]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new R;return a.issues.length===0}var nt=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},rt=e=>{let t=qe(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ke(n,a))};return n},it=e=>{let t=qe(e),n=(e,r,i,a)=>t(e,r,i,Ke(n,a));return n},at=e=>{let t=Je(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ke(n,a))};return n},ot=e=>{let t=Je(e),n=async(e,r,i,a)=>await t(e,r,i,Ke(n,a));return n},st=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ye(e)(t,n,i)},ct=e=>(t,n,r)=>Ye(e)(t,n,r),lt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ze(e)(t,n,i)},ut=e=>async(t,n,r)=>Ze(e)(t,n,r),dt=/^[cC][0-9a-z]{6,}$/,ft=/^[0-9a-z]+$/,pt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,mt=/^[0-9a-vA-V]{20}$/,ht=/^[A-Za-z0-9]{27}$/,gt=/^[a-zA-Z0-9_-]{21}$/;function _t(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var vt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yt=/^([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})$/,bt=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)$/,xt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,St=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Ct(){return new RegExp(St,`u`)}var wt=/^(?:(?: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])$/,Tt=/^(([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}|:))$/,Et=/^((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])$/,Dt=/^(([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])$/,Ot=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,At=/^https?$/,jt=/^\+[1-9]\d{6,14}$/,Mt=`(?:(?:\\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 Nt(e){return RegExp(`^${e}$`)}var Pt=Nt(Mt);function Ft(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 It(e){return RegExp(`^${Ft(e)}$`)}function Lt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ft({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ft({precision:e.precision})}`:n;return RegExp(`^${Mt}T(?:${r})$`)}var Rt=/^[\s\S]{0,}$/,zt=/^-?\d+$/,Bt=/^-?\d+(?:\.\d+)?$/,Vt=/^(?:true|false)$/i,Ht=/^[^A-Z]*$/,Ut=/^[^a-z]*$/,Wt=L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Gt=e=>{let t=e.value;return!pe(t)&&t.length!==void 0},Kt={number:`number`,bigint:`bigint`,object:`date`},qt=L(`$ZodCheckLessThan`,(e,t)=>{Wt.init(e,t);let n=Kt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Kt[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})}}),Jt=L(`$ZodCheckGreaterThan`,(e,t)=>{Wt.init(e,t);let n=Kt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Kt[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})}}),Yt=L(`$ZodCheckMultipleOf`,(e,t)=>{Wt.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):ne(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})}}),Xt=L(`$ZodCheckNumberFormat`,(e,t)=>{Wt.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=u[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})}}),Zt=L(`$ZodCheckMaxLength`,(e,t)=>{var n;Wt.init(e,t),(n=e._zod.def).when??(n.when=Gt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?c(r):i)<=t.maximum)return;let a=de(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qt=L(`$ZodCheckMinLength`,(e,t)=>{var n;Wt.init(e,t),(n=e._zod.def).when??(n.when=Gt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?c(r):i)>=t.minimum)return;let a=de(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$t=L(`$ZodCheckLengthEquals`,(e,t)=>{var n;Wt.init(e,t),(n=e._zod.def).when??(n.when=Gt),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?c(r):i;if(a===t.length)return;let o=de(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),en=L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Wt.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=()=>{})}),tn=L(`$ZodCheckRegex`,(e,t)=>{en.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})}}),nn=L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ht,en.init(e,t)}),rn=L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ut,en.init(e,t)}),an=L(`$ZodCheckIncludes`,(e,t)=>{Wt.init(e,t);let n=E(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})}}),on=L(`$ZodCheckStartsWith`,(e,t)=>{Wt.init(e,t);let n=RegExp(`^${E(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})}}),sn=L(`$ZodCheckEndsWith`,(e,t)=>{Wt.init(e,t);let n=RegExp(`.*${E(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})}}),cn=L(`$ZodCheckOverwrite`,(e,t)=>{Wt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ln=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))}},un={major:4,minor:6,patch:7},U=L(`$ZodType`,(e,t)=>{var r;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=un;let i=e._zod.def.checks,a=e._zod.traits.has(`$ZodCheck`)?[e,...i??[]]:i?.length?[...i]:[];for(let t of a)for(let n of t._zod.onattach)n(e);if(a.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,i)=>{if(t.memo)return t;let a=p(t),o;for(let s of r){if(s._zod.def.when){if(O(t)||!s._zod.def.when(t))continue}else if(a)continue;let r=t.issues.length,c=s._zod.check(t);if(c instanceof Promise&&i?.async===!1)throw new R;if(o||c instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await c,t.issues.length!==r&&(n(t.issues,r,e),a||=p(t,r))});else{if(t.issues.length===r)continue;n(t.issues,r,e),a||=p(t,r)}}return o?o.then(()=>t):t},r=(n,r,i)=>{if(p(n))return n.aborted=!0,n;let o=t(r,a,i);if(o instanceof Promise){if(i.async===!1)throw new R;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(n,i)=>{if(i.skipChecks)return e._zod.parse(n,i);if(i.direction===`backward`){let t=e._zod.parse({value:n.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,i)):r(t,n,i)}let o=e._zod.parse(n,i);if(o instanceof Promise){if(i.async===!1)throw new R;return o.then(e=>t(e,a,i))}return t(o,a,i)}}},{get"~standard"(){return he(this,`~standard`,pn(this))},set"~standard"(e){ae(this,`~standard`,e)}}),dn=(t,n)=>t.issues.length?{issues:t.issues.map(t=>e(t,n,m()))}:{value:t.value};async function fn(e,t){let n={async:!0};return dn(await e._zod.run({value:t,issues:[]},n),n)}function pn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return dn(r,n)}catch{}return fn(e,t)},vendor:`zod`,version:1}}var mn=L(`$ZodString`,(e,t)=>{U.init(e,t),e._zod.pattern=t.pattern??Rt,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}}),W=L(`$ZodStringFormat`,(e,t)=>{en.init(e,t),mn.init(e,t)}),hn=L(`$ZodGUID`,(e,t)=>{t.pattern??=yt,W.init(e,t)}),gn=L(`$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??=bt(e)}else t.pattern??=bt();W.init(e,t)}),_n=L(`$ZodEmail`,(e,t)=>{t.pattern??=xt,W.init(e,t)});function vn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function yn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?vn(e)||2:bn(e,t)}function bn(e,t){if(!t.normalize&&t.protocol?.source===At.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 xn=/[\t\n\r]/g;function Sn(e){return e.replace(xn,``)}function Cn(e,t){return t.lastIndex=0,t.test(e.hostname)}function wn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Tn=L(`$ZodURL`,(e,t)=>{W.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=yn(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=Sn(r);return}t.hostname&&!Cn(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&&!wn(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:Sn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),En=L(`$ZodEmoji`,(e,t)=>{t.pattern??=Ct(),W.init(e,t)}),Dn=L(`$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?gt:_t(t.length),W.init(e,t)}),On=L(`$ZodCUID`,(e,t)=>{t.pattern??=dt,W.init(e,t)}),kn=L(`$ZodCUID2`,(e,t)=>{t.pattern??=ft,W.init(e,t)}),An=L(`$ZodULID`,(e,t)=>{t.pattern??=pt,W.init(e,t)}),jn=L(`$ZodXID`,(e,t)=>{t.pattern??=mt,W.init(e,t)}),Mn=L(`$ZodKSUID`,(e,t)=>{t.pattern??=ht,W.init(e,t)}),Nn=L(`$ZodISODateTime`,(e,t)=>{t.pattern??=Lt(t),W.init(e,t)}),Pn=L(`$ZodISODate`,(e,t)=>{t.pattern??=Pt,W.init(e,t)}),Fn=L(`$ZodISOTime`,(e,t)=>{t.pattern??=It(t),W.init(e,t)}),In=L(`$ZodISODuration`,(e,t)=>{t.pattern??=vt,W.init(e,t)}),Ln=L(`$ZodIPv4`,(e,t)=>{t.pattern??=wt,W.init(e,t)}),Rn=/^[0-9a-fA-F:.]+$/;function zn(e){return Rn.test(e)?vn(`http://[${e}]`):!1}var Bn=L(`$ZodIPv6`,(e,t)=>{t.pattern??=Tt,W.init(e,t),e._zod.check=n=>{zn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Vn=L(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Et,W.init(e,t)});function Hn(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:zn(n)}var Un=L(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Dt,W.init(e,t),e._zod.check=n=>{Hn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Wn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Gn=/^[0-9a-zA-Z+/]*={0,2}$/,Kn=L(`$ZodBase64`,(e,t)=>{t.pattern??=Gn,W.init(e,t),e._zod.check=n=>{Wn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),qn=/^[A-Za-z0-9_-]*$/;function Jn(e){if(!qn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Wn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Yn=L(`$ZodBase64URL`,(e,t)=>{t.pattern??=qn,W.init(e,t),e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Xn=L(`$ZodE164`,(e,t)=>{t.pattern??=jt,W.init(e,t)});function Zn(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 Qn=L(`$ZodJWT`,(e,t)=>{W.init(e,t),e._zod.check=n=>{Zn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),$n=L(`$ZodNumber`,(e,t)=>{U.init(e,t),e._zod.pattern=Bt,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}}),er=L(`$ZodNumberFormat`,(e,t)=>{Xt.init(e,t),$n.init(e,t)}),tr=L(`$ZodBoolean`,(e,t)=>{U.init(e,t),e._zod.pattern=Vt,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}}),nr=L(`$ZodUnknown`,(e,t)=>{U.init(e,t),e._zod.parse=e=>e}),rr=L(`$ZodNever`,(e,t)=>{U.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ir(e,t){let r=o(e._zod.def.checks);if(!r.length)return;let i=Math.min(...r.map(e=>e[0])),a=e._zod.parse;e._zod.parse=(r,s)=>{let c=t(r.value);if(c>i&&!s?.skipChecks&&s?.direction!==`backward`){for(let[t,i]of o(e._zod.def.checks))if(c>t&&i._zod.def.when(r)){let t=r.issues.length;return i._zod.check(r),r.issues[t].continue=!1,n(r.issues,t,e),r}}return a(r,s)}}var ar=e=>Array.isArray(e)?e.length:-1;function or(e,t,n){e.issues.length&&t.issues.push(...N(n,e.issues)),t.value[n]=e.value}var sr=L(`$ZodArray`,(e,t)=>{U.init(e,t);let n=_.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=>or(t,r,e)));else if(or(c,r,e),s&&c.issues.length!==0&&p(c))break}return o.length?Promise.all(o).then(()=>r):r},ir(e,ar)});function cr(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(...N(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var lr=[];function ur(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:lr,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=oe(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function dr(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,m=0;for(let i in t){if(o&&n.issues.length!==m){if(p(n,m))break;m=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=>cr(e,n,i,t,d,f))):cr(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 fr=L(`$ZodObject`,(e,t)=>{U.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=w(()=>ur(t));V(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)||Ee(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=M,o=t.catchall,s,c=_.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(p(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=>cr(n,t,e,r,a,o))):cr(s,t,e,r,a,o)}return o?dr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),pr=L(`$ZodObjectJIT`,(e,t)=>{fr.init(e,t);let n=e._zod.parse,r=w(()=>ur(t)),i=_.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ln([`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;
@@ -69,13 +69,13 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
69
69
  <%s {...props} />
70
70
  React keys must be passed directly to JSX without using spread:
71
71
  let props = %s;
72
- <%s key={someKey} {...props} />`,o,p,m,p),ne[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=dc(),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.view_transition`),k=Symbol.for(`react.client.reference`),A=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var P,ee={},F=m.react_stack_bottom_frame.bind(m,o)(),te=N(i(o)),ne={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=F;return d(e,t,n,!1,o,r?N(i(e)):te)},e.jsxs=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=F;return d(e,t,n,!0,o,r?N(i(e)):te)}})()})),pc=Ne(((e,t)=>{t.exports=fc()})),X=Ie(dc(),1),mc=pc(),hc=X.createContext(void 0),gc=e=>{let t=X.useContext(hc);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},_c=({client:e,children:t})=>(X.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,mc.jsx)(hc.Provider,{value:e,children:t})),vc={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},yc=new class{#e=vc;#t=!1;setTimeoutProvider(e){this.#t&&e!==this.#e&&console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,{previous:this.#e,provider:e}),this.#e=e,this.#t=!1}setTimeout(e,t){return this.#t=!0,this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#t=!0,this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function bc(e){setTimeout(e,0)}var xc=typeof window>`u`||`Deno`in globalThis;function Sc(){}function Cc(e,t){return typeof e==`function`?e(t):e}function wc(e){return typeof e==`number`&&e>=0&&e!==1/0}function Tc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Z(e,t){return typeof e==`function`?e(t):e}function Ec(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Oc(o,t.options))return!1}else if(!Ac(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 Dc(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(kc(t.options.mutationKey)!==kc(a))return!1}else if(!Ac(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Oc(e,t){return(t?.queryKeyHashFn||kc)(e)}function kc(e){return JSON.stringify(e,(e,t)=>Fc(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ac(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(!Ac(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Ac(e[r],t[r]))return!1;return!0}return!1}var jc=Object.prototype.hasOwnProperty;function Mc(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Pc(e)&&Pc(t);if(!r&&!(Fc(e)&&Fc(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:jc.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Mc(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Nc(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 Pc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fc(e){if(!Ic(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!(!Ic(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Ic(e){return Object.prototype.toString.call(e)===`[object Object]`}function Lc(e){return new Promise(t=>{yc.setTimeout(t,e)})}function Rc(e,t,n){if(typeof n.structuralSharing==`function`)return n.structuralSharing(e,t);if(n.structuralSharing!==!1)try{return Mc(e,t)}catch(e){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`),e}return t}function zc(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Bc(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Vc=Symbol();function Hc(e,t){return e.queryFn===Vc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Vc?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Uc(e,t){return typeof e==`function`?e(...t):!!e}function Wc(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Gc=()=>xc,Kc=()=>Gc(),qc=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(){}},Jc=new class extends qc{#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`}},Yc=bc;function Xc(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Yc,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=Xc(),Qc=new class extends qc{#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 $c(e){return Math.min(1e3*2**e,3e4)}function el(e){return(e??`online`)!==`online`||Qc.isOnline()}var tl=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function nl(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Sc);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new tl(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Jc.isFocused()&&(e.networkMode===`always`||Qc.isOnline())&&e.canRun(),p=()=>el(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??(Kc()?0:3),a=e.retryDelay??$c,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Lc(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 rl=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wc(this.gcTime)&&(this.#e=yc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kc()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(yc.clearTimeout(this.#e),this.#e=void 0)}};function il(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=>{Wc(e,()=>t.signal,()=>n=!0)},u=Hc(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?Bc:zc;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ol:al,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:al(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 al(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 ol(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var sl=class extends rl{#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=ul(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=ul(this.options);e.data!==void 0&&(this.setState(ll(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Rc(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(Sc).catch(Sc):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=>Z(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Z(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:!Tc(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)}Array.isArray(this.options.queryKey)||console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Hc(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`?il(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=nl({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof tl&&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 console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),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 tl){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,...cl(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ll(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 cl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:el(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ll(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ul(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 dl=class extends qc{#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),pl(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ml(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ml(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 Z(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&&!Nc(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&hl(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Z(this.options.enabled,this.#t)!==Z(t.enabled,this.#t)||Z(this.options.staleTime,this.#t)!==Z(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Z(this.options.enabled,this.#t)!==Z(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 Nc(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(Sc)),t}#h(e){return!Kc()&&Z(this.options.enabled,this.#t)!==!1&&wc(e)}#g(){this.#b();let e=Z(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Tc(this.#r.dataUpdatedAt,e)+1;this.#u=yc.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Z(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=yc.setInterval(()=>{(this.options.refetchIntervalInBackground||Jc.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(yc.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(yc.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&&pl(e,t),o=i&&hl(e,n,t,r);(a||o)&&(l={...l,...cl(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=Rc(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=Rc(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:gl(e,t),refetch:this.refetch,isEnabled:Z(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),Nc(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 fl(e,t){return Z(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Z(t.retryOnMount,e)!==!1)}function pl(e,t){return fl(e,t)||e.state.data!==void 0&&ml(e,t,t.refetchOnMount)}function ml(e,t,n){if(Z(t.enabled,e)!==!1&&Z(t.staleTime,e)!==`static`){let r=Z(n,e);return r===`always`||r!==!1&&gl(e,t)}return!1}function hl(e,t,n,r){return(e!==t||Z(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&gl(e,n)}function gl(e,t){return Z(t.enabled,e)!==!1&&e.isStaleByTime(Z(t.staleTime,e))}var _l=class extends rl{#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||vl(),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=nl({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 vl(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var yl=class extends qc{#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),Nc(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&kc(t.mutationKey)!==kc(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??vl();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)})})}},bl=X.createContext(!1),xl=()=>X.useContext(bl);bl.Provider;function Sl(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Cl=X.createContext(Sl()),wl=()=>X.useContext(Cl),Tl=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Uc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},El=e=>{X.useEffect(()=>{e.clearReset()},[e])},Dl=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Uc(n,[e.error,r])),Ol=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))}},kl=(e,t)=>e?.suspense&&t.isPending,Al=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function jl(e,t,n){if(typeof e!=`object`||Array.isArray(e))throw Error(`Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object`);let r=xl(),i=wl(),a=gc(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash);o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);let c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ol(o),Tl(o,i,s),El(i);let[l]=X.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(X.useSyncExternalStore(X.useCallback(e=>{let t=d?l.subscribe(Zc.batchCalls(e)):Sc;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),X.useEffect(()=>{l.setOptions(o)},[o,l]),kl(o,u))throw Al(o,l,i);if(Dl({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Ml(e,t){return jl(e,dl,t)}function Nl(e,t){let n=gc(t),[r]=X.useState(()=>new yl(n,e));X.useEffect(()=>{r.setOptions(e)},[r,e]);let i=X.useSyncExternalStore(X.useCallback(e=>r.subscribe(Zc.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=X.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Sc)},[r]);if(i.error&&Uc(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Pl=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Fl=/^[\\/]{2}/;function Il(e,t){return t+e.replace(/\\/g,`/`)}var Ll=`popstate`;function Rl(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function zl(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Hl(``,{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:Ul(t)}return Gl(t,n,null,e)}function Q(e,t){if(e===!1||e==null)throw Error(t)}function $(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Bl(){return Math.random().toString(36).substring(2,10)}function Vl(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 Hl(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Wl(t):t,state:n,key:t&&t.key||r||Bl(),mask:i}}function Ul({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 Wl(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 Gl(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=Rl(e)?e:Hl(h.location,e,t);n&&n(r,e),l=u()+1;let d=Vl(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=Rl(e)?e:Hl(h.location,e,t);n&&n(r,e),l=u();let i=Vl(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 Kl(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(Ll,d),c=e,()=>{i.removeEventListener(Ll,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 Kl(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Q(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ul(t);return i=i.replace(/ $/,`%20`),!n&&Fl.test(i)&&(i=r+i),new URL(i,r)}var ql=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)}},Jl=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function Yl(e){return Jl.has(e)}var Xl=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function Zl(e){return Xl.has(e)}function Ql(e){return e.index===!0}function $l(e){let t={};return e.Component&&(e.element&&$(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:X.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&$(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:X.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&$(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:X.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}function eu(e,t=$l,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(Q(e.index!==!0||!e.children,`Cannot specify children on an index route`),Q(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Ql(e)){let n={...e,id:s};return r[s]=tu(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=tu(n,t(n)),e.children&&(n.children=eu(e.children,t,o,r,i)),n}})}function tu(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function nu(e,t,n=`/`){return ru(e,t,n,!1)}function ru(e,t,n,r,i){let a=Tu((typeof t==`string`?Wl(t):t).pathname||`/`,n);if(a==null)return null;let o=i??au(e),s=null,c=wu(a);for(let e=0;s==null&&e<o.length;++e)s=bu(o[e],c,r);return s}function iu(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 au(e){let t=ou(e);return cu(t),t}function ou(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;Q(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=Fu([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Q(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ou(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:vu(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Cu(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 su(e.path))a(e,t,!0,n)}),t}function su(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=su(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 cu(e){e.sort((e,t)=>e.score===t.score?yu(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var lu=/^:[\w-]+$/,uu=/^:[\w-]+/,du=3.5,fu=3,pu=2,mu=1,hu=10,gu=-2,_u=e=>e===`*`;function vu(e,t){let n=e.split(`/`),r=n.length;return n.some(_u)&&(r+=gu),t&&(r+=pu),n.filter(e=>!_u(e)).reduce((e,t)=>e+(lu.test(t)?fu:uu.test(t)?du:t===``?mu:hu),r)}function yu(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 bu(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?Su(u,l,s.matcher,s.compiledParams):xu(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=xu({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Fu([a,d.pathname]),pathnameBase:Lu(Fu([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Fu([a,d.pathnameBase]))}return o}function xu(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Cu(e.path,e.caseSensitive,e.end);return Su(e,t,n,r)}function Su(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Iu(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Iu(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 Cu(e,t=!1,n=!0){$(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 wu(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return $(!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 Tu(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 Eu({basename:e,pathname:t}){return t===`/`?e:Fu([e,t])}var Du=e=>Pl.test(e);function Ou(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Wl(e):e,a;return n?(n=Pu(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?ku(n.substring(1),`/`):ku(n,t)):a=t,{pathname:a,search:Ru(r),hash:zu(i)}}function ku(e,t){let n=Iu(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Au(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 ju(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Mu(e){let t=ju(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Nu(e,t,n,r=!1){let i;typeof e==`string`?i=Wl(e):(i={...e},Q(!i.pathname||!i.pathname.includes(`?`),Au(`?`,`pathname`,`search`,i)),Q(!i.pathname||!i.pathname.includes(`#`),Au(`#`,`pathname`,`hash`,i)),Q(!i.search||!i.search.includes(`#`),Au(`#`,`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=Ou(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Pu=e=>e.replace(/[\\/]{2,}/g,`/`),Fu=e=>Pu(e.join(`/`));function Iu(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 Lu=e=>Iu(e).replace(/^\/*/,`/`),Ru=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,zu=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Bu=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Vu=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 Hu(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Uu(e){return Fu(e.map(e=>e.route.path).filter(Boolean))||`/`}function Wu(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?Wl(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 Gu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ku(e,t){let n=e;if(typeof n!=`string`||!Pl.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Gu)try{let e=new URL(window.location.href),r=Fl.test(n)?new URL(Il(n,e.protocol)):new URL(n),a=Tu(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{$(!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 qu=Symbol(`Uninstrumented`),Ju=new WeakMap;function Yu(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)=>td(await nd(n.lazy,void 0,()=>e(...t),rd))}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)=>td(await nd(n[`lazy.middleware`],void 0,()=>t(...e),rd))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>td(await nd(n[`lazy.loader`],void 0,()=>t(...e),rd))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>td(await nd(n[`lazy.action`],void 0,()=>t(...e),rd))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Zu(t.loader),i=async(...t)=>td(await nd(n.loader,id(t[0]),()=>e(...t),rd));e.hydrate===!0&&(i.hydrate=!0),Qu(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Zu(t.action),i=async(...t)=>td(await nd(n.action,id(t[0]),()=>e(...t),rd));Qu(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Zu(e),r=async(...e)=>td(await nd(n.middleware,id(e[0]),()=>t(...e),rd));return Qu(r,t),r})),r}function Xu(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=Zu(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?Ul(i):`.`,...ad(e,a??{})};return td(await nd(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=$u(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...rd(e),meta:o})))};Qu(r,t),e.navigate=r}if(n.fetch.length>0){let t=Zu(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return td(await nd(n.fetch,{href:o??`.`,fetcherKey:i,...ad(e,s??{})},async()=>{let n=$u(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...rd(e),meta:c})))};Qu(r,t),e.fetch=r}return e}function Zu(e){return e[qu]??e}function Qu(e,t){e[qu]=t}function $u(e,t){return Ju.set(e,t),()=>{Ju.get(e)===t&&Ju.delete(e)}}function ed(e){let t=Ju.get(e);return Ju.delete(e),t}function td(e){if(e.type===`error`)throw e.value;return e.value}async function nd(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=nd(e,t,n,r,i,a-1),await s,Q(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={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function rd(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function id(e){let{request:t,context:n,params:r}=e;return{...e,request:od(t),params:{...r},context:sd(n)}}function ad(e,t){return{currentUrl:Ul(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 od(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function sd(e){return{get:t=>e.get(t)}}var cd=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=au(e)}match(e,t=!1){return ru(this.#e,e,this.#n,t,this.#t)}},ld=new URL(`http://localhost`);function ud(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ld)}catch{return ld}}function dd(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function fd(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 pd(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&&!dd(i,n),s=!dd(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!fd(e,i)||!dd(i,a)))throw Error(`External navigation is not allowed`)}var md=[`POST`,`PUT`,`PATCH`,`DELETE`],hd=new Set(md),gd=[`GET`,...md],_d=new Set(gd),vd=new Set([301,302,303,307,308]),yd=new Set([307,308]),bd={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},xd={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Sd={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Cd=`remix-router-transitions`,wd=Symbol(`ResetLoaderData`);function Td(e,t){return e.unstable_routePatternMatching?(Q(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new cd(t)}var Ed=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 Dd(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;Q(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),...Yu(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=Td(o,s),l={},u=new Ed(eu(e.routes,a,void 0,l),c),d=e.dataStrategy||Wd,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=hf(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=mf(u.activeRoutes);S=!0,C=!S,y=n,x={[r.id]:t}}else if(y&&!e.hydrationData&&He(y,e.history.location.pathname).active&&(y=null),!y){S=!1,C=!S,y=[];let t=He(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=>Md(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=Nd(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:bd,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,O=!1,k,A=!1,j=new Map,M=null,N=!1,P=!1,ee=new Set,F=new Map,te=0,ne=-1,re=new Map,I=new Set,ie=new Map,ae=new Map,oe=new Set,se=new Map,ce,L=null;function R(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(ce){ce(),ce=void 0;return}$(se.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=Ie({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{ce=e});e.history.go(r*-1),Fe(i,{state:`blocked`,location:n,proceed(){Fe(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,Sd),z({blockers:e})}}),D?.resolve(),D=null}else return pe(t,n)}),n){Bf(t,j);let e=()=>Vf(t,j);t.addEventListener(`pagehide`,e),M=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||pe(`POP`,T.location,{initialHydration:!0}),w}function le(){f&&f(),M&&M(),p.clear(),k&&k.abort(),T.fetchers.forEach((e,t)=>De(T.fetchers,t)),T.blockers.forEach((e,t)=>Pe(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`&&(oe.has(t)?n.push(t):r.push(t))}),oe.forEach(e=>{!T.fetchers.has(e)&&!F.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=>De(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&&Af(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?df(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,s=T.blockers;s.size>0&&!N&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Sd)));let c=!N&&Ve(t,n.matches||T.matches),l=O===!0||T.navigation.formMethod!=null&&Af(T.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),N||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!N&&t!==T.location){let e=j.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:j.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(A){let e=j.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),j.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:bd,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,O=!1,A=!1,N=!1,P=!1,D?.resolve(),D=null,L?.resolve(),L=null}async function B(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=Hf();let n=D.promise;return e.history.go(t),n}let r=ed(w),{path:i,submission:a,error:o}=Ad(!1,kd(T.location,T.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?Wl(n.mask):{...T.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},Fl.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),pd(typeof n.mask==`string`?n.mask:Ul(n.mask),Ul(c),e.history.createURL(`/`),`reject`)}let l=T.location,u=Hl(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},pd(t==null?e.history.createHref(T.location):typeof t==`string`?t:Ul(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&&Af(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=Ie({currentLocation:l,nextLocation:u,historyAction:f});h?Fe(h,{state:`blocked`,location:u,proceed(){Fe(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),B(t,n)},reset(){let e=new Map(T.blockers);e.set(h,Sd),z({blockers:e})}}):await pe(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 fe(){L||=Hf(),Se(),z({revalidation:`loading`});let e=L.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(pe(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(pe(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:A===!0}),e)}async function pe(t,n,r){k&&k.abort(),k=null,E=t,N=(r&&r.startUninterruptedRevalidation)===!0,Be(T.location,T.matches),O=(r&&r.preventScrollReset)===!0,A=(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&&!P&&vf(T.location,n)&&!(r&&r.submission&&Af(r.submission.formMethod))){de(n,{matches:i},{flushSync:a});return}let o=He(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=Nf(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=Le(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;k=new AbortController;let l=of(e.history,n,k.signal,r&&r.submission),u=e.getContext?await e.getContext():new ql,d;if(r&&r.pendingError)d=[pf(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Af(r.submission.formMethod)){let c=await V(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(Cf(t)&&Hu(t.error)&&t.error.status===404){k=null,de(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,d=c.pendingActionResult,s=Ff(n,i,t,r.submission),a=!1,o.active=!1,l=of(e.history,l.url,l.signal)}let{shortCircuited:f,matches:p,loaderData:m,errors:h,workingFetchers:g}=await me(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||(k=null,de(n,{matches:p||i,...ff(d),loaderData:m,errors:h,...g?{fetchers:g}:{}}))}async function V(t,n,i,o,c,d,f,p,m={}){if(Se(),z({navigation:If(n,o,c,i)},{flushSync:m.flushSync===!0}),f){let e=await Ue(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}=mf(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=pf(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}=Le(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Mf(o,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:hf(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await be(t,n,Xd(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(wf(h)){let n;return n=m&&m.replace!=null?m.replace:af(h.response.headers.get(`Location`),new URL(t.url),s,e.history)===T.location.pathname+T.location.search,await ye(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Cf(h)){let e=pf(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 me(t,n,i,o,s,d,f,p,m,h,g,_,v,y){let b=f||Ff(n,i,o,p),x=p||m||Pf(b),S=!N&&!g;if(d){if(S){let e=he(v);z({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Ue(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}=mf(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=pf(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}=Le(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let{dsMatches:C,revalidatingFetchers:w}=jd(t,s,a,l,e.history,T,i,x,n,g?[]:r,g===!0,P,ee,oe,ie,I,c,v,y);if(ne=++te,!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=je(e);return de(n,{matches:i,loaderData:{},errors:v&&Cf(v[1])?{[v[0]]:v[1].error}:null,...ff(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=he(v);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=ge(w)),z(e,{flushSync:_})}w.forEach(e=>{ke(e.key),e.controller&&F.set(e.key,e.controller)});let E=()=>w.forEach(e=>ke(e.key));k&&k.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await xe(C,w,t,n,s);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener(`abort`,E),w.forEach(e=>F.delete(e.key));let A=gf(D);if(A)return await ye(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=gf(O),A)return I.add(A.key),await ye(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(T.fetchers),{loaderData:M,errors:re}=uf(T,i,D,v,w,O,j);g&&T.errors&&(re={...T.errors,...re});let ae=je(j),se=Me(ne,j),ce=ae||se||w.length>0;return{matches:i,loaderData:M,errors:re,...ce?{workingFetchers:j}:{}}}function he(e){if(e&&!Cf(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function ge(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Lf(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function H(t,n,r,i){ke(t);let a=(i&&i.flushSync)===!0,o=ed(w),l=kd(T.location,T.matches,s,r,n,i?.relative),u=c.match(l),d=He(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(Nf(e.history,l,u)),!u){we(t,n,hf(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Ad(!0,l,i);if(m){we(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new ql,g=(i&&i.preventScrollReset)===!0;if(p&&Af(p.formMethod)){await _e(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};ie.set(t,_),await ve(t,_,u,h,a,g,p)}async function _e(t,n,i,o,s,u,d,f,p,m){Se(),ie.delete(t),Ce(t,Rf(p,T.fetchers.get(t)),{flushSync:d});let h=new AbortController,g=of(e.history,i,h.signal,p);if(u){let e=await Ue(o,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:d});return}if(e.matches)o=e.matches;else{we(t,n,hf(404,{pathname:i}),{flushSync:d});return}}let _=Mf(o,i);if(!_.route.action&&!_.route.lazy){we(t,n,hf(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:d});return}F.set(t,h);let v=te,y=Xd(a,l,g,i,o,_,r,s),b=await be(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){F.get(t)===h&&F.delete(t);return}if(oe.has(t)){if(wf(x)||Cf(x)){Ce(t,zf(void 0));return}}else{if(wf(x)){if(F.delete(t),ne>v){Ce(t,zf(void 0));return}return I.add(t),Ce(t,Lf(p)),ye(g,x,!1,{fetcherSubmission:p,preventScrollReset:f})}if(Cf(x)){we(t,n,x.error);return}}let S=T.navigation.location||T.location,C=of(e.history,S,h.signal),w=T.navigation.state===`idle`?T.matches:c.match(T.navigation.location);Q(w,`Didn't find any matches after fetcher action`);let D=++te;re.set(t,D);let{dsMatches:O,revalidatingFetchers:A}=jd(C,s,a,l,e.history,T,w,p,S,r,!1,P,ee,oe,ie,I,c,[_.route.id,x],m),j=Lf(p,x.data),M=new Map(T.fetchers);M.set(t,j),A.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=M.get(t),r=Lf(void 0,n?n.data:void 0);M.set(t,r),ke(t),e.controller&&F.set(t,e.controller)}),z({fetchers:M});let N=()=>A.forEach(e=>ke(e.key));h.signal.addEventListener(`abort`,N);let{loaderResults:ae,fetcherResults:se}=await xe(O,A,C,S,s);if(h.signal.aborted){re.get(t)===D&&re.delete(t);return}h.signal.removeEventListener(`abort`,N),re.delete(t),F.delete(t),A.forEach(e=>F.delete(e.key));let ce=T.fetchers.has(t),L=e=>{if(!ce)return e;let n=new Map(e.fetchers);return n.set(t,zf(x.data)),{...e,fetchers:n}},R=gf(ae);if(R)return T=L(T),ye(C,R.result,!1,{preventScrollReset:f});if(R=gf(se),R)return I.add(R.key),T=L(T),ye(C,R.result,!1,{preventScrollReset:f});let le=new Map(T.fetchers);ce&&le.set(t,zf(x.data));let{loaderData:ue,errors:B}=uf(T,w,ae,void 0,A,se,le);Me(D,le),T.navigation.state===`loading`&&D>ne?(Q(E,`Expected pending action`),k&&k.abort(),de(T.navigation.location,{matches:w,loaderData:ue,errors:B,fetchers:le})):(z({errors:B,loaderData:df(T.loaderData,ue,w,B),fetchers:le}),P=!1)}async function ve(t,n,i,o,s,c,u){let{routeId:d,path:f}=n,p=T.fetchers.get(t);Ce(t,Lf(u,p?p.data:void 0),{flushSync:s});let m=new AbortController,h=of(e.history,f,m.signal);if(n.isDiscovering){let e=await Ue(i,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,d,e.error,{flushSync:s});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{we(t,d,hf(404,{pathname:f}),{flushSync:s});return}}let g=Mf(i,f);F.set(t,m);let _=te,v=await be(h,f,Xd(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(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(oe.has(t))Ce(t,zf(void 0));else{if(wf(y)){if(ne>_){Ce(t,zf(void 0));return}I.add(t),await ye(h,y,!1,{preventScrollReset:c});return}Cf(y)?we(t,d,y.error):Ce(t,zf(y.data))}}}async function ye(r,i,a,{submission:o,fetcherSubmission:c,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(P=!0);let d=i.response.headers.get(`Location`);Q(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=af(d,p,s,e.history),pd(f,d,p,`allow-explicit`);let m=Hl(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Du(d)){let n=Kl(t,d,!0);e=n.origin!==t.location.origin||Tu(n.pathname,s)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}k=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=Pf(T.navigation));let y=o||c;yd.has(i.response.status)&&y&&Af(y.formMethod)?await pe(h,m,{submission:{...y,formAction:d},preventScrollReset:l||O,enableViewTransition:a?A:void 0}):await pe(h,m,{overrideNavigation:Ff(m,[],h,o),fetcherSubmission:c,preventScrollReset:l||O,enableViewTransition:a?A:void 0})}async function be(e,t,n,r,i){let a,o={};try{a=await Zd(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(!Af(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(Sf(r)){let i=r.result;o[t]={type:`redirect`,response:tf(i,e,t,n,s)}}else o[t]=await ef(r);return o}async function xe(e,t,n,r,i){let a=be(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await be(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:hf(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Se(){P=!0,ie.forEach((e,t)=>{F.has(t)&&ee.add(t),ke(t)})}function Ce(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),z({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function we(e,t,n,r={}){let i=pf(T.matches,t),a=new Map(T.fetchers);De(a,e),z({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Te(e){return ae.set(e,(ae.get(e)||0)+1),oe.has(e)&&oe.delete(e),T.fetchers.get(e)||xd}function Ee(e,t){ke(e,t?.reason),Ce(e,zf(null))}function De(e,t){let n=T.fetchers.get(t);F.has(t)&&!(n&&n.state===`loading`&&re.has(t))&&ke(t),ie.delete(t),re.delete(t),I.delete(t),oe.delete(t),ee.delete(t),e.delete(t)}function Oe(e){let t=(ae.get(e)||0)-1;t<=0?(ae.delete(e),oe.add(e)):ae.set(e,t),z({fetchers:new Map(T.fetchers)})}function ke(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function Ae(e,t){for(let n of e){let e=t.get(n);Q(e,`Expected fetcher: ${n}`);let r=zf(e.data);t.set(n,r)}}function je(e){let t=[],n=!1;for(let r of I){let i=e.get(r);Q(i,`Expected fetcher: ${r}`),i.state===`loading`&&(I.delete(r),t.push(r),n=!0)}return Ae(t,e),n}function Me(e,t){let n=[];for(let[r,i]of re)if(i<e){let e=t.get(r);Q(e,`Expected fetcher: ${r}`),e.state===`loading`&&(ke(r),re.delete(r),n.push(r))}return Ae(n,t),n.length>0}function Ne(e,t){let n=T.blockers.get(e)||Sd;return se.get(e)!==t&&se.set(e,t),n}function Pe(e){T.blockers.delete(e),se.delete(e)}function Fe(e,t){let n=T.blockers.get(e)||Sd;Q(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 Ie({currentLocation:e,nextLocation:t,historyAction:n}){if(se.size===0)return;se.size>1&&$(!1,`A router only supports one blocker at a time`);let r=Array.from(se.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 Le(e){let t=hf(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=mf(n);return{notFoundMatches:r,route:i,error:t}}function Re(e,t,n){if(h=e,_=t,g=n||null,!v&&T.navigation===bd){v=!0;let e=Ve(T.location,T.matches);e!=null&&z({restoreScrollPosition:e})}return()=>{h=null,_=null,g=null}}function ze(e,t){return g&&g(e,t.map(e=>iu(e,T.loaderData)))||e.key}function Be(e,t){if(h&&_){let n=ze(e,t);h[n]=_()}}function Ve(e,t){if(h){let n=ze(e,t),r=h[n];if(typeof r==`number`)return r}return null}function He(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 Ue(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||Ld(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&&We(o,d.slice(0,o.length))))))return{type:`success`,matches:s};if(d||=c.match(n,!0),!d||We(o,d))return{type:`success`,matches:null};o=d}}function We(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Ge(e){l={},u.setHmrRoutes(eu(e,a,void 0,l))}function Ke(e,t,n=!1){Ld(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:Re,navigate:B,fetch:H,revalidate:fe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Te,resetFetcher:Ee,deleteFetcher:Oe,dispose:le,getBlocker:Ne,deleteBlocker:Pe,patchRoutes:Ke,_internalFetchControllers:F,_internalSetRoutes:Ge,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){z(e)}},e.instrumentations&&(w=Xu(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function Od(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function kd(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=Nu(r||`.`,Mu(o),Tu(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=jf(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=Eu({basename:n,pathname:c.pathname})),Ul(c)}function Ad(e,t,n){if(!n||!Od(n))return{path:t};if(n.formMethod&&!kf(n.formMethod))return{path:t,error:hf(405,{method:n.formMethod})};let r=()=>({path:t,error:hf(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=_f(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Af(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(!Af(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()}}}Q(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=sf(n.formData),s=n.formData;else if(n.body instanceof FormData)o=sf(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=cf(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=cf(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(Af(c.formMethod))return{path:t,submission:c};let l=Wl(t);return e&&l.search&&jf(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ul(l),submission:c}}function jd(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Cf(_[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(_&&Cf(_[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=Uu(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(!Md(s))f=!1;else if(u){let{shouldLoad:e}=Nd(s,a.loaderData,a.errors);f=e}else Pd(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Yd(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?Fd(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Yd(n,r,e,c,E,i,l,t,Id(i,m),m,v)}),O=[];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(!_){O.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=Mf(_,e.path),b=new AbortController,x=of(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=Xd(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=Xd(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};Id(y,a)&&(S=Xd(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function Md(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Nd(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Md(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 Pd(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Fd(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Id(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Ld(e,t,n,r,i,a){let o;if(e){let t=r[e];Q(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=>Rd(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=eu(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]=eu([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 Rd(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=>Rd(e,t)))??!1}var zd=new WeakMap,Bd=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Q(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=zd.get(i);o||(o={},zd.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Yl(e),n=i[e]!==void 0;if(t)$(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)$(!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},Vd=new WeakMap;function Hd(e,t,n,r,i){let a=n[e.id];if(Q(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Vd.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Q(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=Zl(e),o=a[e]!==void 0;i?$(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?$(!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 Vd.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=Bd({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 Ud(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 Wd(e){return e.matches.some(e=>e.route.middleware)?Gd(e,()=>Ud(e)):Ud(e)}function Gd(e,t){return Kd(e,t,e=>{if(Of(e))throw e;return e},bf,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{[pf(r,a).route.id]:{type:`error`,result:t}}}}}async function Kd(e,t,n,r,i){let{matches:a,...o}=e;return await qd(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function qd(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 qd(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 Jd(e,t,n,r,i){let a=Bd({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Hd(r.route,Af(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Yd(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Jd(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Id(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Id(a,{...l,defaultShouldRevalidate:e}):Id(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Af(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Af(n.method)||!p)?Qd({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 Xd(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Yd(e,t,n,r,Uu(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Jd(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Zd(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:Wu(t,n),pattern:Uu(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 Gd(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 Qd({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Af(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:Wu(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 hf(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 hf(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function $d(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 ef(e){let{result:t,type:n}=e;if(Ef(t)){let e;try{e=await $d(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Vu(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Tf(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:yf(t),statusCode:Hu(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Hu(t)?t.status:void 0}:Tf(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 tf(e,t,n,r,i){let a=e.headers.get(`Location`);if(Q(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Du(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=kd(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var nf=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function rf(e){try{return nf.includes(new URL(e).protocol)}catch{return!1}}function af(e,t,n,r){if(Du(e)){let r=e,i=Fl.test(r)?new URL(Il(r,t.protocol)):new URL(r);if(rf(i.toString()))throw Error(`Invalid redirect location`);let a=Tu(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Pu(i.pathname)+i.search+i.hash}try{if(rf(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function of(e,t,n,r){let i=e.createURL(_f(t)).toString(),a={signal:n};if(r&&Af(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?sf(r.formData):r.formData}return new Request(i,a)}function sf(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function cf(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function lf(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Cf(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(Q(!wf(f),`Cannot handle redirect results in processLoaderData`),Cf(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=pf(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=wd),c||(c=!0,s=Hu(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 uf(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=lf(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(Q(s,`Did not find corresponding fetcher result`),Cf(s)){let t=pf(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(wf(s))Q(!1,`Unhandled fetcher revalidation redirect`);else{let e=zf(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function df(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==wd).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 ff(e){return e?Cf(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function pf(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 mf(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 hf(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 Vu(e||500,o,Error(s),!0)}function gf(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(wf(r))return{key:n,result:r}}}function _f(e){return Ul({...typeof e==`string`?Wl(e):e,hash:``})}function vf(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function yf(e){return new Vu(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function bf(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&xf(t))}function xf(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Sf(e){return Ef(e.result)&&vd.has(e.result.status)}function Cf(e){return e.type===`error`}function wf(e){return(e&&e.type)===`redirect`}function Tf(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Ef(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Df(e){return vd.has(e)}function Of(e){return Ef(e)&&Df(e.status)&&e.headers.has(`Location`)}function kf(e){return _d.has(e.toUpperCase())}function Af(e){return hd.has(e.toUpperCase())}function jf(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Mf(e,t){let n=typeof t==`string`?Wl(t).search:t.search;if(e[e.length-1].route.index&&jf(n||``))return e[e.length-1];let r=ju(e);return r[r.length-1]}function Nf(e,t,n){return{url:Wu(e.createURL(t),t),pattern:n?Uu(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Pf(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 Ff(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 If(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 Lf(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 Rf(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 zf(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 Bf(e,t){try{let n=e.sessionStorage.getItem(Cd);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 Vf(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Cd,JSON.stringify(n))}catch(e){$(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Hf(){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 Uf=X.createContext(null);Uf.displayName=`DataRouter`;var Wf=X.createContext(null);Wf.displayName=`DataRouterState`;var Gf=X.createContext(null);Gf.displayName=`DataRouterData`;var Kf=X.createContext(null);Kf.displayName=`DataRouterNavigation`;var qf=X.createContext(!1);function Jf(){return X.useContext(qf)}var Yf=X.createContext({isTransitioning:!1});Yf.displayName=`ViewTransition`;var Xf=X.createContext(null);Xf.displayName=`Fetchers`;var Zf=X.createContext(null);Zf.displayName=`Await`;var Qf=X.createContext(null);Qf.displayName=`Navigation`;var $f=X.createContext(null);$f.displayName=`Location`;var ep=X.createContext({outlet:null,matches:[],isDataRoute:!1});ep.displayName=`Route`;var tp=X.createContext(!1);tp.displayName=`IsDataRoute`;var np=X.createContext(void 0);np.displayName=`RouteId`;var rp=X.createContext(null);rp.displayName=`RouteError`;var ip=`REACT_ROUTER_ERROR`,ap=`REDIRECT`,op=`ROUTE_ERROR_RESPONSE`;function sp(e){if(e.startsWith(`${ip}:${ap}:{`))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 cp(e){if(e.startsWith(`${ip}:${op}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Vu(t.status,t.statusText,t.data)}catch{}}function lp(e,{relative:t}={}){Q(up(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=X.useContext(Qf),{hash:i,pathname:a,search:o}=yp(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Fu([n,a])),r.createHref({pathname:s,search:o,hash:i})}function up(){return X.useContext($f)!=null}function dp(){return Q(up(),`useLocation() may be used only in the context of a <Router> component.`),X.useContext($f).location}var fp=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function pp(){return X.useContext(tp)?zp():mp()}function mp(){Q(up(),`useNavigate() may be used only in the context of a <Router> component.`);let e=X.useContext(Uf),{basename:t,navigator:n}=X.useContext(Qf),{matches:r}=X.useContext(ep),{pathname:i}=dp(),a=JSON.stringify(Mu(r)),o=X.useRef(!1);return X.useLayoutEffect(()=>{o.current=!0}),X.useCallback((r,s={})=>{if($(o.current,fp),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Nu(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Fu([t,c.pathname])),pd(typeof r==`string`?r:Ul(r),n.createHref(c),ud(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var hp=X.createContext(null);function gp(){return X.useContext(hp)}function _p(e){let t=X.useContext(ep).outlet;return X.useMemo(()=>t&&X.createElement(hp.Provider,{value:e},t),[t,e])}function vp(){let{matches:e}=X.useContext(ep);return e[e.length-1]?.params??{}}function yp(e,{relative:t}={}){let{matches:n}=X.useContext(ep),{pathname:r}=dp(),i=JSON.stringify(Mu(n));return X.useMemo(()=>Nu(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function bp(e,t,n){Q(up(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=X.useContext(Qf),{matches:i}=X.useContext(ep),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Vp(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=dp(),d;if(t){let e=typeof t==`string`?Wl(t):t;Q(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m;m=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):nu(e,{pathname:p}),$(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),$(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Dp(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Fu([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Fu([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?X.createElement($f.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function xp(){let e=Ip(),t=Hu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=X.createElement(X.Fragment,null,X.createElement(`p`,null,`💿 Hey developer 👋`),X.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,X.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,X.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),X.createElement(X.Fragment,null,X.createElement(`h2`,null,`Unexpected Application Error!`),X.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?X.createElement(`pre`,{style:i},n):null,o)}var Sp=X.createElement(xp,null),Cp=class extends X.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=qf;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=cp(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:X.createElement(ep.Provider,{value:this.props.routeContext},X.createElement(tp.Provider,{value:this.props.routeContext.isDataRoute},X.createElement(np.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},X.createElement(rp.Provider,{value:e,children:this.props.component}))));return this.context?X.createElement(Tp,{error:e},t):t}},wp=new WeakMap;function Tp({children:e,error:t}){let{basename:n,navigator:r}=X.useContext(Qf);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=sp(t.digest);if(e){let i=wp.get(t);if(i)throw i;let a=Ku(e.location,n),o=a.absoluteURL||a.to;if(pd(e.location,o,ud(r),`allow-explicit`),rf(o))throw Error(`Invalid redirect location`);if(Gu&&!wp.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 wp.set(t,n),n}}return X.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Ep({routeContext:e,match:t,children:n}){let r=X.useContext(Uf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),X.createElement(ep.Provider,{value:e},X.createElement(tp.Provider,{value:e.isDataRoute},X.createElement(np.Provider,{value:t.route.id},n)))}function Dp(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);Q(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:Uu(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||Sp,o&&(s<0&&c===0?(Vp(`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?X.createElement(n.route.Component,null):n.route.element?n.route.element:e,X.createElement(Ep,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?X.createElement(Cp,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Op(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kp(e){let t=X.useContext(Uf);return Q(t,Op(e)),t}function Ap(e){let t=X.useContext(Wf);return Q(t,Op(e)),t}function jp(e){let t=X.useContext(Gf);return Q(t,Op(e)),t}function Mp(e){let t=X.useContext(Kf);return Q(t,Op(e)),t}function Np(e){let t=X.useContext(np);return Q(t,`${e} can only be used on routes that contain a unique "id"`),t}function Pp(){let{navigation:e}=Mp(`useNavigation`);return X.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function Fp(){let{matches:e}=Ap(`useMatches`),{loaderData:t}=jp(`useMatches`);return X.useMemo(()=>e.map(e=>iu(e,t)),[e,t])}function Ip(){let e=X.useContext(rp),t=jp(`useRouteError`),n=Np(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Lp=0;function Rp(e){let{router:t,basename:n}=kp(`useBlocker`),r=Ap(`useBlocker`),[i,a]=X.useState(``),o=X.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:Tu(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:Tu(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return X.useEffect(()=>{let e=String(++Lp);return a(e),()=>t.deleteBlocker(e)},[t]),X.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):Sd}function zp(){let{router:e}=kp(`useNavigate`),t=Np(`useNavigate`),n=X.useRef(!1);return X.useLayoutEffect(()=>{n.current=!0}),X.useCallback(async(r,i={})=>{$(n.current,fp),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Bp={};function Vp(e,t,n){!t&&!Bp[e]&&(Bp[e]=!0,$(!1,n))}var Hp=/:(\d+)(?:-(\d+))?$/,Up=/^(?:[A-Za-z]:\/|\/\/(?!\/)|\/)/;function Wp(e){return Hp.exec(e)?.[0]??``}function Gp(e){return qp(Kp(e))}function Kp(e){return e.replace(Hp,``).replaceAll(`\\`,`/`)}function qp(e){let t=Up.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 Jp({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:Se(-t)}}function Yp(e){return e%7==0?{unit:`week`,count:e/7}:{unit:`day`,count:e}}function Xp(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 Qp={number:0,nan:NaN,string:``,boolean:!1,bigint:0n,symbol:Symbol(),function:()=>void 0,undefined:void 0,null:null,array:[],object:{}};function $p(e,{issue:t,receivedType:n}){let r=n===void 0?void 0:em(n),i=e({...t,input:r});return typeof i==`string`?i:i?.message??t.message}function em(e){return e in Qp?Qp[e]:Object.create({constructor:{name:e}})}var tm=li().localeError,nm={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`},rm=`not set`,im={category:nm,noCategory:rm,categoryRow:{...nm,unset:rm,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`}},am={task:[`task`,`tasks`],line:[`line`,`lines`],project:[`project`,`projects`],day:[`day`,`days`],week:[`week`,`weeks`],session:[`session`,`sessions`]};function om(e,t){let[n,r]=am[t];return j(e,n,r)}function sm(e){return e===null?`—`:e<1?`less than a day`:om(Math.round(e),`day`)}function cm(e){return e===null?`—`:e<1?`within a day`:`within ${sm(e)}`}function lm(e){let t=Jp(e);switch(t.kind){case`no-open`:return`No open tasks`;case`clears`:return`Debt clears in about ${ie(`en`,t.weeks)} wk. (by ${re(`en`,t.until)})`;case`not-shrinking`:return`Debt is not shrinking`;case`grows`:return`Debt grows by ${ue(`en`,t.perWeek)} ${ge(t.perWeek,...am.task)} a week`}}function um({windowDays:e,closed:t,created:n}){let r=Yp(e);return`over ${om(r.count,r.unit)}: closed ${t}, created ${n}`}function dm(e){switch(e.kind){case`debt-growing`:return`Debt has grown for ${om(e.params.weeks,`week`)} straight: created ${e.params.created}, closed ${e.params.closed}`;case`urgent-stale`:return`Urgent tasks have been waiting more than ${om(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Stuck in progress: ${e.params.count}, longest ${e.params.id} — ${sm(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?`"${im.evidence[t]}"`:`"${im.evidence[t]}" ${im.checkMethod[n]}`} is almost always wrong: precision ${r}% on ${i} decided over ${om(a,`day`)}`}case`low-changed`:return`Code changed for ${om(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 ${om(e.params.days,`day`)}: ${e.params.count} — clean them up (backlog prune)`}}function fm(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 $p(tm,e)}}var pm=(e,t)=>({reason:`git does not trust ${e} (the directory belongs to another user)`,fix:`Fix: ${t}`}),mm={task:`its file`,project:`its project file`},hm=(e,t)=>`${e} is not loaded: ${mm[t]} could not be parsed`;function gm(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-unparsed`:return`epic ${e.epic} is not loaded: ${mm[e.fileKind]} could not be parsed`;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`epic-closed-with-open-tasks`:return`the epic closes on its own once all its tasks are closed — close the open ones first: ${e.children.join(`, `)}`;case`reference-missing`:return`${e.id} not found`;case`reference-unparsed`:return hm(e.id,e.fileKind);case`not-utf8`:return`the file is not UTF-8 — the backlog leaves it untouched until it is re-saved as UTF-8`;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===``?fm(e.issue):`${e.path}: ${fm(e.issue)}`;case`not-a-file`:return`not a file — the backlog reads only regular files and links to them`;case`link-unreachable`:return`the link does not lead to an accessible file or directory`;case`task-is-link`:return`the task is a link; links are supported only for a project directory`;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 _m=Zp(gm);function vm(e){return`all tasks of the epic are closed: ${e.join(`, `)}`}function ym(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 — ${vm(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: epic reopened — it has open tasks: ${e.childIds.join(`, `)}`;case`source-moved`:return Gp(e.from)===Gp(e.to)?`${e.taskId}: source moved ${Wp(e.from)} → ${Wp(e.to)}`:`${e.taskId}: code file renamed, source ${e.from} → ${e.to}`}}function bm(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: could not fix — ${xm(e)}`;case`task-invalid`:return`${e.taskId}: ${gm(e.problem)}`;case`file-not-parsed`:return`File ${e.path} could not be parsed: ${_m(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`:{let{reason:t,fix:n}=pm(e.repo,e.trustCommand);return`Project ${e.projectId}: ${t} — commits and code edits of its tasks are not checked. ${n}`}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`project-branches-unreadable`:return`Project ${e.projectId}: could not read the git branches in ${e.repo} (a broken ref or a git failure) — missing code files of its tasks were not checked`;case`merge-state-unknown`:return`Project ${e.projectId}: git in ${e.repo} could not tell whether ${ge(e.branches.length,`branch`,`branches`)} ${e.branches.join(`, `)} landed in the current branch (shallow clone, unrelated history or a git failure) — tasks created there were checked as usual, without waiting for the merge`;case`late-commits-unknown`:return`Project ${e.projectId}: git in ${e.repo} could not read the late commits or the reflog of ${ge(e.taskIds.length,`task`,`tasks`)} ${e.taskIds.join(`, `)} (shallow clone or a git failure) — their code edits were not checked, the next run will try again`;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 xm(e){switch(e.cause){case`invalid`:return _m(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:gm,problems:_m,taskNotLoaded:hm,unsafeRepo:pm,schemaIssue:fm,...Xp(im),count:om,days:sm,p90:cm,forecast:lm,forecastTail:um,signal:dm,epicDoneReason:vm,fileBusy:({path:e,lock:t,seconds:n})=>`${e} has been locked by another process for more than ${ie(`en`,n)} s (${t})`,checkFix:ym,checkProblem:bm,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}`,markCommitsReadFailed:(e,t)=>`Could not read the ${e} journal — the commits tasks were created and confirmed on are unknown: tasks from unmerged branches are checked as usual, and the code at the mark is taken from the reflog: ${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=fi().localeError,wm={bloaters:`Разбухшее`,"change-preventers":`Мешает изменениям`,couplers:`Связанность`,"data-dealers":`Работа с данными`,dispensables:`Лишнее`,"functional-abusers":`Императивность`,"lexical-abusers":`Именование`,"oo-abusers":`ООП`,obfuscators:`Запутанность`,bug:`Ошибка`},Tm=`не указана`,Em={category:wm,noCategory:Tm,categoryRow:{...wm,unset:Tm,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:`свежий`}},Dm={task:[`задача`,`задачи`,`задач`],line:[`строка`,`строки`,`строк`],project:[`проект`,`проекта`,`проектов`],day:[`день`,`дня`,`дней`],week:[`неделя`,`недели`,`недель`],session:[`сессия`,`сессии`,`сессий`]},Om={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},km={task:[`задачи`,`задач`,`задач`],day:[`дня`,`дней`,`дней`]};function Am(e,t){let[n,r,i]=Dm[t];return B(e,n,r,i)}function jm(e,t){return B(e,...Om[t])}function Mm(e,t){return B(e,...km[t])}function Nm(e){return e===null?`—`:e<1?`меньше дня`:`${ie(`ru`,Math.round(e))} дн.`}function Pm(e){return e===null?`—`:e<1?`быстрее суток`:`за ${Nm(e)}`}function Fm(e){let t=Jp(e);switch(t.kind){case`no-open`:return`Открытых задач нет`;case`clears`:return`Долг разберётся примерно за ${ie(`ru`,t.weeks)} нед. (к ${re(`ru`,t.until)})`;case`not-shrinking`:return`Долг не уменьшается`;case`grows`:return`Долг растёт на ${ue(`ru`,t.perWeek)} ${P(t.perWeek,...Dm.task)} в неделю`}}function Im({windowDays:e,closed:t,created:n}){let{unit:r,count:i}=Yp(e);return`за ${jm(i,r)}: закрыто ${t}, создано ${n}`}function Lm(e){switch(e.kind){case`debt-growing`:return`Долг растёт ${jm(e.params.weeks,`week`)} подряд: создано ${e.params.created}, закрыто ${e.params.closed}`;case`urgent-stale`:return`Срочные задачи ждут дольше ${Mm(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Застряли в работе: ${e.params.count}, дольше всех ${e.params.id} — ${Nm(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?`«${Em.evidence[t]}»`:`«${Em.evidence[t]}» ${Em.checkMethod[n]}`} почти всегда ошибается: точность ${r}% на ${i} решённых за ${jm(a,`day`)}`}case`low-changed`:return`Код менялся у ${Mm(e.params.count,`task`)} с низким приоритетом — перепроверьте при случае («почисти беклог»)`;case`stale-low`:return`Задач с низким приоритетом старше ${Mm(e.params.days,`day`)}: ${e.params.count} — разберите (backlog prune)`}}function Rm(e){switch(e.kind){case`bad-id`:return`некорректный ID`;case`empty-title`:return`пустой заголовок`;case`empty-name`:return`пустое имя проекта`;case`bad-prefix`:return`некорректный префикс`;case`zod`:return $p(Cm,e)}}var zm=(e,t)=>({reason:`git не доверяет ${e} (каталог принадлежит другому пользователю)`,fix:`Исправление: ${t}`}),Bm={task:`её файл`,project:`файл её проекта`},Vm={task:`его файл`,project:`файл его проекта`},Hm=(e,t)=>`${e} не загружена: не разобран ${Bm[t]}`;function Um(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-unparsed`:return`эпик ${e.epic} не загружен: не разобран ${Vm[e.fileKind]}`;case`epic-not-epic`:return`${e.epic} не является эпиком`;case`epic-foreign-project`:return`эпик ${e.epic} из другого проекта — снимите эпик или выберите эпик этого проекта`;case`epic-in-epic`:return`эпик не может входить в другой эпик`;case`epic-closed-with-open-tasks`:return`эпик закроется сам, когда закроются все его задачи — сначала закройте открытые: ${e.children.join(`, `)}`;case`reference-missing`:return`${e.id} не найдена`;case`reference-unparsed`:return Hm(e.id,e.fileKind);case`not-utf8`:return`файл не в кодировке UTF-8 — беклог его не меняет, пока его не пересохранят в UTF-8`;case`no-frontmatter`:return`файл не начинается с frontmatter (---)`;case`frontmatter-unclosed`:return`frontmatter не закрыт строкой ---`;case`yaml`:return`ошибка YAML: ${e.detail}`;case`schema`:return e.path===``?Rm(e.issue):`${e.path}: ${Rm(e.issue)}`;case`not-a-file`:return`не файл — беклог читает только обычные файлы и ссылки на них`;case`link-unreachable`:return`ссылка не ведёт к доступному файлу или каталогу`;case`task-is-link`:return`задача — ссылка; ссылки поддерживаются только для каталога проекта`;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 Wm=Zp(Um);function Gm(e){return`все задачи эпика закрыты: ${e.join(`, `)}`}function Km(e){switch(e.kind){case`references-removed`:return`${e.taskId}: убраны ссылки на несуществующие задачи: ${e.ids.join(`, `)}`;case`epic-closed`:return`${e.taskId}: эпик закрыт — ${Gm(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: эпик снова открыт — в нём открытые задачи: ${e.childIds.join(`, `)}`;case`source-moved`:return Gp(e.from)===Gp(e.to)?`${e.taskId}: source сдвинулся ${Wp(e.from)} → ${Wp(e.to)}`:`${e.taskId}: файл кода переименован, source ${e.from} → ${e.to}`}}function qm(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: не удалось исправить — ${Jm(e)}`;case`task-invalid`:return`${e.taskId}: ${Um(e.problem)}`;case`file-not-parsed`:return`Файл ${e.path} не разобран: ${Wm(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`:{let{reason:t,fix:n}=zm(e.repo,e.trustCommand);return`Проект ${e.projectId}: ${t} — коммиты и правки кода его задач не проверяются. ${n}`}case`project-history-unreadable`:return`Проект ${e.projectId}: не удалось прочитать историю git в ${e.repo} — коммиты и правки кода его задач не проверены`;case`project-branches-unreadable`:return`Проект ${e.projectId}: не удалось прочитать ветки git в ${e.repo} (битая ссылка в refs или сбой git) — пропавшие файлы кода его задач не проверены`;case`merge-state-unknown`:return`Проект ${e.projectId}: git в ${e.repo} не смог ответить, ${e.branches.length===1?`влита ли ветка`:`влиты ли ветки`} ${e.branches.join(`, `)} в текущую (неполный клон, несвязанная история или сбой git) — созданные там задачи проверены как обычные, без ожидания слияния`;case`late-commits-unknown`:return`Проект ${e.projectId}: git в ${e.repo} не смог прочитать поздние коммиты или reflog ${e.taskIds.length===1?`задачи`:`задач`} ${e.taskIds.join(`, `)} (неполный клон или сбой git) — правки их кода не проверены, проверка повторится при следующем запуске`;case`prefix-shared`:return`У проектов ${e.projectIds.join(`, `)} один префикс ${e.prefix} — ID их задач пересекаются. Смените prefix в project.md одного из них`}}function Jm(e){switch(e.cause){case`invalid`:return Wm(e.problems);case`changed-during-check`:return`файл изменился во время проверки`;case`gone-during-check`:return`файл исчез во время проверки`;case`busy-during-check`:return`файл занят другим процессом`}}var Ym={hookMark:`Беклог`,languageName:`Русский`,problem:Um,problems:Wm,taskNotLoaded:Hm,unsafeRepo:zm,schemaIssue:Rm,...Xp(Em),count:Am,days:Nm,p90:Pm,forecast:Fm,forecastTail:Im,signal:Lm,epicDoneReason:Gm,fileBusy:({path:e,lock:t,seconds:n})=>`${e} занят другим процессом дольше ${ie(`ru`,n)} с (${t})`,checkFix:Km,checkProblem:qm,runsNotTrimmed:e=>`Не удалось обрезать журнал запусков: ${e}`,journalNotCompacted:(e,t)=>`Не удалось уплотнить журнал в ${e}: ${t}`,closedNotSwept:e=>`Не удалось удалить закрытые задачи: ${e}`,serviceLogNotTrimmed:e=>`Не удалось обрезать лог службы: ${e}`,candidatesRecordFailed:(e,t)=>`Не удалось записать кандидатов в журнал ${e}: ${t}`,markCommitsReadFailed:(e,t)=>`Не удалось прочитать журнал ${e} — неизвестно, на каких коммитах задачи заводили и подтверждали: задачи из невлитых веток проверяются как обычные, а код на момент отметки берётся из reflog: ${t}`,unreadableSkipped:(e,t)=>`Не удалось прочитать ${e}, он пропущен: ${t}`,settingsNotSaved:(e,t)=>`Не удалось сохранить язык в ${e}: ${t}. Он определяется заново при каждом запуске — разрешите запись в каталог беклога.`,settingsFileInvalid:e=>`${e} не разобран, язык для этого запуска определён автоматически. Файл не изменён — поправьте его вручную.`};function Xm(e){return e===`ru`?Ym:Sm}var Zm={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`},Qm={skipLink:`Перейти к содержимому`,sidebarNav:`Навигация`,brand:`беклог`,sectionsLabel:`Разделы`,tasksNav:`Задачи`,statsNav:`Статистика`,signalsHidden:e=>`, тревог: ${e}`,collapseProjects:`Свернуть список проектов`,expandProjects:`Развернуть список проектов`,projects:`Проекты`,taskWord:e=>P(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:`Удалить`},$m=(e,t)=>`Changed ${e} of ${t}`,eh={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.`,unparsedProject:`The project file could not be parsed — its tasks are hidden until the file is fixed.`,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=>`${j(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`,epicNotLoaded:`epic not loaded`,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 ${j(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:$m,epic:$m,restore:(e,t)=>`Restored ${e} of ${t}`},notChanged:e=>`${j(e,`task`,`tasks`)} not changed`,undo:`Undo`,undoFailed:`Couldn't undo`,viewSwitch:`View`,listView:`List`,boardView:`Board`,board:`Task board`,columnCount:e=>j(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`,dragStayed:e=>`${e} stayed where it was`,dragCancelled:e=>`Moving ${e} was cancelled`,collapseTags:`collapse`,showMoreTags:e=>`Show ${e} more`},th=(e,t)=>`${P(e,`Изменена`,`Изменено`,`Изменено`)} ${e} из ${t}`,nh={docTitle:e=>`${e} — Беклог`,taskDocTitle:(e,t)=>`${e} · ${t} — Беклог`,projects:`Проекты`,autoClosed:`Закрыты агентом`,autoClosedInProject:e=>`Закрыты агентом · ${e}`,missingTask:e=>`Задачи ${e} нет — возможно, её удалили после закрытия.`,parseErrorsTitle:`Не удалось разобрать файлы:`,loadingTasks:`Загружаем задачи…`,unknownProject:`Проект не найден.`,unparsedProject:`Файл проекта не разобран — его задачи не показаны, пока файл не исправят.`,hiddenOpenNote:e=>`Ещё ${B(e,`открытая задача`,`открытые задачи`,`открытых задач`)} — в проектах без галочки.`,noTasksInScope:e=>`В учтённых проектах задач нет. ${e}`,noTasksYet:e=>[`Задач пока нет. Беклог наполняет агент: он записывает задачи командой `,e(`backlog new`),`, пока работает над кодом.`],noOpenTasksInScope:e=>`В учтённых проектах открытых задач нет. ${e}`,noOpenTasks:`Открытых задач нет.`,showAllStatuses:`Показать все статусы`,noMatches:`Под фильтры ничего не подходит.`,resetFilters:`Сбросить фильтры`,taskCount:e=>`В списке ${B(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:`эпик не найден`,epicNotLoaded:`эпик не загружен`,anyEpicLabel:`любой`,noEpicLabel:`без эпика`,selectTask:e=>`Выбрать ${e}`,selectAllVisible:`Выбрать все видимые`,selectionKeysHint:e=>`Пробел на задаче — выбрать её, Shift+Пробел — выбрать диапазон, ${e} — к действиям с выбранными`,toActionsHint:e=>`${e} — к действиям`,selectionActions:`Действия с выбранными`,selectedCount:e=>`Выбрано ${e}`,hiddenByFilter:e=>`(${e} ${P(e,`скрыта`,`скрыты`,`скрыто`)} фильтром)`,closeAsObsolete:`Закрыть как неактуальные`,closeDialogTitle:e=>`Закрыть ${B(e,`задачу`,`задачи`,`задач`)} как неактуальные?`,closeDialogDescription:e=>`Статус станет «${e}», причина запишется в каждую задачу.`,closeReason:`Причина`,closeConfirm:e=>`Закрыть ${e}`,epic:`Эпик`,removeFromEpic:`Вынуть из эпика`,mixedProjects:`Задачи из разных проектов`,clearSelection:`Снять выбор`,bulkFailed:`Не удалось изменить задачи`,batchSummary:{close:(e,t)=>`${P(e,`Закрыта`,`Закрыто`,`Закрыто`)} ${e} из ${t}`,priority:th,epic:th,restore:(e,t)=>`${P(e,`Возвращена`,`Возвращено`,`Возвращено`)} ${e} из ${t}`},notChanged:e=>`${P(e,`Не изменена`,`Не изменены`,`Не изменено`)} ${e} ${P(e,`задача`,`задачи`,`задач`)}`,undo:`Отменить`,undoFailed:`Не удалось отменить`,viewSwitch:`Вид`,listView:`Список`,boardView:`Доска`,board:`Доска задач`,columnCount:e=>B(e,`задача`,`задачи`,`задач`),emptyColumn:`Перетащите сюда задачу`,closedHidden:`Закрытые скрыты фильтром — перетащите сюда, чтобы закрыть`,moved:(e,t)=>`${e}: статус «${t}»`,moveFailed:e=>`Не удалось перенести ${e}`,dragInstructions:`Пробел — взять задачу, стрелки влево и вправо — выбрать колонку, пробел — положить, Esc — отменить.`,dragStarted:e=>`Задача ${e} взята`,dragOver:(e,t)=>`${e} над колонкой «${t}»`,dragStayed:e=>`${e} осталась на месте`,dragCancelled:e=>`Перенос ${e} отменён`,collapseTags:`свернуть`,showMoreTags:e=>`Показать ещё ${e}`},rh=e=>j(e,`day`,`days`),ih={day:`day`,week:`week`,sample:`sample`},ah={week:[`week`,`weeks`],day:[`day`,`days`]},oh={week:`a week`,day:`a day`},sh={week:`since the week of`,day:`since`},ch={week:`in the latest week with decisions`,day:`on the last day with decisions`},lh=(e,t)=>j(t,...ah[e]),uh=e=>j(e,`task`,`tasks`),dh=e=>j(e,`token`,`tokens`);function fh({formatted:e,count:t}){return`${e} ${ge(t,`line`,`lines`)}`}function ph(e){let t=rh(e.churnDays),n=j(e.statsWeeks,`week`,`weeks`),r=j(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:rh(e.statsDays),lastWeek:rh(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`now`,chartLabel:(e,t)=>`${e}. Left and right arrows move by ${ih[t]}`,onRightScale:e=>`${e} (right scale)`,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})=>`${lh(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,average:r})=>{let i=lh(e,t);if(n===0)return`${i}: no tasks created`;if(r===null)return`${i}: created ${n}`;let a=r.since===null?``:` ${sh[e]} ${F(`en`,r.since)}`;return`${i}: created ${n}, on average ${ue(`en`,r.perPeriod)} ${oh[e]}${a}`},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=>j(e,`commit`,`commits`),churnTasks:(e,t)=>`${uh(e)}, weight ${t}`,densityTitle:`Debt density`,perKloc:e=>`${ue(`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`],modelAccuracyTitle:`Precision by model`,modelAccuracyTable:e=>`Precision by model, ${e}`,modelAccuracyColumn:`Model`,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?`${lh(e,t)}: no decided candidates`:`${lh(e,t)}: decided ${n}, precision ${ch[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:fh,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}: ${j(e,`line`,`lines`)} in pull requests, deferred ${t}, noise without backlog ${n}`,effectDaysSummary:(e,t,n)=>`Over ${lh(`day`,e)}: ${j(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)=>`${uh(e)} — ${fh(t)}`,noPending:`nothing pending`,pendingWithoutEstimate:e=>`${uh(e)}, ${a}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${uh(e)} ${fh(t)}, on average ${n} per task`,noiseMissing:{"no-repos":`the project has no repositories — add repos to project.md`,"no-lines":`no code lines in pull requests since adoption`,"no-deferred-tasks":`no tasks deferred yet — nothing to measure`,"estimate-pending":a},noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Counting usage from Claude Code and Codex transcripts…`,noTranscripts:`No Claude Code or Codex transcripts found.`,scanProgress:(e,t)=>`Counting usage from Claude Code and Codex transcripts: read ${e} of ${j(t,`file`,`files`)}`,costNote:`Backlog usage comes from Claude Code and Codex transcripts. Tokens for turns started by the Stop hook come from the logs. Command and skill output is estimated from text length. Cost uses standard Anthropic and OpenAI API prices. Your subscription may cost differently.`,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=>`${ue(`en`,e)} MiB`,milliseconds:e=>`${k(`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:dh,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,money:i,hookRuns:a,cliRuns:o})=>`Over ${lh(e,t)}: due to the hook ${dh(n)}, CLI output and skill ${r}, at API prices ${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 mh=e=>B(e,`день`,`дня`,`дней`),hh={day:`дням`,week:`неделям`,sample:`замерам`},gh={week:[`неделя`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},_h={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},vh={week:`в неделю`,day:`в день`},yh={week:`с\xA0недели`,day:`с`},bh={week:`на последней неделе с решениями`,day:`в последний день с решениями`},xh=(e,t)=>B(t,...gh[e]),Sh=e=>B(e,`задача`,`задачи`,`задач`),Ch=e=>B(e,`токен`,`токена`,`токенов`);function wh({formatted:e,count:t}){return`${e} ${P(t,`строка`,`строки`,`строк`)}`}function Th(e){let t=mh(e.churnDays),n=B(e.statsWeeks,`неделю`,`недели`,`недель`),r=B(e.statsWeeks,`недели`,`недель`,`недель`),i=B(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:B(e.statsWeeks,`неделя`,`недели`,`недель`),days:mh(e.statsDays),lastWeek:mh(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`сейчас`,chartLabel:(e,t)=>`${e}. Стрелки влево и вправо — по ${hh[t]}`,onRightScale:e=>`${e} (шкала справа)`,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})=>`${xh(e,t)}: создано ${n}, закрыто ${r}, открыто сейчас ${i}`,createdBy:{week:`Создано по неделям`,day:`Создано по дням`},createdTasks:`создано задач`,intakeSummary:({grain:e,periodCount:t,created:n,average:r})=>{let i=xh(e,t);if(n===0)return`${i}: задач не создавали`;if(r===null)return`${i}: создано ${n}`;let a=r.since===null?``:` ${yh[e]} ${F(`ru`,r.since)}`;return`${i}: создано ${n}, в среднем ${ue(`ru`,r.perPeriod)} ${vh[e]}${a}`},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=>B(e,`коммит`,`коммита`,`коммитов`),churnTasks:(e,t)=>`${Sh(e)}, вес ${t}`,densityTitle:`Плотность долга`,perKloc:e=>`${ue(`ru`,e)} на 1000 строк`,accuracyTitle:`Точность проверки`,noCandidates:`Проверка ещё не находила кандидатов`,accuracyHint:`Доля кандидатов проверки, после которых задача закрылась; остальные подтверждены как актуальные`,accuracyTable:e=>`Точность проверки, ${e}`,accuracyHead:[`Улика`,`Кандидатов`,`Закрыто`,`Подтверждено`,`Без решения`,`Точность`],modelAccuracyTitle:`Точность по моделям`,modelAccuracyTable:e=>`Точность по моделям, ${e}`,modelAccuracyColumn:`Модель`,splitRow:e=>`└ из них ${e}`,beforeMethodRecorded:`до записи способа`,checkedBy:e=>`проверено ${e}`,beforeMatchRecorded:`до записи признака`,matchedBy:e=>`совпали ${e}`,decidedCandidates:`решено кандидатов`,precision:`точность`,accuracySummary:({grain:e,periodCount:t,decided:n,latestPrecision:r})=>r===null?`${xh(e,t)}: решённых кандидатов нет`:`${xh(e,t)}: решено ${n}, точность ${bh[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:wh,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}: в пулреквестах ${B(e,`строка`,`строки`,`строк`)}, вынесено ${t}, шум без беклога ${n}`,effectDaysSummary:(e,t,n)=>`За ${xh(`day`,e)}: по теме пулреквестов ${B(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)=>`${Sh(e)} — ${wh(t)}`,noPending:`ожидающих нет`,pendingWithoutEstimate:e=>`${Sh(e)}, ${o}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${Sh(e)} ${wh(t)}, в среднем ${n} на задачу`,noiseMissing:{"no-repos":`у проекта нет репозиториев — добавьте repos в project.md`,"no-lines":`после внедрения нет строк кода в пулреквестах`,"no-deferred-tasks":`вынесенных задач пока нет — считать не из чего`,"estimate-pending":o},noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Считаем расход по расшифровкам Claude Code и Codex…`,noTranscripts:`Расшифровки Claude Code и Codex не найдены.`,scanProgress:(e,t)=>`Считаем расход по расшифровкам Claude Code и Codex: прочитано ${e} из ${B(t,`файла`,`файлов`,`файлов`)}`,costNote:`Расходы беклога считаются по расшифровкам Claude Code и Codex. Токены ходов, запущенных Stop-хуком, берутся из журнала, а вывод команд и скилла оценивается по длине текста. Стоимость рассчитывается по стандартным ценам API Anthropic и OpenAI. У подписки может быть другая стоимость.`,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=>`${ue(`ru`,e)} МиБ`,milliseconds:e=>`${k(`ru`,e)} мс`,spendBy:{week:`Расход по неделям`,day:`Расход по дням`},hookTurnTokens:`токены ходов хука`,cliOutputTokens:`токены вывода CLI и скилла`,hookRuns:`запуски хука`,otherCommands:`другие команды`,hookTurnsTooltip:`ходы хука`,cliOutput:`вывод CLI и скилл`,apiPriceTooltip:`по ценам API`,tokens:Ch,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,money:i,hookRuns:a,cliRuns:o})=>`За ${B(t,..._h[e])}: из-за хука ${Ch(n)}, вывод CLI и скилл ${r}, по ценам API ${i}; запусков хука ${a}, других команд ${o}`,serverMemory:`Память сервера`,memoryRestartNote:`После перезапуска сервера история начинается заново`,memorySummary:(e,t)=>`Сейчас ${e}, максимум за ${i} ${t}`,processMemory:`память процесса`,jsHeap:`куча JavaScript`}}var Eh=5e3,Dh=x,Oh=[`test`,`tests`,`__tests__`,`e2e`,`spec`],kh=[{glob:`*.test.*`,pattern:/\.test\./},{glob:`*.spec.*`,pattern:/\.spec\./},{glob:`*_test.*`,pattern:/_test\./},{glob:`test_*.py`,pattern:/^test_.+\.py$/}].map(({glob:e})=>e),Ah=/^\s*[-*+]\s+\[(?<mark>[ xX])\]\s+(?<text>.*)$/,jh=/^\s{0,3}(?<fence>`{3,}|~{3,})/;function Mh(e){let t=[],n=null;for(let[r,i]of e.split(`
72
+ <%s key={someKey} {...props} />`,o,p,m,p),ne[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=dc(),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.view_transition`),k=Symbol.for(`react.client.reference`),A=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var P,ee={},F=m.react_stack_bottom_frame.bind(m,o)(),te=N(i(o)),ne={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=F;return d(e,t,n,!1,o,r?N(i(e)):te)},e.jsxs=function(e,t,n){var r=1e4>A.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=F;return d(e,t,n,!0,o,r?N(i(e)):te)}})()})),pc=Ne(((e,t)=>{t.exports=fc()})),X=Ie(dc(),1),mc=pc(),hc=X.createContext(void 0),gc=e=>{let t=X.useContext(hc);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},_c=({client:e,children:t})=>(X.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,mc.jsx)(hc.Provider,{value:e,children:t})),vc={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},yc=new class{#e=vc;#t=!1;setTimeoutProvider(e){this.#t&&e!==this.#e&&console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,{previous:this.#e,provider:e}),this.#e=e,this.#t=!1}setTimeout(e,t){return this.#t=!0,this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#t=!0,this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function bc(e){setTimeout(e,0)}var xc=typeof window>`u`||`Deno`in globalThis;function Sc(){}function Cc(e,t){return typeof e==`function`?e(t):e}function wc(e){return typeof e==`number`&&e>=0&&e!==1/0}function Tc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Z(e,t){return typeof e==`function`?e(t):e}function Ec(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Oc(o,t.options))return!1}else if(!Ac(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 Dc(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(kc(t.options.mutationKey)!==kc(a))return!1}else if(!Ac(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Oc(e,t){return(t?.queryKeyHashFn||kc)(e)}function kc(e){return JSON.stringify(e,(e,t)=>Fc(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ac(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(!Ac(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Ac(e[r],t[r]))return!1;return!0}return!1}var jc=Object.prototype.hasOwnProperty;function Mc(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Pc(e)&&Pc(t);if(!r&&!(Fc(e)&&Fc(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:jc.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Mc(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Nc(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 Pc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fc(e){if(!Ic(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!(!Ic(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Ic(e){return Object.prototype.toString.call(e)===`[object Object]`}function Lc(e){return new Promise(t=>{yc.setTimeout(t,e)})}function Rc(e,t,n){if(typeof n.structuralSharing==`function`)return n.structuralSharing(e,t);if(n.structuralSharing!==!1)try{return Mc(e,t)}catch(e){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`),e}return t}function zc(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Bc(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Vc=Symbol();function Hc(e,t){return e.queryFn===Vc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Vc?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Uc(e,t){return typeof e==`function`?e(...t):!!e}function Wc(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Gc=()=>xc,Kc=()=>Gc(),qc=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(){}},Jc=new class extends qc{#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`}},Yc=bc;function Xc(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Yc,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=Xc(),Qc=new class extends qc{#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 $c(e){return Math.min(1e3*2**e,3e4)}function el(e){return(e??`online`)!==`online`||Qc.isOnline()}var tl=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function nl(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Sc);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new tl(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Jc.isFocused()&&(e.networkMode===`always`||Qc.isOnline())&&e.canRun(),p=()=>el(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??(Kc()?0:3),a=e.retryDelay??$c,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Lc(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 rl=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wc(this.gcTime)&&(this.#e=yc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kc()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(yc.clearTimeout(this.#e),this.#e=void 0)}};function il(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=>{Wc(e,()=>t.signal,()=>n=!0)},u=Hc(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?Bc:zc;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ol:al,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:al(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 al(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 ol(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var sl=class extends rl{#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=ul(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=ul(this.options);e.data!==void 0&&(this.setState(ll(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Rc(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(Sc).catch(Sc):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=>Z(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Z(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:!Tc(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)}Array.isArray(this.options.queryKey)||console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Hc(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`?il(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=nl({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof tl&&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 console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),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 tl){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,...cl(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ll(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 cl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:el(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ll(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ul(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 dl=class extends qc{#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),pl(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ml(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ml(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 Z(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&&!Nc(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&hl(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Z(this.options.enabled,this.#t)!==Z(t.enabled,this.#t)||Z(this.options.staleTime,this.#t)!==Z(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Z(this.options.enabled,this.#t)!==Z(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 Nc(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(Sc)),t}#h(e){return!Kc()&&Z(this.options.enabled,this.#t)!==!1&&wc(e)}#g(){this.#b();let e=Z(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Tc(this.#r.dataUpdatedAt,e)+1;this.#u=yc.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Z(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=yc.setInterval(()=>{(this.options.refetchIntervalInBackground||Jc.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(yc.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(yc.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&&pl(e,t),o=i&&hl(e,n,t,r);(a||o)&&(l={...l,...cl(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=Rc(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=Rc(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:gl(e,t),refetch:this.refetch,isEnabled:Z(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),Nc(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 fl(e,t){return Z(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Z(t.retryOnMount,e)!==!1)}function pl(e,t){return fl(e,t)||e.state.data!==void 0&&ml(e,t,t.refetchOnMount)}function ml(e,t,n){if(Z(t.enabled,e)!==!1&&Z(t.staleTime,e)!==`static`){let r=Z(n,e);return r===`always`||r!==!1&&gl(e,t)}return!1}function hl(e,t,n,r){return(e!==t||Z(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&gl(e,n)}function gl(e,t){return Z(t.enabled,e)!==!1&&e.isStaleByTime(Z(t.staleTime,e))}var _l=class extends rl{#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||vl(),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=nl({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 vl(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var yl=class extends qc{#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),Nc(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&kc(t.mutationKey)!==kc(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??vl();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)})})}},bl=X.createContext(!1),xl=()=>X.useContext(bl);bl.Provider;function Sl(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Cl=X.createContext(Sl()),wl=()=>X.useContext(Cl),Tl=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Uc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},El=e=>{X.useEffect(()=>{e.clearReset()},[e])},Dl=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Uc(n,[e.error,r])),Ol=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))}},kl=(e,t)=>e?.suspense&&t.isPending,Al=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function jl(e,t,n){if(typeof e!=`object`||Array.isArray(e))throw Error(`Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object`);let r=xl(),i=wl(),a=gc(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash);o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);let c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ol(o),Tl(o,i,s),El(i);let[l]=X.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(X.useSyncExternalStore(X.useCallback(e=>{let t=d?l.subscribe(Zc.batchCalls(e)):Sc;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),X.useEffect(()=>{l.setOptions(o)},[o,l]),kl(o,u))throw Al(o,l,i);if(Dl({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Ml(e,t){return jl(e,dl,t)}function Nl(e,t){let n=gc(t),[r]=X.useState(()=>new yl(n,e));X.useEffect(()=>{r.setOptions(e)},[r,e]);let i=X.useSyncExternalStore(X.useCallback(e=>r.subscribe(Zc.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=X.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Sc)},[r]);if(i.error&&Uc(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Pl=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Fl=/^[\\/]{2}/;function Il(e,t){return t+e.replace(/\\/g,`/`)}var Ll=`popstate`;function Rl(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function zl(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Hl(``,{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:Ul(t)}return Gl(t,n,null,e)}function Q(e,t){if(e===!1||e==null)throw Error(t)}function $(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Bl(){return Math.random().toString(36).substring(2,10)}function Vl(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 Hl(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Wl(t):t,state:n,key:t&&t.key||r||Bl(),mask:i}}function Ul({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 Wl(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 Gl(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=Rl(e)?e:Hl(h.location,e,t);n&&n(r,e),l=u()+1;let d=Vl(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=Rl(e)?e:Hl(h.location,e,t);n&&n(r,e),l=u();let i=Vl(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 Kl(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(Ll,d),c=e,()=>{i.removeEventListener(Ll,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 Kl(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Q(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ul(t);return i=i.replace(/ $/,`%20`),!n&&Fl.test(i)&&(i=r+i),new URL(i,r)}var ql=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)}},Jl=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function Yl(e){return Jl.has(e)}var Xl=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function Zl(e){return Xl.has(e)}function Ql(e){return e.index===!0}function $l(e){let t={};return e.Component&&(e.element&&$(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:X.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&$(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:X.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&$(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:X.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}function eu(e,t=$l,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(Q(e.index!==!0||!e.children,`Cannot specify children on an index route`),Q(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Ql(e)){let n={...e,id:s};return r[s]=tu(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=tu(n,t(n)),e.children&&(n.children=eu(e.children,t,o,r,i)),n}})}function tu(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function nu(e,t,n=`/`){return ru(e,t,n,!1)}function ru(e,t,n,r,i){let a=Tu((typeof t==`string`?Wl(t):t).pathname||`/`,n);if(a==null)return null;let o=i??au(e),s=null,c=wu(a);for(let e=0;s==null&&e<o.length;++e)s=bu(o[e],c,r);return s}function iu(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 au(e){let t=ou(e);return cu(t),t}function ou(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;Q(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=Fu([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Q(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ou(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:vu(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Cu(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 su(e.path))a(e,t,!0,n)}),t}function su(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=su(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 cu(e){e.sort((e,t)=>e.score===t.score?yu(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var lu=/^:[\w-]+$/,uu=/^:[\w-]+/,du=3.5,fu=3,pu=2,mu=1,hu=10,gu=-2,_u=e=>e===`*`;function vu(e,t){let n=e.split(`/`),r=n.length;return n.some(_u)&&(r+=gu),t&&(r+=pu),n.filter(e=>!_u(e)).reduce((e,t)=>e+(lu.test(t)?fu:uu.test(t)?du:t===``?mu:hu),r)}function yu(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 bu(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?Su(u,l,s.matcher,s.compiledParams):xu(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=xu({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Fu([a,d.pathname]),pathnameBase:Lu(Fu([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Fu([a,d.pathnameBase]))}return o}function xu(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Cu(e.path,e.caseSensitive,e.end);return Su(e,t,n,r)}function Su(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Iu(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Iu(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 Cu(e,t=!1,n=!0){$(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 wu(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return $(!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 Tu(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 Eu({basename:e,pathname:t}){return t===`/`?e:Fu([e,t])}var Du=e=>Pl.test(e);function Ou(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Wl(e):e,a;return n?(n=Pu(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?ku(n.substring(1),`/`):ku(n,t)):a=t,{pathname:a,search:Ru(r),hash:zu(i)}}function ku(e,t){let n=Iu(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Au(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 ju(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Mu(e){let t=ju(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Nu(e,t,n,r=!1){let i;typeof e==`string`?i=Wl(e):(i={...e},Q(!i.pathname||!i.pathname.includes(`?`),Au(`?`,`pathname`,`search`,i)),Q(!i.pathname||!i.pathname.includes(`#`),Au(`#`,`pathname`,`hash`,i)),Q(!i.search||!i.search.includes(`#`),Au(`#`,`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=Ou(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Pu=e=>e.replace(/[\\/]{2,}/g,`/`),Fu=e=>Pu(e.join(`/`));function Iu(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 Lu=e=>Iu(e).replace(/^\/*/,`/`),Ru=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,zu=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Bu=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Vu=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 Hu(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Uu(e){return Fu(e.map(e=>e.route.path).filter(Boolean))||`/`}function Wu(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?Wl(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 Gu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ku(e,t){let n=e;if(typeof n!=`string`||!Pl.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Gu)try{let e=new URL(window.location.href),r=Fl.test(n)?new URL(Il(n,e.protocol)):new URL(n),a=Tu(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{$(!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 qu=Symbol(`Uninstrumented`),Ju=new WeakMap;function Yu(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)=>td(await nd(n.lazy,void 0,()=>e(...t),rd))}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)=>td(await nd(n[`lazy.middleware`],void 0,()=>t(...e),rd))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>td(await nd(n[`lazy.loader`],void 0,()=>t(...e),rd))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>td(await nd(n[`lazy.action`],void 0,()=>t(...e),rd))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Zu(t.loader),i=async(...t)=>td(await nd(n.loader,id(t[0]),()=>e(...t),rd));e.hydrate===!0&&(i.hydrate=!0),Qu(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Zu(t.action),i=async(...t)=>td(await nd(n.action,id(t[0]),()=>e(...t),rd));Qu(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Zu(e),r=async(...e)=>td(await nd(n.middleware,id(e[0]),()=>t(...e),rd));return Qu(r,t),r})),r}function Xu(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=Zu(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?Ul(i):`.`,...ad(e,a??{})};return td(await nd(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=$u(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...rd(e),meta:o})))};Qu(r,t),e.navigate=r}if(n.fetch.length>0){let t=Zu(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return td(await nd(n.fetch,{href:o??`.`,fetcherKey:i,...ad(e,s??{})},async()=>{let n=$u(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...rd(e),meta:c})))};Qu(r,t),e.fetch=r}return e}function Zu(e){return e[qu]??e}function Qu(e,t){e[qu]=t}function $u(e,t){return Ju.set(e,t),()=>{Ju.get(e)===t&&Ju.delete(e)}}function ed(e){let t=Ju.get(e);return Ju.delete(e),t}function td(e){if(e.type===`error`)throw e.value;return e.value}async function nd(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=nd(e,t,n,r,i,a-1),await s,Q(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={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function rd(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function id(e){let{request:t,context:n,params:r}=e;return{...e,request:od(t),params:{...r},context:sd(n)}}function ad(e,t){return{currentUrl:Ul(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 od(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function sd(e){return{get:t=>e.get(t)}}var cd=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=au(e)}match(e,t=!1){return ru(this.#e,e,this.#n,t,this.#t)}},ld=new URL(`http://localhost`);function ud(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ld)}catch{return ld}}function dd(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function fd(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 pd(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&&!dd(i,n),s=!dd(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!fd(e,i)||!dd(i,a)))throw Error(`External navigation is not allowed`)}var md=[`POST`,`PUT`,`PATCH`,`DELETE`],hd=new Set(md),gd=[`GET`,...md],_d=new Set(gd),vd=new Set([301,302,303,307,308]),yd=new Set([307,308]),bd={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},xd={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Sd={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Cd=`remix-router-transitions`,wd=Symbol(`ResetLoaderData`);function Td(e,t){return e.unstable_routePatternMatching?(Q(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new cd(t)}var Ed=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 Dd(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;Q(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),...Yu(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=Td(o,s),l={},u=new Ed(eu(e.routes,a,void 0,l),c),d=e.dataStrategy||Wd,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=hf(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=mf(u.activeRoutes);S=!0,C=!S,y=n,x={[r.id]:t}}else if(y&&!e.hydrationData&&He(y,e.history.location.pathname).active&&(y=null),!y){S=!1,C=!S,y=[];let t=He(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=>Md(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=Nd(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:bd,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,O=!1,k,A=!1,j=new Map,M=null,N=!1,P=!1,ee=new Set,F=new Map,te=0,ne=-1,re=new Map,I=new Set,ie=new Map,ae=new Map,oe=new Set,se=new Map,ce,L=null;function R(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(ce){ce(),ce=void 0;return}$(se.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=Ie({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{ce=e});e.history.go(r*-1),Fe(i,{state:`blocked`,location:n,proceed(){Fe(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,Sd),z({blockers:e})}}),D?.resolve(),D=null}else return pe(t,n)}),n){Bf(t,j);let e=()=>Vf(t,j);t.addEventListener(`pagehide`,e),M=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||pe(`POP`,T.location,{initialHydration:!0}),w}function le(){f&&f(),M&&M(),p.clear(),k&&k.abort(),T.fetchers.forEach((e,t)=>De(T.fetchers,t)),T.blockers.forEach((e,t)=>Pe(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`&&(oe.has(t)?n.push(t):r.push(t))}),oe.forEach(e=>{!T.fetchers.has(e)&&!F.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=>De(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&&Af(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?df(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,s=T.blockers;s.size>0&&!N&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Sd)));let c=!N&&Ve(t,n.matches||T.matches),l=O===!0||T.navigation.formMethod!=null&&Af(T.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),N||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!N&&t!==T.location){let e=j.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:j.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(A){let e=j.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),j.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:bd,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,O=!1,A=!1,N=!1,P=!1,D?.resolve(),D=null,L?.resolve(),L=null}async function B(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=Hf();let n=D.promise;return e.history.go(t),n}let r=ed(w),{path:i,submission:a,error:o}=Ad(!1,kd(T.location,T.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?Wl(n.mask):{...T.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},Fl.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),pd(typeof n.mask==`string`?n.mask:Ul(n.mask),Ul(c),e.history.createURL(`/`),`reject`)}let l=T.location,u=Hl(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},pd(t==null?e.history.createHref(T.location):typeof t==`string`?t:Ul(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&&Af(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=Ie({currentLocation:l,nextLocation:u,historyAction:f});h?Fe(h,{state:`blocked`,location:u,proceed(){Fe(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),B(t,n)},reset(){let e=new Map(T.blockers);e.set(h,Sd),z({blockers:e})}}):await pe(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 fe(){L||=Hf(),Se(),z({revalidation:`loading`});let e=L.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(pe(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(pe(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:A===!0}),e)}async function pe(t,n,r){k&&k.abort(),k=null,E=t,N=(r&&r.startUninterruptedRevalidation)===!0,Be(T.location,T.matches),O=(r&&r.preventScrollReset)===!0,A=(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&&!P&&vf(T.location,n)&&!(r&&r.submission&&Af(r.submission.formMethod))){de(n,{matches:i},{flushSync:a});return}let o=He(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=Nf(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=Le(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;k=new AbortController;let l=of(e.history,n,k.signal,r&&r.submission),u=e.getContext?await e.getContext():new ql,d;if(r&&r.pendingError)d=[pf(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Af(r.submission.formMethod)){let c=await V(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(Cf(t)&&Hu(t.error)&&t.error.status===404){k=null,de(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,d=c.pendingActionResult,s=Ff(n,i,t,r.submission),a=!1,o.active=!1,l=of(e.history,l.url,l.signal)}let{shortCircuited:f,matches:p,loaderData:m,errors:h,workingFetchers:g}=await me(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||(k=null,de(n,{matches:p||i,...ff(d),loaderData:m,errors:h,...g?{fetchers:g}:{}}))}async function V(t,n,i,o,c,d,f,p,m={}){if(Se(),z({navigation:If(n,o,c,i)},{flushSync:m.flushSync===!0}),f){let e=await Ue(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}=mf(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=pf(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}=Le(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Mf(o,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:hf(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await be(t,n,Xd(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(wf(h)){let n;return n=m&&m.replace!=null?m.replace:af(h.response.headers.get(`Location`),new URL(t.url),s,e.history)===T.location.pathname+T.location.search,await ye(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Cf(h)){let e=pf(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 me(t,n,i,o,s,d,f,p,m,h,g,_,v,y){let b=f||Ff(n,i,o,p),x=p||m||Pf(b),S=!N&&!g;if(d){if(S){let e=he(v);z({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Ue(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}=mf(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=pf(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}=Le(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let{dsMatches:C,revalidatingFetchers:w}=jd(t,s,a,l,e.history,T,i,x,n,g?[]:r,g===!0,P,ee,oe,ie,I,c,v,y);if(ne=++te,!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=je(e);return de(n,{matches:i,loaderData:{},errors:v&&Cf(v[1])?{[v[0]]:v[1].error}:null,...ff(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=he(v);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=ge(w)),z(e,{flushSync:_})}w.forEach(e=>{ke(e.key),e.controller&&F.set(e.key,e.controller)});let E=()=>w.forEach(e=>ke(e.key));k&&k.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await xe(C,w,t,n,s);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener(`abort`,E),w.forEach(e=>F.delete(e.key));let A=gf(D);if(A)return await ye(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=gf(O),A)return I.add(A.key),await ye(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(T.fetchers),{loaderData:M,errors:re}=uf(T,i,D,v,w,O,j);g&&T.errors&&(re={...T.errors,...re});let ae=je(j),se=Me(ne,j),ce=ae||se||w.length>0;return{matches:i,loaderData:M,errors:re,...ce?{workingFetchers:j}:{}}}function he(e){if(e&&!Cf(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function ge(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Lf(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function H(t,n,r,i){ke(t);let a=(i&&i.flushSync)===!0,o=ed(w),l=kd(T.location,T.matches,s,r,n,i?.relative),u=c.match(l),d=He(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(Nf(e.history,l,u)),!u){we(t,n,hf(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Ad(!0,l,i);if(m){we(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new ql,g=(i&&i.preventScrollReset)===!0;if(p&&Af(p.formMethod)){await _e(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};ie.set(t,_),await ve(t,_,u,h,a,g,p)}async function _e(t,n,i,o,s,u,d,f,p,m){Se(),ie.delete(t),Ce(t,Rf(p,T.fetchers.get(t)),{flushSync:d});let h=new AbortController,g=of(e.history,i,h.signal,p);if(u){let e=await Ue(o,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:d});return}if(e.matches)o=e.matches;else{we(t,n,hf(404,{pathname:i}),{flushSync:d});return}}let _=Mf(o,i);if(!_.route.action&&!_.route.lazy){we(t,n,hf(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:d});return}F.set(t,h);let v=te,y=Xd(a,l,g,i,o,_,r,s),b=await be(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){F.get(t)===h&&F.delete(t);return}if(oe.has(t)){if(wf(x)||Cf(x)){Ce(t,zf(void 0));return}}else{if(wf(x)){if(F.delete(t),ne>v){Ce(t,zf(void 0));return}return I.add(t),Ce(t,Lf(p)),ye(g,x,!1,{fetcherSubmission:p,preventScrollReset:f})}if(Cf(x)){we(t,n,x.error);return}}let S=T.navigation.location||T.location,C=of(e.history,S,h.signal),w=T.navigation.state===`idle`?T.matches:c.match(T.navigation.location);Q(w,`Didn't find any matches after fetcher action`);let D=++te;re.set(t,D);let{dsMatches:O,revalidatingFetchers:A}=jd(C,s,a,l,e.history,T,w,p,S,r,!1,P,ee,oe,ie,I,c,[_.route.id,x],m),j=Lf(p,x.data),M=new Map(T.fetchers);M.set(t,j),A.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=M.get(t),r=Lf(void 0,n?n.data:void 0);M.set(t,r),ke(t),e.controller&&F.set(t,e.controller)}),z({fetchers:M});let N=()=>A.forEach(e=>ke(e.key));h.signal.addEventListener(`abort`,N);let{loaderResults:ae,fetcherResults:se}=await xe(O,A,C,S,s);if(h.signal.aborted){re.get(t)===D&&re.delete(t);return}h.signal.removeEventListener(`abort`,N),re.delete(t),F.delete(t),A.forEach(e=>F.delete(e.key));let ce=T.fetchers.has(t),L=e=>{if(!ce)return e;let n=new Map(e.fetchers);return n.set(t,zf(x.data)),{...e,fetchers:n}},R=gf(ae);if(R)return T=L(T),ye(C,R.result,!1,{preventScrollReset:f});if(R=gf(se),R)return I.add(R.key),T=L(T),ye(C,R.result,!1,{preventScrollReset:f});let le=new Map(T.fetchers);ce&&le.set(t,zf(x.data));let{loaderData:ue,errors:B}=uf(T,w,ae,void 0,A,se,le);Me(D,le),T.navigation.state===`loading`&&D>ne?(Q(E,`Expected pending action`),k&&k.abort(),de(T.navigation.location,{matches:w,loaderData:ue,errors:B,fetchers:le})):(z({errors:B,loaderData:df(T.loaderData,ue,w,B),fetchers:le}),P=!1)}async function ve(t,n,i,o,s,c,u){let{routeId:d,path:f}=n,p=T.fetchers.get(t);Ce(t,Lf(u,p?p.data:void 0),{flushSync:s});let m=new AbortController,h=of(e.history,f,m.signal);if(n.isDiscovering){let e=await Ue(i,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,d,e.error,{flushSync:s});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{we(t,d,hf(404,{pathname:f}),{flushSync:s});return}}let g=Mf(i,f);F.set(t,m);let _=te,v=await be(h,f,Xd(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(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(oe.has(t))Ce(t,zf(void 0));else{if(wf(y)){if(ne>_){Ce(t,zf(void 0));return}I.add(t),await ye(h,y,!1,{preventScrollReset:c});return}Cf(y)?we(t,d,y.error):Ce(t,zf(y.data))}}}async function ye(r,i,a,{submission:o,fetcherSubmission:c,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(P=!0);let d=i.response.headers.get(`Location`);Q(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=af(d,p,s,e.history),pd(f,d,p,`allow-explicit`);let m=Hl(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Du(d)){let n=Kl(t,d,!0);e=n.origin!==t.location.origin||Tu(n.pathname,s)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}k=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=Pf(T.navigation));let y=o||c;yd.has(i.response.status)&&y&&Af(y.formMethod)?await pe(h,m,{submission:{...y,formAction:d},preventScrollReset:l||O,enableViewTransition:a?A:void 0}):await pe(h,m,{overrideNavigation:Ff(m,[],h,o),fetcherSubmission:c,preventScrollReset:l||O,enableViewTransition:a?A:void 0})}async function be(e,t,n,r,i){let a,o={};try{a=await Zd(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(!Af(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(Sf(r)){let i=r.result;o[t]={type:`redirect`,response:tf(i,e,t,n,s)}}else o[t]=await ef(r);return o}async function xe(e,t,n,r,i){let a=be(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await be(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:hf(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Se(){P=!0,ie.forEach((e,t)=>{F.has(t)&&ee.add(t),ke(t)})}function Ce(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),z({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function we(e,t,n,r={}){let i=pf(T.matches,t),a=new Map(T.fetchers);De(a,e),z({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Te(e){return ae.set(e,(ae.get(e)||0)+1),oe.has(e)&&oe.delete(e),T.fetchers.get(e)||xd}function Ee(e,t){ke(e,t?.reason),Ce(e,zf(null))}function De(e,t){let n=T.fetchers.get(t);F.has(t)&&!(n&&n.state===`loading`&&re.has(t))&&ke(t),ie.delete(t),re.delete(t),I.delete(t),oe.delete(t),ee.delete(t),e.delete(t)}function Oe(e){let t=(ae.get(e)||0)-1;t<=0?(ae.delete(e),oe.add(e)):ae.set(e,t),z({fetchers:new Map(T.fetchers)})}function ke(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function Ae(e,t){for(let n of e){let e=t.get(n);Q(e,`Expected fetcher: ${n}`);let r=zf(e.data);t.set(n,r)}}function je(e){let t=[],n=!1;for(let r of I){let i=e.get(r);Q(i,`Expected fetcher: ${r}`),i.state===`loading`&&(I.delete(r),t.push(r),n=!0)}return Ae(t,e),n}function Me(e,t){let n=[];for(let[r,i]of re)if(i<e){let e=t.get(r);Q(e,`Expected fetcher: ${r}`),e.state===`loading`&&(ke(r),re.delete(r),n.push(r))}return Ae(n,t),n.length>0}function Ne(e,t){let n=T.blockers.get(e)||Sd;return se.get(e)!==t&&se.set(e,t),n}function Pe(e){T.blockers.delete(e),se.delete(e)}function Fe(e,t){let n=T.blockers.get(e)||Sd;Q(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 Ie({currentLocation:e,nextLocation:t,historyAction:n}){if(se.size===0)return;se.size>1&&$(!1,`A router only supports one blocker at a time`);let r=Array.from(se.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 Le(e){let t=hf(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=mf(n);return{notFoundMatches:r,route:i,error:t}}function Re(e,t,n){if(h=e,_=t,g=n||null,!v&&T.navigation===bd){v=!0;let e=Ve(T.location,T.matches);e!=null&&z({restoreScrollPosition:e})}return()=>{h=null,_=null,g=null}}function ze(e,t){return g&&g(e,t.map(e=>iu(e,T.loaderData)))||e.key}function Be(e,t){if(h&&_){let n=ze(e,t);h[n]=_()}}function Ve(e,t){if(h){let n=ze(e,t),r=h[n];if(typeof r==`number`)return r}return null}function He(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 Ue(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||Ld(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&&We(o,d.slice(0,o.length))))))return{type:`success`,matches:s};if(d||=c.match(n,!0),!d||We(o,d))return{type:`success`,matches:null};o=d}}function We(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Ge(e){l={},u.setHmrRoutes(eu(e,a,void 0,l))}function Ke(e,t,n=!1){Ld(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:Re,navigate:B,fetch:H,revalidate:fe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Te,resetFetcher:Ee,deleteFetcher:Oe,dispose:le,getBlocker:Ne,deleteBlocker:Pe,patchRoutes:Ke,_internalFetchControllers:F,_internalSetRoutes:Ge,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){z(e)}},e.instrumentations&&(w=Xu(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function Od(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function kd(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=Nu(r||`.`,Mu(o),Tu(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=jf(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=Eu({basename:n,pathname:c.pathname})),Ul(c)}function Ad(e,t,n){if(!n||!Od(n))return{path:t};if(n.formMethod&&!kf(n.formMethod))return{path:t,error:hf(405,{method:n.formMethod})};let r=()=>({path:t,error:hf(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=_f(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Af(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(!Af(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()}}}Q(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=sf(n.formData),s=n.formData;else if(n.body instanceof FormData)o=sf(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=cf(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=cf(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(Af(c.formMethod))return{path:t,submission:c};let l=Wl(t);return e&&l.search&&jf(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ul(l),submission:c}}function jd(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Cf(_[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(_&&Cf(_[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=Uu(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(!Md(s))f=!1;else if(u){let{shouldLoad:e}=Nd(s,a.loaderData,a.errors);f=e}else Pd(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Yd(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?Fd(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Yd(n,r,e,c,E,i,l,t,Id(i,m),m,v)}),O=[];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(!_){O.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=Mf(_,e.path),b=new AbortController,x=of(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=Xd(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=Xd(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};Id(y,a)&&(S=Xd(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function Md(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Nd(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Md(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 Pd(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Fd(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Id(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Ld(e,t,n,r,i,a){let o;if(e){let t=r[e];Q(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=>Rd(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=eu(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]=eu([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 Rd(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=>Rd(e,t)))??!1}var zd=new WeakMap,Bd=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Q(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=zd.get(i);o||(o={},zd.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Yl(e),n=i[e]!==void 0;if(t)$(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)$(!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},Vd=new WeakMap;function Hd(e,t,n,r,i){let a=n[e.id];if(Q(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Vd.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Q(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=Zl(e),o=a[e]!==void 0;i?$(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?$(!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 Vd.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=Bd({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 Ud(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 Wd(e){return e.matches.some(e=>e.route.middleware)?Gd(e,()=>Ud(e)):Ud(e)}function Gd(e,t){return Kd(e,t,e=>{if(Of(e))throw e;return e},bf,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{[pf(r,a).route.id]:{type:`error`,result:t}}}}}async function Kd(e,t,n,r,i){let{matches:a,...o}=e;return await qd(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function qd(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 qd(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 Jd(e,t,n,r,i){let a=Bd({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Hd(r.route,Af(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Yd(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Jd(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Id(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Id(a,{...l,defaultShouldRevalidate:e}):Id(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Af(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Af(n.method)||!p)?Qd({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 Xd(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Yd(e,t,n,r,Uu(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Jd(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Zd(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:Wu(t,n),pattern:Uu(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 Gd(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 Qd({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Af(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:Wu(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 hf(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 hf(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function $d(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 ef(e){let{result:t,type:n}=e;if(Ef(t)){let e;try{e=await $d(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Vu(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Tf(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:yf(t),statusCode:Hu(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Hu(t)?t.status:void 0}:Tf(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 tf(e,t,n,r,i){let a=e.headers.get(`Location`);if(Q(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Du(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=kd(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var nf=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function rf(e){try{return nf.includes(new URL(e).protocol)}catch{return!1}}function af(e,t,n,r){if(Du(e)){let r=e,i=Fl.test(r)?new URL(Il(r,t.protocol)):new URL(r);if(rf(i.toString()))throw Error(`Invalid redirect location`);let a=Tu(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Pu(i.pathname)+i.search+i.hash}try{if(rf(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function of(e,t,n,r){let i=e.createURL(_f(t)).toString(),a={signal:n};if(r&&Af(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?sf(r.formData):r.formData}return new Request(i,a)}function sf(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function cf(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function lf(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Cf(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(Q(!wf(f),`Cannot handle redirect results in processLoaderData`),Cf(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=pf(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=wd),c||(c=!0,s=Hu(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 uf(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=lf(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(Q(s,`Did not find corresponding fetcher result`),Cf(s)){let t=pf(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(wf(s))Q(!1,`Unhandled fetcher revalidation redirect`);else{let e=zf(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function df(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==wd).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 ff(e){return e?Cf(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function pf(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 mf(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 hf(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 Vu(e||500,o,Error(s),!0)}function gf(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(wf(r))return{key:n,result:r}}}function _f(e){return Ul({...typeof e==`string`?Wl(e):e,hash:``})}function vf(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function yf(e){return new Vu(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function bf(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&xf(t))}function xf(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Sf(e){return Ef(e.result)&&vd.has(e.result.status)}function Cf(e){return e.type===`error`}function wf(e){return(e&&e.type)===`redirect`}function Tf(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Ef(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Df(e){return vd.has(e)}function Of(e){return Ef(e)&&Df(e.status)&&e.headers.has(`Location`)}function kf(e){return _d.has(e.toUpperCase())}function Af(e){return hd.has(e.toUpperCase())}function jf(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Mf(e,t){let n=typeof t==`string`?Wl(t).search:t.search;if(e[e.length-1].route.index&&jf(n||``))return e[e.length-1];let r=ju(e);return r[r.length-1]}function Nf(e,t,n){return{url:Wu(e.createURL(t),t),pattern:n?Uu(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Pf(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 Ff(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 If(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 Lf(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 Rf(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 zf(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 Bf(e,t){try{let n=e.sessionStorage.getItem(Cd);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 Vf(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Cd,JSON.stringify(n))}catch(e){$(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Hf(){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 Uf=X.createContext(null);Uf.displayName=`DataRouter`;var Wf=X.createContext(null);Wf.displayName=`DataRouterState`;var Gf=X.createContext(null);Gf.displayName=`DataRouterData`;var Kf=X.createContext(null);Kf.displayName=`DataRouterNavigation`;var qf=X.createContext(!1);function Jf(){return X.useContext(qf)}var Yf=X.createContext({isTransitioning:!1});Yf.displayName=`ViewTransition`;var Xf=X.createContext(null);Xf.displayName=`Fetchers`;var Zf=X.createContext(null);Zf.displayName=`Await`;var Qf=X.createContext(null);Qf.displayName=`Navigation`;var $f=X.createContext(null);$f.displayName=`Location`;var ep=X.createContext({outlet:null,matches:[],isDataRoute:!1});ep.displayName=`Route`;var tp=X.createContext(!1);tp.displayName=`IsDataRoute`;var np=X.createContext(void 0);np.displayName=`RouteId`;var rp=X.createContext(null);rp.displayName=`RouteError`;var ip=`REACT_ROUTER_ERROR`,ap=`REDIRECT`,op=`ROUTE_ERROR_RESPONSE`;function sp(e){if(e.startsWith(`${ip}:${ap}:{`))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 cp(e){if(e.startsWith(`${ip}:${op}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Vu(t.status,t.statusText,t.data)}catch{}}function lp(e,{relative:t}={}){Q(up(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=X.useContext(Qf),{hash:i,pathname:a,search:o}=yp(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Fu([n,a])),r.createHref({pathname:s,search:o,hash:i})}function up(){return X.useContext($f)!=null}function dp(){return Q(up(),`useLocation() may be used only in the context of a <Router> component.`),X.useContext($f).location}var fp=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function pp(){return X.useContext(tp)?zp():mp()}function mp(){Q(up(),`useNavigate() may be used only in the context of a <Router> component.`);let e=X.useContext(Uf),{basename:t,navigator:n}=X.useContext(Qf),{matches:r}=X.useContext(ep),{pathname:i}=dp(),a=JSON.stringify(Mu(r)),o=X.useRef(!1);return X.useLayoutEffect(()=>{o.current=!0}),X.useCallback((r,s={})=>{if($(o.current,fp),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Nu(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Fu([t,c.pathname])),pd(typeof r==`string`?r:Ul(r),n.createHref(c),ud(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var hp=X.createContext(null);function gp(){return X.useContext(hp)}function _p(e){let t=X.useContext(ep).outlet;return X.useMemo(()=>t&&X.createElement(hp.Provider,{value:e},t),[t,e])}function vp(){let{matches:e}=X.useContext(ep);return e[e.length-1]?.params??{}}function yp(e,{relative:t}={}){let{matches:n}=X.useContext(ep),{pathname:r}=dp(),i=JSON.stringify(Mu(n));return X.useMemo(()=>Nu(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function bp(e,t,n){Q(up(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=X.useContext(Qf),{matches:i}=X.useContext(ep),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Vp(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=dp(),d;if(t){let e=typeof t==`string`?Wl(t):t;Q(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m;m=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):nu(e,{pathname:p}),$(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),$(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Dp(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Fu([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Fu([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?X.createElement($f.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function xp(){let e=Ip(),t=Hu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=X.createElement(X.Fragment,null,X.createElement(`p`,null,`💿 Hey developer 👋`),X.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,X.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,X.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),X.createElement(X.Fragment,null,X.createElement(`h2`,null,`Unexpected Application Error!`),X.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?X.createElement(`pre`,{style:i},n):null,o)}var Sp=X.createElement(xp,null),Cp=class extends X.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=qf;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=cp(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:X.createElement(ep.Provider,{value:this.props.routeContext},X.createElement(tp.Provider,{value:this.props.routeContext.isDataRoute},X.createElement(np.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},X.createElement(rp.Provider,{value:e,children:this.props.component}))));return this.context?X.createElement(Tp,{error:e},t):t}},wp=new WeakMap;function Tp({children:e,error:t}){let{basename:n,navigator:r}=X.useContext(Qf);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=sp(t.digest);if(e){let i=wp.get(t);if(i)throw i;let a=Ku(e.location,n),o=a.absoluteURL||a.to;if(pd(e.location,o,ud(r),`allow-explicit`),rf(o))throw Error(`Invalid redirect location`);if(Gu&&!wp.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 wp.set(t,n),n}}return X.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Ep({routeContext:e,match:t,children:n}){let r=X.useContext(Uf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),X.createElement(ep.Provider,{value:e},X.createElement(tp.Provider,{value:e.isDataRoute},X.createElement(np.Provider,{value:t.route.id},n)))}function Dp(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);Q(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:Uu(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||Sp,o&&(s<0&&c===0?(Vp(`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?X.createElement(n.route.Component,null):n.route.element?n.route.element:e,X.createElement(Ep,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?X.createElement(Cp,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Op(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kp(e){let t=X.useContext(Uf);return Q(t,Op(e)),t}function Ap(e){let t=X.useContext(Wf);return Q(t,Op(e)),t}function jp(e){let t=X.useContext(Gf);return Q(t,Op(e)),t}function Mp(e){let t=X.useContext(Kf);return Q(t,Op(e)),t}function Np(e){let t=X.useContext(np);return Q(t,`${e} can only be used on routes that contain a unique "id"`),t}function Pp(){let{navigation:e}=Mp(`useNavigation`);return X.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function Fp(){let{matches:e}=Ap(`useMatches`),{loaderData:t}=jp(`useMatches`);return X.useMemo(()=>e.map(e=>iu(e,t)),[e,t])}function Ip(){let e=X.useContext(rp),t=jp(`useRouteError`),n=Np(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Lp=0;function Rp(e){let{router:t,basename:n}=kp(`useBlocker`),r=Ap(`useBlocker`),[i,a]=X.useState(``),o=X.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:Tu(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:Tu(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return X.useEffect(()=>{let e=String(++Lp);return a(e),()=>t.deleteBlocker(e)},[t]),X.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):Sd}function zp(){let{router:e}=kp(`useNavigate`),t=Np(`useNavigate`),n=X.useRef(!1);return X.useLayoutEffect(()=>{n.current=!0}),X.useCallback(async(r,i={})=>{$(n.current,fp),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Bp={};function Vp(e,t,n){!t&&!Bp[e]&&(Bp[e]=!0,$(!1,n))}var Hp=/:(\d+)(?:-(\d+))?$/,Up=/^(?:[A-Za-z]:\/|\/\/(?!\/)|\/)/;function Wp(e){return Hp.exec(e)?.[0]??``}function Gp(e){return qp(Kp(e))}function Kp(e){return e.replace(Hp,``).replaceAll(`\\`,`/`)}function qp(e){let t=Up.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 Jp({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:Se(-t)}}function Yp(e){return e%7==0?{unit:`week`,count:e/7}:{unit:`day`,count:e}}function Xp(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 Qp={number:0,nan:NaN,string:``,boolean:!1,bigint:0n,symbol:Symbol(),function:()=>void 0,undefined:void 0,null:null,array:[],object:{}};function $p(e,{issue:t,receivedType:n}){let r=n===void 0?void 0:em(n),i=e({...t,input:r});return typeof i==`string`?i:i?.message??t.message}function em(e){return e in Qp?Qp[e]:Object.create({constructor:{name:e}})}var tm=li().localeError,nm={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`},rm=`not set`,im={category:nm,noCategory:rm,categoryRow:{...nm,unset:rm,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`}},am={task:[`task`,`tasks`],line:[`line`,`lines`],project:[`project`,`projects`],day:[`day`,`days`],week:[`week`,`weeks`],session:[`session`,`sessions`]};function om(e,t){let[n,r]=am[t];return j(e,n,r)}function sm(e){return e===null?`—`:e<1?`less than a day`:om(Math.round(e),`day`)}function cm(e){return e===null?`—`:e<1?`within a day`:`within ${sm(e)}`}function lm(e){let t=Jp(e);switch(t.kind){case`no-open`:return`No open tasks`;case`clears`:return`Debt clears in about ${ie(`en`,t.weeks)} wk. (by ${re(`en`,t.until)})`;case`not-shrinking`:return`Debt is not shrinking`;case`grows`:return`Debt grows by ${ue(`en`,t.perWeek)} ${ge(t.perWeek,...am.task)} a week`}}function um({windowDays:e,closed:t,created:n}){let r=Yp(e);return`over ${om(r.count,r.unit)}: closed ${t}, created ${n}`}function dm(e){switch(e.kind){case`debt-growing`:return`Debt has grown for ${om(e.params.weeks,`week`)} straight: created ${e.params.created}, closed ${e.params.closed}`;case`urgent-stale`:return`Urgent tasks have been waiting more than ${om(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Stuck in progress: ${e.params.count}, longest ${e.params.id} — ${sm(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?`"${im.evidence[t]}"`:`"${im.evidence[t]}" ${im.checkMethod[n]}`} is almost always wrong: precision ${r}% on ${i} decided over ${om(a,`day`)}`}case`low-changed`:return`Code changed for ${om(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 ${om(e.params.days,`day`)}: ${e.params.count} — clean them up (backlog prune)`}}function fm(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 $p(tm,e)}}var pm=(e,t)=>({reason:`git does not trust ${e} (the directory belongs to another user)`,fix:`Fix: ${t}`}),mm={task:`its file`,project:`its project file`},hm=(e,t)=>`${e} is not loaded: ${mm[t]} could not be parsed`;function gm(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-unparsed`:return`epic ${e.epic} is not loaded: ${mm[e.fileKind]} could not be parsed`;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`epic-closed-with-open-tasks`:return`the epic closes on its own once all its tasks are closed — close the open ones first: ${e.children.join(`, `)}`;case`reference-missing`:return`${e.id} not found`;case`reference-unparsed`:return hm(e.id,e.fileKind);case`not-utf8`:return`the file is not UTF-8 — the backlog leaves it untouched until it is re-saved as UTF-8`;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===``?fm(e.issue):`${e.path}: ${fm(e.issue)}`;case`not-a-file`:return`not a file — the backlog reads only regular files and links to them`;case`link-unreachable`:return`the link does not lead to an accessible file or directory`;case`task-is-link`:return`the task is a link; links are supported only for a project directory`;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 _m=Zp(gm);function vm(e){return`all tasks of the epic are closed: ${e.join(`, `)}`}function ym(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 — ${vm(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: epic reopened — it has open tasks: ${e.childIds.join(`, `)}`;case`source-moved`:return Gp(e.from)===Gp(e.to)?`${e.taskId}: source moved ${Wp(e.from)} → ${Wp(e.to)}`:`${e.taskId}: code file renamed, source ${e.from} → ${e.to}`}}function bm(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: could not fix — ${xm(e)}`;case`task-invalid`:return`${e.taskId}: ${gm(e.problem)}`;case`file-not-parsed`:return`File ${e.path} could not be parsed: ${_m(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`:{let{reason:t,fix:n}=pm(e.repo,e.trustCommand);return`Project ${e.projectId}: ${t} — commits and code edits of its tasks are not checked. ${n}`}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`project-branches-unreadable`:return`Project ${e.projectId}: could not read the git branches in ${e.repo} (a broken ref or a git failure) — missing code files of its tasks were not checked`;case`merge-state-unknown`:return`Project ${e.projectId}: git in ${e.repo} could not tell whether ${ge(e.branches.length,`branch`,`branches`)} ${e.branches.join(`, `)} landed in the current branch (shallow clone, unrelated history or a git failure) — tasks created there were checked as usual, without waiting for the merge`;case`late-commits-unknown`:return`Project ${e.projectId}: git in ${e.repo} could not read the late commits or the reflog of ${ge(e.taskIds.length,`task`,`tasks`)} ${e.taskIds.join(`, `)} (shallow clone or a git failure) — their code edits were not checked, the next run will try again`;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 xm(e){switch(e.cause){case`invalid`:return _m(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:gm,problems:_m,taskNotLoaded:hm,unsafeRepo:pm,schemaIssue:fm,...Xp(im),count:om,days:sm,p90:cm,forecast:lm,forecastTail:um,signal:dm,epicDoneReason:vm,fileBusy:({path:e,lock:t,seconds:n})=>`${e} has been locked by another process for more than ${ie(`en`,n)} s (${t})`,checkFix:ym,checkProblem:bm,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}`,markCommitsReadFailed:(e,t)=>`Could not read the ${e} journal — the commits tasks were created and confirmed on are unknown: tasks from unmerged branches are checked as usual, and the code at the mark is taken from the reflog: ${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=fi().localeError,wm={bloaters:`Разбухшее`,"change-preventers":`Мешает изменениям`,couplers:`Связанность`,"data-dealers":`Работа с данными`,dispensables:`Лишнее`,"functional-abusers":`Императивность`,"lexical-abusers":`Именование`,"oo-abusers":`ООП`,obfuscators:`Запутанность`,bug:`Ошибка`},Tm=`не указана`,Em={category:wm,noCategory:Tm,categoryRow:{...wm,unset:Tm,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:`свежий`}},Dm={task:[`задача`,`задачи`,`задач`],line:[`строка`,`строки`,`строк`],project:[`проект`,`проекта`,`проектов`],day:[`день`,`дня`,`дней`],week:[`неделя`,`недели`,`недель`],session:[`сессия`,`сессии`,`сессий`]},Om={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},km={task:[`задачи`,`задач`,`задач`],day:[`дня`,`дней`,`дней`]};function Am(e,t){let[n,r,i]=Dm[t];return B(e,n,r,i)}function jm(e,t){return B(e,...Om[t])}function Mm(e,t){return B(e,...km[t])}function Nm(e){return e===null?`—`:e<1?`меньше дня`:`${ie(`ru`,Math.round(e))} дн.`}function Pm(e){return e===null?`—`:e<1?`быстрее суток`:`за ${Nm(e)}`}function Fm(e){let t=Jp(e);switch(t.kind){case`no-open`:return`Открытых задач нет`;case`clears`:return`Долг разберётся примерно за ${ie(`ru`,t.weeks)} нед. (к ${re(`ru`,t.until)})`;case`not-shrinking`:return`Долг не уменьшается`;case`grows`:return`Долг растёт на ${ue(`ru`,t.perWeek)} ${P(t.perWeek,...Dm.task)} в неделю`}}function Im({windowDays:e,closed:t,created:n}){let{unit:r,count:i}=Yp(e);return`за ${jm(i,r)}: закрыто ${t}, создано ${n}`}function Lm(e){switch(e.kind){case`debt-growing`:return`Долг растёт ${jm(e.params.weeks,`week`)} подряд: создано ${e.params.created}, закрыто ${e.params.closed}`;case`urgent-stale`:return`Срочные задачи ждут дольше ${Mm(e.params.days,`day`)}: ${e.params.count}`;case`stuck`:return`Застряли в работе: ${e.params.count}, дольше всех ${e.params.id} — ${Nm(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?`«${Em.evidence[t]}»`:`«${Em.evidence[t]}» ${Em.checkMethod[n]}`} почти всегда ошибается: точность ${r}% на ${i} решённых за ${jm(a,`day`)}`}case`low-changed`:return`Код менялся у ${Mm(e.params.count,`task`)} с низким приоритетом — перепроверьте при случае («почисти беклог»)`;case`stale-low`:return`Задач с низким приоритетом старше ${Mm(e.params.days,`day`)}: ${e.params.count} — разберите (backlog prune)`}}function Rm(e){switch(e.kind){case`bad-id`:return`некорректный ID`;case`empty-title`:return`пустой заголовок`;case`empty-name`:return`пустое имя проекта`;case`bad-prefix`:return`некорректный префикс`;case`zod`:return $p(Cm,e)}}var zm=(e,t)=>({reason:`git не доверяет ${e} (каталог принадлежит другому пользователю)`,fix:`Исправление: ${t}`}),Bm={task:`её файл`,project:`файл её проекта`},Vm={task:`его файл`,project:`файл его проекта`},Hm=(e,t)=>`${e} не загружена: не разобран ${Bm[t]}`;function Um(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-unparsed`:return`эпик ${e.epic} не загружен: не разобран ${Vm[e.fileKind]}`;case`epic-not-epic`:return`${e.epic} не является эпиком`;case`epic-foreign-project`:return`эпик ${e.epic} из другого проекта — снимите эпик или выберите эпик этого проекта`;case`epic-in-epic`:return`эпик не может входить в другой эпик`;case`epic-closed-with-open-tasks`:return`эпик закроется сам, когда закроются все его задачи — сначала закройте открытые: ${e.children.join(`, `)}`;case`reference-missing`:return`${e.id} не найдена`;case`reference-unparsed`:return Hm(e.id,e.fileKind);case`not-utf8`:return`файл не в кодировке UTF-8 — беклог его не меняет, пока его не пересохранят в UTF-8`;case`no-frontmatter`:return`файл не начинается с frontmatter (---)`;case`frontmatter-unclosed`:return`frontmatter не закрыт строкой ---`;case`yaml`:return`ошибка YAML: ${e.detail}`;case`schema`:return e.path===``?Rm(e.issue):`${e.path}: ${Rm(e.issue)}`;case`not-a-file`:return`не файл — беклог читает только обычные файлы и ссылки на них`;case`link-unreachable`:return`ссылка не ведёт к доступному файлу или каталогу`;case`task-is-link`:return`задача — ссылка; ссылки поддерживаются только для каталога проекта`;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 Wm=Zp(Um);function Gm(e){return`все задачи эпика закрыты: ${e.join(`, `)}`}function Km(e){switch(e.kind){case`references-removed`:return`${e.taskId}: убраны ссылки на несуществующие задачи: ${e.ids.join(`, `)}`;case`epic-closed`:return`${e.taskId}: эпик закрыт — ${Gm(e.childIds)}`;case`epic-reopened`:return`${e.taskId}: эпик снова открыт — в нём открытые задачи: ${e.childIds.join(`, `)}`;case`source-moved`:return Gp(e.from)===Gp(e.to)?`${e.taskId}: source сдвинулся ${Wp(e.from)} → ${Wp(e.to)}`:`${e.taskId}: файл кода переименован, source ${e.from} → ${e.to}`}}function qm(e){switch(e.kind){case`fix-failed`:return`${e.taskId}: не удалось исправить — ${Jm(e)}`;case`task-invalid`:return`${e.taskId}: ${Um(e.problem)}`;case`file-not-parsed`:return`Файл ${e.path} не разобран: ${Wm(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`:{let{reason:t,fix:n}=zm(e.repo,e.trustCommand);return`Проект ${e.projectId}: ${t} — коммиты и правки кода его задач не проверяются. ${n}`}case`project-history-unreadable`:return`Проект ${e.projectId}: не удалось прочитать историю git в ${e.repo} — коммиты и правки кода его задач не проверены`;case`project-branches-unreadable`:return`Проект ${e.projectId}: не удалось прочитать ветки git в ${e.repo} (битая ссылка в refs или сбой git) — пропавшие файлы кода его задач не проверены`;case`merge-state-unknown`:return`Проект ${e.projectId}: git в ${e.repo} не смог ответить, ${e.branches.length===1?`влита ли ветка`:`влиты ли ветки`} ${e.branches.join(`, `)} в текущую (неполный клон, несвязанная история или сбой git) — созданные там задачи проверены как обычные, без ожидания слияния`;case`late-commits-unknown`:return`Проект ${e.projectId}: git в ${e.repo} не смог прочитать поздние коммиты или reflog ${e.taskIds.length===1?`задачи`:`задач`} ${e.taskIds.join(`, `)} (неполный клон или сбой git) — правки их кода не проверены, проверка повторится при следующем запуске`;case`prefix-shared`:return`У проектов ${e.projectIds.join(`, `)} один префикс ${e.prefix} — ID их задач пересекаются. Смените prefix в project.md одного из них`}}function Jm(e){switch(e.cause){case`invalid`:return Wm(e.problems);case`changed-during-check`:return`файл изменился во время проверки`;case`gone-during-check`:return`файл исчез во время проверки`;case`busy-during-check`:return`файл занят другим процессом`}}var Ym={hookMark:`Беклог`,languageName:`Русский`,problem:Um,problems:Wm,taskNotLoaded:Hm,unsafeRepo:zm,schemaIssue:Rm,...Xp(Em),count:Am,days:Nm,p90:Pm,forecast:Fm,forecastTail:Im,signal:Lm,epicDoneReason:Gm,fileBusy:({path:e,lock:t,seconds:n})=>`${e} занят другим процессом дольше ${ie(`ru`,n)} с (${t})`,checkFix:Km,checkProblem:qm,runsNotTrimmed:e=>`Не удалось обрезать журнал запусков: ${e}`,journalNotCompacted:(e,t)=>`Не удалось уплотнить журнал в ${e}: ${t}`,closedNotSwept:e=>`Не удалось удалить закрытые задачи: ${e}`,serviceLogNotTrimmed:e=>`Не удалось обрезать лог службы: ${e}`,candidatesRecordFailed:(e,t)=>`Не удалось записать кандидатов в журнал ${e}: ${t}`,markCommitsReadFailed:(e,t)=>`Не удалось прочитать журнал ${e} — неизвестно, на каких коммитах задачи заводили и подтверждали: задачи из невлитых веток проверяются как обычные, а код на момент отметки берётся из reflog: ${t}`,unreadableSkipped:(e,t)=>`Не удалось прочитать ${e}, он пропущен: ${t}`,settingsNotSaved:(e,t)=>`Не удалось сохранить язык в ${e}: ${t}. Он определяется заново при каждом запуске — разрешите запись в каталог беклога.`,settingsFileInvalid:e=>`${e} не разобран, язык для этого запуска определён автоматически. Файл не изменён — поправьте его вручную.`};function Xm(e){return e===`ru`?Ym:Sm}var Zm={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`},Qm={skipLink:`Перейти к содержимому`,sidebarNav:`Навигация`,brand:`беклог`,sectionsLabel:`Разделы`,tasksNav:`Задачи`,statsNav:`Статистика`,signalsHidden:e=>`, тревог: ${e}`,collapseProjects:`Свернуть список проектов`,expandProjects:`Развернуть список проектов`,projects:`Проекты`,taskWord:e=>P(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:`Удалить`},$m=(e,t)=>`Changed ${e} of ${t}`,eh={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.`,unparsedProject:`The project file could not be parsed — its tasks are hidden until the file is fixed.`,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=>`${j(e,`task`,`tasks`)} in the list`,status:`Status`,priority:`Priority`,probability:`Probability`,probabilityRange:(e,t)=>`Probability · ${e}–${t}%`,probabilityUnestimated:`Probability · unestimated`,probabilityMin:`From, %`,probabilityMax:`To, %`,probabilityFilterError:`Enter whole numbers from 0 to 100. The lower bound must not exceed the upper bound.`,applyProbabilityFilter:`Apply`,clearProbabilityFilter:`Reset`,unestimatedProbability:`Unestimated`,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`,epicNotLoaded:`epic not loaded`,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 ${j(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:$m,epic:$m,restore:(e,t)=>`Restored ${e} of ${t}`},notChanged:e=>`${j(e,`task`,`tasks`)} not changed`,undo:`Undo`,undoFailed:`Couldn't undo`,viewSwitch:`View`,listView:`List`,boardView:`Board`,board:`Task board`,columnCount:e=>j(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`,dragStayed:e=>`${e} stayed where it was`,dragCancelled:e=>`Moving ${e} was cancelled`,collapseTags:`collapse`,showMoreTags:e=>`Show ${e} more`},th=(e,t)=>`${P(e,`Изменена`,`Изменено`,`Изменено`)} ${e} из ${t}`,nh={docTitle:e=>`${e} — Беклог`,taskDocTitle:(e,t)=>`${e} · ${t} — Беклог`,projects:`Проекты`,autoClosed:`Закрыты агентом`,autoClosedInProject:e=>`Закрыты агентом · ${e}`,missingTask:e=>`Задачи ${e} нет — возможно, её удалили после закрытия.`,parseErrorsTitle:`Не удалось разобрать файлы:`,loadingTasks:`Загружаем задачи…`,unknownProject:`Проект не найден.`,unparsedProject:`Файл проекта не разобран — его задачи не показаны, пока файл не исправят.`,hiddenOpenNote:e=>`Ещё ${B(e,`открытая задача`,`открытые задачи`,`открытых задач`)} — в проектах без галочки.`,noTasksInScope:e=>`В учтённых проектах задач нет. ${e}`,noTasksYet:e=>[`Задач пока нет. Беклог наполняет агент: он записывает задачи командой `,e(`backlog new`),`, пока работает над кодом.`],noOpenTasksInScope:e=>`В учтённых проектах открытых задач нет. ${e}`,noOpenTasks:`Открытых задач нет.`,showAllStatuses:`Показать все статусы`,noMatches:`Под фильтры ничего не подходит.`,resetFilters:`Сбросить фильтры`,taskCount:e=>`В списке ${B(e,`задача`,`задачи`,`задач`)}`,status:`Статус`,priority:`Приоритет`,probability:`Вероятность`,probabilityRange:(e,t)=>`Вероятность · ${e}–${t}%`,probabilityUnestimated:`Вероятность · без оценки`,probabilityMin:`От, %`,probabilityMax:`До, %`,probabilityFilterError:`Введите целые числа от 0 до 100. Нижняя граница должна быть не больше верхней.`,applyProbabilityFilter:`Применить`,clearProbabilityFilter:`Сбросить`,unestimatedProbability:`Без оценки`,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:`эпик не найден`,epicNotLoaded:`эпик не загружен`,anyEpicLabel:`любой`,noEpicLabel:`без эпика`,selectTask:e=>`Выбрать ${e}`,selectAllVisible:`Выбрать все видимые`,selectionKeysHint:e=>`Пробел на задаче — выбрать её, Shift+Пробел — выбрать диапазон, ${e} — к действиям с выбранными`,toActionsHint:e=>`${e} — к действиям`,selectionActions:`Действия с выбранными`,selectedCount:e=>`Выбрано ${e}`,hiddenByFilter:e=>`(${e} ${P(e,`скрыта`,`скрыты`,`скрыто`)} фильтром)`,closeAsObsolete:`Закрыть как неактуальные`,closeDialogTitle:e=>`Закрыть ${B(e,`задачу`,`задачи`,`задач`)} как неактуальные?`,closeDialogDescription:e=>`Статус станет «${e}», причина запишется в каждую задачу.`,closeReason:`Причина`,closeConfirm:e=>`Закрыть ${e}`,epic:`Эпик`,removeFromEpic:`Вынуть из эпика`,mixedProjects:`Задачи из разных проектов`,clearSelection:`Снять выбор`,bulkFailed:`Не удалось изменить задачи`,batchSummary:{close:(e,t)=>`${P(e,`Закрыта`,`Закрыто`,`Закрыто`)} ${e} из ${t}`,priority:th,epic:th,restore:(e,t)=>`${P(e,`Возвращена`,`Возвращено`,`Возвращено`)} ${e} из ${t}`},notChanged:e=>`${P(e,`Не изменена`,`Не изменены`,`Не изменено`)} ${e} ${P(e,`задача`,`задачи`,`задач`)}`,undo:`Отменить`,undoFailed:`Не удалось отменить`,viewSwitch:`Вид`,listView:`Список`,boardView:`Доска`,board:`Доска задач`,columnCount:e=>B(e,`задача`,`задачи`,`задач`),emptyColumn:`Перетащите сюда задачу`,closedHidden:`Закрытые скрыты фильтром — перетащите сюда, чтобы закрыть`,moved:(e,t)=>`${e}: статус «${t}»`,moveFailed:e=>`Не удалось перенести ${e}`,dragInstructions:`Пробел — взять задачу, стрелки влево и вправо — выбрать колонку, пробел — положить, Esc — отменить.`,dragStarted:e=>`Задача ${e} взята`,dragOver:(e,t)=>`${e} над колонкой «${t}»`,dragStayed:e=>`${e} осталась на месте`,dragCancelled:e=>`Перенос ${e} отменён`,collapseTags:`свернуть`,showMoreTags:e=>`Показать ещё ${e}`},rh=e=>j(e,`day`,`days`),ih={day:`day`,week:`week`,sample:`sample`},ah={week:[`week`,`weeks`],day:[`day`,`days`]},oh={week:`a week`,day:`a day`},sh={week:`since the week of`,day:`since`},ch={week:`in the latest week with decisions`,day:`on the last day with decisions`},lh=(e,t)=>j(t,...ah[e]),uh=e=>j(e,`task`,`tasks`),dh=e=>j(e,`token`,`tokens`);function fh({formatted:e,count:t}){return`${e} ${ge(t,`line`,`lines`)}`}function ph(e){let t=rh(e.churnDays),n=j(e.statsWeeks,`week`,`weeks`),r=j(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:rh(e.statsDays),lastWeek:rh(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`now`,chartLabel:(e,t)=>`${e}. Left and right arrows move by ${ih[t]}`,onRightScale:e=>`${e} (right scale)`,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})=>`${lh(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,average:r})=>{let i=lh(e,t);if(n===0)return`${i}: no tasks created`;if(r===null)return`${i}: created ${n}`;let a=r.since===null?``:` ${sh[e]} ${F(`en`,r.since)}`;return`${i}: created ${n}, on average ${ue(`en`,r.perPeriod)} ${oh[e]}${a}`},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=>j(e,`commit`,`commits`),churnTasks:(e,t)=>`${uh(e)}, weight ${t}`,densityTitle:`Debt density`,perKloc:e=>`${ue(`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`],modelAccuracyTitle:`Precision by model`,modelAccuracyTable:e=>`Precision by model, ${e}`,modelAccuracyColumn:`Model`,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?`${lh(e,t)}: no decided candidates`:`${lh(e,t)}: decided ${n}, precision ${ch[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:fh,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}: ${j(e,`line`,`lines`)} in pull requests, deferred ${t}, noise without backlog ${n}`,effectDaysSummary:(e,t,n)=>`Over ${lh(`day`,e)}: ${j(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)=>`${uh(e)} — ${fh(t)}`,noPending:`nothing pending`,pendingWithoutEstimate:e=>`${uh(e)}, ${a}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${uh(e)} ${fh(t)}, on average ${n} per task`,noiseMissing:{"no-repos":`the project has no repositories — add repos to project.md`,"no-lines":`no code lines in pull requests since adoption`,"no-deferred-tasks":`no tasks deferred yet — nothing to measure`,"estimate-pending":a},noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Counting usage from Claude Code and Codex transcripts…`,noTranscripts:`No Claude Code or Codex transcripts found.`,scanProgress:(e,t)=>`Counting usage from Claude Code and Codex transcripts: read ${e} of ${j(t,`file`,`files`)}`,costNote:`Backlog usage comes from Claude Code and Codex transcripts. Tokens for turns started by the Stop hook come from the logs. Command and skill output is estimated from text length. Cost uses standard Anthropic and OpenAI API prices. Your subscription may cost differently.`,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=>`${ue(`en`,e)} MiB`,milliseconds:e=>`${k(`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:dh,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,money:i,hookRuns:a,cliRuns:o})=>`Over ${lh(e,t)}: due to the hook ${dh(n)}, CLI output and skill ${r}, at API prices ${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 mh=e=>B(e,`день`,`дня`,`дней`),hh={day:`дням`,week:`неделям`,sample:`замерам`},gh={week:[`неделя`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},_h={week:[`неделю`,`недели`,`недель`],day:[`день`,`дня`,`дней`]},vh={week:`в неделю`,day:`в день`},yh={week:`с\xA0недели`,day:`с`},bh={week:`на последней неделе с решениями`,day:`в последний день с решениями`},xh=(e,t)=>B(t,...gh[e]),Sh=e=>B(e,`задача`,`задачи`,`задач`),Ch=e=>B(e,`токен`,`токена`,`токенов`);function wh({formatted:e,count:t}){return`${e} ${P(t,`строка`,`строки`,`строк`)}`}function Th(e){let t=mh(e.churnDays),n=B(e.statsWeeks,`неделю`,`недели`,`недель`),r=B(e.statsWeeks,`недели`,`недель`,`недель`),i=B(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:B(e.statsWeeks,`неделя`,`недели`,`недель`),days:mh(e.statsDays),lastWeek:mh(e.costTotalsDays),churn:t},periodCaption:(e,t)=>`${e} · ${t}`,periodNow:`сейчас`,chartLabel:(e,t)=>`${e}. Стрелки влево и вправо — по ${hh[t]}`,onRightScale:e=>`${e} (шкала справа)`,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})=>`${xh(e,t)}: создано ${n}, закрыто ${r}, открыто сейчас ${i}`,createdBy:{week:`Создано по неделям`,day:`Создано по дням`},createdTasks:`создано задач`,intakeSummary:({grain:e,periodCount:t,created:n,average:r})=>{let i=xh(e,t);if(n===0)return`${i}: задач не создавали`;if(r===null)return`${i}: создано ${n}`;let a=r.since===null?``:` ${yh[e]} ${F(`ru`,r.since)}`;return`${i}: создано ${n}, в среднем ${ue(`ru`,r.perPeriod)} ${vh[e]}${a}`},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=>B(e,`коммит`,`коммита`,`коммитов`),churnTasks:(e,t)=>`${Sh(e)}, вес ${t}`,densityTitle:`Плотность долга`,perKloc:e=>`${ue(`ru`,e)} на 1000 строк`,accuracyTitle:`Точность проверки`,noCandidates:`Проверка ещё не находила кандидатов`,accuracyHint:`Доля кандидатов проверки, после которых задача закрылась; остальные подтверждены как актуальные`,accuracyTable:e=>`Точность проверки, ${e}`,accuracyHead:[`Улика`,`Кандидатов`,`Закрыто`,`Подтверждено`,`Без решения`,`Точность`],modelAccuracyTitle:`Точность по моделям`,modelAccuracyTable:e=>`Точность по моделям, ${e}`,modelAccuracyColumn:`Модель`,splitRow:e=>`└ из них ${e}`,beforeMethodRecorded:`до записи способа`,checkedBy:e=>`проверено ${e}`,beforeMatchRecorded:`до записи признака`,matchedBy:e=>`совпали ${e}`,decidedCandidates:`решено кандидатов`,precision:`точность`,accuracySummary:({grain:e,periodCount:t,decided:n,latestPrecision:r})=>r===null?`${xh(e,t)}: решённых кандидатов нет`:`${xh(e,t)}: решено ${n}, точность ${bh[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:wh,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}: в пулреквестах ${B(e,`строка`,`строки`,`строк`)}, вынесено ${t}, шум без беклога ${n}`,effectDaysSummary:(e,t,n)=>`За ${xh(`day`,e)}: по теме пулреквестов ${B(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)=>`${Sh(e)} — ${wh(t)}`,noPending:`ожидающих нет`,pendingWithoutEstimate:e=>`${Sh(e)}, ${o}`,pendingEstimated:({openTasks:e,estimated:t,perTask:n})=>`${Sh(e)} ${wh(t)}, в среднем ${n} на задачу`,noiseMissing:{"no-repos":`у проекта нет репозиториев — добавьте repos в project.md`,"no-lines":`после внедрения нет строк кода в пулреквестах`,"no-deferred-tasks":`вынесенных задач пока нет — считать не из чего`,"estimate-pending":o},noiseFormula:(e,t,n,r)=>`${e} ÷ (${t} + ${n}) ${r}`,scanStarting:`Считаем расход по расшифровкам Claude Code и Codex…`,noTranscripts:`Расшифровки Claude Code и Codex не найдены.`,scanProgress:(e,t)=>`Считаем расход по расшифровкам Claude Code и Codex: прочитано ${e} из ${B(t,`файла`,`файлов`,`файлов`)}`,costNote:`Расходы беклога считаются по расшифровкам Claude Code и Codex. Токены ходов, запущенных Stop-хуком, берутся из журнала, а вывод команд и скилла оценивается по длине текста. Стоимость рассчитывается по стандартным ценам API Anthropic и OpenAI. У подписки может быть другая стоимость.`,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=>`${ue(`ru`,e)} МиБ`,milliseconds:e=>`${k(`ru`,e)} мс`,spendBy:{week:`Расход по неделям`,day:`Расход по дням`},hookTurnTokens:`токены ходов хука`,cliOutputTokens:`токены вывода CLI и скилла`,hookRuns:`запуски хука`,otherCommands:`другие команды`,hookTurnsTooltip:`ходы хука`,cliOutput:`вывод CLI и скилл`,apiPriceTooltip:`по ценам API`,tokens:Ch,spendSummary:({grain:e,periodCount:t,hookTokens:n,cliTokens:r,money:i,hookRuns:a,cliRuns:o})=>`За ${B(t,..._h[e])}: из-за хука ${Ch(n)}, вывод CLI и скилл ${r}, по ценам API ${i}; запусков хука ${a}, других команд ${o}`,serverMemory:`Память сервера`,memoryRestartNote:`После перезапуска сервера история начинается заново`,memorySummary:(e,t)=>`Сейчас ${e}, максимум за ${i} ${t}`,processMemory:`память процесса`,jsHeap:`куча JavaScript`}}var Eh=5e3,Dh=x,Oh=[`test`,`tests`,`__tests__`,`e2e`,`spec`],kh=[{glob:`*.test.*`,pattern:/\.test\./},{glob:`*.spec.*`,pattern:/\.spec\./},{glob:`*_test.*`,pattern:/_test\./},{glob:`test_*.py`,pattern:/^test_.+\.py$/}].map(({glob:e})=>e),Ah=/^\s*[-*+]\s+\[(?<mark>[ xX])\]\s+(?<text>.*)$/,jh=/^\s{0,3}(?<fence>`{3,}|~{3,})/;function Mh(e){let t=[],n=null;for(let[r,i]of e.split(`
73
73
  `).entries()){let e=jh.exec(i)?.groups?.fence;if(e!==void 0){n===null?n=e:e.startsWith(n)&&(n=null);continue}if(n!==null)continue;let a=Ah.exec(i)?.groups;a&&t.push({line:r,checked:a.mark!==` `,text:a.text??``})}return t}function Nh(e,t){let n=Mh(e).find(e=>e.line===t);if(!n)return e;let r=e.split(`
74
74
  `);return r[t]=(r[t]??``).replace(/\[[ xX]\]/,n.checked?`[ ]`:`[x]`),r.join(`
75
- `)}var Ph=[`done`,`cancelled`];function Fh(e){return Ph.some(t=>t===e)}function Ih(e,t){let n=new Map,r=new Map,i=new Map,a=new Map;for(let t of e){n.set(t.id,t);for(let e of t.blockedBy)Gh(r,e,t);for(let e of t.related)Gh(i,e,t);t.epic!==void 0&&Gh(a,t.epic,t)}return{byId:n,dependentsOf:r,relatedFrom:i,childrenOf:a,notLoaded:t}}function Lh(e,t){return Wh(e.blockedBy,t).filter(e=>!Fh(e.status))}function Rh(e,t){return Lh(e,t).length>0}function zh(e,t){return[...new Set([...e.blockedBy,...e.related])].filter(e=>!t.byId.has(e))}function Bh(e,t){return t.dependentsOf.get(e.id)??[]}function Vh(e,t){let n=[...Wh(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 Hh(e,t){return t.childrenOf.get(e.id)??[]}function Uh(e,t){if(e.status===`done`)return 100;if(e.type===`epic`){let n=Hh(e,t).filter(e=>e.status!==`cancelled`);return n.length===0?null:Kh(n.filter(e=>e.status===`done`).length,n.length)}let n=Mh(e.body);return n.length===0?null:Kh(n.filter(e=>e.checked).length,n.length)}function Wh(e,t){return e.flatMap(e=>t.byId.get(e)??[])}function Gh(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function Kh(e,t){return Math.round(e/t*100)}var qh=/^[A-Z][A-Z0-9]{0,9}-[1-9]\d*$/,Jh=/^[A-Z][A-Z0-9]{0,9}$/;function Yh(e){if(!qh.test(e))return null;let t=e.lastIndexOf(`-`);return{prefix:e.slice(0,t),number:Number(e.slice(t+1))}}function Xh(e,t){return`${e}-${t}`}function Zh(e,t){let n=Yh(e),r=Yh(t);return!n||!r?e.localeCompare(t):n.prefix===r.prefix?n.number-r.number:n.prefix.localeCompare(r.prefix)}function Qh(e){return{error:()=>e}}var $h=[`task`,`epic`],eg=[`backlog`,`in-progress`,`blocked`,`done`,`cancelled`],tg=[`low`,`medium`,`high`,`critical`],ng=[`bloaters`,`change-preventers`,`couplers`,`data-dealers`,`dispensables`,`functional-abusers`,`lexical-abusers`,`oo-abusers`,`obfuscators`,`bug`],rg=[`fixed`,`obsolete`,`duplicate`,`epic-done`],ig=`,`;function ag(e){return e.trim().toLowerCase()}function og(e){return[...new Set(e.flatMap(e=>e.split(ig)).map(ag).filter(Boolean))]}var sg=q().regex(qh,Qh(`bad-id`)),cg=Cs(sg).default([]).transform(e=>[...new Set(e)]),lg=Ts({id:sg,title:q().trim().min(1,Qh(`empty-title`)),type:Y($h).default(`task`),status:Y(eg).default(`backlog`),priority:Y(tg).default(`medium`),category:Y(ng).optional(),tags:Cs(q()).default([]).transform(og),epic:sg.optional(),blockedBy:cg,related:cg,created:lc({offset:!0}),source:q().optional(),anchor:q().optional(),closed:lc({offset:!0}).optional(),resolution:Y(rg).optional(),reason:q().optional(),verified:lc({offset:!0}).optional()});Ts({name:q().trim().min(1,Qh(`empty-name`)),prefix:q().regex(Jh,Qh(`bad-prefix`)),repos:Cs(q()).default([]),issuedUpTo:ps().int().nonnegative().optional(),active:_s().default(!0)});var ug=[`cli`,`web`,`check`,`sweep`],dg=`unknown`;function fg(e){return Y([...e,dg]).catch(dg)}var pg=[`review`,`incidental`,`manual`],mg=[`source-changed`,`source-missing`,`duplicate`,`no-source`],hg=[`full`,`changed`],gg=[`symbol`,`anchor`,`file`];[...gg];var _g=[`source`,`title`,`symbol`];[..._g];var vg=Ts({bySymbol:_s().optional(),byAnchor:_s().optional()}),yg={at:lc({offset:!0}),task:q().min(1),via:fg(ug),undo:Ls(!0).optional().catch(void 0)},bg=lg.extend({priority:fg(tg),category:fg(ng).optional(),resolution:fg(rg).optional()});As(`kind`,[Ts({...yg,kind:Ls(`created`),type:Y($h),priority:fg(tg),tags:Cs(q()),source:q().optional(),epic:q().optional(),category:fg(ng).optional(),found:fg(pg).optional(),origin:Ts({branch:q().optional(),commit:q().min(1)}).optional()}),Ts({...yg,kind:Ls(`status`),from:Y(eg),to:Y(eg),resolution:fg(rg).optional()}),Ts({...yg,kind:Ls(`priority`),from:fg(tg),to:fg(tg)}),Ts({...yg,kind:Ls(`deleted`),snapshot:bg}),Ts({...yg,kind:Ls(`category`),from:fg(ng).optional(),to:fg(ng).optional()}),Ts({...yg,kind:Ls(`verified`),source:q().optional(),commit:q().min(1).optional().catch(void 0)}),Ts({...yg,kind:Ls(`candidate`),evidence:Y(mg),mode:fg(hg),method:fg(gg).optional(),...vg.shape,match:fg(_g).optional(),model:q().trim().min(1).optional().catch(void 0)}),Ts({...yg,kind:Ls(`candidate-gone`),evidence:Y(mg)}),Ts({...yg,kind:Ls(`candidate-filtered`),symbol:q()})]),Object.keys(bg.shape);function xg(e,t,n=()=>1){let r=new Map;for(let i of e){let e=t(i);r.set(e,(r.get(e)??0)+n(i))}return r}function Sg(e,t){return[e.filter(t),e.filter(e=>!t(e))]}Ts({input:ps(),cacheWrite5m:ps(),cacheWrite1h:ps(),cacheRead:ps(),output:ps()});var Cg=272e3,wg=1.5;Tg({input:8,output:40,cacheRead:.4}),Tg({input:2,output:10,cacheRead:.1}),Tg({input:2,output:10,cacheRead:.1}),Tg({input:1,output:5,cacheRead:.05}),Tg({input:10,output:50,cacheRead:1}),Tg({input:.1,output:.5,cacheRead:.01});function Tg({input:e,output:t,cacheRead:n}){return{input:e,output:t,cacheRead:n,longPrompt:{threshold:Cg,input:e*2,output:t*wg,cacheRead:n*2}}}var Eg={statsWeeks:12,statsDays:30,costTotalsDays:7,churnDays:90,memoryHistoryHours:Dh/x,staleUrgentDays:7,minFixesForEstimate:5,testFileGlobs:kh,testDirectories:Oh},Dg=Th(Eg),Og=ph(Eg),kg={cardLabel:e=>`Task ${e}`,title:`Task title`,description:`Task description`,leaveWithDraft:`Leave without saving the description?`,leaveWithFieldEdits:`Leave without saving your field edit?`,leaveWhileSaving:`The server still hasn't answered the save. If you leave now and it doesn't go through, your changes will be lost and you won't see an error. Leave anyway?`,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.`,saveTimedOut:`The backlog server did not answer in time, so the edit may have been saved. Once the server answers, this view will show what is on disk; if your edit is not there, repeat it.`,saveNotSent:`The edit was not sent: the backlog server never answered the previous save. Repeat it once the server answers.`,taskGone:e=>`Task ${e} is no longer in the backlog: it was deleted or moved.`,fieldNotSaved:e=>`"${e}" is not saved: leave the field once more to retry.`,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`},Ag={cardLabel:e=>`Задача ${e}`,title:`Название задачи`,description:`Описание задачи`,leaveWithDraft:`Уйти без сохранения описания?`,leaveWithFieldEdits:`Уйти, не сохранив правку поля?`,leaveWhileSaving:`Сервер всё ещё не ответил на сохранение. Если уйти сейчас и запись не пройдёт, изменения потеряются, а сообщения об ошибке вы не увидите. Всё равно уйти?`,createdLabel:`создана`,closedLabel:`Закрыта`,closedWithoutDate:`Закрыта, дата не записана`,reasonNotRecorded:`причина не записана`,restoreToBacklog:`Вернуть в беклог`,saving:`Сохраняем…`,saved:`Сохранено`,draftConflict:`Описание изменилось на диске, пока вы его правили. «Сохранить» перезапишет его вашим текстом, «Отмена» покажет актуальное.`,taskConflict:`Задача изменилась на диске, показана актуальная версия. Повторите правку.`,saveTimedOut:`Сервер беклога не ответил вовремя — правка могла записаться. Когда сервер ответит, здесь будет то, что на диске; если правки там нет, повторите.`,saveNotSent:`Правка не отправлена: сервер беклога так и не ответил на предыдущее сохранение. Повторите, когда он ответит.`,taskGone:e=>`Задачи ${e} больше нет в беклоге: её удалили или перенесли.`,fieldNotSaved: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} уже в списке`},jg=Ne((e=>{(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`;case O:return`ViewTransition`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=A.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(j.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function l(){var e=t(this.type);return ee[e]||(ee[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,"ref",{enumerable:!1,value:null}):Object.defineProperty(e,"ref",{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0){if(o){if(M(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`)}else f(p)}if(j.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,ne[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
75
+ `)}var Ph=[`done`,`cancelled`];function Fh(e){return Ph.some(t=>t===e)}function Ih(e,t){let n=new Map,r=new Map,i=new Map,a=new Map;for(let t of e){n.set(t.id,t);for(let e of t.blockedBy)Gh(r,e,t);for(let e of t.related)Gh(i,e,t);t.epic!==void 0&&Gh(a,t.epic,t)}return{byId:n,dependentsOf:r,relatedFrom:i,childrenOf:a,notLoaded:t}}function Lh(e,t){return Wh(e.blockedBy,t).filter(e=>!Fh(e.status))}function Rh(e,t){return Lh(e,t).length>0}function zh(e,t){return[...new Set([...e.blockedBy,...e.related])].filter(e=>!t.byId.has(e))}function Bh(e,t){return t.dependentsOf.get(e.id)??[]}function Vh(e,t){let n=[...Wh(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 Hh(e,t){return t.childrenOf.get(e.id)??[]}function Uh(e,t){if(e.status===`done`)return 100;if(e.type===`epic`){let n=Hh(e,t).filter(e=>e.status!==`cancelled`);return n.length===0?null:Kh(n.filter(e=>e.status===`done`).length,n.length)}let n=Mh(e.body);return n.length===0?null:Kh(n.filter(e=>e.checked).length,n.length)}function Wh(e,t){return e.flatMap(e=>t.byId.get(e)??[])}function Gh(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function Kh(e,t){return Math.round(e/t*100)}var qh=/^[A-Z][A-Z0-9]{0,9}-[1-9]\d*$/,Jh=/^[A-Z][A-Z0-9]{0,9}$/;function Yh(e){if(!qh.test(e))return null;let t=e.lastIndexOf(`-`);return{prefix:e.slice(0,t),number:Number(e.slice(t+1))}}function Xh(e,t){return`${e}-${t}`}function Zh(e,t){let n=Yh(e),r=Yh(t);return!n||!r?e.localeCompare(t):n.prefix===r.prefix?n.number-r.number:n.prefix.localeCompare(r.prefix)}function Qh(e){return{error:()=>e}}var $h=ps().int().min(0).max(100);function eg(e){let t=e.trim();return/^\d+$/u.test(t)?$h.safeParse(Number(t)).data:void 0}function tg(e){if(e==null)return;if(e===`none`)return e;let[t=``,n,...r]=e.split(`..`).map(e=>e.trim());if(n===void 0||r.length>0)return;let i=eg(t),a=eg(n);if(!(t!==``&&i===void 0||n!==``&&a===void 0)&&!(i===void 0&&a===void 0||(i??0)>(a??100)))return{min:i,max:a}}function ng(e){return e===`none`?e:`${e.min??``}..${e.max??``}`}var rg=[`task`,`epic`],ig=[`backlog`,`in-progress`,`blocked`,`done`,`cancelled`],ag=[`low`,`medium`,`high`,`critical`],og=[`bloaters`,`change-preventers`,`couplers`,`data-dealers`,`dispensables`,`functional-abusers`,`lexical-abusers`,`oo-abusers`,`obfuscators`,`bug`],sg=[`fixed`,`obsolete`,`duplicate`,`epic-done`],cg=`,`;function lg(e){return e.trim().toLowerCase()}function ug(e){return[...new Set(e.flatMap(e=>e.split(cg)).map(lg).filter(Boolean))]}var dg=q().regex(qh,Qh(`bad-id`)),fg=Cs(dg).default([]).transform(e=>[...new Set(e)]),pg=Ts({id:dg,title:q().trim().min(1,Qh(`empty-title`)),type:Y(rg).default(`task`),status:Y(ig).default(`backlog`),priority:Y(ag).default(`medium`),probability:$h.nullable().transform(e=>e??void 0).optional(),category:Y(og).optional(),tags:Cs(q()).default([]).transform(ug),epic:dg.optional(),blockedBy:fg,related:fg,created:lc({offset:!0}),source:q().optional(),anchor:q().optional(),closed:lc({offset:!0}).optional(),resolution:Y(sg).optional(),reason:q().optional(),verified:lc({offset:!0}).optional()});Ts({name:q().trim().min(1,Qh(`empty-name`)),prefix:q().regex(Jh,Qh(`bad-prefix`)),repos:Cs(q()).default([]),issuedUpTo:ps().int().nonnegative().optional(),active:_s().default(!0)});var mg=[`cli`,`web`,`check`,`sweep`],hg=`unknown`;function gg(e){return Y([...e,hg]).catch(hg)}var _g=[`review`,`incidental`,`manual`],vg=[`source-changed`,`source-missing`,`duplicate`,`no-source`],yg=[`full`,`changed`],bg=[`symbol`,`anchor`,`file`];[...bg];var xg=[`source`,`title`,`symbol`];[...xg];var Sg=Ts({bySymbol:_s().optional(),byAnchor:_s().optional()}),Cg={at:lc({offset:!0}),task:q().min(1),via:gg(mg),undo:Ls(!0).optional().catch(void 0)},wg=pg.extend({priority:gg(ag),category:gg(og).optional(),resolution:gg(sg).optional()});As(`kind`,[Ts({...Cg,kind:Ls(`created`),type:Y(rg),priority:gg(ag),tags:Cs(q()),source:q().optional(),epic:q().optional(),category:gg(og).optional(),found:gg(_g).optional(),origin:Ts({branch:q().optional(),commit:q().min(1)}).optional()}),Ts({...Cg,kind:Ls(`status`),from:Y(ig),to:Y(ig),resolution:gg(sg).optional()}),Ts({...Cg,kind:Ls(`priority`),from:gg(ag),to:gg(ag)}),Ts({...Cg,kind:Ls(`deleted`),snapshot:wg}),Ts({...Cg,kind:Ls(`category`),from:gg(og).optional(),to:gg(og).optional()}),Ts({...Cg,kind:Ls(`verified`),source:q().optional(),commit:q().min(1).optional().catch(void 0)}),Ts({...Cg,kind:Ls(`candidate`),evidence:Y(vg),mode:gg(yg),method:gg(bg).optional(),...Sg.shape,match:gg(xg).optional(),model:q().trim().min(1).optional().catch(void 0)}),Ts({...Cg,kind:Ls(`candidate-gone`),evidence:Y(vg)}),Ts({...Cg,kind:Ls(`candidate-filtered`),symbol:q()})]),Object.keys(wg.shape);function Tg(e,t,n=()=>1){let r=new Map;for(let i of e){let e=t(i);r.set(e,(r.get(e)??0)+n(i))}return r}function Eg(e,t){return[e.filter(t),e.filter(e=>!t(e))]}Ts({input:ps(),cacheWrite5m:ps(),cacheWrite1h:ps(),cacheRead:ps(),output:ps()});var Dg=272e3,Og=1.5;kg({input:8,output:40,cacheRead:.4}),kg({input:2,output:10,cacheRead:.1}),kg({input:2,output:10,cacheRead:.1}),kg({input:1,output:5,cacheRead:.05}),kg({input:10,output:50,cacheRead:1}),kg({input:.1,output:.5,cacheRead:.01});function kg({input:e,output:t,cacheRead:n}){return{input:e,output:t,cacheRead:n,longPrompt:{threshold:Dg,input:e*2,output:t*Og,cacheRead:n*2}}}var Ag={statsWeeks:12,statsDays:30,costTotalsDays:7,churnDays:90,memoryHistoryHours:Dh/x,staleUrgentDays:7,minFixesForEstimate:5,testFileGlobs:kh,testDirectories:Oh},jg=Th(Ag),Mg=ph(Ag),Ng={cardLabel:e=>`Task ${e}`,title:`Task title`,description:`Task description`,leaveWithDraft:`Leave without saving the description?`,leaveWithFieldEdits:`Leave without saving your field edit?`,leaveWhileSaving:`The server still hasn't answered the save. If you leave now and it doesn't go through, your changes will be lost and you won't see an error. Leave anyway?`,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.`,saveTimedOut:`The backlog server did not answer in time, so the edit may have been saved. Once the server answers, this view will show what is on disk; if your edit is not there, repeat it.`,saveNotSent:`The edit was not sent: the backlog server never answered the previous save. Repeat it once the server answers.`,taskGone:e=>`Task ${e} is no longer in the backlog: it was deleted or moved.`,fieldNotSaved:e=>`"${e}" is not saved: leave the field once more to retry.`,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`,probabilityField:`Probability, %`,probabilityPlaceholder:`Not estimated`,invalidProbability:`Enter a whole number from 0 to 100.`,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`},Pg={cardLabel:e=>`Задача ${e}`,title:`Название задачи`,description:`Описание задачи`,leaveWithDraft:`Уйти без сохранения описания?`,leaveWithFieldEdits:`Уйти, не сохранив правку поля?`,leaveWhileSaving:`Сервер всё ещё не ответил на сохранение. Если уйти сейчас и запись не пройдёт, изменения потеряются, а сообщения об ошибке вы не увидите. Всё равно уйти?`,createdLabel:`создана`,closedLabel:`Закрыта`,closedWithoutDate:`Закрыта, дата не записана`,reasonNotRecorded:`причина не записана`,restoreToBacklog:`Вернуть в беклог`,saving:`Сохраняем…`,saved:`Сохранено`,draftConflict:`Описание изменилось на диске, пока вы его правили. «Сохранить» перезапишет его вашим текстом, «Отмена» покажет актуальное.`,taskConflict:`Задача изменилась на диске, показана актуальная версия. Повторите правку.`,saveTimedOut:`Сервер беклога не ответил вовремя — правка могла записаться. Когда сервер ответит, здесь будет то, что на диске; если правки там нет, повторите.`,saveNotSent:`Правка не отправлена: сервер беклога так и не ответил на предыдущее сохранение. Повторите, когда он ответит.`,taskGone:e=>`Задачи ${e} больше нет в беклоге: её удалили или перенесли.`,fieldNotSaved:e=>`Поле «${e}» не сохранено: выйдите из поля ещё раз, чтобы повторить.`,fieldConflict:e=>`Поле «${e}» изменилось на диске, пока вы его правили. В поле остался ваш вариант: выйдите из поля ещё раз, чтобы записать его поверх.`,statusField:`Статус`,priorityField:`Приоритет`,probabilityField:`Вероятность, %`,probabilityPlaceholder:`Не оценено`,invalidProbability:`Введите целое число от 0 до 100.`,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} уже в списке`},Fg=Ne((e=>{(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`;case O:return`ViewTransition`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=A.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(j.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function l(){var e=t(this.type);return ee[e]||(ee[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,"ref",{enumerable:!1,value:null}):Object.defineProperty(e,"ref",{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0){if(o){if(M(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`)}else f(p)}if(j.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,ne[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
76
76
  let props = %s;
77
77
  <%s {...props} />
78
78
  React keys must be passed directly to JSX without using spread:
79
79
  let props = %s;
80
- <%s key={someKey} {...props} />`,o,p,m,p),ne[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=dc(),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.view_transition`),k=Symbol.for(`react.client.reference`),A=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var P,ee={},F=m.react_stack_bottom_frame.bind(m,o)(),te=N(i(o)),ne={};e.Fragment=_,e.jsxDEV=function(e,t,n,r){var a=1e4>A.recentlyCreatedOwnerStacks++;if(a){var o=Error.stackTraceLimit;Error.stackTraceLimit=10;var s=Error(`react-stack-top-frame`);Error.stackTraceLimit=o}else s=F;return d(e,t,n,r,s,a?N(i(e)):te)}})()})),Mg=Ne(((e,t)=>{t.exports=jg()})),Ng=Mg(),Pg=`/home/runner/work/p-backlog/p-backlog/src/web/i18n.tsx`,Fg={ru:{app:me,layout:Qm,list:nh,task:Ag,stats:Dg,ui:i},en:{app:se,layout:Zm,list:eh,task:kg,stats:Og,ui:h}},Ig=(0,X.createContext)(null),Lg=(0,X.createContext)(null),Rg={ru:{...Fg.ru,core:Xm(`ru`)},en:{...Fg.en,core:Xm(`en`)}};function zg({language:e,children:t}){return(0,X.useEffect)(()=>{document.documentElement.lang=e},[e]),(0,Ng.jsxDEV)(Ig.Provider,{value:e,children:(0,Ng.jsxDEV)(Lg.Provider,{value:Rg[e],children:t},void 0,!1,{fileName:Pg,lineNumber:38,columnNumber:7},this)},void 0,!1,{fileName:Pg,lineNumber:37,columnNumber:5},this)}function Bg(){let e=(0,X.useContext)(Ig);if(e===null)throw Error(`MessagesProvider is not mounted`);return e}function Vg(){let e=(0,X.useContext)(Lg);if(e===null)throw Error(`MessagesProvider is not mounted`);return e}function Hg(e){return e.replace(/^\n+/,``).trimEnd()}var Ug={overview:`/stats`,code:`/stats/code`,effect:`/stats/effect`,quality:`/stats/quality`,signals:`/stats/signals`,cost:`/stats/cost`},Wg=`/stats/memory`,Gg=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`}},Kg={readMs:6e4,writeMs:12e4},qg=0,Jg=-1,Yg=404,Xg=409,Zg=500,Qg=new Set([502,504]),$g=503;function e_(e){if(e instanceof Gg)return e.status===qg?`unreachable`:e.status===Jg?`timedOut`:e.status===Yg?`notFound`:e.status===Xg?`conflict`:e.status>=Zg?`serverFailure`:`rejected`}function t_(e,{readMs:t,writeMs:n}=Kg){let r=async(r,i={})=>{let a=(i.method??`GET`)===`GET`?t:n,o=AbortSignal.timeout(a),s=i.signal?n_(i.signal,o):o,c=await e(r,{...i,signal:s}).catch(e=>{throw i_(e)});if(Qg.has(c.status))throw r_();let l=await c.json().catch(e=>{throw i_(e)});if(c.ok)return l;let{errors:u=[],current:d}=l;throw c.status===$g&&u.length===0?r_():new Gg(c.status,u,d)};return{projects:e=>r(`/api/projects`,e),setProjectActive:(e,t)=>r(a_(e),o_(`PATCH`,{active:t})),deleteProject:async(e,t)=>{await r(a_(e),o_(`DELETE`,{confirm:t}))},tasks:e=>r(`/api/tasks`,e),updateTask:(e,t,n,i)=>r(`/api/tasks/${encodeURIComponent(e)}`,{...o_(`PATCH`,{version:t,changes:n}),...i}),batchTasks:e=>r(`/api/tasks/batch`,o_(`POST`,e)),statsReport:(e,t,n)=>r(s_(`/api${Ug[e]}`,t),n),memorySamples:e=>r(`/api${Wg}`,e),settings:e=>r(`/api/settings`,e),setLanguage:e=>r(`/api/settings`,o_(`PATCH`,{language:e})),writeDeadline:()=>AbortSignal.timeout(n)}}function n_(e,t){let n=new AbortController;for(let r of[e,t])r.aborted?n.abort(r.reason):r.addEventListener(`abort`,()=>n.abort(r.reason),{once:!0});return n.signal}function r_(){return new Gg(qg,[])}function i_(e){return e instanceof Error&&e.name===`TimeoutError`?new Gg(Jg,[]):r_()}function a_(e){return`/api/projects/${encodeURIComponent(e)}`}function o_(e,t){return{method:e,body:JSON.stringify(t),headers:{"content-type":`application/json`}}}function s_(e,t){return t===void 0?e:`${e}?project=${encodeURIComponent(t)}`}var c_={fixed:`done`,obsolete:`cancelled`,duplicate:`cancelled`,"epic-done":`done`};function l_(e){return e.split(`
81
- `).map(e=>e.trim()).filter(e=>e!==``).join(` `)}function u_(e,t){if(!Fh(e.status)||e.closed===void 0)return;let n=d_(e,t);return n===void 0?{at:new Date(Date.parse(e.closed)+7*be)}:{afterEpic:n}}function d_(e,t){if(e.epic===void 0)return;let n=t.byId.get(e.epic);if(n===void 0)return t.notLoaded.has(e.epic)?e.epic:void 0;if(n.type!==`epic`)return;let r=f_(n)&&p_(n,t).length>0;return!Fh(n.status)||r?n.id:void 0}function f_(e){return e.type===`epic`&&Fh(e.status)&&e.resolution===`epic-done`}function p_(e,t){return Hh(e,t).flatMap(e=>Fh(e.status)?[]:[e.id])}function m_(e,t){return e.kind===`close`&&t.type===`epic`}var h_=Ts({language:Y(we)}),g_=Cs(sg),__=Es({title:q().optional(),type:Y($h).optional(),status:Y(eg).optional(),priority:Y(tg).optional(),tags:Cs(q()).optional(),epic:sg.nullable().optional(),blockedBy:g_.optional(),related:g_.optional(),body:q().optional(),category:Y(ng).nullable().optional()});Es({active:_s()}),Es({confirm:q()}),Es(h_.shape),Es({version:q().min(1),changes:__});var v_=Es({status:Y(eg),priority:Y(tg),epic:sg.nullable()});Es({tasks:Cs(Es({id:sg,version:q().min(1)})).min(1).max(500).refine(e=>new Set(e.map(e=>e.id)).size===e.length),action:As(`kind`,[Es({kind:Ls(`close`),reason:q().transform(l_).pipe(q().min(1))}),Es({kind:Ls(`priority`),priority:Y(tg)}),Es({kind:Ls(`epic`),epic:sg.nullable()}),Es({kind:Ls(`restore`),changes:Ps(sg,v_)})])});var y_=`p-backlog:events`,b_=`p-backlog:events`,x_=[`open`,`change`],S_=5e3;function C_(e){if(!(`locks`in navigator)||typeof BroadcastChannel>`u`)return new EventSource(e);let t=new Map,n=(e,n)=>t.get(e)?.forEach(t=>t(new MessageEvent(e,{data:n}))),r=new BroadcastChannel(b_);r.onmessage=e=>{D_(e.data)&&n(e.data.type,e.data.data)};let i=w_(e,(e,t)=>{n(e,t),r.postMessage({type:e,data:t})});return{addEventListener:(e,n)=>t.set(e,(t.get(e)??new Set).add(n)),close:()=>{i(),r.close()}}}function w_(e,t){let n=new AbortController,r,i=()=>new Promise(i=>{if(n.signal.aborted){i();return}let o=E_(e,t),s=()=>{n.signal.removeEventListener(`abort`,s),o.close(),i()};o.addEventListener(`error`,()=>{o.readyState===EventSource.CLOSED&&(s(),r=setTimeout(a,S_))}),n.signal.addEventListener(`abort`,s,{once:!0})}),a=()=>{navigator.locks.request(y_,{signal:n.signal},i).catch(e=>{if(!T_(e))throw e})};return a(),()=>{clearTimeout(r),n.abort()}}function T_(e){return e instanceof DOMException&&e.name===`AbortError`}function E_(e,t){let n=new EventSource(e);for(let e of x_)n.addEventListener(e,n=>t(e,n.data));return n}function D_(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&`data`in e}var O_=`/home/runner/work/p-backlog/p-backlog/src/web/app/backlog-api.tsx`,k_=(0,X.createContext)(null),A_={client:t_((e,t)=>fetch(e,t)),openEvents:()=>C_(`/api/events`),batchChunkSize:500};function j_({api:e,children:t}){return(0,Ng.jsxDEV)(k_.Provider,{value:e,children:t},void 0,!1,{fileName:O_,lineNumber:19,columnNumber:10},this)}function M_(){let e=(0,X.useContext)(k_);if(!e)throw Error(`BacklogApiProvider is not mounted`);return e}function N_(e,t){let[n,r]=Sg(e,e=>m_(t,e));return{tasks:[...r,...n].map(({id:e,version:t})=>({id:e,version:t})),action:t}}var P_=class extends Error{done;rest;failure;constructor(e,t,n){super(n.message),this.done=e,this.rest=t,this.failure=n,this.name=`PartialBatchError`}};async function F_(e,{tasks:t,action:n},r){let i=[];for(let a=0;a<t.length;a+=r){let o=t.slice(a,a+r);try{let t=await e.batchTasks(I_(n,o));i.push(...t.results)}catch(e){throw a===0||!(e instanceof Error)?e:new P_({results:i},I_(n,t.slice(a)),e)}}return{results:i}}function I_(e,t){return{tasks:t,action:L_(e,t)}}function L_(e,t){if(e.kind!==`restore`)return e;let n=new Set(t.map(({id:e})=>e));return{kind:`restore`,changes:Object.fromEntries(Object.entries(e.changes).filter(([e])=>n.has(e)))}}var R_=[`projects`],z_=[`tasks`],B_=[`stats`],V_=[`settings`],H_=[...B_,`memory`],U_=[z_,R_];function W_(e,t){return[...B_,e,{projectId:t}]}function G_(e){return q_(e,[...U_,B_])}function K_(e){return q_(e,U_)}function q_(e,t){return Promise.all(t.map(t=>e.invalidateQueries({queryKey:t})))}var J_=6e4,Y_=1e4;function X_(){let{client:e}=M_();return Ml({queryKey:V_,queryFn:({signal:t})=>e.settings({signal:t})})}function Z_(){let{client:e}=M_(),t=gc();return Nl({mutationFn:t=>e.setLanguage(t),onSuccess:e=>{t.setQueryData(V_,e),t.invalidateQueries()}})}function Q_(){let{client:e}=M_();return Ml({queryKey:R_,queryFn:({signal:t})=>e.projects({signal:t}),select:ev})}function $_(){let{client:e}=M_();return Ml({queryKey:z_,queryFn:({signal:t})=>e.tasks({signal:t})})}function ev(e){return e.projects}function tv(e,t){return av(e,t,{staleTime:J_})}function nv(e){return av(`cost`,e,{staleTime:0,refetchInterval:e=>iv(e.state.data?.scan)?Y_:!1})}function rv(){let{client:e}=M_();return Ml({queryKey:H_,queryFn:({signal:t})=>e.memorySamples({signal:t}),refetchInterval:Eh,initialData:{samples:[]}})}function iv(e){return e===void 0?!1:!e.listed||e.bytesLeft>0}function av(e,t,n){let{client:r}=M_();return Ml({queryKey:W_(e,t),queryFn:({signal:n})=>r.statsReport(e,t,{signal:n}),...n})}function ov(){let{client:e}=M_(),t=gc();return Nl({mutationFn:({id:t,active:n})=>e.setProjectActive(t,n),onSuccess:()=>void G_(t)})}function sv(){let{client:e}=M_(),t=gc();return Nl({mutationFn:({id:t,confirm:n})=>e.deleteProject(t,n),onSuccess:()=>void G_(t)})}var cv={id:`task-saves`},lv=class extends Error{constructor(){super(`the save waited in the queue past its answer deadline and was not sent`),this.name=`SaveNotSentError`}},uv=class extends Error{taskId;constructor(e){super(`task ${e} is not in the loaded backlog`),this.taskId=e,this.name=`TaskGoneError`}};function dv(){let{client:e}=M_(),t=gc(),{mutateAsync:n}=Nl({scope:cv,mutationFn:async({id:n,change:r,bodyEdit:i,answerBy:a})=>{if(a.aborted)throw new lv;let o=gv(t,n);if(!o)throw new uv(n);let s=r(o),c={signal:a};return fv(o,s,()=>i===void 0?e.updateTask(n,o.version,s,c):hv(e,n,s,i,c))},onSuccess:({saved:e})=>_v(t,e),onSettled:()=>K_(t)});return{save:t=>n({...t,answerBy:e.writeDeadline()})}}async function fv(e,t,n){try{return{before:e,saved:await n()}}catch(e){let n=e instanceof Gg?e.current:void 0;if(n!==void 0&&pv(n,t))return{before:n,saved:n};throw e}}function pv(e,t){let{body:n,...r}=t;return(n===void 0||Hg(e.body)===Hg(n))&&Object.entries(r).every(([t,n])=>JSON.stringify(e[t]??null)===JSON.stringify(n??null))}function mv(){let{client:e,batchChunkSize:t}=M_(),n=gc();return Nl({scope:cv,mutationFn:n=>F_(e,n,t),onSettled:()=>K_(n)})}async function hv(e,t,n,r,i){try{return await e.updateTask(t,r.version,n,i)}catch(a){if(!(a instanceof Gg)||a.current?.body!==r.body)throw a;return await e.updateTask(t,a.current.version,n,i)}}function gv(e,t){return e.getQueryData(z_)?.tasks.find(e=>e.id===t)}function _v(e,t){e.setQueryData(z_,e=>e===void 0?e:{...e,tasks:e.tasks.map(e=>e.id===t.id?t:e)})}function vv(...e){return e.filter(Boolean).join(` `)}var yv={notice:`_notice_1bs5e_1`},bv=`/home/runner/work/p-backlog/p-backlog/src/web/ui/Notice.tsx`;function xv({as:e=`p`,shown:t=!0,className:n,...r}){return(0,Ng.jsxDEV)(e,{className:t?vv(yv.notice,n):`visually-hidden`,...r},void 0,!1,{fileName:bv,lineNumber:8,columnNumber:10},this)}var Sv={heading:`_heading_1wasa_1`,headingRow:`_headingRow_1wasa_9`,message:`_message_1wasa_22`,hint:`_hint_1wasa_27`,waiting:`_waiting_1wasa_36`},Cv=`/home/runner/work/p-backlog/p-backlog/src/web/ui/Page.tsx`;function wv({ref:e,children:t,actions:n}){let r=(0,Ng.jsxDEV)(`h1`,{ref:e,tabIndex:-1,className:Sv.heading,children:t},void 0,!1,{fileName:Cv,lineNumber:7,columnNumber:5},this);return n===void 0?r:(0,Ng.jsxDEV)(`div`,{className:Sv.headingRow,children:[r,n]},void 0,!0,{fileName:Cv,lineNumber:13,columnNumber:5},this)}function Tv({as:e=`div`,className:t,...n}){return(0,Ng.jsxDEV)(e,{className:vv(Sv.message,t),...n},void 0,!1,{fileName:Cv,lineNumber:23,columnNumber:10},this)}var Ev={hidden:`visually-hidden`,shown:vv(Sv.message,Sv.hint),waiting:vv(Sv.message,Sv.hint,Sv.waiting)};function Dv({ref:e,state:t,children:n}){return(0,Ng.jsxDEV)(`div`,{ref:e,tabIndex:-1,role:`status`,"aria-live":`polite`,className:Ev[t],children:n},void 0,!1,{fileName:Cv,lineNumber:38,columnNumber:5},this)}export{Uh as $,Zc as $t,e_ as A,Dd as At,ag as B,nu as Bt,N_ as C,Pe as Cn,Wf as Ct,c_ as D,ep as Dt,M_ as E,Qf as Et,xg as F,$l as Ft,Yh as G,Ul as Gt,qh as H,Nu as Ht,tg as I,Mu as It,Hh as J,$ as Jt,Ih as K,Q as Kt,ng as L,Uu as Lt,Bg as M,pd as Mt,Vg as N,Vu as Nt,u_ as O,Yf as Ot,Mg as P,Bu as Pt,Vh as Q,Qc as Qt,eg as R,Fu as Rt,P_ as S,Ne as Sn,Kf as St,A_ as T,$f as Tt,Zh as U,Tu as Ut,og as V,Ku as Vt,Xh as W,zl as Wt,Fh as X,_l as Xt,Rh as Y,Pl as Yt,zh as Z,sl as Zt,$_ as _,rc as _n,yp as _t,vv as a,Dc as an,kp as at,B_ as b,q as bn,Uf as bt,mv as c,Ac as cn,lp as ct,rv as d,_c as dn,Fp as dt,Jc as en,Mh as et,Q_ as f,gc as fn,pp as ft,tv as g,Cs as gn,vp as gt,X_ as h,Y as hn,gp as ht,xv as i,Oc as in,Np as it,zg as j,ud as jt,Gg as k,Jf as kt,nv as l,Z as ln,up as lt,ov as m,dc as mn,_p as mt,Dv as n,Cc as nn,Xm as nt,lv as o,Ec as on,jp as ot,Z_ as p,pc as pn,Pp as pt,Bh as q,Wl as qt,Tv as r,kc as rn,Rp as rt,uv as s,Sc as sn,Ap as st,wv as t,qc as tn,Nh as tt,sv as u,Vc as un,dp as ut,dv as v,ps as vn,bp as vt,j_ as w,Ie as wn,Xf as wt,G_ as x,jo as xn,Gf as xt,U_ as y,Ts as yn,Zf as yt,$h as z,xu as zt};
80
+ <%s key={someKey} {...props} />`,o,p,m,p),ne[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=dc(),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.view_transition`),k=Symbol.for(`react.client.reference`),A=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var P,ee={},F=m.react_stack_bottom_frame.bind(m,o)(),te=N(i(o)),ne={};e.Fragment=_,e.jsxDEV=function(e,t,n,r){var a=1e4>A.recentlyCreatedOwnerStacks++;if(a){var o=Error.stackTraceLimit;Error.stackTraceLimit=10;var s=Error(`react-stack-top-frame`);Error.stackTraceLimit=o}else s=F;return d(e,t,n,r,s,a?N(i(e)):te)}})()})),Ig=Ne(((e,t)=>{t.exports=Fg()})),Lg=Ig(),Rg=`/home/runner/work/p-backlog/p-backlog/src/web/i18n.tsx`,zg={ru:{app:me,layout:Qm,list:nh,task:Pg,stats:jg,ui:i},en:{app:se,layout:Zm,list:eh,task:Ng,stats:Mg,ui:h}},Bg=(0,X.createContext)(null),Vg=(0,X.createContext)(null),Hg={ru:{...zg.ru,core:Xm(`ru`)},en:{...zg.en,core:Xm(`en`)}};function Ug({language:e,children:t}){return(0,X.useEffect)(()=>{document.documentElement.lang=e},[e]),(0,Lg.jsxDEV)(Bg.Provider,{value:e,children:(0,Lg.jsxDEV)(Vg.Provider,{value:Hg[e],children:t},void 0,!1,{fileName:Rg,lineNumber:38,columnNumber:7},this)},void 0,!1,{fileName:Rg,lineNumber:37,columnNumber:5},this)}function Wg(){let e=(0,X.useContext)(Bg);if(e===null)throw Error(`MessagesProvider is not mounted`);return e}function Gg(){let e=(0,X.useContext)(Vg);if(e===null)throw Error(`MessagesProvider is not mounted`);return e}function Kg(e){return e.replace(/^\n+/,``).trimEnd()}var qg={overview:`/stats`,code:`/stats/code`,effect:`/stats/effect`,quality:`/stats/quality`,signals:`/stats/signals`,cost:`/stats/cost`},Jg=`/stats/memory`,Yg=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`}},Xg={readMs:6e4,writeMs:12e4},Zg=0,Qg=-1,$g=404,e_=409,t_=500,n_=new Set([502,504]),r_=503;function i_(e){if(e instanceof Yg)return e.status===Zg?`unreachable`:e.status===Qg?`timedOut`:e.status===$g?`notFound`:e.status===e_?`conflict`:e.status>=t_?`serverFailure`:`rejected`}function a_(e,{readMs:t,writeMs:n}=Xg){let r=async(r,i={})=>{let a=(i.method??`GET`)===`GET`?t:n,o=AbortSignal.timeout(a),s=i.signal?o_(i.signal,o):o,c=await e(r,{...i,signal:s}).catch(e=>{throw c_(e)});if(n_.has(c.status))throw s_();let l=await c.json().catch(e=>{throw c_(e)});if(c.ok)return l;let{errors:u=[],current:d}=l;throw c.status===r_&&u.length===0?s_():new Yg(c.status,u,d)};return{projects:e=>r(`/api/projects`,e),setProjectActive:(e,t)=>r(l_(e),u_(`PATCH`,{active:t})),deleteProject:async(e,t)=>{await r(l_(e),u_(`DELETE`,{confirm:t}))},tasks:e=>r(`/api/tasks`,e),updateTask:(e,t,n,i)=>r(`/api/tasks/${encodeURIComponent(e)}`,{...u_(`PATCH`,{version:t,changes:n}),...i}),batchTasks:e=>r(`/api/tasks/batch`,u_(`POST`,e)),statsReport:(e,t,n)=>r(d_(`/api${qg[e]}`,t),n),memorySamples:e=>r(`/api${Jg}`,e),settings:e=>r(`/api/settings`,e),setLanguage:e=>r(`/api/settings`,u_(`PATCH`,{language:e})),writeDeadline:()=>AbortSignal.timeout(n)}}function o_(e,t){let n=new AbortController;for(let r of[e,t])r.aborted?n.abort(r.reason):r.addEventListener(`abort`,()=>n.abort(r.reason),{once:!0});return n.signal}function s_(){return new Yg(Zg,[])}function c_(e){return e instanceof Error&&e.name===`TimeoutError`?new Yg(Qg,[]):s_()}function l_(e){return`/api/projects/${encodeURIComponent(e)}`}function u_(e,t){return{method:e,body:JSON.stringify(t),headers:{"content-type":`application/json`}}}function d_(e,t){return t===void 0?e:`${e}?project=${encodeURIComponent(t)}`}var f_={fixed:`done`,obsolete:`cancelled`,duplicate:`cancelled`,"epic-done":`done`};function p_(e){return e.split(`
81
+ `).map(e=>e.trim()).filter(e=>e!==``).join(` `)}function m_(e,t){if(!Fh(e.status)||e.closed===void 0)return;let n=h_(e,t);return n===void 0?{at:new Date(Date.parse(e.closed)+7*be)}:{afterEpic:n}}function h_(e,t){if(e.epic===void 0)return;let n=t.byId.get(e.epic);if(n===void 0)return t.notLoaded.has(e.epic)?e.epic:void 0;if(n.type!==`epic`)return;let r=g_(n)&&__(n,t).length>0;return!Fh(n.status)||r?n.id:void 0}function g_(e){return e.type===`epic`&&Fh(e.status)&&e.resolution===`epic-done`}function __(e,t){return Hh(e,t).flatMap(e=>Fh(e.status)?[]:[e.id])}function v_(e,t){return e.kind===`close`&&t.type===`epic`}var y_=Ts({language:Y(we)}),b_=Cs(dg),x_=Es({title:q().optional(),type:Y(rg).optional(),status:Y(ig).optional(),priority:Y(ag).optional(),probability:$h.nullable().optional(),tags:Cs(q()).optional(),epic:dg.nullable().optional(),blockedBy:b_.optional(),related:b_.optional(),body:q().optional(),category:Y(og).nullable().optional()});Es({active:_s()}),Es({confirm:q()}),Es(y_.shape),Es({version:q().min(1),changes:x_});var S_=Es({status:Y(ig),priority:Y(ag),epic:dg.nullable()});Es({tasks:Cs(Es({id:dg,version:q().min(1)})).min(1).max(500).refine(e=>new Set(e.map(e=>e.id)).size===e.length),action:As(`kind`,[Es({kind:Ls(`close`),reason:q().transform(p_).pipe(q().min(1))}),Es({kind:Ls(`priority`),priority:Y(ag)}),Es({kind:Ls(`epic`),epic:dg.nullable()}),Es({kind:Ls(`restore`),changes:Ps(dg,S_)})])});var C_=`p-backlog:events`,w_=`p-backlog:events`,T_=[`open`,`change`],E_=5e3;function D_(e){if(!(`locks`in navigator)||typeof BroadcastChannel>`u`)return new EventSource(e);let t=new Map,n=(e,n)=>t.get(e)?.forEach(t=>t(new MessageEvent(e,{data:n}))),r=new BroadcastChannel(w_);r.onmessage=e=>{j_(e.data)&&n(e.data.type,e.data.data)};let i=O_(e,(e,t)=>{n(e,t),r.postMessage({type:e,data:t})});return{addEventListener:(e,n)=>t.set(e,(t.get(e)??new Set).add(n)),close:()=>{i(),r.close()}}}function O_(e,t){let n=new AbortController,r,i=()=>new Promise(i=>{if(n.signal.aborted){i();return}let o=A_(e,t),s=()=>{n.signal.removeEventListener(`abort`,s),o.close(),i()};o.addEventListener(`error`,()=>{o.readyState===EventSource.CLOSED&&(s(),r=setTimeout(a,E_))}),n.signal.addEventListener(`abort`,s,{once:!0})}),a=()=>{navigator.locks.request(C_,{signal:n.signal},i).catch(e=>{if(!k_(e))throw e})};return a(),()=>{clearTimeout(r),n.abort()}}function k_(e){return e instanceof DOMException&&e.name===`AbortError`}function A_(e,t){let n=new EventSource(e);for(let e of T_)n.addEventListener(e,n=>t(e,n.data));return n}function j_(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&`data`in e}var M_=`/home/runner/work/p-backlog/p-backlog/src/web/app/backlog-api.tsx`,N_=(0,X.createContext)(null),P_={client:a_((e,t)=>fetch(e,t)),openEvents:()=>D_(`/api/events`),batchChunkSize:500};function F_({api:e,children:t}){return(0,Lg.jsxDEV)(N_.Provider,{value:e,children:t},void 0,!1,{fileName:M_,lineNumber:19,columnNumber:10},this)}function I_(){let e=(0,X.useContext)(N_);if(!e)throw Error(`BacklogApiProvider is not mounted`);return e}function L_(e,t){let[n,r]=Eg(e,e=>v_(t,e));return{tasks:[...r,...n].map(({id:e,version:t})=>({id:e,version:t})),action:t}}var R_=class extends Error{done;rest;failure;constructor(e,t,n){super(n.message),this.done=e,this.rest=t,this.failure=n,this.name=`PartialBatchError`}};async function z_(e,{tasks:t,action:n},r){let i=[];for(let a=0;a<t.length;a+=r){let o=t.slice(a,a+r);try{let t=await e.batchTasks(B_(n,o));i.push(...t.results)}catch(e){throw a===0||!(e instanceof Error)?e:new R_({results:i},B_(n,t.slice(a)),e)}}return{results:i}}function B_(e,t){return{tasks:t,action:V_(e,t)}}function V_(e,t){if(e.kind!==`restore`)return e;let n=new Set(t.map(({id:e})=>e));return{kind:`restore`,changes:Object.fromEntries(Object.entries(e.changes).filter(([e])=>n.has(e)))}}var H_=[`projects`],U_=[`tasks`],W_=[`stats`],G_=[`settings`],K_=[...W_,`memory`],q_=[U_,H_];function J_(e,t){return[...W_,e,{projectId:t}]}function Y_(e){return Z_(e,[...q_,W_])}function X_(e){return Z_(e,q_)}function Z_(e,t){return Promise.all(t.map(t=>e.invalidateQueries({queryKey:t})))}var Q_=6e4,$_=1e4;function ev(){let{client:e}=I_();return Ml({queryKey:G_,queryFn:({signal:t})=>e.settings({signal:t})})}function tv(){let{client:e}=I_(),t=gc();return Nl({mutationFn:t=>e.setLanguage(t),onSuccess:e=>{t.setQueryData(G_,e),t.invalidateQueries()}})}function nv(){let{client:e}=I_();return Ml({queryKey:H_,queryFn:({signal:t})=>e.projects({signal:t}),select:iv})}function rv(){let{client:e}=I_();return Ml({queryKey:U_,queryFn:({signal:t})=>e.tasks({signal:t})})}function iv(e){return e.projects}function av(e,t){return lv(e,t,{staleTime:Q_})}function ov(e){return lv(`cost`,e,{staleTime:0,refetchInterval:e=>cv(e.state.data?.scan)?$_:!1})}function sv(){let{client:e}=I_();return Ml({queryKey:K_,queryFn:({signal:t})=>e.memorySamples({signal:t}),refetchInterval:Eh,initialData:{samples:[]}})}function cv(e){return e===void 0?!1:!e.listed||e.bytesLeft>0}function lv(e,t,n){let{client:r}=I_();return Ml({queryKey:J_(e,t),queryFn:({signal:n})=>r.statsReport(e,t,{signal:n}),...n})}function uv(){let{client:e}=I_(),t=gc();return Nl({mutationFn:({id:t,active:n})=>e.setProjectActive(t,n),onSuccess:()=>void Y_(t)})}function dv(){let{client:e}=I_(),t=gc();return Nl({mutationFn:({id:t,confirm:n})=>e.deleteProject(t,n),onSuccess:()=>void Y_(t)})}var fv={id:`task-saves`},pv=class extends Error{constructor(){super(`the save waited in the queue past its answer deadline and was not sent`),this.name=`SaveNotSentError`}},mv=class extends Error{taskId;constructor(e){super(`task ${e} is not in the loaded backlog`),this.taskId=e,this.name=`TaskGoneError`}};function hv(){let{client:e}=I_(),t=gc(),{mutateAsync:n}=Nl({scope:fv,mutationFn:async({id:n,change:r,bodyEdit:i,answerBy:a})=>{if(a.aborted)throw new pv;let o=bv(t,n);if(!o)throw new mv(n);let s=r(o),c={signal:a};return gv(o,s,()=>i===void 0?e.updateTask(n,o.version,s,c):yv(e,n,s,i,c))},onSuccess:({saved:e})=>xv(t,e),onSettled:()=>X_(t)});return{save:t=>n({...t,answerBy:e.writeDeadline()})}}async function gv(e,t,n){try{return{before:e,saved:await n()}}catch(e){let n=e instanceof Yg?e.current:void 0;if(n!==void 0&&_v(n,t))return{before:n,saved:n};throw e}}function _v(e,t){let{body:n,...r}=t;return(n===void 0||Kg(e.body)===Kg(n))&&Object.entries(r).every(([t,n])=>JSON.stringify(e[t]??null)===JSON.stringify(n??null))}function vv(){let{client:e,batchChunkSize:t}=I_(),n=gc();return Nl({scope:fv,mutationFn:n=>z_(e,n,t),onSettled:()=>X_(n)})}async function yv(e,t,n,r,i){try{return await e.updateTask(t,r.version,n,i)}catch(a){if(!(a instanceof Yg)||a.current?.body!==r.body)throw a;return await e.updateTask(t,a.current.version,n,i)}}function bv(e,t){return e.getQueryData(U_)?.tasks.find(e=>e.id===t)}function xv(e,t){e.setQueryData(U_,e=>e===void 0?e:{...e,tasks:e.tasks.map(e=>e.id===t.id?t:e)})}function Sv(...e){return e.filter(Boolean).join(` `)}var Cv={notice:`_notice_1bs5e_1`},wv=`/home/runner/work/p-backlog/p-backlog/src/web/ui/Notice.tsx`;function Tv({as:e=`p`,shown:t=!0,className:n,...r}){return(0,Lg.jsxDEV)(e,{className:t?Sv(Cv.notice,n):`visually-hidden`,...r},void 0,!1,{fileName:wv,lineNumber:8,columnNumber:10},this)}var Ev={heading:`_heading_1wasa_1`,headingRow:`_headingRow_1wasa_9`,message:`_message_1wasa_22`,hint:`_hint_1wasa_27`,waiting:`_waiting_1wasa_36`},Dv=`/home/runner/work/p-backlog/p-backlog/src/web/ui/Page.tsx`;function Ov({ref:e,children:t,actions:n}){let r=(0,Lg.jsxDEV)(`h1`,{ref:e,tabIndex:-1,className:Ev.heading,children:t},void 0,!1,{fileName:Dv,lineNumber:7,columnNumber:5},this);return n===void 0?r:(0,Lg.jsxDEV)(`div`,{className:Ev.headingRow,children:[r,n]},void 0,!0,{fileName:Dv,lineNumber:13,columnNumber:5},this)}function kv({as:e=`div`,className:t,...n}){return(0,Lg.jsxDEV)(e,{className:Sv(Ev.message,t),...n},void 0,!1,{fileName:Dv,lineNumber:23,columnNumber:10},this)}var Av={hidden:`visually-hidden`,shown:Sv(Ev.message,Ev.hint),waiting:Sv(Ev.message,Ev.hint,Ev.waiting)};function jv({ref:e,state:t,children:n}){return(0,Lg.jsxDEV)(`div`,{ref:e,tabIndex:-1,role:`status`,"aria-live":`polite`,className:Av[t],children:n},void 0,!1,{fileName:Dv,lineNumber:38,columnNumber:5},this)}export{Fh as $,_l as $t,i_ as A,ep as At,lg as B,Uu as Bt,L_ as C,q as Cn,Uf as Ct,f_ as D,Ie as Dn,Xf as Dt,I_ as E,Pe as En,Wf as Et,Tg as F,pd as Ft,qh as G,Nu as Gt,ng as H,xu as Ht,ag as I,Vu as It,Yh as J,Ul as Jt,Zh as K,Tu as Kt,og as L,Bu as Lt,Wg as M,Jf as Mt,Gg as N,Dd as Nt,m_ as O,$f as Ot,Ig as P,ud as Pt,Rh as Q,Pl as Qt,ig as R,$l as Rt,R_ as S,Ts as Sn,Zf as St,P_ as T,Ne as Tn,Kf as Tt,eg as U,nu as Ut,ug as V,Fu as Vt,tg as W,Ku as Wt,Bh as X,Wl as Xt,Ih as Y,Q as Yt,Hh as Z,$ as Zt,rv as _,dc as _n,_p as _t,Sv as a,Cc as an,Xm as at,W_ as b,rc as bn,yp as bt,vv as c,Dc as cn,kp as ct,sv as d,Ac as dn,lp as dt,sl as en,zh as et,nv as f,Z as fn,up as ft,av as g,pc as gn,Pp as gt,ev as h,gc as hn,pp as ht,Tv as i,qc as in,Nh as it,Ug as j,Yf as jt,Yg as k,Qf as kt,ov as l,Ec as ln,jp as lt,uv as m,_c as mn,Fp as mt,jv as n,Zc as nn,Uh as nt,pv as o,kc as on,Rp as ot,tv as p,Vc as pn,dp as pt,Xh as q,zl as qt,kv as r,Jc as rn,Mh as rt,mv as s,Oc as sn,Np as st,Ov as t,Qc as tn,Vh as tt,dv as u,Sc as un,Ap as ut,hv as v,Y as vn,gp as vt,F_ as w,jo as wn,Gf as wt,Y_ as x,ps as xn,bp as xt,q_ as y,Cs as yn,vp as yt,rg as z,Mu as zt};