import{d,bn as O,dJ as R,dK as v,cX as j}from"./index-CeMilrX4.js";/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],lt=d("eye-off",D);/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const G=[["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}],["path",{d:"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",key:"uwwb07"}]],ft=d("ghost",G);/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const V=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ut=d("git-branch",V);/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const q=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],ht=d("grip-vertical",q);/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],mt=d("maximize-2",z);/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],gt=d("minimize-2",L);class W{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(o=>{o.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const F=()=>new W;function dt(){return O(F)}const yt={hidden:{opacity:0,scale:.9},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:400,damping:15}},exit:{opacity:0,scale:.9,transition:{duration:v.fast}}},pt={hidden:{opacity:0,y:"100%"},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:400,damping:30}},exit:{opacity:0,y:"100%",transition:{duration:v.medium,ease:R.easeIn}}},P=1e-8,Y=100,b=3,B=4,_=5,H=20,K=.001,k=.3,$=30,X=.05,U=.7,w=.3;function M(n,t){let e=0;for(let o=0;o<n.length;o++)e+=n[o]*t[o];return e}function J(n){return Math.sqrt(M(n,n))}function I(n){const t=J(n);if(t>0)for(let e=0;e<n.length;e++)n[e]/=t}function C(n,t){const e=M(n,t);for(let o=0;o<n.length;o++)n[o]-=e*t[o]}function Z(n,t){const e=n.length,o=new Array(e).fill(0);for(let r=0;r<e;r++)for(let c=0;c<e;c++)o[r]+=n[r][c]*t[c];return o}function Q(n){const t=Math.exp(-n/$);return Math.max(X,t)}function tt(n,t,e,o){const r=t.length,c=new Map(t.map((a,s)=>[a,s])),l=Array(r).fill(null).map(()=>Array(r).fill(0));for(const a of n){const s=c.get(a.fromHash),i=c.get(a.toHash);if(s!==void 0&&i!==void 0&&s!==i){const u=a.strength*a.certainCount;let f=1;if(e){const y=e.get(a.fromHash),p=e.get(a.toHash);if(y&&p){const S=j(y[0],y[1],p[0],p[1])/1e3;f=Q(S)}}let h=1;if(o){const y=[a.fromHash,a.toHash].sort().join("-");h=1-(o.get(y)??0)*U}const m=a.symmetryRatio??0,x=w+(1-w)*m,g=Math.pow(u,1-k)*Math.pow(f,k)*h*x;l[s][i]=g,l[i][s]=g}}return l}function N(n){const t=n.length,e=Array(t).fill(null).map(()=>Array(t).fill(0));for(let o=0;o<t;o++){let r=0;for(let c=0;c<t;c++)r+=n[o][c],e[o][c]=-n[o][c];e[o][o]=r}return e}function T(n){const t=n.length,e=Array(t).fill(1/Math.sqrt(t));let o=0;for(let s=0;s<t;s++){let i=0;for(let u=0;u<t;u++)i+=Math.abs(n[s][u]);o=Math.max(o,i)}const r=Array(t).fill(null).map(()=>Array(t).fill(0));for(let s=0;s<t;s++){for(let i=0;i<t;i++)r[s][i]=-n[s][i];r[s][s]=o+r[s][s]}let c=Array(t).fill(0).map((s,i)=>Math.sin(i*12.9898)*43758.5453%1-.5);C(c,e),I(c);let l=0;for(let s=0;s<Y;s++){const i=Z(r,c);C(i,e);const u=M(i,i)/M(c,i);if(I(i),c=i,Math.abs(u-l)<P){const f=o-u;return{vector:c,eigenvalue:f}}l=u}const a=o-l;return{vector:c,eigenvalue:a}}function et(n,t){if(n.length<2)return 0;const e=[];for(const l of n){const a=t.get(l);a&&e.push(a)}if(e.length<2)return 0;const o=Math.min(e.length,20),r=e.length<=o?e:nt(e,o);let c=0;for(let l=0;l<r.length;l++)for(let a=l+1;a<r.length;a++){const s=j(r[l][0],r[l][1],r[a][0],r[a][1])/1e3;c=Math.max(c,s)}return c}function nt(n,t){if(t>=n.length)return n;const e=[],o=n.length/t;for(let r=0;r<t;r++)e.push(n[Math.floor(r*o)]);return e}function ot(n,t,e,o){const r=t.length;if(r<b)return null;const c=new Set(t),l=n.filter(m=>c.has(m.fromHash)&&c.has(m.toHash));if(l.length===0)return null;const a=tt(l,t,e,o),s=N(a),{vector:i,eigenvalue:u}=T(s);if(u<K)return null;const f=[],h=[];for(let m=0;m<r;m++)i[m]<0?f.push(t[m]):h.push(t[m]);return f.length<_||h.length<_?null:{group0:f,group1:h,fiedlerValue:u}}function Mt(n,t,e,o){const r=t.length;if(r<b)return{communities:new Map([[0,t]]),nodePartitions:t.map(f=>({hash:f,community:0,fiedlerValue:0})),numCommunities:1,fiedlerValue:0,isConnected:r<=1};const c=[];let l=1/0;const a=[[t,0]];for(;a.length>0;){const[f,h]=a.shift();if((e?et(f,e):0)>H&&h<B&&f.length>=_*2){const g=ot(n,f,e,o);if(g){l=Math.min(l,g.fiedlerValue),a.push([g.group0,h+1]),a.push([g.group1,h+1]);continue}}c.push(f)}const s=new Map,i=[],u=new Map;for(let f=0;f<c.length;f++){s.set(f,c[f]);for(const h of c[f])u.set(h,f)}for(const f of t)i.push({hash:f,community:u.get(f)??0,fiedlerValue:0});return{communities:s,nodePartitions:i,numCommunities:c.length,fiedlerValue:l===1/0?0:l,isConnected:!0}}function Et(n){const t=["rgba(139, 92, 246, 0.25)","rgba(16, 185, 129, 0.25)","rgba(245, 158, 11, 0.25)","rgba(239, 68, 68, 0.25)","rgba(59, 130, 246, 0.25)","rgba(236, 72, 153, 0.25)","rgba(20, 184, 166, 0.25)","rgba(249, 115, 22, 0.25)"];return t[n%t.length]}function _t(n,t){if(t.length<b)return 0;const e=t.length,o=new Map(t.map((a,s)=>[a,s])),r=Array(e).fill(null).map(()=>Array(e).fill(0));for(const a of n){const s=o.get(a.fromHash),i=o.get(a.toHash);s!==void 0&&i!==void 0&&s!==i&&(r[s][i]=1,r[i][s]=1)}const c=N(r),{eigenvalue:l}=T(c);return Math.max(0,l)}function bt(n){const t=["rgba(139, 92, 246, 0.6)","rgba(16, 185, 129, 0.6)","rgba(245, 158, 11, 0.6)","rgba(239, 68, 68, 0.6)","rgba(59, 130, 246, 0.6)","rgba(236, 72, 153, 0.6)","rgba(20, 184, 166, 0.6)","rgba(249, 115, 22, 0.6)"];return t[n%t.length]}function xt(n,t){let e,o;if(t===void 0)for(const r of n)r!=null&&(e===void 0?r>=r&&(e=o=r):(e>r&&(e=r),o<r&&(o=r)));else{let r=-1;for(let c of n)(c=t(c,++r,n))!=null&&(e===void 0?c>=c&&(e=o=c):(e>c&&(e=c),o<c&&(o=c)))}return[e,o]}const it=Math.sqrt(50),rt=Math.sqrt(10),ct=Math.sqrt(2);function E(n,t,e){const o=(t-n)/Math.max(0,e),r=Math.floor(Math.log10(o)),c=o/Math.pow(10,r),l=c>=it?10:c>=rt?5:c>=ct?2:1;let a,s,i;return r<0?(i=Math.pow(10,-r)/l,a=Math.round(n*i),s=Math.round(t*i),a/i<n&&++a,s/i>t&&--s,i=-i):(i=Math.pow(10,r)*l,a=Math.round(n/i),s=Math.round(t/i),a*i<n&&++a,s*i>t&&--s),s<a&&.5<=e&&e<2?E(n,t,e*2):[a,s,i]}function kt(n,t,e){if(t=+t,n=+n,e=+e,!(e>0))return[];if(n===t)return[n];const o=t<n,[r,c,l]=o?E(t,n,e):E(n,t,e);if(!(c>=r))return[];const a=c-r+1,s=new Array(a);if(o)if(l<0)for(let i=0;i<a;++i)s[i]=(c-i)/-l;else for(let i=0;i<a;++i)s[i]=(c-i)*l;else if(l<0)for(let i=0;i<a;++i)s[i]=(r+i)/-l;else for(let i=0;i<a;++i)s[i]=(r+i)*l;return s}function A(n,t,e){return t=+t,n=+n,e=+e,E(n,t,e)[2]}function wt(n,t,e){t=+t,n=+n,e=+e;const o=t<n,r=o?A(t,n,e):A(n,t,e);return(o?-1:1)*(r<0?1/-r:r)}function It(n,t){let e;for(const o of n)o!=null&&(e<o||e===void 0&&o>=o)&&(e=o);return e}export{lt as E,ut as G,mt as M,kt as a,A as b,ft as c,ht as d,xt as e,_t as f,gt as g,pt as h,bt as i,Et as j,Mt as k,It as m,yt as s,wt as t,dt as u};
