kanban-lite 1.2.4 → 1.2.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.
@@ -1,4 +1,4 @@
1
- var r1=Object.defineProperty;var n1=(e,t,r)=>t in e?r1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Pe=(e,t,r)=>n1(e,typeof t!="symbol"?t+"":t,r);import{r as x,R as B,F as s1,P as Xm,C as Bc,a as St,b as Ul,c as Zr,M as o1,T as Kt,E as a1,d as Uc,e as i1,S as l1,Z as ma,L as c1,f as Wl,X as st,g as u1,h as d1,B as eg,I as tg,Q as rg,i as ng,j as sg,k as og,l as ag,m as Ze,n as f1,o as Mo,p as Se,q as h1,s as ig,H as p1,t as m1,u as lg,v as Wc,U as ga,w as Xa,x as gf,D as g1,y as cg,z as v1,W as y1,A as b1,G as ug,J as dg,K as x1,N as vf,O as w1,V as k1,Y as _1,_ as C1,$ as $1,a0 as S1,a1 as j1,a2 as E1}from"./icons-BBjcNiGI.js";import{r as fg}from"./react-vendor-CgdWStRY.js";var hg={exports:{}},ei={};/**
1
+ var Jx=Object.defineProperty;var Zx=(e,t,r)=>t in e?Jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Pe=(e,t,r)=>Zx(e,typeof t!="symbol"?t+"":t,r);import{r as x,R as B,F as Qx,P as Gm,C as Dc,a as St,b as Ll,c as Zr,M as Xx,T as Kt,E as e1,d as Lc,e as t1,S as r1,Z as ma,L as n1,f as Fl,X as st,g as s1,h as o1,B as qm,I as Ym,Q as Jm,i as Zm,j as Qm,k as Xm,l as eg,m as Ze,n as a1,o as Mo,p as Se,q as i1,s as tg,H as l1,t as c1,u as rg,v as Fc,U as ga,w as Xa,x as hf,D as u1,y as ng,z as d1,W as f1,A as h1,G as sg,J as og,K as p1,N as pf,O as m1,V as g1,Y as v1,_ as y1,$ as b1,a0 as x1,a1 as w1,a2 as k1}from"./icons-BBjcNiGI.js";import{r as ag}from"./react-vendor-CgdWStRY.js";var ig={exports:{}},ei={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ var r1=Object.defineProperty;var n1=(e,t,r)=>t in e?r1(e,t,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var A1=x,N1=Symbol.for("react.element"),P1=Symbol.for("react.fragment"),R1=Object.prototype.hasOwnProperty,T1=A1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,I1={key:!0,ref:!0,__self:!0,__source:!0};function pg(e,t,r){var n,s={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)R1.call(t,n)&&!I1.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:N1,type:e,key:o,ref:a,props:s,_owner:T1.current}}ei.Fragment=P1;ei.jsx=pg;ei.jsxs=pg;hg.exports=ei;var l=hg.exports;if(!("acquireVsCodeApi"in window)){let e=function(){return typeof navigator<"u"&&navigator.onLine===!1?"You are offline. Form submissions are unavailable until the standalone backend reconnects.":"Cannot submit while disconnected from the standalone backend. Wait for reconnection and try again."},t=function(E){const P={type:"connectionStatus",...E};window.postMessage(P,"*")},r=function(){z!==null&&(window.clearTimeout(z),z=null)},n=function(E){C&&E.send(JSON.stringify({type:"ready"})),w&&E.send(w),_&&E.send(_)},s=function(E){for(const P of v)E.send(P);v.length=0},o=function(E){if(y=!1,!D||z!==null)return;if(R>=g){t({connected:!1,reconnecting:!1,fatal:!0,retryCount:R,maxRetries:g,reason:E});return}const P=h[R];R+=1,t({connected:!1,reconnecting:!0,fatal:!1,retryCount:R,maxRetries:g,retryDelayMs:P,reason:E}),z=window.setTimeout(()=>{z=null,a()},P)},a=function(){const E=new WebSocket(p);m=E,E.addEventListener("open",()=>{if(m!==E)return;y=!0;const P=!b;b=!0,r(),R=0,n(E),P&&s(E),t({connected:!0,reconnecting:!1,fatal:!1,retryCount:0,maxRetries:g})}),E.addEventListener("message",P=>{if(m===E)try{const K=JSON.parse(P.data);window.postMessage(K,"*")}catch{}}),E.addEventListener("error",()=>{m===E&&(E.readyState===WebSocket.CONNECTING||E.readyState===WebSocket.OPEN)&&E.close()}),E.addEventListener("close",()=>{m===E&&(m=null,o("socket-closed"))})},i=function(E){const P=document.createElement("input");P.type="file",P.multiple=!0,P.style.display="none",document.body.appendChild(P);const K=()=>{P.remove()};P.onchange=async()=>{if(!P.files||P.files.length===0){K();return}const O=[];for(const q of Array.from(P.files)){const V=await q.arrayBuffer(),L=new Uint8Array(V);let U="";for(let oe=0;oe<L.length;oe++)U+=String.fromCharCode(L[oe]);O.push({name:q.name,data:btoa(U)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cardId:E,files:O})})}catch(q){console.error("Failed to upload attachment:",q)}K()},P.click()},c=function(E,P){const K=`/api/attachment?cardId=${encodeURIComponent(E)}&filename=${encodeURIComponent(P)}`;window.open(K,"_blank")},u=function(E){document.body.classList.toggle("vscode-dark",E),document.body.classList.toggle("vscode-light",!E)},d=function(){const E=localStorage.getItem("kanban-standalone-theme");u(E!==null?E==="dark":S.matches)};const f=window.__KB_BASE__??"",p=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}${f}/ws`,h=[250,500,1e3,2e3,4e3],g=h.length;let m=null;const v=[];let y=!1,b=!1,C=!1,w=null,_=null,R=0,z=null,D=!0;window.addEventListener("beforeunload",()=>{D=!1,r(),m&&(m.readyState===WebSocket.CONNECTING||m.readyState===WebSocket.OPEN)&&m.close()}),a();let j=null;try{const E=sessionStorage.getItem("kanban-standalone-state");E&&(j=JSON.parse(E))}catch{}window.acquireVsCodeApi=()=>({postMessage(E){const P=E;if(P.type==="openFile"){const O=P.cardId;fetch(`/api/card-file?cardId=${encodeURIComponent(O)}`).then(q=>q.json()).then(q=>{var U;const V=(U=q==null?void 0:q.data)==null?void 0:U.path;if(!V){console.error("card-file: missing path in response",q);return}const L=document.createElement("a");L.href=`vscode://file/${V}`,document.body.appendChild(L),L.click(),document.body.removeChild(L)}).catch(q=>console.error("Failed to open card in VS Code:",q));return}if(P.type==="openMetadataFile"){const O=P.path;fetch(`/api/resolve-path?path=${encodeURIComponent(O)}`).then(q=>q.json()).then(q=>{var U;const V=(U=q==null?void 0:q.data)==null?void 0:U.path;if(!V){console.error("resolve-path: missing path in response",q);return}const L=document.createElement("a");L.href=`vscode://file/${V}`,document.body.appendChild(L),L.click(),document.body.removeChild(L)}).catch(q=>console.error("Failed to open metadata file in VS Code:",q));return}if(P.type==="addAttachment"){i(P.cardId);return}if(P.type==="openAttachment"){c(P.cardId,P.attachment);return}if(P.type==="toggleTheme"){const q=!document.body.classList.contains("vscode-dark");localStorage.setItem("kanban-standalone-theme",q?"dark":"light"),u(q);return}const K=JSON.stringify(E);if(P.type==="ready"){C=!0,y&&m&&m.readyState===WebSocket.OPEN&&m.send(K);return}if(P.type==="switchBoard"&&(w=K),P.type==="openCard"&&(_=K),P.type==="closeCard"&&(_=null),P.type==="switchBoard"||P.type==="openCard"||P.type==="closeCard"){y&&m&&m.readyState===WebSocket.OPEN&&m.send(K);return}if(P.type==="submitForm"&&(!y||!m||m.readyState!==WebSocket.OPEN)){window.postMessage({type:"submitFormResult",callbackKey:P.callbackKey,error:e()},"*");return}y&&m&&m.readyState===WebSocket.OPEN?m.send(K):b?console.warn("Dropping standalone message while disconnected",P.type):v.push(K)},getState(){return j},setState(E){j=E;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(E))}catch{}}});const S=window.matchMedia("(prefers-color-scheme: dark)");S.addEventListener("change",E=>{localStorage.getItem("kanban-standalone-theme")===null&&u(E.matches)}),document.body?d():document.addEventListener("DOMContentLoaded",d)}var mg,yf=fg;mg=yf.createRoot,yf.hydrateRoot;var Le=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Le||{});function gg({update:e,notify:t,unwatched:r}){return{link:n,unlink:s,propagate:o,checkDirty:a,shallowPropagate:i};function n(u,d,f){const p=d.depsTail;if(p!==void 0&&p.dep===u)return;const h=p!==void 0?p.nextDep:d.deps;if(h!==void 0&&h.dep===u){h.version=f,d.depsTail=h;return}const g=u.subsTail;if(g!==void 0&&g.version===f&&g.sub===d)return;const m=d.depsTail=u.subsTail={version:f,dep:u,sub:d,prevDep:p,nextDep:h,prevSub:g,nextSub:void 0};h!==void 0&&(h.prevDep=m),p!==void 0?p.nextDep=m:d.deps=m,g!==void 0?g.nextSub=m:u.subs=m}function s(u,d=u.sub){const f=u.dep,p=u.prevDep,h=u.nextDep,g=u.nextSub,m=u.prevSub;return h!==void 0?h.prevDep=p:d.depsTail=p,p!==void 0?p.nextDep=h:d.deps=h,g!==void 0?g.prevSub=m:f.subsTail=m,m!==void 0?m.nextSub=g:(f.subs=g)===void 0&&r(f),h}function o(u){let d=u.nextSub,f;e:do{const p=u.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&c(u,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const g=p.subs;if(g!==void 0){const m=(u=g).nextSub;m!==void 0&&(f={value:d,prev:f},d=m);continue}}if((u=d)!==void 0){d=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){d=u.nextSub;continue e}break}while(!0)}function a(u,d){let f,p=0,h=!1;e:do{const g=u.dep,m=g.flags;if(d.flags&16)h=!0;else if((m&17)===17){if(e(g)){const v=g.subs;v.nextSub!==void 0&&i(v),h=!0}}else if((m&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=g.deps,d=g,++p;continue}if(!h){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=d.subs,y=v.nextSub!==void 0;if(y?(u=f.value,f=f.prev):u=v,h){if(e(d)){y&&i(v),d=u.sub;continue}h=!1}else d.flags&=-33;d=u.sub;const b=u.nextDep;if(b!==void 0){u=b;continue e}}return h}while(!0)}function i(u){do{const d=u.sub,f=d.flags;(f&48)===32&&(d.flags=f|16,(f&6)===2&&t(d))}while((u=u.nextSub)!==void 0)}function c(u,d){let f=d.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}let Vc=0,Or=0,Ds=0;const or=[],{link:vQ,unlink:vg,propagate:yQ,checkDirty:M1,shallowPropagate:bQ}=gg({update(e){return e.depsTail!==void 0?L1(e):F1(e)},notify(e){var n;let t=Ds,r=t;do if(or[t++]=e,e.flags&=-3,e=(n=e.subs)==null?void 0:n.sub,e===void 0||!(e.flags&2))break;while(!0);for(Ds=t;r<--t;){const s=or[r];or[r++]=or[t],or[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ti(e)):W1.call(e)}});function z1(){return Vc}function O1(){++Vc}function D1(){--Vc||U1()}function L1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,ti(e)}}function F1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function B1(e){const t=e.flags;if(t&16||t&32&&M1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,ti(e)}}else e.flags=2}function U1(){try{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,B1(e)}}finally{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,e.flags|=10}Or=0,Ds=0}}function W1(){this.depsTail=void 0,this.flags=0,ti(this);const e=this.subs;e!==void 0&&vg(e)}function ti(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=vg(r,e)}function Kc(e,t,r){var o,a,i;const n=typeof e=="object",s=n?e:void 0;return{next:(o=n?e.next:e)==null?void 0:o.bind(s),error:(a=n?e.error:t)==null?void 0:a.bind(s),complete:(i=n?e.complete:r)==null?void 0:i.bind(s)}}const Vl=[];let ea=0;const{link:bf,unlink:V1,propagate:K1,checkDirty:yg,shallowPropagate:xf}=gg({update(e){return e._update()},notify(e){Vl[Kl++]=e,e.flags&=~Le.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Le.Mutable|Le.Dirty,va(e))}});let zo=0,Kl=0,Ft;function va(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=V1(r,e)}function bg(){if(!(z1()>0)){for(;zo<Kl;){const e=Vl[zo];Vl[zo++]=void 0,e.notify()}zo=0,Kl=0}}function xg(e,t){const r=typeof e=="function",n=e,s={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?Le.None:Le.Mutable,get(){return Ft!==void 0&&bf(s,Ft,ea),s._snapshot},subscribe(o){const a=Kc(o),i={current:!1},c=H1(()=>{var u;s.get(),i.current?(u=a.next)==null||u.call(a,s._snapshot):i.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(o){const a=Ft,i=Object.is;if(r)Ft=s,++ea,s.depsTail=void 0;else if(o===void 0)return!1;r&&(s.flags=Le.Mutable|Le.RecursedCheck);try{const c=s._snapshot,u=typeof o=="function"?o(c):o===void 0&&r?n(c):o;return c===void 0||!i(c,u)?(s._snapshot=u,!0):!1}finally{Ft=a,r&&(s.flags&=~Le.RecursedCheck),va(s)}}};return r?(s.flags=Le.Mutable|Le.Dirty,s.get=function(){const o=s.flags;if(o&Le.Dirty||o&Le.Pending&&yg(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&xf(a)}}else o&Le.Pending&&(s.flags=o&~Le.Pending);return Ft!==void 0&&bf(s,Ft,ea),s._snapshot}):s.set=function(o){if(s._update(o)){const a=s.subs;a!==void 0&&(K1(a),xf(a),bg())}},s}function H1(e){const t=()=>{const n=Ft;Ft=r,++ea,r.depsTail=void 0,r.flags=Le.Watching|Le.RecursedCheck;try{return e()}finally{Ft=n,r.flags&=~Le.RecursedCheck,va(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Le.Watching|Le.RecursedCheck,notify(){const n=this.flags;n&Le.Dirty||n&Le.Pending&&yg(this.deps,this)?t():this.flags=Le.Watching},stop(){this.flags=Le.None,this.depsTail=void 0,va(this)}};return t(),r}class q1{constructor(t){this.atom=xg(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Kc(t))}}class G1{constructor(t){this.atom=xg(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Kc(t))}}function Y1(e){return typeof e=="function"?new G1(e):new q1(e)}function J1(e){try{O1(),e()}finally{D1(),bg()}}const Er="__TSR_index",wf="popstate",kf="beforeunload";function wg(e){let t=e.getLocation();const r=new Set,n=a=>{t=e.getLocation(),r.forEach(i=>i({location:t,action:a}))},s=a=>{e.notifyOnIndexChange??!0?n(a):t=e.getLocation()},o=async({task:a,navigateOpts:i,...c})=>{var p,h;if((i==null?void 0:i.ignoreBlocker)??!1){a();return}const d=((p=e.getBlockers)==null?void 0:p.call(e))??[],f=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(const g of d){const m=Ys(c.path,c.state);if(await g.blockerFn({currentLocation:t,nextLocation:m,action:c.type})){(h=e.onBlocked)==null||h.call(e);return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:a=>(r.add(a),()=>{r.delete(a)}),push:(a,i,c)=>{const u=t.state[Er];i=Hl(u+1,i),o({task:()=>{e.pushState(a,i),n({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:i})},replace:(a,i,c)=>{const u=t.state[Er];i=Hl(u,i),o({task:()=>{e.replaceState(a,i),n({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:i})},go:(a,i)=>{o({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{o({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Er]!==0,createHref:a=>e.createHref(a),block:a=>{var c;if(!e.setBlockers)return()=>{};const i=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...i,a]),()=>{var d,f;const u=((d=e.getBlockers)==null?void 0:d.call(e))??[];(f=e.setBlockers)==null||f.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:n}}function Hl(e,t){t||(t={});const r=Hc();return{...t,key:r,__TSR_key:r,[Er]:e}}function Z1(e){var D,j;const t=typeof document<"u"?window:void 0,r=t.history.pushState,n=t.history.replaceState;let s=[];const o=()=>s,a=S=>s=S,i=S=>S,c=()=>Ys(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((D=t.history.state)!=null&&D.__TSR_key)&&!((j=t.history.state)!=null&&j.key)){const S=Hc();t.history.replaceState({[Er]:0,key:S,__TSR_key:S},"")}let u=c(),d,f=!1,p=!1,h=!1,g=!1;const m=()=>u;let v,y;const b=()=>{v&&(z._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),z._ignoreSubscribers=!1,v=void 0,y=void 0,d=void 0)},C=(S,E,P)=>{const K=i(E);y||(d=u),u=Ys(E,P),v={href:K,state:P,isPush:(v==null?void 0:v.isPush)||S==="push"},y||(y=Promise.resolve().then(()=>b()))},w=S=>{u=c(),z.notify({type:S})},_=async()=>{if(p){p=!1;return}const S=c(),E=S.state[Er]-u.state[Er],P=E===1,K=E===-1,O=!P&&!K||f;f=!1;const q=O?"GO":K?"BACK":"FORWARD",V=O?{type:"GO",index:E}:{type:K?"BACK":"FORWARD"};if(h)h=!1;else{const L=o();if(typeof document<"u"&&L.length){for(const U of L)if(await U.blockerFn({currentLocation:u,nextLocation:S,action:q})){p=!0,t.history.go(1),z.notify(V);return}}}u=c(),z.notify(V)},R=S=>{if(g){g=!1;return}let E=!1;const P=o();if(typeof document<"u"&&P.length)for(const K of P){const O=K.enableBeforeUnload??!0;if(O===!0){E=!0;break}if(typeof O=="function"&&O()===!0){E=!0;break}}if(E)return S.preventDefault(),S.returnValue=""},z=wg({getLocation:m,getLength:()=>t.history.length,pushState:(S,E)=>C("push",S,E),replaceState:(S,E)=>C("replace",S,E),back:S=>(S&&(h=!0),g=!0,t.history.back()),forward:S=>{S&&(h=!0),g=!0,t.history.forward()},go:S=>{f=!0,t.history.go(S)},createHref:S=>i(S),flush:b,destroy:()=>{t.history.pushState=r,t.history.replaceState=n,t.removeEventListener(kf,R,{capture:!0}),t.removeEventListener(wf,_)},onBlocked:()=>{d&&u!==d&&(u=d)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(kf,R,{capture:!0}),t.addEventListener(wf,_),t.history.pushState=function(...S){const E=r.apply(t.history,S);return z._ignoreSubscribers||w("PUSH"),E},t.history.replaceState=function(...S){const E=n.apply(t.history,S);return z._ignoreSubscribers||w("REPLACE"),E},z}function Q1(e={initialEntries:["/"]}){const t=e.initialEntries;let r=e.initialIndex?Math.min(Math.max(e.initialIndex,0),t.length-1):t.length-1;const n=t.map((c,u)=>Hl(u,void 0)),s=()=>Ys(t[r],n[r]);let o=[];return wg({getLocation:s,getLength:()=>t.length,pushState:(c,u)=>{r<t.length-1&&(t.splice(r+1),n.splice(r+1)),n.push(u),t.push(c),r=Math.max(t.length-1,0)},replaceState:(c,u)=>{n[r]=u,t[r]=c},back:()=>{r=Math.max(r-1,0)},forward:()=>{r=Math.min(r+1,t.length-1)},go:c=>{r=Math.min(Math.max(r+c,0),t.length-1)},createHref:c=>c,getBlockers:()=>o,setBlockers:c=>o=c})}function X1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ys(e,t){const r=X1(e),n=r.indexOf("#"),s=r.indexOf("?"),o=Hc();return{href:r,pathname:r.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:r.length),hash:n>-1?r.substring(n):"",search:s>-1?r.slice(s,n===-1?void 0:n):"",state:t||{[Er]:0,key:o,__TSR_key:o}}}function Hc(){return(Math.random()+1).toString(36).substring(7)}const ew=!1;function Ls(e){let t;return J1(()=>{t=e()}),t}function Js(e){return e[e.length-1]}function tw(e){return typeof e=="function"}function $r(e,t){return tw(e)?e(t):e}const rw=Object.prototype.hasOwnProperty,_f=Object.prototype.propertyIsEnumerable;function gt(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=t,s=Sf(e)&&Sf(n);if(!s&&!(ya(e)&&ya(n)))return n;const o=s?e:Cf(e);if(!o)return n;const a=s?n:Cf(n);if(!a)return n;const i=o.length,c=a.length,u=s?new Array(c):{};let d=0;for(let f=0;f<c;f++){const p=s?f:a[f],h=e[p],g=n[p];if(h===g){u[p]=h,(s?f<i:rw.call(e,p))&&d++;continue}if(h===null||g===null||typeof h!="object"||typeof g!="object"){u[p]=g;continue}const m=gt(h,g,r+1);u[p]=m,m===h&&d++}return i===c&&d===i?e:u}function Cf(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!_f.call(e,s))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const n=t;for(const s of r){if(!_f.call(e,s))return!1;n.push(s)}return n}function ya(e){if(!$f(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!$f(r)||!r.hasOwnProperty("isPrototypeOf"))}function $f(e){return Object.prototype.toString.call(e)==="[object Object]"}function Sf(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qr(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!Qr(e[n],t[n],r))return!1;return!0}if(ya(e)&&ya(t)){const n=(r==null?void 0:r.ignoreUndefined)??!0;if(r!=null&&r.partial){for(const a in t)if((!n||t[a]!==void 0)&&!Qr(e[a],t[a],r))return!1;return!0}let s=0;if(!n)s=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&s++;let o=0;for(const a in t)if((!n||t[a]!==void 0)&&(o++,o>s||!Qr(e[a],t[a],r)))return!1;return s===o}return!1}function Bn(e){let t,r;const n=new Promise((s,o)=>{t=s,r=o});return n.status="pending",n.resolve=s=>{n.status="resolved",n.value=s,t(s),e==null||e(s)},n.reject=s=>{n.status="rejected",r(s)},n}function Zs(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function nw(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function jf(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return nw(t)}const sw=["http:","https:","mailto:","tel:"];function ba(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}function ms(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,n="",s;for(;(s=t.exec(e))!==null;)n+=jf(e.slice(r,s.index))+s[0],r=t.lastIndex;n=n+jf(r?e.slice(r):e);let o=!1;return n.startsWith("//")&&(o=!0,n="/"+n.replace(/^\/+/,"")),{path:n,handledProtocolRelativeURL:o}}function ow(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var aw="Invariant failed";function Pr(e,t){if(!e)throw new Error(aw)}function xa(e){const t=new Map;let r,n;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,n&&(n.next=o,o.prev=n)):(o.next.prev=void 0,r=o.next,o.next=void 0,n&&(o.prev=n,n.next=o)),n=o)};return{get(o){const a=t.get(o);if(a)return s(a),a.value},set(o,a){if(t.size>=e&&r){const c=r;t.delete(c.key),c.next&&(r=c.next,c.next.prev=void 0),c===n&&(n=void 0)}const i=t.get(o);if(i)i.value=a,s(i);else{const c={key:o,value:a,prev:n};n&&(n.next=c),n=c,r||(r=c),t.set(o,c)}},clear(){t.clear(),r=void 0,n=void 0}}}const Un=0,tn=1,rn=2,Qs=3,Gr=4,kg=5;function iw(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function qc(e,t,r=new Uint16Array(6)){const n=e.indexOf("/",t),s=n===-1?e.length:n,o=e.substring(t,s);if(!o||!o.includes("$"))return r[0]=Un,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r;if(o==="$"){const i=e.length;return r[0]=rn,r[1]=t,r[2]=t,r[3]=i,r[4]=i,r[5]=i,r}if(o.charCodeAt(0)===36)return r[0]=tn,r[1]=t,r[2]=t+1,r[3]=s,r[4]=s,r[5]=s,r;const a=iw(o);if(a){const[i,c]=a,u=o.charCodeAt(i+1);if(u===45){if(i+2<o.length&&o.charCodeAt(i+2)===36){const d=i+3,f=c;if(d<f)return r[0]=Qs,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+c+1,r[5]=s,r}}else if(u===36){const d=i+1,f=i+2;return f===c?(r[0]=rn,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+c+1,r[5]=e.length,r):(r[0]=tn,r[1]=t+i,r[2]=t+f,r[3]=t+c,r[4]=t+c+1,r[5]=s,r)}}return r[0]=Un,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r}function ri(e,t,r,n,s,o,a){var c,u,d,f,p,h,g,m,v,y,b,C,w;a==null||a(r);let i=n;{const _=r.fullPath??r.from,R=_.length,z=((c=r.options)==null?void 0:c.caseSensitive)??e,D=!!((d=(u=r.options)==null?void 0:u.params)!=null&&d.parse&&((p=(f=r.options)==null?void 0:f.skipRouteOnParseError)!=null&&p.params));for(;i<R;){const S=qc(_,i,t);let E;const P=i,K=S[5];switch(i=K+1,o++,S[0]){case Un:{const q=_.substring(S[2],S[3]);if(z){const V=(h=s.static)==null?void 0:h.get(q);if(V)E=V;else{s.static??(s.static=new Map);const L=Yr(r.fullPath??r.from);L.parent=s,L.depth=o,E=L,s.static.set(q,L)}}else{const V=q.toLowerCase(),L=(g=s.staticInsensitive)==null?void 0:g.get(V);if(L)E=L;else{s.staticInsensitive??(s.staticInsensitive=new Map);const U=Yr(r.fullPath??r.from);U.parent=s,U.depth=o,E=U,s.staticInsensitive.set(V,U)}}break}case tn:{const q=_.substring(P,S[1]),V=_.substring(S[4],K),L=z&&!!(q||V),U=q?L?q:q.toLowerCase():void 0,oe=V?L?V:V.toLowerCase():void 0,Y=!D&&((m=s.dynamic)==null?void 0:m.find(N=>!N.skipOnParamError&&N.caseSensitive===L&&N.prefix===U&&N.suffix===oe));if(Y)E=Y;else{const N=Fi(tn,r.fullPath??r.from,L,U,oe);E=N,N.depth=o,N.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(N)}break}case Qs:{const q=_.substring(P,S[1]),V=_.substring(S[4],K),L=z&&!!(q||V),U=q?L?q:q.toLowerCase():void 0,oe=V?L?V:V.toLowerCase():void 0,Y=!D&&((v=s.optional)==null?void 0:v.find(N=>!N.skipOnParamError&&N.caseSensitive===L&&N.prefix===U&&N.suffix===oe));if(Y)E=Y;else{const N=Fi(Qs,r.fullPath??r.from,L,U,oe);E=N,N.parent=s,N.depth=o,s.optional??(s.optional=[]),s.optional.push(N)}break}case rn:{const q=_.substring(P,S[1]),V=_.substring(S[4],K),L=z&&!!(q||V),U=q?L?q:q.toLowerCase():void 0,oe=V?L?V:V.toLowerCase():void 0,Y=Fi(rn,r.fullPath??r.from,L,U,oe);E=Y,Y.parent=s,Y.depth=o,s.wildcard??(s.wildcard=[]),s.wildcard.push(Y)}}s=E}if(D&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const S=Yr(r.fullPath??r.from);S.kind=kg,S.parent=s,o++,S.depth=o,s.pathless??(s.pathless=[]),s.pathless.push(S),s=S}const j=(r.path||!r.children)&&!r.isRoot;if(j&&_.endsWith("/")){const S=Yr(r.fullPath??r.from);S.kind=Gr,S.parent=s,o++,S.depth=o,s.index=S,s=S}s.parse=((b=(y=r.options)==null?void 0:y.params)==null?void 0:b.parse)??null,s.skipOnParamError=D,s.parsingPriority=((w=(C=r.options)==null?void 0:C.skipRouteOnParseError)==null?void 0:w.priority)??0,j&&!s.route&&(s.route=r,s.fullPath=r.fullPath??r.from)}if(r.children)for(const _ of r.children)ri(e,t,_,i,s,o,a)}function Li(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Cr(e){var t,r,n;if(e.pathless)for(const s of e.pathless)Cr(s);if(e.static)for(const s of e.static.values())Cr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())Cr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Li);for(const s of e.dynamic)Cr(s)}if((r=e.optional)!=null&&r.length){e.optional.sort(Li);for(const s of e.optional)Cr(s)}if((n=e.wildcard)!=null&&n.length){e.wildcard.sort(Li);for(const s of e.wildcard)Cr(s)}}function Yr(e){return{kind:Un,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fi(e,t,r,n,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:n,suffix:s}}function lw(e,t){const r=Yr("/"),n=new Uint16Array(6);for(const s of e)ri(!1,n,s,1,r,0);Cr(r),t.masksTree=r,t.flatCache=xa(1e3)}function cw(e,t){e||(e="/");const r=t.flatCache.get(e);if(r)return r;const n=Gc(e,t.masksTree);return t.flatCache.set(e,n),n}function uw(e,t,r,n,s){e||(e="/"),n||(n="/");const o=t?`case\0${e}`:e;let a=s.singleCache.get(o);if(!a){a=Yr("/");const i=new Uint16Array(6);ri(t,i,{from:e},1,a,0),s.singleCache.set(o,a)}return Gc(n,a,r)}function dw(e,t,r=!1){const n=r?e:`nofuzz\0${e}`,s=t.matchCache.get(n);if(s!==void 0)return s;e||(e="/");let o;try{o=Gc(e,t.segmentTree,r)}catch(a){if(a instanceof URIError)o=null;else throw a}return o&&(o.branch=pw(o.route)),t.matchCache.set(n,o),o}function fw(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function hw(e,t=!1,r){const n=Yr(e.fullPath),s=new Uint16Array(6),o={},a={};let i=0;return ri(t,s,e,1,n,0,u=>{if(r==null||r(u,i),Pr(!(u.id in o),`Duplicate routes found with id: ${String(u.id)}`),o[u.id]=u,i!==0&&u.path){const d=fw(u.fullPath);(!a[d]||u.fullPath.endsWith("/"))&&(a[d]=u)}i++}),Cr(n),{processedTree:{segmentTree:n,singleCache:xa(1e3),matchCache:xa(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:a}}function Gc(e,t,r=!1){const n=e.split("/"),s=gw(e,n,t,r);if(!s)return null;const[o]=_g(e,n,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function _g(e,t,r){var d,f,p,h,g,m,v,y,b,C;const n=mw(r.node);let s=null;const o={};let a=((d=r.extract)==null?void 0:d.part)??0,i=((f=r.extract)==null?void 0:f.node)??0,c=((p=r.extract)==null?void 0:p.path)??0,u=((h=r.extract)==null?void 0:h.segment)??0;for(;i<n.length;a++,i++,c++,u++){const w=n[i];if(w.kind===Gr)break;if(w.kind===kg){u--,a--,c--;continue}const _=t[a],R=c;if(_&&(c+=_.length),w.kind===tn){s??(s=r.node.fullPath.split("/"));const z=s[u],D=((g=w.prefix)==null?void 0:g.length)??0;if(z.charCodeAt(D)===123){const S=((m=w.suffix)==null?void 0:m.length)??0,E=z.substring(D+2,z.length-S-1),P=_.substring(D,_.length-S);o[E]=decodeURIComponent(P)}else{const S=z.substring(1);o[S]=decodeURIComponent(_)}}else if(w.kind===Qs){if(r.skipped&1<<i){a--,c=R-1;continue}s??(s=r.node.fullPath.split("/"));const z=s[u],D=((v=w.prefix)==null?void 0:v.length)??0,j=((y=w.suffix)==null?void 0:y.length)??0,S=z.substring(D+3,z.length-j-1),E=w.suffix||w.prefix?_.substring(D,_.length-j):_;E&&(o[S]=decodeURIComponent(E))}else if(w.kind===rn){const z=w,D=e.substring(R+(((b=z.prefix)==null?void 0:b.length)??0),e.length-(((C=z.suffix)==null?void 0:C.length)??0)),j=decodeURIComponent(D);o["*"]=j,o._splat=j;break}}return r.rawParams&&Object.assign(o,r.rawParams),[o,{part:a,node:i,path:c,segment:u}]}function pw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function mw(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function gw(e,t,r,n){if(e==="/"&&r.index)return{node:r.index,skipped:0};const s=!Js(t),o=s&&e!=="/",a=t.length-(s?1:0),i=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,u=null,d=null;for(;i.length;){const f=i.pop(),{node:p,index:h,skipped:g,depth:m,statics:v,dynamics:y,optionals:b}=f;let{extract:C,rawParams:w,parsedParams:_}=f;if(p.skipOnParamError){if(!Bi(e,t,f))continue;w=f.rawParams,C=f.extract,_=f.parsedParams}n&&p.route&&p.kind!==Gr&&gs(u,f)&&(u=f);const R=h===a;if(R&&(p.route&&!o&&gs(d,f)&&(d=f),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const z=R?void 0:t[h];let D;if(R&&p.index){const j={node:p.index,index:h,skipped:g,depth:m+1,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_};let S=!0;if(p.index.skipOnParamError&&(Bi(e,t,j)||(S=!1)),S){if(v===a&&!y&&!b&&!g)return j;gs(d,j)&&(d=j)}}if(p.wildcard&&gs(c,f))for(const j of p.wildcard){const{prefix:S,suffix:E}=j;if(S&&(R||!(j.caseSensitive?z:D??(D=z.toLowerCase())).startsWith(S)))continue;if(E){if(R)continue;const K=t.slice(h).join("/").slice(-E.length);if((j.caseSensitive?K:K.toLowerCase())!==E)continue}const P={node:j,index:a,skipped:g,depth:m,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_};if(!(j.skipOnParamError&&!Bi(e,t,P))){c=P;break}}if(p.optional){const j=g|1<<m,S=m+1;for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E];i.push({node:P,index:h,skipped:j,depth:S,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(!R)for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E],{prefix:K,suffix:O}=P;if(K||O){const q=P.caseSensitive?z:D??(D=z.toLowerCase());if(K&&!q.startsWith(K)||O&&!q.endsWith(O))continue}i.push({node:P,index:h+1,skipped:g,depth:S,statics:v,dynamics:y,optionals:b+1,extract:C,rawParams:w,parsedParams:_})}}if(!R&&p.dynamic&&z)for(let j=p.dynamic.length-1;j>=0;j--){const S=p.dynamic[j],{prefix:E,suffix:P}=S;if(E||P){const K=S.caseSensitive?z:D??(D=z.toLowerCase());if(E&&!K.startsWith(E)||P&&!K.endsWith(P))continue}i.push({node:S,index:h+1,skipped:g,depth:m+1,statics:v,dynamics:y+1,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(!R&&p.staticInsensitive){const j=p.staticInsensitive.get(D??(D=z.toLowerCase()));j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(!R&&p.static){const j=p.static.get(z);j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(p.pathless){const j=m+1;for(let S=p.pathless.length-1;S>=0;S--){const E=p.pathless[S];i.push({node:E,index:h,skipped:g,depth:j,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}}}if(d&&c)return gs(c,d)?d:c;if(d)return d;if(c)return c;if(n&&u){let f=u.index;for(let h=0;h<u.index;h++)f+=t[h].length;const p=f===e.length?"/":e.slice(f);return u.rawParams??(u.rawParams={}),u.rawParams["**"]=decodeURIComponent(p),u}return null}function Bi(e,t,r){try{const[n,s]=_g(e,t,r);r.rawParams=n,r.extract=s;const o=r.node.parse(n);return r.parsedParams=Object.assign({},r.parsedParams,o),!0}catch{return null}}function gs(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Gr)>(e.node.kind===Gr)||t.node.kind===Gr==(e.node.kind===Gr)&&t.depth>e.depth))):!0}function ta(e){return Yc(e.filter(t=>t!==void 0).join("/"))}function Yc(e){return e.replace(/\/{2,}/g,"/")}function Cg(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ar(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function $g(e){return Ar(Cg(e))}function wa(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function vw(e,t,r){return wa(e,r)===wa(t,r)}function yw({base:e,to:t,trailingSlash:r="never",cache:n}){const s=t.startsWith("/"),o=!s&&t===".";let a;if(n){a=s?t:o?e:e+"\0"+t;const f=n.get(a);if(f)return f}let i;if(o)i=e.split("/");else if(s)i=t.split("/");else{for(i=e.split("/");i.length>1&&Js(i)==="";)i.pop();const f=t.split("/");for(let p=0,h=f.length;p<h;p++){const g=f[p];g===""?p?p===h-1&&i.push(g):i=[g]:g===".."?i.pop():g==="."||i.push(g)}}i.length>1&&(Js(i)===""?r==="never"&&i.pop():r==="always"&&i.push(""));let c,u="";for(let f=0;f<i.length;f++){f>0&&(u+="/");const p=i[f];if(!p)continue;c=qc(p,0,c);const h=c[0];if(h===Un){u+=p;continue}const g=c[5],m=p.substring(0,c[1]),v=p.substring(c[4],g),y=p.substring(c[2],c[3]);h===tn?u+=m||v?`${m}{$${y}}${v}`:`$${y}`:h===rn?u+=m||v?`${m}{$}${v}`:"$":u+=`${m}{-$${y}}${v}`}u=Yc(u);const d=u||"/";return a&&n&&n.set(a,d),d}function bw(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),r=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),n=new RegExp(r,"g");return s=>s.replace(n,o=>t.get(o)??o)}function Ui(e,t,r){const n=t[e];return typeof n!="string"?n:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(n)?n:n.split("/").map(s=>Af(s,r)).join("/"):Af(n,r)}function Ef({path:e,params:t,decoder:r,...n}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const a=e.length;let i=0,c,u="";for(;i<a;){const f=i;c=qc(e,f,c);const p=c[5];if(i=p+1,f===p)continue;const h=c[0];if(h===Un){u+="/"+e.substring(f,p);continue}if(h===rn){const g=t._splat;o._splat=g,o["*"]=g;const m=e.substring(f,c[1]),v=e.substring(c[4],p);if(!g){s=!0,(m||v)&&(u+="/"+m+v);continue}const y=Ui("_splat",t,r);u+="/"+m+y+v;continue}if(h===tn){const g=e.substring(c[2],c[3]);!s&&!(g in t)&&(s=!0),o[g]=t[g];const m=e.substring(f,c[1]),v=e.substring(c[4],p),y=Ui(g,t,r)??"undefined";u+="/"+m+y+v;continue}if(h===Qs){const g=e.substring(c[2],c[3]),m=t[g];if(m==null)continue;o[g]=m;const v=e.substring(f,c[1]),y=e.substring(c[4],p),b=Ui(g,t,r)??"";u+="/"+v+b+y;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:o,interpolatedPath:u||"/",isMissingParams:s}}function Af(e,t){const r=encodeURIComponent(e);return(t==null?void 0:t(r))??r}function ht(e){return!!(e!=null&&e.isNotFound)}function xw(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ql="tsr-scroll-restoration-v1_3",ww=(e,t)=>{let r;return(...n)=>{r||(r=setTimeout(()=>{e(...n),r=null},t))}};function kw(){const e=xw();if(!e)return null;const t=e.getItem(ql);let r=t?JSON.parse(t):{};return{state:r,set:n=>{r=$r(n,r)||r;try{e.setItem(ql,JSON.stringify(r))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Oo=kw(),_w=e=>e.state.__TSR_key||e.href;function Cw(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}let ka=!1;function $w({storageKey:e,key:t,behavior:r,shouldScrollRestoration:n,scrollToTopSelectors:s,location:o}){var u,d;let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const i=t||((u=window.history.state)==null?void 0:u.__TSR_key),c=a[i];ka=!0;e:{if(n&&c&&Object.keys(c).length>0){for(const h in c){const g=c[h];if(h==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:r});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=g.scrollX,m.scrollTop=g.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const h=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(h){const g=document.getElementById(f);g&&g.scrollIntoView(h)}break e}const p={top:0,left:0,behavior:r};if(window.scrollTo(p),s)for(const h of s){if(h==="window")continue;const g=typeof h=="function"?h():document.querySelector(h);g&&g.scrollTo(p)}}ka=!1}function Sw(e,t){if(!Oo||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Oo))return;e.isScrollRestorationSetup=!0,ka=!1;const n=e.options.getScrollRestorationKey||_w;window.history.scrollRestoration="manual";const s=o=>{if(ka||!e.isScrollRestoring)return;let a="";if(o.target===document||o.target===window)a="window";else{const c=o.target.getAttribute("data-scroll-restoration-id");c?a=`[data-scroll-restoration-id="${c}"]`:a=Cw(o.target)}const i=n(e.state.location);Oo.set(c=>{const u=c[i]||(c[i]={}),d=u[a]||(u[a]={});if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const f=document.querySelector(a);f&&(d.scrollX=f.scrollLeft||0,d.scrollY=f.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",ww(s,100),!0),e.subscribe("onRendered",o=>{const a=n(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||($w({storageKey:ql,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Oo.set(i=>(i[a]||(i[a]={}),i)))})}function jw(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const r=document.getElementById(e.state.location.hash);r&&r.scrollIntoView(t)}}}function Ew(e,t=String){const r=new URLSearchParams;for(const n in e){const s=e[n];s!==void 0&&r.set(n,t(s))}return r.toString()}function Wi(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Aw(e){const t=new URLSearchParams(e),r={};for(const[n,s]of t.entries()){const o=r[n];o==null?r[n]=Wi(s):Array.isArray(o)?o.push(Wi(s)):r[n]=[o,Wi(s)]}return r}const Nw=Rw(JSON.parse),Pw=Tw(JSON.stringify,JSON.parse);function Rw(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=Aw(t);for(const n in r){const s=r[n];if(typeof s=="string")try{r[n]=e(s)}catch{}}return r}}function Tw(e,t){const r=typeof t=="function";function n(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(r&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const o=Ew(s,n);return o?`?${o}`:""}}const _t="__root__";function Iw(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function yt(e){return e instanceof Response&&!!e.options}const Gl=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},ni=(e,t)=>!!(e.preload&&!e.router.state.matches.some(r=>r.id===t)),On=(e,t,r=!0)=>{const n={...e.router.options.context??{}},s=r?t:t-1;for(let o=0;o<=s;o++){const a=e.matches[o];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(n,i.__routeContext,i.__beforeLoadContext)}return n},Nf=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,n=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),s=n>=0?n:0;let o=r?e.matches.findIndex(a=>a.routeId===r):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=s);for(let a=o;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return r?o:s},Sr=(e,t,r)=>{var n,s,o;if(!(!yt(r)&&!ht(r)))throw yt(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&((n=t._nonReactive.beforeLoadPromise)==null||n.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,a=>({...a,status:yt(r)?"redirected":a.status==="pending"?"success":a.status,context:On(e,t.index),isFetching:!1,error:r})),ht(r)&&!r.routeId&&(r.routeId=t.routeId),(o=t._nonReactive.loadPromise)==null||o.resolve()),yt(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},Sg=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,vs=(e,t,r,n)=>{var i,c;const{id:s,routeId:o}=e.matches[t],a=e.router.looseRoutesById[o];if(r instanceof Promise)throw r;r.routerCode=n,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Sr(e,e.router.getMatch(s),r);try{(c=(i=a.options).onError)==null||c.call(i,r)}catch(u){r=u,Sr(e,e.router.getMatch(s),r)}e.updateMatch(s,u=>{var d,f;return(d=u._nonReactive.beforeLoadPromise)==null||d.resolve(),u._nonReactive.beforeLoadPromise=void 0,(f=u._nonReactive.loadPromise)==null||f.resolve(),{...u,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!yt(r)&&!ht(r)&&(e.serialError??(e.serialError=r))},jg=(e,t,r,n)=>{var a;if(n._nonReactive.pendingTimeout!==void 0)return;const s=r.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!ni(e,t)&&(r.options.loader||r.options.beforeLoad||Ag(r))&&typeof s=="number"&&s!==1/0&&(r.options.pendingComponent??((a=e.router.options)==null?void 0:a.defaultPendingComponent)))){const i=setTimeout(()=>{Gl(e)},s);n._nonReactive.pendingTimeout=i}},Mw=(e,t,r)=>{const n=e.router.getMatch(t);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;jg(e,t,r,n);const s=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Sr(e,o,o.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(s):s()},zw=(e,t,r,n)=>{const s=e.router.getMatch(t),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Bn(()=>{o==null||o.resolve()});const{paramsError:a,searchError:i}=s;a&&vs(e,r,a,"PARSE_PARAMS"),i&&vs(e,r,i,"VALIDATE_SEARCH"),jg(e,t,n,s);const c=new AbortController;let u=!1;const d=()=>{u||(u=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:c})))},f=()=>{var w;(w=s._nonReactive.beforeLoadPromise)==null||w.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!n.options.beforeLoad){Ls(()=>{d(),f()});return}s._nonReactive.beforeLoadPromise=Bn();const p={...On(e,r,!1),...s.__routeContext},{search:h,params:g,cause:m}=s,v=ni(e,t),y={search:h,abortController:c,params:g,preload:v,context:p,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":m,matches:e.matches,routeId:n.id,...e.router.options.additionalContext},b=w=>{if(w===void 0){Ls(()=>{d(),f()});return}(yt(w)||ht(w))&&(d(),vs(e,r,w,"BEFORE_LOAD")),Ls(()=>{d(),e.updateMatch(t,_=>({..._,__beforeLoadContext:w})),f()})};let C;try{if(C=n.options.beforeLoad(y),Zs(C))return d(),C.catch(w=>{vs(e,r,w,"BEFORE_LOAD")}).then(b)}catch(w){d(),vs(e,r,w,"BEFORE_LOAD")}b(C)},Ow=(e,t)=>{const{id:r,routeId:n}=e.matches[t],s=e.router.looseRoutesById[n],o=()=>i(),a=()=>zw(e,r,t,s),i=()=>{if(Sg(e,r))return;const c=Mw(e,r,s);return Zs(c)?c.then(a):a()};return o()},Dw=(e,t,r)=>{var o,a,i,c,u,d;const n=e.router.getMatch(t);if(!n||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([(a=(o=r.options).head)==null?void 0:a.call(o,s),(c=(i=r.options).scripts)==null?void 0:c.call(i,s),(d=(u=r.options).headers)==null?void 0:d.call(u,s)]).then(([f,p,h])=>{const g=f==null?void 0:f.meta,m=f==null?void 0:f.links,v=f==null?void 0:f.scripts,y=f==null?void 0:f.styles;return{meta:g,links:m,headScripts:v,headers:h,scripts:p,styles:y}})},Eg=(e,t,r,n,s)=>{const o=t[n-1],{params:a,loaderDeps:i,abortController:c,cause:u}=e.router.getMatch(r),d=On(e,n),f=ni(e,r);return{params:a,deps:i,preload:!!f,parentMatchPromise:o,abortController:c,context:d,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:f?"preload":u,route:s,...e.router.options.additionalContext}},Pf=async(e,t,r,n,s)=>{var o,a,i,c,u,d,f;try{const p=e.router.getMatch(r);try{(!(ew??e.router.isServer)||p.ssr===!0)&&_a(s);const h=(a=(o=s.options).loader)==null?void 0:a.call(o,Eg(e,t,r,n,s)),g=s.options.loader&&Zs(h);if(!!(g||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(r,y=>({...y,isFetching:"loader"})),s.options.loader){const y=g?await h:h;Sr(e,e.router.getMatch(r),y),y!==void 0&&e.updateMatch(r,b=>({...b,loaderData:y}))}s._lazyPromise&&await s._lazyPromise;const v=p._nonReactive.minPendingPromise;v&&await v,s._componentsPromise&&await s._componentsPromise,e.updateMatch(r,y=>({...y,error:void 0,context:On(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(h){let g=h;if((g==null?void 0:g.name)==="AbortError"){if(p.abortController.signal.aborted){(i=p._nonReactive.loaderPromise)==null||i.resolve(),p._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,v=>({...v,status:v.status==="pending"?"success":v.status,isFetching:!1,context:On(e,n)}));return}const m=p._nonReactive.minPendingPromise;m&&await m,ht(h)&&await((u=(c=s.options.notFoundComponent)==null?void 0:c.preload)==null?void 0:u.call(c)),Sr(e,e.router.getMatch(r),h);try{(f=(d=s.options).onError)==null||f.call(d,h)}catch(v){g=v,Sr(e,e.router.getMatch(r),v)}e.updateMatch(r,v=>({...v,error:g,context:On(e,n),status:"error",isFetching:!1}))}}catch(p){const h=e.router.getMatch(r);h&&(h._nonReactive.loaderPromise=void 0),Sr(e,h,p)}},Lw=async(e,t,r)=>{var f,p;async function n(h,g,m,v){const y=Date.now()-g.updatedAt,b=h?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,C=v.options.shouldReload,w=typeof C=="function"?C(Eg(e,t,s,r,v)):C,{status:_,invalid:R}=m;a=_==="success"&&(R||(w??y>b)),h&&v.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{var z,D;try{await Pf(e,t,s,r,v);const j=e.router.getMatch(s);(z=j._nonReactive.loaderPromise)==null||z.resolve(),(D=j._nonReactive.loadPromise)==null||D.resolve(),j._nonReactive.loaderPromise=void 0}catch(j){yt(j)&&await e.router.navigate(j.options)}})()):(_!=="success"||a&&e.sync)&&await Pf(e,t,s,r,v))}const{id:s,routeId:o}=e.matches[r];let a=!1,i=!1;const c=e.router.looseRoutesById[o];if(!Sg(e,s)){const h=e.router.getMatch(s),g=ni(e,s);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(s),v=m._nonReactive.error||m.error;v&&Sr(e,m,v),m.status==="pending"&&await n(g,h,m,c)}else{const m=g&&!e.router.state.matches.some(y=>y.id===s),v=e.router.getMatch(s);v._nonReactive.loaderPromise=Bn(),m!==v.preload&&e.updateMatch(s,y=>({...y,preload:m})),await n(g,h,v,c)}}const u=e.router.getMatch(s);i||((f=u._nonReactive.loaderPromise)==null||f.resolve(),(p=u._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,i||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=i?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(e.updateMatch(s,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(s)):u};async function Rf(e){var p;const t=e,r=[];t.router.state.matches.some(h=>h._forcePending)&&Gl(t);let n;for(let h=0;h<t.matches.length;h++){try{const g=Ow(t,h);Zs(g)&&await g}catch(g){if(yt(g))throw g;if(ht(g))n=g;else if(!t.preload)throw g;break}if(t.serialError)break}const s=t.firstBadMatchIndex??t.matches.length,o=n&&!t.preload?Nf(t,n):void 0,a=n&&t.preload?0:o!==void 0?Math.min(o+1,s):s;let i,c;for(let h=0;h<a;h++)r.push(Lw(t,r,h));try{await Promise.all(r)}catch{const h=await Promise.allSettled(r);for(const g of h){if(g.status!=="rejected")continue;const m=g.reason;if(yt(m))throw m;ht(m)?i??(i=m):c??(c=m)}if(c!==void 0)throw c}const u=i??(n&&!t.preload?n:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!u&&n&&t.preload)return t.matches;if(u){const h=Nf(t,u);Pr(h!==void 0);const g=t.matches[h],m=t.router.looseRoutesById[g.routeId],v=(p=t.router.options)==null?void 0:p.defaultNotFoundComponent;!m.options.notFoundComponent&&v&&(m.options.notFoundComponent=v),u.routeId=g.routeId;const y=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,b=>({...b,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),d=h,await _a(m)}else if(!t.preload){const h=t.matches[0];if(!h.globalNotFound){const g=t.router.getMatch(h.id);g!=null&&g.globalNotFound&&t.updateMatch(h.id,m=>({...m,globalNotFound:!1,error:void 0}))}}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await _a(h)}for(let h=0;h<=d;h++){const g=t.matches[h],{id:m,routeId:v}=g,y=t.router.looseRoutesById[v];try{const b=Dw(t,m,y);if(b){const C=await b;t.updateMatch(m,w=>({...w,...C}))}}catch(b){console.error(`Error executing head for route ${v}:`,b)}}const f=Gl(t);if(Zs(f)&&await f,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function _a(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:r,...n}=t.options;Object.assign(e.options,n),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var n;const r=[];for(const s of Ng){const o=(n=e.options[s])==null?void 0:n.preload;o&&r.push(o())}if(r.length)return Promise.all(r).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Ag(e){var t;for(const r of Ng)if((t=e.options[r])!=null&&t.preload)return!0;return!1}const Ng=["component","errorComponent","pendingComponent","notFoundComponent"];function Fw(e){return{input:({url:t})=>{for(const r of e)t=Yl(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=Pg(e[r],t);return t}}}function Bw(e){const t=$g(e.basepath),r=`/${t}`,n=`${r}/`,s=e.caseSensitive?r:r.toLowerCase(),o=e.caseSensitive?n:n.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===s?a.pathname="/":i.startsWith(o)&&(a.pathname=a.pathname.slice(r.length)),a},output:({url:a})=>(a.pathname=ta(["/",t,a.pathname]),a)}}function Yl(e,t){var n;const r=(n=e==null?void 0:e.input)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function Pg(e,t){var n;const r=(n=e==null?void 0:e.output)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function Xr(e){const t=e.resolvedLocation,r=e.location,n=(t==null?void 0:t.pathname)!==r.pathname,s=(t==null?void 0:t.href)!==r.href,o=(t==null?void 0:t.hash)!==r.hash;return{fromLocation:t,toLocation:r,pathChanged:n,hrefChanged:s,hashChanged:o}}function Uw(e){const t=e.filter(r=>r.status!=="redirected");return t.length===e.length?e:t}class Ww{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{var p;const n=this.options,s=this.basepath??(n==null?void 0:n.basepath)??"/",o=this.basepath===void 0,a=n==null?void 0:n.rewrite;if(this.options={...n,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=bw(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Z1()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=xa(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=Y1(Kw(this.latestLocation)),Sw(this));let i=!1;const c=this.options.basepath??"/",u=this.options.rewrite;if(o||s!==c||a!==u){this.basepath=c;const h=[],g=$g(c);g&&g!=="/"&&h.push(Bw({basepath:c})),u&&h.push(u),this.rewrite=h.length===0?void 0:h.length===1?h[0]:Fw(h),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof((p=window.CSS)==null?void 0:p.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=hw(this.routeTree,this.options.caseSensitive,(n,s)=>{n.init({originalIndex:s})});return this.options.routeMasks&&lw(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,n)=>{const s={eventType:r,fn:n};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=r=>{this.subscribers.forEach(n=>{n.eventType===r.type&&n.fn(r)})},this.parseLocation=(r,n)=>{const s=({pathname:c,search:u,hash:d,href:f,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const b=this.options.parseSearch(u),C=this.options.stringifySearch(b);return{href:c+C+d,publicHref:f,pathname:ms(c).path,external:!1,searchStr:C,search:gt(n==null?void 0:n.search,b),hash:ms(d.slice(1)).path,state:gt(n==null?void 0:n.state,p)}}const h=new URL(f,this.origin),g=Yl(this.rewrite,h),m=this.options.parseSearch(g.search),v=this.options.stringifySearch(m);return g.search=v,{href:g.href.replace(g.origin,""),publicHref:f,pathname:ms(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:v,search:gt(n==null?void 0:n.search,m),hash:ms(g.hash.slice(1)).path,state:gt(n==null?void 0:n.state,p)}},o=s(r),{__tempLocation:a,__tempKey:i}=o.state;if(a&&(!i||i===this.tempLocationKey)){const c=s(a);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(r,n)=>yw({base:r,to:Yc(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,n,s)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:n},s):this.matchRoutesInternal(r,n),this.getMatchedRoutes=r=>Hw({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const n=this.getMatch(r);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const r=this.state.matches.filter(o=>o.status==="pending"),n=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...r,...n]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=r=>{const n=(o={})=>{var E,P;const a=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);o.from;const c=o.unsafeRelative==="path"?a.pathname:o.from??i.fullPath,u=this.resolvePathWithBase(c,"."),d=i.search,f={...i.params},p=o.to?this.resolvePathWithBase(u,`${o.to}`):this.resolvePathWithBase(u,"."),h=o.params===!1||o.params===null?{}:(o.params??!0)===!0?f:Object.assign(f,$r(o.params,f)),g=this.getMatchedRoutes(p);let m=g.matchedRoutes;if((!g.foundRoute||g.foundRoute.path!=="/"&&g.routeParams["**"])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(h).length>0)for(const K of m){const O=((E=K.options.params)==null?void 0:E.stringify)??K.options.stringifyParams;if(O)try{Object.assign(h,O(h))}catch{}}const y=r.leaveParams?p:ms(Ef({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let b=d;if(r._includeValidateSearch&&((P=this.options.search)!=null&&P.strict)){const K={};m.forEach(O=>{if(O.options.validateSearch)try{Object.assign(K,ra(O.options.validateSearch,{...K,...b}))}catch{}}),b=K}b=qw({search:b,dest:o,destRoutes:m,_includeValidateSearch:r._includeValidateSearch}),b=gt(d,b);const C=this.options.stringifySearch(b),w=o.hash===!0?a.hash:o.hash?$r(o.hash,a.hash):void 0,_=w?`#${w}`:"";let R=o.state===!0?a.state:o.state?$r(o.state,a.state):{};R=gt(a.state,R);const z=`${y}${C}${_}`;let D,j,S=!1;if(this.rewrite){const K=new URL(z,this.origin),O=Pg(this.rewrite,K);D=K.href.replace(K.origin,""),O.origin!==this.origin?(j=O.href,S=!0):j=O.pathname+O.search+O.hash}else D=ow(z),j=D;return{publicHref:j,href:D,pathname:y,search:b,searchStr:C,state:R,hash:w??"",external:S,unmaskOnReload:o.unmaskOnReload}},s=(o={},a)=>{const i=n(o);let c=a?n(a):void 0;if(!c){const u={};if(this.options.routeMasks){const d=cw(i.pathname,this.processedTree);if(d){Object.assign(u,d.rawParams);const{from:f,params:p,...h}=d.route,g=p===!1||p===null?{}:(p??!0)===!0?u:Object.assign(u,$r(p,u));a={from:r.from,...h,params:g},c=n(a)}}}return c&&(i.maskedLocation=c),i};return r.mask?s(r,{from:r.from,...r.mask}):s(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:n,...s})=>{const o=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(d=>{s.state[d]=this.latestLocation.state[d]});const u=Qr(s.state,this.latestLocation.state);return c.forEach(d=>{delete s.state[d]}),u},a=Ar(this.latestLocation.href)===Ar(s.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Bn(()=>{i==null||i.resolve()}),a&&o())this.load();else{let{maskedLocation:c,hashScrollIntoView:u,...d}=s;c&&(d={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[s.replace?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:n})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:n,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:a,href:i,...c}={})=>{if(i){const f=this.history.location.state.__TSR_index,p=Ys(i,{__TSR_index:r?f:f+1}),h=new URL(p.pathname,this.origin),g=Yl(this.rewrite,h);c.to=g.pathname,c.search=this.options.parseSearch(p.search),c.hash=p.hash.slice(1)}const u=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const d=this.commitLocation({...u,viewTransition:o,replace:r,resetScroll:n,hashScrollIntoView:s,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:r,reloadDocument:n,href:s,publicHref:o,...a})=>{var c;let i=!1;if(s)try{new URL(`${s}`),i=!0}catch{}if(i&&!n&&(n=!0),n){if(r!==void 0||!s){const d=this.buildLocation({to:r,...a});s=s??d.publicHref,o=o??d.publicHref}const u=!i&&o?o:s;if(ba(u,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history,f=((c=d.getBlockers)==null?void 0:c.call(d))??[];for(const p of f)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...a,href:s,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:r,cachedMatches:n.cachedMatches.filter(s=>!r.some(o=>o.id===s.id))}))},this.load=async r=>{let n,s,o;for(o=new Promise(i=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const u=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xr({resolvedLocation:d,location:u})}),this.emit({type:"onBeforeLoad",...Xr({resolvedLocation:d,location:u})}),await Rf({router:this,sync:r==null?void 0:r.sync,matches:this.state.pendingMatches,location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],p=[],h=[],g=[];Ls(()=>{this.__store.setState(m=>{const v=m.matches,y=m.pendingMatches||m.matches;return f=v.filter(b=>!y.some(C=>C.id===b.id)),p=v.filter(b=>!y.some(C=>C.routeId===b.routeId)),h=y.filter(b=>!v.some(C=>C.routeId===b.routeId)),g=y.filter(b=>v.some(C=>C.routeId===b.routeId)),{...m,isLoading:!1,loadedAt:Date.now(),matches:y,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[h,"onEnter"],[g,"onStay"]].forEach(([m,v])=>{m.forEach(y=>{var b,C;(C=(b=this.looseRoutesById[y.routeId].options)[v])==null||C.call(b,y)})})})})}})}catch(u){yt(u)?(n=u,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):ht(u)&&(s=u),this.__store.setState(d=>({...d,statusCode:n?n.status:s?404:d.matches.some(f=>f.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===o&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=r=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.state.resolvedLocation,i=typeof n.types=="function"?n.types(Xr({resolvedLocation:a,location:o})):n.types;if(i===!1){r();return}s={update:r,types:i}}else s=r;document.startViewTransition(s)}else r()},this.updateMatch=(r,n)=>{this.startTransition(()=>{var o;const s=(o=this.state.pendingMatches)!=null&&o.some(a=>a.id===r)?"pendingMatches":this.state.matches.some(a=>a.id===r)?"matches":this.state.cachedMatches.some(a=>a.id===r)?"cachedMatches":"";s&&(s==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:Uw(a.cachedMatches.map(i=>i.id===r?n(i):i))})):this.__store.setState(a=>{var i;return{...a,[s]:(i=a[s])==null?void 0:i.map(c=>c.id===r?n(c):c)}}))})},this.getMatch=r=>{var s;const n=o=>o.id===r;return this.state.cachedMatches.find(n)??((s=this.state.pendingMatches)==null?void 0:s.find(n))??this.state.matches.find(n)},this.invalidate=r=>{const n=s=>{var o;return((o=r==null?void 0:r.filter)==null?void 0:o.call(r,s))??!0?{...s,invalid:!0,...r!=null&&r.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.__store.setState(s=>{var o;return{...s,matches:s.matches.map(n),cachedMatches:s.cachedMatches.map(n),pendingMatches:(o=s.pendingMatches)==null?void 0:o.map(n)}}),this.shouldViewTransition=!1,this.load({sync:r==null?void 0:r.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const n=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const s=r.options._builtLocation??this.buildLocation(r.options),o=this.getParsedLocationHref(s);r.options.href=o,r.headers.set("Location",o)}else if(n)try{const s=new URL(n);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;r.options.href=o,r.headers.set("Location",o)}}catch{}if(r.options.href&&!r.options._builtLocation&&ba(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const n=r==null?void 0:r.filter;n!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!n(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const r=n=>{const s=this.looseRoutesById[n.routeId];if(!s.options.loader)return!0;const o=(n.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=_a,this.preloadRoute=async r=>{const n=r._builtLocation??this.buildLocation(r);let s=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:r});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...o,...this.state.cachedMatches.map(i=>i.id)]);Ls(()=>{s.forEach(i=>{a.has(i.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,i]}))})});try{return s=await Rf({router:this,matches:s,location:n,preload:!0,updateMatch:(i,c)=>{o.has(i)?s=s.map(u=>u.id===i?c(u):u):this.updateMatch(i,c)}}),s}catch(i){if(yt(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:n});ht(i)||console.error(i);return}},this.matchRoute=(r,n)=>{const s={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},o=this.buildLocation(s);if(n!=null&&n.pending&&this.state.status!=="pending")return!1;const i=((n==null?void 0:n.pending)===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=uw(o.pathname,(n==null?void 0:n.caseSensitive)??!1,(n==null?void 0:n.fuzzy)??!1,i.pathname,this.processedTree);return!c||r.params&&!Qr(c.rawParams,r.params,{partial:!0})?!1:(n==null?void 0:n.includeSearch)??!0?Qr(i.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(r=>r.status==="notFound"||r.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Pw,parseSearch:t.parseSearch??Nw,protocolAllowlist:t.protocolAllowlist??sw}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:r,processedTree:n}){this.routesById=t,this.routesByPath=r,this.processedTree=n;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(t){return(t==null?void 0:t.id)?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,r){var p,h;const n=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:o,parsedParams:a}=n;let{matchedRoutes:i}=n,c=!1;(s?s.path!=="/"&&o["**"]:Ar(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:c=!0);const u=c?Yw(this.options.notFoundMode,i):void 0,d=new Array(i.length),f=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<i.length;g++){const m=i[g],v=d[g-1];let y,b,C;{const V=(v==null?void 0:v.search)??t.search,L=(v==null?void 0:v._strictSearch)??void 0;try{const U=ra(m.options.validateSearch,{...V})??void 0;y={...V,...U},b={...L,...U},C=void 0}catch(U){let oe=U;if(U instanceof Ca||(oe=new Ca(U.message,{cause:U})),r!=null&&r.throwOnError)throw oe;y=V,b={},C=oe}}const w=((h=(p=m.options).loaderDeps)==null?void 0:h.call(p,{search:y}))??"",_=w?JSON.stringify(w):"",{interpolatedPath:R,usedParams:z}=Ef({path:m.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),D=m.id+R+_,j=this.getMatch(D),S=f.get(m.id),E=(j==null?void 0:j._strictParams)??z;let P;if(!j)try{Tf(m,z,a,E)}catch(V){if(ht(V)||yt(V)?P=V:P=new Vw(V.message,{cause:V}),r!=null&&r.throwOnError)throw P}Object.assign(o,E);const K=S?"stay":"enter";let O;if(j)O={...j,cause:K,params:(S==null?void 0:S.params)??o,_strictParams:E,search:gt(S?S.search:j.search,y),_strictSearch:b};else{const V=m.options.loader||m.options.beforeLoad||m.lazyFn||Ag(m)?"pending":"success";O={id:D,ssr:m.options.ssr,index:g,routeId:m.id,params:(S==null?void 0:S.params)??o,_strictParams:E,pathname:R,updatedAt:Date.now(),search:S?gt(S.search,y):y,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Bn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:K,loaderDeps:S?gt(S.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}r!=null&&r.preload||(O.globalNotFound=u===m.id),O.searchError=C;const q=this.getParentContext(v);O.context={...q,...O.__routeContext,...O.__beforeLoadContext},d[g]=O}for(let g=0;g<d.length;g++){const m=d[g],v=this.looseRoutesById[m.routeId],y=this.getMatch(m.id),b=f.get(m.routeId);if(m.params=b?gt(b.params,o):o,!y){const C=d[g-1],w=this.getParentContext(C);if(v.options.context){const _={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:v.id};m.__routeContext=v.options.context(_)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:r,routeParams:n,parsedParams:s}=this.getMatchedRoutes(t.pathname),o=Js(r),a={...t.search};for(const d of r)try{Object.assign(a,ra(d.options.validateSearch,a))}catch{}const i=Js(this.state.matches),c=i&&i.routeId===o.id&&t.pathname===this.state.location.pathname;let u;if(c)u=i.params;else{const d={...n};for(const f of r)try{Tf(f,n,s??{},d)}catch{}u=d}return{matchedRoutes:r,fullPath:o.fullPath,search:a,params:u}}}class Ca extends Error{}class Vw extends Error{}function Kw(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ra(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new Ca("Async validation not supported");if(r.issues)throw new Ca(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Hw({pathname:e,routesById:t,processedTree:r}){const n={},s=Ar(e);let o,a;const i=dw(s,r,!0);return i&&(o=i.route,Object.assign(n,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:(i==null?void 0:i.branch)||[t[_t]],routeParams:n,foundRoute:o,parsedParams:a}}function qw({search:e,dest:t,destRoutes:r,_includeValidateSearch:n}){return Gw(r)(e,t,n??!1)}function Gw(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)(s=o.options.search)!=null&&s.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const a=({search:i,next:c})=>{let u=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(u=o.options.preSearchFilters.reduce((f,p)=>p(f),i));const d=c(u);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,p)=>p(f),d):d};t.middlewares.push(a)}if(o.options.validateSearch){const a=({search:i,next:c})=>{const u=c(i);if(!t._includeValidateSearch)return u;try{return{...u,...ra(o.options.validateSearch,u)??void 0}}catch{return u}};t.middlewares.push(a)}}const r=({search:o})=>{const a=t.dest;return a.search?a.search===!0?o:$r(a.search,o):{}};t.middlewares.push(r);const n=(o,a,i)=>{if(o>=i.length)return a;const c=i[o];return c({search:a,next:d=>n(o+1,d,i)})};return function(a,i,c){return t.dest=i,t._includeValidateSearch=c,n(0,a,t.middlewares)}}function Yw(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const n=t[r];if(n.children)return n.id}return _t}function Tf(e,t,r,n){var o;const s=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const a in t)a in r&&(n[a]=r[a]);else{const a=s(n);Object.assign(n,a)}}const Jw="Error preloading route! ☝️";class Rg{constructor(t){if(this.init=r=>{var u,d;this.originalIndex=r.originalIndex;const n=this.options,s=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(d=(u=this.options).getParentRoute)==null?void 0:d.call(u),s?this._path=_t:this.parentRoute||Pr(!1);let o=s?_t:n==null?void 0:n.path;o&&o!=="/"&&(o=Cg(o));const a=(n==null?void 0:n.id)||o;let i=s?_t:ta([this.parentRoute.id===_t?"":this.parentRoute.id,a]);o===_t&&(o="/"),i!==_t&&(i=ta(["/",i]));const c=i===_t?"/":ta([this.parentRoute.fullPath,o]);this._path=o,this._id=i,this._fullPath=c,this._to=Ar(c)},this.addChildren=r=>this._addFileChildren(r),this._addFileChildren=r=>(Array.isArray(r)&&(this.children=r),typeof r=="object"&&r!==null&&(this.children=Object.values(r)),this),this._addFileTypes=()=>this,this.updateLoader=r=>(Object.assign(this.options,r),this),this.update=r=>(Object.assign(this.options,r),this),this.lazy=r=>(this.lazyFn=r,this),this.redirect=r=>Iw({from:this.fullPath,...r}),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Zw extends Rg{constructor(t){super(t)}}const Do=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Vi(e){const t=x.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function Qw(e,t,r={},n={}){x.useEffect(()=>{if(!e.current||n.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{t(o)},r);return s.observe(e.current),()=>{s.disconnect()}},[t,r,n.disabled,e])}function Xw(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}function Jc(e){const t=e.errorComponent??Zc;return l.jsx(ek,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:n})=>r?x.createElement(t,{error:r,reset:n}):e.children})}class ek extends x.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,r){r.error&&r.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,r){this.props.onCatch&&this.props.onCatch(t,r)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Zc({error:e}){const[t,r]=x.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(n=>!n),children:t?"Hide Error":"Show Error"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function tk({children:e,fallback:t=null}){return Tg()?l.jsx(B.Fragment,{children:e}):l.jsx(B.Fragment,{children:t})}function Tg(){return B.useSyncExternalStore(rk,()=>!0,()=>!1)}function rk(){return()=>{}}var Ig={exports:{}},Mg={},zg={exports:{}},Og={};/**
9
+ */var _1=x,C1=Symbol.for("react.element"),$1=Symbol.for("react.fragment"),S1=Object.prototype.hasOwnProperty,j1=_1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E1={key:!0,ref:!0,__self:!0,__source:!0};function lg(e,t,r){var n,s={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)S1.call(t,n)&&!E1.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:C1,type:e,key:o,ref:a,props:s,_owner:j1.current}}ei.Fragment=$1;ei.jsx=lg;ei.jsxs=lg;ig.exports=ei;var l=ig.exports;if(!("acquireVsCodeApi"in window)){let e=function(){return typeof navigator<"u"&&navigator.onLine===!1?"You are offline. Form submissions are unavailable until the standalone backend reconnects.":"Cannot submit while disconnected from the standalone backend. Wait for reconnection and try again."},t=function(E){const P={type:"connectionStatus",...E};window.postMessage(P,"*")},r=function(){z!==null&&(window.clearTimeout(z),z=null)},n=function(E){C&&E.send(JSON.stringify({type:"ready"})),w&&E.send(w),_&&E.send(_)},s=function(E){for(const P of v)E.send(P);v.length=0},o=function(E){if(y=!1,!D||z!==null)return;if(R>=g){t({connected:!1,reconnecting:!1,fatal:!0,retryCount:R,maxRetries:g,reason:E});return}const P=h[R];R+=1,t({connected:!1,reconnecting:!0,fatal:!1,retryCount:R,maxRetries:g,retryDelayMs:P,reason:E}),z=window.setTimeout(()=>{z=null,a()},P)},a=function(){const E=new WebSocket(p);m=E,E.addEventListener("open",()=>{if(m!==E)return;y=!0;const P=!b;b=!0,r(),R=0,n(E),P&&s(E),t({connected:!0,reconnecting:!1,fatal:!1,retryCount:0,maxRetries:g})}),E.addEventListener("message",P=>{if(m===E)try{const K=JSON.parse(P.data);window.postMessage(K,"*")}catch{}}),E.addEventListener("error",()=>{m===E&&(E.readyState===WebSocket.CONNECTING||E.readyState===WebSocket.OPEN)&&E.close()}),E.addEventListener("close",()=>{m===E&&(m=null,o("socket-closed"))})},i=function(E){const P=document.createElement("input");P.type="file",P.multiple=!0,P.style.display="none",document.body.appendChild(P);const K=()=>{P.remove()};P.onchange=async()=>{if(!P.files||P.files.length===0){K();return}const O=[];for(const G of Array.from(P.files)){const V=await G.arrayBuffer(),L=new Uint8Array(V);let U="";for(let oe=0;oe<L.length;oe++)U+=String.fromCharCode(L[oe]);O.push({name:G.name,data:btoa(U)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cardId:E,files:O})})}catch(G){console.error("Failed to upload attachment:",G)}K()},P.click()},c=function(E,P){const K=`/api/attachment?cardId=${encodeURIComponent(E)}&filename=${encodeURIComponent(P)}`;window.open(K,"_blank")},u=function(E){document.body.classList.toggle("vscode-dark",E),document.body.classList.toggle("vscode-light",!E)},d=function(){const E=localStorage.getItem("kanban-standalone-theme");u(E!==null?E==="dark":S.matches)};const f=window.__KB_BASE__??"",p=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}${f}/ws`,h=[250,500,1e3,2e3,4e3],g=h.length;let m=null;const v=[];let y=!1,b=!1,C=!1,w=null,_=null,R=0,z=null,D=!0;window.addEventListener("beforeunload",()=>{D=!1,r(),m&&(m.readyState===WebSocket.CONNECTING||m.readyState===WebSocket.OPEN)&&m.close()}),a();let j=null;try{const E=sessionStorage.getItem("kanban-standalone-state");E&&(j=JSON.parse(E))}catch{}window.acquireVsCodeApi=()=>({postMessage(E){const P=E;if(P.type==="openFile"){const O=P.cardId;fetch(`/api/card-file?cardId=${encodeURIComponent(O)}`).then(G=>G.json()).then(G=>{var U;const V=(U=G==null?void 0:G.data)==null?void 0:U.path;if(!V){console.error("card-file: missing path in response",G);return}const L=document.createElement("a");L.href=`vscode://file/${V}`,document.body.appendChild(L),L.click(),document.body.removeChild(L)}).catch(G=>console.error("Failed to open card in VS Code:",G));return}if(P.type==="openMetadataFile"){const O=P.path;fetch(`/api/resolve-path?path=${encodeURIComponent(O)}`).then(G=>G.json()).then(G=>{var U;const V=(U=G==null?void 0:G.data)==null?void 0:U.path;if(!V){console.error("resolve-path: missing path in response",G);return}const L=document.createElement("a");L.href=`vscode://file/${V}`,document.body.appendChild(L),L.click(),document.body.removeChild(L)}).catch(G=>console.error("Failed to open metadata file in VS Code:",G));return}if(P.type==="addAttachment"){i(P.cardId);return}if(P.type==="openAttachment"){c(P.cardId,P.attachment);return}if(P.type==="toggleTheme"){const G=!document.body.classList.contains("vscode-dark");localStorage.setItem("kanban-standalone-theme",G?"dark":"light"),u(G);return}const K=JSON.stringify(E);if(P.type==="ready"){C=!0,y&&m&&m.readyState===WebSocket.OPEN&&m.send(K);return}if(P.type==="switchBoard"&&(w=K),P.type==="openCard"&&(_=K),P.type==="closeCard"&&(_=null),P.type==="switchBoard"||P.type==="openCard"||P.type==="closeCard"){y&&m&&m.readyState===WebSocket.OPEN&&m.send(K);return}if(P.type==="submitForm"&&(!y||!m||m.readyState!==WebSocket.OPEN)){window.postMessage({type:"submitFormResult",callbackKey:P.callbackKey,error:e()},"*");return}y&&m&&m.readyState===WebSocket.OPEN?m.send(K):b?console.warn("Dropping standalone message while disconnected",P.type):v.push(K)},getState(){return j},setState(E){j=E;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(E))}catch{}}});const S=window.matchMedia("(prefers-color-scheme: dark)");S.addEventListener("change",E=>{localStorage.getItem("kanban-standalone-theme")===null&&u(E.matches)}),document.body?d():document.addEventListener("DOMContentLoaded",d)}var cg,mf=ag;cg=mf.createRoot,mf.hydrateRoot;var Le=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Le||{});function ug({update:e,notify:t,unwatched:r}){return{link:n,unlink:s,propagate:o,checkDirty:a,shallowPropagate:i};function n(u,d,f){const p=d.depsTail;if(p!==void 0&&p.dep===u)return;const h=p!==void 0?p.nextDep:d.deps;if(h!==void 0&&h.dep===u){h.version=f,d.depsTail=h;return}const g=u.subsTail;if(g!==void 0&&g.version===f&&g.sub===d)return;const m=d.depsTail=u.subsTail={version:f,dep:u,sub:d,prevDep:p,nextDep:h,prevSub:g,nextSub:void 0};h!==void 0&&(h.prevDep=m),p!==void 0?p.nextDep=m:d.deps=m,g!==void 0?g.nextSub=m:u.subs=m}function s(u,d=u.sub){const f=u.dep,p=u.prevDep,h=u.nextDep,g=u.nextSub,m=u.prevSub;return h!==void 0?h.prevDep=p:d.depsTail=p,p!==void 0?p.nextDep=h:d.deps=h,g!==void 0?g.prevSub=m:f.subsTail=m,m!==void 0?m.nextSub=g:(f.subs=g)===void 0&&r(f),h}function o(u){let d=u.nextSub,f;e:do{const p=u.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&c(u,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const g=p.subs;if(g!==void 0){const m=(u=g).nextSub;m!==void 0&&(f={value:d,prev:f},d=m);continue}}if((u=d)!==void 0){d=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){d=u.nextSub;continue e}break}while(!0)}function a(u,d){let f,p=0,h=!1;e:do{const g=u.dep,m=g.flags;if(d.flags&16)h=!0;else if((m&17)===17){if(e(g)){const v=g.subs;v.nextSub!==void 0&&i(v),h=!0}}else if((m&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=g.deps,d=g,++p;continue}if(!h){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=d.subs,y=v.nextSub!==void 0;if(y?(u=f.value,f=f.prev):u=v,h){if(e(d)){y&&i(v),d=u.sub;continue}h=!1}else d.flags&=-33;d=u.sub;const b=u.nextDep;if(b!==void 0){u=b;continue e}}return h}while(!0)}function i(u){do{const d=u.sub,f=d.flags;(f&48)===32&&(d.flags=f|16,(f&6)===2&&t(d))}while((u=u.nextSub)!==void 0)}function c(u,d){let f=d.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}let Bc=0,Or=0,Ds=0;const or=[],{link:CQ,unlink:dg,propagate:$Q,checkDirty:A1,shallowPropagate:SQ}=ug({update(e){return e.depsTail!==void 0?T1(e):I1(e)},notify(e){var n;let t=Ds,r=t;do if(or[t++]=e,e.flags&=-3,e=(n=e.subs)==null?void 0:n.sub,e===void 0||!(e.flags&2))break;while(!0);for(Ds=t;r<--t;){const s=or[r];or[r++]=or[t],or[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ti(e)):O1.call(e)}});function N1(){return Bc}function P1(){++Bc}function R1(){--Bc||z1()}function T1(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,ti(e)}}function I1(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function M1(e){const t=e.flags;if(t&16||t&32&&A1(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,ti(e)}}else e.flags=2}function z1(){try{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,M1(e)}}finally{for(;Or<Ds;){const e=or[Or];or[Or++]=void 0,e.flags|=10}Or=0,Ds=0}}function O1(){this.depsTail=void 0,this.flags=0,ti(this);const e=this.subs;e!==void 0&&dg(e)}function ti(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=dg(r,e)}function Uc(e,t,r){var o,a,i;const n=typeof e=="object",s=n?e:void 0;return{next:(o=n?e.next:e)==null?void 0:o.bind(s),error:(a=n?e.error:t)==null?void 0:a.bind(s),complete:(i=n?e.complete:r)==null?void 0:i.bind(s)}}const Bl=[];let ea=0;const{link:gf,unlink:D1,propagate:L1,checkDirty:fg,shallowPropagate:vf}=ug({update(e){return e._update()},notify(e){Bl[Ul++]=e,e.flags&=~Le.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Le.Mutable|Le.Dirty,va(e))}});let zo=0,Ul=0,Ft;function va(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=D1(r,e)}function hg(){if(!(N1()>0)){for(;zo<Ul;){const e=Bl[zo];Bl[zo++]=void 0,e.notify()}zo=0,Ul=0}}function pg(e,t){const r=typeof e=="function",n=e,s={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?Le.None:Le.Mutable,get(){return Ft!==void 0&&gf(s,Ft,ea),s._snapshot},subscribe(o){const a=Uc(o),i={current:!1},c=F1(()=>{var u;s.get(),i.current?(u=a.next)==null||u.call(a,s._snapshot):i.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(o){const a=Ft,i=Object.is;if(r)Ft=s,++ea,s.depsTail=void 0;else if(o===void 0)return!1;r&&(s.flags=Le.Mutable|Le.RecursedCheck);try{const c=s._snapshot,u=typeof o=="function"?o(c):o===void 0&&r?n(c):o;return c===void 0||!i(c,u)?(s._snapshot=u,!0):!1}finally{Ft=a,r&&(s.flags&=~Le.RecursedCheck),va(s)}}};return r?(s.flags=Le.Mutable|Le.Dirty,s.get=function(){const o=s.flags;if(o&Le.Dirty||o&Le.Pending&&fg(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&vf(a)}}else o&Le.Pending&&(s.flags=o&~Le.Pending);return Ft!==void 0&&gf(s,Ft,ea),s._snapshot}):s.set=function(o){if(s._update(o)){const a=s.subs;a!==void 0&&(L1(a),vf(a),hg())}},s}function F1(e){const t=()=>{const n=Ft;Ft=r,++ea,r.depsTail=void 0,r.flags=Le.Watching|Le.RecursedCheck;try{return e()}finally{Ft=n,r.flags&=~Le.RecursedCheck,va(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Le.Watching|Le.RecursedCheck,notify(){const n=this.flags;n&Le.Dirty||n&Le.Pending&&fg(this.deps,this)?t():this.flags=Le.Watching},stop(){this.flags=Le.None,this.depsTail=void 0,va(this)}};return t(),r}class B1{constructor(t){this.atom=pg(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Uc(t))}}class U1{constructor(t){this.atom=pg(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Uc(t))}}function W1(e){return typeof e=="function"?new U1(e):new B1(e)}function V1(e){try{P1(),e()}finally{R1(),hg()}}const Er="__TSR_index",yf="popstate",bf="beforeunload";function mg(e){let t=e.getLocation();const r=new Set,n=a=>{t=e.getLocation(),r.forEach(i=>i({location:t,action:a}))},s=a=>{e.notifyOnIndexChange??!0?n(a):t=e.getLocation()},o=async({task:a,navigateOpts:i,...c})=>{var p,h;if((i==null?void 0:i.ignoreBlocker)??!1){a();return}const d=((p=e.getBlockers)==null?void 0:p.call(e))??[],f=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(const g of d){const m=Ys(c.path,c.state);if(await g.blockerFn({currentLocation:t,nextLocation:m,action:c.type})){(h=e.onBlocked)==null||h.call(e);return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:a=>(r.add(a),()=>{r.delete(a)}),push:(a,i,c)=>{const u=t.state[Er];i=Wl(u+1,i),o({task:()=>{e.pushState(a,i),n({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:i})},replace:(a,i,c)=>{const u=t.state[Er];i=Wl(u,i),o({task:()=>{e.replaceState(a,i),n({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:i})},go:(a,i)=>{o({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{o({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Er]!==0,createHref:a=>e.createHref(a),block:a=>{var c;if(!e.setBlockers)return()=>{};const i=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...i,a]),()=>{var d,f;const u=((d=e.getBlockers)==null?void 0:d.call(e))??[];(f=e.setBlockers)==null||f.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:n}}function Wl(e,t){t||(t={});const r=Wc();return{...t,key:r,__TSR_key:r,[Er]:e}}function K1(e){var D,j;const t=typeof document<"u"?window:void 0,r=t.history.pushState,n=t.history.replaceState;let s=[];const o=()=>s,a=S=>s=S,i=S=>S,c=()=>Ys(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((D=t.history.state)!=null&&D.__TSR_key)&&!((j=t.history.state)!=null&&j.key)){const S=Wc();t.history.replaceState({[Er]:0,key:S,__TSR_key:S},"")}let u=c(),d,f=!1,p=!1,h=!1,g=!1;const m=()=>u;let v,y;const b=()=>{v&&(z._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),z._ignoreSubscribers=!1,v=void 0,y=void 0,d=void 0)},C=(S,E,P)=>{const K=i(E);y||(d=u),u=Ys(E,P),v={href:K,state:P,isPush:(v==null?void 0:v.isPush)||S==="push"},y||(y=Promise.resolve().then(()=>b()))},w=S=>{u=c(),z.notify({type:S})},_=async()=>{if(p){p=!1;return}const S=c(),E=S.state[Er]-u.state[Er],P=E===1,K=E===-1,O=!P&&!K||f;f=!1;const G=O?"GO":K?"BACK":"FORWARD",V=O?{type:"GO",index:E}:{type:K?"BACK":"FORWARD"};if(h)h=!1;else{const L=o();if(typeof document<"u"&&L.length){for(const U of L)if(await U.blockerFn({currentLocation:u,nextLocation:S,action:G})){p=!0,t.history.go(1),z.notify(V);return}}}u=c(),z.notify(V)},R=S=>{if(g){g=!1;return}let E=!1;const P=o();if(typeof document<"u"&&P.length)for(const K of P){const O=K.enableBeforeUnload??!0;if(O===!0){E=!0;break}if(typeof O=="function"&&O()===!0){E=!0;break}}if(E)return S.preventDefault(),S.returnValue=""},z=mg({getLocation:m,getLength:()=>t.history.length,pushState:(S,E)=>C("push",S,E),replaceState:(S,E)=>C("replace",S,E),back:S=>(S&&(h=!0),g=!0,t.history.back()),forward:S=>{S&&(h=!0),g=!0,t.history.forward()},go:S=>{f=!0,t.history.go(S)},createHref:S=>i(S),flush:b,destroy:()=>{t.history.pushState=r,t.history.replaceState=n,t.removeEventListener(bf,R,{capture:!0}),t.removeEventListener(yf,_)},onBlocked:()=>{d&&u!==d&&(u=d)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(bf,R,{capture:!0}),t.addEventListener(yf,_),t.history.pushState=function(...S){const E=r.apply(t.history,S);return z._ignoreSubscribers||w("PUSH"),E},t.history.replaceState=function(...S){const E=n.apply(t.history,S);return z._ignoreSubscribers||w("REPLACE"),E},z}function H1(e={initialEntries:["/"]}){const t=e.initialEntries;let r=e.initialIndex?Math.min(Math.max(e.initialIndex,0),t.length-1):t.length-1;const n=t.map((c,u)=>Wl(u,void 0)),s=()=>Ys(t[r],n[r]);let o=[];return mg({getLocation:s,getLength:()=>t.length,pushState:(c,u)=>{r<t.length-1&&(t.splice(r+1),n.splice(r+1)),n.push(u),t.push(c),r=Math.max(t.length-1,0)},replaceState:(c,u)=>{n[r]=u,t[r]=c},back:()=>{r=Math.max(r-1,0)},forward:()=>{r=Math.min(r+1,t.length-1)},go:c=>{r=Math.min(Math.max(r+c,0),t.length-1)},createHref:c=>c,getBlockers:()=>o,setBlockers:c=>o=c})}function G1(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Ys(e,t){const r=G1(e),n=r.indexOf("#"),s=r.indexOf("?"),o=Wc();return{href:r,pathname:r.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:r.length),hash:n>-1?r.substring(n):"",search:s>-1?r.slice(s,n===-1?void 0:n):"",state:t||{[Er]:0,key:o,__TSR_key:o}}}function Wc(){return(Math.random()+1).toString(36).substring(7)}const q1=!1;function Ls(e){let t;return V1(()=>{t=e()}),t}function Js(e){return e[e.length-1]}function Y1(e){return typeof e=="function"}function $r(e,t){return Y1(e)?e(t):e}const J1=Object.prototype.hasOwnProperty,xf=Object.prototype.propertyIsEnumerable;function gt(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=t,s=_f(e)&&_f(n);if(!s&&!(ya(e)&&ya(n)))return n;const o=s?e:wf(e);if(!o)return n;const a=s?n:wf(n);if(!a)return n;const i=o.length,c=a.length,u=s?new Array(c):{};let d=0;for(let f=0;f<c;f++){const p=s?f:a[f],h=e[p],g=n[p];if(h===g){u[p]=h,(s?f<i:J1.call(e,p))&&d++;continue}if(h===null||g===null||typeof h!="object"||typeof g!="object"){u[p]=g;continue}const m=gt(h,g,r+1);u[p]=m,m===h&&d++}return i===c&&d===i?e:u}function wf(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!xf.call(e,s))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const n=t;for(const s of r){if(!xf.call(e,s))return!1;n.push(s)}return n}function ya(e){if(!kf(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!kf(r)||!r.hasOwnProperty("isPrototypeOf"))}function kf(e){return Object.prototype.toString.call(e)==="[object Object]"}function _f(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qr(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!Qr(e[n],t[n],r))return!1;return!0}if(ya(e)&&ya(t)){const n=(r==null?void 0:r.ignoreUndefined)??!0;if(r!=null&&r.partial){for(const a in t)if((!n||t[a]!==void 0)&&!Qr(e[a],t[a],r))return!1;return!0}let s=0;if(!n)s=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&s++;let o=0;for(const a in t)if((!n||t[a]!==void 0)&&(o++,o>s||!Qr(e[a],t[a],r)))return!1;return s===o}return!1}function Bn(e){let t,r;const n=new Promise((s,o)=>{t=s,r=o});return n.status="pending",n.resolve=s=>{n.status="resolved",n.value=s,t(s),e==null||e(s)},n.reject=s=>{n.status="rejected",r(s)},n}function Zs(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Z1(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Cf(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return Z1(t)}const Q1=["http:","https:","mailto:","tel:"];function ba(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}function ms(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,n="",s;for(;(s=t.exec(e))!==null;)n+=Cf(e.slice(r,s.index))+s[0],r=t.lastIndex;n=n+Cf(r?e.slice(r):e);let o=!1;return n.startsWith("//")&&(o=!0,n="/"+n.replace(/^\/+/,"")),{path:n,handledProtocolRelativeURL:o}}function X1(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var ew="Invariant failed";function Pr(e,t){if(!e)throw new Error(ew)}function xa(e){const t=new Map;let r,n;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,n&&(n.next=o,o.prev=n)):(o.next.prev=void 0,r=o.next,o.next=void 0,n&&(o.prev=n,n.next=o)),n=o)};return{get(o){const a=t.get(o);if(a)return s(a),a.value},set(o,a){if(t.size>=e&&r){const c=r;t.delete(c.key),c.next&&(r=c.next,c.next.prev=void 0),c===n&&(n=void 0)}const i=t.get(o);if(i)i.value=a,s(i);else{const c={key:o,value:a,prev:n};n&&(n.next=c),n=c,r||(r=c),t.set(o,c)}},clear(){t.clear(),r=void 0,n=void 0}}}const Un=0,tn=1,rn=2,Qs=3,qr=4,gg=5;function tw(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function Vc(e,t,r=new Uint16Array(6)){const n=e.indexOf("/",t),s=n===-1?e.length:n,o=e.substring(t,s);if(!o||!o.includes("$"))return r[0]=Un,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r;if(o==="$"){const i=e.length;return r[0]=rn,r[1]=t,r[2]=t,r[3]=i,r[4]=i,r[5]=i,r}if(o.charCodeAt(0)===36)return r[0]=tn,r[1]=t,r[2]=t+1,r[3]=s,r[4]=s,r[5]=s,r;const a=tw(o);if(a){const[i,c]=a,u=o.charCodeAt(i+1);if(u===45){if(i+2<o.length&&o.charCodeAt(i+2)===36){const d=i+3,f=c;if(d<f)return r[0]=Qs,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+c+1,r[5]=s,r}}else if(u===36){const d=i+1,f=i+2;return f===c?(r[0]=rn,r[1]=t+i,r[2]=t+d,r[3]=t+f,r[4]=t+c+1,r[5]=e.length,r):(r[0]=tn,r[1]=t+i,r[2]=t+f,r[3]=t+c,r[4]=t+c+1,r[5]=s,r)}}return r[0]=Un,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r}function ri(e,t,r,n,s,o,a){var c,u,d,f,p,h,g,m,v,y,b,C,w;a==null||a(r);let i=n;{const _=r.fullPath??r.from,R=_.length,z=((c=r.options)==null?void 0:c.caseSensitive)??e,D=!!((d=(u=r.options)==null?void 0:u.params)!=null&&d.parse&&((p=(f=r.options)==null?void 0:f.skipRouteOnParseError)!=null&&p.params));for(;i<R;){const S=Vc(_,i,t);let E;const P=i,K=S[5];switch(i=K+1,o++,S[0]){case Un:{const G=_.substring(S[2],S[3]);if(z){const V=(h=s.static)==null?void 0:h.get(G);if(V)E=V;else{s.static??(s.static=new Map);const L=Yr(r.fullPath??r.from);L.parent=s,L.depth=o,E=L,s.static.set(G,L)}}else{const V=G.toLowerCase(),L=(g=s.staticInsensitive)==null?void 0:g.get(V);if(L)E=L;else{s.staticInsensitive??(s.staticInsensitive=new Map);const U=Yr(r.fullPath??r.from);U.parent=s,U.depth=o,E=U,s.staticInsensitive.set(V,U)}}break}case tn:{const G=_.substring(P,S[1]),V=_.substring(S[4],K),L=z&&!!(G||V),U=G?L?G:G.toLowerCase():void 0,oe=V?L?V:V.toLowerCase():void 0,Y=!D&&((m=s.dynamic)==null?void 0:m.find(N=>!N.skipOnParamError&&N.caseSensitive===L&&N.prefix===U&&N.suffix===oe));if(Y)E=Y;else{const N=Fi(tn,r.fullPath??r.from,L,U,oe);E=N,N.depth=o,N.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(N)}break}case Qs:{const G=_.substring(P,S[1]),V=_.substring(S[4],K),L=z&&!!(G||V),U=G?L?G:G.toLowerCase():void 0,oe=V?L?V:V.toLowerCase():void 0,Y=!D&&((v=s.optional)==null?void 0:v.find(N=>!N.skipOnParamError&&N.caseSensitive===L&&N.prefix===U&&N.suffix===oe));if(Y)E=Y;else{const N=Fi(Qs,r.fullPath??r.from,L,U,oe);E=N,N.parent=s,N.depth=o,s.optional??(s.optional=[]),s.optional.push(N)}break}case rn:{const G=_.substring(P,S[1]),V=_.substring(S[4],K),L=z&&!!(G||V),U=G?L?G:G.toLowerCase():void 0,oe=V?L?V:V.toLowerCase():void 0,Y=Fi(rn,r.fullPath??r.from,L,U,oe);E=Y,Y.parent=s,Y.depth=o,s.wildcard??(s.wildcard=[]),s.wildcard.push(Y)}}s=E}if(D&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const S=Yr(r.fullPath??r.from);S.kind=gg,S.parent=s,o++,S.depth=o,s.pathless??(s.pathless=[]),s.pathless.push(S),s=S}const j=(r.path||!r.children)&&!r.isRoot;if(j&&_.endsWith("/")){const S=Yr(r.fullPath??r.from);S.kind=qr,S.parent=s,o++,S.depth=o,s.index=S,s=S}s.parse=((b=(y=r.options)==null?void 0:y.params)==null?void 0:b.parse)??null,s.skipOnParamError=D,s.parsingPriority=((w=(C=r.options)==null?void 0:C.skipRouteOnParseError)==null?void 0:w.priority)??0,j&&!s.route&&(s.route=r,s.fullPath=r.fullPath??r.from)}if(r.children)for(const _ of r.children)ri(e,t,_,i,s,o,a)}function Li(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Cr(e){var t,r,n;if(e.pathless)for(const s of e.pathless)Cr(s);if(e.static)for(const s of e.static.values())Cr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())Cr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Li);for(const s of e.dynamic)Cr(s)}if((r=e.optional)!=null&&r.length){e.optional.sort(Li);for(const s of e.optional)Cr(s)}if((n=e.wildcard)!=null&&n.length){e.wildcard.sort(Li);for(const s of e.wildcard)Cr(s)}}function Yr(e){return{kind:Un,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fi(e,t,r,n,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:n,suffix:s}}function rw(e,t){const r=Yr("/"),n=new Uint16Array(6);for(const s of e)ri(!1,n,s,1,r,0);Cr(r),t.masksTree=r,t.flatCache=xa(1e3)}function nw(e,t){e||(e="/");const r=t.flatCache.get(e);if(r)return r;const n=Kc(e,t.masksTree);return t.flatCache.set(e,n),n}function sw(e,t,r,n,s){e||(e="/"),n||(n="/");const o=t?`case\0${e}`:e;let a=s.singleCache.get(o);if(!a){a=Yr("/");const i=new Uint16Array(6);ri(t,i,{from:e},1,a,0),s.singleCache.set(o,a)}return Kc(n,a,r)}function ow(e,t,r=!1){const n=r?e:`nofuzz\0${e}`,s=t.matchCache.get(n);if(s!==void 0)return s;e||(e="/");let o;try{o=Kc(e,t.segmentTree,r)}catch(a){if(a instanceof URIError)o=null;else throw a}return o&&(o.branch=lw(o.route)),t.matchCache.set(n,o),o}function aw(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function iw(e,t=!1,r){const n=Yr(e.fullPath),s=new Uint16Array(6),o={},a={};let i=0;return ri(t,s,e,1,n,0,u=>{if(r==null||r(u,i),Pr(!(u.id in o),`Duplicate routes found with id: ${String(u.id)}`),o[u.id]=u,i!==0&&u.path){const d=aw(u.fullPath);(!a[d]||u.fullPath.endsWith("/"))&&(a[d]=u)}i++}),Cr(n),{processedTree:{segmentTree:n,singleCache:xa(1e3),matchCache:xa(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:a}}function Kc(e,t,r=!1){const n=e.split("/"),s=uw(e,n,t,r);if(!s)return null;const[o]=vg(e,n,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function vg(e,t,r){var d,f,p,h,g,m,v,y,b,C;const n=cw(r.node);let s=null;const o={};let a=((d=r.extract)==null?void 0:d.part)??0,i=((f=r.extract)==null?void 0:f.node)??0,c=((p=r.extract)==null?void 0:p.path)??0,u=((h=r.extract)==null?void 0:h.segment)??0;for(;i<n.length;a++,i++,c++,u++){const w=n[i];if(w.kind===qr)break;if(w.kind===gg){u--,a--,c--;continue}const _=t[a],R=c;if(_&&(c+=_.length),w.kind===tn){s??(s=r.node.fullPath.split("/"));const z=s[u],D=((g=w.prefix)==null?void 0:g.length)??0;if(z.charCodeAt(D)===123){const S=((m=w.suffix)==null?void 0:m.length)??0,E=z.substring(D+2,z.length-S-1),P=_.substring(D,_.length-S);o[E]=decodeURIComponent(P)}else{const S=z.substring(1);o[S]=decodeURIComponent(_)}}else if(w.kind===Qs){if(r.skipped&1<<i){a--,c=R-1;continue}s??(s=r.node.fullPath.split("/"));const z=s[u],D=((v=w.prefix)==null?void 0:v.length)??0,j=((y=w.suffix)==null?void 0:y.length)??0,S=z.substring(D+3,z.length-j-1),E=w.suffix||w.prefix?_.substring(D,_.length-j):_;E&&(o[S]=decodeURIComponent(E))}else if(w.kind===rn){const z=w,D=e.substring(R+(((b=z.prefix)==null?void 0:b.length)??0),e.length-(((C=z.suffix)==null?void 0:C.length)??0)),j=decodeURIComponent(D);o["*"]=j,o._splat=j;break}}return r.rawParams&&Object.assign(o,r.rawParams),[o,{part:a,node:i,path:c,segment:u}]}function lw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function cw(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function uw(e,t,r,n){if(e==="/"&&r.index)return{node:r.index,skipped:0};const s=!Js(t),o=s&&e!=="/",a=t.length-(s?1:0),i=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,u=null,d=null;for(;i.length;){const f=i.pop(),{node:p,index:h,skipped:g,depth:m,statics:v,dynamics:y,optionals:b}=f;let{extract:C,rawParams:w,parsedParams:_}=f;if(p.skipOnParamError){if(!Bi(e,t,f))continue;w=f.rawParams,C=f.extract,_=f.parsedParams}n&&p.route&&p.kind!==qr&&gs(u,f)&&(u=f);const R=h===a;if(R&&(p.route&&!o&&gs(d,f)&&(d=f),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const z=R?void 0:t[h];let D;if(R&&p.index){const j={node:p.index,index:h,skipped:g,depth:m+1,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_};let S=!0;if(p.index.skipOnParamError&&(Bi(e,t,j)||(S=!1)),S){if(v===a&&!y&&!b&&!g)return j;gs(d,j)&&(d=j)}}if(p.wildcard&&gs(c,f))for(const j of p.wildcard){const{prefix:S,suffix:E}=j;if(S&&(R||!(j.caseSensitive?z:D??(D=z.toLowerCase())).startsWith(S)))continue;if(E){if(R)continue;const K=t.slice(h).join("/").slice(-E.length);if((j.caseSensitive?K:K.toLowerCase())!==E)continue}const P={node:j,index:a,skipped:g,depth:m,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_};if(!(j.skipOnParamError&&!Bi(e,t,P))){c=P;break}}if(p.optional){const j=g|1<<m,S=m+1;for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E];i.push({node:P,index:h,skipped:j,depth:S,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(!R)for(let E=p.optional.length-1;E>=0;E--){const P=p.optional[E],{prefix:K,suffix:O}=P;if(K||O){const G=P.caseSensitive?z:D??(D=z.toLowerCase());if(K&&!G.startsWith(K)||O&&!G.endsWith(O))continue}i.push({node:P,index:h+1,skipped:g,depth:S,statics:v,dynamics:y,optionals:b+1,extract:C,rawParams:w,parsedParams:_})}}if(!R&&p.dynamic&&z)for(let j=p.dynamic.length-1;j>=0;j--){const S=p.dynamic[j],{prefix:E,suffix:P}=S;if(E||P){const K=S.caseSensitive?z:D??(D=z.toLowerCase());if(E&&!K.startsWith(E)||P&&!K.endsWith(P))continue}i.push({node:S,index:h+1,skipped:g,depth:m+1,statics:v,dynamics:y+1,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(!R&&p.staticInsensitive){const j=p.staticInsensitive.get(D??(D=z.toLowerCase()));j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(!R&&p.static){const j=p.static.get(z);j&&i.push({node:j,index:h+1,skipped:g,depth:m+1,statics:v+1,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}if(p.pathless){const j=m+1;for(let S=p.pathless.length-1;S>=0;S--){const E=p.pathless[S];i.push({node:E,index:h,skipped:g,depth:j,statics:v,dynamics:y,optionals:b,extract:C,rawParams:w,parsedParams:_})}}}if(d&&c)return gs(c,d)?d:c;if(d)return d;if(c)return c;if(n&&u){let f=u.index;for(let h=0;h<u.index;h++)f+=t[h].length;const p=f===e.length?"/":e.slice(f);return u.rawParams??(u.rawParams={}),u.rawParams["**"]=decodeURIComponent(p),u}return null}function Bi(e,t,r){try{const[n,s]=vg(e,t,r);r.rawParams=n,r.extract=s;const o=r.node.parse(n);return r.parsedParams=Object.assign({},r.parsedParams,o),!0}catch{return null}}function gs(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===qr)>(e.node.kind===qr)||t.node.kind===qr==(e.node.kind===qr)&&t.depth>e.depth))):!0}function ta(e){return Hc(e.filter(t=>t!==void 0).join("/"))}function Hc(e){return e.replace(/\/{2,}/g,"/")}function yg(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ar(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function bg(e){return Ar(yg(e))}function wa(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function dw(e,t,r){return wa(e,r)===wa(t,r)}function fw({base:e,to:t,trailingSlash:r="never",cache:n}){const s=t.startsWith("/"),o=!s&&t===".";let a;if(n){a=s?t:o?e:e+"\0"+t;const f=n.get(a);if(f)return f}let i;if(o)i=e.split("/");else if(s)i=t.split("/");else{for(i=e.split("/");i.length>1&&Js(i)==="";)i.pop();const f=t.split("/");for(let p=0,h=f.length;p<h;p++){const g=f[p];g===""?p?p===h-1&&i.push(g):i=[g]:g===".."?i.pop():g==="."||i.push(g)}}i.length>1&&(Js(i)===""?r==="never"&&i.pop():r==="always"&&i.push(""));let c,u="";for(let f=0;f<i.length;f++){f>0&&(u+="/");const p=i[f];if(!p)continue;c=Vc(p,0,c);const h=c[0];if(h===Un){u+=p;continue}const g=c[5],m=p.substring(0,c[1]),v=p.substring(c[4],g),y=p.substring(c[2],c[3]);h===tn?u+=m||v?`${m}{$${y}}${v}`:`$${y}`:h===rn?u+=m||v?`${m}{$}${v}`:"$":u+=`${m}{-$${y}}${v}`}u=Hc(u);const d=u||"/";return a&&n&&n.set(a,d),d}function hw(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),r=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),n=new RegExp(r,"g");return s=>s.replace(n,o=>t.get(o)??o)}function Ui(e,t,r){const n=t[e];return typeof n!="string"?n:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(n)?n:n.split("/").map(s=>Sf(s,r)).join("/"):Sf(n,r)}function $f({path:e,params:t,decoder:r,...n}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const a=e.length;let i=0,c,u="";for(;i<a;){const f=i;c=Vc(e,f,c);const p=c[5];if(i=p+1,f===p)continue;const h=c[0];if(h===Un){u+="/"+e.substring(f,p);continue}if(h===rn){const g=t._splat;o._splat=g,o["*"]=g;const m=e.substring(f,c[1]),v=e.substring(c[4],p);if(!g){s=!0,(m||v)&&(u+="/"+m+v);continue}const y=Ui("_splat",t,r);u+="/"+m+y+v;continue}if(h===tn){const g=e.substring(c[2],c[3]);!s&&!(g in t)&&(s=!0),o[g]=t[g];const m=e.substring(f,c[1]),v=e.substring(c[4],p),y=Ui(g,t,r)??"undefined";u+="/"+m+y+v;continue}if(h===Qs){const g=e.substring(c[2],c[3]),m=t[g];if(m==null)continue;o[g]=m;const v=e.substring(f,c[1]),y=e.substring(c[4],p),b=Ui(g,t,r)??"";u+="/"+v+b+y;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:o,interpolatedPath:u||"/",isMissingParams:s}}function Sf(e,t){const r=encodeURIComponent(e);return(t==null?void 0:t(r))??r}function ht(e){return!!(e!=null&&e.isNotFound)}function pw(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Vl="tsr-scroll-restoration-v1_3",mw=(e,t)=>{let r;return(...n)=>{r||(r=setTimeout(()=>{e(...n),r=null},t))}};function gw(){const e=pw();if(!e)return null;const t=e.getItem(Vl);let r=t?JSON.parse(t):{};return{state:r,set:n=>{r=$r(n,r)||r;try{e.setItem(Vl,JSON.stringify(r))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Oo=gw(),vw=e=>e.state.__TSR_key||e.href;function yw(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}let ka=!1;function bw({storageKey:e,key:t,behavior:r,shouldScrollRestoration:n,scrollToTopSelectors:s,location:o}){var u,d;let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const i=t||((u=window.history.state)==null?void 0:u.__TSR_key),c=a[i];ka=!0;e:{if(n&&c&&Object.keys(c).length>0){for(const h in c){const g=c[h];if(h==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:r});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=g.scrollX,m.scrollTop=g.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const h=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(h){const g=document.getElementById(f);g&&g.scrollIntoView(h)}break e}const p={top:0,left:0,behavior:r};if(window.scrollTo(p),s)for(const h of s){if(h==="window")continue;const g=typeof h=="function"?h():document.querySelector(h);g&&g.scrollTo(p)}}ka=!1}function xw(e,t){if(!Oo||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Oo))return;e.isScrollRestorationSetup=!0,ka=!1;const n=e.options.getScrollRestorationKey||vw;window.history.scrollRestoration="manual";const s=o=>{if(ka||!e.isScrollRestoring)return;let a="";if(o.target===document||o.target===window)a="window";else{const c=o.target.getAttribute("data-scroll-restoration-id");c?a=`[data-scroll-restoration-id="${c}"]`:a=yw(o.target)}const i=n(e.state.location);Oo.set(c=>{const u=c[i]||(c[i]={}),d=u[a]||(u[a]={});if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const f=document.querySelector(a);f&&(d.scrollX=f.scrollLeft||0,d.scrollY=f.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",mw(s,100),!0),e.subscribe("onRendered",o=>{const a=n(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(bw({storageKey:Vl,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Oo.set(i=>(i[a]||(i[a]={}),i)))})}function ww(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const r=document.getElementById(e.state.location.hash);r&&r.scrollIntoView(t)}}}function kw(e,t=String){const r=new URLSearchParams;for(const n in e){const s=e[n];s!==void 0&&r.set(n,t(s))}return r.toString()}function Wi(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function _w(e){const t=new URLSearchParams(e),r={};for(const[n,s]of t.entries()){const o=r[n];o==null?r[n]=Wi(s):Array.isArray(o)?o.push(Wi(s)):r[n]=[o,Wi(s)]}return r}const Cw=Sw(JSON.parse),$w=jw(JSON.stringify,JSON.parse);function Sw(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=_w(t);for(const n in r){const s=r[n];if(typeof s=="string")try{r[n]=e(s)}catch{}}return r}}function jw(e,t){const r=typeof t=="function";function n(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(r&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const o=kw(s,n);return o?`?${o}`:""}}const _t="__root__";function Ew(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function yt(e){return e instanceof Response&&!!e.options}const Kl=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},ni=(e,t)=>!!(e.preload&&!e.router.state.matches.some(r=>r.id===t)),On=(e,t,r=!0)=>{const n={...e.router.options.context??{}},s=r?t:t-1;for(let o=0;o<=s;o++){const a=e.matches[o];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(n,i.__routeContext,i.__beforeLoadContext)}return n},jf=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,n=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),s=n>=0?n:0;let o=r?e.matches.findIndex(a=>a.routeId===r):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=s);for(let a=o;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return r?o:s},Sr=(e,t,r)=>{var n,s,o;if(!(!yt(r)&&!ht(r)))throw yt(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&((n=t._nonReactive.beforeLoadPromise)==null||n.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,a=>({...a,status:yt(r)?"redirected":a.status==="pending"?"success":a.status,context:On(e,t.index),isFetching:!1,error:r})),ht(r)&&!r.routeId&&(r.routeId=t.routeId),(o=t._nonReactive.loadPromise)==null||o.resolve()),yt(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},xg=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,vs=(e,t,r,n)=>{var i,c;const{id:s,routeId:o}=e.matches[t],a=e.router.looseRoutesById[o];if(r instanceof Promise)throw r;r.routerCode=n,e.firstBadMatchIndex??(e.firstBadMatchIndex=t),Sr(e,e.router.getMatch(s),r);try{(c=(i=a.options).onError)==null||c.call(i,r)}catch(u){r=u,Sr(e,e.router.getMatch(s),r)}e.updateMatch(s,u=>{var d,f;return(d=u._nonReactive.beforeLoadPromise)==null||d.resolve(),u._nonReactive.beforeLoadPromise=void 0,(f=u._nonReactive.loadPromise)==null||f.resolve(),{...u,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!yt(r)&&!ht(r)&&(e.serialError??(e.serialError=r))},wg=(e,t,r,n)=>{var a;if(n._nonReactive.pendingTimeout!==void 0)return;const s=r.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!ni(e,t)&&(r.options.loader||r.options.beforeLoad||_g(r))&&typeof s=="number"&&s!==1/0&&(r.options.pendingComponent??((a=e.router.options)==null?void 0:a.defaultPendingComponent)))){const i=setTimeout(()=>{Kl(e)},s);n._nonReactive.pendingTimeout=i}},Aw=(e,t,r)=>{const n=e.router.getMatch(t);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;wg(e,t,r,n);const s=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Sr(e,o,o.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(s):s()},Nw=(e,t,r,n)=>{const s=e.router.getMatch(t),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Bn(()=>{o==null||o.resolve()});const{paramsError:a,searchError:i}=s;a&&vs(e,r,a,"PARSE_PARAMS"),i&&vs(e,r,i,"VALIDATE_SEARCH"),wg(e,t,n,s);const c=new AbortController;let u=!1;const d=()=>{u||(u=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:c})))},f=()=>{var w;(w=s._nonReactive.beforeLoadPromise)==null||w.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!n.options.beforeLoad){Ls(()=>{d(),f()});return}s._nonReactive.beforeLoadPromise=Bn();const p={...On(e,r,!1),...s.__routeContext},{search:h,params:g,cause:m}=s,v=ni(e,t),y={search:h,abortController:c,params:g,preload:v,context:p,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":m,matches:e.matches,routeId:n.id,...e.router.options.additionalContext},b=w=>{if(w===void 0){Ls(()=>{d(),f()});return}(yt(w)||ht(w))&&(d(),vs(e,r,w,"BEFORE_LOAD")),Ls(()=>{d(),e.updateMatch(t,_=>({..._,__beforeLoadContext:w})),f()})};let C;try{if(C=n.options.beforeLoad(y),Zs(C))return d(),C.catch(w=>{vs(e,r,w,"BEFORE_LOAD")}).then(b)}catch(w){d(),vs(e,r,w,"BEFORE_LOAD")}b(C)},Pw=(e,t)=>{const{id:r,routeId:n}=e.matches[t],s=e.router.looseRoutesById[n],o=()=>i(),a=()=>Nw(e,r,t,s),i=()=>{if(xg(e,r))return;const c=Aw(e,r,s);return Zs(c)?c.then(a):a()};return o()},Rw=(e,t,r)=>{var o,a,i,c,u,d;const n=e.router.getMatch(t);if(!n||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([(a=(o=r.options).head)==null?void 0:a.call(o,s),(c=(i=r.options).scripts)==null?void 0:c.call(i,s),(d=(u=r.options).headers)==null?void 0:d.call(u,s)]).then(([f,p,h])=>{const g=f==null?void 0:f.meta,m=f==null?void 0:f.links,v=f==null?void 0:f.scripts,y=f==null?void 0:f.styles;return{meta:g,links:m,headScripts:v,headers:h,scripts:p,styles:y}})},kg=(e,t,r,n,s)=>{const o=t[n-1],{params:a,loaderDeps:i,abortController:c,cause:u}=e.router.getMatch(r),d=On(e,n),f=ni(e,r);return{params:a,deps:i,preload:!!f,parentMatchPromise:o,abortController:c,context:d,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:f?"preload":u,route:s,...e.router.options.additionalContext}},Ef=async(e,t,r,n,s)=>{var o,a,i,c,u,d,f;try{const p=e.router.getMatch(r);try{(!(q1??e.router.isServer)||p.ssr===!0)&&_a(s);const h=(a=(o=s.options).loader)==null?void 0:a.call(o,kg(e,t,r,n,s)),g=s.options.loader&&Zs(h);if(!!(g||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(r,y=>({...y,isFetching:"loader"})),s.options.loader){const y=g?await h:h;Sr(e,e.router.getMatch(r),y),y!==void 0&&e.updateMatch(r,b=>({...b,loaderData:y}))}s._lazyPromise&&await s._lazyPromise;const v=p._nonReactive.minPendingPromise;v&&await v,s._componentsPromise&&await s._componentsPromise,e.updateMatch(r,y=>({...y,error:void 0,context:On(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(h){let g=h;if((g==null?void 0:g.name)==="AbortError"){if(p.abortController.signal.aborted){(i=p._nonReactive.loaderPromise)==null||i.resolve(),p._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,v=>({...v,status:v.status==="pending"?"success":v.status,isFetching:!1,context:On(e,n)}));return}const m=p._nonReactive.minPendingPromise;m&&await m,ht(h)&&await((u=(c=s.options.notFoundComponent)==null?void 0:c.preload)==null?void 0:u.call(c)),Sr(e,e.router.getMatch(r),h);try{(f=(d=s.options).onError)==null||f.call(d,h)}catch(v){g=v,Sr(e,e.router.getMatch(r),v)}e.updateMatch(r,v=>({...v,error:g,context:On(e,n),status:"error",isFetching:!1}))}}catch(p){const h=e.router.getMatch(r);h&&(h._nonReactive.loaderPromise=void 0),Sr(e,h,p)}},Tw=async(e,t,r)=>{var f,p;async function n(h,g,m,v){const y=Date.now()-g.updatedAt,b=h?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,C=v.options.shouldReload,w=typeof C=="function"?C(kg(e,t,s,r,v)):C,{status:_,invalid:R}=m;a=_==="success"&&(R||(w??y>b)),h&&v.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{var z,D;try{await Ef(e,t,s,r,v);const j=e.router.getMatch(s);(z=j._nonReactive.loaderPromise)==null||z.resolve(),(D=j._nonReactive.loadPromise)==null||D.resolve(),j._nonReactive.loaderPromise=void 0}catch(j){yt(j)&&await e.router.navigate(j.options)}})()):(_!=="success"||a&&e.sync)&&await Ef(e,t,s,r,v))}const{id:s,routeId:o}=e.matches[r];let a=!1,i=!1;const c=e.router.looseRoutesById[o];if(!xg(e,s)){const h=e.router.getMatch(s),g=ni(e,s);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(s),v=m._nonReactive.error||m.error;v&&Sr(e,m,v),m.status==="pending"&&await n(g,h,m,c)}else{const m=g&&!e.router.state.matches.some(y=>y.id===s),v=e.router.getMatch(s);v._nonReactive.loaderPromise=Bn(),m!==v.preload&&e.updateMatch(s,y=>({...y,preload:m})),await n(g,h,v,c)}}const u=e.router.getMatch(s);i||((f=u._nonReactive.loaderPromise)==null||f.resolve(),(p=u._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,i||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=i?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(e.updateMatch(s,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(s)):u};async function Af(e){var p;const t=e,r=[];t.router.state.matches.some(h=>h._forcePending)&&Kl(t);let n;for(let h=0;h<t.matches.length;h++){try{const g=Pw(t,h);Zs(g)&&await g}catch(g){if(yt(g))throw g;if(ht(g))n=g;else if(!t.preload)throw g;break}if(t.serialError)break}const s=t.firstBadMatchIndex??t.matches.length,o=n&&!t.preload?jf(t,n):void 0,a=n&&t.preload?0:o!==void 0?Math.min(o+1,s):s;let i,c;for(let h=0;h<a;h++)r.push(Tw(t,r,h));try{await Promise.all(r)}catch{const h=await Promise.allSettled(r);for(const g of h){if(g.status!=="rejected")continue;const m=g.reason;if(yt(m))throw m;ht(m)?i??(i=m):c??(c=m)}if(c!==void 0)throw c}const u=i??(n&&!t.preload?n:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!u&&n&&t.preload)return t.matches;if(u){const h=jf(t,u);Pr(h!==void 0);const g=t.matches[h],m=t.router.looseRoutesById[g.routeId],v=(p=t.router.options)==null?void 0:p.defaultNotFoundComponent;!m.options.notFoundComponent&&v&&(m.options.notFoundComponent=v),u.routeId=g.routeId;const y=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,b=>({...b,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),d=h,await _a(m)}else if(!t.preload){const h=t.matches[0];if(!h.globalNotFound){const g=t.router.getMatch(h.id);g!=null&&g.globalNotFound&&t.updateMatch(h.id,m=>({...m,globalNotFound:!1,error:void 0}))}}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await _a(h)}for(let h=0;h<=d;h++){const g=t.matches[h],{id:m,routeId:v}=g,y=t.router.looseRoutesById[v];try{const b=Rw(t,m,y);if(b){const C=await b;t.updateMatch(m,w=>({...w,...C}))}}catch(b){console.error(`Error executing head for route ${v}:`,b)}}const f=Kl(t);if(Zs(f)&&await f,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function _a(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:r,...n}=t.options;Object.assign(e.options,n),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var n;const r=[];for(const s of Cg){const o=(n=e.options[s])==null?void 0:n.preload;o&&r.push(o())}if(r.length)return Promise.all(r).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function _g(e){var t;for(const r of Cg)if((t=e.options[r])!=null&&t.preload)return!0;return!1}const Cg=["component","errorComponent","pendingComponent","notFoundComponent"];function Iw(e){return{input:({url:t})=>{for(const r of e)t=Hl(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=$g(e[r],t);return t}}}function Mw(e){const t=bg(e.basepath),r=`/${t}`,n=`${r}/`,s=e.caseSensitive?r:r.toLowerCase(),o=e.caseSensitive?n:n.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===s?a.pathname="/":i.startsWith(o)&&(a.pathname=a.pathname.slice(r.length)),a},output:({url:a})=>(a.pathname=ta(["/",t,a.pathname]),a)}}function Hl(e,t){var n;const r=(n=e==null?void 0:e.input)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function $g(e,t){var n;const r=(n=e==null?void 0:e.output)==null?void 0:n.call(e,{url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function Xr(e){const t=e.resolvedLocation,r=e.location,n=(t==null?void 0:t.pathname)!==r.pathname,s=(t==null?void 0:t.href)!==r.href,o=(t==null?void 0:t.hash)!==r.hash;return{fromLocation:t,toLocation:r,pathChanged:n,hrefChanged:s,hashChanged:o}}function zw(e){const t=e.filter(r=>r.status!=="redirected");return t.length===e.length?e:t}class Ow{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{var p;const n=this.options,s=this.basepath??(n==null?void 0:n.basepath)??"/",o=this.basepath===void 0,a=n==null?void 0:n.rewrite;if(this.options={...n,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=hw(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=K1()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=xa(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=W1(Lw(this.latestLocation)),xw(this));let i=!1;const c=this.options.basepath??"/",u=this.options.rewrite;if(o||s!==c||a!==u){this.basepath=c;const h=[],g=bg(c);g&&g!=="/"&&h.push(Mw({basepath:c})),u&&h.push(u),this.rewrite=h.length===0?void 0:h.length===1?h[0]:Iw(h),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof((p=window.CSS)==null?void 0:p.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=iw(this.routeTree,this.options.caseSensitive,(n,s)=>{n.init({originalIndex:s})});return this.options.routeMasks&&rw(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,n)=>{const s={eventType:r,fn:n};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=r=>{this.subscribers.forEach(n=>{n.eventType===r.type&&n.fn(r)})},this.parseLocation=(r,n)=>{const s=({pathname:c,search:u,hash:d,href:f,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const b=this.options.parseSearch(u),C=this.options.stringifySearch(b);return{href:c+C+d,publicHref:f,pathname:ms(c).path,external:!1,searchStr:C,search:gt(n==null?void 0:n.search,b),hash:ms(d.slice(1)).path,state:gt(n==null?void 0:n.state,p)}}const h=new URL(f,this.origin),g=Hl(this.rewrite,h),m=this.options.parseSearch(g.search),v=this.options.stringifySearch(m);return g.search=v,{href:g.href.replace(g.origin,""),publicHref:f,pathname:ms(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:v,search:gt(n==null?void 0:n.search,m),hash:ms(g.hash.slice(1)).path,state:gt(n==null?void 0:n.state,p)}},o=s(r),{__tempLocation:a,__tempKey:i}=o.state;if(a&&(!i||i===this.tempLocationKey)){const c=s(a);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(r,n)=>fw({base:r,to:Hc(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,n,s)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:n},s):this.matchRoutesInternal(r,n),this.getMatchedRoutes=r=>Fw({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const n=this.getMatch(r);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const r=this.state.matches.filter(o=>o.status==="pending"),n=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...r,...n]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=r=>{const n=(o={})=>{var E,P;const a=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);o.from;const c=o.unsafeRelative==="path"?a.pathname:o.from??i.fullPath,u=this.resolvePathWithBase(c,"."),d=i.search,f={...i.params},p=o.to?this.resolvePathWithBase(u,`${o.to}`):this.resolvePathWithBase(u,"."),h=o.params===!1||o.params===null?{}:(o.params??!0)===!0?f:Object.assign(f,$r(o.params,f)),g=this.getMatchedRoutes(p);let m=g.matchedRoutes;if((!g.foundRoute||g.foundRoute.path!=="/"&&g.routeParams["**"])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(h).length>0)for(const K of m){const O=((E=K.options.params)==null?void 0:E.stringify)??K.options.stringifyParams;if(O)try{Object.assign(h,O(h))}catch{}}const y=r.leaveParams?p:ms($f({path:p,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let b=d;if(r._includeValidateSearch&&((P=this.options.search)!=null&&P.strict)){const K={};m.forEach(O=>{if(O.options.validateSearch)try{Object.assign(K,ra(O.options.validateSearch,{...K,...b}))}catch{}}),b=K}b=Bw({search:b,dest:o,destRoutes:m,_includeValidateSearch:r._includeValidateSearch}),b=gt(d,b);const C=this.options.stringifySearch(b),w=o.hash===!0?a.hash:o.hash?$r(o.hash,a.hash):void 0,_=w?`#${w}`:"";let R=o.state===!0?a.state:o.state?$r(o.state,a.state):{};R=gt(a.state,R);const z=`${y}${C}${_}`;let D,j,S=!1;if(this.rewrite){const K=new URL(z,this.origin),O=$g(this.rewrite,K);D=K.href.replace(K.origin,""),O.origin!==this.origin?(j=O.href,S=!0):j=O.pathname+O.search+O.hash}else D=X1(z),j=D;return{publicHref:j,href:D,pathname:y,search:b,searchStr:C,state:R,hash:w??"",external:S,unmaskOnReload:o.unmaskOnReload}},s=(o={},a)=>{const i=n(o);let c=a?n(a):void 0;if(!c){const u={};if(this.options.routeMasks){const d=nw(i.pathname,this.processedTree);if(d){Object.assign(u,d.rawParams);const{from:f,params:p,...h}=d.route,g=p===!1||p===null?{}:(p??!0)===!0?u:Object.assign(u,$r(p,u));a={from:r.from,...h,params:g},c=n(a)}}}return c&&(i.maskedLocation=c),i};return r.mask?s(r,{from:r.from,...r.mask}):s(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:n,...s})=>{const o=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(d=>{s.state[d]=this.latestLocation.state[d]});const u=Qr(s.state,this.latestLocation.state);return c.forEach(d=>{delete s.state[d]}),u},a=Ar(this.latestLocation.href)===Ar(s.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Bn(()=>{i==null||i.resolve()}),a&&o())this.load();else{let{maskedLocation:c,hashScrollIntoView:u,...d}=s;c&&(d={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[s.replace?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:n})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:n,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:a,href:i,...c}={})=>{if(i){const f=this.history.location.state.__TSR_index,p=Ys(i,{__TSR_index:r?f:f+1}),h=new URL(p.pathname,this.origin),g=Hl(this.rewrite,h);c.to=g.pathname,c.search=this.options.parseSearch(p.search),c.hash=p.hash.slice(1)}const u=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const d=this.commitLocation({...u,viewTransition:o,replace:r,resetScroll:n,hashScrollIntoView:s,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:r,reloadDocument:n,href:s,publicHref:o,...a})=>{var c;let i=!1;if(s)try{new URL(`${s}`),i=!0}catch{}if(i&&!n&&(n=!0),n){if(r!==void 0||!s){const d=this.buildLocation({to:r,...a});s=s??d.publicHref,o=o??d.publicHref}const u=!i&&o?o:s;if(ba(u,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history,f=((c=d.getBlockers)==null?void 0:c.call(d))??[];for(const p of f)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...a,href:s,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:r,cachedMatches:n.cachedMatches.filter(s=>!r.some(o=>o.id===s.id))}))},this.load=async r=>{let n,s,o;for(o=new Promise(i=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const u=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xr({resolvedLocation:d,location:u})}),this.emit({type:"onBeforeLoad",...Xr({resolvedLocation:d,location:u})}),await Af({router:this,sync:r==null?void 0:r.sync,matches:this.state.pendingMatches,location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=[],p=[],h=[],g=[];Ls(()=>{this.__store.setState(m=>{const v=m.matches,y=m.pendingMatches||m.matches;return f=v.filter(b=>!y.some(C=>C.id===b.id)),p=v.filter(b=>!y.some(C=>C.routeId===b.routeId)),h=y.filter(b=>!v.some(C=>C.routeId===b.routeId)),g=y.filter(b=>v.some(C=>C.routeId===b.routeId)),{...m,isLoading:!1,loadedAt:Date.now(),matches:y,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...f.filter(b=>b.status!=="error"&&b.status!=="notFound"&&b.status!=="redirected")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[h,"onEnter"],[g,"onStay"]].forEach(([m,v])=>{m.forEach(y=>{var b,C;(C=(b=this.looseRoutesById[y.routeId].options)[v])==null||C.call(b,y)})})})})}})}catch(u){yt(u)?(n=u,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):ht(u)&&(s=u),this.__store.setState(d=>({...d,statusCode:n?n.status:s?404:d.matches.some(f=>f.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===o&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=r=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.state.resolvedLocation,i=typeof n.types=="function"?n.types(Xr({resolvedLocation:a,location:o})):n.types;if(i===!1){r();return}s={update:r,types:i}}else s=r;document.startViewTransition(s)}else r()},this.updateMatch=(r,n)=>{this.startTransition(()=>{var o;const s=(o=this.state.pendingMatches)!=null&&o.some(a=>a.id===r)?"pendingMatches":this.state.matches.some(a=>a.id===r)?"matches":this.state.cachedMatches.some(a=>a.id===r)?"cachedMatches":"";s&&(s==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:zw(a.cachedMatches.map(i=>i.id===r?n(i):i))})):this.__store.setState(a=>{var i;return{...a,[s]:(i=a[s])==null?void 0:i.map(c=>c.id===r?n(c):c)}}))})},this.getMatch=r=>{var s;const n=o=>o.id===r;return this.state.cachedMatches.find(n)??((s=this.state.pendingMatches)==null?void 0:s.find(n))??this.state.matches.find(n)},this.invalidate=r=>{const n=s=>{var o;return((o=r==null?void 0:r.filter)==null?void 0:o.call(r,s))??!0?{...s,invalid:!0,...r!=null&&r.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.__store.setState(s=>{var o;return{...s,matches:s.matches.map(n),cachedMatches:s.cachedMatches.map(n),pendingMatches:(o=s.pendingMatches)==null?void 0:o.map(n)}}),this.shouldViewTransition=!1,this.load({sync:r==null?void 0:r.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const n=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const s=r.options._builtLocation??this.buildLocation(r.options),o=this.getParsedLocationHref(s);r.options.href=o,r.headers.set("Location",o)}else if(n)try{const s=new URL(n);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;r.options.href=o,r.headers.set("Location",o)}}catch{}if(r.options.href&&!r.options._builtLocation&&ba(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const n=r==null?void 0:r.filter;n!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!n(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const r=n=>{const s=this.looseRoutesById[n.routeId];if(!s.options.loader)return!0;const o=(n.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=_a,this.preloadRoute=async r=>{const n=r._builtLocation??this.buildLocation(r);let s=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:r});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...o,...this.state.cachedMatches.map(i=>i.id)]);Ls(()=>{s.forEach(i=>{a.has(i.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,i]}))})});try{return s=await Af({router:this,matches:s,location:n,preload:!0,updateMatch:(i,c)=>{o.has(i)?s=s.map(u=>u.id===i?c(u):u):this.updateMatch(i,c)}}),s}catch(i){if(yt(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:n});ht(i)||console.error(i);return}},this.matchRoute=(r,n)=>{const s={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},o=this.buildLocation(s);if(n!=null&&n.pending&&this.state.status!=="pending")return!1;const i=((n==null?void 0:n.pending)===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=sw(o.pathname,(n==null?void 0:n.caseSensitive)??!1,(n==null?void 0:n.fuzzy)??!1,i.pathname,this.processedTree);return!c||r.params&&!Qr(c.rawParams,r.params,{partial:!0})?!1:(n==null?void 0:n.includeSearch)??!0?Qr(i.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(r=>r.status==="notFound"||r.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??$w,parseSearch:t.parseSearch??Cw,protocolAllowlist:t.protocolAllowlist??Q1}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:r,processedTree:n}){this.routesById=t,this.routesByPath=r,this.processedTree=n;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(t){return(t==null?void 0:t.id)?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,r){var p,h;const n=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:o,parsedParams:a}=n;let{matchedRoutes:i}=n,c=!1;(s?s.path!=="/"&&o["**"]:Ar(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:c=!0);const u=c?Ww(this.options.notFoundMode,i):void 0,d=new Array(i.length),f=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<i.length;g++){const m=i[g],v=d[g-1];let y,b,C;{const V=(v==null?void 0:v.search)??t.search,L=(v==null?void 0:v._strictSearch)??void 0;try{const U=ra(m.options.validateSearch,{...V})??void 0;y={...V,...U},b={...L,...U},C=void 0}catch(U){let oe=U;if(U instanceof Ca||(oe=new Ca(U.message,{cause:U})),r!=null&&r.throwOnError)throw oe;y=V,b={},C=oe}}const w=((h=(p=m.options).loaderDeps)==null?void 0:h.call(p,{search:y}))??"",_=w?JSON.stringify(w):"",{interpolatedPath:R,usedParams:z}=$f({path:m.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),D=m.id+R+_,j=this.getMatch(D),S=f.get(m.id),E=(j==null?void 0:j._strictParams)??z;let P;if(!j)try{Nf(m,z,a,E)}catch(V){if(ht(V)||yt(V)?P=V:P=new Dw(V.message,{cause:V}),r!=null&&r.throwOnError)throw P}Object.assign(o,E);const K=S?"stay":"enter";let O;if(j)O={...j,cause:K,params:(S==null?void 0:S.params)??o,_strictParams:E,search:gt(S?S.search:j.search,y),_strictSearch:b};else{const V=m.options.loader||m.options.beforeLoad||m.lazyFn||_g(m)?"pending":"success";O={id:D,ssr:m.options.ssr,index:g,routeId:m.id,params:(S==null?void 0:S.params)??o,_strictParams:E,pathname:R,updatedAt:Date.now(),search:S?gt(S.search,y):y,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Bn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:K,loaderDeps:S?gt(S.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}r!=null&&r.preload||(O.globalNotFound=u===m.id),O.searchError=C;const G=this.getParentContext(v);O.context={...G,...O.__routeContext,...O.__beforeLoadContext},d[g]=O}for(let g=0;g<d.length;g++){const m=d[g],v=this.looseRoutesById[m.routeId],y=this.getMatch(m.id),b=f.get(m.routeId);if(m.params=b?gt(b.params,o):o,!y){const C=d[g-1],w=this.getParentContext(C);if(v.options.context){const _={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:v.id};m.__routeContext=v.options.context(_)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:r,routeParams:n,parsedParams:s}=this.getMatchedRoutes(t.pathname),o=Js(r),a={...t.search};for(const d of r)try{Object.assign(a,ra(d.options.validateSearch,a))}catch{}const i=Js(this.state.matches),c=i&&i.routeId===o.id&&t.pathname===this.state.location.pathname;let u;if(c)u=i.params;else{const d={...n};for(const f of r)try{Nf(f,n,s??{},d)}catch{}u=d}return{matchedRoutes:r,fullPath:o.fullPath,search:a,params:u}}}class Ca extends Error{}class Dw extends Error{}function Lw(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ra(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new Ca("Async validation not supported");if(r.issues)throw new Ca(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Fw({pathname:e,routesById:t,processedTree:r}){const n={},s=Ar(e);let o,a;const i=ow(s,r,!0);return i&&(o=i.route,Object.assign(n,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:(i==null?void 0:i.branch)||[t[_t]],routeParams:n,foundRoute:o,parsedParams:a}}function Bw({search:e,dest:t,destRoutes:r,_includeValidateSearch:n}){return Uw(r)(e,t,n??!1)}function Uw(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)(s=o.options.search)!=null&&s.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const a=({search:i,next:c})=>{let u=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(u=o.options.preSearchFilters.reduce((f,p)=>p(f),i));const d=c(u);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,p)=>p(f),d):d};t.middlewares.push(a)}if(o.options.validateSearch){const a=({search:i,next:c})=>{const u=c(i);if(!t._includeValidateSearch)return u;try{return{...u,...ra(o.options.validateSearch,u)??void 0}}catch{return u}};t.middlewares.push(a)}}const r=({search:o})=>{const a=t.dest;return a.search?a.search===!0?o:$r(a.search,o):{}};t.middlewares.push(r);const n=(o,a,i)=>{if(o>=i.length)return a;const c=i[o];return c({search:a,next:d=>n(o+1,d,i)})};return function(a,i,c){return t.dest=i,t._includeValidateSearch=c,n(0,a,t.middlewares)}}function Ww(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const n=t[r];if(n.children)return n.id}return _t}function Nf(e,t,r,n){var o;const s=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const a in t)a in r&&(n[a]=r[a]);else{const a=s(n);Object.assign(n,a)}}const Vw="Error preloading route! ☝️";class Sg{constructor(t){if(this.init=r=>{var u,d;this.originalIndex=r.originalIndex;const n=this.options,s=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(d=(u=this.options).getParentRoute)==null?void 0:d.call(u),s?this._path=_t:this.parentRoute||Pr(!1);let o=s?_t:n==null?void 0:n.path;o&&o!=="/"&&(o=yg(o));const a=(n==null?void 0:n.id)||o;let i=s?_t:ta([this.parentRoute.id===_t?"":this.parentRoute.id,a]);o===_t&&(o="/"),i!==_t&&(i=ta(["/",i]));const c=i===_t?"/":ta([this.parentRoute.fullPath,o]);this._path=o,this._id=i,this._fullPath=c,this._to=Ar(c)},this.addChildren=r=>this._addFileChildren(r),this._addFileChildren=r=>(Array.isArray(r)&&(this.children=r),typeof r=="object"&&r!==null&&(this.children=Object.values(r)),this),this._addFileTypes=()=>this,this.updateLoader=r=>(Object.assign(this.options,r),this),this.update=r=>(Object.assign(this.options,r),this),this.lazy=r=>(this.lazyFn=r,this),this.redirect=r=>Ew({from:this.fullPath,...r}),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Kw extends Sg{constructor(t){super(t)}}const Do=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Vi(e){const t=x.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function Hw(e,t,r={},n={}){x.useEffect(()=>{if(!e.current||n.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{t(o)},r);return s.observe(e.current),()=>{s.disconnect()}},[t,r,n.disabled,e])}function Gw(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}function Gc(e){const t=e.errorComponent??qc;return l.jsx(qw,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:n})=>r?x.createElement(t,{error:r,reset:n}):e.children})}class qw extends x.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,r){r.error&&r.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,r){this.props.onCatch&&this.props.onCatch(t,r)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function qc({error:e}){const[t,r]=x.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(n=>!n),children:t?"Hide Error":"Show Error"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function Yw({children:e,fallback:t=null}){return jg()?l.jsx(B.Fragment,{children:e}):l.jsx(B.Fragment,{children:t})}function jg(){return B.useSyncExternalStore(Jw,()=>!0,()=>!1)}function Jw(){return()=>{}}var Eg={exports:{}},Ag={},Ng={exports:{}},Pg={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.production.js
12
12
  *
@@ -14,7 +14,7 @@ var r1=Object.defineProperty;var n1=(e,t,r)=>t in e?r1(e,t,{enumerable:!0,config
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Wn=x;function nk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sk=typeof Object.is=="function"?Object.is:nk,ok=Wn.useState,ak=Wn.useEffect,ik=Wn.useLayoutEffect,lk=Wn.useDebugValue;function ck(e,t){var r=t(),n=ok({inst:{value:r,getSnapshot:t}}),s=n[0].inst,o=n[1];return ik(function(){s.value=r,s.getSnapshot=t,Ki(s)&&o({inst:s})},[e,r,t]),ak(function(){return Ki(s)&&o({inst:s}),e(function(){Ki(s)&&o({inst:s})})},[e]),lk(r),r}function Ki(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!sk(e,r)}catch{return!0}}function uk(e,t){return t()}var dk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?uk:ck;Og.useSyncExternalStore=Wn.useSyncExternalStore!==void 0?Wn.useSyncExternalStore:dk;zg.exports=Og;var fk=zg.exports;/**
17
+ */var Wn=x;function Zw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qw=typeof Object.is=="function"?Object.is:Zw,Xw=Wn.useState,ek=Wn.useEffect,tk=Wn.useLayoutEffect,rk=Wn.useDebugValue;function nk(e,t){var r=t(),n=Xw({inst:{value:r,getSnapshot:t}}),s=n[0].inst,o=n[1];return tk(function(){s.value=r,s.getSnapshot=t,Ki(s)&&o({inst:s})},[e,r,t]),ek(function(){return Ki(s)&&o({inst:s}),e(function(){Ki(s)&&o({inst:s})})},[e]),rk(r),r}function Ki(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Qw(e,r)}catch{return!0}}function sk(e,t){return t()}var ok=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sk:nk;Pg.useSyncExternalStore=Wn.useSyncExternalStore!==void 0?Wn.useSyncExternalStore:ok;Ng.exports=Pg;var ak=Ng.exports;/**
18
18
  * @license React
19
19
  * use-sync-external-store-shim/with-selector.production.js
20
20
  *
@@ -22,17 +22,17 @@ var r1=Object.defineProperty;var n1=(e,t,r)=>t in e?r1(e,t,{enumerable:!0,config
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var si=x,hk=fk;function pk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mk=typeof Object.is=="function"?Object.is:pk,gk=hk.useSyncExternalStore,vk=si.useRef,yk=si.useEffect,bk=si.useMemo,xk=si.useDebugValue;Mg.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var o=vk(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=bk(function(){function c(h){if(!u){if(u=!0,d=h,h=n(h),s!==void 0&&a.hasValue){var g=a.value;if(s(g,h))return f=g}return f=h}if(g=f,mk(d,h))return g;var m=n(h);return s!==void 0&&s(g,m)?(d=h,g):(d=h,f=m)}var u=!1,d,f,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,s]);var i=gk(e,o[0],o[1]);return yk(function(){a.hasValue=!0,a.value=i},[i]),xk(i),i};Ig.exports=Mg;var wk=Ig.exports;function kk(e,t){return e===t}function _k(e,t,r=kk){const n=x.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(a);return i},[e]),s=x.useCallback(()=>e==null?void 0:e.get(),[e]);return wk.useSyncExternalStoreWithSelector(n,s,s,t,r)}const Dg=x.createContext(null);function jt(e){const t=x.useContext(Dg);return e==null||e.warn,t}function $t(e){const t=jt({warn:(e==null?void 0:e.router)===void 0}),r=(e==null?void 0:e.router)||t,n=x.useRef(void 0);return _k(r.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??r.options.defaultStructuralSharing){const o=gt(n.current,e.select(s));return n.current=o,o}return e.select(s)}return s})}const oi=x.createContext(void 0),Ck=x.createContext(void 0);function Ht(e){const t=x.useContext(e.from?Ck:oi);return $t({select:n=>{const s=n.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Pr(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function Qc(e){return Ht({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Xc(e){const{select:t,...r}=e;return Ht({...r,select:n=>t?t(n.loaderDeps):n.loaderDeps})}function ai(e){return Ht({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function ii(e){return Ht({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function li(e){const t=jt();return x.useCallback(r=>t.navigate({...r,from:r.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function $k(e,t){const r=jt(),n=Xw(t),{activeProps:s,inactiveProps:o,activeOptions:a,to:i,preload:c,preloadDelay:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:h,viewTransition:g,children:m,target:v,disabled:y,style:b,className:C,onClick:w,onBlur:_,onFocus:R,onMouseEnter:z,onMouseLeave:D,onTouchStart:j,ignoreBlocker:S,params:E,search:P,hash:K,state:O,mask:q,reloadDocument:V,unsafeRelative:L,from:U,_fromLocation:oe,...Y}=e,N=Tg(),Z=$t({select:ye=>{const $e=ye.matches[ye.matches.length-1];return{search:$e==null?void 0:$e.search,hash:ye.location.hash,path:$e==null?void 0:$e.pathname}},structuralSharing:!0}),I=e.from,k=x.useMemo(()=>({...e,from:I}),[r,Z,I,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),$=x.useMemo(()=>r.buildLocation({...k}),[r,k]),A=$.maskedLocation?$.maskedLocation.publicHref:$.publicHref,W=$.maskedLocation?$.maskedLocation.external:$.external,H=x.useMemo(()=>Pk(A,W,r.history,y),[y,W,A,r.history]),ee=x.useMemo(()=>{if(H!=null&&H.external)return ba(H.href,r.protocolAllowlist)?void 0:H.href;if(!Rk(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),ba(i,r.protocolAllowlist)?void 0:i}catch{}},[i,H,r.protocolAllowlist]),re=$t({select:ye=>{if(ee)return!1;if(a!=null&&a.exact){if(!vw(ye.location.pathname,$.pathname,r.basepath))return!1}else{const $e=wa(ye.location.pathname,r.basepath),Ve=wa($.pathname,r.basepath);if(!($e.startsWith(Ve)&&($e.length===Ve.length||$e[Ve.length]==="/")))return!1}return((a==null?void 0:a.includeSearch)??!0)&&!Qr(ye.location.search,$.search,{partial:!(a!=null&&a.exact),ignoreUndefined:!(a!=null&&a.explicitUndefined)})?!1:a!=null&&a.includeHash?N&&ye.location.hash===$.hash:!0}}),le=re?$r(s,{})??Sk:Hi,pe=re?Hi:$r(o,{})??Hi,M=[C,le.className,pe.className].filter(Boolean).join(" "),J=(b||le.style||pe.style)&&{...b,...le.style,...pe.style},[se,ue]=x.useState(!1),_e=x.useRef(!1),we=e.reloadDocument||ee?!1:c??r.options.defaultPreload,Ne=u??r.options.defaultPreloadDelay??0,Ce=x.useCallback(()=>{r.preloadRoute({...k,_builtLocation:$}).catch(ye=>{console.warn(ye),console.warn(Jw)})},[r,k,$]),Ie=x.useCallback(ye=>{ye!=null&&ye.isIntersecting&&Ce()},[Ce]);Qw(n,Ie,Nk,{disabled:!!y||we!=="viewport"}),x.useEffect(()=>{_e.current||!y&&we==="render"&&(Ce(),_e.current=!0)},[y,Ce,we]);const qe=ye=>{const $e=ye.currentTarget.getAttribute("target"),Ve=v!==void 0?v:$e;if(!y&&!Tk(ye)&&!ye.defaultPrevented&&(!Ve||Ve==="_self")&&ye.button===0){ye.preventDefault(),fg.flushSync(()=>{ue(!0)});const pt=r.subscribe("onResolved",()=>{pt(),ue(!1)});r.navigate({...k,replace:f,resetScroll:h,hashScrollIntoView:d,startTransition:p,viewTransition:g,ignoreBlocker:S})}};if(ee)return{...Y,ref:n,href:ee,...m&&{children:m},...v&&{target:v},...y&&{disabled:y},...b&&{style:b},...C&&{className:C},...w&&{onClick:w},..._&&{onBlur:_},...R&&{onFocus:R},...z&&{onMouseEnter:z},...D&&{onMouseLeave:D},...j&&{onTouchStart:j}};const it=ye=>{if(y||we!=="intent")return;if(!Ne){Ce();return}const $e=ye.currentTarget;if(ys.has($e))return;const Ve=setTimeout(()=>{ys.delete($e),Ce()},Ne);ys.set($e,Ve)},Et=ye=>{y||we!=="intent"||Ce()},wt=ye=>{if(y||!we||!Ne)return;const $e=ye.currentTarget,Ve=ys.get($e);Ve&&(clearTimeout(Ve),ys.delete($e))};return{...Y,...le,...pe,href:H==null?void 0:H.href,ref:n,onClick:xn([w,qe]),onBlur:xn([_,wt]),onFocus:xn([R,it]),onMouseEnter:xn([z,it]),onMouseLeave:xn([D,wt]),onTouchStart:xn([j,Et]),disabled:!!y,target:v,...J&&{style:J},...M&&{className:M},...y&&jk,...re&&Ek,...N&&se&&Ak}}const Hi={},Sk={className:"active"},jk={role:"link","aria-disabled":!0},Ek={"data-status":"active","aria-current":"page"},Ak={"data-transitioning":"transitioning"},ys=new WeakMap,Nk={rootMargin:"100px"},xn=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function Pk(e,t,r,n){if(!n)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function Rk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Lg=x.forwardRef((e,t)=>{const{_asChild:r,...n}=e,{type:s,...o}=$k(n,t),a=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;if(!r){const{disabled:i,...c}=o;return x.createElement("a",c,a)}return x.createElement(r,o,a)});function Tk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Ik extends Rg{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ai({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Xc({...r,from:this.id}),this.useLoaderData=r=>Qc({...r,from:this.id}),this.useNavigate=()=>li({from:this.fullPath}),this.Link=B.forwardRef((r,n)=>l.jsx(Lg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function oo(e){return new Ik(e)}class Mk extends Zw{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ai({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Xc({...r,from:this.id}),this.useLoaderData=r=>Qc({...r,from:this.id}),this.useNavigate=()=>li({from:this.fullPath}),this.Link=B.forwardRef((r,n)=>l.jsx(Lg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function zk(e){return new Mk(e)}function If(e){return typeof e=="object"?new Mf(e,{silent:!0}).createRoute(e):new Mf(e,{silent:!0}).createRoute}class Mf{constructor(t,r){this.path=t,this.createRoute=n=>{const s=oo(n);return s.isRoot=!1,s},this.silent=r==null?void 0:r.silent}}class zf{constructor(t){this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.options.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({from:this.options.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useParams=r=>ai({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useLoaderDeps=r=>Xc({...r,from:this.options.id}),this.useLoaderData=r=>Qc({...r,from:this.options.id}),this.useNavigate=()=>{const r=jt();return li({from:r.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Of(e){return typeof e=="object"?new zf(e):t=>new zf({id:e,...t})}function Ok(){const e=jt(),t=x.useRef({router:e,mounted:!1}),[r,n]=x.useState(!1),{hasPendingMatches:s,isLoading:o}=$t({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),a=Vi(o),i=o||r||s,c=Vi(i),u=o||s,d=Vi(u);return e.startTransition=f=>{n(!0),x.startTransition(()=>{f(),n(!1)})},x.useEffect(()=>{const f=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ar(e.latestLocation.publicHref)!==Ar(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{f()}},[e,e.history]),Do(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),Do(()=>{a&&!o&&e.emit({type:"onLoad",...Xr(e.state)})},[a,e,o]),Do(()=>{d&&!u&&e.emit({type:"onBeforeRouteMount",...Xr(e.state)})},[u,d,e]),Do(()=>{if(c&&!i){const f=Xr(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),f.hrefChanged&&jw(e)}},[i,c,e]),null}function Dk(e){const t=$t({select:r=>`not-found-${r.location.pathname}-${r.status}`});return l.jsx(Jc,{getResetKey:()=>t,onCatch:(r,n)=>{var s;if(ht(r))(s=e.onCatch)==null||s.call(e,r,n);else throw r},errorComponent:({error:r})=>{var n;if(ht(r))return(n=e.fallback)==null?void 0:n.call(e,r);throw r},children:e.children})}function Lk(){return l.jsx("p",{children:"Not Found"})}function Sn(e){return l.jsx(l.Fragment,{children:e.children})}function Fg(e,t,r){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...r}):l.jsx(Lk,{})}function Fk(){return jt().isScrollRestoring,null}const Bg=x.memo(function({matchId:t}){var m,v;const r=jt(),n=$t({select:y=>{var w;const b=y.matches.findIndex(_=>_.id===t),C=y.matches[b];return Pr(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:y.loadedAt,parentRouteId:(w=y.matches[b-1])==null?void 0:w.routeId}},structuralSharing:!0}),s=r.routesById[n.routeId],o=s.options.pendingComponent??r.options.defaultPendingComponent,a=o?l.jsx(o,{}):null,i=s.options.errorComponent??r.options.defaultErrorComponent,c=s.options.onCatch??r.options.defaultOnCatch,u=s.isRoot?s.options.notFoundComponent??((m=r.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,d=n.ssr===!1||n.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||d)&&(s.options.wrapInSuspense??o??(((v=s.options.errorComponent)==null?void 0:v.preload)||d))?x.Suspense:Sn,p=i?Jc:Sn,h=u?Dk:Sn,g=s.isRoot?s.options.shellComponent??Sn:Sn;return l.jsxs(g,{children:[l.jsx(oi.Provider,{value:t,children:l.jsx(f,{fallback:a,children:l.jsx(p,{getResetKey:()=>n.resetKey,errorComponent:i||Zc,onCatch:(y,b)=>{if(ht(y))throw y;c==null||c(y,b)},children:l.jsx(h,{fallback:y=>{if(!u||y.routeId&&y.routeId!==n.routeId||!y.routeId&&!s.isRoot)throw y;return x.createElement(u,y)},children:d||n._displayPending?l.jsx(tk,{fallback:a,children:l.jsx(Df,{matchId:t})}):l.jsx(Df,{matchId:t})})})})}),n.parentRouteId===_t&&r.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Bk,{}),l.jsx(Fk,{})]}):null]})});function Bk(){const e=jt(),t=x.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:r=>{r&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Xr(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Df=x.memo(function({matchId:t}){var c,u,d,f;const r=jt(),{match:n,key:s,routeId:o}=$t({select:p=>{const h=p.matches.find(b=>b.id===t),g=h.routeId,m=r.routesById[g].options.remountDeps??r.options.defaultRemountDeps,v=m==null?void 0:m({routeId:g,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:g,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),a=r.routesById[o],i=x.useMemo(()=>{const p=a.options.component??r.options.defaultComponent;return p?l.jsx(p,{},s):l.jsx(ci,{})},[s,a.options.component,r.options.defaultComponent]);if(n._displayPending)throw(c=r.getMatch(n.id))==null?void 0:c._nonReactive.displayPendingPromise;if(n._forcePending)throw(u=r.getMatch(n.id))==null?void 0:u._nonReactive.minPendingPromise;if(n.status==="pending"){const p=a.options.pendingMinMs??r.options.defaultPendingMinMs;if(p){const h=r.getMatch(n.id);if(h&&!h._nonReactive.minPendingPromise){const g=Bn();h._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),h._nonReactive.minPendingPromise=void 0},p)}}throw(d=r.getMatch(n.id))==null?void 0:d._nonReactive.loadPromise}if(n.status==="notFound")return Pr(ht(n.error)),Fg(r,a,n.error);if(n.status==="redirected")throw Pr(yt(n.error)),(f=r.getMatch(n.id))==null?void 0:f._nonReactive.loadPromise;if(n.status==="error")throw n.error;return i}),ci=x.memo(function(){const t=jt(),r=x.useContext(oi),n=$t({select:u=>{var d;return(d=u.matches.find(f=>f.id===r))==null?void 0:d.routeId}}),s=t.routesById[n],o=$t({select:u=>{const f=u.matches.find(p=>p.id===r);return Pr(f),f.globalNotFound}}),a=$t({select:u=>{var p;const d=u.matches,f=d.findIndex(h=>h.id===r);return(p=d[f+1])==null?void 0:p.id}}),i=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Fg(t,s,void 0);if(!a)return null;const c=l.jsx(Bg,{matchId:a});return n===_t?l.jsx(x.Suspense,{fallback:i,children:c}):c});function Uk(){const e=jt(),r=e.routesById[_t].options.pendingComponent??e.options.defaultPendingComponent,n=r?l.jsx(r,{}):null,s=typeof document<"u"&&e.ssr?Sn:x.Suspense,o=l.jsxs(s,{fallback:n,children:[l.jsx(Ok,{}),l.jsx(Wk,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:o}):o}function Wk(){const e=jt(),t=$t({select:s=>{var o;return(o=s.matches[0])==null?void 0:o.id}}),r=$t({select:s=>s.loadedAt}),n=t?l.jsx(Bg,{matchId:t}):null;return l.jsx(oi.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?n:l.jsx(Jc,{getResetKey:()=>r,errorComponent:Zc,onCatch:void 0,children:n})})}const Vk=e=>new Kk(e);class Kk extends Ww{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=If,globalThis.createLazyFileRoute=Of):typeof window<"u"&&(window.createFileRoute=If,window.createLazyFileRoute=Of);function Hk({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const n=l.jsx(Dg.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:n}):n}function qk({router:e,...t}){return l.jsx(Hk,{router:e,...t,children:l.jsx(Uk,{})})}const Gk="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Rn(e,t,r){const n=r[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===n||t&&t.slice(-1)===n)throw new Error("trailing zero");if(t){let a=0;for(;(e[a]||n)===t[a];)a++;if(a>0)return t.slice(0,a)+Rn(e.slice(a),t.slice(a),r)}const s=e?r.indexOf(e[0]):0,o=t!=null?r.indexOf(t[0]):r.length;if(o-s>1){const a=Math.round(.5*(s+o));return r[a]}else return t&&t.length>1?t.slice(0,1):r[s]+Rn(e.slice(1),null,r)}function Ug(e){if(e.length!==Wg(e[0]))throw new Error("invalid integer part of order key: "+e)}function Wg(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function Ps(e){const t=Wg(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function Lf(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const r=Ps(e);if(e.slice(r.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function Ff(e,t){Ug(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])+1;a===t.length?n[o]=t[0]:(n[o]=t[a],s=!1)}if(s){if(r==="Z")return"a"+t[0];if(r==="z")return null;const o=String.fromCharCode(r.charCodeAt(0)+1);return o>"a"?n.push(t[0]):n.pop(),o+n.join("")}else return r+n.join("")}function Yk(e,t){Ug(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])-1;a===-1?n[o]=t.slice(-1):(n[o]=t[a],s=!1)}if(s){if(r==="a")return"Z"+t.slice(-1);if(r==="A")return null;const o=String.fromCharCode(r.charCodeAt(0)-1);return o<"Z"?n.push(t.slice(-1)):n.pop(),o+n.join("")}else return r+n.join("")}function Jk(e,t,r=Gk){if(e!=null&&Lf(e,r),t!=null&&Lf(t,r),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+r[0];const c=Ps(t),u=t.slice(c.length);if(c==="A"+r[0].repeat(26))return c+Rn("",u,r);if(c<t)return c;const d=Yk(c,r);if(d==null)throw new Error("cannot decrement any more");return d}if(t==null){const c=Ps(e),u=e.slice(c.length),d=Ff(c,r);return d??c+Rn(u,null,r)}const n=Ps(e),s=e.slice(n.length),o=Ps(t),a=t.slice(o.length);if(n===o)return n+Rn(s,a,r);const i=Ff(n,r);if(i==null)throw new Error("cannot increment any more");return i<t?i:n+Rn(s,null,r)}const Bf=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(h=>h(t,p))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,i);return i},Zk=e=>e?Bf(e):Bf,Qk=e=>e;function Xk(e,t=Qk){const r=B.useSyncExternalStore(e.subscribe,B.useCallback(()=>t(e.getState()),[e,t]),B.useCallback(()=>t(e.getInitialState()),[e,t]));return B.useDebugValue(r),r}const Uf=e=>{const t=Zk(e),r=n=>Xk(t,n);return Object.assign(r,t),r},e_=e=>e?Uf(e):Uf;function ur(e){return Array.isArray?Array.isArray(e):Hg(e)==="[object Array]"}function t_(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function r_(e){return e==null?"":t_(e)}function Ut(e){return typeof e=="string"}function Vg(e){return typeof e=="number"}function n_(e){return e===!0||e===!1||s_(e)&&Hg(e)=="[object Boolean]"}function Kg(e){return typeof e=="object"}function s_(e){return Kg(e)&&e!==null}function vt(e){return e!=null}function qi(e){return!e.trim().length}function Hg(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const o_="Incorrect 'index' type",a_=e=>`Invalid value for key ${e}`,i_=e=>`Pattern length exceeds max of ${e}.`,l_=e=>`Missing ${e} property in key`,c_=e=>`Property 'weight' in key '${e}' must be a positive integer`,Wf=Object.prototype.hasOwnProperty;class u_{constructor(t){this._keys=[],this._keyMap={};let r=0;t.forEach(n=>{let s=qg(n);this._keys.push(s),this._keyMap[s.id]=s,r+=s.weight}),this._keys.forEach(n=>{n.weight/=r})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function qg(e){let t=null,r=null,n=null,s=1,o=null;if(Ut(e)||ur(e))n=e,t=Vf(e),r=Jl(e);else{if(!Wf.call(e,"name"))throw new Error(l_("name"));const a=e.name;if(n=a,Wf.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(c_(a));t=Vf(a),r=Jl(a),o=e.getFn}return{path:t,id:r,weight:s,src:n,getFn:o}}function Vf(e){return ur(e)?e:e.split(".")}function Jl(e){return ur(e)?e.join("."):e}function d_(e,t){let r=[],n=!1;const s=(o,a,i)=>{if(vt(o))if(!a[i])r.push(o);else{let c=a[i];const u=o[c];if(!vt(u))return;if(i===a.length-1&&(Ut(u)||Vg(u)||n_(u)))r.push(r_(u));else if(ur(u)){n=!0;for(let d=0,f=u.length;d<f;d+=1)s(u[d],a,i+1)}else a.length&&s(u,a,i+1)}};return s(e,Ut(t)?t.split("."):t,0),n?r:r[0]}const f_={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},h_={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},p_={location:0,threshold:.6,distance:100},m_={useExtendedSearch:!1,getFn:d_,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var de={...h_,...f_,...p_,...m_};const g_=/[^ ]+/g;function v_(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(s){const o=s.match(g_).length;if(r.has(o))return r.get(o);const a=1/Math.pow(o,.5*e),i=parseFloat(Math.round(a*n)/n);return r.set(o,i),i},clear(){r.clear()}}}class eu{constructor({getFn:t=de.getFn,fieldNormWeight:r=de.fieldNormWeight}={}){this.norm=v_(r,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ut(this.docs[0])?this.docs.forEach((t,r)=>{this._addString(t,r)}):this.docs.forEach((t,r)=>{this._addObject(t,r)}),this.norm.clear())}add(t){const r=this.size();Ut(t)?this._addString(t,r):this._addObject(t,r)}removeAt(t){this.records.splice(t,1);for(let r=t,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(t,r){return t[this._keysMap[r]]}size(){return this.records.length}_addString(t,r){if(!vt(t)||qi(t))return;let n={v:t,i:r,n:this.norm.get(t)};this.records.push(n)}_addObject(t,r){let n={i:r,$:{}};this.keys.forEach((s,o)=>{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(vt(a)){if(ur(a)){let i=[];const c=[{nestedArrIndex:-1,value:a}];for(;c.length;){const{nestedArrIndex:u,value:d}=c.pop();if(vt(d))if(Ut(d)&&!qi(d)){let f={v:d,i:u,n:this.norm.get(d)};i.push(f)}else ur(d)&&d.forEach((f,p)=>{c.push({nestedArrIndex:p,value:f})})}n.$[o]=i}else if(Ut(a)&&!qi(a)){let i={v:a,n:this.norm.get(a)};n.$[o]=i}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Gg(e,t,{getFn:r=de.getFn,fieldNormWeight:n=de.fieldNormWeight}={}){const s=new eu({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(qg)),s.setSources(t),s.create(),s}function y_(e,{getFn:t=de.getFn,fieldNormWeight:r=de.fieldNormWeight}={}){const{keys:n,records:s}=e,o=new eu({getFn:t,fieldNormWeight:r});return o.setKeys(n),o.setIndexRecords(s),o}function Lo(e,{errors:t=0,currentLocation:r=0,expectedLocation:n=0,distance:s=de.distance,ignoreLocation:o=de.ignoreLocation}={}){const a=t/e.length;if(o)return a;const i=Math.abs(n-r);return s?a+i/s:i?1:a}function b_(e=[],t=de.minMatchCharLength){let r=[],n=-1,s=-1,o=0;for(let a=e.length;o<a;o+=1){let i=e[o];i&&n===-1?n=o:!i&&n!==-1&&(s=o-1,s-n+1>=t&&r.push([n,s]),n=-1)}return e[o-1]&&o-n>=t&&r.push([n,o-1]),r}const Wr=32;function x_(e,t,r,{location:n=de.location,distance:s=de.distance,threshold:o=de.threshold,findAllMatches:a=de.findAllMatches,minMatchCharLength:i=de.minMatchCharLength,includeMatches:c=de.includeMatches,ignoreLocation:u=de.ignoreLocation}={}){if(t.length>Wr)throw new Error(i_(Wr));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=o,g=p;const m=i>1||c,v=m?Array(f):[];let y;for(;(y=e.indexOf(t,g))>-1;){let z=Lo(t,{currentLocation:y,expectedLocation:p,distance:s,ignoreLocation:u});if(h=Math.min(z,h),g=y+d,m){let D=0;for(;D<d;)v[y+D]=1,D+=1}}g=-1;let b=[],C=1,w=d+f;const _=1<<d-1;for(let z=0;z<d;z+=1){let D=0,j=w;for(;D<j;)Lo(t,{errors:z,currentLocation:p+j,expectedLocation:p,distance:s,ignoreLocation:u})<=h?D=j:w=j,j=Math.floor((w-D)/2+D);w=j;let S=Math.max(1,p-j+1),E=a?f:Math.min(p+j,f)+d,P=Array(E+2);P[E+1]=(1<<z)-1;for(let O=E;O>=S;O-=1){let q=O-1,V=r[e.charAt(q)];if(m&&(v[q]=+!!V),P[O]=(P[O+1]<<1|1)&V,z&&(P[O]|=(b[O+1]|b[O])<<1|1|b[O+1]),P[O]&_&&(C=Lo(t,{errors:z,currentLocation:q,expectedLocation:p,distance:s,ignoreLocation:u}),C<=h)){if(h=C,g=q,g<=p)break;S=Math.max(1,2*p-g)}}if(Lo(t,{errors:z+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:u})>h)break;b=P}const R={isMatch:g>=0,score:Math.max(.001,C)};if(m){const z=b_(v,i);z.length?c&&(R.indices=z):R.isMatch=!1}return R}function w_(e){let t={};for(let r=0,n=e.length;r<n;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<n-r-1}return t}const $a=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Yg{constructor(t,{location:r=de.location,threshold:n=de.threshold,distance:s=de.distance,includeMatches:o=de.includeMatches,findAllMatches:a=de.findAllMatches,minMatchCharLength:i=de.minMatchCharLength,isCaseSensitive:c=de.isCaseSensitive,ignoreDiacritics:u=de.ignoreDiacritics,ignoreLocation:d=de.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:d},t=c?t:t.toLowerCase(),t=u?$a(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(h,g)=>{this.chunks.push({pattern:h,alphabet:w_(h),startIndex:g})},p=this.pattern.length;if(p>Wr){let h=0;const g=p%Wr,m=p-g;for(;h<m;)f(this.pattern.substr(h,Wr),h),h+=Wr;if(g){const v=p-Wr;f(this.pattern.substr(v),v)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s}=this.options;if(t=r?t:t.toLowerCase(),t=n?$a(t):t,this.pattern===t){let m={isMatch:!0,score:0};return s&&(m.indices=[[0,t.length-1]]),m}const{location:o,distance:a,threshold:i,findAllMatches:c,minMatchCharLength:u,ignoreLocation:d}=this.options;let f=[],p=0,h=!1;this.chunks.forEach(({pattern:m,alphabet:v,startIndex:y})=>{const{isMatch:b,score:C,indices:w}=x_(t,m,v,{location:o+y,distance:a,threshold:i,findAllMatches:c,minMatchCharLength:u,includeMatches:s,ignoreLocation:d});b&&(h=!0),p+=C,b&&w&&(f=[...f,...w])});let g={isMatch:h,score:h?p/this.chunks.length:1};return h&&s&&(g.indices=f),g}}class Tr{constructor(t){this.pattern=t}static isMultiMatch(t){return Kf(t,this.multiRegex)}static isSingleMatch(t){return Kf(t,this.singleRegex)}search(){}}function Kf(e,t){const r=e.match(t);return r?r[1]:null}class k_ extends Tr{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const r=t===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class __ extends Tr{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class C_ extends Tr{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const r=t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class $_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const r=!t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class S_ extends Tr{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const r=t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class j_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const r=!t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Jg extends Tr{constructor(t,{location:r=de.location,threshold:n=de.threshold,distance:s=de.distance,includeMatches:o=de.includeMatches,findAllMatches:a=de.findAllMatches,minMatchCharLength:i=de.minMatchCharLength,isCaseSensitive:c=de.isCaseSensitive,ignoreDiacritics:u=de.ignoreDiacritics,ignoreLocation:d=de.ignoreLocation}={}){super(t),this._bitapSearch=new Yg(t,{location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Zg extends Tr{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let r=0,n;const s=[],o=this.pattern.length;for(;(n=t.indexOf(this.pattern,r))>-1;)r=n+o,s.push([n,r-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const Zl=[k_,Zg,C_,$_,j_,S_,__,Jg],Hf=Zl.length,E_=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,A_="|";function N_(e,t={}){return e.split(A_).map(r=>{let n=r.trim().split(E_).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=n.length;o<a;o+=1){const i=n[o];let c=!1,u=-1;for(;!c&&++u<Hf;){const d=Zl[u];let f=d.isMultiMatch(i);f&&(s.push(new d(f,t)),c=!0)}if(!c)for(u=-1;++u<Hf;){const d=Zl[u];let f=d.isSingleMatch(i);if(f){s.push(new d(f,t));break}}}return s})}const P_=new Set([Jg.type,Zg.type]);class R_{constructor(t,{isCaseSensitive:r=de.isCaseSensitive,ignoreDiacritics:n=de.ignoreDiacritics,includeMatches:s=de.includeMatches,minMatchCharLength:o=de.minMatchCharLength,ignoreLocation:a=de.ignoreLocation,findAllMatches:i=de.findAllMatches,location:c=de.location,threshold:u=de.threshold,distance:d=de.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:o,findAllMatches:i,ignoreLocation:a,location:c,threshold:u,distance:d},t=r?t:t.toLowerCase(),t=n?$a(t):t,this.pattern=t,this.query=N_(this.pattern,this.options)}static condition(t,r){return r.useExtendedSearch}searchIn(t){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:o}=this.options;t=s?t:t.toLowerCase(),t=o?$a(t):t;let a=0,i=[],c=0;for(let u=0,d=r.length;u<d;u+=1){const f=r[u];i.length=0,a=0;for(let p=0,h=f.length;p<h;p+=1){const g=f[p],{isMatch:m,indices:v,score:y}=g.search(t);if(m){if(a+=1,c+=y,n){const b=g.constructor.type;P_.has(b)?i=[...i,...v]:i.push(v)}}else{c=0,a=0,i.length=0;break}}if(a){let p={isMatch:!0,score:c/a};return n&&(p.indices=i),p}}return{isMatch:!1,score:1}}}const Ql=[];function T_(...e){Ql.push(...e)}function Xl(e,t){for(let r=0,n=Ql.length;r<n;r+=1){let s=Ql[r];if(s.condition(e,t))return new s(e,t)}return new Yg(e,t)}const Sa={AND:"$and",OR:"$or"},ec={PATH:"$path",PATTERN:"$val"},tc=e=>!!(e[Sa.AND]||e[Sa.OR]),I_=e=>!!e[ec.PATH],M_=e=>!ur(e)&&Kg(e)&&!tc(e),qf=e=>({[Sa.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Qg(e,t,{auto:r=!0}={}){const n=s=>{let o=Object.keys(s);const a=I_(s);if(!a&&o.length>1&&!tc(s))return n(qf(s));if(M_(s)){const c=a?s[ec.PATH]:o[0],u=a?s[ec.PATTERN]:s[c];if(!Ut(u))throw new Error(a_(c));const d={keyId:Jl(c),pattern:u};return r&&(d.searcher=Xl(u,t)),d}let i={children:[],operator:o[0]};return o.forEach(c=>{const u=s[c];ur(u)&&u.forEach(d=>{i.children.push(n(d))})}),i};return tc(e)||(e=qf(e)),n(e)}function z_(e,{ignoreFieldNorm:t=de.ignoreFieldNorm}){e.forEach(r=>{let n=1;r.matches.forEach(({key:s,norm:o,score:a})=>{const i=s?s.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(t?1:o))}),r.score=n})}function O_(e,t){const r=e.matches;t.matches=[],vt(r)&&r.forEach(n=>{if(!vt(n.indices)||!n.indices.length)return;const{indices:s,value:o}=n;let a={indices:s,value:o};n.key&&(a.key=n.key.src),n.idx>-1&&(a.refIndex=n.idx),t.matches.push(a)})}function D_(e,t){t.score=e.score}function L_(e,t,{includeMatches:r=de.includeMatches,includeScore:n=de.includeScore}={}){const s=[];return r&&s.push(O_),n&&s.push(D_),e.map(o=>{const{idx:a}=o,i={item:t[a],refIndex:a};return s.length&&s.forEach(c=>{c(o,i)}),i})}class qn{constructor(t,r={},n){this.options={...de,...r},this.options.useExtendedSearch,this._keyStore=new u_(this.options.keys),this.setCollection(t,n)}setCollection(t,r){if(this._docs=t,r&&!(r instanceof eu))throw new Error(o_);this._myIndex=r||Gg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){vt(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const r=[];for(let n=0,s=this._docs.length;n<s;n+=1){const o=this._docs[n];t(o,n)&&(this.removeAt(n),n-=1,s-=1,r.push(o))}return r}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:r=-1}={}){const{includeMatches:n,includeScore:s,shouldSort:o,sortFn:a,ignoreFieldNorm:i}=this.options;let c=Ut(t)?Ut(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return z_(c,{ignoreFieldNorm:i}),o&&c.sort(a),Vg(r)&&r>-1&&(c=c.slice(0,r)),L_(c,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(t){const r=Xl(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:c,score:u,indices:d}=r.searchIn(o);c&&s.push({item:o,idx:a,matches:[{score:u,value:o,norm:i,indices:d}]})}),s}_searchLogical(t){const r=Qg(t,this.options),n=(i,c,u)=>{if(!i.children){const{keyId:f,searcher:p}=i,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:p});return h&&h.length?[{idx:u,item:c,matches:h}]:[]}const d=[];for(let f=0,p=i.children.length;f<p;f+=1){const h=i.children[f],g=n(h,c,u);if(g.length)d.push(...g);else if(i.operator===Sa.AND)return[]}return d},s=this._myIndex.records,o={},a=[];return s.forEach(({$:i,i:c})=>{if(vt(i)){let u=n(r,i,c);u.length&&(o[c]||(o[c]={idx:c,item:i,matches:[]},a.push(o[c])),u.forEach(({matches:d})=>{o[c].matches.push(...d)}))}}),a}_searchObjectList(t){const r=Xl(t,this.options),{keys:n,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i})=>{if(!vt(a))return;let c=[];n.forEach((u,d)=>{c.push(...this._findMatches({key:u,value:a[d],searcher:r}))}),c.length&&o.push({idx:i,item:a,matches:c})}),o}_findMatches({key:t,value:r,searcher:n}){if(!vt(r))return[];let s=[];if(ur(r))r.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:c,score:u,indices:d}=n.searchIn(o);c&&s.push({score:u,key:t,value:o,idx:a,norm:i,indices:d})});else{const{v:o,n:a}=r,{isMatch:i,score:c,indices:u}=n.searchIn(o);i&&s.push({score:c,key:t,value:o,norm:a,indices:u})}return s}}qn.version="7.1.0";qn.createIndex=Gg;qn.parseIndex=y_;qn.config=de;qn.parseQuery=Qg;T_(R_);function F_(e,t){return t.split(".").reduce((r,n)=>r!=null&&typeof r=="object"?r[n]:void 0,e)}function B_(e){return e.replace(/\\([\\"'])/g,"$1")}function Fs(e){const t={},r=e.replace(/meta\.([a-zA-Z0-9_.]+):\s*(?:"((?:\\.|[^"])*)"|'((?:\\.|[^'])*)'|(\S+))/g,(n,s,o,a,i)=>{const c=o??a??i??"";return t[s]=B_(c),""}).replace(/\s{2,}/g," ").trim();return{metaFilter:t,plainText:r}}function rc(e){return e==null?[]:Array.isArray(e)?e.flatMap(t=>rc(t)):typeof e=="object"?Object.values(e).flatMap(t=>rc(t)):[String(e)]}function Xs(e){return e.toLowerCase().trim()}function Gf(e){return Xs(e).replace(/[^a-z0-9]+/g,"")}function Xg(e,t){const r=Xs(e),n=Xs(t);if(!n||r.includes(n))return!0;const s=Gf(e),o=Gf(t);if(o&&s.includes(o))return!0;const a=new qn([{value:r},{value:s}],{keys:["value"],threshold:.4,ignoreLocation:!0,minMatchCharLength:o.length===1?1:2});return a.search(n).length>0||o.length>0&&a.search(o).length>0}function e0(e){return[e.content,e.id,e.assignee,...e.labels].filter(t=>typeof t=="string"&&t.length>0).join(`
26
- `)}function U_(e){const t=rc(e.metadata);return[e0(e),...t].filter(r=>r.length>0).join(`
27
- `)}function W_(e,t){const r=Xs(t);return r?e0(e).toLowerCase().includes(r):!0}function V_(e,t){return Xs(t)?Xg(U_(e),t):!0}function K_(e,t,r=!1){if(Object.keys(t).length===0)return!0;if(!e)return!1;for(const[n,s]of Object.entries(t)){const o=F_(e,n);if(o==null)return!1;const a=String(o);if(!a.toLowerCase().includes(s.toLowerCase())&&(!r||!Xg(a,s)))return!1}return!0}function H_(e,t,r={},n=!1){const{metaFilter:s,plainText:o}=Fs(t||""),a={...r,...s};return K_(e.metadata,a,n)?o?n?V_(e,o):W_(e,o):!0:!1}function tu(e){const t=e.match(/^#\s+(.+)$/m);return t?t[1].trim():e.split(`
28
- `).map(n=>n.trim()).find(n=>n.length>0)||"Untitled"}function q_(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50)||"card"}function t0(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return t?t.split(/\s+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" "):e}const Gn="deleted",bs={id:Gn,name:"Deleted",color:"#ef4444"},G_=["aurora","sunset","meadow","nebula","lagoon","candy","ember","violet"],Y_=["paper","mist","sand"],J_="fancy",Z_="aurora",Q_="paper";function X_(e){return e==="plain"?Q_:Z_}function eC(e,t){return e==="plain"?Y_.includes(t):G_.includes(t)}function ja(e,t){const r=e??J_,n=t&&eC(r,t)?t:X_(r);return{boardBackgroundMode:r,boardBackgroundPreset:n}}const nc=[{name:"red",hex:"#e11d48"},{name:"orange",hex:"#ea580c"},{name:"amber",hex:"#d97706"},{name:"yellow",hex:"#ca8a04"},{name:"lime",hex:"#65a30d"},{name:"green",hex:"#16a34a"},{name:"teal",hex:"#0d9488"},{name:"cyan",hex:"#0891b2"},{name:"blue",hex:"#2563eb"},{name:"indigo",hex:"#4f46e5"},{name:"violet",hex:"#7c3aed"},{name:"pink",hex:"#db2777"}],tC=20,rC=80,ru=50;function na(e){return Number.isFinite(e)?Math.max(tC,Math.min(rC,e)):ru}function nC(e,t){return!Number.isFinite(t)||t<=0?ru:na((t-e)/t*100)}function sC(e){let t=!1,r=ru;const n=u=>(r=nC(u,e.getViewportWidth()),r),s=u=>{t&&e.onPreview(n(u.clientX))},o=()=>{e.eventTarget.removeEventListener("pointermove",s),e.eventTarget.removeEventListener("pointerup",i),e.eventTarget.removeEventListener("pointercancel",c)},a=()=>{t&&(t=!1,o())},i=u=>{if(!t)return;const d=n(u.clientX);a(),e.onCommit(d)},c=()=>{t&&(a(),e.onCancel())};return{start(u){return(e.getPanelMode()??"drawer")!=="drawer"?!1:(a(),t=!0,e.eventTarget.addEventListener("pointermove",s),e.eventTarget.addEventListener("pointerup",i),e.eventTarget.addEventListener("pointercancel",c),e.onPreview(n(u.clientX)),!0)},cancel(){c()},dispose(){c()},isActive(){return t}}}const oC=["write","preview","comments","logs"],Ea="preview",sc="form:";function oc(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function r0(e){return oC.includes(e)}function n0(e){return e.startsWith(sc)&&e.length>sc.length}function s0(e){return r0(e)||n0(e)}function ac(e){return`${sc}${e}`}function aC(e){return s0(e)?e:Ea}function iC(e,t){var r;return oc(e.schema)?!0:!!(e.name&&(t!=null&&t.forms)&&oc((r=t.forms[e.name])==null?void 0:r.schema))}function lC(e,t){const r=(e==null?void 0:e.forms)??[];if(r.length===0)return[];const n=new Set;return r.flatMap((s,o)=>{if(!iC(s,t))return[];const a=oc(s.schema)?s.schema:void 0,i=s.name??(a&&typeof a.title=="string"&&a.title.trim().length>0?q_(a.title):`form-${o}`);let c=i||`form-${o}`,u=2;for(;n.has(c);)c=`${i}-${u++}`;return n.add(c),[ac(c)]})}function jn(e,t,r){const n=aC(e);return!t||r0(n)||n0(n)&&lC(t,r).includes(n)?n:Ea}function xs(e,t){return e.find(r=>r.id===t)}const cC={hiddenColumnIds:[],minimizedColumnIds:[]};function ic(e){const t=Array.from(new Set((e==null?void 0:e.hiddenColumnIds)??[])),r=new Set(t);return{hiddenColumnIds:t,minimizedColumnIds:Array.from(new Set((e==null?void 0:e.minimizedColumnIds)??[])).filter(n=>!r.has(n))}}function lc(e,t){const r=new Set(t);return ic({hiddenColumnIds:e.hiddenColumnIds.filter(n=>r.has(n)),minimizedColumnIds:e.minimizedColumnIds.filter(n=>r.has(n))})}function uC(e){return e.hiddenColumnIds.length>0||e.minimizedColumnIds.length>0}function En(e,t){return e[t]??cC}function Rs(e,t,r){return uC(r)?{...e,[t]:r}:t in e?Object.fromEntries(Object.entries(e).filter(([n])=>n!==t)):e}function dC(e,t){return e.hiddenColumnIds.length===t.hiddenColumnIds.length&&e.minimizedColumnIds.length===t.minimizedColumnIds.length&&e.hiddenColumnIds.every((r,n)=>r===t.hiddenColumnIds[n])&&e.minimizedColumnIds.every((r,n)=>r===t.minimizedColumnIds[n])}function Yf(e,t,r){const n=En(e,t),s=lc(n,r);return dC(n,s)?e:Rs(e,t,s)}const fC=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,hC=e=>{const t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},pC=e=>{const t=new Date,r=new Date(t);r.setDate(t.getDate()-t.getDay()),r.setHours(0,0,0,0);const n=new Date(r);return n.setDate(r.getDate()+7),e>=r&&e<n},mC=e=>{const t=new Date;return t.setHours(0,0,0,0),e<t};function gC(e){const t=e.trim().replace(/\s+/g," ");return t?/\s/.test(t)?JSON.stringify(t):t:""}function Gi(e,t){const r=Object.entries(t).map(([n,s])=>[n.trim(),s.trim()]).filter(([n,s])=>n.length>0&&s.length>0).map(([n,s])=>`meta.${n}: ${gC(s)}`);return[e.trim(),...r].filter(Boolean).join(" ").trim()}const G=e_((e,t)=>({cards:[],columns:[],boards:[],columnVisibilityByBoard:{},currentBoard:"default",isDarkMode:fC(),searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{},layout:"horizontal",workspace:null,cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,showDeletedColumn:!1,defaultPriority:"medium",defaultStatus:"backlog",boardZoom:100,cardZoom:100,boardBackgroundMode:"fancy",boardBackgroundPreset:"aurora",panelMode:"drawer",drawerWidth:50},drawerWidthPreview:null,effectiveDrawerWidth:50,settingsOpen:!1,labelDefs:{},activeCardId:null,activeCardTab:Ea,selectedCardIds:[],lastClickedCardId:null,starredBoards:[],savedViews:[],toggleStarBoard:r=>e(n=>({starredBoards:n.starredBoards.includes(r)?n.starredBoards.filter(s=>s!==r):[...n.starredBoards,r]})),saveCurrentView:r=>e(n=>{const o={id:`view-${Date.now()}`,name:r,searchQuery:n.searchQuery,fuzzySearch:n.fuzzySearch,priorityFilter:n.priorityFilter,assigneeFilter:n.assigneeFilter,labelFilter:[...n.labelFilter],dueDateFilter:n.dueDateFilter};return{savedViews:[...n.savedViews,o]}}),removeView:r=>e(n=>({savedViews:n.savedViews.filter(s=>s.id!==r)})),setActiveCardId:r=>e(n=>{if(!r)return{activeCardId:null,activeCardTab:Ea};const s=xs(n.boards,n.currentBoard),o=n.cards.find(a=>a.id===r);return{activeCardId:r,activeCardTab:jn(n.activeCardTab,o,s)}}),setActiveCardTab:r=>e(n=>({activeCardTab:jn(r,n.activeCardId?n.cards.find(s=>s.id===n.activeCardId):void 0,xs(n.boards,n.currentBoard))})),setWorkspace:r=>e({workspace:r}),setLabelDefs:r=>e({labelDefs:r}),setCards:r=>e(n=>({cards:r,activeCardTab:n.activeCardId?jn(n.activeCardTab,r.find(s=>s.id===n.activeCardId),xs(n.boards,n.currentBoard)):n.activeCardTab})),setColumns:r=>e(n=>({columns:r,columnVisibilityByBoard:Rs(n.columnVisibilityByBoard,n.currentBoard,lc(En(n.columnVisibilityByBoard,n.currentBoard),r.map(s=>s.id)))})),setBoards:r=>e(n=>{const s=new Set(r.map(a=>a.id)),o=xs(r,n.currentBoard);return{boards:r,columnVisibilityByBoard:Object.fromEntries(Object.entries(n.columnVisibilityByBoard).filter(([a])=>s.has(a))),activeCardTab:n.activeCardId?jn(n.activeCardTab,n.cards.find(a=>a.id===n.activeCardId),o):n.activeCardTab}}),setCurrentBoard:r=>e(n=>({currentBoard:r,activeCardTab:n.activeCardId?jn(n.activeCardTab,n.cards.find(s=>s.id===n.activeCardId),xs(n.boards,r)):n.activeCardTab})),getColumnVisibility:r=>{const n=r??t().currentBoard;return En(t().columnVisibilityByBoard,n)},getHiddenColumnIds:r=>t().getColumnVisibility(r).hiddenColumnIds,getMinimizedColumnIds:r=>t().getColumnVisibility(r).minimizedColumnIds,isColumnHidden:(r,n)=>t().getHiddenColumnIds(n).includes(r),isColumnMinimized:(r,n)=>t().getMinimizedColumnIds(n).includes(r),setColumnHidden:(r,n,s)=>e(o=>{const a=En(o.columnVisibilityByBoard,r),i=s?[...a.hiddenColumnIds,n]:a.hiddenColumnIds.filter(c=>c!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,ic({hiddenColumnIds:i,minimizedColumnIds:a.minimizedColumnIds.filter(c=>c!==n)}))}}),setColumnMinimized:(r,n,s)=>e(o=>{const a=En(o.columnVisibilityByBoard,r),i=s?[...a.minimizedColumnIds,n]:a.minimizedColumnIds.filter(c=>c!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,ic({hiddenColumnIds:a.hiddenColumnIds,minimizedColumnIds:i}))}}),toggleColumnMinimized:(r,n)=>{const s=t();s.setColumnMinimized(r,n,!s.isColumnMinimized(n,r))},sanitizeColumnVisibility:(r,n)=>e(s=>({columnVisibilityByBoard:Rs(s.columnVisibilityByBoard,r,lc(En(s.columnVisibilityByBoard,r),n))})),setIsDarkMode:r=>e({isDarkMode:r}),setCardSettings:r=>e(n=>{const s=na(r.drawerWidth??n.cardSettings.drawerWidth??50),o=ja(r.boardBackgroundMode??n.cardSettings.boardBackgroundMode,r.boardBackgroundPreset??n.cardSettings.boardBackgroundPreset);return{cardSettings:{...r,boardZoom:r.boardZoom??n.cardSettings.boardZoom,cardZoom:r.cardZoom??n.cardSettings.cardZoom,boardBackgroundMode:o.boardBackgroundMode,boardBackgroundPreset:o.boardBackgroundPreset,panelMode:r.panelMode??n.cardSettings.panelMode,drawerWidth:s},effectiveDrawerWidth:n.drawerWidthPreview??s}}),setDrawerWidthPreview:r=>e(n=>{const s=na(r);return{drawerWidthPreview:s,effectiveDrawerWidth:s}}),clearDrawerWidthPreview:()=>e(r=>({drawerWidthPreview:null,effectiveDrawerWidth:na(r.cardSettings.drawerWidth??50)})),setSettingsOpen:r=>e({settingsOpen:r}),setSearchQuery:r=>e({searchQuery:r}),setFuzzySearch:r=>e({fuzzySearch:r}),clearPlainTextSearch:()=>e(r=>{const{metaFilter:n}=Fs(r.searchQuery);return{searchQuery:Gi("",n)}}),applyMetadataFilterToken:(r,n)=>e(s=>{const o=r.trim(),a=n.trim().replace(/\s+/g," ");if(!o||!a)return{};const{metaFilter:i,plainText:c}=Fs(s.searchQuery);return i[o]=a,{searchQuery:Gi(c,i)}}),removeMetadataFilterToken:r=>e(n=>{const s=r.trim();if(!s)return{};const{metaFilter:o,plainText:a}=Fs(n.searchQuery);return s in o?(delete o[s],{searchQuery:Gi(a,o)}):{}}),applyLabelFilter:r=>e(()=>{const n=r.trim();return n?{labelFilter:[n]}:{}}),setPriorityFilter:r=>e({priorityFilter:r}),setAssigneeFilter:r=>e({assigneeFilter:r}),setLabelFilter:r=>e({labelFilter:r}),setDueDateFilter:r=>e({dueDateFilter:r}),setColumnSort:(r,n)=>e(s=>({columnSorts:n==="order"?Object.fromEntries(Object.entries(s.columnSorts).filter(([o])=>o!==r)):{...s.columnSorts,[r]:n}})),setLayout:r=>e({layout:r}),toggleLayout:()=>e(r=>({layout:r.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>e({searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{}}),addCard:r=>e(n=>({cards:[...n.cards,r]})),updateCard:(r,n)=>e(s=>({cards:s.cards.map(o=>o.id===r?{...o,...n}:o)})),removeCard:r=>e(n=>({cards:n.cards.filter(s=>s.id!==r)})),getCardsByStatus:r=>{const{cards:n}=t();return n.filter(s=>s.status===r).sort((s,o)=>s.order<o.order?-1:s.order>o.order?1:0)},getFilteredCardsByStatus:r=>{const{cards:n,searchQuery:s,fuzzySearch:o,priorityFilter:a,assigneeFilter:i,labelFilter:c,dueDateFilter:u,columnSorts:d}=t(),f=d[r]||"order";return n.filter(p=>{if(p.status!==r||a!=="all"&&p.priority!==a)return!1;if(i!=="all"){if(i==="unassigned"){if(p.assignee)return!1}else if(p.assignee!==i)return!1}if(c.length>0&&!p.labels.some(h=>c.includes(h)))return!1;if(u!=="all")if(u==="no-date"){if(p.dueDate)return!1}else if(p.dueDate){const h=new Date(p.dueDate);if(u==="overdue"&&!mC(h)||u==="today"&&!hC(h)||u==="this-week"&&!pC(h))return!1}else return!1;return!(s&&!H_(p,s,{},o))}).sort((p,h)=>f==="created:asc"?p.created.localeCompare(h.created):f==="created:desc"?h.created.localeCompare(p.created):f==="modified:asc"?p.modified.localeCompare(h.modified):f==="modified:desc"?h.modified.localeCompare(p.modified):p.order<h.order?-1:p.order>h.order?1:0)},getUniqueAssignees:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.assignee&&n.add(s.assignee)}),Array.from(n).sort()},getUniqueLabels:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.labels.forEach(o=>n.add(o))}),Array.from(n).sort()},hasActiveFilters:()=>{const{searchQuery:r,fuzzySearch:n,priorityFilter:s,assigneeFilter:o,labelFilter:a,dueDateFilter:i,columnSorts:c}=t();return r!==""||n||s!=="all"||o!=="all"||a.length>0||i!=="all"||Object.keys(c).length>0},toggleSelectCard:r=>e(n=>({selectedCardIds:n.selectedCardIds.includes(r)?n.selectedCardIds.filter(a=>a!==r):[...n.selectedCardIds,r],lastClickedCardId:r})),selectCardRange:r=>e(n=>{if(!n.lastClickedCardId)return{selectedCardIds:[r],lastClickedCardId:r};const s=[];for(const d of n.columns)s.push(...t().getFilteredCardsByStatus(d.id));const o=s.findIndex(d=>d.id===n.lastClickedCardId),a=s.findIndex(d=>d.id===r);if(o===-1||a===-1)return{selectedCardIds:[r],lastClickedCardId:r};const i=Math.min(o,a),c=Math.max(o,a),u=new Set(n.selectedCardIds);for(let d=i;d<=c;d++)u.add(s[d].id);return{selectedCardIds:Array.from(u),lastClickedCardId:r}}),selectAllInColumn:r=>e(n=>{const s=t().getFilteredCardsByStatus(r),o=new Set(n.selectedCardIds);for(const a of s)o.add(a.id);return{selectedCardIds:Array.from(o)}}),clearSelection:()=>e({selectedCardIds:[],lastClickedCardId:null}),setSelectedCardIds:r=>e({selectedCardIds:r})}));function o0(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=o0(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function vC(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=o0(e))&&(n&&(n+=" "),n+=t);return n}const nu="-",yC=e=>{const t=xC(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(nu);return i[0]===""&&i.length!==1&&i.shift(),a0(i,t)||bC(a)},getConflictingClassGroupIds:(a,i)=>{const c=r[a]||[];return i&&n[a]?[...c,...n[a]]:c}}},a0=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?a0(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(nu);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},Jf=/^\[(.+)\]$/,bC=e=>{if(Jf.test(e)){const t=Jf.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},xC=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return kC(Object.entries(e.classGroups),r).forEach(([o,a])=>{cc(a,n,o,t)}),n},cc=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Zf(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(wC(s)){cc(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{cc(a,Zf(t,o),r,n)})})},Zf=(e,t)=>{let r=e;return t.split(nu).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},wC=e=>e.isThemeGetter,kC=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,_C=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},i0="!",CC=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const c=[];let u=0,d=0,f;for(let v=0;v<i.length;v++){let y=i[v];if(u===0){if(y===s&&(n||i.slice(v,v+o)===t)){c.push(i.slice(d,v)),d=v+o;continue}if(y==="/"){f=v;continue}}y==="["?u++:y==="]"&&u--}const p=c.length===0?i:i.substring(d),h=p.startsWith(i0),g=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}};return r?i=>r({className:i,parseClassName:a}):a},$C=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},SC=e=>({cache:_C(e.cacheSize),parseClassName:CC(e),...yC(e)}),jC=/\s+/,EC=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(jC);let i="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=r(u);let g=!!h,m=n(g?p.substring(0,h):p);if(!m){if(!g){i=u+(i.length>0?" "+i:i);continue}if(m=n(p),!m){i=u+(i.length>0?" "+i:i);continue}g=!1}const v=$C(d).join(":"),y=f?v+i0:v,b=y+m;if(o.includes(b))continue;o.push(b);const C=s(m,g);for(let w=0;w<C.length;++w){const _=C[w];o.push(y+_)}i=u+(i.length>0?" "+i:i)}return i};function AC(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=l0(t))&&(n&&(n+=" "),n+=r);return n}const l0=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=l0(e[n]))&&(r&&(r+=" "),r+=t);return r};function NC(e,...t){let r,n,s,o=a;function a(c){const u=t.reduce((d,f)=>f(d),e());return r=SC(u),n=r.cache.get,s=r.cache.set,o=i,i(c)}function i(c){const u=n(c);if(u)return u;const d=EC(c,r);return s(c,d),d}return function(){return o(AC.apply(null,arguments))}}const Me=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},c0=/^\[(?:([a-z-]+):)?(.+)\]$/i,PC=/^\d+\/\d+$/,RC=new Set(["px","full","screen"]),TC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>Dn(e)||RC.has(e)||PC.test(e),yr=e=>Yn(e,"length",KC),Dn=e=>!!e&&!Number.isNaN(Number(e)),Yi=e=>Yn(e,"number",Dn),ws=e=>!!e&&Number.isInteger(Number(e)),DC=e=>e.endsWith("%")&&Dn(e.slice(0,-1)),ge=e=>c0.test(e),br=e=>TC.test(e),LC=new Set(["length","size","percentage"]),FC=e=>Yn(e,LC,u0),BC=e=>Yn(e,"position",u0),UC=new Set(["image","url"]),WC=e=>Yn(e,UC,qC),VC=e=>Yn(e,"",HC),ks=()=>!0,Yn=(e,t,r)=>{const n=c0.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},KC=e=>IC.test(e)&&!MC.test(e),u0=()=>!1,HC=e=>zC.test(e),qC=e=>OC.test(e),GC=()=>{const e=Me("colors"),t=Me("spacing"),r=Me("blur"),n=Me("brightness"),s=Me("borderColor"),o=Me("borderRadius"),a=Me("borderSpacing"),i=Me("borderWidth"),c=Me("contrast"),u=Me("grayscale"),d=Me("hueRotate"),f=Me("invert"),p=Me("gap"),h=Me("gradientColorStops"),g=Me("gradientColorStopPositions"),m=Me("inset"),v=Me("margin"),y=Me("opacity"),b=Me("padding"),C=Me("saturate"),w=Me("scale"),_=Me("sepia"),R=Me("skew"),z=Me("space"),D=Me("translate"),j=()=>["auto","contain","none"],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",ge,t],P=()=>[ge,t],K=()=>["",nr,yr],O=()=>["auto",Dn,ge],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],oe=()=>["","0",ge],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[Dn,ge];return{cacheSize:500,separator:":",theme:{colors:[ks],spacing:[nr,yr],blur:["none","",br,ge],brightness:N(),borderColor:[e],borderRadius:["none","","full",br,ge],borderSpacing:P(),borderWidth:K(),contrast:N(),grayscale:oe(),hueRotate:N(),invert:oe(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[DC,yr],inset:E(),margin:E(),opacity:N(),padding:P(),saturate:N(),scale:N(),sepia:oe(),skew:N(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ge]}],container:["container"],columns:[{columns:[br]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),ge]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ws,ge]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ge]}],grow:[{grow:oe()}],shrink:[{shrink:oe()}],order:[{order:["first","last","none",ws,ge]}],"grid-cols":[{"grid-cols":[ks]}],"col-start-end":[{col:["auto",{span:["full",ws,ge]},ge]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[ks]}],"row-start-end":[{row:["auto",{span:[ws,ge]},ge]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ge]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[z]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[z]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ge,t]}],"min-w":[{"min-w":[ge,t,"min","max","fit"]}],"max-w":[{"max-w":[ge,t,"none","full","min","max","fit","prose",{screen:[br]},br]}],h:[{h:[ge,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ge,t,"auto","min","max","fit"]}],"font-size":[{text:["base",br,yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yi]}],"font-family":[{font:[ks]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ge]}],"line-clamp":[{"line-clamp":["none",Dn,Yi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,ge]}],"list-image":[{"list-image":["none",ge]}],"list-style-type":[{list:["none","disc","decimal",ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,yr]}],"underline-offset":[{"underline-offset":["auto",nr,ge]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),BC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},WC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[nr,ge]}],"outline-w":[{outline:[nr,yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[nr,yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",br,VC]}],"shadow-color":[{shadow:[ks]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",br,ge]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ge]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",ge]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ws,ge]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ge]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,yr,Yi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},YC=NC(GC);function Ee(...e){return YC(vC(e))}function sa(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(7*24*3600));n%=7*24*3600;const i=Math.floor(n/(24*3600));n%=24*3600;const c=Math.floor(n/3600);n%=3600;const u=Math.floor(n/60),d=n%60;return s>0?o>0?`${s}y${o}mo`:`${s}y`:o>0?`${o}mo`:a>0?i>0?`${a}w${i}d`:`${a}w`:i>0?c>0?`${i}d${c}h`:`${i}d`:c>0?u>0?`${c}h${u}m`:`${c}h`:u>0?d>0?`${u}m${d}s`:`${u}m`:`${d}s`}function Aa(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function Bs(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(24*3600));n%=24*3600;const i=Math.floor(n/3600);n%=3600;const c=Math.floor(n/60),u=n%60,d=[];return s>0&&d.push(`${s} ${s===1?"year":"years"}`),o>0&&d.push(`${o} ${o===1?"month":"months"}`),a>0&&d.push(`${a} ${a===1?"day":"days"}`),i>0&&d.push(`${i} ${i===1?"hour":"hours"}`),c>0&&d.push(`${c} ${c===1?"min":"mins"}`),d.length===0?u>0?`${u} ${u===1?"sec":"secs"} ago`:"just now":`${d.slice(0,2).join(" ")} ago`}function JC(e,t){const r=[];return e&&r.push(`Created at: ${Aa(e)} (${Bs(e)})`),t&&r.push(`Modified at: ${Aa(t)} (${Bs(t)})`),r.join(`
29
- `)}const Qf={critical:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",high:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",medium:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",low:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"},Xf={critical:"Critical",high:"High",medium:"Med",low:"Low"};function ZC(e){const t=e.split(`
25
+ */var si=x,ik=ak;function lk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ck=typeof Object.is=="function"?Object.is:lk,uk=ik.useSyncExternalStore,dk=si.useRef,fk=si.useEffect,hk=si.useMemo,pk=si.useDebugValue;Ag.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var o=dk(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=hk(function(){function c(h){if(!u){if(u=!0,d=h,h=n(h),s!==void 0&&a.hasValue){var g=a.value;if(s(g,h))return f=g}return f=h}if(g=f,ck(d,h))return g;var m=n(h);return s!==void 0&&s(g,m)?(d=h,g):(d=h,f=m)}var u=!1,d,f,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,s]);var i=uk(e,o[0],o[1]);return fk(function(){a.hasValue=!0,a.value=i},[i]),pk(i),i};Eg.exports=Ag;var mk=Eg.exports;function gk(e,t){return e===t}function vk(e,t,r=gk){const n=x.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:i}=e.subscribe(a);return i},[e]),s=x.useCallback(()=>e==null?void 0:e.get(),[e]);return mk.useSyncExternalStoreWithSelector(n,s,s,t,r)}const Rg=x.createContext(null);function jt(e){const t=x.useContext(Rg);return e==null||e.warn,t}function $t(e){const t=jt({warn:(e==null?void 0:e.router)===void 0}),r=(e==null?void 0:e.router)||t,n=x.useRef(void 0);return vk(r.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??r.options.defaultStructuralSharing){const o=gt(n.current,e.select(s));return n.current=o,o}return e.select(s)}return s})}const oi=x.createContext(void 0),yk=x.createContext(void 0);function Ht(e){const t=x.useContext(e.from?yk:oi);return $t({select:n=>{const s=n.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Pr(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function Yc(e){return Ht({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Jc(e){const{select:t,...r}=e;return Ht({...r,select:n=>t?t(n.loaderDeps):n.loaderDeps})}function ai(e){return Ht({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function ii(e){return Ht({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function li(e){const t=jt();return x.useCallback(r=>t.navigate({...r,from:r.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function bk(e,t){const r=jt(),n=Gw(t),{activeProps:s,inactiveProps:o,activeOptions:a,to:i,preload:c,preloadDelay:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:h,viewTransition:g,children:m,target:v,disabled:y,style:b,className:C,onClick:w,onBlur:_,onFocus:R,onMouseEnter:z,onMouseLeave:D,onTouchStart:j,ignoreBlocker:S,params:E,search:P,hash:K,state:O,mask:G,reloadDocument:V,unsafeRelative:L,from:U,_fromLocation:oe,...Y}=e,N=jg(),Z=$t({select:ye=>{const $e=ye.matches[ye.matches.length-1];return{search:$e==null?void 0:$e.search,hash:ye.location.hash,path:$e==null?void 0:$e.pathname}},structuralSharing:!0}),I=e.from,k=x.useMemo(()=>({...e,from:I}),[r,Z,I,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),$=x.useMemo(()=>r.buildLocation({...k}),[r,k]),A=$.maskedLocation?$.maskedLocation.publicHref:$.publicHref,W=$.maskedLocation?$.maskedLocation.external:$.external,H=x.useMemo(()=>$k(A,W,r.history,y),[y,W,A,r.history]),ee=x.useMemo(()=>{if(H!=null&&H.external)return ba(H.href,r.protocolAllowlist)?void 0:H.href;if(!Sk(i)&&!(typeof i!="string"||i.indexOf(":")===-1))try{return new URL(i),ba(i,r.protocolAllowlist)?void 0:i}catch{}},[i,H,r.protocolAllowlist]),re=$t({select:ye=>{if(ee)return!1;if(a!=null&&a.exact){if(!dw(ye.location.pathname,$.pathname,r.basepath))return!1}else{const $e=wa(ye.location.pathname,r.basepath),Ve=wa($.pathname,r.basepath);if(!($e.startsWith(Ve)&&($e.length===Ve.length||$e[Ve.length]==="/")))return!1}return((a==null?void 0:a.includeSearch)??!0)&&!Qr(ye.location.search,$.search,{partial:!(a!=null&&a.exact),ignoreUndefined:!(a!=null&&a.explicitUndefined)})?!1:a!=null&&a.includeHash?N&&ye.location.hash===$.hash:!0}}),le=re?$r(s,{})??xk:Hi,pe=re?Hi:$r(o,{})??Hi,M=[C,le.className,pe.className].filter(Boolean).join(" "),J=(b||le.style||pe.style)&&{...b,...le.style,...pe.style},[se,ue]=x.useState(!1),_e=x.useRef(!1),we=e.reloadDocument||ee?!1:c??r.options.defaultPreload,Ne=u??r.options.defaultPreloadDelay??0,Ce=x.useCallback(()=>{r.preloadRoute({...k,_builtLocation:$}).catch(ye=>{console.warn(ye),console.warn(Vw)})},[r,k,$]),Ie=x.useCallback(ye=>{ye!=null&&ye.isIntersecting&&Ce()},[Ce]);Hw(n,Ie,Ck,{disabled:!!y||we!=="viewport"}),x.useEffect(()=>{_e.current||!y&&we==="render"&&(Ce(),_e.current=!0)},[y,Ce,we]);const Ge=ye=>{const $e=ye.currentTarget.getAttribute("target"),Ve=v!==void 0?v:$e;if(!y&&!jk(ye)&&!ye.defaultPrevented&&(!Ve||Ve==="_self")&&ye.button===0){ye.preventDefault(),ag.flushSync(()=>{ue(!0)});const pt=r.subscribe("onResolved",()=>{pt(),ue(!1)});r.navigate({...k,replace:f,resetScroll:h,hashScrollIntoView:d,startTransition:p,viewTransition:g,ignoreBlocker:S})}};if(ee)return{...Y,ref:n,href:ee,...m&&{children:m},...v&&{target:v},...y&&{disabled:y},...b&&{style:b},...C&&{className:C},...w&&{onClick:w},..._&&{onBlur:_},...R&&{onFocus:R},...z&&{onMouseEnter:z},...D&&{onMouseLeave:D},...j&&{onTouchStart:j}};const it=ye=>{if(y||we!=="intent")return;if(!Ne){Ce();return}const $e=ye.currentTarget;if(ys.has($e))return;const Ve=setTimeout(()=>{ys.delete($e),Ce()},Ne);ys.set($e,Ve)},Et=ye=>{y||we!=="intent"||Ce()},wt=ye=>{if(y||!we||!Ne)return;const $e=ye.currentTarget,Ve=ys.get($e);Ve&&(clearTimeout(Ve),ys.delete($e))};return{...Y,...le,...pe,href:H==null?void 0:H.href,ref:n,onClick:xn([w,Ge]),onBlur:xn([_,wt]),onFocus:xn([R,it]),onMouseEnter:xn([z,it]),onMouseLeave:xn([D,wt]),onTouchStart:xn([j,Et]),disabled:!!y,target:v,...J&&{style:J},...M&&{className:M},...y&&wk,...re&&kk,...N&&se&&_k}}const Hi={},xk={className:"active"},wk={role:"link","aria-disabled":!0},kk={"data-status":"active","aria-current":"page"},_k={"data-transitioning":"transitioning"},ys=new WeakMap,Ck={rootMargin:"100px"},xn=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function $k(e,t,r,n){if(!n)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function Sk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Tg=x.forwardRef((e,t)=>{const{_asChild:r,...n}=e,{type:s,...o}=bk(n,t),a=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;if(!r){const{disabled:i,...c}=o;return x.createElement("a",c,a)}return x.createElement(r,o,a)});function jk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Ek extends Sg{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ai({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jc({...r,from:this.id}),this.useLoaderData=r=>Yc({...r,from:this.id}),this.useNavigate=()=>li({from:this.fullPath}),this.Link=B.forwardRef((r,n)=>l.jsx(Tg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function oo(e){return new Ek(e)}class Ak extends Kw{constructor(t){super(t),this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({...r,from:this.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useParams=r=>ai({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Jc({...r,from:this.id}),this.useLoaderData=r=>Yc({...r,from:this.id}),this.useNavigate=()=>li({from:this.fullPath}),this.Link=B.forwardRef((r,n)=>l.jsx(Tg,{ref:n,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function Nk(e){return new Ak(e)}function Pf(e){return typeof e=="object"?new Rf(e,{silent:!0}).createRoute(e):new Rf(e,{silent:!0}).createRoute}class Rf{constructor(t,r){this.path=t,this.createRoute=n=>{const s=oo(n);return s.isRoot=!1,s},this.silent=r==null?void 0:r.silent}}class Tf{constructor(t){this.useMatch=r=>Ht({select:r==null?void 0:r.select,from:this.options.id,structuralSharing:r==null?void 0:r.structuralSharing}),this.useRouteContext=r=>Ht({from:this.options.id,select:n=>r!=null&&r.select?r.select(n.context):n.context}),this.useSearch=r=>ii({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useParams=r=>ai({select:r==null?void 0:r.select,structuralSharing:r==null?void 0:r.structuralSharing,from:this.options.id}),this.useLoaderDeps=r=>Jc({...r,from:this.options.id}),this.useLoaderData=r=>Yc({...r,from:this.options.id}),this.useNavigate=()=>{const r=jt();return li({from:r.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function If(e){return typeof e=="object"?new Tf(e):t=>new Tf({id:e,...t})}function Pk(){const e=jt(),t=x.useRef({router:e,mounted:!1}),[r,n]=x.useState(!1),{hasPendingMatches:s,isLoading:o}=$t({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(p=>p.status==="pending")}),structuralSharing:!0}),a=Vi(o),i=o||r||s,c=Vi(i),u=o||s,d=Vi(u);return e.startTransition=f=>{n(!0),x.startTransition(()=>{f(),n(!1)})},x.useEffect(()=>{const f=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ar(e.latestLocation.publicHref)!==Ar(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{f()}},[e,e.history]),Do(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(p){console.error(p)}})()},[e]),Do(()=>{a&&!o&&e.emit({type:"onLoad",...Xr(e.state)})},[a,e,o]),Do(()=>{d&&!u&&e.emit({type:"onBeforeRouteMount",...Xr(e.state)})},[u,d,e]),Do(()=>{if(c&&!i){const f=Xr(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),f.hrefChanged&&ww(e)}},[i,c,e]),null}function Rk(e){const t=$t({select:r=>`not-found-${r.location.pathname}-${r.status}`});return l.jsx(Gc,{getResetKey:()=>t,onCatch:(r,n)=>{var s;if(ht(r))(s=e.onCatch)==null||s.call(e,r,n);else throw r},errorComponent:({error:r})=>{var n;if(ht(r))return(n=e.fallback)==null?void 0:n.call(e,r);throw r},children:e.children})}function Tk(){return l.jsx("p",{children:"Not Found"})}function Sn(e){return l.jsx(l.Fragment,{children:e.children})}function Ig(e,t,r){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...r}):l.jsx(Tk,{})}function Ik(){return jt().isScrollRestoring,null}const Mg=x.memo(function({matchId:t}){var m,v;const r=jt(),n=$t({select:y=>{var w;const b=y.matches.findIndex(_=>_.id===t),C=y.matches[b];return Pr(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:y.loadedAt,parentRouteId:(w=y.matches[b-1])==null?void 0:w.routeId}},structuralSharing:!0}),s=r.routesById[n.routeId],o=s.options.pendingComponent??r.options.defaultPendingComponent,a=o?l.jsx(o,{}):null,i=s.options.errorComponent??r.options.defaultErrorComponent,c=s.options.onCatch??r.options.defaultOnCatch,u=s.isRoot?s.options.notFoundComponent??((m=r.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,d=n.ssr===!1||n.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||d)&&(s.options.wrapInSuspense??o??(((v=s.options.errorComponent)==null?void 0:v.preload)||d))?x.Suspense:Sn,p=i?Gc:Sn,h=u?Rk:Sn,g=s.isRoot?s.options.shellComponent??Sn:Sn;return l.jsxs(g,{children:[l.jsx(oi.Provider,{value:t,children:l.jsx(f,{fallback:a,children:l.jsx(p,{getResetKey:()=>n.resetKey,errorComponent:i||qc,onCatch:(y,b)=>{if(ht(y))throw y;c==null||c(y,b)},children:l.jsx(h,{fallback:y=>{if(!u||y.routeId&&y.routeId!==n.routeId||!y.routeId&&!s.isRoot)throw y;return x.createElement(u,y)},children:d||n._displayPending?l.jsx(Yw,{fallback:a,children:l.jsx(Mf,{matchId:t})}):l.jsx(Mf,{matchId:t})})})})}),n.parentRouteId===_t&&r.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Mk,{}),l.jsx(Ik,{})]}):null]})});function Mk(){const e=jt(),t=x.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:r=>{r&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Xr(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Mf=x.memo(function({matchId:t}){var c,u,d,f;const r=jt(),{match:n,key:s,routeId:o}=$t({select:p=>{const h=p.matches.find(b=>b.id===t),g=h.routeId,m=r.routesById[g].options.remountDeps??r.options.defaultRemountDeps,v=m==null?void 0:m({routeId:g,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:g,match:{id:h.id,status:h.status,error:h.error,invalid:h.invalid,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),a=r.routesById[o],i=x.useMemo(()=>{const p=a.options.component??r.options.defaultComponent;return p?l.jsx(p,{},s):l.jsx(ci,{})},[s,a.options.component,r.options.defaultComponent]);if(n._displayPending)throw(c=r.getMatch(n.id))==null?void 0:c._nonReactive.displayPendingPromise;if(n._forcePending)throw(u=r.getMatch(n.id))==null?void 0:u._nonReactive.minPendingPromise;if(n.status==="pending"){const p=a.options.pendingMinMs??r.options.defaultPendingMinMs;if(p){const h=r.getMatch(n.id);if(h&&!h._nonReactive.minPendingPromise){const g=Bn();h._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),h._nonReactive.minPendingPromise=void 0},p)}}throw(d=r.getMatch(n.id))==null?void 0:d._nonReactive.loadPromise}if(n.status==="notFound")return Pr(ht(n.error)),Ig(r,a,n.error);if(n.status==="redirected")throw Pr(yt(n.error)),(f=r.getMatch(n.id))==null?void 0:f._nonReactive.loadPromise;if(n.status==="error")throw n.error;return i}),ci=x.memo(function(){const t=jt(),r=x.useContext(oi),n=$t({select:u=>{var d;return(d=u.matches.find(f=>f.id===r))==null?void 0:d.routeId}}),s=t.routesById[n],o=$t({select:u=>{const f=u.matches.find(p=>p.id===r);return Pr(f),f.globalNotFound}}),a=$t({select:u=>{var p;const d=u.matches,f=d.findIndex(h=>h.id===r);return(p=d[f+1])==null?void 0:p.id}}),i=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Ig(t,s,void 0);if(!a)return null;const c=l.jsx(Mg,{matchId:a});return n===_t?l.jsx(x.Suspense,{fallback:i,children:c}):c});function zk(){const e=jt(),r=e.routesById[_t].options.pendingComponent??e.options.defaultPendingComponent,n=r?l.jsx(r,{}):null,s=typeof document<"u"&&e.ssr?Sn:x.Suspense,o=l.jsxs(s,{fallback:n,children:[l.jsx(Pk,{}),l.jsx(Ok,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:o}):o}function Ok(){const e=jt(),t=$t({select:s=>{var o;return(o=s.matches[0])==null?void 0:o.id}}),r=$t({select:s=>s.loadedAt}),n=t?l.jsx(Mg,{matchId:t}):null;return l.jsx(oi.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?n:l.jsx(Gc,{getResetKey:()=>r,errorComponent:qc,onCatch:void 0,children:n})})}const Dk=e=>new Lk(e);class Lk extends Ow{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Pf,globalThis.createLazyFileRoute=If):typeof window<"u"&&(window.createFileRoute=Pf,window.createLazyFileRoute=If);function Fk({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const n=l.jsx(Rg.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:n}):n}function Bk({router:e,...t}){return l.jsx(Fk,{router:e,...t,children:l.jsx(zk,{})})}const Uk="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Rn(e,t,r){const n=r[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===n||t&&t.slice(-1)===n)throw new Error("trailing zero");if(t){let a=0;for(;(e[a]||n)===t[a];)a++;if(a>0)return t.slice(0,a)+Rn(e.slice(a),t.slice(a),r)}const s=e?r.indexOf(e[0]):0,o=t!=null?r.indexOf(t[0]):r.length;if(o-s>1){const a=Math.round(.5*(s+o));return r[a]}else return t&&t.length>1?t.slice(0,1):r[s]+Rn(e.slice(1),null,r)}function zg(e){if(e.length!==Og(e[0]))throw new Error("invalid integer part of order key: "+e)}function Og(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function Ps(e){const t=Og(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function zf(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const r=Ps(e);if(e.slice(r.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function Of(e,t){zg(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])+1;a===t.length?n[o]=t[0]:(n[o]=t[a],s=!1)}if(s){if(r==="Z")return"a"+t[0];if(r==="z")return null;const o=String.fromCharCode(r.charCodeAt(0)+1);return o>"a"?n.push(t[0]):n.pop(),o+n.join("")}else return r+n.join("")}function Wk(e,t){zg(e);const[r,...n]=e.split("");let s=!0;for(let o=n.length-1;s&&o>=0;o--){const a=t.indexOf(n[o])-1;a===-1?n[o]=t.slice(-1):(n[o]=t[a],s=!1)}if(s){if(r==="a")return"Z"+t.slice(-1);if(r==="A")return null;const o=String.fromCharCode(r.charCodeAt(0)-1);return o<"Z"?n.push(t.slice(-1)):n.pop(),o+n.join("")}else return r+n.join("")}function Vk(e,t,r=Uk){if(e!=null&&zf(e,r),t!=null&&zf(t,r),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+r[0];const c=Ps(t),u=t.slice(c.length);if(c==="A"+r[0].repeat(26))return c+Rn("",u,r);if(c<t)return c;const d=Wk(c,r);if(d==null)throw new Error("cannot decrement any more");return d}if(t==null){const c=Ps(e),u=e.slice(c.length),d=Of(c,r);return d??c+Rn(u,null,r)}const n=Ps(e),s=e.slice(n.length),o=Ps(t),a=t.slice(o.length);if(n===o)return n+Rn(s,a,r);const i=Of(n,r);if(i==null)throw new Error("cannot increment any more");return i<t?i:n+Rn(s,null,r)}const Df=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(h=>h(t,p))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,i);return i},Kk=e=>e?Df(e):Df,Hk=e=>e;function Gk(e,t=Hk){const r=B.useSyncExternalStore(e.subscribe,B.useCallback(()=>t(e.getState()),[e,t]),B.useCallback(()=>t(e.getInitialState()),[e,t]));return B.useDebugValue(r),r}const Lf=e=>{const t=Kk(e),r=n=>Gk(t,n);return Object.assign(r,t),r},qk=e=>e?Lf(e):Lf;function ur(e){return Array.isArray?Array.isArray(e):Fg(e)==="[object Array]"}function Yk(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Jk(e){return e==null?"":Yk(e)}function Ut(e){return typeof e=="string"}function Dg(e){return typeof e=="number"}function Zk(e){return e===!0||e===!1||Qk(e)&&Fg(e)=="[object Boolean]"}function Lg(e){return typeof e=="object"}function Qk(e){return Lg(e)&&e!==null}function vt(e){return e!=null}function Gi(e){return!e.trim().length}function Fg(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Xk="Incorrect 'index' type",e_=e=>`Invalid value for key ${e}`,t_=e=>`Pattern length exceeds max of ${e}.`,r_=e=>`Missing ${e} property in key`,n_=e=>`Property 'weight' in key '${e}' must be a positive integer`,Ff=Object.prototype.hasOwnProperty;class s_{constructor(t){this._keys=[],this._keyMap={};let r=0;t.forEach(n=>{let s=Bg(n);this._keys.push(s),this._keyMap[s.id]=s,r+=s.weight}),this._keys.forEach(n=>{n.weight/=r})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bg(e){let t=null,r=null,n=null,s=1,o=null;if(Ut(e)||ur(e))n=e,t=Bf(e),r=Gl(e);else{if(!Ff.call(e,"name"))throw new Error(r_("name"));const a=e.name;if(n=a,Ff.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(n_(a));t=Bf(a),r=Gl(a),o=e.getFn}return{path:t,id:r,weight:s,src:n,getFn:o}}function Bf(e){return ur(e)?e:e.split(".")}function Gl(e){return ur(e)?e.join("."):e}function o_(e,t){let r=[],n=!1;const s=(o,a,i)=>{if(vt(o))if(!a[i])r.push(o);else{let c=a[i];const u=o[c];if(!vt(u))return;if(i===a.length-1&&(Ut(u)||Dg(u)||Zk(u)))r.push(Jk(u));else if(ur(u)){n=!0;for(let d=0,f=u.length;d<f;d+=1)s(u[d],a,i+1)}else a.length&&s(u,a,i+1)}};return s(e,Ut(t)?t.split("."):t,0),n?r:r[0]}const a_={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},i_={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},l_={location:0,threshold:.6,distance:100},c_={useExtendedSearch:!1,getFn:o_,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var de={...i_,...a_,...l_,...c_};const u_=/[^ ]+/g;function d_(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(s){const o=s.match(u_).length;if(r.has(o))return r.get(o);const a=1/Math.pow(o,.5*e),i=parseFloat(Math.round(a*n)/n);return r.set(o,i),i},clear(){r.clear()}}}class Zc{constructor({getFn:t=de.getFn,fieldNormWeight:r=de.fieldNormWeight}={}){this.norm=d_(r,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ut(this.docs[0])?this.docs.forEach((t,r)=>{this._addString(t,r)}):this.docs.forEach((t,r)=>{this._addObject(t,r)}),this.norm.clear())}add(t){const r=this.size();Ut(t)?this._addString(t,r):this._addObject(t,r)}removeAt(t){this.records.splice(t,1);for(let r=t,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(t,r){return t[this._keysMap[r]]}size(){return this.records.length}_addString(t,r){if(!vt(t)||Gi(t))return;let n={v:t,i:r,n:this.norm.get(t)};this.records.push(n)}_addObject(t,r){let n={i:r,$:{}};this.keys.forEach((s,o)=>{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(vt(a)){if(ur(a)){let i=[];const c=[{nestedArrIndex:-1,value:a}];for(;c.length;){const{nestedArrIndex:u,value:d}=c.pop();if(vt(d))if(Ut(d)&&!Gi(d)){let f={v:d,i:u,n:this.norm.get(d)};i.push(f)}else ur(d)&&d.forEach((f,p)=>{c.push({nestedArrIndex:p,value:f})})}n.$[o]=i}else if(Ut(a)&&!Gi(a)){let i={v:a,n:this.norm.get(a)};n.$[o]=i}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Ug(e,t,{getFn:r=de.getFn,fieldNormWeight:n=de.fieldNormWeight}={}){const s=new Zc({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(Bg)),s.setSources(t),s.create(),s}function f_(e,{getFn:t=de.getFn,fieldNormWeight:r=de.fieldNormWeight}={}){const{keys:n,records:s}=e,o=new Zc({getFn:t,fieldNormWeight:r});return o.setKeys(n),o.setIndexRecords(s),o}function Lo(e,{errors:t=0,currentLocation:r=0,expectedLocation:n=0,distance:s=de.distance,ignoreLocation:o=de.ignoreLocation}={}){const a=t/e.length;if(o)return a;const i=Math.abs(n-r);return s?a+i/s:i?1:a}function h_(e=[],t=de.minMatchCharLength){let r=[],n=-1,s=-1,o=0;for(let a=e.length;o<a;o+=1){let i=e[o];i&&n===-1?n=o:!i&&n!==-1&&(s=o-1,s-n+1>=t&&r.push([n,s]),n=-1)}return e[o-1]&&o-n>=t&&r.push([n,o-1]),r}const Wr=32;function p_(e,t,r,{location:n=de.location,distance:s=de.distance,threshold:o=de.threshold,findAllMatches:a=de.findAllMatches,minMatchCharLength:i=de.minMatchCharLength,includeMatches:c=de.includeMatches,ignoreLocation:u=de.ignoreLocation}={}){if(t.length>Wr)throw new Error(t_(Wr));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=o,g=p;const m=i>1||c,v=m?Array(f):[];let y;for(;(y=e.indexOf(t,g))>-1;){let z=Lo(t,{currentLocation:y,expectedLocation:p,distance:s,ignoreLocation:u});if(h=Math.min(z,h),g=y+d,m){let D=0;for(;D<d;)v[y+D]=1,D+=1}}g=-1;let b=[],C=1,w=d+f;const _=1<<d-1;for(let z=0;z<d;z+=1){let D=0,j=w;for(;D<j;)Lo(t,{errors:z,currentLocation:p+j,expectedLocation:p,distance:s,ignoreLocation:u})<=h?D=j:w=j,j=Math.floor((w-D)/2+D);w=j;let S=Math.max(1,p-j+1),E=a?f:Math.min(p+j,f)+d,P=Array(E+2);P[E+1]=(1<<z)-1;for(let O=E;O>=S;O-=1){let G=O-1,V=r[e.charAt(G)];if(m&&(v[G]=+!!V),P[O]=(P[O+1]<<1|1)&V,z&&(P[O]|=(b[O+1]|b[O])<<1|1|b[O+1]),P[O]&_&&(C=Lo(t,{errors:z,currentLocation:G,expectedLocation:p,distance:s,ignoreLocation:u}),C<=h)){if(h=C,g=G,g<=p)break;S=Math.max(1,2*p-g)}}if(Lo(t,{errors:z+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:u})>h)break;b=P}const R={isMatch:g>=0,score:Math.max(.001,C)};if(m){const z=h_(v,i);z.length?c&&(R.indices=z):R.isMatch=!1}return R}function m_(e){let t={};for(let r=0,n=e.length;r<n;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<n-r-1}return t}const $a=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Wg{constructor(t,{location:r=de.location,threshold:n=de.threshold,distance:s=de.distance,includeMatches:o=de.includeMatches,findAllMatches:a=de.findAllMatches,minMatchCharLength:i=de.minMatchCharLength,isCaseSensitive:c=de.isCaseSensitive,ignoreDiacritics:u=de.ignoreDiacritics,ignoreLocation:d=de.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:d},t=c?t:t.toLowerCase(),t=u?$a(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(h,g)=>{this.chunks.push({pattern:h,alphabet:m_(h),startIndex:g})},p=this.pattern.length;if(p>Wr){let h=0;const g=p%Wr,m=p-g;for(;h<m;)f(this.pattern.substr(h,Wr),h),h+=Wr;if(g){const v=p-Wr;f(this.pattern.substr(v),v)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s}=this.options;if(t=r?t:t.toLowerCase(),t=n?$a(t):t,this.pattern===t){let m={isMatch:!0,score:0};return s&&(m.indices=[[0,t.length-1]]),m}const{location:o,distance:a,threshold:i,findAllMatches:c,minMatchCharLength:u,ignoreLocation:d}=this.options;let f=[],p=0,h=!1;this.chunks.forEach(({pattern:m,alphabet:v,startIndex:y})=>{const{isMatch:b,score:C,indices:w}=p_(t,m,v,{location:o+y,distance:a,threshold:i,findAllMatches:c,minMatchCharLength:u,includeMatches:s,ignoreLocation:d});b&&(h=!0),p+=C,b&&w&&(f=[...f,...w])});let g={isMatch:h,score:h?p/this.chunks.length:1};return h&&s&&(g.indices=f),g}}class Tr{constructor(t){this.pattern=t}static isMultiMatch(t){return Uf(t,this.multiRegex)}static isSingleMatch(t){return Uf(t,this.singleRegex)}search(){}}function Uf(e,t){const r=e.match(t);return r?r[1]:null}class g_ extends Tr{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const r=t===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class v_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class y_ extends Tr{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const r=t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class b_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const r=!t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class x_ extends Tr{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const r=t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class w_ extends Tr{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const r=!t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Vg extends Tr{constructor(t,{location:r=de.location,threshold:n=de.threshold,distance:s=de.distance,includeMatches:o=de.includeMatches,findAllMatches:a=de.findAllMatches,minMatchCharLength:i=de.minMatchCharLength,isCaseSensitive:c=de.isCaseSensitive,ignoreDiacritics:u=de.ignoreDiacritics,ignoreLocation:d=de.ignoreLocation}={}){super(t),this._bitapSearch=new Wg(t,{location:r,threshold:n,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Kg extends Tr{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let r=0,n;const s=[],o=this.pattern.length;for(;(n=t.indexOf(this.pattern,r))>-1;)r=n+o,s.push([n,r-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const ql=[g_,Kg,y_,b_,w_,x_,v_,Vg],Wf=ql.length,k_=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,__="|";function C_(e,t={}){return e.split(__).map(r=>{let n=r.trim().split(k_).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=n.length;o<a;o+=1){const i=n[o];let c=!1,u=-1;for(;!c&&++u<Wf;){const d=ql[u];let f=d.isMultiMatch(i);f&&(s.push(new d(f,t)),c=!0)}if(!c)for(u=-1;++u<Wf;){const d=ql[u];let f=d.isSingleMatch(i);if(f){s.push(new d(f,t));break}}}return s})}const $_=new Set([Vg.type,Kg.type]);class S_{constructor(t,{isCaseSensitive:r=de.isCaseSensitive,ignoreDiacritics:n=de.ignoreDiacritics,includeMatches:s=de.includeMatches,minMatchCharLength:o=de.minMatchCharLength,ignoreLocation:a=de.ignoreLocation,findAllMatches:i=de.findAllMatches,location:c=de.location,threshold:u=de.threshold,distance:d=de.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:o,findAllMatches:i,ignoreLocation:a,location:c,threshold:u,distance:d},t=r?t:t.toLowerCase(),t=n?$a(t):t,this.pattern=t,this.query=C_(this.pattern,this.options)}static condition(t,r){return r.useExtendedSearch}searchIn(t){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:o}=this.options;t=s?t:t.toLowerCase(),t=o?$a(t):t;let a=0,i=[],c=0;for(let u=0,d=r.length;u<d;u+=1){const f=r[u];i.length=0,a=0;for(let p=0,h=f.length;p<h;p+=1){const g=f[p],{isMatch:m,indices:v,score:y}=g.search(t);if(m){if(a+=1,c+=y,n){const b=g.constructor.type;$_.has(b)?i=[...i,...v]:i.push(v)}}else{c=0,a=0,i.length=0;break}}if(a){let p={isMatch:!0,score:c/a};return n&&(p.indices=i),p}}return{isMatch:!1,score:1}}}const Yl=[];function j_(...e){Yl.push(...e)}function Jl(e,t){for(let r=0,n=Yl.length;r<n;r+=1){let s=Yl[r];if(s.condition(e,t))return new s(e,t)}return new Wg(e,t)}const Sa={AND:"$and",OR:"$or"},Zl={PATH:"$path",PATTERN:"$val"},Ql=e=>!!(e[Sa.AND]||e[Sa.OR]),E_=e=>!!e[Zl.PATH],A_=e=>!ur(e)&&Lg(e)&&!Ql(e),Vf=e=>({[Sa.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Hg(e,t,{auto:r=!0}={}){const n=s=>{let o=Object.keys(s);const a=E_(s);if(!a&&o.length>1&&!Ql(s))return n(Vf(s));if(A_(s)){const c=a?s[Zl.PATH]:o[0],u=a?s[Zl.PATTERN]:s[c];if(!Ut(u))throw new Error(e_(c));const d={keyId:Gl(c),pattern:u};return r&&(d.searcher=Jl(u,t)),d}let i={children:[],operator:o[0]};return o.forEach(c=>{const u=s[c];ur(u)&&u.forEach(d=>{i.children.push(n(d))})}),i};return Ql(e)||(e=Vf(e)),n(e)}function N_(e,{ignoreFieldNorm:t=de.ignoreFieldNorm}){e.forEach(r=>{let n=1;r.matches.forEach(({key:s,norm:o,score:a})=>{const i=s?s.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(t?1:o))}),r.score=n})}function P_(e,t){const r=e.matches;t.matches=[],vt(r)&&r.forEach(n=>{if(!vt(n.indices)||!n.indices.length)return;const{indices:s,value:o}=n;let a={indices:s,value:o};n.key&&(a.key=n.key.src),n.idx>-1&&(a.refIndex=n.idx),t.matches.push(a)})}function R_(e,t){t.score=e.score}function T_(e,t,{includeMatches:r=de.includeMatches,includeScore:n=de.includeScore}={}){const s=[];return r&&s.push(P_),n&&s.push(R_),e.map(o=>{const{idx:a}=o,i={item:t[a],refIndex:a};return s.length&&s.forEach(c=>{c(o,i)}),i})}class Gn{constructor(t,r={},n){this.options={...de,...r},this.options.useExtendedSearch,this._keyStore=new s_(this.options.keys),this.setCollection(t,n)}setCollection(t,r){if(this._docs=t,r&&!(r instanceof Zc))throw new Error(Xk);this._myIndex=r||Ug(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){vt(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const r=[];for(let n=0,s=this._docs.length;n<s;n+=1){const o=this._docs[n];t(o,n)&&(this.removeAt(n),n-=1,s-=1,r.push(o))}return r}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:r=-1}={}){const{includeMatches:n,includeScore:s,shouldSort:o,sortFn:a,ignoreFieldNorm:i}=this.options;let c=Ut(t)?Ut(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return N_(c,{ignoreFieldNorm:i}),o&&c.sort(a),Dg(r)&&r>-1&&(c=c.slice(0,r)),T_(c,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(t){const r=Jl(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:c,score:u,indices:d}=r.searchIn(o);c&&s.push({item:o,idx:a,matches:[{score:u,value:o,norm:i,indices:d}]})}),s}_searchLogical(t){const r=Hg(t,this.options),n=(i,c,u)=>{if(!i.children){const{keyId:f,searcher:p}=i,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:p});return h&&h.length?[{idx:u,item:c,matches:h}]:[]}const d=[];for(let f=0,p=i.children.length;f<p;f+=1){const h=i.children[f],g=n(h,c,u);if(g.length)d.push(...g);else if(i.operator===Sa.AND)return[]}return d},s=this._myIndex.records,o={},a=[];return s.forEach(({$:i,i:c})=>{if(vt(i)){let u=n(r,i,c);u.length&&(o[c]||(o[c]={idx:c,item:i,matches:[]},a.push(o[c])),u.forEach(({matches:d})=>{o[c].matches.push(...d)}))}}),a}_searchObjectList(t){const r=Jl(t,this.options),{keys:n,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i})=>{if(!vt(a))return;let c=[];n.forEach((u,d)=>{c.push(...this._findMatches({key:u,value:a[d],searcher:r}))}),c.length&&o.push({idx:i,item:a,matches:c})}),o}_findMatches({key:t,value:r,searcher:n}){if(!vt(r))return[];let s=[];if(ur(r))r.forEach(({v:o,i:a,n:i})=>{if(!vt(o))return;const{isMatch:c,score:u,indices:d}=n.searchIn(o);c&&s.push({score:u,key:t,value:o,idx:a,norm:i,indices:d})});else{const{v:o,n:a}=r,{isMatch:i,score:c,indices:u}=n.searchIn(o);i&&s.push({score:c,key:t,value:o,norm:a,indices:u})}return s}}Gn.version="7.1.0";Gn.createIndex=Ug;Gn.parseIndex=f_;Gn.config=de;Gn.parseQuery=Hg;j_(S_);function I_(e,t){return t.split(".").reduce((r,n)=>r!=null&&typeof r=="object"?r[n]:void 0,e)}function M_(e){return e.replace(/\\([\\"'])/g,"$1")}function Fs(e){const t={},r=e.replace(/meta\.([a-zA-Z0-9_.]+):\s*(?:"((?:\\.|[^"])*)"|'((?:\\.|[^'])*)'|(\S+))/g,(n,s,o,a,i)=>{const c=o??a??i??"";return t[s]=M_(c),""}).replace(/\s{2,}/g," ").trim();return{metaFilter:t,plainText:r}}function Xl(e){return e==null?[]:Array.isArray(e)?e.flatMap(t=>Xl(t)):typeof e=="object"?Object.values(e).flatMap(t=>Xl(t)):[String(e)]}function Xs(e){return e.toLowerCase().trim()}function Kf(e){return Xs(e).replace(/[^a-z0-9]+/g,"")}function Gg(e,t){const r=Xs(e),n=Xs(t);if(!n||r.includes(n))return!0;const s=Kf(e),o=Kf(t);if(o&&s.includes(o))return!0;const a=new Gn([{value:r},{value:s}],{keys:["value"],threshold:.4,ignoreLocation:!0,minMatchCharLength:o.length===1?1:2});return a.search(n).length>0||o.length>0&&a.search(o).length>0}function qg(e){return[e.content,e.id,e.assignee,...e.labels].filter(t=>typeof t=="string"&&t.length>0).join(`
26
+ `)}function z_(e){const t=Xl(e.metadata);return[qg(e),...t].filter(r=>r.length>0).join(`
27
+ `)}function O_(e,t){const r=Xs(t);return r?qg(e).toLowerCase().includes(r):!0}function D_(e,t){return Xs(t)?Gg(z_(e),t):!0}function L_(e,t,r=!1){if(Object.keys(t).length===0)return!0;if(!e)return!1;for(const[n,s]of Object.entries(t)){const o=I_(e,n);if(o==null)return!1;const a=String(o);if(!a.toLowerCase().includes(s.toLowerCase())&&(!r||!Gg(a,s)))return!1}return!0}function F_(e,t,r={},n=!1){const{metaFilter:s,plainText:o}=Fs(t||""),a={...r,...s};return L_(e.metadata,a,n)?o?n?D_(e,o):O_(e,o):!0:!1}function Qc(e){const t=e.match(/^#\s+(.+)$/m);return t?t[1].trim():e.split(`
28
+ `).map(n=>n.trim()).find(n=>n.length>0)||"Untitled"}function B_(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50)||"card"}function Yg(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return t?t.split(/\s+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" "):e}const qn="deleted",bs={id:qn,name:"Deleted",color:"#ef4444"},U_=["aurora","sunset","meadow","nebula","lagoon","candy","ember","violet"],W_=["paper","mist","sand"],V_="fancy",K_="aurora",H_="paper";function G_(e){return e==="plain"?H_:K_}function q_(e,t){return e==="plain"?W_.includes(t):U_.includes(t)}function ja(e,t){const r=e??V_,n=t&&q_(r,t)?t:G_(r);return{boardBackgroundMode:r,boardBackgroundPreset:n}}const ec=[{name:"red",hex:"#e11d48"},{name:"orange",hex:"#ea580c"},{name:"amber",hex:"#d97706"},{name:"yellow",hex:"#ca8a04"},{name:"lime",hex:"#65a30d"},{name:"green",hex:"#16a34a"},{name:"teal",hex:"#0d9488"},{name:"cyan",hex:"#0891b2"},{name:"blue",hex:"#2563eb"},{name:"indigo",hex:"#4f46e5"},{name:"violet",hex:"#7c3aed"},{name:"pink",hex:"#db2777"}],Y_=20,J_=80,Xc=50;function na(e){return Number.isFinite(e)?Math.max(Y_,Math.min(J_,e)):Xc}function Z_(e,t){return!Number.isFinite(t)||t<=0?Xc:na((t-e)/t*100)}function Q_(e){let t=!1,r=Xc;const n=u=>(r=Z_(u,e.getViewportWidth()),r),s=u=>{t&&e.onPreview(n(u.clientX))},o=()=>{e.eventTarget.removeEventListener("pointermove",s),e.eventTarget.removeEventListener("pointerup",i),e.eventTarget.removeEventListener("pointercancel",c)},a=()=>{t&&(t=!1,o())},i=u=>{if(!t)return;const d=n(u.clientX);a(),e.onCommit(d)},c=()=>{t&&(a(),e.onCancel())};return{start(u){return(e.getPanelMode()??"drawer")!=="drawer"?!1:(a(),t=!0,e.eventTarget.addEventListener("pointermove",s),e.eventTarget.addEventListener("pointerup",i),e.eventTarget.addEventListener("pointercancel",c),e.onPreview(n(u.clientX)),!0)},cancel(){c()},dispose(){c()},isActive(){return t}}}const X_=["write","preview","comments","logs"],Ea="preview",tc="form:";function rc(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Jg(e){return X_.includes(e)}function Zg(e){return e.startsWith(tc)&&e.length>tc.length}function Qg(e){return Jg(e)||Zg(e)}function nc(e){return`${tc}${e}`}function eC(e){return Qg(e)?e:Ea}function tC(e,t){var r;return rc(e.schema)?!0:!!(e.name&&(t!=null&&t.forms)&&rc((r=t.forms[e.name])==null?void 0:r.schema))}function rC(e,t){const r=(e==null?void 0:e.forms)??[];if(r.length===0)return[];const n=new Set;return r.flatMap((s,o)=>{if(!tC(s,t))return[];const a=rc(s.schema)?s.schema:void 0,i=s.name??(a&&typeof a.title=="string"&&a.title.trim().length>0?B_(a.title):`form-${o}`);let c=i||`form-${o}`,u=2;for(;n.has(c);)c=`${i}-${u++}`;return n.add(c),[nc(c)]})}function jn(e,t,r){const n=eC(e);return!t||Jg(n)||Zg(n)&&rC(t,r).includes(n)?n:Ea}function xs(e,t){return e.find(r=>r.id===t)}const nC={hiddenColumnIds:[],minimizedColumnIds:[]};function sc(e){const t=Array.from(new Set((e==null?void 0:e.hiddenColumnIds)??[])),r=new Set(t);return{hiddenColumnIds:t,minimizedColumnIds:Array.from(new Set((e==null?void 0:e.minimizedColumnIds)??[])).filter(n=>!r.has(n))}}function oc(e,t){const r=new Set(t);return sc({hiddenColumnIds:e.hiddenColumnIds.filter(n=>r.has(n)),minimizedColumnIds:e.minimizedColumnIds.filter(n=>r.has(n))})}function sC(e){return e.hiddenColumnIds.length>0||e.minimizedColumnIds.length>0}function En(e,t){return e[t]??nC}function Rs(e,t,r){return sC(r)?{...e,[t]:r}:t in e?Object.fromEntries(Object.entries(e).filter(([n])=>n!==t)):e}function oC(e,t){return e.hiddenColumnIds.length===t.hiddenColumnIds.length&&e.minimizedColumnIds.length===t.minimizedColumnIds.length&&e.hiddenColumnIds.every((r,n)=>r===t.hiddenColumnIds[n])&&e.minimizedColumnIds.every((r,n)=>r===t.minimizedColumnIds[n])}function Hf(e,t,r){const n=En(e,t),s=oc(n,r);return oC(n,s)?e:Rs(e,t,s)}const aC=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,iC=e=>{const t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},lC=e=>{const t=new Date,r=new Date(t);r.setDate(t.getDate()-t.getDay()),r.setHours(0,0,0,0);const n=new Date(r);return n.setDate(r.getDate()+7),e>=r&&e<n},cC=e=>{const t=new Date;return t.setHours(0,0,0,0),e<t};function uC(e){const t=e.trim().replace(/\s+/g," ");return t?/\s/.test(t)?JSON.stringify(t):t:""}function qi(e,t){const r=Object.entries(t).map(([n,s])=>[n.trim(),s.trim()]).filter(([n,s])=>n.length>0&&s.length>0).map(([n,s])=>`meta.${n}: ${uC(s)}`);return[e.trim(),...r].filter(Boolean).join(" ").trim()}const q=qk((e,t)=>({cards:[],columns:[],boards:[],columnVisibilityByBoard:{},currentBoard:"default",isDarkMode:aC(),searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{},layout:"horizontal",workspace:null,cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,showDeletedColumn:!1,defaultPriority:"medium",defaultStatus:"backlog",boardZoom:100,cardZoom:100,boardBackgroundMode:"fancy",boardBackgroundPreset:"aurora",panelMode:"drawer",drawerWidth:50},drawerWidthPreview:null,effectiveDrawerWidth:50,settingsOpen:!1,labelDefs:{},activeCardId:null,activeCardTab:Ea,selectedCardIds:[],lastClickedCardId:null,starredBoards:[],savedViews:[],toggleStarBoard:r=>e(n=>({starredBoards:n.starredBoards.includes(r)?n.starredBoards.filter(s=>s!==r):[...n.starredBoards,r]})),saveCurrentView:r=>e(n=>{const o={id:`view-${Date.now()}`,name:r,searchQuery:n.searchQuery,fuzzySearch:n.fuzzySearch,priorityFilter:n.priorityFilter,assigneeFilter:n.assigneeFilter,labelFilter:[...n.labelFilter],dueDateFilter:n.dueDateFilter};return{savedViews:[...n.savedViews,o]}}),removeView:r=>e(n=>({savedViews:n.savedViews.filter(s=>s.id!==r)})),setActiveCardId:r=>e(n=>{if(!r)return{activeCardId:null,activeCardTab:Ea};const s=xs(n.boards,n.currentBoard),o=n.cards.find(a=>a.id===r);return{activeCardId:r,activeCardTab:jn(n.activeCardTab,o,s)}}),setActiveCardTab:r=>e(n=>({activeCardTab:jn(r,n.activeCardId?n.cards.find(s=>s.id===n.activeCardId):void 0,xs(n.boards,n.currentBoard))})),setWorkspace:r=>e({workspace:r}),setLabelDefs:r=>e({labelDefs:r}),setCards:r=>e(n=>({cards:r,activeCardTab:n.activeCardId?jn(n.activeCardTab,r.find(s=>s.id===n.activeCardId),xs(n.boards,n.currentBoard)):n.activeCardTab})),setColumns:r=>e(n=>({columns:r,columnVisibilityByBoard:Rs(n.columnVisibilityByBoard,n.currentBoard,oc(En(n.columnVisibilityByBoard,n.currentBoard),r.map(s=>s.id)))})),setBoards:r=>e(n=>{const s=new Set(r.map(a=>a.id)),o=xs(r,n.currentBoard);return{boards:r,columnVisibilityByBoard:Object.fromEntries(Object.entries(n.columnVisibilityByBoard).filter(([a])=>s.has(a))),activeCardTab:n.activeCardId?jn(n.activeCardTab,n.cards.find(a=>a.id===n.activeCardId),o):n.activeCardTab}}),setCurrentBoard:r=>e(n=>({currentBoard:r,activeCardTab:n.activeCardId?jn(n.activeCardTab,n.cards.find(s=>s.id===n.activeCardId),xs(n.boards,r)):n.activeCardTab})),getColumnVisibility:r=>{const n=r??t().currentBoard;return En(t().columnVisibilityByBoard,n)},getHiddenColumnIds:r=>t().getColumnVisibility(r).hiddenColumnIds,getMinimizedColumnIds:r=>t().getColumnVisibility(r).minimizedColumnIds,isColumnHidden:(r,n)=>t().getHiddenColumnIds(n).includes(r),isColumnMinimized:(r,n)=>t().getMinimizedColumnIds(n).includes(r),setColumnHidden:(r,n,s)=>e(o=>{const a=En(o.columnVisibilityByBoard,r),i=s?[...a.hiddenColumnIds,n]:a.hiddenColumnIds.filter(c=>c!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,sc({hiddenColumnIds:i,minimizedColumnIds:a.minimizedColumnIds.filter(c=>c!==n)}))}}),setColumnMinimized:(r,n,s)=>e(o=>{const a=En(o.columnVisibilityByBoard,r),i=s?[...a.minimizedColumnIds,n]:a.minimizedColumnIds.filter(c=>c!==n);return{columnVisibilityByBoard:Rs(o.columnVisibilityByBoard,r,sc({hiddenColumnIds:a.hiddenColumnIds,minimizedColumnIds:i}))}}),toggleColumnMinimized:(r,n)=>{const s=t();s.setColumnMinimized(r,n,!s.isColumnMinimized(n,r))},sanitizeColumnVisibility:(r,n)=>e(s=>({columnVisibilityByBoard:Rs(s.columnVisibilityByBoard,r,oc(En(s.columnVisibilityByBoard,r),n))})),setIsDarkMode:r=>e({isDarkMode:r}),setCardSettings:r=>e(n=>{const s=na(r.drawerWidth??n.cardSettings.drawerWidth??50),o=ja(r.boardBackgroundMode??n.cardSettings.boardBackgroundMode,r.boardBackgroundPreset??n.cardSettings.boardBackgroundPreset);return{cardSettings:{...r,boardZoom:r.boardZoom??n.cardSettings.boardZoom,cardZoom:r.cardZoom??n.cardSettings.cardZoom,boardBackgroundMode:o.boardBackgroundMode,boardBackgroundPreset:o.boardBackgroundPreset,panelMode:r.panelMode??n.cardSettings.panelMode,drawerWidth:s},effectiveDrawerWidth:n.drawerWidthPreview??s}}),setDrawerWidthPreview:r=>e(n=>{const s=na(r);return{drawerWidthPreview:s,effectiveDrawerWidth:s}}),clearDrawerWidthPreview:()=>e(r=>({drawerWidthPreview:null,effectiveDrawerWidth:na(r.cardSettings.drawerWidth??50)})),setSettingsOpen:r=>e({settingsOpen:r}),setSearchQuery:r=>e({searchQuery:r}),setFuzzySearch:r=>e({fuzzySearch:r}),clearPlainTextSearch:()=>e(r=>{const{metaFilter:n}=Fs(r.searchQuery);return{searchQuery:qi("",n)}}),applyMetadataFilterToken:(r,n)=>e(s=>{const o=r.trim(),a=n.trim().replace(/\s+/g," ");if(!o||!a)return{};const{metaFilter:i,plainText:c}=Fs(s.searchQuery);return i[o]=a,{searchQuery:qi(c,i)}}),removeMetadataFilterToken:r=>e(n=>{const s=r.trim();if(!s)return{};const{metaFilter:o,plainText:a}=Fs(n.searchQuery);return s in o?(delete o[s],{searchQuery:qi(a,o)}):{}}),applyLabelFilter:r=>e(()=>{const n=r.trim();return n?{labelFilter:[n]}:{}}),setPriorityFilter:r=>e({priorityFilter:r}),setAssigneeFilter:r=>e({assigneeFilter:r}),setLabelFilter:r=>e({labelFilter:r}),setDueDateFilter:r=>e({dueDateFilter:r}),setColumnSort:(r,n)=>e(s=>({columnSorts:n==="order"?Object.fromEntries(Object.entries(s.columnSorts).filter(([o])=>o!==r)):{...s.columnSorts,[r]:n}})),setLayout:r=>e({layout:r}),toggleLayout:()=>e(r=>({layout:r.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>e({searchQuery:"",fuzzySearch:!1,priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{}}),addCard:r=>e(n=>({cards:[...n.cards,r]})),updateCard:(r,n)=>e(s=>({cards:s.cards.map(o=>o.id===r?{...o,...n}:o)})),removeCard:r=>e(n=>({cards:n.cards.filter(s=>s.id!==r)})),getCardsByStatus:r=>{const{cards:n}=t();return n.filter(s=>s.status===r).sort((s,o)=>s.order<o.order?-1:s.order>o.order?1:0)},getFilteredCardsByStatus:r=>{const{cards:n,searchQuery:s,fuzzySearch:o,priorityFilter:a,assigneeFilter:i,labelFilter:c,dueDateFilter:u,columnSorts:d}=t(),f=d[r]||"order";return n.filter(p=>{if(p.status!==r||a!=="all"&&p.priority!==a)return!1;if(i!=="all"){if(i==="unassigned"){if(p.assignee)return!1}else if(p.assignee!==i)return!1}if(c.length>0&&!p.labels.some(h=>c.includes(h)))return!1;if(u!=="all")if(u==="no-date"){if(p.dueDate)return!1}else if(p.dueDate){const h=new Date(p.dueDate);if(u==="overdue"&&!cC(h)||u==="today"&&!iC(h)||u==="this-week"&&!lC(h))return!1}else return!1;return!(s&&!F_(p,s,{},o))}).sort((p,h)=>f==="created:asc"?p.created.localeCompare(h.created):f==="created:desc"?h.created.localeCompare(p.created):f==="modified:asc"?p.modified.localeCompare(h.modified):f==="modified:desc"?h.modified.localeCompare(p.modified):p.order<h.order?-1:p.order>h.order?1:0)},getUniqueAssignees:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.assignee&&n.add(s.assignee)}),Array.from(n).sort()},getUniqueLabels:()=>{const{cards:r}=t(),n=new Set;return r.forEach(s=>{s.labels.forEach(o=>n.add(o))}),Array.from(n).sort()},hasActiveFilters:()=>{const{searchQuery:r,fuzzySearch:n,priorityFilter:s,assigneeFilter:o,labelFilter:a,dueDateFilter:i,columnSorts:c}=t();return r!==""||n||s!=="all"||o!=="all"||a.length>0||i!=="all"||Object.keys(c).length>0},toggleSelectCard:r=>e(n=>({selectedCardIds:n.selectedCardIds.includes(r)?n.selectedCardIds.filter(a=>a!==r):[...n.selectedCardIds,r],lastClickedCardId:r})),selectCardRange:r=>e(n=>{if(!n.lastClickedCardId)return{selectedCardIds:[r],lastClickedCardId:r};const s=[];for(const d of n.columns)s.push(...t().getFilteredCardsByStatus(d.id));const o=s.findIndex(d=>d.id===n.lastClickedCardId),a=s.findIndex(d=>d.id===r);if(o===-1||a===-1)return{selectedCardIds:[r],lastClickedCardId:r};const i=Math.min(o,a),c=Math.max(o,a),u=new Set(n.selectedCardIds);for(let d=i;d<=c;d++)u.add(s[d].id);return{selectedCardIds:Array.from(u),lastClickedCardId:r}}),selectAllInColumn:r=>e(n=>{const s=t().getFilteredCardsByStatus(r),o=new Set(n.selectedCardIds);for(const a of s)o.add(a.id);return{selectedCardIds:Array.from(o)}}),clearSelection:()=>e({selectedCardIds:[],lastClickedCardId:null}),setSelectedCardIds:r=>e({selectedCardIds:r})}));function Xg(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Xg(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function dC(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Xg(e))&&(n&&(n+=" "),n+=t);return n}const eu="-",fC=e=>{const t=pC(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const i=a.split(eu);return i[0]===""&&i.length!==1&&i.shift(),e0(i,t)||hC(a)},getConflictingClassGroupIds:(a,i)=>{const c=r[a]||[];return i&&n[a]?[...c,...n[a]]:c}}},e0=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?e0(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(eu);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},Gf=/^\[(.+)\]$/,hC=e=>{if(Gf.test(e)){const t=Gf.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},pC=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return gC(Object.entries(e.classGroups),r).forEach(([o,a])=>{ac(a,n,o,t)}),n},ac=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:qf(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(mC(s)){ac(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{ac(a,qf(t,o),r,n)})})},qf=(e,t)=>{let r=e;return t.split(eu).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},mC=e=>e.isThemeGetter,gC=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[r,s]}):e,vC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},t0="!",yC=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=i=>{const c=[];let u=0,d=0,f;for(let v=0;v<i.length;v++){let y=i[v];if(u===0){if(y===s&&(n||i.slice(v,v+o)===t)){c.push(i.slice(d,v)),d=v+o;continue}if(y==="/"){f=v;continue}}y==="["?u++:y==="]"&&u--}const p=c.length===0?i:i.substring(d),h=p.startsWith(t0),g=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}};return r?i=>r({className:i,parseClassName:a}):a},bC=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},xC=e=>({cache:vC(e.cacheSize),parseClassName:yC(e),...fC(e)}),wC=/\s+/,kC=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(wC);let i="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=r(u);let g=!!h,m=n(g?p.substring(0,h):p);if(!m){if(!g){i=u+(i.length>0?" "+i:i);continue}if(m=n(p),!m){i=u+(i.length>0?" "+i:i);continue}g=!1}const v=bC(d).join(":"),y=f?v+t0:v,b=y+m;if(o.includes(b))continue;o.push(b);const C=s(m,g);for(let w=0;w<C.length;++w){const _=C[w];o.push(y+_)}i=u+(i.length>0?" "+i:i)}return i};function _C(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=r0(t))&&(n&&(n+=" "),n+=r);return n}const r0=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=r0(e[n]))&&(r&&(r+=" "),r+=t);return r};function CC(e,...t){let r,n,s,o=a;function a(c){const u=t.reduce((d,f)=>f(d),e());return r=xC(u),n=r.cache.get,s=r.cache.set,o=i,i(c)}function i(c){const u=n(c);if(u)return u;const d=kC(c,r);return s(c,d),d}return function(){return o(_C.apply(null,arguments))}}const Me=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},n0=/^\[(?:([a-z-]+):)?(.+)\]$/i,$C=/^\d+\/\d+$/,SC=new Set(["px","full","screen"]),jC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,EC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,AC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=e=>Dn(e)||SC.has(e)||$C.test(e),yr=e=>Yn(e,"length",LC),Dn=e=>!!e&&!Number.isNaN(Number(e)),Yi=e=>Yn(e,"number",Dn),ws=e=>!!e&&Number.isInteger(Number(e)),RC=e=>e.endsWith("%")&&Dn(e.slice(0,-1)),ge=e=>n0.test(e),br=e=>jC.test(e),TC=new Set(["length","size","percentage"]),IC=e=>Yn(e,TC,s0),MC=e=>Yn(e,"position",s0),zC=new Set(["image","url"]),OC=e=>Yn(e,zC,BC),DC=e=>Yn(e,"",FC),ks=()=>!0,Yn=(e,t,r)=>{const n=n0.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},LC=e=>EC.test(e)&&!AC.test(e),s0=()=>!1,FC=e=>NC.test(e),BC=e=>PC.test(e),UC=()=>{const e=Me("colors"),t=Me("spacing"),r=Me("blur"),n=Me("brightness"),s=Me("borderColor"),o=Me("borderRadius"),a=Me("borderSpacing"),i=Me("borderWidth"),c=Me("contrast"),u=Me("grayscale"),d=Me("hueRotate"),f=Me("invert"),p=Me("gap"),h=Me("gradientColorStops"),g=Me("gradientColorStopPositions"),m=Me("inset"),v=Me("margin"),y=Me("opacity"),b=Me("padding"),C=Me("saturate"),w=Me("scale"),_=Me("sepia"),R=Me("skew"),z=Me("space"),D=Me("translate"),j=()=>["auto","contain","none"],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",ge,t],P=()=>[ge,t],K=()=>["",nr,yr],O=()=>["auto",Dn,ge],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],oe=()=>["","0",ge],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[Dn,ge];return{cacheSize:500,separator:":",theme:{colors:[ks],spacing:[nr,yr],blur:["none","",br,ge],brightness:N(),borderColor:[e],borderRadius:["none","","full",br,ge],borderSpacing:P(),borderWidth:K(),contrast:N(),grayscale:oe(),hueRotate:N(),invert:oe(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[RC,yr],inset:E(),margin:E(),opacity:N(),padding:P(),saturate:N(),scale:N(),sepia:oe(),skew:N(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",ge]}],container:["container"],columns:[{columns:[br]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),ge]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ws,ge]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ge]}],grow:[{grow:oe()}],shrink:[{shrink:oe()}],order:[{order:["first","last","none",ws,ge]}],"grid-cols":[{"grid-cols":[ks]}],"col-start-end":[{col:["auto",{span:["full",ws,ge]},ge]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[ks]}],"row-start-end":[{row:["auto",{span:[ws,ge]},ge]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ge]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[z]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[z]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ge,t]}],"min-w":[{"min-w":[ge,t,"min","max","fit"]}],"max-w":[{"max-w":[ge,t,"none","full","min","max","fit","prose",{screen:[br]},br]}],h:[{h:[ge,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ge,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ge,t,"auto","min","max","fit"]}],"font-size":[{text:["base",br,yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yi]}],"font-family":[{font:[ks]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ge]}],"line-clamp":[{"line-clamp":["none",Dn,Yi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,ge]}],"list-image":[{"list-image":["none",ge]}],"list-style-type":[{list:["none","disc","decimal",ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,yr]}],"underline-offset":[{"underline-offset":["auto",nr,ge]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),MC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",IC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[nr,ge]}],"outline-w":[{outline:[nr,yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[nr,yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",br,DC]}],"shadow-color":[{shadow:[ks]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",br,ge]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ge]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",ge]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ws,ge]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ge]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,yr,Yi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},WC=CC(UC);function Ee(...e){return WC(dC(e))}function sa(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(7*24*3600));n%=7*24*3600;const i=Math.floor(n/(24*3600));n%=24*3600;const c=Math.floor(n/3600);n%=3600;const u=Math.floor(n/60),d=n%60;return s>0?o>0?`${s}y${o}mo`:`${s}y`:o>0?`${o}mo`:a>0?i>0?`${a}w${i}d`:`${a}w`:i>0?c>0?`${i}d${c}h`:`${i}d`:c>0?u>0?`${c}h${u}m`:`${c}h`:u>0?d>0?`${u}m${d}s`:`${u}m`:`${d}s`}function Aa(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function Bs(e){if(!e)return"";const t=Date.now(),r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.floor((t-r)/1e3));const s=Math.floor(n/(365*24*3600));n%=365*24*3600;const o=Math.floor(n/(30*24*3600));n%=30*24*3600;const a=Math.floor(n/(24*3600));n%=24*3600;const i=Math.floor(n/3600);n%=3600;const c=Math.floor(n/60),u=n%60,d=[];return s>0&&d.push(`${s} ${s===1?"year":"years"}`),o>0&&d.push(`${o} ${o===1?"month":"months"}`),a>0&&d.push(`${a} ${a===1?"day":"days"}`),i>0&&d.push(`${i} ${i===1?"hour":"hours"}`),c>0&&d.push(`${c} ${c===1?"min":"mins"}`),d.length===0?u>0?`${u} ${u===1?"sec":"secs"} ago`:"just now":`${d.slice(0,2).join(" ")} ago`}function VC(e,t){const r=[];return e&&r.push(`Created at: ${Aa(e)} (${Bs(e)})`),t&&r.push(`Modified at: ${Aa(t)} (${Bs(t)})`),r.join(`
29
+ `)}const Yf={critical:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",high:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",medium:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",low:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"},Jf={critical:"Critical",high:"High",medium:"Med",low:"Low"};function KC(e){const t=e.split(`
30
30
  `),r=t.findIndex(s=>/^#\s+/.test(s));return(r>=0?t.slice(r+1):t).join(`
31
- `).trim()}function QC(e){return e.replace(/```[\s\S]*?```/g,"[code]").replace(/`([^`]+)`/g,"$1").replace(/^#{1,6}\s+(.+)$/gm,"$1").replace(/^>\s*/gm,"").replace(/\*\*\*(.+?)\*\*\*/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/_(.+?)_/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^[-*+]\s+/gm,"").replace(/^\d+\.\s+/gm,"").replace(/\n+/g," ").trim()}function XC({card:e,onClick:t,isDragging:r,isSelected:n}){const s=G(m=>m.cardSettings),o=G(m=>m.labelDefs),a=G(m=>m.applyLabelFilter),i=tu(e.content),c=ZC(e.content),u=e.filePath&&e.filePath.split("/").pop()||"",d=m=>{if(!m)return null;const v=new Date(m),y=new Date,b=v.getTime()-y.getTime(),C=Math.ceil(b/(1e3*60*60*24));return C<0?{text:"Overdue",className:"text-red-500"}:C===0?{text:"Today",className:"text-orange-500"}:C===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:C<=7?{text:`${C}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:v.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},f=e.status==="done"?null:d(e.dueDate),p=m=>{if(!m)return null;const v=new Date(m),b=new Date().getTime()-v.getTime(),C=Math.floor(b/(1e3*60)),w=Math.floor(b/(1e3*60*60)),_=Math.floor(b/(1e3*60*60*24));return C<1?"Just now":C<60?`${C}m ago`:w<24?`${w}h ago`:_===1?"1d ago":_<30?`${_}d ago`:_<365?`${Math.floor(_/30)}mo ago`:`${Math.floor(_/365)}y ago`},h=e.status==="done"?p(e.completedAt):null,g=(()=>{var m,v,y,b,C,w,_;return((v=(m=e.cardState)==null?void 0:m.error)==null?void 0:v.availability)==="identity-unavailable"?{label:"Sign in",className:"kb-card-state-badge kb-card-state-badge--identity bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",title:e.cardState.error.message}:((b=(y=e.cardState)==null?void 0:y.error)==null?void 0:b.availability)==="unavailable"?{label:"State off",className:"kb-card-state-badge kb-card-state-badge--unavailable bg-zinc-200 text-zinc-700 dark:bg-zinc-700 dark:text-zinc-200",title:e.cardState.error.message}:(w=(C=e.cardState)==null?void 0:C.unread)!=null&&w.unread?{label:"Unread",className:"kb-card-state-badge kb-card-state-badge--unread bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-300",title:"Unread activity is waiting on this card"}:(_=e.cardState)!=null&&_.open?{label:"Opened",className:"kb-card-state-badge kb-card-state-badge--opened bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",title:`Last opened ${new Date(e.cardState.open.value.openedAt).toLocaleString()}`}:null})();return l.jsxs("div",{onClick:t,className:["group kb-card",`kb-card-priority--${e.priority}`,n?"kb-card--selected":"",r?"shadow-lg opacity-90":""].filter(Boolean).join(" "),children:[l.jsxs("div",{className:"flex-1",children:[s.showFileName&&u&&l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(s1,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-400"}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-400 truncate flex-1",children:u}),s.showPriorityBadges&&l.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${Qf[e.priority]}`,children:Xf[e.priority]})]}),l.jsxs("div",{className:`flex items-start gap-2 ${c?"mb-1":"mb-2"}`,children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:i}),g&&l.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded shrink-0 ${g.className}`,title:g.title,children:g.label}),s.showPriorityBadges&&!(s.showFileName&&u)&&l.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${Qf[e.priority]}`,children:Xf[e.priority]})]}),c&&l.jsx("p",{className:`text-xs text-zinc-500 dark:text-zinc-400 ${s.compactMode?"line-clamp-1":"line-clamp-2"} mb-1.5`,children:QC(c)}),s.showLabels&&e.labels.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[(s.compactMode?e.labels.slice(0,2):e.labels.slice(0,4)).map(m=>{const v=o[m];return l.jsx("button",{type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),a(m)},className:`text-xs px-1.5 py-0.5 rounded ${v?"":"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300"}`,style:v?{backgroundColor:`${v.color}20`,color:v.color}:void 0,title:`Filter cards by label ${m}`,"aria-label":`Filter cards by label ${m}`,children:m},m)}),(s.compactMode?e.labels.length>2:e.labels.length>4)&&l.jsxs("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400 px-0.5 py-0.5 leading-tight",children:["+",e.labels.length-(s.compactMode?2:4)]})]})]}),l.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[l.jsx("div",{className:"flex items-center gap-1",children:s.showAssignee&&e.assignee&&e.assignee!=="null"&&l.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:e.assignee.split(/\s+/).map(m=>m[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:e.assignee})]})}),e.attachments.length>0&&l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[l.jsx(Xm,{size:12}),l.jsx("span",{children:e.attachments.length})]}),e.metadata&&Object.keys(e.metadata).length>0&&l.jsx("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:l.jsx("span",{className:"text-[10px] font-mono",children:`{${Object.keys(e.metadata).length}}`})}),s.showDueDate&&f&&l.jsxs("div",{className:`flex items-center gap-1 ${f.className}`,children:[l.jsx(Bc,{size:12}),l.jsx("span",{children:f.text})]}),h&&l.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(St,{size:12}),l.jsx("span",{children:h})]}),l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",title:JC(e.created,e.modified),children:[l.jsx(Ul,{size:12}),l.jsx("span",{children:sa(e.modified)})]})]})]})}function e$({status:e,onAdd:t}){const{cardSettings:r}=G(),[n,s]=x.useState(!1),[o,a]=x.useState(""),i=x.useRef(null);x.useEffect(()=>{n&&i.current&&i.current.focus()},[n]);const c=()=>{const d=o.trim();if(d){const f=`# ${d}`;t({status:e,priority:r.defaultPriority,content:f}),a("")}s(!1)},u=d=>{d.key==="Enter"?(d.preventDefault(),c()):d.key==="Escape"&&(a(""),s(!1))};return n?l.jsx("input",{ref:i,type:"text",value:o,onChange:d=>a(d.target.value),onBlur:c,onKeyDown:u,placeholder:"Card title...",className:"kb-quick-add-input"}):l.jsxs("button",{onClick:()=>s(!0),className:"kb-quick-add-btn",children:[l.jsx(Zr,{size:13}),l.jsx("span",{children:"Add card"})]})}const t$=[{value:"order",label:"Board Order"},{value:"created:asc",label:"Created (oldest)"},{value:"created:desc",label:"Created (newest)"},{value:"modified:asc",label:"Modified (oldest)"},{value:"modified:desc",label:"Modified (newest)"}],r$="application/x-column-id",n$="kanban-column:";function s$(e,t){var n,s,o;const r=Array.from(((n=e.dataTransfer)==null?void 0:n.types)??[]);if(r.includes(r$))return!0;if(r.includes("text/plain"))try{if((((o=(s=e.dataTransfer)==null?void 0:s.getData)==null?void 0:o.call(s,"text/plain"))??"").startsWith(n$))return!0}catch{}return!!t}function eh({column:e,columnIndex:t,cards:r,onCardClick:n,onAddCard:s,onEditColumn:o,onRemoveColumn:a,onCleanupColumn:i,onDragStart:c,onDragOver:u,onDragOverCard:d,onDrop:f,onDragEnd:p,draggedCard:h,dropTarget:g,draggedColumnId:m,dropColumnIndex:v,onColumnDragStart:y,onColumnDragOver:b,onColumnDrop:C,onColumnDragEnd:w,isMinimized:_=!1,onToggleMinimized:R,layout:z,isDeletedColumn:D,onPurgeColumn:j,selectedCardId:S,selectedCardIds:E,onSelectAll:P,sort:K,onSortChange:O,onQuickAdd:q,onTriggerAction:V}){const L=z==="vertical",U=M=>s$(M,m),oe=g&&g.columnId===e.id,Y=!D&&v===t&&m!==e.id,N=!D&&v===t+1&&m!==e.id,Z=m===e.id,I="0 1px 2px 0 rgb(0 0 0 / 0.05)",k=L?"border-t-2 border-blue-500":"border-l-2 border-blue-500",$=L?"border-b-2 border-blue-500":"border-r-2 border-blue-500",A={...Y?L?{borderTopColor:"#3b82f6"}:{borderLeftColor:"#3b82f6"}:{},...N?L?{borderBottomColor:"#3b82f6"}:{borderRightColor:"#3b82f6"}:{},...Y||N?{boxShadow:`${I}, ${L?Y?"0 -8px 18px -14px rgba(59,130,246,0.65)":"0 8px 18px -14px rgba(59,130,246,0.65)":Y?"-8px 0 18px -14px rgba(59,130,246,0.65)":"8px 0 18px -14px rgba(59,130,246,0.65)"}`}:{}},[W,H]=x.useState(!1),ee=x.useRef(null),re=x.useMemo(()=>E.filter(M=>r.some(J=>J.id===M)),[E,r]),le=re.length>0?r.filter(M=>re.includes(M.id)):r,pe=x.useMemo(()=>{const M={};for(const J of le){if(!J.actions)continue;const se=Array.isArray(J.actions)?J.actions.map(ue=>[ue,ue]):Object.entries(J.actions);for(const[ue,_e]of se)M[ue]||(M[ue]={label:_e,cardIds:[]}),M[ue].cardIds.push(J.id)}return Object.entries(M)},[le]);return x.useEffect(()=>{if(!W)return;const M=J=>{ee.current&&!ee.current.contains(J.target)&&H(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[W]),_&&!D?l.jsx("div",{style:A,className:[L?"flex items-center gap-2 bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm px-2 py-1.5":"flex-shrink-0 w-10 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Z?"opacity-40":"",Y?k:"",N?$:"",oe&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:M=>{U(M)?(M.preventDefault(),b(M,t)):u(M,e.id)},onDrop:M=>{U(M)?(M.stopPropagation(),C(M)):f(M,e.id)},children:l.jsxs("div",{className:L?"flex items-center gap-2 w-full cursor-grab active:cursor-grabbing":"flex flex-col items-center gap-1.5 px-1.5 py-1.5 cursor-grab active:cursor-grabbing h-full",draggable:!0,onDragStart:M=>y(M,e.id),onDragOver:M=>{U(M)&&(M.stopPropagation(),b(M,t))},onDrop:M=>{U(M)&&(M.stopPropagation(),C(M))},onDragEnd:w,children:[l.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),R()},className:"p-0.5 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors flex-shrink-0",title:`Expand ${e.name}`,children:l.jsx(o1,{size:12,className:"text-zinc-500"})}),L?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 truncate",title:e.name,children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",children:r.length})]}):l.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-1 justify-start min-h-0 overflow-hidden",children:[l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:r.length}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 tracking-wide",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},title:e.name,children:e.name}),l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:e.color}})]})]})}):l.jsxs("div",{style:A,className:[L?"flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Z?"opacity-40":"",Y?k:"",N?$:"",oe&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:M=>{U(M)?(M.preventDefault(),b(M,t)):u(M,e.id)},onDrop:M=>{U(M)?(M.stopPropagation(),C(M)):f(M,e.id)},children:[l.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between w-full px-3 py-2.5 border-b border-zinc-200 dark:border-zinc-700 cursor-grab active:cursor-grabbing bg-zinc-50 dark:bg-zinc-800 rounded-t-xl",draggable:!D,onDragStart:M=>{D||y(M,e.id)},onDragOver:M=>{D||!U(M)||(M.stopPropagation(),b(M,t))},onDrop:M=>{U(M)&&(M.stopPropagation(),C(M))},onDragEnd:w,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:r.length})]}),l.jsx("div",{className:"flex items-center gap-0.5",children:D?l.jsx("button",{type:"button",onClick:()=>{r.length!==0&&window.confirm(`Permanently delete all ${r.length} card${r.length===1?"":"s"} from disk?`)&&(j==null||j())},className:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Permanently delete all cards",children:l.jsx(Kt,{size:16,className:"text-red-500"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>s(e.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${e.name}`,children:l.jsx(Zr,{size:16,className:"text-zinc-500"})}),l.jsxs("div",{className:"relative",ref:ee,children:[l.jsx("button",{type:"button",onClick:()=>H(!W),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:l.jsx(a1,{size:16,className:"text-zinc-500"})}),W&&l.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[170px]",children:[l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Sort by"}),t$.map(M=>l.jsxs("button",{type:"button",onClick:()=>{O(M.value)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(St,{size:14,className:K===M.value?"text-blue-500":"invisible"}),M.label]},M.value)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),o(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Uc,{size:14}),"Edit List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),a(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Remove List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),i(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-orange-600 dark:text-orange-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Cleanup List"]}),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),R()},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(i1,{size:14}),"Minimize List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),P(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(l1,{size:14}),"Select All"]}),pe.length>0&&V&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Actions"}),pe.map(([M,{label:J,cardIds:se}])=>l.jsxs("button",{type:"button",onClick:()=>{H(!1),se.forEach(ue=>V(ue,M))},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(ma,{size:14,className:"text-amber-500 flex-shrink-0"}),l.jsx("span",{className:"flex-1 text-left truncate",children:J}),l.jsx("span",{className:"text-xs text-zinc-400 dark:text-zinc-500 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full flex-shrink-0",children:se.length})]},M))]})]})]})]})})]}),l.jsxs("div",{className:L?"flex-1 p-3 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-3 space-y-2 min-h-[200px]",children:[r.map((M,J)=>l.jsxs("div",{children:[oe&&g.index===J&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),l.jsx("div",{draggable:!0,"data-card-id":M.id,onDragStart:se=>c(se,M),onDragOver:se=>d(se,e.id,J),onDragEnd:p,className:`${L?"w-64":""} ${(h==null?void 0:h.id)===M.id?"opacity-40":""}`,children:l.jsx(XC,{card:M,onClick:se=>n(M,se),isSelected:E.includes(M.id)||M.id===S})})]},M.id)),oe&&g.index===r.length&&r.length>0&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),r.length===0&&l.jsxs("div",{className:L?"flex items-center gap-2 py-4 px-1 text-zinc-400 dark:text-zinc-500":"flex flex-col items-center gap-1.5 py-8 text-zinc-400 dark:text-zinc-500",children:[l.jsx(c1,{size:L?14:20,className:"shrink-0 opacity-50"}),l.jsx("span",{className:L?"text-sm":"text-sm text-center",children:"No cards yet"}),!L&&l.jsx("span",{className:"text-[11px] text-center text-zinc-300 dark:text-zinc-600 max-w-[120px]",children:"Drag cards here or click + to add one"})]})]}),!D&&q&&l.jsx("div",{className:"px-2 pb-2",children:l.jsx(e$,{status:e.id,onAdd:q})})]})}const o$="application/x-column-id",a$="kanban-column:";function i$({onCardClick:e,onAddCard:t,onMoveCard:r,onMoveCards:n,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onPurgeDeletedCards:i,onReorderColumns:c,selectedCardId:u,selectedCardIds:d,onSelectAll:f,onQuickAdd:p,onTriggerAction:h}){const g=x.useRef(null),m=G(M=>M.cardSettings),v=G(M=>M.effectiveDrawerWidth),y=G(M=>M.columns),b=G(M=>M.currentBoard),C=G(M=>M.getFilteredCardsByStatus),w=G(M=>M.getCardsByStatus),_=G(M=>M.getHiddenColumnIds(b)),R=G(M=>M.getMinimizedColumnIds(b)),z=G(M=>M.toggleColumnMinimized),D=G(M=>M.layout),j=G(M=>M.columnSorts),S=G(M=>M.setColumnSort);x.useEffect(()=>{if(!u)return;const M=g.current;if(!M)return;const se=setTimeout(()=>{const ue=M.querySelector(`[data-card-id="${u}"]`);if(!ue)return;const _e=M.getBoundingClientRect(),we=ue.getBoundingClientRect();if(!(we.left>=_e.left&&we.right<=_e.right)){const Ce=we.right-_e.right;M.scrollBy({left:Ce+10,behavior:"smooth"})}ue.scrollIntoView({behavior:"smooth",block:"nearest"})},50);return()=>clearTimeout(se)},[m.panelMode,v,u]);const[E,P]=x.useState(null),[K,O]=x.useState(null),[q,V]=x.useState(null),L=x.useRef(null),[U,oe]=x.useState(null),Y=x.useCallback((M,J)=>{P(J),M.dataTransfer.effectAllowed="move",d.length>1&&d.includes(J.id)?M.dataTransfer.setData("text/plain",JSON.stringify(d)):M.dataTransfer.setData("text/plain",J.id)},[d]),N=x.useCallback((M,J)=>{M.preventDefault(),M.dataTransfer.dropEffect="move",!L.current&&J&&O(se=>(se==null?void 0:se.columnId)===J?se:{columnId:J,index:0})},[]),Z=x.useCallback((M,J,se)=>{if(M.preventDefault(),M.dataTransfer.dropEffect="move",L.current)return;const ue=M.currentTarget.getBoundingClientRect(),_e=ue.top+ue.height/2,we=M.clientY<_e?se:se+1;O(Ne=>Ne&&Ne.columnId===J&&Ne.index===we?Ne:{columnId:J,index:we})},[]),I=x.useCallback((M,J)=>{if(M.preventDefault(),!E)return;if(d.length>1&&d.includes(E.id)){n([...d],J),P(null),O(null);return}const se=C(J);let ue;if(K&&K.columnId===J?ue=K.index:ue=se.length,E.status===J){const Ce=se.findIndex(Ie=>Ie.id===E.id);if(Ce!==-1&&ue>Ce&&ue--,Ce===ue){P(null),O(null);return}}const _e=w(J).filter(Ce=>Ce.id!==E.id),we=se.filter(Ce=>Ce.id!==E.id);let Ne;if(we.length===0)Ne=_e.length;else if(ue>=we.length){const Ce=we[we.length-1];Ne=_e.findIndex(qe=>qe.id===Ce.id)+1}else{const Ce=we[ue];Ne=_e.findIndex(Ie=>Ie.id===Ce.id)}r(E.id,J,Ne),P(null),O(null)},[E,K,d,C,w,r,n]),k=x.useCallback(()=>{P(null),O(null)},[]),$=x.useCallback((M,J)=>{L.current=J,V(J),O(null),M.dataTransfer.effectAllowed="move",M.dataTransfer.setData(o$,J),M.dataTransfer.setData("text/plain",`${a$}${J}`)},[]),A=x.useCallback((M,J)=>{M.preventDefault(),M.dataTransfer.dropEffect="move";const se=M.currentTarget.getBoundingClientRect(),ue=D==="vertical"?M.clientY<se.top+se.height/2?J:J+1:M.clientX<se.left+se.width/2?J:J+1;oe(_e=>_e===ue?_e:ue)},[D]),W=x.useCallback(M=>{M.preventDefault();const J=L.current??q;if(!J||U===null){L.current=null,V(null),oe(null);return}const se=new Set(_),ue=y.map(Ie=>Ie.id),_e=ue.filter(Ie=>!se.has(Ie)),we=_e.indexOf(J);if(we===-1){L.current=null,V(null),oe(null);return}const Ne=[..._e];Ne.splice(we,1);const Ce=U>we?U-1:U;if(Ne.splice(Ce,0,J),Ne.join()!==_e.join()){let Ie=0;const qe=ue.map(it=>se.has(it)?it:Ne[Ie++]);c(qe)}L.current=null,V(null),oe(null)},[y,q,U,_,c]),H=x.useCallback(()=>{L.current=null,V(null),oe(null)},[]),ee=D==="vertical",re=new Set(_),le=new Set(R),pe=y.filter(M=>!re.has(M.id));return l.jsx("div",{ref:g,className:ee?"h-full overflow-y-auto px-5 py-4":"h-full overflow-x-auto px-5 py-4",children:l.jsxs("div",{className:ee?"flex flex-col gap-5":"flex gap-5 h-full min-w-max",children:[y.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-zinc-400 dark:text-zinc-500",children:[l.jsx(Wl,{size:40,className:"opacity-30"}),l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-500 dark:text-zinc-400",children:"No lists yet"}),l.jsx("p",{className:"text-[12px] mt-1 text-zinc-400 dark:text-zinc-500",children:'Click "Add List" in the toolbar to create your first column'})]})]}),pe.map((M,J)=>l.jsx(eh,{column:M,columnIndex:J,cards:C(M.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:Y,onDragOver:N,onDragOverCard:Z,onDrop:I,onDragEnd:k,draggedCard:E,dropTarget:K,draggedColumnId:q,dropColumnIndex:U,onColumnDragStart:$,onColumnDragOver:A,onColumnDrop:W,onColumnDragEnd:H,isMinimized:le.has(M.id),onToggleMinimized:()=>z(b,M.id),layout:D,selectedCardId:u,selectedCardIds:d,onSelectAll:f,sort:j[M.id]||"order",onSortChange:se=>S(M.id,se),onQuickAdd:p,onTriggerAction:h},M.id)),m.showDeletedColumn&&l.jsx(eh,{column:bs,columnIndex:y.length,cards:C(bs.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:Y,onDragOver:N,onDragOverCard:Z,onDrop:I,onDragEnd:k,draggedCard:E,dropTarget:K,draggedColumnId:q,dropColumnIndex:U,onColumnDragStart:$,onColumnDragOver:A,onColumnDrop:W,onColumnDragEnd:H,layout:D,isDeletedColumn:!0,onPurgeColumn:i,selectedCardId:u,selectedCardIds:d,onSelectAll:f,sort:j[bs.id]||"order",onSortChange:M=>S(bs.id,M)},bs.id)]})})}const l$=["Mo","Tu","We","Th","Fr","Sa","Su"],c$=["January","February","March","April","May","June","July","August","September","October","November","December"];function u$({value:e,onChange:t,placeholder:r="Due date"}){const[n,s]=x.useState(!1),o=new Date,a=e?new Date(e+"T00:00:00"):null,[i,c]=x.useState((a==null?void 0:a.getFullYear())??o.getFullYear()),[u,d]=x.useState((a==null?void 0:a.getMonth())??o.getMonth()),f=new Date(i,u+1,0).getDate(),p=(new Date(i,u,1).getDay()+6)%7,h=Array(p).fill(null);for(let w=1;w<=f;w++)h.push(w);const g=()=>{u===0?(d(11),c(w=>w-1)):d(w=>w-1)},m=()=>{u===11?(d(0),c(w=>w+1)):d(w=>w+1)},v=w=>{const _=String(u+1).padStart(2,"0"),R=String(w).padStart(2,"0");t(`${i}-${_}-${R}`),s(!1)},y=w=>w===o.getDate()&&u===o.getMonth()&&i===o.getFullYear(),b=w=>a!==null&&w===a.getDate()&&u===a.getMonth()&&i===a.getFullYear(),C=w=>new Date(w+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>s(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:[l.jsx("span",{children:e?C(e):r}),e&&l.jsx("span",{role:"button",onClick:w=>{w.stopPropagation(),t(""),s(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:l.jsx(st,{size:12})})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("button",{type:"button",onClick:g,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(u1,{size:14})}),l.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[c$[u]," ",i]}),l.jsx("button",{type:"button",onClick:m,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(d1,{size:14})})]}),l.jsx("div",{className:"grid grid-cols-7 mb-1",children:l$.map(w=>l.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:w},w))}),l.jsx("div",{className:"grid grid-cols-7",children:h.map((w,_)=>l.jsx("div",{className:"flex items-center justify-center",children:w?l.jsx("button",{type:"button",onClick:()=>v(w),className:Ee("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:b(w)?"var(--vscode-focusBorder)":y(w)?"var(--vscode-editor-selectionBackground)":void 0,color:b(w)?"var(--vscode-editor-background)":(y(w),"var(--vscode-foreground)")},onMouseEnter:R=>{b(w)||(R.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:R=>{!b(w)&&!y(w)?R.currentTarget.style.background="transparent":y(w)&&!b(w)&&(R.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:w}):l.jsx("div",{className:"w-7 h-7"})},_))}),l.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("button",{type:"button",onClick:()=>{const w=String(o.getMonth()+1).padStart(2,"0"),_=String(o.getDate()).padStart(2,"0");t(`${o.getFullYear()}-${w}-${_}`),s(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:w=>w.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:w=>w.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}function su(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var an=su();function d0(e){an=e}var Vr={exec:()=>null};function ke(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(ct.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var d$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ct={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},f$=/^(?:[ \t]*(?:\n|$))+/,h$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,p$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,m$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ou=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,f0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,h0=ke(f0).replace(/bull/g,ou).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),g$=ke(f0).replace(/bull/g,ou).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),au=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v$=/^[^\n]+/,iu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,y$=ke(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",iu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),b$=ke(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ou).getRegex(),ui="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",lu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,x$=ke("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",lu).replace("tag",ui).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),p0=ke(au).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ui).getRegex(),w$=ke(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",p0).getRegex(),cu={blockquote:w$,code:h$,def:y$,fences:p$,heading:m$,hr:ao,html:x$,lheading:h0,list:b$,newline:f$,paragraph:p0,table:Vr,text:v$},th=ke("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ui).getRegex(),k$={...cu,lheading:g$,table:th,paragraph:ke(au).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",th).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ui).getRegex()},_$={...cu,html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",lu).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Vr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ke(au).replace("hr",ao).replace("heading",` *#{1,6} *[^
32
- ]`).replace("lheading",h0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,m0=/^( {2,}|\\)\n(?!\s*$)/,S$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,di=/[\p{P}\p{S}]/u,uu=/[\s\p{P}\p{S}]/u,g0=/[^\s\p{P}\p{S}]/u,j$=ke(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,uu).getRegex(),v0=/(?!~)[\p{P}\p{S}]/u,E$=/(?!~)[\s\p{P}\p{S}]/u,A$=/(?:[^\s\p{P}\p{S}]|~)/u,y0=/(?![*_])[\p{P}\p{S}]/u,N$=/(?![*_])[\s\p{P}\p{S}]/u,P$=/(?:[^\s\p{P}\p{S}]|[*_])/u,R$=ke(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",d$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),b0=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,T$=ke(b0,"u").replace(/punct/g,di).getRegex(),I$=ke(b0,"u").replace(/punct/g,v0).getRegex(),x0="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",M$=ke(x0,"gu").replace(/notPunctSpace/g,g0).replace(/punctSpace/g,uu).replace(/punct/g,di).getRegex(),z$=ke(x0,"gu").replace(/notPunctSpace/g,A$).replace(/punctSpace/g,E$).replace(/punct/g,v0).getRegex(),O$=ke("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,g0).replace(/punctSpace/g,uu).replace(/punct/g,di).getRegex(),D$=ke(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,y0).getRegex(),L$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",F$=ke(L$,"gu").replace(/notPunctSpace/g,P$).replace(/punctSpace/g,N$).replace(/punct/g,y0).getRegex(),B$=ke(/\\(punct)/,"gu").replace(/punct/g,di).getRegex(),U$=ke(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),W$=ke(lu).replace("(?:-->|$)","-->").getRegex(),V$=ke("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",W$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Na=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,K$=ke(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Na).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),w0=ke(/^!?\[(label)\]\[(ref)\]/).replace("label",Na).replace("ref",iu).getRegex(),k0=ke(/^!?\[(ref)\](?:\[\])?/).replace("ref",iu).getRegex(),H$=ke("reflink|nolink(?!\\()","g").replace("reflink",w0).replace("nolink",k0).getRegex(),rh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,du={_backpedal:Vr,anyPunctuation:B$,autolink:U$,blockSkip:R$,br:m0,code:$$,del:Vr,delLDelim:Vr,delRDelim:Vr,emStrongLDelim:T$,emStrongRDelimAst:M$,emStrongRDelimUnd:O$,escape:C$,link:K$,nolink:k0,punctuation:j$,reflink:w0,reflinkSearch:H$,tag:V$,text:S$,url:Vr},q$={...du,link:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Na).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Na).getRegex()},uc={...du,emStrongRDelimAst:z$,emStrongLDelim:I$,delLDelim:D$,delRDelim:F$,url:ke(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",rh).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ke(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",rh).getRegex()},G$={...uc,br:ke(m0).replace("{2,}","*").getRegex(),text:ke(uc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Fo={normal:cu,gfm:k$,pedantic:_$},_s={normal:du,gfm:uc,breaks:G$,pedantic:q$},Y$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nh=e=>Y$[e];function Lt(e,t){if(t){if(ct.escapeTest.test(e))return e.replace(ct.escapeReplace,nh)}else if(ct.escapeTestNoEncode.test(e))return e.replace(ct.escapeReplaceNoEncode,nh);return e}function sh(e){try{e=encodeURI(e).replace(ct.percentDecode,"%")}catch{return null}return e}function oh(e,t){var o;let r=e.replace(ct.findPipe,(a,i,c)=>{let u=!1,d=i;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ct.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!((o=n.at(-1))!=null&&o.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(ct.slashPipe,"|");return n}function Cs(e,t,r){let n=e.length;if(n===0)return"";let s=0;for(;s<n&&e.charAt(n-s-1)===t;)s++;return e.slice(0,n-s)}function J$(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Z$(e,t=0){let r=t,n="";for(let s of e)if(s===" "){let o=4-r%4;n+=" ".repeat(o),r+=o}else n+=s,r++;return n}function ah(e,t,r,n,s){let o=t.href,a=t.title||null,i=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:a,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,c}function Q$(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
31
+ `).trim()}function HC(e){return e.replace(/```[\s\S]*?```/g,"[code]").replace(/`([^`]+)`/g,"$1").replace(/^#{1,6}\s+(.+)$/gm,"$1").replace(/^>\s*/gm,"").replace(/\*\*\*(.+?)\*\*\*/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/_(.+?)_/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^[-*+]\s+/gm,"").replace(/^\d+\.\s+/gm,"").replace(/\n+/g," ").trim()}function GC({card:e,onClick:t,isDragging:r,isSelected:n}){const s=q(m=>m.cardSettings),o=q(m=>m.labelDefs),a=q(m=>m.applyLabelFilter),i=Qc(e.content),c=KC(e.content),u=e.filePath&&e.filePath.split("/").pop()||"",d=m=>{if(!m)return null;const v=new Date(m),y=new Date,b=v.getTime()-y.getTime(),C=Math.ceil(b/(1e3*60*60*24));return C<0?{text:"Overdue",className:"text-red-500"}:C===0?{text:"Today",className:"text-orange-500"}:C===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:C<=7?{text:`${C}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:v.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},f=e.status==="done"?null:d(e.dueDate),p=m=>{if(!m)return null;const v=new Date(m),b=new Date().getTime()-v.getTime(),C=Math.floor(b/(1e3*60)),w=Math.floor(b/(1e3*60*60)),_=Math.floor(b/(1e3*60*60*24));return C<1?"Just now":C<60?`${C}m ago`:w<24?`${w}h ago`:_===1?"1d ago":_<30?`${_}d ago`:_<365?`${Math.floor(_/30)}mo ago`:`${Math.floor(_/365)}y ago`},h=e.status==="done"?p(e.completedAt):null,g=(()=>{var m,v,y,b,C,w,_;return((v=(m=e.cardState)==null?void 0:m.error)==null?void 0:v.availability)==="identity-unavailable"?{label:"Sign in",className:"kb-card-state-badge kb-card-state-badge--identity bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",title:e.cardState.error.message}:((b=(y=e.cardState)==null?void 0:y.error)==null?void 0:b.availability)==="unavailable"?{label:"State off",className:"kb-card-state-badge kb-card-state-badge--unavailable bg-zinc-200 text-zinc-700 dark:bg-zinc-700 dark:text-zinc-200",title:e.cardState.error.message}:(w=(C=e.cardState)==null?void 0:C.unread)!=null&&w.unread?{label:"Unread",className:"kb-card-state-badge kb-card-state-badge--unread bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-300",title:"Unread activity is waiting on this card"}:(_=e.cardState)!=null&&_.open?{label:"Opened",className:"kb-card-state-badge kb-card-state-badge--opened bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",title:`Last opened ${new Date(e.cardState.open.value.openedAt).toLocaleString()}`}:null})();return l.jsxs("div",{onClick:t,className:["group kb-card",`kb-card-priority--${e.priority}`,n?"kb-card--selected":"",r?"shadow-lg opacity-90":""].filter(Boolean).join(" "),children:[l.jsxs("div",{className:"flex-1",children:[s.showFileName&&u&&l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(Qx,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-400"}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-400 truncate flex-1",children:u}),s.showPriorityBadges&&l.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${Yf[e.priority]}`,children:Jf[e.priority]})]}),l.jsxs("div",{className:`flex items-start gap-2 ${c?"mb-1":"mb-2"}`,children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:i}),g&&l.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded shrink-0 ${g.className}`,title:g.title,children:g.label}),s.showPriorityBadges&&!(s.showFileName&&u)&&l.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${Yf[e.priority]}`,children:Jf[e.priority]})]}),c&&l.jsx("p",{className:`text-xs text-zinc-500 dark:text-zinc-400 ${s.compactMode?"line-clamp-1":"line-clamp-2"} mb-1.5`,children:HC(c)}),s.showLabels&&e.labels.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[(s.compactMode?e.labels.slice(0,2):e.labels.slice(0,4)).map(m=>{const v=o[m];return l.jsx("button",{type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),a(m)},className:`text-xs px-1.5 py-0.5 rounded ${v?"":"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300"}`,style:v?{backgroundColor:`${v.color}20`,color:v.color}:void 0,title:`Filter cards by label ${m}`,"aria-label":`Filter cards by label ${m}`,children:m},m)}),(s.compactMode?e.labels.length>2:e.labels.length>4)&&l.jsxs("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400 px-0.5 py-0.5 leading-tight",children:["+",e.labels.length-(s.compactMode?2:4)]})]})]}),l.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[l.jsx("div",{className:"flex items-center gap-1",children:s.showAssignee&&e.assignee&&e.assignee!=="null"&&l.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:e.assignee.split(/\s+/).map(m=>m[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:e.assignee})]})}),e.attachments.length>0&&l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[l.jsx(Gm,{size:12}),l.jsx("span",{children:e.attachments.length})]}),e.metadata&&Object.keys(e.metadata).length>0&&l.jsx("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:l.jsx("span",{className:"text-[10px] font-mono",children:`{${Object.keys(e.metadata).length}}`})}),s.showDueDate&&f&&l.jsxs("div",{className:`flex items-center gap-1 ${f.className}`,children:[l.jsx(Dc,{size:12}),l.jsx("span",{children:f.text})]}),h&&l.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(St,{size:12}),l.jsx("span",{children:h})]}),l.jsxs("div",{className:"flex items-center gap-1 text-zinc-500 dark:text-zinc-400",title:VC(e.created,e.modified),children:[l.jsx(Ll,{size:12}),l.jsx("span",{children:sa(e.modified)})]})]})]})}function qC({status:e,onAdd:t}){const{cardSettings:r}=q(),[n,s]=x.useState(!1),[o,a]=x.useState(""),i=x.useRef(null);x.useEffect(()=>{n&&i.current&&i.current.focus()},[n]);const c=()=>{const d=o.trim();if(d){const f=`# ${d}`;t({status:e,priority:r.defaultPriority,content:f}),a("")}s(!1)},u=d=>{d.key==="Enter"?(d.preventDefault(),c()):d.key==="Escape"&&(a(""),s(!1))};return n?l.jsx("input",{ref:i,type:"text",value:o,onChange:d=>a(d.target.value),onBlur:c,onKeyDown:u,placeholder:"Card title...",className:"kb-quick-add-input"}):l.jsxs("button",{onClick:()=>s(!0),className:"kb-quick-add-btn",children:[l.jsx(Zr,{size:13}),l.jsx("span",{children:"Add card"})]})}const YC=[{value:"order",label:"Board Order"},{value:"created:asc",label:"Created (oldest)"},{value:"created:desc",label:"Created (newest)"},{value:"modified:asc",label:"Modified (oldest)"},{value:"modified:desc",label:"Modified (newest)"}],JC="application/x-column-id",ZC="kanban-column:";function QC(e,t){var n,s,o;const r=Array.from(((n=e.dataTransfer)==null?void 0:n.types)??[]);if(r.includes(JC))return!0;if(r.includes("text/plain"))try{if((((o=(s=e.dataTransfer)==null?void 0:s.getData)==null?void 0:o.call(s,"text/plain"))??"").startsWith(ZC))return!0}catch{}return!!t}function Zf({column:e,columnIndex:t,cards:r,onCardClick:n,onAddCard:s,onEditColumn:o,onRemoveColumn:a,onCleanupColumn:i,onDragStart:c,onDragOver:u,onDragOverCard:d,onDrop:f,onDragEnd:p,draggedCard:h,dropTarget:g,draggedColumnId:m,dropColumnIndex:v,onColumnDragStart:y,onColumnDragOver:b,onColumnDrop:C,onColumnDragEnd:w,isMinimized:_=!1,onToggleMinimized:R,layout:z,isDeletedColumn:D,onPurgeColumn:j,selectedCardId:S,selectedCardIds:E,onSelectAll:P,sort:K,onSortChange:O,onQuickAdd:G,onTriggerAction:V}){const L=z==="vertical",U=M=>QC(M,m),oe=g&&g.columnId===e.id,Y=!D&&v===t&&m!==e.id,N=!D&&v===t+1&&m!==e.id,Z=m===e.id,I="0 1px 2px 0 rgb(0 0 0 / 0.05)",k=L?"border-t-2 border-blue-500":"border-l-2 border-blue-500",$=L?"border-b-2 border-blue-500":"border-r-2 border-blue-500",A={...Y?L?{borderTopColor:"#3b82f6"}:{borderLeftColor:"#3b82f6"}:{},...N?L?{borderBottomColor:"#3b82f6"}:{borderRightColor:"#3b82f6"}:{},...Y||N?{boxShadow:`${I}, ${L?Y?"0 -8px 18px -14px rgba(59,130,246,0.65)":"0 8px 18px -14px rgba(59,130,246,0.65)":Y?"-8px 0 18px -14px rgba(59,130,246,0.65)":"8px 0 18px -14px rgba(59,130,246,0.65)"}`}:{}},[W,H]=x.useState(!1),ee=x.useRef(null),re=x.useMemo(()=>E.filter(M=>r.some(J=>J.id===M)),[E,r]),le=re.length>0?r.filter(M=>re.includes(M.id)):r,pe=x.useMemo(()=>{const M={};for(const J of le){if(!J.actions)continue;const se=Array.isArray(J.actions)?J.actions.map(ue=>[ue,ue]):Object.entries(J.actions);for(const[ue,_e]of se)M[ue]||(M[ue]={label:_e,cardIds:[]}),M[ue].cardIds.push(J.id)}return Object.entries(M)},[le]);return x.useEffect(()=>{if(!W)return;const M=J=>{ee.current&&!ee.current.contains(J.target)&&H(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[W]),_&&!D?l.jsx("div",{style:A,className:[L?"flex items-center gap-2 bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm px-2 py-1.5":"flex-shrink-0 w-10 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Z?"opacity-40":"",Y?k:"",N?$:"",oe&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:M=>{U(M)?(M.preventDefault(),b(M,t)):u(M,e.id)},onDrop:M=>{U(M)?(M.stopPropagation(),C(M)):f(M,e.id)},children:l.jsxs("div",{className:L?"flex items-center gap-2 w-full cursor-grab active:cursor-grabbing":"flex flex-col items-center gap-1.5 px-1.5 py-1.5 cursor-grab active:cursor-grabbing h-full",draggable:!0,onDragStart:M=>y(M,e.id),onDragOver:M=>{U(M)&&(M.stopPropagation(),b(M,t))},onDrop:M=>{U(M)&&(M.stopPropagation(),C(M))},onDragEnd:w,children:[l.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),R()},className:"p-0.5 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors flex-shrink-0",title:`Expand ${e.name}`,children:l.jsx(Xx,{size:12,className:"text-zinc-500"})}),L?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 truncate",title:e.name,children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",children:r.length})]}):l.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-1 justify-start min-h-0 overflow-hidden",children:[l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 font-medium tabular-nums",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:r.length}),l.jsx("span",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100 tracking-wide",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},title:e.name,children:e.name}),l.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:e.color}})]})]})}):l.jsxs("div",{style:A,className:[L?"flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-50 dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 shadow-sm",Z?"opacity-40":"",Y?k:"",N?$:"",oe&&h?"ring-2 ring-blue-400 dark:ring-blue-500":""].filter(Boolean).join(" "),onDragOver:M=>{U(M)?(M.preventDefault(),b(M,t)):u(M,e.id)},onDrop:M=>{U(M)?(M.stopPropagation(),C(M)):f(M,e.id)},children:[l.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between w-full px-3 py-2.5 border-b border-zinc-200 dark:border-zinc-700 cursor-grab active:cursor-grabbing bg-zinc-50 dark:bg-zinc-800 rounded-t-xl",draggable:!D,onDragStart:M=>{D||y(M,e.id)},onDragOver:M=>{D||!U(M)||(M.stopPropagation(),b(M,t))},onDrop:M=>{U(M)&&(M.stopPropagation(),C(M))},onDragEnd:w,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),l.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:e.name}),l.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:r.length})]}),l.jsx("div",{className:"flex items-center gap-0.5",children:D?l.jsx("button",{type:"button",onClick:()=>{r.length!==0&&window.confirm(`Permanently delete all ${r.length} card${r.length===1?"":"s"} from disk?`)&&(j==null||j())},className:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Permanently delete all cards",children:l.jsx(Kt,{size:16,className:"text-red-500"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>s(e.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${e.name}`,children:l.jsx(Zr,{size:16,className:"text-zinc-500"})}),l.jsxs("div",{className:"relative",ref:ee,children:[l.jsx("button",{type:"button",onClick:()=>H(!W),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:l.jsx(e1,{size:16,className:"text-zinc-500"})}),W&&l.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[170px]",children:[l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Sort by"}),YC.map(M=>l.jsxs("button",{type:"button",onClick:()=>{O(M.value)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(St,{size:14,className:K===M.value?"text-blue-500":"invisible"}),M.label]},M.value)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),o(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Lc,{size:14}),"Edit List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),a(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Remove List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),i(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-orange-600 dark:text-orange-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(Kt,{size:14}),"Cleanup List"]}),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),R()},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(t1,{size:14}),"Minimize List"]}),l.jsxs("button",{type:"button",onClick:()=>{H(!1),P(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(r1,{size:14}),"Select All"]}),pe.length>0&&V&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),l.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Actions"}),pe.map(([M,{label:J,cardIds:se}])=>l.jsxs("button",{type:"button",onClick:()=>{H(!1),se.forEach(ue=>V(ue,M))},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(ma,{size:14,className:"text-amber-500 flex-shrink-0"}),l.jsx("span",{className:"flex-1 text-left truncate",children:J}),l.jsx("span",{className:"text-xs text-zinc-400 dark:text-zinc-500 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full flex-shrink-0",children:se.length})]},M))]})]})]})]})})]}),l.jsxs("div",{className:L?"flex-1 p-3 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-3 space-y-2 min-h-[200px]",children:[r.map((M,J)=>l.jsxs("div",{children:[oe&&g.index===J&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),l.jsx("div",{draggable:!0,"data-card-id":M.id,onDragStart:se=>c(se,M),onDragOver:se=>d(se,e.id,J),onDragEnd:p,className:`${L?"w-64":""} ${(h==null?void 0:h.id)===M.id?"opacity-40":""}`,children:l.jsx(GC,{card:M,onClick:se=>n(M,se),isSelected:E.includes(M.id)||M.id===S})})]},M.id)),oe&&g.index===r.length&&r.length>0&&l.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),r.length===0&&l.jsxs("div",{className:L?"flex items-center gap-2 py-4 px-1 text-zinc-400 dark:text-zinc-500":"flex flex-col items-center gap-1.5 py-8 text-zinc-400 dark:text-zinc-500",children:[l.jsx(n1,{size:L?14:20,className:"shrink-0 opacity-50"}),l.jsx("span",{className:L?"text-sm":"text-sm text-center",children:"No cards yet"}),!L&&l.jsx("span",{className:"text-[11px] text-center text-zinc-300 dark:text-zinc-600 max-w-[120px]",children:"Drag cards here or click + to add one"})]})]}),!D&&G&&l.jsx("div",{className:"px-2 pb-2",children:l.jsx(qC,{status:e.id,onAdd:G})})]})}const XC="application/x-column-id",e$="kanban-column:";function t$({onCardClick:e,onAddCard:t,onMoveCard:r,onMoveCards:n,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onPurgeDeletedCards:i,onReorderColumns:c,selectedCardId:u,selectedCardIds:d,onSelectAll:f,onQuickAdd:p,onTriggerAction:h}){const g=x.useRef(null),m=q(M=>M.cardSettings),v=q(M=>M.effectiveDrawerWidth),y=q(M=>M.columns),b=q(M=>M.currentBoard),C=q(M=>M.getFilteredCardsByStatus),w=q(M=>M.getCardsByStatus),_=q(M=>M.getHiddenColumnIds(b)),R=q(M=>M.getMinimizedColumnIds(b)),z=q(M=>M.toggleColumnMinimized),D=q(M=>M.layout),j=q(M=>M.columnSorts),S=q(M=>M.setColumnSort);x.useEffect(()=>{if(!u)return;const M=g.current;if(!M)return;const se=setTimeout(()=>{const ue=M.querySelector(`[data-card-id="${u}"]`);if(!ue)return;const _e=M.getBoundingClientRect(),we=ue.getBoundingClientRect();if(!(we.left>=_e.left&&we.right<=_e.right)){const Ce=we.right-_e.right;M.scrollBy({left:Ce+10,behavior:"smooth"})}ue.scrollIntoView({behavior:"smooth",block:"nearest"})},50);return()=>clearTimeout(se)},[m.panelMode,v,u]);const[E,P]=x.useState(null),[K,O]=x.useState(null),[G,V]=x.useState(null),L=x.useRef(null),[U,oe]=x.useState(null),Y=x.useCallback((M,J)=>{P(J),M.dataTransfer.effectAllowed="move",d.length>1&&d.includes(J.id)?M.dataTransfer.setData("text/plain",JSON.stringify(d)):M.dataTransfer.setData("text/plain",J.id)},[d]),N=x.useCallback((M,J)=>{M.preventDefault(),M.dataTransfer.dropEffect="move",!L.current&&J&&O(se=>(se==null?void 0:se.columnId)===J?se:{columnId:J,index:0})},[]),Z=x.useCallback((M,J,se)=>{if(M.preventDefault(),M.dataTransfer.dropEffect="move",L.current)return;const ue=M.currentTarget.getBoundingClientRect(),_e=ue.top+ue.height/2,we=M.clientY<_e?se:se+1;O(Ne=>Ne&&Ne.columnId===J&&Ne.index===we?Ne:{columnId:J,index:we})},[]),I=x.useCallback((M,J)=>{if(M.preventDefault(),!E)return;if(d.length>1&&d.includes(E.id)){n([...d],J),P(null),O(null);return}const se=C(J);let ue;if(K&&K.columnId===J?ue=K.index:ue=se.length,E.status===J){const Ce=se.findIndex(Ie=>Ie.id===E.id);if(Ce!==-1&&ue>Ce&&ue--,Ce===ue){P(null),O(null);return}}const _e=w(J).filter(Ce=>Ce.id!==E.id),we=se.filter(Ce=>Ce.id!==E.id);let Ne;if(we.length===0)Ne=_e.length;else if(ue>=we.length){const Ce=we[we.length-1];Ne=_e.findIndex(Ge=>Ge.id===Ce.id)+1}else{const Ce=we[ue];Ne=_e.findIndex(Ie=>Ie.id===Ce.id)}r(E.id,J,Ne),P(null),O(null)},[E,K,d,C,w,r,n]),k=x.useCallback(()=>{P(null),O(null)},[]),$=x.useCallback((M,J)=>{L.current=J,V(J),O(null),M.dataTransfer.effectAllowed="move",M.dataTransfer.setData(XC,J),M.dataTransfer.setData("text/plain",`${e$}${J}`)},[]),A=x.useCallback((M,J)=>{M.preventDefault(),M.dataTransfer.dropEffect="move";const se=M.currentTarget.getBoundingClientRect(),ue=D==="vertical"?M.clientY<se.top+se.height/2?J:J+1:M.clientX<se.left+se.width/2?J:J+1;oe(_e=>_e===ue?_e:ue)},[D]),W=x.useCallback(M=>{M.preventDefault();const J=L.current??G;if(!J||U===null){L.current=null,V(null),oe(null);return}const se=new Set(_),ue=y.map(Ie=>Ie.id),_e=ue.filter(Ie=>!se.has(Ie)),we=_e.indexOf(J);if(we===-1){L.current=null,V(null),oe(null);return}const Ne=[..._e];Ne.splice(we,1);const Ce=U>we?U-1:U;if(Ne.splice(Ce,0,J),Ne.join()!==_e.join()){let Ie=0;const Ge=ue.map(it=>se.has(it)?it:Ne[Ie++]);c(Ge)}L.current=null,V(null),oe(null)},[y,G,U,_,c]),H=x.useCallback(()=>{L.current=null,V(null),oe(null)},[]),ee=D==="vertical",re=new Set(_),le=new Set(R),pe=y.filter(M=>!re.has(M.id));return l.jsx("div",{ref:g,className:ee?"h-full overflow-y-auto px-5 py-4":"h-full overflow-x-auto px-5 py-4",children:l.jsxs("div",{className:ee?"flex flex-col gap-5":"flex gap-5 h-full min-w-max",children:[y.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-zinc-400 dark:text-zinc-500",children:[l.jsx(Fl,{size:40,className:"opacity-30"}),l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-500 dark:text-zinc-400",children:"No lists yet"}),l.jsx("p",{className:"text-[12px] mt-1 text-zinc-400 dark:text-zinc-500",children:'Click "Add List" in the toolbar to create your first column'})]})]}),pe.map((M,J)=>l.jsx(Zf,{column:M,columnIndex:J,cards:C(M.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:Y,onDragOver:N,onDragOverCard:Z,onDrop:I,onDragEnd:k,draggedCard:E,dropTarget:K,draggedColumnId:G,dropColumnIndex:U,onColumnDragStart:$,onColumnDragOver:A,onColumnDrop:W,onColumnDragEnd:H,isMinimized:le.has(M.id),onToggleMinimized:()=>z(b,M.id),layout:D,selectedCardId:u,selectedCardIds:d,onSelectAll:f,sort:j[M.id]||"order",onSortChange:se=>S(M.id,se),onQuickAdd:p,onTriggerAction:h},M.id)),m.showDeletedColumn&&l.jsx(Zf,{column:bs,columnIndex:y.length,cards:C(bs.id),onCardClick:e,onAddCard:t,onEditColumn:s,onRemoveColumn:o,onCleanupColumn:a,onDragStart:Y,onDragOver:N,onDragOverCard:Z,onDrop:I,onDragEnd:k,draggedCard:E,dropTarget:K,draggedColumnId:G,dropColumnIndex:U,onColumnDragStart:$,onColumnDragOver:A,onColumnDrop:W,onColumnDragEnd:H,layout:D,isDeletedColumn:!0,onPurgeColumn:i,selectedCardId:u,selectedCardIds:d,onSelectAll:f,sort:j[bs.id]||"order",onSortChange:M=>S(bs.id,M)},bs.id)]})})}const r$=["Mo","Tu","We","Th","Fr","Sa","Su"],n$=["January","February","March","April","May","June","July","August","September","October","November","December"];function s$({value:e,onChange:t,placeholder:r="Due date"}){const[n,s]=x.useState(!1),o=new Date,a=e?new Date(e+"T00:00:00"):null,[i,c]=x.useState((a==null?void 0:a.getFullYear())??o.getFullYear()),[u,d]=x.useState((a==null?void 0:a.getMonth())??o.getMonth()),f=new Date(i,u+1,0).getDate(),p=(new Date(i,u,1).getDay()+6)%7,h=Array(p).fill(null);for(let w=1;w<=f;w++)h.push(w);const g=()=>{u===0?(d(11),c(w=>w-1)):d(w=>w-1)},m=()=>{u===11?(d(0),c(w=>w+1)):d(w=>w+1)},v=w=>{const _=String(u+1).padStart(2,"0"),R=String(w).padStart(2,"0");t(`${i}-${_}-${R}`),s(!1)},y=w=>w===o.getDate()&&u===o.getMonth()&&i===o.getFullYear(),b=w=>a!==null&&w===a.getDate()&&u===a.getMonth()&&i===a.getFullYear(),C=w=>new Date(w+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>s(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:[l.jsx("span",{children:e?C(e):r}),e&&l.jsx("span",{role:"button",onClick:w=>{w.stopPropagation(),t(""),s(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:l.jsx(st,{size:12})})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("button",{type:"button",onClick:g,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(s1,{size:14})}),l.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[n$[u]," ",i]}),l.jsx("button",{type:"button",onClick:m,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:l.jsx(o1,{size:14})})]}),l.jsx("div",{className:"grid grid-cols-7 mb-1",children:r$.map(w=>l.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:w},w))}),l.jsx("div",{className:"grid grid-cols-7",children:h.map((w,_)=>l.jsx("div",{className:"flex items-center justify-center",children:w?l.jsx("button",{type:"button",onClick:()=>v(w),className:Ee("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:b(w)?"var(--vscode-focusBorder)":y(w)?"var(--vscode-editor-selectionBackground)":void 0,color:b(w)?"var(--vscode-editor-background)":(y(w),"var(--vscode-foreground)")},onMouseEnter:R=>{b(w)||(R.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:R=>{!b(w)&&!y(w)?R.currentTarget.style.background="transparent":y(w)&&!b(w)&&(R.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:w}):l.jsx("div",{className:"w-7 h-7"})},_))}),l.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("button",{type:"button",onClick:()=>{const w=String(o.getMonth()+1).padStart(2,"0"),_=String(o.getDate()).padStart(2,"0");t(`${o.getFullYear()}-${w}-${_}`),s(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:w=>w.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:w=>w.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}function tu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var an=tu();function o0(e){an=e}var Vr={exec:()=>null};function ke(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(ct.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var o$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ct={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},a$=/^(?:[ \t]*(?:\n|$))+/,i$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,l$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,c$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ru=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,a0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,i0=ke(a0).replace(/bull/g,ru).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),u$=ke(a0).replace(/bull/g,ru).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,d$=/^[^\n]+/,su=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,f$=ke(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",su).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),h$=ke(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ru).getRegex(),ui="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ou=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,p$=ke("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ou).replace("tag",ui).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),l0=ke(nu).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ui).getRegex(),m$=ke(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",l0).getRegex(),au={blockquote:m$,code:i$,def:f$,fences:l$,heading:c$,hr:ao,html:p$,lheading:i0,list:h$,newline:a$,paragraph:l0,table:Vr,text:d$},Qf=ke("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ui).getRegex(),g$={...au,lheading:u$,table:Qf,paragraph:ke(nu).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ui).getRegex()},v$={...au,html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ou).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Vr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ke(nu).replace("hr",ao).replace("heading",` *#{1,6} *[^
32
+ ]`).replace("lheading",i0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},y$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,b$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,c0=/^( {2,}|\\)\n(?!\s*$)/,x$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,di=/[\p{P}\p{S}]/u,iu=/[\s\p{P}\p{S}]/u,u0=/[^\s\p{P}\p{S}]/u,w$=ke(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,iu).getRegex(),d0=/(?!~)[\p{P}\p{S}]/u,k$=/(?!~)[\s\p{P}\p{S}]/u,_$=/(?:[^\s\p{P}\p{S}]|~)/u,f0=/(?![*_])[\p{P}\p{S}]/u,C$=/(?![*_])[\s\p{P}\p{S}]/u,$$=/(?:[^\s\p{P}\p{S}]|[*_])/u,S$=ke(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",o$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),h0=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,j$=ke(h0,"u").replace(/punct/g,di).getRegex(),E$=ke(h0,"u").replace(/punct/g,d0).getRegex(),p0="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",A$=ke(p0,"gu").replace(/notPunctSpace/g,u0).replace(/punctSpace/g,iu).replace(/punct/g,di).getRegex(),N$=ke(p0,"gu").replace(/notPunctSpace/g,_$).replace(/punctSpace/g,k$).replace(/punct/g,d0).getRegex(),P$=ke("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,u0).replace(/punctSpace/g,iu).replace(/punct/g,di).getRegex(),R$=ke(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,f0).getRegex(),T$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",I$=ke(T$,"gu").replace(/notPunctSpace/g,$$).replace(/punctSpace/g,C$).replace(/punct/g,f0).getRegex(),M$=ke(/\\(punct)/,"gu").replace(/punct/g,di).getRegex(),z$=ke(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),O$=ke(ou).replace("(?:-->|$)","-->").getRegex(),D$=ke("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",O$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Na=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,L$=ke(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Na).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),m0=ke(/^!?\[(label)\]\[(ref)\]/).replace("label",Na).replace("ref",su).getRegex(),g0=ke(/^!?\[(ref)\](?:\[\])?/).replace("ref",su).getRegex(),F$=ke("reflink|nolink(?!\\()","g").replace("reflink",m0).replace("nolink",g0).getRegex(),Xf=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,lu={_backpedal:Vr,anyPunctuation:M$,autolink:z$,blockSkip:S$,br:c0,code:b$,del:Vr,delLDelim:Vr,delRDelim:Vr,emStrongLDelim:j$,emStrongRDelimAst:A$,emStrongRDelimUnd:P$,escape:y$,link:L$,nolink:g0,punctuation:w$,reflink:m0,reflinkSearch:F$,tag:D$,text:x$,url:Vr},B$={...lu,link:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Na).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Na).getRegex()},ic={...lu,emStrongRDelimAst:N$,emStrongLDelim:E$,delLDelim:R$,delRDelim:I$,url:ke(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Xf).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ke(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Xf).getRegex()},U$={...ic,br:ke(c0).replace("{2,}","*").getRegex(),text:ke(ic.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Fo={normal:au,gfm:g$,pedantic:v$},_s={normal:lu,gfm:ic,breaks:U$,pedantic:B$},W$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},eh=e=>W$[e];function Lt(e,t){if(t){if(ct.escapeTest.test(e))return e.replace(ct.escapeReplace,eh)}else if(ct.escapeTestNoEncode.test(e))return e.replace(ct.escapeReplaceNoEncode,eh);return e}function th(e){try{e=encodeURI(e).replace(ct.percentDecode,"%")}catch{return null}return e}function rh(e,t){var o;let r=e.replace(ct.findPipe,(a,i,c)=>{let u=!1,d=i;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ct.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!((o=n.at(-1))!=null&&o.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(ct.slashPipe,"|");return n}function Cs(e,t,r){let n=e.length;if(n===0)return"";let s=0;for(;s<n&&e.charAt(n-s-1)===t;)s++;return e.slice(0,n-s)}function V$(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function K$(e,t=0){let r=t,n="";for(let s of e)if(s===" "){let o=4-r%4;n+=" ".repeat(o),r+=o}else n+=s,r++;return n}function nh(e,t,r,n,s){let o=t.href,a=t.title||null,i=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:a,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,c}function H$(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
33
33
  `).map(o=>{let a=o.match(r.other.beginningSpace);if(a===null)return o;let[i]=a;return i.length>=s.length?o.slice(s.length):o}).join(`
34
34
  `)}var Pa=class{constructor(e){Pe(this,"options");Pe(this,"rules");Pe(this,"lexer");this.options=e||an}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Cs(r,`
35
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=Q$(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=Cs(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Cs(t[0],`
35
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=H$(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=Cs(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Cs(t[0],`
36
36
  `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Cs(t[0],`
37
37
  `).split(`
38
38
  `),n="",s="",o=[];for(;r.length>0;){let a=!1,i=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))i.push(r[c]),a=!0;else if(!a)i.push(r[c]);else break;r=r.slice(c);let u=i.join(`
@@ -44,16 +44,16 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
44
44
  `),m=this.blockquote(g);o[o.length-1]=m,n=n.substring(0,n.length-h.raw.length)+m.raw,s=s.substring(0,s.length-h.text.length)+m.text;break}else if((p==null?void 0:p.type)==="list"){let h=p,g=h.raw+`
45
45
  `+r.join(`
46
46
  `),m=this.list(g);o[o.length-1]=m,n=n.substring(0,n.length-p.raw.length)+m.raw,s=s.substring(0,s.length-h.raw.length)+m.raw,r=g.substring(o.at(-1).raw.length).split(`
47
- `);continue}}return{type:"blockquote",raw:n,tokens:o,text:s}}}list(e){var r,n;let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),o=s.length>1,a={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");let i=this.rules.other.listItemRegex(s),c=!1;for(;e;){let d=!1,f="",p="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let h=Z$(t[2].split(`
47
+ `);continue}}return{type:"blockquote",raw:n,tokens:o,text:s}}}list(e){var r,n;let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),o=s.length>1,a={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");let i=this.rules.other.listItemRegex(s),c=!1;for(;e;){let d=!1,f="",p="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let h=K$(t[2].split(`
48
48
  `,1)[0],t[1].length),g=e.split(`
49
49
  `,1)[0],m=!h.trim(),v=0;if(this.options.pedantic?(v=2,p=h.trimStart()):m?v=t[1].length+1:(v=h.search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=h.slice(v),v+=t[1].length),m&&this.rules.other.blankLine.test(g)&&(f+=g+`
50
50
  `,e=e.substring(g.length+1),d=!0),!d){let y=this.rules.other.nextBulletRegex(v),b=this.rules.other.hrRegex(v),C=this.rules.other.fencesBeginRegex(v),w=this.rules.other.headingBeginRegex(v),_=this.rules.other.htmlBeginRegex(v),R=this.rules.other.blockquoteBeginRegex(v);for(;e;){let z=e.split(`
51
51
  `,1)[0],D;if(g=z,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),D=g):D=g.replace(this.rules.other.tabCharGlobal," "),C.test(g)||w.test(g)||_.test(g)||R.test(g)||y.test(g)||b.test(g))break;if(D.search(this.rules.other.nonSpaceChar)>=v||!g.trim())p+=`
52
52
  `+D.slice(v);else{if(m||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(h)||w.test(h)||b.test(h))break;p+=`
53
53
  `+g}m=!g.trim(),f+=z+`
54
- `,e=e.substring(z.length+1),h=D.slice(v)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),a.raw+=f}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((r=d.tokens[0])==null?void 0:r.type)==="text"||((n=d.tokens[0])==null?void 0:n.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!a.loose){let f=d.tokens.filter(h=>h.type==="space"),p=f.length>0&&f.some(h=>this.rules.other.anyLine.test(h.raw));a.loose=p}}if(a.loose)for(let d of a.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){var a;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=oh(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
55
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<r.length;i++)o.header.push({text:r[i],tokens:this.lexer.inline(r[i]),header:!0,align:o.align[i]});for(let i of s)o.rows.push(oh(i,o.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[u]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
56
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Cs(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=J$(t[2],"()");if(o===-2)return;if(o>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),ah(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return ah(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,o,a,i=s,c=0,u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+s);(n=u.exec(t))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(a=[...o].length,n[3]||n[4]){i+=a;continue}else if((n[5]||n[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(i-=a,i>0)continue;a=Math.min(a,a+i+c);let d=[...n[0]][0].length,f=e.slice(0,s+n.index+d+a);if(Math.min(s,a)%2){let h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,o,a,i=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(n=c.exec(t))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o||(a=[...o].length,a!==s))continue;if(n[3]||n[4]){i+=a;continue}if(i-=a,i>0)continue;a=Math.min(a,a+i);let u=[...n[0]][0].length,d=e.slice(0,s+n.index+u+a),f=d.slice(s,-s);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let o;do o=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(o!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},Pt=class dc{constructor(t){Pe(this,"tokens");Pe(this,"options");Pe(this,"state");Pe(this,"inlineQueue");Pe(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||an,this.options.tokenizer=this.options.tokenizer||new Pa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ct,block:Fo.normal,inline:_s.normal};this.options.pedantic?(r.block=Fo.pedantic,r.inline=_s.pedantic):this.options.gfm&&(r.block=Fo.gfm,this.options.breaks?r.inline=_s.breaks:r.inline=_s.gfm),this.tokenizer.rules=r}static get rules(){return{block:Fo,inline:_s}}static lex(t,r){return new dc(r).lex(t)}static lexInline(t,r){return new dc(r).inlineTokens(t)}lex(t){t=t.replace(ct.carriageReturn,`
54
+ `,e=e.substring(z.length+1),h=D.slice(v)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),a.raw+=f}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((r=d.tokens[0])==null?void 0:r.type)==="text"||((n=d.tokens[0])==null?void 0:n.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!a.loose){let f=d.tokens.filter(h=>h.type==="space"),p=f.length>0&&f.some(h=>this.rules.other.anyLine.test(h.raw));a.loose=p}}if(a.loose)for(let d of a.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){var a;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=rh(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
55
+ `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<r.length;i++)o.header.push({text:r[i],tokens:this.lexer.inline(r[i]),header:!0,align:o.align[i]});for(let i of s)o.rows.push(rh(i,o.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[u]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
56
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Cs(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=V$(t[2],"()");if(o===-2)return;if(o>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),nh(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return nh(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,o,a,i=s,c=0,u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+s);(n=u.exec(t))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(a=[...o].length,n[3]||n[4]){i+=a;continue}else if((n[5]||n[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(i-=a,i>0)continue;a=Math.min(a,a+i+c);let d=[...n[0]][0].length,f=e.slice(0,s+n.index+d+a);if(Math.min(s,a)%2){let h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,o,a,i=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(n=c.exec(t))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o||(a=[...o].length,a!==s))continue;if(n[3]||n[4]){i+=a;continue}if(i-=a,i>0)continue;a=Math.min(a,a+i);let u=[...n[0]][0].length,d=e.slice(0,s+n.index+u+a),f=d.slice(s,-s);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let o;do o=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(o!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},Pt=class lc{constructor(t){Pe(this,"tokens");Pe(this,"options");Pe(this,"state");Pe(this,"inlineQueue");Pe(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||an,this.options.tokenizer=this.options.tokenizer||new Pa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ct,block:Fo.normal,inline:_s.normal};this.options.pedantic?(r.block=Fo.pedantic,r.inline=_s.pedantic):this.options.gfm&&(r.block=Fo.gfm,this.options.breaks?r.inline=_s.breaks:r.inline=_s.gfm),this.tokenizer.rules=r}static get rules(){return{block:Fo,inline:_s}}static lex(t,r){return new lc(r).lex(t)}static lexInline(t,r){return new lc(r).inlineTokens(t)}lex(t){t=t.replace(ct.carriageReturn,`
57
57
  `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var s,o,a;for(this.options.pedantic&&(t=t.replace(ct.tabCharGlobal," ").replace(ct.spaceLine,""));t;){let i;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(u=>(i=u.call({lexer:this},t,r))?(t=t.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let u=r.at(-1);i.raw.length===1&&u!==void 0?u.raw+=`
58
58
  `:r.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
59
59
  `)?"":`
@@ -85,8 +85,8 @@ ${this.parser.parse(e)}</blockquote>
85
85
  `}tablerow({text:e}){return`<tr>
86
86
  ${e}</tr>
87
87
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
88
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Lt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=sh(e);if(s===null)return n;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+Lt(t)+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=sh(e);if(s===null)return Lt(r);e=s;let o=`<img src="${e}" alt="${Lt(r)}"`;return t&&(o+=` title="${Lt(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Lt(e.text)}},fu=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Rt=class fc{constructor(t){Pe(this,"options");Pe(this,"renderer");Pe(this,"textRenderer");this.options=t||an,this.options.renderer=this.options.renderer||new Ra,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new fu}static parse(t,r){return new fc(r).parse(t)}static parseInline(t,r){return new fc(r).parseInline(t)}parse(t){var n,s;let r="";for(let o=0;o<t.length;o++){let a=t[o];if((s=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&s[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){r+=u||"";continue}}let i=a;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let c='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(t,r=this.renderer){var s,o;let n="";for(let a=0;a<t.length;a++){let i=t[a];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[i.type]){let u=this.options.extensions.renderers[i.type].call({parser:this},i);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=u||"";continue}}let c=i;switch(c.type){case"escape":{n+=r.text(c);break}case"html":{n+=r.html(c);break}case"link":{n+=r.link(c);break}case"image":{n+=r.image(c);break}case"checkbox":{n+=r.checkbox(c);break}case"strong":{n+=r.strong(c);break}case"em":{n+=r.em(c);break}case"codespan":{n+=r.codespan(c);break}case"br":{n+=r.br(c);break}case"del":{n+=r.del(c);break}case"text":{n+=r.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},Xo,Ts=(Xo=class{constructor(e){Pe(this,"options");Pe(this,"block");this.options=e||an}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Pt.lex:Pt.lexInline}provideParser(){return this.block?Rt.parse:Rt.parseInline}},Pe(Xo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Pe(Xo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Xo),_0=class{constructor(...e){Pe(this,"defaults",su());Pe(this,"options",this.setOptions);Pe(this,"parse",this.parseMarkdown(!0));Pe(this,"parseInline",this.parseMarkdown(!1));Pe(this,"Parser",Rt);Pe(this,"Renderer",Ra);Pe(this,"TextRenderer",fu);Pe(this,"Lexer",Pt);Pe(this,"Tokenizer",Pa);Pe(this,"Hooks",Ts);this.use(...e)}walkTokens(e,t){var n,s;let r=[];for(let o of e)switch(r=r.concat(t.call(this,o)),o.type){case"table":{let a=o;for(let i of a.header)r=r.concat(this.walkTokens(i.tokens,t));for(let i of a.rows)for(let c of i)r=r.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=o;r=r.concat(this.walkTokens(a.items,t));break}default:{let a=o;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(i=>{let c=a[i].flat(1/0);r=r.concat(this.walkTokens(c,t))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let i=s.renderer.apply(this,a);return i===!1&&(i=o.apply(this,a)),i}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){let s=this.defaults.renderer||new Ra(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,i=r.renderer[a],c=s[a];s[a]=(...u)=>{let d=i.apply(s,u);return d===!1&&(d=c.apply(s,u)),d||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new Pa(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,i=r.tokenizer[a],c=s[a];s[a]=(...u)=>{let d=i.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new Ts;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,i=r.hooks[a],c=s[a];Ts.passThroughHooks.has(o)?s[a]=u=>{if(this.defaults.async&&Ts.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await i.call(s,u);return c.call(s,f)})();let d=i.call(s,u);return c.call(s,d)}:s[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await i.apply(s,u);return f===!1&&(f=await c.apply(s,u)),f})();let d=i.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;n.walkTokens=function(a){let i=[];return i.push(o.call(this,a)),s&&(i=i.concat(s.call(this,a))),i}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Pt.lex(e,t??this.defaults)}parser(e,t){return Rt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},s={...this.defaults,...n},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(t):t,i=await(s.hooks?await s.hooks.provideLexer():e?Pt.lex:Pt.lexInline)(a,s),c=s.hooks?await s.hooks.processAllTokens(i):i;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser():e?Rt.parse:Rt.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(o);try{s.hooks&&(t=s.hooks.preprocess(t));let a=(s.hooks?s.hooks.provideLexer():e?Pt.lex:Pt.lexInline)(t,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let i=(s.hooks?s.hooks.provideParser():e?Rt.parse:Rt.parseInline)(a,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(a){return o(a)}}}onError(e,t){return r=>{if(r.message+=`
89
- Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+Lt(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},nn=new _0;function Ae(e,t){return nn.parse(e,t)}Ae.options=Ae.setOptions=function(e){return nn.setOptions(e),Ae.defaults=nn.defaults,d0(Ae.defaults),Ae};Ae.getDefaults=su;Ae.defaults=an;Ae.use=function(...e){return nn.use(...e),Ae.defaults=nn.defaults,d0(Ae.defaults),Ae};Ae.walkTokens=function(e,t){return nn.walkTokens(e,t)};Ae.parseInline=nn.parseInline;Ae.Parser=Rt;Ae.parser=Rt.parse;Ae.Renderer=Ra;Ae.TextRenderer=fu;Ae.Lexer=Pt;Ae.lexer=Pt.lex;Ae.Tokenizer=Pa;Ae.Hooks=Ts;Ae.parse=Ae;Ae.options;Ae.setOptions;Ae.use;Ae.walkTokens;Ae.parseInline;Rt.parse;Pt.lex;function C0(e,t,r,n){const s=e.selectionStart,o=e.selectionEnd,a=t.substring(s,o);let i=t.substring(0,s);const c=t.substring(o);let u=a,d=0;switch(n){case"heading":{const p=t.lastIndexOf(`
88
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Lt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=th(e);if(s===null)return n;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+Lt(t)+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=th(e);if(s===null)return Lt(r);e=s;let o=`<img src="${e}" alt="${Lt(r)}"`;return t&&(o+=` title="${Lt(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Lt(e.text)}},cu=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Rt=class cc{constructor(t){Pe(this,"options");Pe(this,"renderer");Pe(this,"textRenderer");this.options=t||an,this.options.renderer=this.options.renderer||new Ra,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cu}static parse(t,r){return new cc(r).parse(t)}static parseInline(t,r){return new cc(r).parseInline(t)}parse(t){var n,s;let r="";for(let o=0;o<t.length;o++){let a=t[o];if((s=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&s[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){r+=u||"";continue}}let i=a;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let c='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(t,r=this.renderer){var s,o;let n="";for(let a=0;a<t.length;a++){let i=t[a];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[i.type]){let u=this.options.extensions.renderers[i.type].call({parser:this},i);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=u||"";continue}}let c=i;switch(c.type){case"escape":{n+=r.text(c);break}case"html":{n+=r.html(c);break}case"link":{n+=r.link(c);break}case"image":{n+=r.image(c);break}case"checkbox":{n+=r.checkbox(c);break}case"strong":{n+=r.strong(c);break}case"em":{n+=r.em(c);break}case"codespan":{n+=r.codespan(c);break}case"br":{n+=r.br(c);break}case"del":{n+=r.del(c);break}case"text":{n+=r.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},Xo,Ts=(Xo=class{constructor(e){Pe(this,"options");Pe(this,"block");this.options=e||an}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Pt.lex:Pt.lexInline}provideParser(){return this.block?Rt.parse:Rt.parseInline}},Pe(Xo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Pe(Xo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Xo),v0=class{constructor(...e){Pe(this,"defaults",tu());Pe(this,"options",this.setOptions);Pe(this,"parse",this.parseMarkdown(!0));Pe(this,"parseInline",this.parseMarkdown(!1));Pe(this,"Parser",Rt);Pe(this,"Renderer",Ra);Pe(this,"TextRenderer",cu);Pe(this,"Lexer",Pt);Pe(this,"Tokenizer",Pa);Pe(this,"Hooks",Ts);this.use(...e)}walkTokens(e,t){var n,s;let r=[];for(let o of e)switch(r=r.concat(t.call(this,o)),o.type){case"table":{let a=o;for(let i of a.header)r=r.concat(this.walkTokens(i.tokens,t));for(let i of a.rows)for(let c of i)r=r.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=o;r=r.concat(this.walkTokens(a.items,t));break}default:{let a=o;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(i=>{let c=a[i].flat(1/0);r=r.concat(this.walkTokens(c,t))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let i=s.renderer.apply(this,a);return i===!1&&(i=o.apply(this,a)),i}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){let s=this.defaults.renderer||new Ra(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,i=r.renderer[a],c=s[a];s[a]=(...u)=>{let d=i.apply(s,u);return d===!1&&(d=c.apply(s,u)),d||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new Pa(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,i=r.tokenizer[a],c=s[a];s[a]=(...u)=>{let d=i.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new Ts;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,i=r.hooks[a],c=s[a];Ts.passThroughHooks.has(o)?s[a]=u=>{if(this.defaults.async&&Ts.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await i.call(s,u);return c.call(s,f)})();let d=i.call(s,u);return c.call(s,d)}:s[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await i.apply(s,u);return f===!1&&(f=await c.apply(s,u)),f})();let d=i.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;n.walkTokens=function(a){let i=[];return i.push(o.call(this,a)),s&&(i=i.concat(s.call(this,a))),i}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Pt.lex(e,t??this.defaults)}parser(e,t){return Rt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},s={...this.defaults,...n},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(t):t,i=await(s.hooks?await s.hooks.provideLexer():e?Pt.lex:Pt.lexInline)(a,s),c=s.hooks?await s.hooks.processAllTokens(i):i;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser():e?Rt.parse:Rt.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(o);try{s.hooks&&(t=s.hooks.preprocess(t));let a=(s.hooks?s.hooks.provideLexer():e?Pt.lex:Pt.lexInline)(t,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let i=(s.hooks?s.hooks.provideParser():e?Rt.parse:Rt.parseInline)(a,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(a){return o(a)}}}onError(e,t){return r=>{if(r.message+=`
89
+ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+Lt(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},nn=new v0;function Ae(e,t){return nn.parse(e,t)}Ae.options=Ae.setOptions=function(e){return nn.setOptions(e),Ae.defaults=nn.defaults,o0(Ae.defaults),Ae};Ae.getDefaults=tu;Ae.defaults=an;Ae.use=function(...e){return nn.use(...e),Ae.defaults=nn.defaults,o0(Ae.defaults),Ae};Ae.walkTokens=function(e,t){return nn.walkTokens(e,t)};Ae.parseInline=nn.parseInline;Ae.Parser=Rt;Ae.parser=Rt.parse;Ae.Renderer=Ra;Ae.TextRenderer=cu;Ae.Lexer=Pt;Ae.lexer=Pt.lex;Ae.Tokenizer=Pa;Ae.Hooks=Ts;Ae.parse=Ae;Ae.options;Ae.setOptions;Ae.use;Ae.walkTokens;Ae.parseInline;Rt.parse;Pt.lex;function y0(e,t,r,n){const s=e.selectionStart,o=e.selectionEnd,a=t.substring(s,o);let i=t.substring(0,s);const c=t.substring(o);let u=a,d=0;switch(n){case"heading":{const p=t.lastIndexOf(`
90
90
  `,s-1)+1,h=t.substring(p,s);h.startsWith("### ")?(i=t.substring(0,p)+h.slice(4),u=a,d=-4):h.startsWith("## ")?(i=t.substring(0,p)+"### "+h.slice(3),u=a,d=1):h.startsWith("# ")?(i=t.substring(0,p)+"## "+h.slice(2),u=a,d=1):(i=t.substring(0,p)+"# "+h,u=a,d=2);break}case"bold":u=a?`**${a}**`:"**bold**",d=a?4:2;break;case"italic":u=a?`_${a}_`:"_italic_",d=a?2:1;break;case"quote":{u=a?a.split(`
91
91
  `).map(h=>`> ${h}`).join(`
92
92
  `):"> ",d=a?u.length-a.length:2;break}case"code":a.includes(`
@@ -98,36 +98,36 @@ ${a}
98
98
  `).map((h,g)=>`${g+1}. ${h}`).join(`
99
99
  `):"1. ",d=a?u.length-a.length:3;break}case"tasklist":{u=a?a.split(`
100
100
  `).map(h=>`- [ ] ${h}`).join(`
101
- `):"- [ ] ",d=a?u.length-a.length:6;break}}const f=i+u+c;r(f),requestAnimationFrame(()=>{e.focus();const p=s+(a?u.length:d);e.selectionStart=e.selectionEnd=p})}function rt({icon:e,title:t,onClick:r,separator:n}){return l.jsxs(l.Fragment,{children:[n&&l.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),l.jsx("button",{type:"button",onClick:r,title:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:e})]})}const X$=new _0({gfm:!0,breaks:!0,renderer:{link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),s=t?` title="${t}"`:"";return`<a href="${e}"${s} target="_blank" rel="noopener noreferrer">${n}</a>`}}});function hu(e){const t=e.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return X$.parse(t,{async:!1})}const ih="kanban-comment-author";function lh({initialContent:e="",onSubmit:t,onCancel:r,submitLabel:n="Comment"}){const[s,o]=x.useState(()=>localStorage.getItem(ih)??""),[a,i]=x.useState(e),[c,u]=x.useState("write"),d=x.useRef(null),f=x.useRef(!0);x.useEffect(()=>{var y;if(f.current){f.current=!1;return}c==="write"&&((y=d.current)==null||y.focus())},[c]);const p=x.useMemo(()=>a.trim()?hu(a):"",[a]),h=x.useCallback(y=>{d.current&&C0(d.current,a,i,y)},[a]),g=()=>{const y=s.trim(),b=a.trim();!y||!b||(localStorage.setItem(ih,y),t(y,b),e||(i(""),u("write")))},m=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),g()),(y.metaKey||y.ctrlKey)&&y.key==="b"&&(y.preventDefault(),h("bold")),(y.metaKey||y.ctrlKey)&&y.key==="i"&&(y.preventDefault(),h("italic")),(y.metaKey||y.ctrlKey)&&y.key==="k"&&(y.preventDefault(),h("link"))},v=s.trim().length>0&&a.trim().length>0;return l.jsxs("div",{className:"comment-editor-shell",children:[l.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:"Your name","aria-label":"Comment author name",className:"comment-editor-author outline-none",style:{color:"var(--vscode-foreground)"}}),l.jsxs("div",{className:"comment-editor-frame",children:[l.jsx("div",{className:"comment-editor-tabs",children:["write","preview"].map(y=>l.jsx("button",{type:"button",onClick:()=>u(y),className:`comment-editor-tab${c===y?" is-active":""}`,children:y},y))}),c==="write"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"comment-editor-toolbar",children:[l.jsx(rt,{icon:l.jsx(eg,{size:12}),title:"Bold (Cmd+B)",onClick:()=>h("bold")}),l.jsx(rt,{icon:l.jsx(tg,{size:12}),title:"Italic (Cmd+I)",onClick:()=>h("italic")}),l.jsx(rt,{icon:l.jsx(rg,{size:12}),title:"Quote",onClick:()=>h("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(ng,{size:12}),title:"Code",onClick:()=>h("code")}),l.jsx(rt,{icon:l.jsx(sg,{size:12}),title:"Link (Cmd+K)",onClick:()=>h("link"),separator:!0}),l.jsx(rt,{icon:l.jsx(og,{size:12}),title:"Unordered list",onClick:()=>h("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(ag,{size:12}),title:"Ordered list",onClick:()=>h("ol")})]}),l.jsx("textarea",{ref:d,value:a,onChange:y=>i(y.target.value),onKeyDown:m,placeholder:"Add a comment... (Markdown supported)",className:"comment-editor-textarea text-xs outline-none",style:{color:"var(--vscode-foreground)"},rows:5})]}):p?l.jsx("div",{className:"comment-editor-preview text-xs comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:p}}):l.jsx("div",{className:"comment-editor-empty text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})]}),l.jsxs("div",{className:"comment-editor-actions",children:[r&&l.jsx("button",{type:"button",onClick:r,className:"px-2.5 py-1 text-xs rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:g,disabled:!v,className:"card-inline-action card-inline-action--solid disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:`${n} (Cmd+Enter)`,children:n})]})]})}function eS({content:e}){const t=x.useMemo(()=>hu(e),[e]);return l.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:t}})}function tS(e){const t=Date.now(),r=new Date(e).getTime(),n=Math.floor((t-r)/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const o=Math.floor(s/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);return a<30?`${a}d ago`:new Date(e).toLocaleDateString()}function rS({comments:e,onAddComment:t,onUpdateComment:r,onDeleteComment:n}){const[s,o]=x.useState(null);return l.jsxs("div",{className:"card-comments-shell",children:[e.length>0&&l.jsx("div",{className:"card-comment-list",children:e.map(a=>l.jsxs("div",{className:"card-comment-item",children:[l.jsx("span",{className:"card-comment-avatar",children:a.author.split(/\s+/).filter(Boolean).map(i=>i[0]).join("").toUpperCase().slice(0,2)}),l.jsxs("div",{className:"card-comment-bubble",children:[l.jsxs("div",{className:"card-comment-meta",children:[l.jsx("span",{className:"card-comment-author",children:a.author}),l.jsx("span",{className:"card-comment-time",children:tS(a.created)}),l.jsxs("div",{className:"card-comment-actions",children:[l.jsx("button",{onClick:()=>o(a.id),className:"p-1 rounded-full transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:l.jsx(Uc,{size:11})}),l.jsx("button",{onClick:()=>n(a.id),className:"p-1 rounded-full transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:l.jsx(Kt,{size:11})})]})]}),s===a.id?l.jsx("div",{className:"mt-1",children:l.jsx(lh,{initialContent:a.content,submitLabel:"Save",onSubmit:(i,c)=>{r(a.id,c),o(null)},onCancel:()=>o(null)})}):l.jsx(eS,{content:a.content})]})]},a.id))}),l.jsx("div",{className:"card-comments-composer",children:l.jsx(lh,{onSubmit:(a,i)=>t(a,i),submitLabel:"Comment"})})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function $0(e){return typeof e>"u"||e===null}function nS(e){return typeof e=="object"&&e!==null}function sS(e){return Array.isArray(e)?e:$0(e)?[]:[e]}function oS(e,t){var r,n,s,o;if(t)for(o=Object.keys(t),r=0,n=o.length;r<n;r+=1)s=o[r],e[s]=t[s];return e}function aS(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function iS(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var lS=$0,cS=nS,uS=sS,dS=aS,fS=iS,hS=oS,ln={isNothing:lS,isObject:cS,toArray:uS,repeat:dS,isNegativeZero:fS,extend:hS};function S0(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
101
+ `):"- [ ] ",d=a?u.length-a.length:6;break}}const f=i+u+c;r(f),requestAnimationFrame(()=>{e.focus();const p=s+(a?u.length:d);e.selectionStart=e.selectionEnd=p})}function rt({icon:e,title:t,onClick:r,separator:n}){return l.jsxs(l.Fragment,{children:[n&&l.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),l.jsx("button",{type:"button",onClick:r,title:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:e})]})}const G$=new v0({gfm:!0,breaks:!0,renderer:{link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),s=t?` title="${t}"`:"";return`<a href="${e}"${s} target="_blank" rel="noopener noreferrer">${n}</a>`}}});function uu(e){const t=e.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return G$.parse(t,{async:!1})}const sh="kanban-comment-author";function oh({initialContent:e="",onSubmit:t,onCancel:r,submitLabel:n="Comment"}){const[s,o]=x.useState(()=>localStorage.getItem(sh)??""),[a,i]=x.useState(e),[c,u]=x.useState("write"),d=x.useRef(null),f=x.useRef(!0);x.useEffect(()=>{var y;if(f.current){f.current=!1;return}c==="write"&&((y=d.current)==null||y.focus())},[c]);const p=x.useMemo(()=>a.trim()?uu(a):"",[a]),h=x.useCallback(y=>{d.current&&y0(d.current,a,i,y)},[a]),g=()=>{const y=s.trim(),b=a.trim();!y||!b||(localStorage.setItem(sh,y),t(y,b),e||(i(""),u("write")))},m=y=>{y.key==="Enter"&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),g()),(y.metaKey||y.ctrlKey)&&y.key==="b"&&(y.preventDefault(),h("bold")),(y.metaKey||y.ctrlKey)&&y.key==="i"&&(y.preventDefault(),h("italic")),(y.metaKey||y.ctrlKey)&&y.key==="k"&&(y.preventDefault(),h("link"))},v=s.trim().length>0&&a.trim().length>0;return l.jsxs("div",{className:"comment-editor-shell",children:[l.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:"Your name","aria-label":"Comment author name",className:"comment-editor-author outline-none",style:{color:"var(--vscode-foreground)"}}),l.jsxs("div",{className:"comment-editor-frame",children:[l.jsx("div",{className:"comment-editor-tabs",children:["write","preview"].map(y=>l.jsx("button",{type:"button",onClick:()=>u(y),className:`comment-editor-tab${c===y?" is-active":""}`,children:y},y))}),c==="write"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"comment-editor-toolbar",children:[l.jsx(rt,{icon:l.jsx(qm,{size:12}),title:"Bold (Cmd+B)",onClick:()=>h("bold")}),l.jsx(rt,{icon:l.jsx(Ym,{size:12}),title:"Italic (Cmd+I)",onClick:()=>h("italic")}),l.jsx(rt,{icon:l.jsx(Jm,{size:12}),title:"Quote",onClick:()=>h("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(Zm,{size:12}),title:"Code",onClick:()=>h("code")}),l.jsx(rt,{icon:l.jsx(Qm,{size:12}),title:"Link (Cmd+K)",onClick:()=>h("link"),separator:!0}),l.jsx(rt,{icon:l.jsx(Xm,{size:12}),title:"Unordered list",onClick:()=>h("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(eg,{size:12}),title:"Ordered list",onClick:()=>h("ol")})]}),l.jsx("textarea",{ref:d,value:a,onChange:y=>i(y.target.value),onKeyDown:m,placeholder:"Add a comment... (Markdown supported)",className:"comment-editor-textarea text-xs outline-none",style:{color:"var(--vscode-foreground)"},rows:5})]}):p?l.jsx("div",{className:"comment-editor-preview text-xs comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:p}}):l.jsx("div",{className:"comment-editor-empty text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})]}),l.jsxs("div",{className:"comment-editor-actions",children:[r&&l.jsx("button",{type:"button",onClick:r,className:"px-2.5 py-1 text-xs rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:g,disabled:!v,className:"card-inline-action card-inline-action--solid disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:`${n} (Cmd+Enter)`,children:n})]})]})}function q$({content:e}){const t=x.useMemo(()=>uu(e),[e]);return l.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:t}})}function Y$(e){const t=Date.now(),r=new Date(e).getTime(),n=Math.floor((t-r)/1e3);if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const o=Math.floor(s/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);return a<30?`${a}d ago`:new Date(e).toLocaleDateString()}function J$({comments:e,onAddComment:t,onUpdateComment:r,onDeleteComment:n}){const[s,o]=x.useState(null);return l.jsxs("div",{className:"card-comments-shell",children:[e.length>0&&l.jsx("div",{className:"card-comment-list",children:e.map(a=>l.jsxs("div",{className:"card-comment-item",children:[l.jsx("span",{className:"card-comment-avatar",children:a.author.split(/\s+/).filter(Boolean).map(i=>i[0]).join("").toUpperCase().slice(0,2)}),l.jsxs("div",{className:"card-comment-bubble",children:[l.jsxs("div",{className:"card-comment-meta",children:[l.jsx("span",{className:"card-comment-author",children:a.author}),l.jsx("span",{className:"card-comment-time",children:Y$(a.created)}),l.jsxs("div",{className:"card-comment-actions",children:[l.jsx("button",{onClick:()=>o(a.id),className:"p-1 rounded-full transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:l.jsx(Lc,{size:11})}),l.jsx("button",{onClick:()=>n(a.id),className:"p-1 rounded-full transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:l.jsx(Kt,{size:11})})]})]}),s===a.id?l.jsx("div",{className:"mt-1",children:l.jsx(oh,{initialContent:a.content,submitLabel:"Save",onSubmit:(i,c)=>{r(a.id,c),o(null)},onCancel:()=>o(null)})}):l.jsx(q$,{content:a.content})]})]},a.id))}),l.jsx("div",{className:"card-comments-composer",children:l.jsx(oh,{onSubmit:(a,i)=>t(a,i),submitLabel:"Comment"})})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function b0(e){return typeof e>"u"||e===null}function Z$(e){return typeof e=="object"&&e!==null}function Q$(e){return Array.isArray(e)?e:b0(e)?[]:[e]}function X$(e,t){var r,n,s,o;if(t)for(o=Object.keys(t),r=0,n=o.length;r<n;r+=1)s=o[r],e[s]=t[s];return e}function eS(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function tS(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var rS=b0,nS=Z$,sS=Q$,oS=eS,aS=tS,iS=X$,ln={isNothing:rS,isObject:nS,toArray:sS,repeat:oS,isNegativeZero:aS,extend:iS};function x0(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
102
102
 
103
- `+e.mark.snippet),n+" "+r):n}function eo(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=S0(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}eo.prototype=Object.create(Error.prototype);eo.prototype.constructor=eo;eo.prototype.toString=function(t){return this.name+": "+S0(this,t)};var Ct=eo,pS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],mS=["scalar","sequence","mapping"];function gS(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function vS(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(pS.indexOf(r)===-1)throw new Ct('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=gS(t.styleAliases||null),mS.indexOf(this.kind)===-1)throw new Ct('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ot=vS;function ch(e,t){var r=[];return e[t].forEach(function(n){var s=r.length;r.forEach(function(o,a){o.tag===n.tag&&o.kind===n.kind&&o.multi===n.multi&&(s=a)}),r[s]=n}),r}function yS(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(s){s.multi?(e.multi[s.kind].push(s),e.multi.fallback.push(s)):e[s.kind][s.tag]=e.fallback[s.tag]=s}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function hc(e){return this.extend(e)}hc.prototype.extend=function(t){var r=[],n=[];if(t instanceof ot)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new Ct("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(o){if(!(o instanceof ot))throw new Ct("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Ct("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Ct("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(o){if(!(o instanceof ot))throw new Ct("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(hc.prototype);return s.implicit=(this.implicit||[]).concat(r),s.explicit=(this.explicit||[]).concat(n),s.compiledImplicit=ch(s,"implicit"),s.compiledExplicit=ch(s,"explicit"),s.compiledTypeMap=yS(s.compiledImplicit,s.compiledExplicit),s};var bS=hc,xS=new ot("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),wS=new ot("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),kS=new ot("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),_S=new bS({explicit:[xS,wS,kS]});function CS(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function $S(){return null}function SS(e){return e===null}var jS=new ot("tag:yaml.org,2002:null",{kind:"scalar",resolve:CS,construct:$S,predicate:SS,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function ES(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function AS(e){return e==="true"||e==="True"||e==="TRUE"}function NS(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var PS=new ot("tag:yaml.org,2002:bool",{kind:"scalar",resolve:ES,construct:AS,predicate:NS,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function RS(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function TS(e){return 48<=e&&e<=55}function IS(e){return 48<=e&&e<=57}function MS(e){if(e===null)return!1;var t=e.length,r=0,n=!1,s;if(!t)return!1;if(s=e[r],(s==="-"||s==="+")&&(s=e[++r]),s==="0"){if(r+1===t)return!0;if(s=e[++r],s==="b"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(s!=="0"&&s!=="1")return!1;n=!0}return n&&s!=="_"}if(s==="x"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!RS(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}if(s==="o"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!TS(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}}if(s==="_")return!1;for(;r<t;r++)if(s=e[r],s!=="_"){if(!IS(e.charCodeAt(r)))return!1;n=!0}return!(!n||s==="_")}function zS(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function OS(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ln.isNegativeZero(e)}var DS=new ot("tag:yaml.org,2002:int",{kind:"scalar",resolve:MS,construct:zS,predicate:OS,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),LS=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function FS(e){return!(e===null||!LS.test(e)||e[e.length-1]==="_")}function BS(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var US=/^[-+]?[0-9]+e/;function WS(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ln.isNegativeZero(e))return"-0.0";return r=e.toString(10),US.test(r)?r.replace("e",".e"):r}function VS(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ln.isNegativeZero(e))}var KS=new ot("tag:yaml.org,2002:float",{kind:"scalar",resolve:FS,construct:BS,predicate:VS,represent:WS,defaultStyle:"lowercase"}),HS=_S.extend({implicit:[jS,PS,DS,KS]}),qS=HS,j0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),E0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function GS(e){return e===null?!1:j0.exec(e)!==null||E0.exec(e)!==null}function YS(e){var t,r,n,s,o,a,i,c=0,u=null,d,f,p;if(t=j0.exec(e),t===null&&(t=E0.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(r,n,s));if(o=+t[4],a=+t[5],i=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(d=+t[10],f=+(t[11]||0),u=(d*60+f)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(r,n,s,o,a,i,c)),u&&p.setTime(p.getTime()-u),p}function JS(e){return e.toISOString()}var ZS=new ot("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:GS,construct:YS,instanceOf:Date,represent:JS});function QS(e){return e==="<<"||e===null}var XS=new ot("tag:yaml.org,2002:merge",{kind:"scalar",resolve:QS}),pu=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
104
- \r`;function ej(e){if(e===null)return!1;var t,r,n=0,s=e.length,o=pu;for(r=0;r<s;r++)if(t=o.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function tj(e){var t,r,n=e.replace(/[\r\n=]/g,""),s=n.length,o=pu,a=0,i=[];for(t=0;t<s;t++)t%4===0&&t&&(i.push(a>>16&255),i.push(a>>8&255),i.push(a&255)),a=a<<6|o.indexOf(n.charAt(t));return r=s%4*6,r===0?(i.push(a>>16&255),i.push(a>>8&255),i.push(a&255)):r===18?(i.push(a>>10&255),i.push(a>>2&255)):r===12&&i.push(a>>4&255),new Uint8Array(i)}function rj(e){var t="",r=0,n,s,o=e.length,a=pu;for(n=0;n<o;n++)n%3===0&&n&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[n];return s=o%3,s===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):s===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):s===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function nj(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var sj=new ot("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ej,construct:tj,predicate:nj,represent:rj}),oj=Object.prototype.hasOwnProperty,aj=Object.prototype.toString;function ij(e){if(e===null)return!0;var t=[],r,n,s,o,a,i=e;for(r=0,n=i.length;r<n;r+=1){if(s=i[r],a=!1,aj.call(s)!=="[object Object]")return!1;for(o in s)if(oj.call(s,o))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function lj(e){return e!==null?e:[]}var cj=new ot("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ij,construct:lj}),uj=Object.prototype.toString;function dj(e){if(e===null)return!0;var t,r,n,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(n=a[t],uj.call(n)!=="[object Object]"||(s=Object.keys(n),s.length!==1))return!1;o[t]=[s[0],n[s[0]]]}return!0}function fj(e){if(e===null)return[];var t,r,n,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],s=Object.keys(n),o[t]=[s[0],n[s[0]]];return o}var hj=new ot("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:dj,construct:fj}),pj=Object.prototype.hasOwnProperty;function mj(e){if(e===null)return!0;var t,r=e;for(t in r)if(pj.call(r,t)&&r[t]!==null)return!1;return!0}function gj(e){return e!==null?e:{}}var vj=new ot("tag:yaml.org,2002:set",{kind:"mapping",resolve:mj,construct:gj}),yj=qS.extend({implicit:[ZS,XS],explicit:[sj,cj,hj,vj]});function uh(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
105
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}var bj=new Array(256),xj=new Array(256);for(var wn=0;wn<256;wn++)bj[wn]=uh(wn)?1:0,xj[wn]=uh(wn);var A0=Object.prototype.toString,N0=Object.prototype.hasOwnProperty,mu=65279,wj=9,to=10,kj=13,_j=32,Cj=33,$j=34,pc=35,Sj=37,jj=38,Ej=39,Aj=42,P0=44,Nj=45,Ta=58,Pj=61,Rj=62,Tj=63,Ij=64,R0=91,T0=93,Mj=96,I0=123,zj=124,M0=125,at={};at[0]="\\0";at[7]="\\a";at[8]="\\b";at[9]="\\t";at[10]="\\n";at[11]="\\v";at[12]="\\f";at[13]="\\r";at[27]="\\e";at[34]='\\"';at[92]="\\\\";at[133]="\\N";at[160]="\\_";at[8232]="\\L";at[8233]="\\P";var Oj=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Dj=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Lj(e,t){var r,n,s,o,a,i,c;if(t===null)return{};for(r={},n=Object.keys(t),s=0,o=n.length;s<o;s+=1)a=n[s],i=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&N0.call(c.styleAliases,i)&&(i=c.styleAliases[i]),r[a]=i;return r}function Fj(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Ct("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ln.repeat("0",n-t.length)+t}var Bj=1,ro=2;function Uj(e){this.schema=e.schema||yj,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ln.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Lj(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ro:Bj,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function dh(e,t){for(var r=ln.repeat(" ",t),n=0,s=-1,o="",a,i=e.length;n<i;)s=e.indexOf(`
103
+ `+e.mark.snippet),n+" "+r):n}function eo(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=x0(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}eo.prototype=Object.create(Error.prototype);eo.prototype.constructor=eo;eo.prototype.toString=function(t){return this.name+": "+x0(this,t)};var Ct=eo,lS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],cS=["scalar","sequence","mapping"];function uS(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function dS(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(lS.indexOf(r)===-1)throw new Ct('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=uS(t.styleAliases||null),cS.indexOf(this.kind)===-1)throw new Ct('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ot=dS;function ah(e,t){var r=[];return e[t].forEach(function(n){var s=r.length;r.forEach(function(o,a){o.tag===n.tag&&o.kind===n.kind&&o.multi===n.multi&&(s=a)}),r[s]=n}),r}function fS(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(s){s.multi?(e.multi[s.kind].push(s),e.multi.fallback.push(s)):e[s.kind][s.tag]=e.fallback[s.tag]=s}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function uc(e){return this.extend(e)}uc.prototype.extend=function(t){var r=[],n=[];if(t instanceof ot)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new Ct("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(o){if(!(o instanceof ot))throw new Ct("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Ct("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Ct("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(o){if(!(o instanceof ot))throw new Ct("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(uc.prototype);return s.implicit=(this.implicit||[]).concat(r),s.explicit=(this.explicit||[]).concat(n),s.compiledImplicit=ah(s,"implicit"),s.compiledExplicit=ah(s,"explicit"),s.compiledTypeMap=fS(s.compiledImplicit,s.compiledExplicit),s};var hS=uc,pS=new ot("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),mS=new ot("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),gS=new ot("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),vS=new hS({explicit:[pS,mS,gS]});function yS(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function bS(){return null}function xS(e){return e===null}var wS=new ot("tag:yaml.org,2002:null",{kind:"scalar",resolve:yS,construct:bS,predicate:xS,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function kS(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function _S(e){return e==="true"||e==="True"||e==="TRUE"}function CS(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var $S=new ot("tag:yaml.org,2002:bool",{kind:"scalar",resolve:kS,construct:_S,predicate:CS,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function SS(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function jS(e){return 48<=e&&e<=55}function ES(e){return 48<=e&&e<=57}function AS(e){if(e===null)return!1;var t=e.length,r=0,n=!1,s;if(!t)return!1;if(s=e[r],(s==="-"||s==="+")&&(s=e[++r]),s==="0"){if(r+1===t)return!0;if(s=e[++r],s==="b"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(s!=="0"&&s!=="1")return!1;n=!0}return n&&s!=="_"}if(s==="x"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!SS(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}if(s==="o"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!jS(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}}if(s==="_")return!1;for(;r<t;r++)if(s=e[r],s!=="_"){if(!ES(e.charCodeAt(r)))return!1;n=!0}return!(!n||s==="_")}function NS(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function PS(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ln.isNegativeZero(e)}var RS=new ot("tag:yaml.org,2002:int",{kind:"scalar",resolve:AS,construct:NS,predicate:PS,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),TS=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function IS(e){return!(e===null||!TS.test(e)||e[e.length-1]==="_")}function MS(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var zS=/^[-+]?[0-9]+e/;function OS(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ln.isNegativeZero(e))return"-0.0";return r=e.toString(10),zS.test(r)?r.replace("e",".e"):r}function DS(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ln.isNegativeZero(e))}var LS=new ot("tag:yaml.org,2002:float",{kind:"scalar",resolve:IS,construct:MS,predicate:DS,represent:OS,defaultStyle:"lowercase"}),FS=vS.extend({implicit:[wS,$S,RS,LS]}),BS=FS,w0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),k0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function US(e){return e===null?!1:w0.exec(e)!==null||k0.exec(e)!==null}function WS(e){var t,r,n,s,o,a,i,c=0,u=null,d,f,p;if(t=w0.exec(e),t===null&&(t=k0.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(r,n,s));if(o=+t[4],a=+t[5],i=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(d=+t[10],f=+(t[11]||0),u=(d*60+f)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(r,n,s,o,a,i,c)),u&&p.setTime(p.getTime()-u),p}function VS(e){return e.toISOString()}var KS=new ot("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:US,construct:WS,instanceOf:Date,represent:VS});function HS(e){return e==="<<"||e===null}var GS=new ot("tag:yaml.org,2002:merge",{kind:"scalar",resolve:HS}),du=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
104
+ \r`;function qS(e){if(e===null)return!1;var t,r,n=0,s=e.length,o=du;for(r=0;r<s;r++)if(t=o.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function YS(e){var t,r,n=e.replace(/[\r\n=]/g,""),s=n.length,o=du,a=0,i=[];for(t=0;t<s;t++)t%4===0&&t&&(i.push(a>>16&255),i.push(a>>8&255),i.push(a&255)),a=a<<6|o.indexOf(n.charAt(t));return r=s%4*6,r===0?(i.push(a>>16&255),i.push(a>>8&255),i.push(a&255)):r===18?(i.push(a>>10&255),i.push(a>>2&255)):r===12&&i.push(a>>4&255),new Uint8Array(i)}function JS(e){var t="",r=0,n,s,o=e.length,a=du;for(n=0;n<o;n++)n%3===0&&n&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[n];return s=o%3,s===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):s===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):s===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function ZS(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var QS=new ot("tag:yaml.org,2002:binary",{kind:"scalar",resolve:qS,construct:YS,predicate:ZS,represent:JS}),XS=Object.prototype.hasOwnProperty,ej=Object.prototype.toString;function tj(e){if(e===null)return!0;var t=[],r,n,s,o,a,i=e;for(r=0,n=i.length;r<n;r+=1){if(s=i[r],a=!1,ej.call(s)!=="[object Object]")return!1;for(o in s)if(XS.call(s,o))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function rj(e){return e!==null?e:[]}var nj=new ot("tag:yaml.org,2002:omap",{kind:"sequence",resolve:tj,construct:rj}),sj=Object.prototype.toString;function oj(e){if(e===null)return!0;var t,r,n,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(n=a[t],sj.call(n)!=="[object Object]"||(s=Object.keys(n),s.length!==1))return!1;o[t]=[s[0],n[s[0]]]}return!0}function aj(e){if(e===null)return[];var t,r,n,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],s=Object.keys(n),o[t]=[s[0],n[s[0]]];return o}var ij=new ot("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:oj,construct:aj}),lj=Object.prototype.hasOwnProperty;function cj(e){if(e===null)return!0;var t,r=e;for(t in r)if(lj.call(r,t)&&r[t]!==null)return!1;return!0}function uj(e){return e!==null?e:{}}var dj=new ot("tag:yaml.org,2002:set",{kind:"mapping",resolve:cj,construct:uj}),fj=BS.extend({implicit:[KS,GS],explicit:[QS,nj,ij,dj]});function ih(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
105
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}var hj=new Array(256),pj=new Array(256);for(var wn=0;wn<256;wn++)hj[wn]=ih(wn)?1:0,pj[wn]=ih(wn);var _0=Object.prototype.toString,C0=Object.prototype.hasOwnProperty,fu=65279,mj=9,to=10,gj=13,vj=32,yj=33,bj=34,dc=35,xj=37,wj=38,kj=39,_j=42,$0=44,Cj=45,Ta=58,$j=61,Sj=62,jj=63,Ej=64,S0=91,j0=93,Aj=96,E0=123,Nj=124,A0=125,at={};at[0]="\\0";at[7]="\\a";at[8]="\\b";at[9]="\\t";at[10]="\\n";at[11]="\\v";at[12]="\\f";at[13]="\\r";at[27]="\\e";at[34]='\\"';at[92]="\\\\";at[133]="\\N";at[160]="\\_";at[8232]="\\L";at[8233]="\\P";var Pj=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Rj=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Tj(e,t){var r,n,s,o,a,i,c;if(t===null)return{};for(r={},n=Object.keys(t),s=0,o=n.length;s<o;s+=1)a=n[s],i=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&C0.call(c.styleAliases,i)&&(i=c.styleAliases[i]),r[a]=i;return r}function Ij(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Ct("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ln.repeat("0",n-t.length)+t}var Mj=1,ro=2;function zj(e){this.schema=e.schema||fj,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ln.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Tj(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ro:Mj,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function lh(e,t){for(var r=ln.repeat(" ",t),n=0,s=-1,o="",a,i=e.length;n<i;)s=e.indexOf(`
106
106
  `,n),s===-1?(a=e.slice(n),n=i):(a=e.slice(n,s+1),n=s+1),a.length&&a!==`
107
- `&&(o+=r),o+=a;return o}function mc(e,t){return`
108
- `+ln.repeat(" ",e.indent*t)}function Wj(e,t){var r,n,s;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(s=e.implicitTypes[r],s.resolve(t))return!0;return!1}function Ia(e){return e===_j||e===wj}function no(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==mu||65536<=e&&e<=1114111}function fh(e){return no(e)&&e!==mu&&e!==kj&&e!==to}function hh(e,t,r){var n=fh(e),s=n&&!Ia(e);return(r?n:n&&e!==P0&&e!==R0&&e!==T0&&e!==I0&&e!==M0)&&e!==pc&&!(t===Ta&&!s)||fh(t)&&!Ia(t)&&e===pc||t===Ta&&s}function Vj(e){return no(e)&&e!==mu&&!Ia(e)&&e!==Nj&&e!==Tj&&e!==Ta&&e!==P0&&e!==R0&&e!==T0&&e!==I0&&e!==M0&&e!==pc&&e!==jj&&e!==Aj&&e!==Cj&&e!==zj&&e!==Pj&&e!==Rj&&e!==Ej&&e!==$j&&e!==Sj&&e!==Ij&&e!==Mj}function Kj(e){return!Ia(e)&&e!==Ta}function Is(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function z0(e){var t=/^\n* /;return t.test(e)}var O0=1,gc=2,D0=3,L0=4,An=5;function Hj(e,t,r,n,s,o,a,i){var c,u=0,d=null,f=!1,p=!1,h=n!==-1,g=-1,m=Vj(Is(e,0))&&Kj(Is(e,e.length-1));if(t||a)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Is(e,c),!no(u))return An;m=m&&hh(u,d,i),d=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Is(e,c),u===to)f=!0,h&&(p=p||c-g-1>n&&e[g+1]!==" ",g=c);else if(!no(u))return An;m=m&&hh(u,d,i),d=u}p=p||h&&c-g-1>n&&e[g+1]!==" "}return!f&&!p?m&&!a&&!s(e)?O0:o===ro?An:gc:r>9&&z0(e)?An:a?o===ro?An:gc:p?L0:D0}function qj(e,t,r,n,s){e.dump=function(){if(t.length===0)return e.quotingType===ro?'""':"''";if(!e.noCompatMode&&(Oj.indexOf(t)!==-1||Dj.test(t)))return e.quotingType===ro?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),i=n||e.flowLevel>-1&&r>=e.flowLevel;function c(u){return Wj(e,u)}switch(Hj(t,i,e.indent,a,c,e.quotingType,e.forceQuotes&&!n,s)){case O0:return t;case gc:return"'"+t.replace(/'/g,"''")+"'";case D0:return"|"+ph(t,e.indent)+mh(dh(t,o));case L0:return">"+ph(t,e.indent)+mh(dh(Gj(t,a),o));case An:return'"'+Yj(t)+'"';default:throw new Ct("impossible error: invalid scalar style")}}()}function ph(e,t){var r=z0(e)?String(t):"",n=e[e.length-1]===`
107
+ `&&(o+=r),o+=a;return o}function fc(e,t){return`
108
+ `+ln.repeat(" ",e.indent*t)}function Oj(e,t){var r,n,s;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(s=e.implicitTypes[r],s.resolve(t))return!0;return!1}function Ia(e){return e===vj||e===mj}function no(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==fu||65536<=e&&e<=1114111}function ch(e){return no(e)&&e!==fu&&e!==gj&&e!==to}function uh(e,t,r){var n=ch(e),s=n&&!Ia(e);return(r?n:n&&e!==$0&&e!==S0&&e!==j0&&e!==E0&&e!==A0)&&e!==dc&&!(t===Ta&&!s)||ch(t)&&!Ia(t)&&e===dc||t===Ta&&s}function Dj(e){return no(e)&&e!==fu&&!Ia(e)&&e!==Cj&&e!==jj&&e!==Ta&&e!==$0&&e!==S0&&e!==j0&&e!==E0&&e!==A0&&e!==dc&&e!==wj&&e!==_j&&e!==yj&&e!==Nj&&e!==$j&&e!==Sj&&e!==kj&&e!==bj&&e!==xj&&e!==Ej&&e!==Aj}function Lj(e){return!Ia(e)&&e!==Ta}function Is(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function N0(e){var t=/^\n* /;return t.test(e)}var P0=1,hc=2,R0=3,T0=4,An=5;function Fj(e,t,r,n,s,o,a,i){var c,u=0,d=null,f=!1,p=!1,h=n!==-1,g=-1,m=Dj(Is(e,0))&&Lj(Is(e,e.length-1));if(t||a)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Is(e,c),!no(u))return An;m=m&&uh(u,d,i),d=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=Is(e,c),u===to)f=!0,h&&(p=p||c-g-1>n&&e[g+1]!==" ",g=c);else if(!no(u))return An;m=m&&uh(u,d,i),d=u}p=p||h&&c-g-1>n&&e[g+1]!==" "}return!f&&!p?m&&!a&&!s(e)?P0:o===ro?An:hc:r>9&&N0(e)?An:a?o===ro?An:hc:p?T0:R0}function Bj(e,t,r,n,s){e.dump=function(){if(t.length===0)return e.quotingType===ro?'""':"''";if(!e.noCompatMode&&(Pj.indexOf(t)!==-1||Rj.test(t)))return e.quotingType===ro?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),i=n||e.flowLevel>-1&&r>=e.flowLevel;function c(u){return Oj(e,u)}switch(Fj(t,i,e.indent,a,c,e.quotingType,e.forceQuotes&&!n,s)){case P0:return t;case hc:return"'"+t.replace(/'/g,"''")+"'";case R0:return"|"+dh(t,e.indent)+fh(lh(t,o));case T0:return">"+dh(t,e.indent)+fh(lh(Uj(t,a),o));case An:return'"'+Wj(t)+'"';default:throw new Ct("impossible error: invalid scalar style")}}()}function dh(e,t){var r=N0(e)?String(t):"",n=e[e.length-1]===`
109
109
  `,s=n&&(e[e.length-2]===`
110
110
  `||e===`
111
111
  `),o=s?"+":n?"":"-";return r+o+`
112
- `}function mh(e){return e[e.length-1]===`
113
- `?e.slice(0,-1):e}function Gj(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var u=e.indexOf(`
114
- `);return u=u!==-1?u:e.length,r.lastIndex=u,gh(e.slice(0,u),t)}(),s=e[0]===`
112
+ `}function fh(e){return e[e.length-1]===`
113
+ `?e.slice(0,-1):e}function Uj(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var u=e.indexOf(`
114
+ `);return u=u!==-1?u:e.length,r.lastIndex=u,hh(e.slice(0,u),t)}(),s=e[0]===`
115
115
  `||e[0]===" ",o,a;a=r.exec(e);){var i=a[1],c=a[2];o=c[0]===" ",n+=i+(!s&&!o&&c!==""?`
116
- `:"")+gh(c,t),s=o}return n}function gh(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,s=0,o,a=0,i=0,c="";n=r.exec(e);)i=n.index,i-s>t&&(o=a>s?a:i,c+=`
116
+ `:"")+hh(c,t),s=o}return n}function hh(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,s=0,o,a=0,i=0,c="";n=r.exec(e);)i=n.index,i-s>t&&(o=a>s?a:i,c+=`
117
117
  `+e.slice(s,o),s=o+1),a=i;return c+=`
118
118
  `,e.length-s>t&&a>s?c+=e.slice(s,a)+`
119
- `+e.slice(a+1):c+=e.slice(s),c.slice(1)}function Yj(e){for(var t="",r=0,n,s=0;s<e.length;r>=65536?s+=2:s++)r=Is(e,s),n=at[r],!n&&no(r)?(t+=e[s],r>=65536&&(t+=e[s+1])):t+=n||Fj(r);return t}function Jj(e,t,r){var n="",s=e.tag,o,a,i;for(o=0,a=r.length;o<a;o+=1)i=r[o],e.replacer&&(i=e.replacer.call(r,String(o),i)),(dr(e,t,i,!1,!1)||typeof i>"u"&&dr(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=s,e.dump="["+n+"]"}function vh(e,t,r,n){var s="",o=e.tag,a,i,c;for(a=0,i=r.length;a<i;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(dr(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&dr(e,t+1,null,!0,!0,!1,!0))&&((!n||s!=="")&&(s+=mc(e,t)),e.dump&&to===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=o,e.dump=s||"[]"}function Zj(e,t,r){var n="",s=e.tag,o=Object.keys(r),a,i,c,u,d;for(a=0,i=o.length;a<i;a+=1)d="",n!==""&&(d+=", "),e.condenseFlow&&(d+='"'),c=o[a],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),dr(e,t,c,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),dr(e,t,u,!1,!1)&&(d+=e.dump,n+=d));e.tag=s,e.dump="{"+n+"}"}function Qj(e,t,r,n){var s="",o=e.tag,a=Object.keys(r),i,c,u,d,f,p;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Ct("sortKeys must be a boolean or a function");for(i=0,c=a.length;i<c;i+=1)p="",(!n||s!=="")&&(p+=mc(e,t)),u=a[i],d=r[u],e.replacer&&(d=e.replacer.call(r,u,d)),dr(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&to===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,f&&(p+=mc(e,t)),dr(e,t+1,d,!0,f)&&(e.dump&&to===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,s+=p));e.tag=o,e.dump=s||"{}"}function yh(e,t,r){var n,s,o,a,i,c;for(s=r?e.explicitTypes:e.implicitTypes,o=0,a=s.length;o<a;o+=1)if(i=s[o],(i.instanceOf||i.predicate)&&(!i.instanceOf||typeof t=="object"&&t instanceof i.instanceOf)&&(!i.predicate||i.predicate(t))){if(r?i.multi&&i.representName?e.tag=i.representName(t):e.tag=i.tag:e.tag="?",i.represent){if(c=e.styleMap[i.tag]||i.defaultStyle,A0.call(i.represent)==="[object Function]")n=i.represent(t,c);else if(N0.call(i.represent,c))n=i.represent[c](t,c);else throw new Ct("!<"+i.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function dr(e,t,r,n,s,o,a){e.tag=null,e.dump=r,yh(e,r,!1)||yh(e,r,!0);var i=A0.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var d=i==="[object Object]"||i==="[object Array]",f,p;if(d&&(f=e.duplicates.indexOf(r),p=f!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(s=!1),p&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),i==="[object Object]")n&&Object.keys(e.dump).length!==0?(Qj(e,t,e.dump,s),p&&(e.dump="&ref_"+f+e.dump)):(Zj(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(i==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?vh(e,t-1,e.dump,s):vh(e,t,e.dump,s),p&&(e.dump="&ref_"+f+e.dump)):(Jj(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(i==="[object String]")e.tag!=="?"&&qj(e,e.dump,t,o,c);else{if(i==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ct("unacceptable kind of an object to dump "+i)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Xj(e,t){var r=[],n=[],s,o;for(vc(e,r,n),s=0,o=n.length;s<o;s+=1)t.duplicates.push(r[n[s]]);t.usedDuplicates=new Array(o)}function vc(e,t,r){var n,s,o;if(e!==null&&typeof e=="object")if(s=t.indexOf(e),s!==-1)r.indexOf(s)===-1&&r.push(s);else if(t.push(e),Array.isArray(e))for(s=0,o=e.length;s<o;s+=1)vc(e[s],t,r);else for(n=Object.keys(e),s=0,o=n.length;s<o;s+=1)vc(e[n[s]],t,r)}function eE(e,t){t=t||{};var r=new Uj(t);r.noRefs||Xj(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),dr(r,0,n,!0,!0)?r.dump+`
120
- `:""}var tE=eE,rE={dump:tE},nE=rE.dump;function sE(e){const t=new Date(e),r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function oE({text:e}){const t=x.useMemo(()=>hu(e),[e]);return l.jsx("span",{className:"log-text [&_p]:inline [&_p]:m-0",dangerouslySetInnerHTML:{__html:t}})}function F0(e){try{return nE(e,{indent:2,lineWidth:80,noRefs:!0}).trimEnd()}catch{return JSON.stringify(e,null,2)}}function aE(e){const t=JSON.stringify(e);return t.length>60?t.slice(0,59)+"…}":t}function iE({obj:e}){const t=x.useMemo(()=>F0(e),[e]);return l.jsx("pre",{className:"mt-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:t})}function lE({obj:e}){const[t,r]=x.useState(!1),n=x.useMemo(()=>F0(e),[e]),s=x.useMemo(()=>aE(e),[e]);return t?l.jsxs("div",{style:{flexBasis:"100%"},className:"mt-1 flex items-start gap-1",children:[l.jsx("button",{type:"button",onClick:()=>r(!1),className:"inline-flex items-center shrink-0 px-1 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Collapse",children:l.jsx(f1,{size:10})}),l.jsx("pre",{className:"flex-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:n})]}):l.jsx("button",{type:"button",onClick:()=>r(!0),className:"font-mono text-[10px] ml-1 px-1 rounded transition-colors vscode-hover-bg cursor-pointer",style:{color:"var(--vscode-descriptionForeground)",background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.08))"},title:"Click to expand",children:s})}function Bo({label:e,children:t}){const[r,n]=x.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>n(!r),className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:[e,l.jsx(Ze,{size:10})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),l.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 rounded shadow-lg py-1 min-w-[120px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},onClick:()=>n(!1),children:t})]})]})}function Ji({label:e,active:t,onClick:r}){return l.jsxs("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[l.jsx("span",{className:"w-3",children:t&&l.jsx(St,{size:10})}),e]})}function Uo({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:"var(--vscode-foreground)"},children:[l.jsx("span",{className:"w-3 h-3 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(St,{size:8,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),e]})}function B0({logs:e,onClearLogs:t,logsFilter:r,onLogsFilterChange:n}){const[s,o]=x.useState(()=>(r==null?void 0:r.limit)??"all"),[a,i]=x.useState(()=>(r==null?void 0:r.order)??"desc"),[c,u]=x.useState(()=>new Set((r==null?void 0:r.disabledSources)??[])),[d,f]=x.useState(()=>(r==null?void 0:r.show)??{timestamp:!0,source:!0,objects:!1}),p=x.useMemo(()=>{const m=new Set;for(const v of e)m.add(v.source);return Array.from(m).sort()},[e]),h=x.useMemo(()=>{let m=e;return c.size>0&&(m=m.filter(v=>!c.has(v.source))),m=[...m],a==="desc"&&m.reverse(),s!=="all"&&(m=m.slice(0,s)),m},[e,c,a,s]),g=[10,25,50,100,"all"];return x.useEffect(()=>{n==null||n({limit:s,order:a,disabledSources:Array.from(c),show:d})},[s,a,c,d]),l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"card-log-toolbar shrink-0",children:[l.jsxs("button",{type:"button",onClick:t,disabled:e.length===0,className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg disabled:opacity-40",style:{color:"var(--vscode-descriptionForeground)"},title:"Clear all logs",children:[l.jsx(Kt,{size:10}),"Clear"]}),l.jsx("span",{className:"w-px h-4 mx-0.5",style:{background:"var(--vscode-panel-border)"}}),l.jsx(Bo,{label:l.jsxs(l.Fragment,{children:["Limit: ",s]}),children:g.map(m=>l.jsx(Ji,{label:String(m),active:s===m,onClick:()=>o(m)},String(m)))}),l.jsxs(Bo,{label:l.jsxs(l.Fragment,{children:["Order: ",a==="desc"?"Newest":"Oldest"]}),children:[l.jsx(Ji,{label:"Newest first",active:a==="desc",onClick:()=>i("desc")}),l.jsx(Ji,{label:"Oldest first",active:a==="asc",onClick:()=>i("asc")})]}),p.length>0&&l.jsx(Bo,{label:`Sources (${p.filter(m=>!c.has(m)).length}/${p.length})`,children:l.jsx("div",{onClick:m=>m.stopPropagation(),children:p.map(m=>l.jsx(Uo,{label:m,checked:!c.has(m),onChange:v=>u(y=>{const b=new Set(y);return v?b.delete(m):b.add(m),b})},m))})}),l.jsx(Bo,{label:"Show",children:l.jsxs("div",{onClick:m=>m.stopPropagation(),children:[l.jsx(Uo,{label:"Timestamp",checked:d.timestamp,onChange:m=>f(v=>({...v,timestamp:m}))}),l.jsx(Uo,{label:"Source",checked:d.source,onChange:m=>f(v=>({...v,source:m}))}),l.jsx(Uo,{label:"Objects",checked:d.objects,onChange:m=>f(v=>({...v,objects:m}))})]})}),l.jsxs("span",{className:"card-log-count",children:[h.length,s!=="all"&&e.length>s?` / ${e.length}`:""," entries"]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:h.length===0?l.jsx("p",{className:"p-4 text-xs italic",style:{color:"var(--vscode-descriptionForeground)"},children:e.length===0?"No log entries yet.":"No entries match the current filters."}):l.jsx("div",{className:"flex flex-col",children:h.map((m,v)=>l.jsxs("div",{className:"card-log-entry px-4 py-2 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.timestamp&&l.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--vscode-descriptionForeground)"},title:m.timestamp,children:sE(m.timestamp)}),d.source&&l.jsx("span",{className:"text-[10px] font-medium px-1 rounded shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m.source}),l.jsx("span",{className:"comment-markdown inline text-xs leading-normal [&_p]:inline [&_p]:m-0",style:{color:"var(--vscode-foreground)"},children:l.jsx(oE,{text:m.text})}),!d.objects&&m.object&&l.jsx(lE,{obj:m.object})]}),d.objects&&m.object&&l.jsx(iE,{obj:m.object})]},`${m.timestamp}-${v}`))})})]})}var cE=typeof Mo=="object"&&Mo&&Mo.Object===Object&&Mo,U0=cE,uE=U0,dE=typeof self=="object"&&self&&self.Object===Object&&self,fE=uE||dE||Function("return this")(),ut=fE,hE=ut,pE=hE.Symbol,Jn=pE,bh=Jn,W0=Object.prototype,mE=W0.hasOwnProperty,gE=W0.toString,$s=bh?bh.toStringTag:void 0;function vE(e){var t=mE.call(e,$s),r=e[$s];try{e[$s]=void 0;var n=!0}catch{}var s=gE.call(e);return n&&(t?e[$s]=r:delete e[$s]),s}var yE=vE,bE=Object.prototype,xE=bE.toString;function wE(e){return xE.call(e)}var kE=wE,xh=Jn,_E=yE,CE=kE,$E="[object Null]",SE="[object Undefined]",wh=xh?xh.toStringTag:void 0;function jE(e){return e==null?e===void 0?SE:$E:wh&&wh in Object(e)?_E(e):CE(e)}var Ir=jE;function EE(e){return e!=null&&typeof e=="object"}var bt=EE,AE=Ir,NE=bt,PE="[object Symbol]";function RE(e){return typeof e=="symbol"||NE(e)&&AE(e)==PE}var Zn=RE,TE=Zn;function IE(e,t,r){for(var n=-1,s=e.length;++n<s;){var o=e[n],a=t(o);if(a!=null&&(i===void 0?a===a&&!TE(a):r(a,i)))var i=a,c=o}return c}var ME=IE;function zE(e,t){return e>t}var OE=zE;function DE(){this.__data__=[],this.size=0}var LE=DE;function FE(e,t){return e===t||e!==e&&t!==t}var io=FE,BE=io;function UE(e,t){for(var r=e.length;r--;)if(BE(e[r][0],t))return r;return-1}var fi=UE,WE=fi,VE=Array.prototype,KE=VE.splice;function HE(e){var t=this.__data__,r=WE(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():KE.call(t,r,1),--this.size,!0}var qE=HE,GE=fi;function YE(e){var t=this.__data__,r=GE(t,e);return r<0?void 0:t[r][1]}var JE=YE,ZE=fi;function QE(e){return ZE(this.__data__,e)>-1}var XE=QE,eA=fi;function tA(e,t){var r=this.__data__,n=eA(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var rA=tA,nA=LE,sA=qE,oA=JE,aA=XE,iA=rA;function Qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=nA;Qn.prototype.delete=sA;Qn.prototype.get=oA;Qn.prototype.has=aA;Qn.prototype.set=iA;var hi=Qn,lA=hi;function cA(){this.__data__=new lA,this.size=0}var uA=cA;function dA(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var fA=dA;function hA(e){return this.__data__.get(e)}var pA=hA;function mA(e){return this.__data__.has(e)}var gA=mA;function vA(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xt=vA,yA=Ir,bA=xt,xA="[object AsyncFunction]",wA="[object Function]",kA="[object GeneratorFunction]",_A="[object Proxy]";function CA(e){if(!bA(e))return!1;var t=yA(e);return t==wA||t==kA||t==xA||t==_A}var lo=CA;const $A=Se(lo);var SA=ut,jA=SA["__core-js_shared__"],EA=jA,Zi=EA,kh=function(){var e=/[^.]+$/.exec(Zi&&Zi.keys&&Zi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function AA(e){return!!kh&&kh in e}var NA=AA,PA=Function.prototype,RA=PA.toString;function TA(e){if(e!=null){try{return RA.call(e)}catch{}try{return e+""}catch{}}return""}var V0=TA,IA=lo,MA=NA,zA=xt,OA=V0,DA=/[\\^$.*+?()[\]{}|]/g,LA=/^\[object .+?Constructor\]$/,FA=Function.prototype,BA=Object.prototype,UA=FA.toString,WA=BA.hasOwnProperty,VA=RegExp("^"+UA.call(WA).replace(DA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function KA(e){if(!zA(e)||MA(e))return!1;var t=IA(e)?VA:LA;return t.test(OA(e))}var HA=KA;function qA(e,t){return e==null?void 0:e[t]}var GA=qA,YA=HA,JA=GA;function ZA(e,t){var r=JA(e,t);return YA(r)?r:void 0}var cn=ZA,QA=cn,XA=ut,eN=QA(XA,"Map"),gu=eN,tN=cn,rN=tN(Object,"create"),pi=rN,_h=pi;function nN(){this.__data__=_h?_h(null):{},this.size=0}var sN=nN;function oN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var aN=oN,iN=pi,lN="__lodash_hash_undefined__",cN=Object.prototype,uN=cN.hasOwnProperty;function dN(e){var t=this.__data__;if(iN){var r=t[e];return r===lN?void 0:r}return uN.call(t,e)?t[e]:void 0}var fN=dN,hN=pi,pN=Object.prototype,mN=pN.hasOwnProperty;function gN(e){var t=this.__data__;return hN?t[e]!==void 0:mN.call(t,e)}var vN=gN,yN=pi,bN="__lodash_hash_undefined__";function xN(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yN&&t===void 0?bN:t,this}var wN=xN,kN=sN,_N=aN,CN=fN,$N=vN,SN=wN;function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=kN;Xn.prototype.delete=_N;Xn.prototype.get=CN;Xn.prototype.has=$N;Xn.prototype.set=SN;var jN=Xn,Ch=jN,EN=hi,AN=gu;function NN(){this.size=0,this.__data__={hash:new Ch,map:new(AN||EN),string:new Ch}}var PN=NN;function RN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var TN=RN,IN=TN;function MN(e,t){var r=e.__data__;return IN(t)?r[typeof t=="string"?"string":"hash"]:r.map}var mi=MN,zN=mi;function ON(e){var t=zN(this,e).delete(e);return this.size-=t?1:0,t}var DN=ON,LN=mi;function FN(e){return LN(this,e).get(e)}var BN=FN,UN=mi;function WN(e){return UN(this,e).has(e)}var VN=WN,KN=mi;function HN(e,t){var r=KN(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var qN=HN,GN=PN,YN=DN,JN=BN,ZN=VN,QN=qN;function es(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}es.prototype.clear=GN;es.prototype.delete=YN;es.prototype.get=JN;es.prototype.has=ZN;es.prototype.set=QN;var vu=es,XN=hi,eP=gu,tP=vu,rP=200;function nP(e,t){var r=this.__data__;if(r instanceof XN){var n=r.__data__;if(!eP||n.length<rP-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new tP(n)}return r.set(e,t),this.size=r.size,this}var sP=nP,oP=hi,aP=uA,iP=fA,lP=pA,cP=gA,uP=sP;function ts(e){var t=this.__data__=new oP(e);this.size=t.size}ts.prototype.clear=aP;ts.prototype.delete=iP;ts.prototype.get=lP;ts.prototype.has=cP;ts.prototype.set=uP;var gi=ts,dP="__lodash_hash_undefined__";function fP(e){return this.__data__.set(e,dP),this}var hP=fP;function pP(e){return this.__data__.has(e)}var mP=pP,gP=vu,vP=hP,yP=mP;function Ma(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new gP;++t<r;)this.add(e[t])}Ma.prototype.add=Ma.prototype.push=vP;Ma.prototype.has=yP;var bP=Ma;function xP(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var wP=xP;function kP(e,t){return e.has(t)}var _P=kP,CP=bP,$P=wP,SP=_P,jP=1,EP=2;function AP(e,t,r,n,s,o){var a=r&jP,i=e.length,c=t.length;if(i!=c&&!(a&&c>i))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,h=r&EP?new CP:void 0;for(o.set(e,t),o.set(t,e);++f<i;){var g=e[f],m=t[f];if(n)var v=a?n(m,g,f,t,e,o):n(g,m,f,e,t,o);if(v!==void 0){if(v)continue;p=!1;break}if(h){if(!$P(t,function(y,b){if(!SP(h,b)&&(g===y||s(g,y,r,n,o)))return h.push(b)})){p=!1;break}}else if(!(g===m||s(g,m,r,n,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var K0=AP,NP=ut,PP=NP.Uint8Array,H0=PP;function RP(e){var t=-1,r=Array(e.size);return e.forEach(function(n,s){r[++t]=[s,n]}),r}var q0=RP;function TP(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var IP=TP,$h=Jn,Sh=H0,MP=io,zP=K0,OP=q0,DP=IP,LP=1,FP=2,BP="[object Boolean]",UP="[object Date]",WP="[object Error]",VP="[object Map]",KP="[object Number]",HP="[object RegExp]",qP="[object Set]",GP="[object String]",YP="[object Symbol]",JP="[object ArrayBuffer]",ZP="[object DataView]",jh=$h?$h.prototype:void 0,Qi=jh?jh.valueOf:void 0;function QP(e,t,r,n,s,o,a){switch(r){case ZP:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JP:return!(e.byteLength!=t.byteLength||!o(new Sh(e),new Sh(t)));case BP:case UP:case KP:return MP(+e,+t);case WP:return e.name==t.name&&e.message==t.message;case HP:case GP:return e==t+"";case VP:var i=OP;case qP:var c=n&LP;if(i||(i=DP),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=FP,a.set(e,t);var d=zP(i(e),i(t),n,s,o,a);return a.delete(e),d;case YP:if(Qi)return Qi.call(e)==Qi.call(t)}return!1}var XP=QP;function eR(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var yu=eR,tR=Array.isArray,Ue=tR;const G0=Se(Ue);var rR=yu,nR=Ue;function sR(e,t,r){var n=t(e);return nR(e)?n:rR(n,r(e))}var Y0=sR;function oR(e,t){for(var r=-1,n=e==null?0:e.length,s=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[s++]=a)}return o}var J0=oR;function aR(){return[]}var Z0=aR,iR=J0,lR=Z0,cR=Object.prototype,uR=cR.propertyIsEnumerable,Eh=Object.getOwnPropertySymbols,dR=Eh?function(e){return e==null?[]:(e=Object(e),iR(Eh(e),function(t){return uR.call(e,t)}))}:lR,bu=dR,Xi,Ah;function fR(){if(Ah)return Xi;Ah=1;function e(t,r){for(var n=-1,s=Array(t);++n<t;)s[n]=r(n);return s}return Xi=e,Xi}var hR=Ir,pR=bt,mR="[object Arguments]";function gR(e){return pR(e)&&hR(e)==mR}var vR=gR,Nh=vR,yR=bt,Q0=Object.prototype,bR=Q0.hasOwnProperty,xR=Q0.propertyIsEnumerable,wR=Nh(function(){return arguments}())?Nh:function(e){return yR(e)&&bR.call(e,"callee")&&!xR.call(e,"callee")},co=wR,za={exports:{}};function kR(){return!1}var _R=kR;za.exports;(function(e,t){var r=ut,n=_R,s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,i=a?r.Buffer:void 0,c=i?i.isBuffer:void 0,u=c||n;e.exports=u})(za,za.exports);var uo=za.exports,CR=9007199254740991,$R=/^(?:0|[1-9]\d*)$/;function SR(e,t){var r=typeof e;return t=t??CR,!!t&&(r=="number"||r!="symbol"&&$R.test(e))&&e>-1&&e%1==0&&e<t}var fo=SR,jR=9007199254740991;function ER(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jR}var xu=ER,AR=Ir,NR=xu,PR=bt,RR="[object Arguments]",TR="[object Array]",IR="[object Boolean]",MR="[object Date]",zR="[object Error]",OR="[object Function]",DR="[object Map]",LR="[object Number]",FR="[object Object]",BR="[object RegExp]",UR="[object Set]",WR="[object String]",VR="[object WeakMap]",KR="[object ArrayBuffer]",HR="[object DataView]",qR="[object Float32Array]",GR="[object Float64Array]",YR="[object Int8Array]",JR="[object Int16Array]",ZR="[object Int32Array]",QR="[object Uint8Array]",XR="[object Uint8ClampedArray]",eT="[object Uint16Array]",tT="[object Uint32Array]",ze={};ze[qR]=ze[GR]=ze[YR]=ze[JR]=ze[ZR]=ze[QR]=ze[XR]=ze[eT]=ze[tT]=!0;ze[RR]=ze[TR]=ze[KR]=ze[IR]=ze[HR]=ze[MR]=ze[zR]=ze[OR]=ze[DR]=ze[LR]=ze[FR]=ze[BR]=ze[UR]=ze[WR]=ze[VR]=!1;function rT(e){return PR(e)&&NR(e.length)&&!!ze[AR(e)]}var nT=rT;function sT(e){return function(t){return e(t)}}var wu=sT,Oa={exports:{}};Oa.exports;(function(e,t){var r=U0,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o&&r.process,i=function(){try{var c=s&&s.require&&s.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();e.exports=i})(Oa,Oa.exports);var ku=Oa.exports,oT=nT,aT=wu,Ph=ku,Rh=Ph&&Ph.isTypedArray,iT=Rh?aT(Rh):oT,vi=iT,el,Th;function X0(){if(Th)return el;Th=1;var e=fR(),t=co,r=Ue,n=uo,s=fo,o=vi,a=Object.prototype,i=a.hasOwnProperty;function c(u,d){var f=r(u),p=!f&&t(u),h=!f&&!p&&n(u),g=!f&&!p&&!h&&o(u),m=f||p||h||g,v=m?e(u.length,String):[],y=v.length;for(var b in u)(d||i.call(u,b))&&!(m&&(b=="length"||h&&(b=="offset"||b=="parent")||g&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||s(b,y)))&&v.push(b);return v}return el=c,el}var lT=Object.prototype;function cT(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||lT;return e===r}var yi=cT;function uT(e,t){return function(r){return e(t(r))}}var ev=uT,dT=ev,fT=dT(Object.keys,Object),hT=fT,pT=yi,mT=hT,gT=Object.prototype,vT=gT.hasOwnProperty;function yT(e){if(!pT(e))return mT(e);var t=[];for(var r in Object(e))vT.call(e,r)&&r!="constructor"&&t.push(r);return t}var _u=yT,bT=lo,xT=xu;function wT(e){return e!=null&&xT(e.length)&&!bT(e)}var mr=wT,tl,Ih;function Jt(){if(Ih)return tl;Ih=1;var e=X0(),t=_u,r=mr;function n(s){return r(s)?e(s):t(s)}return tl=n,tl}var kT=Y0,_T=bu,CT=Jt();function $T(e){return kT(e,CT,_T)}var tv=$T,Mh=tv,ST=1,jT=Object.prototype,ET=jT.hasOwnProperty;function AT(e,t,r,n,s,o){var a=r&ST,i=Mh(e),c=i.length,u=Mh(t),d=u.length;if(c!=d&&!a)return!1;for(var f=c;f--;){var p=i[f];if(!(a?p in t:ET.call(t,p)))return!1}var h=o.get(e),g=o.get(t);if(h&&g)return h==t&&g==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=a;++f<c;){p=i[f];var y=e[p],b=t[p];if(n)var C=a?n(b,y,p,t,e,o):n(y,b,p,e,t,o);if(!(C===void 0?y===b||s(y,b,r,n,o):C)){m=!1;break}v||(v=p=="constructor")}if(m&&!v){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return o.delete(e),o.delete(t),m}var NT=AT,PT=cn,RT=ut,TT=PT(RT,"DataView"),IT=TT,MT=cn,zT=ut,OT=MT(zT,"Promise"),DT=OT,LT=cn,FT=ut,BT=LT(FT,"Set"),UT=BT,WT=cn,VT=ut,KT=WT(VT,"WeakMap"),rv=KT,yc=IT,bc=gu,xc=DT,wc=UT,kc=rv,nv=Ir,rs=V0,zh="[object Map]",HT="[object Object]",Oh="[object Promise]",Dh="[object Set]",Lh="[object WeakMap]",Fh="[object DataView]",qT=rs(yc),GT=rs(bc),YT=rs(xc),JT=rs(wc),ZT=rs(kc),Br=nv;(yc&&Br(new yc(new ArrayBuffer(1)))!=Fh||bc&&Br(new bc)!=zh||xc&&Br(xc.resolve())!=Oh||wc&&Br(new wc)!=Dh||kc&&Br(new kc)!=Lh)&&(Br=function(e){var t=nv(e),r=t==HT?e.constructor:void 0,n=r?rs(r):"";if(n)switch(n){case qT:return Fh;case GT:return zh;case YT:return Oh;case JT:return Dh;case ZT:return Lh}return t});var un=Br,rl=gi,QT=K0,XT=XP,eI=NT,Bh=un,Uh=Ue,Wh=uo,tI=vi,rI=1,Vh="[object Arguments]",Kh="[object Array]",Wo="[object Object]",nI=Object.prototype,Hh=nI.hasOwnProperty;function sI(e,t,r,n,s,o){var a=Uh(e),i=Uh(t),c=a?Kh:Bh(e),u=i?Kh:Bh(t);c=c==Vh?Wo:c,u=u==Vh?Wo:u;var d=c==Wo,f=u==Wo,p=c==u;if(p&&Wh(e)){if(!Wh(t))return!1;a=!0,d=!1}if(p&&!d)return o||(o=new rl),a||tI(e)?QT(e,t,r,n,s,o):XT(e,t,c,r,n,s,o);if(!(r&rI)){var h=d&&Hh.call(e,"__wrapped__"),g=f&&Hh.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,v=g?t.value():t;return o||(o=new rl),s(m,v,r,n,o)}}return p?(o||(o=new rl),eI(e,t,r,n,s,o)):!1}var oI=sI,aI=oI,qh=bt;function sv(e,t,r,n,s){return e===t?!0:e==null||t==null||!qh(e)&&!qh(t)?e!==e&&t!==t:aI(e,t,r,n,sv,s)}var Cu=sv,iI=gi,lI=Cu,cI=1,uI=2;function dI(e,t,r,n){var s=r.length,o=s,a=!n;if(e==null)return!o;for(e=Object(e);s--;){var i=r[s];if(a&&i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++s<o;){i=r[s];var c=i[0],u=e[c],d=i[1];if(a&&i[2]){if(u===void 0&&!(c in e))return!1}else{var f=new iI;if(n)var p=n(u,d,c,e,t,f);if(!(p===void 0?lI(d,u,cI|uI,n,f):p))return!1}}return!0}var fI=dI,hI=xt;function pI(e){return e===e&&!hI(e)}var ov=pI,mI=ov,gI=Jt();function vI(e){for(var t=gI(e),r=t.length;r--;){var n=t[r],s=e[n];t[r]=[n,s,mI(s)]}return t}var yI=vI;function bI(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var av=bI,xI=fI,wI=yI,kI=av;function _I(e){var t=wI(e);return t.length==1&&t[0][2]?kI(t[0][0],t[0][1]):function(r){return r===e||xI(r,e,t)}}var CI=_I,$I=Ue,SI=Zn,jI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,EI=/^\w*$/;function AI(e,t){if($I(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||SI(e)?!0:EI.test(e)||!jI.test(e)||t!=null&&e in Object(t)}var $u=AI,iv=vu,NI="Expected a function";function Su(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(NI);var r=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var a=e.apply(this,n);return r.cache=o.set(s,a)||o,a};return r.cache=new(Su.Cache||iv),r}Su.Cache=iv;var PI=Su,RI=PI,TI=500;function II(e){var t=RI(e,function(n){return r.size===TI&&r.clear(),n}),r=t.cache;return t}var MI=II,zI=MI,OI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,DI=/\\(\\)?/g,LI=zI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(OI,function(r,n,s,o){t.push(s?o.replace(DI,"$1"):n||r)}),t}),lv=LI;function FI(e,t){for(var r=-1,n=e==null?0:e.length,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}var ho=FI,Gh=Jn,BI=ho,UI=Ue,WI=Zn,Yh=Gh?Gh.prototype:void 0,Jh=Yh?Yh.toString:void 0;function cv(e){if(typeof e=="string")return e;if(UI(e))return BI(e,cv)+"";if(WI(e))return Jh?Jh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var uv=cv,VI=uv;function KI(e){return e==null?"":VI(e)}var ns=KI,HI=Ue,qI=$u,GI=lv,YI=ns;function JI(e,t){return HI(e)?e:qI(e,t)?[e]:GI(YI(e))}var bi=JI,ZI=Zn;function QI(e){if(typeof e=="string"||ZI(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var dn=QI,XI=bi,eM=dn;function tM(e,t){t=XI(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[eM(t[r++])];return r&&r==n?e:void 0}var ju=tM,rM=ju;function nM(e,t,r){var n=e==null?void 0:rM(e,t);return n===void 0?r:n}var dv=nM;const Qe=Se(dv);function sM(e,t){return e!=null&&t in Object(e)}var oM=sM,aM=bi,iM=co,lM=Ue,cM=fo,uM=xu,dM=dn;function fM(e,t,r){t=aM(t,e);for(var n=-1,s=t.length,o=!1;++n<s;){var a=dM(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=s?o:(s=e==null?0:e.length,!!s&&uM(s)&&cM(a,s)&&(lM(e)||iM(e)))}var fv=fM,hM=oM,pM=fv;function mM(e,t){return e!=null&&pM(e,t,hM)}var gM=mM,vM=Cu,yM=dv,bM=gM,xM=$u,wM=ov,kM=av,_M=dn,CM=1,$M=2;function SM(e,t){return xM(e)&&wM(t)?kM(_M(e),t):function(r){var n=yM(r,e);return n===void 0&&n===t?bM(r,e):vM(t,n,CM|$M)}}var jM=SM;function EM(e){return e}var xi=EM;function AM(e){return function(t){return t==null?void 0:t[e]}}var NM=AM,PM=ju;function RM(e){return function(t){return PM(t,e)}}var TM=RM,IM=NM,MM=TM,zM=$u,OM=dn;function DM(e){return zM(e)?IM(OM(e)):MM(e)}var LM=DM,FM=CI,BM=jM,UM=xi,WM=Ue,VM=LM;function KM(e){return typeof e=="function"?e:e==null?UM:typeof e=="object"?WM(e)?BM(e[0],e[1]):FM(e):VM(e)}var fn=KM,HM=ME,qM=OE,GM=fn;function YM(e,t){return e&&e.length?HM(e,GM(t),qM):void 0}var JM=YM;const wi=Se(JM);var ZM=_u,QM=un,XM=co,e2=Ue,t2=mr,r2=uo,n2=yi,s2=vi,o2="[object Map]",a2="[object Set]",i2=Object.prototype,l2=i2.hasOwnProperty;function c2(e){if(e==null)return!0;if(t2(e)&&(e2(e)||typeof e=="string"||typeof e.splice=="function"||r2(e)||s2(e)||XM(e)))return!e.length;var t=QM(e);if(t==o2||t==a2)return!e.size;if(n2(e))return!ZM(e).length;for(var r in e)if(l2.call(e,r))return!1;return!0}var u2=c2;const he=Se(u2);function d2(e,t,r,n){var s=-1,o=e==null?0:e.length;for(n&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}var hv=d2;function f2(e){return function(t){return e==null?void 0:e[t]}}var h2=f2,p2=h2,m2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},g2=p2(m2),v2=g2,y2=v2,b2=ns,x2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,w2="\\u0300-\\u036f",k2="\\ufe20-\\ufe2f",_2="\\u20d0-\\u20ff",C2=w2+k2+_2,$2="["+C2+"]",S2=RegExp($2,"g");function j2(e){return e=b2(e),e&&e.replace(x2,y2).replace(S2,"")}var E2=j2,A2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function N2(e){return e.match(A2)||[]}var P2=N2,R2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function T2(e){return R2.test(e)}var I2=T2,pv="\\ud800-\\udfff",M2="\\u0300-\\u036f",z2="\\ufe20-\\ufe2f",O2="\\u20d0-\\u20ff",D2=M2+z2+O2,mv="\\u2700-\\u27bf",gv="a-z\\xdf-\\xf6\\xf8-\\xff",L2="\\xac\\xb1\\xd7\\xf7",F2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",B2="\\u2000-\\u206f",U2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vv="A-Z\\xc0-\\xd6\\xd8-\\xde",W2="\\ufe0e\\ufe0f",yv=L2+F2+B2+U2,bv="['’]",Zh="["+yv+"]",V2="["+D2+"]",xv="\\d+",K2="["+mv+"]",wv="["+gv+"]",kv="[^"+pv+yv+xv+mv+gv+vv+"]",H2="\\ud83c[\\udffb-\\udfff]",q2="(?:"+V2+"|"+H2+")",G2="[^"+pv+"]",_v="(?:\\ud83c[\\udde6-\\uddff]){2}",Cv="[\\ud800-\\udbff][\\udc00-\\udfff]",Nn="["+vv+"]",Y2="\\u200d",Qh="(?:"+wv+"|"+kv+")",J2="(?:"+Nn+"|"+kv+")",Xh="(?:"+bv+"(?:d|ll|m|re|s|t|ve))?",ep="(?:"+bv+"(?:D|LL|M|RE|S|T|VE))?",$v=q2+"?",Sv="["+W2+"]?",Z2="(?:"+Y2+"(?:"+[G2,_v,Cv].join("|")+")"+Sv+$v+")*",Q2="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",X2="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ez=Sv+$v+Z2,tz="(?:"+[K2,_v,Cv].join("|")+")"+ez,rz=RegExp([Nn+"?"+wv+"+"+Xh+"(?="+[Zh,Nn,"$"].join("|")+")",J2+"+"+ep+"(?="+[Zh,Nn+Qh,"$"].join("|")+")",Nn+"?"+Qh+"+"+Xh,Nn+"+"+ep,X2,Q2,xv,tz].join("|"),"g");function nz(e){return e.match(rz)||[]}var sz=nz,oz=P2,az=I2,iz=ns,lz=sz;function cz(e,t,r){return e=iz(e),t=r?void 0:t,t===void 0?az(e)?lz(e):oz(e):e.match(t)||[]}var uz=cz,dz=hv,fz=E2,hz=uz,pz="['’]",mz=RegExp(pz,"g");function gz(e){return function(t){return dz(hz(fz(t).replace(mz,"")),e,"")}}var vz=gz;function yz(e,t,r){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),r=r>s?s:r,r<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(s);++n<s;)o[n]=e[n+t];return o}var jv=yz,bz=jv;function xz(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:bz(e,t,r)}var wz=xz,kz="\\ud800-\\udfff",_z="\\u0300-\\u036f",Cz="\\ufe20-\\ufe2f",$z="\\u20d0-\\u20ff",Sz=_z+Cz+$z,jz="\\ufe0e\\ufe0f",Ez="\\u200d",Az=RegExp("["+Ez+kz+Sz+jz+"]");function Nz(e){return Az.test(e)}var Ev=Nz;function Pz(e){return e.split("")}var Rz=Pz,Av="\\ud800-\\udfff",Tz="\\u0300-\\u036f",Iz="\\ufe20-\\ufe2f",Mz="\\u20d0-\\u20ff",zz=Tz+Iz+Mz,Oz="\\ufe0e\\ufe0f",Dz="["+Av+"]",_c="["+zz+"]",Cc="\\ud83c[\\udffb-\\udfff]",Lz="(?:"+_c+"|"+Cc+")",Nv="[^"+Av+"]",Pv="(?:\\ud83c[\\udde6-\\uddff]){2}",Rv="[\\ud800-\\udbff][\\udc00-\\udfff]",Fz="\\u200d",Tv=Lz+"?",Iv="["+Oz+"]?",Bz="(?:"+Fz+"(?:"+[Nv,Pv,Rv].join("|")+")"+Iv+Tv+")*",Uz=Iv+Tv+Bz,Wz="(?:"+[Nv+_c+"?",_c,Pv,Rv,Dz].join("|")+")",Vz=RegExp(Cc+"(?="+Cc+")|"+Wz+Uz,"g");function Kz(e){return e.match(Vz)||[]}var Hz=Kz,qz=Rz,Gz=Ev,Yz=Hz;function Jz(e){return Gz(e)?Yz(e):qz(e)}var Zz=Jz,Qz=wz,Xz=Ev,eO=Zz,tO=ns;function rO(e){return function(t){t=tO(t);var r=Xz(t)?eO(t):void 0,n=r?r[0]:t.charAt(0),s=r?Qz(r,1).join(""):t.slice(1);return n[e]()+s}}var nO=rO,sO=nO,oO=sO("toUpperCase"),aO=oO,iO=vz,lO=aO,cO=iO(function(e,t,r){return e+(r?" ":"")+lO(t)}),Mv=cO;const zv=Se(Mv);var uO=Jt();const dO=Se(uO);var fO=Math.ceil,hO=Math.max;function pO(e,t,r,n){for(var s=-1,o=hO(fO((t-e)/(r||1)),0),a=Array(o);o--;)a[n?o:++s]=e,e+=r;return a}var mO=pO,gO=io,vO=mr,yO=fo,bO=xt;function xO(e,t,r){if(!bO(r))return!1;var n=typeof t;return(n=="number"?vO(r)&&yO(t,r.length):n=="string"&&t in r)?gO(r[t],e):!1}var Ov=xO,wO=/\s/;function kO(e){for(var t=e.length;t--&&wO.test(e.charAt(t)););return t}var _O=kO,CO=_O,$O=/^\s+/;function SO(e){return e&&e.slice(0,CO(e)+1).replace($O,"")}var jO=SO,EO=jO,tp=xt,AO=Zn,rp=NaN,NO=/^[-+]0x[0-9a-f]+$/i,PO=/^0b[01]+$/i,RO=/^0o[0-7]+$/i,TO=parseInt;function IO(e){if(typeof e=="number")return e;if(AO(e))return rp;if(tp(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=tp(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=EO(e);var r=PO.test(e);return r||RO.test(e)?TO(e.slice(2),r?2:8):NO.test(e)?rp:+e}var Dv=IO,MO=Dv,np=1/0,zO=17976931348623157e292;function OO(e){if(!e)return e===0?e:0;if(e=MO(e),e===np||e===-np){var t=e<0?-1:1;return t*zO}return e===e?e:0}var Lv=OO,DO=mO,LO=Ov,nl=Lv;function FO(e){return function(t,r,n){return n&&typeof n!="number"&&LO(t,r,n)&&(r=n=void 0),t=nl(t),r===void 0?(r=t,t=0):r=nl(r),n=n===void 0?t<r?1:-1:nl(n),DO(t,r,n,e)}}var BO=FO,UO=BO,WO=UO(),VO=WO;const Fv=Se(VO);var KO=Object.prototype,HO=KO.hasOwnProperty;function qO(e,t){return e!=null&&HO.call(e,t)}var GO=qO,YO=GO,JO=fv;function ZO(e,t){return e!=null&&JO(e,t,YO)}var QO=ZO;const Bv=Se(QO);var XO=fn,eD=mr,tD=Jt();function rD(e){return function(t,r,n){var s=Object(t);if(!eD(t)){var o=XO(r);t=tD(t),r=function(i){return o(s[i],i,s)}}var a=e(t,r,n);return a>-1?s[o?t[a]:a]:void 0}}var nD=rD;function sD(e,t,r,n){for(var s=e.length,o=r+(n?1:-1);n?o--:++o<s;)if(t(e[o],o,e))return o;return-1}var Uv=sD,oD=Lv;function aD(e){var t=oD(e),r=t%1;return t===t?r?t-r:t:0}var po=aD,iD=Uv,lD=fn,cD=po,uD=Math.max;function dD(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var s=r==null?0:cD(r);return s<0&&(s=uD(n+s,0)),iD(e,lD(t),s)}var fD=dD,hD=nD,pD=fD,mD=hD(pD),gD=mD;const vD=Se(gD);function yD(e){return e!==e}var bD=yD;function xD(e,t,r){for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}var wD=xD,kD=Uv,_D=bD,CD=wD;function $D(e,t,r){return t===t?CD(e,t,r):kD(e,_D,r)}var Wv=$D,SD=Ir,jD=Ue,ED=bt,AD="[object String]";function ND(e){return typeof e=="string"||!jD(e)&&ED(e)&&SD(e)==AD}var PD=ND,RD=ho;function TD(e,t){return RD(t,function(r){return e[r]})}var ID=TD,MD=ID,zD=Jt();function OD(e){return e==null?[]:MD(e,zD(e))}var DD=OD,LD=Wv,FD=mr,BD=PD,UD=po,WD=DD,VD=Math.max;function KD(e,t,r,n){e=FD(e)?e:WD(e),r=r&&!n?UD(r):0;var s=e.length;return r<0&&(r=VD(s+r,0)),BD(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&LD(e,t,r)>-1}var HD=KD;const Vv=Se(HD);var $c={exports:{}},Kv={},Mt={},Vn={},mo={},be={},so={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(b){if(super(),!e.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((C,w)=>`${C}${w}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((C,w)=>(w instanceof r&&(C[w.str]=(C[w.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function s(y,...b){const C=[y[0]];let w=0;for(;w<b.length;)i(C,b[w]),C.push(y[++w]);return new n(C)}e._=s;const o=new n("+");function a(y,...b){const C=[h(y[0])];let w=0;for(;w<b.length;)C.push(o),i(C,b[w]),C.push(o,h(y[++w]));return c(C),new n(C)}e.str=a;function i(y,b){b instanceof n?y.push(...b._items):b instanceof r?y.push(b):y.push(f(b))}e.addCodeArg=i;function c(y){let b=1;for(;b<y.length-1;){if(y[b]===o){const C=u(y[b-1],y[b+1]);if(C!==void 0){y.splice(b-1,3,C);continue}y[b++]="+"}b++}}function u(y,b){if(b==='""')return y;if(y==='""')return b;if(typeof y=="string")return b instanceof r||y[y.length-1]!=='"'?void 0:typeof b!="string"?`${y.slice(0,-1)}${b}"`:b[0]==='"'?y.slice(0,-1)+b.slice(1):void 0;if(typeof b=="string"&&b[0]==='"'&&!(y instanceof r))return`"${y}${b.slice(1)}`}function d(y,b){return b.emptyStr()?y:y.emptyStr()?b:a`${y}${b}`}e.strConcat=d;function f(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:h(Array.isArray(y)?y.join(","):y)}function p(y){return new n(h(y))}e.stringify=p;function h(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function g(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=g;function m(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=m;function v(y){return new n(y.toString())}e.regexpCode=v})(so);var Sc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=so;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,f;if(!((f=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||f===void 0)&&f.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=s;class o extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:f}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${f}]`}}e.ValueScopeName=o;const a=(0,t._)`\n`;class i extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:t.nil}}get(){return this._scope}name(u){return new o(u,this._newName(u))}value(u,d){var f;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const p=this.toName(u),{prefix:h}=p,g=(f=d.key)!==null&&f!==void 0?f:d.ref;let m=this._values[h];if(m){const b=m.get(g);if(b)return b}else m=this._values[h]=new Map;m.set(g,p);const v=this._scope[h]||(this._scope[h]=[]),y=v.length;return v[y]=d.ref,p.setValue(d,{property:h,itemIndex:y}),p}getValue(u,d){const f=this._values[u];if(f)return f.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${u}${f.scopePath}`})}scopeCode(u=this._values,d,f){return this._reduceValues(u,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},d,f)}_reduceValues(u,d,f={},p){let h=t.nil;for(const g in u){const m=u[g];if(!m)continue;const v=f[g]=f[g]||new Map;m.forEach(y=>{if(v.has(y))return;v.set(y,n.Started);let b=d(y);if(b){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${C} ${y} = ${b};${this.opts._n}`}else if(b=p==null?void 0:p(y))h=(0,t._)`${h}${b}${this.opts._n}`;else throw new r(y);v.set(y,n.Completed)})}return h}}e.ValueScope=i})(Sc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=so,r=Sc;var n=so;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Sc;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(k,$){return this}}class a extends o{constructor(k,$,A){super(),this.varKind=k,this.name=$,this.rhs=A}render({es5:k,_n:$}){const A=k?r.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${A} ${this.name}${W};`+$}optimizeNames(k,$){if(k[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,k,$)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends o{constructor(k,$,A){super(),this.lhs=k,this.rhs=$,this.sideEffects=A}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,$){if(!(this.lhs instanceof t.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=O(this.rhs,k,$),this}get names(){const k=this.lhs instanceof t.Name?{}:{...this.lhs.names};return K(k,this.rhs)}}class c extends i{constructor(k,$,A,W){super(k,A,W),this.op=$}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class u extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class d extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class f extends o{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class p extends o{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,$){return this.code=O(this.code,k,$),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce(($,A)=>$+A.render(k),"")}optimizeNodes(){const{nodes:k}=this;let $=k.length;for(;$--;){const A=k[$].optimizeNodes();Array.isArray(A)?k.splice($,1,...A):A?k[$]=A:k.splice($,1)}return k.length>0?this:void 0}optimizeNames(k,$){const{nodes:A}=this;let W=A.length;for(;W--;){const H=A[W];H.optimizeNames(k,$)||(q(k,H.names),A.splice(W,1))}return A.length>0?this:void 0}get names(){return this.nodes.reduce((k,$)=>P(k,$.names),{})}}class g extends h{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class m extends h{}class v extends g{}v.kind="else";class y extends g{constructor(k,$){super($),this.condition=k}render(k){let $=`if(${this.condition})`+super.render(k);return this.else&&($+="else "+this.else.render(k)),$}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let $=this.else;if($){const A=$.optimizeNodes();$=this.else=Array.isArray(A)?new v(A):A}if($)return k===!1?$ instanceof y?$:$.nodes:this.nodes.length?this:new y(V(k),$ instanceof y?[$]:$.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,$){var A;if(this.else=(A=this.else)===null||A===void 0?void 0:A.optimizeNames(k,$),!!(super.optimizeNames(k,$)||this.else))return this.condition=O(this.condition,k,$),this}get names(){const k=super.names;return K(k,this.condition),this.else&&P(k,this.else.names),k}}y.kind="if";class b extends g{}b.kind="for";class C extends b{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,$){if(super.optimizeNames(k,$))return this.iteration=O(this.iteration,k,$),this}get names(){return P(super.names,this.iteration.names)}}class w extends b{constructor(k,$,A,W){super(),this.varKind=k,this.name=$,this.from=A,this.to=W}render(k){const $=k.es5?r.varKinds.var:this.varKind,{name:A,from:W,to:H}=this;return`for(${$} ${A}=${W}; ${A}<${H}; ${A}++)`+super.render(k)}get names(){const k=K(super.names,this.from);return K(k,this.to)}}class _ extends b{constructor(k,$,A,W){super(),this.loop=k,this.varKind=$,this.name=A,this.iterable=W}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,$){if(super.optimizeNames(k,$))return this.iterable=O(this.iterable,k,$),this}get names(){return P(super.names,this.iterable.names)}}class R extends g{constructor(k,$,A){super(),this.name=k,this.args=$,this.async=A}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}R.kind="func";class z extends h{render(k){return"return "+super.render(k)}}z.kind="return";class D extends g{render(k){let $="try"+super.render(k);return this.catch&&($+=this.catch.render(k)),this.finally&&($+=this.finally.render(k)),$}optimizeNodes(){var k,$;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),($=this.finally)===null||$===void 0||$.optimizeNodes(),this}optimizeNames(k,$){var A,W;return super.optimizeNames(k,$),(A=this.catch)===null||A===void 0||A.optimizeNames(k,$),(W=this.finally)===null||W===void 0||W.optimizeNames(k,$),this}get names(){const k=super.names;return this.catch&&P(k,this.catch.names),this.finally&&P(k,this.finally.names),k}}class j extends g{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}j.kind="catch";class S extends g{render(k){return"finally"+super.render(k)}}S.kind="finally";class E{constructor(k,$={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...$,_n:$.lines?`
121
- `:""},this._extScope=k,this._scope=new r.Scope({parent:k}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,$){const A=this._extScope.value(k,$);return(this._values[A.prefix]||(this._values[A.prefix]=new Set)).add(A),A}getScopeValue(k,$){return this._extScope.getValue(k,$)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,$,A,W){const H=this._scope.toName($);return A!==void 0&&W&&(this._constants[H.str]=A),this._leafNode(new a(k,H,A)),H}const(k,$,A){return this._def(r.varKinds.const,k,$,A)}let(k,$,A){return this._def(r.varKinds.let,k,$,A)}var(k,$,A){return this._def(r.varKinds.var,k,$,A)}assign(k,$,A){return this._leafNode(new i(k,$,A))}add(k,$){return this._leafNode(new c(k,e.operators.ADD,$))}code(k){return typeof k=="function"?k():k!==t.nil&&this._leafNode(new p(k)),this}object(...k){const $=["{"];for(const[A,W]of k)$.length>1&&$.push(","),$.push(A),(A!==W||this.opts.es5)&&($.push(":"),(0,t.addCodeArg)($,W));return $.push("}"),new t._Code($)}if(k,$,A){if(this._blockNode(new y(k)),$&&A)this.code($).else().code(A).endIf();else if($)this.code($).endIf();else if(A)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new y(k))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(k,$){return this._blockNode(k),$&&this.code($).endFor(),this}for(k,$){return this._for(new C(k),$)}forRange(k,$,A,W,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(k);return this._for(new w(H,ee,$,A),()=>W(ee))}forOf(k,$,A,W=r.varKinds.const){const H=this._scope.toName(k);if(this.opts.es5){const ee=$ instanceof t.Name?$:this.var("_arr",$);return this.forRange("_i",0,(0,t._)`${ee}.length`,re=>{this.var(H,(0,t._)`${ee}[${re}]`),A(H)})}return this._for(new _("of",W,H,$),()=>A(H))}forIn(k,$,A,W=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,t._)`Object.keys(${$})`,A);const H=this._scope.toName(k);return this._for(new _("in",W,H,$),()=>A(H))}endFor(){return this._endBlockNode(b)}label(k){return this._leafNode(new u(k))}break(k){return this._leafNode(new d(k))}return(k){const $=new z;if(this._blockNode($),this.code(k),$.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(z)}try(k,$,A){if(!$&&!A)throw new Error('CodeGen: "try" without "catch" and "finally"');const W=new D;if(this._blockNode(W),this.code(k),$){const H=this.name("e");this._currNode=W.catch=new j(H),$(H)}return A&&(this._currNode=W.finally=new S,this.code(A)),this._endBlockNode(j,S)}throw(k){return this._leafNode(new f(k))}block(k,$){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock($),this}endBlock(k){const $=this._blockStarts.pop();if($===void 0)throw new Error("CodeGen: not in self-balancing block");const A=this._nodes.length-$;if(A<0||k!==void 0&&A!==k)throw new Error(`CodeGen: wrong number of nodes: ${A} vs ${k} expected`);return this._nodes.length=$,this}func(k,$=t.nil,A,W){return this._blockNode(new R(k,$,A)),W&&this.code(W).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,$){const A=this._currNode;if(A instanceof k||$&&A instanceof $)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${$?`${k.kind}/${$.kind}`:k.kind}"`)}_elseNode(k){const $=this._currNode;if(!($ instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=$.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const $=this._nodes;$[$.length-1]=k}}e.CodeGen=E;function P(I,k){for(const $ in k)I[$]=(I[$]||0)+(k[$]||0);return I}function K(I,k){return k instanceof t._CodeOrName?P(I,k.names):I}function O(I,k,$){if(I instanceof t.Name)return A(I);if(!W(I))return I;return new t._Code(I._items.reduce((H,ee)=>(ee instanceof t.Name&&(ee=A(ee)),ee instanceof t._Code?H.push(...ee._items):H.push(ee),H),[]));function A(H){const ee=$[H.str];return ee===void 0||k[H.str]!==1?H:(delete k[H.str],ee)}function W(H){return H instanceof t._Code&&H._items.some(ee=>ee instanceof t.Name&&k[ee.str]===1&&$[ee.str]!==void 0)}}function q(I,k){for(const $ in k)I[$]=(I[$]||0)-(k[$]||0)}function V(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${Z(I)}`}e.not=V;const L=N(e.operators.AND);function U(...I){return I.reduce(L)}e.and=U;const oe=N(e.operators.OR);function Y(...I){return I.reduce(oe)}e.or=Y;function N(I){return(k,$)=>k===t.nil?$:$===t.nil?k:(0,t._)`${Z(k)} ${I} ${Z($)}`}function Z(I){return I instanceof t.Name?I:(0,t._)`(${I})`}})(be);var ne={};Object.defineProperty(ne,"__esModule",{value:!0});ne.checkStrictMode=ne.getErrorPath=ne.Type=ne.useFunc=ne.setEvaluated=ne.evaluatedPropsToName=ne.mergeEvaluated=ne.eachItem=ne.unescapeJsonPointer=ne.escapeJsonPointer=ne.escapeFragment=ne.unescapeFragment=ne.schemaRefOrVal=ne.schemaHasRulesButRef=ne.schemaHasRules=ne.checkUnknownRules=ne.alwaysValidSchema=ne.toHash=void 0;const Re=be,qD=so;function GD(e){const t={};for(const r of e)t[r]=!0;return t}ne.toHash=GD;function YD(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Hv(e,t),!qv(t,e.self.RULES.all))}ne.alwaysValidSchema=YD;function Hv(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;const s=n.RULES.keywords;for(const o in t)s[o]||Jv(e,`unknown keyword: "${o}"`)}ne.checkUnknownRules=Hv;function qv(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}ne.schemaHasRules=qv;function JD(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ne.schemaHasRulesButRef=JD;function ZD({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Re._)`${r}`}return(0,Re._)`${e}${t}${(0,Re.getProperty)(n)}`}ne.schemaRefOrVal=ZD;function QD(e){return Gv(decodeURIComponent(e))}ne.unescapeFragment=QD;function XD(e){return encodeURIComponent(Eu(e))}ne.escapeFragment=XD;function Eu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ne.escapeJsonPointer=Eu;function Gv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ne.unescapeJsonPointer=Gv;function eL(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}ne.eachItem=eL;function sp({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{const c=a===void 0?o:a instanceof Re.Name?(o instanceof Re.Name?e(s,o,a):t(s,o,a),a):o instanceof Re.Name?(t(s,a,o),o):r(o,a);return i===Re.Name&&!(c instanceof Re.Name)?n(s,c):c}}ne.mergeEvaluated={props:sp({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Re._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Re._)`${r} || {}`).code((0,Re._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Re._)`${r} || {}`),Au(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Yv}),items:sp({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Re._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Re._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Yv(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,Re._)`{}`);return t!==void 0&&Au(e,r,t),r}ne.evaluatedPropsToName=Yv;function Au(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Re._)`${t}${(0,Re.getProperty)(n)}`,!0))}ne.setEvaluated=Au;const op={};function tL(e,t){return e.scopeValue("func",{ref:t,code:op[t.code]||(op[t.code]=new qD._Code(t.code))})}ne.useFunc=tL;var jc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(jc||(ne.Type=jc={}));function rL(e,t,r){if(e instanceof Re.Name){const n=t===jc.Num;return r?n?(0,Re._)`"[" + ${e} + "]"`:(0,Re._)`"['" + ${e} + "']"`:n?(0,Re._)`"/" + ${e}`:(0,Re._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Re.getProperty)(e).toString():"/"+Eu(e)}ne.getErrorPath=rL;function Jv(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ne.checkStrictMode=Jv;var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});const et=be,nL={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};Zt.default=nL;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=be,r=ne,n=Zt;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:y})=>y?(0,t.str)`"${v}" keyword must be ${y} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function s(v,y=e.keywordError,b,C){const{it:w}=v,{gen:_,compositeRule:R,allErrors:z}=w,D=f(v,y,b);C??(R||z)?c(_,D):u(w,(0,t._)`[${D}]`)}e.reportError=s;function o(v,y=e.keywordError,b){const{it:C}=v,{gen:w,compositeRule:_,allErrors:R}=C,z=f(v,y,b);c(w,z),_||R||u(C,n.default.vErrors)}e.reportExtraError=o;function a(v,y){v.assign(n.default.errors,y),v.if((0,t._)`${n.default.vErrors} !== null`,()=>v.if(y,()=>v.assign((0,t._)`${n.default.vErrors}.length`,y),()=>v.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function i({gen:v,keyword:y,schemaValue:b,data:C,errsCount:w,it:_}){if(w===void 0)throw new Error("ajv implementation error");const R=v.name("err");v.forRange("i",w,n.default.errors,z=>{v.const(R,(0,t._)`${n.default.vErrors}[${z}]`),v.if((0,t._)`${R}.instancePath === undefined`,()=>v.assign((0,t._)`${R}.instancePath`,(0,t.strConcat)(n.default.instancePath,_.errorPath))),v.assign((0,t._)`${R}.schemaPath`,(0,t.str)`${_.errSchemaPath}/${y}`),_.opts.verbose&&(v.assign((0,t._)`${R}.schema`,b),v.assign((0,t._)`${R}.data`,C))})}e.extendErrors=i;function c(v,y){const b=v.const("err",y);v.if((0,t._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,t._)`[${b}]`),(0,t._)`${n.default.vErrors}.push(${b})`),v.code((0,t._)`${n.default.errors}++`)}function u(v,y){const{gen:b,validateName:C,schemaEnv:w}=v;w.$async?b.throw((0,t._)`new ${v.ValidationError}(${y})`):(b.assign((0,t._)`${C}.errors`,y),b.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function f(v,y,b){const{createErrors:C}=v.it;return C===!1?(0,t._)`{}`:p(v,y,b)}function p(v,y,b={}){const{gen:C,it:w}=v,_=[h(w,b),g(v,b)];return m(v,y,_),C.object(..._)}function h({errorPath:v},{instancePath:y}){const b=y?(0,t.str)`${v}${(0,r.getErrorPath)(y,r.Type.Str)}`:v;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,b)]}function g({keyword:v,it:{errSchemaPath:y}},{schemaPath:b,parentSchema:C}){let w=C?y:(0,t.str)`${y}/${v}`;return b&&(w=(0,t.str)`${w}${(0,r.getErrorPath)(b,r.Type.Str)}`),[d.schemaPath,w]}function m(v,{params:y,message:b},C){const{keyword:w,data:_,schemaValue:R,it:z}=v,{opts:D,propertyName:j,topSchemaRef:S,schemaPath:E}=z;C.push([d.keyword,w],[d.params,typeof y=="function"?y(v):y||(0,t._)`{}`]),D.messages&&C.push([d.message,typeof b=="function"?b(v):b]),D.verbose&&C.push([d.schema,R],[d.parentSchema,(0,t._)`${S}${E}`],[n.default.data,_]),j&&C.push([d.propertyName,j])}})(mo);Object.defineProperty(Vn,"__esModule",{value:!0});Vn.boolOrEmptySchema=Vn.topBoolOrEmptySchema=void 0;const sL=mo,oL=be,aL=Zt,iL={message:"boolean schema is false"};function lL(e){const{gen:t,schema:r,validateName:n}=e;r===!1?Zv(e,!1):typeof r=="object"&&r.$async===!0?t.return(aL.default.data):(t.assign((0,oL._)`${n}.errors`,null),t.return(!0))}Vn.topBoolOrEmptySchema=lL;function cL(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Zv(e)):r.var(t,!0)}Vn.boolOrEmptySchema=cL;function Zv(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,sL.reportError)(s,iL,void 0,t)}var He={},sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.getRules=sn.isJSONType=void 0;const uL=["string","number","integer","boolean","null","object","array"],dL=new Set(uL);function fL(e){return typeof e=="string"&&dL.has(e)}sn.isJSONType=fL;function hL(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}sn.getRules=hL;var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.shouldUseRule=ir.shouldUseGroup=ir.schemaHasRulesForType=void 0;function pL({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Qv(e,n)}ir.schemaHasRulesForType=pL;function Qv(e,t){return t.rules.some(r=>Xv(e,r))}ir.shouldUseGroup=Qv;function Xv(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ir.shouldUseRule=Xv;Object.defineProperty(He,"__esModule",{value:!0});He.reportTypeError=He.checkDataTypes=He.checkDataType=He.coerceAndCheckDataType=He.getJSONTypes=He.getSchemaTypes=He.DataType=void 0;const mL=sn,gL=ir,vL=mo,ve=be,ey=ne;var Ln;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ln||(He.DataType=Ln={}));function yL(e){const t=ty(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}He.getSchemaTypes=yL;function ty(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(mL.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}He.getJSONTypes=ty;function bL(e,t){const{gen:r,data:n,opts:s}=e,o=xL(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,gL.schemaHasRulesForType)(e,t[0]));if(a){const i=Nu(t,n,s.strictNumbers,Ln.Wrong);r.if(i,()=>{o.length?wL(e,t,o):Pu(e)})}return a}He.coerceAndCheckDataType=bL;const ry=new Set(["string","number","integer","boolean","null"]);function xL(e,t){return t?e.filter(r=>ry.has(r)||t==="array"&&r==="array"):[]}function wL(e,t,r){const{gen:n,data:s,opts:o}=e,a=n.let("dataType",(0,ve._)`typeof ${s}`),i=n.let("coerced",(0,ve._)`undefined`);o.coerceTypes==="array"&&n.if((0,ve._)`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,ve._)`${s}[0]`).assign(a,(0,ve._)`typeof ${s}`).if(Nu(t,s,o.strictNumbers),()=>n.assign(i,s))),n.if((0,ve._)`${i} !== undefined`);for(const u of r)(ry.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);n.else(),Pu(e),n.endIf(),n.if((0,ve._)`${i} !== undefined`,()=>{n.assign(s,i),kL(e,i)});function c(u){switch(u){case"string":n.elseIf((0,ve._)`${a} == "number" || ${a} == "boolean"`).assign(i,(0,ve._)`"" + ${s}`).elseIf((0,ve._)`${s} === null`).assign(i,(0,ve._)`""`);return;case"number":n.elseIf((0,ve._)`${a} == "boolean" || ${s} === null
119
+ `+e.slice(a+1):c+=e.slice(s),c.slice(1)}function Wj(e){for(var t="",r=0,n,s=0;s<e.length;r>=65536?s+=2:s++)r=Is(e,s),n=at[r],!n&&no(r)?(t+=e[s],r>=65536&&(t+=e[s+1])):t+=n||Ij(r);return t}function Vj(e,t,r){var n="",s=e.tag,o,a,i;for(o=0,a=r.length;o<a;o+=1)i=r[o],e.replacer&&(i=e.replacer.call(r,String(o),i)),(dr(e,t,i,!1,!1)||typeof i>"u"&&dr(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=s,e.dump="["+n+"]"}function ph(e,t,r,n){var s="",o=e.tag,a,i,c;for(a=0,i=r.length;a<i;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(dr(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&dr(e,t+1,null,!0,!0,!1,!0))&&((!n||s!=="")&&(s+=fc(e,t)),e.dump&&to===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=o,e.dump=s||"[]"}function Kj(e,t,r){var n="",s=e.tag,o=Object.keys(r),a,i,c,u,d;for(a=0,i=o.length;a<i;a+=1)d="",n!==""&&(d+=", "),e.condenseFlow&&(d+='"'),c=o[a],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),dr(e,t,c,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),dr(e,t,u,!1,!1)&&(d+=e.dump,n+=d));e.tag=s,e.dump="{"+n+"}"}function Hj(e,t,r,n){var s="",o=e.tag,a=Object.keys(r),i,c,u,d,f,p;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Ct("sortKeys must be a boolean or a function");for(i=0,c=a.length;i<c;i+=1)p="",(!n||s!=="")&&(p+=fc(e,t)),u=a[i],d=r[u],e.replacer&&(d=e.replacer.call(r,u,d)),dr(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&to===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,f&&(p+=fc(e,t)),dr(e,t+1,d,!0,f)&&(e.dump&&to===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,s+=p));e.tag=o,e.dump=s||"{}"}function mh(e,t,r){var n,s,o,a,i,c;for(s=r?e.explicitTypes:e.implicitTypes,o=0,a=s.length;o<a;o+=1)if(i=s[o],(i.instanceOf||i.predicate)&&(!i.instanceOf||typeof t=="object"&&t instanceof i.instanceOf)&&(!i.predicate||i.predicate(t))){if(r?i.multi&&i.representName?e.tag=i.representName(t):e.tag=i.tag:e.tag="?",i.represent){if(c=e.styleMap[i.tag]||i.defaultStyle,_0.call(i.represent)==="[object Function]")n=i.represent(t,c);else if(C0.call(i.represent,c))n=i.represent[c](t,c);else throw new Ct("!<"+i.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function dr(e,t,r,n,s,o,a){e.tag=null,e.dump=r,mh(e,r,!1)||mh(e,r,!0);var i=_0.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var d=i==="[object Object]"||i==="[object Array]",f,p;if(d&&(f=e.duplicates.indexOf(r),p=f!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(s=!1),p&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),i==="[object Object]")n&&Object.keys(e.dump).length!==0?(Hj(e,t,e.dump,s),p&&(e.dump="&ref_"+f+e.dump)):(Kj(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(i==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?ph(e,t-1,e.dump,s):ph(e,t,e.dump,s),p&&(e.dump="&ref_"+f+e.dump)):(Vj(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(i==="[object String]")e.tag!=="?"&&Bj(e,e.dump,t,o,c);else{if(i==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ct("unacceptable kind of an object to dump "+i)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Gj(e,t){var r=[],n=[],s,o;for(pc(e,r,n),s=0,o=n.length;s<o;s+=1)t.duplicates.push(r[n[s]]);t.usedDuplicates=new Array(o)}function pc(e,t,r){var n,s,o;if(e!==null&&typeof e=="object")if(s=t.indexOf(e),s!==-1)r.indexOf(s)===-1&&r.push(s);else if(t.push(e),Array.isArray(e))for(s=0,o=e.length;s<o;s+=1)pc(e[s],t,r);else for(n=Object.keys(e),s=0,o=n.length;s<o;s+=1)pc(e[n[s]],t,r)}function qj(e,t){t=t||{};var r=new zj(t);r.noRefs||Gj(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),dr(r,0,n,!0,!0)?r.dump+`
120
+ `:""}var Yj=qj,Jj={dump:Yj},Zj=Jj.dump;function Qj(e){const t=new Date(e),r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`}function Xj({text:e}){const t=x.useMemo(()=>uu(e),[e]);return l.jsx("span",{className:"log-text [&_p]:inline [&_p]:m-0",dangerouslySetInnerHTML:{__html:t}})}function I0(e){try{return Zj(e,{indent:2,lineWidth:80,noRefs:!0}).trimEnd()}catch{return JSON.stringify(e,null,2)}}function eE(e){const t=JSON.stringify(e);return t.length>60?t.slice(0,59)+"…}":t}function tE({obj:e}){const t=x.useMemo(()=>I0(e),[e]);return l.jsx("pre",{className:"mt-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:t})}function rE({obj:e}){const[t,r]=x.useState(!1),n=x.useMemo(()=>I0(e),[e]),s=x.useMemo(()=>eE(e),[e]);return t?l.jsxs("div",{style:{flexBasis:"100%"},className:"mt-1 flex items-start gap-1",children:[l.jsx("button",{type:"button",onClick:()=>r(!1),className:"inline-flex items-center shrink-0 px-1 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Collapse",children:l.jsx(a1,{size:10})}),l.jsx("pre",{className:"flex-1 px-2 py-1.5 rounded text-[10px] font-mono leading-relaxed overflow-x-auto",style:{background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.1))",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-panel-border)"},children:n})]}):l.jsx("button",{type:"button",onClick:()=>r(!0),className:"font-mono text-[10px] ml-1 px-1 rounded transition-colors vscode-hover-bg cursor-pointer",style:{color:"var(--vscode-descriptionForeground)",background:"var(--vscode-textCodeBlock-background, rgba(0,0,0,0.08))"},title:"Click to expand",children:s})}function Bo({label:e,children:t}){const[r,n]=x.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>n(!r),className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:[e,l.jsx(Ze,{size:10})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),l.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 rounded shadow-lg py-1 min-w-[120px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},onClick:()=>n(!1),children:t})]})]})}function Ji({label:e,active:t,onClick:r}){return l.jsxs("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[l.jsx("span",{className:"w-3",children:t&&l.jsx(St,{size:10})}),e]})}function Uo({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-1 text-[10px] transition-colors vscode-hover-bg flex items-center gap-2",style:{color:"var(--vscode-foreground)"},children:[l.jsx("span",{className:"w-3 h-3 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(St,{size:8,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),e]})}function M0({logs:e,onClearLogs:t,logsFilter:r,onLogsFilterChange:n}){const[s,o]=x.useState(()=>(r==null?void 0:r.limit)??"all"),[a,i]=x.useState(()=>(r==null?void 0:r.order)??"desc"),[c,u]=x.useState(()=>new Set((r==null?void 0:r.disabledSources)??[])),[d,f]=x.useState(()=>(r==null?void 0:r.show)??{timestamp:!0,source:!0,objects:!1}),p=x.useMemo(()=>{const m=new Set;for(const v of e)m.add(v.source);return Array.from(m).sort()},[e]),h=x.useMemo(()=>{let m=e;return c.size>0&&(m=m.filter(v=>!c.has(v.source))),m=[...m],a==="desc"&&m.reverse(),s!=="all"&&(m=m.slice(0,s)),m},[e,c,a,s]),g=[10,25,50,100,"all"];return x.useEffect(()=>{n==null||n({limit:s,order:a,disabledSources:Array.from(c),show:d})},[s,a,c,d]),l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"card-log-toolbar shrink-0",children:[l.jsxs("button",{type:"button",onClick:t,disabled:e.length===0,className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] rounded transition-colors vscode-hover-bg disabled:opacity-40",style:{color:"var(--vscode-descriptionForeground)"},title:"Clear all logs",children:[l.jsx(Kt,{size:10}),"Clear"]}),l.jsx("span",{className:"w-px h-4 mx-0.5",style:{background:"var(--vscode-panel-border)"}}),l.jsx(Bo,{label:l.jsxs(l.Fragment,{children:["Limit: ",s]}),children:g.map(m=>l.jsx(Ji,{label:String(m),active:s===m,onClick:()=>o(m)},String(m)))}),l.jsxs(Bo,{label:l.jsxs(l.Fragment,{children:["Order: ",a==="desc"?"Newest":"Oldest"]}),children:[l.jsx(Ji,{label:"Newest first",active:a==="desc",onClick:()=>i("desc")}),l.jsx(Ji,{label:"Oldest first",active:a==="asc",onClick:()=>i("asc")})]}),p.length>0&&l.jsx(Bo,{label:`Sources (${p.filter(m=>!c.has(m)).length}/${p.length})`,children:l.jsx("div",{onClick:m=>m.stopPropagation(),children:p.map(m=>l.jsx(Uo,{label:m,checked:!c.has(m),onChange:v=>u(y=>{const b=new Set(y);return v?b.delete(m):b.add(m),b})},m))})}),l.jsx(Bo,{label:"Show",children:l.jsxs("div",{onClick:m=>m.stopPropagation(),children:[l.jsx(Uo,{label:"Timestamp",checked:d.timestamp,onChange:m=>f(v=>({...v,timestamp:m}))}),l.jsx(Uo,{label:"Source",checked:d.source,onChange:m=>f(v=>({...v,source:m}))}),l.jsx(Uo,{label:"Objects",checked:d.objects,onChange:m=>f(v=>({...v,objects:m}))})]})}),l.jsxs("span",{className:"card-log-count",children:[h.length,s!=="all"&&e.length>s?` / ${e.length}`:""," entries"]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:h.length===0?l.jsx("p",{className:"p-4 text-xs italic",style:{color:"var(--vscode-descriptionForeground)"},children:e.length===0?"No log entries yet.":"No entries match the current filters."}):l.jsx("div",{className:"flex flex-col",children:h.map((m,v)=>l.jsxs("div",{className:"card-log-entry px-4 py-2 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.timestamp&&l.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--vscode-descriptionForeground)"},title:m.timestamp,children:Qj(m.timestamp)}),d.source&&l.jsx("span",{className:"text-[10px] font-medium px-1 rounded shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m.source}),l.jsx("span",{className:"comment-markdown inline text-xs leading-normal [&_p]:inline [&_p]:m-0",style:{color:"var(--vscode-foreground)"},children:l.jsx(Xj,{text:m.text})}),!d.objects&&m.object&&l.jsx(rE,{obj:m.object})]}),d.objects&&m.object&&l.jsx(tE,{obj:m.object})]},`${m.timestamp}-${v}`))})})]})}var nE=typeof Mo=="object"&&Mo&&Mo.Object===Object&&Mo,z0=nE,sE=z0,oE=typeof self=="object"&&self&&self.Object===Object&&self,aE=sE||oE||Function("return this")(),ut=aE,iE=ut,lE=iE.Symbol,Jn=lE,gh=Jn,O0=Object.prototype,cE=O0.hasOwnProperty,uE=O0.toString,$s=gh?gh.toStringTag:void 0;function dE(e){var t=cE.call(e,$s),r=e[$s];try{e[$s]=void 0;var n=!0}catch{}var s=uE.call(e);return n&&(t?e[$s]=r:delete e[$s]),s}var fE=dE,hE=Object.prototype,pE=hE.toString;function mE(e){return pE.call(e)}var gE=mE,vh=Jn,vE=fE,yE=gE,bE="[object Null]",xE="[object Undefined]",yh=vh?vh.toStringTag:void 0;function wE(e){return e==null?e===void 0?xE:bE:yh&&yh in Object(e)?vE(e):yE(e)}var Ir=wE;function kE(e){return e!=null&&typeof e=="object"}var bt=kE,_E=Ir,CE=bt,$E="[object Symbol]";function SE(e){return typeof e=="symbol"||CE(e)&&_E(e)==$E}var Zn=SE,jE=Zn;function EE(e,t,r){for(var n=-1,s=e.length;++n<s;){var o=e[n],a=t(o);if(a!=null&&(i===void 0?a===a&&!jE(a):r(a,i)))var i=a,c=o}return c}var AE=EE;function NE(e,t){return e>t}var PE=NE;function RE(){this.__data__=[],this.size=0}var TE=RE;function IE(e,t){return e===t||e!==e&&t!==t}var io=IE,ME=io;function zE(e,t){for(var r=e.length;r--;)if(ME(e[r][0],t))return r;return-1}var fi=zE,OE=fi,DE=Array.prototype,LE=DE.splice;function FE(e){var t=this.__data__,r=OE(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():LE.call(t,r,1),--this.size,!0}var BE=FE,UE=fi;function WE(e){var t=this.__data__,r=UE(t,e);return r<0?void 0:t[r][1]}var VE=WE,KE=fi;function HE(e){return KE(this.__data__,e)>-1}var GE=HE,qE=fi;function YE(e,t){var r=this.__data__,n=qE(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var JE=YE,ZE=TE,QE=BE,XE=VE,eA=GE,tA=JE;function Qn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qn.prototype.clear=ZE;Qn.prototype.delete=QE;Qn.prototype.get=XE;Qn.prototype.has=eA;Qn.prototype.set=tA;var hi=Qn,rA=hi;function nA(){this.__data__=new rA,this.size=0}var sA=nA;function oA(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var aA=oA;function iA(e){return this.__data__.get(e)}var lA=iA;function cA(e){return this.__data__.has(e)}var uA=cA;function dA(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xt=dA,fA=Ir,hA=xt,pA="[object AsyncFunction]",mA="[object Function]",gA="[object GeneratorFunction]",vA="[object Proxy]";function yA(e){if(!hA(e))return!1;var t=fA(e);return t==mA||t==gA||t==pA||t==vA}var lo=yA;const bA=Se(lo);var xA=ut,wA=xA["__core-js_shared__"],kA=wA,Zi=kA,bh=function(){var e=/[^.]+$/.exec(Zi&&Zi.keys&&Zi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _A(e){return!!bh&&bh in e}var CA=_A,$A=Function.prototype,SA=$A.toString;function jA(e){if(e!=null){try{return SA.call(e)}catch{}try{return e+""}catch{}}return""}var D0=jA,EA=lo,AA=CA,NA=xt,PA=D0,RA=/[\\^$.*+?()[\]{}|]/g,TA=/^\[object .+?Constructor\]$/,IA=Function.prototype,MA=Object.prototype,zA=IA.toString,OA=MA.hasOwnProperty,DA=RegExp("^"+zA.call(OA).replace(RA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function LA(e){if(!NA(e)||AA(e))return!1;var t=EA(e)?DA:TA;return t.test(PA(e))}var FA=LA;function BA(e,t){return e==null?void 0:e[t]}var UA=BA,WA=FA,VA=UA;function KA(e,t){var r=VA(e,t);return WA(r)?r:void 0}var cn=KA,HA=cn,GA=ut,qA=HA(GA,"Map"),hu=qA,YA=cn,JA=YA(Object,"create"),pi=JA,xh=pi;function ZA(){this.__data__=xh?xh(null):{},this.size=0}var QA=ZA;function XA(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var eN=XA,tN=pi,rN="__lodash_hash_undefined__",nN=Object.prototype,sN=nN.hasOwnProperty;function oN(e){var t=this.__data__;if(tN){var r=t[e];return r===rN?void 0:r}return sN.call(t,e)?t[e]:void 0}var aN=oN,iN=pi,lN=Object.prototype,cN=lN.hasOwnProperty;function uN(e){var t=this.__data__;return iN?t[e]!==void 0:cN.call(t,e)}var dN=uN,fN=pi,hN="__lodash_hash_undefined__";function pN(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=fN&&t===void 0?hN:t,this}var mN=pN,gN=QA,vN=eN,yN=aN,bN=dN,xN=mN;function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=gN;Xn.prototype.delete=vN;Xn.prototype.get=yN;Xn.prototype.has=bN;Xn.prototype.set=xN;var wN=Xn,wh=wN,kN=hi,_N=hu;function CN(){this.size=0,this.__data__={hash:new wh,map:new(_N||kN),string:new wh}}var $N=CN;function SN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var jN=SN,EN=jN;function AN(e,t){var r=e.__data__;return EN(t)?r[typeof t=="string"?"string":"hash"]:r.map}var mi=AN,NN=mi;function PN(e){var t=NN(this,e).delete(e);return this.size-=t?1:0,t}var RN=PN,TN=mi;function IN(e){return TN(this,e).get(e)}var MN=IN,zN=mi;function ON(e){return zN(this,e).has(e)}var DN=ON,LN=mi;function FN(e,t){var r=LN(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var BN=FN,UN=$N,WN=RN,VN=MN,KN=DN,HN=BN;function es(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}es.prototype.clear=UN;es.prototype.delete=WN;es.prototype.get=VN;es.prototype.has=KN;es.prototype.set=HN;var pu=es,GN=hi,qN=hu,YN=pu,JN=200;function ZN(e,t){var r=this.__data__;if(r instanceof GN){var n=r.__data__;if(!qN||n.length<JN-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new YN(n)}return r.set(e,t),this.size=r.size,this}var QN=ZN,XN=hi,eP=sA,tP=aA,rP=lA,nP=uA,sP=QN;function ts(e){var t=this.__data__=new XN(e);this.size=t.size}ts.prototype.clear=eP;ts.prototype.delete=tP;ts.prototype.get=rP;ts.prototype.has=nP;ts.prototype.set=sP;var gi=ts,oP="__lodash_hash_undefined__";function aP(e){return this.__data__.set(e,oP),this}var iP=aP;function lP(e){return this.__data__.has(e)}var cP=lP,uP=pu,dP=iP,fP=cP;function Ma(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new uP;++t<r;)this.add(e[t])}Ma.prototype.add=Ma.prototype.push=dP;Ma.prototype.has=fP;var hP=Ma;function pP(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var mP=pP;function gP(e,t){return e.has(t)}var vP=gP,yP=hP,bP=mP,xP=vP,wP=1,kP=2;function _P(e,t,r,n,s,o){var a=r&wP,i=e.length,c=t.length;if(i!=c&&!(a&&c>i))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,h=r&kP?new yP:void 0;for(o.set(e,t),o.set(t,e);++f<i;){var g=e[f],m=t[f];if(n)var v=a?n(m,g,f,t,e,o):n(g,m,f,e,t,o);if(v!==void 0){if(v)continue;p=!1;break}if(h){if(!bP(t,function(y,b){if(!xP(h,b)&&(g===y||s(g,y,r,n,o)))return h.push(b)})){p=!1;break}}else if(!(g===m||s(g,m,r,n,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var L0=_P,CP=ut,$P=CP.Uint8Array,F0=$P;function SP(e){var t=-1,r=Array(e.size);return e.forEach(function(n,s){r[++t]=[s,n]}),r}var B0=SP;function jP(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var EP=jP,kh=Jn,_h=F0,AP=io,NP=L0,PP=B0,RP=EP,TP=1,IP=2,MP="[object Boolean]",zP="[object Date]",OP="[object Error]",DP="[object Map]",LP="[object Number]",FP="[object RegExp]",BP="[object Set]",UP="[object String]",WP="[object Symbol]",VP="[object ArrayBuffer]",KP="[object DataView]",Ch=kh?kh.prototype:void 0,Qi=Ch?Ch.valueOf:void 0;function HP(e,t,r,n,s,o,a){switch(r){case KP:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case VP:return!(e.byteLength!=t.byteLength||!o(new _h(e),new _h(t)));case MP:case zP:case LP:return AP(+e,+t);case OP:return e.name==t.name&&e.message==t.message;case FP:case UP:return e==t+"";case DP:var i=PP;case BP:var c=n&TP;if(i||(i=RP),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=IP,a.set(e,t);var d=NP(i(e),i(t),n,s,o,a);return a.delete(e),d;case WP:if(Qi)return Qi.call(e)==Qi.call(t)}return!1}var GP=HP;function qP(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var mu=qP,YP=Array.isArray,Ue=YP;const U0=Se(Ue);var JP=mu,ZP=Ue;function QP(e,t,r){var n=t(e);return ZP(e)?n:JP(n,r(e))}var W0=QP;function XP(e,t){for(var r=-1,n=e==null?0:e.length,s=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[s++]=a)}return o}var V0=XP;function eR(){return[]}var K0=eR,tR=V0,rR=K0,nR=Object.prototype,sR=nR.propertyIsEnumerable,$h=Object.getOwnPropertySymbols,oR=$h?function(e){return e==null?[]:(e=Object(e),tR($h(e),function(t){return sR.call(e,t)}))}:rR,gu=oR;function aR(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var iR=aR,lR=Ir,cR=bt,uR="[object Arguments]";function dR(e){return cR(e)&&lR(e)==uR}var fR=dR,Sh=fR,hR=bt,H0=Object.prototype,pR=H0.hasOwnProperty,mR=H0.propertyIsEnumerable,gR=Sh(function(){return arguments}())?Sh:function(e){return hR(e)&&pR.call(e,"callee")&&!mR.call(e,"callee")},co=gR,za={exports:{}};function vR(){return!1}var yR=vR;za.exports;(function(e,t){var r=ut,n=yR,s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,i=a?r.Buffer:void 0,c=i?i.isBuffer:void 0,u=c||n;e.exports=u})(za,za.exports);var uo=za.exports,bR=9007199254740991,xR=/^(?:0|[1-9]\d*)$/;function wR(e,t){var r=typeof e;return t=t??bR,!!t&&(r=="number"||r!="symbol"&&xR.test(e))&&e>-1&&e%1==0&&e<t}var fo=wR,kR=9007199254740991;function _R(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kR}var vu=_R,CR=Ir,$R=vu,SR=bt,jR="[object Arguments]",ER="[object Array]",AR="[object Boolean]",NR="[object Date]",PR="[object Error]",RR="[object Function]",TR="[object Map]",IR="[object Number]",MR="[object Object]",zR="[object RegExp]",OR="[object Set]",DR="[object String]",LR="[object WeakMap]",FR="[object ArrayBuffer]",BR="[object DataView]",UR="[object Float32Array]",WR="[object Float64Array]",VR="[object Int8Array]",KR="[object Int16Array]",HR="[object Int32Array]",GR="[object Uint8Array]",qR="[object Uint8ClampedArray]",YR="[object Uint16Array]",JR="[object Uint32Array]",ze={};ze[UR]=ze[WR]=ze[VR]=ze[KR]=ze[HR]=ze[GR]=ze[qR]=ze[YR]=ze[JR]=!0;ze[jR]=ze[ER]=ze[FR]=ze[AR]=ze[BR]=ze[NR]=ze[PR]=ze[RR]=ze[TR]=ze[IR]=ze[MR]=ze[zR]=ze[OR]=ze[DR]=ze[LR]=!1;function ZR(e){return SR(e)&&$R(e.length)&&!!ze[CR(e)]}var QR=ZR;function XR(e){return function(t){return e(t)}}var yu=XR,Oa={exports:{}};Oa.exports;(function(e,t){var r=z0,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o&&r.process,i=function(){try{var c=s&&s.require&&s.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();e.exports=i})(Oa,Oa.exports);var bu=Oa.exports,eT=QR,tT=yu,jh=bu,Eh=jh&&jh.isTypedArray,rT=Eh?tT(Eh):eT,vi=rT,nT=iR,sT=co,oT=Ue,aT=uo,iT=fo,lT=vi,cT=Object.prototype,uT=cT.hasOwnProperty;function dT(e,t){var r=oT(e),n=!r&&sT(e),s=!r&&!n&&aT(e),o=!r&&!n&&!s&&lT(e),a=r||n||s||o,i=a?nT(e.length,String):[],c=i.length;for(var u in e)(t||uT.call(e,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||iT(u,c)))&&i.push(u);return i}var G0=dT,fT=Object.prototype;function hT(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fT;return e===r}var yi=hT;function pT(e,t){return function(r){return e(t(r))}}var q0=pT,mT=q0,gT=mT(Object.keys,Object),vT=gT,yT=yi,bT=vT,xT=Object.prototype,wT=xT.hasOwnProperty;function kT(e){if(!yT(e))return bT(e);var t=[];for(var r in Object(e))wT.call(e,r)&&r!="constructor"&&t.push(r);return t}var xu=kT,_T=lo,CT=vu;function $T(e){return e!=null&&CT(e.length)&&!_T(e)}var mr=$T,ST=G0,jT=xu,ET=mr;function AT(e){return ET(e)?ST(e):jT(e)}var Jt=AT;const NT=Se(Jt);var PT=W0,RT=gu,TT=Jt;function IT(e){return PT(e,TT,RT)}var Y0=IT,Ah=Y0,MT=1,zT=Object.prototype,OT=zT.hasOwnProperty;function DT(e,t,r,n,s,o){var a=r&MT,i=Ah(e),c=i.length,u=Ah(t),d=u.length;if(c!=d&&!a)return!1;for(var f=c;f--;){var p=i[f];if(!(a?p in t:OT.call(t,p)))return!1}var h=o.get(e),g=o.get(t);if(h&&g)return h==t&&g==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=a;++f<c;){p=i[f];var y=e[p],b=t[p];if(n)var C=a?n(b,y,p,t,e,o):n(y,b,p,e,t,o);if(!(C===void 0?y===b||s(y,b,r,n,o):C)){m=!1;break}v||(v=p=="constructor")}if(m&&!v){var w=e.constructor,_=t.constructor;w!=_&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return o.delete(e),o.delete(t),m}var LT=DT,FT=cn,BT=ut,UT=FT(BT,"DataView"),WT=UT,VT=cn,KT=ut,HT=VT(KT,"Promise"),GT=HT,qT=cn,YT=ut,JT=qT(YT,"Set"),ZT=JT,QT=cn,XT=ut,eI=QT(XT,"WeakMap"),J0=eI,mc=WT,gc=hu,vc=GT,yc=ZT,bc=J0,Z0=Ir,rs=D0,Nh="[object Map]",tI="[object Object]",Ph="[object Promise]",Rh="[object Set]",Th="[object WeakMap]",Ih="[object DataView]",rI=rs(mc),nI=rs(gc),sI=rs(vc),oI=rs(yc),aI=rs(bc),Br=Z0;(mc&&Br(new mc(new ArrayBuffer(1)))!=Ih||gc&&Br(new gc)!=Nh||vc&&Br(vc.resolve())!=Ph||yc&&Br(new yc)!=Rh||bc&&Br(new bc)!=Th)&&(Br=function(e){var t=Z0(e),r=t==tI?e.constructor:void 0,n=r?rs(r):"";if(n)switch(n){case rI:return Ih;case nI:return Nh;case sI:return Ph;case oI:return Rh;case aI:return Th}return t});var un=Br,Xi=gi,iI=L0,lI=GP,cI=LT,Mh=un,zh=Ue,Oh=uo,uI=vi,dI=1,Dh="[object Arguments]",Lh="[object Array]",Wo="[object Object]",fI=Object.prototype,Fh=fI.hasOwnProperty;function hI(e,t,r,n,s,o){var a=zh(e),i=zh(t),c=a?Lh:Mh(e),u=i?Lh:Mh(t);c=c==Dh?Wo:c,u=u==Dh?Wo:u;var d=c==Wo,f=u==Wo,p=c==u;if(p&&Oh(e)){if(!Oh(t))return!1;a=!0,d=!1}if(p&&!d)return o||(o=new Xi),a||uI(e)?iI(e,t,r,n,s,o):lI(e,t,c,r,n,s,o);if(!(r&dI)){var h=d&&Fh.call(e,"__wrapped__"),g=f&&Fh.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,v=g?t.value():t;return o||(o=new Xi),s(m,v,r,n,o)}}return p?(o||(o=new Xi),cI(e,t,r,n,s,o)):!1}var pI=hI,mI=pI,Bh=bt;function Q0(e,t,r,n,s){return e===t?!0:e==null||t==null||!Bh(e)&&!Bh(t)?e!==e&&t!==t:mI(e,t,r,n,Q0,s)}var wu=Q0,gI=gi,vI=wu,yI=1,bI=2;function xI(e,t,r,n){var s=r.length,o=s,a=!n;if(e==null)return!o;for(e=Object(e);s--;){var i=r[s];if(a&&i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++s<o;){i=r[s];var c=i[0],u=e[c],d=i[1];if(a&&i[2]){if(u===void 0&&!(c in e))return!1}else{var f=new gI;if(n)var p=n(u,d,c,e,t,f);if(!(p===void 0?vI(d,u,yI|bI,n,f):p))return!1}}return!0}var wI=xI,kI=xt;function _I(e){return e===e&&!kI(e)}var X0=_I,CI=X0,$I=Jt;function SI(e){for(var t=$I(e),r=t.length;r--;){var n=t[r],s=e[n];t[r]=[n,s,CI(s)]}return t}var jI=SI;function EI(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var ev=EI,AI=wI,NI=jI,PI=ev;function RI(e){var t=NI(e);return t.length==1&&t[0][2]?PI(t[0][0],t[0][1]):function(r){return r===e||AI(r,e,t)}}var TI=RI,II=Ue,MI=Zn,zI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OI=/^\w*$/;function DI(e,t){if(II(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||MI(e)?!0:OI.test(e)||!zI.test(e)||t!=null&&e in Object(t)}var ku=DI,tv=pu,LI="Expected a function";function _u(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(LI);var r=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var a=e.apply(this,n);return r.cache=o.set(s,a)||o,a};return r.cache=new(_u.Cache||tv),r}_u.Cache=tv;var FI=_u,BI=FI,UI=500;function WI(e){var t=BI(e,function(n){return r.size===UI&&r.clear(),n}),r=t.cache;return t}var VI=WI,KI=VI,HI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,GI=/\\(\\)?/g,qI=KI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(HI,function(r,n,s,o){t.push(s?o.replace(GI,"$1"):n||r)}),t}),rv=qI;function YI(e,t){for(var r=-1,n=e==null?0:e.length,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}var ho=YI,Uh=Jn,JI=ho,ZI=Ue,QI=Zn,Wh=Uh?Uh.prototype:void 0,Vh=Wh?Wh.toString:void 0;function nv(e){if(typeof e=="string")return e;if(ZI(e))return JI(e,nv)+"";if(QI(e))return Vh?Vh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var sv=nv,XI=sv;function eM(e){return e==null?"":XI(e)}var ns=eM,tM=Ue,rM=ku,nM=rv,sM=ns;function oM(e,t){return tM(e)?e:rM(e,t)?[e]:nM(sM(e))}var bi=oM,aM=Zn;function iM(e){if(typeof e=="string"||aM(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var dn=iM,lM=bi,cM=dn;function uM(e,t){t=lM(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[cM(t[r++])];return r&&r==n?e:void 0}var Cu=uM,dM=Cu;function fM(e,t,r){var n=e==null?void 0:dM(e,t);return n===void 0?r:n}var ov=fM;const Qe=Se(ov);function hM(e,t){return e!=null&&t in Object(e)}var pM=hM,mM=bi,gM=co,vM=Ue,yM=fo,bM=vu,xM=dn;function wM(e,t,r){t=mM(t,e);for(var n=-1,s=t.length,o=!1;++n<s;){var a=xM(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=s?o:(s=e==null?0:e.length,!!s&&bM(s)&&yM(a,s)&&(vM(e)||gM(e)))}var av=wM,kM=pM,_M=av;function CM(e,t){return e!=null&&_M(e,t,kM)}var $M=CM,SM=wu,jM=ov,EM=$M,AM=ku,NM=X0,PM=ev,RM=dn,TM=1,IM=2;function MM(e,t){return AM(e)&&NM(t)?PM(RM(e),t):function(r){var n=jM(r,e);return n===void 0&&n===t?EM(r,e):SM(t,n,TM|IM)}}var zM=MM;function OM(e){return e}var xi=OM;function DM(e){return function(t){return t==null?void 0:t[e]}}var LM=DM,FM=Cu;function BM(e){return function(t){return FM(t,e)}}var UM=BM,WM=LM,VM=UM,KM=ku,HM=dn;function GM(e){return KM(e)?WM(HM(e)):VM(e)}var qM=GM,YM=TI,JM=zM,ZM=xi,QM=Ue,XM=qM;function e2(e){return typeof e=="function"?e:e==null?ZM:typeof e=="object"?QM(e)?JM(e[0],e[1]):YM(e):XM(e)}var fn=e2,t2=AE,r2=PE,n2=fn;function s2(e,t){return e&&e.length?t2(e,n2(t),r2):void 0}var o2=s2;const wi=Se(o2);var a2=xu,i2=un,l2=co,c2=Ue,u2=mr,d2=uo,f2=yi,h2=vi,p2="[object Map]",m2="[object Set]",g2=Object.prototype,v2=g2.hasOwnProperty;function y2(e){if(e==null)return!0;if(u2(e)&&(c2(e)||typeof e=="string"||typeof e.splice=="function"||d2(e)||h2(e)||l2(e)))return!e.length;var t=i2(e);if(t==p2||t==m2)return!e.size;if(f2(e))return!a2(e).length;for(var r in e)if(v2.call(e,r))return!1;return!0}var b2=y2;const he=Se(b2);function x2(e,t,r,n){var s=-1,o=e==null?0:e.length;for(n&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}var iv=x2;function w2(e){return function(t){return e==null?void 0:e[t]}}var k2=w2,_2=k2,C2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},$2=_2(C2),S2=$2,j2=S2,E2=ns,A2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,N2="\\u0300-\\u036f",P2="\\ufe20-\\ufe2f",R2="\\u20d0-\\u20ff",T2=N2+P2+R2,I2="["+T2+"]",M2=RegExp(I2,"g");function z2(e){return e=E2(e),e&&e.replace(A2,j2).replace(M2,"")}var O2=z2,D2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function L2(e){return e.match(D2)||[]}var F2=L2,B2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function U2(e){return B2.test(e)}var W2=U2,lv="\\ud800-\\udfff",V2="\\u0300-\\u036f",K2="\\ufe20-\\ufe2f",H2="\\u20d0-\\u20ff",G2=V2+K2+H2,cv="\\u2700-\\u27bf",uv="a-z\\xdf-\\xf6\\xf8-\\xff",q2="\\xac\\xb1\\xd7\\xf7",Y2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",J2="\\u2000-\\u206f",Z2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dv="A-Z\\xc0-\\xd6\\xd8-\\xde",Q2="\\ufe0e\\ufe0f",fv=q2+Y2+J2+Z2,hv="['’]",Kh="["+fv+"]",X2="["+G2+"]",pv="\\d+",ez="["+cv+"]",mv="["+uv+"]",gv="[^"+lv+fv+pv+cv+uv+dv+"]",tz="\\ud83c[\\udffb-\\udfff]",rz="(?:"+X2+"|"+tz+")",nz="[^"+lv+"]",vv="(?:\\ud83c[\\udde6-\\uddff]){2}",yv="[\\ud800-\\udbff][\\udc00-\\udfff]",Nn="["+dv+"]",sz="\\u200d",Hh="(?:"+mv+"|"+gv+")",oz="(?:"+Nn+"|"+gv+")",Gh="(?:"+hv+"(?:d|ll|m|re|s|t|ve))?",qh="(?:"+hv+"(?:D|LL|M|RE|S|T|VE))?",bv=rz+"?",xv="["+Q2+"]?",az="(?:"+sz+"(?:"+[nz,vv,yv].join("|")+")"+xv+bv+")*",iz="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lz="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",cz=xv+bv+az,uz="(?:"+[ez,vv,yv].join("|")+")"+cz,dz=RegExp([Nn+"?"+mv+"+"+Gh+"(?="+[Kh,Nn,"$"].join("|")+")",oz+"+"+qh+"(?="+[Kh,Nn+Hh,"$"].join("|")+")",Nn+"?"+Hh+"+"+Gh,Nn+"+"+qh,lz,iz,pv,uz].join("|"),"g");function fz(e){return e.match(dz)||[]}var hz=fz,pz=F2,mz=W2,gz=ns,vz=hz;function yz(e,t,r){return e=gz(e),t=r?void 0:t,t===void 0?mz(e)?vz(e):pz(e):e.match(t)||[]}var bz=yz,xz=iv,wz=O2,kz=bz,_z="['’]",Cz=RegExp(_z,"g");function $z(e){return function(t){return xz(kz(wz(t).replace(Cz,"")),e,"")}}var Sz=$z;function jz(e,t,r){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),r=r>s?s:r,r<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(s);++n<s;)o[n]=e[n+t];return o}var wv=jz,Ez=wv;function Az(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:Ez(e,t,r)}var Nz=Az,Pz="\\ud800-\\udfff",Rz="\\u0300-\\u036f",Tz="\\ufe20-\\ufe2f",Iz="\\u20d0-\\u20ff",Mz=Rz+Tz+Iz,zz="\\ufe0e\\ufe0f",Oz="\\u200d",Dz=RegExp("["+Oz+Pz+Mz+zz+"]");function Lz(e){return Dz.test(e)}var kv=Lz;function Fz(e){return e.split("")}var Bz=Fz,_v="\\ud800-\\udfff",Uz="\\u0300-\\u036f",Wz="\\ufe20-\\ufe2f",Vz="\\u20d0-\\u20ff",Kz=Uz+Wz+Vz,Hz="\\ufe0e\\ufe0f",Gz="["+_v+"]",xc="["+Kz+"]",wc="\\ud83c[\\udffb-\\udfff]",qz="(?:"+xc+"|"+wc+")",Cv="[^"+_v+"]",$v="(?:\\ud83c[\\udde6-\\uddff]){2}",Sv="[\\ud800-\\udbff][\\udc00-\\udfff]",Yz="\\u200d",jv=qz+"?",Ev="["+Hz+"]?",Jz="(?:"+Yz+"(?:"+[Cv,$v,Sv].join("|")+")"+Ev+jv+")*",Zz=Ev+jv+Jz,Qz="(?:"+[Cv+xc+"?",xc,$v,Sv,Gz].join("|")+")",Xz=RegExp(wc+"(?="+wc+")|"+Qz+Zz,"g");function eO(e){return e.match(Xz)||[]}var tO=eO,rO=Bz,nO=kv,sO=tO;function oO(e){return nO(e)?sO(e):rO(e)}var aO=oO,iO=Nz,lO=kv,cO=aO,uO=ns;function dO(e){return function(t){t=uO(t);var r=lO(t)?cO(t):void 0,n=r?r[0]:t.charAt(0),s=r?iO(r,1).join(""):t.slice(1);return n[e]()+s}}var fO=dO,hO=fO,pO=hO("toUpperCase"),mO=pO,gO=Sz,vO=mO,yO=gO(function(e,t,r){return e+(r?" ":"")+vO(t)}),Av=yO;const Nv=Se(Av);var bO=Math.ceil,xO=Math.max;function wO(e,t,r,n){for(var s=-1,o=xO(bO((t-e)/(r||1)),0),a=Array(o);o--;)a[n?o:++s]=e,e+=r;return a}var kO=wO,_O=io,CO=mr,$O=fo,SO=xt;function jO(e,t,r){if(!SO(r))return!1;var n=typeof t;return(n=="number"?CO(r)&&$O(t,r.length):n=="string"&&t in r)?_O(r[t],e):!1}var Pv=jO,EO=/\s/;function AO(e){for(var t=e.length;t--&&EO.test(e.charAt(t)););return t}var NO=AO,PO=NO,RO=/^\s+/;function TO(e){return e&&e.slice(0,PO(e)+1).replace(RO,"")}var IO=TO,MO=IO,Yh=xt,zO=Zn,Jh=NaN,OO=/^[-+]0x[0-9a-f]+$/i,DO=/^0b[01]+$/i,LO=/^0o[0-7]+$/i,FO=parseInt;function BO(e){if(typeof e=="number")return e;if(zO(e))return Jh;if(Yh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=MO(e);var r=DO.test(e);return r||LO.test(e)?FO(e.slice(2),r?2:8):OO.test(e)?Jh:+e}var Rv=BO,UO=Rv,Zh=1/0,WO=17976931348623157e292;function VO(e){if(!e)return e===0?e:0;if(e=UO(e),e===Zh||e===-Zh){var t=e<0?-1:1;return t*WO}return e===e?e:0}var Tv=VO,KO=kO,HO=Pv,el=Tv;function GO(e){return function(t,r,n){return n&&typeof n!="number"&&HO(t,r,n)&&(r=n=void 0),t=el(t),r===void 0?(r=t,t=0):r=el(r),n=n===void 0?t<r?1:-1:el(n),KO(t,r,n,e)}}var qO=GO,YO=qO,JO=YO(),ZO=JO;const Iv=Se(ZO);var QO=Object.prototype,XO=QO.hasOwnProperty;function eD(e,t){return e!=null&&XO.call(e,t)}var tD=eD,rD=tD,nD=av;function sD(e,t){return e!=null&&nD(e,t,rD)}var oD=sD;const Mv=Se(oD);var aD=fn,iD=mr,lD=Jt;function cD(e){return function(t,r,n){var s=Object(t);if(!iD(t)){var o=aD(r);t=lD(t),r=function(i){return o(s[i],i,s)}}var a=e(t,r,n);return a>-1?s[o?t[a]:a]:void 0}}var uD=cD;function dD(e,t,r,n){for(var s=e.length,o=r+(n?1:-1);n?o--:++o<s;)if(t(e[o],o,e))return o;return-1}var zv=dD,fD=Tv;function hD(e){var t=fD(e),r=t%1;return t===t?r?t-r:t:0}var po=hD,pD=zv,mD=fn,gD=po,vD=Math.max;function yD(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var s=r==null?0:gD(r);return s<0&&(s=vD(n+s,0)),pD(e,mD(t),s)}var bD=yD,xD=uD,wD=bD,kD=xD(wD),_D=kD;const CD=Se(_D);function $D(e){return e!==e}var SD=$D;function jD(e,t,r){for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}var ED=jD,AD=zv,ND=SD,PD=ED;function RD(e,t,r){return t===t?PD(e,t,r):AD(e,ND,r)}var Ov=RD,TD=Ir,ID=Ue,MD=bt,zD="[object String]";function OD(e){return typeof e=="string"||!ID(e)&&MD(e)&&TD(e)==zD}var DD=OD,LD=ho;function FD(e,t){return LD(t,function(r){return e[r]})}var BD=FD,UD=BD,WD=Jt;function VD(e){return e==null?[]:UD(e,WD(e))}var KD=VD,HD=Ov,GD=mr,qD=DD,YD=po,JD=KD,ZD=Math.max;function QD(e,t,r,n){e=GD(e)?e:JD(e),r=r&&!n?YD(r):0;var s=e.length;return r<0&&(r=ZD(s+r,0)),qD(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&HD(e,t,r)>-1}var XD=QD;const Dv=Se(XD);var kc={exports:{}},Lv={},Mt={},Vn={},mo={},be={},so={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(b){if(super(),!e.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((C,w)=>`${C}${w}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((C,w)=>(w instanceof r&&(C[w.str]=(C[w.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function s(y,...b){const C=[y[0]];let w=0;for(;w<b.length;)i(C,b[w]),C.push(y[++w]);return new n(C)}e._=s;const o=new n("+");function a(y,...b){const C=[h(y[0])];let w=0;for(;w<b.length;)C.push(o),i(C,b[w]),C.push(o,h(y[++w]));return c(C),new n(C)}e.str=a;function i(y,b){b instanceof n?y.push(...b._items):b instanceof r?y.push(b):y.push(f(b))}e.addCodeArg=i;function c(y){let b=1;for(;b<y.length-1;){if(y[b]===o){const C=u(y[b-1],y[b+1]);if(C!==void 0){y.splice(b-1,3,C);continue}y[b++]="+"}b++}}function u(y,b){if(b==='""')return y;if(y==='""')return b;if(typeof y=="string")return b instanceof r||y[y.length-1]!=='"'?void 0:typeof b!="string"?`${y.slice(0,-1)}${b}"`:b[0]==='"'?y.slice(0,-1)+b.slice(1):void 0;if(typeof b=="string"&&b[0]==='"'&&!(y instanceof r))return`"${y}${b.slice(1)}`}function d(y,b){return b.emptyStr()?y:y.emptyStr()?b:a`${y}${b}`}e.strConcat=d;function f(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:h(Array.isArray(y)?y.join(","):y)}function p(y){return new n(h(y))}e.stringify=p;function h(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function g(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=g;function m(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=m;function v(y){return new n(y.toString())}e.regexpCode=v})(so);var _c={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=so;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,f;if(!((f=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||f===void 0)&&f.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=s;class o extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:f}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${f}]`}}e.ValueScopeName=o;const a=(0,t._)`\n`;class i extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:t.nil}}get(){return this._scope}name(u){return new o(u,this._newName(u))}value(u,d){var f;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const p=this.toName(u),{prefix:h}=p,g=(f=d.key)!==null&&f!==void 0?f:d.ref;let m=this._values[h];if(m){const b=m.get(g);if(b)return b}else m=this._values[h]=new Map;m.set(g,p);const v=this._scope[h]||(this._scope[h]=[]),y=v.length;return v[y]=d.ref,p.setValue(d,{property:h,itemIndex:y}),p}getValue(u,d){const f=this._values[u];if(f)return f.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${u}${f.scopePath}`})}scopeCode(u=this._values,d,f){return this._reduceValues(u,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},d,f)}_reduceValues(u,d,f={},p){let h=t.nil;for(const g in u){const m=u[g];if(!m)continue;const v=f[g]=f[g]||new Map;m.forEach(y=>{if(v.has(y))return;v.set(y,n.Started);let b=d(y);if(b){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${C} ${y} = ${b};${this.opts._n}`}else if(b=p==null?void 0:p(y))h=(0,t._)`${h}${b}${this.opts._n}`;else throw new r(y);v.set(y,n.Completed)})}return h}}e.ValueScope=i})(_c);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=so,r=_c;var n=so;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=_c;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(k,$){return this}}class a extends o{constructor(k,$,A){super(),this.varKind=k,this.name=$,this.rhs=A}render({es5:k,_n:$}){const A=k?r.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${A} ${this.name}${W};`+$}optimizeNames(k,$){if(k[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,k,$)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends o{constructor(k,$,A){super(),this.lhs=k,this.rhs=$,this.sideEffects=A}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,$){if(!(this.lhs instanceof t.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=O(this.rhs,k,$),this}get names(){const k=this.lhs instanceof t.Name?{}:{...this.lhs.names};return K(k,this.rhs)}}class c extends i{constructor(k,$,A,W){super(k,A,W),this.op=$}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class u extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class d extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class f extends o{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class p extends o{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,$){return this.code=O(this.code,k,$),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce(($,A)=>$+A.render(k),"")}optimizeNodes(){const{nodes:k}=this;let $=k.length;for(;$--;){const A=k[$].optimizeNodes();Array.isArray(A)?k.splice($,1,...A):A?k[$]=A:k.splice($,1)}return k.length>0?this:void 0}optimizeNames(k,$){const{nodes:A}=this;let W=A.length;for(;W--;){const H=A[W];H.optimizeNames(k,$)||(G(k,H.names),A.splice(W,1))}return A.length>0?this:void 0}get names(){return this.nodes.reduce((k,$)=>P(k,$.names),{})}}class g extends h{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class m extends h{}class v extends g{}v.kind="else";class y extends g{constructor(k,$){super($),this.condition=k}render(k){let $=`if(${this.condition})`+super.render(k);return this.else&&($+="else "+this.else.render(k)),$}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let $=this.else;if($){const A=$.optimizeNodes();$=this.else=Array.isArray(A)?new v(A):A}if($)return k===!1?$ instanceof y?$:$.nodes:this.nodes.length?this:new y(V(k),$ instanceof y?[$]:$.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,$){var A;if(this.else=(A=this.else)===null||A===void 0?void 0:A.optimizeNames(k,$),!!(super.optimizeNames(k,$)||this.else))return this.condition=O(this.condition,k,$),this}get names(){const k=super.names;return K(k,this.condition),this.else&&P(k,this.else.names),k}}y.kind="if";class b extends g{}b.kind="for";class C extends b{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,$){if(super.optimizeNames(k,$))return this.iteration=O(this.iteration,k,$),this}get names(){return P(super.names,this.iteration.names)}}class w extends b{constructor(k,$,A,W){super(),this.varKind=k,this.name=$,this.from=A,this.to=W}render(k){const $=k.es5?r.varKinds.var:this.varKind,{name:A,from:W,to:H}=this;return`for(${$} ${A}=${W}; ${A}<${H}; ${A}++)`+super.render(k)}get names(){const k=K(super.names,this.from);return K(k,this.to)}}class _ extends b{constructor(k,$,A,W){super(),this.loop=k,this.varKind=$,this.name=A,this.iterable=W}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,$){if(super.optimizeNames(k,$))return this.iterable=O(this.iterable,k,$),this}get names(){return P(super.names,this.iterable.names)}}class R extends g{constructor(k,$,A){super(),this.name=k,this.args=$,this.async=A}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}R.kind="func";class z extends h{render(k){return"return "+super.render(k)}}z.kind="return";class D extends g{render(k){let $="try"+super.render(k);return this.catch&&($+=this.catch.render(k)),this.finally&&($+=this.finally.render(k)),$}optimizeNodes(){var k,$;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),($=this.finally)===null||$===void 0||$.optimizeNodes(),this}optimizeNames(k,$){var A,W;return super.optimizeNames(k,$),(A=this.catch)===null||A===void 0||A.optimizeNames(k,$),(W=this.finally)===null||W===void 0||W.optimizeNames(k,$),this}get names(){const k=super.names;return this.catch&&P(k,this.catch.names),this.finally&&P(k,this.finally.names),k}}class j extends g{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}j.kind="catch";class S extends g{render(k){return"finally"+super.render(k)}}S.kind="finally";class E{constructor(k,$={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...$,_n:$.lines?`
121
+ `:""},this._extScope=k,this._scope=new r.Scope({parent:k}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,$){const A=this._extScope.value(k,$);return(this._values[A.prefix]||(this._values[A.prefix]=new Set)).add(A),A}getScopeValue(k,$){return this._extScope.getValue(k,$)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,$,A,W){const H=this._scope.toName($);return A!==void 0&&W&&(this._constants[H.str]=A),this._leafNode(new a(k,H,A)),H}const(k,$,A){return this._def(r.varKinds.const,k,$,A)}let(k,$,A){return this._def(r.varKinds.let,k,$,A)}var(k,$,A){return this._def(r.varKinds.var,k,$,A)}assign(k,$,A){return this._leafNode(new i(k,$,A))}add(k,$){return this._leafNode(new c(k,e.operators.ADD,$))}code(k){return typeof k=="function"?k():k!==t.nil&&this._leafNode(new p(k)),this}object(...k){const $=["{"];for(const[A,W]of k)$.length>1&&$.push(","),$.push(A),(A!==W||this.opts.es5)&&($.push(":"),(0,t.addCodeArg)($,W));return $.push("}"),new t._Code($)}if(k,$,A){if(this._blockNode(new y(k)),$&&A)this.code($).else().code(A).endIf();else if($)this.code($).endIf();else if(A)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new y(k))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(k,$){return this._blockNode(k),$&&this.code($).endFor(),this}for(k,$){return this._for(new C(k),$)}forRange(k,$,A,W,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(k);return this._for(new w(H,ee,$,A),()=>W(ee))}forOf(k,$,A,W=r.varKinds.const){const H=this._scope.toName(k);if(this.opts.es5){const ee=$ instanceof t.Name?$:this.var("_arr",$);return this.forRange("_i",0,(0,t._)`${ee}.length`,re=>{this.var(H,(0,t._)`${ee}[${re}]`),A(H)})}return this._for(new _("of",W,H,$),()=>A(H))}forIn(k,$,A,W=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,t._)`Object.keys(${$})`,A);const H=this._scope.toName(k);return this._for(new _("in",W,H,$),()=>A(H))}endFor(){return this._endBlockNode(b)}label(k){return this._leafNode(new u(k))}break(k){return this._leafNode(new d(k))}return(k){const $=new z;if(this._blockNode($),this.code(k),$.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(z)}try(k,$,A){if(!$&&!A)throw new Error('CodeGen: "try" without "catch" and "finally"');const W=new D;if(this._blockNode(W),this.code(k),$){const H=this.name("e");this._currNode=W.catch=new j(H),$(H)}return A&&(this._currNode=W.finally=new S,this.code(A)),this._endBlockNode(j,S)}throw(k){return this._leafNode(new f(k))}block(k,$){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock($),this}endBlock(k){const $=this._blockStarts.pop();if($===void 0)throw new Error("CodeGen: not in self-balancing block");const A=this._nodes.length-$;if(A<0||k!==void 0&&A!==k)throw new Error(`CodeGen: wrong number of nodes: ${A} vs ${k} expected`);return this._nodes.length=$,this}func(k,$=t.nil,A,W){return this._blockNode(new R(k,$,A)),W&&this.code(W).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,$){const A=this._currNode;if(A instanceof k||$&&A instanceof $)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${$?`${k.kind}/${$.kind}`:k.kind}"`)}_elseNode(k){const $=this._currNode;if(!($ instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=$.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const $=this._nodes;$[$.length-1]=k}}e.CodeGen=E;function P(I,k){for(const $ in k)I[$]=(I[$]||0)+(k[$]||0);return I}function K(I,k){return k instanceof t._CodeOrName?P(I,k.names):I}function O(I,k,$){if(I instanceof t.Name)return A(I);if(!W(I))return I;return new t._Code(I._items.reduce((H,ee)=>(ee instanceof t.Name&&(ee=A(ee)),ee instanceof t._Code?H.push(...ee._items):H.push(ee),H),[]));function A(H){const ee=$[H.str];return ee===void 0||k[H.str]!==1?H:(delete k[H.str],ee)}function W(H){return H instanceof t._Code&&H._items.some(ee=>ee instanceof t.Name&&k[ee.str]===1&&$[ee.str]!==void 0)}}function G(I,k){for(const $ in k)I[$]=(I[$]||0)-(k[$]||0)}function V(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${Z(I)}`}e.not=V;const L=N(e.operators.AND);function U(...I){return I.reduce(L)}e.and=U;const oe=N(e.operators.OR);function Y(...I){return I.reduce(oe)}e.or=Y;function N(I){return(k,$)=>k===t.nil?$:$===t.nil?k:(0,t._)`${Z(k)} ${I} ${Z($)}`}function Z(I){return I instanceof t.Name?I:(0,t._)`(${I})`}})(be);var ne={};Object.defineProperty(ne,"__esModule",{value:!0});ne.checkStrictMode=ne.getErrorPath=ne.Type=ne.useFunc=ne.setEvaluated=ne.evaluatedPropsToName=ne.mergeEvaluated=ne.eachItem=ne.unescapeJsonPointer=ne.escapeJsonPointer=ne.escapeFragment=ne.unescapeFragment=ne.schemaRefOrVal=ne.schemaHasRulesButRef=ne.schemaHasRules=ne.checkUnknownRules=ne.alwaysValidSchema=ne.toHash=void 0;const Re=be,eL=so;function tL(e){const t={};for(const r of e)t[r]=!0;return t}ne.toHash=tL;function rL(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Fv(e,t),!Bv(t,e.self.RULES.all))}ne.alwaysValidSchema=rL;function Fv(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;const s=n.RULES.keywords;for(const o in t)s[o]||Vv(e,`unknown keyword: "${o}"`)}ne.checkUnknownRules=Fv;function Bv(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}ne.schemaHasRules=Bv;function nL(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ne.schemaHasRulesButRef=nL;function sL({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Re._)`${r}`}return(0,Re._)`${e}${t}${(0,Re.getProperty)(n)}`}ne.schemaRefOrVal=sL;function oL(e){return Uv(decodeURIComponent(e))}ne.unescapeFragment=oL;function aL(e){return encodeURIComponent($u(e))}ne.escapeFragment=aL;function $u(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ne.escapeJsonPointer=$u;function Uv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ne.unescapeJsonPointer=Uv;function iL(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}ne.eachItem=iL;function Qh({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{const c=a===void 0?o:a instanceof Re.Name?(o instanceof Re.Name?e(s,o,a):t(s,o,a),a):o instanceof Re.Name?(t(s,a,o),o):r(o,a);return i===Re.Name&&!(c instanceof Re.Name)?n(s,c):c}}ne.mergeEvaluated={props:Qh({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Re._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Re._)`${r} || {}`).code((0,Re._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Re._)`${r} || {}`),Su(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Wv}),items:Qh({mergeNames:(e,t,r)=>e.if((0,Re._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Re._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Re._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Re._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Wv(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,Re._)`{}`);return t!==void 0&&Su(e,r,t),r}ne.evaluatedPropsToName=Wv;function Su(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Re._)`${t}${(0,Re.getProperty)(n)}`,!0))}ne.setEvaluated=Su;const Xh={};function lL(e,t){return e.scopeValue("func",{ref:t,code:Xh[t.code]||(Xh[t.code]=new eL._Code(t.code))})}ne.useFunc=lL;var Cc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Cc||(ne.Type=Cc={}));function cL(e,t,r){if(e instanceof Re.Name){const n=t===Cc.Num;return r?n?(0,Re._)`"[" + ${e} + "]"`:(0,Re._)`"['" + ${e} + "']"`:n?(0,Re._)`"/" + ${e}`:(0,Re._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Re.getProperty)(e).toString():"/"+$u(e)}ne.getErrorPath=cL;function Vv(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ne.checkStrictMode=Vv;var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});const et=be,uL={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};Zt.default=uL;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=be,r=ne,n=Zt;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:y})=>y?(0,t.str)`"${v}" keyword must be ${y} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function s(v,y=e.keywordError,b,C){const{it:w}=v,{gen:_,compositeRule:R,allErrors:z}=w,D=f(v,y,b);C??(R||z)?c(_,D):u(w,(0,t._)`[${D}]`)}e.reportError=s;function o(v,y=e.keywordError,b){const{it:C}=v,{gen:w,compositeRule:_,allErrors:R}=C,z=f(v,y,b);c(w,z),_||R||u(C,n.default.vErrors)}e.reportExtraError=o;function a(v,y){v.assign(n.default.errors,y),v.if((0,t._)`${n.default.vErrors} !== null`,()=>v.if(y,()=>v.assign((0,t._)`${n.default.vErrors}.length`,y),()=>v.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function i({gen:v,keyword:y,schemaValue:b,data:C,errsCount:w,it:_}){if(w===void 0)throw new Error("ajv implementation error");const R=v.name("err");v.forRange("i",w,n.default.errors,z=>{v.const(R,(0,t._)`${n.default.vErrors}[${z}]`),v.if((0,t._)`${R}.instancePath === undefined`,()=>v.assign((0,t._)`${R}.instancePath`,(0,t.strConcat)(n.default.instancePath,_.errorPath))),v.assign((0,t._)`${R}.schemaPath`,(0,t.str)`${_.errSchemaPath}/${y}`),_.opts.verbose&&(v.assign((0,t._)`${R}.schema`,b),v.assign((0,t._)`${R}.data`,C))})}e.extendErrors=i;function c(v,y){const b=v.const("err",y);v.if((0,t._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,t._)`[${b}]`),(0,t._)`${n.default.vErrors}.push(${b})`),v.code((0,t._)`${n.default.errors}++`)}function u(v,y){const{gen:b,validateName:C,schemaEnv:w}=v;w.$async?b.throw((0,t._)`new ${v.ValidationError}(${y})`):(b.assign((0,t._)`${C}.errors`,y),b.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function f(v,y,b){const{createErrors:C}=v.it;return C===!1?(0,t._)`{}`:p(v,y,b)}function p(v,y,b={}){const{gen:C,it:w}=v,_=[h(w,b),g(v,b)];return m(v,y,_),C.object(..._)}function h({errorPath:v},{instancePath:y}){const b=y?(0,t.str)`${v}${(0,r.getErrorPath)(y,r.Type.Str)}`:v;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,b)]}function g({keyword:v,it:{errSchemaPath:y}},{schemaPath:b,parentSchema:C}){let w=C?y:(0,t.str)`${y}/${v}`;return b&&(w=(0,t.str)`${w}${(0,r.getErrorPath)(b,r.Type.Str)}`),[d.schemaPath,w]}function m(v,{params:y,message:b},C){const{keyword:w,data:_,schemaValue:R,it:z}=v,{opts:D,propertyName:j,topSchemaRef:S,schemaPath:E}=z;C.push([d.keyword,w],[d.params,typeof y=="function"?y(v):y||(0,t._)`{}`]),D.messages&&C.push([d.message,typeof b=="function"?b(v):b]),D.verbose&&C.push([d.schema,R],[d.parentSchema,(0,t._)`${S}${E}`],[n.default.data,_]),j&&C.push([d.propertyName,j])}})(mo);Object.defineProperty(Vn,"__esModule",{value:!0});Vn.boolOrEmptySchema=Vn.topBoolOrEmptySchema=void 0;const dL=mo,fL=be,hL=Zt,pL={message:"boolean schema is false"};function mL(e){const{gen:t,schema:r,validateName:n}=e;r===!1?Kv(e,!1):typeof r=="object"&&r.$async===!0?t.return(hL.default.data):(t.assign((0,fL._)`${n}.errors`,null),t.return(!0))}Vn.topBoolOrEmptySchema=mL;function gL(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Kv(e)):r.var(t,!0)}Vn.boolOrEmptySchema=gL;function Kv(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,dL.reportError)(s,pL,void 0,t)}var He={},sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.getRules=sn.isJSONType=void 0;const vL=["string","number","integer","boolean","null","object","array"],yL=new Set(vL);function bL(e){return typeof e=="string"&&yL.has(e)}sn.isJSONType=bL;function xL(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}sn.getRules=xL;var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.shouldUseRule=ir.shouldUseGroup=ir.schemaHasRulesForType=void 0;function wL({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Hv(e,n)}ir.schemaHasRulesForType=wL;function Hv(e,t){return t.rules.some(r=>Gv(e,r))}ir.shouldUseGroup=Hv;function Gv(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ir.shouldUseRule=Gv;Object.defineProperty(He,"__esModule",{value:!0});He.reportTypeError=He.checkDataTypes=He.checkDataType=He.coerceAndCheckDataType=He.getJSONTypes=He.getSchemaTypes=He.DataType=void 0;const kL=sn,_L=ir,CL=mo,ve=be,qv=ne;var Ln;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ln||(He.DataType=Ln={}));function $L(e){const t=Yv(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}He.getSchemaTypes=$L;function Yv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(kL.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}He.getJSONTypes=Yv;function SL(e,t){const{gen:r,data:n,opts:s}=e,o=jL(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,_L.schemaHasRulesForType)(e,t[0]));if(a){const i=ju(t,n,s.strictNumbers,Ln.Wrong);r.if(i,()=>{o.length?EL(e,t,o):Eu(e)})}return a}He.coerceAndCheckDataType=SL;const Jv=new Set(["string","number","integer","boolean","null"]);function jL(e,t){return t?e.filter(r=>Jv.has(r)||t==="array"&&r==="array"):[]}function EL(e,t,r){const{gen:n,data:s,opts:o}=e,a=n.let("dataType",(0,ve._)`typeof ${s}`),i=n.let("coerced",(0,ve._)`undefined`);o.coerceTypes==="array"&&n.if((0,ve._)`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,ve._)`${s}[0]`).assign(a,(0,ve._)`typeof ${s}`).if(ju(t,s,o.strictNumbers),()=>n.assign(i,s))),n.if((0,ve._)`${i} !== undefined`);for(const u of r)(Jv.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);n.else(),Eu(e),n.endIf(),n.if((0,ve._)`${i} !== undefined`,()=>{n.assign(s,i),AL(e,i)});function c(u){switch(u){case"string":n.elseIf((0,ve._)`${a} == "number" || ${a} == "boolean"`).assign(i,(0,ve._)`"" + ${s}`).elseIf((0,ve._)`${s} === null`).assign(i,(0,ve._)`""`);return;case"number":n.elseIf((0,ve._)`${a} == "boolean" || ${s} === null
122
122
  || (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,(0,ve._)`+${s}`);return;case"integer":n.elseIf((0,ve._)`${a} === "boolean" || ${s} === null
123
123
  || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,(0,ve._)`+${s}`);return;case"boolean":n.elseIf((0,ve._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf((0,ve._)`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf((0,ve._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf((0,ve._)`${a} === "string" || ${a} === "number"
124
- || ${a} === "boolean" || ${s} === null`).assign(i,(0,ve._)`[${s}]`)}}}function kL({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,ve._)`${t} !== undefined`,()=>e.assign((0,ve._)`${t}[${r}]`,n))}function Ec(e,t,r,n=Ln.Correct){const s=n===Ln.Correct?ve.operators.EQ:ve.operators.NEQ;let o;switch(e){case"null":return(0,ve._)`${t} ${s} null`;case"array":o=(0,ve._)`Array.isArray(${t})`;break;case"object":o=(0,ve._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,ve._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,ve._)`typeof ${t} ${s} ${e}`}return n===Ln.Correct?o:(0,ve.not)(o);function a(i=ve.nil){return(0,ve.and)((0,ve._)`typeof ${t} == "number"`,i,r?(0,ve._)`isFinite(${t})`:ve.nil)}}He.checkDataType=Ec;function Nu(e,t,r,n){if(e.length===1)return Ec(e[0],t,r,n);let s;const o=(0,ey.toHash)(e);if(o.array&&o.object){const a=(0,ve._)`typeof ${t} != "object"`;s=o.null?a:(0,ve._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=ve.nil;o.number&&delete o.integer;for(const a in o)s=(0,ve.and)(s,Ec(a,t,r,n));return s}He.checkDataTypes=Nu;const _L={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,ve._)`{type: ${e}}`:(0,ve._)`{type: ${t}}`};function Pu(e){const t=CL(e);(0,vL.reportError)(t,_L)}He.reportTypeError=Pu;function CL(e){const{gen:t,data:r,schema:n}=e,s=(0,ey.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}var ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.assignDefaults=void 0;const kn=be,$L=ne;function SL(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)ap(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,o)=>ap(e,o,s.default))}ki.assignDefaults=SL;function ap(e,t,r){const{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;const i=(0,kn._)`${o}${(0,kn.getProperty)(t)}`;if(s){(0,$L.checkStrictMode)(e,`default is ignored for: ${i}`);return}let c=(0,kn._)`${i} === undefined`;a.useDefaults==="empty"&&(c=(0,kn._)`${c} || ${i} === null || ${i} === ""`),n.if(c,(0,kn._)`${i} = ${(0,kn.stringify)(r)}`)}var Wt={},xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.validateUnion=xe.validateArray=xe.usePattern=xe.callValidateCode=xe.schemaProperties=xe.allSchemaProperties=xe.noPropertyInData=xe.propertyInData=xe.isOwnProperty=xe.hasPropFunc=xe.reportMissingProp=xe.checkMissingProp=xe.checkReportMissingProp=void 0;const Oe=be,Ru=ne,xr=Zt,jL=ne;function EL(e,t){const{gen:r,data:n,it:s}=e;r.if(Iu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Oe._)`${t}`},!0),e.error()})}xe.checkReportMissingProp=EL;function AL({gen:e,data:t,it:{opts:r}},n,s){return(0,Oe.or)(...n.map(o=>(0,Oe.and)(Iu(e,t,o,r.ownProperties),(0,Oe._)`${s} = ${o}`)))}xe.checkMissingProp=AL;function NL(e,t){e.setParams({missingProperty:t},!0),e.error()}xe.reportMissingProp=NL;function ny(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Oe._)`Object.prototype.hasOwnProperty`})}xe.hasPropFunc=ny;function Tu(e,t,r){return(0,Oe._)`${ny(e)}.call(${t}, ${r})`}xe.isOwnProperty=Tu;function PL(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} !== undefined`;return n?(0,Oe._)`${s} && ${Tu(e,t,r)}`:s}xe.propertyInData=PL;function Iu(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} === undefined`;return n?(0,Oe.or)(s,(0,Oe.not)(Tu(e,t,r))):s}xe.noPropertyInData=Iu;function sy(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}xe.allSchemaProperties=sy;function RL(e,t){return sy(t).filter(r=>!(0,Ru.alwaysValidSchema)(e,t[r]))}xe.schemaProperties=RL;function TL({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){const d=u?(0,Oe._)`${e}, ${t}, ${n}${s}`:t,f=[[xr.default.instancePath,(0,Oe.strConcat)(xr.default.instancePath,o)],[xr.default.parentData,a.parentData],[xr.default.parentDataProperty,a.parentDataProperty],[xr.default.rootData,xr.default.rootData]];a.opts.dynamicRef&&f.push([xr.default.dynamicAnchors,xr.default.dynamicAnchors]);const p=(0,Oe._)`${d}, ${r.object(...f)}`;return c!==Oe.nil?(0,Oe._)`${i}.call(${c}, ${p})`:(0,Oe._)`${i}(${p})`}xe.callValidateCode=TL;const IL=(0,Oe._)`new RegExp`;function ML({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Oe._)`${s.code==="new RegExp"?IL:(0,jL.useFunc)(e,s)}(${r}, ${n})`})}xe.usePattern=ML;function zL(e){const{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){const i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){const c=t.const("len",(0,Oe._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Ru.Type.Num},o),t.if((0,Oe.not)(o),i)})}}xe.validateArray=zL;function OL(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Ru.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{const d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);t.assign(a,(0,Oe._)`${a} || ${i}`),e.mergeValidEvaluated(d,i)||t.if((0,Oe.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}xe.validateUnion=OL;Object.defineProperty(Wt,"__esModule",{value:!0});Wt.validateKeywordUsage=Wt.validSchemaType=Wt.funcKeywordCode=Wt.macroKeywordCode=void 0;const lt=be,Kr=Zt,DL=xe,LL=mo;function FL(e,t){const{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=oy(r,n,i);a.opts.validateSchema!==!1&&a.self.validateSchema(i,!0);const u=r.name("valid");e.subschema({schema:i,schemaPath:lt.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Wt.macroKeywordCode=FL;function BL(e,t){var r;const{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;WL(c,t);const u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,d=oy(n,s,u),f=n.let("valid");e.block$data(f,p),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function p(){if(t.errors===!1)m(),t.modifying&&ip(e),v(()=>e.error());else{const y=t.async?h():g();t.modifying&&ip(e),v(()=>UL(e,y))}}function h(){const y=n.let("ruleErrs",null);return n.try(()=>m((0,lt._)`await `),b=>n.assign(f,!1).if((0,lt._)`${b} instanceof ${c.ValidationError}`,()=>n.assign(y,(0,lt._)`${b}.errors`),()=>n.throw(b))),y}function g(){const y=(0,lt._)`${d}.errors`;return n.assign(y,null),m(lt.nil),y}function m(y=t.async?(0,lt._)`await `:lt.nil){const b=c.opts.passContext?Kr.default.this:Kr.default.self,C=!("compile"in t&&!i||t.schema===!1);n.assign(f,(0,lt._)`${y}${(0,DL.callValidateCode)(e,d,b,C)}`,t.modifying)}function v(y){var b;n.if((0,lt.not)((b=t.valid)!==null&&b!==void 0?b:f),y)}}Wt.funcKeywordCode=BL;function ip(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,lt._)`${n.parentData}[${n.parentDataProperty}]`))}function UL(e,t){const{gen:r}=e;r.if((0,lt._)`Array.isArray(${t})`,()=>{r.assign(Kr.default.vErrors,(0,lt._)`${Kr.default.vErrors} === null ? ${t} : ${Kr.default.vErrors}.concat(${t})`).assign(Kr.default.errors,(0,lt._)`${Kr.default.vErrors}.length`),(0,LL.extendErrors)(e)},()=>e.error())}function WL({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function oy(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,lt.stringify)(r)})}function VL(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Wt.validSchemaType=VL;function KL({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const a=s.dependencies;if(a!=null&&a.some(i=>!Object.prototype.hasOwnProperty.call(e,i)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[o])){const c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Wt.validateKeywordUsage=KL;var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.extendSubschemaMode=Nr.extendSubschemaData=Nr.getSubschema=void 0;const Bt=be,ay=ne;function HL(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const i=e.schema[t];return r===void 0?{schema:i,schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}${(0,Bt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,ay.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Nr.getSubschema=HL;function qL(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(r!==void 0){const{errorPath:u,dataPathArr:d,opts:f}=t,p=i.let("data",(0,Bt._)`${t.data}${(0,Bt.getProperty)(r)}`,!0);c(p),e.errorPath=(0,Bt.str)`${u}${(0,ay.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Bt._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const u=s instanceof Bt.Name?s:i.let("data",s,!0);c(u),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Nr.extendSubschemaData=qL;function GL(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}Nr.extendSubschemaMode=GL;var Je={},iy=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},ly={exports:{}},jr=ly.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};oa(t,n,s,e,"",e)};jr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};jr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};jr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};jr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function oa(e,t,r,n,s,o,a,i,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,a,i,c,u);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in jr.arrayKeywords)for(var p=0;p<f.length;p++)oa(e,t,r,f[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in jr.propsKeywords){if(f&&typeof f=="object")for(var h in f)oa(e,t,r,f[h],s+"/"+d+"/"+YL(h),o,s,d,n,h)}else(d in jr.keywords||e.allKeys&&!(d in jr.skipKeywords))&&oa(e,t,r,f,s+"/"+d,o,s,d,n)}r(n,s,o,a,i,c,u)}}function YL(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var JL=ly.exports;Object.defineProperty(Je,"__esModule",{value:!0});Je.getSchemaRefs=Je.resolveUrl=Je.normalizeId=Je._getFullPath=Je.getFullPath=Je.inlineRef=void 0;const ZL=ne,QL=iy,XL=JL,eF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function tF(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Ac(e):t?cy(e)<=t:!1}Je.inlineRef=tF;const rF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ac(e){for(const t in e){if(rF.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Ac)||typeof r=="object"&&Ac(r))return!0}return!1}function cy(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!eF.has(r)&&(typeof e[r]=="object"&&(0,ZL.eachItem)(e[r],n=>t+=cy(n)),t===1/0))return 1/0}return t}function uy(e,t="",r){r!==!1&&(t=Fn(t));const n=e.parse(t);return dy(e,n)}Je.getFullPath=uy;function dy(e,t){return e.serialize(t).split("#")[0]+"#"}Je._getFullPath=dy;const nF=/#\/?$/;function Fn(e){return e?e.replace(nF,""):""}Je.normalizeId=Fn;function sF(e,t,r){return r=Fn(r),e.resolve(t,r)}Je.resolveUrl=sF;const oF=/^[a-z_][-a-z0-9._]*$/i;function aF(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Fn(e[r]||t),o={"":s},a=uy(n,s,!1),i={},c=new Set;return XL(e,{allKeys:!0},(f,p,h,g)=>{if(g===void 0)return;const m=a+p;let v=o[g];typeof f[r]=="string"&&(v=y.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),o[p]=v;function y(C){const w=this.opts.uriResolver.resolve;if(C=Fn(v?w(v,C):C),c.has(C))throw d(C);c.add(C);let _=this.refs[C];return typeof _=="string"&&(_=this.refs[_]),typeof _=="object"?u(f,_.schema,C):C!==Fn(m)&&(C[0]==="#"?(u(f,i[C],C),i[C]=f):this.refs[C]=m),C}function b(C){if(typeof C=="string"){if(!oF.test(C))throw new Error(`invalid anchor "${C}"`);y.call(this,`#${C}`)}}}),i;function u(f,p,h){if(p!==void 0&&!QL(f,p))throw d(h)}function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Je.getSchemaRefs=aF;Object.defineProperty(Mt,"__esModule",{value:!0});Mt.getData=Mt.KeywordCxt=Mt.validateFunctionCode=void 0;const fy=Vn,lp=He,Mu=ir,Da=He,iF=ki,Us=Wt,sl=Nr,ie=be,fe=Zt,lF=Je,lr=ne,Ss=mo;function cF(e){if(my(e)&&(gy(e),py(e))){fF(e);return}hy(e,()=>(0,fy.topBoolOrEmptySchema)(e))}Mt.validateFunctionCode=cF;function hy({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){s.code.es5?e.func(t,(0,ie._)`${fe.default.data}, ${fe.default.valCxt}`,n.$async,()=>{e.code((0,ie._)`"use strict"; ${cp(r,s)}`),dF(e,s),e.code(o)}):e.func(t,(0,ie._)`${fe.default.data}, ${uF(s)}`,n.$async,()=>e.code(cp(r,s)).code(o))}function uF(e){return(0,ie._)`{${fe.default.instancePath}="", ${fe.default.parentData}, ${fe.default.parentDataProperty}, ${fe.default.rootData}=${fe.default.data}${e.dynamicRef?(0,ie._)`, ${fe.default.dynamicAnchors}={}`:ie.nil}}={}`}function dF(e,t){e.if(fe.default.valCxt,()=>{e.var(fe.default.instancePath,(0,ie._)`${fe.default.valCxt}.${fe.default.instancePath}`),e.var(fe.default.parentData,(0,ie._)`${fe.default.valCxt}.${fe.default.parentData}`),e.var(fe.default.parentDataProperty,(0,ie._)`${fe.default.valCxt}.${fe.default.parentDataProperty}`),e.var(fe.default.rootData,(0,ie._)`${fe.default.valCxt}.${fe.default.rootData}`),t.dynamicRef&&e.var(fe.default.dynamicAnchors,(0,ie._)`${fe.default.valCxt}.${fe.default.dynamicAnchors}`)},()=>{e.var(fe.default.instancePath,(0,ie._)`""`),e.var(fe.default.parentData,(0,ie._)`undefined`),e.var(fe.default.parentDataProperty,(0,ie._)`undefined`),e.var(fe.default.rootData,fe.default.data),t.dynamicRef&&e.var(fe.default.dynamicAnchors,(0,ie._)`{}`)})}function fF(e){const{schema:t,opts:r,gen:n}=e;hy(e,()=>{r.$comment&&t.$comment&&yy(e),vF(e),n.let(fe.default.vErrors,null),n.let(fe.default.errors,0),r.unevaluated&&hF(e),vy(e),xF(e)})}function hF(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,ie._)`${r}.evaluated`),t.if((0,ie._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,ie._)`${e.evaluated}.props`,(0,ie._)`undefined`)),t.if((0,ie._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,ie._)`${e.evaluated}.items`,(0,ie._)`undefined`))}function cp(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,ie._)`/*# sourceURL=${r} */`:ie.nil}function pF(e,t){if(my(e)&&(gy(e),py(e))){mF(e,t);return}(0,fy.boolOrEmptySchema)(e,t)}function py({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function my(e){return typeof e.schema!="boolean"}function mF(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&yy(e),yF(e),bF(e);const o=n.const("_errs",fe.default.errors);vy(e,o),n.var(t,(0,ie._)`${o} === ${fe.default.errors}`)}function gy(e){(0,lr.checkUnknownRules)(e),gF(e)}function vy(e,t){if(e.opts.jtd)return up(e,[],!1,t);const r=(0,lp.getSchemaTypes)(e.schema),n=(0,lp.coerceAndCheckDataType)(e,r);up(e,r,!n,t)}function gF(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,lr.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function vF(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,lr.checkStrictMode)(e,"default is ignored in the schema root")}function yF(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,lF.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function bF(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function yy({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const o=r.$comment;if(s.$comment===!0)e.code((0,ie._)`${fe.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){const a=(0,ie.str)`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code((0,ie._)`${fe.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function xF(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;r.$async?t.if((0,ie._)`${fe.default.errors} === 0`,()=>t.return(fe.default.data),()=>t.throw((0,ie._)`new ${s}(${fe.default.vErrors})`)):(t.assign((0,ie._)`${n}.errors`,fe.default.vErrors),o.unevaluated&&wF(e),t.return((0,ie._)`${fe.default.errors} === 0`))}function wF({gen:e,evaluated:t,props:r,items:n}){r instanceof ie.Name&&e.assign((0,ie._)`${t}.props`,r),n instanceof ie.Name&&e.assign((0,ie._)`${t}.items`,n)}function up(e,t,r,n){const{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,lr.schemaHasRulesButRef)(o,d))){s.block(()=>wy(e,"$ref",d.all.$ref.definition));return}c.jtd||kF(e,t),s.block(()=>{for(const p of d.rules)f(p);f(d.post)});function f(p){(0,Mu.shouldUseGroup)(o,p)&&(p.type?(s.if((0,Da.checkDataType)(p.type,a,c.strictNumbers)),dp(e,p),t.length===1&&t[0]===p.type&&r&&(s.else(),(0,Da.reportTypeError)(e)),s.endIf()):dp(e,p),i||s.if((0,ie._)`${fe.default.errors} === ${n||0}`))}}function dp(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,iF.assignDefaults)(e,t.type),r.block(()=>{for(const o of t.rules)(0,Mu.shouldUseRule)(n,o)&&wy(e,o.keyword,o.definition,t.type)})}function kF(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(_F(e,t),e.opts.allowUnionTypes||CF(e,t),$F(e,e.dataTypes))}function _F(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{by(e.dataTypes,r)||zu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),jF(e,t)}}function CF(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&zu(e,"use allowUnionTypes to allow union type keyword")}function $F(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Mu.shouldUseRule)(e.schema,s)){const{type:o}=s.definition;o.length&&!o.some(a=>SF(t,a))&&zu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function SF(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function by(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function jF(e,t){const r=[];for(const n of e.dataTypes)by(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function zu(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,lr.checkStrictMode)(e,t,e.opts.strictTypes)}class xy{constructor(t,r,n){if((0,Us.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,lr.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",ky(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Us.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",fe.default.errors))}result(t,r,n){this.failResult((0,ie.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,ie.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,ie._)`${r} !== undefined && (${(0,ie.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ss.reportExtraError:Ss.reportError)(this,this.def.error,r)}$dataError(){(0,Ss.reportError)(this,this.def.$dataError||Ss.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ss.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=ie.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=ie.nil,r=ie.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:o,def:a}=this;n.if((0,ie.or)((0,ie._)`${s} === undefined`,r)),t!==ie.nil&&n.assign(t,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==ie.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:o}=this;return(0,ie.or)(a(),i());function a(){if(n.length){if(!(r instanceof ie.Name))throw new Error("ajv implementation error");const c=Array.isArray(n)?n:[n];return(0,ie._)`${(0,Da.checkDataTypes)(c,r,o.opts.strictNumbers,Da.DataType.Wrong)}`}return ie.nil}function i(){if(s.validateSchema){const c=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,ie._)`!${c}(${r})`}return ie.nil}}subschema(t,r){const n=(0,sl.getSubschema)(this.it,t);(0,sl.extendSubschemaData)(n,this.it,t),(0,sl.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return pF(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=lr.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=lr.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,ie.Name)),!0}}Mt.KeywordCxt=xy;function wy(e,t,r,n){const s=new xy(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Us.funcKeywordCode)(s,r):"macro"in r?(0,Us.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Us.funcKeywordCode)(s,r)}const EF=/^\/(?:[^~]|~0|~1)*$/,AF=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ky(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return fe.default.rootData;if(e[0]==="/"){if(!EF.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,o=fe.default.rootData}else{const u=AF.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw new Error(c("property/index",d));return n[t-d]}if(d>t)throw new Error(c("data",d));if(o=r[t-d],!s)return o}let a=o;const i=s.split("/");for(const u of i)u&&(o=(0,ie._)`${o}${(0,ie.getProperty)((0,lr.unescapeJsonPointer)(u))}`,a=(0,ie._)`${a} && ${o}`);return a;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}Mt.getData=ky;var go={};Object.defineProperty(go,"__esModule",{value:!0});class NF extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}go.default=NF;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});const ol=Je;class PF extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,ol.resolveUrl)(t,r,n),this.missingSchema=(0,ol.normalizeId)((0,ol.getFullPath)(t,this.missingRef))}}ss.default=PF;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.resolveSchema=ft.getCompilingSchema=ft.resolveRef=ft.compileSchema=ft.SchemaEnv=void 0;const At=be,RF=go,Dr=Zt,Tt=Je,fp=ne,TF=Mt;class _i{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Tt.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ft.SchemaEnv=_i;function Ou(e){const t=_y.call(this,e);if(t)return t;const r=(0,Tt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new At.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o});let i;e.$async&&(i=a.scopeValue("Error",{ref:RF.default,code:(0,At._)`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Dr.default.data,parentData:Dr.default.parentData,parentDataProperty:Dr.default.parentDataProperty,dataNames:[Dr.default.data],dataPathArr:[At.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,At.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:At.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,At._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,TF.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const f=a.toString();d=`${a.scopeRefs(Dr.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const h=new Function(`${Dr.default.self}`,`${Dr.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:f,scopeValues:a._values}),this.opts.unevaluated){const{props:g,items:m}=u;h.evaluated={props:g instanceof At.Name?void 0:g,items:m instanceof At.Name?void 0:m,dynamicProps:g instanceof At.Name,dynamicItems:m instanceof At.Name},h.source&&(h.source.evaluated=(0,At.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}ft.compileSchema=Ou;function IF(e,t,r){var n;r=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let o=OF.call(this,e,r);if(o===void 0){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;a&&(o=new _i({schema:a,schemaId:i,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=MF.call(this,o)}ft.resolveRef=IF;function MF(e){return(0,Tt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Ou.call(this,e)}function _y(e){for(const t of this._compilations)if(zF(t,e))return t}ft.getCompilingSchema=_y;function zF(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function OF(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Ci.call(this,e,t)}function Ci(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Tt._getFullPath)(this.opts.uriResolver,r);let s=(0,Tt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return al.call(this,r,e);const o=(0,Tt.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){const i=Ci.call(this,e,a);return typeof(i==null?void 0:i.schema)!="object"?void 0:al.call(this,r,i)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Ou.call(this,a),o===(0,Tt.normalizeId)(t)){const{schema:i}=a,{schemaId:c}=this.opts,u=i[c];return u&&(s=(0,Tt.resolveUrl)(this.opts.uriResolver,s,u)),new _i({schema:i,schemaId:c,root:e,baseId:s})}return al.call(this,r,a)}}ft.resolveSchema=Ci;const DF=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function al(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const i of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const c=r[(0,fp.unescapeFragment)(i)];if(c===void 0)return;r=c;const u=typeof r=="object"&&r[this.opts.schemaId];!DF.has(i)&&u&&(t=(0,Tt.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,fp.schemaHasRulesButRef)(r,this.RULES)){const i=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Ci.call(this,n,i)}const{schemaId:a}=this.opts;if(o=o||new _i({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o}const LF="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",FF="Meta-schema for $data reference (JSON AnySchema extension proposal)",BF="object",UF=["$data"],WF={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},VF=!1,KF={$id:LF,description:FF,type:BF,required:UF,properties:WF,additionalProperties:VF};var Du={},$i={exports:{}};const HF=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Cy=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function $y(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const qF=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function hp(e){return e.length=0,!0}function GF(e,t,r){if(e.length){const n=$y(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function YF(e){let t=0;const r={error:!1,address:"",zone:""},n=[],s=[];let o=!1,a=!1,i=GF;for(let c=0;c<e.length;c++){const u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!i(s,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(o=!0),n.push(":");continue}else if(u==="%"){if(!i(s,n,r))break;i=hp}else{s.push(u);continue}}return s.length&&(i===hp?r.zone=s.join(""):a?n.push(s.join("")):n.push($y(s))),r.address=n.join(""),r}function Sy(e){if(JF(e,":")<2)return{host:e,isIPV6:!1};const t=YF(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function JF(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function ZF(e){let t=e;const r=[];let n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function QF(e,t){const r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function XF(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!Cy(r)){const n=Sy(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var jy={nonSimpleDomain:qF,recomposeAuthority:XF,normalizeComponentEncoding:QF,removeDotSegments:ZF,isIPv4:Cy,isUUID:HF,normalizeIPv6:Sy};const{isUUID:eB}=jy,tB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function Ey(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Ay(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Ny(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function rB(e){return e.secure=Ey(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function nB(e){if((e.port===(Ey(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function sB(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(tB);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,o=Lu(s);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function oB(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=Lu(s);o&&(e=o.serialize(e,t));const a=e,i=e.nss;return a.path=`${n||t.nid}:${i}`,t.skipEscape=!0,a}function aB(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!eB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function iB(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const Py={scheme:"http",domainHost:!0,parse:Ay,serialize:Ny},lB={scheme:"https",domainHost:Py.domainHost,parse:Ay,serialize:Ny},aa={scheme:"ws",domainHost:!0,parse:rB,serialize:nB},cB={scheme:"wss",domainHost:aa.domainHost,parse:aa.parse,serialize:aa.serialize},uB={scheme:"urn",parse:sB,serialize:oB,skipNormalize:!0},dB={scheme:"urn:uuid",parse:aB,serialize:iB,skipNormalize:!0},La={http:Py,https:lB,ws:aa,wss:cB,urn:uB,"urn:uuid":dB};Object.setPrototypeOf(La,null);function Lu(e){return e&&(La[e]||La[e.toLowerCase()])||void 0}var fB={SCHEMES:La,getSchemeHandler:Lu};const{normalizeIPv6:hB,removeDotSegments:Ms,recomposeAuthority:pB,normalizeComponentEncoding:Vo,isIPv4:mB,nonSimpleDomain:gB}=jy,{SCHEMES:vB,getSchemeHandler:Ry}=fB;function yB(e,t){return typeof e=="string"?e=Vt(fr(e,t),t):typeof e=="object"&&(e=fr(Vt(e,t),t)),e}function bB(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=Ty(fr(e,n),fr(t,n),n,!0);return n.skipEscape=!0,Vt(s,n)}function Ty(e,t,r,n){const s={};return n||(e=fr(Vt(e,r),r),t=fr(Vt(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=Ms(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=Ms(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function xB(e,t,r){return typeof e=="string"?(e=unescape(e),e=Vt(Vo(fr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Vt(Vo(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Vt(Vo(fr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Vt(Vo(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Vt(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=Ry(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");const a=pB(r);if(a!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(a),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let i=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(i=Ms(i)),a===void 0&&i[0]==="/"&&i[1]==="/"&&(i="/%2F"+i.slice(2)),s.push(i)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}const wB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function fr(e,t){const r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let s=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);const o=e.match(wB);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host)if(mB(n.host)===!1){const c=hB(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");const a=Ry(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&gB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i}(!a||a&&!a.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}const Fu={SCHEMES:vB,normalize:yB,resolve:bB,resolveComponent:Ty,equal:xB,serialize:Vt,parse:fr};$i.exports=Fu;$i.exports.default=Fu;$i.exports.fastUri=Fu;var kB=$i.exports;Object.defineProperty(Du,"__esModule",{value:!0});const Iy=kB;Iy.code='require("ajv/dist/runtime/uri").default';Du.default=Iy;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Mt;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=be;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=go,s=ss,o=sn,a=ft,i=be,c=Je,u=He,d=ne,f=KF,p=Du,h=(Y,N)=>new RegExp(Y,N);h.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function C(Y){var N,Z,I,k,$,A,W,H,ee,re,le,pe,M,J,se,ue,_e,we,Ne,Ce,Ie,qe,it,Et,wt;const ye=Y.strict,$e=(N=Y.code)===null||N===void 0?void 0:N.optimize,Ve=$e===!0||$e===void 0?1:$e||0,pt=(I=(Z=Y.code)===null||Z===void 0?void 0:Z.regExp)!==null&&I!==void 0?I:h,ls=(k=Y.uriResolver)!==null&&k!==void 0?k:p.default;return{strictSchema:(A=($=Y.strictSchema)!==null&&$!==void 0?$:ye)!==null&&A!==void 0?A:!0,strictNumbers:(H=(W=Y.strictNumbers)!==null&&W!==void 0?W:ye)!==null&&H!==void 0?H:!0,strictTypes:(re=(ee=Y.strictTypes)!==null&&ee!==void 0?ee:ye)!==null&&re!==void 0?re:"log",strictTuples:(pe=(le=Y.strictTuples)!==null&&le!==void 0?le:ye)!==null&&pe!==void 0?pe:"log",strictRequired:(J=(M=Y.strictRequired)!==null&&M!==void 0?M:ye)!==null&&J!==void 0?J:!1,code:Y.code?{...Y.code,optimize:Ve,regExp:pt}:{optimize:Ve,regExp:pt},loopRequired:(se=Y.loopRequired)!==null&&se!==void 0?se:b,loopEnum:(ue=Y.loopEnum)!==null&&ue!==void 0?ue:b,meta:(_e=Y.meta)!==null&&_e!==void 0?_e:!0,messages:(we=Y.messages)!==null&&we!==void 0?we:!0,inlineRefs:(Ne=Y.inlineRefs)!==null&&Ne!==void 0?Ne:!0,schemaId:(Ce=Y.schemaId)!==null&&Ce!==void 0?Ce:"$id",addUsedSchema:(Ie=Y.addUsedSchema)!==null&&Ie!==void 0?Ie:!0,validateSchema:(qe=Y.validateSchema)!==null&&qe!==void 0?qe:!0,validateFormats:(it=Y.validateFormats)!==null&&it!==void 0?it:!0,unicodeRegExp:(Et=Y.unicodeRegExp)!==null&&Et!==void 0?Et:!0,int32range:(wt=Y.int32range)!==null&&wt!==void 0?wt:!0,uriResolver:ls}}class w{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...C(N)};const{es5:Z,lines:I}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:m,es5:Z,lines:I}),this.logger=P(N.logger);const k=N.validateFormats;N.validateFormats=!1,this.RULES=(0,o.getRules)(),_.call(this,v,N,"NOT SUPPORTED"),_.call(this,y,N,"DEPRECATED","warn"),this._metaOpts=S.call(this),N.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&j.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),z.call(this),N.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:Z,schemaId:I}=this.opts;let k=f;I==="id"&&(k={...f},k.id=k.$id,delete k.$id),Z&&N&&this.addMetaSchema(k,k[I],!1)}defaultMeta(){const{meta:N,schemaId:Z}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[Z]||N:void 0}validate(N,Z){let I;if(typeof N=="string"){if(I=this.getSchema(N),!I)throw new Error(`no schema with key or ref "${N}"`)}else I=this.compile(N);const k=I(Z);return"$async"in I||(this.errors=I.errors),k}compile(N,Z){const I=this._addSchema(N,Z);return I.validate||this._compileSchemaEnv(I)}compileAsync(N,Z){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:I}=this.opts;return k.call(this,N,Z);async function k(re,le){await $.call(this,re.$schema);const pe=this._addSchema(re,le);return pe.validate||A.call(this,pe)}async function $(re){re&&!this.getSchema(re)&&await k.call(this,{$ref:re},!0)}async function A(re){try{return this._compileSchemaEnv(re)}catch(le){if(!(le instanceof s.default))throw le;return W.call(this,le),await H.call(this,le.missingSchema),A.call(this,re)}}function W({missingSchema:re,missingRef:le}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${le} cannot be resolved`)}async function H(re){const le=await ee.call(this,re);this.refs[re]||await $.call(this,le.$schema),this.refs[re]||this.addSchema(le,re,Z)}async function ee(re){const le=this._loading[re];if(le)return le;try{return await(this._loading[re]=I(re))}finally{delete this._loading[re]}}}addSchema(N,Z,I,k=this.opts.validateSchema){if(Array.isArray(N)){for(const A of N)this.addSchema(A,void 0,I,k);return this}let $;if(typeof N=="object"){const{schemaId:A}=this.opts;if($=N[A],$!==void 0&&typeof $!="string")throw new Error(`schema ${A} must be string`)}return Z=(0,c.normalizeId)(Z||$),this._checkUnique(Z),this.schemas[Z]=this._addSchema(N,I,Z,k,!0),this}addMetaSchema(N,Z,I=this.opts.validateSchema){return this.addSchema(N,Z,!0,I),this}validateSchema(N,Z){if(typeof N=="boolean")return!0;let I;if(I=N.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate(I,N);if(!k&&Z){const $="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error($);else throw new Error($)}return k}getSchema(N){let Z;for(;typeof(Z=R.call(this,N))=="string";)N=Z;if(Z===void 0){const{schemaId:I}=this.opts,k=new a.SchemaEnv({schema:{},schemaId:I});if(Z=a.resolveSchema.call(this,k,N),!Z)return;this.refs[N]=Z}return Z.validate||this._compileSchemaEnv(Z)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const Z=R.call(this,N);return typeof Z=="object"&&this._cache.delete(Z.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const Z=N;this._cache.delete(Z);let I=N[this.opts.schemaId];return I&&(I=(0,c.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const Z of N)this.addKeyword(Z);return this}addKeyword(N,Z){let I;if(typeof N=="string")I=N,typeof Z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Z.keyword=I);else if(typeof N=="object"&&Z===void 0){if(Z=N,I=Z.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(O.call(this,I,Z),!Z)return(0,d.eachItem)(I,$=>q.call(this,$)),this;L.call(this,Z);const k={...Z,type:(0,u.getJSONTypes)(Z.type),schemaType:(0,u.getJSONTypes)(Z.schemaType)};return(0,d.eachItem)(I,k.type.length===0?$=>q.call(this,$,k):$=>k.type.forEach(A=>q.call(this,$,k,A))),this}getKeyword(N){const Z=this.RULES.all[N];return typeof Z=="object"?Z.definition:!!Z}removeKeyword(N){const{RULES:Z}=this;delete Z.keywords[N],delete Z.all[N];for(const I of Z.rules){const k=I.rules.findIndex($=>$.keyword===N);k>=0&&I.rules.splice(k,1)}return this}addFormat(N,Z){return typeof Z=="string"&&(Z=new RegExp(Z)),this.formats[N]=Z,this}errorsText(N=this.errors,{separator:Z=", ",dataVar:I="data"}={}){return!N||N.length===0?"No errors":N.map(k=>`${I}${k.instancePath} ${k.message}`).reduce((k,$)=>k+Z+$)}$dataMetaSchema(N,Z){const I=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const k of Z){const $=k.split("/").slice(1);let A=N;for(const W of $)A=A[W];for(const W in I){const H=I[W];if(typeof H!="object")continue;const{$data:ee}=H.definition,re=A[W];ee&&re&&(A[W]=oe(re))}}return N}_removeAllSchemas(N,Z){for(const I in N){const k=N[I];(!Z||Z.test(I))&&(typeof k=="string"?delete N[I]:k&&!k.meta&&(this._cache.delete(k.schema),delete N[I]))}}_addSchema(N,Z,I,k=this.opts.validateSchema,$=this.opts.addUsedSchema){let A;const{schemaId:W}=this.opts;if(typeof N=="object")A=N[W];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(N);if(H!==void 0)return H;I=(0,c.normalizeId)(A||I);const ee=c.getSchemaRefs.call(this,N,I);return H=new a.SchemaEnv({schema:N,schemaId:W,meta:Z,baseId:I,localRefs:ee}),this._cache.set(H.schema,H),$&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=H),k&&this.validateSchema(N,!0),H}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):a.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const Z=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,N)}finally{this.opts=Z}}}w.ValidationError=n.default,w.MissingRefError=s.default,e.default=w;function _(Y,N,Z,I="error"){for(const k in Y){const $=k;$ in N&&this.logger[I](`${Z}: option ${k}. ${Y[$]}`)}}function R(Y){return Y=(0,c.normalizeId)(Y),this.schemas[Y]||this.refs[Y]}function z(){const Y=this.opts.schemas;if(Y)if(Array.isArray(Y))this.addSchema(Y);else for(const N in Y)this.addSchema(Y[N],N)}function D(){for(const Y in this.opts.formats){const N=this.opts.formats[Y];N&&this.addFormat(Y,N)}}function j(Y){if(Array.isArray(Y)){this.addVocabulary(Y);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in Y){const Z=Y[N];Z.keyword||(Z.keyword=N),this.addKeyword(Z)}}function S(){const Y={...this.opts};for(const N of g)delete Y[N];return Y}const E={log(){},warn(){},error(){}};function P(Y){if(Y===!1)return E;if(Y===void 0)return console;if(Y.log&&Y.warn&&Y.error)return Y;throw new Error("logger must implement log, warn and error methods")}const K=/^[a-z_$][a-z0-9_$:-]*$/i;function O(Y,N){const{RULES:Z}=this;if((0,d.eachItem)(Y,I=>{if(Z.keywords[I])throw new Error(`Keyword ${I} is already defined`);if(!K.test(I))throw new Error(`Keyword ${I} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function q(Y,N,Z){var I;const k=N==null?void 0:N.post;if(Z&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:$}=this;let A=k?$.post:$.rules.find(({type:H})=>H===Z);if(A||(A={type:Z,rules:[]},$.rules.push(A)),$.keywords[Y]=!0,!N)return;const W={keyword:Y,definition:{...N,type:(0,u.getJSONTypes)(N.type),schemaType:(0,u.getJSONTypes)(N.schemaType)}};N.before?V.call(this,A,W,N.before):A.rules.push(W),$.all[Y]=W,(I=N.implements)===null||I===void 0||I.forEach(H=>this.addKeyword(H))}function V(Y,N,Z){const I=Y.rules.findIndex(k=>k.keyword===Z);I>=0?Y.rules.splice(I,0,N):(Y.rules.push(N),this.logger.warn(`rule ${Z} is not defined`))}function L(Y){let{metaSchema:N}=Y;N!==void 0&&(Y.$data&&this.opts.$data&&(N=oe(N)),Y.validateSchema=this.compile(N,!0))}const U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oe(Y){return{anyOf:[Y,U]}}})(Kv);var Bu={},Uu={},Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});const _B={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Wu.default=_B;var on={};Object.defineProperty(on,"__esModule",{value:!0});on.callRef=on.getValidate=void 0;const CB=ss,pp=xe,dt=be,_n=Zt,mp=ft,Ko=ne,$B={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return f();const d=mp.resolveRef.call(c,u,s,r);if(d===void 0)throw new CB.default(n.opts.uriResolver,s,r);if(d instanceof mp.SchemaEnv)return p(d);return h(d);function f(){if(o===u)return ia(e,a,o,o.$async);const g=t.scopeValue("root",{ref:u});return ia(e,(0,dt._)`${g}.validate`,u,u.$async)}function p(g){const m=My(e,g);ia(e,m,g,g.$async)}function h(g){const m=t.scopeValue("schema",i.code.source===!0?{ref:g,code:(0,dt.stringify)(g)}:{ref:g}),v=t.name("valid"),y=e.subschema({schema:g,dataTypes:[],schemaPath:dt.nil,topSchemaRef:m,errSchemaPath:r},v);e.mergeEvaluated(y),e.ok(v)}}};function My(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,dt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}on.getValidate=My;function ia(e,t,r,n){const{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?_n.default.this:dt.nil;n?d():f();function d(){if(!i.$async)throw new Error("async schema referenced by sync schema");const g=s.let("valid");s.try(()=>{s.code((0,dt._)`await ${(0,pp.callValidateCode)(e,t,u)}`),h(t),a||s.assign(g,!0)},m=>{s.if((0,dt._)`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),a||s.assign(g,!1)}),e.ok(g)}function f(){e.result((0,pp.callValidateCode)(e,t,u),()=>h(t),()=>p(t))}function p(g){const m=(0,dt._)`${g}.errors`;s.assign(_n.default.vErrors,(0,dt._)`${_n.default.vErrors} === null ? ${m} : ${_n.default.vErrors}.concat(${m})`),s.assign(_n.default.errors,(0,dt._)`${_n.default.vErrors}.length`)}function h(g){var m;if(!o.opts.unevaluated)return;const v=(m=r==null?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=Ko.mergeEvaluated.props(s,v.props,o.props));else{const y=s.var("props",(0,dt._)`${g}.evaluated.props`);o.props=Ko.mergeEvaluated.props(s,y,o.props,dt.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=Ko.mergeEvaluated.items(s,v.items,o.items));else{const y=s.var("items",(0,dt._)`${g}.evaluated.items`);o.items=Ko.mergeEvaluated.items(s,y,o.items,dt.Name)}}}on.callRef=ia;on.default=$B;Object.defineProperty(Uu,"__esModule",{value:!0});const SB=Wu,jB=on,EB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",SB.default,jB.default];Uu.default=EB;var Vu={},Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});const Fa=be,wr=Fa.operators,Ba={maximum:{okStr:"<=",ok:wr.LTE,fail:wr.GT},minimum:{okStr:">=",ok:wr.GTE,fail:wr.LT},exclusiveMaximum:{okStr:"<",ok:wr.LT,fail:wr.GTE},exclusiveMinimum:{okStr:">",ok:wr.GT,fail:wr.LTE}},AB={message:({keyword:e,schemaCode:t})=>(0,Fa.str)`must be ${Ba[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Fa._)`{comparison: ${Ba[e].okStr}, limit: ${t}}`},NB={keyword:Object.keys(Ba),type:"number",schemaType:"number",$data:!0,error:AB,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Fa._)`${r} ${Ba[t].fail} ${n} || isNaN(${r})`)}};Ku.default=NB;var Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});const Ws=be,PB={message:({schemaCode:e})=>(0,Ws.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ws._)`{multipleOf: ${e}}`},RB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:PB,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?(0,Ws._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Ws._)`${a} !== parseInt(${a})`;e.fail$data((0,Ws._)`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Hu.default=RB;var qu={},Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});function zy(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}Gu.default=zy;zy.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(qu,"__esModule",{value:!0});const Hr=be,TB=ne,IB=Gu,MB={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,Hr.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Hr._)`{limit: ${e}}`},zB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:MB,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?Hr.operators.GT:Hr.operators.LT,a=s.opts.unicode===!1?(0,Hr._)`${r}.length`:(0,Hr._)`${(0,TB.useFunc)(e.gen,IB.default)}(${r})`;e.fail$data((0,Hr._)`${a} ${o} ${n}`)}};qu.default=zB;var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});const OB=xe,DB=ne,Tn=be,LB={message:({schemaCode:e})=>(0,Tn.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Tn._)`{pattern: ${e}}`},FB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:LB,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e,i=a.opts.unicodeRegExp?"u":"";if(n){const{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,Tn._)`new RegExp`:(0,DB.useFunc)(t,c),d=t.let("valid");t.try(()=>t.assign(d,(0,Tn._)`${u}(${o}, ${i}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,Tn._)`!${d}`)}else{const c=(0,OB.usePattern)(e,s);e.fail$data((0,Tn._)`!${c}.test(${r})`)}}};Yu.default=FB;var Ju={};Object.defineProperty(Ju,"__esModule",{value:!0});const Vs=be,BB={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Vs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Vs._)`{limit: ${e}}`},UB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:BB,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Vs.operators.GT:Vs.operators.LT;e.fail$data((0,Vs._)`Object.keys(${r}).length ${s} ${n}`)}};Ju.default=UB;var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});const js=xe,Ks=be,WB=ne,VB={message:({params:{missingProperty:e}})=>(0,Ks.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Ks._)`{missingProperty: ${e}}`},KB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:VB,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;const c=r.length>=i.loopRequired;if(a.allErrors?u():d(),i.strictRequired){const h=e.parentSchema.properties,{definedProperties:g}=e.it;for(const m of r)if((h==null?void 0:h[m])===void 0&&!g.has(m)){const v=a.schemaEnv.baseId+a.errSchemaPath,y=`required property "${m}" is not defined at "${v}" (strictRequired)`;(0,WB.checkStrictMode)(a,y,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(Ks.nil,f);else for(const h of r)(0,js.checkReportMissingProp)(e,h)}function d(){const h=t.let("missing");if(c||o){const g=t.let("valid",!0);e.block$data(g,()=>p(h,g)),e.ok(g)}else t.if((0,js.checkMissingProp)(e,r,h)),(0,js.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,js.noPropertyInData)(t,s,h,i.ownProperties),()=>e.error())})}function p(h,g){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(g,(0,js.propertyInData)(t,s,h,i.ownProperties)),t.if((0,Ks.not)(g),()=>{e.error(),t.break()})},Ks.nil)}}};Zu.default=KB;var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0});const Hs=be,HB={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Hs.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Hs._)`{limit: ${e}}`},qB={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:HB,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Hs.operators.GT:Hs.operators.LT;e.fail$data((0,Hs._)`${r}.length ${s} ${n}`)}};Qu.default=qB;var Xu={},vo={};Object.defineProperty(vo,"__esModule",{value:!0});const Oy=iy;Oy.code='require("ajv/dist/runtime/equal").default';vo.default=Oy;Object.defineProperty(Xu,"__esModule",{value:!0});const il=He,Ye=be,GB=ne,YB=vo,JB={message:({params:{i:e,j:t}})=>(0,Ye.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ye._)`{i: ${e}, j: ${t}}`},ZB={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:JB,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;const c=t.let("valid"),u=o.items?(0,il.getSchemaTypes)(o.items):[];e.block$data(c,d,(0,Ye._)`${a} === false`),e.ok(c);function d(){const g=t.let("i",(0,Ye._)`${r}.length`),m=t.let("j");e.setParams({i:g,j:m}),t.assign(c,!0),t.if((0,Ye._)`${g} > 1`,()=>(f()?p:h)(g,m))}function f(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function p(g,m){const v=t.name("item"),y=(0,il.checkDataTypes)(u,v,i.opts.strictNumbers,il.DataType.Wrong),b=t.const("indices",(0,Ye._)`{}`);t.for((0,Ye._)`;${g}--;`,()=>{t.let(v,(0,Ye._)`${r}[${g}]`),t.if(y,(0,Ye._)`continue`),u.length>1&&t.if((0,Ye._)`typeof ${v} == "string"`,(0,Ye._)`${v} += "_"`),t.if((0,Ye._)`typeof ${b}[${v}] == "number"`,()=>{t.assign(m,(0,Ye._)`${b}[${v}]`),e.error(),t.assign(c,!1).break()}).code((0,Ye._)`${b}[${v}] = ${g}`)})}function h(g,m){const v=(0,GB.useFunc)(t,YB.default),y=t.name("outer");t.label(y).for((0,Ye._)`;${g}--;`,()=>t.for((0,Ye._)`${m} = ${g}; ${m}--;`,()=>t.if((0,Ye._)`${v}(${r}[${g}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(y)})))}}};Xu.default=ZB;var ed={};Object.defineProperty(ed,"__esModule",{value:!0});const Nc=be,QB=ne,XB=vo,e3={message:"must be equal to constant",params:({schemaCode:e})=>(0,Nc._)`{allowedValue: ${e}}`},t3={keyword:"const",$data:!0,error:e3,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;n||o&&typeof o=="object"?e.fail$data((0,Nc._)`!${(0,QB.useFunc)(t,XB.default)}(${r}, ${s})`):e.fail((0,Nc._)`${o} !== ${r}`)}};ed.default=t3;var td={};Object.defineProperty(td,"__esModule",{value:!0});const zs=be,r3=ne,n3=vo,s3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,zs._)`{allowedValues: ${e}}`},o3={keyword:"enum",schemaType:"array",$data:!0,error:s3,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const i=s.length>=a.opts.loopEnum;let c;const u=()=>c??(c=(0,r3.useFunc)(t,n3.default));let d;if(i||n)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const h=t.const("vSchema",o);d=(0,zs.or)(...s.map((g,m)=>p(h,m)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",o,h=>t.if((0,zs._)`${u()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function p(h,g){const m=s[g];return typeof m=="object"&&m!==null?(0,zs._)`${u()}(${r}, ${h}[${g}])`:(0,zs._)`${r} === ${m}`}}};td.default=o3;Object.defineProperty(Vu,"__esModule",{value:!0});const a3=Ku,i3=Hu,l3=qu,c3=Yu,u3=Ju,d3=Zu,f3=Qu,h3=Xu,p3=ed,m3=td,g3=[a3.default,i3.default,l3.default,c3.default,u3.default,d3.default,f3.default,h3.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},p3.default,m3.default];Vu.default=g3;var rd={},os={};Object.defineProperty(os,"__esModule",{value:!0});os.validateAdditionalItems=void 0;const qr=be,Pc=ne,v3={message:({params:{len:e}})=>(0,qr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,qr._)`{limit: ${e}}`},y3={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:v3,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Pc.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Dy(e,n)}};function Dy(e,t){const{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;const i=r.const("len",(0,qr._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,qr._)`${i} <= ${t.length}`);else if(typeof n=="object"&&!(0,Pc.alwaysValidSchema)(a,n)){const u=r.var("valid",(0,qr._)`${i} <= ${t.length}`);r.if((0,qr.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,d=>{e.subschema({keyword:o,dataProp:d,dataPropType:Pc.Type.Num},u),a.allErrors||r.if((0,qr.not)(u),()=>r.break())})}}os.validateAdditionalItems=Dy;os.default=y3;var nd={},as={};Object.defineProperty(as,"__esModule",{value:!0});as.validateTuple=void 0;const gp=be,la=ne,b3=xe,x3={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Ly(e,"additionalItems",t);r.items=!0,!(0,la.alwaysValidSchema)(r,t)&&e.ok((0,b3.validateArray)(e))}};function Ly(e,t,r=e.schema){const{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;d(s),i.opts.unevaluated&&r.length&&i.items!==!0&&(i.items=la.mergeEvaluated.items(n,r.length,i.items));const c=n.name("valid"),u=n.const("len",(0,gp._)`${o}.length`);r.forEach((f,p)=>{(0,la.alwaysValidSchema)(i,f)||(n.if((0,gp._)`${u} > ${p}`,()=>e.subschema({keyword:a,schemaProp:p,dataProp:p},c)),e.ok(c))});function d(f){const{opts:p,errSchemaPath:h}=i,g=r.length,m=g===f.minItems&&(g===f.maxItems||f[t]===!1);if(p.strictTuples&&!m){const v=`"${a}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,la.checkStrictMode)(i,v,p.strictTuples)}}}as.validateTuple=Ly;as.default=x3;Object.defineProperty(nd,"__esModule",{value:!0});const w3=as,k3={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,w3.validateTuple)(e,"items")};nd.default=k3;var sd={};Object.defineProperty(sd,"__esModule",{value:!0});const vp=be,_3=ne,C3=xe,$3=os,S3={message:({params:{len:e}})=>(0,vp.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,vp._)`{limit: ${e}}`},j3={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:S3,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,_3.alwaysValidSchema)(n,t)&&(s?(0,$3.validateAdditionalItems)(e,s):e.ok((0,C3.validateArray)(e)))}};sd.default=j3;var od={};Object.defineProperty(od,"__esModule",{value:!0});const kt=be,Ho=ne,E3={message:({params:{min:e,max:t}})=>t===void 0?(0,kt.str)`must contain at least ${e} valid item(s)`:(0,kt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,kt._)`{minContains: ${e}}`:(0,kt._)`{minContains: ${e}, maxContains: ${t}}`},A3={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:E3,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;let a,i;const{minContains:c,maxContains:u}=n;o.opts.next?(a=c===void 0?1:c,i=u):a=1;const d=t.const("len",(0,kt._)`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){(0,Ho.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){(0,Ho.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Ho.alwaysValidSchema)(o,r)){let m=(0,kt._)`${d} >= ${a}`;i!==void 0&&(m=(0,kt._)`${m} && ${d} <= ${i}`),e.pass(m);return}o.items=!0;const f=t.name("valid");i===void 0&&a===1?h(f,()=>t.if(f,()=>t.break())):a===0?(t.let(f,!0),i!==void 0&&t.if((0,kt._)`${s}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,()=>e.reset());function p(){const m=t.name("_valid"),v=t.let("count",0);h(m,()=>t.if(m,()=>g(v)))}function h(m,v){t.forRange("i",0,d,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:Ho.Type.Num,compositeRule:!0},m),v()})}function g(m){t.code((0,kt._)`${m}++`),i===void 0?t.if((0,kt._)`${m} >= ${a}`,()=>t.assign(f,!0).break()):(t.if((0,kt._)`${m} > ${i}`,()=>t.assign(f,!1).break()),a===1?t.assign(f,!0):t.if((0,kt._)`${m} >= ${a}`,()=>t.assign(f,!0)))}}};od.default=A3;var Fy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=be,r=ne,n=xe;e.error={message:({params:{property:c,depsCount:u,deps:d}})=>{const f=u===1?"property":"properties";return(0,t.str)`must have ${f} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:d,missingProperty:f}})=>(0,t._)`{property: ${c},
124
+ || ${a} === "boolean" || ${s} === null`).assign(i,(0,ve._)`[${s}]`)}}}function AL({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,ve._)`${t} !== undefined`,()=>e.assign((0,ve._)`${t}[${r}]`,n))}function $c(e,t,r,n=Ln.Correct){const s=n===Ln.Correct?ve.operators.EQ:ve.operators.NEQ;let o;switch(e){case"null":return(0,ve._)`${t} ${s} null`;case"array":o=(0,ve._)`Array.isArray(${t})`;break;case"object":o=(0,ve._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,ve._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,ve._)`typeof ${t} ${s} ${e}`}return n===Ln.Correct?o:(0,ve.not)(o);function a(i=ve.nil){return(0,ve.and)((0,ve._)`typeof ${t} == "number"`,i,r?(0,ve._)`isFinite(${t})`:ve.nil)}}He.checkDataType=$c;function ju(e,t,r,n){if(e.length===1)return $c(e[0],t,r,n);let s;const o=(0,qv.toHash)(e);if(o.array&&o.object){const a=(0,ve._)`typeof ${t} != "object"`;s=o.null?a:(0,ve._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=ve.nil;o.number&&delete o.integer;for(const a in o)s=(0,ve.and)(s,$c(a,t,r,n));return s}He.checkDataTypes=ju;const NL={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,ve._)`{type: ${e}}`:(0,ve._)`{type: ${t}}`};function Eu(e){const t=PL(e);(0,CL.reportError)(t,NL)}He.reportTypeError=Eu;function PL(e){const{gen:t,data:r,schema:n}=e,s=(0,qv.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}var ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.assignDefaults=void 0;const kn=be,RL=ne;function TL(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)ep(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,o)=>ep(e,o,s.default))}ki.assignDefaults=TL;function ep(e,t,r){const{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;const i=(0,kn._)`${o}${(0,kn.getProperty)(t)}`;if(s){(0,RL.checkStrictMode)(e,`default is ignored for: ${i}`);return}let c=(0,kn._)`${i} === undefined`;a.useDefaults==="empty"&&(c=(0,kn._)`${c} || ${i} === null || ${i} === ""`),n.if(c,(0,kn._)`${i} = ${(0,kn.stringify)(r)}`)}var Wt={},xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.validateUnion=xe.validateArray=xe.usePattern=xe.callValidateCode=xe.schemaProperties=xe.allSchemaProperties=xe.noPropertyInData=xe.propertyInData=xe.isOwnProperty=xe.hasPropFunc=xe.reportMissingProp=xe.checkMissingProp=xe.checkReportMissingProp=void 0;const Oe=be,Au=ne,xr=Zt,IL=ne;function ML(e,t){const{gen:r,data:n,it:s}=e;r.if(Pu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Oe._)`${t}`},!0),e.error()})}xe.checkReportMissingProp=ML;function zL({gen:e,data:t,it:{opts:r}},n,s){return(0,Oe.or)(...n.map(o=>(0,Oe.and)(Pu(e,t,o,r.ownProperties),(0,Oe._)`${s} = ${o}`)))}xe.checkMissingProp=zL;function OL(e,t){e.setParams({missingProperty:t},!0),e.error()}xe.reportMissingProp=OL;function Zv(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Oe._)`Object.prototype.hasOwnProperty`})}xe.hasPropFunc=Zv;function Nu(e,t,r){return(0,Oe._)`${Zv(e)}.call(${t}, ${r})`}xe.isOwnProperty=Nu;function DL(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} !== undefined`;return n?(0,Oe._)`${s} && ${Nu(e,t,r)}`:s}xe.propertyInData=DL;function Pu(e,t,r,n){const s=(0,Oe._)`${t}${(0,Oe.getProperty)(r)} === undefined`;return n?(0,Oe.or)(s,(0,Oe.not)(Nu(e,t,r))):s}xe.noPropertyInData=Pu;function Qv(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}xe.allSchemaProperties=Qv;function LL(e,t){return Qv(t).filter(r=>!(0,Au.alwaysValidSchema)(e,t[r]))}xe.schemaProperties=LL;function FL({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){const d=u?(0,Oe._)`${e}, ${t}, ${n}${s}`:t,f=[[xr.default.instancePath,(0,Oe.strConcat)(xr.default.instancePath,o)],[xr.default.parentData,a.parentData],[xr.default.parentDataProperty,a.parentDataProperty],[xr.default.rootData,xr.default.rootData]];a.opts.dynamicRef&&f.push([xr.default.dynamicAnchors,xr.default.dynamicAnchors]);const p=(0,Oe._)`${d}, ${r.object(...f)}`;return c!==Oe.nil?(0,Oe._)`${i}.call(${c}, ${p})`:(0,Oe._)`${i}(${p})`}xe.callValidateCode=FL;const BL=(0,Oe._)`new RegExp`;function UL({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Oe._)`${s.code==="new RegExp"?BL:(0,IL.useFunc)(e,s)}(${r}, ${n})`})}xe.usePattern=UL;function WL(e){const{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){const i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){const c=t.const("len",(0,Oe._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Au.Type.Num},o),t.if((0,Oe.not)(o),i)})}}xe.validateArray=WL;function VL(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Au.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{const d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);t.assign(a,(0,Oe._)`${a} || ${i}`),e.mergeValidEvaluated(d,i)||t.if((0,Oe.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}xe.validateUnion=VL;Object.defineProperty(Wt,"__esModule",{value:!0});Wt.validateKeywordUsage=Wt.validSchemaType=Wt.funcKeywordCode=Wt.macroKeywordCode=void 0;const lt=be,Kr=Zt,KL=xe,HL=mo;function GL(e,t){const{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=Xv(r,n,i);a.opts.validateSchema!==!1&&a.self.validateSchema(i,!0);const u=r.name("valid");e.subschema({schema:i,schemaPath:lt.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Wt.macroKeywordCode=GL;function qL(e,t){var r;const{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;JL(c,t);const u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,d=Xv(n,s,u),f=n.let("valid");e.block$data(f,p),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function p(){if(t.errors===!1)m(),t.modifying&&tp(e),v(()=>e.error());else{const y=t.async?h():g();t.modifying&&tp(e),v(()=>YL(e,y))}}function h(){const y=n.let("ruleErrs",null);return n.try(()=>m((0,lt._)`await `),b=>n.assign(f,!1).if((0,lt._)`${b} instanceof ${c.ValidationError}`,()=>n.assign(y,(0,lt._)`${b}.errors`),()=>n.throw(b))),y}function g(){const y=(0,lt._)`${d}.errors`;return n.assign(y,null),m(lt.nil),y}function m(y=t.async?(0,lt._)`await `:lt.nil){const b=c.opts.passContext?Kr.default.this:Kr.default.self,C=!("compile"in t&&!i||t.schema===!1);n.assign(f,(0,lt._)`${y}${(0,KL.callValidateCode)(e,d,b,C)}`,t.modifying)}function v(y){var b;n.if((0,lt.not)((b=t.valid)!==null&&b!==void 0?b:f),y)}}Wt.funcKeywordCode=qL;function tp(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,lt._)`${n.parentData}[${n.parentDataProperty}]`))}function YL(e,t){const{gen:r}=e;r.if((0,lt._)`Array.isArray(${t})`,()=>{r.assign(Kr.default.vErrors,(0,lt._)`${Kr.default.vErrors} === null ? ${t} : ${Kr.default.vErrors}.concat(${t})`).assign(Kr.default.errors,(0,lt._)`${Kr.default.vErrors}.length`),(0,HL.extendErrors)(e)},()=>e.error())}function JL({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Xv(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,lt.stringify)(r)})}function ZL(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Wt.validSchemaType=ZL;function QL({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const a=s.dependencies;if(a!=null&&a.some(i=>!Object.prototype.hasOwnProperty.call(e,i)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[o])){const c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Wt.validateKeywordUsage=QL;var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.extendSubschemaMode=Nr.extendSubschemaData=Nr.getSubschema=void 0;const Bt=be,ey=ne;function XL(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const i=e.schema[t];return r===void 0?{schema:i,schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,Bt._)`${e.schemaPath}${(0,Bt.getProperty)(t)}${(0,Bt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,ey.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Nr.getSubschema=XL;function eF(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(r!==void 0){const{errorPath:u,dataPathArr:d,opts:f}=t,p=i.let("data",(0,Bt._)`${t.data}${(0,Bt.getProperty)(r)}`,!0);c(p),e.errorPath=(0,Bt.str)`${u}${(0,ey.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Bt._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const u=s instanceof Bt.Name?s:i.let("data",s,!0);c(u),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Nr.extendSubschemaData=eF;function tF(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}Nr.extendSubschemaMode=tF;var Je={},ty=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},ry={exports:{}},jr=ry.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};oa(t,n,s,e,"",e)};jr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};jr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};jr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};jr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function oa(e,t,r,n,s,o,a,i,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,a,i,c,u);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in jr.arrayKeywords)for(var p=0;p<f.length;p++)oa(e,t,r,f[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in jr.propsKeywords){if(f&&typeof f=="object")for(var h in f)oa(e,t,r,f[h],s+"/"+d+"/"+rF(h),o,s,d,n,h)}else(d in jr.keywords||e.allKeys&&!(d in jr.skipKeywords))&&oa(e,t,r,f,s+"/"+d,o,s,d,n)}r(n,s,o,a,i,c,u)}}function rF(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var nF=ry.exports;Object.defineProperty(Je,"__esModule",{value:!0});Je.getSchemaRefs=Je.resolveUrl=Je.normalizeId=Je._getFullPath=Je.getFullPath=Je.inlineRef=void 0;const sF=ne,oF=ty,aF=nF,iF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function lF(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Sc(e):t?ny(e)<=t:!1}Je.inlineRef=lF;const cF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Sc(e){for(const t in e){if(cF.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Sc)||typeof r=="object"&&Sc(r))return!0}return!1}function ny(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!iF.has(r)&&(typeof e[r]=="object"&&(0,sF.eachItem)(e[r],n=>t+=ny(n)),t===1/0))return 1/0}return t}function sy(e,t="",r){r!==!1&&(t=Fn(t));const n=e.parse(t);return oy(e,n)}Je.getFullPath=sy;function oy(e,t){return e.serialize(t).split("#")[0]+"#"}Je._getFullPath=oy;const uF=/#\/?$/;function Fn(e){return e?e.replace(uF,""):""}Je.normalizeId=Fn;function dF(e,t,r){return r=Fn(r),e.resolve(t,r)}Je.resolveUrl=dF;const fF=/^[a-z_][-a-z0-9._]*$/i;function hF(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Fn(e[r]||t),o={"":s},a=sy(n,s,!1),i={},c=new Set;return aF(e,{allKeys:!0},(f,p,h,g)=>{if(g===void 0)return;const m=a+p;let v=o[g];typeof f[r]=="string"&&(v=y.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),o[p]=v;function y(C){const w=this.opts.uriResolver.resolve;if(C=Fn(v?w(v,C):C),c.has(C))throw d(C);c.add(C);let _=this.refs[C];return typeof _=="string"&&(_=this.refs[_]),typeof _=="object"?u(f,_.schema,C):C!==Fn(m)&&(C[0]==="#"?(u(f,i[C],C),i[C]=f):this.refs[C]=m),C}function b(C){if(typeof C=="string"){if(!fF.test(C))throw new Error(`invalid anchor "${C}"`);y.call(this,`#${C}`)}}}),i;function u(f,p,h){if(p!==void 0&&!oF(f,p))throw d(h)}function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Je.getSchemaRefs=hF;Object.defineProperty(Mt,"__esModule",{value:!0});Mt.getData=Mt.KeywordCxt=Mt.validateFunctionCode=void 0;const ay=Vn,rp=He,Ru=ir,Da=He,pF=ki,Us=Wt,tl=Nr,ie=be,fe=Zt,mF=Je,lr=ne,Ss=mo;function gF(e){if(cy(e)&&(uy(e),ly(e))){bF(e);return}iy(e,()=>(0,ay.topBoolOrEmptySchema)(e))}Mt.validateFunctionCode=gF;function iy({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){s.code.es5?e.func(t,(0,ie._)`${fe.default.data}, ${fe.default.valCxt}`,n.$async,()=>{e.code((0,ie._)`"use strict"; ${np(r,s)}`),yF(e,s),e.code(o)}):e.func(t,(0,ie._)`${fe.default.data}, ${vF(s)}`,n.$async,()=>e.code(np(r,s)).code(o))}function vF(e){return(0,ie._)`{${fe.default.instancePath}="", ${fe.default.parentData}, ${fe.default.parentDataProperty}, ${fe.default.rootData}=${fe.default.data}${e.dynamicRef?(0,ie._)`, ${fe.default.dynamicAnchors}={}`:ie.nil}}={}`}function yF(e,t){e.if(fe.default.valCxt,()=>{e.var(fe.default.instancePath,(0,ie._)`${fe.default.valCxt}.${fe.default.instancePath}`),e.var(fe.default.parentData,(0,ie._)`${fe.default.valCxt}.${fe.default.parentData}`),e.var(fe.default.parentDataProperty,(0,ie._)`${fe.default.valCxt}.${fe.default.parentDataProperty}`),e.var(fe.default.rootData,(0,ie._)`${fe.default.valCxt}.${fe.default.rootData}`),t.dynamicRef&&e.var(fe.default.dynamicAnchors,(0,ie._)`${fe.default.valCxt}.${fe.default.dynamicAnchors}`)},()=>{e.var(fe.default.instancePath,(0,ie._)`""`),e.var(fe.default.parentData,(0,ie._)`undefined`),e.var(fe.default.parentDataProperty,(0,ie._)`undefined`),e.var(fe.default.rootData,fe.default.data),t.dynamicRef&&e.var(fe.default.dynamicAnchors,(0,ie._)`{}`)})}function bF(e){const{schema:t,opts:r,gen:n}=e;iy(e,()=>{r.$comment&&t.$comment&&fy(e),CF(e),n.let(fe.default.vErrors,null),n.let(fe.default.errors,0),r.unevaluated&&xF(e),dy(e),jF(e)})}function xF(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,ie._)`${r}.evaluated`),t.if((0,ie._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,ie._)`${e.evaluated}.props`,(0,ie._)`undefined`)),t.if((0,ie._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,ie._)`${e.evaluated}.items`,(0,ie._)`undefined`))}function np(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,ie._)`/*# sourceURL=${r} */`:ie.nil}function wF(e,t){if(cy(e)&&(uy(e),ly(e))){kF(e,t);return}(0,ay.boolOrEmptySchema)(e,t)}function ly({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function cy(e){return typeof e.schema!="boolean"}function kF(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&fy(e),$F(e),SF(e);const o=n.const("_errs",fe.default.errors);dy(e,o),n.var(t,(0,ie._)`${o} === ${fe.default.errors}`)}function uy(e){(0,lr.checkUnknownRules)(e),_F(e)}function dy(e,t){if(e.opts.jtd)return sp(e,[],!1,t);const r=(0,rp.getSchemaTypes)(e.schema),n=(0,rp.coerceAndCheckDataType)(e,r);sp(e,r,!n,t)}function _F(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,lr.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function CF(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,lr.checkStrictMode)(e,"default is ignored in the schema root")}function $F(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,mF.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function SF(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function fy({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const o=r.$comment;if(s.$comment===!0)e.code((0,ie._)`${fe.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){const a=(0,ie.str)`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code((0,ie._)`${fe.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function jF(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;r.$async?t.if((0,ie._)`${fe.default.errors} === 0`,()=>t.return(fe.default.data),()=>t.throw((0,ie._)`new ${s}(${fe.default.vErrors})`)):(t.assign((0,ie._)`${n}.errors`,fe.default.vErrors),o.unevaluated&&EF(e),t.return((0,ie._)`${fe.default.errors} === 0`))}function EF({gen:e,evaluated:t,props:r,items:n}){r instanceof ie.Name&&e.assign((0,ie._)`${t}.props`,r),n instanceof ie.Name&&e.assign((0,ie._)`${t}.items`,n)}function sp(e,t,r,n){const{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,lr.schemaHasRulesButRef)(o,d))){s.block(()=>my(e,"$ref",d.all.$ref.definition));return}c.jtd||AF(e,t),s.block(()=>{for(const p of d.rules)f(p);f(d.post)});function f(p){(0,Ru.shouldUseGroup)(o,p)&&(p.type?(s.if((0,Da.checkDataType)(p.type,a,c.strictNumbers)),op(e,p),t.length===1&&t[0]===p.type&&r&&(s.else(),(0,Da.reportTypeError)(e)),s.endIf()):op(e,p),i||s.if((0,ie._)`${fe.default.errors} === ${n||0}`))}}function op(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,pF.assignDefaults)(e,t.type),r.block(()=>{for(const o of t.rules)(0,Ru.shouldUseRule)(n,o)&&my(e,o.keyword,o.definition,t.type)})}function AF(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(NF(e,t),e.opts.allowUnionTypes||PF(e,t),RF(e,e.dataTypes))}function NF(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{hy(e.dataTypes,r)||Tu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),IF(e,t)}}function PF(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Tu(e,"use allowUnionTypes to allow union type keyword")}function RF(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Ru.shouldUseRule)(e.schema,s)){const{type:o}=s.definition;o.length&&!o.some(a=>TF(t,a))&&Tu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function TF(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function hy(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function IF(e,t){const r=[];for(const n of e.dataTypes)hy(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Tu(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,lr.checkStrictMode)(e,t,e.opts.strictTypes)}class py{constructor(t,r,n){if((0,Us.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,lr.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",gy(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Us.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",fe.default.errors))}result(t,r,n){this.failResult((0,ie.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,ie.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,ie._)`${r} !== undefined && (${(0,ie.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ss.reportExtraError:Ss.reportError)(this,this.def.error,r)}$dataError(){(0,Ss.reportError)(this,this.def.$dataError||Ss.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ss.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=ie.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=ie.nil,r=ie.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:o,def:a}=this;n.if((0,ie.or)((0,ie._)`${s} === undefined`,r)),t!==ie.nil&&n.assign(t,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==ie.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:o}=this;return(0,ie.or)(a(),i());function a(){if(n.length){if(!(r instanceof ie.Name))throw new Error("ajv implementation error");const c=Array.isArray(n)?n:[n];return(0,ie._)`${(0,Da.checkDataTypes)(c,r,o.opts.strictNumbers,Da.DataType.Wrong)}`}return ie.nil}function i(){if(s.validateSchema){const c=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,ie._)`!${c}(${r})`}return ie.nil}}subschema(t,r){const n=(0,tl.getSubschema)(this.it,t);(0,tl.extendSubschemaData)(n,this.it,t),(0,tl.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return wF(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=lr.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=lr.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,ie.Name)),!0}}Mt.KeywordCxt=py;function my(e,t,r,n){const s=new py(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Us.funcKeywordCode)(s,r):"macro"in r?(0,Us.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Us.funcKeywordCode)(s,r)}const MF=/^\/(?:[^~]|~0|~1)*$/,zF=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gy(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return fe.default.rootData;if(e[0]==="/"){if(!MF.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,o=fe.default.rootData}else{const u=zF.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw new Error(c("property/index",d));return n[t-d]}if(d>t)throw new Error(c("data",d));if(o=r[t-d],!s)return o}let a=o;const i=s.split("/");for(const u of i)u&&(o=(0,ie._)`${o}${(0,ie.getProperty)((0,lr.unescapeJsonPointer)(u))}`,a=(0,ie._)`${a} && ${o}`);return a;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}Mt.getData=gy;var go={};Object.defineProperty(go,"__esModule",{value:!0});class OF extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}go.default=OF;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});const rl=Je;class DF extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,rl.resolveUrl)(t,r,n),this.missingSchema=(0,rl.normalizeId)((0,rl.getFullPath)(t,this.missingRef))}}ss.default=DF;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.resolveSchema=ft.getCompilingSchema=ft.resolveRef=ft.compileSchema=ft.SchemaEnv=void 0;const At=be,LF=go,Dr=Zt,Tt=Je,ap=ne,FF=Mt;class _i{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Tt.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ft.SchemaEnv=_i;function Iu(e){const t=vy.call(this,e);if(t)return t;const r=(0,Tt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new At.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o});let i;e.$async&&(i=a.scopeValue("Error",{ref:LF.default,code:(0,At._)`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Dr.default.data,parentData:Dr.default.parentData,parentDataProperty:Dr.default.parentDataProperty,dataNames:[Dr.default.data],dataPathArr:[At.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,At.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:At.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,At._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,FF.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const f=a.toString();d=`${a.scopeRefs(Dr.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const h=new Function(`${Dr.default.self}`,`${Dr.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:f,scopeValues:a._values}),this.opts.unevaluated){const{props:g,items:m}=u;h.evaluated={props:g instanceof At.Name?void 0:g,items:m instanceof At.Name?void 0:m,dynamicProps:g instanceof At.Name,dynamicItems:m instanceof At.Name},h.source&&(h.source.evaluated=(0,At.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}ft.compileSchema=Iu;function BF(e,t,r){var n;r=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let o=VF.call(this,e,r);if(o===void 0){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;a&&(o=new _i({schema:a,schemaId:i,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=UF.call(this,o)}ft.resolveRef=BF;function UF(e){return(0,Tt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Iu.call(this,e)}function vy(e){for(const t of this._compilations)if(WF(t,e))return t}ft.getCompilingSchema=vy;function WF(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function VF(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Ci.call(this,e,t)}function Ci(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Tt._getFullPath)(this.opts.uriResolver,r);let s=(0,Tt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return nl.call(this,r,e);const o=(0,Tt.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){const i=Ci.call(this,e,a);return typeof(i==null?void 0:i.schema)!="object"?void 0:nl.call(this,r,i)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Iu.call(this,a),o===(0,Tt.normalizeId)(t)){const{schema:i}=a,{schemaId:c}=this.opts,u=i[c];return u&&(s=(0,Tt.resolveUrl)(this.opts.uriResolver,s,u)),new _i({schema:i,schemaId:c,root:e,baseId:s})}return nl.call(this,r,a)}}ft.resolveSchema=Ci;const KF=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function nl(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const i of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const c=r[(0,ap.unescapeFragment)(i)];if(c===void 0)return;r=c;const u=typeof r=="object"&&r[this.opts.schemaId];!KF.has(i)&&u&&(t=(0,Tt.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,ap.schemaHasRulesButRef)(r,this.RULES)){const i=(0,Tt.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Ci.call(this,n,i)}const{schemaId:a}=this.opts;if(o=o||new _i({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o}const HF="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",GF="Meta-schema for $data reference (JSON AnySchema extension proposal)",qF="object",YF=["$data"],JF={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ZF=!1,QF={$id:HF,description:GF,type:qF,required:YF,properties:JF,additionalProperties:ZF};var Mu={},$i={exports:{}};const XF=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),yy=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function by(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const eB=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function ip(e){return e.length=0,!0}function tB(e,t,r){if(e.length){const n=by(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function rB(e){let t=0;const r={error:!1,address:"",zone:""},n=[],s=[];let o=!1,a=!1,i=tB;for(let c=0;c<e.length;c++){const u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!i(s,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(o=!0),n.push(":");continue}else if(u==="%"){if(!i(s,n,r))break;i=ip}else{s.push(u);continue}}return s.length&&(i===ip?r.zone=s.join(""):a?n.push(s.join("")):n.push(by(s))),r.address=n.join(""),r}function xy(e){if(nB(e,":")<2)return{host:e,isIPV6:!1};const t=rB(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function nB(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function sB(e){let t=e;const r=[];let n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function oB(e,t){const r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function aB(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!yy(r)){const n=xy(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var wy={nonSimpleDomain:eB,recomposeAuthority:aB,normalizeComponentEncoding:oB,removeDotSegments:sB,isIPv4:yy,isUUID:XF,normalizeIPv6:xy};const{isUUID:iB}=wy,lB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function ky(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function _y(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Cy(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function cB(e){return e.secure=ky(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function uB(e){if((e.port===(ky(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function dB(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(lB);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,o=zu(s);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function fB(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=zu(s);o&&(e=o.serialize(e,t));const a=e,i=e.nss;return a.path=`${n||t.nid}:${i}`,t.skipEscape=!0,a}function hB(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!iB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function pB(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const $y={scheme:"http",domainHost:!0,parse:_y,serialize:Cy},mB={scheme:"https",domainHost:$y.domainHost,parse:_y,serialize:Cy},aa={scheme:"ws",domainHost:!0,parse:cB,serialize:uB},gB={scheme:"wss",domainHost:aa.domainHost,parse:aa.parse,serialize:aa.serialize},vB={scheme:"urn",parse:dB,serialize:fB,skipNormalize:!0},yB={scheme:"urn:uuid",parse:hB,serialize:pB,skipNormalize:!0},La={http:$y,https:mB,ws:aa,wss:gB,urn:vB,"urn:uuid":yB};Object.setPrototypeOf(La,null);function zu(e){return e&&(La[e]||La[e.toLowerCase()])||void 0}var bB={SCHEMES:La,getSchemeHandler:zu};const{normalizeIPv6:xB,removeDotSegments:Ms,recomposeAuthority:wB,normalizeComponentEncoding:Vo,isIPv4:kB,nonSimpleDomain:_B}=wy,{SCHEMES:CB,getSchemeHandler:Sy}=bB;function $B(e,t){return typeof e=="string"?e=Vt(fr(e,t),t):typeof e=="object"&&(e=fr(Vt(e,t),t)),e}function SB(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=jy(fr(e,n),fr(t,n),n,!0);return n.skipEscape=!0,Vt(s,n)}function jy(e,t,r,n){const s={};return n||(e=fr(Vt(e,r),r),t=fr(Vt(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ms(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=Ms(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=Ms(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function jB(e,t,r){return typeof e=="string"?(e=unescape(e),e=Vt(Vo(fr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Vt(Vo(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Vt(Vo(fr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Vt(Vo(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Vt(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=Sy(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");const a=wB(r);if(a!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(a),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let i=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(i=Ms(i)),a===void 0&&i[0]==="/"&&i[1]==="/"&&(i="/%2F"+i.slice(2)),s.push(i)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}const EB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function fr(e,t){const r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let s=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);const o=e.match(EB);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host)if(kB(n.host)===!1){const c=xB(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");const a=Sy(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&_B(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i}(!a||a&&!a.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}const Ou={SCHEMES:CB,normalize:$B,resolve:SB,resolveComponent:jy,equal:jB,serialize:Vt,parse:fr};$i.exports=Ou;$i.exports.default=Ou;$i.exports.fastUri=Ou;var AB=$i.exports;Object.defineProperty(Mu,"__esModule",{value:!0});const Ey=AB;Ey.code='require("ajv/dist/runtime/uri").default';Mu.default=Ey;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Mt;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=be;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=go,s=ss,o=sn,a=ft,i=be,c=Je,u=He,d=ne,f=QF,p=Mu,h=(Y,N)=>new RegExp(Y,N);h.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function C(Y){var N,Z,I,k,$,A,W,H,ee,re,le,pe,M,J,se,ue,_e,we,Ne,Ce,Ie,Ge,it,Et,wt;const ye=Y.strict,$e=(N=Y.code)===null||N===void 0?void 0:N.optimize,Ve=$e===!0||$e===void 0?1:$e||0,pt=(I=(Z=Y.code)===null||Z===void 0?void 0:Z.regExp)!==null&&I!==void 0?I:h,ls=(k=Y.uriResolver)!==null&&k!==void 0?k:p.default;return{strictSchema:(A=($=Y.strictSchema)!==null&&$!==void 0?$:ye)!==null&&A!==void 0?A:!0,strictNumbers:(H=(W=Y.strictNumbers)!==null&&W!==void 0?W:ye)!==null&&H!==void 0?H:!0,strictTypes:(re=(ee=Y.strictTypes)!==null&&ee!==void 0?ee:ye)!==null&&re!==void 0?re:"log",strictTuples:(pe=(le=Y.strictTuples)!==null&&le!==void 0?le:ye)!==null&&pe!==void 0?pe:"log",strictRequired:(J=(M=Y.strictRequired)!==null&&M!==void 0?M:ye)!==null&&J!==void 0?J:!1,code:Y.code?{...Y.code,optimize:Ve,regExp:pt}:{optimize:Ve,regExp:pt},loopRequired:(se=Y.loopRequired)!==null&&se!==void 0?se:b,loopEnum:(ue=Y.loopEnum)!==null&&ue!==void 0?ue:b,meta:(_e=Y.meta)!==null&&_e!==void 0?_e:!0,messages:(we=Y.messages)!==null&&we!==void 0?we:!0,inlineRefs:(Ne=Y.inlineRefs)!==null&&Ne!==void 0?Ne:!0,schemaId:(Ce=Y.schemaId)!==null&&Ce!==void 0?Ce:"$id",addUsedSchema:(Ie=Y.addUsedSchema)!==null&&Ie!==void 0?Ie:!0,validateSchema:(Ge=Y.validateSchema)!==null&&Ge!==void 0?Ge:!0,validateFormats:(it=Y.validateFormats)!==null&&it!==void 0?it:!0,unicodeRegExp:(Et=Y.unicodeRegExp)!==null&&Et!==void 0?Et:!0,int32range:(wt=Y.int32range)!==null&&wt!==void 0?wt:!0,uriResolver:ls}}class w{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...C(N)};const{es5:Z,lines:I}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:m,es5:Z,lines:I}),this.logger=P(N.logger);const k=N.validateFormats;N.validateFormats=!1,this.RULES=(0,o.getRules)(),_.call(this,v,N,"NOT SUPPORTED"),_.call(this,y,N,"DEPRECATED","warn"),this._metaOpts=S.call(this),N.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&j.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),z.call(this),N.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:Z,schemaId:I}=this.opts;let k=f;I==="id"&&(k={...f},k.id=k.$id,delete k.$id),Z&&N&&this.addMetaSchema(k,k[I],!1)}defaultMeta(){const{meta:N,schemaId:Z}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[Z]||N:void 0}validate(N,Z){let I;if(typeof N=="string"){if(I=this.getSchema(N),!I)throw new Error(`no schema with key or ref "${N}"`)}else I=this.compile(N);const k=I(Z);return"$async"in I||(this.errors=I.errors),k}compile(N,Z){const I=this._addSchema(N,Z);return I.validate||this._compileSchemaEnv(I)}compileAsync(N,Z){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:I}=this.opts;return k.call(this,N,Z);async function k(re,le){await $.call(this,re.$schema);const pe=this._addSchema(re,le);return pe.validate||A.call(this,pe)}async function $(re){re&&!this.getSchema(re)&&await k.call(this,{$ref:re},!0)}async function A(re){try{return this._compileSchemaEnv(re)}catch(le){if(!(le instanceof s.default))throw le;return W.call(this,le),await H.call(this,le.missingSchema),A.call(this,re)}}function W({missingSchema:re,missingRef:le}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${le} cannot be resolved`)}async function H(re){const le=await ee.call(this,re);this.refs[re]||await $.call(this,le.$schema),this.refs[re]||this.addSchema(le,re,Z)}async function ee(re){const le=this._loading[re];if(le)return le;try{return await(this._loading[re]=I(re))}finally{delete this._loading[re]}}}addSchema(N,Z,I,k=this.opts.validateSchema){if(Array.isArray(N)){for(const A of N)this.addSchema(A,void 0,I,k);return this}let $;if(typeof N=="object"){const{schemaId:A}=this.opts;if($=N[A],$!==void 0&&typeof $!="string")throw new Error(`schema ${A} must be string`)}return Z=(0,c.normalizeId)(Z||$),this._checkUnique(Z),this.schemas[Z]=this._addSchema(N,I,Z,k,!0),this}addMetaSchema(N,Z,I=this.opts.validateSchema){return this.addSchema(N,Z,!0,I),this}validateSchema(N,Z){if(typeof N=="boolean")return!0;let I;if(I=N.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate(I,N);if(!k&&Z){const $="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error($);else throw new Error($)}return k}getSchema(N){let Z;for(;typeof(Z=R.call(this,N))=="string";)N=Z;if(Z===void 0){const{schemaId:I}=this.opts,k=new a.SchemaEnv({schema:{},schemaId:I});if(Z=a.resolveSchema.call(this,k,N),!Z)return;this.refs[N]=Z}return Z.validate||this._compileSchemaEnv(Z)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const Z=R.call(this,N);return typeof Z=="object"&&this._cache.delete(Z.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const Z=N;this._cache.delete(Z);let I=N[this.opts.schemaId];return I&&(I=(0,c.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const Z of N)this.addKeyword(Z);return this}addKeyword(N,Z){let I;if(typeof N=="string")I=N,typeof Z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Z.keyword=I);else if(typeof N=="object"&&Z===void 0){if(Z=N,I=Z.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(O.call(this,I,Z),!Z)return(0,d.eachItem)(I,$=>G.call(this,$)),this;L.call(this,Z);const k={...Z,type:(0,u.getJSONTypes)(Z.type),schemaType:(0,u.getJSONTypes)(Z.schemaType)};return(0,d.eachItem)(I,k.type.length===0?$=>G.call(this,$,k):$=>k.type.forEach(A=>G.call(this,$,k,A))),this}getKeyword(N){const Z=this.RULES.all[N];return typeof Z=="object"?Z.definition:!!Z}removeKeyword(N){const{RULES:Z}=this;delete Z.keywords[N],delete Z.all[N];for(const I of Z.rules){const k=I.rules.findIndex($=>$.keyword===N);k>=0&&I.rules.splice(k,1)}return this}addFormat(N,Z){return typeof Z=="string"&&(Z=new RegExp(Z)),this.formats[N]=Z,this}errorsText(N=this.errors,{separator:Z=", ",dataVar:I="data"}={}){return!N||N.length===0?"No errors":N.map(k=>`${I}${k.instancePath} ${k.message}`).reduce((k,$)=>k+Z+$)}$dataMetaSchema(N,Z){const I=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const k of Z){const $=k.split("/").slice(1);let A=N;for(const W of $)A=A[W];for(const W in I){const H=I[W];if(typeof H!="object")continue;const{$data:ee}=H.definition,re=A[W];ee&&re&&(A[W]=oe(re))}}return N}_removeAllSchemas(N,Z){for(const I in N){const k=N[I];(!Z||Z.test(I))&&(typeof k=="string"?delete N[I]:k&&!k.meta&&(this._cache.delete(k.schema),delete N[I]))}}_addSchema(N,Z,I,k=this.opts.validateSchema,$=this.opts.addUsedSchema){let A;const{schemaId:W}=this.opts;if(typeof N=="object")A=N[W];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(N);if(H!==void 0)return H;I=(0,c.normalizeId)(A||I);const ee=c.getSchemaRefs.call(this,N,I);return H=new a.SchemaEnv({schema:N,schemaId:W,meta:Z,baseId:I,localRefs:ee}),this._cache.set(H.schema,H),$&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=H),k&&this.validateSchema(N,!0),H}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):a.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const Z=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,N)}finally{this.opts=Z}}}w.ValidationError=n.default,w.MissingRefError=s.default,e.default=w;function _(Y,N,Z,I="error"){for(const k in Y){const $=k;$ in N&&this.logger[I](`${Z}: option ${k}. ${Y[$]}`)}}function R(Y){return Y=(0,c.normalizeId)(Y),this.schemas[Y]||this.refs[Y]}function z(){const Y=this.opts.schemas;if(Y)if(Array.isArray(Y))this.addSchema(Y);else for(const N in Y)this.addSchema(Y[N],N)}function D(){for(const Y in this.opts.formats){const N=this.opts.formats[Y];N&&this.addFormat(Y,N)}}function j(Y){if(Array.isArray(Y)){this.addVocabulary(Y);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in Y){const Z=Y[N];Z.keyword||(Z.keyword=N),this.addKeyword(Z)}}function S(){const Y={...this.opts};for(const N of g)delete Y[N];return Y}const E={log(){},warn(){},error(){}};function P(Y){if(Y===!1)return E;if(Y===void 0)return console;if(Y.log&&Y.warn&&Y.error)return Y;throw new Error("logger must implement log, warn and error methods")}const K=/^[a-z_$][a-z0-9_$:-]*$/i;function O(Y,N){const{RULES:Z}=this;if((0,d.eachItem)(Y,I=>{if(Z.keywords[I])throw new Error(`Keyword ${I} is already defined`);if(!K.test(I))throw new Error(`Keyword ${I} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function G(Y,N,Z){var I;const k=N==null?void 0:N.post;if(Z&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:$}=this;let A=k?$.post:$.rules.find(({type:H})=>H===Z);if(A||(A={type:Z,rules:[]},$.rules.push(A)),$.keywords[Y]=!0,!N)return;const W={keyword:Y,definition:{...N,type:(0,u.getJSONTypes)(N.type),schemaType:(0,u.getJSONTypes)(N.schemaType)}};N.before?V.call(this,A,W,N.before):A.rules.push(W),$.all[Y]=W,(I=N.implements)===null||I===void 0||I.forEach(H=>this.addKeyword(H))}function V(Y,N,Z){const I=Y.rules.findIndex(k=>k.keyword===Z);I>=0?Y.rules.splice(I,0,N):(Y.rules.push(N),this.logger.warn(`rule ${Z} is not defined`))}function L(Y){let{metaSchema:N}=Y;N!==void 0&&(Y.$data&&this.opts.$data&&(N=oe(N)),Y.validateSchema=this.compile(N,!0))}const U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oe(Y){return{anyOf:[Y,U]}}})(Lv);var Du={},Lu={},Fu={};Object.defineProperty(Fu,"__esModule",{value:!0});const NB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Fu.default=NB;var on={};Object.defineProperty(on,"__esModule",{value:!0});on.callRef=on.getValidate=void 0;const PB=ss,lp=xe,dt=be,_n=Zt,cp=ft,Ko=ne,RB={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return f();const d=cp.resolveRef.call(c,u,s,r);if(d===void 0)throw new PB.default(n.opts.uriResolver,s,r);if(d instanceof cp.SchemaEnv)return p(d);return h(d);function f(){if(o===u)return ia(e,a,o,o.$async);const g=t.scopeValue("root",{ref:u});return ia(e,(0,dt._)`${g}.validate`,u,u.$async)}function p(g){const m=Ay(e,g);ia(e,m,g,g.$async)}function h(g){const m=t.scopeValue("schema",i.code.source===!0?{ref:g,code:(0,dt.stringify)(g)}:{ref:g}),v=t.name("valid"),y=e.subschema({schema:g,dataTypes:[],schemaPath:dt.nil,topSchemaRef:m,errSchemaPath:r},v);e.mergeEvaluated(y),e.ok(v)}}};function Ay(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,dt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}on.getValidate=Ay;function ia(e,t,r,n){const{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?_n.default.this:dt.nil;n?d():f();function d(){if(!i.$async)throw new Error("async schema referenced by sync schema");const g=s.let("valid");s.try(()=>{s.code((0,dt._)`await ${(0,lp.callValidateCode)(e,t,u)}`),h(t),a||s.assign(g,!0)},m=>{s.if((0,dt._)`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),a||s.assign(g,!1)}),e.ok(g)}function f(){e.result((0,lp.callValidateCode)(e,t,u),()=>h(t),()=>p(t))}function p(g){const m=(0,dt._)`${g}.errors`;s.assign(_n.default.vErrors,(0,dt._)`${_n.default.vErrors} === null ? ${m} : ${_n.default.vErrors}.concat(${m})`),s.assign(_n.default.errors,(0,dt._)`${_n.default.vErrors}.length`)}function h(g){var m;if(!o.opts.unevaluated)return;const v=(m=r==null?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=Ko.mergeEvaluated.props(s,v.props,o.props));else{const y=s.var("props",(0,dt._)`${g}.evaluated.props`);o.props=Ko.mergeEvaluated.props(s,y,o.props,dt.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=Ko.mergeEvaluated.items(s,v.items,o.items));else{const y=s.var("items",(0,dt._)`${g}.evaluated.items`);o.items=Ko.mergeEvaluated.items(s,y,o.items,dt.Name)}}}on.callRef=ia;on.default=RB;Object.defineProperty(Lu,"__esModule",{value:!0});const TB=Fu,IB=on,MB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",TB.default,IB.default];Lu.default=MB;var Bu={},Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});const Fa=be,wr=Fa.operators,Ba={maximum:{okStr:"<=",ok:wr.LTE,fail:wr.GT},minimum:{okStr:">=",ok:wr.GTE,fail:wr.LT},exclusiveMaximum:{okStr:"<",ok:wr.LT,fail:wr.GTE},exclusiveMinimum:{okStr:">",ok:wr.GT,fail:wr.LTE}},zB={message:({keyword:e,schemaCode:t})=>(0,Fa.str)`must be ${Ba[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Fa._)`{comparison: ${Ba[e].okStr}, limit: ${t}}`},OB={keyword:Object.keys(Ba),type:"number",schemaType:"number",$data:!0,error:zB,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Fa._)`${r} ${Ba[t].fail} ${n} || isNaN(${r})`)}};Uu.default=OB;var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});const Ws=be,DB={message:({schemaCode:e})=>(0,Ws.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ws._)`{multipleOf: ${e}}`},LB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:DB,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?(0,Ws._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Ws._)`${a} !== parseInt(${a})`;e.fail$data((0,Ws._)`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Wu.default=LB;var Vu={},Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});function Ny(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}Ku.default=Ny;Ny.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Vu,"__esModule",{value:!0});const Hr=be,FB=ne,BB=Ku,UB={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,Hr.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Hr._)`{limit: ${e}}`},WB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:UB,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?Hr.operators.GT:Hr.operators.LT,a=s.opts.unicode===!1?(0,Hr._)`${r}.length`:(0,Hr._)`${(0,FB.useFunc)(e.gen,BB.default)}(${r})`;e.fail$data((0,Hr._)`${a} ${o} ${n}`)}};Vu.default=WB;var Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});const VB=xe,KB=ne,Tn=be,HB={message:({schemaCode:e})=>(0,Tn.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Tn._)`{pattern: ${e}}`},GB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:HB,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e,i=a.opts.unicodeRegExp?"u":"";if(n){const{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,Tn._)`new RegExp`:(0,KB.useFunc)(t,c),d=t.let("valid");t.try(()=>t.assign(d,(0,Tn._)`${u}(${o}, ${i}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,Tn._)`!${d}`)}else{const c=(0,VB.usePattern)(e,s);e.fail$data((0,Tn._)`!${c}.test(${r})`)}}};Hu.default=GB;var Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});const Vs=be,qB={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Vs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Vs._)`{limit: ${e}}`},YB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qB,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Vs.operators.GT:Vs.operators.LT;e.fail$data((0,Vs._)`Object.keys(${r}).length ${s} ${n}`)}};Gu.default=YB;var qu={};Object.defineProperty(qu,"__esModule",{value:!0});const js=xe,Ks=be,JB=ne,ZB={message:({params:{missingProperty:e}})=>(0,Ks.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Ks._)`{missingProperty: ${e}}`},QB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:ZB,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;const c=r.length>=i.loopRequired;if(a.allErrors?u():d(),i.strictRequired){const h=e.parentSchema.properties,{definedProperties:g}=e.it;for(const m of r)if((h==null?void 0:h[m])===void 0&&!g.has(m)){const v=a.schemaEnv.baseId+a.errSchemaPath,y=`required property "${m}" is not defined at "${v}" (strictRequired)`;(0,JB.checkStrictMode)(a,y,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(Ks.nil,f);else for(const h of r)(0,js.checkReportMissingProp)(e,h)}function d(){const h=t.let("missing");if(c||o){const g=t.let("valid",!0);e.block$data(g,()=>p(h,g)),e.ok(g)}else t.if((0,js.checkMissingProp)(e,r,h)),(0,js.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,js.noPropertyInData)(t,s,h,i.ownProperties),()=>e.error())})}function p(h,g){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(g,(0,js.propertyInData)(t,s,h,i.ownProperties)),t.if((0,Ks.not)(g),()=>{e.error(),t.break()})},Ks.nil)}}};qu.default=QB;var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});const Hs=be,XB={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Hs.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Hs._)`{limit: ${e}}`},e5={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:XB,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Hs.operators.GT:Hs.operators.LT;e.fail$data((0,Hs._)`${r}.length ${s} ${n}`)}};Yu.default=e5;var Ju={},vo={};Object.defineProperty(vo,"__esModule",{value:!0});const Py=ty;Py.code='require("ajv/dist/runtime/equal").default';vo.default=Py;Object.defineProperty(Ju,"__esModule",{value:!0});const sl=He,Ye=be,t5=ne,r5=vo,n5={message:({params:{i:e,j:t}})=>(0,Ye.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ye._)`{i: ${e}, j: ${t}}`},s5={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:n5,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;const c=t.let("valid"),u=o.items?(0,sl.getSchemaTypes)(o.items):[];e.block$data(c,d,(0,Ye._)`${a} === false`),e.ok(c);function d(){const g=t.let("i",(0,Ye._)`${r}.length`),m=t.let("j");e.setParams({i:g,j:m}),t.assign(c,!0),t.if((0,Ye._)`${g} > 1`,()=>(f()?p:h)(g,m))}function f(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function p(g,m){const v=t.name("item"),y=(0,sl.checkDataTypes)(u,v,i.opts.strictNumbers,sl.DataType.Wrong),b=t.const("indices",(0,Ye._)`{}`);t.for((0,Ye._)`;${g}--;`,()=>{t.let(v,(0,Ye._)`${r}[${g}]`),t.if(y,(0,Ye._)`continue`),u.length>1&&t.if((0,Ye._)`typeof ${v} == "string"`,(0,Ye._)`${v} += "_"`),t.if((0,Ye._)`typeof ${b}[${v}] == "number"`,()=>{t.assign(m,(0,Ye._)`${b}[${v}]`),e.error(),t.assign(c,!1).break()}).code((0,Ye._)`${b}[${v}] = ${g}`)})}function h(g,m){const v=(0,t5.useFunc)(t,r5.default),y=t.name("outer");t.label(y).for((0,Ye._)`;${g}--;`,()=>t.for((0,Ye._)`${m} = ${g}; ${m}--;`,()=>t.if((0,Ye._)`${v}(${r}[${g}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(y)})))}}};Ju.default=s5;var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});const jc=be,o5=ne,a5=vo,i5={message:"must be equal to constant",params:({schemaCode:e})=>(0,jc._)`{allowedValue: ${e}}`},l5={keyword:"const",$data:!0,error:i5,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;n||o&&typeof o=="object"?e.fail$data((0,jc._)`!${(0,o5.useFunc)(t,a5.default)}(${r}, ${s})`):e.fail((0,jc._)`${o} !== ${r}`)}};Zu.default=l5;var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0});const zs=be,c5=ne,u5=vo,d5={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,zs._)`{allowedValues: ${e}}`},f5={keyword:"enum",schemaType:"array",$data:!0,error:d5,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const i=s.length>=a.opts.loopEnum;let c;const u=()=>c??(c=(0,c5.useFunc)(t,u5.default));let d;if(i||n)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const h=t.const("vSchema",o);d=(0,zs.or)(...s.map((g,m)=>p(h,m)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",o,h=>t.if((0,zs._)`${u()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function p(h,g){const m=s[g];return typeof m=="object"&&m!==null?(0,zs._)`${u()}(${r}, ${h}[${g}])`:(0,zs._)`${r} === ${m}`}}};Qu.default=f5;Object.defineProperty(Bu,"__esModule",{value:!0});const h5=Uu,p5=Wu,m5=Vu,g5=Hu,v5=Gu,y5=qu,b5=Yu,x5=Ju,w5=Zu,k5=Qu,_5=[h5.default,p5.default,m5.default,g5.default,v5.default,y5.default,b5.default,x5.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},w5.default,k5.default];Bu.default=_5;var Xu={},os={};Object.defineProperty(os,"__esModule",{value:!0});os.validateAdditionalItems=void 0;const Gr=be,Ec=ne,C5={message:({params:{len:e}})=>(0,Gr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Gr._)`{limit: ${e}}`},$5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:C5,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Ec.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ry(e,n)}};function Ry(e,t){const{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;const i=r.const("len",(0,Gr._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Gr._)`${i} <= ${t.length}`);else if(typeof n=="object"&&!(0,Ec.alwaysValidSchema)(a,n)){const u=r.var("valid",(0,Gr._)`${i} <= ${t.length}`);r.if((0,Gr.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,d=>{e.subschema({keyword:o,dataProp:d,dataPropType:Ec.Type.Num},u),a.allErrors||r.if((0,Gr.not)(u),()=>r.break())})}}os.validateAdditionalItems=Ry;os.default=$5;var ed={},as={};Object.defineProperty(as,"__esModule",{value:!0});as.validateTuple=void 0;const up=be,la=ne,S5=xe,j5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Ty(e,"additionalItems",t);r.items=!0,!(0,la.alwaysValidSchema)(r,t)&&e.ok((0,S5.validateArray)(e))}};function Ty(e,t,r=e.schema){const{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;d(s),i.opts.unevaluated&&r.length&&i.items!==!0&&(i.items=la.mergeEvaluated.items(n,r.length,i.items));const c=n.name("valid"),u=n.const("len",(0,up._)`${o}.length`);r.forEach((f,p)=>{(0,la.alwaysValidSchema)(i,f)||(n.if((0,up._)`${u} > ${p}`,()=>e.subschema({keyword:a,schemaProp:p,dataProp:p},c)),e.ok(c))});function d(f){const{opts:p,errSchemaPath:h}=i,g=r.length,m=g===f.minItems&&(g===f.maxItems||f[t]===!1);if(p.strictTuples&&!m){const v=`"${a}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,la.checkStrictMode)(i,v,p.strictTuples)}}}as.validateTuple=Ty;as.default=j5;Object.defineProperty(ed,"__esModule",{value:!0});const E5=as,A5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,E5.validateTuple)(e,"items")};ed.default=A5;var td={};Object.defineProperty(td,"__esModule",{value:!0});const dp=be,N5=ne,P5=xe,R5=os,T5={message:({params:{len:e}})=>(0,dp.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,dp._)`{limit: ${e}}`},I5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:T5,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,N5.alwaysValidSchema)(n,t)&&(s?(0,R5.validateAdditionalItems)(e,s):e.ok((0,P5.validateArray)(e)))}};td.default=I5;var rd={};Object.defineProperty(rd,"__esModule",{value:!0});const kt=be,Ho=ne,M5={message:({params:{min:e,max:t}})=>t===void 0?(0,kt.str)`must contain at least ${e} valid item(s)`:(0,kt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,kt._)`{minContains: ${e}}`:(0,kt._)`{minContains: ${e}, maxContains: ${t}}`},z5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:M5,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;let a,i;const{minContains:c,maxContains:u}=n;o.opts.next?(a=c===void 0?1:c,i=u):a=1;const d=t.const("len",(0,kt._)`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){(0,Ho.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){(0,Ho.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Ho.alwaysValidSchema)(o,r)){let m=(0,kt._)`${d} >= ${a}`;i!==void 0&&(m=(0,kt._)`${m} && ${d} <= ${i}`),e.pass(m);return}o.items=!0;const f=t.name("valid");i===void 0&&a===1?h(f,()=>t.if(f,()=>t.break())):a===0?(t.let(f,!0),i!==void 0&&t.if((0,kt._)`${s}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,()=>e.reset());function p(){const m=t.name("_valid"),v=t.let("count",0);h(m,()=>t.if(m,()=>g(v)))}function h(m,v){t.forRange("i",0,d,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:Ho.Type.Num,compositeRule:!0},m),v()})}function g(m){t.code((0,kt._)`${m}++`),i===void 0?t.if((0,kt._)`${m} >= ${a}`,()=>t.assign(f,!0).break()):(t.if((0,kt._)`${m} > ${i}`,()=>t.assign(f,!1).break()),a===1?t.assign(f,!0):t.if((0,kt._)`${m} >= ${a}`,()=>t.assign(f,!0)))}}};rd.default=z5;var Iy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=be,r=ne,n=xe;e.error={message:({params:{property:c,depsCount:u,deps:d}})=>{const f=u===1?"property":"properties";return(0,t.str)`must have ${f} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:d,missingProperty:f}})=>(0,t._)`{property: ${c},
125
125
  missingProperty: ${f},
126
126
  depsCount: ${u},
127
- deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,d]=o(c);a(c,u),i(c,d)}};function o({schema:c}){const u={},d={};for(const f in c){if(f==="__proto__")continue;const p=Array.isArray(c[f])?u:d;p[f]=c[f]}return[u,d]}function a(c,u=c.schema){const{gen:d,data:f,it:p}=c;if(Object.keys(u).length===0)return;const h=d.let("missing");for(const g in u){const m=u[g];if(m.length===0)continue;const v=(0,n.propertyInData)(d,f,g,p.opts.ownProperties);c.setParams({property:g,depsCount:m.length,deps:m.join(", ")}),p.allErrors?d.if(v,()=>{for(const y of m)(0,n.checkReportMissingProp)(c,y)}):(d.if((0,t._)`${v} && (${(0,n.checkMissingProp)(c,m,h)})`),(0,n.reportMissingProp)(c,h),d.else())}}e.validatePropertyDeps=a;function i(c,u=c.schema){const{gen:d,data:f,keyword:p,it:h}=c,g=d.name("valid");for(const m in u)(0,r.alwaysValidSchema)(h,u[m])||(d.if((0,n.propertyInData)(d,f,m,h.opts.ownProperties),()=>{const v=c.subschema({keyword:p,schemaProp:m},g);c.mergeValidEvaluated(v,g)},()=>d.var(g,!0)),c.ok(g))}e.validateSchemaDeps=i,e.default=s})(Fy);var ad={};Object.defineProperty(ad,"__esModule",{value:!0});const By=be,N3=ne,P3={message:"property name must be valid",params:({params:e})=>(0,By._)`{propertyName: ${e.propertyName}}`},R3={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:P3,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,N3.alwaysValidSchema)(s,r))return;const o=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,By.not)(o),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(o)}};ad.default=R3;var Si={};Object.defineProperty(Si,"__esModule",{value:!0});const qo=xe,Nt=be,T3=Zt,Go=ne,I3={message:"must NOT have additional properties",params:({params:e})=>(0,Nt._)`{additionalProperty: ${e.additionalProperty}}`},M3={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:I3,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,Go.alwaysValidSchema)(a,r))return;const u=(0,qo.allSchemaProperties)(n.properties),d=(0,qo.allSchemaProperties)(n.patternProperties);f(),e.ok((0,Nt._)`${o} === ${T3.default.errors}`);function f(){t.forIn("key",s,v=>{!u.length&&!d.length?g(v):t.if(p(v),()=>g(v))})}function p(v){let y;if(u.length>8){const b=(0,Go.schemaRefOrVal)(a,n.properties,"properties");y=(0,qo.isOwnProperty)(t,b,v)}else u.length?y=(0,Nt.or)(...u.map(b=>(0,Nt._)`${v} === ${b}`)):y=Nt.nil;return d.length&&(y=(0,Nt.or)(y,...d.map(b=>(0,Nt._)`${(0,qo.usePattern)(e,b)}.test(${v})`))),(0,Nt.not)(y)}function h(v){t.code((0,Nt._)`delete ${s}[${v}]`)}function g(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){h(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),i||t.break();return}if(typeof r=="object"&&!(0,Go.alwaysValidSchema)(a,r)){const y=t.name("valid");c.removeAdditional==="failing"?(m(v,y,!1),t.if((0,Nt.not)(y),()=>{e.reset(),h(v)})):(m(v,y),i||t.if((0,Nt.not)(y),()=>t.break()))}}function m(v,y,b){const C={keyword:"additionalProperties",dataProp:v,dataPropType:Go.Type.Str};b===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(C,y)}}};Si.default=M3;var id={};Object.defineProperty(id,"__esModule",{value:!0});const z3=Mt,yp=xe,ll=ne,bp=Si,O3={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&bp.default.code(new z3.KeywordCxt(o,bp.default,"additionalProperties"));const a=(0,yp.allSchemaProperties)(r);for(const f of a)o.definedProperties.add(f);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=ll.mergeEvaluated.props(t,(0,ll.toHash)(a),o.props));const i=a.filter(f=>!(0,ll.alwaysValidSchema)(o,r[f]));if(i.length===0)return;const c=t.name("valid");for(const f of i)u(f)?d(f):(t.if((0,yp.propertyInData)(t,s,f,o.opts.ownProperties)),d(f),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(c);function u(f){return o.opts.useDefaults&&!o.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};id.default=O3;var ld={};Object.defineProperty(ld,"__esModule",{value:!0});const xp=xe,Yo=be,wp=ne,kp=ne,D3={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=(0,xp.allSchemaProperties)(r),c=i.filter(m=>(0,wp.alwaysValidSchema)(o,r[m]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;const u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,d=t.name("valid");o.props!==!0&&!(o.props instanceof Yo.Name)&&(o.props=(0,kp.evaluatedPropsToName)(t,o.props));const{props:f}=o;p();function p(){for(const m of i)u&&h(m),o.allErrors?g(m):(t.var(d,!0),g(m),t.if(d))}function h(m){for(const v in u)new RegExp(m).test(v)&&(0,wp.checkStrictMode)(o,`property ${v} matches pattern ${m} (use allowMatchingProperties)`)}function g(m){t.forIn("key",n,v=>{t.if((0,Yo._)`${(0,xp.usePattern)(e,m)}.test(${v})`,()=>{const y=c.includes(m);y||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:v,dataPropType:kp.Type.Str},d),o.opts.unevaluated&&f!==!0?t.assign((0,Yo._)`${f}[${v}]`,!0):!y&&!o.allErrors&&t.if((0,Yo.not)(d),()=>t.break())})})}}};ld.default=D3;var cd={};Object.defineProperty(cd,"__esModule",{value:!0});const L3=ne,F3={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,L3.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};cd.default=F3;var ud={};Object.defineProperty(ud,"__esModule",{value:!0});const B3=xe,U3={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:B3.validateUnion,error:{message:"must match a schema in anyOf"}};ud.default=U3;var dd={};Object.defineProperty(dd,"__esModule",{value:!0});const ca=be,W3=ne,V3={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ca._)`{passingSchemas: ${e.passing}}`},K3={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:V3,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,f)=>{let p;(0,W3.alwaysValidSchema)(s,d)?t.var(c,!0):p=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c),f>0&&t.if((0,ca._)`${c} && ${a}`).assign(a,!1).assign(i,(0,ca._)`[${i}, ${f}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(i,f),p&&e.mergeEvaluated(p,ca.Name)})})}}};dd.default=K3;var fd={};Object.defineProperty(fd,"__esModule",{value:!0});const H3=ne,q3={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((o,a)=>{if((0,H3.alwaysValidSchema)(n,o))return;const i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};fd.default=q3;var hd={};Object.defineProperty(hd,"__esModule",{value:!0});const Ua=be,Uy=ne,G3={message:({params:e})=>(0,Ua.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ua._)`{failingKeyword: ${e.ifClause}}`},Y3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:G3,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Uy.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=_p(n,"then"),o=_p(n,"else");if(!s&&!o)return;const a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(i,u("then",d),u("else",d))}else s?t.if(i,u("then")):t.if((0,Ua.not)(i),u("else"));e.pass(a,()=>e.error(!0));function c(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(d)}function u(d,f){return()=>{const p=e.subschema({keyword:d},i);t.assign(a,i),e.mergeValidEvaluated(p,a),f?t.assign(f,(0,Ua._)`${d}`):e.setParams({ifClause:d})}}}};function _p(e,t){const r=e.schema[t];return r!==void 0&&!(0,Uy.alwaysValidSchema)(e,r)}hd.default=Y3;var pd={};Object.defineProperty(pd,"__esModule",{value:!0});const J3=ne,Z3={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,J3.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};pd.default=Z3;Object.defineProperty(rd,"__esModule",{value:!0});const Q3=os,X3=nd,e5=as,t5=sd,r5=od,n5=Fy,s5=ad,o5=Si,a5=id,i5=ld,l5=cd,c5=ud,u5=dd,d5=fd,f5=hd,h5=pd;function p5(e=!1){const t=[l5.default,c5.default,u5.default,d5.default,f5.default,h5.default,s5.default,o5.default,n5.default,a5.default,i5.default];return e?t.push(X3.default,t5.default):t.push(Q3.default,e5.default),t.push(r5.default),t}rd.default=p5;var md={},gd={};Object.defineProperty(gd,"__esModule",{value:!0});const Be=be,m5={message:({schemaCode:e})=>(0,Be.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Be._)`{format: ${e}}`},g5={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:m5,code(e,t){const{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:f}=i;if(!c.validateFormats)return;s?p():h();function p(){const g=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),m=r.const("fDef",(0,Be._)`${g}[${a}]`),v=r.let("fType"),y=r.let("format");r.if((0,Be._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(v,(0,Be._)`${m}.type || "string"`).assign(y,(0,Be._)`${m}.validate`),()=>r.assign(v,(0,Be._)`"string"`).assign(y,m)),e.fail$data((0,Be.or)(b(),C()));function b(){return c.strictSchema===!1?Be.nil:(0,Be._)`${a} && !${y}`}function C(){const w=d.$async?(0,Be._)`(${m}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,Be._)`${y}(${n})`,_=(0,Be._)`(typeof ${y} == "function" ? ${w} : ${y}.test(${n}))`;return(0,Be._)`${y} && ${y} !== true && ${v} === ${t} && !${_}`}}function h(){const g=f.formats[o];if(!g){b();return}if(g===!0)return;const[m,v,y]=C(g);m===t&&e.pass(w());function b(){if(c.strictSchema===!1){f.logger.warn(_());return}throw new Error(_());function _(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function C(_){const R=_ instanceof RegExp?(0,Be.regexpCode)(_):c.code.formats?(0,Be._)`${c.code.formats}${(0,Be.getProperty)(o)}`:void 0,z=r.scopeValue("formats",{key:o,ref:_,code:R});return typeof _=="object"&&!(_ instanceof RegExp)?[_.type||"string",_.validate,(0,Be._)`${z}.validate`]:["string",_,z]}function w(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Be._)`await ${y}(${n})`}return typeof v=="function"?(0,Be._)`${y}(${n})`:(0,Be._)`${y}.test(${n})`}}}};gd.default=g5;Object.defineProperty(md,"__esModule",{value:!0});const v5=gd,y5=[v5.default];md.default=y5;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.contentVocabulary=Kn.metadataVocabulary=void 0;Kn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Kn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Bu,"__esModule",{value:!0});const b5=Uu,x5=Vu,w5=rd,k5=md,Cp=Kn,_5=[b5.default,x5.default,(0,w5.default)(),k5.default,Cp.metadataVocabulary,Cp.contentVocabulary];Bu.default=_5;var vd={},ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.DiscrError=void 0;var $p;(function(e){e.Tag="tag",e.Mapping="mapping"})($p||(ji.DiscrError=$p={}));Object.defineProperty(vd,"__esModule",{value:!0});const Pn=be,Rc=ji,Sp=ft,C5=ss,$5=ne,S5={message:({params:{discrError:e,tagName:t}})=>e===Rc.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Pn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},j5={keyword:"discriminator",type:"object",schemaType:"object",error:S5,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const i=n.propertyName;if(typeof i!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",(0,Pn._)`${r}${(0,Pn.getProperty)(i)}`);t.if((0,Pn._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:Rc.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function d(){const h=p();t.if(!1);for(const g in h)t.elseIf((0,Pn._)`${u} === ${g}`),t.assign(c,f(h[g]));t.else(),e.error(!1,{discrError:Rc.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function f(h){const g=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},g);return e.mergeEvaluated(m,Pn.Name),g}function p(){var h;const g={},m=y(s);let v=!0;for(let w=0;w<a.length;w++){let _=a[w];if(_!=null&&_.$ref&&!(0,$5.schemaHasRulesButRef)(_,o.self.RULES)){const z=_.$ref;if(_=Sp.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,z),_ instanceof Sp.SchemaEnv&&(_=_.schema),_===void 0)throw new C5.default(o.opts.uriResolver,o.baseId,z)}const R=(h=_==null?void 0:_.properties)===null||h===void 0?void 0:h[i];if(typeof R!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);v=v&&(m||y(_)),b(R,w)}if(!v)throw new Error(`discriminator: "${i}" must be required`);return g;function y({required:w}){return Array.isArray(w)&&w.includes(i)}function b(w,_){if(w.const)C(w.const,_);else if(w.enum)for(const R of w.enum)C(R,_);else throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function C(w,_){if(typeof w!="string"||w in g)throw new Error(`discriminator: "${i}" values must be unique strings`);g[w]=_}}}};vd.default=j5;const E5="http://json-schema.org/draft-07/schema#",A5="http://json-schema.org/draft-07/schema#",N5="Core schema meta-schema",P5={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},R5=["object","boolean"],T5={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},I5={$schema:E5,$id:A5,title:N5,definitions:P5,type:R5,properties:T5,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=Kv,n=Bu,s=vd,o=I5,a=["/properties"],i="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(g,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Mt;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=be;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=go;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=ss;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})($c,$c.exports);var Wy=$c.exports;const M5=Se(Wy);var Tc={exports:{}},Vy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,S){return{validate:j,compare:S}}e.fullFormats={date:t(o,a),time:t(c,u),"date-time":t(f,p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:D,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:w},int64:{type:"number",validate:_},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(j){return j%4===0&&(j%100!==0||j%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(j){const S=n.exec(j);if(!S)return!1;const E=+S[1],P=+S[2],K=+S[3];return P>=1&&P<=12&&K>=1&&K<=(P===2&&r(E)?29:s[P])}function a(j,S){if(j&&S)return j>S?1:j<S?-1:0}const i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c(j,S){const E=i.exec(j);if(!E)return!1;const P=+E[1],K=+E[2],O=+E[3],q=E[5];return(P<=23&&K<=59&&O<=59||P===23&&K===59&&O===60)&&(!S||q!=="")}function u(j,S){if(!(j&&S))return;const E=i.exec(j),P=i.exec(S);if(E&&P)return j=E[1]+E[2]+E[3]+(E[4]||""),S=P[1]+P[2]+P[3]+(P[4]||""),j>S?1:j<S?-1:0}const d=/t|\s/i;function f(j){const S=j.split(d);return S.length===2&&o(S[0])&&c(S[1],!0)}function p(j,S){if(!(j&&S))return;const[E,P]=j.split(d),[K,O]=S.split(d),q=a(E,K);if(q!==void 0)return q||u(P,O)}const h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function m(j){return h.test(j)&&g.test(j)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(j){return v.lastIndex=0,v.test(j)}const b=-2147483648,C=2**31-1;function w(j){return Number.isInteger(j)&&j<=C&&j>=b}function _(j){return Number.isInteger(j)}function R(){return!0}const z=/[^\\]\\Z/;function D(j){if(z.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(Vy);var Ky={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Wy,r=be,n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:i,schemaCode:c})=>r.str`should be ${s[i].okStr} ${c}`,params:({keyword:i,schemaCode:c})=>r._`{comparison: ${s[i].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(i){const{gen:c,data:u,schemaCode:d,keyword:f,it:p}=i,{opts:h,self:g}=p;if(!h.validateFormats)return;const m=new t.KeywordCxt(p,g.RULES.all.format.definition,"format");m.$data?v():y();function v(){const C=c.scopeValue("formats",{ref:g.formats,code:h.code.formats}),w=c.const("fmt",r._`${C}[${m.schemaCode}]`);i.fail$data(r.or(r._`typeof ${w} != "object"`,r._`${w} instanceof RegExp`,r._`typeof ${w}.compare != "function"`,b(w)))}function y(){const C=m.schema,w=g.formats[C];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw new Error(`"${f}": format "${C}" does not define "compare" function`);const _=c.scopeValue("formats",{key:C,ref:w,code:h.code.formats?r._`${h.code.formats}${r.getProperty(C)}`:void 0});i.fail$data(b(_))}function b(C){return r._`${C}.compare(${u}, ${d}) ${s[f].fail} 0`}},dependencies:["format"]};const a=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=a})(Ky);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Vy,n=Ky,s=be,o=new s.Name("fullFormats"),a=new s.Name("fastFormats"),i=(u,d={keywords:!0})=>{if(Array.isArray(d))return c(u,d,r.fullFormats,o),u;const[f,p]=d.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,o],h=d.formats||r.formatNames;return c(u,h,f,p),d.keywords&&n.default(u),u};i.get=(u,d="full")=>{const p=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!p)throw new Error(`Unknown format "${u}"`);return p};function c(u,d,f,p){var h,g;(h=(g=u.opts.code).formats)!==null&&h!==void 0||(g.formats=s._`require("ajv-formats/dist/formats").${p}`);for(const m of d)u.addFormat(m,f[m])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})(Tc,Tc.exports);var z5=Tc.exports;const O5=Se(z5);function D5(e){return function(t,r,n){for(var s=-1,o=Object(t),a=n(t),i=a.length;i--;){var c=a[e?i:++s];if(r(o[c],c,o)===!1)break}return t}}var L5=D5,F5=L5,B5=F5(),Hy=B5,U5=Hy,W5=Jt();function V5(e,t){return e&&U5(e,t,W5)}var K5=V5,H5=mr;function q5(e,t){return function(r,n){if(r==null)return r;if(!H5(r))return e(r,n);for(var s=r.length,o=t?s:-1,a=Object(r);(t?o--:++o<s)&&n(a[o],o,a)!==!1;);return r}}var G5=q5,Y5=K5,J5=G5,Z5=J5(Y5),yd=Z5,Q5=yd;function X5(e,t){var r=[];return Q5(e,function(n,s,o){t(n,s,o)&&r.push(n)}),r}var e4=X5,t4=J0,r4=e4,n4=fn,s4=Ue;function o4(e,t){var r=s4(e)?t4:r4;return r(e,n4(t))}var qy=o4;const Wa=Se(qy);var a4=Cu;function i4(e,t){return a4(e,t)}var l4=i4;const Gy=Se(l4);var c4=cn,u4=function(){try{var e=c4(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Yy=u4,jp=Yy;function d4(e,t,r){t=="__proto__"&&jp?jp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var bd=d4,f4=bd,h4=io;function p4(e,t,r){(r!==void 0&&!h4(e[t],r)||r===void 0&&!(t in e))&&f4(e,t,r)}var Jy=p4,Va={exports:{}};Va.exports;(function(e,t){var r=ut,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o?r.Buffer:void 0,i=a?a.allocUnsafe:void 0;function c(u,d){if(d)return u.slice();var f=u.length,p=i?i(f):new u.constructor(f);return u.copy(p),p}e.exports=c})(Va,Va.exports);var Zy=Va.exports,Ep=H0;function m4(e){var t=new e.constructor(e.byteLength);return new Ep(t).set(new Ep(e)),t}var xd=m4,g4=xd;function v4(e,t){var r=t?g4(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Qy=v4;function y4(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var yo=y4,b4=xt,Ap=Object.create,x4=function(){function e(){}return function(t){if(!b4(t))return{};if(Ap)return Ap(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Ei=x4,w4=ev,k4=w4(Object.getPrototypeOf,Object),wd=k4,_4=Ei,C4=wd,$4=yi;function S4(e){return typeof e.constructor=="function"&&!$4(e)?_4(C4(e)):{}}var Xy=S4,j4=mr,E4=bt;function A4(e){return E4(e)&&j4(e)}var N4=A4,P4=Ir,R4=wd,T4=bt,I4="[object Object]",M4=Function.prototype,z4=Object.prototype,eb=M4.toString,O4=z4.hasOwnProperty,D4=eb.call(Object);function L4(e){if(!T4(e)||P4(e)!=I4)return!1;var t=R4(e);if(t===null)return!0;var r=O4.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&eb.call(r)==D4}var tb=L4;function F4(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var rb=F4,B4=bd,U4=io,W4=Object.prototype,V4=W4.hasOwnProperty;function K4(e,t,r){var n=e[t];(!(V4.call(e,t)&&U4(n,r))||r===void 0&&!(t in e))&&B4(e,t,r)}var kd=K4,H4=kd,q4=bd;function G4(e,t,r,n){var s=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var i=t[o],c=n?n(r[i],e[i],i,r,e):void 0;c===void 0&&(c=e[i]),s?q4(r,i,c):H4(r,i,c)}return r}var bo=G4;function Y4(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var J4=Y4,Z4=xt,Q4=yi,X4=J4,e9=Object.prototype,t9=e9.hasOwnProperty;function r9(e){if(!Z4(e))return X4(e);var t=Q4(e),r=[];for(var n in e)n=="constructor"&&(t||!t9.call(e,n))||r.push(n);return r}var n9=r9,s9=X0(),o9=n9,a9=mr;function i9(e){return a9(e)?s9(e,!0):o9(e)}var xo=i9,l9=bo,c9=xo;function u9(e){return l9(e,c9(e))}var d9=u9,Np=Jy,f9=Zy,h9=Qy,p9=yo,m9=Xy,Pp=co,Rp=Ue,g9=N4,v9=uo,y9=lo,b9=xt,x9=tb,w9=vi,Tp=rb,k9=d9;function _9(e,t,r,n,s,o,a){var i=Tp(e,r),c=Tp(t,r),u=a.get(c);if(u){Np(e,r,u);return}var d=o?o(i,c,r+"",e,t,a):void 0,f=d===void 0;if(f){var p=Rp(c),h=!p&&v9(c),g=!p&&!h&&w9(c);d=c,p||h||g?Rp(i)?d=i:g9(i)?d=p9(i):h?(f=!1,d=f9(c,!0)):g?(f=!1,d=h9(c,!0)):d=[]:x9(c)||Pp(c)?(d=i,Pp(i)?d=k9(i):(!b9(i)||y9(i))&&(d=m9(c))):f=!1}f&&(a.set(c,d),s(d,c,n,o,a),a.delete(c)),Np(e,r,d)}var C9=_9,$9=gi,S9=Jy,j9=Hy,E9=C9,A9=xt,N9=xo,P9=rb;function nb(e,t,r,n,s){e!==t&&j9(t,function(o,a){if(s||(s=new $9),A9(o))E9(e,t,a,r,nb,n,s);else{var i=n?n(P9(e,a),o,a+"",e,t,s):void 0;i===void 0&&(i=o),S9(e,a,i)}},N9)}var R9=nb;function T9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var _d=T9,I9=_d,Ip=Math.max;function M9(e,t,r){return t=Ip(t===void 0?e.length-1:t,0),function(){for(var n=arguments,s=-1,o=Ip(n.length-t,0),a=Array(o);++s<o;)a[s]=n[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=n[s];return i[t]=r(a),I9(e,this,i)}}var sb=M9;function z9(e){return function(){return e}}var O9=z9,D9=O9,Mp=Yy,L9=xi,F9=Mp?function(e,t){return Mp(e,"toString",{configurable:!0,enumerable:!1,value:D9(t),writable:!0})}:L9,B9=F9,U9=800,W9=16,V9=Date.now;function K9(e){var t=0,r=0;return function(){var n=V9(),s=W9-(n-r);if(r=n,s>0){if(++t>=U9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var ob=K9,H9=B9,q9=ob,G9=q9(H9),Cd=G9,Y9=xi,J9=sb,Z9=Cd;function Q9(e,t){return Z9(J9(e,t,Y9),e+"")}var X9=Q9,e6=X9,t6=Ov;function r6(e){return e6(function(t,r){var n=-1,s=r.length,o=s>1?r[s-1]:void 0,a=s>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,a&&t6(r[0],r[1],a)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var i=r[n];i&&e(t,i,n,o)}return t})}var n6=r6,s6=R9,o6=n6,a6=o6(function(e,t,r){s6(e,t,r)}),i6=a6;const wo=Se(i6);function l6(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var $d=l6,c6=bo,u6=Jt();function d6(e,t){return e&&c6(t,u6(t),e)}var ab=d6,f6=bo,h6=xo;function p6(e,t){return e&&f6(t,h6(t),e)}var m6=p6,g6=bo,v6=bu;function y6(e,t){return g6(e,v6(e),t)}var b6=y6,x6=yu,w6=wd,k6=bu,_6=Z0,C6=Object.getOwnPropertySymbols,$6=C6?function(e){for(var t=[];e;)x6(t,k6(e)),e=w6(e);return t}:_6,ib=$6,S6=bo,j6=ib;function E6(e,t){return S6(e,j6(e),t)}var A6=E6,N6=Y0,P6=ib,R6=xo;function T6(e){return N6(e,R6,P6)}var I6=T6,M6=Object.prototype,z6=M6.hasOwnProperty;function O6(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&z6.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var D6=O6,L6=xd;function F6(e,t){var r=t?L6(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var B6=F6,U6=/\w*$/;function W6(e){var t=new e.constructor(e.source,U6.exec(e));return t.lastIndex=e.lastIndex,t}var V6=W6,zp=Jn,Op=zp?zp.prototype:void 0,Dp=Op?Op.valueOf:void 0;function K6(e){return Dp?Object(Dp.call(e)):{}}var H6=K6,q6=xd,G6=B6,Y6=V6,J6=H6,Z6=Qy,Q6="[object Boolean]",X6="[object Date]",eU="[object Map]",tU="[object Number]",rU="[object RegExp]",nU="[object Set]",sU="[object String]",oU="[object Symbol]",aU="[object ArrayBuffer]",iU="[object DataView]",lU="[object Float32Array]",cU="[object Float64Array]",uU="[object Int8Array]",dU="[object Int16Array]",fU="[object Int32Array]",hU="[object Uint8Array]",pU="[object Uint8ClampedArray]",mU="[object Uint16Array]",gU="[object Uint32Array]";function vU(e,t,r){var n=e.constructor;switch(t){case aU:return q6(e);case Q6:case X6:return new n(+e);case iU:return G6(e,r);case lU:case cU:case uU:case dU:case fU:case hU:case pU:case mU:case gU:return Z6(e,r);case eU:return new n;case tU:case sU:return new n(e);case rU:return Y6(e);case nU:return new n;case oU:return J6(e)}}var yU=vU,bU=un,xU=bt,wU="[object Map]";function kU(e){return xU(e)&&bU(e)==wU}var _U=kU,CU=_U,$U=wu,Lp=ku,Fp=Lp&&Lp.isMap,SU=Fp?$U(Fp):CU,jU=SU,EU=un,AU=bt,NU="[object Set]";function PU(e){return AU(e)&&EU(e)==NU}var RU=PU,TU=RU,IU=wu,Bp=ku,Up=Bp&&Bp.isSet,MU=Up?IU(Up):TU,zU=MU,OU=gi,DU=$d,LU=kd,FU=ab,BU=m6,UU=Zy,WU=yo,VU=b6,KU=A6,HU=tv,qU=I6,GU=un,YU=D6,JU=yU,ZU=Xy,QU=Ue,XU=uo,eW=jU,tW=xt,rW=zU,nW=Jt(),sW=xo,oW=1,aW=2,iW=4,lb="[object Arguments]",lW="[object Array]",cW="[object Boolean]",uW="[object Date]",dW="[object Error]",cb="[object Function]",fW="[object GeneratorFunction]",hW="[object Map]",pW="[object Number]",ub="[object Object]",mW="[object RegExp]",gW="[object Set]",vW="[object String]",yW="[object Symbol]",bW="[object WeakMap]",xW="[object ArrayBuffer]",wW="[object DataView]",kW="[object Float32Array]",_W="[object Float64Array]",CW="[object Int8Array]",$W="[object Int16Array]",SW="[object Int32Array]",jW="[object Uint8Array]",EW="[object Uint8ClampedArray]",AW="[object Uint16Array]",NW="[object Uint32Array]",Te={};Te[lb]=Te[lW]=Te[xW]=Te[wW]=Te[cW]=Te[uW]=Te[kW]=Te[_W]=Te[CW]=Te[$W]=Te[SW]=Te[hW]=Te[pW]=Te[ub]=Te[mW]=Te[gW]=Te[vW]=Te[yW]=Te[jW]=Te[EW]=Te[AW]=Te[NW]=!0;Te[dW]=Te[cb]=Te[bW]=!1;function ua(e,t,r,n,s,o){var a,i=t&oW,c=t&aW,u=t&iW;if(r&&(a=s?r(e,n,s,o):r(e)),a!==void 0)return a;if(!tW(e))return e;var d=QU(e);if(d){if(a=YU(e),!i)return WU(e,a)}else{var f=GU(e),p=f==cb||f==fW;if(XU(e))return UU(e,i);if(f==ub||f==lb||p&&!s){if(a=c||p?{}:ZU(e),!i)return c?KU(e,BU(a,e)):VU(e,FU(a,e))}else{if(!Te[f])return s?e:{};a=JU(e,f,i)}}o||(o=new OU);var h=o.get(e);if(h)return h;o.set(e,a),rW(e)?e.forEach(function(v){a.add(ua(v,t,r,v,e,o))}):eW(e)&&e.forEach(function(v,y){a.set(y,ua(v,t,r,y,e,o))});var g=u?c?qU:HU:c?sW:nW,m=d?void 0:g(e);return DU(m||e,function(v,y){m&&(y=v,v=e[y]),LU(a,y,ua(v,t,r,y,e,o))}),a}var Sd=ua,PW=Sd,RW=1,TW=4;function IW(e){return PW(e,RW|TW)}var MW=IW;const qs=Se(MW);var db={};(function(e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={};for(var s in r){var o=r[s];t.call(n,o)?n[o].push(s):n[o]=[s]}return n}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(db);var cl,Wp;function Mr(){return Wp||(Wp=1,cl={}),cl}var Ke=db,zW=Mr(),Vp=Array.prototype.push;function OW(e,t){return t==2?function(r,n){return e.apply(void 0,arguments)}:function(r){return e.apply(void 0,arguments)}}function ul(e,t){return t==2?function(r,n){return e(r,n)}:function(r){return e(r)}}function Kp(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r}function DW(e){return function(t){return e({},t)}}function LW(e,t){return function(){for(var r=arguments.length,n=r-1,s=Array(r);r--;)s[r]=arguments[r];var o=s[t],a=s.slice(0,t);return o&&Vp.apply(a,o),t!=n&&Vp.apply(a,s.slice(t+1)),e.apply(this,a)}}function dl(e,t){return function(){var r=arguments.length;if(r){for(var n=Array(r);r--;)n[r]=arguments[r];var s=n[0]=t.apply(void 0,n);return e.apply(void 0,n),s}}}function Ic(e,t,r,n){var s=typeof t=="function",o=t===Object(t);if(o&&(n=r,r=t,t=void 0),r==null)throw new TypeError;n||(n={});var a={cap:"cap"in n?n.cap:!0,curry:"curry"in n?n.curry:!0,fixed:"fixed"in n?n.fixed:!0,immutable:"immutable"in n?n.immutable:!0,rearg:"rearg"in n?n.rearg:!0},i=s?r:zW,c="curry"in n&&n.curry,u="fixed"in n&&n.fixed,d="rearg"in n&&n.rearg,f=s?r.runInContext():void 0,p=s?r:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},h=p.ary,g=p.assign,m=p.clone,v=p.curry,y=p.forEach,b=p.isArray,C=p.isError,w=p.isFunction,_=p.isWeakMap,R=p.keys,z=p.rearg,D=p.toInteger,j=p.toPath,S=R(Ke.aryMethod),E={castArray:function($){return function(){var A=arguments[0];return b(A)?$(Kp(A)):$.apply(void 0,arguments)}},iteratee:function($){return function(){var A=arguments[0],W=arguments[1],H=$(A,W),ee=H.length;return a.cap&&typeof W=="number"?(W=W>2?W-2:1,ee&&ee<=W?H:ul(H,W)):H}},mixin:function($){return function(A){var W=this;if(!w(W))return $(W,Object(A));var H=[];return y(R(A),function(ee){w(A[ee])&&H.push([ee,W.prototype[ee]])}),$(W,Object(A)),y(H,function(ee){var re=ee[1];w(re)?W.prototype[ee[0]]=re:delete W.prototype[ee[0]]}),W}},nthArg:function($){return function(A){var W=A<0?1:D(A)+1;return v($(A),W)}},rearg:function($){return function(A,W){var H=W?W.length:0;return v($(A,W),H)}},runInContext:function($){return function(A){return Ic(e,$(A),n)}}};function P($,A){if(a.cap){var W=Ke.iterateeRearg[$];if(W)return Y(A,W);var H=!s&&Ke.iterateeAry[$];if(H)return oe(A,H)}return A}function K($,A,W){return c||a.curry&&W>1?v(A,W):A}function O($,A,W){if(a.fixed&&(u||!Ke.skipFixed[$])){var H=Ke.methodSpread[$],ee=H&&H.start;return ee===void 0?h(A,W):LW(A,ee)}return A}function q($,A,W){return a.rearg&&W>1&&(d||!Ke.skipRearg[$])?z(A,Ke.methodRearg[$]||Ke.aryRearg[W]):A}function V($,A){A=j(A);for(var W=-1,H=A.length,ee=H-1,re=m(Object($)),le=re;le!=null&&++W<H;){var pe=A[W],M=le[pe];M!=null&&!(w(M)||C(M)||_(M))&&(le[pe]=m(W==ee?M:Object(M))),le=le[pe]}return re}function L($){return I.runInContext.convert($)(void 0)}function U($,A){var W=Ke.aliasToReal[$]||$,H=Ke.remap[W]||W,ee=n;return function(re){var le=s?f:p,pe=s?f[H]:A,M=g(g({},ee),re);return Ic(le,W,pe,M)}}function oe($,A){return N($,function(W){return typeof W=="function"?ul(W,A):W})}function Y($,A){return N($,function(W){var H=A.length;return OW(z(ul(W,H),A),H)})}function N($,A){return function(){var W=arguments.length;if(!W)return $();for(var H=Array(W);W--;)H[W]=arguments[W];var ee=a.rearg?0:W-1;return H[ee]=A(H[ee]),$.apply(void 0,H)}}function Z($,A,W){var H,ee=Ke.aliasToReal[$]||$,re=A,le=E[ee];return le?re=le(A):a.immutable&&(Ke.mutate.array[ee]?re=dl(A,Kp):Ke.mutate.object[ee]?re=dl(A,DW(A)):Ke.mutate.set[ee]&&(re=dl(A,V))),y(S,function(pe){return y(Ke.aryMethod[pe],function(M){if(ee==M){var J=Ke.methodSpread[ee],se=J&&J.afterRearg;return H=se?O(ee,q(ee,re,pe),pe):q(ee,O(ee,re,pe),pe),H=P(ee,H),H=K(ee,H,pe),!1}}),!H}),H||(H=re),H==A&&(H=c?v(H,1):function(){return A.apply(this,arguments)}),H.convert=U(ee,A),H.placeholder=A.placeholder=W,H}if(!o)return Z(t,r,i);var I=r,k=[];return y(S,function($){y(Ke.aryMethod[$],function(A){var W=I[Ke.remap[A]||A];W&&k.push([A,Z(A,W,I)])})}),y(R(I),function($){var A=I[$];if(typeof A=="function"){for(var W=k.length;W--;)if(k[W][0]==$)return;A.convert=U($,A),k.push([$,A])}}),y(k,function($){I[$[0]]=$[1]}),I.convert=L,I.placeholder=I,y(R(I),function($){y(Ke.realToAlias[$]||[],function(A){I[A]=I[$]})}),I}var FW=Ic,fl,Hp;function fb(){if(Hp)return fl;Hp=1;var e=rv,t=e&&new e;return fl=t,fl}var BW=xi,qp=fb(),UW=qp?function(e,t){return qp.set(e,t),e}:BW,hb=UW,WW=Ei,VW=xt;function KW(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=WW(e.prototype),n=e.apply(r,t);return VW(n)?n:r}}var Ai=KW,HW=Ai,qW=ut,GW=1;function YW(e,t,r){var n=t&GW,s=HW(e);function o(){var a=this&&this!==qW&&this instanceof o?s:e;return a.apply(n?r:this,arguments)}return o}var JW=YW,ZW=Math.max;function QW(e,t,r,n){for(var s=-1,o=e.length,a=r.length,i=-1,c=t.length,u=ZW(o-a,0),d=Array(c+u),f=!n;++i<c;)d[i]=t[i];for(;++s<a;)(f||s<o)&&(d[r[s]]=e[s]);for(;u--;)d[i++]=e[s++];return d}var pb=QW,XW=Math.max;function eV(e,t,r,n){for(var s=-1,o=e.length,a=-1,i=r.length,c=-1,u=t.length,d=XW(o-i,0),f=Array(d+u),p=!n;++s<d;)f[s]=e[s];for(var h=s;++c<u;)f[h+c]=t[c];for(;++a<i;)(p||s<o)&&(f[h+r[a]]=e[s++]);return f}var mb=eV;function tV(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var rV=tV,hl,Gp;function jd(){if(Gp)return hl;Gp=1;function e(){}return hl=e,hl}var pl,Yp;function Ed(){if(Yp)return pl;Yp=1;var e=Ei,t=jd(),r=4294967295;function n(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=r,this.__views__=[]}return n.prototype=e(t.prototype),n.prototype.constructor=n,pl=n,pl}var ml,Jp;function nV(){if(Jp)return ml;Jp=1;function e(){}return ml=e,ml}var gl,Zp;function Ad(){if(Zp)return gl;Zp=1;var e=fb(),t=nV(),r=e?function(n){return e.get(n)}:t;return gl=r,gl}var vl,Qp;function sV(){if(Qp)return vl;Qp=1;var e={};return vl=e,vl}var yl,Xp;function gb(){if(Xp)return yl;Xp=1;var e=sV(),t=Object.prototype,r=t.hasOwnProperty;function n(s){for(var o=s.name+"",a=e[o],i=r.call(e,o)?a.length:0;i--;){var c=a[i],u=c.func;if(u==null||u==s)return c.name}return o}return yl=n,yl}var bl,em;function Nd(){if(em)return bl;em=1;var e=Ei,t=jd();function r(n,s){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=void 0}return r.prototype=e(t.prototype),r.prototype.constructor=r,bl=r,bl}var xl,tm;function oV(){if(tm)return xl;tm=1;var e=Ed(),t=Nd(),r=yo;function n(s){if(s instanceof e)return s.clone();var o=new t(s.__wrapped__,s.__chain__);return o.__actions__=r(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}return xl=n,xl}var wl,rm;function aV(){if(rm)return wl;rm=1;var e=Ed(),t=Nd(),r=jd(),n=Ue,s=bt,o=oV(),a=Object.prototype,i=a.hasOwnProperty;function c(u){if(s(u)&&!n(u)&&!(u instanceof e)){if(u instanceof t)return u;if(i.call(u,"__wrapped__"))return o(u)}return new t(u)}return c.prototype=r.prototype,c.prototype.constructor=c,wl=c,wl}var kl,nm;function vb(){if(nm)return kl;nm=1;var e=Ed(),t=Ad(),r=gb(),n=aV();function s(o){var a=r(o),i=n[a];if(typeof i!="function"||!(a in e.prototype))return!1;if(o===i)return!0;var c=t(i);return!!c&&o===c[0]}return kl=s,kl}var iV=hb,lV=ob,cV=lV(iV),yb=cV,uV=/\{\n\/\* \[wrapped with (.+)\] \*/,dV=/,? & /;function fV(e){var t=e.match(uV);return t?t[1].split(dV):[]}var hV=fV,pV=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function mV(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(pV,`{
127
+ deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,d]=o(c);a(c,u),i(c,d)}};function o({schema:c}){const u={},d={};for(const f in c){if(f==="__proto__")continue;const p=Array.isArray(c[f])?u:d;p[f]=c[f]}return[u,d]}function a(c,u=c.schema){const{gen:d,data:f,it:p}=c;if(Object.keys(u).length===0)return;const h=d.let("missing");for(const g in u){const m=u[g];if(m.length===0)continue;const v=(0,n.propertyInData)(d,f,g,p.opts.ownProperties);c.setParams({property:g,depsCount:m.length,deps:m.join(", ")}),p.allErrors?d.if(v,()=>{for(const y of m)(0,n.checkReportMissingProp)(c,y)}):(d.if((0,t._)`${v} && (${(0,n.checkMissingProp)(c,m,h)})`),(0,n.reportMissingProp)(c,h),d.else())}}e.validatePropertyDeps=a;function i(c,u=c.schema){const{gen:d,data:f,keyword:p,it:h}=c,g=d.name("valid");for(const m in u)(0,r.alwaysValidSchema)(h,u[m])||(d.if((0,n.propertyInData)(d,f,m,h.opts.ownProperties),()=>{const v=c.subschema({keyword:p,schemaProp:m},g);c.mergeValidEvaluated(v,g)},()=>d.var(g,!0)),c.ok(g))}e.validateSchemaDeps=i,e.default=s})(Iy);var nd={};Object.defineProperty(nd,"__esModule",{value:!0});const My=be,O5=ne,D5={message:"property name must be valid",params:({params:e})=>(0,My._)`{propertyName: ${e.propertyName}}`},L5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:D5,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,O5.alwaysValidSchema)(s,r))return;const o=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,My.not)(o),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(o)}};nd.default=L5;var Si={};Object.defineProperty(Si,"__esModule",{value:!0});const Go=xe,Nt=be,F5=Zt,qo=ne,B5={message:"must NOT have additional properties",params:({params:e})=>(0,Nt._)`{additionalProperty: ${e.additionalProperty}}`},U5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:B5,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,qo.alwaysValidSchema)(a,r))return;const u=(0,Go.allSchemaProperties)(n.properties),d=(0,Go.allSchemaProperties)(n.patternProperties);f(),e.ok((0,Nt._)`${o} === ${F5.default.errors}`);function f(){t.forIn("key",s,v=>{!u.length&&!d.length?g(v):t.if(p(v),()=>g(v))})}function p(v){let y;if(u.length>8){const b=(0,qo.schemaRefOrVal)(a,n.properties,"properties");y=(0,Go.isOwnProperty)(t,b,v)}else u.length?y=(0,Nt.or)(...u.map(b=>(0,Nt._)`${v} === ${b}`)):y=Nt.nil;return d.length&&(y=(0,Nt.or)(y,...d.map(b=>(0,Nt._)`${(0,Go.usePattern)(e,b)}.test(${v})`))),(0,Nt.not)(y)}function h(v){t.code((0,Nt._)`delete ${s}[${v}]`)}function g(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){h(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),i||t.break();return}if(typeof r=="object"&&!(0,qo.alwaysValidSchema)(a,r)){const y=t.name("valid");c.removeAdditional==="failing"?(m(v,y,!1),t.if((0,Nt.not)(y),()=>{e.reset(),h(v)})):(m(v,y),i||t.if((0,Nt.not)(y),()=>t.break()))}}function m(v,y,b){const C={keyword:"additionalProperties",dataProp:v,dataPropType:qo.Type.Str};b===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(C,y)}}};Si.default=U5;var sd={};Object.defineProperty(sd,"__esModule",{value:!0});const W5=Mt,fp=xe,ol=ne,hp=Si,V5={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&hp.default.code(new W5.KeywordCxt(o,hp.default,"additionalProperties"));const a=(0,fp.allSchemaProperties)(r);for(const f of a)o.definedProperties.add(f);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=ol.mergeEvaluated.props(t,(0,ol.toHash)(a),o.props));const i=a.filter(f=>!(0,ol.alwaysValidSchema)(o,r[f]));if(i.length===0)return;const c=t.name("valid");for(const f of i)u(f)?d(f):(t.if((0,fp.propertyInData)(t,s,f,o.opts.ownProperties)),d(f),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(c);function u(f){return o.opts.useDefaults&&!o.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};sd.default=V5;var od={};Object.defineProperty(od,"__esModule",{value:!0});const pp=xe,Yo=be,mp=ne,gp=ne,K5={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=(0,pp.allSchemaProperties)(r),c=i.filter(m=>(0,mp.alwaysValidSchema)(o,r[m]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;const u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,d=t.name("valid");o.props!==!0&&!(o.props instanceof Yo.Name)&&(o.props=(0,gp.evaluatedPropsToName)(t,o.props));const{props:f}=o;p();function p(){for(const m of i)u&&h(m),o.allErrors?g(m):(t.var(d,!0),g(m),t.if(d))}function h(m){for(const v in u)new RegExp(m).test(v)&&(0,mp.checkStrictMode)(o,`property ${v} matches pattern ${m} (use allowMatchingProperties)`)}function g(m){t.forIn("key",n,v=>{t.if((0,Yo._)`${(0,pp.usePattern)(e,m)}.test(${v})`,()=>{const y=c.includes(m);y||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:v,dataPropType:gp.Type.Str},d),o.opts.unevaluated&&f!==!0?t.assign((0,Yo._)`${f}[${v}]`,!0):!y&&!o.allErrors&&t.if((0,Yo.not)(d),()=>t.break())})})}}};od.default=K5;var ad={};Object.defineProperty(ad,"__esModule",{value:!0});const H5=ne,G5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,H5.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};ad.default=G5;var id={};Object.defineProperty(id,"__esModule",{value:!0});const q5=xe,Y5={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:q5.validateUnion,error:{message:"must match a schema in anyOf"}};id.default=Y5;var ld={};Object.defineProperty(ld,"__esModule",{value:!0});const ca=be,J5=ne,Z5={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ca._)`{passingSchemas: ${e.passing}}`},Q5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Z5,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,f)=>{let p;(0,J5.alwaysValidSchema)(s,d)?t.var(c,!0):p=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c),f>0&&t.if((0,ca._)`${c} && ${a}`).assign(a,!1).assign(i,(0,ca._)`[${i}, ${f}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(i,f),p&&e.mergeEvaluated(p,ca.Name)})})}}};ld.default=Q5;var cd={};Object.defineProperty(cd,"__esModule",{value:!0});const X5=ne,e3={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((o,a)=>{if((0,X5.alwaysValidSchema)(n,o))return;const i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};cd.default=e3;var ud={};Object.defineProperty(ud,"__esModule",{value:!0});const Ua=be,zy=ne,t3={message:({params:e})=>(0,Ua.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ua._)`{failingKeyword: ${e.ifClause}}`},r3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:t3,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,zy.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=vp(n,"then"),o=vp(n,"else");if(!s&&!o)return;const a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(i,u("then",d),u("else",d))}else s?t.if(i,u("then")):t.if((0,Ua.not)(i),u("else"));e.pass(a,()=>e.error(!0));function c(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(d)}function u(d,f){return()=>{const p=e.subschema({keyword:d},i);t.assign(a,i),e.mergeValidEvaluated(p,a),f?t.assign(f,(0,Ua._)`${d}`):e.setParams({ifClause:d})}}}};function vp(e,t){const r=e.schema[t];return r!==void 0&&!(0,zy.alwaysValidSchema)(e,r)}ud.default=r3;var dd={};Object.defineProperty(dd,"__esModule",{value:!0});const n3=ne,s3={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,n3.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};dd.default=s3;Object.defineProperty(Xu,"__esModule",{value:!0});const o3=os,a3=ed,i3=as,l3=td,c3=rd,u3=Iy,d3=nd,f3=Si,h3=sd,p3=od,m3=ad,g3=id,v3=ld,y3=cd,b3=ud,x3=dd;function w3(e=!1){const t=[m3.default,g3.default,v3.default,y3.default,b3.default,x3.default,d3.default,f3.default,u3.default,h3.default,p3.default];return e?t.push(a3.default,l3.default):t.push(o3.default,i3.default),t.push(c3.default),t}Xu.default=w3;var fd={},hd={};Object.defineProperty(hd,"__esModule",{value:!0});const Be=be,k3={message:({schemaCode:e})=>(0,Be.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Be._)`{format: ${e}}`},_3={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:k3,code(e,t){const{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:f}=i;if(!c.validateFormats)return;s?p():h();function p(){const g=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),m=r.const("fDef",(0,Be._)`${g}[${a}]`),v=r.let("fType"),y=r.let("format");r.if((0,Be._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(v,(0,Be._)`${m}.type || "string"`).assign(y,(0,Be._)`${m}.validate`),()=>r.assign(v,(0,Be._)`"string"`).assign(y,m)),e.fail$data((0,Be.or)(b(),C()));function b(){return c.strictSchema===!1?Be.nil:(0,Be._)`${a} && !${y}`}function C(){const w=d.$async?(0,Be._)`(${m}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,Be._)`${y}(${n})`,_=(0,Be._)`(typeof ${y} == "function" ? ${w} : ${y}.test(${n}))`;return(0,Be._)`${y} && ${y} !== true && ${v} === ${t} && !${_}`}}function h(){const g=f.formats[o];if(!g){b();return}if(g===!0)return;const[m,v,y]=C(g);m===t&&e.pass(w());function b(){if(c.strictSchema===!1){f.logger.warn(_());return}throw new Error(_());function _(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function C(_){const R=_ instanceof RegExp?(0,Be.regexpCode)(_):c.code.formats?(0,Be._)`${c.code.formats}${(0,Be.getProperty)(o)}`:void 0,z=r.scopeValue("formats",{key:o,ref:_,code:R});return typeof _=="object"&&!(_ instanceof RegExp)?[_.type||"string",_.validate,(0,Be._)`${z}.validate`]:["string",_,z]}function w(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Be._)`await ${y}(${n})`}return typeof v=="function"?(0,Be._)`${y}(${n})`:(0,Be._)`${y}.test(${n})`}}}};hd.default=_3;Object.defineProperty(fd,"__esModule",{value:!0});const C3=hd,$3=[C3.default];fd.default=$3;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.contentVocabulary=Kn.metadataVocabulary=void 0;Kn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Kn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Du,"__esModule",{value:!0});const S3=Lu,j3=Bu,E3=Xu,A3=fd,yp=Kn,N3=[S3.default,j3.default,(0,E3.default)(),A3.default,yp.metadataVocabulary,yp.contentVocabulary];Du.default=N3;var pd={},ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.DiscrError=void 0;var bp;(function(e){e.Tag="tag",e.Mapping="mapping"})(bp||(ji.DiscrError=bp={}));Object.defineProperty(pd,"__esModule",{value:!0});const Pn=be,Ac=ji,xp=ft,P3=ss,R3=ne,T3={message:({params:{discrError:e,tagName:t}})=>e===Ac.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Pn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},I3={keyword:"discriminator",type:"object",schemaType:"object",error:T3,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const i=n.propertyName;if(typeof i!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",(0,Pn._)`${r}${(0,Pn.getProperty)(i)}`);t.if((0,Pn._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:Ac.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function d(){const h=p();t.if(!1);for(const g in h)t.elseIf((0,Pn._)`${u} === ${g}`),t.assign(c,f(h[g]));t.else(),e.error(!1,{discrError:Ac.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function f(h){const g=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},g);return e.mergeEvaluated(m,Pn.Name),g}function p(){var h;const g={},m=y(s);let v=!0;for(let w=0;w<a.length;w++){let _=a[w];if(_!=null&&_.$ref&&!(0,R3.schemaHasRulesButRef)(_,o.self.RULES)){const z=_.$ref;if(_=xp.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,z),_ instanceof xp.SchemaEnv&&(_=_.schema),_===void 0)throw new P3.default(o.opts.uriResolver,o.baseId,z)}const R=(h=_==null?void 0:_.properties)===null||h===void 0?void 0:h[i];if(typeof R!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);v=v&&(m||y(_)),b(R,w)}if(!v)throw new Error(`discriminator: "${i}" must be required`);return g;function y({required:w}){return Array.isArray(w)&&w.includes(i)}function b(w,_){if(w.const)C(w.const,_);else if(w.enum)for(const R of w.enum)C(R,_);else throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function C(w,_){if(typeof w!="string"||w in g)throw new Error(`discriminator: "${i}" values must be unique strings`);g[w]=_}}}};pd.default=I3;const M3="http://json-schema.org/draft-07/schema#",z3="http://json-schema.org/draft-07/schema#",O3="Core schema meta-schema",D3={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},L3=["object","boolean"],F3={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},B3={$schema:M3,$id:z3,title:O3,definitions:D3,type:L3,properties:F3,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=Lv,n=Du,s=pd,o=B3,a=["/properties"],i="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(g,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Mt;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=be;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=go;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=ss;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})(kc,kc.exports);var Oy=kc.exports;const U3=Se(Oy);var Nc={exports:{}},Dy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,S){return{validate:j,compare:S}}e.fullFormats={date:t(o,a),time:t(c,u),"date-time":t(f,p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:D,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:w},int64:{type:"number",validate:_},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(j){return j%4===0&&(j%100!==0||j%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(j){const S=n.exec(j);if(!S)return!1;const E=+S[1],P=+S[2],K=+S[3];return P>=1&&P<=12&&K>=1&&K<=(P===2&&r(E)?29:s[P])}function a(j,S){if(j&&S)return j>S?1:j<S?-1:0}const i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c(j,S){const E=i.exec(j);if(!E)return!1;const P=+E[1],K=+E[2],O=+E[3],G=E[5];return(P<=23&&K<=59&&O<=59||P===23&&K===59&&O===60)&&(!S||G!=="")}function u(j,S){if(!(j&&S))return;const E=i.exec(j),P=i.exec(S);if(E&&P)return j=E[1]+E[2]+E[3]+(E[4]||""),S=P[1]+P[2]+P[3]+(P[4]||""),j>S?1:j<S?-1:0}const d=/t|\s/i;function f(j){const S=j.split(d);return S.length===2&&o(S[0])&&c(S[1],!0)}function p(j,S){if(!(j&&S))return;const[E,P]=j.split(d),[K,O]=S.split(d),G=a(E,K);if(G!==void 0)return G||u(P,O)}const h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function m(j){return h.test(j)&&g.test(j)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(j){return v.lastIndex=0,v.test(j)}const b=-2147483648,C=2**31-1;function w(j){return Number.isInteger(j)&&j<=C&&j>=b}function _(j){return Number.isInteger(j)}function R(){return!0}const z=/[^\\]\\Z/;function D(j){if(z.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(Dy);var Ly={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Oy,r=be,n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:i,schemaCode:c})=>r.str`should be ${s[i].okStr} ${c}`,params:({keyword:i,schemaCode:c})=>r._`{comparison: ${s[i].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(i){const{gen:c,data:u,schemaCode:d,keyword:f,it:p}=i,{opts:h,self:g}=p;if(!h.validateFormats)return;const m=new t.KeywordCxt(p,g.RULES.all.format.definition,"format");m.$data?v():y();function v(){const C=c.scopeValue("formats",{ref:g.formats,code:h.code.formats}),w=c.const("fmt",r._`${C}[${m.schemaCode}]`);i.fail$data(r.or(r._`typeof ${w} != "object"`,r._`${w} instanceof RegExp`,r._`typeof ${w}.compare != "function"`,b(w)))}function y(){const C=m.schema,w=g.formats[C];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw new Error(`"${f}": format "${C}" does not define "compare" function`);const _=c.scopeValue("formats",{key:C,ref:w,code:h.code.formats?r._`${h.code.formats}${r.getProperty(C)}`:void 0});i.fail$data(b(_))}function b(C){return r._`${C}.compare(${u}, ${d}) ${s[f].fail} 0`}},dependencies:["format"]};const a=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=a})(Ly);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Dy,n=Ly,s=be,o=new s.Name("fullFormats"),a=new s.Name("fastFormats"),i=(u,d={keywords:!0})=>{if(Array.isArray(d))return c(u,d,r.fullFormats,o),u;const[f,p]=d.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,o],h=d.formats||r.formatNames;return c(u,h,f,p),d.keywords&&n.default(u),u};i.get=(u,d="full")=>{const p=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!p)throw new Error(`Unknown format "${u}"`);return p};function c(u,d,f,p){var h,g;(h=(g=u.opts.code).formats)!==null&&h!==void 0||(g.formats=s._`require("ajv-formats/dist/formats").${p}`);for(const m of d)u.addFormat(m,f[m])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})(Nc,Nc.exports);var W3=Nc.exports;const V3=Se(W3);function K3(e){return function(t,r,n){for(var s=-1,o=Object(t),a=n(t),i=a.length;i--;){var c=a[e?i:++s];if(r(o[c],c,o)===!1)break}return t}}var H3=K3,G3=H3,q3=G3(),Fy=q3,Y3=Fy,J3=Jt;function Z3(e,t){return e&&Y3(e,t,J3)}var Q3=Z3,X3=mr;function e4(e,t){return function(r,n){if(r==null)return r;if(!X3(r))return e(r,n);for(var s=r.length,o=t?s:-1,a=Object(r);(t?o--:++o<s)&&n(a[o],o,a)!==!1;);return r}}var t4=e4,r4=Q3,n4=t4,s4=n4(r4),md=s4,o4=md;function a4(e,t){var r=[];return o4(e,function(n,s,o){t(n,s,o)&&r.push(n)}),r}var i4=a4,l4=V0,c4=i4,u4=fn,d4=Ue;function f4(e,t){var r=d4(e)?l4:c4;return r(e,u4(t))}var By=f4;const Wa=Se(By);var h4=wu;function p4(e,t){return h4(e,t)}var m4=p4;const Uy=Se(m4);var g4=cn,v4=function(){try{var e=g4(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Wy=v4,wp=Wy;function y4(e,t,r){t=="__proto__"&&wp?wp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var gd=y4,b4=gd,x4=io;function w4(e,t,r){(r!==void 0&&!x4(e[t],r)||r===void 0&&!(t in e))&&b4(e,t,r)}var Vy=w4,Va={exports:{}};Va.exports;(function(e,t){var r=ut,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===n,a=o?r.Buffer:void 0,i=a?a.allocUnsafe:void 0;function c(u,d){if(d)return u.slice();var f=u.length,p=i?i(f):new u.constructor(f);return u.copy(p),p}e.exports=c})(Va,Va.exports);var Ky=Va.exports,kp=F0;function k4(e){var t=new e.constructor(e.byteLength);return new kp(t).set(new kp(e)),t}var vd=k4,_4=vd;function C4(e,t){var r=t?_4(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Hy=C4;function $4(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var yo=$4,S4=xt,_p=Object.create,j4=function(){function e(){}return function(t){if(!S4(t))return{};if(_p)return _p(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Ei=j4,E4=q0,A4=E4(Object.getPrototypeOf,Object),yd=A4,N4=Ei,P4=yd,R4=yi;function T4(e){return typeof e.constructor=="function"&&!R4(e)?N4(P4(e)):{}}var Gy=T4,I4=mr,M4=bt;function z4(e){return M4(e)&&I4(e)}var O4=z4,D4=Ir,L4=yd,F4=bt,B4="[object Object]",U4=Function.prototype,W4=Object.prototype,qy=U4.toString,V4=W4.hasOwnProperty,K4=qy.call(Object);function H4(e){if(!F4(e)||D4(e)!=B4)return!1;var t=L4(e);if(t===null)return!0;var r=V4.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&qy.call(r)==K4}var Yy=H4;function G4(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Jy=G4,q4=gd,Y4=io,J4=Object.prototype,Z4=J4.hasOwnProperty;function Q4(e,t,r){var n=e[t];(!(Z4.call(e,t)&&Y4(n,r))||r===void 0&&!(t in e))&&q4(e,t,r)}var bd=Q4,X4=bd,e9=gd;function t9(e,t,r,n){var s=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var i=t[o],c=n?n(r[i],e[i],i,r,e):void 0;c===void 0&&(c=e[i]),s?e9(r,i,c):X4(r,i,c)}return r}var bo=t9;function r9(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var n9=r9,s9=xt,o9=yi,a9=n9,i9=Object.prototype,l9=i9.hasOwnProperty;function c9(e){if(!s9(e))return a9(e);var t=o9(e),r=[];for(var n in e)n=="constructor"&&(t||!l9.call(e,n))||r.push(n);return r}var u9=c9,d9=G0,f9=u9,h9=mr;function p9(e){return h9(e)?d9(e,!0):f9(e)}var xo=p9,m9=bo,g9=xo;function v9(e){return m9(e,g9(e))}var y9=v9,Cp=Vy,b9=Ky,x9=Hy,w9=yo,k9=Gy,$p=co,Sp=Ue,_9=O4,C9=uo,$9=lo,S9=xt,j9=Yy,E9=vi,jp=Jy,A9=y9;function N9(e,t,r,n,s,o,a){var i=jp(e,r),c=jp(t,r),u=a.get(c);if(u){Cp(e,r,u);return}var d=o?o(i,c,r+"",e,t,a):void 0,f=d===void 0;if(f){var p=Sp(c),h=!p&&C9(c),g=!p&&!h&&E9(c);d=c,p||h||g?Sp(i)?d=i:_9(i)?d=w9(i):h?(f=!1,d=b9(c,!0)):g?(f=!1,d=x9(c,!0)):d=[]:j9(c)||$p(c)?(d=i,$p(i)?d=A9(i):(!S9(i)||$9(i))&&(d=k9(c))):f=!1}f&&(a.set(c,d),s(d,c,n,o,a),a.delete(c)),Cp(e,r,d)}var P9=N9,R9=gi,T9=Vy,I9=Fy,M9=P9,z9=xt,O9=xo,D9=Jy;function Zy(e,t,r,n,s){e!==t&&I9(t,function(o,a){if(s||(s=new R9),z9(o))M9(e,t,a,r,Zy,n,s);else{var i=n?n(D9(e,a),o,a+"",e,t,s):void 0;i===void 0&&(i=o),T9(e,a,i)}},O9)}var L9=Zy;function F9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var xd=F9,B9=xd,Ep=Math.max;function U9(e,t,r){return t=Ep(t===void 0?e.length-1:t,0),function(){for(var n=arguments,s=-1,o=Ep(n.length-t,0),a=Array(o);++s<o;)a[s]=n[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=n[s];return i[t]=r(a),B9(e,this,i)}}var Qy=U9;function W9(e){return function(){return e}}var V9=W9,K9=V9,Ap=Wy,H9=xi,G9=Ap?function(e,t){return Ap(e,"toString",{configurable:!0,enumerable:!1,value:K9(t),writable:!0})}:H9,q9=G9,Y9=800,J9=16,Z9=Date.now;function Q9(e){var t=0,r=0;return function(){var n=Z9(),s=J9-(n-r);if(r=n,s>0){if(++t>=Y9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Xy=Q9,X9=q9,e6=Xy,t6=e6(X9),wd=t6,r6=xi,n6=Qy,s6=wd;function o6(e,t){return s6(n6(e,t,r6),e+"")}var a6=o6,i6=a6,l6=Pv;function c6(e){return i6(function(t,r){var n=-1,s=r.length,o=s>1?r[s-1]:void 0,a=s>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,a&&l6(r[0],r[1],a)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var i=r[n];i&&e(t,i,n,o)}return t})}var u6=c6,d6=L9,f6=u6,h6=f6(function(e,t,r){d6(e,t,r)}),p6=h6;const wo=Se(p6);function m6(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var kd=m6,g6=bo,v6=Jt;function y6(e,t){return e&&g6(t,v6(t),e)}var eb=y6,b6=bo,x6=xo;function w6(e,t){return e&&b6(t,x6(t),e)}var k6=w6,_6=bo,C6=gu;function $6(e,t){return _6(e,C6(e),t)}var S6=$6,j6=mu,E6=yd,A6=gu,N6=K0,P6=Object.getOwnPropertySymbols,R6=P6?function(e){for(var t=[];e;)j6(t,A6(e)),e=E6(e);return t}:N6,tb=R6,T6=bo,I6=tb;function M6(e,t){return T6(e,I6(e),t)}var z6=M6,O6=W0,D6=tb,L6=xo;function F6(e){return O6(e,L6,D6)}var B6=F6,U6=Object.prototype,W6=U6.hasOwnProperty;function V6(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&W6.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var K6=V6,H6=vd;function G6(e,t){var r=t?H6(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var q6=G6,Y6=/\w*$/;function J6(e){var t=new e.constructor(e.source,Y6.exec(e));return t.lastIndex=e.lastIndex,t}var Z6=J6,Np=Jn,Pp=Np?Np.prototype:void 0,Rp=Pp?Pp.valueOf:void 0;function Q6(e){return Rp?Object(Rp.call(e)):{}}var X6=Q6,eU=vd,tU=q6,rU=Z6,nU=X6,sU=Hy,oU="[object Boolean]",aU="[object Date]",iU="[object Map]",lU="[object Number]",cU="[object RegExp]",uU="[object Set]",dU="[object String]",fU="[object Symbol]",hU="[object ArrayBuffer]",pU="[object DataView]",mU="[object Float32Array]",gU="[object Float64Array]",vU="[object Int8Array]",yU="[object Int16Array]",bU="[object Int32Array]",xU="[object Uint8Array]",wU="[object Uint8ClampedArray]",kU="[object Uint16Array]",_U="[object Uint32Array]";function CU(e,t,r){var n=e.constructor;switch(t){case hU:return eU(e);case oU:case aU:return new n(+e);case pU:return tU(e,r);case mU:case gU:case vU:case yU:case bU:case xU:case wU:case kU:case _U:return sU(e,r);case iU:return new n;case lU:case dU:return new n(e);case cU:return rU(e);case uU:return new n;case fU:return nU(e)}}var $U=CU,SU=un,jU=bt,EU="[object Map]";function AU(e){return jU(e)&&SU(e)==EU}var NU=AU,PU=NU,RU=yu,Tp=bu,Ip=Tp&&Tp.isMap,TU=Ip?RU(Ip):PU,IU=TU,MU=un,zU=bt,OU="[object Set]";function DU(e){return zU(e)&&MU(e)==OU}var LU=DU,FU=LU,BU=yu,Mp=bu,zp=Mp&&Mp.isSet,UU=zp?BU(zp):FU,WU=UU,VU=gi,KU=kd,HU=bd,GU=eb,qU=k6,YU=Ky,JU=yo,ZU=S6,QU=z6,XU=Y0,eW=B6,tW=un,rW=K6,nW=$U,sW=Gy,oW=Ue,aW=uo,iW=IU,lW=xt,cW=WU,uW=Jt,dW=xo,fW=1,hW=2,pW=4,rb="[object Arguments]",mW="[object Array]",gW="[object Boolean]",vW="[object Date]",yW="[object Error]",nb="[object Function]",bW="[object GeneratorFunction]",xW="[object Map]",wW="[object Number]",sb="[object Object]",kW="[object RegExp]",_W="[object Set]",CW="[object String]",$W="[object Symbol]",SW="[object WeakMap]",jW="[object ArrayBuffer]",EW="[object DataView]",AW="[object Float32Array]",NW="[object Float64Array]",PW="[object Int8Array]",RW="[object Int16Array]",TW="[object Int32Array]",IW="[object Uint8Array]",MW="[object Uint8ClampedArray]",zW="[object Uint16Array]",OW="[object Uint32Array]",Te={};Te[rb]=Te[mW]=Te[jW]=Te[EW]=Te[gW]=Te[vW]=Te[AW]=Te[NW]=Te[PW]=Te[RW]=Te[TW]=Te[xW]=Te[wW]=Te[sb]=Te[kW]=Te[_W]=Te[CW]=Te[$W]=Te[IW]=Te[MW]=Te[zW]=Te[OW]=!0;Te[yW]=Te[nb]=Te[SW]=!1;function ua(e,t,r,n,s,o){var a,i=t&fW,c=t&hW,u=t&pW;if(r&&(a=s?r(e,n,s,o):r(e)),a!==void 0)return a;if(!lW(e))return e;var d=oW(e);if(d){if(a=rW(e),!i)return JU(e,a)}else{var f=tW(e),p=f==nb||f==bW;if(aW(e))return YU(e,i);if(f==sb||f==rb||p&&!s){if(a=c||p?{}:sW(e),!i)return c?QU(e,qU(a,e)):ZU(e,GU(a,e))}else{if(!Te[f])return s?e:{};a=nW(e,f,i)}}o||(o=new VU);var h=o.get(e);if(h)return h;o.set(e,a),cW(e)?e.forEach(function(v){a.add(ua(v,t,r,v,e,o))}):iW(e)&&e.forEach(function(v,y){a.set(y,ua(v,t,r,y,e,o))});var g=u?c?eW:XU:c?dW:uW,m=d?void 0:g(e);return KU(m||e,function(v,y){m&&(y=v,v=e[y]),HU(a,y,ua(v,t,r,y,e,o))}),a}var _d=ua,DW=_d,LW=1,FW=4;function BW(e){return DW(e,LW|FW)}var UW=BW;const Gs=Se(UW);var ob={};(function(e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={};for(var s in r){var o=r[s];t.call(n,o)?n[o].push(s):n[o]=[s]}return n}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(ob);var al,Op;function Mr(){return Op||(Op=1,al={}),al}var Ke=ob,WW=Mr(),Dp=Array.prototype.push;function VW(e,t){return t==2?function(r,n){return e.apply(void 0,arguments)}:function(r){return e.apply(void 0,arguments)}}function il(e,t){return t==2?function(r,n){return e(r,n)}:function(r){return e(r)}}function Lp(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r}function KW(e){return function(t){return e({},t)}}function HW(e,t){return function(){for(var r=arguments.length,n=r-1,s=Array(r);r--;)s[r]=arguments[r];var o=s[t],a=s.slice(0,t);return o&&Dp.apply(a,o),t!=n&&Dp.apply(a,s.slice(t+1)),e.apply(this,a)}}function ll(e,t){return function(){var r=arguments.length;if(r){for(var n=Array(r);r--;)n[r]=arguments[r];var s=n[0]=t.apply(void 0,n);return e.apply(void 0,n),s}}}function Pc(e,t,r,n){var s=typeof t=="function",o=t===Object(t);if(o&&(n=r,r=t,t=void 0),r==null)throw new TypeError;n||(n={});var a={cap:"cap"in n?n.cap:!0,curry:"curry"in n?n.curry:!0,fixed:"fixed"in n?n.fixed:!0,immutable:"immutable"in n?n.immutable:!0,rearg:"rearg"in n?n.rearg:!0},i=s?r:WW,c="curry"in n&&n.curry,u="fixed"in n&&n.fixed,d="rearg"in n&&n.rearg,f=s?r.runInContext():void 0,p=s?r:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},h=p.ary,g=p.assign,m=p.clone,v=p.curry,y=p.forEach,b=p.isArray,C=p.isError,w=p.isFunction,_=p.isWeakMap,R=p.keys,z=p.rearg,D=p.toInteger,j=p.toPath,S=R(Ke.aryMethod),E={castArray:function($){return function(){var A=arguments[0];return b(A)?$(Lp(A)):$.apply(void 0,arguments)}},iteratee:function($){return function(){var A=arguments[0],W=arguments[1],H=$(A,W),ee=H.length;return a.cap&&typeof W=="number"?(W=W>2?W-2:1,ee&&ee<=W?H:il(H,W)):H}},mixin:function($){return function(A){var W=this;if(!w(W))return $(W,Object(A));var H=[];return y(R(A),function(ee){w(A[ee])&&H.push([ee,W.prototype[ee]])}),$(W,Object(A)),y(H,function(ee){var re=ee[1];w(re)?W.prototype[ee[0]]=re:delete W.prototype[ee[0]]}),W}},nthArg:function($){return function(A){var W=A<0?1:D(A)+1;return v($(A),W)}},rearg:function($){return function(A,W){var H=W?W.length:0;return v($(A,W),H)}},runInContext:function($){return function(A){return Pc(e,$(A),n)}}};function P($,A){if(a.cap){var W=Ke.iterateeRearg[$];if(W)return Y(A,W);var H=!s&&Ke.iterateeAry[$];if(H)return oe(A,H)}return A}function K($,A,W){return c||a.curry&&W>1?v(A,W):A}function O($,A,W){if(a.fixed&&(u||!Ke.skipFixed[$])){var H=Ke.methodSpread[$],ee=H&&H.start;return ee===void 0?h(A,W):HW(A,ee)}return A}function G($,A,W){return a.rearg&&W>1&&(d||!Ke.skipRearg[$])?z(A,Ke.methodRearg[$]||Ke.aryRearg[W]):A}function V($,A){A=j(A);for(var W=-1,H=A.length,ee=H-1,re=m(Object($)),le=re;le!=null&&++W<H;){var pe=A[W],M=le[pe];M!=null&&!(w(M)||C(M)||_(M))&&(le[pe]=m(W==ee?M:Object(M))),le=le[pe]}return re}function L($){return I.runInContext.convert($)(void 0)}function U($,A){var W=Ke.aliasToReal[$]||$,H=Ke.remap[W]||W,ee=n;return function(re){var le=s?f:p,pe=s?f[H]:A,M=g(g({},ee),re);return Pc(le,W,pe,M)}}function oe($,A){return N($,function(W){return typeof W=="function"?il(W,A):W})}function Y($,A){return N($,function(W){var H=A.length;return VW(z(il(W,H),A),H)})}function N($,A){return function(){var W=arguments.length;if(!W)return $();for(var H=Array(W);W--;)H[W]=arguments[W];var ee=a.rearg?0:W-1;return H[ee]=A(H[ee]),$.apply(void 0,H)}}function Z($,A,W){var H,ee=Ke.aliasToReal[$]||$,re=A,le=E[ee];return le?re=le(A):a.immutable&&(Ke.mutate.array[ee]?re=ll(A,Lp):Ke.mutate.object[ee]?re=ll(A,KW(A)):Ke.mutate.set[ee]&&(re=ll(A,V))),y(S,function(pe){return y(Ke.aryMethod[pe],function(M){if(ee==M){var J=Ke.methodSpread[ee],se=J&&J.afterRearg;return H=se?O(ee,G(ee,re,pe),pe):G(ee,O(ee,re,pe),pe),H=P(ee,H),H=K(ee,H,pe),!1}}),!H}),H||(H=re),H==A&&(H=c?v(H,1):function(){return A.apply(this,arguments)}),H.convert=U(ee,A),H.placeholder=A.placeholder=W,H}if(!o)return Z(t,r,i);var I=r,k=[];return y(S,function($){y(Ke.aryMethod[$],function(A){var W=I[Ke.remap[A]||A];W&&k.push([A,Z(A,W,I)])})}),y(R(I),function($){var A=I[$];if(typeof A=="function"){for(var W=k.length;W--;)if(k[W][0]==$)return;A.convert=U($,A),k.push([$,A])}}),y(k,function($){I[$[0]]=$[1]}),I.convert=L,I.placeholder=I,y(R(I),function($){y(Ke.realToAlias[$]||[],function(A){I[A]=I[$]})}),I}var GW=Pc,cl,Fp;function ab(){if(Fp)return cl;Fp=1;var e=J0,t=e&&new e;return cl=t,cl}var qW=xi,Bp=ab(),YW=Bp?function(e,t){return Bp.set(e,t),e}:qW,ib=YW,JW=Ei,ZW=xt;function QW(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=JW(e.prototype),n=e.apply(r,t);return ZW(n)?n:r}}var Ai=QW,XW=Ai,eV=ut,tV=1;function rV(e,t,r){var n=t&tV,s=XW(e);function o(){var a=this&&this!==eV&&this instanceof o?s:e;return a.apply(n?r:this,arguments)}return o}var nV=rV,sV=Math.max;function oV(e,t,r,n){for(var s=-1,o=e.length,a=r.length,i=-1,c=t.length,u=sV(o-a,0),d=Array(c+u),f=!n;++i<c;)d[i]=t[i];for(;++s<a;)(f||s<o)&&(d[r[s]]=e[s]);for(;u--;)d[i++]=e[s++];return d}var lb=oV,aV=Math.max;function iV(e,t,r,n){for(var s=-1,o=e.length,a=-1,i=r.length,c=-1,u=t.length,d=aV(o-i,0),f=Array(d+u),p=!n;++s<d;)f[s]=e[s];for(var h=s;++c<u;)f[h+c]=t[c];for(;++a<i;)(p||s<o)&&(f[h+r[a]]=e[s++]);return f}var cb=iV;function lV(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var cV=lV,ul,Up;function Cd(){if(Up)return ul;Up=1;function e(){}return ul=e,ul}var dl,Wp;function $d(){if(Wp)return dl;Wp=1;var e=Ei,t=Cd(),r=4294967295;function n(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=r,this.__views__=[]}return n.prototype=e(t.prototype),n.prototype.constructor=n,dl=n,dl}var fl,Vp;function uV(){if(Vp)return fl;Vp=1;function e(){}return fl=e,fl}var hl,Kp;function Sd(){if(Kp)return hl;Kp=1;var e=ab(),t=uV(),r=e?function(n){return e.get(n)}:t;return hl=r,hl}var pl,Hp;function dV(){if(Hp)return pl;Hp=1;var e={};return pl=e,pl}var ml,Gp;function ub(){if(Gp)return ml;Gp=1;var e=dV(),t=Object.prototype,r=t.hasOwnProperty;function n(s){for(var o=s.name+"",a=e[o],i=r.call(e,o)?a.length:0;i--;){var c=a[i],u=c.func;if(u==null||u==s)return c.name}return o}return ml=n,ml}var gl,qp;function jd(){if(qp)return gl;qp=1;var e=Ei,t=Cd();function r(n,s){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=void 0}return r.prototype=e(t.prototype),r.prototype.constructor=r,gl=r,gl}var vl,Yp;function fV(){if(Yp)return vl;Yp=1;var e=$d(),t=jd(),r=yo;function n(s){if(s instanceof e)return s.clone();var o=new t(s.__wrapped__,s.__chain__);return o.__actions__=r(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}return vl=n,vl}var yl,Jp;function hV(){if(Jp)return yl;Jp=1;var e=$d(),t=jd(),r=Cd(),n=Ue,s=bt,o=fV(),a=Object.prototype,i=a.hasOwnProperty;function c(u){if(s(u)&&!n(u)&&!(u instanceof e)){if(u instanceof t)return u;if(i.call(u,"__wrapped__"))return o(u)}return new t(u)}return c.prototype=r.prototype,c.prototype.constructor=c,yl=c,yl}var bl,Zp;function db(){if(Zp)return bl;Zp=1;var e=$d(),t=Sd(),r=ub(),n=hV();function s(o){var a=r(o),i=n[a];if(typeof i!="function"||!(a in e.prototype))return!1;if(o===i)return!0;var c=t(i);return!!c&&o===c[0]}return bl=s,bl}var pV=ib,mV=Xy,gV=mV(pV),fb=gV,vV=/\{\n\/\* \[wrapped with (.+)\] \*/,yV=/,? & /;function bV(e){var t=e.match(vV);return t?t[1].split(yV):[]}var xV=bV,wV=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function kV(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(wV,`{
128
128
  /* [wrapped with `+t+`] */
129
- `)}var gV=mV,vV=Wv;function yV(e,t){var r=e==null?0:e.length;return!!r&&vV(e,t,0)>-1}var bV=yV,xV=$d,wV=bV,kV=1,_V=2,CV=8,$V=16,SV=32,jV=64,EV=128,AV=256,NV=512,PV=[["ary",EV],["bind",kV],["bindKey",_V],["curry",CV],["curryRight",$V],["flip",NV],["partial",SV],["partialRight",jV],["rearg",AV]];function RV(e,t){return xV(PV,function(r){var n="_."+r[0];t&r[1]&&!wV(e,n)&&e.push(n)}),e.sort()}var TV=RV,IV=hV,MV=gV,zV=Cd,OV=TV;function DV(e,t,r){var n=t+"";return zV(e,MV(n,OV(IV(n),r)))}var bb=DV,LV=vb(),FV=yb,BV=bb,UV=4,WV=8,sm=32,om=64;function VV(e,t,r,n,s,o,a,i,c,u){var d=t&WV,f=d?a:void 0,p=d?void 0:a,h=d?o:void 0,g=d?void 0:o;t|=d?sm:om,t&=~(d?om:sm),t&UV||(t&=-4);var m=[e,t,s,h,f,g,p,i,c,u],v=r.apply(void 0,m);return LV(e)&&FV(v,m),v.placeholder=n,BV(v,e,t)}var xb=VV;function KV(e){var t=e;return t.placeholder}var wb=KV,HV=yo,qV=fo,GV=Math.min;function YV(e,t){for(var r=e.length,n=GV(t.length,r),s=HV(e);n--;){var o=t[n];e[n]=qV(o,r)?s[o]:void 0}return e}var JV=YV,am="__lodash_placeholder__";function ZV(e,t){for(var r=-1,n=e.length,s=0,o=[];++r<n;){var a=e[r];(a===t||a===am)&&(e[r]=am,o[s++]=r)}return o}var Pd=ZV,QV=pb,XV=mb,e8=rV,im=Ai,t8=xb,r8=wb,n8=JV,s8=Pd,o8=ut,a8=1,i8=2,l8=8,c8=16,u8=128,d8=512;function kb(e,t,r,n,s,o,a,i,c,u){var d=t&u8,f=t&a8,p=t&i8,h=t&(l8|c8),g=t&d8,m=p?void 0:im(e);function v(){for(var y=arguments.length,b=Array(y),C=y;C--;)b[C]=arguments[C];if(h)var w=r8(v),_=e8(b,w);if(n&&(b=QV(b,n,s,h)),o&&(b=XV(b,o,a,h)),y-=_,h&&y<u){var R=s8(b,w);return t8(e,t,kb,v.placeholder,r,b,R,i,c,u-y)}var z=f?r:this,D=p?z[e]:e;return y=b.length,i?b=n8(b,i):g&&y>1&&b.reverse(),d&&c<y&&(b.length=c),this&&this!==o8&&this instanceof v&&(D=m||im(D)),D.apply(z,b)}return v}var _b=kb,f8=_d,h8=Ai,p8=_b,m8=xb,g8=wb,v8=Pd,y8=ut;function b8(e,t,r){var n=h8(e);function s(){for(var o=arguments.length,a=Array(o),i=o,c=g8(s);i--;)a[i]=arguments[i];var u=o<3&&a[0]!==c&&a[o-1]!==c?[]:v8(a,c);if(o-=u.length,o<r)return m8(e,t,p8,s.placeholder,void 0,a,u,void 0,void 0,r-o);var d=this&&this!==y8&&this instanceof s?n:e;return f8(d,this,a)}return s}var x8=b8,w8=_d,k8=Ai,_8=ut,C8=1;function $8(e,t,r,n){var s=t&C8,o=k8(e);function a(){for(var i=-1,c=arguments.length,u=-1,d=n.length,f=Array(d+c),p=this&&this!==_8&&this instanceof a?o:e;++u<d;)f[u]=n[u];for(;c--;)f[u++]=arguments[++i];return w8(p,s?r:this,f)}return a}var S8=$8,j8=pb,E8=mb,lm=Pd,cm="__lodash_placeholder__",_l=1,A8=2,N8=4,um=8,Es=128,dm=256,P8=Math.min;function R8(e,t){var r=e[1],n=t[1],s=r|n,o=s<(_l|A8|Es),a=n==Es&&r==um||n==Es&&r==dm&&e[7].length<=t[8]||n==(Es|dm)&&t[7].length<=t[8]&&r==um;if(!(o||a))return e;n&_l&&(e[2]=t[2],s|=r&_l?0:N8);var i=t[3];if(i){var c=e[3];e[3]=c?j8(c,i,t[4]):i,e[4]=c?lm(e[3],cm):t[4]}return i=t[5],i&&(c=e[5],e[5]=c?E8(c,i,t[6]):i,e[6]=c?lm(e[5],cm):t[6]),i=t[7],i&&(e[7]=i),n&Es&&(e[8]=e[8]==null?t[8]:P8(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=s,e}var T8=R8,I8=hb,M8=JW,z8=x8,O8=_b,D8=S8,L8=Ad(),F8=T8,B8=yb,U8=bb,fm=po,W8="Expected a function",hm=1,V8=2,pm=8,mm=16,gm=32,K8=64,vm=Math.max;function H8(e,t,r,n,s,o,a,i){var c=t&V8;if(!c&&typeof e!="function")throw new TypeError(W8);var u=n?n.length:0;if(u||(t&=-97,n=s=void 0),a=a===void 0?a:vm(fm(a),0),i=i===void 0?i:fm(i),u-=s?s.length:0,t&K8){var d=n,f=s;n=s=void 0}var p=c?void 0:L8(e),h=[e,t,r,n,s,d,f,o,a,i];if(p&&F8(h,p),e=h[0],t=h[1],r=h[2],n=h[3],s=h[4],i=h[9]=h[9]===void 0?c?0:e.length:vm(h[9]-u,0),!i&&t&(pm|mm)&&(t&=-25),!t||t==hm)var g=M8(e,t,r);else t==pm||t==mm?g=z8(e,t,i):(t==gm||t==(hm|gm))&&!s.length?g=D8(e,t,r,n):g=O8.apply(void 0,h);var m=p?I8:B8;return U8(m(g,h),e,t)}var Rd=H8,q8=Rd,G8=128;function Y8(e,t,r){return t=r?void 0:t,t=e&&t==null?e.length:t,q8(e,G8,void 0,void 0,void 0,void 0,t)}var J8=Y8,Z8=Sd,Q8=4;function X8(e){return Z8(e,Q8)}var e7=X8,t7=Rd,r7=8;function Td(e,t,r){t=r?void 0:t;var n=t7(e,r7,void 0,void 0,void 0,void 0,void 0,t);return n.placeholder=Td.placeholder,n}Td.placeholder={};var n7=Td,s7=Ir,o7=bt,a7=tb,i7="[object DOMException]",l7="[object Error]";function c7(e){if(!o7(e))return!1;var t=s7(e);return t==l7||t==i7||typeof e.message=="string"&&typeof e.name=="string"&&!a7(e)}var u7=c7,d7=un,f7=bt,h7="[object WeakMap]";function p7(e){return f7(e)&&d7(e)==h7}var m7=p7,g7=Sd,v7=fn,y7=1;function b7(e){return v7(typeof e=="function"?e:g7(e,y7))}var x7=b7,ym=Jn,w7=co,k7=Ue,bm=ym?ym.isConcatSpreadable:void 0;function _7(e){return k7(e)||w7(e)||!!(bm&&e&&e[bm])}var C7=_7,$7=yu,S7=C7;function Cb(e,t,r,n,s){var o=-1,a=e.length;for(r||(r=S7),s||(s=[]);++o<a;){var i=e[o];t>0&&r(i)?t>1?Cb(i,t-1,r,n,s):$7(s,i):n||(s[s.length]=i)}return s}var j7=Cb,E7=j7;function A7(e){var t=e==null?0:e.length;return t?E7(e,1):[]}var N7=A7,P7=N7,R7=sb,T7=Cd;function I7(e){return T7(R7(e,void 0,P7),e+"")}var $b=I7,M7=Rd,z7=$b,O7=256,D7=z7(function(e,t){return M7(e,O7,void 0,void 0,void 0,t)}),L7=D7,F7=ho,B7=yo,U7=Ue,W7=Zn,V7=lv,K7=dn,H7=ns;function q7(e){return U7(e)?F7(e,K7):W7(e)?[e]:B7(V7(H7(e)))}var G7=q7,Y7={ary:J8,assign:ab,clone:e7,curry:n7,forEach:$d,isArray:Ue,isError:u7,isFunction:lo,isWeakMap:m7,iteratee:x7,keys:_u,rearg:L7,toInteger:po,toPath:G7},J7=FW,Z7=Y7;function Q7(e,t,r){return J7(Z7,e,t,r)}var hn=Q7,Cl,xm;function X7(){if(xm)return Cl;xm=1;var e=kd,t=bi,r=fo,n=xt,s=dn;function o(a,i,c,u){if(!n(a))return a;i=t(i,a);for(var d=-1,f=i.length,p=f-1,h=a;h!=null&&++d<f;){var g=s(i[d]),m=c;if(g==="__proto__"||g==="constructor"||g==="prototype")return a;if(d!=p){var v=h[g];m=u?u(v,g,h):void 0,m===void 0&&(m=n(v)?v:r(i[d+1])?[]:{})}e(h,g,m),h=h[g]}return a}return Cl=o,Cl}var $l,wm;function eK(){if(wm)return $l;wm=1;var e=X7();function t(r,n,s){return r==null?r:e(r,n,s)}return $l=t,$l}var tK=hn,Sb=tK("set",eK());Sb.placeholder=Mr();var rK=Sb;const nK=Se(rK);function sK(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var jb=sK;const oK=Se(jb);var aK=ju,iK=jv;function lK(e,t){return t.length<2?e:aK(e,iK(t,0,-1))}var cK=lK,uK=bi,dK=jb,fK=cK,hK=dn,pK=Object.prototype,mK=pK.hasOwnProperty;function gK(e,t){t=uK(t,e);var r=-1,n=t.length;if(!n)return!0;for(var s=e==null||typeof e!="object"&&typeof e!="function";++r<n;){var o=t[r];if(typeof o=="string"){if(o==="__proto__"&&!mK.call(e,"__proto__"))return!1;if(o==="constructor"&&r+1<n&&typeof t[r+1]=="string"&&t[r+1]==="prototype"){if(s&&r===0)continue;return!1}}}var a=fK(e,t);return a==null||delete a[hK(dK(t))]}var vK=gK,Sl,km;function yK(){if(km)return Sl;km=1;var e=vK;function t(r,n){return r==null?!0:e(r,n)}return Sl=t,Sl}var bK=hn,Eb=bK("unset",yK());Eb.placeholder=Mr();var xK=Eb;const wK=Se(xK);function kK(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}var _K=kK,CK=_K,$K=uv,SK=po,jK=ns;function EK(e,t,r){e=jK(e),t=$K(t);var n=e.length;r=r===void 0?n:CK(SK(r),0,n);var s=r;return r-=t.length,r>=0&&e.slice(r,s)==t}var AK=EK;const NK=Se(AK);function PK(e,t,r,n,s){return s(e,function(o,a,i){r=n?(n=!1,o):t(r,o,a,i)}),r}var RK=PK,TK=hv,IK=yd,MK=fn,zK=RK,OK=Ue;function DK(e,t,r){var n=OK(e)?TK:zK,s=arguments.length<3;return n(e,MK(t),r,s,IK)}var LK=DK;const Mc=Se(LK);var FK=ho;function BK(e,t){return FK(t,function(r){return[r,e[r]]})}var UK=BK;function WK(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=[n,n]}),r}var VK=WK,KK=UK,HK=un,qK=q0,GK=VK,YK="[object Map]",JK="[object Set]";function ZK(e){return function(t){var r=HK(t);return r==YK?qK(t):r==JK?GK(t):KK(t,e(t))}}var QK=ZK,XK=QK,eH=Jt(),tH=XK(eH),rH=tH;const nH=Se(rH);function sH(e){return e===void 0}var oH=sH;const aH=Se(oH),da="additionalProperties",fa="required",iH=(e,t)=>{const r={};return e.filter(n=>{const s=t(n);return Object.prototype.hasOwnProperty.call(r,s)?!1:(r[s]=!0,!0)})};class lH{constructor(t){this.findOption=t,this.schemaObject=r=>{const n=this.properties(r),s={type:"object",properties:n,additionalProperties:this.findOption(n)(da)},o=this.findOption(n)(fa);return o.length>0&&(s.required=o),s},this.properties=r=>{const n={};return Object.keys(r).reduce((s,o)=>(s[o]=this.property(r[o]),s),n)},this.property=r=>{switch(typeof r){case"string":return{type:"string"};case"boolean":return{type:"boolean"};case"number":return Number.isInteger(r)?{type:"integer"}:{type:"number"};case"object":return r==null?{type:"null"}:this.schemaObjectOrArray(r);default:return{}}},this.schemaObjectOrArray=r=>r instanceof Array?this.schemaArray(r):this.schemaObject(r),this.schemaArray=r=>{if(r.length>0){const n=r.map(this.property),s=iH(n,o=>JSON.stringify(o));return s.length===1?{type:"array",items:s[0]}:{type:"array",items:{oneOf:s}}}else return{type:"array",items:{}}}}}const Ab=(e,t={})=>{const r=s=>o=>{switch(o){case da:return Object.prototype.hasOwnProperty.call(t,da)?t[da]:!0;case fa:return Object.prototype.hasOwnProperty.call(t,fa)?t[fa](s):Object.keys(s);default:return}};return new lH(r).schemaObject(e)},Id=new Set,Nb=(e,t)=>t<=1?e:e+t.toString(),cH=(e,t)=>{const r=Nb(e,t);return!Id.has(r)},_m=e=>{e===void 0&&(e="undefined");let t=0;for(;!cH(e,t);)t++;const r=Nb(e,t);return Id.add(r),r},Cm=e=>Id.delete(e),Md=(e,t)=>{let r=e;return!he(e)&&!he(t)&&!t.startsWith("[")&&(r=e+"."),he(r)?t:he(t)?r:`${r}${t}`},Pb=e=>{const n=e.replace(/(anyOf|allOf|oneOf)\/[\d]+\//g,"").replace(/(then|else)\//g,"").split("/").map(ko),o=n[0]==="#"||n[0]===""?2:1;return Fv(o,n.length,2).map(a=>n[a])},zc=e=>e==null?void 0:e.replace(/~/g,"~0").replace(/\//g,"~1"),ko=e=>e==null?void 0:e.replace(/~1/g,"/").replace(/~0/,"~"),jl=(e,t)=>{if(t&&typeof t.title=="string")return t.title;if(typeof e.scope=="string"){const r=e.scope,n=ko(r.substr(r.lastIndexOf("/")+1));return zv(n)}return""},Rb=(e,t)=>{const r=e.label;if(typeof r=="boolean")return Jo(jl(e,t),r);if(typeof r=="string")return Jo(r,!0);if(typeof r=="object"){const n=typeof r.text=="string"?r.text:jl(e,t),s=typeof r.show=="boolean"?r.show:!0;return Jo(n,s)}return Jo(jl(e,t),!0)},Jo=(e,t)=>({text:e,show:t}),ha=(e,t)=>he(t)?e:t.split(".").reduce((n,s)=>{if(!(!n||!Object.prototype.hasOwnProperty.call(n,s)))return n[s]},e),uH=e=>e==="#"||e===void 0||e==="",zt=(e,t,r)=>zd(e,t,{rootSchema:r,resolutionMap:new Map}),zd=(e,t,r)=>{let n;if(e&&typeof e.$ref=="string"){const s=El(r.rootSchema,e.$ref,r);s!==void 0&&(n=El(s,t,r))}return n===void 0&&(n=El(e,t,r)),n},El=(e,t,r)=>{let n=r.resolutionMap.get(e);if(n||(n=new Set,r.resolutionMap.set(e,n)),n.has(t))return;n.add(t);const s=Od(e,t==null?void 0:t.split("/").map(ko),r);return n.delete(t),s},Od=(e,t,r)=>{if(!t||t.length===0)return e;if(he(e))return;const n=dH(e,t,r);if(n!==void 0)return n;const s=[].concat(e.oneOf??[],e.allOf??[],e.anyOf??[],e.then??[],e.else??[]);for(const o of s){let a=o;o&&typeof o.$ref=="string"&&(a=zd(r.rootSchema,o.$ref,r));const i=Od(a,t,r);if(i)return i}},dH=(e,t,r)=>{if(!t||t.length===0)return e;if(he(e))return;const n=Tb(e,t);return n.schema&&typeof n.schema.$ref=="string"&&(n.schema=zd(r.rootSchema,n.schema.$ref,r)),Od(n.schema,n.remainingPathSegments,r)},Tb=(e,t)=>{if(!t||t.length===0)return{schema:e,remainingPathSegments:[]};if(he(e))return{schema:void 0,remainingPathSegments:t};const[r,...n]=t;return uH(r)?Tb(e,n):{schema:Qe(e,r),remainingPathSegments:n,resolvedSegment:r}};var qt;(function(e){e.HIDE="HIDE",e.SHOW="SHOW",e.ENABLE="ENABLE",e.DISABLE="DISABLE"})(qt||(qt={}));const Ib=(e,t)=>{if(!mH(e))return t??"";const r=Pb(e.scope);return he(r)?t??"":Md(t,r.join("."))},Mb=e=>typeof e=="object"&&e!==null&&typeof e.i18n=="string",fH=e=>e.type==="Group",hH=e=>e.elements!==void 0,pH=e=>!!e&&typeof e=="object",mH=e=>pH(e)&&typeof e.scope=="string",gH=e=>!!e&&typeof e=="object",vH=e=>e.type==="OR",yH=e=>e.type==="AND",bH=e=>e.type==="LEAF",xH=e=>Bv(e,"schema"),wH=e=>Bv(e,"validate")&&typeof e.validate=="function",Al=(e,t)=>Ib(e,t),Oc=(e,t,r,n,s,o)=>{if(yH(r))return r.conditions.reduce((a,i)=>a&&Oc(e,t,i,n,s,o),!0);if(vH(r))return r.conditions.reduce((a,i)=>a||Oc(e,t,i,n,s,o),!1);if(bH(r))return ha(e,Al(r,n))===r.expectedValue;if(xH(r)){const a=ha(e,Al(r,n));return r.failWhenUndefined&&a===void 0?!1:s.validate(r.schema,a)}else if(wH(r)){const i={data:ha(e,Al(r,n)),fullData:e,path:n,uischemaElement:t,config:o};return r.validate(i)}else return!0},zb=(e,t,r,n,s)=>{const o=e.rule.condition;return Oc(t,e,o,r,n,s)},kH=(e,t,r=void 0,n,s)=>{const o=zb(e,t,r,n,s);switch(e.rule.effect){case qt.HIDE:return!o;case qt.SHOW:return o;default:return!0}},_H=(e,t,r=void 0,n,s)=>{const o=zb(e,t,r,n,s);switch(e.rule.effect){case qt.DISABLE:return!o;case qt.ENABLE:return o;default:return!0}},Dd=e=>!!(e.rule&&(e.rule.effect===qt.SHOW||e.rule.effect===qt.HIDE)),CH=e=>!!(e.rule&&(e.rule.effect===qt.ENABLE||e.rule.effect===qt.DISABLE)),_o=(e,t,r=void 0,n,s)=>e.rule?kH(e,t,r,n,s):!0,$H=(e,t,r=void 0,n,s)=>e.rule?_H(e,t,r,n,s):!0,Ka=e=>!!e&&Object.prototype.hasOwnProperty.call(e,"oneOf")&&e.oneOf&&e.oneOf.every(t=>t.const!==void 0),SH=e=>!!e&&typeof e=="object"&&(Object.prototype.hasOwnProperty.call(e,"enum")||Object.prototype.hasOwnProperty.call(e,"const")),jH=(e,t)=>{const r=e.toISOString();return t==="date-time"?r:t==="date"?r.split("T")[0]:t==="time"?r.split("T")[1].split(".")[0]:r},Ob=e=>e.replace("#","root").replace(new RegExp("/","g"),"_"),nt=(e,t)=>Vv(en(e),t),en=e=>{if(he(e))return[];if(!he(e.type)&&typeof e.type=="string")return[e.type];if(G0(e.type))return e.type;if(!he(e.properties)||!he(e.additionalProperties))return["object"];if(!he(e.items))return["array"];if(!he(e.enum)){const t=new Set;return e.enum.forEach(r=>{typeof r=="string"?t.add("string"):en(r).forEach(n=>t.add(n))}),Array.from(t)}if(!he(e.allOf)){const t=vD(e.allOf,r=>en(r).length!==0);if(t)return en(t)}return[]},Gt={schema:zt,data:ha},EH=e=>Pb(e.scope).join("."),Nl={compose:Md,fromScoped:EH},Db=e=>{const t=new M5({allErrors:!0,verbose:!0,strict:!1,addUsedSchema:!1,...e});return O5(t),t},sr=(e,t)=>e===void 0?[]:e(t)?[]:e.errors,AH=e=>{switch(e.keyword){case"required":case"dependencies":return e.params.missingProperty;case"additionalProperties":return e.params.additionalProperty;default:return}},Ha=e=>{let t=e.dataPath||e.instancePath||"";t=t.replace(/\//g,".");const r=AH(e);return r!==void 0&&!t.endsWith(r)&&(t=`${t}.${r}`),t=t.replace(/^./,""),t=ko(t),t},NH=(e,t,r)=>n=>{const s=Wa(n,o=>o.keyword==="oneOf"||o.keyword==="anyOf").map(o=>Ha(o));return Wa(n,o=>{if(RH.indexOf(o.keyword)!==-1&&!Ka(o.parentSchema))return!1;const a=Ha(o);let i=r(a);const c=o.parentSchema;return i&&!PH(c)&&!Ka(c)&&s.findIndex(u=>e.startsWith(u))!==-1&&(i=i&&Gy(c,t)),i})},PH=e=>(e==null?void 0:e.type)==="object"||!!(e!=null&&e.properties),RH=["additionalProperties","allOf","anyOf","oneOf"],TH=e=>e==null?"":e.join(`
130
- `),qa={createLabelDescriptionFrom:Rb,convertToValidClassName:Ob},Lb=e=>({type:e,elements:[]}),pa=e=>({type:"Control",scope:e}),IH=(e,t)=>{if(!he(e)&&!hH(e)){const r=Lb(t);return r.elements.push(e),r}return e},MH=(e,t)=>{if(!he(t)){const r=zv(t);if(fH(e))e.label=r;else{const n={type:"Label",text:r};e.elements.push(n)}}},zH=e=>!he(e)&&(!he(e.oneOf)||!he(e.anyOf)||!he(e.allOf)),Dc=(e,t,r,n,s,o)=>{if(!he(e)&&e.$ref!==void 0)return Dc(zt(o,e.$ref,o),t,r,n,s,o);if(zH(e)){const i=pa(r);return t.push(i),i}const a=en(e);if(a.length===0)return null;if(a.length>1){const i=pa(r);return t.push(i),i}if(r==="#"&&a[0]==="object"){const i=Lb(s);if(t.push(i),e.properties&&dO(e.properties).length>1&&MH(i,n),!he(e.properties)){const c=r+"/properties";Object.keys(e.properties).map(u=>{let d=e.properties[u];const f=`${c}/${zc(u)}`;d.$ref!==void 0&&(d=zt(o,d.$ref,o)),Dc(d,i.elements,f,u,s,o)})}return i}switch(a[0]){case"object":case"array":case"string":case"number":case"integer":case"null":case"boolean":{const i=pa(r);return t.push(i),i}default:throw new Error("Unknown type: "+JSON.stringify(e))}},Fb=(e,t="VerticalLayout",r="#",n=e)=>IH(Dc(e,[],r,"",t,n),t),Ga={jsonSchema:Ab,uiSchema:Fb,controlElement:pa},Ld="jsonforms/INIT",Fd="jsonforms/UPDATE_CORE",Bd="jsonforms/SET_AJV",Ud="jsonforms/UPDATE",Wd="jsonforms/UPDATE_ERRORS",OH="jsonforms/VALIDATE",Bb="jsonforms/ADD_RENDERER",Ub="jsonforms/REMOVE_RENDERER",Wb="jsonforms/ADD_CELL",Vb="jsonforms/REMOVE_CELL",Vd="jsonforms/SET_CONFIG",Kb="jsonforms/ADD_UI_SCHEMA",Hb="jsonforms/REMOVE_UI_SCHEMA",Kd="jsonforms/SET_SCHEMA",Hd="jsonforms/SET_UISCHEMA",qd="jsonforms/SET_VALIDATION_MODE",Gd="jsonforms/SET_LOCALE",Yd="jsonforms/SET_TRANSLATOR",Jd="jsonforms/UPDATE_I18N",qb="jsonforms/ADD_DEFAULT_DATA",Gb="jsonforms/REMOVE_DEFAULT_DATA",DH=e=>{if(!("type"in e)||typeof e.type!="string")return!1;switch(e.type){case"ADD":return"values"in e&&Array.isArray(e.values)&&e.values.length>0;case"REMOVE":return"indices"in e&&Array.isArray(e.indices)&&e.indices.length>0&&e.indices.every(t=>typeof t=="number");case"MOVE":return"moves"in e&&Array.isArray(e.moves)&&e.moves.length>0&&e.moves.every(t=>typeof t=="object"&&t!==null&&"from"in t&&"to"in t&&typeof t.from=="number"&&typeof t.to=="number");default:return!1}},LH=(e,t=Ab(e),r,n)=>({type:Ld,data:e,schema:t,uischema:typeof r=="object"?r:Fb(t),options:n}),FH=(e,t,r,n)=>({type:Fd,data:e,schema:t,uischema:r,options:n}),BH=(e,t)=>({type:qb,schemaPath:e,data:t}),UH=e=>({type:Gb,schemaPath:e}),WH=e=>({type:Bd,ajv:e}),In=(e,t,r)=>({type:Ud,path:e,updater:t,context:r}),VH=e=>({type:Wd,errors:e}),KH=(e,t)=>({type:Bb,tester:e,renderer:t}),HH=(e,t)=>({type:Wb,tester:e,cell:t}),qH=(e,t)=>({type:Vb,tester:e,cell:t}),GH=(e,t)=>({type:Ub,tester:e,renderer:t}),YH=e=>({type:Vd,config:e}),JH=e=>({type:qd,validationMode:e}),ZH=(e,t)=>({type:Kb,tester:e,uischema:t}),QH=e=>({type:Hb,tester:e}),XH=e=>({type:Gd,locale:e}),eq=e=>({type:Kd,schema:e}),tq=(e,t)=>({type:Yd,translator:e,errorTranslator:t}),rq=(e,t,r)=>({type:Jd,locale:e,translator:t,errorTranslator:r}),nq=e=>({type:Hd,uischema:e});var Cn=Object.freeze({__proto__:null,INIT:Ld,UPDATE_CORE:Fd,SET_AJV:Bd,UPDATE_DATA:Ud,UPDATE_ERRORS:Wd,VALIDATE:OH,ADD_RENDERER:Bb,REMOVE_RENDERER:Ub,ADD_CELL:Wb,REMOVE_CELL:Vb,SET_CONFIG:Vd,ADD_UI_SCHEMA:Kb,REMOVE_UI_SCHEMA:Hb,SET_SCHEMA:Kd,SET_UISCHEMA:Hd,SET_VALIDATION_MODE:qd,SET_LOCALE:Gd,SET_TRANSLATOR:Yd,UPDATE_I18N:Jd,ADD_DEFAULT_DATA:qb,REMOVE_DEFAULT_DATA:Gb,isUpdateArrayContext:DH,init:LH,updateCore:FH,registerDefaultData:BH,unregisterDefaultData:UH,setAjv:WH,update:In,updateErrors:VH,registerRenderer:KH,registerCell:HH,unregisterCell:qH,unregisterRenderer:GH,setConfig:YH,setValidationMode:JH,registerUISchema:ZH,unregisterUISchema:QH,setLocale:XH,setSchema:eq,setTranslator:tq,updateI18n:rq,setUISchema:nq});const sq={restrict:!1,trim:!1,showUnfocusedDescription:!1,hideRequiredAsterisk:!1},$m=(e={})=>wo({},sq,e),Sm=(e=$m(),t)=>{switch(t.type){case Vd:return $m(t.config);default:return e}},oq={data:{},schema:{},uischema:void 0,errors:[],validator:void 0,ajv:void 0,validationMode:"ValidateAndShow",additionalErrors:[]},jm=(e,t)=>t&&aq(t.options)?t.options.validationMode:e.validationMode,aq=e=>e?e.validationMode!==void 0:!1,iq=e=>e?e.additionalErrors!==void 0:!1,Em=(e,t)=>t&&iq(t.options)?t.options.additionalErrors:e.additionalErrors,Am=(e,t)=>{if(t){if(lq(t.options))return t.options.ajv;if(t.options!==void 0&&$A(t.options.compile))return t.options}return e.ajv?e.ajv:Db()},lq=e=>e?e.ajv!==void 0:!1,Pl=(e=oq,t)=>{switch(t.type){case Ld:{const r=Am(e,t),n=jm(e,t),s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data),a=Em(e,t);return{...e,data:t.data,schema:t.schema,uischema:t.uischema,additionalErrors:a,errors:o,validator:s,ajv:r,validationMode:n}}case Fd:{const r=Am(e,t),n=jm(e,t);let s=e.validator,o=e.errors;e.schema!==t.schema||e.validationMode!==n||e.ajv!==r?(s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data)):e.data!==t.data&&(o=sr(s,t.data));const a=Em(e,t);return e.data!==t.data||e.schema!==t.schema||e.uischema!==t.uischema||e.ajv!==r||e.errors!==o||e.validator!==s||e.validationMode!==n||e.additionalErrors!==a?{...e,data:t.data,schema:t.schema,uischema:t.uischema,ajv:r,errors:Gy(o,e.errors)?e.errors:o,validator:s,validationMode:n,additionalErrors:a}:e}case Bd:{const r=t.ajv,n=e.validationMode==="NoValidation"?void 0:r.compile(e.schema),s=sr(n,e.data);return{...e,validator:n,errors:s}}case Kd:{const n=t.schema&&e.ajv&&e.validationMode!=="NoValidation"?e.ajv.compile(t.schema):e.validator,s=sr(n,e.data);return{...e,validator:n,schema:t.schema,errors:s}}case Hd:return{...e,uischema:t.uischema};case Ud:{if(t.path===void 0||t.path===null)return e;if(t.path===""){const r=t.updater(qs(e.data)),n=sr(e.validator,r);return{...e,data:r,errors:n}}else{const r=Qe(e.data,t.path),n=t.updater(qs(r));let s;n!==void 0?s=nK(t.path,n,e.data===void 0?{}:e.data):s=wK(t.path,e.data===void 0?{}:e.data);const o=sr(e.validator,s);return{...e,data:s,errors:o}}}case Wd:return{...e,errors:t.errors};case qd:{if(e.validationMode===t.validationMode)return e;if(t.validationMode==="NoValidation"){const r=sr(void 0,e.data);return{...e,errors:r,validationMode:t.validationMode}}if(e.validationMode==="NoValidation"){const r=e.ajv.compile(e.schema),n=sr(r,e.data);return{...e,validator:r,errors:n,validationMode:t.validationMode}}return{...e,validationMode:t.validationMode}}default:return e}};var tt;(function(e){e.addTooltip="addTooltip",e.addAriaLabel="addAriaLabel",e.removeTooltip="removeTooltip",e.upAriaLabel="upAriaLabel",e.downAriaLabel="downAriaLabel",e.noSelection="noSelection",e.removeAriaLabel="removeAriaLabel",e.noDataMessage="noDataMessage",e.deleteDialogTitle="deleteDialogTitle",e.deleteDialogMessage="deleteDialogMessage",e.deleteDialogAccept="deleteDialogAccept",e.deleteDialogDecline="deleteDialogDecline",e.up="up",e.down="down"})(tt||(tt={}));const cq=[{key:tt.addTooltip,default:e=>e?`Add to ${e}`:"Add"},{key:tt.addAriaLabel,default:e=>e?`Add to ${e} button`:"Add button"},{key:tt.removeTooltip,default:()=>"Delete"},{key:tt.removeAriaLabel,default:()=>"Delete button"},{key:tt.upAriaLabel,default:()=>"Move item up"},{key:tt.up,default:()=>"Up"},{key:tt.down,default:()=>"Down"},{key:tt.downAriaLabel,default:()=>"Move item down"},{key:tt.noDataMessage,default:()=>"No data"},{key:tt.noSelection,default:()=>"No selection"},{key:tt.deleteDialogTitle,default:()=>"Confirm Deletion"},{key:tt.deleteDialogMessage,default:()=>"Are you sure you want to delete the selected entry?"},{key:tt.deleteDialogAccept,default:()=>"Yes"},{key:tt.deleteDialogDecline,default:()=>"No"}];var Mn;(function(e){e.clearDialogTitle="clearDialogTitle",e.clearDialogMessage="clearDialogMessage",e.clearDialogAccept="clearDialogAccept",e.clearDialogDecline="clearDialogDecline"})(Mn||(Mn={}));Mn.clearDialogTitle,Mn.clearDialogMessage,Mn.clearDialogAccept,Mn.clearDialogDecline;const Zd=(e,t)=>Mb(t)?t.i18n:(e==null?void 0:e.i18n)??void 0,uq=e=>(e==null?void 0:e.split(".").filter(t=>!/^\d+$/.test(t)).join("."))||"root",Rr=(e,t,r)=>Zd(e,t)??uq(r),Ya=(e,t,r,n)=>`${Rr(e,t,r)}.${n}`,dq=(e,t)=>`${e}.${t}`,Qd=(e,t)=>t,Xd=(e,t,r)=>{var i;const n=Ya(e.parentSchema,r,Ha(e),`error.${e.keyword}`),s=t(n,void 0,{error:e});if(s!==void 0)return s;const o=t(`error.${e.keyword}`,void 0,{error:e});if(o!==void 0)return o;const a=t(e.message,void 0,{error:e});return a!==void 0?a:e.keyword==="required"&&((i=e.message)!=null&&i.startsWith("must have required property"))?t("is a required property","is a required property",{error:e}):e.message},Yb=(e,t,r,n,s,o)=>{if(e.length>0&&r){const a=Ya(n,s,o,"error.custom"),i=r(a,void 0,{schema:n,uischema:s,path:o,errors:e});if(i!==void 0)return i}return TH(e.map(a=>t(a,r,s)))},Jb=(e,t)=>{if(e.label===!1||(e.label===void 0||e.label===null||e.label===!0)&&!Mb(e))return;const r=typeof e.label=="string"?e.label:JSON.stringify(e.label),n=Zd(void 0,e),s=typeof n=="string"?`${n}.label`:r;return t(s,r,{uischema:e})},fq=(e,t,r,n)=>{const s={};return t.forEach(o=>{const a=dq(r,o.key);s[o.key]=e(a,o.default(n))}),s},hq=e=>e===void 0?Qd:e.translate,pq=e=>e===void 0?Xd:e.translateError,Yt=()=>e=>hq(Qe(e,"jsonforms.i18n")),Zb=()=>e=>pq(Qe(e,"jsonforms.i18n")),zn={locale:"en",translate:Qd,translateError:Xd},Nm=(e=zn,t)=>{switch(t.type){case Jd:{const r=t.locale??zn.locale,n=t.translator??zn.translate,s=t.errorTranslator??zn.translateError;return r!==e.locale||n!==e.translate||s!==e.translateError?{...e,locale:r,translate:n,translateError:s}:e}case Yd:return{...e,translate:t.translator??Qd,translateError:t.errorTranslator??Xd};case Gd:return{...e,locale:t.locale??navigator.languages[0]};default:return e}},Hn=-1,cr=e=>!he(e)&&e.scope!==void 0,Ot=e=>(t,r,n)=>{if(he(t)||!cr(t)||he(r))return!1;const s=t.scope;if(he(s))return!1;let o=r;return nt(r,"object")&&(o=zt(r,s,n==null?void 0:n.rootSchema)),o===void 0?!1:e(o,n==null?void 0:n.rootSchema)},ef=(e,t)=>(r,n,s)=>{if(he(r)||!cr(r))return!1;const o=r.scope;let a=n;return nt(n,"object")&&(a=zt(n,o,s==null?void 0:s.rootSchema)),a=Qe(a,e),a===void 0?!1:t(a,s==null?void 0:s.rootSchema)},hr=e=>Ot(t=>!he(t)&&nt(t,e)),Ni=e=>Ot(t=>!he(t)&&t.format===e&&nt(t,"string")),De=e=>t=>!he(t)&&t.type===e,gr=(e,t)=>r=>{if(he(r))return!1;const n=r.options;return!he(n)&&n[e]===t},mq=e=>t=>{if(he(t))return!1;const r=t.options;return!he(r)&&!aH(r[e])},gq=e=>t=>he(e)||!cr(t)?!1:NK(t.scope,e),vq=e=>t=>{if(he(e)||!cr(t))return!1;const r=t.scope;return!he(r)&&oK(r.split("/"))===e},Fe=(...e)=>(t,r,n)=>e.reduce((s,o)=>s&&o(t,r,n),!0),Co=(...e)=>(t,r,n)=>e.reduce((s,o)=>s||o(t,r,n),!1),We=(e,t)=>(r,n,s)=>t(r,n,s)?e:Hn,yq=(e,t)=>(r,n,s)=>{const o=t(r,n,s);return o===Hn?Hn:o+e},Qb=Fe(De("Control"),hr("boolean")),bq=Fe(De("Control"),hr("object")),xq=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"allOf"))),wq=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"anyOf"))),kq=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"oneOf"))),tf=Fe(De("Control"),Ot(e=>SH(e))),rf=Fe(De("Control"),Ot(e=>Ka(e))),Xb=Fe(De("Control"),hr("integer")),ex=Fe(De("Control"),hr("number")),tx=Fe(De("Control"),hr("string")),rx=Fe(De("Control"),gr("multi",!0)),nx=Fe(De("Control"),Co(Ni("date"),gr("format","date"))),sx=Fe(De("Control"),Co(Ni("time"),gr("format","time"))),ox=Fe(De("Control"),Co(Ni("date-time"),gr("format","date-time"))),ax=Fe(Ot((e,t)=>nt(e,"array")&&!Array.isArray(zt(e,"items",t))),ef("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e;return nt(r,"object")})),ix=Fe(De("Control"),ax),Os=(e,t,r)=>{if(G0(e))return Mc(e,(n,s)=>n||Os(s,t,r),!1);if(t(e))return!0;if(e.$ref){const n=zt(r,e.$ref,r);if(n&&!n.$ref)return Os(n,t,r)}return e.items?Os(e.items,t,r):e.properties?Mc(nH(e.properties),(n,[s,o])=>n||Os(o,t,r),!1):!1},lx=(e,t,r)=>{if(!De("Control")(e,t,r))return!1;const n=e.scope,s=zt(t,n,(r==null?void 0:r.rootSchema)??t);let o=0;if(s!==void 0&&s.items!==void 0){if(Os(s.items,a=>a===t||a.$ref!==void 0?!1:!!(a.anyOf||a.allOf||a.oneOf&&!Ka(a)||nt(a,"object")&&(o++,o===2)||nt(a,"array")),r==null?void 0:r.rootSchema))return!0;if(e.options&&e.options.detail){if(typeof e.options.detail=="string")return e.options.detail.toUpperCase()!=="DEFAULT";if(typeof e.options.detail=="object"&&e.options.detail.type)return!0}}return!1},_q=ix,Cq=Fe(De("Control"),Ot((e,t)=>en(e).length!==0&&!Array.isArray(zt(e,"items",t))),ef("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e,n=en(r);return n.length===1&&Vv(["integer","number","boolean","string"],n[0])})),cx=Fe(De("Control"),Co(hr("number"),hr("integer")),Ot(e=>Object.prototype.hasOwnProperty.call(e,"maximum")&&Object.prototype.hasOwnProperty.call(e,"minimum")&&Object.prototype.hasOwnProperty.call(e,"default")),gr("slider",!0)),$q=Fe(De("Control"),hr("integer"),gr("format",!0)),ux=e=>e.type==="Categorization",dx=e=>e.type==="Category",nf=e=>he(e.elements)?!1:e.elements.map(t=>ux(t)?nf(t):dx(t)).reduce((t,r)=>t&&r,!0),Sq=e=>nf(e),jq=e=>(t,r,n)=>!e(t,r,n);var Eq=Object.freeze({__proto__:null,NOT_APPLICABLE:Hn,isControl:cr,schemaMatches:Ot,schemaSubPathMatches:ef,schemaTypeIs:hr,formatIs:Ni,uiTypeIs:De,optionIs:gr,hasOption:mq,scopeEndsWith:gq,scopeEndIs:vq,and:Fe,or:Co,rankWith:We,withIncreasedRank:yq,isBooleanControl:Qb,isObjectControl:bq,isAllOfControl:xq,isAnyOfControl:wq,isOneOfControl:kq,isEnumControl:tf,isOneOfEnumControl:rf,isIntegerControl:Xb,isNumberControl:ex,isStringControl:tx,isMultiLineControl:rx,isDateControl:nx,isTimeControl:sx,isDateTimeControl:ox,isObjectArray:ax,isObjectArrayControl:ix,isObjectArrayWithNesting:lx,isArrayObjectControl:_q,isPrimitiveArrayControl:Cq,isRangeControl:cx,isNumberFormatControl:$q,isCategorization:ux,isCategory:dx,hasCategory:nf,categorizationHasCategory:Sq,not:jq});const Aq=e=>(t,r,n)=>{const s=wi(e,o=>o.tester(t,r,n));if(s!==void 0&&s.tester(t,r,n)!==Hn)return s.uischema},Nq=(e,t,r,n,s="VerticalLayout",o,a)=>{if(o&&o.options&&o.options.detail){if(typeof o.options.detail=="string"){if(o.options.detail.toUpperCase()==="GENERATE")return typeof s=="function"?s():Ga.uiSchema(t,s,void 0,a)}else if(typeof o.options.detail=="object"&&o.options.detail.type&&typeof o.options.detail.type=="string")return o.options.detail}const i=Aq(e)(t,r,n);return i===void 0?typeof s=="function"?s():Ga.uiSchema(t,s,"#",a):i},Pm=(e,t,r)=>r(e,t),fx=(e,t,r)=>n=>{const s=n.errors??[],o=n.additionalErrors??[];return NH(e,t,r)(n.validationMode==="ValidateAndHide"?o:[...s,...o])},Pq=(e,t)=>fx(e,t,r=>r===e),Rq=(e,t)=>fx(e,t,r=>r.startsWith(e+".")),hx=(e,t)=>r=>Pq(e,t)(r.jsonforms.core),Tq=(e,t)=>r=>Rq(e,t)(r.jsonforms.core),Pi=e=>Mq(Qe(e,"jsonforms.core")),Ja=e=>zq(Qe(e,"jsonforms.core")),Iq=e=>Oq(Qe(e,"jsonforms.core")),is=e=>Dq(Qe(e,"jsonforms.core")),sf=e=>Qe(e,"jsonforms.renderers"),of=e=>Qe(e,"jsonforms.cells"),Mq=e=>Qe(e,"data"),zq=e=>Qe(e,"schema"),Oq=e=>Qe(e,"uischema"),Dq=e=>Qe(e,"ajv"),pr=e=>e.jsonforms.config,af=(e,t,r,n,s,o)=>{var a,i,c;return(a=e==null?void 0:e.jsonforms)!=null&&a.readonly?!1:r&&CH(r)?$H(r,s,t==null?void 0:t.path,is(e),o):typeof((i=r==null?void 0:r.options)==null?void 0:i.readonly)=="boolean"?!r.options.readonly:typeof((c=r==null?void 0:r.options)==null?void 0:c.readOnly)=="boolean"?!r.options.readOnly:typeof(o==null?void 0:o.readonly)=="boolean"?!o.readonly:typeof(o==null?void 0:o.readOnly)=="boolean"?!o.readOnly:(n==null?void 0:n.readOnly)===!0?!1:typeof(t==null?void 0:t.enabled)=="boolean"?t.enabled:!0},px=(e,t,r)=>{const n=t+r;if(n<0||n>=e.length)return;const s=[t,n].sort((o,a)=>o-a);e.splice(s[0],2,e[s[1]],e[s[0]])},Lq=(e,t)=>{px(e,t,-1)},Fq=(e,t)=>{px(e,t,1)},Bq=(e,t,r)=>{const n=t.split("/"),s=ko(n[n.length-1]),a=n.slice(0,n.length-2).join("/"),i=Gt.schema(e,a,r);return i!==void 0&&i.required!==void 0&&i.required.indexOf(s)!==-1},mx=(e,t,r)=>`${e??""}${t&&!r?"*":""}`,gx=(e,t)=>{const r=vx(e,t);return r===void 0?{}:r},vx=(e,t)=>{const r=typeof e.$ref=="string"?Gt.schema(t,e.$ref,t):e;if(r.default!==void 0)return Rm(r,t);if(nt(r,"string"))return r.format==="date-time"||r.format==="date"||r.format==="time"?jH(new Date,r.format):"";if(nt(r,"integer")||nt(r,"number"))return 0;if(nt(r,"boolean"))return!1;if(nt(r,"array"))return[];if(nt(r,"object"))return Rm(r,t);if(nt(r,"null"))return null;const n=["oneOf","anyOf","allOf"];for(const s of n)if(e[s]&&Array.isArray(e[s])){const o=Uq(e[s],t);if(o!==void 0)return o}},Uq=(e,t)=>{if(e.length>0)for(const r of e){const n=vx(r,t);if(n!==void 0)return n}},Rm=(e,t)=>{if(nt(e,"object")&&e.default===void 0){const r={};for(const n in e.properties){const s=e.properties[n],o=s.$ref?Gt.schema(t,s.$ref,t):s;o&&o.default!==void 0&&(r[n]=qs(o.default))}return e.allOf&&Array.isArray(e.allOf)&&e.allOf.forEach(n=>{if(n&&n.properties)for(const s in n.properties){const o=n.properties[s],a=o.$ref?Gt.schema(t,o.$ref,t):o;a&&a.default!==void 0&&(r[s]=qs(a.default))}}),r}return qs(e.default)},yx=(e,t,r,n)=>t===void 0||t!==void 0&&!e||!n&&!r,Za=(e,t,r)=>{let n=typeof e=="string"?e:JSON.stringify(e);return t&&(r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e}},bx=(e,t,r)=>{let n=e.title??(typeof e.const=="string"?e.const:JSON.stringify(e.const));return t&&(e.i18n?n=t(e.i18n,n):r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e.const}},Ri=(e,t)=>{const{uischema:r}=t,n=Pi(e),s=Ib(r,t.path),o=pr(e),a=t.visible===void 0||Dd(r)?_o(r,n,t.path,is(e),o):t.visible,i=r,c=t.id,u=Ja(e),d=i.scope!==void 0&&Bq(t.schema,i.scope,u),f=Gt.schema(t.schema||u,i.scope,u),p=hx(s,f)(e),h=f!==void 0?f.description:"",g=Gt.data(n,s),m=Rb(r,f),v=m.show?m.text:"",y=af(e,t,r,f||u,n,o),b=f??u,C=Yt()(e),w=Zb()(e),_=Rr(b,r,s),R=C(Ya(b,r,s,"label"),v,{schema:b,uischema:r,path:s,errors:p}),z=C(Ya(b,r,s,"description"),h,{schema:b,uischema:r,path:s,errors:p}),D=Yb(p,w,C,b,r,s);return{data:g,description:z,errors:D,label:R,visible:a,enabled:y,id:c,path:s,required:d,uischema:r,schema:b,config:pr(e),cells:t.cells||e.jsonforms.cells,rootSchema:u,i18nKeyPrefix:_}},Wq=e=>({handleChange(t,r){e(In(t,()=>r))}}),Vq=(e,t)=>{var s;const r=Ri(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Za(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Za(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},Kq=(e,t)=>{var s;const r=Ri(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>bx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}},Hq=(e,t)=>{const{...r}=Ri(e,t);return{...r,uischemas:e.jsonforms.uischemas}},qq=(e,t)=>{const{path:r,schema:n,uischema:s,label:o,...a}=Hq(e,t),i=Gt.schema(n,"items",a.rootSchema),c=Tq(r,i)(e);return{...a,label:o,path:r,uischema:s,schema:i,arraySchema:n,childErrors:c,renderers:t.renderers||sf(e),cells:t.cells||of(e)}},Gq=e=>({addItem:(t,r)=>()=>{e(In(t,n=>n==null?[r]:(n.push(r),n),{type:"ADD",values:[r]}))},removeItems:(t,r)=>()=>{e(In(t,n=>(r.sort((s,o)=>s-o).reverse().forEach(s=>n.splice(s,1)),n),{type:"REMOVE",indices:r}))},moveUp:(t,r)=>()=>{e(In(t,n=>(Lq(n,r),n),{type:"MOVE",moves:[{from:r,to:r-1}]}))},moveDown:(t,r)=>()=>{e(In(t,n=>(Fq(n,r),n),{type:"MOVE",moves:[{from:r,to:r+1}]}))}}),xx={visible:!0,enabled:!0,path:"",direction:"column"},Yq=e=>e.type==="HorizontalLayout"?"row":e.type==="VerticalLayout"?"column":xx.direction,Jq=(e,t)=>{const r=Pi(e),{uischema:n}=t,s=t.visible===void 0||Dd(n)?_o(t.uischema,r,t.path,is(e),pr(e)):t.visible,o=Gt.data(r,t.path),a=pr(e),i=af(e,t,n,void 0,r,a),c=Yt()(e),u=gH(n)?Jb(n,c):void 0;return{...xx,renderers:t.renderers||sf(e),cells:t.cells||of(e),visible:s,enabled:i,path:t.path,data:o,uischema:t.uischema,schema:t.schema,direction:t.direction??Yq(n),config:a,label:u}},Zq=(e,t)=>({renderers:t.renderers||Qe(e.jsonforms,"renderers"),cells:t.cells||Qe(e.jsonforms,"cells"),schema:t.schema||Ja(e),rootSchema:Ja(e),uischema:t.uischema||Iq(e),path:t.path,enabled:t.enabled,config:pr(e)}),Qq=(e,t)=>{const{uischema:r}=t,n=t.visible===void 0||Dd(r)?_o(t.uischema,Pi(e),t.path,is(e),pr(e)):t.visible,s=r.text,o=Yt()(e),a=Zd(void 0,r),i=a?`${a}.text`:s??"";return{text:o(i,s,{uischema:r}),visible:n,config:pr(e),renderers:t.renderers||sf(e),cells:t.cells||of(e),uischema:r}},Ti=(e,t)=>{const{id:r,schema:n,path:s,uischema:o,renderers:a,cells:i}=t,c=Pi(e),u=pr(e),d=t.visible!==void 0?t.visible:_o(o,c,void 0,is(e),u),f=Ja(e);let p;e.jsonforms.readonly===!0?p=!1:typeof t.enabled=="boolean"?p=t.enabled:p=af(e,t,o,n||f,c,u);const h=Yt()(e),g=Zb()(e),m=Yb(hx(s,n)(e),g,h,n,o,s),v=he(m);return{data:Gt.data(c,s),visible:d,enabled:p,id:r,path:s,errors:m,isValid:v,schema:n,uischema:o,config:pr(e),rootSchema:f,renderers:a,cells:i}},Xq=(e,t)=>{const r=Ti(e,t),{renderers:n,cells:s,...o}=t;return{...r,...o,cells:s||e.jsonforms.cells||[]}},eG=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Za(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Za(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},tG=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>bx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}};var rG=ut,nG=function(){return rG.Date.now()},sG=nG,oG=xt,Rl=sG,Tm=Dv,aG="Expected a function",iG=Math.max,lG=Math.min;function cG(e,t,r){var n,s,o,a,i,c,u=0,d=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(aG);t=Tm(t)||0,oG(r)&&(d=!!r.leading,f="maxWait"in r,o=f?iG(Tm(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p);function h(R){var z=n,D=s;return n=s=void 0,u=R,a=e.apply(D,z),a}function g(R){return u=R,i=setTimeout(y,t),d?h(R):a}function m(R){var z=R-c,D=R-u,j=t-z;return f?lG(j,o-D):j}function v(R){var z=R-c,D=R-u;return c===void 0||z>=t||z<0||f&&D>=o}function y(){var R=Rl();if(v(R))return b(R);i=setTimeout(y,m(R))}function b(R){return i=void 0,p&&n?h(R):(n=s=void 0,a)}function C(){i!==void 0&&clearTimeout(i),u=0,n=c=s=i=void 0}function w(){return i===void 0?a:b(Rl())}function _(){var R=Rl(),z=v(R);if(n=arguments,s=this,c=R,z){if(i===void 0)return g(c);if(f)return clearTimeout(i),i=setTimeout(y,t),h(c)}return i===void 0&&(i=setTimeout(y,t)),a}return _.cancel=C,_.flush=w,_}var uG=cG;const dG=Se(uG);class fG extends B.Component{constructor(t){super(t)}}class hG extends fG{constructor(t){super(t),this.handleChange=r=>{this.setState({value:r}),this.updateData(r)},this.onFocus=()=>{this.setState({isFocused:!0})},this.onBlur=()=>{this.setState({isFocused:!1})},this.updateData=r=>{this.props.handleChange(this.props.path,r)},this.state={value:t.data?t.data:"",isFocused:!1}}}class wx extends x.Component{render(){return B.createElement("div",{style:{color:"red"}},"No applicable ",this.props.type," found.")}}const pG={data:{},schema:{},uischema:void 0,errors:[],additionalErrors:[],validator:void 0,ajv:void 0},kx=B.createContext({core:pG,renderers:[]}),mG=(e,t)=>{const r=x.useRef(!0);x.useEffect(()=>{if(r.current){r.current=!1;return}e()},t)},gG=({children:e,initState:t,onChange:r,middleware:n})=>{var _,R,z;const{data:s,schema:o,uischema:a,ajv:i,validationMode:c,additionalErrors:u}=t.core,d=x.useRef(n??Pm);d.current=n??Pm;const[f,p]=x.useState(()=>d.current(t.core,Cn.init(s,o,a,{ajv:i,validationMode:c,additionalErrors:u}),Pl));x.useEffect(()=>p(D=>d.current(D,Cn.updateCore(s,o,a,{ajv:i,validationMode:c,additionalErrors:u}),Pl)),[s,o,a,i,c,u]);const[h,g]=x.useReducer(Sm,void 0,()=>Sm(void 0,Cn.setConfig(t.config)));mG(()=>{g(Cn.setConfig(t.config))},[t.config]);const[m,v]=x.useReducer(Nm,void 0,()=>{var D,j,S;return Nm(t.i18n,Cn.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))});x.useEffect(()=>{var D,j,S;v(Cn.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))},[(_=t.i18n)==null?void 0:_.locale,(R=t.i18n)==null?void 0:R.translate,(z=t.i18n)==null?void 0:z.translateError]);const y=x.useCallback(D=>{p(j=>d.current(j,D,Pl))},[]),b=x.useMemo(()=>({core:f,renderers:t.renderers,cells:t.cells,config:h,uischemas:t.uischemas,readonly:t.readonly,i18n:m,dispatch:y}),[f,t.renderers,t.cells,h,t.uischemas,t.readonly,m]),C=x.useRef(r);x.useEffect(()=>{C.current=r},[r]);const w=x.useCallback(dG((...D)=>{var j;return(j=C.current)==null?void 0:j.call(C,...D)},10),[]);return x.useEffect(()=>{w({data:f.data,errors:f.errors})},[f.data,f.errors]),B.createElement(kx.Provider,{value:b},e)},$o=()=>x.useContext(kx),vG=(e,t)=>qq({jsonforms:{...e}},t),yG=(e,t)=>Jq({jsonforms:{...e}},t),bG=(e,t)=>Ri({jsonforms:{...e}},t),xG=(e,t)=>{var s;const r=Vq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},wG=(e,t)=>{var s;const r=Kq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},zr=e=>x.useMemo(()=>Wq(e),[e]),kG=(e,t)=>Zq({jsonforms:{...e}},t),_G=e=>({...zr(e),...x.useMemo(()=>Gq(e),[e])}),CG=(e,t)=>Ti({jsonforms:{...e}},t),$G=(e,t)=>{var s;const r=eG({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},SG=(e,t)=>{var s;const r=tG({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},jG=(e,t)=>Xq({jsonforms:{...e}},t),EG=(e,t)=>Qq({jsonforms:{...e}},t),Dt=e=>function(r){const n=$o();return B.createElement(e,{ctx:n,props:r})},AG=e=>function({ctx:r,props:n}){const s=kG(r,n);return B.createElement(e,{...n,...s})},NG=e=>function({ctx:r,props:n}){const s=bG(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...s,...o})},PG=e=>function({ctx:r,props:n}){const s=yG(r,n);return B.createElement(e,{...n,...s})},RG=e=>function({ctx:r,props:n}){const s=vG(r,n),o=_G(r.dispatch);return B.createElement(e,{...n,...s,...o})},TG=e=>function({ctx:r,props:n}){const s=CG(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},IG=e=>function({ctx:r,props:n}){const s=jG(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},MG=e=>function({ctx:r,props:n}){const s=$G(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},zG=e=>function({ctx:r,props:n}){const s=xG(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},OG=e=>function({ctx:r,props:n}){const s=SG(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},DG=e=>function({ctx:r,props:n}){const s=wG(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},LG=e=>function({ctx:r,props:n}){const s=EG(r,n);return B.createElement(e,{...n,...s})},_x=(e,t=!0)=>Dt(AG(t?B.memo(e):e)),FG=(e,t=!0)=>Dt(NG(t?B.memo(e):e)),Ii=(e,t=!0)=>Dt(PG(t?B.memo(e):e)),Cx=(e,t=!0)=>Dt(RG(t?B.memo(e):e)),Qt=(e,t=!0)=>Dt(TG(t?B.memo(e):e)),BG=(e,t=!0)=>Dt(IG(t?B.memo(e):e)),UG=(e,t=!0)=>Dt(MG(t?B.memo(e):e)),WG=(e,t=!0)=>Dt(zG(t?B.memo(e):e)),VG=(e,t=!0)=>Dt(OG(t?B.memo(e):e)),KG=(e,t=!0)=>Dt(DG(t?B.memo(e):e)),HG=(e,t=!0)=>Dt(LG(t?B.memo(e):e)),So=e=>function(r){var a,i;const n=$o(),s=((a=n.i18n)==null?void 0:a.locale)??zn.locale,o=((i=n.i18n)==null?void 0:i.translate)??zn.translate;return B.createElement(e,{...r,locale:s,t:o})},$x=e=>function(r){const n=x.useMemo(()=>fq(r.t,cq,r.i18nKeyPrefix,r.label),[r.t,r.i18nKeyPrefix,r.label]);return B.createElement(e,{...r,translations:n})};class Sx extends B.Component{constructor(t){super(t),this.state={id:cr(t.uischema)?_m(t.uischema.scope):void 0}}componentWillUnmount(){cr(this.props.uischema)&&Cm(this.state.id)}componentDidUpdate(t){t.schema!==this.props.schema&&(Cm(this.state.id),this.setState({id:cr(this.props.uischema)?_m(this.props.uischema.scope):void 0}))}render(){const{schema:t,rootSchema:r,uischema:n,path:s,enabled:o,renderers:a,cells:i,config:c}=this.props;return B.createElement(qG,{uischema:n,schema:t,rootSchema:r,path:s,enabled:o,renderers:a,cells:i,id:this.state.id,config:c})}}const qG=B.memo(function(t){const r=x.useMemo(()=>({rootSchema:t.rootSchema,config:t.config}),[t.rootSchema,t.config]),n=x.useMemo(()=>wi(t.renderers,s=>s.tester(t.uischema,t.schema,r)),[t.renderers,t.uischema,t.schema,r]);if(n===void 0||n.tester(t.uischema,t.schema,r)===-1)return B.createElement(wx,{type:"renderer"});{const s=n.renderer;return B.createElement(s,{uischema:t.uischema,schema:t.schema,path:t.path,enabled:t.enabled,renderers:t.renderers,cells:t.cells,id:t.id})}});class GG extends Sx{constructor(t){super(t)}}const Mi=_x(Sx);_x(GG);const YG=e=>{const{ajv:t,data:r,schema:n,uischema:s,renderers:o,cells:a,onChange:i,config:c,uischemas:u,readonly:d,validationMode:f,i18n:p,additionalErrors:h,middleware:g}=e,m=x.useMemo(()=>n!==void 0?n:Ga.jsonSchema(r),[n,r]),v=x.useMemo(()=>typeof s=="object"?s:Ga.uiSchema(m,void 0,void 0,m),[s,m]);return B.createElement(gG,{initState:{core:{ajv:t,data:r,schema:m,uischema:v,validationMode:f,additionalErrors:h},config:c,uischemas:u,renderers:o,cells:a,readonly:d,i18n:p},onChange:i,middleware:g},B.createElement(Mi,null))},JG=({uischema:e,schema:t,rootSchema:r,path:n,cells:s,id:o,enabled:a,renderers:i,config:c})=>{const u=x.useMemo(()=>({rootSchema:r,config:c}),[r,c]),d=x.useMemo(()=>wi(s,f=>f.tester(e,t,u)),[s,e,t,u]);if(d===void 0||d.tester(e,t,u)===-1)return B.createElement(wx,{type:"cell"});{const f=d.cell;return B.createElement(f,{uischema:e,schema:t,enabled:a,path:n,id:o,renderers:i,cells:s})}},Lc=BG(JG);var ZG=Array.prototype,QG=ZG.join;function XG(e,t){return e==null?"":QG.call(e,t)}var eY=XG;const jx=Se(eY);var tY=hn,Ex=tY("filter",qy);Ex.placeholder=Mr();var rY=Ex;const Im=Se(rY);var Tl,Mm;function nY(){if(Mm)return Tl;Mm=1;var e=yd,t=mr;function r(n,s){var o=-1,a=t(n)?Array(n.length):[];return e(n,function(i,c,u){a[++o]=s(i,c,u)}),a}return Tl=r,Tl}var Il,zm;function sY(){if(zm)return Il;zm=1;var e=ho,t=fn,r=nY(),n=Ue;function s(o,a){var i=n(o)?e:r;return i(o,t(a))}return Il=s,Il}var oY=hn,Ax=oY("map",sY());Ax.placeholder=Mr();var aY=Ax;const Om=Se(aY);var Ml,Dm;function iY(){if(Dm)return Ml;Dm=1;var e=Nd(),t=$b,r=Ad(),n=gb(),s=Ue,o=vb(),a="Expected a function",i=8,c=32,u=128,d=256;function f(p){return t(function(h){var g=h.length,m=g,v=e.prototype.thru;for(p&&h.reverse();m--;){var y=h[m];if(typeof y!="function")throw new TypeError(a);if(v&&!b&&n(y)=="wrapper")var b=new e([],!0)}for(m=b?m:g;++m<g;){y=h[m];var C=n(y),w=C=="wrapper"?r(y):void 0;w&&o(w[0])&&w[1]==(u|i|c|d)&&!w[4].length&&w[9]==1?b=b[n(w[0])].apply(b,w[3]):b=y.length==1&&o(y)?b[C]():b.thru(y)}return function(){var _=arguments,R=_[0];if(b&&_.length==1&&s(R))return b.plant(R).value();for(var z=0,D=g?h[z].apply(this,_):R;++z<g;)D=h[z].call(this,D);return D}})}return Ml=f,Ml}var zl,Lm;function lY(){if(Lm)return zl;Lm=1;var e=iY(),t=e();return zl=t,zl}var cY=hn,Nx=cY("flow",lY());Nx.placeholder=Mr();var uY=Nx;const Fm=Se(uY);var Ol,Bm;function Px(){return Bm||(Bm=1,Ol={cap:!1,curry:!1,fixed:!1,immutable:!1,rearg:!1}),Ol}var dY=hn,Rx=dY("keys",Jt(),Px());Rx.placeholder=Mr();var fY=Rx;const Um=Se(fY);var hY=hn,Tx=hY("startCase",Mv,Px());Tx.placeholder=Mr();var pY=Tx;const mY=Se(pY),Ix={"enum.none":"None"},Gs=e=>(t,...r)=>{const n=Wa(e,s=>s.name===t);return Mc(n,(s,o)=>typeof o.classNames=="function"?s.concat(o.classNames(r)):s.concat(o.classNames),[])},It=e=>(t,...r)=>jx(Gs(e)(t,r)," "),gY=[{name:"control",classNames:["control"]},{name:"control.trim",classNames:["trim"]},{name:"control.input",classNames:["input"]},{name:"control.select",classNames:["select"]},{name:"control.checkbox",classNames:["checkbox"]},{name:"control.radio",classNames:["radio"]},{name:"control.radio.option",classNames:["radio-option"]},{name:"control.radio.input",classNames:["radio-input"]},{name:"control.radio.label",classNames:["radio-label"]},{name:"control.validation.error",classNames:["validation_error"]},{name:"control.validation",classNames:["validation"]},{name:"categorization",classNames:["categorization"]},{name:"categorization.master",classNames:["categorization-master"]},{name:"categorization.detail",classNames:["categorization-detail"]},{name:"category.group",classNames:["category-group"]},{name:"category.subcategories",classNames:["category-subcategories"]},{name:"array.layout",classNames:["array-layout"]},{name:"array.children",classNames:["children"]},{name:"group.layout",classNames:["group-layout"]},{name:"horizontal.layout",classNames:["horizontal-layout"]},{name:"horizontal.layout.item",classNames:([e])=>[`horizontal-layout-${e}`]},{name:"vertical.layout",classNames:["vertical-layout"]},{name:"array.table.validation.error",classNames:["validation_error"]},{name:"array.table.validation",classNames:["validation"]},{name:"array.table",classNames:["array-table-layout","control"]},{name:"array.control.validation.error",classNames:["validation_error"]},{name:"array.control.validation",classNames:["validation"]},{name:"array.control.add",classNames:["button-add"]},{name:"array.child.controls",classNames:["child-controls"]},{name:"array.child.controls.up",classNames:["button-up"]},{name:"array.child.controls.down",classNames:["button-down"]},{name:"array.child.controls.delete",classNames:["button-delete"]},{name:"array.control",classNames:["array-control-layout","control"]},{name:"input.description",classNames:["input-description"]}],vY={styles:gY},yY=B.createContext(vY),bY=()=>x.useContext(yY),lf=()=>{const{styles:e}=bY();return e},Xt=e=>function(r){const n=$o(),s=lf(),o=r.uischema,a=n.config,i=a&&a.trim,c=x.useMemo(()=>Gs(s)("control"),[s]);let u=he(o.scope)?[""]:c.concat([`${Ob(o.scope)}`]);i&&(u=u.concat(Gs(s)("control.trim")));const d=he(r.errors),f=x.useMemo(()=>It(s)("control.label"),[s]),p=x.useMemo(()=>It(s)("input.description"),[s]),h=x.useMemo(()=>It(s)("control.validation"),[s]),g=x.useMemo(()=>It(s)("control.validation.error"),[s]),m=["validate"].concat(d?"valid":"invalid"),v=x.useMemo(()=>It(s),[s]),y=x.useMemo(()=>Gs(s),[s]),b=u.join(" "),C=m.join(" "),w=x.useMemo(()=>({wrapper:b,input:C,label:f,description:p,validation:h,validationError:g}),[b,C,f,p,h,g]);return B.createElement(e,{...r,getStyleAsClassName:v,getStyle:y,classNames:w})},cf=e=>t=>function(n){const s=["validate"].concat(n.isValid?"valid":"invalid"),o=lf(),a=It(o)(e);return a&&s.push(a),B.createElement(t,{...n,getStyleAsClassName:It(o),getStyle:Gs(o),className:s.join(" ")})},xY=e=>function(r){const n=$o(),s=is({jsonforms:{...n}});return B.createElement(e,{...r,ajv:s})},vr=cf("control.input"),Mx=cf("control.select"),wY=cf("control.checkbox");class kY extends hG{render(){const{classNames:t,description:r,id:n,errors:s,label:o,uischema:a,schema:i,rootSchema:c,visible:u,enabled:d,required:f,path:p,cells:h,config:g}=this.props,m=s.length===0,v=[t.validation].concat(m?t.description:t.validationError).join(" "),y=wo({},g,a.options),b=!yx(u,r,this.state.isFocused,y.showUnfocusedDescription),C={rootSchema:c,config:g},w=wi(h,_=>_.tester(a,i,C));return w===void 0||w.tester(a,i,C)===Hn?(console.warn("No applicable cell found.",a,i),null):B.createElement("div",{className:t.wrapper,hidden:!u,onFocus:this.onFocus,onBlur:this.onBlur,id:n},B.createElement("label",{htmlFor:n+"-input",className:t.label},mx(o,f,y.hideRequiredAsterisk)),B.createElement(Lc,{uischema:a,schema:i,path:p,id:n+"-input",enabled:d}),B.createElement("div",{className:v},m?b?r:null:s))}}const _Y=We(1,cr);var CY=Xt(FG(kY));const zx=({classNames:e,id:t,label:r,options:n,required:s,description:o,errors:a,data:i,uischema:c,visible:u,config:d,enabled:f,path:p,handleChange:h})=>{const g=lf(),[m,v]=x.useState(!1),y=x.useMemo(()=>It(g)("control.radio"),[g]),b=x.useMemo(()=>It(g)("control.radio.option"),[g]),C=x.useMemo(()=>It(g)("control.radio.input"),[g]),w=x.useMemo(()=>It(g)("control.radio.label"),[g]),_=a.length===0,R=[e.validation].concat(_?e.description:e.validationError).join(" "),z=wo({},d,c.options),D=!yx(u,o,m,z.showUnfocusedDescription),j=!y||y==="radio";let S={};return j&&(S={display:"flex",flexDirection:z.orientation==="vertical"?"column":"row"}),B.createElement("div",{className:e.wrapper,hidden:!u,onFocus:()=>v(!0),onBlur:()=>v(!1)},B.createElement("label",{htmlFor:t,className:e.label},mx(r,s,z.hideRequiredAsterisk)),B.createElement("div",{className:y,style:S},n.map(E=>B.createElement("div",{key:E.label,className:b},B.createElement("input",{type:"radio",value:E.value,id:E.value,name:t,checked:i===E.value,onChange:P=>h(p,E.value),disabled:!f,className:C}),B.createElement("label",{htmlFor:E.value,className:w},E.label)))),B.createElement("div",{className:R},_?D?o:null:a))},$Y=e=>B.createElement(zx,{...e}),SY=We(3,Fe(tf,gr("format","radio")));var jY=Xt(WG($Y));const EY=e=>B.createElement(zx,{...e}),AY=We(3,Fe(rf,gr("format","radio")));var NY=Xt(KG(EY));const{convertToValidClassName:PY}=qa,RY=({classNames:e,data:t,label:r,path:n,schema:s,errors:o,addItem:a,removeItems:i,moveUp:c,moveDown:u,uischema:d,uischemas:f,getStyleAsClassName:p,renderers:h,rootSchema:g,translations:m,enabled:v})=>{const y=d,b=x.useMemo(()=>Nq(f,s,d.scope,n,void 0,d,g),[f,s,d.scope,n,d,g]),C=o.length===0,_=[p("array.control.validation")].concat(C?"":p("array.control.validation.error")).join(" "),R=p("array.control.add"),z=p("array.control.label"),D=p("array.child.controls"),j=p("array.child.controls.up"),S=p("array.child.controls.down"),E=p("array.child.controls.delete"),P=[p("array.control"),PY(y.scope)].join(" ");return B.createElement("div",{className:P},B.createElement("header",null,B.createElement("label",{className:z},r),B.createElement("button",{type:"button",className:R,disabled:!v,onClick:a(n,gx(s,g))},"Add to ",r)),B.createElement("div",{className:_},o),B.createElement("div",{className:e.children},t?Fv(0,t.length).map(K=>{const O=Md(n,`${K}`);return B.createElement("div",{key:K},B.createElement(Mi,{schema:s,uischema:b||d,path:O,key:O,renderers:h}),B.createElement("div",{className:D},B.createElement("button",{type:"button",className:j,disabled:!v,"aria-label":m.upAriaLabel,onClick:()=>{c(n,K)()}},m.up),B.createElement("button",{type:"button",className:S,disabled:!v,"aria-label":m.downAriaLabel,onClick:()=>{u(n,K)()}},m.down),B.createElement("button",{type:"button",className:E,disabled:!v,"aria-label":m.removeAriaLabel,onClick:()=>{window.confirm("Are you sure you wish to delete this item?")&&i(n,[K])()}},m.removeTooltip)))}):B.createElement("p",null,m.noDataMessage)))},TY=({schema:e,uischema:t,data:r,path:n,rootSchema:s,uischemas:o,addItem:a,getStyle:i,getStyleAsClassName:c,removeItems:u,moveUp:d,moveDown:f,id:p,visible:h,enabled:g,errors:m,translations:v,arraySchema:y})=>{const b=t,C=qa.createLabelDescriptionFrom(b,e),w=C.show?C.text:"",_=`control ${qa.convertToValidClassName(b.scope)}`,R=c("array.layout"),z=c("array.button"),D=c("array.children"),j={wrapper:_,fieldSet:R,button:z,children:D};return B.createElement(RY,{classNames:j,data:r,label:w,path:n,schema:e,arraySchema:y,errors:m,addItem:a,removeItems:u,moveUp:d,moveDown:f,uischema:t,uischemas:o,getStyleAsClassName:c,rootSchema:s,id:p,visible:h,enabled:g,getStyle:i,translations:v})};var IY=Xt(Cx(So($x(TY))));const MY=We(4,lx),Ox=e=>e.type==="Categorization",zY=We(1,Fe(De("Categorization"),e=>{const t=r=>he(r.elements)?!1:r.elements.map(n=>Ox(n)?t(n):n.type==="Category").reduce((n,s)=>n&&s,!0);return t(e)})),OY=(e,t)=>t===e?"selected":"",Dx=({selectedCategory:e,elements:t,data:r,depth:n,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i,ajv:c,config:u})=>{const d=x.useMemo(()=>t.filter(p=>_o(p,r,void 0,c,u)),[t,r,c,u]),f=x.useMemo(()=>d.map(p=>Jb(p,i)),[d,i]);return B.createElement("ul",{className:o},d.map((p,h)=>Ox(p)?B.createElement("li",{key:f[h],className:a},B.createElement("span",null,f[h]),B.createElement(Dx,{selectedCategory:e,elements:p.elements,data:r,ajv:c,config:u,depth:n+1,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i})):B.createElement("li",{key:f[h],onClick:s(h),className:OY(p,e)},B.createElement("span",null,f[h]))))},DY=({category:e,schema:t,path:r})=>B.createElement("div",{id:"categorization.detail"},(e.elements||[]).map((n,s)=>B.createElement(Mi,{key:`${r}-${s}`,uischema:n,schema:t,path:r}))),LY=({data:e,uischema:t,schema:r,path:n,selected:s,t:o,visible:a,getStyleAsClassName:i,onChange:c,ajv:u,config:d})=>{const f=t,p=f.elements,h=i("categorization"),g=i("categorization.master"),m=i("categorization.detail"),v=i("category.subcategories"),y=i("category.group"),[b,C]=x.useState(t),[w,_]=x.useState(s??0),R=w>=f.elements.length?0:w;f!==b&&(_(0),C(f));const z=D=>()=>c?c(D,R):_(D);return B.createElement("div",{className:h,hidden:a==null?!1:!a},B.createElement("div",{className:g},B.createElement(Dx,{elements:p,selectedCategory:p[R],data:e,ajv:u,config:d,depth:0,onSelect:z,subcategoriesClassName:v,groupClassName:y,t:o})),B.createElement("div",{className:m},B.createElement(DY,{category:p[R],schema:r,path:n,key:R})))};var FY=xY(Xt(So(Ii(LY))));const BY=We(1,De("Label")),UY=({text:e,visible:t,getStyleAsClassName:r})=>{const n=r("label-control"),s=!t;return B.createElement("label",{hidden:s,className:n},e)};var WY=Xt(HG(UY));const{convertToValidClassName:VY}=qa,{or:KY,isObjectArrayControl:HY,isPrimitiveArrayControl:qY,rankWith:GY}=Eq,YY=GY(3,KY(HY,qY));class JY extends B.Component{constructor(){super(...arguments),this.confirmDelete=(t,r)=>{const n=t.substring(0,t.lastIndexOf("."));this.props.removeItems(n,[r])()}}render(){const{addItem:t,uischema:r,schema:n,rootSchema:s,path:o,data:a,visible:i,errors:c,label:u,getStyleAsClassName:d,childErrors:f,translations:p,enabled:h}=this.props,g=r,m=d("array.table.table"),v=d("array.table.label"),y=d("array.table.button"),b=d("array.table.validation"),C=[d("array.table"),VY(g.scope)].join(" "),w=z=>({type:"Control",label:!1,scope:n.type==="object"?`#/properties/${z}`:"#"}),_=c.length===0,R=[b].concat(_?"":d("array.table.validation.error")).join(" ");return B.createElement("div",{className:C,hidden:!i},B.createElement("header",null,B.createElement("label",{className:v},u),B.createElement("button",{type:"button",disabled:!h,className:y,onClick:t(o,gx(n,s))},p.addTooltip)),B.createElement("div",{className:R},_?"":c),B.createElement("table",{className:m},B.createElement("thead",null,B.createElement("tr",null,n.properties?Fm(Um,Im(z=>n.properties[z].type!=="array"),Om(z=>B.createElement("th",{key:z},n.properties[z].title??mY(z))))(n.properties):B.createElement("th",null,"Items"),B.createElement("th",null,"Valid"),B.createElement("th",null," "))),B.createElement("tbody",null,!a||!Array.isArray(a)||a.length===0?B.createElement("tr",null,B.createElement("td",null,p.noDataMessage)):a.map((z,D)=>{const j=Nl.compose(o,`${D}`),S=Wa(f,O=>Ha(O).startsWith(j)),E=d("array.validation"),P=d("array.validation.error"),K=S?[E].concat(P).join(" "):E;return B.createElement("tr",{key:j},n.properties?Fm(Um,Im(O=>n.properties[O].type!=="array"),Om(O=>{const q=Nl.compose(j,O.toString());return B.createElement("td",{key:q},B.createElement(Lc,{schema:Gt.schema(n,`#/properties/${zc(O)}`,s),uischema:w(zc(O)),path:j+"."+O}))}))(n.properties):B.createElement("td",{key:Nl.compose(j,D.toString())},B.createElement(Lc,{schema:n,uischema:w(),path:j})),B.createElement("td",null,S?B.createElement("span",{className:K},jx(S.map(O=>O.message)," and ")):B.createElement("span",{className:K},"OK")),B.createElement("td",null,B.createElement("button",{type:"button",disabled:!h,"aria-label":p.removeAriaLabel,onClick:()=>{window.confirm(p.deleteDialogMessage)&&this.confirmDelete(j,D)}},p.removeTooltip)))}))))}}var ZY=Xt(Cx(So($x(JY))));const QY=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"checkbox",checked:!!t,onChange:c=>i(a,c.target.checked),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},XY=We(2,Qb);var eJ=Qt(wY(QY));const tJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"date",value:t||"",onChange:c=>i(a,c.target.value),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},rJ=We(2,nx);var nJ=Qt(vr(tJ));const sJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e,c=u=>u===""?"":u+":00.000Z";return B.createElement("input",{type:"datetime-local",value:(t||"").substr(0,16),onChange:u=>i(a,c(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},oJ=We(2,ox);var aJ=Qt(vr(sJ));const iJ=e=>{const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:c,options:u,t:d}=e,f=x.useMemo(()=>d("enum.none",Ix["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]);return B.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:p=>c(i,p.target.selectedIndex===0?void 0:p.target.value)},[B.createElement("option",{value:"",key:"jsonforms.enum.none"},f)].concat(u.map(p=>B.createElement("option",{value:p.value,label:p.label,key:p.value}))))},lJ=We(2,tf);var cJ=UG(So(Mx(iJ)));const uJ=e=>e===""?void 0:parseInt(e,10),dJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"number",step:"1",value:t??"",onChange:c=>i(a,uJ(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},fJ=We(2,Xb);var hJ=Qt(vr(dJ));const pJ=e=>e===""?void 0:Number(e),mJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"number",step:"0.1",value:t??"",onChange:c=>i(a,pJ(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},gJ=We(2,ex);var vJ=Qt(vr(mJ));const yJ=e=>{const{className:t,id:r,enabled:n,uischema:s,path:o,handleChange:a,schema:i}=e,c=i.maxLength,u=e.toFormatted(e.data),d=f=>{const p=e.fromFormatted(f.currentTarget.value);a(o,p)};return B.createElement("input",{type:"text",value:u,onChange:d,className:t,id:r,disabled:!n,autoFocus:s.options&&s.options.focus,maxLength:s.options&&s.options.restrict?c:void 0,size:s.options&&s.options.trim?c:void 0})};Qt(vr(yJ));const bJ=e=>{var h;const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:c,options:u,t:d}=e,f=x.useMemo(()=>d("enum.none",Ix["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]),p=B.createElement("option",{value:"",key:"jsonforms.enum.none"},f);return B.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:g=>c(i,g.target.selectedIndex===0?void 0:g.target.value)},(((h=a.options)==null?void 0:h.hideEmptyOption)===!0?[]:[p]).concat(u.map(g=>B.createElement("option",{value:g.value,label:g.label,key:g.value}))))},xJ=We(2,rf);var wJ=VG(So(Mx(bJ)));const kJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,schema:a,path:i,handleChange:c}=e;return B.createElement("div",{style:{display:"flex"}},B.createElement("input",{type:"range",max:a.maximum,min:a.minimum,value:t||a.default,onChange:u=>c(i,Number(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus,style:{flex:"1"}}),B.createElement("label",{style:{marginLeft:"0.5em"}},t||a.default))},_J=We(4,cx);var CJ=Qt(vr(kJ));const $J=e=>{const{config:t,data:r,className:n,id:s,enabled:o,uischema:a,schema:i,path:c,handleChange:u}=e,d=i.maxLength,f=wo({},t,a.options);return B.createElement("input",{type:f.format==="password"?"password":"text",value:r||"",onChange:p=>u(c,p.target.value===""?void 0:p.target.value),className:n,id:s,disabled:!o,autoFocus:f.focus,placeholder:f.placeholder,maxLength:f.restrict?d:void 0,size:f.trim?d:void 0})},SJ=We(1,tx);var jJ=Qt(vr($J));const EJ=e=>{const{data:t,className:r,id:n,enabled:s,config:o,uischema:a,path:i,handleChange:c}=e,u=wo({},o,a.options);return B.createElement("textarea",{value:t||"",onChange:d=>c(i,d.target.value===""?void 0:d.target.value),className:r,id:n,disabled:!s,autoFocus:u.focus,placeholder:u.placeholder})},AJ=We(2,rx);var NJ=Qt(vr(EJ));const PJ=e=>{if(typeof e=="string"){const t=e.split(":");return t.length===2&&t.push("00"),t.join(":")}return e},RJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"time",value:t||"",onChange:c=>i(a,PJ(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},TJ=We(2,sx);var IJ=Qt(vr(RJ));const uf=(e,t,r,n,s)=>{if(he(e.elements))return[];const{renderers:o,cells:a}=$o();return e.elements.map((i,c)=>B.createElement("div",{className:r,key:`${n}-${c}`},B.createElement(Mi,{renderers:o,cells:a,uischema:i,schema:t,path:n,enabled:s})))},MJ=We(1,De("Group")),zJ=e=>{const{data:t,...r}=e;return B.createElement(OJ,{...r})},OJ=B.memo(function({schema:t,uischema:r,path:n,enabled:s,visible:o,label:a,getStyle:i,getStyleAsClassName:c}){const u=r,d=u.elements?u.elements.length:0,f=c("group.layout"),p=["group-layout-item"].concat(i("group.layout.item",d)).join(" ");return B.createElement("fieldset",{className:f,hidden:o==null?!1:!o},he(a)?"":B.createElement("legend",{className:c("group.label")},a),uf(u,t,p,n,s))});var DJ=Xt(Ii(zJ));const Lx=({className:e,children:t,visible:r})=>B.createElement("div",{className:e,hidden:r==null?!1:!r},t),LJ=We(1,De("HorizontalLayout")),FJ=e=>{const{data:t,...r}=e;return B.createElement(BJ,{...r})},BJ=B.memo(function({schema:t,uischema:r,getStyle:n,getStyleAsClassName:s,enabled:o,visible:a,path:i}){const c=r,u=c.elements?c.elements.length:0,d=s("horizontal.layout"),f=["horizontal-layout-item"].concat(n("horizontal.layout.item",u)).join(" ");return B.createElement(Lx,{className:d,visible:a,enabled:o,path:i,uischema:r,schema:t,getStyle:n,getStyleAsClassName:s},uf(c,t,f,i,o))});var UJ=Xt(Ii(FJ,!1));const WJ=We(1,De("VerticalLayout")),VJ=e=>{const{data:t,...r}=e;return B.createElement(KJ,{...r})},KJ=B.memo(function({schema:t,uischema:r,path:n,visible:s,enabled:o,getStyle:a,getStyleAsClassName:i}){const c=r,u=c.elements?c.elements.length:0,d=i("vertical.layout"),f=["vertical-layout-item"].concat(a("vertical.layout.item",u)).join(" ");return B.createElement(Lx,{className:d,uischema:r,schema:t,visible:s,enabled:o,path:n,getStyle:a,getStyleAsClassName:i},uf(c,t,f,n,o))});var HJ=Xt(Ii(VJ,!1));const qJ=[{tester:_Y,renderer:CY},{tester:SY,renderer:jY},{tester:AY,renderer:NY},{tester:MY,renderer:IY},{tester:BY,renderer:WY},{tester:zY,renderer:FY},{tester:YY,renderer:ZY},{tester:MJ,renderer:DJ},{tester:WJ,renderer:HJ},{tester:LJ,renderer:UJ}],GJ=[{tester:XY,cell:eJ},{tester:rJ,cell:nJ},{tester:oJ,cell:aJ},{tester:lJ,cell:cJ},{tester:fJ,cell:hJ},{tester:gJ,cell:vJ},{tester:xJ,cell:wJ},{tester:_J,cell:CJ},{tester:AJ,cell:NJ},{tester:SJ,cell:jJ},{tester:TJ,cell:IJ}];function YJ(e,t){return e.split(".").reduce((r,n)=>{if(r!=null&&typeof r=="object"&&!Array.isArray(r))return r[n]},t)}function JJ(e,t){return e.replace(/\$\{([^}]+)\}/g,(r,n)=>{const s=YJ(n.trim(),t);return s==null?"":String(s)})}function Fx(e,t){return typeof e=="string"?JJ(e,t):Array.isArray(e)?e.map(r=>Fx(r,t)):e!==null&&typeof e=="object"?Bx(e,t):e}function Bx(e,t){const r={};for(const[n,s]of Object.entries(e))r[n]=Fx(s,t);return r}function ZJ(e,t){return{id:e.id,boardId:t,status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,content:e.content,actions:e.actions,forms:e.forms,formData:e.formData,metadata:e.metadata}}let Dl=null;function df(){return Dl||(Dl=acquireVsCodeApi()),Dl}const QJ=df(),Ux=Db({allErrors:!0,strict:!1});function ar(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Jr(e){return e?{...e}:{}}function XJ(e){return ar(e.properties)?new Set(Object.keys(e.properties)):new Set}function eZ(e,t){if(!ar(e.metadata))return{};const r=XJ(t);return r.size===0?{}:Object.fromEntries(Object.entries(e.metadata).filter(([n])=>r.has(n)))}function tZ(e,t){return typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():t}function rZ(e,t){return typeof(t==null?void 0:t.name)=="string"&&t.name.trim().length>0?t.name.trim():t0(e)}function nZ(e){return typeof(e==null?void 0:e.description)=="string"?e.description.trim():""}function sZ(){const e=new Set;return(t,r,n)=>{const o=(typeof(r==null?void 0:r.title)=="string"&&r.title.trim().length>0?r.title.trim():`form-${n}`).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50),a=t??(o||`form-${n}`);let i=a,c=2;for(;e.has(i);)i=`${a}-${c++}`;return e.add(i),i}}function oZ(e,t){const r=e.forms??[],n=(t==null?void 0:t.forms)??{},s=sZ(),o=ZJ(e,e.boardId??(t==null?void 0:t.id)??"");return r.flatMap((a,i)=>{var g;const c=a.name?n[a.name]:void 0,u=ar(a.schema)?a.schema:ar(c==null?void 0:c.schema)?c.schema:void 0;if(!u)return[];const d=s(a.name,u,i),f=a.name?rZ(a.name,c):tZ(u,t0(d)),p=a.name?nZ(c):"",h={...Jr(c==null?void 0:c.data),...Jr(ar(a.data)?a.data:void 0),...Jr((g=e.formData)==null?void 0:g[d])};return[{id:d,name:f,description:p,label:f,schema:u,...ar(a.ui)?{ui:a.ui}:ar(c==null?void 0:c.ui)?{ui:c.ui}:{},initialData:{...Bx(h,o),...eZ(e,u)},fromConfig:!!(a.name&&c)}]})}function Zo(e,t){const r=Ux.compile(e);return r(t)?[]:r.errors??[]}function aZ(e){var s;const r=(typeof((s=e.params)==null?void 0:s.missingProperty)=="string"?e.params.missingProperty:"")||e.instancePath||"/",n=e.message||"is invalid";return`${r} ${n}`.trim()}function iZ(e,t,r){return(r==null?void 0:r.formId)===e&&r.dataSignature===t}function lZ({cardId:e,boardId:t,form:r,className:n,onSubmitted:s}){const o=x.useMemo(()=>JSON.stringify(r.initialData),[r.initialData]),[a,i]=x.useState(()=>Jr(r.initialData)),[c,u]=x.useState(()=>Zo(r.schema,Jr(r.initialData))),[d,f]=x.useState(!1),[p,h]=x.useState(null),[g,m]=x.useState(null),v=x.useRef(null),y=x.useRef(null);x.useEffect(()=>{const w=Jr(r.initialData);i(w),u(Zo(r.schema,w)),h(null),m(_=>iZ(r.id,o,y.current)?_??`Saved ${r.name}`:null)},[r.id,r.name,r.schema,r.initialData,o]),x.useEffect(()=>()=>{v.current&&(window.removeEventListener("message",v.current),v.current=null)},[]);const b=async()=>{var R,z;const w=Zo(r.schema,a);if(u(w),h(null),m(null),w.length>0||d)return;const _=`submit-form-${e}-${r.id}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;f(!0);try{const D=await new Promise((E,P)=>{const K=O=>{const q=O.data;if(!(!q||q.type!=="submitFormResult"||q.callbackKey!==_)){if(window.removeEventListener("message",K),v.current=null,q.error){P(new Error(q.error));return}if(!q.result){P(new Error("Form submission failed without a result payload"));return}E(q.result)}};v.current=K,window.addEventListener("message",K),QJ.postMessage({type:"submitForm",cardId:e,formId:r.id,data:a,callbackKey:_,...t?{boardId:t}:{}})}),j=ar((R=D.card.formData)==null?void 0:R[r.id])?(z=D.card.formData)==null?void 0:z[r.id]:D.data,S=Jr(j);y.current={formId:r.id,dataSignature:JSON.stringify(S)},i(S),u(Zo(r.schema,S)),m(`Saved ${r.name}`),s==null||s(D)}catch(D){y.current=null,h(D instanceof Error?D.message:String(D))}finally{f(!1)}},C=c.length>0;return l.jsxs("div",{className:Ee("flex h-full flex-col",n),children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"truncate text-sm font-semibold",style:{color:"var(--vscode-foreground)"},children:r.name}),r.fromConfig&&l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:"Shared"})]}),r.description&&l.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:r.description}),C&&l.jsx("p",{className:"mt-1 text-xs font-medium",style:{color:"var(--vscode-errorForeground)"},children:`Fix ${c.length} validation error${c.length===1?"":"s"} before submitting.`})]}),l.jsx("button",{type:"button",onClick:b,disabled:C||d,className:"rounded px-3 py-1.5 text-xs font-medium transition-opacity disabled:cursor-not-allowed disabled:opacity-50",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:C?"Resolve validation errors before submitting":void 0,children:d?"Submitting…":"Submit"})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[l.jsx("div",{className:"card-jsonforms p-4",children:l.jsx(YG,{schema:r.schema,uischema:r.ui,data:a,renderers:qJ,cells:GJ,ajv:Ux,validationMode:"ValidateAndShow",onChange:({data:w,errors:_})=>{const R=ar(w)?w:{};y.current=null,i(R),u(_??[]),h(null),m(null)}})}),(p||g||C)&&l.jsxs("div",{className:"space-y-2 px-4 pb-4",children:[p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-errorForeground) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-errorForeground) 40%, transparent)",color:"var(--vscode-errorForeground)"},children:p}),g&&!p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-testing-iconPassed) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-testing-iconPassed) 40%, transparent)",color:"var(--vscode-testing-iconPassed)"},children:g}),C&&l.jsxs("div",{className:"rounded px-3 py-2",style:{background:"var(--vscode-inputValidation-warningBackground, color-mix(in srgb, var(--vscode-editorWarning-foreground, #d7ba7d) 10%, transparent))",border:"1px solid var(--vscode-inputValidation-warningBorder, var(--vscode-editorWarning-foreground, #d7ba7d))"},children:[l.jsx("p",{className:"mb-2 text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:"Validation issues"}),l.jsx("ul",{className:"space-y-1 pl-4 text-xs",style:{color:"var(--vscode-foreground)"},children:c.map((w,_)=>l.jsx("li",{className:"list-disc",children:aZ(w)},`${w.instancePath??"/"}-${w.message??"invalid"}-${_}`))})]})]})]})]})}function Wx({value:e,onChange:t,placeholder:r="Write markdown...",className:n,autoFocus:s,mode:o="create",comments:a,onAddComment:i,onUpdateComment:c,onDeleteComment:u,logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h,cardId:g,frontmatter:m,onFormSubmitSuccess:v}){const y=o==="edit",b=y?"Edit":"Write",C=G(L=>L.activeCardTab),w=G(L=>L.setActiveCardTab),_=G(L=>L.boards),R=G(L=>L.currentBoard),[z,D]=x.useState("write"),j=y?C:z,S=L=>{y?w(L):D(L)},E=x.useRef(null),P=x.useMemo(()=>_.find(L=>L.id===R),[_,R]),K=x.useMemo(()=>y&&m?oZ({...m,content:e},P):[],[P,m,y,e]),O=x.useMemo(()=>e.trim()?Ae.parse(e,{async:!1,gfm:!0,breaks:!0}):"",[e]);x.useEffect(()=>{j==="write"&&E.current&&E.current.focus()},[j]),x.useEffect(()=>{s&&E.current&&E.current.focus()},[s]);const q=x.useCallback(L=>{E.current&&C0(E.current,e,t,L)},[e,t]),V=L=>{if(L.key==="Tab"){L.preventDefault();const U=L.currentTarget,oe=U.selectionStart,Y=U.selectionEnd,N=e.substring(0,oe)+" "+e.substring(Y);t(N),requestAnimationFrame(()=>{U.selectionStart=U.selectionEnd=oe+2})}(L.metaKey||L.ctrlKey)&&L.key==="b"&&(L.preventDefault(),L.stopPropagation(),q("bold")),(L.metaKey||L.ctrlKey)&&L.key==="i"&&(L.preventDefault(),q("italic")),(L.metaKey||L.ctrlKey)&&L.key==="k"&&(L.preventDefault(),q("link"))};return l.jsxs("div",{className:Ee("card-markdown-shell h-full",n),children:[l.jsxs("div",{className:"card-markdown-header shrink-0",children:[l.jsxs("div",{className:"card-markdown-tabs",children:[(y?["preview","write"]:["write","preview"]).map(L=>l.jsx("button",{type:"button",onClick:()=>S(L),className:Ee("card-markdown-tab",j===L&&"is-active"),children:L==="write"?b:"Preview"},L)),K.map(L=>{const U=ac(L.id);return l.jsx("button",{type:"button",onClick:()=>S(U),className:Ee("card-markdown-tab",j===U&&"is-active"),children:`form: ${L.name}`},U)}),a&&l.jsxs("button",{type:"button",onClick:()=>S("comments"),className:Ee("card-markdown-tab",j==="comments"&&"is-active"),children:[l.jsx(h1,{size:12}),"Comments",a.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:a.length})]}),d&&l.jsxs("button",{type:"button",onClick:()=>S("logs"),className:Ee("card-markdown-tab",j==="logs"&&"is-active"),children:[l.jsx(ig,{size:12}),"Logs",d.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d.length})]})]}),j==="write"&&l.jsxs("div",{className:"card-markdown-toolbar",children:[l.jsx(rt,{icon:l.jsx(p1,{size:14}),title:"Heading",onClick:()=>q("heading")}),l.jsx(rt,{icon:l.jsx(eg,{size:14}),title:"Bold (⌘B)",onClick:()=>q("bold")}),l.jsx(rt,{icon:l.jsx(tg,{size:14}),title:"Italic (⌘I)",onClick:()=>q("italic")}),l.jsx(rt,{icon:l.jsx(rg,{size:14}),title:"Quote",onClick:()=>q("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(ng,{size:14}),title:"Code",onClick:()=>q("code")}),l.jsx(rt,{icon:l.jsx(sg,{size:14}),title:"Link (⌘K)",onClick:()=>q("link")}),l.jsx(rt,{icon:l.jsx(og,{size:14}),title:"Bulleted list",onClick:()=>q("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(ag,{size:14}),title:"Numbered list",onClick:()=>q("ol")}),l.jsx(rt,{icon:l.jsx(m1,{size:14}),title:"Task list",onClick:()=>q("tasklist")})]})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[j==="write"&&l.jsx("textarea",{ref:E,value:e,onChange:L=>t(L.target.value),onKeyDown:V,placeholder:r,className:"markdown-editor-textarea",spellCheck:!1}),j==="preview"&&l.jsx("div",{className:"min-h-[200px]",children:O?l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:O}}):l.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),K.map(L=>{const U=ac(L.id);return g?l.jsx("div",{className:Ee("h-full",j===U?"block":"hidden"),children:l.jsx(lZ,{cardId:g,boardId:P==null?void 0:P.id,form:L,onSubmitted:v})},U):null}),j==="comments"&&a&&i&&c&&u&&l.jsx(rS,{comments:a,onAddComment:i,onUpdateComment:c,onDeleteComment:u}),j==="logs"&&d&&f&&l.jsx(B0,{logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h})]})]})}function Qa({panelMode:e,onPreview:t,onCommit:r,onCancel:n}){const s=x.useRef(null),o=x.useRef(t),a=x.useRef(r),i=x.useRef(n);return o.current=t,a.current=r,i.current=n,x.useEffect(()=>{if(typeof window>"u")return;const c=sC({eventTarget:window,getPanelMode:()=>e,getViewportWidth:()=>window.innerWidth,onPreview:u=>o.current(u),onCommit:u=>a.current(u),onCancel:()=>i.current()});return s.current=c,()=>{c.dispose(),s.current=null}},[e]),e!=="drawer"?null:l.jsx("button",{type:"button","aria-label":"Resize drawer",title:"Drag to resize drawer","data-panel-resize-handle":"",className:"absolute inset-y-0 left-0 z-10 w-3 cursor-ew-resize touch-none pointer-events-auto",onPointerDown:c=>{var u,d,f;c.preventDefault(),(d=(u=c.currentTarget).setPointerCapture)==null||d.call(u,c.pointerId),(f=s.current)==null||f.start({clientX:c.clientX})},children:l.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-0 left-1/2 w-px -translate-x-1/2",style:{background:"var(--vscode-panel-border)"}})})}const cZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}];function Wm({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ee("relative",n),children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{type:"button",onClick:()=>{r(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:c=>{i.value!==e&&(c.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:c=>{i.value!==e&&(c.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(St,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function uZ({value:e,onChange:t}){const[r,n]=x.useState(!1),s=x.useRef(null),o=x.useRef(null),a=G(f=>f.cards),i=x.useMemo(()=>{const f=new Set;return a.forEach(p=>{p.assignee&&f.add(p.assignee)}),Array.from(f).sort()},[a]),c=x.useMemo(()=>e.trim()?i.filter(f=>f.toLowerCase().includes(e.toLowerCase())&&f!==e):i,[e,i]),u=r&&c.length>0,d=e.trim()?e.trim().split(/\s+/).map(f=>f[0]).join("").toUpperCase().slice(0,2):null;return l.jsxs("div",{ref:o,className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var f;return(f=s.current)==null?void 0:f.focus()},children:[d&&l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d}),l.jsx("input",{ref:s,type:"text",value:e,onChange:f=>t(f.target.value),onFocus:()=>n(!0),onBlur:()=>setTimeout(()=>n(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),u&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:c.map(f=>l.jsxs("button",{type:"button",onMouseDown:p=>{p.preventDefault(),t(f)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:p=>p.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:f.split(/\s+/).map(p=>p[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:f})]},f))})]})}function dZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=G(h=>h.cards),c=G(h=>h.labelDefs),u=x.useMemo(()=>{const h=new Set;return i.forEach(g=>g.labels.forEach(m=>h.add(m))),Array.from(h).sort()},[i]),d=x.useMemo(()=>{const h=u.filter(g=>!e.includes(g));return r.trim()?h.filter(g=>g.toLowerCase().includes(r.toLowerCase())):h},[r,u,e]),f=s&&d.length>0,p=h=>{const g=(h||r).trim();g&&!e.includes(g)&&t([...e,g]),n("")};return l.jsxs("div",{className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var h;return(h=a.current)==null?void 0:h.focus()},children:[e.map(h=>{const g=c[h];return l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[h,l.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),t(e.filter(v=>v!==h))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},h)}),l.jsx("input",{ref:a,type:"text",value:r,onChange:h=>n(h.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:h=>{var g;h.key==="Enter"&&(h.preventDefault(),p()),h.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),h.key==="Escape"&&(n(""),(g=a.current)==null||g.blur())},placeholder:e.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),f&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:d.map(h=>{const g=c[h];return l.jsx("button",{type:"button",onMouseDown:m=>{m.preventDefault(),p(h)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:l.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:h})},h)})})]})}function fZ({actions:e,onChange:t}){const[r,n]=x.useState(""),s=x.useRef(null),o=a=>{const i=r.trim();i&&!e.includes(i)&&t([...e,i]),n("")};return l.jsx("div",{className:"relative flex-1",children:l.jsxs("label",{className:"flex items-center gap-1.5 flex-wrap cursor-text",children:[e.map(a=>l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[a,l.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),t(e.filter(c=>c!==a))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},a)),l.jsx("input",{ref:s,type:"text",value:r,onChange:a=>n(a.target.value),onKeyDown:a=>{var i;(a.key==="Enter"||a.key===",")&&(a.preventDefault(),o()),a.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),a.key==="Escape"&&(n(""),(i=s.current)==null||i.blur())},placeholder:e.length===0?"Add actions...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]})})}function $n({label:e,icon:t,children:r}){return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:n=>n.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[l.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function hZ({isOpen:e,...t}){return e?l.jsx(pZ,{isOpen:e,...t}):null}function pZ({isOpen:e,onClose:t,onCreate:r,onSaveSettings:n,initialStatus:s}){const o=G(V=>V.cardSettings),a=G(V=>V.effectiveDrawerWidth),i=G(V=>V.setDrawerWidthPreview),c=G(V=>V.clearDrawerWidthPreview),u=G(V=>V.setCardSettings),d=G(V=>V.columns),f=x.useMemo(()=>d.filter(V=>V.id!==Gn).map(V=>({value:V.id,label:V.name,dotColor:V.color})),[d]),[p,h]=x.useState(""),[g,m]=x.useState(s??o.defaultStatus),[v,y]=x.useState(o.defaultPriority),[b,C]=x.useState(""),[w,_]=x.useState(""),[R,z]=x.useState([]),[D,j]=x.useState([]),[S,E]=x.useState(""),P=x.useRef(null);x.useEffect(()=>{const V=setTimeout(()=>{var L;return(L=P.current)==null?void 0:L.focus()},50);return()=>clearTimeout(V)},[]);const K=()=>{const V=S.trim(),L=p.trim(),U=L?`# ${L}${V?`
129
+ `)}var _V=kV,CV=Ov;function $V(e,t){var r=e==null?0:e.length;return!!r&&CV(e,t,0)>-1}var SV=$V,jV=kd,EV=SV,AV=1,NV=2,PV=8,RV=16,TV=32,IV=64,MV=128,zV=256,OV=512,DV=[["ary",MV],["bind",AV],["bindKey",NV],["curry",PV],["curryRight",RV],["flip",OV],["partial",TV],["partialRight",IV],["rearg",zV]];function LV(e,t){return jV(DV,function(r){var n="_."+r[0];t&r[1]&&!EV(e,n)&&e.push(n)}),e.sort()}var FV=LV,BV=xV,UV=_V,WV=wd,VV=FV;function KV(e,t,r){var n=t+"";return WV(e,UV(n,VV(BV(n),r)))}var hb=KV,HV=db(),GV=fb,qV=hb,YV=4,JV=8,Qp=32,Xp=64;function ZV(e,t,r,n,s,o,a,i,c,u){var d=t&JV,f=d?a:void 0,p=d?void 0:a,h=d?o:void 0,g=d?void 0:o;t|=d?Qp:Xp,t&=~(d?Xp:Qp),t&YV||(t&=-4);var m=[e,t,s,h,f,g,p,i,c,u],v=r.apply(void 0,m);return HV(e)&&GV(v,m),v.placeholder=n,qV(v,e,t)}var pb=ZV;function QV(e){var t=e;return t.placeholder}var mb=QV,XV=yo,e8=fo,t8=Math.min;function r8(e,t){for(var r=e.length,n=t8(t.length,r),s=XV(e);n--;){var o=t[n];e[n]=e8(o,r)?s[o]:void 0}return e}var n8=r8,em="__lodash_placeholder__";function s8(e,t){for(var r=-1,n=e.length,s=0,o=[];++r<n;){var a=e[r];(a===t||a===em)&&(e[r]=em,o[s++]=r)}return o}var Ed=s8,o8=lb,a8=cb,i8=cV,tm=Ai,l8=pb,c8=mb,u8=n8,d8=Ed,f8=ut,h8=1,p8=2,m8=8,g8=16,v8=128,y8=512;function gb(e,t,r,n,s,o,a,i,c,u){var d=t&v8,f=t&h8,p=t&p8,h=t&(m8|g8),g=t&y8,m=p?void 0:tm(e);function v(){for(var y=arguments.length,b=Array(y),C=y;C--;)b[C]=arguments[C];if(h)var w=c8(v),_=i8(b,w);if(n&&(b=o8(b,n,s,h)),o&&(b=a8(b,o,a,h)),y-=_,h&&y<u){var R=d8(b,w);return l8(e,t,gb,v.placeholder,r,b,R,i,c,u-y)}var z=f?r:this,D=p?z[e]:e;return y=b.length,i?b=u8(b,i):g&&y>1&&b.reverse(),d&&c<y&&(b.length=c),this&&this!==f8&&this instanceof v&&(D=m||tm(D)),D.apply(z,b)}return v}var vb=gb,b8=xd,x8=Ai,w8=vb,k8=pb,_8=mb,C8=Ed,$8=ut;function S8(e,t,r){var n=x8(e);function s(){for(var o=arguments.length,a=Array(o),i=o,c=_8(s);i--;)a[i]=arguments[i];var u=o<3&&a[0]!==c&&a[o-1]!==c?[]:C8(a,c);if(o-=u.length,o<r)return k8(e,t,w8,s.placeholder,void 0,a,u,void 0,void 0,r-o);var d=this&&this!==$8&&this instanceof s?n:e;return b8(d,this,a)}return s}var j8=S8,E8=xd,A8=Ai,N8=ut,P8=1;function R8(e,t,r,n){var s=t&P8,o=A8(e);function a(){for(var i=-1,c=arguments.length,u=-1,d=n.length,f=Array(d+c),p=this&&this!==N8&&this instanceof a?o:e;++u<d;)f[u]=n[u];for(;c--;)f[u++]=arguments[++i];return E8(p,s?r:this,f)}return a}var T8=R8,I8=lb,M8=cb,rm=Ed,nm="__lodash_placeholder__",xl=1,z8=2,O8=4,sm=8,Es=128,om=256,D8=Math.min;function L8(e,t){var r=e[1],n=t[1],s=r|n,o=s<(xl|z8|Es),a=n==Es&&r==sm||n==Es&&r==om&&e[7].length<=t[8]||n==(Es|om)&&t[7].length<=t[8]&&r==sm;if(!(o||a))return e;n&xl&&(e[2]=t[2],s|=r&xl?0:O8);var i=t[3];if(i){var c=e[3];e[3]=c?I8(c,i,t[4]):i,e[4]=c?rm(e[3],nm):t[4]}return i=t[5],i&&(c=e[5],e[5]=c?M8(c,i,t[6]):i,e[6]=c?rm(e[5],nm):t[6]),i=t[7],i&&(e[7]=i),n&Es&&(e[8]=e[8]==null?t[8]:D8(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=s,e}var F8=L8,B8=ib,U8=nV,W8=j8,V8=vb,K8=T8,H8=Sd(),G8=F8,q8=fb,Y8=hb,am=po,J8="Expected a function",im=1,Z8=2,lm=8,cm=16,um=32,Q8=64,dm=Math.max;function X8(e,t,r,n,s,o,a,i){var c=t&Z8;if(!c&&typeof e!="function")throw new TypeError(J8);var u=n?n.length:0;if(u||(t&=-97,n=s=void 0),a=a===void 0?a:dm(am(a),0),i=i===void 0?i:am(i),u-=s?s.length:0,t&Q8){var d=n,f=s;n=s=void 0}var p=c?void 0:H8(e),h=[e,t,r,n,s,d,f,o,a,i];if(p&&G8(h,p),e=h[0],t=h[1],r=h[2],n=h[3],s=h[4],i=h[9]=h[9]===void 0?c?0:e.length:dm(h[9]-u,0),!i&&t&(lm|cm)&&(t&=-25),!t||t==im)var g=U8(e,t,r);else t==lm||t==cm?g=W8(e,t,i):(t==um||t==(im|um))&&!s.length?g=K8(e,t,r,n):g=V8.apply(void 0,h);var m=p?B8:q8;return Y8(m(g,h),e,t)}var Ad=X8,e7=Ad,t7=128;function r7(e,t,r){return t=r?void 0:t,t=e&&t==null?e.length:t,e7(e,t7,void 0,void 0,void 0,void 0,t)}var n7=r7,s7=_d,o7=4;function a7(e){return s7(e,o7)}var i7=a7,l7=Ad,c7=8;function Nd(e,t,r){t=r?void 0:t;var n=l7(e,c7,void 0,void 0,void 0,void 0,void 0,t);return n.placeholder=Nd.placeholder,n}Nd.placeholder={};var u7=Nd,d7=Ir,f7=bt,h7=Yy,p7="[object DOMException]",m7="[object Error]";function g7(e){if(!f7(e))return!1;var t=d7(e);return t==m7||t==p7||typeof e.message=="string"&&typeof e.name=="string"&&!h7(e)}var v7=g7,y7=un,b7=bt,x7="[object WeakMap]";function w7(e){return b7(e)&&y7(e)==x7}var k7=w7,_7=_d,C7=fn,$7=1;function S7(e){return C7(typeof e=="function"?e:_7(e,$7))}var j7=S7,fm=Jn,E7=co,A7=Ue,hm=fm?fm.isConcatSpreadable:void 0;function N7(e){return A7(e)||E7(e)||!!(hm&&e&&e[hm])}var P7=N7,R7=mu,T7=P7;function yb(e,t,r,n,s){var o=-1,a=e.length;for(r||(r=T7),s||(s=[]);++o<a;){var i=e[o];t>0&&r(i)?t>1?yb(i,t-1,r,n,s):R7(s,i):n||(s[s.length]=i)}return s}var I7=yb,M7=I7;function z7(e){var t=e==null?0:e.length;return t?M7(e,1):[]}var O7=z7,D7=O7,L7=Qy,F7=wd;function B7(e){return F7(L7(e,void 0,D7),e+"")}var bb=B7,U7=Ad,W7=bb,V7=256,K7=W7(function(e,t){return U7(e,V7,void 0,void 0,void 0,t)}),H7=K7,G7=ho,q7=yo,Y7=Ue,J7=Zn,Z7=rv,Q7=dn,X7=ns;function eK(e){return Y7(e)?G7(e,Q7):J7(e)?[e]:q7(Z7(X7(e)))}var tK=eK,rK={ary:n7,assign:eb,clone:i7,curry:u7,forEach:kd,isArray:Ue,isError:v7,isFunction:lo,isWeakMap:k7,iteratee:j7,keys:xu,rearg:H7,toInteger:po,toPath:tK},nK=GW,sK=rK;function oK(e,t,r){return nK(sK,e,t,r)}var hn=oK,wl,pm;function aK(){if(pm)return wl;pm=1;var e=bd,t=bi,r=fo,n=xt,s=dn;function o(a,i,c,u){if(!n(a))return a;i=t(i,a);for(var d=-1,f=i.length,p=f-1,h=a;h!=null&&++d<f;){var g=s(i[d]),m=c;if(g==="__proto__"||g==="constructor"||g==="prototype")return a;if(d!=p){var v=h[g];m=u?u(v,g,h):void 0,m===void 0&&(m=n(v)?v:r(i[d+1])?[]:{})}e(h,g,m),h=h[g]}return a}return wl=o,wl}var kl,mm;function iK(){if(mm)return kl;mm=1;var e=aK();function t(r,n,s){return r==null?r:e(r,n,s)}return kl=t,kl}var lK=hn,xb=lK("set",iK());xb.placeholder=Mr();var cK=xb;const uK=Se(cK);function dK(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var wb=dK;const fK=Se(wb);var hK=Cu,pK=wv;function mK(e,t){return t.length<2?e:hK(e,pK(t,0,-1))}var gK=mK,vK=bi,yK=wb,bK=gK,xK=dn,wK=Object.prototype,kK=wK.hasOwnProperty;function _K(e,t){t=vK(t,e);var r=-1,n=t.length;if(!n)return!0;for(var s=e==null||typeof e!="object"&&typeof e!="function";++r<n;){var o=t[r];if(typeof o=="string"){if(o==="__proto__"&&!kK.call(e,"__proto__"))return!1;if(o==="constructor"&&r+1<n&&typeof t[r+1]=="string"&&t[r+1]==="prototype"){if(s&&r===0)continue;return!1}}}var a=bK(e,t);return a==null||delete a[xK(yK(t))]}var CK=_K,_l,gm;function $K(){if(gm)return _l;gm=1;var e=CK;function t(r,n){return r==null?!0:e(r,n)}return _l=t,_l}var SK=hn,kb=SK("unset",$K());kb.placeholder=Mr();var jK=kb;const EK=Se(jK);function AK(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}var NK=AK,PK=NK,RK=sv,TK=po,IK=ns;function MK(e,t,r){e=IK(e),t=RK(t);var n=e.length;r=r===void 0?n:PK(TK(r),0,n);var s=r;return r-=t.length,r>=0&&e.slice(r,s)==t}var zK=MK;const OK=Se(zK);function DK(e,t,r,n,s){return s(e,function(o,a,i){r=n?(n=!1,o):t(r,o,a,i)}),r}var LK=DK,FK=iv,BK=md,UK=fn,WK=LK,VK=Ue;function KK(e,t,r){var n=VK(e)?FK:WK,s=arguments.length<3;return n(e,UK(t),r,s,BK)}var HK=KK;const Rc=Se(HK);var GK=ho;function qK(e,t){return GK(t,function(r){return[r,e[r]]})}var YK=qK;function JK(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=[n,n]}),r}var ZK=JK,QK=YK,XK=un,eH=B0,tH=ZK,rH="[object Map]",nH="[object Set]";function sH(e){return function(t){var r=XK(t);return r==rH?eH(t):r==nH?tH(t):QK(t,e(t))}}var oH=sH,aH=oH,iH=Jt,lH=aH(iH),cH=lH;const uH=Se(cH);function dH(e){return e===void 0}var fH=dH;const hH=Se(fH),da="additionalProperties",fa="required",pH=(e,t)=>{const r={};return e.filter(n=>{const s=t(n);return Object.prototype.hasOwnProperty.call(r,s)?!1:(r[s]=!0,!0)})};class mH{constructor(t){this.findOption=t,this.schemaObject=r=>{const n=this.properties(r),s={type:"object",properties:n,additionalProperties:this.findOption(n)(da)},o=this.findOption(n)(fa);return o.length>0&&(s.required=o),s},this.properties=r=>{const n={};return Object.keys(r).reduce((s,o)=>(s[o]=this.property(r[o]),s),n)},this.property=r=>{switch(typeof r){case"string":return{type:"string"};case"boolean":return{type:"boolean"};case"number":return Number.isInteger(r)?{type:"integer"}:{type:"number"};case"object":return r==null?{type:"null"}:this.schemaObjectOrArray(r);default:return{}}},this.schemaObjectOrArray=r=>r instanceof Array?this.schemaArray(r):this.schemaObject(r),this.schemaArray=r=>{if(r.length>0){const n=r.map(this.property),s=pH(n,o=>JSON.stringify(o));return s.length===1?{type:"array",items:s[0]}:{type:"array",items:{oneOf:s}}}else return{type:"array",items:{}}}}}const _b=(e,t={})=>{const r=s=>o=>{switch(o){case da:return Object.prototype.hasOwnProperty.call(t,da)?t[da]:!0;case fa:return Object.prototype.hasOwnProperty.call(t,fa)?t[fa](s):Object.keys(s);default:return}};return new mH(r).schemaObject(e)},Pd=new Set,Cb=(e,t)=>t<=1?e:e+t.toString(),gH=(e,t)=>{const r=Cb(e,t);return!Pd.has(r)},vm=e=>{e===void 0&&(e="undefined");let t=0;for(;!gH(e,t);)t++;const r=Cb(e,t);return Pd.add(r),r},ym=e=>Pd.delete(e),Rd=(e,t)=>{let r=e;return!he(e)&&!he(t)&&!t.startsWith("[")&&(r=e+"."),he(r)?t:he(t)?r:`${r}${t}`},$b=e=>{const n=e.replace(/(anyOf|allOf|oneOf)\/[\d]+\//g,"").replace(/(then|else)\//g,"").split("/").map(ko),o=n[0]==="#"||n[0]===""?2:1;return Iv(o,n.length,2).map(a=>n[a])},Tc=e=>e==null?void 0:e.replace(/~/g,"~0").replace(/\//g,"~1"),ko=e=>e==null?void 0:e.replace(/~1/g,"/").replace(/~0/,"~"),Cl=(e,t)=>{if(t&&typeof t.title=="string")return t.title;if(typeof e.scope=="string"){const r=e.scope,n=ko(r.substr(r.lastIndexOf("/")+1));return Nv(n)}return""},Sb=(e,t)=>{const r=e.label;if(typeof r=="boolean")return Jo(Cl(e,t),r);if(typeof r=="string")return Jo(r,!0);if(typeof r=="object"){const n=typeof r.text=="string"?r.text:Cl(e,t),s=typeof r.show=="boolean"?r.show:!0;return Jo(n,s)}return Jo(Cl(e,t),!0)},Jo=(e,t)=>({text:e,show:t}),ha=(e,t)=>he(t)?e:t.split(".").reduce((n,s)=>{if(!(!n||!Object.prototype.hasOwnProperty.call(n,s)))return n[s]},e),vH=e=>e==="#"||e===void 0||e==="",zt=(e,t,r)=>Td(e,t,{rootSchema:r,resolutionMap:new Map}),Td=(e,t,r)=>{let n;if(e&&typeof e.$ref=="string"){const s=$l(r.rootSchema,e.$ref,r);s!==void 0&&(n=$l(s,t,r))}return n===void 0&&(n=$l(e,t,r)),n},$l=(e,t,r)=>{let n=r.resolutionMap.get(e);if(n||(n=new Set,r.resolutionMap.set(e,n)),n.has(t))return;n.add(t);const s=Id(e,t==null?void 0:t.split("/").map(ko),r);return n.delete(t),s},Id=(e,t,r)=>{if(!t||t.length===0)return e;if(he(e))return;const n=yH(e,t,r);if(n!==void 0)return n;const s=[].concat(e.oneOf??[],e.allOf??[],e.anyOf??[],e.then??[],e.else??[]);for(const o of s){let a=o;o&&typeof o.$ref=="string"&&(a=Td(r.rootSchema,o.$ref,r));const i=Id(a,t,r);if(i)return i}},yH=(e,t,r)=>{if(!t||t.length===0)return e;if(he(e))return;const n=jb(e,t);return n.schema&&typeof n.schema.$ref=="string"&&(n.schema=Td(r.rootSchema,n.schema.$ref,r)),Id(n.schema,n.remainingPathSegments,r)},jb=(e,t)=>{if(!t||t.length===0)return{schema:e,remainingPathSegments:[]};if(he(e))return{schema:void 0,remainingPathSegments:t};const[r,...n]=t;return vH(r)?jb(e,n):{schema:Qe(e,r),remainingPathSegments:n,resolvedSegment:r}};var Gt;(function(e){e.HIDE="HIDE",e.SHOW="SHOW",e.ENABLE="ENABLE",e.DISABLE="DISABLE"})(Gt||(Gt={}));const Eb=(e,t)=>{if(!kH(e))return t??"";const r=$b(e.scope);return he(r)?t??"":Rd(t,r.join("."))},Ab=e=>typeof e=="object"&&e!==null&&typeof e.i18n=="string",bH=e=>e.type==="Group",xH=e=>e.elements!==void 0,wH=e=>!!e&&typeof e=="object",kH=e=>wH(e)&&typeof e.scope=="string",_H=e=>!!e&&typeof e=="object",CH=e=>e.type==="OR",$H=e=>e.type==="AND",SH=e=>e.type==="LEAF",jH=e=>Mv(e,"schema"),EH=e=>Mv(e,"validate")&&typeof e.validate=="function",Sl=(e,t)=>Eb(e,t),Ic=(e,t,r,n,s,o)=>{if($H(r))return r.conditions.reduce((a,i)=>a&&Ic(e,t,i,n,s,o),!0);if(CH(r))return r.conditions.reduce((a,i)=>a||Ic(e,t,i,n,s,o),!1);if(SH(r))return ha(e,Sl(r,n))===r.expectedValue;if(jH(r)){const a=ha(e,Sl(r,n));return r.failWhenUndefined&&a===void 0?!1:s.validate(r.schema,a)}else if(EH(r)){const i={data:ha(e,Sl(r,n)),fullData:e,path:n,uischemaElement:t,config:o};return r.validate(i)}else return!0},Nb=(e,t,r,n,s)=>{const o=e.rule.condition;return Ic(t,e,o,r,n,s)},AH=(e,t,r=void 0,n,s)=>{const o=Nb(e,t,r,n,s);switch(e.rule.effect){case Gt.HIDE:return!o;case Gt.SHOW:return o;default:return!0}},NH=(e,t,r=void 0,n,s)=>{const o=Nb(e,t,r,n,s);switch(e.rule.effect){case Gt.DISABLE:return!o;case Gt.ENABLE:return o;default:return!0}},Md=e=>!!(e.rule&&(e.rule.effect===Gt.SHOW||e.rule.effect===Gt.HIDE)),PH=e=>!!(e.rule&&(e.rule.effect===Gt.ENABLE||e.rule.effect===Gt.DISABLE)),_o=(e,t,r=void 0,n,s)=>e.rule?AH(e,t,r,n,s):!0,RH=(e,t,r=void 0,n,s)=>e.rule?NH(e,t,r,n,s):!0,Ka=e=>!!e&&Object.prototype.hasOwnProperty.call(e,"oneOf")&&e.oneOf&&e.oneOf.every(t=>t.const!==void 0),TH=e=>!!e&&typeof e=="object"&&(Object.prototype.hasOwnProperty.call(e,"enum")||Object.prototype.hasOwnProperty.call(e,"const")),IH=(e,t)=>{const r=e.toISOString();return t==="date-time"?r:t==="date"?r.split("T")[0]:t==="time"?r.split("T")[1].split(".")[0]:r},Pb=e=>e.replace("#","root").replace(new RegExp("/","g"),"_"),nt=(e,t)=>Dv(en(e),t),en=e=>{if(he(e))return[];if(!he(e.type)&&typeof e.type=="string")return[e.type];if(U0(e.type))return e.type;if(!he(e.properties)||!he(e.additionalProperties))return["object"];if(!he(e.items))return["array"];if(!he(e.enum)){const t=new Set;return e.enum.forEach(r=>{typeof r=="string"?t.add("string"):en(r).forEach(n=>t.add(n))}),Array.from(t)}if(!he(e.allOf)){const t=CD(e.allOf,r=>en(r).length!==0);if(t)return en(t)}return[]},qt={schema:zt,data:ha},MH=e=>$b(e.scope).join("."),jl={compose:Rd,fromScoped:MH},Rb=e=>{const t=new U3({allErrors:!0,verbose:!0,strict:!1,addUsedSchema:!1,...e});return V3(t),t},sr=(e,t)=>e===void 0?[]:e(t)?[]:e.errors,zH=e=>{switch(e.keyword){case"required":case"dependencies":return e.params.missingProperty;case"additionalProperties":return e.params.additionalProperty;default:return}},Ha=e=>{let t=e.dataPath||e.instancePath||"";t=t.replace(/\//g,".");const r=zH(e);return r!==void 0&&!t.endsWith(r)&&(t=`${t}.${r}`),t=t.replace(/^./,""),t=ko(t),t},OH=(e,t,r)=>n=>{const s=Wa(n,o=>o.keyword==="oneOf"||o.keyword==="anyOf").map(o=>Ha(o));return Wa(n,o=>{if(LH.indexOf(o.keyword)!==-1&&!Ka(o.parentSchema))return!1;const a=Ha(o);let i=r(a);const c=o.parentSchema;return i&&!DH(c)&&!Ka(c)&&s.findIndex(u=>e.startsWith(u))!==-1&&(i=i&&Uy(c,t)),i})},DH=e=>(e==null?void 0:e.type)==="object"||!!(e!=null&&e.properties),LH=["additionalProperties","allOf","anyOf","oneOf"],FH=e=>e==null?"":e.join(`
130
+ `),Ga={createLabelDescriptionFrom:Sb,convertToValidClassName:Pb},Tb=e=>({type:e,elements:[]}),pa=e=>({type:"Control",scope:e}),BH=(e,t)=>{if(!he(e)&&!xH(e)){const r=Tb(t);return r.elements.push(e),r}return e},UH=(e,t)=>{if(!he(t)){const r=Nv(t);if(bH(e))e.label=r;else{const n={type:"Label",text:r};e.elements.push(n)}}},WH=e=>!he(e)&&(!he(e.oneOf)||!he(e.anyOf)||!he(e.allOf)),Mc=(e,t,r,n,s,o)=>{if(!he(e)&&e.$ref!==void 0)return Mc(zt(o,e.$ref,o),t,r,n,s,o);if(WH(e)){const i=pa(r);return t.push(i),i}const a=en(e);if(a.length===0)return null;if(a.length>1){const i=pa(r);return t.push(i),i}if(r==="#"&&a[0]==="object"){const i=Tb(s);if(t.push(i),e.properties&&NT(e.properties).length>1&&UH(i,n),!he(e.properties)){const c=r+"/properties";Object.keys(e.properties).map(u=>{let d=e.properties[u];const f=`${c}/${Tc(u)}`;d.$ref!==void 0&&(d=zt(o,d.$ref,o)),Mc(d,i.elements,f,u,s,o)})}return i}switch(a[0]){case"object":case"array":case"string":case"number":case"integer":case"null":case"boolean":{const i=pa(r);return t.push(i),i}default:throw new Error("Unknown type: "+JSON.stringify(e))}},Ib=(e,t="VerticalLayout",r="#",n=e)=>BH(Mc(e,[],r,"",t,n),t),qa={jsonSchema:_b,uiSchema:Ib,controlElement:pa},zd="jsonforms/INIT",Od="jsonforms/UPDATE_CORE",Dd="jsonforms/SET_AJV",Ld="jsonforms/UPDATE",Fd="jsonforms/UPDATE_ERRORS",VH="jsonforms/VALIDATE",Mb="jsonforms/ADD_RENDERER",zb="jsonforms/REMOVE_RENDERER",Ob="jsonforms/ADD_CELL",Db="jsonforms/REMOVE_CELL",Bd="jsonforms/SET_CONFIG",Lb="jsonforms/ADD_UI_SCHEMA",Fb="jsonforms/REMOVE_UI_SCHEMA",Ud="jsonforms/SET_SCHEMA",Wd="jsonforms/SET_UISCHEMA",Vd="jsonforms/SET_VALIDATION_MODE",Kd="jsonforms/SET_LOCALE",Hd="jsonforms/SET_TRANSLATOR",Gd="jsonforms/UPDATE_I18N",Bb="jsonforms/ADD_DEFAULT_DATA",Ub="jsonforms/REMOVE_DEFAULT_DATA",KH=e=>{if(!("type"in e)||typeof e.type!="string")return!1;switch(e.type){case"ADD":return"values"in e&&Array.isArray(e.values)&&e.values.length>0;case"REMOVE":return"indices"in e&&Array.isArray(e.indices)&&e.indices.length>0&&e.indices.every(t=>typeof t=="number");case"MOVE":return"moves"in e&&Array.isArray(e.moves)&&e.moves.length>0&&e.moves.every(t=>typeof t=="object"&&t!==null&&"from"in t&&"to"in t&&typeof t.from=="number"&&typeof t.to=="number");default:return!1}},HH=(e,t=_b(e),r,n)=>({type:zd,data:e,schema:t,uischema:typeof r=="object"?r:Ib(t),options:n}),GH=(e,t,r,n)=>({type:Od,data:e,schema:t,uischema:r,options:n}),qH=(e,t)=>({type:Bb,schemaPath:e,data:t}),YH=e=>({type:Ub,schemaPath:e}),JH=e=>({type:Dd,ajv:e}),In=(e,t,r)=>({type:Ld,path:e,updater:t,context:r}),ZH=e=>({type:Fd,errors:e}),QH=(e,t)=>({type:Mb,tester:e,renderer:t}),XH=(e,t)=>({type:Ob,tester:e,cell:t}),eG=(e,t)=>({type:Db,tester:e,cell:t}),tG=(e,t)=>({type:zb,tester:e,renderer:t}),rG=e=>({type:Bd,config:e}),nG=e=>({type:Vd,validationMode:e}),sG=(e,t)=>({type:Lb,tester:e,uischema:t}),oG=e=>({type:Fb,tester:e}),aG=e=>({type:Kd,locale:e}),iG=e=>({type:Ud,schema:e}),lG=(e,t)=>({type:Hd,translator:e,errorTranslator:t}),cG=(e,t,r)=>({type:Gd,locale:e,translator:t,errorTranslator:r}),uG=e=>({type:Wd,uischema:e});var Cn=Object.freeze({__proto__:null,INIT:zd,UPDATE_CORE:Od,SET_AJV:Dd,UPDATE_DATA:Ld,UPDATE_ERRORS:Fd,VALIDATE:VH,ADD_RENDERER:Mb,REMOVE_RENDERER:zb,ADD_CELL:Ob,REMOVE_CELL:Db,SET_CONFIG:Bd,ADD_UI_SCHEMA:Lb,REMOVE_UI_SCHEMA:Fb,SET_SCHEMA:Ud,SET_UISCHEMA:Wd,SET_VALIDATION_MODE:Vd,SET_LOCALE:Kd,SET_TRANSLATOR:Hd,UPDATE_I18N:Gd,ADD_DEFAULT_DATA:Bb,REMOVE_DEFAULT_DATA:Ub,isUpdateArrayContext:KH,init:HH,updateCore:GH,registerDefaultData:qH,unregisterDefaultData:YH,setAjv:JH,update:In,updateErrors:ZH,registerRenderer:QH,registerCell:XH,unregisterCell:eG,unregisterRenderer:tG,setConfig:rG,setValidationMode:nG,registerUISchema:sG,unregisterUISchema:oG,setLocale:aG,setSchema:iG,setTranslator:lG,updateI18n:cG,setUISchema:uG});const dG={restrict:!1,trim:!1,showUnfocusedDescription:!1,hideRequiredAsterisk:!1},bm=(e={})=>wo({},dG,e),xm=(e=bm(),t)=>{switch(t.type){case Bd:return bm(t.config);default:return e}},fG={data:{},schema:{},uischema:void 0,errors:[],validator:void 0,ajv:void 0,validationMode:"ValidateAndShow",additionalErrors:[]},wm=(e,t)=>t&&hG(t.options)?t.options.validationMode:e.validationMode,hG=e=>e?e.validationMode!==void 0:!1,pG=e=>e?e.additionalErrors!==void 0:!1,km=(e,t)=>t&&pG(t.options)?t.options.additionalErrors:e.additionalErrors,_m=(e,t)=>{if(t){if(mG(t.options))return t.options.ajv;if(t.options!==void 0&&bA(t.options.compile))return t.options}return e.ajv?e.ajv:Rb()},mG=e=>e?e.ajv!==void 0:!1,El=(e=fG,t)=>{switch(t.type){case zd:{const r=_m(e,t),n=wm(e,t),s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data),a=km(e,t);return{...e,data:t.data,schema:t.schema,uischema:t.uischema,additionalErrors:a,errors:o,validator:s,ajv:r,validationMode:n}}case Od:{const r=_m(e,t),n=wm(e,t);let s=e.validator,o=e.errors;e.schema!==t.schema||e.validationMode!==n||e.ajv!==r?(s=n==="NoValidation"?void 0:r.compile(t.schema),o=sr(s,t.data)):e.data!==t.data&&(o=sr(s,t.data));const a=km(e,t);return e.data!==t.data||e.schema!==t.schema||e.uischema!==t.uischema||e.ajv!==r||e.errors!==o||e.validator!==s||e.validationMode!==n||e.additionalErrors!==a?{...e,data:t.data,schema:t.schema,uischema:t.uischema,ajv:r,errors:Uy(o,e.errors)?e.errors:o,validator:s,validationMode:n,additionalErrors:a}:e}case Dd:{const r=t.ajv,n=e.validationMode==="NoValidation"?void 0:r.compile(e.schema),s=sr(n,e.data);return{...e,validator:n,errors:s}}case Ud:{const n=t.schema&&e.ajv&&e.validationMode!=="NoValidation"?e.ajv.compile(t.schema):e.validator,s=sr(n,e.data);return{...e,validator:n,schema:t.schema,errors:s}}case Wd:return{...e,uischema:t.uischema};case Ld:{if(t.path===void 0||t.path===null)return e;if(t.path===""){const r=t.updater(Gs(e.data)),n=sr(e.validator,r);return{...e,data:r,errors:n}}else{const r=Qe(e.data,t.path),n=t.updater(Gs(r));let s;n!==void 0?s=uK(t.path,n,e.data===void 0?{}:e.data):s=EK(t.path,e.data===void 0?{}:e.data);const o=sr(e.validator,s);return{...e,data:s,errors:o}}}case Fd:return{...e,errors:t.errors};case Vd:{if(e.validationMode===t.validationMode)return e;if(t.validationMode==="NoValidation"){const r=sr(void 0,e.data);return{...e,errors:r,validationMode:t.validationMode}}if(e.validationMode==="NoValidation"){const r=e.ajv.compile(e.schema),n=sr(r,e.data);return{...e,validator:r,errors:n,validationMode:t.validationMode}}return{...e,validationMode:t.validationMode}}default:return e}};var tt;(function(e){e.addTooltip="addTooltip",e.addAriaLabel="addAriaLabel",e.removeTooltip="removeTooltip",e.upAriaLabel="upAriaLabel",e.downAriaLabel="downAriaLabel",e.noSelection="noSelection",e.removeAriaLabel="removeAriaLabel",e.noDataMessage="noDataMessage",e.deleteDialogTitle="deleteDialogTitle",e.deleteDialogMessage="deleteDialogMessage",e.deleteDialogAccept="deleteDialogAccept",e.deleteDialogDecline="deleteDialogDecline",e.up="up",e.down="down"})(tt||(tt={}));const gG=[{key:tt.addTooltip,default:e=>e?`Add to ${e}`:"Add"},{key:tt.addAriaLabel,default:e=>e?`Add to ${e} button`:"Add button"},{key:tt.removeTooltip,default:()=>"Delete"},{key:tt.removeAriaLabel,default:()=>"Delete button"},{key:tt.upAriaLabel,default:()=>"Move item up"},{key:tt.up,default:()=>"Up"},{key:tt.down,default:()=>"Down"},{key:tt.downAriaLabel,default:()=>"Move item down"},{key:tt.noDataMessage,default:()=>"No data"},{key:tt.noSelection,default:()=>"No selection"},{key:tt.deleteDialogTitle,default:()=>"Confirm Deletion"},{key:tt.deleteDialogMessage,default:()=>"Are you sure you want to delete the selected entry?"},{key:tt.deleteDialogAccept,default:()=>"Yes"},{key:tt.deleteDialogDecline,default:()=>"No"}];var Mn;(function(e){e.clearDialogTitle="clearDialogTitle",e.clearDialogMessage="clearDialogMessage",e.clearDialogAccept="clearDialogAccept",e.clearDialogDecline="clearDialogDecline"})(Mn||(Mn={}));Mn.clearDialogTitle,Mn.clearDialogMessage,Mn.clearDialogAccept,Mn.clearDialogDecline;const qd=(e,t)=>Ab(t)?t.i18n:(e==null?void 0:e.i18n)??void 0,vG=e=>(e==null?void 0:e.split(".").filter(t=>!/^\d+$/.test(t)).join("."))||"root",Rr=(e,t,r)=>qd(e,t)??vG(r),Ya=(e,t,r,n)=>`${Rr(e,t,r)}.${n}`,yG=(e,t)=>`${e}.${t}`,Yd=(e,t)=>t,Jd=(e,t,r)=>{var i;const n=Ya(e.parentSchema,r,Ha(e),`error.${e.keyword}`),s=t(n,void 0,{error:e});if(s!==void 0)return s;const o=t(`error.${e.keyword}`,void 0,{error:e});if(o!==void 0)return o;const a=t(e.message,void 0,{error:e});return a!==void 0?a:e.keyword==="required"&&((i=e.message)!=null&&i.startsWith("must have required property"))?t("is a required property","is a required property",{error:e}):e.message},Wb=(e,t,r,n,s,o)=>{if(e.length>0&&r){const a=Ya(n,s,o,"error.custom"),i=r(a,void 0,{schema:n,uischema:s,path:o,errors:e});if(i!==void 0)return i}return FH(e.map(a=>t(a,r,s)))},Vb=(e,t)=>{if(e.label===!1||(e.label===void 0||e.label===null||e.label===!0)&&!Ab(e))return;const r=typeof e.label=="string"?e.label:JSON.stringify(e.label),n=qd(void 0,e),s=typeof n=="string"?`${n}.label`:r;return t(s,r,{uischema:e})},bG=(e,t,r,n)=>{const s={};return t.forEach(o=>{const a=yG(r,o.key);s[o.key]=e(a,o.default(n))}),s},xG=e=>e===void 0?Yd:e.translate,wG=e=>e===void 0?Jd:e.translateError,Yt=()=>e=>xG(Qe(e,"jsonforms.i18n")),Kb=()=>e=>wG(Qe(e,"jsonforms.i18n")),zn={locale:"en",translate:Yd,translateError:Jd},Cm=(e=zn,t)=>{switch(t.type){case Gd:{const r=t.locale??zn.locale,n=t.translator??zn.translate,s=t.errorTranslator??zn.translateError;return r!==e.locale||n!==e.translate||s!==e.translateError?{...e,locale:r,translate:n,translateError:s}:e}case Hd:return{...e,translate:t.translator??Yd,translateError:t.errorTranslator??Jd};case Kd:return{...e,locale:t.locale??navigator.languages[0]};default:return e}},Hn=-1,cr=e=>!he(e)&&e.scope!==void 0,Ot=e=>(t,r,n)=>{if(he(t)||!cr(t)||he(r))return!1;const s=t.scope;if(he(s))return!1;let o=r;return nt(r,"object")&&(o=zt(r,s,n==null?void 0:n.rootSchema)),o===void 0?!1:e(o,n==null?void 0:n.rootSchema)},Zd=(e,t)=>(r,n,s)=>{if(he(r)||!cr(r))return!1;const o=r.scope;let a=n;return nt(n,"object")&&(a=zt(n,o,s==null?void 0:s.rootSchema)),a=Qe(a,e),a===void 0?!1:t(a,s==null?void 0:s.rootSchema)},hr=e=>Ot(t=>!he(t)&&nt(t,e)),Ni=e=>Ot(t=>!he(t)&&t.format===e&&nt(t,"string")),De=e=>t=>!he(t)&&t.type===e,gr=(e,t)=>r=>{if(he(r))return!1;const n=r.options;return!he(n)&&n[e]===t},kG=e=>t=>{if(he(t))return!1;const r=t.options;return!he(r)&&!hH(r[e])},_G=e=>t=>he(e)||!cr(t)?!1:OK(t.scope,e),CG=e=>t=>{if(he(e)||!cr(t))return!1;const r=t.scope;return!he(r)&&fK(r.split("/"))===e},Fe=(...e)=>(t,r,n)=>e.reduce((s,o)=>s&&o(t,r,n),!0),Co=(...e)=>(t,r,n)=>e.reduce((s,o)=>s||o(t,r,n),!1),We=(e,t)=>(r,n,s)=>t(r,n,s)?e:Hn,$G=(e,t)=>(r,n,s)=>{const o=t(r,n,s);return o===Hn?Hn:o+e},Hb=Fe(De("Control"),hr("boolean")),SG=Fe(De("Control"),hr("object")),jG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"allOf"))),EG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"anyOf"))),AG=Fe(De("Control"),Ot(e=>Object.prototype.hasOwnProperty.call(e,"oneOf"))),Qd=Fe(De("Control"),Ot(e=>TH(e))),Xd=Fe(De("Control"),Ot(e=>Ka(e))),Gb=Fe(De("Control"),hr("integer")),qb=Fe(De("Control"),hr("number")),Yb=Fe(De("Control"),hr("string")),Jb=Fe(De("Control"),gr("multi",!0)),Zb=Fe(De("Control"),Co(Ni("date"),gr("format","date"))),Qb=Fe(De("Control"),Co(Ni("time"),gr("format","time"))),Xb=Fe(De("Control"),Co(Ni("date-time"),gr("format","date-time"))),ex=Fe(Ot((e,t)=>nt(e,"array")&&!Array.isArray(zt(e,"items",t))),Zd("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e;return nt(r,"object")})),tx=Fe(De("Control"),ex),Os=(e,t,r)=>{if(U0(e))return Rc(e,(n,s)=>n||Os(s,t,r),!1);if(t(e))return!0;if(e.$ref){const n=zt(r,e.$ref,r);if(n&&!n.$ref)return Os(n,t,r)}return e.items?Os(e.items,t,r):e.properties?Rc(uH(e.properties),(n,[s,o])=>n||Os(o,t,r),!1):!1},rx=(e,t,r)=>{if(!De("Control")(e,t,r))return!1;const n=e.scope,s=zt(t,n,(r==null?void 0:r.rootSchema)??t);let o=0;if(s!==void 0&&s.items!==void 0){if(Os(s.items,a=>a===t||a.$ref!==void 0?!1:!!(a.anyOf||a.allOf||a.oneOf&&!Ka(a)||nt(a,"object")&&(o++,o===2)||nt(a,"array")),r==null?void 0:r.rootSchema))return!0;if(e.options&&e.options.detail){if(typeof e.options.detail=="string")return e.options.detail.toUpperCase()!=="DEFAULT";if(typeof e.options.detail=="object"&&e.options.detail.type)return!0}}return!1},NG=tx,PG=Fe(De("Control"),Ot((e,t)=>en(e).length!==0&&!Array.isArray(zt(e,"items",t))),Zd("items",(e,t)=>{const r=e.$ref?zt(t,e.$ref,t):e,n=en(r);return n.length===1&&Dv(["integer","number","boolean","string"],n[0])})),nx=Fe(De("Control"),Co(hr("number"),hr("integer")),Ot(e=>Object.prototype.hasOwnProperty.call(e,"maximum")&&Object.prototype.hasOwnProperty.call(e,"minimum")&&Object.prototype.hasOwnProperty.call(e,"default")),gr("slider",!0)),RG=Fe(De("Control"),hr("integer"),gr("format",!0)),sx=e=>e.type==="Categorization",ox=e=>e.type==="Category",ef=e=>he(e.elements)?!1:e.elements.map(t=>sx(t)?ef(t):ox(t)).reduce((t,r)=>t&&r,!0),TG=e=>ef(e),IG=e=>(t,r,n)=>!e(t,r,n);var MG=Object.freeze({__proto__:null,NOT_APPLICABLE:Hn,isControl:cr,schemaMatches:Ot,schemaSubPathMatches:Zd,schemaTypeIs:hr,formatIs:Ni,uiTypeIs:De,optionIs:gr,hasOption:kG,scopeEndsWith:_G,scopeEndIs:CG,and:Fe,or:Co,rankWith:We,withIncreasedRank:$G,isBooleanControl:Hb,isObjectControl:SG,isAllOfControl:jG,isAnyOfControl:EG,isOneOfControl:AG,isEnumControl:Qd,isOneOfEnumControl:Xd,isIntegerControl:Gb,isNumberControl:qb,isStringControl:Yb,isMultiLineControl:Jb,isDateControl:Zb,isTimeControl:Qb,isDateTimeControl:Xb,isObjectArray:ex,isObjectArrayControl:tx,isObjectArrayWithNesting:rx,isArrayObjectControl:NG,isPrimitiveArrayControl:PG,isRangeControl:nx,isNumberFormatControl:RG,isCategorization:sx,isCategory:ox,hasCategory:ef,categorizationHasCategory:TG,not:IG});const zG=e=>(t,r,n)=>{const s=wi(e,o=>o.tester(t,r,n));if(s!==void 0&&s.tester(t,r,n)!==Hn)return s.uischema},OG=(e,t,r,n,s="VerticalLayout",o,a)=>{if(o&&o.options&&o.options.detail){if(typeof o.options.detail=="string"){if(o.options.detail.toUpperCase()==="GENERATE")return typeof s=="function"?s():qa.uiSchema(t,s,void 0,a)}else if(typeof o.options.detail=="object"&&o.options.detail.type&&typeof o.options.detail.type=="string")return o.options.detail}const i=zG(e)(t,r,n);return i===void 0?typeof s=="function"?s():qa.uiSchema(t,s,"#",a):i},$m=(e,t,r)=>r(e,t),ax=(e,t,r)=>n=>{const s=n.errors??[],o=n.additionalErrors??[];return OH(e,t,r)(n.validationMode==="ValidateAndHide"?o:[...s,...o])},DG=(e,t)=>ax(e,t,r=>r===e),LG=(e,t)=>ax(e,t,r=>r.startsWith(e+".")),ix=(e,t)=>r=>DG(e,t)(r.jsonforms.core),FG=(e,t)=>r=>LG(e,t)(r.jsonforms.core),Pi=e=>UG(Qe(e,"jsonforms.core")),Ja=e=>WG(Qe(e,"jsonforms.core")),BG=e=>VG(Qe(e,"jsonforms.core")),is=e=>KG(Qe(e,"jsonforms.core")),tf=e=>Qe(e,"jsonforms.renderers"),rf=e=>Qe(e,"jsonforms.cells"),UG=e=>Qe(e,"data"),WG=e=>Qe(e,"schema"),VG=e=>Qe(e,"uischema"),KG=e=>Qe(e,"ajv"),pr=e=>e.jsonforms.config,nf=(e,t,r,n,s,o)=>{var a,i,c;return(a=e==null?void 0:e.jsonforms)!=null&&a.readonly?!1:r&&PH(r)?RH(r,s,t==null?void 0:t.path,is(e),o):typeof((i=r==null?void 0:r.options)==null?void 0:i.readonly)=="boolean"?!r.options.readonly:typeof((c=r==null?void 0:r.options)==null?void 0:c.readOnly)=="boolean"?!r.options.readOnly:typeof(o==null?void 0:o.readonly)=="boolean"?!o.readonly:typeof(o==null?void 0:o.readOnly)=="boolean"?!o.readOnly:(n==null?void 0:n.readOnly)===!0?!1:typeof(t==null?void 0:t.enabled)=="boolean"?t.enabled:!0},lx=(e,t,r)=>{const n=t+r;if(n<0||n>=e.length)return;const s=[t,n].sort((o,a)=>o-a);e.splice(s[0],2,e[s[1]],e[s[0]])},HG=(e,t)=>{lx(e,t,-1)},GG=(e,t)=>{lx(e,t,1)},qG=(e,t,r)=>{const n=t.split("/"),s=ko(n[n.length-1]),a=n.slice(0,n.length-2).join("/"),i=qt.schema(e,a,r);return i!==void 0&&i.required!==void 0&&i.required.indexOf(s)!==-1},cx=(e,t,r)=>`${e??""}${t&&!r?"*":""}`,ux=(e,t)=>{const r=dx(e,t);return r===void 0?{}:r},dx=(e,t)=>{const r=typeof e.$ref=="string"?qt.schema(t,e.$ref,t):e;if(r.default!==void 0)return Sm(r,t);if(nt(r,"string"))return r.format==="date-time"||r.format==="date"||r.format==="time"?IH(new Date,r.format):"";if(nt(r,"integer")||nt(r,"number"))return 0;if(nt(r,"boolean"))return!1;if(nt(r,"array"))return[];if(nt(r,"object"))return Sm(r,t);if(nt(r,"null"))return null;const n=["oneOf","anyOf","allOf"];for(const s of n)if(e[s]&&Array.isArray(e[s])){const o=YG(e[s],t);if(o!==void 0)return o}},YG=(e,t)=>{if(e.length>0)for(const r of e){const n=dx(r,t);if(n!==void 0)return n}},Sm=(e,t)=>{if(nt(e,"object")&&e.default===void 0){const r={};for(const n in e.properties){const s=e.properties[n],o=s.$ref?qt.schema(t,s.$ref,t):s;o&&o.default!==void 0&&(r[n]=Gs(o.default))}return e.allOf&&Array.isArray(e.allOf)&&e.allOf.forEach(n=>{if(n&&n.properties)for(const s in n.properties){const o=n.properties[s],a=o.$ref?qt.schema(t,o.$ref,t):o;a&&a.default!==void 0&&(r[s]=Gs(a.default))}}),r}return Gs(e.default)},fx=(e,t,r,n)=>t===void 0||t!==void 0&&!e||!n&&!r,Za=(e,t,r)=>{let n=typeof e=="string"?e:JSON.stringify(e);return t&&(r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e}},hx=(e,t,r)=>{let n=e.title??(typeof e.const=="string"?e.const:JSON.stringify(e.const));return t&&(e.i18n?n=t(e.i18n,n):r?n=t(`${r}.${n}`,n):n=t(n,n)),{label:n,value:e.const}},Ri=(e,t)=>{const{uischema:r}=t,n=Pi(e),s=Eb(r,t.path),o=pr(e),a=t.visible===void 0||Md(r)?_o(r,n,t.path,is(e),o):t.visible,i=r,c=t.id,u=Ja(e),d=i.scope!==void 0&&qG(t.schema,i.scope,u),f=qt.schema(t.schema||u,i.scope,u),p=ix(s,f)(e),h=f!==void 0?f.description:"",g=qt.data(n,s),m=Sb(r,f),v=m.show?m.text:"",y=nf(e,t,r,f||u,n,o),b=f??u,C=Yt()(e),w=Kb()(e),_=Rr(b,r,s),R=C(Ya(b,r,s,"label"),v,{schema:b,uischema:r,path:s,errors:p}),z=C(Ya(b,r,s,"description"),h,{schema:b,uischema:r,path:s,errors:p}),D=Wb(p,w,C,b,r,s);return{data:g,description:z,errors:D,label:R,visible:a,enabled:y,id:c,path:s,required:d,uischema:r,schema:b,config:pr(e),cells:t.cells||e.jsonforms.cells,rootSchema:u,i18nKeyPrefix:_}},JG=e=>({handleChange(t,r){e(In(t,()=>r))}}),ZG=(e,t)=>{var s;const r=Ri(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Za(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Za(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},QG=(e,t)=>{var s;const r=Ri(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>hx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}},XG=(e,t)=>{const{...r}=Ri(e,t);return{...r,uischemas:e.jsonforms.uischemas}},eq=(e,t)=>{const{path:r,schema:n,uischema:s,label:o,...a}=XG(e,t),i=qt.schema(n,"items",a.rootSchema),c=FG(r,i)(e);return{...a,label:o,path:r,uischema:s,schema:i,arraySchema:n,childErrors:c,renderers:t.renderers||tf(e),cells:t.cells||rf(e)}},tq=e=>({addItem:(t,r)=>()=>{e(In(t,n=>n==null?[r]:(n.push(r),n),{type:"ADD",values:[r]}))},removeItems:(t,r)=>()=>{e(In(t,n=>(r.sort((s,o)=>s-o).reverse().forEach(s=>n.splice(s,1)),n),{type:"REMOVE",indices:r}))},moveUp:(t,r)=>()=>{e(In(t,n=>(HG(n,r),n),{type:"MOVE",moves:[{from:r,to:r-1}]}))},moveDown:(t,r)=>()=>{e(In(t,n=>(GG(n,r),n),{type:"MOVE",moves:[{from:r,to:r+1}]}))}}),px={visible:!0,enabled:!0,path:"",direction:"column"},rq=e=>e.type==="HorizontalLayout"?"row":e.type==="VerticalLayout"?"column":px.direction,nq=(e,t)=>{const r=Pi(e),{uischema:n}=t,s=t.visible===void 0||Md(n)?_o(t.uischema,r,t.path,is(e),pr(e)):t.visible,o=qt.data(r,t.path),a=pr(e),i=nf(e,t,n,void 0,r,a),c=Yt()(e),u=_H(n)?Vb(n,c):void 0;return{...px,renderers:t.renderers||tf(e),cells:t.cells||rf(e),visible:s,enabled:i,path:t.path,data:o,uischema:t.uischema,schema:t.schema,direction:t.direction??rq(n),config:a,label:u}},sq=(e,t)=>({renderers:t.renderers||Qe(e.jsonforms,"renderers"),cells:t.cells||Qe(e.jsonforms,"cells"),schema:t.schema||Ja(e),rootSchema:Ja(e),uischema:t.uischema||BG(e),path:t.path,enabled:t.enabled,config:pr(e)}),oq=(e,t)=>{const{uischema:r}=t,n=t.visible===void 0||Md(r)?_o(t.uischema,Pi(e),t.path,is(e),pr(e)):t.visible,s=r.text,o=Yt()(e),a=qd(void 0,r),i=a?`${a}.text`:s??"";return{text:o(i,s,{uischema:r}),visible:n,config:pr(e),renderers:t.renderers||tf(e),cells:t.cells||rf(e),uischema:r}},Ti=(e,t)=>{const{id:r,schema:n,path:s,uischema:o,renderers:a,cells:i}=t,c=Pi(e),u=pr(e),d=t.visible!==void 0?t.visible:_o(o,c,void 0,is(e),u),f=Ja(e);let p;e.jsonforms.readonly===!0?p=!1:typeof t.enabled=="boolean"?p=t.enabled:p=nf(e,t,o,n||f,c,u);const h=Yt()(e),g=Kb()(e),m=Wb(ix(s,n)(e),g,h,n,o,s),v=he(m);return{data:qt.data(c,s),visible:d,enabled:p,id:r,path:s,errors:m,isValid:v,schema:n,uischema:o,config:pr(e),rootSchema:f,renderers:a,cells:i}},aq=(e,t)=>{const r=Ti(e,t),{renderers:n,cells:s,...o}=t;return{...r,...o,cells:s||e.jsonforms.cells||[]}},iq=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.enum)==null?void 0:s.map(o=>Za(o,Yt()(e),Rr(r.schema,r.uischema,r.path))))||r.schema.const&&[Za(r.schema.const,Yt()(e),Rr(r.schema,r.uischema,r.path))];return{...r,options:n}},lq=(e,t)=>{var s;const r=Ti(e,t),n=t.options||((s=r.schema.oneOf)==null?void 0:s.map(o=>hx(o,Yt()(e),Rr(r.schema,r.uischema,r.path))));return{...r,options:n}};var cq=ut,uq=function(){return cq.Date.now()},dq=uq,fq=xt,Al=dq,jm=Rv,hq="Expected a function",pq=Math.max,mq=Math.min;function gq(e,t,r){var n,s,o,a,i,c,u=0,d=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(hq);t=jm(t)||0,fq(r)&&(d=!!r.leading,f="maxWait"in r,o=f?pq(jm(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p);function h(R){var z=n,D=s;return n=s=void 0,u=R,a=e.apply(D,z),a}function g(R){return u=R,i=setTimeout(y,t),d?h(R):a}function m(R){var z=R-c,D=R-u,j=t-z;return f?mq(j,o-D):j}function v(R){var z=R-c,D=R-u;return c===void 0||z>=t||z<0||f&&D>=o}function y(){var R=Al();if(v(R))return b(R);i=setTimeout(y,m(R))}function b(R){return i=void 0,p&&n?h(R):(n=s=void 0,a)}function C(){i!==void 0&&clearTimeout(i),u=0,n=c=s=i=void 0}function w(){return i===void 0?a:b(Al())}function _(){var R=Al(),z=v(R);if(n=arguments,s=this,c=R,z){if(i===void 0)return g(c);if(f)return clearTimeout(i),i=setTimeout(y,t),h(c)}return i===void 0&&(i=setTimeout(y,t)),a}return _.cancel=C,_.flush=w,_}var vq=gq;const yq=Se(vq);class bq extends B.Component{constructor(t){super(t)}}class xq extends bq{constructor(t){super(t),this.handleChange=r=>{this.setState({value:r}),this.updateData(r)},this.onFocus=()=>{this.setState({isFocused:!0})},this.onBlur=()=>{this.setState({isFocused:!1})},this.updateData=r=>{this.props.handleChange(this.props.path,r)},this.state={value:t.data?t.data:"",isFocused:!1}}}class mx extends x.Component{render(){return B.createElement("div",{style:{color:"red"}},"No applicable ",this.props.type," found.")}}const wq={data:{},schema:{},uischema:void 0,errors:[],additionalErrors:[],validator:void 0,ajv:void 0},gx=B.createContext({core:wq,renderers:[]}),kq=(e,t)=>{const r=x.useRef(!0);x.useEffect(()=>{if(r.current){r.current=!1;return}e()},t)},_q=({children:e,initState:t,onChange:r,middleware:n})=>{var _,R,z;const{data:s,schema:o,uischema:a,ajv:i,validationMode:c,additionalErrors:u}=t.core,d=x.useRef(n??$m);d.current=n??$m;const[f,p]=x.useState(()=>d.current(t.core,Cn.init(s,o,a,{ajv:i,validationMode:c,additionalErrors:u}),El));x.useEffect(()=>p(D=>d.current(D,Cn.updateCore(s,o,a,{ajv:i,validationMode:c,additionalErrors:u}),El)),[s,o,a,i,c,u]);const[h,g]=x.useReducer(xm,void 0,()=>xm(void 0,Cn.setConfig(t.config)));kq(()=>{g(Cn.setConfig(t.config))},[t.config]);const[m,v]=x.useReducer(Cm,void 0,()=>{var D,j,S;return Cm(t.i18n,Cn.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))});x.useEffect(()=>{var D,j,S;v(Cn.updateI18n((D=t.i18n)==null?void 0:D.locale,(j=t.i18n)==null?void 0:j.translate,(S=t.i18n)==null?void 0:S.translateError))},[(_=t.i18n)==null?void 0:_.locale,(R=t.i18n)==null?void 0:R.translate,(z=t.i18n)==null?void 0:z.translateError]);const y=x.useCallback(D=>{p(j=>d.current(j,D,El))},[]),b=x.useMemo(()=>({core:f,renderers:t.renderers,cells:t.cells,config:h,uischemas:t.uischemas,readonly:t.readonly,i18n:m,dispatch:y}),[f,t.renderers,t.cells,h,t.uischemas,t.readonly,m]),C=x.useRef(r);x.useEffect(()=>{C.current=r},[r]);const w=x.useCallback(yq((...D)=>{var j;return(j=C.current)==null?void 0:j.call(C,...D)},10),[]);return x.useEffect(()=>{w({data:f.data,errors:f.errors})},[f.data,f.errors]),B.createElement(gx.Provider,{value:b},e)},$o=()=>x.useContext(gx),Cq=(e,t)=>eq({jsonforms:{...e}},t),$q=(e,t)=>nq({jsonforms:{...e}},t),Sq=(e,t)=>Ri({jsonforms:{...e}},t),jq=(e,t)=>{var s;const r=ZG({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Eq=(e,t)=>{var s;const r=QG({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},zr=e=>x.useMemo(()=>JG(e),[e]),Aq=(e,t)=>sq({jsonforms:{...e}},t),Nq=e=>({...zr(e),...x.useMemo(()=>tq(e),[e])}),Pq=(e,t)=>Ti({jsonforms:{...e}},t),Rq=(e,t)=>{var s;const r=iq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Tq=(e,t)=>{var s;const r=lq({jsonforms:{...e}},t),n=x.useMemo(()=>r.options,[t.options,r.schema,(s=e.i18n)==null?void 0:s.translate]);return{...r,options:n}},Iq=(e,t)=>aq({jsonforms:{...e}},t),Mq=(e,t)=>oq({jsonforms:{...e}},t),Dt=e=>function(r){const n=$o();return B.createElement(e,{ctx:n,props:r})},zq=e=>function({ctx:r,props:n}){const s=Aq(r,n);return B.createElement(e,{...n,...s})},Oq=e=>function({ctx:r,props:n}){const s=Sq(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...s,...o})},Dq=e=>function({ctx:r,props:n}){const s=$q(r,n);return B.createElement(e,{...n,...s})},Lq=e=>function({ctx:r,props:n}){const s=Cq(r,n),o=Nq(r.dispatch);return B.createElement(e,{...n,...s,...o})},Fq=e=>function({ctx:r,props:n}){const s=Pq(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},Bq=e=>function({ctx:r,props:n}){const s=Iq(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},Uq=e=>function({ctx:r,props:n}){const s=Rq(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},Wq=e=>function({ctx:r,props:n}){const s=jq(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},Vq=e=>function({ctx:r,props:n}){const s=Tq(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},Kq=e=>function({ctx:r,props:n}){const s=Eq(r,n),o=zr(r.dispatch);return B.createElement(e,{...n,...o,...s})},Hq=e=>function({ctx:r,props:n}){const s=Mq(r,n);return B.createElement(e,{...n,...s})},vx=(e,t=!0)=>Dt(zq(t?B.memo(e):e)),Gq=(e,t=!0)=>Dt(Oq(t?B.memo(e):e)),Ii=(e,t=!0)=>Dt(Dq(t?B.memo(e):e)),yx=(e,t=!0)=>Dt(Lq(t?B.memo(e):e)),Qt=(e,t=!0)=>Dt(Fq(t?B.memo(e):e)),qq=(e,t=!0)=>Dt(Bq(t?B.memo(e):e)),Yq=(e,t=!0)=>Dt(Uq(t?B.memo(e):e)),Jq=(e,t=!0)=>Dt(Wq(t?B.memo(e):e)),Zq=(e,t=!0)=>Dt(Vq(t?B.memo(e):e)),Qq=(e,t=!0)=>Dt(Kq(t?B.memo(e):e)),Xq=(e,t=!0)=>Dt(Hq(t?B.memo(e):e)),So=e=>function(r){var a,i;const n=$o(),s=((a=n.i18n)==null?void 0:a.locale)??zn.locale,o=((i=n.i18n)==null?void 0:i.translate)??zn.translate;return B.createElement(e,{...r,locale:s,t:o})},bx=e=>function(r){const n=x.useMemo(()=>bG(r.t,gG,r.i18nKeyPrefix,r.label),[r.t,r.i18nKeyPrefix,r.label]);return B.createElement(e,{...r,translations:n})};class xx extends B.Component{constructor(t){super(t),this.state={id:cr(t.uischema)?vm(t.uischema.scope):void 0}}componentWillUnmount(){cr(this.props.uischema)&&ym(this.state.id)}componentDidUpdate(t){t.schema!==this.props.schema&&(ym(this.state.id),this.setState({id:cr(this.props.uischema)?vm(this.props.uischema.scope):void 0}))}render(){const{schema:t,rootSchema:r,uischema:n,path:s,enabled:o,renderers:a,cells:i,config:c}=this.props;return B.createElement(eY,{uischema:n,schema:t,rootSchema:r,path:s,enabled:o,renderers:a,cells:i,id:this.state.id,config:c})}}const eY=B.memo(function(t){const r=x.useMemo(()=>({rootSchema:t.rootSchema,config:t.config}),[t.rootSchema,t.config]),n=x.useMemo(()=>wi(t.renderers,s=>s.tester(t.uischema,t.schema,r)),[t.renderers,t.uischema,t.schema,r]);if(n===void 0||n.tester(t.uischema,t.schema,r)===-1)return B.createElement(mx,{type:"renderer"});{const s=n.renderer;return B.createElement(s,{uischema:t.uischema,schema:t.schema,path:t.path,enabled:t.enabled,renderers:t.renderers,cells:t.cells,id:t.id})}});class tY extends xx{constructor(t){super(t)}}const Mi=vx(xx);vx(tY);const rY=e=>{const{ajv:t,data:r,schema:n,uischema:s,renderers:o,cells:a,onChange:i,config:c,uischemas:u,readonly:d,validationMode:f,i18n:p,additionalErrors:h,middleware:g}=e,m=x.useMemo(()=>n!==void 0?n:qa.jsonSchema(r),[n,r]),v=x.useMemo(()=>typeof s=="object"?s:qa.uiSchema(m,void 0,void 0,m),[s,m]);return B.createElement(_q,{initState:{core:{ajv:t,data:r,schema:m,uischema:v,validationMode:f,additionalErrors:h},config:c,uischemas:u,renderers:o,cells:a,readonly:d,i18n:p},onChange:i,middleware:g},B.createElement(Mi,null))},nY=({uischema:e,schema:t,rootSchema:r,path:n,cells:s,id:o,enabled:a,renderers:i,config:c})=>{const u=x.useMemo(()=>({rootSchema:r,config:c}),[r,c]),d=x.useMemo(()=>wi(s,f=>f.tester(e,t,u)),[s,e,t,u]);if(d===void 0||d.tester(e,t,u)===-1)return B.createElement(mx,{type:"cell"});{const f=d.cell;return B.createElement(f,{uischema:e,schema:t,enabled:a,path:n,id:o,renderers:i,cells:s})}},zc=qq(nY);var sY=Array.prototype,oY=sY.join;function aY(e,t){return e==null?"":oY.call(e,t)}var iY=aY;const wx=Se(iY);var lY=hn,kx=lY("filter",By);kx.placeholder=Mr();var cY=kx;const Em=Se(cY);var Nl,Am;function uY(){if(Am)return Nl;Am=1;var e=md,t=mr;function r(n,s){var o=-1,a=t(n)?Array(n.length):[];return e(n,function(i,c,u){a[++o]=s(i,c,u)}),a}return Nl=r,Nl}var Pl,Nm;function dY(){if(Nm)return Pl;Nm=1;var e=ho,t=fn,r=uY(),n=Ue;function s(o,a){var i=n(o)?e:r;return i(o,t(a))}return Pl=s,Pl}var fY=hn,_x=fY("map",dY());_x.placeholder=Mr();var hY=_x;const Pm=Se(hY);var Rl,Rm;function pY(){if(Rm)return Rl;Rm=1;var e=jd(),t=bb,r=Sd(),n=ub(),s=Ue,o=db(),a="Expected a function",i=8,c=32,u=128,d=256;function f(p){return t(function(h){var g=h.length,m=g,v=e.prototype.thru;for(p&&h.reverse();m--;){var y=h[m];if(typeof y!="function")throw new TypeError(a);if(v&&!b&&n(y)=="wrapper")var b=new e([],!0)}for(m=b?m:g;++m<g;){y=h[m];var C=n(y),w=C=="wrapper"?r(y):void 0;w&&o(w[0])&&w[1]==(u|i|c|d)&&!w[4].length&&w[9]==1?b=b[n(w[0])].apply(b,w[3]):b=y.length==1&&o(y)?b[C]():b.thru(y)}return function(){var _=arguments,R=_[0];if(b&&_.length==1&&s(R))return b.plant(R).value();for(var z=0,D=g?h[z].apply(this,_):R;++z<g;)D=h[z].call(this,D);return D}})}return Rl=f,Rl}var Tl,Tm;function mY(){if(Tm)return Tl;Tm=1;var e=pY(),t=e();return Tl=t,Tl}var gY=hn,Cx=gY("flow",mY());Cx.placeholder=Mr();var vY=Cx;const Im=Se(vY);var Il,Mm;function $x(){return Mm||(Mm=1,Il={cap:!1,curry:!1,fixed:!1,immutable:!1,rearg:!1}),Il}var yY=hn,Sx=yY("keys",Jt,$x());Sx.placeholder=Mr();var bY=Sx;const zm=Se(bY);var xY=hn,jx=xY("startCase",Av,$x());jx.placeholder=Mr();var wY=jx;const kY=Se(wY),Ex={"enum.none":"None"},qs=e=>(t,...r)=>{const n=Wa(e,s=>s.name===t);return Rc(n,(s,o)=>typeof o.classNames=="function"?s.concat(o.classNames(r)):s.concat(o.classNames),[])},It=e=>(t,...r)=>wx(qs(e)(t,r)," "),_Y=[{name:"control",classNames:["control"]},{name:"control.trim",classNames:["trim"]},{name:"control.input",classNames:["input"]},{name:"control.select",classNames:["select"]},{name:"control.checkbox",classNames:["checkbox"]},{name:"control.radio",classNames:["radio"]},{name:"control.radio.option",classNames:["radio-option"]},{name:"control.radio.input",classNames:["radio-input"]},{name:"control.radio.label",classNames:["radio-label"]},{name:"control.validation.error",classNames:["validation_error"]},{name:"control.validation",classNames:["validation"]},{name:"categorization",classNames:["categorization"]},{name:"categorization.master",classNames:["categorization-master"]},{name:"categorization.detail",classNames:["categorization-detail"]},{name:"category.group",classNames:["category-group"]},{name:"category.subcategories",classNames:["category-subcategories"]},{name:"array.layout",classNames:["array-layout"]},{name:"array.children",classNames:["children"]},{name:"group.layout",classNames:["group-layout"]},{name:"horizontal.layout",classNames:["horizontal-layout"]},{name:"horizontal.layout.item",classNames:([e])=>[`horizontal-layout-${e}`]},{name:"vertical.layout",classNames:["vertical-layout"]},{name:"array.table.validation.error",classNames:["validation_error"]},{name:"array.table.validation",classNames:["validation"]},{name:"array.table",classNames:["array-table-layout","control"]},{name:"array.control.validation.error",classNames:["validation_error"]},{name:"array.control.validation",classNames:["validation"]},{name:"array.control.add",classNames:["button-add"]},{name:"array.child.controls",classNames:["child-controls"]},{name:"array.child.controls.up",classNames:["button-up"]},{name:"array.child.controls.down",classNames:["button-down"]},{name:"array.child.controls.delete",classNames:["button-delete"]},{name:"array.control",classNames:["array-control-layout","control"]},{name:"input.description",classNames:["input-description"]}],CY={styles:_Y},$Y=B.createContext(CY),SY=()=>x.useContext($Y),sf=()=>{const{styles:e}=SY();return e},Xt=e=>function(r){const n=$o(),s=sf(),o=r.uischema,a=n.config,i=a&&a.trim,c=x.useMemo(()=>qs(s)("control"),[s]);let u=he(o.scope)?[""]:c.concat([`${Pb(o.scope)}`]);i&&(u=u.concat(qs(s)("control.trim")));const d=he(r.errors),f=x.useMemo(()=>It(s)("control.label"),[s]),p=x.useMemo(()=>It(s)("input.description"),[s]),h=x.useMemo(()=>It(s)("control.validation"),[s]),g=x.useMemo(()=>It(s)("control.validation.error"),[s]),m=["validate"].concat(d?"valid":"invalid"),v=x.useMemo(()=>It(s),[s]),y=x.useMemo(()=>qs(s),[s]),b=u.join(" "),C=m.join(" "),w=x.useMemo(()=>({wrapper:b,input:C,label:f,description:p,validation:h,validationError:g}),[b,C,f,p,h,g]);return B.createElement(e,{...r,getStyleAsClassName:v,getStyle:y,classNames:w})},of=e=>t=>function(n){const s=["validate"].concat(n.isValid?"valid":"invalid"),o=sf(),a=It(o)(e);return a&&s.push(a),B.createElement(t,{...n,getStyleAsClassName:It(o),getStyle:qs(o),className:s.join(" ")})},jY=e=>function(r){const n=$o(),s=is({jsonforms:{...n}});return B.createElement(e,{...r,ajv:s})},vr=of("control.input"),Ax=of("control.select"),EY=of("control.checkbox");class AY extends xq{render(){const{classNames:t,description:r,id:n,errors:s,label:o,uischema:a,schema:i,rootSchema:c,visible:u,enabled:d,required:f,path:p,cells:h,config:g}=this.props,m=s.length===0,v=[t.validation].concat(m?t.description:t.validationError).join(" "),y=wo({},g,a.options),b=!fx(u,r,this.state.isFocused,y.showUnfocusedDescription),C={rootSchema:c,config:g},w=wi(h,_=>_.tester(a,i,C));return w===void 0||w.tester(a,i,C)===Hn?(console.warn("No applicable cell found.",a,i),null):B.createElement("div",{className:t.wrapper,hidden:!u,onFocus:this.onFocus,onBlur:this.onBlur,id:n},B.createElement("label",{htmlFor:n+"-input",className:t.label},cx(o,f,y.hideRequiredAsterisk)),B.createElement(zc,{uischema:a,schema:i,path:p,id:n+"-input",enabled:d}),B.createElement("div",{className:v},m?b?r:null:s))}}const NY=We(1,cr);var PY=Xt(Gq(AY));const Nx=({classNames:e,id:t,label:r,options:n,required:s,description:o,errors:a,data:i,uischema:c,visible:u,config:d,enabled:f,path:p,handleChange:h})=>{const g=sf(),[m,v]=x.useState(!1),y=x.useMemo(()=>It(g)("control.radio"),[g]),b=x.useMemo(()=>It(g)("control.radio.option"),[g]),C=x.useMemo(()=>It(g)("control.radio.input"),[g]),w=x.useMemo(()=>It(g)("control.radio.label"),[g]),_=a.length===0,R=[e.validation].concat(_?e.description:e.validationError).join(" "),z=wo({},d,c.options),D=!fx(u,o,m,z.showUnfocusedDescription),j=!y||y==="radio";let S={};return j&&(S={display:"flex",flexDirection:z.orientation==="vertical"?"column":"row"}),B.createElement("div",{className:e.wrapper,hidden:!u,onFocus:()=>v(!0),onBlur:()=>v(!1)},B.createElement("label",{htmlFor:t,className:e.label},cx(r,s,z.hideRequiredAsterisk)),B.createElement("div",{className:y,style:S},n.map(E=>B.createElement("div",{key:E.label,className:b},B.createElement("input",{type:"radio",value:E.value,id:E.value,name:t,checked:i===E.value,onChange:P=>h(p,E.value),disabled:!f,className:C}),B.createElement("label",{htmlFor:E.value,className:w},E.label)))),B.createElement("div",{className:R},_?D?o:null:a))},RY=e=>B.createElement(Nx,{...e}),TY=We(3,Fe(Qd,gr("format","radio")));var IY=Xt(Jq(RY));const MY=e=>B.createElement(Nx,{...e}),zY=We(3,Fe(Xd,gr("format","radio")));var OY=Xt(Qq(MY));const{convertToValidClassName:DY}=Ga,LY=({classNames:e,data:t,label:r,path:n,schema:s,errors:o,addItem:a,removeItems:i,moveUp:c,moveDown:u,uischema:d,uischemas:f,getStyleAsClassName:p,renderers:h,rootSchema:g,translations:m,enabled:v})=>{const y=d,b=x.useMemo(()=>OG(f,s,d.scope,n,void 0,d,g),[f,s,d.scope,n,d,g]),C=o.length===0,_=[p("array.control.validation")].concat(C?"":p("array.control.validation.error")).join(" "),R=p("array.control.add"),z=p("array.control.label"),D=p("array.child.controls"),j=p("array.child.controls.up"),S=p("array.child.controls.down"),E=p("array.child.controls.delete"),P=[p("array.control"),DY(y.scope)].join(" ");return B.createElement("div",{className:P},B.createElement("header",null,B.createElement("label",{className:z},r),B.createElement("button",{type:"button",className:R,disabled:!v,onClick:a(n,ux(s,g))},"Add to ",r)),B.createElement("div",{className:_},o),B.createElement("div",{className:e.children},t?Iv(0,t.length).map(K=>{const O=Rd(n,`${K}`);return B.createElement("div",{key:K},B.createElement(Mi,{schema:s,uischema:b||d,path:O,key:O,renderers:h}),B.createElement("div",{className:D},B.createElement("button",{type:"button",className:j,disabled:!v,"aria-label":m.upAriaLabel,onClick:()=>{c(n,K)()}},m.up),B.createElement("button",{type:"button",className:S,disabled:!v,"aria-label":m.downAriaLabel,onClick:()=>{u(n,K)()}},m.down),B.createElement("button",{type:"button",className:E,disabled:!v,"aria-label":m.removeAriaLabel,onClick:()=>{window.confirm("Are you sure you wish to delete this item?")&&i(n,[K])()}},m.removeTooltip)))}):B.createElement("p",null,m.noDataMessage)))},FY=({schema:e,uischema:t,data:r,path:n,rootSchema:s,uischemas:o,addItem:a,getStyle:i,getStyleAsClassName:c,removeItems:u,moveUp:d,moveDown:f,id:p,visible:h,enabled:g,errors:m,translations:v,arraySchema:y})=>{const b=t,C=Ga.createLabelDescriptionFrom(b,e),w=C.show?C.text:"",_=`control ${Ga.convertToValidClassName(b.scope)}`,R=c("array.layout"),z=c("array.button"),D=c("array.children"),j={wrapper:_,fieldSet:R,button:z,children:D};return B.createElement(LY,{classNames:j,data:r,label:w,path:n,schema:e,arraySchema:y,errors:m,addItem:a,removeItems:u,moveUp:d,moveDown:f,uischema:t,uischemas:o,getStyleAsClassName:c,rootSchema:s,id:p,visible:h,enabled:g,getStyle:i,translations:v})};var BY=Xt(yx(So(bx(FY))));const UY=We(4,rx),Px=e=>e.type==="Categorization",WY=We(1,Fe(De("Categorization"),e=>{const t=r=>he(r.elements)?!1:r.elements.map(n=>Px(n)?t(n):n.type==="Category").reduce((n,s)=>n&&s,!0);return t(e)})),VY=(e,t)=>t===e?"selected":"",Rx=({selectedCategory:e,elements:t,data:r,depth:n,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i,ajv:c,config:u})=>{const d=x.useMemo(()=>t.filter(p=>_o(p,r,void 0,c,u)),[t,r,c,u]),f=x.useMemo(()=>d.map(p=>Vb(p,i)),[d,i]);return B.createElement("ul",{className:o},d.map((p,h)=>Px(p)?B.createElement("li",{key:f[h],className:a},B.createElement("span",null,f[h]),B.createElement(Rx,{selectedCategory:e,elements:p.elements,data:r,ajv:c,config:u,depth:n+1,onSelect:s,subcategoriesClassName:o,groupClassName:a,t:i})):B.createElement("li",{key:f[h],onClick:s(h),className:VY(p,e)},B.createElement("span",null,f[h]))))},KY=({category:e,schema:t,path:r})=>B.createElement("div",{id:"categorization.detail"},(e.elements||[]).map((n,s)=>B.createElement(Mi,{key:`${r}-${s}`,uischema:n,schema:t,path:r}))),HY=({data:e,uischema:t,schema:r,path:n,selected:s,t:o,visible:a,getStyleAsClassName:i,onChange:c,ajv:u,config:d})=>{const f=t,p=f.elements,h=i("categorization"),g=i("categorization.master"),m=i("categorization.detail"),v=i("category.subcategories"),y=i("category.group"),[b,C]=x.useState(t),[w,_]=x.useState(s??0),R=w>=f.elements.length?0:w;f!==b&&(_(0),C(f));const z=D=>()=>c?c(D,R):_(D);return B.createElement("div",{className:h,hidden:a==null?!1:!a},B.createElement("div",{className:g},B.createElement(Rx,{elements:p,selectedCategory:p[R],data:e,ajv:u,config:d,depth:0,onSelect:z,subcategoriesClassName:v,groupClassName:y,t:o})),B.createElement("div",{className:m},B.createElement(KY,{category:p[R],schema:r,path:n,key:R})))};var GY=jY(Xt(So(Ii(HY))));const qY=We(1,De("Label")),YY=({text:e,visible:t,getStyleAsClassName:r})=>{const n=r("label-control"),s=!t;return B.createElement("label",{hidden:s,className:n},e)};var JY=Xt(Xq(YY));const{convertToValidClassName:ZY}=Ga,{or:QY,isObjectArrayControl:XY,isPrimitiveArrayControl:eJ,rankWith:tJ}=MG,rJ=tJ(3,QY(XY,eJ));class nJ extends B.Component{constructor(){super(...arguments),this.confirmDelete=(t,r)=>{const n=t.substring(0,t.lastIndexOf("."));this.props.removeItems(n,[r])()}}render(){const{addItem:t,uischema:r,schema:n,rootSchema:s,path:o,data:a,visible:i,errors:c,label:u,getStyleAsClassName:d,childErrors:f,translations:p,enabled:h}=this.props,g=r,m=d("array.table.table"),v=d("array.table.label"),y=d("array.table.button"),b=d("array.table.validation"),C=[d("array.table"),ZY(g.scope)].join(" "),w=z=>({type:"Control",label:!1,scope:n.type==="object"?`#/properties/${z}`:"#"}),_=c.length===0,R=[b].concat(_?"":d("array.table.validation.error")).join(" ");return B.createElement("div",{className:C,hidden:!i},B.createElement("header",null,B.createElement("label",{className:v},u),B.createElement("button",{type:"button",disabled:!h,className:y,onClick:t(o,ux(n,s))},p.addTooltip)),B.createElement("div",{className:R},_?"":c),B.createElement("table",{className:m},B.createElement("thead",null,B.createElement("tr",null,n.properties?Im(zm,Em(z=>n.properties[z].type!=="array"),Pm(z=>B.createElement("th",{key:z},n.properties[z].title??kY(z))))(n.properties):B.createElement("th",null,"Items"),B.createElement("th",null,"Valid"),B.createElement("th",null," "))),B.createElement("tbody",null,!a||!Array.isArray(a)||a.length===0?B.createElement("tr",null,B.createElement("td",null,p.noDataMessage)):a.map((z,D)=>{const j=jl.compose(o,`${D}`),S=Wa(f,O=>Ha(O).startsWith(j)),E=d("array.validation"),P=d("array.validation.error"),K=S?[E].concat(P).join(" "):E;return B.createElement("tr",{key:j},n.properties?Im(zm,Em(O=>n.properties[O].type!=="array"),Pm(O=>{const G=jl.compose(j,O.toString());return B.createElement("td",{key:G},B.createElement(zc,{schema:qt.schema(n,`#/properties/${Tc(O)}`,s),uischema:w(Tc(O)),path:j+"."+O}))}))(n.properties):B.createElement("td",{key:jl.compose(j,D.toString())},B.createElement(zc,{schema:n,uischema:w(),path:j})),B.createElement("td",null,S?B.createElement("span",{className:K},wx(S.map(O=>O.message)," and ")):B.createElement("span",{className:K},"OK")),B.createElement("td",null,B.createElement("button",{type:"button",disabled:!h,"aria-label":p.removeAriaLabel,onClick:()=>{window.confirm(p.deleteDialogMessage)&&this.confirmDelete(j,D)}},p.removeTooltip)))}))))}}var sJ=Xt(yx(So(bx(nJ))));const oJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"checkbox",checked:!!t,onChange:c=>i(a,c.target.checked),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},aJ=We(2,Hb);var iJ=Qt(EY(oJ));const lJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"date",value:t||"",onChange:c=>i(a,c.target.value),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},cJ=We(2,Zb);var uJ=Qt(vr(lJ));const dJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e,c=u=>u===""?"":u+":00.000Z";return B.createElement("input",{type:"datetime-local",value:(t||"").substr(0,16),onChange:u=>i(a,c(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},fJ=We(2,Xb);var hJ=Qt(vr(dJ));const pJ=e=>{const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:c,options:u,t:d}=e,f=x.useMemo(()=>d("enum.none",Ex["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]);return B.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:p=>c(i,p.target.selectedIndex===0?void 0:p.target.value)},[B.createElement("option",{value:"",key:"jsonforms.enum.none"},f)].concat(u.map(p=>B.createElement("option",{value:p.value,label:p.label,key:p.value}))))},mJ=We(2,Qd);var gJ=Yq(So(Ax(pJ)));const vJ=e=>e===""?void 0:parseInt(e,10),yJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"number",step:"1",value:t??"",onChange:c=>i(a,vJ(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},bJ=We(2,Gb);var xJ=Qt(vr(yJ));const wJ=e=>e===""?void 0:Number(e),kJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"number",step:"0.1",value:t??"",onChange:c=>i(a,wJ(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},_J=We(2,qb);var CJ=Qt(vr(kJ));const $J=e=>{const{className:t,id:r,enabled:n,uischema:s,path:o,handleChange:a,schema:i}=e,c=i.maxLength,u=e.toFormatted(e.data),d=f=>{const p=e.fromFormatted(f.currentTarget.value);a(o,p)};return B.createElement("input",{type:"text",value:u,onChange:d,className:t,id:r,disabled:!n,autoFocus:s.options&&s.options.focus,maxLength:s.options&&s.options.restrict?c:void 0,size:s.options&&s.options.trim?c:void 0})};Qt(vr($J));const SJ=e=>{var h;const{data:t,className:r,id:n,enabled:s,schema:o,uischema:a,path:i,handleChange:c,options:u,t:d}=e,f=x.useMemo(()=>d("enum.none",Ex["enum.none"],{schema:o,uischema:a,path:i}),[d,o,a,i]),p=B.createElement("option",{value:"",key:"jsonforms.enum.none"},f);return B.createElement("select",{className:r,id:n,disabled:!s,autoFocus:a.options&&a.options.focus,value:t||"",onChange:g=>c(i,g.target.selectedIndex===0?void 0:g.target.value)},(((h=a.options)==null?void 0:h.hideEmptyOption)===!0?[]:[p]).concat(u.map(g=>B.createElement("option",{value:g.value,label:g.label,key:g.value}))))},jJ=We(2,Xd);var EJ=Zq(So(Ax(SJ)));const AJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,schema:a,path:i,handleChange:c}=e;return B.createElement("div",{style:{display:"flex"}},B.createElement("input",{type:"range",max:a.maximum,min:a.minimum,value:t||a.default,onChange:u=>c(i,Number(u.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus,style:{flex:"1"}}),B.createElement("label",{style:{marginLeft:"0.5em"}},t||a.default))},NJ=We(4,nx);var PJ=Qt(vr(AJ));const RJ=e=>{const{config:t,data:r,className:n,id:s,enabled:o,uischema:a,schema:i,path:c,handleChange:u}=e,d=i.maxLength,f=wo({},t,a.options);return B.createElement("input",{type:f.format==="password"?"password":"text",value:r||"",onChange:p=>u(c,p.target.value===""?void 0:p.target.value),className:n,id:s,disabled:!o,autoFocus:f.focus,placeholder:f.placeholder,maxLength:f.restrict?d:void 0,size:f.trim?d:void 0})},TJ=We(1,Yb);var IJ=Qt(vr(RJ));const MJ=e=>{const{data:t,className:r,id:n,enabled:s,config:o,uischema:a,path:i,handleChange:c}=e,u=wo({},o,a.options);return B.createElement("textarea",{value:t||"",onChange:d=>c(i,d.target.value===""?void 0:d.target.value),className:r,id:n,disabled:!s,autoFocus:u.focus,placeholder:u.placeholder})},zJ=We(2,Jb);var OJ=Qt(vr(MJ));const DJ=e=>{if(typeof e=="string"){const t=e.split(":");return t.length===2&&t.push("00"),t.join(":")}return e},LJ=e=>{const{data:t,className:r,id:n,enabled:s,uischema:o,path:a,handleChange:i}=e;return B.createElement("input",{type:"time",value:t||"",onChange:c=>i(a,DJ(c.target.value)),className:r,id:n,disabled:!s,autoFocus:o.options&&o.options.focus})},FJ=We(2,Qb);var BJ=Qt(vr(LJ));const af=(e,t,r,n,s)=>{if(he(e.elements))return[];const{renderers:o,cells:a}=$o();return e.elements.map((i,c)=>B.createElement("div",{className:r,key:`${n}-${c}`},B.createElement(Mi,{renderers:o,cells:a,uischema:i,schema:t,path:n,enabled:s})))},UJ=We(1,De("Group")),WJ=e=>{const{data:t,...r}=e;return B.createElement(VJ,{...r})},VJ=B.memo(function({schema:t,uischema:r,path:n,enabled:s,visible:o,label:a,getStyle:i,getStyleAsClassName:c}){const u=r,d=u.elements?u.elements.length:0,f=c("group.layout"),p=["group-layout-item"].concat(i("group.layout.item",d)).join(" ");return B.createElement("fieldset",{className:f,hidden:o==null?!1:!o},he(a)?"":B.createElement("legend",{className:c("group.label")},a),af(u,t,p,n,s))});var KJ=Xt(Ii(WJ));const Tx=({className:e,children:t,visible:r})=>B.createElement("div",{className:e,hidden:r==null?!1:!r},t),HJ=We(1,De("HorizontalLayout")),GJ=e=>{const{data:t,...r}=e;return B.createElement(qJ,{...r})},qJ=B.memo(function({schema:t,uischema:r,getStyle:n,getStyleAsClassName:s,enabled:o,visible:a,path:i}){const c=r,u=c.elements?c.elements.length:0,d=s("horizontal.layout"),f=["horizontal-layout-item"].concat(n("horizontal.layout.item",u)).join(" ");return B.createElement(Tx,{className:d,visible:a,enabled:o,path:i,uischema:r,schema:t,getStyle:n,getStyleAsClassName:s},af(c,t,f,i,o))});var YJ=Xt(Ii(GJ,!1));const JJ=We(1,De("VerticalLayout")),ZJ=e=>{const{data:t,...r}=e;return B.createElement(QJ,{...r})},QJ=B.memo(function({schema:t,uischema:r,path:n,visible:s,enabled:o,getStyle:a,getStyleAsClassName:i}){const c=r,u=c.elements?c.elements.length:0,d=i("vertical.layout"),f=["vertical-layout-item"].concat(a("vertical.layout.item",u)).join(" ");return B.createElement(Tx,{className:d,uischema:r,schema:t,visible:s,enabled:o,path:n,getStyle:a,getStyleAsClassName:i},af(c,t,f,n,o))});var XJ=Xt(Ii(ZJ,!1));const eZ=[{tester:NY,renderer:PY},{tester:TY,renderer:IY},{tester:zY,renderer:OY},{tester:UY,renderer:BY},{tester:qY,renderer:JY},{tester:WY,renderer:GY},{tester:rJ,renderer:sJ},{tester:UJ,renderer:KJ},{tester:JJ,renderer:XJ},{tester:HJ,renderer:YJ}],tZ=[{tester:aJ,cell:iJ},{tester:cJ,cell:uJ},{tester:fJ,cell:hJ},{tester:mJ,cell:gJ},{tester:bJ,cell:xJ},{tester:_J,cell:CJ},{tester:jJ,cell:EJ},{tester:NJ,cell:PJ},{tester:zJ,cell:OJ},{tester:TJ,cell:IJ},{tester:FJ,cell:BJ}];function rZ(e,t){return e.split(".").reduce((r,n)=>{if(r!=null&&typeof r=="object"&&!Array.isArray(r))return r[n]},t)}function nZ(e,t){return e.replace(/\$\{([^}]+)\}/g,(r,n)=>{const s=rZ(n.trim(),t);return s==null?"":String(s)})}function Ix(e,t){return typeof e=="string"?nZ(e,t):Array.isArray(e)?e.map(r=>Ix(r,t)):e!==null&&typeof e=="object"?Mx(e,t):e}function Mx(e,t){const r={};for(const[n,s]of Object.entries(e))r[n]=Ix(s,t);return r}function sZ(e,t){return{id:e.id,boardId:t,status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,content:e.content,actions:e.actions,forms:e.forms,formData:e.formData,metadata:e.metadata}}let Ml=null;function lf(){return Ml||(Ml=acquireVsCodeApi()),Ml}const oZ=lf(),zx=Rb({allErrors:!0,strict:!1});function ar(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Jr(e){return e?{...e}:{}}function aZ(e){return ar(e.properties)?new Set(Object.keys(e.properties)):new Set}function iZ(e,t){if(!ar(e.metadata))return{};const r=aZ(t);return r.size===0?{}:Object.fromEntries(Object.entries(e.metadata).filter(([n])=>r.has(n)))}function lZ(e,t){return typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():t}function cZ(e,t){return typeof(t==null?void 0:t.name)=="string"&&t.name.trim().length>0?t.name.trim():Yg(e)}function uZ(e){return typeof(e==null?void 0:e.description)=="string"?e.description.trim():""}function dZ(){const e=new Set;return(t,r,n)=>{const o=(typeof(r==null?void 0:r.title)=="string"&&r.title.trim().length>0?r.title.trim():`form-${n}`).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,50),a=t??(o||`form-${n}`);let i=a,c=2;for(;e.has(i);)i=`${a}-${c++}`;return e.add(i),i}}function fZ(e,t){const r=e.forms??[],n=(t==null?void 0:t.forms)??{},s=dZ(),o=sZ(e,e.boardId??(t==null?void 0:t.id)??"");return r.flatMap((a,i)=>{var g;const c=a.name?n[a.name]:void 0,u=ar(a.schema)?a.schema:ar(c==null?void 0:c.schema)?c.schema:void 0;if(!u)return[];const d=s(a.name,u,i),f=a.name?cZ(a.name,c):lZ(u,Yg(d)),p=a.name?uZ(c):"",h={...Jr(c==null?void 0:c.data),...Jr(ar(a.data)?a.data:void 0),...Jr((g=e.formData)==null?void 0:g[d])};return[{id:d,name:f,description:p,label:f,schema:u,...ar(a.ui)?{ui:a.ui}:ar(c==null?void 0:c.ui)?{ui:c.ui}:{},initialData:{...Mx(h,o),...iZ(e,u)},fromConfig:!!(a.name&&c)}]})}function Zo(e,t){const r=zx.compile(e);return r(t)?[]:r.errors??[]}function hZ(e){var s;const r=(typeof((s=e.params)==null?void 0:s.missingProperty)=="string"?e.params.missingProperty:"")||e.instancePath||"/",n=e.message||"is invalid";return`${r} ${n}`.trim()}function pZ(e,t,r){return(r==null?void 0:r.formId)===e&&r.dataSignature===t}function mZ({cardId:e,boardId:t,form:r,className:n,onSubmitted:s}){const o=x.useMemo(()=>JSON.stringify(r.initialData),[r.initialData]),[a,i]=x.useState(()=>Jr(r.initialData)),[c,u]=x.useState(()=>Zo(r.schema,Jr(r.initialData))),[d,f]=x.useState(!1),[p,h]=x.useState(null),[g,m]=x.useState(null),v=x.useRef(null),y=x.useRef(null);x.useEffect(()=>{const w=Jr(r.initialData);i(w),u(Zo(r.schema,w)),h(null),m(_=>pZ(r.id,o,y.current)?_??`Saved ${r.name}`:null)},[r.id,r.name,r.schema,r.initialData,o]),x.useEffect(()=>()=>{v.current&&(window.removeEventListener("message",v.current),v.current=null)},[]);const b=async()=>{var R,z;const w=Zo(r.schema,a);if(u(w),h(null),m(null),w.length>0||d)return;const _=`submit-form-${e}-${r.id}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;f(!0);try{const D=await new Promise((E,P)=>{const K=O=>{const G=O.data;if(!(!G||G.type!=="submitFormResult"||G.callbackKey!==_)){if(window.removeEventListener("message",K),v.current=null,G.error){P(new Error(G.error));return}if(!G.result){P(new Error("Form submission failed without a result payload"));return}E(G.result)}};v.current=K,window.addEventListener("message",K),oZ.postMessage({type:"submitForm",cardId:e,formId:r.id,data:a,callbackKey:_,...t?{boardId:t}:{}})}),j=ar((R=D.card.formData)==null?void 0:R[r.id])?(z=D.card.formData)==null?void 0:z[r.id]:D.data,S=Jr(j);y.current={formId:r.id,dataSignature:JSON.stringify(S)},i(S),u(Zo(r.schema,S)),m(`Saved ${r.name}`),s==null||s(D)}catch(D){y.current=null,h(D instanceof Error?D.message:String(D))}finally{f(!1)}},C=c.length>0;return l.jsxs("div",{className:Ee("flex h-full flex-col",n),children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"truncate text-sm font-semibold",style:{color:"var(--vscode-foreground)"},children:r.name}),r.fromConfig&&l.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:"Shared"})]}),r.description&&l.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:r.description}),C&&l.jsx("p",{className:"mt-1 text-xs font-medium",style:{color:"var(--vscode-errorForeground)"},children:`Fix ${c.length} validation error${c.length===1?"":"s"} before submitting.`})]}),l.jsx("button",{type:"button",onClick:b,disabled:C||d,className:"rounded px-3 py-1.5 text-xs font-medium transition-opacity disabled:cursor-not-allowed disabled:opacity-50",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:C?"Resolve validation errors before submitting":void 0,children:d?"Submitting…":"Submit"})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[l.jsx("div",{className:"card-jsonforms p-4",children:l.jsx(rY,{schema:r.schema,uischema:r.ui,data:a,renderers:eZ,cells:tZ,ajv:zx,validationMode:"ValidateAndShow",onChange:({data:w,errors:_})=>{const R=ar(w)?w:{};y.current=null,i(R),u(_??[]),h(null),m(null)}})}),(p||g||C)&&l.jsxs("div",{className:"space-y-2 px-4 pb-4",children:[p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-errorForeground) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-errorForeground) 40%, transparent)",color:"var(--vscode-errorForeground)"},children:p}),g&&!p&&l.jsx("div",{className:"rounded px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--vscode-testing-iconPassed) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--vscode-testing-iconPassed) 40%, transparent)",color:"var(--vscode-testing-iconPassed)"},children:g}),C&&l.jsxs("div",{className:"rounded px-3 py-2",style:{background:"var(--vscode-inputValidation-warningBackground, color-mix(in srgb, var(--vscode-editorWarning-foreground, #d7ba7d) 10%, transparent))",border:"1px solid var(--vscode-inputValidation-warningBorder, var(--vscode-editorWarning-foreground, #d7ba7d))"},children:[l.jsx("p",{className:"mb-2 text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:"Validation issues"}),l.jsx("ul",{className:"space-y-1 pl-4 text-xs",style:{color:"var(--vscode-foreground)"},children:c.map((w,_)=>l.jsx("li",{className:"list-disc",children:hZ(w)},`${w.instancePath??"/"}-${w.message??"invalid"}-${_}`))})]})]})]})]})}function Ox({value:e,onChange:t,placeholder:r="Write markdown...",className:n,autoFocus:s,mode:o="create",comments:a,onAddComment:i,onUpdateComment:c,onDeleteComment:u,logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h,cardId:g,frontmatter:m,onFormSubmitSuccess:v}){const y=o==="edit",b=y?"Edit":"Write",C=q(L=>L.activeCardTab),w=q(L=>L.setActiveCardTab),_=q(L=>L.boards),R=q(L=>L.currentBoard),[z,D]=x.useState("write"),j=y?C:z,S=L=>{y?w(L):D(L)},E=x.useRef(null),P=x.useMemo(()=>_.find(L=>L.id===R),[_,R]),K=x.useMemo(()=>y&&m?fZ({...m,content:e},P):[],[P,m,y,e]),O=x.useMemo(()=>e.trim()?Ae.parse(e,{async:!1,gfm:!0,breaks:!0}):"",[e]);x.useEffect(()=>{j==="write"&&E.current&&E.current.focus()},[j]),x.useEffect(()=>{s&&E.current&&E.current.focus()},[s]);const G=x.useCallback(L=>{E.current&&y0(E.current,e,t,L)},[e,t]),V=L=>{if(L.key==="Tab"){L.preventDefault();const U=L.currentTarget,oe=U.selectionStart,Y=U.selectionEnd,N=e.substring(0,oe)+" "+e.substring(Y);t(N),requestAnimationFrame(()=>{U.selectionStart=U.selectionEnd=oe+2})}(L.metaKey||L.ctrlKey)&&L.key==="b"&&(L.preventDefault(),L.stopPropagation(),G("bold")),(L.metaKey||L.ctrlKey)&&L.key==="i"&&(L.preventDefault(),G("italic")),(L.metaKey||L.ctrlKey)&&L.key==="k"&&(L.preventDefault(),G("link"))};return l.jsxs("div",{className:Ee("card-markdown-shell h-full",n),children:[l.jsxs("div",{className:"card-markdown-header shrink-0",children:[l.jsxs("div",{className:"card-markdown-tabs",children:[(y?["preview","write"]:["write","preview"]).map(L=>l.jsx("button",{type:"button",onClick:()=>S(L),className:Ee("card-markdown-tab",j===L&&"is-active"),children:L==="write"?b:"Preview"},L)),K.map(L=>{const U=nc(L.id);return l.jsx("button",{type:"button",onClick:()=>S(U),className:Ee("card-markdown-tab",j===U&&"is-active"),children:`form: ${L.name}`},U)}),a&&l.jsxs("button",{type:"button",onClick:()=>S("comments"),className:Ee("card-markdown-tab",j==="comments"&&"is-active"),children:[l.jsx(i1,{size:12}),"Comments",a.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:a.length})]}),d&&l.jsxs("button",{type:"button",onClick:()=>S("logs"),className:Ee("card-markdown-tab",j==="logs"&&"is-active"),children:[l.jsx(tg,{size:12}),"Logs",d.length>0&&l.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d.length})]})]}),j==="write"&&l.jsxs("div",{className:"card-markdown-toolbar",children:[l.jsx(rt,{icon:l.jsx(l1,{size:14}),title:"Heading",onClick:()=>G("heading")}),l.jsx(rt,{icon:l.jsx(qm,{size:14}),title:"Bold (⌘B)",onClick:()=>G("bold")}),l.jsx(rt,{icon:l.jsx(Ym,{size:14}),title:"Italic (⌘I)",onClick:()=>G("italic")}),l.jsx(rt,{icon:l.jsx(Jm,{size:14}),title:"Quote",onClick:()=>G("quote"),separator:!0}),l.jsx(rt,{icon:l.jsx(Zm,{size:14}),title:"Code",onClick:()=>G("code")}),l.jsx(rt,{icon:l.jsx(Qm,{size:14}),title:"Link (⌘K)",onClick:()=>G("link")}),l.jsx(rt,{icon:l.jsx(Xm,{size:14}),title:"Bulleted list",onClick:()=>G("ul"),separator:!0}),l.jsx(rt,{icon:l.jsx(eg,{size:14}),title:"Numbered list",onClick:()=>G("ol")}),l.jsx(rt,{icon:l.jsx(c1,{size:14}),title:"Task list",onClick:()=>G("tasklist")})]})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[j==="write"&&l.jsx("textarea",{ref:E,value:e,onChange:L=>t(L.target.value),onKeyDown:V,placeholder:r,className:"markdown-editor-textarea",spellCheck:!1}),j==="preview"&&l.jsx("div",{className:"min-h-[200px]",children:O?l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:O}}):l.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),K.map(L=>{const U=nc(L.id);return g?l.jsx("div",{className:Ee("h-full",j===U?"block":"hidden"),children:l.jsx(mZ,{cardId:g,boardId:P==null?void 0:P.id,form:L,onSubmitted:v})},U):null}),j==="comments"&&a&&i&&c&&u&&l.jsx(J$,{comments:a,onAddComment:i,onUpdateComment:c,onDeleteComment:u}),j==="logs"&&d&&f&&l.jsx(M0,{logs:d,onClearLogs:f,logsFilter:p,onLogsFilterChange:h})]})]})}function Qa({panelMode:e,onPreview:t,onCommit:r,onCancel:n}){const s=x.useRef(null),o=x.useRef(t),a=x.useRef(r),i=x.useRef(n);return o.current=t,a.current=r,i.current=n,x.useEffect(()=>{if(typeof window>"u")return;const c=Q_({eventTarget:window,getPanelMode:()=>e,getViewportWidth:()=>window.innerWidth,onPreview:u=>o.current(u),onCommit:u=>a.current(u),onCancel:()=>i.current()});return s.current=c,()=>{c.dispose(),s.current=null}},[e]),e!=="drawer"?null:l.jsx("button",{type:"button","aria-label":"Resize drawer",title:"Drag to resize drawer","data-panel-resize-handle":"",className:"absolute inset-y-0 left-0 z-10 w-3 cursor-ew-resize touch-none pointer-events-auto",onPointerDown:c=>{var u,d,f;c.preventDefault(),(d=(u=c.currentTarget).setPointerCapture)==null||d.call(u,c.pointerId),(f=s.current)==null||f.start({clientX:c.clientX})},children:l.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-0 left-1/2 w-px -translate-x-1/2",style:{background:"var(--vscode-panel-border)"}})})}const gZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}];function Om({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ee("relative",n),children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{type:"button",onClick:()=>{r(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:c=>{i.value!==e&&(c.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:c=>{i.value!==e&&(c.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(St,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function vZ({value:e,onChange:t}){const[r,n]=x.useState(!1),s=x.useRef(null),o=x.useRef(null),a=q(f=>f.cards),i=x.useMemo(()=>{const f=new Set;return a.forEach(p=>{p.assignee&&f.add(p.assignee)}),Array.from(f).sort()},[a]),c=x.useMemo(()=>e.trim()?i.filter(f=>f.toLowerCase().includes(e.toLowerCase())&&f!==e):i,[e,i]),u=r&&c.length>0,d=e.trim()?e.trim().split(/\s+/).map(f=>f[0]).join("").toUpperCase().slice(0,2):null;return l.jsxs("div",{ref:o,className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var f;return(f=s.current)==null?void 0:f.focus()},children:[d&&l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d}),l.jsx("input",{ref:s,type:"text",value:e,onChange:f=>t(f.target.value),onFocus:()=>n(!0),onBlur:()=>setTimeout(()=>n(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),u&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:c.map(f=>l.jsxs("button",{type:"button",onMouseDown:p=>{p.preventDefault(),t(f)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:p=>p.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:f.split(/\s+/).map(p=>p[0]).join("").toUpperCase().slice(0,2)}),l.jsx("span",{children:f})]},f))})]})}function yZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=q(h=>h.cards),c=q(h=>h.labelDefs),u=x.useMemo(()=>{const h=new Set;return i.forEach(g=>g.labels.forEach(m=>h.add(m))),Array.from(h).sort()},[i]),d=x.useMemo(()=>{const h=u.filter(g=>!e.includes(g));return r.trim()?h.filter(g=>g.toLowerCase().includes(r.toLowerCase())):h},[r,u,e]),f=s&&d.length>0,p=h=>{const g=(h||r).trim();g&&!e.includes(g)&&t([...e,g]),n("")};return l.jsxs("div",{className:"relative flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var h;return(h=a.current)==null?void 0:h.focus()},children:[e.map(h=>{const g=c[h];return l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[h,l.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),t(e.filter(v=>v!==h))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},h)}),l.jsx("input",{ref:a,type:"text",value:r,onChange:h=>n(h.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:h=>{var g;h.key==="Enter"&&(h.preventDefault(),p()),h.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),h.key==="Escape"&&(n(""),(g=a.current)==null||g.blur())},placeholder:e.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),f&&l.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:d.map(h=>{const g=c[h];return l.jsx("button",{type:"button",onMouseDown:m=>{m.preventDefault(),p(h)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:l.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:g?{backgroundColor:`${g.color}20`,color:g.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:h})},h)})})]})}function bZ({actions:e,onChange:t}){const[r,n]=x.useState(""),s=x.useRef(null),o=a=>{const i=r.trim();i&&!e.includes(i)&&t([...e,i]),n("")};return l.jsx("div",{className:"relative flex-1",children:l.jsxs("label",{className:"flex items-center gap-1.5 flex-wrap cursor-text",children:[e.map(a=>l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[a,l.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),t(e.filter(c=>c!==a))},className:"hover:text-red-500 transition-colors",children:l.jsx(st,{size:9})})]},a)),l.jsx("input",{ref:s,type:"text",value:r,onChange:a=>n(a.target.value),onKeyDown:a=>{var i;(a.key==="Enter"||a.key===",")&&(a.preventDefault(),o()),a.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),a.key==="Escape"&&(n(""),(i=s.current)==null||i.blur())},placeholder:e.length===0?"Add actions...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]})})}function $n({label:e,icon:t,children:r}){return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:n=>n.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[l.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function xZ({isOpen:e,...t}){return e?l.jsx(wZ,{isOpen:e,...t}):null}function wZ({isOpen:e,onClose:t,onCreate:r,onSaveSettings:n,initialStatus:s}){const o=q(V=>V.cardSettings),a=q(V=>V.effectiveDrawerWidth),i=q(V=>V.setDrawerWidthPreview),c=q(V=>V.clearDrawerWidthPreview),u=q(V=>V.setCardSettings),d=q(V=>V.columns),f=x.useMemo(()=>d.filter(V=>V.id!==qn).map(V=>({value:V.id,label:V.name,dotColor:V.color})),[d]),[p,h]=x.useState(""),[g,m]=x.useState(s??o.defaultStatus),[v,y]=x.useState(o.defaultPriority),[b,C]=x.useState(""),[w,_]=x.useState(""),[R,z]=x.useState([]),[D,j]=x.useState([]),[S,E]=x.useState(""),P=x.useRef(null);x.useEffect(()=>{const V=setTimeout(()=>{var L;return(L=P.current)==null?void 0:L.focus()},50);return()=>clearTimeout(V)},[]);const K=()=>{const V=S.trim(),L=p.trim(),U=L?`# ${L}${V?`
131
131
 
132
- ${V}`:""}`:V;r({status:g,priority:v,content:U,assignee:b.trim()||null,dueDate:w||null,labels:R,actions:D})},O=()=>{K(),t()},q=()=>{t()};return x.useEffect(()=>{const V=L=>{L.key==="Escape"&&q(),(L.metaKey||L.ctrlKey)&&L.key==="Enter"&&O(),(L.metaKey||L.ctrlKey)&&L.key==="s"&&(L.preventDefault(),O())};if(e)return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)}),l.jsxs("div",{className:`fixed inset-0 z-50 flex ${(o.panelMode??"drawer")==="drawer"?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[(o.panelMode??"drawer")!=="drawer"&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:q}),l.jsxs("div",{className:(o.panelMode??"drawer")==="drawer"?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:{background:"var(--vscode-editor-background)",...(o.panelMode??"drawer")==="drawer"?{width:`${a}%`,borderLeft:"1px solid var(--vscode-panel-border)"}:{border:"1px solid var(--vscode-panel-border)"}},...(o.panelMode??"drawer")==="drawer"?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:(o.panelMode??"drawer")==="drawer"?"drawer":"popup",onPreview:i,onCommit:V=>{c();const L={...G.getState().cardSettings,drawerWidth:V};u(L),n(L)},onCancel:c}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Card"})}),l.jsx("button",{onClick:q,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx($n,{label:"Status",icon:l.jsx(lg,{size:13}),children:l.jsx(Wm,{value:g,options:f,onChange:V=>m(V)})}),o.showPriorityBadges&&l.jsx($n,{label:"Priority",icon:l.jsx(Wc,{size:13}),children:l.jsx(Wm,{value:v,options:cZ.map(V=>({value:V.value,label:V.label,dot:V.dot})),onChange:V=>y(V)})}),o.showAssignee&&l.jsx($n,{label:"Assignee",icon:l.jsx(ga,{size:13}),children:l.jsx(uZ,{value:b,onChange:C})}),o.showDueDate&&l.jsx($n,{label:"Due date",icon:l.jsx(Bc,{size:13}),children:l.jsx(u$,{value:w,onChange:_})}),o.showLabels&&l.jsx($n,{label:"Labels",icon:l.jsx(Xa,{size:13}),children:l.jsx(dZ,{labels:R,onChange:z})}),l.jsx($n,{label:"Actions",icon:l.jsx(ma,{size:13}),children:l.jsx(fZ,{actions:D,onChange:j})})]}),l.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[l.jsx("textarea",{ref:P,value:p,onChange:V=>h(V.target.value),placeholder:"Card title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:V=>{const L=V.target;L.style.height="auto",L.style.height=L.scrollHeight+"px"},onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&V.preventDefault()}}),l.jsx(Wx,{value:S,onChange:E,placeholder:"Add a description..."})]}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[l.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:q,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:O,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}function Vm({value:e}){const[t,r]=x.useState(!1),n=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1 cursor-pointer",onClick:n,title:"Click to copy",children:[l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300",children:e}),l.jsx("span",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}const mZ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},gZ=["critical","high","medium","low"],vZ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},yZ=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],bZ={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},xZ={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function wZ({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ee("relative",s&&"z-30",n),children:[l.jsxs("button",{onClick:()=>o(!s),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",a.dot)}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>o(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[172px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{onClick:()=>{r(i.value),o(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:c=>{i.value!==e&&(c.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:c=>{i.value!==e&&(c.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",i.dot)}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(St,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function kZ({value:e,onChange:t,onTransferToBoard:r}){const[n,s]=x.useState(!1),o=G(u=>u.columns),a=G(u=>u.boards),i=G(u=>u.currentBoard),c=a.filter(u=>u.id!==i);return l.jsxs("div",{className:Ee("relative",n&&"z-30"),children:[l.jsxs("button",{onClick:()=>s(!n),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(()=>{const u=o.find(d=>d.id===e);return u?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),l.jsx("span",{children:u.name})]}):l.jsx("span",{children:e})})(),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>s(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[204px] max-h-[320px] overflow-y-auto",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[o.map(u=>l.jsxs("button",{onClick:()=>{t(u.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:u.id===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:d=>{u.id!==e&&(d.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:d=>{u.id!==e&&(d.currentTarget.style.background="transparent")},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),l.jsx("span",{className:"flex-1 text-left",children:u.name}),u.id===e&&l.jsx(St,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},u.id)),c.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mx-2 my-1",style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Move to..."}),c.map(u=>l.jsxs("div",{children:[l.jsx("div",{className:"px-4 py-1 text-[10px] font-semibold",style:{color:"var(--vscode-descriptionForeground)"},children:u.name}),(u.columns||[]).map(d=>l.jsxs("button",{onClick:()=>{r(u.id,d.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 pl-5 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:f=>{f.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d.color}}),l.jsx("span",{className:"flex-1 text-left",children:d.name})]},`${u.id}-${d.id}`))]},u.id))]})]})]})]})}function kr({label:e,icon:t,children:r}){return l.jsxs("div",{className:"card-property-row",children:[l.jsxs("div",{className:"card-property-label-group",children:[l.jsx("span",{className:"card-property-icon",style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"card-property-label",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"card-property-value",children:r})]})}function Vx(e){return Array.isArray(e)?e.map(t=>String(t)).join(","):String(e)}function Fc({path:e,value:t}){const r=G(n=>n.applyMetadataFilterToken);return l.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),r(e,t)},className:"shrink-0 rounded p-0.5 opacity-60 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-1 focus:ring-blue-500",style:{color:"var(--vscode-descriptionForeground)"},title:`Filter cards by ${e}`,"aria-label":`Filter cards by metadata ${e} = ${t}`,children:l.jsx(b1,{size:11})})}function _Z({onSelect:e}){const[t,r]=x.useState(!1),[n,s]=x.useState("claude"),o=xZ[n],a=bZ[n];return l.jsxs("div",{className:Ee("relative",t&&"z-30"),children:[l.jsxs("button",{onClick:()=>r(!t),className:Ee("card-inline-action card-inline-action--solid",a.bg,a.hover,a.shadow,a.border),children:[l.jsx(y1,{size:13}),l.jsx("span",{children:"Build with AI"}),l.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),l.jsx(Ze,{size:11,className:Ee("ml-0.5 opacity-60 transition-transform",t&&"rotate-180")})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>r(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full right-0 mt-1 min-w-[240px] overflow-hidden bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700",children:[l.jsx("div",{className:"flex",children:yZ.map(i=>l.jsx("button",{onClick:()=>s(i.agent),className:Ee("flex-1 px-3 py-2 text-[11px] font-medium transition-all",n===i.agent?i.activeColor:Ee("text-zinc-600 dark:text-zinc-400",i.color)),children:i.label},i.agent))}),l.jsx("div",{className:"p-1 space-y-1",children:o.map(i=>l.jsxs("button",{onClick:()=>{e(n,i.permissionMode),r(!1)},className:"w-full text-left px-2.5 py-1.5 rounded-[8px] hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[l.jsx("div",{className:"text-[11px] font-medium text-zinc-900 dark:text-zinc-100",children:i.label}),l.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:i.description})]},i.permissionMode))})]})]})]})}function CZ({actions:e,onTriggerAction:t}){const[r,n]=x.useState(!1),s=Array.isArray(e)?e.map(o=>({key:o,label:o})):Object.entries(e).map(([o,a])=>({key:o,label:a}));return l.jsxs("div",{className:Ee("relative",r&&"z-30"),children:[l.jsxs("button",{onClick:()=>n(!r),className:"card-inline-action",style:{color:"var(--vscode-foreground)",border:"1px solid var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},children:[l.jsx("span",{children:"Run Action"}),l.jsx(Ze,{size:11,className:Ee("opacity-60 transition-transform",r&&"rotate-180")})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button","aria-label":"Close actions menu",className:"card-floating-dismiss cursor-default",onClick:()=>n(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full right-0 mt-1",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:s.map(({key:o,label:a})=>l.jsx("button",{type:"button",onClick:()=>{n(!1),t(o)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors whitespace-nowrap",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent"},children:a},o))})]})]})}function Kx({size:e=16}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 19.88V4.12a1.5 1.5 0 0 0-.85-1.533zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}function _r({title:e,icon:t,onClick:r,variant:n="default",label:s}){return l.jsxs("button",{type:"button",onClick:r,className:Ee("card-action-button",n!=="default"&&`card-action-button--${n}`),title:e,"aria-label":e,children:[l.jsx("span",{className:"card-action-button__icon",children:t}),s&&l.jsx("span",{className:"card-action-button__label",children:s})]})}function Hx(e){return/^https?:\/\//i.test(e)}function $Z(e){return/^(\/|~\/|\.{1,2}\/|[A-Za-z]:[/\\])/i.test(e)}function SZ({value:e}){const[t,r]=x.useState(!1),n=s=>{s.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300 hover:underline",title:e,onClick:s=>s.stopPropagation(),children:[l.jsx(cg,{size:10,className:"shrink-0"}),l.jsx("span",{className:"break-all",children:e})]}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:n,title:"Copy URL",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function jZ({value:e,onOpenFile:t}){const[r,n]=x.useState(!1),s=o=>{o.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[t&&l.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100 transition-opacity cursor-pointer",onClick:o=>{o.stopPropagation(),t(e)},title:"Open in VS Code",children:l.jsx(Kx,{size:11})}),l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300 break-all",children:e}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:s,title:"Copy path",children:r?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function EZ({metadata:e,onOpenMetadataFile:t}){if(!e||Object.keys(e).length===0)return null;const r=Object.keys(e);return l.jsxs("div",{className:"card-metadata-section",children:[l.jsxs("div",{className:"card-metadata-section__header",children:[l.jsx("span",{children:"Metadata"}),l.jsx("span",{className:"card-metadata-section__count",children:r.length})]}),l.jsx("div",{className:"card-metadata-tree-shell",children:l.jsx(qx,{data:e,depth:0,onOpenMetadataFile:t})})]})}function qx({data:e,depth:t,pathPrefix:r="",onOpenMetadataFile:n}){return l.jsx("div",{style:{paddingLeft:t>0?12:0},children:Object.entries(e).map(([s,o])=>{const a=r?`${r}.${s}`:s,i=Vx(o);return l.jsx("div",{className:"py-0.5",children:o&&typeof o=="object"&&!Array.isArray(o)?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,":"]}),l.jsx(qx,{data:o,depth:t+1,pathPrefix:a,onOpenMetadataFile:n})]}):Array.isArray(o)?l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),l.jsx(Vm,{value:`[${o.join(", ")}]`}),l.jsx(Fc,{path:a,value:i})]}):l.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),Hx(String(o))?l.jsx(SZ,{value:String(o)}):$Z(String(o))?l.jsx(jZ,{value:String(o),onOpenFile:n}):l.jsx(Vm,{value:String(o)}),l.jsx(Fc,{path:a,value:i})]})},s)})})}function AZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=G(m=>m.cards),c=G(m=>m.labelDefs),u=G(m=>m.applyLabelFilter),d=x.useMemo(()=>{const m=new Set;return i.forEach(v=>v.labels.forEach(y=>m.add(y))),Array.from(m).sort()},[i]),f=x.useMemo(()=>{const m=d.filter(v=>!e.includes(v));return r.trim()?m.filter(v=>v.toLowerCase().includes(r.toLowerCase())):m},[r,d,e]),p=s&&f.length>0,h=m=>{const v=(m||r).trim();v&&!e.includes(v)&&t([...e,v]),n("")},g=m=>{t(e.filter(v=>v!==m))};return l.jsxs("div",{className:Ee("relative flex items-center gap-2 flex-wrap",p&&"z-30"),children:[e.map(m=>{const v=c[m];return l.jsxs("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[l.jsx("button",{type:"button",onClick:()=>u(m),className:"hover:underline",title:`Filter cards by label ${m}`,"aria-label":`Filter cards by label ${m}`,children:m}),l.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),g(m)},className:"hover:text-red-500 transition-colors","aria-label":`Remove label ${m}`,children:l.jsx(st,{size:9})})]},m)}),l.jsxs("button",{onClick:()=>{o(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.focus()},0)},className:"card-label-add",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Zr,{size:10}),l.jsx("span",{children:"Add label"})]}),l.jsx("input",{ref:a,type:"text",value:r,onChange:m=>n(m.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:m=>{var v;m.key==="Enter"&&(m.preventDefault(),h()),m.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),m.key==="Escape"&&(n(""),(v=a.current)==null||v.blur())},placeholder:e.length===0?"Add labels...":"",className:"card-label-input",style:{color:"var(--vscode-foreground)",display:s||r?"block":"none"}}),p&&l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 max-h-[200px] overflow-auto min-w-[220px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:f.map(m=>{const v=c[m];return l.jsx("button",{type:"button",onMouseDown:y=>{y.preventDefault(),h(m)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:l.jsx("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m})},m)})})]})}function NZ({cardId:e,content:t,frontmatter:r,comments:n,contentVersion:s,onSave:o,onClose:a,onDelete:i,onPermanentDelete:c,onRestore:u,onOpenFile:d,onOpenMetadataFile:f,onDownloadCard:p,onStartWithAI:h,onAddAttachment:g,onOpenAttachment:m,onRemoveAttachment:v,onAddComment:y,onUpdateComment:b,onDeleteComment:C,onTransferToBoard:w,onTriggerAction:_,logs:R,onClearLogs:z,logsFilter:D,onLogsFilterChange:j}){var M;const{cardSettings:S,boards:E,currentBoard:P}=G(),K=((M=E.find(J=>J.id===P))==null?void 0:M.metadata)??[],[O,q]=x.useState(r),[V,L]=x.useState(t),[U,oe]=x.useState(!1),[Y,N]=x.useState(!1),Z=O.status===Gn,I=tu(V),k=O.metadata??{},$=x.useMemo(()=>K.map(J=>({key:J,value:k[J]})).filter(({value:J})=>J!=null&&String(J).trim()!==""),[k,K]),A=x.useRef(null),W=x.useRef(O),H=x.useRef(V);W.current=O,H.current=V;const ee=x.useCallback(()=>{o(H.current,W.current)},[o]);x.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),x.useEffect(()=>{L(t)},[e,s]),x.useEffect(()=>{q(r)},[r]);const re=x.useCallback(J=>{L(J),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{o(J,W.current)},800)},[o]),le=x.useCallback(J=>{q(se=>{const ue={...se,...J};return A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{o(H.current,ue)},800),ue})},[o]),pe=x.useCallback(J=>{q(se=>({...se,formData:J.card.formData,modified:J.card.modified}))},[]);return x.useEffect(()=>{const J=se=>{(se.metaKey||se.ctrlKey)&&se.key==="s"&&(se.preventDefault(),A.current&&clearTimeout(A.current),ee()),(se.metaKey||se.ctrlKey)&&se.key==="b"&&S.showBuildWithAI&&(se.preventDefault(),h("claude","default")),se.key==="Escape"&&(A.current&&(clearTimeout(A.current),ee()),a())};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[ee,a,h,S.showBuildWithAI]),l.jsx("div",{className:"card-editor-shell h-full flex flex-col",children:l.jsx("div",{className:"card-editor-content flex-1 min-h-0 overflow-auto",children:l.jsxs("div",{className:"card-editor-stack",children:[l.jsxs("header",{className:"card-editor-hero",children:[l.jsxs("div",{className:"card-editor-hero-copy",children:[l.jsxs("div",{className:"card-editor-hero-meta",children:[l.jsx("span",{className:"card-editor-card-id",children:e}),l.jsx("span",{className:"card-editor-hero-separator","aria-hidden":"true"}),l.jsx("span",{title:Bs(O.modified),children:sa(O.modified)})]}),l.jsx("h1",{className:"card-editor-title",children:I})]}),l.jsxs("div",{className:"card-editor-hero-actions",children:[O.actions&&(Array.isArray(O.actions)?O.actions.length>0:Object.keys(O.actions).length>0)&&_&&l.jsx(CZ,{actions:O.actions,onTriggerAction:_}),S.showBuildWithAI&&l.jsx(_Z,{onSelect:h}),Z?U?l.jsxs("div",{className:"card-delete-confirmation",children:[l.jsx("span",{className:"card-delete-confirmation__text",children:"Delete this card from disk?"}),l.jsx(_r,{title:"Confirm permanent delete",icon:l.jsx(Kt,{size:15}),label:"Delete",onClick:()=>{oe(!1),c()},variant:"danger"}),l.jsx(_r,{title:"Cancel permanent delete",icon:l.jsx(gf,{size:15}),label:"Keep",onClick:()=>oe(!1)})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Restore card",icon:l.jsx(gf,{size:15}),label:"Restore",onClick:u,variant:"primary"}),l.jsx(_r,{title:"Permanently delete from disk",icon:l.jsx(Kt,{size:15}),label:"Delete forever",onClick:()=>oe(!0),variant:"danger"})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Open in VS Code",icon:l.jsx(Kx,{size:15}),onClick:d}),l.jsx(_r,{title:"Download card as Markdown",icon:l.jsx(g1,{size:15}),onClick:p}),l.jsx(_r,{title:"Move to deleted",icon:l.jsx(Kt,{size:15}),onClick:i,variant:"danger"})]}),l.jsx(_r,{title:"Close card",icon:l.jsx(st,{size:16}),onClick:a})]})]}),l.jsxs("div",{className:Ee("card-editor-desktop-columns",S.compactMode&&"is-compact"),children:[l.jsxs("div",{className:"card-editor-top-row",children:[l.jsxs("section",{className:"card-surface card-surface--details",children:[l.jsx("div",{className:"card-surface-header",children:l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Overview"}),l.jsx("h2",{className:"card-surface-title",children:"Details"})]})}),l.jsxs("div",{className:"card-property-list",children:[l.jsx(kr,{label:"Status",icon:l.jsx(lg,{size:13}),children:l.jsx(kZ,{value:O.status,onChange:J=>le({status:J}),onTransferToBoard:w})}),S.showPriorityBadges&&l.jsx(kr,{label:"Priority",icon:l.jsx(Wc,{size:13}),children:l.jsx(wZ,{value:O.priority,options:gZ.map(J=>({value:J,label:mZ[J],dot:vZ[J]})),onChange:J=>le({priority:J})})}),S.showAssignee&&l.jsx(kr,{label:"Assignee",icon:l.jsx(ga,{size:13}),children:l.jsxs("div",{className:"card-property-chip card-property-chip--input",children:[l.jsx("span",{className:"card-property-avatar",style:{background:O.assignee?"var(--vscode-badge-background)":"rgba(148, 163, 184, 0.18)",color:O.assignee?"var(--vscode-badge-foreground)":"var(--vscode-descriptionForeground)"},children:O.assignee?O.assignee.split(/\s+/).filter(Boolean).map(J=>J[0]).join("").toUpperCase().slice(0,2):l.jsx(ga,{size:12})}),l.jsx("input",{type:"text",value:O.assignee||"",onChange:J=>le({assignee:J.target.value||null}),placeholder:"No assignee",className:"card-property-text-input",style:{color:O.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),S.showDueDate&&l.jsx(kr,{label:"Due date",icon:l.jsx(Bc,{size:13}),children:l.jsx("input",{type:"date",value:O.dueDate||"",onChange:J=>le({dueDate:J.target.value||null}),className:"card-date-input",style:{color:O.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),S.showLabels&&l.jsx(kr,{label:"Labels",icon:l.jsx(Xa,{size:13}),children:l.jsx(AZ,{labels:O.labels,onChange:J=>le({labels:J})})}),$.map(({key:J,value:se})=>{const ue=String(se);return l.jsx(kr,{label:J,icon:l.jsx(cg,{size:13}),children:l.jsxs("div",{className:"card-metadata-highlight min-w-0",children:[Hx(ue)?l.jsx("a",{href:ue,target:"_blank",rel:"noopener noreferrer",className:"card-metadata-highlight__link truncate",style:{color:"var(--vscode-textLink-foreground)"},children:ue}):l.jsx("span",{className:"card-metadata-highlight__value",style:{color:"var(--vscode-foreground)"},children:ue}),l.jsx(Fc,{path:J,value:Vx(se)})]})},J)}),l.jsxs("button",{type:"button",onClick:()=>N(J=>!J),className:"card-advanced-toggle",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Ze,{size:11,className:`opacity-60 transition-transform ${Y?"":"-rotate-90"}`}),l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",children:"Advanced"})]}),Y&&l.jsxs(l.Fragment,{children:[l.jsx(kr,{label:"Created",icon:l.jsx(Ul,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Aa(O.created)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(O.created),children:sa(O.created)})]})}),l.jsx(kr,{label:"Modified",icon:l.jsx(Ul,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Aa(O.modified)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(O.modified),children:sa(O.modified)})]})}),l.jsx("div",{className:"px-4 pb-2",children:l.jsx(EZ,{metadata:k,onOpenMetadataFile:f})})]})]})]}),l.jsxs("section",{className:Ee("card-surface card-surface--attachments",S.compactMode&&"card-surface--attachments-compact"),children:[l.jsxs("div",{className:"card-surface-header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Files"}),l.jsx("h2",{className:"card-surface-title",children:"Attachments"})]}),l.jsxs("button",{type:"button",onClick:g,className:"card-inline-action",children:[l.jsx(v1,{size:14}),l.jsx("span",{children:"Add attachment"})]})]}),O.attachments.length>0?l.jsx("div",{className:"card-attachment-tags",children:O.attachments.map(J=>l.jsxs("div",{className:"card-attachment-tag",children:[l.jsxs("button",{type:"button",onClick:()=>m(J),className:"card-attachment-tag__link",title:J,children:[l.jsx(Xm,{size:12}),l.jsx("span",{children:J})]}),l.jsx("button",{type:"button",onClick:()=>v(J),className:"card-attachment-tag__remove","aria-label":`Remove ${J}`,children:l.jsx(st,{size:12})})]},J))}):l.jsx("p",{className:"card-empty-state",children:"No attachments yet."})]})]}),l.jsx("section",{className:"card-surface card-surface--editor card-editor-main-surface",children:l.jsx(Wx,{value:V,onChange:re,placeholder:"Start writing...",className:"flex-1 min-h-[26rem]",mode:"edit",comments:n,onAddComment:y,onUpdateComment:b,onDeleteComment:C,logs:R,onClearLogs:z,logsFilter:D,onLogsFilterChange:j,cardId:e,frontmatter:O,onFormSubmitSuccess:pe})})]})]})})})}function PZ({labels:e,labelDefs:t,selected:r,onChange:n,showAllOption:s=!1,position:o="below"}){const[a,i]=x.useState(""),c=x.useMemo(()=>{const p={};return e.forEach(h=>{const g=t[h],m=(g==null?void 0:g.group)||"Other";p[m]||(p[m]=[]),p[m].push(h)}),p},[e,t]),u=x.useMemo(()=>{if(!a)return c;const p=a.toLowerCase(),h={};return Object.entries(c).forEach(([g,m])=>{const v=m.filter(y=>y.toLowerCase().includes(p));v.length>0&&(h[g]=v)}),h},[c,a]),d=p=>{r.includes(p)?n(r.filter(h=>h!==p)):n([...r,p])},f=o==="above"?"bottom-full mb-1":"top-full mt-1";return l.jsxs("div",{className:`absolute ${f} left-0 min-w-[200px] max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1`,children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:p=>i(p.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),s&&!a&&l.jsxs("button",{type:"button",onClick:()=>n([]),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${r.length===0?"text-blue-600 dark:text-blue-400 font-medium":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${r.length===0?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:r.length===0&&l.jsx(St,{size:10,className:"text-white"})}),l.jsx("span",{children:"All Labels"})]}),Object.entries(u).map(([p,h])=>l.jsxs("div",{children:[Object.keys(u).length>1&&l.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-xs font-semibold text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:p}),h.map(g=>{const m=t[g],v=r.includes(g);return l.jsxs("button",{type:"button",onClick:()=>d(g),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${v?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:v&&l.jsx(St,{size:10,className:"text-white"})}),(m==null?void 0:m.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:m.color}}),l.jsx("span",{className:"truncate",children:g})]},g)})]},p)),Object.keys(u).length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]})}function RZ({boards:e,currentBoard:t,starredBoards:r,onSelect:n,onClose:s}){const[o,a]=x.useState(""),[i,c]=x.useState(0),u=x.useRef(null),d=x.useMemo(()=>{const g=o.toLowerCase();return(g?e.filter(v=>v.name.toLowerCase().includes(g)||v.id.toLowerCase().includes(g)):e).slice().sort((v,y)=>{const b=r.includes(v.id),C=r.includes(y.id);return b&&!C?-1:!b&&C?1:0})},[e,o,r]);x.useEffect(()=>{setTimeout(()=>{var g;return(g=u.current)==null?void 0:g.focus()},0)},[]),x.useEffect(()=>{c(0)},[o]),x.useEffect(()=>{const g=m=>{if(m.key==="Escape"){m.stopPropagation(),s();return}if(m.key==="ArrowDown"){m.preventDefault(),c(v=>Math.min(v+1,d.length-1));return}if(m.key==="ArrowUp"){m.preventDefault(),c(v=>Math.max(v-1,0));return}m.key==="Enter"&&d[i]&&(n(d[i].id),s())};return document.addEventListener("keydown",g,!0),()=>document.removeEventListener("keydown",g,!0)},[d,i,n,s]);const f=d.filter(g=>r.includes(g.id)),p=d.filter(g=>!r.includes(g.id)),h=f.length>0;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:s}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 w-72 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-lg shadow-xl overflow-hidden",children:[l.jsx("div",{className:"p-2 border-b border-zinc-200 dark:border-zinc-700",children:l.jsxs("div",{className:"relative",children:[l.jsx(ug,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{ref:u,type:"text",value:o,onChange:g=>a(g.target.value),placeholder:"Search boards...",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-zinc-50 dark:bg-zinc-700 rounded-md border border-zinc-200 dark:border-zinc-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]})}),l.jsxs("div",{className:"py-1 max-h-72 overflow-y-auto",children:[d.length===0&&l.jsx("div",{className:"px-4 py-3 text-sm text-zinc-400 dark:text-zinc-500 text-center",children:"No boards found"}),h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-3 pt-1 pb-0.5 flex items-center gap-1.5",children:[l.jsx(dg,{size:11,className:"text-amber-400 fill-amber-400"}),l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Starred"})]}),f.map(g=>{const m=d.indexOf(g);return l.jsx(Km,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)}),p.length>0&&l.jsx("div",{className:"px-3 pt-2 pb-0.5",children:l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"All boards"})})]}),p.map(g=>{const m=d.indexOf(g);return l.jsx(Km,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)})]}),l.jsx("div",{className:"px-3 py-1.5 border-t border-zinc-200 dark:border-zinc-700",children:l.jsx("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:"↑↓ navigate · Enter select · Esc close"})})]})]})}function Km({board:e,isActive:t,isCurrent:r,onSelect:n}){return l.jsxs("button",{type:"button",onClick:n,className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors ${t?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-zinc-900 dark:text-zinc-100 hover:bg-zinc-100 dark:hover:bg-zinc-700"}`,children:[l.jsx(St,{size:14,className:r?"text-blue-500 shrink-0":"invisible shrink-0"}),l.jsx("span",{className:"truncate",children:e.name})]})}const Hm=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],qm=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],Ll="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function Lr({label:e,onRemove:t}){return l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700 rounded-full",children:[l.jsx("span",{className:"max-w-[180px] truncate",children:e}),l.jsx("button",{type:"button",onClick:t,className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-200 flex-shrink-0","aria-label":`Remove ${e} filter`,children:l.jsx(st,{size:12})})]})}function TZ({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":t,onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-2 text-sm transition-colors hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 flex items-center gap-2",children:[l.jsx("span",{className:"w-4 h-4 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(St,{size:10,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),l.jsx("span",{className:"truncate",children:e})]})}function IZ({onOpenSettings:e,onAddColumn:t,onCreateCard:r,onToggleTheme:n,onSwitchBoard:s,onCreateBoard:o,onOpenBoardLogs:a,boardLogsOpen:i,onTriggerBoardAction:c,onOpenShortcutHelp:u}){var Ro,To,Io;const d=G(T=>T.searchQuery),f=G(T=>T.setSearchQuery),p=G(T=>T.fuzzySearch),h=G(T=>T.setFuzzySearch),g=G(T=>T.clearPlainTextSearch),m=G(T=>T.removeMetadataFilterToken),v=G(T=>T.priorityFilter),y=G(T=>T.setPriorityFilter),b=G(T=>T.assigneeFilter),C=G(T=>T.setAssigneeFilter),w=G(T=>T.labelFilter),_=G(T=>T.setLabelFilter),R=G(T=>T.dueDateFilter),z=G(T=>T.setDueDateFilter),D=G(T=>T.clearAllFilters),j=G(T=>T.layout),S=G(T=>T.toggleLayout),E=G(T=>T.isDarkMode),P=G(T=>T.cardSettings),K=G(T=>T.boards),O=G(T=>T.currentBoard),q=G(T=>T.columns),V=G(T=>T.labelDefs),L=G(T=>T.cards),U=G(T=>T.starredBoards),oe=G(T=>T.toggleStarBoard),Y=G(T=>T.savedViews),N=G(T=>T.saveCurrentView),Z=G(T=>T.removeView),I=G(T=>T.getHiddenColumnIds()),k=G(T=>T.setColumnHidden),$=x.useMemo(()=>{const T=new Set;return L.forEach(me=>{me.assignee&&T.add(me.assignee)}),Array.from(T).sort()},[L]),A=x.useMemo(()=>{const T=new Set;return L.forEach(me=>me.labels.forEach(er=>T.add(er))),Array.from(T).sort()},[L]),W=x.useMemo(()=>Fs(d),[d]),H=x.useMemo(()=>Object.entries(W.metaFilter),[W]),ee=x.useMemo(()=>{const T=G.getState().columnSorts;return d!==""||p||v!=="all"||b!=="all"||w.length>0||R!=="all"||Object.values(T).some(me=>me!=="order")},[d,p,v,b,w,R]),[re,le]=x.useState(!1),[pe,M]=x.useState(!1),[J,se]=x.useState(""),ue=x.useRef(null),_e=x.useRef(null),[we,Ne]=x.useState(!1),Ce=x.useRef(null),[Ie,qe]=x.useState(!1),[it,Et]=x.useState(!1),wt=x.useRef(null),[ye,$e]=x.useState(!1),Ve=x.useRef(null),[pt,ls]=x.useState(!1),[pn,mn]=x.useState(!1),cs=x.useRef(null),[us,gn]=x.useState(!1),[ds,vn]=x.useState(""),fs=x.useRef(null),jo=x.useMemo(()=>{var T;return((T=K.find(me=>me.id===O))==null?void 0:T.actions)??{}},[K,O]),yn=x.useMemo(()=>Object.entries(jo),[jo]),hs=x.useMemo(()=>q.filter(T=>T.id!==Gn),[q]),Eo=x.useMemo(()=>new Set(I),[I]),bn=x.useMemo(()=>{let T=0;return v!=="all"&&(T+=1),b!=="all"&&(T+=1),w.length>0&&(T+=1),R!=="all"&&(T+=1),T},[v,b,w,R]);x.useEffect(()=>{const T=me=>{ue.current&&!ue.current.contains(me.target)&&(le(!1),M(!1),se(""))};return(re||pe)&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[re,pe]),x.useEffect(()=>{const T=me=>{Ce.current&&!Ce.current.contains(me.target)&&Ne(!1)};return we&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[we]),x.useEffect(()=>{const T=me=>{wt.current&&!wt.current.contains(me.target)&&(qe(!1),Et(!1))};return Ie&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[Ie]),x.useEffect(()=>{Ie||Et(!1)},[Ie]),x.useEffect(()=>{const T=me=>{Ve.current&&!Ve.current.contains(me.target)&&$e(!1)};return ye&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[ye]),x.useEffect(()=>{const T=me=>{cs.current&&!cs.current.contains(me.target)&&mn(!1)};return pn&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[pn]),x.useEffect(()=>{us&&fs.current&&fs.current.focus()},[us]),x.useEffect(()=>{pe&&_e.current&&_e.current.focus()},[pe]);const zi=((Ro=K.find(T=>T.id===O))==null?void 0:Ro.name)||O,Ao=U.includes(O),No=x.useCallback(()=>{const T=ds.trim();T&&(N(T),vn(""),gn(!1),mn(!1))},[ds,N]),Oi=x.useCallback(T=>{const me=G.getState();me.setSearchQuery(T.searchQuery),me.setFuzzySearch(T.fuzzySearch),me.setPriorityFilter(T.priorityFilter),me.setAssigneeFilter(T.assigneeFilter),me.setLabelFilter(T.labelFilter),me.setDueDateFilter(T.dueDateFilter)},[]),Po=()=>{const T=J.trim();T&&(o(T),se(""),M(!1))};return x.useEffect(()=>{const T=me=>{const er=me.target;er.tagName==="INPUT"||er.tagName==="TEXTAREA"||er.isContentEditable||(me.key==="b"||me.key==="B")&&(me.preventDefault(),le(Di=>!Di))};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[]),l.jsxs("div",{className:"flex flex-col border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50",children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 flex-wrap",children:[l.jsxs("div",{className:"relative flex items-center gap-0.5",ref:ue,children:[l.jsxs("button",{type:"button",onClick:()=>le(!re),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Switch board (b)",children:[l.jsx("span",{className:"max-w-[120px] truncate",children:zi}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${re?"rotate-180":""}`})]}),l.jsx("button",{type:"button",onClick:()=>oe(O),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:Ao?"Unstar board":"Star board",children:l.jsx(dg,{size:14,className:Ao?"fill-amber-400 text-amber-400":"text-zinc-400"})}),pe?l.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[l.jsx("input",{ref:_e,type:"text",value:J,onChange:T=>se(T.target.value),onKeyDown:T=>{T.key==="Enter"&&Po(),T.key==="Escape"&&(M(!1),se(""))},placeholder:"Board name...",className:"w-28 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:Po,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Create"}),l.jsx("button",{type:"button",onClick:()=>{M(!1),se("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:14})})]}):l.jsx("button",{type:"button",onClick:()=>M(!0),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Create new board",children:l.jsx(Zr,{size:14,className:"text-zinc-400"})}),re&&l.jsx(RZ,{boards:K,currentBoard:O,starredBoards:U,onSelect:T=>{s(T),le(!1)},onClose:()=>le(!1)})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[220px] max-w-md",children:[l.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[l.jsx(ug,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{type:"text",value:d,onChange:T=>f(T.target.value),placeholder:"Search cards, people, labels...",title:"Search cards by text. Advanced metadata search also works with meta.field: value",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("label",{className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs text-zinc-600 dark:text-zinc-300 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md select-none whitespace-nowrap",children:[l.jsx("input",{type:"checkbox",checked:p,onChange:T=>h(T.target.checked),className:"h-3.5 w-3.5 rounded border-zinc-300 text-blue-600 focus:ring-blue-500"}),l.jsx("span",{children:"Fuzzy"})]})]}),l.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors shadow-sm",title:"Create a new card",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"New Card"})]}),l.jsxs("button",{type:"button",onClick:()=>ls(T=>!T),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${pt||bn>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Show or hide filters",children:[l.jsx(x1,{size:14}),l.jsx("span",{children:bn>0?`Filters (${bn})`:"Filters"})]}),pt&&P.showPriorityBadges&&l.jsx("select",{value:v,onChange:T=>y(T.target.value),className:Ll,children:Hm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),pt&&P.showAssignee&&l.jsxs("select",{value:b,onChange:T=>C(T.target.value),className:Ll,children:[l.jsx("option",{value:"all",children:"All Assignees"}),l.jsx("option",{value:"unassigned",children:"Unassigned"}),$.map(T=>l.jsx("option",{value:T,children:T},T))]}),pt&&P.showLabels&&l.jsxs("div",{className:"relative",ref:Ce,children:[l.jsxs("button",{type:"button",onClick:()=>Ne(!we),className:`flex items-center gap-1.5 text-sm bg-white dark:bg-zinc-800 border rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 transition-colors ${w.length>0?"border-blue-500 dark:border-blue-400":"border-zinc-200 dark:border-zinc-600"}`,children:[l.jsx(Xa,{size:14,className:"text-zinc-400 shrink-0"}),l.jsx("span",{className:"max-w-[100px] truncate",children:w.length===0?"All Labels":w.length===1?w[0]:`${w.length} Labels`}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${we?"rotate-180":""}`})]}),we&&l.jsx(PZ,{labels:A,labelDefs:V,selected:w,onChange:_,showAllOption:!0})]}),pt&&P.showDueDate&&l.jsx("select",{value:R,onChange:T=>z(T.target.value),className:Ll,children:qm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),ee&&l.jsxs("button",{onClick:D,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[l.jsx(st,{size:14}),l.jsx("span",{children:"Clear"})]}),l.jsxs("div",{className:"relative",ref:cs,children:[l.jsxs("button",{type:"button",onClick:()=>mn(!pn),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${Y.length>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Saved views",children:[l.jsx(vf,{size:14}),l.jsxs("span",{children:["Views",Y.length>0?` (${Y.length})`:""]})]}),pn&&l.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[220px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[Y.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Saved views"}),Y.map(T=>l.jsxs("div",{className:"flex items-center gap-1 px-2",children:[l.jsx("button",{type:"button",onClick:()=>{Oi(T),mn(!1)},className:"flex-1 text-sm text-left py-1.5 px-1 text-zinc-900 dark:text-zinc-100 hover:text-blue-600 dark:hover:text-blue-400 truncate transition-colors",children:T.name}),l.jsx("button",{type:"button",onClick:()=>Z(T.id),className:"p-1 text-zinc-400 hover:text-red-500 transition-colors shrink-0",title:"Remove view",children:l.jsx(st,{size:12})})]},T.id)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"})]}),us?l.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-1",children:[l.jsx("input",{ref:fs,type:"text",value:ds,onChange:T=>vn(T.target.value),onKeyDown:T=>{T.key==="Enter"&&No(),T.key==="Escape"&&(gn(!1),vn(""))},placeholder:"View name...",className:"flex-1 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:No,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Save"}),l.jsx("button",{type:"button",onClick:()=>{gn(!1),vn("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:12})})]}):l.jsxs("button",{type:"button",onClick:()=>gn(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(vf,{size:14}),l.jsx("span",{children:"Save current filters"})]})]})]}),l.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"Add List"})]}),u&&l.jsx("button",{type:"button",onClick:u,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Keyboard shortcuts (?)",children:l.jsx(w1,{size:16})}),l.jsx("button",{type:"button",onClick:S,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:j==="horizontal"?"Switch to row layout":"Switch to column layout",children:j==="horizontal"?l.jsx(k1,{size:16}):l.jsx(Wl,{size:16})}),l.jsxs("div",{className:"relative",ref:wt,children:[l.jsx("button",{type:"button",onClick:()=>qe(!Ie),className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Board options",children:l.jsx(_1,{size:16})}),Ie&&l.jsxs("div",{className:"absolute top-full right-0 mt-1 min-w-[200px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[hs.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-1",onClick:T=>T.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:T=>{T.stopPropagation(),Et(me=>!me)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors rounded-sm","aria-expanded":it,children:[l.jsx(Wl,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{className:"flex-1",children:"Columns"}),l.jsx(Ze,{size:14,className:`shrink-0 text-zinc-400 transition-transform ${it?"rotate-180":""}`})]}),it&&l.jsx("div",{className:"mt-1 mb-1 rounded-md border border-zinc-200 dark:border-zinc-700 bg-zinc-50/80 dark:bg-zinc-900/50 py-1",onClick:T=>T.stopPropagation(),children:hs.map(T=>{const me=!Eo.has(T.id);return l.jsx(TZ,{label:T.name,checked:me,onChange:er=>k(O,T.id,!er)},T.id)})})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"})]}),l.jsxs("button",{type:"button",onClick:()=>{n(),qe(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[E?l.jsx(C1,{size:14,className:"shrink-0 text-zinc-400"}):l.jsx($1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:E?"Light Theme":"Dark Theme"})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{e(),qe(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx(S1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:"Settings"})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{a(),qe(!1)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${i?"text-blue-600 dark:text-blue-400":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx(ig,{size:14,className:`shrink-0 ${i?"text-blue-500":"text-zinc-400"}`}),l.jsx("span",{children:"Board Logs"})]})]})]})]}),yn.length>0&&c&&l.jsxs("div",{className:"relative ml-auto",ref:Ve,children:[l.jsxs("button",{type:"button",onClick:()=>$e(!ye),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Board actions",children:[l.jsx(ma,{size:14,className:"text-amber-500"}),l.jsx("span",{children:"Actions"}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${ye?"rotate-180":""}`})]}),ye&&l.jsx("div",{className:"absolute top-full right-0 mt-1 min-w-[180px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:yn.map(([T,me])=>l.jsxs("button",{type:"button",onClick:()=>{$e(!1),c(O,T)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx(ma,{size:12,className:"text-amber-500 shrink-0"}),l.jsx("span",{className:"truncate",children:me})]},T))})]})]}),ee&&l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-4 pb-2",children:[W.plainText&&l.jsx(Lr,{label:`Search: "${W.plainText}"`,onRemove:g}),H.map(([T,me])=>l.jsx(Lr,{label:`meta.${T}: ${me}`,onRemove:()=>m(T)},T)),p&&l.jsx(Lr,{label:"Fuzzy",onRemove:()=>h(!1)}),v!=="all"&&l.jsx(Lr,{label:`Priority: ${((To=Hm.find(T=>T.value===v))==null?void 0:To.label)??v}`,onRemove:()=>y("all")}),b!=="all"&&l.jsx(Lr,{label:`Assignee: ${b==="unassigned"?"Unassigned":b}`,onRemove:()=>C("all")}),w.map(T=>l.jsx(Lr,{label:`Label: ${T}`,onRemove:()=>_(w.filter(me=>me!==T))},T)),R!=="all"&&l.jsx(Lr,{label:`Due: ${((Io=qm.find(T=>T.value===R))==null?void 0:Io.label)??R}`,onRemove:()=>z("all")})]})]})}function Gm({title:e,message:t,onUndo:r,onExpire:n,duration:s,index:o,actionLabel:a="Undo",persistent:i=!1,tone:c="default"}){const[u,d]=x.useState(100),f=!i&&typeof s=="number"&&typeof n=="function",p=c==="error"?"var(--vscode-errorForeground, #f14c4c)":c==="info"?"var(--vscode-progressBar-background)":void 0;return x.useEffect(()=>{if(!f||!s){d(100);return}const h=50,g=h/s*100,m=setInterval(()=>{d(v=>{const y=v-g;return y<=0?(clearInterval(m),0):y})},h);return()=>clearInterval(m)},[s,f]),x.useEffect(()=>{f&&u<=0&&n&&n()},[u,n,f]),l.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))",borderLeft:p?`3px solid ${p}`:void 0},children:[l.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[e&&l.jsx("div",{className:"mb-0.5 text-[12px] font-semibold",children:e}),l.jsx("span",{className:`text-[13px] leading-snug ${e?"block":"truncate"}`,children:t})]}),r&&l.jsx("button",{onClick:r,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:h=>h.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:h=>h.currentTarget.style.background="var(--vscode-button-background)",children:a})]}),f&&l.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:l.jsx("div",{className:"h-full transition-none",style:{width:`${u}%`,background:"var(--vscode-progressBar-background)"}})})]})}const MZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],zZ=[{value:"fancy",label:"Fancy"},{value:"plain",label:"Plain"}],OZ=[{value:"aurora",label:"Aurora Glow"},{value:"sunset",label:"Sunset Blend"},{value:"meadow",label:"Meadow Mist"},{value:"nebula",label:"Nebula Bloom"},{value:"lagoon",label:"Lagoon Light"},{value:"candy",label:"Candy Pop"},{value:"ember",label:"Ember Sky"},{value:"violet",label:"Violet Pulse"}],DZ=[{value:"paper",label:"Paper White"},{value:"mist",label:"Mist Blue"},{value:"sand",label:"Soft Sand"}];function LZ({isOpen:e,settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}){return e?l.jsx(UZ,{settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}):null}function FZ({checked:e,onChange:t}){return l.jsx("button",{type:"button",onClick:()=>t(!e),className:Ee("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:e?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:l.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:e?"translateX(18px)":"translateX(3px)"}})})}function As({title:e,children:t}){return l.jsxs("div",{className:"py-3",children:[l.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{children:t})]})}function Fr({label:e,description:t,checked:r,onChange:n}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>n(!r),onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsx(FZ,{checked:r,onChange:n})]})}function Qo({label:e,value:t}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-1.5",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{className:"text-xs font-mono truncate max-w-[60%] text-right",style:{color:"var(--vscode-foreground)",opacity:.7},title:t,children:t})]})}function Ns({label:e,value:t,options:r,onChange:n}){const[s,o]=x.useState(!1),a=r.find(i=>i.value===t);return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:r.map(i=>l.jsxs("button",{type:"button",onClick:()=>{n(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:c=>{i.value!==t&&(c.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:c=>{i.value!==t&&(c.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label})]},i.value))})]})]})]})}function Fl({label:e,description:t,value:r,min:n,max:s,step:o,unit:a,onChange:i}){const c=(r-n)/(s-n)*100;return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:u=>u.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:u=>u.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("input",{type:"range",min:n,max:s,step:o,value:r,onChange:u=>i(Number(u.target.value)),className:"settings-slider",style:{background:`linear-gradient(to right, var(--vscode-button-background) ${c}%, var(--vscode-badge-background, #6b7280) ${c}%)`}}),l.jsxs("span",{className:"text-xs font-mono w-12 text-right tabular-nums",style:{color:"var(--vscode-foreground)"},children:[r,a||"%"]})]})]})}function Ym({value:e,onChange:t}){const[r,n]=x.useState(!1),[s,o]=x.useState("");return l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>n(!r),className:"w-5 h-5 rounded-full border border-white/20 cursor-pointer shrink-0",style:{backgroundColor:e}}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-2 min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsx("div",{className:"grid grid-cols-6 gap-1.5 mb-2",children:nc.map(a=>l.jsx("button",{type:"button",onClick:()=>{t(a.hex),n(!1)},className:"w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:a.hex,borderColor:e===a.hex?"white":"transparent"},title:a.name},a.name))}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("input",{type:"text",placeholder:"#hex",value:s,onChange:a=>o(a.target.value),className:"flex-1 px-2 py-1 text-xs rounded",style:{background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"}}),l.jsx("button",{type:"button",onClick:()=>{/^#[0-9a-fA-F]{6}$/.test(s)&&(t(s),n(!1),o(""))},className:"px-2 py-1 text-xs rounded",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"OK"})]})]})]})]})}function BZ({onSetLabel:e,onRenameLabel:t,onDeleteLabel:r}){const n=G(j=>j.labelDefs),s=G(j=>j.cards),[o,a]=x.useState(""),[i,c]=x.useState(nc[0].hex),[u,d]=x.useState(""),[f,p]=x.useState(null),[h,g]=x.useState(""),[m,v]=x.useState(null),y=x.useMemo(()=>{const j=new Map;for(const[S,E]of Object.entries(n))j.set(S,E);for(const S of s)for(const E of S.labels)j.has(E)||j.set(E,void 0);return j},[n,s]),b=x.useMemo(()=>{const j={};return y.forEach((E,P)=>{const K=(E==null?void 0:E.group)||"Other";j[K]||(j[K]=[]),j[K].push({name:P,def:E})}),Object.entries(j).sort(([E],[P])=>E==="Other"?1:P==="Other"?-1:E.localeCompare(P))},[y]),C=x.useMemo(()=>{const j=new Set;return Object.values(n).forEach(S=>{S.group&&j.add(S.group)}),Array.from(j).sort()},[n]),w=j=>s.filter(S=>S.labels.includes(j)).length,_=()=>{const j=o.trim();j&&(e==null||e(j,{color:i,group:u||void 0}),a(""),c(nc[0].hex),d(""))},R=j=>{const S=h.trim();S&&S!==j&&(t==null||t(j,S)),p(null),g("")},z=j=>{r==null||r(j),v(null)},D={background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"};return l.jsxs("div",{className:"px-4 space-y-3",children:[b.map(([j,S])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--vscode-descriptionForeground)"},children:j}),l.jsx("div",{className:"space-y-1",children:S.map(({name:E,def:P})=>l.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded group/label transition-colors",onMouseEnter:K=>K.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:K=>K.currentTarget.style.background="transparent",children:[l.jsx(Ym,{value:(P==null?void 0:P.color)||"#6b7280",onChange:K=>e==null?void 0:e(E,{...P,color:K,group:P==null?void 0:P.group})}),f===E?l.jsx("input",{type:"text",value:h,onChange:K=>g(K.target.value),onKeyDown:K=>{K.key==="Enter"&&R(E),K.key==="Escape"&&(p(null),g(""))},onBlur:()=>R(E),autoFocus:!0,className:"flex-1 px-1.5 py-0.5 text-xs rounded min-w-0",style:D}):l.jsx("span",{className:"flex-1 text-xs truncate",style:{color:"var(--vscode-foreground)"},children:E}),(P==null?void 0:P.group)&&f!==E&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:P.group}),m===E?l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsxs("span",{className:"text-[10px]",style:{color:"var(--vscode-errorForeground, #f44)"},children:[w(E)," card",w(E)!==1?"s":""]}),l.jsx("button",{type:"button",onClick:()=>z(E),className:"px-1.5 py-0.5 text-[10px] rounded",style:{background:"var(--vscode-inputValidation-errorBackground, #5a1d1d)",color:"var(--vscode-errorForeground, #f44)"},children:"Delete"}),l.jsx("button",{type:"button",onClick:()=>v(null),className:"px-1.5 py-0.5 text-[10px] rounded",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"})]}):l.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover/label:opacity-100 transition-opacity",children:[l.jsx("button",{type:"button",onClick:()=>{p(E),g(E)},className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:K=>K.currentTarget.style.color="var(--vscode-foreground)",onMouseLeave:K=>K.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Rename label",children:l.jsx(Uc,{size:12})}),l.jsx("button",{type:"button",onClick:()=>v(E),className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:K=>K.currentTarget.style.color="var(--vscode-errorForeground, #f44)",onMouseLeave:K=>K.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Delete label",children:l.jsx(Kt,{size:12})})]})]},E))})]},j)),l.jsxs("div",{className:"rounded-lg p-2 space-y-2",style:{background:"var(--vscode-input-background)",border:"1px solid var(--vscode-input-border, transparent)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ym,{value:i,onChange:c}),l.jsx("input",{type:"text",placeholder:"New label name...",value:o,onChange:j=>a(j.target.value),onKeyDown:j=>{j.key==="Enter"&&_()},className:"flex-1 px-1.5 py-1 text-xs rounded bg-transparent min-w-0",style:{color:"var(--vscode-input-foreground)",outline:"none"}})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",placeholder:"Group (optional)",value:u,onChange:j=>d(j.target.value),onKeyDown:j=>{j.key==="Enter"&&_()},list:"label-groups",className:"flex-1 px-1.5 py-1 text-xs rounded",style:D}),l.jsx("datalist",{id:"label-groups",children:C.map(j=>l.jsx("option",{value:j},j))}),l.jsxs("button",{type:"button",onClick:_,disabled:!o.trim(),className:"flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-40",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:[l.jsx(Zr,{size:12}),"Add"]})]})]})]})}function UZ({settings:e,workspace:t,onClose:r,onSave:n,onSetLabel:s,onRenameLabel:o,onDeleteLabel:a}){const[i,c]=x.useState(e),[u,d]=x.useState("general"),[f,p]=x.useState(!1),h=G(_=>_.columns),g=G(_=>_.effectiveDrawerWidth),m=G(_=>_.setDrawerWidthPreview),v=G(_=>_.clearDrawerWidthPreview),y=x.useMemo(()=>h.filter(_=>_.id!==Gn).map(_=>({value:_.id,label:_.name,dotColor:_.color})),[h]),b=x.useMemo(()=>i.boardBackgroundMode==="plain"?DZ:OZ,[i.boardBackgroundMode]);x.useEffect(()=>{c(e)},[e]);const C=_=>{const R={...i,..._};c(R),n(R)};x.useEffect(()=>{const _=R=>{R.key==="Escape"&&(R.stopPropagation(),r())};return document.addEventListener("keydown",_,!0),()=>document.removeEventListener("keydown",_,!0)},[r]);const w=(i.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-50 flex ${w?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!w&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),l.jsxs("div",{className:w?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:w?{width:`${g}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...w?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:w?"drawer":"popup",onPreview:m,onCommit:_=>{v();const R={...i,drawerWidth:_};c(R),n(R)},onCancel:v}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),l.jsx("button",{onClick:r,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:_=>_.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:_=>_.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsx("div",{className:"flex",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:["general","defaults","labels"].map(_=>l.jsxs("button",{type:"button",onClick:()=>d(_),className:"px-4 py-2.5 text-xs font-medium transition-colors relative",style:{color:u===_?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)",background:"transparent"},children:[_.charAt(0).toUpperCase()+_.slice(1),u===_&&l.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:"var(--vscode-button-background)"}})]},_))}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[u==="general"&&l.jsxs(l.Fragment,{children:[l.jsxs(As,{title:"Card Display",children:[l.jsx(Fr,{label:"Show Priority Badges",description:"Display priority indicators on card cards",checked:i.showPriorityBadges,onChange:_=>C({showPriorityBadges:_})}),l.jsx(Fr,{label:"Show Assignee",description:"Display assigned person on card cards",checked:i.showAssignee,onChange:_=>C({showAssignee:_})}),l.jsx(Fr,{label:"Show Due Date",description:"Display due dates on card cards",checked:i.showDueDate,onChange:_=>C({showDueDate:_})}),l.jsx(Fr,{label:"Show Labels",description:"Display labels on card cards and in editors",checked:i.showLabels,onChange:_=>C({showLabels:_})}),l.jsx(Fr,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:i.showFileName,onChange:_=>C({showFileName:_})}),l.jsx(Fr,{label:"Compact Mode",description:"Use compact card layout to show more cards",checked:i.compactMode,onChange:_=>C({compactMode:_})}),l.jsx(Fr,{label:"Show Deleted Column",description:"Display the Deleted column to manage soft-deleted cards",checked:i.showDeletedColumn,onChange:_=>C({showDeletedColumn:_})})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Layout",children:[l.jsx(Ns,{label:"Panel Style",value:i.panelMode??"drawer",options:[{value:"drawer",label:"Right-side Drawer"},{value:"popup",label:"Centered Popup"}],onChange:_=>C({panelMode:_})}),(i.panelMode??"drawer")==="drawer"&&l.jsx(Fl,{label:"Drawer Width",description:"Width of the right-side drawer as a percentage of the viewport",value:i.drawerWidth??50,min:20,max:80,step:5,onChange:_=>C({drawerWidth:_})}),l.jsx(Ns,{label:"Background Style",value:i.boardBackgroundMode,options:zZ,onChange:_=>{const R=ja(_);C(R)}}),l.jsx(Ns,{label:"Background Preset",value:i.boardBackgroundPreset,options:b,onChange:_=>{const R=ja(i.boardBackgroundMode,_);C(R)}})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Zoom",children:[l.jsx(Fl,{label:"Board Zoom",description:"Scale text size on the board view",value:i.boardZoom,min:75,max:150,step:5,onChange:_=>C({boardZoom:_})}),l.jsx(Fl,{label:"Card Detail Zoom",description:"Scale text size in the card detail panel",value:i.cardZoom,min:75,max:150,step:5,onChange:_=>C({cardZoom:_})})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer",onClick:()=>p(_=>!_),onMouseEnter:_=>_.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:_=>_.currentTarget.style.background="transparent",children:[l.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Advanced"}),l.jsx(Ze,{size:14,className:`transition-transform ${f?"rotate-180":""}`,style:{color:"var(--vscode-descriptionForeground)"}})]}),f&&l.jsxs(l.Fragment,{children:[l.jsx(Qo,{label:"Project Path",value:t.projectPath}),l.jsx(Qo,{label:"Kanban Directory",value:t.kanbanDirectory}),l.jsx(Qo,{label:"Server Port",value:String(t.port)}),l.jsx(Qo,{label:"Config Version",value:String(t.configVersion)})]})]})]}),u==="defaults"&&l.jsxs(As,{title:"Defaults",children:[l.jsx(Ns,{label:"Default Priority",value:i.defaultPriority,options:MZ,onChange:_=>C({defaultPriority:_})}),l.jsx(Ns,{label:"Default Status",value:i.defaultStatus,options:y,onChange:_=>C({defaultStatus:_})})]}),u==="labels"&&l.jsx(As,{title:"Labels",children:l.jsx(BZ,{onSetLabel:s,onRenameLabel:o,onDeleteLabel:a})})]}),l.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const WZ=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function VZ({isOpen:e,onClose:t,onSave:r,initial:n,title:s}){const[o,a]=x.useState((n==null?void 0:n.name)??""),[i,c]=x.useState((n==null?void 0:n.color)??"#3b82f6"),u=x.useRef(null);return x.useEffect(()=>{e&&(a((n==null?void 0:n.name)??""),c((n==null?void 0:n.color)??"#3b82f6"),setTimeout(()=>{var d;return(d=u.current)==null?void 0:d.focus()},50))},[e,n]),x.useEffect(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&t(),f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&o.trim()&&r({name:o.trim(),color:i})};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,t,r,o,i]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),l.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:s}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:l.jsx(st,{size:16,className:"text-zinc-500"})})]}),l.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),l.jsx("input",{ref:u,type:"text",value:o,onChange:d=>a(d.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[WZ.map(d=>l.jsx("button",{type:"button",onClick:()=>c(d),className:`w-6 h-6 rounded-full border-2 transition-all ${i===d?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:d},title:d},d)),l.jsx("input",{type:"color",value:i,onChange:d=>c(d.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[l.jsx("button",{type:"button",onClick:t,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:()=>{o.trim()&&r({name:o.trim(),color:i})},disabled:!o.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const KZ=["critical","high","medium","low"],HZ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},qZ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"};function GZ({selectedCount:e,onClearSelection:t,onMoveToColumn:r,onSetPriority:n,onSetAssignee:s,onApplyLabels:o,onDelete:a}){const i=G(b=>b.columns),c=G(b=>b.cards),u=G(b=>b.labelDefs),d=G(b=>b.selectedCardIds),f=x.useMemo(()=>{const b=new Set;return c.forEach(C=>{C.assignee&&b.add(C.assignee)}),Array.from(b).sort()},[c]),p=x.useMemo(()=>{const b=new Set;return c.forEach(C=>C.labels.forEach(w=>b.add(w))),Array.from(b).sort()},[c]),h=x.useMemo(()=>c.filter(b=>d.includes(b.id)),[c,d]),[g,m]=x.useState(null),v=x.useRef(null);x.useEffect(()=>{const b=C=>{v.current&&!v.current.contains(C.target)&&m(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]);const y=b=>{m(g===b?null:b)};return l.jsxs("div",{ref:v,className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-white dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-600 rounded-lg shadow-xl px-3 py-2",children:[l.jsxs("span",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-200 whitespace-nowrap",children:[e," selected"]}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Clear selection",children:l.jsx(st,{size:14,className:"text-zinc-500"})}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("moveTo"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(j1,{size:14}),"Move to",l.jsx(Ze,{size:12})]}),g==="moveTo"&&l.jsx(Bl,{children:i.map(b=>l.jsxs("button",{type:"button",onClick:()=>{r(b.id),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:b.color}}),b.name]},b.id))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("priority"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(Wc,{size:14}),"Priority",l.jsx(Ze,{size:12})]}),g==="priority"&&l.jsx(Bl,{children:KZ.map(b=>l.jsxs("button",{type:"button",onClick:()=>{n(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${qZ[b]}`}),HZ[b]]},b))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("assignee"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(ga,{size:14}),"Assign",l.jsx(Ze,{size:12})]}),g==="assignee"&&l.jsxs(Bl,{children:[l.jsx("button",{type:"button",onClick:()=>{s(null),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors italic",children:"Unassign"}),f.map(b=>l.jsxs("button",{type:"button",onClick:()=>{s(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:b.split(/\s+/).map(C=>C[0]).join("").toUpperCase().slice(0,2)}),b]},b))]})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("labels"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(Xa,{size:14}),"Labels",l.jsx(Ze,{size:12})]}),g==="labels"&&l.jsx(YZ,{allLabels:p,labelDefs:u,selectedCards:h,onApply:(b,C)=>{o(b,C),m(null)}})]}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("button",{type:"button",onClick:()=>{a()},className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors text-red-600 dark:text-red-400",children:[l.jsx(Kt,{size:14}),"Delete"]})]})}function Bl({children:e}){return l.jsx("div",{className:"absolute bottom-full mb-1 left-0 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[160px] max-h-64 overflow-y-auto",children:e})}function YZ({allLabels:e,labelDefs:t,selectedCards:r,onApply:n}){const[s,o]=x.useState(new Map),[a,i]=x.useState(""),c=x.useMemo(()=>{const v=new Map;if(r.length===0)return v;for(const y of e){const b=r.filter(C=>C.labels.includes(y)).length;v.set(y,b===0?"none":b===r.length?"all":"some")}return v},[e,r]),u=v=>{const y=s.get(v);if(y==="add")return"checked";if(y==="remove")return"unchecked";const b=c.get(v)??"none";return b==="all"?"checked":b==="some"?"indeterminate":"unchecked"},d=v=>{const y=c.get(v)??"none",b=u(v),C=new Map(s);b==="unchecked"||b==="indeterminate"?C.set(v,"add"):y==="all"?s.get(v)==="remove"?C.delete(v):C.set(v,"remove"):C.delete(v),o(C)},f=x.useMemo(()=>{if(!a)return e;const v=a.toLowerCase();return e.filter(y=>y.toLowerCase().includes(v))},[e,a]),p=Array.from(s.entries()).filter(([,v])=>v==="add").map(([v])=>v),h=Array.from(s.entries()).filter(([,v])=>v==="remove").map(([v])=>v),g=p.length>0||h.length>0,m=p.length>0&&h.length>0?`Apply changes (+${p.length} −${h.length})`:p.length>0?`Add ${p.length} label${p.length!==1?"s":""}`:`Remove ${h.length} label${h.length!==1?"s":""}`;return l.jsxs("div",{className:"absolute bottom-full mb-1 left-0 z-50 min-w-[200px]",children:[l.jsxs("div",{className:"max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1",children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:v=>i(v.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),f.map(v=>{const y=t[v],b=u(v);return l.jsxs("button",{type:"button",onClick:()=>d(v),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsxs("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${b==="checked"?"border-blue-500 bg-blue-500":b==="indeterminate"?"border-zinc-400 bg-zinc-200 dark:border-zinc-400 dark:bg-zinc-600":"border-zinc-300 dark:border-zinc-500"}`,children:[b==="checked"&&l.jsx(St,{size:10,className:"text-white"}),b==="indeterminate"&&l.jsx(E1,{size:10,className:"text-zinc-600 dark:text-zinc-300"})]}),(y==null?void 0:y.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:y.color}}),l.jsx("span",{className:"truncate",children:v})]},v)}),f.length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]}),g&&l.jsx("div",{className:"bg-white dark:bg-zinc-800 border border-t-0 border-zinc-200 dark:border-zinc-600 rounded-b-md shadow-lg px-1 py-1",children:l.jsx("button",{type:"button",onClick:()=>n(p,h),className:"flex items-center justify-center gap-1 w-full px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 rounded transition-colors",children:m})})]})}const JZ=[{keys:["n"],description:"Create a new card"},{keys:["?"],description:"Show / hide this shortcut reference"},{keys:["Ctrl","Z"],description:"Undo last card deletion"},{keys:["Ctrl","+"],description:"Increase board zoom"},{keys:["Ctrl","-"],description:"Decrease board zoom"},{keys:["Ctrl","Shift","+"],description:"Increase card detail zoom"},{keys:["Ctrl","Shift","-"],description:"Decrease card detail zoom"},{keys:["Esc"],description:"Close dialog / clear selection"},{keys:["Ctrl","Enter"],description:"Save and close card (in create dialog)"},{keys:["Ctrl","S"],description:"Save card (in create dialog)"},{keys:["Enter"],description:"Add card (in inline quick-add)"}];function ZZ({isOpen:e,onClose:t}){return x.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.stopPropagation(),t())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:t}),l.jsxs("div",{className:"relative w-full max-w-md rounded-xl shadow-2xl flex flex-col overflow-hidden",style:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"font-semibold text-sm",style:{color:"var(--vscode-foreground)"},children:"Keyboard Shortcuts"}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:r=>r.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:r=>r.currentTarget.style.background="transparent",title:"Close",children:l.jsx(st,{size:16})})]}),l.jsx("div",{className:"overflow-y-auto max-h-[60vh]",children:JZ.map((r,n)=>l.jsxs("div",{className:"flex items-center justify-between px-5 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)",opacity:.95},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:r.description}),l.jsx("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:r.keys.map((s,o)=>l.jsxs("span",{className:"flex items-center gap-1",children:[o>0&&l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"+"}),l.jsx("kbd",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:s})]},o))})]},n))}),l.jsxs("div",{className:"px-5 py-2 text-xs",style:{borderTop:"1px solid var(--vscode-panel-border)",color:"var(--vscode-descriptionForeground)"},children:["Press ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"?"})," or ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"Esc"})," to close"]})]})]}):null}function QZ(e){if(!e||e<=0)return"";if(e<1e3)return` Next retry in ${e}ms.`;const t=e/1e3;return` Next retry in ${Number.isInteger(t)?String(t):t.toFixed(1)}s.`}function Jm(e){return e?e==="socket-closed"?" The previous socket closed unexpectedly.":` Last signal: ${e}.`:""}function XZ(e){if(e.type==="init"||e.connected||!e.reconnecting&&!e.fatal)return null;if(e.fatal)return{title:"Connection lost",message:`The standalone backend is unavailable and automatic reconnect has stopped.${Jm(e.reason)} Form submissions are unavailable until the backend is reachable again. Refresh or reopen this page after the backend is available again.`,tone:"error"};const t=e.retryCount??1,r=e.maxRetries??t;return{title:"Reconnecting…",message:`Trying to reconnect to the standalone backend (attempt ${t} of ${r}).${QZ(e.retryDelayMs)}${Jm(e.reason)} Form submissions pause until the backend reconnects.`,tone:"info"}}const ce=df();function eQ(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).flatMap(([t,r])=>{if(!r||typeof r!="object"||Array.isArray(r))return[];const n=Array.isArray(r.hiddenColumnIds)?r.hiddenColumnIds.filter(o=>typeof o=="string"):[],s=Array.isArray(r.minimizedColumnIds)?r.minimizedColumnIds.filter(o=>typeof o=="string"):[];return[[t,{hiddenColumnIds:n,minimizedColumnIds:s}]]}))}function tQ(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function rQ(e){return{version:e.version,id:e.id,...e.boardId!==void 0?{boardId:e.boardId}:{},status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,metadata:e.metadata,actions:e.actions,forms:e.forms,formData:e.formData}}function nQ(){const{columns:e,currentBoard:t,columnVisibilityByBoard:r,workspace:n,cardSettings:s,effectiveDrawerWidth:o,settingsOpen:a,selectedCardIds:i,setCards:c,setColumns:u,setBoards:d,setIsDarkMode:f,setWorkspace:p,setCardSettings:h,setDrawerWidthPreview:g,clearDrawerWidthPreview:m,setSettingsOpen:v,setLabelDefs:y,toggleSelectCard:b,selectCardRange:C,selectAllInColumn:w,clearSelection:_,setActiveCardId:R}=G(),[z,D]=x.useState(!1),[j,S]=x.useState("backlog"),[E,P]=x.useState(!1),[K,O]=x.useState(!1),[q,V]=x.useState(null),L=x.useRef(0),[U,oe]=x.useState(null),[Y,N]=x.useState(!1),[Z,I]=x.useState([]),[k,$]=x.useState(!1),A=x.useRef(eQ(ce.getState())),W=x.useRef(null);x.useEffect(()=>{R((U==null?void 0:U.id)??null)},[U==null?void 0:U.id,R]);const[H,ee]=x.useState([]),[re,le]=x.useState(null),pe=x.useRef(H);x.useEffect(()=>{pe.current=H},[H]);const M=x.useRef(0),J=x.useCallback(F=>{oe(Q=>{if(!Q)return Q;const X=F.find(mt=>mt.id===Q.id);if(!X)return Q;const te=rQ(X),je=X.comments||[],ae=Q.content!==X.content,Ge=JSON.stringify(Q.frontmatter)!==JSON.stringify(te),Xe=JSON.stringify(Q.comments)!==JSON.stringify(je);return!ae&&!Ge&&!Xe?Q:(ae&&(L.current+=1),{...Q,content:X.content,frontmatter:te,comments:je,contentVersion:ae?L.current:Q.contentVersion})})},[]),se=x.useCallback(F=>{const{cards:Q}=G.getState(),X=Q.find(ae=>ae.id===F);if(!X)return;const te=X.status;c(Q.map(ae=>ae.id===F?{...ae,status:Gn}:ae)),(U==null?void 0:U.id)===F&&(oe(null),R(null));const je=String(M.current++);ee(ae=>[...ae,{id:je,card:X,originalStatus:te}])},[U,c]),ue=x.useCallback(F=>{const Q=pe.current.find(X=>X.id===F);Q&&(ce.postMessage({type:"deleteCard",cardId:Q.card.id}),ee(X=>X.filter(te=>te.id!==F)))},[]),_e=x.useCallback(F=>{const Q=pe.current.find(te=>te.id===F);if(!Q)return;const{cards:X}=G.getState();c(X.map(te=>te.id===Q.card.id?{...te,status:Q.originalStatus}:te)),ee(te=>te.filter(je=>je.id!==F))},[c]),we=x.useCallback(()=>{const F=pe.current;F.length!==0&&_e(F[F.length-1].id)},[_e]);x.useEffect(()=>{let F=!1,Q=null;const X=ae=>{if(ae.key==="Alt"){F=!0,Q&&clearTimeout(Q),Q=setTimeout(()=>{F=!1},1e3);return}if(ae.altKey&&(F=!1,Q&&(clearTimeout(Q),Q=null)),ae.key==="z"&&(ae.ctrlKey||ae.metaKey)&&!ae.shiftKey&&pe.current.length>0){ae.preventDefault(),we();return}if((ae.key==="="||ae.key==="+"||ae.key==="-")&&(ae.ctrlKey||ae.metaKey)){ae.preventDefault();const Ge=ae.key==="-"?-5:5,{cardSettings:Xe}=G.getState();if(ae.shiftKey){const mt=Math.max(75,Math.min(150,Xe.cardZoom+Ge));if(mt!==Xe.cardZoom){const tr={...Xe,cardZoom:mt};h(tr),ce.postMessage({type:"saveSettings",settings:tr})}}else{const mt=Math.max(75,Math.min(150,Xe.boardZoom+Ge));if(mt!==Xe.boardZoom){const tr={...Xe,boardZoom:mt};h(tr),ce.postMessage({type:"saveSettings",settings:tr})}}return}if(!(ae.target instanceof HTMLInputElement||ae.target instanceof HTMLTextAreaElement||ae.target instanceof HTMLSelectElement||ae.target instanceof HTMLElement&&ae.target.isContentEditable))switch(ae.key){case"n":if(ae.ctrlKey||ae.metaKey||ae.altKey||ae.shiftKey)return;ae.preventDefault(),S("backlog"),D(!0);break;case"?":if(ae.ctrlKey||ae.metaKey||ae.altKey)return;ae.preventDefault(),P(Ge=>!Ge);break;case"Escape":E?P(!1):z?D(!1):G.getState().selectedCardIds.length>0&&_();break}},te=ae=>{ae.key==="Alt"&&F&&(F=!1,Q&&(clearTimeout(Q),Q=null),ce.postMessage({type:"focusMenuBar"}))},je=()=>{F=!1};return window.addEventListener("keydown",X),window.addEventListener("keyup",te),window.addEventListener("mousedown",je),()=>{window.removeEventListener("keydown",X),window.removeEventListener("keyup",te),window.removeEventListener("mousedown",je),Q&&clearTimeout(Q)}},[z,E,we,h,_]),x.useEffect(()=>{const F=()=>{const X=document.documentElement,te=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");f(te),X.dataset.kbTheme=te?"dark":"light",te?X.classList.add("dark"):X.classList.remove("dark")};F();const Q=new MutationObserver(F);return Q.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>Q.disconnect()},[f]),x.useEffect(()=>{const F=document.documentElement;F.style.setProperty("--board-zoom",String(s.boardZoom/100)),F.style.setProperty("--card-zoom",String(s.cardZoom/100))},[s.boardZoom,s.cardZoom]),x.useEffect(()=>{const F=document.documentElement,Q=ja(s.boardBackgroundMode,s.boardBackgroundPreset);F.dataset.kbBoardMode=Q.boardBackgroundMode,F.dataset.kbBoardPreset=Q.boardBackgroundPreset},[s.boardBackgroundMode,s.boardBackgroundPreset]),x.useEffect(()=>{const F=Q=>{const X=Q.data;if(!(!X||typeof X.type!="string"))switch(X.type){case"init":{const te=X.cards??[];{const je=X.columns??[],ae=X.currentBoard??G.getState().currentBoard,Ge=je.map(ps=>ps.id),Xe=G.getState().columnVisibilityByBoard,mt={...A.current,...Xe};if(X.minimizedColumnIds!==void 0){const ps=mt[ae]??{hiddenColumnIds:[],minimizedColumnIds:[]};mt[ae]={...ps,minimizedColumnIds:X.minimizedColumnIds},W.current={boardId:ae,columnIds:X.minimizedColumnIds}}const tr=Yf(mt,ae,Ge);G.setState({currentBoard:ae,columnVisibilityByBoard:tr})}le(null),c(te),J(te),u(X.columns??[]),X.boards&&d(X.boards),X.workspace&&p(X.workspace),X.settings&&(X.settings.markdownEditorMode&&U&&oe(null),h(X.settings)),X.labels&&y(X.labels),$(!0);break}case"connectionStatus":le(XZ(X));break;case"cardsUpdated":c(X.cards),J(X.cards);break;case"triggerCreateDialog":S("backlog"),D(!0);break;case"labelsUpdated":y(X.labels);break;case"showSettings":h(X.settings),v(!0);break;case"cardContent":{const{cardSettings:te}=G.getState();if(te.markdownEditorMode)break;R(X.cardId),L.current+=1,oe(je=>({id:X.cardId,content:X.content,frontmatter:X.frontmatter,comments:X.comments||[],logs:X.logs!==void 0?X.logs:(je==null?void 0:je.id)===X.cardId?je.logs:[],contentVersion:L.current}));break}case"actionResult":break;case"boardActionResult":break;case"logsUpdated":{oe(te=>te&&te.id===X.cardId?{...te,logs:X.logs}:te);break}case"boardLogsUpdated":{I(X.logs);break}}};return window.addEventListener("message",F),ce.postMessage({type:"ready"}),()=>window.removeEventListener("message",F)},[U,c,u,d,p,h,v,y,J]),x.useEffect(()=>{var te;if(!k)return;const F=Yf(r,t,e.map(je=>je.id));if(F!==r){G.setState({columnVisibilityByBoard:F});return}A.current=F,ce.setState(F);const Q=((te=F[t])==null?void 0:te.minimizedColumnIds)??[],X=W.current;(!X||X.boardId!==t||!tQ(X.columnIds,Q))&&(ce.postMessage({type:"setMinimizedColumns",boardId:t,columnIds:Q}),W.current={boardId:t,columnIds:Q})},[r,e,t,k]);const Ne=(F,Q)=>{if(Q.metaKey||Q.ctrlKey){const te=[...G.getState().selectedCardIds];U&&!te.includes(U.id)&&te.push(U.id);const je=te.indexOf(F.id);je>=0?te.splice(je,1):te.push(F.id),G.setState({selectedCardIds:te,lastClickedCardId:F.id}),U&&oe(null);return}if(Q.shiftKey){if(U&&!G.getState().lastClickedCardId){const X=G.getState().selectedCardIds,te=X.includes(U.id)?[...X]:[...X,U.id];G.setState({selectedCardIds:te,lastClickedCardId:U.id})}C(F.id),U&&oe(null);return}_(),ce.postMessage({type:"openCard",cardId:F.id})},Ce=(F,Q)=>{U&&ce.postMessage({type:"saveCardContent",cardId:U.id,content:F,frontmatter:Q})},Ie=(F,Q)=>{U&&(ce.postMessage({type:"transferCard",cardId:U.id,toBoard:F,targetStatus:Q}),oe(null),R(null))},qe=()=>{oe(null),R(null),ce.postMessage({type:"closeCard"})},it=()=>{U&&se(U.id)},Et=()=>{U&&(ce.postMessage({type:"permanentDeleteCard",cardId:U.id}),oe(null),R(null))},wt=()=>{U&&(ce.postMessage({type:"restoreCard",cardId:U.id}),oe(null),R(null))},ye=()=>{ce.postMessage({type:"purgeDeletedCards"})},$e=()=>{U&&ce.postMessage({type:"openFile",cardId:U.id})},Ve=F=>{ce.postMessage({type:"openMetadataFile",path:F})},pt=()=>{U&&ce.postMessage({type:"downloadCard",cardId:U.id})},ls=(F,Q)=>{ce.postMessage({type:"startWithAI",agent:F,permissionMode:Q})},pn=()=>{U&&ce.postMessage({type:"addAttachment",cardId:U.id})},mn=F=>{U&&ce.postMessage({type:"openAttachment",cardId:U.id,attachment:F})},cs=F=>{U&&ce.postMessage({type:"removeAttachment",cardId:U.id,attachment:F})},us=(F,Q)=>{U&&ce.postMessage({type:"addComment",cardId:U.id,author:F,content:Q})},gn=(F,Q)=>{U&&ce.postMessage({type:"updateComment",cardId:U.id,commentId:F,content:Q})},ds=F=>{U&&ce.postMessage({type:"deleteComment",cardId:U.id,commentId:F})},vn=()=>{U&&ce.postMessage({type:"clearLogs",cardId:U.id})},fs=()=>{Y?N(!1):(N(!0),ce.postMessage({type:"getBoardLogs"}))},jo=()=>{ce.postMessage({type:"clearBoardLogs"})},yn=F=>{ce.postMessage({type:"saveSettings",settings:F})},hs=x.useCallback(F=>{g(F)},[g]),Eo=x.useCallback(F=>{m();const Q={...G.getState().cardSettings,drawerWidth:F};h(Q),yn(Q)},[m,h]),bn=x.useCallback(()=>{m()},[m]),zi=()=>{V(null),O(!0)},Ao=F=>{const Q=e.find(X=>X.id===F);Q&&(V(Q),O(!0))},No=F=>{!e.find(te=>te.id===F)||G.getState().cards.filter(te=>te.status===F).length>0||ce.postMessage({type:"removeColumn",columnId:F})},Oi=F=>{!e.find(te=>te.id===F)||G.getState().cards.filter(te=>te.status===F).length===0||ce.postMessage({type:"cleanupColumn",columnId:F})},Po=x.useCallback(F=>{const Q=G.getState().columns;u(F.map(X=>Q.find(te=>te.id===X)).filter(X=>X!=null)),ce.postMessage({type:"reorderColumns",columnIds:F})},[u]),Ro=F=>{q?ce.postMessage({type:"editColumn",columnId:q.id,updates:F}):ce.postMessage({type:"addColumn",column:F}),O(!1),V(null)},To=F=>{S(F),D(!0)},Io=x.useCallback(F=>{const Q=Array.from(G.getState().selectedCardIds);for(const te of Q)ce.postMessage({type:"moveCard",cardId:te,newStatus:F,newOrder:-1});const{cards:X}=G.getState();c(X.map(te=>Q.includes(te.id)?{...te,status:F}:te)),_()},[c,_]),T=x.useCallback(F=>{const Q=Array.from(G.getState().selectedCardIds);for(const te of Q)ce.postMessage({type:"bulkUpdateCard",cardId:te,updates:{priority:F}});const{cards:X}=G.getState();c(X.map(te=>Q.includes(te.id)?{...te,priority:F}:te)),_()},[c,_]),me=x.useCallback(F=>{const Q=Array.from(G.getState().selectedCardIds);for(const te of Q)ce.postMessage({type:"bulkUpdateCard",cardId:te,updates:{assignee:F}});const{cards:X}=G.getState();c(X.map(te=>Q.includes(te.id)?{...te,assignee:F}:te)),_()},[c,_]),er=x.useCallback((F,Q)=>{const X=Array.from(G.getState().selectedCardIds),{cards:te}=G.getState();for(const je of X){const ae=te.find(Xe=>Xe.id===je);if(!ae)continue;const Ge=Array.from(new Set([...ae.labels,...F])).filter(Xe=>!Q.includes(Xe));ce.postMessage({type:"bulkUpdateCard",cardId:je,updates:{labels:Ge}})}c(te.map(je=>{if(!X.includes(je.id))return je;const ae=Array.from(new Set([...je.labels,...F])).filter(Ge=>!Q.includes(Ge));return{...je,labels:ae}})),_()},[c,_]),Di=x.useCallback(()=>{const F=Array.from(G.getState().selectedCardIds);for(const Q of F)se(Q);_()},[se,_]),Jx=x.useCallback((F,Q)=>{for(const te of F)ce.postMessage({type:"moveCard",cardId:te,newStatus:Q,newOrder:-1});const{cards:X}=G.getState();c(X.map(te=>F.includes(te.id)?{...te,status:Q}:te)),_()},[c,_]),pf=F=>{ce.postMessage({type:"createCard",data:F})},Zx=x.useCallback(F=>{if(!U)return;const Q=`action-${Date.now()}`;ce.postMessage({type:"triggerAction",cardId:U.id,action:F,callbackKey:Q})},[U]),Qx=x.useCallback((F,Q)=>{const X=`action-${Date.now()}`;ce.postMessage({type:"triggerAction",cardId:F,action:Q,callbackKey:X})},[]),Xx=x.useCallback((F,Q)=>{const X=`board-action-${Date.now()}`;ce.postMessage({type:"triggerBoardAction",boardId:F,actionKey:Q,callbackKey:X})},[]),e1=(F,Q,X)=>{const{cards:te}=G.getState();if(te.find(ae=>ae.id===F)){const ae=te.filter(rr=>rr.status===Q&&rr.id!==F).sort((rr,mf)=>rr.order<mf.order?-1:rr.order>mf.order?1:0),Ge=Math.max(0,Math.min(X,ae.length)),Xe=Ge>0?ae[Ge-1].order:null,mt=Ge<ae.length?ae[Ge].order:null,tr=Jk(Xe,mt),ps=te.map(rr=>rr.id===F?{...rr,status:Q,order:tr}:rr);c(ps)}ce.postMessage({type:"moveCard",cardId:F,newStatus:Q,newOrder:X})},t1=x.useCallback(F=>{pf({...F,assignee:null,dueDate:null,labels:[],actions:[]})},[]);return e.length===0?l.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:l.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):l.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[l.jsx(IZ,{onOpenSettings:()=>ce.postMessage({type:"openSettings"}),onAddColumn:zi,onCreateCard:()=>{S(s.defaultStatus||"backlog"),D(!0)},onToggleTheme:()=>ce.postMessage({type:"toggleTheme"}),onSwitchBoard:F=>ce.postMessage({type:"switchBoard",boardId:F}),onCreateBoard:F=>ce.postMessage({type:"createBoard",name:F}),onOpenBoardLogs:fs,boardLogsOpen:Y,onTriggerBoardAction:Xx,onOpenShortcutHelp:()=>P(F=>!F)}),l.jsxs("div",{className:"kb-board-stage flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"board-zoom-scope w-full min-w-0",style:(s.panelMode??"drawer")==="drawer"&&i.length===0&&(U!==null||Y)?{width:`${100-o}%`}:void 0,children:l.jsx(i$,{onCardClick:Ne,onAddCard:To,onMoveCard:e1,onMoveCards:Jx,onEditColumn:Ao,onRemoveColumn:No,onCleanupColumn:Oi,onReorderColumns:Po,onPurgeDeletedCards:ye,selectedCardId:U==null?void 0:U.id,selectedCardIds:i,onSelectAll:w,onQuickAdd:t1,onTriggerAction:Qx})}),Y&&i.length===0&&!U&&(()=>{const F=(s.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>N(!1)}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-xl shadow-xl animate-in zoom-in-95 fade-in duration-200",style:F?{width:`${o}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:F?"drawer":"popup",onPreview:hs,onCommit:Eo,onCancel:bn}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"text-sm font-medium",style:{color:"var(--vscode-foreground)"},children:"Board Logs"}),l.jsx("button",{onClick:()=>N(!1),className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:Q=>Q.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:Q=>Q.currentTarget.style.background="transparent",title:"Close board logs",children:"✕"})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsx(B0,{logs:Z,onClearLogs:jo})})]})]})})(),U&&i.length===0&&(()=>{const F=(s.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 card-view-modal-backdrop",onClick:qe}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl overflow-hidden animate-in slide-in-from-right duration-200 pointer-events-auto card-view-shell card-view-shell--drawer":"relative w-full max-w-none h-[90vh] flex flex-col rounded-xl shadow-xl overflow-hidden animate-in zoom-in-95 fade-in duration-200 card-view-shell card-view-shell--popup",style:{fontSize:"calc(1em * var(--card-zoom, 1))",...F?{width:`${o}%`}:{}},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:F?"drawer":"popup",onPreview:hs,onCommit:Eo,onCancel:bn}),l.jsx(NZ,{cardId:U.id,content:U.content,frontmatter:U.frontmatter,comments:U.comments,contentVersion:U.contentVersion,onSave:Ce,onClose:qe,onDelete:it,onPermanentDelete:Et,onRestore:wt,onOpenFile:$e,onOpenMetadataFile:Ve,onDownloadCard:pt,onStartWithAI:ls,onAddAttachment:pn,onOpenAttachment:mn,onRemoveAttachment:cs,onAddComment:us,onUpdateComment:gn,onDeleteComment:ds,onTransferToBoard:Ie,onTriggerAction:Zx,logs:U.logs,onClearLogs:vn,logsFilter:s.logsFilter,onLogsFilterChange:Q=>{const X={...s,logsFilter:Q};h(X),ce.postMessage({type:"saveSettings",settings:X})}})]})]})})()]}),i.length>1&&l.jsx(GZ,{selectedCount:i.length,onClearSelection:_,onMoveToColumn:Io,onSetPriority:T,onSetAssignee:me,onApplyLabels:er,onDelete:Di}),l.jsx(hZ,{isOpen:z,onClose:()=>D(!1),onCreate:pf,initialStatus:j,onSaveSettings:yn}),l.jsx(LZ,{isOpen:a,settings:s,workspace:n,onClose:()=>v(!1),onSave:yn,onSetLabel:(F,Q)=>ce.postMessage({type:"setLabel",name:F,definition:Q}),onRenameLabel:(F,Q)=>ce.postMessage({type:"renameLabel",oldName:F,newName:Q}),onDeleteLabel:F=>ce.postMessage({type:"deleteLabel",name:F})}),l.jsx(VZ,{isOpen:K,onClose:()=>{O(!1),V(null)},onSave:Ro,initial:q?{name:q.name,color:q.color}:void 0,title:q?"Edit List":"Add List"}),re&&l.jsx(Gm,{title:re.title,message:re.message,persistent:!0,tone:re.tone,index:0}),H.map((F,Q)=>l.jsx(Gm,{message:`Deleted "${tu(F.card.content)}"`,onUndo:()=>_e(F.id),onExpire:()=>ue(F.id),duration:5e3,index:re?Q+1:Q},F.id)),l.jsx(ZZ,{isOpen:E,onClose:()=>P(!1)})]})}function sQ(e){return e!=="http:"&&e!=="https:"}function Ur(e){if(typeof e=="string")return e;if(typeof e=="boolean")return String(e)}function oQ(e){var r;const t=(r=Ur(e))==null?void 0:r.trim().replace(/^"(.*)"$/,"$1").toLowerCase();if(t==="true")return!0;if(t==="false")return!1}function ff(e){return{priority:Ur(e.priority),labels:Ur(e.labels),assignee:Ur(e.assignee),dueDate:Ur(e.dueDate),q:Ur(e.q),fuzzy:Ur(e.fuzzy)}}function Zm(e){return JSON.stringify({...e.priority&&{priority:e.priority},...e.labels&&{labels:e.labels},...e.assignee&&{assignee:e.assignee},...e.dueDate&&{dueDate:e.dueDate},...e.q&&{q:e.q},...e.fuzzy&&{fuzzy:e.fuzzy}})}const Qm=df(),aQ=["critical","high","medium","low"],iQ=["overdue","today","this-week","no-date"];function lQ(){const e=li(),t=ai({strict:!1}),r=ii({strict:!1}),{setPriorityFilter:n,setAssigneeFilter:s,setLabelFilter:o,setDueDateFilter:a,setSearchQuery:i,setFuzzySearch:c,setActiveCardTab:u}=G.getState(),d=G(S=>S.columns),f=G(S=>S.currentBoard),p=G(S=>S.activeCardId),h=G(S=>S.activeCardTab),g=G(S=>S.priorityFilter),m=G(S=>S.assigneeFilter),v=G(S=>S.labelFilter),y=G(S=>S.dueDateFilter),b=G(S=>S.searchQuery),C=G(S=>S.fuzzySearch),w=G.getState(),_=x.useRef({board:t.boardId??w.currentBoard,cardId:"",tab:jn(t.tabId??w.activeCardTab),searchStr:Zm(r)}),R=x.useRef(!1),z=x.useRef(t.cardId??null);x.useEffect(()=>{if(R.current)return;R.current=!0,r.priority&&aQ.includes(r.priority)&&n(r.priority),r.labels&&o(r.labels.split(",").filter(Boolean)),r.assignee&&s(r.assignee),r.dueDate&&iQ.includes(r.dueDate)&&a(r.dueDate),r.q&&i(decodeURIComponent(r.q));const S=oQ(r.fuzzy);S!==void 0&&c(S),t.tabId&&s0(t.tabId)&&u(t.tabId),t.boardId&&Qm.postMessage({type:"switchBoard",boardId:t.boardId})},[]);const D=x.useRef(!1);x.useEffect(()=>{D.current||d.length===0||(D.current=!0,z.current&&(Qm.postMessage({type:"openCard",cardId:z.current}),z.current=null))},[d]);const j=x.useRef(!0);return x.useEffect(()=>{if(d.length===0)return;const S={};g!=="all"&&(S.priority=g),v.length>0&&(S.labels=v.join(",")),m!=="all"&&(S.assignee=m),y!=="all"&&(S.dueDate=y),b&&(S.q=b),C&&(S.fuzzy="true");const E=Zm(S),P=_.current,K=P.board!==f,O=P.cardId!==(p??""),q=!!p&&P.tab!==h,V=P.searchStr!==E;if(!K&&!O&&!q&&!V)return;_.current={board:f,cardId:p??"",tab:h,searchStr:E};const L=j.current||!K&&!O&&!q&&V;j.current=!1,e(p?{to:"/$boardId/$cardId/$tabId",params:{boardId:f,cardId:p,tabId:h},search:S,replace:L}:{to:"/$boardId",params:{boardId:f},search:S,replace:L})},[d.length,f,p,h,g,m,v,y,b,C,e]),null}function cQ(){return l.jsxs(l.Fragment,{children:[l.jsx(nQ,{}),l.jsx(lQ,{}),l.jsx(ci,{})]})}const hf=zk({component:cQ,notFoundComponent:()=>null}),uQ=oo({getParentRoute:()=>hf,path:"/",component:()=>null}),Gx=oo({getParentRoute:()=>hf,path:"$boardId",validateSearch:ff,component:()=>l.jsx(ci,{})}),Yx=oo({getParentRoute:()=>Gx,path:"$cardId",validateSearch:ff,component:()=>l.jsx(ci,{})}),dQ=oo({getParentRoute:()=>Yx,path:"$tabId",validateSearch:ff,component:()=>null}),fQ=hf.addChildren([uQ,Gx.addChildren([Yx.addChildren([dQ])])]),hQ=Vk({routeTree:fQ,history:sQ(window.location.protocol)?Q1({initialEntries:["/"]}):void 0,defaultPreload:"intent"});mg(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(qk,{router:hQ})}));
132
+ ${V}`:""}`:V;r({status:g,priority:v,content:U,assignee:b.trim()||null,dueDate:w||null,labels:R,actions:D})},O=()=>{K(),t()},G=()=>{t()};return x.useEffect(()=>{const V=L=>{L.key==="Escape"&&G(),(L.metaKey||L.ctrlKey)&&L.key==="Enter"&&O(),(L.metaKey||L.ctrlKey)&&L.key==="s"&&(L.preventDefault(),O())};if(e)return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)}),l.jsxs("div",{className:`fixed inset-0 z-50 flex ${(o.panelMode??"drawer")==="drawer"?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[(o.panelMode??"drawer")!=="drawer"&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:G}),l.jsxs("div",{className:(o.panelMode??"drawer")==="drawer"?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:{background:"var(--vscode-editor-background)",...(o.panelMode??"drawer")==="drawer"?{width:`${a}%`,borderLeft:"1px solid var(--vscode-panel-border)"}:{border:"1px solid var(--vscode-panel-border)"}},...(o.panelMode??"drawer")==="drawer"?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:(o.panelMode??"drawer")==="drawer"?"drawer":"popup",onPreview:i,onCommit:V=>{c();const L={...q.getState().cardSettings,drawerWidth:V};u(L),n(L)},onCancel:c}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Card"})}),l.jsx("button",{onClick:G,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx($n,{label:"Status",icon:l.jsx(rg,{size:13}),children:l.jsx(Om,{value:g,options:f,onChange:V=>m(V)})}),o.showPriorityBadges&&l.jsx($n,{label:"Priority",icon:l.jsx(Fc,{size:13}),children:l.jsx(Om,{value:v,options:gZ.map(V=>({value:V.value,label:V.label,dot:V.dot})),onChange:V=>y(V)})}),o.showAssignee&&l.jsx($n,{label:"Assignee",icon:l.jsx(ga,{size:13}),children:l.jsx(vZ,{value:b,onChange:C})}),o.showDueDate&&l.jsx($n,{label:"Due date",icon:l.jsx(Dc,{size:13}),children:l.jsx(s$,{value:w,onChange:_})}),o.showLabels&&l.jsx($n,{label:"Labels",icon:l.jsx(Xa,{size:13}),children:l.jsx(yZ,{labels:R,onChange:z})}),l.jsx($n,{label:"Actions",icon:l.jsx(ma,{size:13}),children:l.jsx(bZ,{actions:D,onChange:j})})]}),l.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[l.jsx("textarea",{ref:P,value:p,onChange:V=>h(V.target.value),placeholder:"Card title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:V=>{const L=V.target;L.style.height="auto",L.style.height=L.scrollHeight+"px"},onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&V.preventDefault()}}),l.jsx(Ox,{value:S,onChange:E,placeholder:"Add a description..."})]}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[l.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",l.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:G,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="transparent",children:"Cancel"}),l.jsx("button",{type:"button",onClick:O,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:V=>V.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:V=>V.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}function Dm({value:e}){const[t,r]=x.useState(!1),n=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1 cursor-pointer",onClick:n,title:"Click to copy",children:[l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300",children:e}),l.jsx("span",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}const kZ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},_Z=["critical","high","medium","low"],CZ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},$Z=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],SZ={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},jZ={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function EZ({value:e,options:t,onChange:r,className:n}){const[s,o]=x.useState(!1),a=t.find(i=>i.value===e);return l.jsxs("div",{className:Ee("relative",s&&"z-30",n),children:[l.jsxs("button",{onClick:()=>o(!s),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",a.dot)}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>o(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[172px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(i=>l.jsxs("button",{onClick:()=>{r(i.value),o(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:c=>{i.value!==e&&(c.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:c=>{i.value!==e&&(c.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",i.dot)}),l.jsx("span",{className:"flex-1 text-left",children:i.label}),i.value===e&&l.jsx(St,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},i.value))})]})]})}function AZ({value:e,onChange:t,onTransferToBoard:r}){const[n,s]=x.useState(!1),o=q(u=>u.columns),a=q(u=>u.boards),i=q(u=>u.currentBoard),c=a.filter(u=>u.id!==i);return l.jsxs("div",{className:Ee("relative",n&&"z-30"),children:[l.jsxs("button",{onClick:()=>s(!n),className:"card-select-trigger",style:{color:"var(--vscode-foreground)"},children:[(()=>{const u=o.find(d=>d.id===e);return u?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),l.jsx("span",{children:u.name})]}):l.jsx("span",{children:e})})(),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>s(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 min-w-[204px] max-h-[320px] overflow-y-auto",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[o.map(u=>l.jsxs("button",{onClick:()=>{t(u.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:u.id===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:d=>{u.id!==e&&(d.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:d=>{u.id!==e&&(d.currentTarget.style.background="transparent")},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),l.jsx("span",{className:"flex-1 text-left",children:u.name}),u.id===e&&l.jsx(St,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},u.id)),c.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mx-2 my-1",style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Move to..."}),c.map(u=>l.jsxs("div",{children:[l.jsx("div",{className:"px-4 py-1 text-[10px] font-semibold",style:{color:"var(--vscode-descriptionForeground)"},children:u.name}),(u.columns||[]).map(d=>l.jsxs("button",{onClick:()=>{r(u.id,d.id),s(!1)},className:"card-floating-menu__item w-full flex items-center gap-2 pl-5 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:f=>{f.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},children:[l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d.color}}),l.jsx("span",{className:"flex-1 text-left",children:d.name})]},`${u.id}-${d.id}`))]},u.id))]})]})]})]})}function kr({label:e,icon:t,children:r}){return l.jsxs("div",{className:"card-property-row",children:[l.jsxs("div",{className:"card-property-label-group",children:[l.jsx("span",{className:"card-property-icon",style:{color:"var(--vscode-descriptionForeground)"},children:t}),l.jsx("span",{className:"card-property-label",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),l.jsx("div",{className:"card-property-value",children:r})]})}function Dx(e){return Array.isArray(e)?e.map(t=>String(t)).join(","):String(e)}function Oc({path:e,value:t}){const r=q(n=>n.applyMetadataFilterToken);return l.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),r(e,t)},className:"shrink-0 rounded p-0.5 opacity-60 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-1 focus:ring-blue-500",style:{color:"var(--vscode-descriptionForeground)"},title:`Filter cards by ${e}`,"aria-label":`Filter cards by metadata ${e} = ${t}`,children:l.jsx(h1,{size:11})})}function NZ({onSelect:e}){const[t,r]=x.useState(!1),[n,s]=x.useState("claude"),o=jZ[n],a=SZ[n];return l.jsxs("div",{className:Ee("relative",t&&"z-30"),children:[l.jsxs("button",{onClick:()=>r(!t),className:Ee("card-inline-action card-inline-action--solid",a.bg,a.hover,a.shadow,a.border),children:[l.jsx(f1,{size:13}),l.jsx("span",{children:"Build with AI"}),l.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),l.jsx(Ze,{size:11,className:Ee("ml-0.5 opacity-60 transition-transform",t&&"rotate-180")})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"card-floating-dismiss",onClick:()=>r(!1)}),l.jsxs("div",{className:"card-floating-menu absolute top-full right-0 mt-1 min-w-[240px] overflow-hidden bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700",children:[l.jsx("div",{className:"flex",children:$Z.map(i=>l.jsx("button",{onClick:()=>s(i.agent),className:Ee("flex-1 px-3 py-2 text-[11px] font-medium transition-all",n===i.agent?i.activeColor:Ee("text-zinc-600 dark:text-zinc-400",i.color)),children:i.label},i.agent))}),l.jsx("div",{className:"p-1 space-y-1",children:o.map(i=>l.jsxs("button",{onClick:()=>{e(n,i.permissionMode),r(!1)},className:"w-full text-left px-2.5 py-1.5 rounded-[8px] hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[l.jsx("div",{className:"text-[11px] font-medium text-zinc-900 dark:text-zinc-100",children:i.label}),l.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:i.description})]},i.permissionMode))})]})]})]})}function PZ({actions:e,onTriggerAction:t}){const[r,n]=x.useState(!1),s=Array.isArray(e)?e.map(o=>({key:o,label:o})):Object.entries(e).map(([o,a])=>({key:o,label:a}));return l.jsxs("div",{className:Ee("relative",r&&"z-30"),children:[l.jsxs("button",{onClick:()=>n(!r),className:"card-inline-action",style:{color:"var(--vscode-foreground)",border:"1px solid var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},children:[l.jsx("span",{children:"Run Action"}),l.jsx(Ze,{size:11,className:Ee("opacity-60 transition-transform",r&&"rotate-180")})]}),r&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button","aria-label":"Close actions menu",className:"card-floating-dismiss cursor-default",onClick:()=>n(!1)}),l.jsx("div",{className:"card-floating-menu absolute top-full right-0 mt-1",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:s.map(({key:o,label:a})=>l.jsx("button",{type:"button",onClick:()=>{n(!1),t(o)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors whitespace-nowrap",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent"},children:a},o))})]})]})}function Lx({size:e=16}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 19.88V4.12a1.5 1.5 0 0 0-.85-1.533zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}function _r({title:e,icon:t,onClick:r,variant:n="default",label:s}){return l.jsxs("button",{type:"button",onClick:r,className:Ee("card-action-button",n!=="default"&&`card-action-button--${n}`),title:e,"aria-label":e,children:[l.jsx("span",{className:"card-action-button__icon",children:t}),s&&l.jsx("span",{className:"card-action-button__label",children:s})]})}function Fx(e){return/^https?:\/\//i.test(e)}function RZ(e){return/^(\/|~\/|\.{1,2}\/|[A-Za-z]:[/\\])/i.test(e)}function TZ({value:e}){const[t,r]=x.useState(!1),n=s=>{s.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300 hover:underline",title:e,onClick:s=>s.stopPropagation(),children:[l.jsx(ng,{size:10,className:"shrink-0"}),l.jsx("span",{className:"break-all",children:e})]}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:n,title:"Copy URL",children:t?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function IZ({value:e,onOpenFile:t}){const[r,n]=x.useState(!1),s=o=>{o.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return l.jsxs("span",{className:"group/val inline-flex items-center gap-1",children:[t&&l.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100 transition-opacity cursor-pointer",onClick:o=>{o.stopPropagation(),t(e)},title:"Open in VS Code",children:l.jsx(Lx,{size:11})}),l.jsx("span",{className:"text-zinc-700 dark:text-zinc-300 break-all",children:e}),l.jsx("button",{className:"opacity-0 group-hover/val:opacity-100 transition-opacity cursor-pointer",onClick:s,title:"Copy path",children:r?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function MZ({metadata:e,onOpenMetadataFile:t}){if(!e||Object.keys(e).length===0)return null;const r=Object.keys(e);return l.jsxs("div",{className:"card-metadata-section",children:[l.jsxs("div",{className:"card-metadata-section__header",children:[l.jsx("span",{children:"Metadata"}),l.jsx("span",{className:"card-metadata-section__count",children:r.length})]}),l.jsx("div",{className:"card-metadata-tree-shell",children:l.jsx(Bx,{data:e,depth:0,onOpenMetadataFile:t})})]})}function Bx({data:e,depth:t,pathPrefix:r="",onOpenMetadataFile:n}){return l.jsx("div",{style:{paddingLeft:t>0?12:0},children:Object.entries(e).map(([s,o])=>{const a=r?`${r}.${s}`:s,i=Dx(o);return l.jsx("div",{className:"py-0.5",children:o&&typeof o=="object"&&!Array.isArray(o)?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,":"]}),l.jsx(Bx,{data:o,depth:t+1,pathPrefix:a,onOpenMetadataFile:n})]}):Array.isArray(o)?l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),l.jsx(Dm,{value:`[${o.join(", ")}]`}),l.jsx(Oc,{path:a,value:i})]}):l.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[l.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),Fx(String(o))?l.jsx(TZ,{value:String(o)}):RZ(String(o))?l.jsx(IZ,{value:String(o),onOpenFile:n}):l.jsx(Dm,{value:String(o)}),l.jsx(Oc,{path:a,value:i})]})},s)})})}function zZ({labels:e,onChange:t}){const[r,n]=x.useState(""),[s,o]=x.useState(!1),a=x.useRef(null),i=q(m=>m.cards),c=q(m=>m.labelDefs),u=q(m=>m.applyLabelFilter),d=x.useMemo(()=>{const m=new Set;return i.forEach(v=>v.labels.forEach(y=>m.add(y))),Array.from(m).sort()},[i]),f=x.useMemo(()=>{const m=d.filter(v=>!e.includes(v));return r.trim()?m.filter(v=>v.toLowerCase().includes(r.toLowerCase())):m},[r,d,e]),p=s&&f.length>0,h=m=>{const v=(m||r).trim();v&&!e.includes(v)&&t([...e,v]),n("")},g=m=>{t(e.filter(v=>v!==m))};return l.jsxs("div",{className:Ee("relative flex items-center gap-2 flex-wrap",p&&"z-30"),children:[e.map(m=>{const v=c[m];return l.jsxs("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[l.jsx("button",{type:"button",onClick:()=>u(m),className:"hover:underline",title:`Filter cards by label ${m}`,"aria-label":`Filter cards by label ${m}`,children:m}),l.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),g(m)},className:"hover:text-red-500 transition-colors","aria-label":`Remove label ${m}`,children:l.jsx(st,{size:9})})]},m)}),l.jsxs("button",{onClick:()=>{o(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.focus()},0)},className:"card-label-add",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Zr,{size:10}),l.jsx("span",{children:"Add label"})]}),l.jsx("input",{ref:a,type:"text",value:r,onChange:m=>n(m.target.value),onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),150),onKeyDown:m=>{var v;m.key==="Enter"&&(m.preventDefault(),h()),m.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1)),m.key==="Escape"&&(n(""),(v=a.current)==null||v.blur())},placeholder:e.length===0?"Add labels...":"",className:"card-label-input",style:{color:"var(--vscode-foreground)",display:s||r?"block":"none"}}),p&&l.jsx("div",{className:"card-floating-menu absolute top-full left-0 mt-1.5 max-h-[200px] overflow-auto min-w-[220px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:f.map(m=>{const v=c[m];return l.jsx("button",{type:"button",onMouseDown:y=>{y.preventDefault(),h(m)},className:"card-floating-menu__item w-full flex items-center gap-2 text-[11px] transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:l.jsx("span",{className:"card-label-pill",style:v?{backgroundColor:`${v.color}20`,color:v.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:m})},m)})})]})}function OZ({cardId:e,content:t,frontmatter:r,comments:n,contentVersion:s,onSave:o,onClose:a,onDelete:i,onPermanentDelete:c,onRestore:u,onOpenFile:d,onOpenMetadataFile:f,onDownloadCard:p,onStartWithAI:h,onAddAttachment:g,onOpenAttachment:m,onRemoveAttachment:v,onAddComment:y,onUpdateComment:b,onDeleteComment:C,onTransferToBoard:w,onTriggerAction:_,logs:R,onClearLogs:z,logsFilter:D,onLogsFilterChange:j}){var M;const{cardSettings:S,boards:E,currentBoard:P}=q(),K=((M=E.find(J=>J.id===P))==null?void 0:M.metadata)??[],[O,G]=x.useState(r),[V,L]=x.useState(t),[U,oe]=x.useState(!1),[Y,N]=x.useState(!1),Z=O.status===qn,I=Qc(V),k=O.metadata??{},$=x.useMemo(()=>K.map(J=>({key:J,value:k[J]})).filter(({value:J})=>J!=null&&String(J).trim()!==""),[k,K]),A=x.useRef(null),W=x.useRef(O),H=x.useRef(V);W.current=O,H.current=V;const ee=x.useCallback(()=>{o(H.current,W.current)},[o]);x.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),x.useEffect(()=>{L(t)},[e,s]),x.useEffect(()=>{G(r)},[r]);const re=x.useCallback(J=>{L(J),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{o(J,W.current)},800)},[o]),le=x.useCallback(J=>{G(se=>{const ue={...se,...J};return A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{o(H.current,ue)},800),ue})},[o]),pe=x.useCallback(J=>{G(se=>({...se,formData:J.card.formData,modified:J.card.modified}))},[]);return x.useEffect(()=>{const J=se=>{(se.metaKey||se.ctrlKey)&&se.key==="s"&&(se.preventDefault(),A.current&&clearTimeout(A.current),ee()),(se.metaKey||se.ctrlKey)&&se.key==="b"&&S.showBuildWithAI&&(se.preventDefault(),h("claude","default")),se.key==="Escape"&&(A.current&&(clearTimeout(A.current),ee()),a())};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[ee,a,h,S.showBuildWithAI]),l.jsx("div",{className:"card-editor-shell h-full flex flex-col",children:l.jsx("div",{className:"card-editor-content flex-1 min-h-0 overflow-auto",children:l.jsxs("div",{className:"card-editor-stack",children:[l.jsxs("header",{className:"card-editor-hero",children:[l.jsxs("div",{className:"card-editor-hero-copy",children:[l.jsxs("div",{className:"card-editor-hero-meta",children:[l.jsx("span",{className:"card-editor-card-id",children:e}),l.jsx("span",{className:"card-editor-hero-separator","aria-hidden":"true"}),l.jsx("span",{title:Bs(O.modified),children:sa(O.modified)})]}),l.jsx("h1",{className:"card-editor-title",children:I})]}),l.jsxs("div",{className:"card-editor-hero-actions",children:[O.actions&&(Array.isArray(O.actions)?O.actions.length>0:Object.keys(O.actions).length>0)&&_&&l.jsx(PZ,{actions:O.actions,onTriggerAction:_}),S.showBuildWithAI&&l.jsx(NZ,{onSelect:h}),Z?U?l.jsxs("div",{className:"card-delete-confirmation",children:[l.jsx("span",{className:"card-delete-confirmation__text",children:"Delete this card from disk?"}),l.jsx(_r,{title:"Confirm permanent delete",icon:l.jsx(Kt,{size:15}),label:"Delete",onClick:()=>{oe(!1),c()},variant:"danger"}),l.jsx(_r,{title:"Cancel permanent delete",icon:l.jsx(hf,{size:15}),label:"Keep",onClick:()=>oe(!1)})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Restore card",icon:l.jsx(hf,{size:15}),label:"Restore",onClick:u,variant:"primary"}),l.jsx(_r,{title:"Permanently delete from disk",icon:l.jsx(Kt,{size:15}),label:"Delete forever",onClick:()=>oe(!0),variant:"danger"})]}):l.jsxs(l.Fragment,{children:[l.jsx(_r,{title:"Open in VS Code",icon:l.jsx(Lx,{size:15}),onClick:d}),l.jsx(_r,{title:"Download card as Markdown",icon:l.jsx(u1,{size:15}),onClick:p}),l.jsx(_r,{title:"Move to deleted",icon:l.jsx(Kt,{size:15}),onClick:i,variant:"danger"})]}),l.jsx(_r,{title:"Close card",icon:l.jsx(st,{size:16}),onClick:a})]})]}),l.jsxs("div",{className:Ee("card-editor-desktop-columns",S.compactMode&&"is-compact"),children:[l.jsxs("div",{className:"card-editor-top-row",children:[l.jsxs("section",{className:"card-surface card-surface--details",children:[l.jsx("div",{className:"card-surface-header",children:l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Overview"}),l.jsx("h2",{className:"card-surface-title",children:"Details"})]})}),l.jsxs("div",{className:"card-property-list",children:[l.jsx(kr,{label:"Status",icon:l.jsx(rg,{size:13}),children:l.jsx(AZ,{value:O.status,onChange:J=>le({status:J}),onTransferToBoard:w})}),S.showPriorityBadges&&l.jsx(kr,{label:"Priority",icon:l.jsx(Fc,{size:13}),children:l.jsx(EZ,{value:O.priority,options:_Z.map(J=>({value:J,label:kZ[J],dot:CZ[J]})),onChange:J=>le({priority:J})})}),S.showAssignee&&l.jsx(kr,{label:"Assignee",icon:l.jsx(ga,{size:13}),children:l.jsxs("div",{className:"card-property-chip card-property-chip--input",children:[l.jsx("span",{className:"card-property-avatar",style:{background:O.assignee?"var(--vscode-badge-background)":"rgba(148, 163, 184, 0.18)",color:O.assignee?"var(--vscode-badge-foreground)":"var(--vscode-descriptionForeground)"},children:O.assignee?O.assignee.split(/\s+/).filter(Boolean).map(J=>J[0]).join("").toUpperCase().slice(0,2):l.jsx(ga,{size:12})}),l.jsx("input",{type:"text",value:O.assignee||"",onChange:J=>le({assignee:J.target.value||null}),placeholder:"No assignee",className:"card-property-text-input",style:{color:O.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),S.showDueDate&&l.jsx(kr,{label:"Due date",icon:l.jsx(Dc,{size:13}),children:l.jsx("input",{type:"date",value:O.dueDate||"",onChange:J=>le({dueDate:J.target.value||null}),className:"card-date-input",style:{color:O.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),S.showLabels&&l.jsx(kr,{label:"Labels",icon:l.jsx(Xa,{size:13}),children:l.jsx(zZ,{labels:O.labels,onChange:J=>le({labels:J})})}),$.map(({key:J,value:se})=>{const ue=String(se);return l.jsx(kr,{label:J,icon:l.jsx(ng,{size:13}),children:l.jsxs("div",{className:"card-metadata-highlight min-w-0",children:[Fx(ue)?l.jsx("a",{href:ue,target:"_blank",rel:"noopener noreferrer",className:"card-metadata-highlight__link truncate",style:{color:"var(--vscode-textLink-foreground)"},children:ue}):l.jsx("span",{className:"card-metadata-highlight__value",style:{color:"var(--vscode-foreground)"},children:ue}),l.jsx(Oc,{path:J,value:Dx(se)})]})},J)}),l.jsxs("button",{type:"button",onClick:()=>N(J=>!J),className:"card-advanced-toggle",style:{color:"var(--vscode-descriptionForeground)"},children:[l.jsx(Ze,{size:11,className:`opacity-60 transition-transform ${Y?"":"-rotate-90"}`}),l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",children:"Advanced"})]}),Y&&l.jsxs(l.Fragment,{children:[l.jsx(kr,{label:"Created",icon:l.jsx(Ll,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Aa(O.created)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(O.created),children:sa(O.created)})]})}),l.jsx(kr,{label:"Modified",icon:l.jsx(Ll,{size:13}),children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Aa(O.modified)}),l.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Bs(O.modified),children:sa(O.modified)})]})}),l.jsx("div",{className:"px-4 pb-2",children:l.jsx(MZ,{metadata:k,onOpenMetadataFile:f})})]})]})]}),l.jsxs("section",{className:Ee("card-surface card-surface--attachments",S.compactMode&&"card-surface--attachments-compact"),children:[l.jsxs("div",{className:"card-surface-header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"card-surface-kicker",children:"Files"}),l.jsx("h2",{className:"card-surface-title",children:"Attachments"})]}),l.jsxs("button",{type:"button",onClick:g,className:"card-inline-action",children:[l.jsx(d1,{size:14}),l.jsx("span",{children:"Add attachment"})]})]}),O.attachments.length>0?l.jsx("div",{className:"card-attachment-tags",children:O.attachments.map(J=>l.jsxs("div",{className:"card-attachment-tag",children:[l.jsxs("button",{type:"button",onClick:()=>m(J),className:"card-attachment-tag__link",title:J,children:[l.jsx(Gm,{size:12}),l.jsx("span",{children:J})]}),l.jsx("button",{type:"button",onClick:()=>v(J),className:"card-attachment-tag__remove","aria-label":`Remove ${J}`,children:l.jsx(st,{size:12})})]},J))}):l.jsx("p",{className:"card-empty-state",children:"No attachments yet."})]})]}),l.jsx("section",{className:"card-surface card-surface--editor card-editor-main-surface",children:l.jsx(Ox,{value:V,onChange:re,placeholder:"Start writing...",className:"flex-1 min-h-[26rem]",mode:"edit",comments:n,onAddComment:y,onUpdateComment:b,onDeleteComment:C,logs:R,onClearLogs:z,logsFilter:D,onLogsFilterChange:j,cardId:e,frontmatter:O,onFormSubmitSuccess:pe})})]})]})})})}function DZ({labels:e,labelDefs:t,selected:r,onChange:n,showAllOption:s=!1,position:o="below"}){const[a,i]=x.useState(""),c=x.useMemo(()=>{const p={};return e.forEach(h=>{const g=t[h],m=(g==null?void 0:g.group)||"Other";p[m]||(p[m]=[]),p[m].push(h)}),p},[e,t]),u=x.useMemo(()=>{if(!a)return c;const p=a.toLowerCase(),h={};return Object.entries(c).forEach(([g,m])=>{const v=m.filter(y=>y.toLowerCase().includes(p));v.length>0&&(h[g]=v)}),h},[c,a]),d=p=>{r.includes(p)?n(r.filter(h=>h!==p)):n([...r,p])},f=o==="above"?"bottom-full mb-1":"top-full mt-1";return l.jsxs("div",{className:`absolute ${f} left-0 min-w-[200px] max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1`,children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:p=>i(p.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),s&&!a&&l.jsxs("button",{type:"button",onClick:()=>n([]),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${r.length===0?"text-blue-600 dark:text-blue-400 font-medium":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${r.length===0?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:r.length===0&&l.jsx(St,{size:10,className:"text-white"})}),l.jsx("span",{children:"All Labels"})]}),Object.entries(u).map(([p,h])=>l.jsxs("div",{children:[Object.keys(u).length>1&&l.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-xs font-semibold text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:p}),h.map(g=>{const m=t[g],v=r.includes(g);return l.jsxs("button",{type:"button",onClick:()=>d(g),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${v?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:v&&l.jsx(St,{size:10,className:"text-white"})}),(m==null?void 0:m.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:m.color}}),l.jsx("span",{className:"truncate",children:g})]},g)})]},p)),Object.keys(u).length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]})}function LZ({boards:e,currentBoard:t,starredBoards:r,onSelect:n,onClose:s}){const[o,a]=x.useState(""),[i,c]=x.useState(0),u=x.useRef(null),d=x.useMemo(()=>{const g=o.toLowerCase();return(g?e.filter(v=>v.name.toLowerCase().includes(g)||v.id.toLowerCase().includes(g)):e).slice().sort((v,y)=>{const b=r.includes(v.id),C=r.includes(y.id);return b&&!C?-1:!b&&C?1:0})},[e,o,r]);x.useEffect(()=>{setTimeout(()=>{var g;return(g=u.current)==null?void 0:g.focus()},0)},[]),x.useEffect(()=>{c(0)},[o]),x.useEffect(()=>{const g=m=>{if(m.key==="Escape"){m.stopPropagation(),s();return}if(m.key==="ArrowDown"){m.preventDefault(),c(v=>Math.min(v+1,d.length-1));return}if(m.key==="ArrowUp"){m.preventDefault(),c(v=>Math.max(v-1,0));return}m.key==="Enter"&&d[i]&&(n(d[i].id),s())};return document.addEventListener("keydown",g,!0),()=>document.removeEventListener("keydown",g,!0)},[d,i,n,s]);const f=d.filter(g=>r.includes(g.id)),p=d.filter(g=>!r.includes(g.id)),h=f.length>0;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:s}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 w-72 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-lg shadow-xl overflow-hidden",children:[l.jsx("div",{className:"p-2 border-b border-zinc-200 dark:border-zinc-700",children:l.jsxs("div",{className:"relative",children:[l.jsx(sg,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{ref:u,type:"text",value:o,onChange:g=>a(g.target.value),placeholder:"Search boards...",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-zinc-50 dark:bg-zinc-700 rounded-md border border-zinc-200 dark:border-zinc-600 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]})}),l.jsxs("div",{className:"py-1 max-h-72 overflow-y-auto",children:[d.length===0&&l.jsx("div",{className:"px-4 py-3 text-sm text-zinc-400 dark:text-zinc-500 text-center",children:"No boards found"}),h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-3 pt-1 pb-0.5 flex items-center gap-1.5",children:[l.jsx(og,{size:11,className:"text-amber-400 fill-amber-400"}),l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Starred"})]}),f.map(g=>{const m=d.indexOf(g);return l.jsx(Lm,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)}),p.length>0&&l.jsx("div",{className:"px-3 pt-2 pb-0.5",children:l.jsx("span",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"All boards"})})]}),p.map(g=>{const m=d.indexOf(g);return l.jsx(Lm,{board:g,isActive:m===i,isCurrent:g.id===t,onSelect:()=>{n(g.id),s()}},g.id)})]}),l.jsx("div",{className:"px-3 py-1.5 border-t border-zinc-200 dark:border-zinc-700",children:l.jsx("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:"↑↓ navigate · Enter select · Esc close"})})]})]})}function Lm({board:e,isActive:t,isCurrent:r,onSelect:n}){return l.jsxs("button",{type:"button",onClick:n,className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors ${t?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-zinc-900 dark:text-zinc-100 hover:bg-zinc-100 dark:hover:bg-zinc-700"}`,children:[l.jsx(St,{size:14,className:r?"text-blue-500 shrink-0":"invisible shrink-0"}),l.jsx("span",{className:"truncate",children:e.name})]})}const Fm=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Bm=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],zl="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function Lr({label:e,onRemove:t}){return l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700 rounded-full",children:[l.jsx("span",{className:"max-w-[180px] truncate",children:e}),l.jsx("button",{type:"button",onClick:t,className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-200 flex-shrink-0","aria-label":`Remove ${e} filter`,children:l.jsx(st,{size:12})})]})}function FZ({label:e,checked:t,onChange:r}){return l.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":t,onClick:n=>{n.stopPropagation(),r(!t)},className:"w-full text-left px-3 py-2 text-sm transition-colors hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 flex items-center gap-2",children:[l.jsx("span",{className:"w-4 h-4 rounded-sm border flex items-center justify-center shrink-0",style:{borderColor:t?"var(--vscode-focusBorder)":"var(--vscode-checkbox-border, var(--vscode-panel-border))",background:t?"var(--vscode-focusBorder)":"transparent"},children:t&&l.jsx(St,{size:10,style:{color:"var(--vscode-checkbox-foreground, white)"}})}),l.jsx("span",{className:"truncate",children:e})]})}function BZ({onOpenSettings:e,onAddColumn:t,onCreateCard:r,onToggleTheme:n,onSwitchBoard:s,onCreateBoard:o,onOpenBoardLogs:a,boardLogsOpen:i,onTriggerBoardAction:c,onOpenShortcutHelp:u}){var Ro,To,Io;const d=q(T=>T.searchQuery),f=q(T=>T.setSearchQuery),p=q(T=>T.fuzzySearch),h=q(T=>T.setFuzzySearch),g=q(T=>T.clearPlainTextSearch),m=q(T=>T.removeMetadataFilterToken),v=q(T=>T.priorityFilter),y=q(T=>T.setPriorityFilter),b=q(T=>T.assigneeFilter),C=q(T=>T.setAssigneeFilter),w=q(T=>T.labelFilter),_=q(T=>T.setLabelFilter),R=q(T=>T.dueDateFilter),z=q(T=>T.setDueDateFilter),D=q(T=>T.clearAllFilters),j=q(T=>T.layout),S=q(T=>T.toggleLayout),E=q(T=>T.isDarkMode),P=q(T=>T.cardSettings),K=q(T=>T.boards),O=q(T=>T.currentBoard),G=q(T=>T.columns),V=q(T=>T.labelDefs),L=q(T=>T.cards),U=q(T=>T.starredBoards),oe=q(T=>T.toggleStarBoard),Y=q(T=>T.savedViews),N=q(T=>T.saveCurrentView),Z=q(T=>T.removeView),I=q(T=>T.getHiddenColumnIds()),k=q(T=>T.setColumnHidden),$=x.useMemo(()=>{const T=new Set;return L.forEach(me=>{me.assignee&&T.add(me.assignee)}),Array.from(T).sort()},[L]),A=x.useMemo(()=>{const T=new Set;return L.forEach(me=>me.labels.forEach(er=>T.add(er))),Array.from(T).sort()},[L]),W=x.useMemo(()=>Fs(d),[d]),H=x.useMemo(()=>Object.entries(W.metaFilter),[W]),ee=x.useMemo(()=>{const T=q.getState().columnSorts;return d!==""||p||v!=="all"||b!=="all"||w.length>0||R!=="all"||Object.values(T).some(me=>me!=="order")},[d,p,v,b,w,R]),[re,le]=x.useState(!1),[pe,M]=x.useState(!1),[J,se]=x.useState(""),ue=x.useRef(null),_e=x.useRef(null),[we,Ne]=x.useState(!1),Ce=x.useRef(null),[Ie,Ge]=x.useState(!1),[it,Et]=x.useState(!1),wt=x.useRef(null),[ye,$e]=x.useState(!1),Ve=x.useRef(null),[pt,ls]=x.useState(!1),[pn,mn]=x.useState(!1),cs=x.useRef(null),[us,gn]=x.useState(!1),[ds,vn]=x.useState(""),fs=x.useRef(null),jo=x.useMemo(()=>{var T;return((T=K.find(me=>me.id===O))==null?void 0:T.actions)??{}},[K,O]),yn=x.useMemo(()=>Object.entries(jo),[jo]),hs=x.useMemo(()=>G.filter(T=>T.id!==qn),[G]),Eo=x.useMemo(()=>new Set(I),[I]),bn=x.useMemo(()=>{let T=0;return v!=="all"&&(T+=1),b!=="all"&&(T+=1),w.length>0&&(T+=1),R!=="all"&&(T+=1),T},[v,b,w,R]);x.useEffect(()=>{const T=me=>{ue.current&&!ue.current.contains(me.target)&&(le(!1),M(!1),se(""))};return(re||pe)&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[re,pe]),x.useEffect(()=>{const T=me=>{Ce.current&&!Ce.current.contains(me.target)&&Ne(!1)};return we&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[we]),x.useEffect(()=>{const T=me=>{wt.current&&!wt.current.contains(me.target)&&(Ge(!1),Et(!1))};return Ie&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[Ie]),x.useEffect(()=>{Ie||Et(!1)},[Ie]),x.useEffect(()=>{const T=me=>{Ve.current&&!Ve.current.contains(me.target)&&$e(!1)};return ye&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[ye]),x.useEffect(()=>{const T=me=>{cs.current&&!cs.current.contains(me.target)&&mn(!1)};return pn&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[pn]),x.useEffect(()=>{us&&fs.current&&fs.current.focus()},[us]),x.useEffect(()=>{pe&&_e.current&&_e.current.focus()},[pe]);const zi=((Ro=K.find(T=>T.id===O))==null?void 0:Ro.name)||O,Ao=U.includes(O),No=x.useCallback(()=>{const T=ds.trim();T&&(N(T),vn(""),gn(!1),mn(!1))},[ds,N]),Oi=x.useCallback(T=>{const me=q.getState();me.setSearchQuery(T.searchQuery),me.setFuzzySearch(T.fuzzySearch),me.setPriorityFilter(T.priorityFilter),me.setAssigneeFilter(T.assigneeFilter),me.setLabelFilter(T.labelFilter),me.setDueDateFilter(T.dueDateFilter)},[]),Po=()=>{const T=J.trim();T&&(o(T),se(""),M(!1))};return x.useEffect(()=>{const T=me=>{const er=me.target;er.tagName==="INPUT"||er.tagName==="TEXTAREA"||er.isContentEditable||(me.key==="b"||me.key==="B")&&(me.preventDefault(),le(Di=>!Di))};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[]),l.jsxs("div",{className:"flex flex-col border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50",children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 flex-wrap",children:[l.jsxs("div",{className:"relative flex items-center gap-0.5",ref:ue,children:[l.jsxs("button",{type:"button",onClick:()=>le(!re),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Switch board (b)",children:[l.jsx("span",{className:"max-w-[120px] truncate",children:zi}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${re?"rotate-180":""}`})]}),l.jsx("button",{type:"button",onClick:()=>oe(O),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:Ao?"Unstar board":"Star board",children:l.jsx(og,{size:14,className:Ao?"fill-amber-400 text-amber-400":"text-zinc-400"})}),pe?l.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[l.jsx("input",{ref:_e,type:"text",value:J,onChange:T=>se(T.target.value),onKeyDown:T=>{T.key==="Enter"&&Po(),T.key==="Escape"&&(M(!1),se(""))},placeholder:"Board name...",className:"w-28 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:Po,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Create"}),l.jsx("button",{type:"button",onClick:()=>{M(!1),se("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:14})})]}):l.jsx("button",{type:"button",onClick:()=>M(!0),className:"p-1.5 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Create new board",children:l.jsx(Zr,{size:14,className:"text-zinc-400"})}),re&&l.jsx(LZ,{boards:K,currentBoard:O,starredBoards:U,onSelect:T=>{s(T),le(!1)},onClose:()=>le(!1)})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[220px] max-w-md",children:[l.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[l.jsx(sg,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),l.jsx("input",{type:"text",value:d,onChange:T=>f(T.target.value),placeholder:"Search cards, people, labels...",title:"Search cards by text. Advanced metadata search also works with meta.field: value",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("label",{className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs text-zinc-600 dark:text-zinc-300 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md select-none whitespace-nowrap",children:[l.jsx("input",{type:"checkbox",checked:p,onChange:T=>h(T.target.checked),className:"h-3.5 w-3.5 rounded border-zinc-300 text-blue-600 focus:ring-blue-500"}),l.jsx("span",{children:"Fuzzy"})]})]}),l.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors shadow-sm",title:"Create a new card",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"New Card"})]}),l.jsxs("button",{type:"button",onClick:()=>ls(T=>!T),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${pt||bn>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Show or hide filters",children:[l.jsx(p1,{size:14}),l.jsx("span",{children:bn>0?`Filters (${bn})`:"Filters"})]}),pt&&P.showPriorityBadges&&l.jsx("select",{value:v,onChange:T=>y(T.target.value),className:zl,children:Fm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),pt&&P.showAssignee&&l.jsxs("select",{value:b,onChange:T=>C(T.target.value),className:zl,children:[l.jsx("option",{value:"all",children:"All Assignees"}),l.jsx("option",{value:"unassigned",children:"Unassigned"}),$.map(T=>l.jsx("option",{value:T,children:T},T))]}),pt&&P.showLabels&&l.jsxs("div",{className:"relative",ref:Ce,children:[l.jsxs("button",{type:"button",onClick:()=>Ne(!we),className:`flex items-center gap-1.5 text-sm bg-white dark:bg-zinc-800 border rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 transition-colors ${w.length>0?"border-blue-500 dark:border-blue-400":"border-zinc-200 dark:border-zinc-600"}`,children:[l.jsx(Xa,{size:14,className:"text-zinc-400 shrink-0"}),l.jsx("span",{className:"max-w-[100px] truncate",children:w.length===0?"All Labels":w.length===1?w[0]:`${w.length} Labels`}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${we?"rotate-180":""}`})]}),we&&l.jsx(DZ,{labels:A,labelDefs:V,selected:w,onChange:_,showAllOption:!0})]}),pt&&P.showDueDate&&l.jsx("select",{value:R,onChange:T=>z(T.target.value),className:zl,children:Bm.map(T=>l.jsx("option",{value:T.value,children:T.label},T.value))}),ee&&l.jsxs("button",{onClick:D,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[l.jsx(st,{size:14}),l.jsx("span",{children:"Clear"})]}),l.jsxs("div",{className:"relative",ref:cs,children:[l.jsxs("button",{type:"button",onClick:()=>mn(!pn),className:`flex items-center gap-1.5 px-2 py-1.5 text-sm border rounded-md transition-colors ${Y.length>0?"text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/30":"text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 border-zinc-200 dark:border-zinc-600 bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700"}`,title:"Saved views",children:[l.jsx(pf,{size:14}),l.jsxs("span",{children:["Views",Y.length>0?` (${Y.length})`:""]})]}),pn&&l.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[220px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[Y.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"px-3 py-1 text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Saved views"}),Y.map(T=>l.jsxs("div",{className:"flex items-center gap-1 px-2",children:[l.jsx("button",{type:"button",onClick:()=>{Oi(T),mn(!1)},className:"flex-1 text-sm text-left py-1.5 px-1 text-zinc-900 dark:text-zinc-100 hover:text-blue-600 dark:hover:text-blue-400 truncate transition-colors",children:T.name}),l.jsx("button",{type:"button",onClick:()=>Z(T.id),className:"p-1 text-zinc-400 hover:text-red-500 transition-colors shrink-0",title:"Remove view",children:l.jsx(st,{size:12})})]},T.id)),l.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"})]}),us?l.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-1",children:[l.jsx("input",{ref:fs,type:"text",value:ds,onChange:T=>vn(T.target.value),onKeyDown:T=>{T.key==="Enter"&&No(),T.key==="Escape"&&(gn(!1),vn(""))},placeholder:"View name...",className:"flex-1 px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"}),l.jsx("button",{type:"button",onClick:No,className:"px-2 py-1 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 rounded transition-colors",children:"Save"}),l.jsx("button",{type:"button",onClick:()=>{gn(!1),vn("")},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:l.jsx(st,{size:12})})]}):l.jsxs("button",{type:"button",onClick:()=>gn(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx(pf,{size:14}),l.jsx("span",{children:"Save current filters"})]})]})]}),l.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[l.jsx(Zr,{size:16}),l.jsx("span",{children:"Add List"})]}),u&&l.jsx("button",{type:"button",onClick:u,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Keyboard shortcuts (?)",children:l.jsx(m1,{size:16})}),l.jsx("button",{type:"button",onClick:S,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:j==="horizontal"?"Switch to row layout":"Switch to column layout",children:j==="horizontal"?l.jsx(g1,{size:16}):l.jsx(Fl,{size:16})}),l.jsxs("div",{className:"relative",ref:wt,children:[l.jsx("button",{type:"button",onClick:()=>Ge(!Ie),className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Board options",children:l.jsx(v1,{size:16})}),Ie&&l.jsxs("div",{className:"absolute top-full right-0 mt-1 min-w-[200px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[hs.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-1",onClick:T=>T.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:T=>{T.stopPropagation(),Et(me=>!me)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors rounded-sm","aria-expanded":it,children:[l.jsx(Fl,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{className:"flex-1",children:"Columns"}),l.jsx(Ze,{size:14,className:`shrink-0 text-zinc-400 transition-transform ${it?"rotate-180":""}`})]}),it&&l.jsx("div",{className:"mt-1 mb-1 rounded-md border border-zinc-200 dark:border-zinc-700 bg-zinc-50/80 dark:bg-zinc-900/50 py-1",onClick:T=>T.stopPropagation(),children:hs.map(T=>{const me=!Eo.has(T.id);return l.jsx(FZ,{label:T.name,checked:me,onChange:er=>k(O,T.id,!er)},T.id)})})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"})]}),l.jsxs("button",{type:"button",onClick:()=>{n(),Ge(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[E?l.jsx(y1,{size:14,className:"shrink-0 text-zinc-400"}):l.jsx(b1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:E?"Light Theme":"Dark Theme"})]}),l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{e(),Ge(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx(x1,{size:14,className:"shrink-0 text-zinc-400"}),l.jsx("span",{children:"Settings"})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-700 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{a(),Ge(!1)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${i?"text-blue-600 dark:text-blue-400":"text-zinc-900 dark:text-zinc-100"}`,children:[l.jsx(tg,{size:14,className:`shrink-0 ${i?"text-blue-500":"text-zinc-400"}`}),l.jsx("span",{children:"Board Logs"})]})]})]})]}),yn.length>0&&c&&l.jsxs("div",{className:"relative ml-auto",ref:Ve,children:[l.jsxs("button",{type:"button",onClick:()=>$e(!ye),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",title:"Board actions",children:[l.jsx(ma,{size:14,className:"text-amber-500"}),l.jsx("span",{children:"Actions"}),l.jsx(Ze,{size:14,className:`text-zinc-400 transition-transform ${ye?"rotate-180":""}`})]}),ye&&l.jsx("div",{className:"absolute top-full right-0 mt-1 min-w-[180px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:yn.map(([T,me])=>l.jsxs("button",{type:"button",onClick:()=>{$e(!1),c(O,T)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsx(ma,{size:12,className:"text-amber-500 shrink-0"}),l.jsx("span",{className:"truncate",children:me})]},T))})]})]}),ee&&l.jsxs("div",{className:"flex flex-wrap gap-1.5 px-4 pb-2",children:[W.plainText&&l.jsx(Lr,{label:`Search: "${W.plainText}"`,onRemove:g}),H.map(([T,me])=>l.jsx(Lr,{label:`meta.${T}: ${me}`,onRemove:()=>m(T)},T)),p&&l.jsx(Lr,{label:"Fuzzy",onRemove:()=>h(!1)}),v!=="all"&&l.jsx(Lr,{label:`Priority: ${((To=Fm.find(T=>T.value===v))==null?void 0:To.label)??v}`,onRemove:()=>y("all")}),b!=="all"&&l.jsx(Lr,{label:`Assignee: ${b==="unassigned"?"Unassigned":b}`,onRemove:()=>C("all")}),w.map(T=>l.jsx(Lr,{label:`Label: ${T}`,onRemove:()=>_(w.filter(me=>me!==T))},T)),R!=="all"&&l.jsx(Lr,{label:`Due: ${((Io=Bm.find(T=>T.value===R))==null?void 0:Io.label)??R}`,onRemove:()=>z("all")})]})]})}function Um({title:e,message:t,onUndo:r,onExpire:n,duration:s,index:o,actionLabel:a="Undo",persistent:i=!1,tone:c="default"}){const[u,d]=x.useState(100),f=!i&&typeof s=="number"&&typeof n=="function",p=c==="error"?"var(--vscode-errorForeground, #f14c4c)":c==="info"?"var(--vscode-progressBar-background)":void 0;return x.useEffect(()=>{if(!f||!s){d(100);return}const h=50,g=h/s*100,m=setInterval(()=>{d(v=>{const y=v-g;return y<=0?(clearInterval(m),0):y})},h);return()=>clearInterval(m)},[s,f]),x.useEffect(()=>{f&&u<=0&&n&&n()},[u,n,f]),l.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))",borderLeft:p?`3px solid ${p}`:void 0},children:[l.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[e&&l.jsx("div",{className:"mb-0.5 text-[12px] font-semibold",children:e}),l.jsx("span",{className:`text-[13px] leading-snug ${e?"block":"truncate"}`,children:t})]}),r&&l.jsx("button",{onClick:r,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:h=>h.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:h=>h.currentTarget.style.background="var(--vscode-button-background)",children:a})]}),f&&l.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:l.jsx("div",{className:"h-full transition-none",style:{width:`${u}%`,background:"var(--vscode-progressBar-background)"}})})]})}const UZ=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],WZ=[{value:"fancy",label:"Fancy"},{value:"plain",label:"Plain"}],VZ=[{value:"aurora",label:"Aurora Glow"},{value:"sunset",label:"Sunset Blend"},{value:"meadow",label:"Meadow Mist"},{value:"nebula",label:"Nebula Bloom"},{value:"lagoon",label:"Lagoon Light"},{value:"candy",label:"Candy Pop"},{value:"ember",label:"Ember Sky"},{value:"violet",label:"Violet Pulse"}],KZ=[{value:"paper",label:"Paper White"},{value:"mist",label:"Mist Blue"},{value:"sand",label:"Soft Sand"}];function HZ({isOpen:e,settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}){return e?l.jsx(YZ,{settings:t,workspace:r,onClose:n,onSave:s,onSetLabel:o,onRenameLabel:a,onDeleteLabel:i}):null}function GZ({checked:e,onChange:t}){return l.jsx("button",{type:"button",onClick:()=>t(!e),className:Ee("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:e?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:l.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:e?"translateX(18px)":"translateX(3px)"}})})}function As({title:e,children:t}){return l.jsxs("div",{className:"py-3",children:[l.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{children:t})]})}function Fr({label:e,description:t,checked:r,onChange:n}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>n(!r),onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsx(GZ,{checked:r,onChange:n})]})}function Qo({label:e,value:t}){return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-1.5",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-descriptionForeground)"},children:e}),l.jsx("div",{className:"text-xs font-mono truncate max-w-[60%] text-right",style:{color:"var(--vscode-foreground)",opacity:.7},title:t,children:t})]})}function Ns({label:e,value:t,options:r,onChange:n}){const[s,o]=x.useState(!1),a=r.find(i=>i.value===t);return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:i=>i.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:i=>i.currentTarget.style.background="transparent",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",a.dot)}),!(a!=null&&a.dot)&&(a==null?void 0:a.dotColor)&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.dotColor}}),l.jsx("span",{children:a==null?void 0:a.label}),l.jsx(Ze,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),l.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:r.map(i=>l.jsxs("button",{type:"button",onClick:()=>{n(i.value),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:i.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:c=>{i.value!==t&&(c.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:c=>{i.value!==t&&(c.currentTarget.style.background="transparent")},children:[i.dot&&l.jsx("span",{className:Ee("w-2 h-2 rounded-full shrink-0",i.dot)}),!i.dot&&i.dotColor&&l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.dotColor}}),l.jsx("span",{className:"flex-1 text-left",children:i.label})]},i.value))})]})]})]})}function Ol({label:e,description:t,value:r,min:n,max:s,step:o,unit:a,onChange:i}){const c=(r-n)/(s-n)*100;return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:u=>u.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:u=>u.currentTarget.style.background="transparent",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&l.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("input",{type:"range",min:n,max:s,step:o,value:r,onChange:u=>i(Number(u.target.value)),className:"settings-slider",style:{background:`linear-gradient(to right, var(--vscode-button-background) ${c}%, var(--vscode-badge-background, #6b7280) ${c}%)`}}),l.jsxs("span",{className:"text-xs font-mono w-12 text-right tabular-nums",style:{color:"var(--vscode-foreground)"},children:[r,a||"%"]})]})]})}function Wm({value:e,onChange:t}){const[r,n]=x.useState(!1),[s,o]=x.useState("");return l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>n(!r),className:"w-5 h-5 rounded-full border border-white/20 cursor-pointer shrink-0",style:{backgroundColor:e}}),r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-2 min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[l.jsx("div",{className:"grid grid-cols-6 gap-1.5 mb-2",children:ec.map(a=>l.jsx("button",{type:"button",onClick:()=>{t(a.hex),n(!1)},className:"w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:a.hex,borderColor:e===a.hex?"white":"transparent"},title:a.name},a.name))}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("input",{type:"text",placeholder:"#hex",value:s,onChange:a=>o(a.target.value),className:"flex-1 px-2 py-1 text-xs rounded",style:{background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"}}),l.jsx("button",{type:"button",onClick:()=>{/^#[0-9a-fA-F]{6}$/.test(s)&&(t(s),n(!1),o(""))},className:"px-2 py-1 text-xs rounded",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"OK"})]})]})]})]})}function qZ({onSetLabel:e,onRenameLabel:t,onDeleteLabel:r}){const n=q(j=>j.labelDefs),s=q(j=>j.cards),[o,a]=x.useState(""),[i,c]=x.useState(ec[0].hex),[u,d]=x.useState(""),[f,p]=x.useState(null),[h,g]=x.useState(""),[m,v]=x.useState(null),y=x.useMemo(()=>{const j=new Map;for(const[S,E]of Object.entries(n))j.set(S,E);for(const S of s)for(const E of S.labels)j.has(E)||j.set(E,void 0);return j},[n,s]),b=x.useMemo(()=>{const j={};return y.forEach((E,P)=>{const K=(E==null?void 0:E.group)||"Other";j[K]||(j[K]=[]),j[K].push({name:P,def:E})}),Object.entries(j).sort(([E],[P])=>E==="Other"?1:P==="Other"?-1:E.localeCompare(P))},[y]),C=x.useMemo(()=>{const j=new Set;return Object.values(n).forEach(S=>{S.group&&j.add(S.group)}),Array.from(j).sort()},[n]),w=j=>s.filter(S=>S.labels.includes(j)).length,_=()=>{const j=o.trim();j&&(e==null||e(j,{color:i,group:u||void 0}),a(""),c(ec[0].hex),d(""))},R=j=>{const S=h.trim();S&&S!==j&&(t==null||t(j,S)),p(null),g("")},z=j=>{r==null||r(j),v(null)},D={background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"};return l.jsxs("div",{className:"px-4 space-y-3",children:[b.map(([j,S])=>l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--vscode-descriptionForeground)"},children:j}),l.jsx("div",{className:"space-y-1",children:S.map(({name:E,def:P})=>l.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded group/label transition-colors",onMouseEnter:K=>K.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:K=>K.currentTarget.style.background="transparent",children:[l.jsx(Wm,{value:(P==null?void 0:P.color)||"#6b7280",onChange:K=>e==null?void 0:e(E,{...P,color:K,group:P==null?void 0:P.group})}),f===E?l.jsx("input",{type:"text",value:h,onChange:K=>g(K.target.value),onKeyDown:K=>{K.key==="Enter"&&R(E),K.key==="Escape"&&(p(null),g(""))},onBlur:()=>R(E),autoFocus:!0,className:"flex-1 px-1.5 py-0.5 text-xs rounded min-w-0",style:D}):l.jsx("span",{className:"flex-1 text-xs truncate",style:{color:"var(--vscode-foreground)"},children:E}),(P==null?void 0:P.group)&&f!==E&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:P.group}),m===E?l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsxs("span",{className:"text-[10px]",style:{color:"var(--vscode-errorForeground, #f44)"},children:[w(E)," card",w(E)!==1?"s":""]}),l.jsx("button",{type:"button",onClick:()=>z(E),className:"px-1.5 py-0.5 text-[10px] rounded",style:{background:"var(--vscode-inputValidation-errorBackground, #5a1d1d)",color:"var(--vscode-errorForeground, #f44)"},children:"Delete"}),l.jsx("button",{type:"button",onClick:()=>v(null),className:"px-1.5 py-0.5 text-[10px] rounded",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"})]}):l.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover/label:opacity-100 transition-opacity",children:[l.jsx("button",{type:"button",onClick:()=>{p(E),g(E)},className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:K=>K.currentTarget.style.color="var(--vscode-foreground)",onMouseLeave:K=>K.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Rename label",children:l.jsx(Lc,{size:12})}),l.jsx("button",{type:"button",onClick:()=>v(E),className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:K=>K.currentTarget.style.color="var(--vscode-errorForeground, #f44)",onMouseLeave:K=>K.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Delete label",children:l.jsx(Kt,{size:12})})]})]},E))})]},j)),l.jsxs("div",{className:"rounded-lg p-2 space-y-2",style:{background:"var(--vscode-input-background)",border:"1px solid var(--vscode-input-border, transparent)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Wm,{value:i,onChange:c}),l.jsx("input",{type:"text",placeholder:"New label name...",value:o,onChange:j=>a(j.target.value),onKeyDown:j=>{j.key==="Enter"&&_()},className:"flex-1 px-1.5 py-1 text-xs rounded bg-transparent min-w-0",style:{color:"var(--vscode-input-foreground)",outline:"none"}})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",placeholder:"Group (optional)",value:u,onChange:j=>d(j.target.value),onKeyDown:j=>{j.key==="Enter"&&_()},list:"label-groups",className:"flex-1 px-1.5 py-1 text-xs rounded",style:D}),l.jsx("datalist",{id:"label-groups",children:C.map(j=>l.jsx("option",{value:j},j))}),l.jsxs("button",{type:"button",onClick:_,disabled:!o.trim(),className:"flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-40",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:[l.jsx(Zr,{size:12}),"Add"]})]})]})]})}function YZ({settings:e,workspace:t,onClose:r,onSave:n,onSetLabel:s,onRenameLabel:o,onDeleteLabel:a}){const[i,c]=x.useState(e),[u,d]=x.useState("general"),[f,p]=x.useState(!1),h=q(_=>_.columns),g=q(_=>_.effectiveDrawerWidth),m=q(_=>_.setDrawerWidthPreview),v=q(_=>_.clearDrawerWidthPreview),y=x.useMemo(()=>h.filter(_=>_.id!==qn).map(_=>({value:_.id,label:_.name,dotColor:_.color})),[h]),b=x.useMemo(()=>i.boardBackgroundMode==="plain"?KZ:VZ,[i.boardBackgroundMode]);x.useEffect(()=>{c(e)},[e]);const C=_=>{const R={...i,..._};c(R),n(R)};x.useEffect(()=>{const _=R=>{R.key==="Escape"&&(R.stopPropagation(),r())};return document.addEventListener("keydown",_,!0),()=>document.removeEventListener("keydown",_,!0)},[r]);const w=(i.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-50 flex ${w?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!w&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),l.jsxs("div",{className:w?"relative h-full shadow-xl flex flex-col animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] shadow-xl flex flex-col rounded-xl animate-in zoom-in-95 fade-in duration-200",style:w?{width:`${g}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...w?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:w?"drawer":"popup",onPreview:m,onCommit:_=>{v();const R={...i,drawerWidth:_};c(R),n(R)},onCancel:v}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),l.jsx("button",{onClick:r,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:_=>_.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:_=>_.currentTarget.style.background="transparent",children:l.jsx(st,{size:18})})]}),l.jsx("div",{className:"flex",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:["general","defaults","labels"].map(_=>l.jsxs("button",{type:"button",onClick:()=>d(_),className:"px-4 py-2.5 text-xs font-medium transition-colors relative",style:{color:u===_?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)",background:"transparent"},children:[_.charAt(0).toUpperCase()+_.slice(1),u===_&&l.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:"var(--vscode-button-background)"}})]},_))}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[u==="general"&&l.jsxs(l.Fragment,{children:[l.jsxs(As,{title:"Card Display",children:[l.jsx(Fr,{label:"Show Priority Badges",description:"Display priority indicators on card cards",checked:i.showPriorityBadges,onChange:_=>C({showPriorityBadges:_})}),l.jsx(Fr,{label:"Show Assignee",description:"Display assigned person on card cards",checked:i.showAssignee,onChange:_=>C({showAssignee:_})}),l.jsx(Fr,{label:"Show Due Date",description:"Display due dates on card cards",checked:i.showDueDate,onChange:_=>C({showDueDate:_})}),l.jsx(Fr,{label:"Show Labels",description:"Display labels on card cards and in editors",checked:i.showLabels,onChange:_=>C({showLabels:_})}),l.jsx(Fr,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:i.showFileName,onChange:_=>C({showFileName:_})}),l.jsx(Fr,{label:"Compact Mode",description:"Use compact card layout to show more cards",checked:i.compactMode,onChange:_=>C({compactMode:_})}),l.jsx(Fr,{label:"Show Deleted Column",description:"Display the Deleted column to manage soft-deleted cards",checked:i.showDeletedColumn,onChange:_=>C({showDeletedColumn:_})})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Layout",children:[l.jsx(Ns,{label:"Panel Style",value:i.panelMode??"drawer",options:[{value:"drawer",label:"Right-side Drawer"},{value:"popup",label:"Centered Popup"}],onChange:_=>C({panelMode:_})}),(i.panelMode??"drawer")==="drawer"&&l.jsx(Ol,{label:"Drawer Width",description:"Width of the right-side drawer as a percentage of the viewport",value:i.drawerWidth??50,min:20,max:80,step:5,onChange:_=>C({drawerWidth:_})}),l.jsx(Ns,{label:"Background Style",value:i.boardBackgroundMode,options:WZ,onChange:_=>{const R=ja(_);C(R)}}),l.jsx(Ns,{label:"Background Preset",value:i.boardBackgroundPreset,options:b,onChange:_=>{const R=ja(i.boardBackgroundMode,_);C(R)}})]}),l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs(As,{title:"Zoom",children:[l.jsx(Ol,{label:"Board Zoom",description:"Scale text size on the board view",value:i.boardZoom,min:75,max:150,step:5,onChange:_=>C({boardZoom:_})}),l.jsx(Ol,{label:"Card Detail Zoom",description:"Scale text size in the card detail panel",value:i.cardZoom,min:75,max:150,step:5,onChange:_=>C({cardZoom:_})})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer",onClick:()=>p(_=>!_),onMouseEnter:_=>_.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:_=>_.currentTarget.style.background="transparent",children:[l.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Advanced"}),l.jsx(Ze,{size:14,className:`transition-transform ${f?"rotate-180":""}`,style:{color:"var(--vscode-descriptionForeground)"}})]}),f&&l.jsxs(l.Fragment,{children:[l.jsx(Qo,{label:"Project Path",value:t.projectPath}),l.jsx(Qo,{label:"Kanban Directory",value:t.kanbanDirectory}),l.jsx(Qo,{label:"Server Port",value:String(t.port)}),l.jsx(Qo,{label:"Config Version",value:String(t.configVersion)})]})]})]}),u==="defaults"&&l.jsxs(As,{title:"Defaults",children:[l.jsx(Ns,{label:"Default Priority",value:i.defaultPriority,options:UZ,onChange:_=>C({defaultPriority:_})}),l.jsx(Ns,{label:"Default Status",value:i.defaultStatus,options:y,onChange:_=>C({defaultStatus:_})})]}),u==="labels"&&l.jsx(As,{title:"Labels",children:l.jsx(qZ,{onSetLabel:s,onRenameLabel:o,onDeleteLabel:a})})]}),l.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:l.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const JZ=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function ZZ({isOpen:e,onClose:t,onSave:r,initial:n,title:s}){const[o,a]=x.useState((n==null?void 0:n.name)??""),[i,c]=x.useState((n==null?void 0:n.color)??"#3b82f6"),u=x.useRef(null);return x.useEffect(()=>{e&&(a((n==null?void 0:n.name)??""),c((n==null?void 0:n.color)??"#3b82f6"),setTimeout(()=>{var d;return(d=u.current)==null?void 0:d.focus()},50))},[e,n]),x.useEffect(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&t(),f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&o.trim()&&r({name:o.trim(),color:i})};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,t,r,o,i]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),l.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:s}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:l.jsx(st,{size:16,className:"text-zinc-500"})})]}),l.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),l.jsx("input",{ref:u,type:"text",value:o,onChange:d=>a(d.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[JZ.map(d=>l.jsx("button",{type:"button",onClick:()=>c(d),className:`w-6 h-6 rounded-full border-2 transition-all ${i===d?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:d},title:d},d)),l.jsx("input",{type:"color",value:i,onChange:d=>c(d.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[l.jsx("button",{type:"button",onClick:t,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:()=>{o.trim()&&r({name:o.trim(),color:i})},disabled:!o.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const QZ=["critical","high","medium","low"],XZ={critical:"Critical",high:"High",medium:"Medium",low:"Low"},eQ={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"};function tQ({selectedCount:e,onClearSelection:t,onMoveToColumn:r,onSetPriority:n,onSetAssignee:s,onApplyLabels:o,onDelete:a}){const i=q(b=>b.columns),c=q(b=>b.cards),u=q(b=>b.labelDefs),d=q(b=>b.selectedCardIds),f=x.useMemo(()=>{const b=new Set;return c.forEach(C=>{C.assignee&&b.add(C.assignee)}),Array.from(b).sort()},[c]),p=x.useMemo(()=>{const b=new Set;return c.forEach(C=>C.labels.forEach(w=>b.add(w))),Array.from(b).sort()},[c]),h=x.useMemo(()=>c.filter(b=>d.includes(b.id)),[c,d]),[g,m]=x.useState(null),v=x.useRef(null);x.useEffect(()=>{const b=C=>{v.current&&!v.current.contains(C.target)&&m(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]);const y=b=>{m(g===b?null:b)};return l.jsxs("div",{ref:v,className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-white dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-600 rounded-lg shadow-xl px-3 py-2",children:[l.jsxs("span",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-200 whitespace-nowrap",children:[e," selected"]}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",title:"Clear selection",children:l.jsx(st,{size:14,className:"text-zinc-500"})}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("moveTo"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(w1,{size:14}),"Move to",l.jsx(Ze,{size:12})]}),g==="moveTo"&&l.jsx(Dl,{children:i.map(b=>l.jsxs("button",{type:"button",onClick:()=>{r(b.id),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:b.color}}),b.name]},b.id))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("priority"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(Fc,{size:14}),"Priority",l.jsx(Ze,{size:12})]}),g==="priority"&&l.jsx(Dl,{children:QZ.map(b=>l.jsxs("button",{type:"button",onClick:()=>{n(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${eQ[b]}`}),XZ[b]]},b))})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("assignee"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(ga,{size:14}),"Assign",l.jsx(Ze,{size:12})]}),g==="assignee"&&l.jsxs(Dl,{children:[l.jsx("button",{type:"button",onClick:()=>{s(null),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors italic",children:"Unassign"}),f.map(b=>l.jsxs("button",{type:"button",onClick:()=>{s(b),m(null)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[l.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:b.split(/\s+/).map(C=>C[0]).join("").toUpperCase().slice(0,2)}),b]},b))]})]}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>y("labels"),className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors text-zinc-700 dark:text-zinc-200",children:[l.jsx(Xa,{size:14}),"Labels",l.jsx(Ze,{size:12})]}),g==="labels"&&l.jsx(rQ,{allLabels:p,labelDefs:u,selectedCards:h,onApply:(b,C)=>{o(b,C),m(null)}})]}),l.jsx("div",{className:"w-px h-5 bg-zinc-300 dark:bg-zinc-600"}),l.jsxs("button",{type:"button",onClick:()=>{a()},className:"flex items-center gap-1 px-2 py-1 text-sm rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors text-red-600 dark:text-red-400",children:[l.jsx(Kt,{size:14}),"Delete"]})]})}function Dl({children:e}){return l.jsx("div",{className:"absolute bottom-full mb-1 left-0 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[160px] max-h-64 overflow-y-auto",children:e})}function rQ({allLabels:e,labelDefs:t,selectedCards:r,onApply:n}){const[s,o]=x.useState(new Map),[a,i]=x.useState(""),c=x.useMemo(()=>{const v=new Map;if(r.length===0)return v;for(const y of e){const b=r.filter(C=>C.labels.includes(y)).length;v.set(y,b===0?"none":b===r.length?"all":"some")}return v},[e,r]),u=v=>{const y=s.get(v);if(y==="add")return"checked";if(y==="remove")return"unchecked";const b=c.get(v)??"none";return b==="all"?"checked":b==="some"?"indeterminate":"unchecked"},d=v=>{const y=c.get(v)??"none",b=u(v),C=new Map(s);b==="unchecked"||b==="indeterminate"?C.set(v,"add"):y==="all"?s.get(v)==="remove"?C.delete(v):C.set(v,"remove"):C.delete(v),o(C)},f=x.useMemo(()=>{if(!a)return e;const v=a.toLowerCase();return e.filter(y=>y.toLowerCase().includes(v))},[e,a]),p=Array.from(s.entries()).filter(([,v])=>v==="add").map(([v])=>v),h=Array.from(s.entries()).filter(([,v])=>v==="remove").map(([v])=>v),g=p.length>0||h.length>0,m=p.length>0&&h.length>0?`Apply changes (+${p.length} −${h.length})`:p.length>0?`Add ${p.length} label${p.length!==1?"s":""}`:`Remove ${h.length} label${h.length!==1?"s":""}`;return l.jsxs("div",{className:"absolute bottom-full mb-1 left-0 z-50 min-w-[200px]",children:[l.jsxs("div",{className:"max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1",children:[l.jsx("div",{className:"px-2 pb-1",children:l.jsx("input",{type:"text",value:a,onChange:v=>i(v.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),f.map(v=>{const y=t[v],b=u(v);return l.jsxs("button",{type:"button",onClick:()=>d(v),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[l.jsxs("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${b==="checked"?"border-blue-500 bg-blue-500":b==="indeterminate"?"border-zinc-400 bg-zinc-200 dark:border-zinc-400 dark:bg-zinc-600":"border-zinc-300 dark:border-zinc-500"}`,children:[b==="checked"&&l.jsx(St,{size:10,className:"text-white"}),b==="indeterminate"&&l.jsx(k1,{size:10,className:"text-zinc-600 dark:text-zinc-300"})]}),(y==null?void 0:y.color)&&l.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:y.color}}),l.jsx("span",{className:"truncate",children:v})]},v)}),f.length===0&&l.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]}),g&&l.jsx("div",{className:"bg-white dark:bg-zinc-800 border border-t-0 border-zinc-200 dark:border-zinc-600 rounded-b-md shadow-lg px-1 py-1",children:l.jsx("button",{type:"button",onClick:()=>n(p,h),className:"flex items-center justify-center gap-1 w-full px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 rounded transition-colors",children:m})})]})}const nQ=[{keys:["n"],description:"Create a new card"},{keys:["?"],description:"Show / hide this shortcut reference"},{keys:["Ctrl","Z"],description:"Undo last card deletion"},{keys:["Ctrl","+"],description:"Increase board zoom"},{keys:["Ctrl","-"],description:"Decrease board zoom"},{keys:["Ctrl","Shift","+"],description:"Increase card detail zoom"},{keys:["Ctrl","Shift","-"],description:"Decrease card detail zoom"},{keys:["Esc"],description:"Close dialog / clear selection"},{keys:["Ctrl","Enter"],description:"Save and close card (in create dialog)"},{keys:["Ctrl","S"],description:"Save card (in create dialog)"},{keys:["Enter"],description:"Add card (in inline quick-add)"}];function sQ({isOpen:e,onClose:t}){return x.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.stopPropagation(),t())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[e,t]),e?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:t}),l.jsxs("div",{className:"relative w-full max-w-md rounded-xl shadow-2xl flex flex-col overflow-hidden",style:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"font-semibold text-sm",style:{color:"var(--vscode-foreground)"},children:"Keyboard Shortcuts"}),l.jsx("button",{type:"button",onClick:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:r=>r.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:r=>r.currentTarget.style.background="transparent",title:"Close",children:l.jsx(st,{size:16})})]}),l.jsx("div",{className:"overflow-y-auto max-h-[60vh]",children:nQ.map((r,n)=>l.jsxs("div",{className:"flex items-center justify-between px-5 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)",opacity:.95},onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[l.jsx("span",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:r.description}),l.jsx("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:r.keys.map((s,o)=>l.jsxs("span",{className:"flex items-center gap-1",children:[o>0&&l.jsx("span",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"+"}),l.jsx("kbd",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:s})]},o))})]},n))}),l.jsxs("div",{className:"px-5 py-2 text-xs",style:{borderTop:"1px solid var(--vscode-panel-border)",color:"var(--vscode-descriptionForeground)"},children:["Press ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"?"})," or ",l.jsx("kbd",{className:"inline-flex items-center px-1 py-0.5 rounded text-xs font-mono",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)",border:"1px solid var(--vscode-panel-border)"},children:"Esc"})," to close"]})]})]}):null}function oQ(e){if(!e||e<=0)return"";if(e<1e3)return` Next retry in ${e}ms.`;const t=e/1e3;return` Next retry in ${Number.isInteger(t)?String(t):t.toFixed(1)}s.`}function Vm(e){return e?e==="socket-closed"?" The previous socket closed unexpectedly.":` Last signal: ${e}.`:""}function aQ(e){if(e.type==="init"||e.connected||!e.reconnecting&&!e.fatal)return null;if(e.fatal)return{title:"Connection lost",message:`The standalone backend is unavailable and automatic reconnect has stopped.${Vm(e.reason)} Form submissions are unavailable until the backend is reachable again. Refresh or reopen this page after the backend is available again.`,tone:"error"};const t=e.retryCount??1,r=e.maxRetries??t;return{title:"Reconnecting…",message:`Trying to reconnect to the standalone backend (attempt ${t} of ${r}).${oQ(e.retryDelayMs)}${Vm(e.reason)} Form submissions pause until the backend reconnects.`,tone:"info"}}const ce=lf();function iQ(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).flatMap(([t,r])=>{if(!r||typeof r!="object"||Array.isArray(r))return[];const n=Array.isArray(r.hiddenColumnIds)?r.hiddenColumnIds.filter(o=>typeof o=="string"):[],s=Array.isArray(r.minimizedColumnIds)?r.minimizedColumnIds.filter(o=>typeof o=="string"):[];return[[t,{hiddenColumnIds:n,minimizedColumnIds:s}]]}))}function lQ(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function cQ(e){return{version:e.version,id:e.id,...e.boardId!==void 0?{boardId:e.boardId}:{},status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate,created:e.created,modified:e.modified,completedAt:e.completedAt,labels:e.labels,attachments:e.attachments,order:e.order,metadata:e.metadata,actions:e.actions,forms:e.forms,formData:e.formData}}function uQ(){const{columns:e,currentBoard:t,columnVisibilityByBoard:r,workspace:n,cardSettings:s,effectiveDrawerWidth:o,settingsOpen:a,selectedCardIds:i,setCards:c,setColumns:u,setBoards:d,setIsDarkMode:f,setWorkspace:p,setCardSettings:h,setDrawerWidthPreview:g,clearDrawerWidthPreview:m,setSettingsOpen:v,setLabelDefs:y,toggleSelectCard:b,selectCardRange:C,selectAllInColumn:w,clearSelection:_,setActiveCardId:R}=q(),[z,D]=x.useState(!1),[j,S]=x.useState("backlog"),[E,P]=x.useState(!1),[K,O]=x.useState(!1),[G,V]=x.useState(null),L=x.useRef(0),[U,oe]=x.useState(null),[Y,N]=x.useState(!1),[Z,I]=x.useState([]),[k,$]=x.useState(!1),A=x.useRef(iQ(ce.getState())),W=x.useRef(null);x.useEffect(()=>{R((U==null?void 0:U.id)??null)},[U==null?void 0:U.id,R]);const[H,ee]=x.useState([]),[re,le]=x.useState(null),pe=x.useRef(H);x.useEffect(()=>{pe.current=H},[H]);const M=x.useRef(0),J=x.useCallback(F=>{oe(Q=>{if(!Q)return Q;const X=F.find(mt=>mt.id===Q.id);if(!X)return Q;const te=cQ(X),je=X.comments||[],ae=Q.content!==X.content,qe=JSON.stringify(Q.frontmatter)!==JSON.stringify(te),Xe=JSON.stringify(Q.comments)!==JSON.stringify(je);return!ae&&!qe&&!Xe?Q:(ae&&(L.current+=1),{...Q,content:X.content,frontmatter:te,comments:je,contentVersion:ae?L.current:Q.contentVersion})})},[]),se=x.useCallback(F=>{const{cards:Q}=q.getState(),X=Q.find(ae=>ae.id===F);if(!X)return;const te=X.status;c(Q.map(ae=>ae.id===F?{...ae,status:qn}:ae)),(U==null?void 0:U.id)===F&&(oe(null),R(null));const je=String(M.current++);ee(ae=>[...ae,{id:je,card:X,originalStatus:te}])},[U,c]),ue=x.useCallback(F=>{const Q=pe.current.find(X=>X.id===F);Q&&(ce.postMessage({type:"deleteCard",cardId:Q.card.id}),ee(X=>X.filter(te=>te.id!==F)))},[]),_e=x.useCallback(F=>{const Q=pe.current.find(te=>te.id===F);if(!Q)return;const{cards:X}=q.getState();c(X.map(te=>te.id===Q.card.id?{...te,status:Q.originalStatus}:te)),ee(te=>te.filter(je=>je.id!==F))},[c]),we=x.useCallback(()=>{const F=pe.current;F.length!==0&&_e(F[F.length-1].id)},[_e]);x.useEffect(()=>{let F=!1,Q=null;const X=ae=>{if(ae.key==="Alt"){F=!0,Q&&clearTimeout(Q),Q=setTimeout(()=>{F=!1},1e3);return}if(ae.altKey&&(F=!1,Q&&(clearTimeout(Q),Q=null)),ae.key==="z"&&(ae.ctrlKey||ae.metaKey)&&!ae.shiftKey&&pe.current.length>0){ae.preventDefault(),we();return}if((ae.key==="="||ae.key==="+"||ae.key==="-")&&(ae.ctrlKey||ae.metaKey)){ae.preventDefault();const qe=ae.key==="-"?-5:5,{cardSettings:Xe}=q.getState();if(ae.shiftKey){const mt=Math.max(75,Math.min(150,Xe.cardZoom+qe));if(mt!==Xe.cardZoom){const tr={...Xe,cardZoom:mt};h(tr),ce.postMessage({type:"saveSettings",settings:tr})}}else{const mt=Math.max(75,Math.min(150,Xe.boardZoom+qe));if(mt!==Xe.boardZoom){const tr={...Xe,boardZoom:mt};h(tr),ce.postMessage({type:"saveSettings",settings:tr})}}return}if(!(ae.target instanceof HTMLInputElement||ae.target instanceof HTMLTextAreaElement||ae.target instanceof HTMLSelectElement||ae.target instanceof HTMLElement&&ae.target.isContentEditable))switch(ae.key){case"n":if(ae.ctrlKey||ae.metaKey||ae.altKey||ae.shiftKey)return;ae.preventDefault(),S("backlog"),D(!0);break;case"?":if(ae.ctrlKey||ae.metaKey||ae.altKey)return;ae.preventDefault(),P(qe=>!qe);break;case"Escape":E?P(!1):z?D(!1):q.getState().selectedCardIds.length>0&&_();break}},te=ae=>{ae.key==="Alt"&&F&&(F=!1,Q&&(clearTimeout(Q),Q=null),ce.postMessage({type:"focusMenuBar"}))},je=()=>{F=!1};return window.addEventListener("keydown",X),window.addEventListener("keyup",te),window.addEventListener("mousedown",je),()=>{window.removeEventListener("keydown",X),window.removeEventListener("keyup",te),window.removeEventListener("mousedown",je),Q&&clearTimeout(Q)}},[z,E,we,h,_]),x.useEffect(()=>{const F=()=>{const X=document.documentElement,te=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");f(te),X.dataset.kbTheme=te?"dark":"light",te?X.classList.add("dark"):X.classList.remove("dark")};F();const Q=new MutationObserver(F);return Q.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>Q.disconnect()},[f]),x.useEffect(()=>{const F=document.documentElement;F.style.setProperty("--board-zoom",String(s.boardZoom/100)),F.style.setProperty("--card-zoom",String(s.cardZoom/100))},[s.boardZoom,s.cardZoom]),x.useEffect(()=>{const F=document.documentElement,Q=ja(s.boardBackgroundMode,s.boardBackgroundPreset);F.dataset.kbBoardMode=Q.boardBackgroundMode,F.dataset.kbBoardPreset=Q.boardBackgroundPreset},[s.boardBackgroundMode,s.boardBackgroundPreset]),x.useEffect(()=>{const F=Q=>{const X=Q.data;if(!(!X||typeof X.type!="string"))switch(X.type){case"init":{const te=X.cards??[];{const je=X.columns??[],ae=X.currentBoard??q.getState().currentBoard,qe=je.map(ps=>ps.id),Xe=q.getState().columnVisibilityByBoard,mt={...A.current,...Xe};if(X.minimizedColumnIds!==void 0){const ps=mt[ae]??{hiddenColumnIds:[],minimizedColumnIds:[]};mt[ae]={...ps,minimizedColumnIds:X.minimizedColumnIds},W.current={boardId:ae,columnIds:X.minimizedColumnIds}}const tr=Hf(mt,ae,qe);q.setState({currentBoard:ae,columnVisibilityByBoard:tr})}le(null),c(te),J(te),u(X.columns??[]),X.boards&&d(X.boards),X.workspace&&p(X.workspace),X.settings&&(X.settings.markdownEditorMode&&U&&oe(null),h(X.settings)),X.labels&&y(X.labels),$(!0);break}case"connectionStatus":le(aQ(X));break;case"cardsUpdated":c(X.cards),J(X.cards);break;case"triggerCreateDialog":S("backlog"),D(!0);break;case"labelsUpdated":y(X.labels);break;case"showSettings":h(X.settings),v(!0);break;case"cardContent":{const{cardSettings:te}=q.getState();if(te.markdownEditorMode)break;R(X.cardId),L.current+=1,oe(je=>({id:X.cardId,content:X.content,frontmatter:X.frontmatter,comments:X.comments||[],logs:X.logs!==void 0?X.logs:(je==null?void 0:je.id)===X.cardId?je.logs:[],contentVersion:L.current}));break}case"actionResult":break;case"boardActionResult":break;case"logsUpdated":{oe(te=>te&&te.id===X.cardId?{...te,logs:X.logs}:te);break}case"boardLogsUpdated":{I(X.logs);break}}};return window.addEventListener("message",F),ce.postMessage({type:"ready"}),()=>window.removeEventListener("message",F)},[U,c,u,d,p,h,v,y,J]),x.useEffect(()=>{var te;if(!k)return;const F=Hf(r,t,e.map(je=>je.id));if(F!==r){q.setState({columnVisibilityByBoard:F});return}A.current=F,ce.setState(F);const Q=((te=F[t])==null?void 0:te.minimizedColumnIds)??[],X=W.current;(!X||X.boardId!==t||!lQ(X.columnIds,Q))&&(ce.postMessage({type:"setMinimizedColumns",boardId:t,columnIds:Q}),W.current={boardId:t,columnIds:Q})},[r,e,t,k]);const Ne=(F,Q)=>{if(Q.metaKey||Q.ctrlKey){const te=[...q.getState().selectedCardIds];U&&!te.includes(U.id)&&te.push(U.id);const je=te.indexOf(F.id);je>=0?te.splice(je,1):te.push(F.id),q.setState({selectedCardIds:te,lastClickedCardId:F.id}),U&&oe(null);return}if(Q.shiftKey){if(U&&!q.getState().lastClickedCardId){const X=q.getState().selectedCardIds,te=X.includes(U.id)?[...X]:[...X,U.id];q.setState({selectedCardIds:te,lastClickedCardId:U.id})}C(F.id),U&&oe(null);return}_(),ce.postMessage({type:"openCard",cardId:F.id})},Ce=(F,Q)=>{U&&ce.postMessage({type:"saveCardContent",cardId:U.id,content:F,frontmatter:Q})},Ie=(F,Q)=>{U&&(ce.postMessage({type:"transferCard",cardId:U.id,toBoard:F,targetStatus:Q}),oe(null),R(null))},Ge=()=>{oe(null),R(null),ce.postMessage({type:"closeCard"})},it=()=>{U&&se(U.id)},Et=()=>{U&&(ce.postMessage({type:"permanentDeleteCard",cardId:U.id}),oe(null),R(null))},wt=()=>{U&&(ce.postMessage({type:"restoreCard",cardId:U.id}),oe(null),R(null))},ye=()=>{ce.postMessage({type:"purgeDeletedCards"})},$e=()=>{U&&ce.postMessage({type:"openFile",cardId:U.id})},Ve=F=>{ce.postMessage({type:"openMetadataFile",path:F})},pt=()=>{U&&ce.postMessage({type:"downloadCard",cardId:U.id})},ls=(F,Q)=>{ce.postMessage({type:"startWithAI",agent:F,permissionMode:Q})},pn=()=>{U&&ce.postMessage({type:"addAttachment",cardId:U.id})},mn=F=>{U&&ce.postMessage({type:"openAttachment",cardId:U.id,attachment:F})},cs=F=>{U&&ce.postMessage({type:"removeAttachment",cardId:U.id,attachment:F})},us=(F,Q)=>{U&&ce.postMessage({type:"addComment",cardId:U.id,author:F,content:Q})},gn=(F,Q)=>{U&&ce.postMessage({type:"updateComment",cardId:U.id,commentId:F,content:Q})},ds=F=>{U&&ce.postMessage({type:"deleteComment",cardId:U.id,commentId:F})},vn=()=>{U&&ce.postMessage({type:"clearLogs",cardId:U.id})},fs=()=>{Y?N(!1):(N(!0),ce.postMessage({type:"getBoardLogs"}))},jo=()=>{ce.postMessage({type:"clearBoardLogs"})},yn=F=>{ce.postMessage({type:"saveSettings",settings:F})},hs=x.useCallback(F=>{g(F)},[g]),Eo=x.useCallback(F=>{m();const Q={...q.getState().cardSettings,drawerWidth:F};h(Q),yn(Q)},[m,h]),bn=x.useCallback(()=>{m()},[m]),zi=()=>{V(null),O(!0)},Ao=F=>{const Q=e.find(X=>X.id===F);Q&&(V(Q),O(!0))},No=F=>{!e.find(te=>te.id===F)||q.getState().cards.filter(te=>te.status===F).length>0||ce.postMessage({type:"removeColumn",columnId:F})},Oi=F=>{!e.find(te=>te.id===F)||q.getState().cards.filter(te=>te.status===F).length===0||ce.postMessage({type:"cleanupColumn",columnId:F})},Po=x.useCallback(F=>{const Q=q.getState().columns;u(F.map(X=>Q.find(te=>te.id===X)).filter(X=>X!=null)),ce.postMessage({type:"reorderColumns",columnIds:F})},[u]),Ro=F=>{G?ce.postMessage({type:"editColumn",columnId:G.id,updates:F}):ce.postMessage({type:"addColumn",column:F}),O(!1),V(null)},To=F=>{S(F),D(!0)},Io=x.useCallback(F=>{const Q=Array.from(q.getState().selectedCardIds);for(const te of Q)ce.postMessage({type:"moveCard",cardId:te,newStatus:F,newOrder:-1});const{cards:X}=q.getState();c(X.map(te=>Q.includes(te.id)?{...te,status:F}:te)),_()},[c,_]),T=x.useCallback(F=>{const Q=Array.from(q.getState().selectedCardIds);for(const te of Q)ce.postMessage({type:"bulkUpdateCard",cardId:te,updates:{priority:F}});const{cards:X}=q.getState();c(X.map(te=>Q.includes(te.id)?{...te,priority:F}:te)),_()},[c,_]),me=x.useCallback(F=>{const Q=Array.from(q.getState().selectedCardIds);for(const te of Q)ce.postMessage({type:"bulkUpdateCard",cardId:te,updates:{assignee:F}});const{cards:X}=q.getState();c(X.map(te=>Q.includes(te.id)?{...te,assignee:F}:te)),_()},[c,_]),er=x.useCallback((F,Q)=>{const X=Array.from(q.getState().selectedCardIds),{cards:te}=q.getState();for(const je of X){const ae=te.find(Xe=>Xe.id===je);if(!ae)continue;const qe=Array.from(new Set([...ae.labels,...F])).filter(Xe=>!Q.includes(Xe));ce.postMessage({type:"bulkUpdateCard",cardId:je,updates:{labels:qe}})}c(te.map(je=>{if(!X.includes(je.id))return je;const ae=Array.from(new Set([...je.labels,...F])).filter(qe=>!Q.includes(qe));return{...je,labels:ae}})),_()},[c,_]),Di=x.useCallback(()=>{const F=Array.from(q.getState().selectedCardIds);for(const Q of F)se(Q);_()},[se,_]),Vx=x.useCallback((F,Q)=>{for(const te of F)ce.postMessage({type:"moveCard",cardId:te,newStatus:Q,newOrder:-1});const{cards:X}=q.getState();c(X.map(te=>F.includes(te.id)?{...te,status:Q}:te)),_()},[c,_]),df=F=>{ce.postMessage({type:"createCard",data:F})},Kx=x.useCallback(F=>{if(!U)return;const Q=`action-${Date.now()}`;ce.postMessage({type:"triggerAction",cardId:U.id,action:F,callbackKey:Q})},[U]),Hx=x.useCallback((F,Q)=>{const X=`action-${Date.now()}`;ce.postMessage({type:"triggerAction",cardId:F,action:Q,callbackKey:X})},[]),Gx=x.useCallback((F,Q)=>{const X=`board-action-${Date.now()}`;ce.postMessage({type:"triggerBoardAction",boardId:F,actionKey:Q,callbackKey:X})},[]),qx=(F,Q,X)=>{const{cards:te}=q.getState();if(te.find(ae=>ae.id===F)){const ae=te.filter(rr=>rr.status===Q&&rr.id!==F).sort((rr,ff)=>rr.order<ff.order?-1:rr.order>ff.order?1:0),qe=Math.max(0,Math.min(X,ae.length)),Xe=qe>0?ae[qe-1].order:null,mt=qe<ae.length?ae[qe].order:null,tr=Vk(Xe,mt),ps=te.map(rr=>rr.id===F?{...rr,status:Q,order:tr}:rr);c(ps)}ce.postMessage({type:"moveCard",cardId:F,newStatus:Q,newOrder:X})},Yx=x.useCallback(F=>{df({...F,assignee:null,dueDate:null,labels:[],actions:[]})},[]);return e.length===0?l.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:l.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):l.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[l.jsx(BZ,{onOpenSettings:()=>ce.postMessage({type:"openSettings"}),onAddColumn:zi,onCreateCard:()=>{S(s.defaultStatus||"backlog"),D(!0)},onToggleTheme:()=>ce.postMessage({type:"toggleTheme"}),onSwitchBoard:F=>ce.postMessage({type:"switchBoard",boardId:F}),onCreateBoard:F=>ce.postMessage({type:"createBoard",name:F}),onOpenBoardLogs:fs,boardLogsOpen:Y,onTriggerBoardAction:Gx,onOpenShortcutHelp:()=>P(F=>!F)}),l.jsxs("div",{className:"kb-board-stage flex-1 flex overflow-hidden",children:[l.jsx("div",{className:"board-zoom-scope w-full min-w-0",style:(s.panelMode??"drawer")==="drawer"&&i.length===0&&(U!==null||Y)?{width:`${100-o}%`}:void 0,children:l.jsx(t$,{onCardClick:Ne,onAddCard:To,onMoveCard:qx,onMoveCards:Vx,onEditColumn:Ao,onRemoveColumn:No,onCleanupColumn:Oi,onReorderColumns:Po,onPurgeDeletedCards:ye,selectedCardId:U==null?void 0:U.id,selectedCardIds:i,onSelectAll:w,onQuickAdd:Yx,onTriggerAction:Hx})}),Y&&i.length===0&&!U&&(()=>{const F=(s.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>N(!1)}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl animate-in slide-in-from-right duration-200 pointer-events-auto":"relative w-full max-w-2xl max-h-[85vh] flex flex-col rounded-xl shadow-xl animate-in zoom-in-95 fade-in duration-200",style:F?{width:`${o}%`,background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"}:{background:"var(--vscode-editor-background)",border:"1px solid var(--vscode-panel-border)"},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:F?"drawer":"popup",onPreview:hs,onCommit:Eo,onCancel:bn}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-2",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[l.jsx("span",{className:"text-sm font-medium",style:{color:"var(--vscode-foreground)"},children:"Board Logs"}),l.jsx("button",{onClick:()=>N(!1),className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:Q=>Q.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:Q=>Q.currentTarget.style.background="transparent",title:"Close board logs",children:"✕"})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsx(M0,{logs:Z,onClearLogs:jo})})]})]})})(),U&&i.length===0&&(()=>{const F=(s.panelMode??"drawer")==="drawer";return l.jsxs("div",{className:`fixed inset-0 z-40 flex ${F?"justify-end pointer-events-none":"items-center justify-center p-4"}`,children:[!F&&l.jsx("div",{className:"absolute inset-0 card-view-modal-backdrop",onClick:Ge}),l.jsxs("div",{className:F?"relative h-full flex flex-col shadow-xl overflow-hidden animate-in slide-in-from-right duration-200 pointer-events-auto card-view-shell card-view-shell--drawer":"relative w-full max-w-none h-[90vh] flex flex-col rounded-xl shadow-xl overflow-hidden animate-in zoom-in-95 fade-in duration-200 card-view-shell card-view-shell--popup",style:{fontSize:"calc(1em * var(--card-zoom, 1))",...F?{width:`${o}%`}:{}},...F?{"data-panel-drawer":""}:{},children:[l.jsx(Qa,{panelMode:F?"drawer":"popup",onPreview:hs,onCommit:Eo,onCancel:bn}),l.jsx(OZ,{cardId:U.id,content:U.content,frontmatter:U.frontmatter,comments:U.comments,contentVersion:U.contentVersion,onSave:Ce,onClose:Ge,onDelete:it,onPermanentDelete:Et,onRestore:wt,onOpenFile:$e,onOpenMetadataFile:Ve,onDownloadCard:pt,onStartWithAI:ls,onAddAttachment:pn,onOpenAttachment:mn,onRemoveAttachment:cs,onAddComment:us,onUpdateComment:gn,onDeleteComment:ds,onTransferToBoard:Ie,onTriggerAction:Kx,logs:U.logs,onClearLogs:vn,logsFilter:s.logsFilter,onLogsFilterChange:Q=>{const X={...s,logsFilter:Q};h(X),ce.postMessage({type:"saveSettings",settings:X})}})]})]})})()]}),i.length>1&&l.jsx(tQ,{selectedCount:i.length,onClearSelection:_,onMoveToColumn:Io,onSetPriority:T,onSetAssignee:me,onApplyLabels:er,onDelete:Di}),l.jsx(xZ,{isOpen:z,onClose:()=>D(!1),onCreate:df,initialStatus:j,onSaveSettings:yn}),l.jsx(HZ,{isOpen:a,settings:s,workspace:n,onClose:()=>v(!1),onSave:yn,onSetLabel:(F,Q)=>ce.postMessage({type:"setLabel",name:F,definition:Q}),onRenameLabel:(F,Q)=>ce.postMessage({type:"renameLabel",oldName:F,newName:Q}),onDeleteLabel:F=>ce.postMessage({type:"deleteLabel",name:F})}),l.jsx(ZZ,{isOpen:K,onClose:()=>{O(!1),V(null)},onSave:Ro,initial:G?{name:G.name,color:G.color}:void 0,title:G?"Edit List":"Add List"}),re&&l.jsx(Um,{title:re.title,message:re.message,persistent:!0,tone:re.tone,index:0}),H.map((F,Q)=>l.jsx(Um,{message:`Deleted "${Qc(F.card.content)}"`,onUndo:()=>_e(F.id),onExpire:()=>ue(F.id),duration:5e3,index:re?Q+1:Q},F.id)),l.jsx(sQ,{isOpen:E,onClose:()=>P(!1)})]})}function dQ(e){return e!=="http:"&&e!=="https:"}function Ur(e){if(typeof e=="string")return e;if(typeof e=="boolean")return String(e)}function fQ(e){var r;const t=(r=Ur(e))==null?void 0:r.trim().replace(/^"(.*)"$/,"$1").toLowerCase();if(t==="true")return!0;if(t==="false")return!1}function cf(e){return{priority:Ur(e.priority),labels:Ur(e.labels),assignee:Ur(e.assignee),dueDate:Ur(e.dueDate),q:Ur(e.q),fuzzy:Ur(e.fuzzy)}}function Km(e){return JSON.stringify({...e.priority&&{priority:e.priority},...e.labels&&{labels:e.labels},...e.assignee&&{assignee:e.assignee},...e.dueDate&&{dueDate:e.dueDate},...e.q&&{q:e.q},...e.fuzzy&&{fuzzy:e.fuzzy}})}const Hm=lf(),hQ=["critical","high","medium","low"],pQ=["overdue","today","this-week","no-date"];function mQ(){const e=li(),t=ai({strict:!1}),r=ii({strict:!1}),{setPriorityFilter:n,setAssigneeFilter:s,setLabelFilter:o,setDueDateFilter:a,setSearchQuery:i,setFuzzySearch:c,setActiveCardTab:u}=q.getState(),d=q(S=>S.columns),f=q(S=>S.currentBoard),p=q(S=>S.activeCardId),h=q(S=>S.activeCardTab),g=q(S=>S.priorityFilter),m=q(S=>S.assigneeFilter),v=q(S=>S.labelFilter),y=q(S=>S.dueDateFilter),b=q(S=>S.searchQuery),C=q(S=>S.fuzzySearch),w=q.getState(),_=x.useRef({board:t.boardId??w.currentBoard,cardId:"",tab:jn(t.tabId??w.activeCardTab),searchStr:Km(r)}),R=x.useRef(!1),z=x.useRef(t.cardId??null);x.useEffect(()=>{if(R.current)return;R.current=!0,r.priority&&hQ.includes(r.priority)&&n(r.priority),r.labels&&o(r.labels.split(",").filter(Boolean)),r.assignee&&s(r.assignee),r.dueDate&&pQ.includes(r.dueDate)&&a(r.dueDate),r.q&&i(decodeURIComponent(r.q));const S=fQ(r.fuzzy);S!==void 0&&c(S),t.tabId&&Qg(t.tabId)&&u(t.tabId),t.boardId&&Hm.postMessage({type:"switchBoard",boardId:t.boardId})},[]);const D=x.useRef(!1);x.useEffect(()=>{D.current||d.length===0||(D.current=!0,z.current&&(Hm.postMessage({type:"openCard",cardId:z.current}),z.current=null))},[d]);const j=x.useRef(!0);return x.useEffect(()=>{if(d.length===0)return;const S={};g!=="all"&&(S.priority=g),v.length>0&&(S.labels=v.join(",")),m!=="all"&&(S.assignee=m),y!=="all"&&(S.dueDate=y),b&&(S.q=b),C&&(S.fuzzy="true");const E=Km(S),P=_.current,K=P.board!==f,O=P.cardId!==(p??""),G=!!p&&P.tab!==h,V=P.searchStr!==E;if(!K&&!O&&!G&&!V)return;_.current={board:f,cardId:p??"",tab:h,searchStr:E};const L=j.current||!K&&!O&&!G&&V;j.current=!1,e(p?{to:"/$boardId/$cardId/$tabId",params:{boardId:f,cardId:p,tabId:h},search:S,replace:L}:{to:"/$boardId",params:{boardId:f},search:S,replace:L})},[d.length,f,p,h,g,m,v,y,b,C,e]),null}function gQ(){return l.jsxs(l.Fragment,{children:[l.jsx(uQ,{}),l.jsx(mQ,{}),l.jsx(ci,{})]})}const uf=Nk({component:gQ,notFoundComponent:()=>null}),vQ=oo({getParentRoute:()=>uf,path:"/",component:()=>null}),Ux=oo({getParentRoute:()=>uf,path:"$boardId",validateSearch:cf,component:()=>l.jsx(ci,{})}),Wx=oo({getParentRoute:()=>Ux,path:"$cardId",validateSearch:cf,component:()=>l.jsx(ci,{})}),yQ=oo({getParentRoute:()=>Wx,path:"$tabId",validateSearch:cf,component:()=>null}),bQ=uf.addChildren([vQ,Ux.addChildren([Wx.addChildren([yQ])])]),xQ=Dk({routeTree:bQ,history:dQ(window.location.protocol)?H1({initialEntries:["/"]}):void 0,defaultPreload:"intent"});cg(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(Bk,{router:xQ})}));
133
133
  //# sourceMappingURL=index.js.map