@fenglimg/fabric-server 1.7.0 → 1.8.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function a(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}})();var ot,$,Sr,ce,Jt,Tr,Ar,ut,Me,Ie,Er,Lt,_t,vt,Ir,Ue={},He=[],la=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dt=Array.isArray;function ae(t,e){for(var r in e)t[r]=e[r];return t}function Pt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ca(t,e,r){var a,i,n,o={};for(n in e)n=="key"?a=e[n]:n=="ref"?i=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?ot.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(n in t.defaultProps)o[n]===void 0&&(o[n]=t.defaultProps[n]);return ze(t,o,a,i,null)}function ze(t,e,r,a,i){var n={type:t,props:e,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Sr,__i:-1,__u:0};return i==null&&$.vnode!=null&&$.vnode(n),n}function lt(t){return t.children}function De(t,e){this.props=t,this.context=e}function ke(t,e){if(e==null)return t.__?ke(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?ke(t):null}function ua(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,a=[],i=[],n=ae({},e);n.__v=e.__v+1,$.vnode&&$.vnode(n),Ot(t.__P,n,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,a,r??ke(e),!!(32&e.__u),i),n.__v=e.__v,n.__.__k[n.__i]=n,$r(a,n,i),e.__e=e.__=null,n.__e!=r&&Rr(n)}}function Rr(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Rr(t)}function yt(t){(!t.__d&&(t.__d=!0)&&ce.push(t)&&!Be.__r++||Jt!=$.debounceRendering)&&((Jt=$.debounceRendering)||Tr)(Be)}function Be(){try{for(var t,e=1;ce.length;)ce.length>e&&ce.sort(Ar),t=ce.shift(),e=ce.length,ua(t)}finally{ce.length=Be.__r=0}}function Nr(t,e,r,a,i,n,o,d,c,l,h){var p,_,b,x,P,R,T,E=a&&a.__k||He,Z=e.length;for(c=ha(r,e,E,c,Z),p=0;p<Z;p++)(b=r.__k[p])!=null&&(_=b.__i!=-1&&E[b.__i]||Ue,b.__i=p,R=Ot(t,b,_,i,n,o,d,c,l,h),x=b.__e,b.ref&&_.ref!=b.ref&&(_.ref&&Ft(_.ref,null,b),h.push(b.ref,b.__c||x,b)),P==null&&x!=null&&(P=x),(T=!!(4&b.__u))||_.__k===b.__k?(c=jr(b,c,t,T),T&&_.__e&&(_.__e=null)):typeof b.type=="function"&&R!==void 0?c=R:x&&(c=x.nextSibling),b.__u&=-7);return r.__e=P,c}function ha(t,e,r,a,i){var n,o,d,c,l,h=r.length,p=h,_=0;for(t.__k=new Array(i),n=0;n<i;n++)(o=e[n])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[n]=ze(null,o,null,null,null):dt(o)?o=t.__k[n]=ze(lt,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[n]=ze(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[n]=o,c=n+_,o.__=t,o.__b=t.__b+1,d=null,(l=o.__i=pa(o,r,c,p))!=-1&&(p--,(d=r[l])&&(d.__u|=2)),d==null||d.__v==null?(l==-1&&(i>h?_--:i<h&&_++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?_--:l==c+1?_++:(l>c?_--:_++,o.__u|=4))):t.__k[n]=null;if(p)for(n=0;n<h;n++)(d=r[n])!=null&&(2&d.__u)==0&&(d.__e==a&&(a=ke(d)),Pr(d,d));return a}function jr(t,e,r,a){var i,n;if(typeof t.type=="function"){for(i=t.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=t,e=jr(i[n],e,r,a));return e}t.__e!=e&&(a&&(e&&t.type&&!e.parentNode&&(e=ke(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function pa(t,e,r,a){var i,n,o,d=t.key,c=t.type,l=e[r],h=l!=null&&(2&l.__u)==0;if(l===null&&d==null||h&&d==l.key&&c==l.type)return r;if(a>(h?1:0)){for(i=r-1,n=r+1;i>=0||n<e.length;)if((l=e[o=i>=0?i--:n++])!=null&&(2&l.__u)==0&&d==l.key&&c==l.type)return o}return-1}function Kt(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||la.test(e)?r:r+"px"}function Le(t,e,r,a,i){var n,o;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof a=="string"&&(t.style.cssText=a=""),a)for(e in a)r&&e in r||Kt(t.style,e,"");if(r)for(e in r)a&&r[e]==a[e]||Kt(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Er,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+n]=r,r?a?r[Ie]=a[Ie]:(r[Ie]=Lt,t.addEventListener(e,n?vt:_t,n)):t.removeEventListener(e,n?vt:_t,n);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Qt(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[Me]==null)e[Me]=Lt++;else if(e[Me]<r[Ie])return;return r($.event?$.event(e):e)}}}function Ot(t,e,r,a,i,n,o,d,c,l){var h,p,_,b,x,P,R,T,E,Z,W,F,q,B,j,H=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),n=[d=e.__e=r.__e]),(h=$.__b)&&h(e);e:if(typeof H=="function")try{if(T=e.props,E=H.prototype&&H.prototype.render,Z=(h=H.contextType)&&a[h.__c],W=h?Z?Z.props.value:h.__:a,r.__c?R=(p=e.__c=r.__c).__=p.__E:(E?e.__c=p=new H(T,W):(e.__c=p=new De(T,W),p.constructor=H,p.render=ma),Z&&Z.sub(p),p.state||(p.state={}),p.__n=a,_=p.__d=!0,p.__h=[],p._sb=[]),E&&p.__s==null&&(p.__s=p.state),E&&H.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=ae({},p.__s)),ae(p.__s,H.getDerivedStateFromProps(T,p.__s))),b=p.props,x=p.state,p.__v=e,_)E&&H.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),E&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(E&&H.getDerivedStateFromProps==null&&T!==b&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(T,W),e.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(T,p.__s,W)===!1){e.__v!=r.__v&&(p.props=T,p.state=p.__s,p.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(te){te&&(te.__=e)}),He.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&o.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(T,p.__s,W),E&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(b,x,P)})}if(p.context=W,p.props=T,p.__P=t,p.__e=!1,F=$.__r,q=0,E)p.state=p.__s,p.__d=!1,F&&F(e),h=p.render(p.props,p.state,p.context),He.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,F&&F(e),h=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++q<25);p.state=p.__s,p.getChildContext!=null&&(a=ae(ae({},a),p.getChildContext())),E&&!_&&p.getSnapshotBeforeUpdate!=null&&(P=p.getSnapshotBeforeUpdate(b,x)),B=h!=null&&h.type===lt&&h.key==null?Lr(h.props.children):h,d=Nr(t,dt(B)?B:[B],e,r,a,i,n,o,d,c,l),p.base=e.__e,e.__u&=-161,p.__h.length&&o.push(p),R&&(p.__E=p.__=null)}catch(te){if(e.__v=null,c||n!=null)if(te.then){for(e.__u|=c?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;n[n.indexOf(d)]=null,e.__e=d}else{for(j=n.length;j--;)Pt(n[j]);kt(e)}else e.__e=r.__e,e.__k=r.__k,te.then||kt(e);$.__e(te,e,r)}else n==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):d=e.__e=fa(r.__e,e,r,a,i,n,o,c,l);return(h=$.diffed)&&h(e),128&e.__u?void 0:d}function kt(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(kt))}function $r(t,e,r){for(var a=0;a<r.length;a++)Ft(r[a],r[++a],r[++a]);$.__c&&$.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(n){n.call(i)})}catch(n){$.__e(n,i.__v)}})}function Lr(t){return typeof t!="object"||t==null||t.__b>0?t:dt(t)?t.map(Lr):ae({},t)}function fa(t,e,r,a,i,n,o,d,c){var l,h,p,_,b,x,P,R=r.props||Ue,T=e.props,E=e.type;if(E=="svg"?i="http://www.w3.org/2000/svg":E=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),n!=null){for(l=0;l<n.length;l++)if((b=n[l])&&"setAttribute"in b==!!E&&(E?b.localName==E:b.nodeType==3)){t=b,n[l]=null;break}}if(t==null){if(E==null)return document.createTextNode(T);t=document.createElementNS(i,E,T.is&&T),d&&($.__m&&$.__m(e,n),d=!1),n=null}if(E==null)R===T||d&&t.data==T||(t.data=T);else{if(n=n&&ot.call(t.childNodes),!d&&n!=null)for(R={},l=0;l<t.attributes.length;l++)R[(b=t.attributes[l]).name]=b.value;for(l in R)b=R[l],l=="dangerouslySetInnerHTML"?p=b:l=="children"||l in T||l=="value"&&"defaultValue"in T||l=="checked"&&"defaultChecked"in T||Le(t,l,null,b,i);for(l in T)b=T[l],l=="children"?_=b:l=="dangerouslySetInnerHTML"?h=b:l=="value"?x=b:l=="checked"?P=b:d&&typeof b!="function"||R[l]===b||Le(t,l,b,R[l],i);if(h)d||p&&(h.__html==p.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(p&&(t.innerHTML=""),Nr(e.type=="template"?t.content:t,dt(_)?_:[_],e,r,a,E=="foreignObject"?"http://www.w3.org/1999/xhtml":i,n,o,n?n[0]:r.__k&&ke(r,0),d,c),n!=null)for(l=n.length;l--;)Pt(n[l]);d||(l="value",E=="progress"&&x==null?t.removeAttribute("value"):x!=null&&(x!==t[l]||E=="progress"&&!x||E=="option"&&x!=R[l])&&Le(t,l,x,R[l],i),l="checked",P!=null&&P!=t[l]&&Le(t,l,P,R[l],i))}return t}function Ft(t,e,r){try{if(typeof t=="function"){var a=typeof t.__u=="function";a&&t.__u(),a&&e==null||(t.__u=t(e))}else t.current=e}catch(i){$.__e(i,r)}}function Pr(t,e,r){var a,i;if($.unmount&&$.unmount(t),(a=t.ref)&&(a.current&&a.current!=t.__e||Ft(a,null,e)),(a=t.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount()}catch(n){$.__e(n,e)}a.base=a.__P=null}if(a=t.__k)for(i=0;i<a.length;i++)a[i]&&Pr(a[i],e,r||typeof t.type!="function");r||Pt(t.__e),t.__c=t.__=t.__e=void 0}function ma(t,e,r){return this.constructor(t,r)}function ba(t,e,r){var a,i,n,o;e==document&&(e=document.documentElement),$.__&&$.__(t,e),i=(a=!1)?null:e.__k,n=[],o=[],Ot(e,t=e.__k=ca(lt,null,[t]),i||Ue,Ue,e.namespaceURI,i?null:e.firstChild?ot.call(e.childNodes):null,n,i?i.__e:e.firstChild,a,o),$r(n,t,o)}function ga(t){function e(r){var a,i;return this.getChildContext||(a=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){a=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&a.forEach(function(o){o.__e=!0,yt(o)})},this.sub=function(n){a.add(n);var o=n.componentWillUnmount;n.componentWillUnmount=function(){a&&a.delete(n),o&&o.call(n)}}),r.children}return e.__c="__cC"+Ir++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,a){return r.children(a)}).contextType=e,e}ot=He.slice,$={__e:function(t,e,r,a){for(var i,n,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((n=i.constructor)&&n.getDerivedStateFromError!=null&&(i.setState(n.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,a||{}),o=i.__d),o)return i.__E=i}catch(d){t=d}throw t}},Sr=0,De.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ae({},this.state),typeof t=="function"&&(t=t(ae({},r),this.props)),t&&ae(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),yt(this))},De.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),yt(this))},De.prototype.render=lt,ce=[],Tr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ar=function(t,e){return t.__v.__b-e.__v.__b},Be.__r=0,ut=Math.random().toString(8),Me="__d"+ut,Ie="__a"+ut,Er=/(PointerCapture)$|Capture$/i,Lt=0,_t=Qt(!1),vt=Qt(!0),Ir=0;var _a=0;function s(t,e,r,a,i,n){e||(e={});var o,d,c=e;if("ref"in c)for(d in c={},e)d=="ref"?o=e[d]:c[d]=e[d];var l={type:t,props:c,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--_a,__i:-1,__u:0,__source:i,__self:n};if(typeof t=="function"&&(o=t.defaultProps))for(d in o)c[d]===void 0&&(c[d]=o[d]);return $.vnode&&$.vnode(l),l}var xe,O,ht,er,Ve=0,Or=[],M=$,tr=M.__b,rr=M.__r,ar=M.diffed,ir=M.__c,nr=M.unmount,sr=M.__;function ct(t,e){M.__h&&M.__h(O,t,Ve||e),Ve=0;var r=O.__H||(O.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function L(t){return Ve=1,va(Mr,t)}function va(t,e,r){var a=ct(xe++,2);if(a.t=t,!a.__c&&(a.__=[Mr(void 0,e),function(d){var c=a.__N?a.__N[0]:a.__[0],l=a.t(c,d);c!==l&&(a.__N=[l,a.__[1]],a.__c.setState({}))}],a.__c=O,!O.__f)){var i=function(d,c,l){if(!a.__c.__H)return!0;var h=a.__c.__H.__.filter(function(_){return _.__c});if(h.every(function(_){return!_.__N}))return!n||n.call(this,d,c,l);var p=a.__c.props!==d;return h.some(function(_){if(_.__N){var b=_.__[0];_.__=_.__N,_.__N=void 0,b!==_.__[0]&&(p=!0)}}),n&&n.call(this,d,c,l)||p};O.__f=!0;var n=O.shouldComponentUpdate,o=O.componentWillUpdate;O.componentWillUpdate=function(d,c,l){if(this.__e){var h=n;n=void 0,i(d,c,l),n=h}o&&o.call(this,d,c,l)},O.shouldComponentUpdate=i}return a.__N||a.__}function K(t,e){var r=ct(xe++,3);!M.__s&&Fr(r.__H,e)&&(r.__=t,r.u=e,O.__H.__h.push(r))}function Pe(t){return Ve=5,ne(function(){return{current:t}},[])}function ne(t,e){var r=ct(xe++,7);return Fr(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function ya(t){var e=O.context[t.__c],r=ct(xe++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(O)),e.props.value):t.__}function ka(){for(var t;t=Or.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Ze),e.__h.some(xt),e.__h=[]}catch(r){e.__h=[],M.__e(r,t.__v)}}}M.__b=function(t){O=null,tr&&tr(t)},M.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),sr&&sr(t,e)},M.__r=function(t){rr&&rr(t),xe=0;var e=(O=t.__c).__H;e&&(ht===O?(e.__h=[],O.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(Ze),e.__h.some(xt),e.__h=[],xe=0)),ht=O},M.diffed=function(t){ar&&ar(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Or.push(e)!==1&&er===M.requestAnimationFrame||((er=M.requestAnimationFrame)||xa)(ka)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),ht=O=null},M.__c=function(t,e){e.some(function(r){try{r.__h.some(Ze),r.__h=r.__h.filter(function(a){return!a.__||xt(a)})}catch(a){e.some(function(i){i.__h&&(i.__h=[])}),e=[],M.__e(a,r.__v)}}),ir&&ir(t,e)},M.unmount=function(t){nr&&nr(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(a){try{Ze(a)}catch(i){e=i}}),r.__H=void 0,e&&M.__e(e,r.__v))};var or=typeof requestAnimationFrame=="function";function xa(t){var e,r=function(){clearTimeout(a),or&&cancelAnimationFrame(e),setTimeout(t)},a=setTimeout(r,35);or&&(e=requestAnimationFrame(r))}function Ze(t){var e=O,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),O=e}function xt(t){var e=O;t.__c=t.__(),O=e}function Fr(t,e){return!t||t.length!==e.length||e.some(function(r,a){return r!==t[a]})}function Mr(t,e){return typeof e=="function"?e(t):e}var wa=Symbol.for("preact-signals");function Mt(){if(me>1)me--;else{var t,e=!1;for((function(){var i=qe;for(qe=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();Re!==void 0;){var r=Re;for(Re=void 0,We++;r!==void 0;){var a=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&Zr(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=a}}if(We=0,me--,e)throw t}}var N=void 0;function zr(t){var e=N;N=void 0;try{return t()}finally{N=e}}var Re=void 0,me=0,We=0,dr=0,qe=void 0,Xe=0;function Dr(t){if(N!==void 0){var e=t.n;if(e===void 0||e.t!==N)return e={i:0,S:t,p:N.s,n:void 0,t:N,e:void 0,x:void 0,r:e},N.s!==void 0&&(N.s.n=e),N.s=e,t.n=e,32&N.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=N.s,e.n=void 0,N.s.n=e,N.s=e),e}}function Y(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}Y.prototype.brand=wa;Y.prototype.h=function(){return!0};Y.prototype.S=function(t){var e=this,r=this.t;r!==t&&t.e===void 0&&(t.x=r,this.t=t,r!==void 0?r.e=t:zr(function(){var a;(a=e.W)==null||a.call(e)}))};Y.prototype.U=function(t){var e=this;if(this.t!==void 0){var r=t.e,a=t.x;r!==void 0&&(r.x=a,t.e=void 0),a!==void 0&&(a.e=r,t.x=void 0),t===this.t&&(this.t=a,a===void 0&&zr(function(){var i;(i=e.Z)==null||i.call(e)}))}};Y.prototype.subscribe=function(t){var e=this;return Sa(function(){var r=e.value,a=N;N=void 0;try{t(r)}finally{N=a}},{name:"sub"})};Y.prototype.valueOf=function(){return this.value};Y.prototype.toString=function(){return this.value+""};Y.prototype.toJSON=function(){return this.value};Y.prototype.peek=function(){var t=N;N=void 0;try{return this.value}finally{N=t}};Object.defineProperty(Y.prototype,"value",{get:function(){var t=Dr(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(We>100)throw new Error("Cycle detected");(function(r){me!==0&&We===0&&r.l!==dr&&(r.l=dr,qe={S:r,v:r.v,i:r.i,o:qe})})(this),this.v=t,this.i++,Xe++,me++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Mt()}}}});function zt(t,e){return new Y(t,e)}function Zr(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Ur(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Hr(t){for(var e=t.s,r=void 0;e!==void 0;){var a=e.p;e.i===-1?(e.S.U(e),a!==void 0&&(a.n=e.n),e.n!==void 0&&(e.n.p=a)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=a}t.s=r}function Se(t,e){Y.call(this,void 0),this.x=t,this.s=void 0,this.g=Xe-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}Se.prototype=new Y;Se.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Xe))return!0;if(this.g=Xe,this.f|=1,this.i>0&&!Zr(this))return this.f&=-2,!0;var t=N;try{Ur(this),N=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return N=t,Hr(this),this.f&=-2,!0};Se.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}Y.prototype.S.call(this,t)};Se.prototype.U=function(t){if(this.t!==void 0&&(Y.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Se.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Se.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Dr(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Br(t){var e=t.m;if(t.m=void 0,typeof e=="function"){me++;var r=N;N=void 0;try{e()}catch(a){throw t.f&=-2,t.f|=8,Dt(t),a}finally{N=r,Mt()}}}function Dt(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Br(t)}function Ca(t){if(N!==this)throw new Error("Out-of-order effect");Hr(this),N=t,this.f&=-2,8&this.f&&Dt(this),Mt()}function Te(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e?.name}Te.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}};Te.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Br(this),Ur(this),me++;var t=N;return N=this,Ca.bind(this,t)};Te.prototype.N=function(){2&this.f||(this.f|=2,this.u=Re,Re=this)};Te.prototype.d=function(){this.f|=8,1&this.f||Dt(this)};Te.prototype.dispose=function(){this.d()};function Sa(t,e){var r=new Te(t,e);try{r.c()}catch(i){throw r.d(),i}var a=r.d.bind(r);return a[Symbol.dispose]=a,a}async function Ta(){return await Ae("/api/rules")}async function Aa(t){const e=new URLSearchParams;return e.set("path",t),await Ae(Zt("/api/rules/context",e))}async function Ea(t={}){const e=new URLSearchParams;return t.source!==void 0&&e.set("source",t.source),t.since!==void 0&&e.set("since",String(t.since)),await Ae(Zt("/api/ledger",e))}async function Ia(){return await Ae("/api/scan")}async function Ra(){return await Ae("/api/doctor")}async function Na(t){return await Fa("/api/intent/annotate",t)}async function ja(t){const e=new URLSearchParams;return t.ledgerId!==void 0&&e.set("ledger_id",t.ledgerId),t.ts!==void 0&&e.set("ts",String(t.ts)),await Ae(Zt("/api/history/state",e))}let le;function $a(t,e,r,a,i){let n=!1;const o=new AbortController;let d=!1;const c=Ut({Accept:"text/event-stream"});return e!==null&&e.length>0&&(c["Last-Event-ID"]=e),(async()=>{try{const h=await fetch(t,{headers:c,signal:o.signal});if(!h.ok||h.body===null){l(()=>{i()});return}a();const p=h.body.getReader(),_=new TextDecoder;let b="";for(;!n;){const{done:x,value:P}=await p.read();if(x)break;b+=_.decode(P,{stream:!0}),b=b.replace(/\r\n/g,`
2
- `);let R;for(;(R=b.indexOf(`
3
-
4
- `))>=0;){const T=b.slice(0,R);b=b.slice(R+2),La(T,r)}}}catch{}finally{n||l(()=>{i()})}})(),{close(){n=!0,o.abort()}};function l(h){d||(d=!0,h())}}function La(t,e){let r="message",a="",i="";for(const n of t.split(`
5
- `))n.startsWith("event:")?r=n.slice(6).trim():n.startsWith("data:")?a=a.length>0?`${a}
6
- ${n.slice(5).trim()}`:n.slice(5).trim():n.startsWith("id:")&&(i=n.slice(3).trim());a.length>0&&e(r,a,i)}function Pa(){if(le!==void 0)return le;const e=window.__FABRIC_AUTH_TOKEN__;if(typeof e=="string"&&e.length>0)return le=e,le;const r=new URL(window.location.href),a=r.searchParams,i=a.get("token");if(i!==null&&i.length>0){a.delete("token");const n=a.toString(),o=`${r.pathname}${n.length>0?`?${n}`:""}${r.hash}`;return window.history.replaceState({},document.title,o),le=i,le}return le=null,le}function Oa(t){try{const e=JSON.parse(t);return typeof e.type=="string"&&"payload"in e?e:null}catch{return null}}async function Ae(t){const e=await fetch(t,{headers:Ut({Accept:"application/json"})});return await Vr(e)}async function Fa(t,e){const r=await fetch(t,{method:"POST",headers:Ut({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify(e)});return await Vr(r)}async function Vr(t){const e=await t.text(),r=e.length>0?JSON.parse(e):void 0;if(!t.ok)throw new Error(Ma(r,t.status));return r}function Ma(t,e){return t&&typeof t=="object"&&"error"in t&&typeof t.error?.message=="string"?t.error.message:`Fabric API request failed with HTTP ${e}.`}function Zt(t,e){const r=e.toString();return r.length>0?`${t}?${r}`:t}function Ut(t){const e=Pa();return e===null?t:{...t,Authorization:`Bearer ${e}`}}const za=["meta:updated","lock:drift","lock:approved","ledger:appended","drift:detected"],Da=new Set(za),pt=zt([]),ft=zt(!1),mt=zt(0),lr=1e3,Za=3e4,Ua=2;function Ha(){const[t,e]=L({connected:ft.value,lastEvent:pt.value[0]??null,version:mt.value}),r=Pe(null),a=Pe(lr),i=Pe(void 0),n=Pe(!0);return K(()=>{n.current=!0;const o=h=>{ft.value=h,e(p=>({...p,connected:h}))},d=(h,p,_)=>{if(!Da.has(h))return;_.length>0&&(r.current=_);const b=Oa(p);b!==null&&(pt.value=[b,...pt.value].slice(0,50),mt.value+=1,e({connected:ft.value,lastEvent:b,version:mt.value}))};let c=null;const l=()=>{n.current&&(c=$a("/events",r.current,d,()=>{n.current&&(a.current=lr,o(!0))},()=>{if(!n.current)return;o(!1);const h=a.current;a.current=Math.min(a.current*Ua,Za),i.current=setTimeout(l,h)}))};return l(),()=>{n.current=!1,clearTimeout(i.current),c?.close(),o(!1)}},[]),t}var Ba={"cli.main.description":"Fabric CLI - AI agent collaboration framework","cli.shared.created":"Created","cli.shared.skipped":"Skipped","cli.shared.next":"Next","cli.shared.reason":"Reason","cli.shared.updated":"Updated","cli.shared.missing":"missing","cli.shared.present":"present","cli.shared.absent":"missing","cli.shared.yes":"yes","cli.shared.no":"no","cli.shared.none":"none","cli.shared.loading":"loading","cli.shared.refresh":"Refresh","cli.shared.target-invalid":"Target must be an existing directory: {target}","cli.shared.template-not-found":"Template not found: {path}","cli.shared.invalid-host-empty":"Invalid host: <empty>","cli.shared.invalid-port":"Invalid port: {value}","cli.approve.description":"Approve drifted human-lock entries from the command line.","cli.approve.args.all.description":"Approve all drifted human-lock entries without prompting.","cli.approve.args.interactive.description":"Prompt before approving each drifted human-lock entry.","cli.approve.args.target.description":"Target project path, default is the current working directory.","cli.approve.no-drift":"No drift entries found.","cli.approve.prompt":"Approve this entry? [y/N] ","cli.approve.approved-one":"Approved {location}","cli.approve.skipped-one":"Skipped {location}","cli.approve.summary":"Approved {approved}/{total} drift entries. Skipped {skipped}.","cli.approve.table.expected":"Expected","cli.approve.table.current":"Current","cli.bootstrap.description":"Install Fabric bootstrap prompts for supported AI clients.","cli.bootstrap.install.description":"Copy Fabric bootstrap templates into native client locations.","cli.bootstrap.install.args.clients.description":"Optional comma-separated client filter, for example claude,cursor,codex.","cli.bootstrap.install.no-targets":"No bootstrap targets detected. Pass --clients claude,cursor,windsurf,roo,gemini,codex to install explicitly.","cli.bootstrap.install.installed":"Installed {path}","cli.bootstrap.install.skipped-header":"Skipped {path}: Fabric Bootstrap header already present.","cli.bootstrap.install.prepended":"Prepended {path}","cli.bootstrap.errors.unknown-client":'Unknown client "{client}". Use a comma-separated list such as claude,cursor,codex.',"cli.config.description":"Manage Fabric MCP client configuration.","cli.config.clients.claude":"Claude Code CLI","cli.config.install.description":"Install Fabric MCP server entries into detected client configs.","cli.config.install.args.clients.description":"Optional comma-separated client filter, for example cursor,codex,gemini.","cli.config.install.args.dry-run.description":"Preview detected write operations without modifying files.","cli.config.errors.unknown-client":'Unknown client "{client}". Use a comma-separated list such as cursor,codex,gemini.',"cli.config.errors.expected-object":"Expected object in {path}","cli.config.install.no-configs":"No Fabric MCP client config detected. Create the client directory or set clientPaths in fabric.config.json.","cli.config.install.no-config-path":"Skipping {client}: no config path detected.","cli.config.install.dry-run":"[dry-run] {client}: would write {path}","cli.config.install.wrote":"{client}: wrote {path}","cli.doctor.description":"Run Fabric target-state diagnostics.","cli.doctor.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.doctor.args.fix.description":"Repair deterministic derived Fabric state, including meta, rule-test index, bootstrap, and events ledger.","cli.doctor.args.json.description":"Print the doctor report as JSON.","cli.doctor.args.strict.description":"Treat warnings as failures.","cli.hooks.description":"Manage Fabric Git hook templates.","cli.hooks.install.description":"Install the Fabric Husky pre-commit hook template.","cli.hooks.install.args.target.description":"Target project path, default is the current working directory.","cli.hooks.errors.package-json-required":"package.json is required to install hooks: {path}","cli.hooks.install.hook-skipped":"Fabric hook already present in {path}, skipped.","cli.hooks.install.hook-appended":"Appended Fabric hook to existing {path}","cli.hooks.install.hook-created":"Created {path}","cli.hooks.install.prepare-left":"Left existing prepare script unchanged in {path}","cli.hooks.install.prepare-added":"Added prepare script to {path}","cli.human-lint.description":"Validate locked human-edit regions.","cli.human-lint.args.target.description":"Target project path, default is the current working directory.","cli.human-lint.drift-detected":"Human-locked content drift detected. Revert the edit or update approved hashes before committing.","cli.human-lint.table.location":"Location","cli.human-lint.table.expected":"Expected","cli.human-lint.table.got":"Got","cli.init.description":"Initialize Fabric in the target project.","cli.init.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.init.args.debug.description":"Print target resolution details to stderr.","cli.init.args.force.description":"Overwrite existing files (bypass non-destructive guard)","cli.init.args.yes.description":"Accept the current init plan and run without the TTY wizard","cli.init.args.plan.description":"Print the init plan without writing files or running follow-up stages","cli.init.args.reapply.description":"Reapply Fabric-managed files and stage installers over an existing setup","cli.init.args.no-bootstrap.description":"Compatibility flag: remove bootstrap from the init plan","cli.init.args.no-mcp.description":"Compatibility flag: remove MCP configuration from the init plan","cli.init.args.no-hooks.description":"Compatibility flag: remove git hooks from the init plan","cli.init.args.interactive.description":"Compatibility flag: disable the TTY wizard and use direct execution","cli.init.mcp.install.global":"Using globally-installed @fenglimg/fabric-server","cli.init.mcp.install.local":"Installing @fenglimg/fabric-server to project devDependencies","cli.init.mcp.install.prompt":"MCP server install scope (global|local)","cli.init.mcp.install.invalid":'Invalid --mcp-install value "{value}" — falling back to global',"cli.init.mcp.local.installing":"Running {manager} add -D @fenglimg/fabric-server...","cli.init.mcp.local.installed":"Installed to devDependencies","cli.init.created-path":"{label} {path}","cli.init.skipped-existing-path":"{label} {path}: already exists.","cli.init.force.overwritten":"Overwritten","cli.init.force.warning":"--force will overwrite existing Fabric artifacts in {path}","cli.init.stages.bootstrap":"Installing bootstrap templates...","cli.init.stages.mcp":"Configuring MCP clients...","cli.init.stages.hooks":"Installing git hooks...","cli.init.stages.skipped":"skipped","cli.init.stages.completed":"completed","cli.init.stages.failed":"failed","cli.init.stages.summary.ran":"ran","cli.init.stages.summary.skipped":"skipped","cli.init.stages.summary.failed":"failed","cli.init.next-step":"{label} {message}","cli.init.reason-message":"{label} {message}","cli.init.plan.title":"Fabric init plan","cli.init.plan.mode-banner.default":"[mode: apply] Standard init execution","cli.init.plan.mode-banner.plan":"[mode: plan] Dry run only, no files will be written","cli.init.plan.mode-banner.reapply":"[mode: reapply] Force reapplying Fabric-managed assets","cli.init.plan.mode-banner.plan-reapply":"[mode: plan+reapply] Previewing a forced reapply without writing files","cli.init.plan.target":"Target: {target}","cli.init.plan.actions":"Plan: bootstrap={bootstrap} mcp={mcp} hooks={hooks} mcp-install={mcpInstall}","cli.init.plan.detected":"Detected clients: {clients}","cli.init.plan.writes":"Core writes:","cli.init.plan.preview-title":"Fabric init dry run","cli.init.plan.preview-result":"Mode={mode} bootstrap={bootstrap} mcp={mcp} hooks={hooks}","cli.init.mode.default":"default","cli.init.mode.reapply":"reapply","cli.init.mode.badge.default":"APPLY","cli.init.mode.badge.plan":"PLAN","cli.init.mode.badge.reapply":"REAPPLY","cli.init.mode.badge.plan-reapply":"PLAN + REAPPLY","cli.init.compat.plan":"Using standard --plan mode: no files will be written.","cli.init.compat.interactive":"Compatibility: --interactive=false disables the TTY wizard.","cli.init.compat.legacy-stage-flags":"Compatibility: legacy --no-* flags are being mapped into the init plan.","cli.init.wizard.title":"Fabric init wizard","cli.init.wizard.intro":"Fabric init","cli.init.wizard.overview.title":"Install overview","cli.init.wizard.overview.body":`Target: {target}
7
- Mode: {mode}
8
- This wizard only reshapes the init plan; execution still runs through the existing Fabric init stages.`,"cli.init.wizard.step.target":"Confirm target","cli.init.wizard.step.plan":"Shape init plan","cli.init.wizard.step.review":"Review final plan","cli.init.wizard.target.confirm":"Continue initializing Fabric in {target}? [Y/n]","cli.init.wizard.stage.bootstrap":"Install bootstrap templates? [{defaultValue}]","cli.init.wizard.stage.mcp":"Configure MCP clients? [{defaultValue}]","cli.init.wizard.stage.hooks":"Install git hooks? [{defaultValue}]","cli.init.wizard.mcp-install":"MCP server install scope (global/local) [{defaultValue}]","cli.init.wizard.execute.confirm":"Execute this init plan now? [Y/n]","cli.init.wizard.outro":"Init plan accepted. Running Fabric init...","cli.init.wizard.invalid-yes-no":"Please answer yes or no.","cli.init.wizard.invalid-select":"Invalid value. Use one of: {options}.","cli.init.wizard.cancelled":"Fabric init cancelled before execution.","cli.init.capabilities.title":"Client capability summary","cli.init.capabilities.none":"No supported client was detected for bootstrap or MCP follow-up.","cli.init.capabilities.header.client":"Client","cli.init.capabilities.header.bootstrap":"Bootstrap","cli.init.capabilities.header.mcp":"MCP","cli.init.capabilities.header.hook":"Hook","cli.init.capabilities.header.skill":"Skill","cli.init.capabilities.header.follow-up":"Follow-up","cli.init.capabilities.status.ready":"ready","cli.init.capabilities.status.installed":"installed","cli.init.capabilities.status.supported":"supported","cli.init.capabilities.status.manual":"manual","cli.init.capabilities.status.skipped":"skipped","cli.init.capabilities.status.failed":"failed","cli.init.capabilities.status.na":"n/a","cli.init.capabilities.follow-up.ready":"continue in client","cli.init.capabilities.follow-up.install":"install client assets","cli.init.capabilities.follow-up.manual":"manual step required","cli.init.next-step.message":"run fab hooks install to add the Day 4 pre-commit pipeline.","cli.init.reason-message.claude-body":".fabric/forensic.json is ready; use the agents-md-init skill to finish internal Fabric initialization.","cli.init.reason-message.codex-body":".fabric/forensic.json is ready; continue with the repo skill at .agents/skills/fabric-init/SKILL.md and enable features.codex_hooks = true for Codex hooks.","cli.init.reason-message.multi-body":".fabric/forensic.json is ready; continue in your installed client flow: Claude can use agents-md-init, and Codex can use .agents/skills/fabric-init/SKILL.md with features.codex_hooks = true.","cli.init.reason-message.installable-body":".fabric/forensic.json is ready; some detected clients support Fabric follow-up but still need client assets installed.","cli.init.reason-message.manual-body":".fabric/forensic.json is ready; some detected clients still need manual follow-up because no Fabric skill is installed for them yet.","cli.init.codex-hooks.created":"{label} {path} with Codex hooks config (requires features.codex_hooks = true).","cli.init.codex-hooks.updated":"{label} {path} with Codex hooks config (requires features.codex_hooks = true).","cli.init.codex-hooks.skipped":"{label} {path}: Codex hooks config already present.","cli.init.claude-settings.created":"{label} {path} with Claude Stop hook.","cli.init.claude-settings.updated":"{label} {path} with Claude Stop hook.","cli.init.claude-settings.skipped":"{label} {path}: Claude Stop hook already present.","cli.init.claude-settings.skipped-invalid":"{label} {path}: unable to merge Claude Stop hook.","cli.init.claude-settings.invalid-object":"{label} {path}: expected a JSON object.","cli.init.claude-settings.invalid-json":"{label} {path}: invalid JSON ({reason}).","cli.init.claude-settings.invalid-hooks":'{label} {path}: "hooks" must be a JSON object.',"cli.init.claude-settings.invalid-stop-array":'{label} {path}: "hooks.Stop" must be an array.',"cli.init.errors.abort-existing":"ABORT: {path} already exists. fab init is non-destructive.","cli.ledger-append.description":"Append an entry to the Fabric intent ledger.","cli.ledger-append.args.target.description":"Target project path, default is the current working directory.","cli.ledger-append.args.staged.description":"Derive the entry from staged changes (used during pre-commit).","cli.ledger-append.requires-staged":"requires --staged in pre-commit context","cli.ledger-append.intent.auto":"auto: {head}{suffix}","cli.ledger-append.intent.auto-more":" +{count} more","cli.pre-commit.description":"Composite pre-commit hook: runs sync-meta --check-only, human-lint, and ledger-append --staged in one Node process.","cli.pre-commit.args.target.description":"Project root directory, defaults to cwd or EXTERNAL_FIXTURE_PATH.","cli.pre-commit.run-failed":"fabric pre-commit: {name} failed - {message}","cli.scan.description":"Scan the project to detect Fabric bootstrap candidates.","cli.scan.args.target.description":"Target absolute path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.scan.args.debug.description":"Print detection evidence in formatted output.","cli.scan.args.json.description":"Print the diagnostic report as JSON.","cli.scan.report.title":"Fabric scan report","cli.scan.report.target":"Target","cli.scan.report.framework":"Framework","cli.scan.report.evidence":"Evidence","cli.scan.report.readme-quality":"README quality","cli.scan.report.contributing":"CONTRIBUTING.md","cli.scan.report.files-counted":"Files counted","cli.scan.report.ignored-entries":"Ignored entries","cli.scan.report.existing-fabric":"Existing Fabric files","cli.scan.report.recommendations":"Recommendations:","cli.scan.readme-quality.ok":"ok","cli.scan.readme-quality.stub":"stub","cli.scan.recommendation.init":"L0: Run fab init to scaffold .fabric/bootstrap/README.md with TODO markers.","cli.scan.recommendation.readme":"L0: Expand README.md before promoting project facts into Fabric references.","cli.scan.recommendation.contributing":"L0: Add CONTRIBUTING.md or leave a bootstrap TODO reference for contribution flow.","cli.scan.recommendation.unknown-framework":"L1: Add tech-stack TODOs manually because no framework marker was detected.","cli.scan.recommendation.framework-dirs":"L1: Review {framework} directories for future scoped Fabric rule files.","cli.serve.description":"Start the local Fabric MCP HTTP service. Set FABRIC_AUTH_TOKEN to enable Bearer auth for non-localhost binding.","cli.serve.args.port.description":"Listen port, default 7373.","cli.serve.args.host.description":"Listen host, default 127.0.0.1. Set FABRIC_AUTH_TOKEN to enable Bearer auth for non-localhost binding.","cli.serve.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.serve.args.debug.description":"Print target resolution details to stderr.","cli.serve.ready.title":"Fabric Dashboard","cli.serve.warning.host-fallback":"--host {host} requires FABRIC_AUTH_TOKEN; falling back to 127.0.0.1 for safety","cli.serve.error.port-in-use":"Port {port} in use - try --port {nextPort}","cli.update.description":"Refresh MCP host configuration and git hooks without re-creating Fabric files.","cli.update.args.target.description":"Target project path. Defaults to CLI arg, EXTERNAL_FIXTURE_PATH, fabric.config.json, then cwd.","cli.update.args.no-mcp.description":"Skip re-configuring MCP clients","cli.update.args.no-hooks.description":"Skip re-installing git hooks","cli.sync-meta.description":"Sync Fabric metadata from internal rule files.","cli.sync-meta.args.target.description":"Target project path, default is the current working directory.","cli.sync-meta.args.check-only.description":"Exit with code 1 when .fabric/agents.meta.json is out of date.","cli.sync-meta.drift-detected":"Fabric metadata drift detected. Run fab sync-meta to update.","cli.sync-meta.updated":"{label} {path}","dashboard.app.nav.aria-label":"Dashboard views","dashboard.app.nav.readiness.label":"Readiness","dashboard.app.nav.readiness.label-bilingual":"准备情况 Readiness","dashboard.app.nav.readiness.subtitle":"project status","dashboard.app.nav.rules-explain.label":"Rules Explain","dashboard.app.nav.rules-explain.label-bilingual":"规则解析 Rules Explain","dashboard.app.nav.rules-explain.subtitle":"topology & context","dashboard.app.nav.timeline.label":"Timeline","dashboard.app.nav.timeline.label-bilingual":"时间线 Timeline","dashboard.app.nav.timeline.subtitle":"audit & history","dashboard.app.nav.health.label":"Health","dashboard.app.nav.health.label-bilingual":"系统健康 Health","dashboard.app.nav.health.subtitle":"doctor & diagnostics","dashboard.app.nav.section.insights":"Insights","dashboard.app.nav.drift-check":"Drift Check","dashboard.app.nav.modules.read-only":"read-only dashboard","dashboard.app.header.connected":"CONNECTED","dashboard.app.header.connecting":"CONNECTING","dashboard.app.live-region.received":"Received {type}","dashboard.app.breadcrumb.readiness":"readiness","dashboard.app.breadcrumb.rules-explain":"rules-explain","dashboard.app.breadcrumb.timeline":"timeline","dashboard.app.breadcrumb.health":"health","dashboard.rule-topology.title":"Rule Topology","dashboard.rule-topology.subtitle":"See which rules match the current path and why","dashboard.rule-topology.path.placeholder":"Sample path for rules context","dashboard.rule-topology.path.aria-label":"Rules context sample path","dashboard.rule-topology.status.sample":"current path {path}","dashboard.rule-topology.status.hits":"{count} hits","dashboard.rule-topology.status.revision":"version {revision}","dashboard.rule-topology.heatmap.title":"Coverage Heatmap","dashboard.rule-topology.heatmap.subtitle":"Heuristic directory coverage derived from scope_glob patterns","dashboard.rule-topology.heatmap.aria-label":"Directory coverage heatmap","dashboard.rule-topology.heatmap.count":"{count} directories","dashboard.rule-topology.heatmap.rules":"{count} rules","dashboard.rule-topology.heatmap.uncovered":"no matching scope","dashboard.rule-topology.heatmap.empty":"No rule directories available.","dashboard.rule-topology.heatmap.density.full":"covered","dashboard.rule-topology.heatmap.density.partial":"partial","dashboard.rule-topology.heatmap.density.none":"uncovered","dashboard.rule-topology.hit-reason.title":"Hit Reasons","dashboard.rule-topology.hit-reason.subtitle":"Why each rule was loaded for the current sample path","dashboard.rule-topology.hit-reason.aria-label":"Rule hit reasons","dashboard.rule-topology.hit-reason.count":"{count} reasons","dashboard.rule-topology.hit-reason.empty":"No rules loaded for this sample path.","dashboard.rule-topology.hit-reason.global":"Global","dashboard.rule-topology.hit-reason.tier.always":"Always-on","dashboard.rule-topology.hit-reason.tier.path":"Glob","dashboard.rule-topology.hit-reason.tier.description":"Description","dashboard.module-placeholder.coming-soon":"Reserved","dashboard.module-placeholder.read-only":"Reserved for future read-only dashboard capabilities.","dashboard.module-placeholder.forensic.title":"Cognitive Forensic","dashboard.module-placeholder.forensic.subtitle":"Coming later","dashboard.module-placeholder.semantic.title":"Semantic Timeline","dashboard.module-placeholder.semantic.subtitle":"Coming later","dashboard.module-placeholder.ledger.title":"Historical Ledger","dashboard.module-placeholder.ledger.subtitle":"Coming later","dashboard.rules-tree.title":"Rules Tree","dashboard.rules-tree.subtitle":"Browse the rule structure, hierarchy, and sync state from .fabric/agents.meta.json","dashboard.rules-tree.filter.placeholder":"Filter by file, glob, priority, hash...","dashboard.rules-tree.filter.aria-label":"Filter rules tree","dashboard.rules-tree.status.loading":"loading rules","dashboard.rules-tree.status.nodes":"{count} nodes · version {revision}","dashboard.rules-tree.status.locks":"{count} protected regions","dashboard.rules-tree.empty":"No matching rules found.","dashboard.rules-tree.tree.aria-label":"Fabric rules tree","dashboard.rules-tree.detail.title":"Node Detail","dashboard.rules-tree.detail.empty":"Select a rule node to inspect scope, dependencies, priority and hash.","dashboard.rules-tree.detail.file":"file","dashboard.rules-tree.detail.scope":"scope","dashboard.rules-tree.detail.priority":"priority","dashboard.rules-tree.detail.hash":"hash","dashboard.rules-tree.detail.no-deps":"no deps","dashboard.human-lock.title":"Human Protection","dashboard.human-lock.subtitle":"Review protected regions that require human confirmation","dashboard.human-lock.filters.aria-label":"Human lock filters","dashboard.human-lock.filters.all":"all","dashboard.human-lock.filters.drift":"drift","dashboard.human-lock.filters.approved":"approved","dashboard.human-lock.summary":"{drift} drift · {approved} confirmed","dashboard.human-lock.empty":"No human lock entries for this filter.","dashboard.intent-timeline.title":"Intent Timeline","dashboard.intent-timeline.subtitle":"Review AI and human change records in reverse chronological order","dashboard.intent-timeline.filter.label":"Source","dashboard.intent-timeline.filter.all":"All","dashboard.intent-timeline.summary":"AI {aiCount} · Human {humanCount}","dashboard.intent-timeline.columns.ai.title":"AI","dashboard.intent-timeline.columns.ai.entries":"{count} entries","dashboard.intent-timeline.columns.human.title":"Human","dashboard.intent-timeline.columns.human.entries":"{count} entries","dashboard.intent-timeline.empty":"No ledger entries found.","dashboard.intent-timeline.annotate.missing-id":"Cannot annotate a ledger entry without an id.","dashboard.history-replay.title":"History Replay","dashboard.history-replay.subtitle":"Review the rules tree state at any recorded point in history","dashboard.history-replay.toolbar.scrub":"Scrub","dashboard.history-replay.toolbar.latest":"Latest","dashboard.history-replay.selected.none":"No historical entry selected","dashboard.history-replay.status.replay-points":"{count} replay points","dashboard.history-replay.status.entries-applied":"{count} entries applied","dashboard.history-replay.empty.entries":"No ledger entries found for replay.","dashboard.history-replay.state.title":"Viewing state as of {label}","dashboard.history-replay.state.meta":"record {ledgerId} · commit {commit} · {mode}","dashboard.history-replay.status.loading":"loading snapshot","dashboard.history-replay.status.nodes":"{count} nodes","dashboard.history-replay.status.unknown-revision":"unknown version","dashboard.history-replay.tree.aria-label":"Historical Fabric rules tree","dashboard.history-replay.empty.loading":"Loading historical snapshot...","dashboard.history-replay.empty.select":"Select a timeline entry to replay its state.","dashboard.history-replay.meta.not-available":"unavailable","dashboard.history-replay.meta.pending":"pending","dashboard.history-replay.meta.na":"n/a","dashboard.doctor.title":"Doctor Console","dashboard.doctor.subtitle":"Check framework, entry points, version drift, and protected paths","dashboard.doctor.toolbar.overall":"Overall","dashboard.doctor.toolbar.no-summary":"No summary yet","dashboard.doctor.toolbar.entry-points-summary":"{framework} · {count} entry points","dashboard.doctor.toolbar.entry-point-summary":"{framework} · {count} entry point","dashboard.doctor.empty.loading":"Loading doctor report...","dashboard.doctor.summary.framework":"Framework","dashboard.doctor.summary.protected-paths":"Protected paths","dashboard.doctor.summary.intent-ledger":"Intent ledger","dashboard.doctor.summary.no-meta-revision":"No metadata version yet","dashboard.doctor.summary.tracked-paths.none":"No tracked paths","dashboard.doctor.summary.tracked-paths.some":"{count} tracked","dashboard.doctor.summary.hashes-intact":"All approved hashes intact","dashboard.doctor.summary.drifted":"{count} drifted","dashboard.doctor.summary.no-ledger-entries":"No ledger entries yet","dashboard.doctor.card.entry-points":"Entry points","dashboard.doctor.card.checks":"Checks","dashboard.doctor.empty.entry-points":"No current entry points detected.","dashboard.doctor.framework.unknown":"unknown","dashboard.doctor.age.none":"No entries","dashboard.doctor.age.seconds":"{count}s ago","dashboard.doctor.age.minutes":"{count}m ago","dashboard.doctor.age.hours":"{count}h ago","dashboard.doctor.age.days":"{count}d ago","dashboard.doctor.age.weeks":"{count}w ago","dashboard.shared.refresh":"Refresh","dashboard.shared.loading":"loading","dashboard.shared.status.ok":"ok","dashboard.shared.status.warn":"warn","dashboard.shared.status.error":"error","dashboard.shared.status.confirmed":"confirmed","dashboard.shared.status.hash-drift":"hash drift","dashboard.shared.status.stale":"stale","dashboard.shared.status.orphan":"orphan","dashboard.shared.status.attention":"attention","dashboard.source.ai":"AI","dashboard.source.human":"Human","dashboard.timeline-entry.aria-label":"{source} intent {intent}","dashboard.timeline-entry.working-tree":"working tree","dashboard.timeline-entry.parent":"parent {parent}","dashboard.timeline-entry.paths":"paths","dashboard.timeline-entry.annotate":"Annotate","dashboard.timeline-entry.annotation-label":"Human annotation","dashboard.timeline-entry.annotation-placeholder":"Explain review outcome or approval context...","dashboard.timeline-entry.annotation-save":"Save annotation","dashboard.tree-node.locked":"locked","dashboard.tree-node.stale.hash-mismatch":"hash mismatch","dashboard.tree-node.stale.orphan":"orphan","dashboard.lock-card.aria-label":"{file} {lineRange} {status}","dashboard.lock-card.status.drift":"hash drift","dashboard.lock-card.status.confirmed":"confirmed","dashboard.lock-card.hash.locked":"locked hash","dashboard.lock-card.hash.current":"current hash","dashboard.lock-card.hash.diff":"diff","dashboard.lock-card.preview.drift":"DRIFT","dashboard.lock-card.preview.sync":"SYNC","dashboard.lock-card.preview.drift-detail":"Hash differs from protected region.","dashboard.lock-card.preview.sync-detail":"Protected region is in sync.","dashboard.lock-card.footer.region":"protected region · {count} lines","dashboard.lock-card.button.approve":"Approve new hash","dashboard.lock-card.button.confirmed":"Confirmed","dashboard.lock-card.diff.hash-mismatch":"hash mismatch","dashboard.lock-card.diff.no-changes":"no changes","dashboard.lock-card.diff.with-bytes":"+{added} / -{removed} · {bytes} bytes","dashboard.lock-card.diff.without-bytes":"+{added} / -{removed}","dashboard.approve-button.retry":"Retry","dashboard.readiness.filter.analysis":"Project Analysis","dashboard.readiness.loading":"Loading scan data...","dashboard.readiness.summary.framework":"Framework","dashboard.readiness.summary.files":"Files","dashboard.readiness.summary.status":"Fabric Status","dashboard.readiness.card.evidence":"Readiness Evidence","dashboard.readiness.card.recommendations":"Recommendations & Next Steps","dashboard.readiness.readme.description":"Quality of project documentation","dashboard.readiness.contributing.description":"Contribution guidelines for AI/Human","dashboard.readiness.fully-ready":"Project is fully ready.","dashboard.readiness.init-prompt":"Run this command to initialize:","dashboard.rules-explain.analyze":"Analyze Path","dashboard.rules-explain.detail.topology-type":"Topology Type","dashboard.timeline.history-replay.title":"History Replay","dashboard.timeline.close":"Close","dashboard.health.ledger-path.label":"Event Ledger Path","dashboard.health.ledger-path.detail":"Append-only timeline source","dashboard.health.boundary.title":"Control Plane Boundaries","dashboard.health.boundary.description":"The Web Dashboard operates as a Viewer. All rules, metadata, and fixes must be managed via the CLI.","dashboard.health.boundary.cli-action":"CLI Action Required:","dashboard.health.boundary.cli-prompt":"You have {count} fixable issues. Run the following command in your terminal to repair metadata automatically.","dashboard.health.runtime.connected":"MCP Runtime Connected","dashboard.health.runtime.disconnected":"MCP Runtime Disconnected"},Va={"cli.main.description":"Fabric CLI - AI 智能体协作框架","cli.shared.created":"已创建","cli.shared.skipped":"已跳过","cli.shared.next":"下一步","cli.shared.reason":"原因","cli.shared.updated":"已更新","cli.shared.missing":"缺失","cli.shared.present":"存在","cli.shared.absent":"缺失","cli.shared.yes":"是","cli.shared.no":"否","cli.shared.none":"无","cli.shared.loading":"加载中","cli.shared.refresh":"刷新","cli.shared.target-invalid":"目标必须是已存在的目录:{target}","cli.shared.template-not-found":"未找到模板:{path}","cli.shared.invalid-host-empty":"无效 host:<empty>","cli.shared.invalid-port":"无效端口:{value}","cli.approve.description":"从命令行批准已漂移的 human-lock 记录。","cli.approve.args.all.description":"不提示,批准所有已漂移的 human-lock 记录。","cli.approve.args.interactive.description":"逐条提示后批准已漂移的 human-lock 记录。","cli.approve.args.target.description":"目标项目路径,默认为当前工作目录。","cli.approve.no-drift":"未发现漂移记录。","cli.approve.prompt":"批准此记录?[y/N] ","cli.approve.approved-one":"已批准 {location}","cli.approve.skipped-one":"已跳过 {location}","cli.approve.summary":"已批准 {approved}/{total} 条漂移记录。已跳过 {skipped} 条。","cli.approve.table.expected":"预期","cli.approve.table.current":"当前","cli.bootstrap.description":"为支持的 AI 客户端安装 Fabric 引导提示模板。","cli.bootstrap.install.description":"将 Fabric 引导模板复制到各客户端的原生位置。","cli.bootstrap.install.args.clients.description":"可选的逗号分隔客户端过滤器,例如 claude,cursor,codex。","cli.bootstrap.install.no-targets":"未检测到可安装的 bootstrap 目标。可显式传入 --clients claude,cursor,windsurf,roo,gemini,codex。","cli.bootstrap.install.installed":"已安装 {path}","cli.bootstrap.install.skipped-header":"已跳过 {path}:Fabric Bootstrap 头部已存在。","cli.bootstrap.install.prepended":"已前置写入 {path}","cli.bootstrap.errors.unknown-client":"未知客户端“{client}”。请使用逗号分隔列表,例如 claude,cursor,codex。","cli.config.description":"管理 Fabric MCP 客户端配置。","cli.config.clients.claude":"Claude Code CLI","cli.config.install.description":"将 Fabric MCP 服务端条目安装到检测到的客户端配置中。","cli.config.install.args.clients.description":"可选的逗号分隔客户端过滤器,例如 cursor,codex,gemini。","cli.config.install.args.dry-run.description":"仅预览将要发生的写入操作,不修改文件。","cli.config.errors.unknown-client":"未知客户端“{client}”。请使用逗号分隔列表,例如 cursor,codex,gemini。","cli.config.errors.expected-object":"{path} 中应为对象。","cli.config.install.no-configs":"未检测到 Fabric MCP 客户端配置。请创建客户端目录,或在 fabric.config.json 中设置 clientPaths。","cli.config.install.no-config-path":"跳过 {client}:未检测到配置路径。","cli.config.install.dry-run":"[dry-run] {client}:将写入 {path}","cli.config.install.wrote":"{client}:已写入 {path}","cli.doctor.description":"运行 Fabric 目标态诊断。","cli.doctor.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.doctor.args.fix.description":"修复确定性派生的 Fabric 状态,包括 meta、rule-test index、bootstrap 和 events ledger。","cli.doctor.args.json.description":"以 JSON 输出 doctor 报告。","cli.doctor.args.strict.description":"将 warning 也视为失败。","cli.hooks.description":"管理 Fabric Git 钩子模板。","cli.hooks.install.description":"安装 Fabric Husky pre-commit 钩子模板。","cli.hooks.install.args.target.description":"目标项目路径,默认为当前工作目录。","cli.hooks.errors.package-json-required":"安装 hooks 需要 package.json:{path}","cli.hooks.install.hook-skipped":"{path} 中已存在 Fabric hook,已跳过。","cli.hooks.install.hook-appended":"已向现有 {path} 追加 Fabric hook","cli.hooks.install.hook-created":"已创建 {path}","cli.hooks.install.prepare-left":"保留 {path} 中原有的 prepare 脚本不变","cli.hooks.install.prepare-added":"已向 {path} 添加 prepare 脚本","cli.human-lint.description":"验证锁定的人工编辑区块。","cli.human-lint.args.target.description":"目标项目路径,默认为当前工作目录。","cli.human-lint.drift-detected":"检测到 human-lock 内容漂移。请回退编辑,或在提交前更新已批准的哈希。","cli.human-lint.table.location":"位置","cli.human-lint.table.expected":"预期","cli.human-lint.table.got":"实际","cli.init.description":"在目标项目中初始化 Fabric。","cli.init.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.init.args.debug.description":"将目标解析细节输出到 stderr。","cli.init.args.force.description":"覆盖现有文件(绕过非破坏性保护)","cli.init.args.yes.description":"接受当前初始化计划并跳过 TTY 向导直接执行","cli.init.args.plan.description":"仅输出初始化计划,不写文件也不执行后续阶段","cli.init.args.reapply.description":"在已有 setup 上重新应用 Fabric 管理的文件和阶段安装器","cli.init.args.no-bootstrap.description":"兼容标志:从初始化计划中移除 bootstrap","cli.init.args.no-mcp.description":"兼容标志:从初始化计划中移除 MCP 配置","cli.init.args.no-hooks.description":"兼容标志:从初始化计划中移除 git hooks","cli.init.args.interactive.description":"兼容标志:禁用 TTY 向导并直接执行","cli.init.mcp.install.global":"使用全局安装的 @fenglimg/fabric-server","cli.init.mcp.install.local":"将 @fenglimg/fabric-server 安装到项目 devDependencies","cli.init.mcp.install.prompt":"MCP 服务端安装范围(global|local)","cli.init.mcp.install.invalid":"无效的 --mcp-install 值“{value}”,将回退到 global","cli.init.mcp.local.installing":"正在运行 {manager} add -D @fenglimg/fabric-server...","cli.init.mcp.local.installed":"已安装到 devDependencies","cli.init.created-path":"{label} {path}","cli.init.skipped-existing-path":"{label} {path}:已存在。","cli.init.force.overwritten":"已覆盖","cli.init.force.warning":"--force 将覆盖 {path} 中现有的 Fabric 产物","cli.init.stages.bootstrap":"正在安装 bootstrap 模板...","cli.init.stages.mcp":"正在配置 MCP 客户端...","cli.init.stages.hooks":"正在安装 git hooks...","cli.init.stages.skipped":"已跳过","cli.init.stages.completed":"已完成","cli.init.stages.failed":"失败","cli.init.stages.summary.ran":"已执行","cli.init.stages.summary.skipped":"已跳过","cli.init.stages.summary.failed":"失败","cli.init.next-step":"{label} {message}","cli.init.reason-message":"{label} {message}","cli.init.plan.title":"Fabric 初始化计划","cli.init.plan.mode-banner.default":"[mode: apply] 标准初始化执行","cli.init.plan.mode-banner.plan":"[mode: plan] 仅预览,不会写入文件","cli.init.plan.mode-banner.reapply":"[mode: reapply] 将强制重新应用 Fabric 管理资产","cli.init.plan.mode-banner.plan-reapply":"[mode: plan+reapply] 正在预览一次强制 reapply,不会写入文件","cli.init.plan.target":"目标:{target}","cli.init.plan.actions":"计划:bootstrap={bootstrap} mcp={mcp} hooks={hooks} mcp-install={mcpInstall}","cli.init.plan.detected":"检测到的客户端:{clients}","cli.init.plan.writes":"核心写入:","cli.init.plan.preview-title":"Fabric 初始化 dry run","cli.init.plan.preview-result":"模式={mode} bootstrap={bootstrap} mcp={mcp} hooks={hooks}","cli.init.mode.default":"default","cli.init.mode.reapply":"reapply","cli.init.mode.badge.default":"APPLY","cli.init.mode.badge.plan":"PLAN","cli.init.mode.badge.reapply":"REAPPLY","cli.init.mode.badge.plan-reapply":"PLAN + REAPPLY","cli.init.compat.plan":"已启用标准 --plan 模式:不会写入任何文件。","cli.init.compat.interactive":"兼容提示:--interactive=false 会禁用 TTY 向导。","cli.init.compat.legacy-stage-flags":"兼容提示:旧的 --no-* 标志正在映射到初始化计划中。","cli.init.wizard.title":"Fabric 初始化向导","cli.init.wizard.intro":"Fabric init","cli.init.wizard.overview.title":"安装概览","cli.init.wizard.overview.body":`目标:{target}
9
- 模式:{mode}
10
- 这个向导只负责调整初始化计划;真正执行仍然走现有的 Fabric init 阶段。`,"cli.init.wizard.step.target":"确认目标","cli.init.wizard.step.plan":"配置初始化计划","cli.init.wizard.step.review":"复核最终计划","cli.init.wizard.target.confirm":"确认在 {target} 中继续初始化 Fabric?[Y/n]","cli.init.wizard.stage.bootstrap":"是否安装 bootstrap 模板?[{defaultValue}]","cli.init.wizard.stage.mcp":"是否配置 MCP 客户端?[{defaultValue}]","cli.init.wizard.stage.hooks":"是否安装 git hooks?[{defaultValue}]","cli.init.wizard.mcp-install":"MCP 服务端安装范围(global/local)[{defaultValue}]","cli.init.wizard.execute.confirm":"现在执行该初始化计划?[Y/n]","cli.init.wizard.outro":"初始化计划已确认,开始执行 Fabric init...","cli.init.wizard.invalid-yes-no":"请输入 yes 或 no。","cli.init.wizard.invalid-select":"无效输入。可选值:{options}。","cli.init.wizard.cancelled":"Fabric 初始化已在执行前取消。","cli.init.capabilities.title":"客户端能力摘要","cli.init.capabilities.none":"没有检测到可用于 bootstrap 或 MCP 后续接力的受支持客户端。","cli.init.capabilities.header.client":"客户端","cli.init.capabilities.header.bootstrap":"Bootstrap","cli.init.capabilities.header.mcp":"MCP","cli.init.capabilities.header.hook":"Hook","cli.init.capabilities.header.skill":"Skill","cli.init.capabilities.header.follow-up":"后续动作","cli.init.capabilities.status.ready":"已就绪","cli.init.capabilities.status.installed":"已安装","cli.init.capabilities.status.supported":"已支持","cli.init.capabilities.status.manual":"手动处理","cli.init.capabilities.status.skipped":"已跳过","cli.init.capabilities.status.failed":"失败","cli.init.capabilities.status.na":"不适用","cli.init.capabilities.follow-up.ready":"可在客户端继续","cli.init.capabilities.follow-up.install":"安装客户端资产","cli.init.capabilities.follow-up.manual":"需要手动后续处理","cli.init.next-step.message":"运行 fab hooks install 以添加第 4 天的 pre-commit 流水线。","cli.init.reason-message.claude-body":".fabric/forensic.json 已就绪;请使用 agents-md-init skill 完成 Fabric 内部初始化。","cli.init.reason-message.codex-body":".fabric/forensic.json 已就绪;请继续使用仓库内的 .agents/skills/fabric-init/SKILL.md,并为 Codex hooks 启用 features.codex_hooks = true。","cli.init.reason-message.multi-body":".fabric/forensic.json 已就绪;请按已安装客户端继续后续流程:Claude 使用 agents-md-init,Codex 使用 .agents/skills/fabric-init/SKILL.md,并启用 features.codex_hooks = true。","cli.init.reason-message.installable-body":".fabric/forensic.json 已就绪;部分已检测到的客户端已支持 Fabric 后续接力,但仍需安装客户端资产。","cli.init.reason-message.manual-body":".fabric/forensic.json 已就绪;部分已检测到的客户端尚未安装 Fabric skill,需要手动完成后续初始化。","cli.init.codex-hooks.created":"{label} {path},并写入 Codex hooks 配置(需启用 features.codex_hooks = true)。","cli.init.codex-hooks.updated":"{label} {path},并写入 Codex hooks 配置(需启用 features.codex_hooks = true)。","cli.init.codex-hooks.skipped":"{label} {path}:Codex hooks 配置已存在。","cli.init.claude-settings.created":"{label} {path},并写入 Claude Stop hook。","cli.init.claude-settings.updated":"{label} {path},并写入 Claude Stop hook。","cli.init.claude-settings.skipped":"{label} {path}:Claude Stop hook 已存在。","cli.init.claude-settings.skipped-invalid":"{label} {path}:无法合并 Claude Stop hook。","cli.init.claude-settings.invalid-object":"{label} {path}:预期为 JSON 对象。","cli.init.claude-settings.invalid-json":"{label} {path}:JSON 无效({reason})。","cli.init.claude-settings.invalid-hooks":'{label} {path}:"hooks" 必须是 JSON 对象。',"cli.init.claude-settings.invalid-stop-array":'{label} {path}:"hooks.Stop" 必须是数组。',"cli.init.errors.abort-existing":"中止:{path} 已存在。fab init 是非破坏性的。","cli.ledger-append.description":"向 Fabric 意图日志追加一条记录。","cli.ledger-append.args.target.description":"目标项目路径,默认为当前工作目录。","cli.ledger-append.args.staged.description":"从暂存变更推导记录(用于 pre-commit 阶段)。","cli.ledger-append.requires-staged":"pre-commit 场景下必须传入 --staged","cli.ledger-append.intent.auto":"自动:{head}{suffix}","cli.ledger-append.intent.auto-more":" 等 {count} 项","cli.pre-commit.description":"复合 pre-commit 钩子:在单个 Node 进程中依次执行 sync-meta --check-only、human-lint、ledger-append --staged。","cli.pre-commit.args.target.description":"项目根目录,默认取当前目录或 EXTERNAL_FIXTURE_PATH。","cli.pre-commit.run-failed":"fabric pre-commit:{name} 失败 - {message}","cli.scan.description":"扫描项目以检测 Fabric 引导候选模块。","cli.scan.args.target.description":"目标绝对路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.scan.args.debug.description":"以格式化输出打印检测证据。","cli.scan.args.json.description":"以 JSON 格式输出诊断报告。","cli.scan.report.title":"Fabric 扫描报告","cli.scan.report.target":"目标","cli.scan.report.framework":"框架","cli.scan.report.evidence":"证据","cli.scan.report.readme-quality":"README 质量","cli.scan.report.contributing":"CONTRIBUTING.md","cli.scan.report.files-counted":"文件数","cli.scan.report.ignored-entries":"忽略项","cli.scan.report.existing-fabric":"现有 Fabric 文件","cli.scan.report.recommendations":"建议:","cli.scan.readme-quality.ok":"良好","cli.scan.readme-quality.stub":"草稿","cli.scan.recommendation.init":"L0:运行 fab init,在 .fabric/bootstrap/README.md 生成带 TODO 标记的初始说明。","cli.scan.recommendation.readme":"L0:先补充 README.md,再把项目事实整理到 Fabric 参考文件中。","cli.scan.recommendation.contributing":"L0:添加 CONTRIBUTING.md,或在 bootstrap 中留下贡献流程的 TODO 说明。","cli.scan.recommendation.unknown-framework":"L1:当前未检测到框架标记,需要手动补充技术栈说明。","cli.scan.recommendation.framework-dirs":"L1:检查 {framework} 目录,后续为其补充对应作用域的 Fabric 规则文件。","cli.serve.description":"启动本地 Fabric MCP HTTP 服务。若需绑定到非 localhost,请设置 FABRIC_AUTH_TOKEN 以启用 Bearer 鉴权。","cli.serve.args.port.description":"监听端口,默认 7373。","cli.serve.args.host.description":"监听主机,默认 127.0.0.1。若需绑定到非 localhost,请设置 FABRIC_AUTH_TOKEN 以启用 Bearer 鉴权。","cli.serve.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.serve.args.debug.description":"将目标解析细节输出到 stderr。","cli.serve.ready.title":"Fabric 仪表盘","cli.serve.warning.host-fallback":"--host {host} 需要 FABRIC_AUTH_TOKEN;为安全起见已回退到 127.0.0.1","cli.serve.error.port-in-use":"端口 {port} 已被占用,可尝试 --port {nextPort}","cli.update.description":"刷新 MCP 主机配置和 git hooks,不重新创建 Fabric 文件。","cli.update.args.target.description":"目标项目路径。默认依次使用 CLI 参数、EXTERNAL_FIXTURE_PATH、fabric.config.json、当前目录。","cli.update.args.no-mcp.description":"跳过重新配置 MCP 客户端","cli.update.args.no-hooks.description":"跳过重新安装 git hooks","cli.sync-meta.description":"从内部规则文件同步 Fabric 元数据。","cli.sync-meta.args.target.description":"目标项目路径,默认为当前工作目录。","cli.sync-meta.args.check-only.description":"如果 .fabric/agents.meta.json 已过期,则以代码 1 退出。","cli.sync-meta.drift-detected":"检测到 Fabric 元数据漂移。请运行 fab sync-meta 进行更新。","cli.sync-meta.updated":"{label} {path}","dashboard.app.nav.aria-label":"仪表盘视图导航","dashboard.app.nav.readiness.label":"准备情况","dashboard.app.nav.readiness.label-bilingual":"准备情况 Readiness","dashboard.app.nav.readiness.subtitle":"项目状态","dashboard.app.nav.rules-explain.label":"规则解析","dashboard.app.nav.rules-explain.label-bilingual":"规则解析 Rules Explain","dashboard.app.nav.rules-explain.subtitle":"拓扑与上下文","dashboard.app.nav.timeline.label":"时间线","dashboard.app.nav.timeline.label-bilingual":"时间线 Timeline","dashboard.app.nav.timeline.subtitle":"审计与历史","dashboard.app.nav.health.label":"系统健康","dashboard.app.nav.health.label-bilingual":"系统健康 Health","dashboard.app.nav.health.subtitle":"诊断台","dashboard.app.nav.section.insights":"洞察","dashboard.app.nav.drift-check":"漂移检查","dashboard.app.nav.modules.read-only":"只读仪表盘","dashboard.app.header.connected":"已连接","dashboard.app.header.connecting":"连接中","dashboard.app.live-region.received":"已收到 {type}","dashboard.app.breadcrumb.readiness":"readiness","dashboard.app.breadcrumb.rules-explain":"rules-explain","dashboard.app.breadcrumb.timeline":"timeline","dashboard.app.breadcrumb.health":"health","dashboard.rule-topology.title":"规则命中","dashboard.rule-topology.subtitle":"查看当前路径会命中哪些规则,以及为什么会命中","dashboard.rule-topology.path.placeholder":"用于规则上下文的样本路径","dashboard.rule-topology.path.aria-label":"规则上下文样本路径","dashboard.rule-topology.status.sample":"当前路径 {path}","dashboard.rule-topology.status.hits":"{count} 条命中","dashboard.rule-topology.status.revision":"版本 {revision}","dashboard.rule-topology.heatmap.title":"覆盖热力图","dashboard.rule-topology.heatmap.subtitle":"基于 scope_glob 模式推导的目录覆盖情况","dashboard.rule-topology.heatmap.aria-label":"目录覆盖热力图","dashboard.rule-topology.heatmap.count":"{count} 个目录","dashboard.rule-topology.heatmap.rules":"{count} 条规则","dashboard.rule-topology.heatmap.uncovered":"没有匹配作用域","dashboard.rule-topology.heatmap.empty":"当前没有可显示的规则目录。","dashboard.rule-topology.heatmap.density.full":"已覆盖","dashboard.rule-topology.heatmap.density.partial":"部分覆盖","dashboard.rule-topology.heatmap.density.none":"未覆盖","dashboard.rule-topology.hit-reason.title":"命中原因","dashboard.rule-topology.hit-reason.subtitle":"显示当前样本路径为何命中这些规则","dashboard.rule-topology.hit-reason.aria-label":"规则命中原因","dashboard.rule-topology.hit-reason.count":"{count} 条原因","dashboard.rule-topology.hit-reason.empty":"当前样本路径没有加载到规则。","dashboard.rule-topology.hit-reason.global":"全局","dashboard.rule-topology.hit-reason.tier.always":"常驻","dashboard.rule-topology.hit-reason.tier.path":"Glob","dashboard.rule-topology.hit-reason.tier.description":"描述","dashboard.module-placeholder.coming-soon":"功能预留","dashboard.module-placeholder.read-only":"为后续只读仪表盘能力预留。","dashboard.module-placeholder.forensic.title":"认知扫描","dashboard.module-placeholder.forensic.subtitle":"后续补充","dashboard.module-placeholder.semantic.title":"语义时间线","dashboard.module-placeholder.semantic.subtitle":"后续补充","dashboard.module-placeholder.ledger.title":"历史记录","dashboard.module-placeholder.ledger.subtitle":"后续补充","dashboard.rules-tree.title":"规则树","dashboard.rules-tree.subtitle":"查看 .fabric/agents.meta.json 中的规则结构、层级和同步状态","dashboard.rules-tree.filter.placeholder":"按文件、作用域、优先级、哈希过滤...","dashboard.rules-tree.filter.aria-label":"过滤规则树","dashboard.rules-tree.status.loading":"规则加载中","dashboard.rules-tree.status.nodes":"{count} 个节点 · 版本 {revision}","dashboard.rules-tree.status.locks":"{count} 个受保护区域","dashboard.rules-tree.empty":"没有匹配的规则。","dashboard.rules-tree.tree.aria-label":"Fabric 规则树","dashboard.rules-tree.detail.title":"节点详情","dashboard.rules-tree.detail.empty":"选择一个规则节点以查看作用域、依赖、优先级和哈希。","dashboard.rules-tree.detail.file":"文件","dashboard.rules-tree.detail.scope":"作用域","dashboard.rules-tree.detail.priority":"优先级","dashboard.rules-tree.detail.hash":"哈希","dashboard.rules-tree.detail.no-deps":"无依赖","dashboard.human-lock.title":"人工保护","dashboard.human-lock.subtitle":"查看需要人工确认的受保护区域","dashboard.human-lock.filters.aria-label":"人工保护过滤器","dashboard.human-lock.filters.all":"全部","dashboard.human-lock.filters.drift":"漂移","dashboard.human-lock.filters.approved":"已批准","dashboard.human-lock.summary":"{drift} 处漂移 · {approved} 项已确认","dashboard.human-lock.empty":"当前过滤条件下没有受保护记录。","dashboard.intent-timeline.title":"意图时间线","dashboard.intent-timeline.subtitle":"查看 AI 与人工留下的变更记录,按时间倒序排列","dashboard.intent-timeline.filter.label":"来源","dashboard.intent-timeline.filter.all":"全部","dashboard.intent-timeline.summary":"AI {aiCount} · Human {humanCount}","dashboard.intent-timeline.columns.ai.title":"AI","dashboard.intent-timeline.columns.ai.entries":"{count} 条记录","dashboard.intent-timeline.columns.human.title":"人工","dashboard.intent-timeline.columns.human.entries":"{count} 条记录","dashboard.intent-timeline.empty":"没有找到日志记录。","dashboard.intent-timeline.annotate.missing-id":"缺少 id,无法为这条日志添加注释。","dashboard.history-replay.title":"历史回放","dashboard.history-replay.subtitle":"按历史记录回看当时的规则树状态","dashboard.history-replay.toolbar.scrub":"拖动","dashboard.history-replay.toolbar.latest":"最新","dashboard.history-replay.selected.none":"尚未选择历史记录","dashboard.history-replay.status.replay-points":"{count} 个回放点","dashboard.history-replay.status.entries-applied":"已应用 {count} 条记录","dashboard.history-replay.empty.entries":"没有可用于回放的日志记录。","dashboard.history-replay.state.title":"查看 {label} 时刻的状态","dashboard.history-replay.state.meta":"记录 {ledgerId} · 提交 {commit} · {mode}","dashboard.history-replay.status.loading":"快照加载中","dashboard.history-replay.status.nodes":"{count} 个节点","dashboard.history-replay.status.unknown-revision":"未知版本","dashboard.history-replay.tree.aria-label":"历史 Fabric 规则树","dashboard.history-replay.empty.loading":"正在加载历史快照...","dashboard.history-replay.empty.select":"请选择一条时间线记录以回放其状态。","dashboard.history-replay.meta.not-available":"不可用","dashboard.history-replay.meta.pending":"等待中","dashboard.history-replay.meta.na":"无","dashboard.doctor.title":"诊断控制台","dashboard.doctor.subtitle":"查看框架、入口点、版本漂移和受保护路径的状态","dashboard.doctor.toolbar.overall":"整体状态","dashboard.doctor.toolbar.no-summary":"暂无摘要","dashboard.doctor.toolbar.entry-points-summary":"{framework} · {count} 个入口点","dashboard.doctor.toolbar.entry-point-summary":"{framework} · {count} 个入口点","dashboard.doctor.empty.loading":"正在加载 doctor 报告...","dashboard.doctor.summary.framework":"框架","dashboard.doctor.summary.protected-paths":"受保护路径","dashboard.doctor.summary.intent-ledger":"意图日志","dashboard.doctor.summary.no-meta-revision":"暂无元数据版本","dashboard.doctor.summary.tracked-paths.none":"没有跟踪路径","dashboard.doctor.summary.tracked-paths.some":"已跟踪 {count} 项","dashboard.doctor.summary.hashes-intact":"所有已批准哈希均完好","dashboard.doctor.summary.drifted":"{count} 项发生漂移","dashboard.doctor.summary.no-ledger-entries":"暂无日志记录","dashboard.doctor.card.entry-points":"入口点","dashboard.doctor.card.checks":"检查项","dashboard.doctor.empty.entry-points":"当前未检测到入口点。","dashboard.doctor.framework.unknown":"未知","dashboard.doctor.age.none":"暂无记录","dashboard.doctor.age.seconds":"{count} 秒前","dashboard.doctor.age.minutes":"{count} 分钟前","dashboard.doctor.age.hours":"{count} 小时前","dashboard.doctor.age.days":"{count} 天前","dashboard.doctor.age.weeks":"{count} 周前","dashboard.shared.refresh":"刷新","dashboard.shared.loading":"加载中","dashboard.shared.status.ok":"正常","dashboard.shared.status.warn":"警告","dashboard.shared.status.error":"错误","dashboard.shared.status.confirmed":"已确认","dashboard.shared.status.hash-drift":"哈希漂移","dashboard.shared.status.stale":"过期","dashboard.shared.status.orphan":"孤立","dashboard.shared.status.attention":"注意","dashboard.source.ai":"AI","dashboard.source.human":"人工","dashboard.timeline-entry.aria-label":"{source} 意图 {intent}","dashboard.timeline-entry.working-tree":"工作区","dashboard.timeline-entry.parent":"父提交 {parent}","dashboard.timeline-entry.paths":"路径","dashboard.timeline-entry.annotate":"添加注释","dashboard.timeline-entry.annotation-label":"人工注释","dashboard.timeline-entry.annotation-placeholder":"说明审核结论或批准背景...","dashboard.timeline-entry.annotation-save":"保存注释","dashboard.tree-node.locked":"已锁定","dashboard.tree-node.stale.hash-mismatch":"哈希不匹配","dashboard.tree-node.stale.orphan":"孤立","dashboard.lock-card.aria-label":"{file} {lineRange} {status}","dashboard.lock-card.status.drift":"哈希漂移","dashboard.lock-card.status.confirmed":"已确认","dashboard.lock-card.hash.locked":"锁定哈希","dashboard.lock-card.hash.current":"当前哈希","dashboard.lock-card.hash.diff":"差异","dashboard.lock-card.preview.drift":"漂移","dashboard.lock-card.preview.sync":"同步","dashboard.lock-card.preview.drift-detail":"哈希与受保护区域不一致。","dashboard.lock-card.preview.sync-detail":"受保护区域当前保持同步。","dashboard.lock-card.footer.region":"受保护区域 · {count} 行","dashboard.lock-card.button.approve":"批准新哈希","dashboard.lock-card.button.confirmed":"已确认","dashboard.lock-card.diff.hash-mismatch":"哈希不一致","dashboard.lock-card.diff.no-changes":"无变更","dashboard.lock-card.diff.with-bytes":"+{added} / -{removed} · {bytes} 字节","dashboard.lock-card.diff.without-bytes":"+{added} / -{removed}","dashboard.approve-button.retry":"重试","dashboard.readiness.filter.analysis":"项目分析","dashboard.readiness.loading":"正在加载扫描数据...","dashboard.readiness.summary.framework":"框架","dashboard.readiness.summary.files":"文件","dashboard.readiness.summary.status":"Fabric 状态","dashboard.readiness.card.evidence":"准备情况凭证","dashboard.readiness.card.recommendations":"建议与后续步骤","dashboard.readiness.readme.description":"项目文档的质量","dashboard.readiness.contributing.description":"AI与人类协作的贡献指南","dashboard.readiness.fully-ready":"项目已完全准备就绪。","dashboard.readiness.init-prompt":"运行此命令进行初始化:","dashboard.rules-explain.analyze":"分析路径","dashboard.rules-explain.detail.topology-type":"拓扑类型","dashboard.timeline.history-replay.title":"历史回放","dashboard.timeline.close":"关闭","dashboard.health.ledger-path.label":"事件账本路径","dashboard.health.ledger-path.detail":"只能追加写入的时间线数据源","dashboard.health.boundary.title":"控制平面边界","dashboard.health.boundary.description":"Web 控制台作为纯查看器 (Viewer) 运行。所有规则、元数据和修复操作都必须通过 CLI 进行管理。","dashboard.health.boundary.cli-action":"需要执行 CLI 操作:","dashboard.health.boundary.cli-prompt":"检测到 {count} 个可修复的问题。请在终端中运行以下命令以自动修复元数据。","dashboard.health.runtime.connected":"MCP 运行时已连接","dashboard.health.runtime.disconnected":"MCP 运行时已断开"},Wa={en:Ba,"zh-CN":Va};function qa(t,e=Wa){const r=e[t]??e.en,a=e.en;return(i,n)=>{const o=r[i]??a[i]??i;return n===void 0?o:Object.entries(n).reduce((d,[c,l])=>d.replaceAll(`{${c}}`,l),o)}}function Xa(t){if(typeof t!="string")return"en";const e=t.trim().toLowerCase().replace(/\..*$/,"").replace(/_/g,"-");return e.length===0?"en":e==="zh"||e.startsWith("zh-")?"zh-CN":"en"}function Ya(){return typeof navigator<"u"&&typeof navigator.language=="string"?Xa(navigator.language):"en"}function Ga(t=Ya()){return{locale:t,t:qa(t)}}const Wr=ga(null);function Ja({children:t}){const e=ne(()=>Ga(),[]);return s(Wr.Provider,{value:e,children:t})}function G(){const t=ya(Wr);if(t===null)throw new Error("useI18n must be used within an I18nProvider.");return t}const Ka={ok:"dashboard.shared.status.confirmed",drift:"dashboard.shared.status.hash-drift",stale:"dashboard.shared.status.stale",orphan:"dashboard.shared.status.orphan",locked:"dashboard.shared.status.attention"};function se({kind:t,severity:e,message:r,diffStats:a}){const{t:i}=G();if(e==="ok"&&t==="dot")return null;const n=r??i(Ka[e]),o=a===void 0?"":` +${a.added} / -${a.removed}`,d="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold font-mono tracking-widest uppercase border",c="flex items-center gap-2 p-3 rounded-lg text-sm font-medium border shadow-sm",l="w-2 h-2 rounded-full shadow-[0_0_8px_currentColor]",h={ok:"bg-green-500/10 border-green-500/30 text-green-600 dark:bg-green-500/20 dark:border-green-500/30 dark:text-green-400",drift:"bg-orange-500/10 border-orange-500/30 text-orange-600 dark:bg-orange-500/20 dark:border-orange-500/30 dark:text-orange-400",stale:"bg-red-500/10 border-red-500/30 text-red-600 dark:bg-red-500/20 dark:border-red-500/30 dark:text-red-400",orphan:"bg-slate-500/10 border-slate-500/30 text-slate-600 dark:bg-slate-500/20 dark:border-slate-500/30 dark:text-slate-400",locked:"bg-amber-500/10 border-amber-500/30 text-amber-600 dark:bg-amber-500/20 dark:border-amber-500/30 dark:text-amber-400"},p={ok:"bg-green-500 text-green-500",drift:"bg-orange-500 text-orange-500 animate-pulse",stale:"bg-red-500 text-red-500 animate-pulse",orphan:"bg-slate-500 text-slate-500",locked:"bg-amber-500 text-amber-500"};return t==="dot"?s("span",{class:`${l} ${p[e]}`,"aria-label":n}):t==="banner"?s("div",{class:`${c} ${h[e]}`,role:"status",children:[s("span",{"aria-hidden":"true",class:"shrink-0",children:e==="ok"?"✓":"!"}),s("span",{children:[n,o]})]}):s("span",{class:`${d} ${h[e]}`,children:[s("span",{"aria-hidden":"true",children:e==="ok"?"✓":"!"}),s("span",{class:"truncate max-w-[150px] sm:max-w-none",children:[n,o]})]})}function Qa(){const{t}=G(),[e,r]=L(null),[a,i]=L(!0),[n,o]=L(null),d=async()=>{i(!0);try{r(await Ia()),o(null)}catch(c){o(c instanceof Error?c.message:String(c))}finally{i(!1)}};return K(()=>{d()},[]),s("div",{class:"flex-1 flex flex-col gap-6 max-w-5xl mx-auto w-full p-4 md:p-6 lg:p-8",children:[n!==null?s("div",{class:"mb-4",children:s(se,{kind:"banner",severity:"stale",message:n})}):null,s("div",{class:"flex items-center justify-between bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border dark:backdrop-blur-xl sm:rounded-2xl sm:shadow-sm p-4",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted",children:t("dashboard.readiness.filter.analysis")}),s("button",{class:"px-3 py-1.5 rounded-lg text-sm font-medium bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-colors",type:"button",onClick:()=>{d()},children:t("dashboard.shared.refresh")})]}),a&&e===null?s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl",children:t("dashboard.readiness.loading")}):null,e!==null?s("div",{class:"flex flex-col gap-6",children:[s("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s("article",{class:"p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t("dashboard.readiness.summary.framework")}),s("strong",{class:"text-2xl font-bold text-light-text dark:text-dark-text",children:e.framework.kind!=="unknown"?`${e.framework.kind} ${e.framework.version}`:t("dashboard.doctor.framework.unknown")}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted",children:e.framework.subkind!=="unknown"?e.framework.subkind:"Standard"})]}),s("article",{class:"p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t("dashboard.readiness.summary.files")}),s("strong",{class:"text-2xl font-bold text-light-text dark:text-dark-text",children:e.fileCount}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted",children:[e.ignoredCount," ignored"]})]}),s("article",{class:"p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t("dashboard.readiness.summary.status")}),s("strong",{class:"text-2xl font-bold text-light-text dark:text-dark-text",children:e.hasExistingFabric?"Initialized":"Not Initialized"}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted",children:".fabric directory"})]})]}),s("div",{class:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent",children:s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:t("dashboard.readiness.card.evidence")})}),s("div",{class:"flex flex-col",children:[s("div",{class:`p-5 flex flex-col gap-2 border-b border-light-border dark:border-dark-border ${e.readmeQuality==="none"?"bg-red-500/5 dark:bg-red-500/10":""}`,children:[s("div",{class:"flex items-center justify-between",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text",children:"README.md"}),s(se,{kind:"pill",severity:e.readmeQuality==="none"?"stale":"ok",message:e.readmeQuality})]}),s("p",{class:"text-sm text-light-muted dark:text-dark-muted m-0",children:t("dashboard.readiness.readme.description")})]}),s("div",{class:`p-5 flex flex-col gap-2 ${e.hasContributing?"":"bg-amber-500/5 dark:bg-amber-500/10"}`,children:[s("div",{class:"flex items-center justify-between",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text",children:"CONTRIBUTING.md"}),s(se,{kind:"pill",severity:e.hasContributing?"ok":"locked",message:e.hasContributing?"Present":"Missing"})]}),s("p",{class:"text-sm text-light-muted dark:text-dark-muted m-0",children:t("dashboard.readiness.contributing.description")})]})]})]}),s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent",children:s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:t("dashboard.readiness.card.recommendations")})}),s("div",{class:"flex flex-col p-5 gap-4",children:[e.recommendations.length>0?e.recommendations.map((c,l)=>s("div",{class:"flex items-start gap-3 pb-4 border-b border-light-border dark:border-dark-border last:border-0 last:pb-0",children:[s("div",{class:"w-1.5 h-1.5 rounded-full bg-brand-accent mt-2 shrink-0"}),s("span",{class:"text-sm text-light-text dark:text-dark-text leading-relaxed",children:c})]},l)):s("div",{class:"text-sm text-light-muted dark:text-dark-muted text-center py-4",children:s("span",{children:t("dashboard.readiness.fully-ready")})}),!e.hasExistingFabric&&s("div",{class:"mt-2 p-4 rounded-xl border bg-brand-accent/5 border-brand-accent/20 dark:bg-brand-accent/10 dark:border-brand-accent/20",children:[s("strong",{class:"text-sm text-brand-accent dark:text-blue-400 block mb-2",children:t("dashboard.readiness.init-prompt")}),s("div",{class:"rounded-lg p-3 font-mono text-xs flex justify-between items-center border shadow-inner bg-zinc-900 border-zinc-800 text-zinc-300 dark:bg-black/50 dark:border-white/5 dark:text-white/80",children:[s("span",{children:[s("span",{class:"text-zinc-500 dark:text-white/30 mr-2",children:"$"}),"fab init"]}),s("button",{class:"text-zinc-400 hover:text-white dark:text-white/40 dark:hover:text-white transition-colors flex items-center gap-1.5 bg-white/5 px-2 py-1 rounded",onClick:()=>navigator.clipboard.writeText("fab init"),children:[s("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy"]})]})]})]})]})]})]}):null]})}var I;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const n={};for(const o of i)n[o]=o;return n},t.getValidEnumValues=i=>{const n=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),o={};for(const d of n)o[d]=i[d];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const n=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},t.find=(i,n)=>{for(const o of i)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function a(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=a,t.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(I||(I={}));var cr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(cr||(cr={}));const g=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ue=t=>{switch(typeof t){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(t)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":return Array.isArray(t)?g.array:t===null?g.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?g.promise:typeof Map<"u"&&t instanceof Map?g.map:typeof Set<"u"&&t instanceof Set?g.set:typeof Date<"u"&&t instanceof Date?g.date:g.object;default:return g.unknown}},f=I.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class de extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(n){return n.message},a={_errors:[]},i=n=>{for(const o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)a._errors.push(r(o));else{let d=a,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(d[l]=d[l]||{_errors:[]},d[l]._errors.push(r(o))):d[l]=d[l]||{_errors:[]},d=d[l],c++}}};return i(this),a}static assert(e){if(!(e instanceof de))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},a=[];for(const i of this.issues)if(i.path.length>0){const n=i.path[0];r[n]=r[n]||[],r[n].push(e(i))}else a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}}de.create=t=>new de(t);const wt=(t,e)=>{let r;switch(t.code){case f.invalid_type:t.received===g.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case f.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,I.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:r=`Unrecognized key(s) in object: ${I.joinValues(t.keys,", ")}`;break;case f.invalid_union:r="Invalid input";break;case f.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${I.joinValues(t.options)}`;break;case f.invalid_enum_value:r=`Invalid enum value. Expected ${I.joinValues(t.options)}, received '${t.received}'`;break;case f.invalid_arguments:r="Invalid function arguments";break;case f.invalid_return_type:r="Invalid function return type";break;case f.invalid_date:r="Invalid date";break;case f.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:I.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case f.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case f.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case f.custom:r="Invalid input";break;case f.invalid_intersection_types:r="Intersection results could not be merged";break;case f.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case f.not_finite:r="Number must be finite";break;default:r=e.defaultError,I.assertNever(t)}return{message:r}};let ei=wt;function ti(){return ei}const ri=t=>{const{data:e,path:r,errorMaps:a,issueData:i}=t,n=[...r,...i.path||[]],o={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let d="";const c=a.filter(l=>!!l).slice().reverse();for(const l of c)d=l(o,{data:e,defaultError:d}).message;return{...i,path:n,message:d}};function m(t,e){const r=ti(),a=ri({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===wt?void 0:wt].filter(i=>!!i)});t.common.issues.push(a)}class X{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const a=[];for(const i of r){if(i.status==="aborted")return w;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){const a=[];for(const i of r){const n=await i.key,o=await i.value;a.push({key:n,value:o})}return X.mergeObjectSync(e,a)}static mergeObjectSync(e,r){const a={};for(const i of r){const{key:n,value:o}=i;if(n.status==="aborted"||o.status==="aborted")return w;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(a[n.value]=o.value)}return{status:e.value,value:a}}}const w=Object.freeze({status:"aborted"}),Ee=t=>({status:"dirty",value:t}),J=t=>({status:"valid",value:t}),ur=t=>t.status==="aborted",hr=t=>t.status==="dirty",we=t=>t.status==="valid",Ye=t=>typeof Promise<"u"&&t instanceof Promise;var v;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(v||(v={}));class ee{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pr=(t,e)=>{if(we(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new de(t.common.issues);return this._error=r,this._error}}};function S(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,d)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??d.defaultError}:typeof d.data>"u"?{message:c??a??d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:c??r??d.defaultError}},description:i}}class A{get description(){return this._def.description}_getType(e){return ue(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ue(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:ue(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ye(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){const a={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ue(e)},i=this._parseSync({data:e,path:a.path,parent:a});return pr(a,i)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ue(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:r});return we(a)?{value:a.value}:{issues:r.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(a=>we(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(e,r){const a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){const a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ue(e)},i=this._parse({data:e,path:a.path,parent:a}),n=await(Ye(i)?i:Promise.resolve(i));return pr(a,n)}refine(e,r){const a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,n)=>{const o=e(i),d=()=>n.addIssue({code:f.custom,...a(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new pe({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return oe.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Q.create(this)}promise(){return tt.create(this,this._def)}or(e){return Je.create([this,e],this._def)}and(e){return Ke.create(this,e,this._def)}transform(e){return new pe({...S(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new rt({...S(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new Gr({typeName:C.ZodBranded,type:this,...S(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new at({...S(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Bt.create(this,e)}readonly(){return it.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ai=/^c[^\s-]{8,}$/i,ii=/^[0-9a-z]+$/,ni=/^[0-9A-HJKMNP-TV-Z]{26}$/i,si=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,oi=/^[a-z0-9_-]{21}$/i,di=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,li=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ci=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ui="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let bt;const hi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,fi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,mi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gi=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",_i=new RegExp(`^${qr}$`);function Xr(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function vi(t){return new RegExp(`^${Xr(t)}$`)}function yi(t){let e=`${qr}T${Xr(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function ki(t,e){return!!((e==="v4"||!e)&&hi.test(t)||(e==="v6"||!e)&&fi.test(t))}function xi(t,e){if(!di.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(a));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function wi(t,e){return!!((e==="v4"||!e)&&pi.test(t)||(e==="v6"||!e)&&mi.test(t))}class ie extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){const n=this._getOrReturnCtx(e);return m(n,{code:f.invalid_type,expected:g.string,received:n.parsedType}),w}const a=new X;let i;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),m(i,{code:f.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),m(i,{code:f.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="length"){const o=e.data.length>n.value,d=e.data.length<n.value;(o||d)&&(i=this._getOrReturnCtx(e,i),o?m(i,{code:f.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):d&&m(i,{code:f.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if(n.kind==="email")ci.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"email",code:f.invalid_string,message:n.message}),a.dirty());else if(n.kind==="emoji")bt||(bt=new RegExp(ui,"u")),bt.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"emoji",code:f.invalid_string,message:n.message}),a.dirty());else if(n.kind==="uuid")si.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"uuid",code:f.invalid_string,message:n.message}),a.dirty());else if(n.kind==="nanoid")oi.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"nanoid",code:f.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid")ai.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"cuid",code:f.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid2")ii.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"cuid2",code:f.invalid_string,message:n.message}),a.dirty());else if(n.kind==="ulid")ni.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"ulid",code:f.invalid_string,message:n.message}),a.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),m(i,{validation:"url",code:f.invalid_string,message:n.message}),a.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"regex",code:f.invalid_string,message:n.message}),a.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),m(i,{code:f.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),m(i,{code:f.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),m(i,{code:f.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):n.kind==="datetime"?yi(n).test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{code:f.invalid_string,validation:"datetime",message:n.message}),a.dirty()):n.kind==="date"?_i.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{code:f.invalid_string,validation:"date",message:n.message}),a.dirty()):n.kind==="time"?vi(n).test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{code:f.invalid_string,validation:"time",message:n.message}),a.dirty()):n.kind==="duration"?li.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"duration",code:f.invalid_string,message:n.message}),a.dirty()):n.kind==="ip"?ki(e.data,n.version)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"ip",code:f.invalid_string,message:n.message}),a.dirty()):n.kind==="jwt"?xi(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"jwt",code:f.invalid_string,message:n.message}),a.dirty()):n.kind==="cidr"?wi(e.data,n.version)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"cidr",code:f.invalid_string,message:n.message}),a.dirty()):n.kind==="base64"?bi.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"base64",code:f.invalid_string,message:n.message}),a.dirty()):n.kind==="base64url"?gi.test(e.data)||(i=this._getOrReturnCtx(e,i),m(i,{validation:"base64url",code:f.invalid_string,message:n.message}),a.dirty()):I.assertNever(n);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:f.invalid_string,...v.errToObj(a)})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...v.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...v.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...v.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...v.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...v.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...v.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...v.errToObj(r)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new ie({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}ie.create=t=>new ie({checks:[],typeName:C.ZodString,coerce:t?.coerce??!1,...S(t)});function Ci(t,e){const r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,n=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return n%o/10**i}class Ce extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){const n=this._getOrReturnCtx(e);return m(n,{code:f.invalid_type,expected:g.number,received:n.parsedType}),w}let a;const i=new X;for(const n of this._def.checks)n.kind==="int"?I.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{code:f.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:f.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:f.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?Ci(e.data,n.value)!==0&&(a=this._getOrReturnCtx(e,a),m(a,{code:f.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{code:f.not_finite,message:n.message}),i.dirty()):I.assertNever(n);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,a,i){return new Ce({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:v.toString(i)}]})}_addCheck(e){return new Ce({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&I.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Ce.create=t=>new Ce({checks:[],typeName:C.ZodNumber,coerce:t?.coerce||!1,...S(t)});class Ne extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let a;const i=new X;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:f.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),m(a,{code:f.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),m(a,{code:f.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):I.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:g.bigint,received:r.parsedType}),w}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,a,i){return new Ne({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:v.toString(i)}]})}_addCheck(e){return new Ne({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Ne.create=t=>new Ne({checks:[],typeName:C.ZodBigInt,coerce:t?.coerce??!1,...S(t)});class Ct extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){const a=this._getOrReturnCtx(e);return m(a,{code:f.invalid_type,expected:g.boolean,received:a.parsedType}),w}return J(e.data)}}Ct.create=t=>new Ct({typeName:C.ZodBoolean,coerce:t?.coerce||!1,...S(t)});class Ge extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){const n=this._getOrReturnCtx(e);return m(n,{code:f.invalid_type,expected:g.date,received:n.parsedType}),w}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return m(n,{code:f.invalid_date}),w}const a=new X;let i;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),m(i,{code:f.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),m(i,{code:f.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):I.assertNever(n);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ge({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Ge.create=t=>new Ge({checks:[],coerce:t?.coerce||!1,typeName:C.ZodDate,...S(t)});class fr extends A{_parse(e){if(this._getType(e)!==g.symbol){const a=this._getOrReturnCtx(e);return m(a,{code:f.invalid_type,expected:g.symbol,received:a.parsedType}),w}return J(e.data)}}fr.create=t=>new fr({typeName:C.ZodSymbol,...S(t)});class St extends A{_parse(e){if(this._getType(e)!==g.undefined){const a=this._getOrReturnCtx(e);return m(a,{code:f.invalid_type,expected:g.undefined,received:a.parsedType}),w}return J(e.data)}}St.create=t=>new St({typeName:C.ZodUndefined,...S(t)});class Tt extends A{_parse(e){if(this._getType(e)!==g.null){const a=this._getOrReturnCtx(e);return m(a,{code:f.invalid_type,expected:g.null,received:a.parsedType}),w}return J(e.data)}}Tt.create=t=>new Tt({typeName:C.ZodNull,...S(t)});class mr extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return J(e.data)}}mr.create=t=>new mr({typeName:C.ZodAny,...S(t)});class At extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return J(e.data)}}At.create=t=>new At({typeName:C.ZodUnknown,...S(t)});class he extends A{_parse(e){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:g.never,received:r.parsedType}),w}}he.create=t=>new he({typeName:C.ZodNever,...S(t)});class br extends A{_parse(e){if(this._getType(e)!==g.undefined){const a=this._getOrReturnCtx(e);return m(a,{code:f.invalid_type,expected:g.void,received:a.parsedType}),w}return J(e.data)}}br.create=t=>new br({typeName:C.ZodVoid,...S(t)});class Q extends A{_parse(e){const{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==g.array)return m(r,{code:f.invalid_type,expected:g.array,received:r.parsedType}),w;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(o||d)&&(m(r,{code:o?f.too_big:f.too_small,minimum:d?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(m(r,{code:f.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(m(r,{code:f.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((o,d)=>i.type._parseAsync(new ee(r,o,r.path,d)))).then(o=>X.mergeArray(a,o));const n=[...r.data].map((o,d)=>i.type._parseSync(new ee(r,o,r.path,d)));return X.mergeArray(a,n)}get element(){return this._def.type}min(e,r){return new Q({...this._def,minLength:{value:e,message:v.toString(r)}})}max(e,r){return new Q({...this._def,maxLength:{value:e,message:v.toString(r)}})}length(e,r){return new Q({...this._def,exactLength:{value:e,message:v.toString(r)}})}nonempty(e){return this.min(1,e)}}Q.create=(t,e)=>new Q({type:t,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...S(e)});function ve(t){if(t instanceof z){const e={};for(const r in t.shape){const a=t.shape[r];e[r]=oe.create(ve(a))}return new z({...t._def,shape:()=>e})}else return t instanceof Q?new Q({...t._def,type:ve(t.element)}):t instanceof oe?oe.create(ve(t.unwrap())):t instanceof _e?_e.create(ve(t.unwrap())):t instanceof be?be.create(t.items.map(e=>ve(e))):t}class z extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=I.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==g.object){const l=this._getOrReturnCtx(e);return m(l,{code:f.invalid_type,expected:g.object,received:l.parsedType}),w}const{status:a,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof he&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||d.push(l);const c=[];for(const l of o){const h=n[l],p=i.data[l];c.push({key:{status:"valid",value:l},value:h._parse(new ee(i,p,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof he){const l=this._def.unknownKeys;if(l==="passthrough")for(const h of d)c.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(l==="strict")d.length>0&&(m(i,{code:f.unrecognized_keys,keys:d}),a.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const h of d){const p=i.data[h];c.push({key:{status:"valid",value:h},value:l._parse(new ee(i,p,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const h of c){const p=await h.key,_=await h.value;l.push({key:p,value:_,alwaysSet:h.alwaysSet})}return l}).then(l=>X.mergeObjectSync(a,l)):X.mergeObjectSync(a,c)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new z({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{const i=this._def.errorMap?.(r,a).message??a.defaultError;return r.code==="unrecognized_keys"?{message:v.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new z({...this._def,unknownKeys:"strip"})}passthrough(){return new z({...this._def,unknownKeys:"passthrough"})}extend(e){return new z({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new z({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:C.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new z({...this._def,catchall:e})}pick(e){const r={};for(const a of I.objectKeys(e))e[a]&&this.shape[a]&&(r[a]=this.shape[a]);return new z({...this._def,shape:()=>r})}omit(e){const r={};for(const a of I.objectKeys(this.shape))e[a]||(r[a]=this.shape[a]);return new z({...this._def,shape:()=>r})}deepPartial(){return ve(this)}partial(e){const r={};for(const a of I.objectKeys(this.shape)){const i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}return new z({...this._def,shape:()=>r})}required(e){const r={};for(const a of I.objectKeys(this.shape))if(e&&!e[a])r[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof oe;)n=n._def.innerType;r[a]=n}return new z({...this._def,shape:()=>r})}keyof(){return Yr(I.objectKeys(this.shape))}}z.create=(t,e)=>new z({shape:()=>t,unknownKeys:"strip",catchall:he.create(),typeName:C.ZodObject,...S(e)});z.strictCreate=(t,e)=>new z({shape:()=>t,unknownKeys:"strict",catchall:he.create(),typeName:C.ZodObject,...S(e)});z.lazycreate=(t,e)=>new z({shape:t,unknownKeys:"strip",catchall:he.create(),typeName:C.ZodObject,...S(e)});class Je extends A{_parse(e){const{ctx:r}=this._processInputParams(e),a=this._def.options;function i(n){for(const d of n)if(d.result.status==="valid")return d.result;for(const d of n)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const o=n.map(d=>new de(d.ctx.common.issues));return m(r,{code:f.invalid_union,unionErrors:o}),w}if(r.common.async)return Promise.all(a.map(async n=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let n;const o=[];for(const c of a){const l={...r,common:{...r.common,issues:[]},parent:null},h=c._parseSync({data:r.data,path:r.path,parent:l});if(h.status==="valid")return h;h.status==="dirty"&&!n&&(n={result:h,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;const d=o.map(c=>new de(c));return m(r,{code:f.invalid_union,unionErrors:d}),w}}get options(){return this._def.options}}Je.create=(t,e)=>new Je({options:t,typeName:C.ZodUnion,...S(e)});const re=t=>t instanceof It?re(t.schema):t instanceof pe?re(t.innerType()):t instanceof et?[t.value]:t instanceof ge?t.options:t instanceof Rt?I.objectValues(t.enum):t instanceof rt?re(t._def.innerType):t instanceof St?[void 0]:t instanceof Tt?[null]:t instanceof oe?[void 0,...re(t.unwrap())]:t instanceof _e?[null,...re(t.unwrap())]:t instanceof Gr||t instanceof it?re(t.unwrap()):t instanceof at?re(t._def.innerType):[];class Ht extends A{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return m(r,{code:f.invalid_type,expected:g.object,received:r.parsedType}),w;const a=this.discriminator,i=r.data[a],n=this.optionsMap.get(i);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(m(r,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){const i=new Map;for(const n of r){const o=re(n.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of o){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,n)}}return new Ht({typeName:C.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...S(a)})}}function Et(t,e){const r=ue(t),a=ue(e);if(t===e)return{valid:!0,data:t};if(r===g.object&&a===g.object){const i=I.objectKeys(e),n=I.objectKeys(t).filter(d=>i.indexOf(d)!==-1),o={...t,...e};for(const d of n){const c=Et(t[d],e[d]);if(!c.valid)return{valid:!1};o[d]=c.data}return{valid:!0,data:o}}else if(r===g.array&&a===g.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let n=0;n<t.length;n++){const o=t[n],d=e[n],c=Et(o,d);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===g.date&&a===g.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ke extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e),i=(n,o)=>{if(ur(n)||ur(o))return w;const d=Et(n.value,o.value);return d.valid?((hr(n)||hr(o))&&r.dirty(),{status:r.value,value:d.data}):(m(a,{code:f.invalid_intersection_types}),w)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([n,o])=>i(n,o)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Ke.create=(t,e,r)=>new Ke({left:t,right:e,typeName:C.ZodIntersection,...S(r)});class be extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.array)return m(a,{code:f.invalid_type,expected:g.array,received:a.parsedType}),w;if(a.data.length<this._def.items.length)return m(a,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w;!this._def.rest&&a.data.length>this._def.items.length&&(m(a,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const n=[...a.data].map((o,d)=>{const c=this._def.items[d]||this._def.rest;return c?c._parse(new ee(a,o,a.path,d)):null}).filter(o=>!!o);return a.common.async?Promise.all(n).then(o=>X.mergeArray(r,o)):X.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new be({...this._def,rest:e})}}be.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new be({items:t,typeName:C.ZodTuple,rest:null,...S(e)})};class Qe extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.object)return m(a,{code:f.invalid_type,expected:g.object,received:a.parsedType}),w;const i=[],n=this._def.keyType,o=this._def.valueType;for(const d in a.data)i.push({key:n._parse(new ee(a,d,a.path,d)),value:o._parse(new ee(a,a.data[d],a.path,d)),alwaysSet:d in a.data});return a.common.async?X.mergeObjectAsync(r,i):X.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof A?new Qe({keyType:e,valueType:r,typeName:C.ZodRecord,...S(a)}):new Qe({keyType:ie.create(),valueType:e,typeName:C.ZodRecord,...S(r)})}}class gr extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.map)return m(a,{code:f.invalid_type,expected:g.map,received:a.parsedType}),w;const i=this._def.keyType,n=this._def.valueType,o=[...a.data.entries()].map(([d,c],l)=>({key:i._parse(new ee(a,d,a.path,[l,"key"])),value:n._parse(new ee(a,c,a.path,[l,"value"]))}));if(a.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,h=await c.value;if(l.status==="aborted"||h.status==="aborted")return w;(l.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(l.value,h.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const c of o){const l=c.key,h=c.value;if(l.status==="aborted"||h.status==="aborted")return w;(l.status==="dirty"||h.status==="dirty")&&r.dirty(),d.set(l.value,h.value)}return{status:r.value,value:d}}}}gr.create=(t,e,r)=>new gr({valueType:e,keyType:t,typeName:C.ZodMap,...S(r)});class je extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.set)return m(a,{code:f.invalid_type,expected:g.set,received:a.parsedType}),w;const i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(m(a,{code:f.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(m(a,{code:f.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const n=this._def.valueType;function o(c){const l=new Set;for(const h of c){if(h.status==="aborted")return w;h.status==="dirty"&&r.dirty(),l.add(h.value)}return{status:r.value,value:l}}const d=[...a.data.values()].map((c,l)=>n._parse(new ee(a,c,a.path,l)));return a.common.async?Promise.all(d).then(c=>o(c)):o(d)}min(e,r){return new je({...this._def,minSize:{value:e,message:v.toString(r)}})}max(e,r){return new je({...this._def,maxSize:{value:e,message:v.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}je.create=(t,e)=>new je({valueType:t,minSize:null,maxSize:null,typeName:C.ZodSet,...S(e)});class It extends A{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}It.create=(t,e)=>new It({getter:t,typeName:C.ZodLazy,...S(e)});class et extends A{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return m(r,{received:r.data,code:f.invalid_literal,expected:this._def.value}),w}return{status:"valid",value:e.data}}get value(){return this._def.value}}et.create=(t,e)=>new et({value:t,typeName:C.ZodLiteral,...S(e)});function Yr(t,e){return new ge({values:t,typeName:C.ZodEnum,...S(e)})}class ge extends A{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),a=this._def.values;return m(r,{expected:I.joinValues(a),received:r.parsedType,code:f.invalid_type}),w}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),a=this._def.values;return m(r,{received:r.data,code:f.invalid_enum_value,options:a}),w}return J(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return ge.create(e,{...this._def,...r})}exclude(e,r=this._def){return ge.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}}ge.create=Yr;class Rt extends A{_parse(e){const r=I.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==g.string&&a.parsedType!==g.number){const i=I.objectValues(r);return m(a,{expected:I.joinValues(i),received:a.parsedType,code:f.invalid_type}),w}if(this._cache||(this._cache=new Set(I.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=I.objectValues(r);return m(a,{received:a.data,code:f.invalid_enum_value,options:i}),w}return J(e.data)}get enum(){return this._def.values}}Rt.create=(t,e)=>new Rt({values:t,typeName:C.ZodNativeEnum,...S(e)});class tt extends A{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.promise&&r.common.async===!1)return m(r,{code:f.invalid_type,expected:g.promise,received:r.parsedType}),w;const a=r.parsedType===g.promise?r.data:Promise.resolve(r.data);return J(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}tt.create=(t,e)=>new tt({type:t,typeName:C.ZodPromise,...S(e)});class pe extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:o=>{m(a,o),o.fatal?r.abort():r.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){const o=i.transform(a.data,n);if(a.common.async)return Promise.resolve(o).then(async d=>{if(r.value==="aborted")return w;const c=await this._def.schema._parseAsync({data:d,path:a.path,parent:a});return c.status==="aborted"?w:c.status==="dirty"||r.value==="dirty"?Ee(c.value):c});{if(r.value==="aborted")return w;const d=this._def.schema._parseSync({data:o,path:a.path,parent:a});return d.status==="aborted"?w:d.status==="dirty"||r.value==="dirty"?Ee(d.value):d}}if(i.type==="refinement"){const o=d=>{const c=i.refinement(d,n);if(a.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return d.status==="aborted"?w:(d.status==="dirty"&&r.dirty(),o(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>d.status==="aborted"?w:(d.status==="dirty"&&r.dirty(),o(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!we(o))return w;const d=i.transform(o.value,n);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>we(o)?Promise.resolve(i.transform(o.value,n)).then(d=>({status:r.value,value:d})):w);I.assertNever(i)}}pe.create=(t,e,r)=>new pe({schema:t,typeName:C.ZodEffects,effect:e,...S(r)});pe.createWithPreprocess=(t,e,r)=>new pe({schema:e,effect:{type:"preprocess",transform:t},typeName:C.ZodEffects,...S(r)});class oe extends A{_parse(e){return this._getType(e)===g.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}oe.create=(t,e)=>new oe({innerType:t,typeName:C.ZodOptional,...S(e)});class _e extends A{_parse(e){return this._getType(e)===g.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_e.create=(t,e)=>new _e({innerType:t,typeName:C.ZodNullable,...S(e)});class rt extends A{_parse(e){const{ctx:r}=this._processInputParams(e);let a=r.data;return r.parsedType===g.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}rt.create=(t,e)=>new rt({innerType:t,typeName:C.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class at extends A{_parse(e){const{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Ye(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new de(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new de(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}at.create=(t,e)=>new at({innerType:t,typeName:C.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class _r extends A{_parse(e){if(this._getType(e)!==g.nan){const a=this._getOrReturnCtx(e);return m(a,{code:f.invalid_type,expected:g.nan,received:a.parsedType}),w}return{status:"valid",value:e.data}}}_r.create=t=>new _r({typeName:C.ZodNaN,...S(t)});class Gr extends A{_parse(e){const{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}}class Bt extends A{_parse(e){const{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?w:n.status==="dirty"?(r.dirty(),Ee(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{const i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?w:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new Bt({in:e,out:r,typeName:C.ZodPipeline})}}class it extends A{_parse(e){const r=this._def.innerType._parse(e),a=i=>(we(i)&&(i.value=Object.freeze(i.value)),i);return Ye(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}}it.create=(t,e)=>new it({innerType:t,typeName:C.ZodReadonly,...S(e)});var C;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(C||(C={}));const u=ie.create,U=Ce.create,nt=Ct.create,Vt=At.create;he.create;const y=Q.create,k=z.create;Je.create;const Wt=Ht.create;Ke.create;be.create;const qt=Qe.create,D=et.create,V=ge.create;tt.create;oe.create;_e.create;const Xt=pe.createWithPreprocess;var vr=".fabric/agents/",Si=["L0","L1","L2"],Ti=["mirror","cross-cutting","domain","local","global"],Ai=["declared","derived"],Nt=V(Si),Ei=V(Ti),Ii=V(Ai),Jr=k({summary:u(),intent_clues:y(u()),tech_stack:y(u()),impact:y(u()),must_read_if:u(),entities:y(u()).optional()}).strict();k({stable_id:u(),level:Nt,required:nt(),selectable:nt(),description:Jr}).strict();var Ri=k({file:u(),content_ref:u().optional(),scope_glob:u(),deps:y(u()),priority:V(["high","medium","low"]),level:Nt.optional(),layer:Nt,topology_type:Ei,hash:u(),stable_id:u().optional(),identity_source:Ii.optional(),activation:k({tier:V(["always","path","description"]),description:u().optional()}).optional(),description:Jr.optional(),sections:y(u()).optional()}),Ni=Xt(t=>!Oi(t)||typeof t.file!="string"?t:jt(t),Ri),ji=k({revision:u(),nodes:qt(Ni)});function jt(t){const e=t.stable_id??Kr(t.file),r=$i(t);return{...t,layer:t.layer??t.level??yr(t.file),level:t.level??t.layer??yr(t.file),topology_type:t.topology_type??Li(t.file),stable_id:e,identity_source:r}}function Kr(t){const e=Yt(t);return e==="AGENTS.md"||e===".fabric/bootstrap/README.md"?"bootstrap":Qr(e).replace(/\.md$/u,"")}function $i(t){if(t.identity_source!==void 0)return t.identity_source;const e=Kr(t.file);return t.stable_id!==void 0&&t.stable_id!==e?"declared":"derived"}function yr(t){const e=Yt(t);if(e==="AGENTS.md"||e===".fabric/bootstrap/README.md")return"L0";if(ea(e))return"L1";const r=Qr(e),a=Pi(r);return a===0?"L0":a<=2?"L1":"L2"}function Li(t){return ea(Yt(t))?"cross-cutting":"mirror"}function Qr(t){return t.startsWith(vr)?t.slice(vr.length):t}function Pi(t){const e=t.split("/").filter(Boolean);return Math.max(e.length-1,0)}function ea(t){return t.split("/").includes("_cross")}function Yt(t){return t.replaceAll("\\","/")}function Oi(t){return typeof t=="object"&&t!==null}var Fi=1,ye=u().min(1),Mi=k({rule_stable_id:u().min(1),rule_file:u().min(1),rule_hash:ye,previous_rule_hash:ye.optional(),test_file:u().min(1),test_hash:ye,previous_test_hash:ye.optional(),annotation_line:U().int().positive()}).strict(),zi=k({rule_stable_id:u().min(1),test_file:u().min(1),test_hash:ye,previous_test_hash:ye.optional(),annotation_line:U().int().positive()}).strict();k({schema_version:D(Fi),generated_at:u().datetime({offset:!0}),revision:u().min(1).optional(),previous_revision:u().min(1).optional(),links:y(Mi),orphan_annotations:y(zi)}).strict();var Di=V(["ai","human"]),ta=Xt(t=>{if(!(t==null||t==="")){if(typeof t=="number")return t;if(typeof t=="string"){const e=t.trim();if(e.length===0)return;if(/^\d+$/.test(e))return Number.parseInt(e,10);const r=Date.parse(e);return Number.isNaN(r)?t:r}return t}},U().int().nonnegative());k({source:Di.optional(),since:ta.optional()});k({ledger_id:u().trim().min(1).optional(),ts:ta.optional()}).superRefine((t,e)=>{[t.ledger_id,t.ts].filter(a=>a!==void 0).length!==1&&e.addIssue({code:f.custom,message:"Provide exactly one of ledger_id or ts.",path:["ledger_id"]})});k({file:u().min(1),start_line:U().int().positive(),end_line:U().int().positive(),new_hash:u().min(1)});k({file:u().min(1)});k({ledger_entry_id:u().min(1),annotation:u().trim().min(1)});var ra={id:u().optional(),ts:U().int().nonnegative(),intent:u(),affected_paths:y(u())},Zi=k({...ra,source:D("ai"),commit_sha:u().optional()}),Ui=k({...ra,source:D("human"),parent_sha:u(),parent_ledger_entry_id:u().optional(),diff_stat:u(),annotation:u().optional()}),Hi=Wt("source",[Zi,Ui]),Bi=Xt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&(!("source"in t)||t.source===void 0)?{...t,source:"human"}:t,Hi),$e=k({file:u(),start_line:U().int().nonnegative(),end_line:U().int().nonnegative(),hash:u()});k({locked:y($e).optional()});var kr=V(["strict","warn","off"]),Vi=k({claudeCodeCLI:u().optional(),claudeCodeDesktop:u().optional(),cursor:u().optional(),windsurf:u().optional(),rooCode:u().optional(),geminiCLI:u().optional(),codexCLI:u().optional()});k({clientPaths:Vi.optional(),externalFixturePath:u().optional(),scanIgnores:y(u()).optional(),auditMode:kr.optional(),audit_mode:kr.optional()});var Wi=k({path:u(),lines:u(),snippet:u(),pattern_hint:u()}),qi=k({file:u(),line:u(),snippet:u()}),Xi=k({ratio:U().min(0).max(1),total:U().int().nonnegative(),matched:U().int().nonnegative(),co_occurring_patterns:y(u())}),Yi=k({type:V(["framework","pattern","invariant","domain"]),statement:u(),confidence:V(["HIGH","MEDIUM","LOW"]),evidence:y(qi),coverage:Xi,proposed_rule:u().optional(),alternatives:y(u()).optional()}),Gi=k({total_files:U().int().nonnegative(),by_ext:qt(U().int().nonnegative()),key_dirs:y(u()),max_depth:U().int().nonnegative()}),Ji=k({path:u(),reason:u(),size_bytes:U().int().nonnegative().optional()}),Ki=k({kind:u(),version:u(),subkind:u(),evidence:y(u())}),Qi=k({quality:V(["missing","stub","ok"]),line_count:U().int().nonnegative(),has_contributing:nt()}),en=k({path:u(),family:V(["entry","component","config","test","domain"]),rationale:u()}),tn=k({max_files:D(15),max_lines_per_file:D(100)}),rn=k({version:u(),generated_at:u(),generated_by:u(),target:u(),project_name:u(),framework:Ki,topology:Gi,entry_points:y(Ji),code_samples:y(Wi),assertions:y(Yi),candidate_files:y(en),sampling_budget:tn,readme:Qi,recommendations_for_skill:y(u()).optional()}),an=k({kind:u(),version:u(),subkind:u()}),nn=k({confidence:V(["HIGH","MEDIUM","LOW"]),evidence_refs:y(u())}),sn=k({file:u(),lines:u()}),on=k({type:V(["ban","require","protect"]),rule:u(),rationale:u().optional(),confidence_snapshot:nn.optional(),source_evidence:y(sn).optional()}),dn=k({name:u(),paths:y(u()),summary:u().optional(),topology_type:V(["mirror","cross-cutting"]).optional(),target_path:u().optional()}),ln=k({phase:u(),question:u(),answer:u(),presentation:u().optional(),user_corrections:y(u()).optional()});k({framework:an,architecture_patterns:y(u()),invariants:y(on),domain_groups:y(dn),interview_trail:y(ln),forensic_ref:u()});var cn=k({type:D("meta:updated"),payload:ji}),un=k({type:D("lock:drift"),payload:k({locked:y($e),drifted:y($e)})}),hn=k({type:D("lock:approved"),payload:k({locked:y($e),approved:y($e)})}),pn=k({type:D("ledger:appended"),payload:Bi}),fn=k({type:D("drift:detected"),payload:rn});Wt("type",[cn,un,hn,pn,fn]);var fe={kind:D("fabric-event"),id:u(),ts:U().int().nonnegative(),schema_version:D(1),correlation_id:u().optional(),session_id:u().optional()},mn=qt(u()),bn=k({...fe,event_type:D("rule_context_planned"),target_paths:y(u()),required_stable_ids:y(u()),ai_selectable_stable_ids:y(u()),final_stable_ids:y(u()),selection_token:u().optional(),client_hash:u().optional(),intent:u().optional(),known_tech:y(u()).optional(),diagnostics:y(Vt()).optional()}),gn=k({...fe,event_type:D("rule_selection"),selection_token:u(),target_paths:y(u()),required_stable_ids:y(u()),ai_selectable_stable_ids:y(u()),ai_selected_stable_ids:y(u()),final_stable_ids:y(u()),ai_selection_reasons:mn,rejected_stable_ids:y(u()),ignored_stable_ids:y(u())}),_n=k({...fe,event_type:D("rule_sections_fetched"),selection_token:u(),target_paths:y(u()).optional(),requested_sections:y(u()),final_stable_ids:y(u()),ai_selected_stable_ids:y(u()),diagnostics:y(Vt()).optional()}),vn=k({...fe,event_type:D("edit_intent_checked"),path:u(),compliant:nt(),intent:u(),ledger_entry_id:u(),ledger_source:V(["ai","human"]).optional(),commit_sha:u().optional(),parent_sha:u().optional(),parent_ledger_entry_id:u().optional(),diff_stat:u().optional(),annotation:u().optional(),matched_rule_context_ts:U().int().nonnegative().nullable(),window_ms:U().int().nonnegative()}),yn=k({...fe,event_type:D("rule_drift_detected"),revision:u().optional(),drifted_stable_ids:y(u()),missing_files:y(u()),stale_files:y(u()),details:y(k({file:u(),stable_id:u(),expected_hash:u(),actual_hash:u().nullable()})).optional()}),kn=k({...fe,event_type:D("rule_baseline_accepted"),revision:u(),previous_revision:u().optional(),accepted_stable_ids:y(u()),source:V(["doctor_fix","sync_meta"]).optional()}),xn=k({...fe,event_type:D("baseline_synced"),revision:u(),previous_revision:u().optional(),synced_files:y(u()),accepted_stable_ids:y(u()),source:V(["doctor_fix","sync_meta"])}),wn=k({...fe,event_type:D("mcp_event"),mcp_event_id:u(),stream_id:u(),message:Vt()});Wt("event_type",[bn,gn,_n,vn,yn,kn,xn,wn]);function Cn({variant:t,state:e="idle",size:r="md",onClick:a,children:i,ariaLabel:n}){const{t:o}=G(),[d,c]=L(e),l=e==="idle"?d:e,h=l==="busy",p=async()=>{if(!h){c("busy");try{await a(),c("success"),window.setTimeout(()=>c("idle"),900)}catch{c("error"),window.setTimeout(()=>c("idle"),1400)}}},_="inline-flex items-center justify-center gap-2 font-medium rounded-lg transition-all duration-200 border",b=r==="sm"?"px-3 py-1.5 text-xs min-h-[32px]":"px-4 py-2 text-sm min-h-[40px]";let x="";return l==="success"?x="bg-green-500/10 border-green-500/30 text-green-600 dark:bg-green-500/20 dark:border-green-500/30 dark:text-green-400 cursor-default":l==="error"?x="bg-red-500/10 border-red-500 text-red-600 dark:bg-red-500/20 dark:border-red-500 dark:text-red-400 cursor-pointer hover:bg-red-500/20 dark:hover:bg-red-500/30":t==="approve"?x="bg-brand-accent border-transparent text-white hover:bg-brand-accent/90 dark:bg-purple-600 dark:hover:bg-purple-500 cursor-pointer shadow-sm":x="bg-light-surface border-light-border text-light-text hover:bg-light-border/50 dark:bg-white/5 dark:border-dark-border dark:text-dark-text dark:hover:bg-white/10 cursor-pointer shadow-sm",s("button",{type:"button",class:`${_} ${b} ${x} ${h?"opacity-70 cursor-not-allowed transform-none":"active:scale-[0.98]"}`,"aria-label":n,"aria-busy":h,"aria-disabled":h,onClick:p,children:[h?s("span",{class:"w-3.5 h-3.5 rounded-full border-2 border-current border-r-transparent animate-spin","aria-hidden":"true"}):null,l==="success"?s("span",{"aria-hidden":"true",children:"✓"}):null,l==="error"?o("dashboard.approve-button.retry"):i]})}function Sn({nodes:t}){const{t:e}=G(),r=En(t);return s("section",{class:"flex flex-col bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-dark-border dark:shadow-xl overflow-hidden min-h-[280px]",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex justify-between items-start bg-light-surface/90 dark:bg-transparent shrink-0",children:[s("div",{children:[s("h3",{class:"text-sm font-bold text-light-text dark:text-dark-text m-0",children:e("dashboard.rule-topology.heatmap.title")}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted mt-1",children:e("dashboard.rule-topology.heatmap.subtitle")})]}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border whitespace-nowrap",children:e("dashboard.rule-topology.heatmap.count",{count:String(r.length)})})]}),r.length===0?s("div",{class:"p-8 flex-1 flex items-center justify-center text-sm text-light-muted dark:text-dark-muted",children:e("dashboard.rule-topology.heatmap.empty")}):s("div",{class:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",role:"list","aria-label":e("dashboard.rule-topology.heatmap.aria-label"),children:r.map(a=>s("article",{class:`p-3 rounded-xl border bg-light-bg/50 dark:bg-black/20 flex flex-col ${An(a.density)}`,role:"listitem",children:[s("div",{class:"flex justify-between items-center gap-2",children:[s("span",{class:"font-mono text-sm font-medium text-light-text dark:text-dark-text truncate",children:a.path}),s("span",{class:`text-[10px] font-bold px-1.5 py-0.5 rounded whitespace-nowrap ${Tn(a.density)}`,children:e(`dashboard.rule-topology.heatmap.density.${a.density}`)})]}),s("div",{class:"flex justify-between items-center gap-2 mt-2 text-xs font-mono text-light-muted dark:text-dark-muted",children:[s("span",{class:"whitespace-nowrap",children:e("dashboard.rule-topology.heatmap.rules",{count:String(a.directRuleCount)})}),s("span",{class:"truncate opacity-80",children:a.matchingGlobs.slice(0,2).join(" · ")||e("dashboard.rule-topology.heatmap.uncovered")})]})]},a.path))})]})}function Tn(t){switch(t){case"full":return"bg-green-500/10 text-green-600 border border-green-500/30 dark:bg-green-500/20 dark:text-green-400";case"partial":return"bg-amber-500/10 text-amber-600 border border-amber-500/30 dark:bg-amber-500/20 dark:text-amber-400";case"none":return"bg-slate-500/10 text-slate-600 border border-slate-500/30 dark:bg-slate-500/20 dark:text-slate-400"}}function An(t){switch(t){case"full":return"border-l-4 border-l-green-500/50 border-t-light-border border-r-light-border border-b-light-border dark:border-t-dark-border dark:border-r-dark-border dark:border-b-dark-border";case"partial":return"border-l-4 border-l-amber-500/50 border-t-light-border border-r-light-border border-b-light-border dark:border-t-dark-border dark:border-r-dark-border dark:border-b-dark-border";case"none":return"border-l-4 border-l-slate-500/30 border-t-light-border border-r-light-border border-b-light-border dark:border-t-dark-border dark:border-r-dark-border dark:border-b-dark-border"}}function En(t){return In(t).map(a=>{const i=t.filter(o=>Nn(a,st(o.scope_glob))),n=i.some(o=>Rn(a,st(o.scope_glob)));return{path:a,density:n?"full":i.length>0?"partial":"none",matchingGlobs:i.map(o=>o.scope_glob),directRuleCount:i.length}}).sort((a,i)=>a.path.localeCompare(i.path))}function In(t){const e=new Set;for(const r of t){for(const i of xr(r.file))e.add(i);const a=Gt(r.scope_glob);if(a.length>0)for(const i of xr(a))e.add(i)}return Array.from(e)}function xr(t){const r=st(t).split("/").filter(Boolean);if(r.length===0)return[];const i=(r.at(-1)??"").includes(".")?r.length-1:r.length,n=[];for(let o=1;o<=i;o+=1)n.push(r.slice(0,o).join("/"));return n}function Gt(t){const e=st(t).split("/").filter(Boolean),r=[];for(const a of e){if(a==="**"||/[*?[\]{}()!]/.test(a))break;r.push(a)}return r.join("/")}function Rn(t,e){const r=Gt(e);return r.length===0?!1:r===t&&(e===t||e.startsWith(`${t}/**`)||e.startsWith(`${t}/*`))}function Nn(t,e){const r=Gt(e);return r.length===0?!0:r===t||r.startsWith(`${t}/`)||t.startsWith(`${r}/`)}function st(t){return t.replaceAll("\\","/").replace(/^\.?\//,"").replace(/\/+$/,"")}function jn({meta:t,rulesContext:e}){const{t:r}=G(),a=Ln(t,e);return s("section",{class:"flex flex-col bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-dark-border dark:shadow-xl overflow-hidden min-h-[280px]",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex justify-between items-start bg-light-surface/90 dark:bg-transparent shrink-0",children:[s("div",{children:[s("h3",{class:"text-sm font-bold text-light-text dark:text-dark-text m-0",children:r("dashboard.rule-topology.hit-reason.title")}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted mt-1",children:r("dashboard.rule-topology.hit-reason.subtitle")})]}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border whitespace-nowrap",children:r("dashboard.rule-topology.hit-reason.count",{count:String(a.length)})})]}),a.length===0?s("div",{class:"p-8 flex-1 flex items-center justify-center text-sm text-light-muted dark:text-dark-muted",children:r("dashboard.rule-topology.hit-reason.empty")}):s("div",{class:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",role:"list","aria-label":r("dashboard.rule-topology.hit-reason.aria-label"),children:a.map(i=>s("article",{class:"p-4 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border flex flex-col",role:"listitem",children:[s("div",{class:"flex justify-between items-center gap-2 mb-2",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text truncate",children:i.file}),s("span",{class:`text-[10px] font-bold px-1.5 py-0.5 rounded whitespace-nowrap ${$n(i.tier)}`,children:r(`dashboard.rule-topology.hit-reason.tier.${i.tier}`)})]}),s("div",{class:"flex justify-between items-center gap-2 text-xs font-mono text-light-muted dark:text-dark-muted",children:[s("span",{children:i.layer}),s("span",{class:"truncate",children:i.tier==="always"?r("dashboard.rule-topology.hit-reason.global"):i.scope})]}),i.description!==null&&i.description.length>0?s("p",{class:"text-sm text-light-text dark:text-dark-muted mt-3 leading-relaxed border-t border-light-border dark:border-dark-border pt-3",children:i.description}):null]},`${i.layer}:${i.file}:${i.tier}`))})]})}function $n(t){switch(t){case"always":return"bg-green-500/10 text-green-600 border border-green-500/30 dark:bg-green-500/20 dark:text-green-400";case"path":return"bg-amber-500/10 text-amber-600 border border-amber-500/30 dark:bg-amber-500/20 dark:text-amber-400";case"description":return"bg-slate-500/10 text-slate-600 border border-slate-500/30 dark:bg-slate-500/20 dark:text-slate-400";default:return"bg-light-border/50 text-light-muted dark:bg-white/10 dark:text-dark-muted"}}function Ln(t,e){if(t===null||e===null)return[];const r=new Map(Object.values(t.nodes).map(n=>[n.file,n])),a=[],i=new Set;for(const n of e.L1)wr(a,i,r,n.path,"L1");for(const n of e.L2)wr(a,i,r,n.path,"L2");for(const n of e.description_stubs??[]){const o=`description:${n.path}`;if(i.has(o))continue;const d=r.get(n.path);a.push({file:n.path,layer:"description",tier:"description",scope:d?.scope_glob??"",description:n.description}),i.add(o)}return a.sort((n,o)=>n.file.localeCompare(o.file))}function wr(t,e,r,a,i){const n=`${i}:${a}`;if(e.has(n))return;const o=r.get(a),d=o?.activation?.tier??"path";t.push({file:a,layer:i,tier:d,scope:o?.scope_glob??"",description:d==="description"?o?.activation?.description??null:null}),e.add(n)}function $t({source:t,size:e="sm",variant:r="filled",interactive:a=!1,selected:i=!1,onClick:n}){const{t:o}=G(),d=o(`dashboard.source.${t}`),c="inline-flex items-center gap-1.5 rounded-full font-mono text-[10px] font-bold uppercase tracking-widest border transition-colors",l=e==="sm"?"px-2 py-0.5":"px-3 py-1";let h="";t==="ai"?r==="filled"?h=i?"bg-brand-accent/20 border-brand-accent/50 text-brand-accent dark:bg-purple-500/30 dark:border-purple-500/50 dark:text-purple-300":"bg-brand-accent/10 border-brand-accent/30 text-brand-accent/80 dark:bg-purple-500/10 dark:border-purple-500/30 dark:text-purple-400":h=i?"bg-transparent border-brand-accent text-brand-accent dark:border-purple-500 dark:text-purple-400":"bg-transparent border-brand-accent/30 text-brand-accent/70 dark:border-purple-500/30 dark:text-purple-400/70":r==="filled"?h=i?"bg-teal-500/20 border-teal-500/50 text-teal-600 dark:bg-teal-500/30 dark:border-teal-500/50 dark:text-teal-300":"bg-teal-500/10 border-teal-500/30 text-teal-600/80 dark:bg-teal-500/10 dark:border-teal-500/30 dark:text-teal-400":h=i?"bg-transparent border-teal-500 text-teal-600 dark:border-teal-500 dark:text-teal-400":"bg-transparent border-teal-500/30 text-teal-600/70 dark:border-teal-500/30 dark:text-teal-400/70";const _=`${c} ${l} ${h} ${a&&!i?"hover:bg-opacity-80 dark:hover:bg-opacity-80 cursor-pointer":""}`,b=t==="ai"?"bg-brand-accent dark:bg-purple-400":"bg-teal-500 dark:bg-teal-400";return a?s("button",{class:_,type:"button","aria-pressed":i,onClick:n,children:[s("span",{class:`w-1.5 h-1.5 rounded-full ${b} ${i?"shadow-[0_0_8px_currentColor]":""}`,"aria-hidden":"true"}),d]}):s("span",{class:_,children:[s("span",{class:`w-1.5 h-1.5 rounded-full ${b} ${i?"shadow-[0_0_8px_currentColor]":""}`,"aria-hidden":"true"}),d]})}function Pn({entry:t,onAnnotate:e,expanded:r=!1,readOnly:a=!1}){const{locale:i,t:n}=G(),[o,d]=L(r),[c,l]=L(""),h=t.source==="ai",p=!a&&h&&e!==void 0&&t.id!==void 0,_=async()=>{const x=c.trim();!h||e===void 0||x.length===0||(await e(t,x),l(""),d(!1))};return s("article",{class:`p-5 rounded-2xl border bg-light-surface dark:bg-dark-surface dark:backdrop-blur-xl shadow-sm ${h?"border-brand-accent/30 dark:border-purple-500/30":"border-teal-500/30 dark:border-teal-500/30"} flex flex-col gap-3 relative`,"aria-label":n("dashboard.timeline-entry.aria-label",{source:n(`dashboard.source.${t.source}`),intent:t.intent}),children:[s("div",{class:"flex flex-wrap items-center gap-3",children:[s($t,{source:t.source}),h?s("span",{class:"font-mono text-[10px] px-2 py-1 rounded-md bg-light-border/50 text-light-muted dark:bg-white/10 dark:text-dark-muted border border-light-border dark:border-dark-border",children:t.commit_sha?t.commit_sha.substring(0,8):n("dashboard.timeline-entry.working-tree")}):null,h?null:s("span",{class:"font-mono text-[10px] px-2 py-1 rounded-md bg-light-border/50 text-light-muted dark:bg-white/10 dark:text-dark-muted border border-light-border dark:border-dark-border",children:n("dashboard.timeline-entry.parent",{parent:t.parent_sha?t.parent_sha.substring(0,8):""})}),h?null:s("span",{class:"font-mono text-[10px] px-2 py-1 rounded-full bg-light-border/30 text-light-muted dark:bg-black/20 dark:text-dark-muted border border-light-border dark:border-dark-border",children:t.diff_stat}),s("time",{class:"ml-auto font-mono text-[10px] text-light-muted dark:text-dark-muted opacity-60 tracking-wider",dateTime:new Date(t.ts).toISOString(),children:On(t.ts,i)})]}),s("h3",{class:"text-base font-medium text-light-text dark:text-white/90 leading-tight m-0",children:t.intent}),s("div",{class:"flex flex-wrap gap-2 text-[10px] font-mono text-light-muted dark:text-dark-muted mt-1",children:[s("span",{class:"flex items-center gap-1 opacity-70",children:[s("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})," ",t.affected_paths.length," ",n("dashboard.timeline-entry.paths")]}),t.affected_paths.slice(0,3).map(x=>s("span",{class:"truncate max-w-[120px] bg-light-border/20 dark:bg-white/5 px-1.5 py-0.5 rounded",children:x.split("/").pop()},x)),t.affected_paths.length>3&&s("span",{class:"opacity-50",children:"..."})]}),!h&&t.annotation!==void 0?s("div",{class:"mt-2 p-3 rounded-lg bg-teal-500/5 border border-teal-500/10 dark:bg-teal-500/10 dark:border-teal-500/20 text-sm text-light-text dark:text-dark-text leading-relaxed",children:[s("div",{class:"text-[10px] font-bold text-teal-600 dark:text-teal-400 uppercase tracking-widest mb-1",children:n("dashboard.timeline-entry.annotation-label")}),t.annotation]}):null,h&&p?s("div",{class:"mt-1 flex justify-end",children:s("button",{class:"text-[10px] font-bold uppercase tracking-widest text-light-muted hover:text-light-text dark:text-dark-muted dark:hover:text-white/80 transition-colors flex items-center gap-1 px-2 py-1 rounded hover:bg-light-border/50 dark:hover:bg-white/10",type:"button",onClick:x=>{x.stopPropagation(),d(P=>!P)},children:[s("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),n("dashboard.timeline-entry.annotate")]})}):null,o&&h?s("form",{class:"mt-3 flex flex-col gap-3 p-4 rounded-xl bg-light-border/30 border border-light-border dark:bg-black/20 dark:border-dark-border",onClick:x=>x.stopPropagation(),onSubmit:x=>{x.preventDefault(),_()},children:[s("label",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",htmlFor:`annotate-${t.id??t.ts}`,children:n("dashboard.timeline-entry.annotation-label")}),s("input",{id:`annotate-${t.id??t.ts}`,class:"px-3 py-2 rounded-lg text-sm bg-light-surface border border-light-border text-light-text dark:bg-dark-surface dark:border-dark-border dark:text-dark-text placeholder:text-light-muted dark:placeholder:text-dark-muted focus:outline-none focus:ring-2 focus:ring-brand-accent/50 transition-shadow w-full",value:c,onInput:x=>l(x.currentTarget.value),placeholder:n("dashboard.timeline-entry.annotation-placeholder")}),s("div",{class:"flex justify-end gap-2 mt-1",children:s(Cn,{variant:"annotate",size:"sm",onClick:_,children:n("dashboard.timeline-entry.annotation-save")})})]}):null]})}function On(t,e){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(t))}function aa({node:t,level:e,selected:r=!1,onSelect:a,humanLockedNearby:i=!1,staleReason:n=null,defaultExpanded:o=!1,readOnly:d=!1,children:c=[]}){const{t:l}=G(),[h,p]=L(o),_=c.length>0,b=t.file,x=n===null?"ok":n==="orphan"?"orphan":"stale",P=()=>{d||(_&&p(F=>!F),a?.(b))},R=F=>{d||((F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P()),F.key==="ArrowRight"&&_&&p(!0),F.key==="ArrowLeft"&&_&&p(!1))},T=()=>{switch(e){case 0:return"";case 1:return"ml-4";case 2:return"ml-8";case 3:return"ml-12";default:return""}},E=()=>r?"bg-brand-accent/10 border border-brand-accent/20 dark:bg-purple-500/10 dark:border-purple-500/20 dark:shadow-[inset_0_0_12px_rgba(168,85,247,0.05)]":d?"border border-transparent":"hover:bg-light-border/30 dark:hover:bg-white/5 border border-transparent",W=(()=>{switch(e){case 0:return{label:"L0",class:"text-light-muted dark:text-dark-muted bg-light-border/50 dark:bg-white/10"};case 1:return{label:"L1",class:"text-brand-accent dark:text-purple-400 bg-brand-accent/20 dark:bg-purple-500/20"};case 2:return{label:"L2",class:"text-brand-warning dark:text-amber-400 bg-brand-warning/10 dark:bg-amber-500/10"};case 3:return{label:"L3",class:"text-slate-500 dark:text-slate-400 bg-slate-500/10 dark:bg-slate-500/10"};default:return{label:"Lx",class:""}}})();return s("div",{class:"flex flex-col mb-0.5",children:[s("div",{class:`flex items-center justify-between px-3 py-2 rounded-lg cursor-pointer text-sm transition-all duration-200 ${T()} ${E()}`,role:"treeitem","aria-expanded":_?h:void 0,"aria-level":e+1,"aria-readonly":d||void 0,tabIndex:d?-1:0,onClick:d?void 0:P,onKeyDown:d?void 0:R,children:[s("div",{class:"flex items-center gap-2 overflow-hidden",children:[s("span",{class:`w-4 h-4 flex items-center justify-center text-light-muted dark:text-dark-muted transition-transform ${h?"rotate-90":""}`,"aria-hidden":"true",children:_?s("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})}):"•"}),s("span",{class:`text-[10px] font-bold px-1.5 py-0.5 rounded ${W.class}`,children:W.label}),s("span",{class:`font-mono truncate ${r?"font-bold text-brand-accent dark:text-purple-100":"text-light-muted dark:text-dark-muted"} ${e===0?"font-medium text-light-text dark:text-white/90":""}`,children:b}),i?s("span",{class:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-bold uppercase tracking-wider",children:l("dashboard.tree-node.locked")}):null,n!==null?s("div",{class:"ml-2 flex items-center",children:s(se,{kind:"pill",severity:x,message:l(`dashboard.tree-node.stale.${n}`)})}):null]}),s("div",{class:"flex items-center gap-2 shrink-0 ml-4 hidden sm:flex",children:s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted opacity-50",children:Fn(t.hash)})})]}),_&&h?s("div",{class:"flex flex-col mt-0.5 relative",role:"group",children:[s("div",{class:`absolute top-0 bottom-0 left-[22px] ${e===0?"":e===1?"ml-4":e===2?"ml-8":"ml-12"} w-px bg-light-border/50 dark:bg-dark-border/50 z-0`}),c.map(F=>s(aa,{...F,onSelect:a,readOnly:d},`${F.node.file}:${F.level}`))]}):null]})}function Fn(t){return t.length>18?`${t.slice(0,12)}…`:t}const Oe="packages/dashboard/src/views/rules-explain.tsx";function Mn(t,e,r){const a=r.trim().toLowerCase(),i=Object.values(t.nodes).filter(d=>a.length===0||JSON.stringify(d).toLowerCase().includes(a)).sort((d,c)=>d.file.localeCompare(c.file)),n=new Map;for(const d of i){const c=d.file.split("/")[0]??"root";n.set(c,[...n.get(c)??[],d])}return[{node:jt({file:`revision:${t.revision}`,scope_glob:"**/*",deps:[],priority:"high",hash:t.revision}),level:0,defaultExpanded:!0,children:Array.from(n.entries()).map(([d,c])=>({node:jt({file:d,scope_glob:`${d}/**/*`,deps:[],priority:"medium",hash:`${c.length} nodes`}),level:1,defaultExpanded:!0,children:c.map(l=>({node:l,level:2,humanLockedNearby:e.has(l.file),staleReason:l.hash.length===0?"hash-mismatch":null}))}))}]}function zn({lastEvent:t}){const{t:e}=G(),[r,a]=L(null),[i,n]=L(null),[o,d]=L(Oe),[c,l]=L(Oe),[h,p]=L(null),[_,b]=L(""),[x,P]=L(null),R=async q=>{try{const[B,j]=await Promise.all([Ta(),Aa(q)]);a(B),n(j),l(q),P(null)}catch(B){P(B instanceof Error?B.message:String(B))}};K(()=>{R(Oe)},[]),K(()=>{(t?.type==="meta:updated"||t?.type==="drift:detected"||t?.type==="lock:drift")&&R(c)},[c,t]);const T=ne(()=>new Set,[]),E=ne(()=>r===null?[]:Mn(r,T,_),[r,T,_]),Z=h===null?null:r?.nodes[h]??null,W=ne(()=>r===null?[]:Object.values(r.nodes),[r]),F=(i?.L1.length??0)+(i?.L2.length??0)+(i?.description_stubs?.length??0);return s("div",{class:"flex-1 flex flex-col gap-4 min-h-0 relative",children:[x!==null?s("div",{class:"z-50 px-4 pt-2 shrink-0",children:s(se,{kind:"banner",severity:"stale",message:x})}):null,s("div",{class:"flex-1 flex flex-col md:flex-row gap-4 min-h-0",children:[s("div",{class:"w-full md:w-1/3 xl:w-1/4 flex flex-col overflow-hidden bg-light-surface border-r border-light-border sm:border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex justify-between items-center bg-light-surface/90 dark:bg-transparent z-10 shrink-0",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted",children:"Registry Tree"}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border",children:r===null?"...":`${Object.keys(r.nodes).length} Nodes`})]}),s("div",{class:"p-3 border-b border-light-border dark:border-dark-border shrink-0 flex gap-2",children:[s("input",{class:"flex-1 px-3 py-1.5 rounded-lg text-sm bg-light-border/30 border border-light-border text-light-text dark:bg-black/20 dark:border-dark-border dark:text-dark-text placeholder:text-light-muted dark:placeholder:text-dark-muted focus:outline-none focus:ring-2 focus:ring-brand-accent/50 transition-shadow",value:_,onInput:q=>b(q.currentTarget.value),placeholder:e("dashboard.rules-tree.filter.placeholder"),"aria-label":e("dashboard.rules-tree.filter.aria-label")}),s("button",{class:"px-3 py-1.5 rounded-lg text-sm font-medium bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-colors",type:"button",onClick:()=>{R(c)},children:"↻"})]}),s("div",{class:"p-3 overflow-y-auto space-y-0.5 flex-1",role:"tree","aria-label":e("dashboard.rules-tree.tree.aria-label"),children:E.length>0?E.map(q=>s(aa,{...q,selected:q.node.file===h,onSelect:B=>{p(B),B&&(d(B),R(B))}},q.node.file)):s("div",{class:"p-4 text-center text-sm text-light-muted dark:text-dark-muted",children:e(r===null?"dashboard.rules-tree.status.loading":"dashboard.rules-tree.empty")})})]}),s("div",{class:"flex-1 flex flex-col overflow-hidden bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl",children:s("div",{class:"p-6 md:p-8 overflow-y-auto flex-1",children:[s("div",{class:"flex items-center gap-2 mb-6",children:[s("input",{class:"flex-1 px-3 py-2 rounded-lg text-sm bg-light-border/30 border border-light-border text-light-text dark:bg-black/20 dark:border-dark-border dark:text-dark-text focus:outline-none focus:ring-2 focus:ring-brand-accent/50 transition-shadow font-mono",value:o,onInput:q=>d(q.currentTarget.value),placeholder:e("dashboard.rule-topology.path.placeholder"),"aria-label":e("dashboard.rule-topology.path.aria-label")}),s("button",{class:"px-4 py-2 rounded-lg text-sm font-medium bg-brand-accent/10 text-brand-accent hover:bg-brand-accent/20 border border-brand-accent/20 dark:bg-brand-accent/20 dark:text-brand-accent dark:border-brand-accent/30 dark:hover:bg-brand-accent/30 transition-colors whitespace-nowrap",type:"button",onClick:()=>{R(o.trim().length>0?o.trim():Oe)},children:e("dashboard.rules-explain.analyze")})]}),s("div",{class:"flex justify-between items-center mb-8 px-4 py-3 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border text-sm font-mono",children:[s("span",{class:"text-light-muted dark:text-dark-muted",children:e("dashboard.rule-topology.status.sample",{path:c})}),s("span",{class:"font-bold text-light-text dark:text-dark-text",children:e("dashboard.rule-topology.status.hits",{count:String(F)})})]}),Z!==null?s("div",{class:"mb-8",children:[s("div",{class:"inline-block px-2.5 py-1 text-xs font-bold rounded-lg font-mono mb-3 border bg-brand-accent/10 text-brand-accent border-brand-accent/20 dark:bg-purple-500/20 dark:text-purple-300 dark:border-purple-500/30 uppercase",children:[Z.priority," Priority"]}),s("div",{class:"flex justify-between items-start mb-6",children:[s("div",{children:s("h2",{class:"text-2xl font-bold font-mono tracking-tight text-light-text dark:text-white/90 break-all",children:Z.file})}),s("div",{class:"text-right hidden sm:block shrink-0 ml-4",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-1",children:"Hash Revision"}),s("div",{class:"font-mono text-xs px-2.5 py-1 rounded-md border bg-light-border/30 border-light-border text-light-text dark:bg-black/30 dark:border-dark-border dark:text-dark-text shadow-inner",children:[Z.hash.substring(0,12),"..."]})]})]}),s("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[s("div",{class:"p-4 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-2",children:e("dashboard.rules-tree.detail.scope")}),s("div",{class:"font-mono text-sm font-medium text-light-text dark:text-dark-text break-all",children:Z.scope_glob})]}),Z.topology_type&&s("div",{class:"p-4 rounded-xl border bg-light-bg/50 border-light-border dark:bg-black/20 dark:border-dark-border",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-2",children:e("dashboard.rules-explain.detail.topology-type")}),s("div",{class:"font-mono text-sm font-medium text-light-text dark:text-dark-text",children:Z.topology_type})]})]})]}):null,s("div",{class:"grid grid-cols-1 xl:grid-cols-2 gap-6",children:[s("div",{children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted mb-4",children:"Hit Reasons"}),s(jn,{meta:r,rulesContext:i})]}),s("div",{children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted mb-4",children:"Coverage Heatmap"}),s(Sn,{nodes:W})]})]})]})})]})]})}const Dn=(t,e,r)=>[];function Zn({lastEvent:t}){const{t:e,locale:r}=G(),[a,i]=L([]),[n,o]=L("all"),[d,c]=L(null),[l,h]=L(null),[p,_]=L(!1),[b,x]=L(null),P=async()=>{try{i(await Ea()),x(null)}catch(j){x(j instanceof Error?j.message:String(j))}};K(()=>{P()},[]),K(()=>{(t?.type==="ledger:appended"||t?.type==="drift:detected"||t?.type==="lock:drift")&&P()},[t]),K(()=>{if(d===null){h(null);return}let j=!1;return _(!0),ja({ledgerId:d}).then(H=>{j||(h(H),x(null))}).catch(H=>{j||(h(null),x(H instanceof Error?H.message:String(H)))}).finally(()=>{j||_(!1)}),()=>{j=!0}},[d]);const R=ne(()=>a.filter(j=>n==="all"||j.source===n),[a,n]),T=a.filter(j=>j.source==="ai").length,E=a.length-T,Z=async(j,H)=>{if(j.id===void 0)throw new Error(e("dashboard.intent-timeline.annotate.missing-id"));const te=await Na({ledger_entry_id:j.id,annotation:H});te.created&&i(sa=>[te.entry,...sa].sort((oa,da)=>da.ts-oa.ts))},W=ne(()=>a.findIndex(j=>j.id===d),[a,d]),F=W>=0?a[W]??null:null,q=F===null?e("dashboard.history-replay.selected.none"):new Date(F.ts).toLocaleString(r),B=ne(()=>l===null?[]:Dn(l.meta),[l]);return s("div",{class:"flex-1 flex flex-col gap-4 min-h-0 relative",children:[s("div",{class:"flex flex-col gap-4 shrink-0",children:[b!==null?s("div",{class:"z-50 px-4 pt-2",children:s(se,{kind:"banner",severity:"stale",message:b})}):null,s("div",{class:"flex items-center gap-3 bg-light-surface border-b border-light-border dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl sm:rounded-2xl sm:shadow-sm sm:border sm:mx-4 p-4 shrink-0 overflow-x-auto",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted shrink-0 mr-2",children:e("dashboard.intent-timeline.filter.label")}),s("button",{class:`px-3 py-1.5 rounded-full text-xs font-bold font-mono transition-colors shrink-0 ${n==="all"?"bg-light-text text-light-bg dark:bg-white dark:text-black":"bg-light-border/30 hover:bg-light-border/50 text-light-muted dark:bg-white/5 dark:hover:bg-white/10 dark:text-dark-muted"}`,type:"button",onClick:()=>o("all"),children:[e("dashboard.intent-timeline.filter.all")," ",s("span",{class:"opacity-60 ml-1",children:a.length})]}),s("div",{class:"shrink-0",onClick:()=>o("ai"),children:s($t,{source:"ai",interactive:!0,selected:n==="ai"})}),s("div",{class:"shrink-0",onClick:()=>o("human"),children:s($t,{source:"human",interactive:!0,selected:n==="human"})}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted ml-auto shrink-0 whitespace-nowrap hidden sm:inline",children:e("dashboard.intent-timeline.summary",{aiCount:String(T),humanCount:String(E)})})]})]}),s("div",{class:"flex-1 flex flex-col md:flex-row gap-4 min-h-0 sm:px-4",children:[s("div",{class:"flex-1 overflow-y-auto pr-2 pb-8 relative",children:[s("div",{class:"absolute left-6 md:left-1/2 top-0 bottom-0 w-0.5 bg-gradient-to-b from-light-border via-light-border/50 to-transparent dark:from-dark-border dark:via-dark-border/50 -translate-x-1/2 z-0 hidden md:block"}),s("div",{class:"absolute left-[39px] top-0 bottom-0 w-0.5 bg-gradient-to-b from-light-border via-light-border/50 to-transparent dark:from-dark-border dark:via-dark-border/50 z-0 block md:hidden"}),s("div",{class:"flex flex-col gap-6 pt-4 relative z-10",children:R.length>0?R.map(j=>s("div",{class:"flex items-start gap-4",onClick:()=>c(j.id??null),children:s("div",{class:"w-full",children:s(Pn,{entry:j,onAnnotate:Z})})},j.id)):s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl sm:rounded-2xl max-w-xl mx-auto w-full",children:e("dashboard.intent-timeline.empty")})})]}),d!==null&&s("aside",{class:"w-full md:w-1/3 xl:w-1/4 flex flex-col overflow-hidden bg-light-surface border border-light-border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl shrink-0 h-full",children:[s("div",{class:"p-4 border-b border-light-border dark:border-dark-border flex flex-col gap-3 bg-light-surface/90 dark:bg-transparent z-10 shrink-0",children:[s("div",{class:"flex justify-between items-start w-full",children:[s("div",{children:s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0 flex items-center gap-2",children:[s("svg",{class:"w-4 h-4 text-brand-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),e("dashboard.timeline.history-replay.title")]})}),s("button",{class:"w-6 h-6 rounded-full bg-light-border/50 hover:bg-light-border text-light-muted dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-muted flex items-center justify-center transition-colors",onClick:()=>c(null),children:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),s("div",{class:"flex flex-col gap-1 text-[10px] font-mono text-light-muted dark:text-dark-muted",children:[s("span",{class:"truncate",children:[s("span",{class:"opacity-50 mr-1",children:"ID:"})," ",d.substring(0,16),"..."]}),s("span",{class:"truncate",children:[s("span",{class:"opacity-50 mr-1",children:"Time:"})," ",q]})]})]}),s("div",{class:"flex-1 overflow-y-auto p-4 flex flex-col gap-4",children:[p&&s("div",{class:"py-12 text-center text-xs text-light-muted dark:text-dark-muted animate-pulse",children:e("dashboard.history-replay.loading")}),!p&&B.length>0?s("div",{class:"text-xs text-light-muted dark:text-dark-muted text-center py-8",children:"Coming soon..."}):!p&&s("div",{class:"text-xs text-light-muted dark:text-dark-muted text-center py-8",children:e("dashboard.history-replay.no-data")})]})]})]})]})}function Un({lastEvent:t,connected:e=!1}){const{t:r}=G(),[a,i]=L(null),[n,o]=L(!0),[d,c]=L(null),l=async()=>{o(!0);try{i(await Ra()),c(null)}catch(h){c(h instanceof Error?h.message:String(h))}finally{o(!1)}};return K(()=>{l()},[]),K(()=>{(t?.type==="meta:updated"||t?.type==="ledger:appended"||t?.type==="drift:detected")&&l()},[t]),s("div",{class:"flex-1 flex flex-col gap-6 max-w-5xl mx-auto w-full p-4 md:p-6 lg:p-8",children:[d!==null?s("div",{class:"mb-4",children:s(se,{kind:"banner",severity:"stale",message:d})}):null,s("div",{class:"flex items-center justify-between bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl sm:rounded-2xl sm:shadow-sm p-4 flex-wrap gap-4",children:[s("div",{class:"flex items-center gap-3",children:[s("span",{class:"text-xs font-bold uppercase tracking-wider text-light-muted dark:text-dark-muted",children:r("dashboard.doctor.toolbar.overall")}),s(se,{kind:"pill",severity:ia(a?.status??"warn"),message:r(a===null?"dashboard.shared.loading":`dashboard.shared.status.${a.status}`)})]}),s("div",{class:"flex items-center gap-4 ml-auto",children:[s("span",{class:"font-mono text-sm text-light-muted dark:text-dark-muted hidden md:inline",children:a===null?r("dashboard.doctor.toolbar.no-summary"):a.summary.entryPoints.length===1?r("dashboard.doctor.toolbar.entry-point-summary",{framework:gt(a.summary.framework,r),count:"1"}):r("dashboard.doctor.toolbar.entry-points-summary",{framework:gt(a.summary.framework,r),count:String(a.summary.entryPoints.length)})}),s("span",{class:`flex items-center gap-1.5 text-[10px] font-bold px-2 py-1 rounded-full uppercase ${e?"bg-green-500/10 text-green-600 dark:bg-green-500/20 dark:text-green-400":"bg-red-500/10 text-red-600 dark:bg-red-500/20 dark:text-red-400"}`,children:[s("span",{class:`w-1.5 h-1.5 rounded-full ${e?"bg-green-500 shadow-[0_0_8px_#22c55e] animate-pulse":"bg-red-500 shadow-[0_0_8px_#ef4444]"}`}),r(e?"dashboard.health.runtime.connected":"dashboard.health.runtime.disconnected")]}),s("button",{class:"px-3 py-1.5 rounded-lg text-sm font-medium bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-colors",type:"button",onClick:()=>{l()},children:r("dashboard.shared.refresh")})]})]}),n&&a===null?s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted bg-light-surface border border-light-border dark:bg-dark-surface dark:border-dark-border sm:rounded-2xl",children:r("dashboard.doctor.empty.loading")}):null,a!==null?s("div",{class:"flex flex-col gap-6",children:[s("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[s(Fe,{label:r("dashboard.doctor.summary.framework"),value:gt(a.summary.framework,r),detail:a.summary.metaRevision===null?r("dashboard.doctor.summary.no-meta-revision"):`rev ${a.summary.metaRevision}`}),s(Fe,{label:"Rule index",value:`${a.summary.ruleCount} rules`,detail:a.summary.computedMetaRevision===null?r("dashboard.doctor.summary.no-meta-revision"):`computed ${a.summary.computedMetaRevision}`}),s(Fe,{label:"Issues",value:`${a.summary.fixableErrorCount}/${a.summary.manualErrorCount}/${a.summary.warningCount}`,detail:"fixable / manual / warnings"}),s(Fe,{label:r("dashboard.health.ledger-path.label"),value:a.summary.eventLedgerPath,detail:r("dashboard.health.ledger-path.detail")})]}),s("div",{class:"p-5 sm:p-6 rounded-2xl border bg-brand-warning/5 border-brand-warning/30 dark:bg-amber-500/5 dark:border-amber-500/20 relative overflow-hidden shadow-sm",children:[s("div",{class:"absolute top-0 left-0 w-1 h-full bg-brand-warning dark:bg-amber-500 shadow-[0_0_10px_#f59e0b]"}),s("h3",{class:"text-sm font-bold mb-2 flex items-center gap-2 text-brand-warning dark:text-amber-400",children:[s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),r("dashboard.health.boundary.title")]}),s("p",{class:"text-sm mb-4 text-light-text dark:text-dark-muted",children:r("dashboard.health.boundary.description")}),a.summary.fixableErrorCount>0&&s("div",{class:"mt-4",children:[s("strong",{class:"text-sm text-brand-warning dark:text-amber-400 block mb-2",children:r("dashboard.health.boundary.cli-action")}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted mb-2",children:r("dashboard.health.boundary.cli-prompt",{count:String(a.summary.fixableErrorCount)})}),s("div",{class:"rounded-lg p-3 font-mono text-xs flex justify-between items-center border shadow-inner bg-zinc-900 border-zinc-800 text-zinc-300 dark:bg-black/50 dark:border-white/5 dark:text-white/80",children:[s("span",{children:[s("span",{class:"text-zinc-500 dark:text-white/30 mr-2",children:"$"}),"fabric doctor --fix"]}),s("button",{class:"text-zinc-400 hover:text-white dark:text-white/40 dark:hover:text-white transition-colors flex items-center gap-1.5 bg-white/5 px-2 py-1 rounded",onClick:()=>navigator.clipboard.writeText("fabric doctor --fix"),children:[s("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy"]})]})]})]}),s("div",{class:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent flex justify-between items-center",children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:r("dashboard.doctor.card.entry-points")}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border",children:a.summary.entryPoints.length})]}),a.summary.entryPoints.length>0?s("div",{class:"flex flex-col",children:a.summary.entryPoints.map(h=>s("div",{class:"p-5 flex flex-col gap-1 border-b border-light-border dark:border-dark-border last:border-0 hover:bg-light-border/10 dark:hover:bg-white/5 transition-colors",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text break-all",children:h.path}),s("span",{class:"text-xs text-light-muted dark:text-dark-muted",children:h.reason})]},`${h.path}:${h.reason}`))}):s("div",{class:"p-8 text-center text-sm text-light-muted dark:text-dark-muted",children:r("dashboard.doctor.empty.entry-points")})]}),s("article",{class:"flex flex-col bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl overflow-hidden",children:[s("div",{class:"p-5 border-b border-light-border dark:border-dark-border bg-light-surface/90 dark:bg-transparent flex justify-between items-center",children:[s("h3",{class:"text-sm font-bold uppercase tracking-wider text-light-text dark:text-dark-text m-0",children:r("dashboard.doctor.card.checks")}),s("span",{class:"text-[10px] font-mono bg-light-border/50 dark:bg-white/10 px-2 py-0.5 rounded-full border border-light-border dark:border-dark-border",children:a.checks.length})]}),s("div",{class:"flex flex-col",children:a.checks.map(h=>s(Hn,{check:h},h.name))})]})]})]}):null]})}function Fe({label:t,value:e,detail:r}){return s("article",{class:"p-4 sm:p-5 flex flex-col gap-2 bg-light-surface border border-light-border dark:bg-dark-surface dark:border-white/5 sm:rounded-2xl sm:shadow-sm dark:shadow-xl dark:backdrop-blur-3xl",children:[s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest",children:t}),s("strong",{class:"text-xl sm:text-2xl font-bold text-light-text dark:text-dark-text truncate",title:e,children:e}),s("span",{class:"font-mono text-xs text-light-muted dark:text-dark-muted truncate",title:r,children:r})]})}function Hn({check:t}){const{t:e}=G(),r=ia(t.status);return s("div",{class:`p-5 flex flex-col gap-2 border-b border-light-border dark:border-dark-border last:border-0 ${{ok:"bg-green-500/5 dark:bg-green-500/10",locked:"bg-amber-500/5 dark:bg-amber-500/10",stale:"bg-red-500/5 dark:bg-red-500/10"}[r]}`,children:[s("div",{class:"flex items-center justify-between",children:[s("strong",{class:"font-mono text-sm text-light-text dark:text-dark-text",children:t.name}),s(se,{kind:"pill",severity:r,message:e(`dashboard.shared.status.${t.status}`)})]}),s("p",{class:"text-sm text-light-muted dark:text-dark-muted m-0",children:t.message})]})}function ia(t){switch(t){case"ok":return"ok";case"warn":return"locked";case"error":return"stale"}}function gt(t,e){const r=[t.kind,t.version,t.subkind].filter(a=>a!=="unknown");return r.length>0?r.join(" · "):e("dashboard.doctor.framework.unknown")}function Bn(){return s(Ja,{children:s(Vn,{})})}function Vn(){const{t}=G(),[e,r]=L(Cr()),[a,i]=L(()=>{const l=localStorage.getItem("fabric-theme");return l==="light"||l==="dark"?l:document.documentElement.classList.contains("dark")?"dark":"light"}),n=Ha();K(()=>{a==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("fabric-theme",a)},[a]);const o=()=>{i(l=>l==="dark"?"light":"dark")},d=[{id:"readiness",hash:"#/readiness",label:t("dashboard.app.nav.readiness.label"),subtitle:t("dashboard.app.nav.readiness.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{id:"rules-explain",hash:"#/rules-explain",label:t("dashboard.app.nav.rules-explain.label"),subtitle:t("dashboard.app.nav.rules-explain.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})},{id:"timeline",hash:"#/timeline",label:t("dashboard.app.nav.timeline.label"),subtitle:t("dashboard.app.nav.timeline.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})},{id:"health",hash:"#/health",label:t("dashboard.app.nav.health.label"),subtitle:t("dashboard.app.nav.health.subtitle"),icon:s("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})})}];K(()=>{const l=()=>r(Cr());return window.addEventListener("hashchange",l),(window.location.hash===""||window.location.hash==="#/topology"||window.location.hash==="#/rules")&&(window.location.hash="#/rules-explain"),()=>window.removeEventListener("hashchange",l)},[]);const c=ne(()=>d.find(l=>l.id===e)??d[1],[d,e]);return s("div",{class:"h-screen w-screen flex overflow-hidden antialiased bg-light-bg text-light-text dark:bg-dark-bg dark:text-dark-text selection:bg-brand-accent/30 relative p-0 sm:p-4 gap-4",children:[s("div",{class:"ambient-blob bg-purple-600 w-[500px] h-[500px] top-[-20%] left-[-10%] transition-opacity duration-500 opacity-0 dark:opacity-30"}),s("div",{class:"ambient-blob bg-brand-accent w-[500px] h-[500px] bottom-[-20%] right-[10%] transition-opacity duration-500 opacity-0 dark:opacity-30"}),s("aside",{class:"w-64 hidden md:flex flex-col overflow-hidden bg-light-surface border-r border-light-border sm:border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-[0_8px_32px_rgba(0,0,0,0.4)] z-20",children:[s("div",{class:"p-6",children:s("div",{class:"flex items-center justify-between",children:s("div",{class:"flex items-center gap-3",children:[s("div",{class:"w-8 h-8 rounded-xl bg-gradient-to-br from-brand-accent to-purple-600 flex items-center justify-center font-bold text-white shadow-md dark:shadow-[0_0_12px_rgba(59,130,246,0.3)]",children:"F"}),s("span",{class:"font-semibold text-light-text dark:text-dark-text",children:["Fabric ",s("span",{class:"text-light-muted dark:text-dark-muted font-normal",children:["v","1.7.0"]})]})]})})}),s("nav",{class:"flex-1 px-4 space-y-1.5 mt-2",children:[s("div",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted uppercase tracking-widest mb-3 px-3",children:t("dashboard.app.nav.section.insights")}),d.map(l=>{const h=l.id===e;return s("a",{href:l.hash,"aria-current":h?"page":void 0,class:`flex items-center gap-3 px-3 py-2.5 rounded-xl font-medium transition-all duration-200 ${h?"bg-brand-accent/10 text-brand-accent border border-brand-accent/20 dark:bg-white/15 dark:text-white dark:border-white/20 dark:shadow-[0_0_12px_rgba(255,255,255,0.05)]":"text-light-muted hover:bg-light-border/50 hover:text-light-text dark:text-dark-muted dark:hover:bg-white/5 dark:hover:text-dark-text"}`,children:[l.icon,l.label]},l.id)})]}),s("div",{class:"p-4 border-t border-light-border dark:border-dark-border mx-4 mb-4 mt-auto rounded-xl bg-light-border/30 dark:bg-black/20",children:s("div",{class:"flex items-center justify-between",children:s("div",{class:"flex items-center gap-2",children:[s("div",{class:`w-2 h-2 rounded-full ${n.connected?"bg-green-500 shadow-[0_0_8px_#22c55e] animate-pulse":"bg-red-500 shadow-[0_0_8px_#ef4444]"}`}),s("span",{class:"text-[10px] font-bold text-light-muted dark:text-dark-muted font-mono uppercase",children:n.connected?t("dashboard.app.header.connected"):t("dashboard.app.header.connecting")})]})})})]}),s("main",{class:"flex-1 flex flex-col gap-4 min-w-0 z-10",children:[s("header",{class:"h-16 flex items-center justify-between px-6 shrink-0 bg-light-surface border-b border-light-border sm:border sm:rounded-2xl sm:shadow-sm dark:bg-dark-surface dark:border-white/5 dark:backdrop-blur-3xl dark:shadow-xl",children:[s("div",{children:[s("h1",{class:"text-lg font-semibold",children:c.label}),s("p",{class:"text-xs text-light-muted dark:text-dark-muted font-mono mt-0.5",children:c.subtitle})]}),s("div",{class:"flex items-center gap-4",children:s("button",{onClick:o,class:"p-2 rounded-lg bg-light-border/50 hover:bg-light-border text-light-text dark:bg-white/10 dark:hover:bg-white/20 dark:text-dark-text transition-all duration-200 shadow-sm cursor-pointer",title:"Toggle Theme",children:a==="dark"?s("svg",{class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):s("svg",{class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})})]}),s("div",{class:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:[e==="readiness"?s(Qa,{}):null,e==="rules-explain"?s(zn,{lastEvent:n.lastEvent}):null,e==="timeline"?s(Zn,{lastEvent:n.lastEvent}):null,e==="health"?s(Un,{lastEvent:n.lastEvent,connected:n.connected}):null]})]}),s("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",children:n.lastEvent===null?"":t("dashboard.app.live-region.received",{type:n.lastEvent.type})})]})}function Cr(){switch(window.location.hash){case"#/readiness":return"readiness";case"#/rules-explain":return"rules-explain";case"#/timeline":return"timeline";case"#/health":return"health";default:return"rules-explain"}}const na=document.getElementById("app");if(na===null)throw new Error("Fabric Dashboard root element #app was not found.");ba(s(Bn,{}),na);