six-degrees 0.2.0 → 0.2.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.
Files changed (180) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +11 -11
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.rsc +11 -11
  13. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
  14. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +9 -9
  15. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/api/admin-delete/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/admin-update/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/bridges/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/bulk-import/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/company-scores/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/connections/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/delete-cluster/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/ingest/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/network/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/outreach/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/queue/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/scraper/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/setup-profile/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/unlock/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/update/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/update-images/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/users/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/avatars/[file]/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/import/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/import/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/import.html +1 -1
  38. package/.next/standalone/.next/server/app/import.rsc +13 -13
  39. package/.next/standalone/.next/server/app/import.segments/_full.segment.rsc +13 -13
  40. package/.next/standalone/.next/server/app/import.segments/_tree.segment.rsc +1 -1
  41. package/.next/standalone/.next/server/app/import.segments/import/__PAGE__.segment.rsc +11 -11
  42. package/.next/standalone/.next/server/app/index.html +1 -1
  43. package/.next/standalone/.next/server/app/index.rsc +13 -13
  44. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +11 -11
  45. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +13 -13
  46. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  47. package/.next/standalone/.next/server/app/launch/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/launch/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/launch.html +2 -2
  50. package/.next/standalone/.next/server/app/launch.rsc +13 -13
  51. package/.next/standalone/.next/server/app/launch.segments/_full.segment.rsc +13 -13
  52. package/.next/standalone/.next/server/app/launch.segments/_tree.segment.rsc +1 -1
  53. package/.next/standalone/.next/server/app/launch.segments/launch/__PAGE__.segment.rsc +11 -11
  54. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/paths/page.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/paths/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/paths.html +1 -1
  59. package/.next/standalone/.next/server/app/paths.rsc +13 -13
  60. package/.next/standalone/.next/server/app/paths.segments/_full.segment.rsc +13 -13
  61. package/.next/standalone/.next/server/app/paths.segments/_tree.segment.rsc +1 -1
  62. package/.next/standalone/.next/server/app/paths.segments/paths/__PAGE__.segment.rsc +11 -11
  63. package/.next/standalone/.next/server/app/profile/page.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/profile/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/profile.html +1 -1
  66. package/.next/standalone/.next/server/app/profile.rsc +13 -13
  67. package/.next/standalone/.next/server/app/profile.segments/_full.segment.rsc +13 -13
  68. package/.next/standalone/.next/server/app/profile.segments/_tree.segment.rsc +1 -1
  69. package/.next/standalone/.next/server/app/profile.segments/profile/__PAGE__.segment.rsc +11 -11
  70. package/.next/standalone/.next/server/app/queue/page.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/queue/page_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/queue.html +1 -1
  73. package/.next/standalone/.next/server/app/queue.rsc +13 -13
  74. package/.next/standalone/.next/server/app/queue.segments/_full.segment.rsc +13 -13
  75. package/.next/standalone/.next/server/app/queue.segments/_tree.segment.rsc +1 -1
  76. package/.next/standalone/.next/server/app/queue.segments/queue/__PAGE__.segment.rsc +11 -11
  77. package/.next/standalone/.next/server/app/setup/page.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/setup.html +1 -1
  80. package/.next/standalone/.next/server/app/setup.rsc +13 -13
  81. package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +13 -13
  82. package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
  83. package/.next/standalone/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +11 -11
  84. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jrmmj-._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qx548g._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1an3leo._.js +1 -1
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1m8zedk._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/_1_fynia._.js +2 -2
  89. package/.next/standalone/.next/server/chunks/_1itd1o_._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h1_f_2._.js +1 -1
  91. package/.next/standalone/.next/server/chunks/ssr/_0bf3x4q._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/ssr/_17gui6a._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/ssr/_1djpk8t._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/ssr/app_import_page_1fmu6_l.js +1 -1
  95. package/.next/standalone/.next/server/chunks/ssr/app_page_1fazqbf.js +1 -1
  96. package/.next/standalone/.next/server/chunks/ssr/app_paths_page_1ol90m7.js +1 -1
  97. package/.next/standalone/.next/server/chunks/ssr/app_profile_page_0u3-l5y.js +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/app_setup_page_1-282zx.js +2 -2
  99. package/.next/standalone/.next/server/chunks/ssr/lib_0i8v-s3._.js +1 -1
  100. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  101. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  102. package/.next/standalone/.next/server/pages/404.html +1 -1
  103. package/.next/standalone/.next/server/pages/500.html +1 -1
  104. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  106. package/.next/standalone/.next/static/chunks/0jk64vo17avsb.js +1 -0
  107. package/.next/standalone/.next/static/chunks/0s65dsrthylo6.js +2 -0
  108. package/.next/standalone/.next/static/chunks/0uyfdhi8dek85.js +16 -0
  109. package/.next/standalone/.next/static/chunks/{1zmpcmngg5c7-.js → 229haorf0f19b.js} +1 -1
  110. package/.next/{static/chunks/3ts-_4i6bfkh2.js → standalone/.next/static/chunks/2g54uafnwuakc.js} +1 -1
  111. package/.next/standalone/.next/static/chunks/2ot61qsv6_0eq.js +1 -0
  112. package/.next/{static/chunks/3pfyuezyqd9ob.js → standalone/.next/static/chunks/2spwqs6b6dx13.js} +1 -1
  113. package/.next/{static/chunks/1odow92u6wxz0.js → standalone/.next/static/chunks/38dlepuubiox0.js} +1 -1
  114. package/.next/standalone/AGENTS.md +10 -0
  115. package/.next/standalone/CHANGELOG.md +41 -0
  116. package/.next/standalone/CONTRIBUTING.md +9 -0
  117. package/.next/standalone/README.md +49 -29
  118. package/.next/standalone/SECURITY.md +12 -9
  119. package/.next/standalone/app/api/scraper/route.js +4 -3
  120. package/.next/standalone/app/api/update/route.js +10 -2
  121. package/.next/standalone/app/components/ForceGraph.js +1 -1
  122. package/.next/standalone/app/components/Sidebar.js +8 -8
  123. package/.next/standalone/app/components/UpdatePanel.js +39 -8
  124. package/.next/standalone/app/import/page.js +3 -3
  125. package/.next/standalone/app/layout.js +2 -2
  126. package/.next/standalone/app/page.js +2 -2
  127. package/.next/standalone/app/paths/page.js +1 -1
  128. package/.next/standalone/app/profile/page.js +0 -178
  129. package/.next/standalone/app/setup/page.js +4 -4
  130. package/.next/standalone/bin/six-degrees.mjs +7 -2
  131. package/.next/standalone/install.sh +1 -1
  132. package/.next/standalone/lib/csv.js +53 -27
  133. package/.next/standalone/lib/release.js +5 -2
  134. package/.next/standalone/lib/scraper-client.js +3 -3
  135. package/.next/standalone/package-lock.json +103 -9
  136. package/.next/standalone/package.json +12 -10
  137. package/.next/standalone/public/demo-data.json +1 -1
  138. package/.next/standalone/scripts/gen-synthetic.mjs +16 -1
  139. package/.next/standalone/scripts/readme_buttons.py +89 -0
  140. package/.next/standalone/scripts/screenshots.py +2 -0
  141. package/.next/standalone/site/app.js +84 -0
  142. package/.next/standalone/site/index.html +221 -0
  143. package/.next/standalone/site/style.css +155 -0
  144. package/.next/standalone/site/video/install-mac-poster.jpg +0 -0
  145. package/.next/standalone/site/video/install-mac.mp4 +0 -0
  146. package/.next/standalone/site/video/linux-poster.jpg +0 -0
  147. package/.next/standalone/site/video/linux.mp4 +0 -0
  148. package/.next/standalone/site/video/scan-poster.jpg +0 -0
  149. package/.next/standalone/site/video/scan.mp4 +0 -0
  150. package/.next/static/chunks/0jk64vo17avsb.js +1 -0
  151. package/.next/static/chunks/0s65dsrthylo6.js +2 -0
  152. package/.next/static/chunks/0uyfdhi8dek85.js +16 -0
  153. package/.next/static/chunks/{1zmpcmngg5c7-.js → 229haorf0f19b.js} +1 -1
  154. package/.next/{standalone/.next/static/chunks/3ts-_4i6bfkh2.js → static/chunks/2g54uafnwuakc.js} +1 -1
  155. package/.next/static/chunks/2ot61qsv6_0eq.js +1 -0
  156. package/.next/{standalone/.next/static/chunks/3pfyuezyqd9ob.js → static/chunks/2spwqs6b6dx13.js} +1 -1
  157. package/.next/{standalone/.next/static/chunks/1odow92u6wxz0.js → static/chunks/38dlepuubiox0.js} +1 -1
  158. package/CHANGELOG.md +41 -0
  159. package/README.md +49 -29
  160. package/SECURITY.md +12 -9
  161. package/bin/six-degrees.mjs +7 -2
  162. package/lib/csv.js +53 -27
  163. package/lib/release.js +5 -2
  164. package/lib/scraper-client.js +3 -3
  165. package/package.json +12 -10
  166. package/public/demo-data.json +1 -1
  167. package/.next/standalone/.next/static/chunks/1wb_is4wsdm-u.js +0 -1
  168. package/.next/standalone/.next/static/chunks/2rrf5kzx2fhin.js +0 -2
  169. package/.next/standalone/.next/static/chunks/2s_k9x4d0gi9h.js +0 -16
  170. package/.next/standalone/.next/static/chunks/3hsi90cejq2dg.js +0 -1
  171. package/.next/static/chunks/1wb_is4wsdm-u.js +0 -1
  172. package/.next/static/chunks/2rrf5kzx2fhin.js +0 -2
  173. package/.next/static/chunks/2s_k9x4d0gi9h.js +0 -16
  174. package/.next/static/chunks/3hsi90cejq2dg.js +0 -1
  175. /package/.next/standalone/.next/static/{N9wokeIiC9rUIGmzBhj6T → ZGTiDrZ5NHGETgGdlhssu}/_buildManifest.js +0 -0
  176. /package/.next/standalone/.next/static/{N9wokeIiC9rUIGmzBhj6T → ZGTiDrZ5NHGETgGdlhssu}/_clientMiddlewareManifest.js +0 -0
  177. /package/.next/standalone/.next/static/{N9wokeIiC9rUIGmzBhj6T → ZGTiDrZ5NHGETgGdlhssu}/_ssgManifest.js +0 -0
  178. /package/.next/static/{N9wokeIiC9rUIGmzBhj6T → ZGTiDrZ5NHGETgGdlhssu}/_buildManifest.js +0 -0
  179. /package/.next/static/{N9wokeIiC9rUIGmzBhj6T → ZGTiDrZ5NHGETgGdlhssu}/_clientMiddlewareManifest.js +0 -0
  180. /package/.next/static/{N9wokeIiC9rUIGmzBhj6T → ZGTiDrZ5NHGETgGdlhssu}/_ssgManifest.js +0 -0
@@ -1,16 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81694,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(40996),n=e.i(19821);e.i(47716);var o=e.i(23685),l=e.i(57161),a=e.i(48708),s=e.i(36755),s=s,d=e.i(7394),d=d,c=e.i(43079),p=e.i(77899),h=e.i(17983),u=e.i(36534),f=e.i(23731);function g(e,t,r){var i,n,o,l=(0,f.default)(.1);function a(e){for(var l=0,a=i.length;l<a;++l){var s=i[l],d=s.x-t||1e-6,c=s.y-r||1e-6,p=Math.sqrt(d*d+c*c),h=(o[l]-p)*n[l]*e/p;s.vx+=d*h,s.vy+=c*h}}function s(){if(i){var t,r=i.length;for(n=Array(r),o=Array(r),t=0;t<r;++t)o[t]=+e(i[t],t,i),n[t]=isNaN(o[t])?0:+l(i[t],t,i)}}return"function"!=typeof e&&(e=(0,f.default)(+e)),null==t&&(t=0),null==r&&(r=0),a.initialize=function(e){i=e,s()},a.strength=function(e){return arguments.length?(l="function"==typeof e?e:(0,f.default)(+e),s(),a):l},a.radius=function(t){return arguments.length?(e="function"==typeof t?t:(0,f.default)(+t),s(),a):e},a.x=function(e){return arguments.length?(t=+e,a):t},a.y=function(e){return arguments.length?(r=+e,a):r},a}function x(e){return function(){return e}}let y=Math.abs,m=Math.atan2,b=Math.cos,v=Math.max,k=Math.min,w=Math.sin,j=Math.sqrt,_=Math.PI,S=_/2,M=2*_;function z(e){return e>=1?S:e<=-1?-S:Math.asin(e)}let C=Math.PI,F=2*C,B=F-1e-6;function R(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class T{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?R:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return R;let r=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=Math.round(arguments[t]*r)/r+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,i){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,t,r,i,n,o){this._append`C${+e},${+t},${+r},${+i},${this._x1=+n},${this._y1=+o}`}arcTo(e,t,r,i,n){if(e*=1,t*=1,r*=1,i*=1,(n*=1)<0)throw Error(`negative radius: ${n}`);let o=this._x1,l=this._y1,a=r-e,s=i-t,d=o-e,c=l-t,p=d*d+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(p>1e-6)if(Math.abs(c*a-s*d)>1e-6&&n){let h=r-o,u=i-l,f=a*a+s*s,g=Math.sqrt(f),x=Math.sqrt(p),y=n*Math.tan((C-Math.acos((f+p-(h*h+u*u))/(2*g*x)))/2),m=y/x,b=y/g;Math.abs(m-1)>1e-6&&this._append`L${e+m*d},${t+m*c}`,this._append`A${n},${n},0,0,${+(c*h>d*u)},${this._x1=e+b*a},${this._y1=t+b*s}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,r,i,n,o){if(e*=1,t*=1,r*=1,o=!!o,r<0)throw Error(`negative radius: ${r}`);let l=r*Math.cos(i),a=r*Math.sin(i),s=e+l,d=t+a,c=1^o,p=o?i-n:n-i;null===this._x1?this._append`M${s},${d}`:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-d)>1e-6)&&this._append`L${s},${d}`,r&&(p<0&&(p=p%F+F),p>B?this._append`A${r},${r},0,1,${c},${e-l},${t-a}A${r},${r},0,1,${c},${this._x1=s},${this._y1=d}`:p>1e-6&&this._append`A${r},${r},0,${+(p>=C)},${c},${this._x1=e+r*Math.cos(n)},${this._y1=t+r*Math.sin(n)}`)}rect(e,t,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r*=1}v${+i}h${-r}Z`}toString(){return this._}}function $(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(null==r)t=null;else{let e=Math.floor(r);if(!(e>=0))throw RangeError(`invalid digits: ${r}`);t=e}return e},()=>new T(t)}function I(e){return e.innerRadius}function W(e){return e.outerRadius}function A(e){return e.startAngle}function E(e){return e.endAngle}function D(e){return e&&e.padAngle}function O(e,t,r,i,n,o,l){var a=e-r,s=t-i,d=(l?o:-o)/j(a*a+s*s),c=d*s,p=-d*a,h=e+c,u=t+p,f=r+c,g=i+p,x=(h+f)/2,y=(u+g)/2,m=f-h,b=g-u,k=m*m+b*b,w=n-o,_=h*g-f*u,S=(b<0?-1:1)*j(v(0,w*w*k-_*_)),M=(_*b-m*S)/k,z=(-_*m-b*S)/k,C=(_*b+m*S)/k,F=(-_*m+b*S)/k,B=M-x,R=z-y,T=C-x,$=F-y;return B*B+R*R>T*T+$*$&&(M=C,z=F),{cx:M,cy:z,x01:-c,y01:-p,x11:M*(n/w-1),y11:z*(n/w-1)}}function L(e){this._context=e}function P(e){return new L(e)}function N(e){return e[0]}function Y(e){return e[1]}function U(){}function H(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function G(e,t){this._context=e,this._k=(1-t)/6}function q(e,t){this._context=e,this._k=(1-t)/6}T.prototype,Array.prototype.slice,L.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},G.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:H(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:H(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function r(e){return new G(e,t)}return r.tension=function(t){return e(+t)},r}(0),q.prototype={areaStart:U,areaEnd:U,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:H(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let X=function e(t){function r(e){return new q(e,t)}return r.tension=function(t){return e(+t)},r}(0);var V=e.i(91889),K=e.i(561),J=e.i(90273),Z=e.i(36377);let Q=e=>()=>e;function ee(e,{sourceEvent:t,subject:r,target:i,identifier:n,active:o,x:l,y:a,dx:s,dy:d,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:n,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:c}})}function et(e){return!e.ctrlKey&&!e.button}function er(){return this.parentNode}function ei(e,t){return null==t?{x:e.x,y:e.y}:t}function en(){return navigator.maxTouchPoints||"ontouchstart"in this}function eo(){var e,t,r,i,n=et,l=er,a=ei,s=en,d={},c=(0,V.dispatch)("start","drag","end"),p=0,h=0;function u(e){e.on("mousedown.drag",f).filter(s).on("touchstart.drag",y).on("touchmove.drag",m,Z.nonpassive).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(a,s){if(!i&&n.call(this,a,s)){var d=v(this,l.call(this,a,s),a,s,"mouse");d&&((0,o.select)(a.view).on("mousemove.drag",g,Z.nonpassivecapture).on("mouseup.drag",x,Z.nonpassivecapture),(0,J.default)(a.view),(0,Z.nopropagation)(a),r=!1,e=a.clientX,t=a.clientY,d("start",a))}}function g(i){if((0,Z.default)(i),!r){var n=i.clientX-e,o=i.clientY-t;r=n*n+o*o>h}d.mouse("drag",i)}function x(e){(0,o.select)(e.view).on("mousemove.drag mouseup.drag",null),(0,J.yesdrag)(e.view,r),(0,Z.default)(e),d.mouse("end",e)}function y(e,t){if(n.call(this,e,t)){var r,i,o=e.changedTouches,a=l.call(this,e,t),s=o.length;for(r=0;r<s;++r)(i=v(this,a,e,t,o[r].identifier,o[r]))&&((0,Z.nopropagation)(e),i("start",e,o[r]))}}function m(e){var t,r,i=e.changedTouches,n=i.length;for(t=0;t<n;++t)(r=d[i[t].identifier])&&((0,Z.default)(e),r("drag",e,i[t]))}function b(e){var t,r,n=e.changedTouches,o=n.length;for(i&&clearTimeout(i),i=setTimeout(function(){i=null},500),t=0;t<o;++t)(r=d[n[t].identifier])&&((0,Z.nopropagation)(e),r("end",e,n[t]))}function v(e,t,r,i,n,o){var l,s,h,f=c.copy(),g=(0,K.pointer)(o||r,t);if(null!=(h=a.call(e,new ee("beforestart",{sourceEvent:r,target:u,identifier:n,active:p,x:g[0],y:g[1],dx:0,dy:0,dispatch:f}),i)))return l=h.x-g[0]||0,s=h.y-g[1]||0,function r(o,a,c){var x,y=g;switch(o){case"start":d[n]=r,x=p++;break;case"end":delete d[n],--p;case"drag":g=(0,K.pointer)(c||a,t),x=p}f.call(o,e,new ee(o,{sourceEvent:a,subject:h,target:u,identifier:n,active:x,x:g[0]+l,y:g[1]+s,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:f}),i)}}return u.filter=function(e){return arguments.length?(n="function"==typeof e?e:Q(!!e),u):n},u.container=function(e){return arguments.length?(l="function"==typeof e?e:Q(e),u):l},u.subject=function(e){return arguments.length?(a="function"==typeof e?e:Q(e),u):a},u.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Q(!!e),u):s},u.on=function(){var e=c.on.apply(c,arguments);return e===c?u:e},u.clickDistance=function(e){return arguments.length?(h=(e*=1)*e,u):Math.sqrt(h)},u}function el(e){return String(e??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function ea(e,t,r,i){let n;e.selectAll("*").remove();let o=(n=String(t.profile_image_url??""),/^\/avatars\/[A-Za-z0-9_-]+\.(webp|png|jpe?g)$/.test(n)||/^https:\/\/[^"'\s<>]+$/.test(n)?n:null);o?e.append("img").attr("src",o).style("width",r+"px").style("height",r+"px").style("border-radius","50%").style("object-fit","cover").style("border",`2px solid ${i}`).style("display","block").on("error",function(){this.parentElement.style.display="none"}):e.style("opacity",0)}function es(){return o.select("body").append("div").attr("class","graph-tooltip").style("position","fixed").style("top","0px").style("left","0px").style("background","rgba(0,0,0,0.92)").style("color","#fff").style("padding","8px 12px").style("border-radius","6px").style("font-size","12px").style("pointer-events","none").style("opacity",0).style("z-index",1e3).style("border","1px solid rgba(255,255,255,0.2)").style("max-width","280px")}function ed(e,t,r){e.call(eo().on("start",(e,r)=>{e.active||t.alphaTarget(.3).restart(),r.fx=r.x,r.fy=r.y}).on("drag",(e,t)=>{t.fx=e.x,t.fy=e.y}).on("end",(e,i)=>{e.active||t.alphaTarget(0),i.id!==r&&"bridge"!==i.nodeType&&(i.fx=null,i.fy=null)}))}ee.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var s=s,d=d,ec=d,ep=e.i(5258);function eh(e){return String(e??"").replace(/[&<>"']/g,e=>"&"===e?"&amp;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"&#39;")}let eu=(0,r.forwardRef)(function({connections:e=[],degree2:i=[],onSelect:n,userName:l="You",userImage:a=null,selectedId:f=null,mode:x="network"},y){let m=(0,r.useRef)(null),b=(0,r.useRef)(null),v=(0,r.useRef)(null),k=(0,r.useRef)(n),w=(0,r.useRef)(f),j=(0,r.useRef)(1),_=(0,r.useRef)(null),S=(0,r.useRef)(()=>{}),M=(0,r.useRef)(()=>{}),[z,C]=(0,r.useState)({w:0,h:0}),F=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>t(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),B=(0,r.useMemo)(()=>`${e.length}:${i.length}:${e.map(e=>e.id).join(",")}|${i.map(e=>e.id).join(",")}`,[e,i]),R=(0,r.useRef)({connections:e,degree2:i});return(0,r.useImperativeHandle)(y,()=>({focusNode:e=>M.current(e)}),[]),(0,r.useEffect)(()=>{k.current=n},[n]),(0,r.useEffect)(()=>{R.current={connections:e,degree2:i}},[e,i]),(0,r.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();C(e=>{let r=Math.round(t.width),i=Math.round(t.height);return e.w===r&&e.h===i?e:{w:r,h:i}})};t();let r=new ResizeObserver(t);return r.observe(e),window.addEventListener("resize",t),()=>{r.disconnect(),window.removeEventListener("resize",t)}},[]),(0,r.useEffect)(()=>{w.current=f,S.current(f)},[f]),(0,r.useEffect)(()=>{let e=b.current;if(!e||z.w<40||z.h<40)return;let t=z.w,r=z.h,{connections:i,degree2:n}=R.current,f="degrees"===x,y=new Set(n.map(e=>e.source_connection_id).filter(Boolean)),C=f?i.filter(e=>y.has(e.id)):i,B=new Map(C.map(e=>[e.id,e])),T=n.filter(e=>e.source_connection_id&&B.has(e.source_connection_id)),$=new Set(C.map(e=>e.tier).filter(Boolean)),I=new Set(n.map(e=>e.source_connection_id).filter(Boolean)),W=new Set(I.size?C.filter(e=>I.has(e.id)).map(e=>e.id):[...C].sort((e,t)=>(Number(t.power_score)||0)-(Number(e.power_score)||0)).slice(0,14).map(e=>e.id)),A={id:"__user__",kind:"user",tier:null,r:26,targetRadius:0,connection:null,x:0,y:0,fx:0,fy:0},E={S:0,A:0,B:0,C:0,D:0},D=[],O=new Map,L=new Map;for(let e of C){let t=e.tier||"D",r=(E[t]=(E[t]||0)+1,(E[t]-1)*2.399963),i=ep.TIER_RING_RADIUS[t]||ep.TIER_RING_RADIUS.D,n=W.has(e.id),o={id:e.id,kind:"d1",hub:n,tier:t,r:n?7+1.1*Number(e.power_score||0):4.5,targetRadius:i,connection:e,x:Math.cos(r)*i,y:Math.sin(r)*i};D.push(o),O.set(e.id,o),L.set(e.id,r)}let P=new Map;for(let e of T){let t=e.source_connection_id,r=P.get(t);r?r.push(e):P.set(t,[e])}let N=[],Y=[],U=ep.TIER_RING_RADIUS.B+70;if(f){let e=[...D].sort((e,t)=>(P.get(t.id)?.length||0)-(P.get(e.id)?.length||0)),t=Math.max(140,9*Math.max(1,e.length)),r=e=>Math.sqrt((P.get(e.id)?.length||0)+4),i=e.reduce((e,t)=>e+r(t),0)||1,n=-Math.PI/2;e.forEach(e=>{let o=r(e)/i*Math.PI*2,l=n+o/2;n+=o;let a=Math.min(.88*o,1.6);e.x=e.fx=Math.cos(l)*t,e.y=e.fy=Math.sin(l)*t,e.hub=!0,e.r=9+Math.min(10,(P.get(e.id)?.length||0)/40);let s=[...P.get(e.id)||[]].sort((e,t)=>(Number(t.power_score)||0)-(Number(e.power_score)||0)),d=0,c=t+e.r+16;for(;d<s.length;){let e=Math.max(1,Math.floor(c*a/9)),t=s.slice(d,d+e);t.forEach((e,r)=>{let i=l+(1===t.length?0:(r/(t.length-1)-.5)*a),n={id:e.id,kind:"d2",tier:e.tier||"D",r:1.8+.32*Math.min(10,Number(e.power_score)||0),connection:e,x:Math.cos(i)*c,y:Math.sin(i)*c};n.fx=n.x,n.fy=n.y,N.push(n)}),d+=t.length,c+=9}U=Math.max(U,c+10)})}for(let[e,t]of f?[]:P){let r=O.get(e);if(!r)continue;let i=L.get(e)??0,n=r.targetRadius,o=Math.min(.15,1.5/Math.max(1,t.length));t.forEach((e,l)=>{let a=i+(l-(t.length-1)/2)*o,s=n+46+l%3*13,d={id:e.id,kind:"d2",tier:e.tier||"D",r:3.5,targetRadius:n+60,connection:e,x:Math.cos(a)*s,y:Math.sin(a)*s};N.push(d),Y.push({source:d,target:r})})}let H=[A,...D,...N],G=[...N,...D,A],q=(0,o.select)(e);q.selectAll("*").remove();let X=q.append("defs"),V=X.append("radialGradient").attr("id","og-user-grad");V.append("stop").attr("offset","0%").attr("stop-color","#f8fafc"),V.append("stop").attr("offset","55%").attr("stop-color","#c7d2fe"),V.append("stop").attr("offset","100%").attr("stop-color","#818cf8"),X.append("filter").attr("id","og-blur").attr("x","-75%").attr("y","-75%").attr("width","250%").attr("height","250%").append("feGaussianBlur").attr("stdDeviation",6);let K=q.append("g").attr("class","viewport"),J=K.append("g"),Z=K.append("g"),Q=K.append("g"),ee=K.append("g"),et=D.filter(e=>e.hub),er=Z.selectAll("line").data(et,e=>e.id).join("line").attr("stroke",e=>ep.TIER_COLORS[e.tier]||ep.TIER_COLORS.D).attr("stroke-opacity",.09).attr("stroke-width",.5);if(f&&D.length){let e=Math.hypot(D[0].x,D[0].y);J.append("circle").attr("r",e).attr("fill","none").attr("stroke","#FF6B35").attr("stroke-opacity",.18).attr("stroke-width",1).attr("stroke-dasharray","3 7")}for(let e of f?[]:ep.TIER_ORDER)$.has(e)&&J.append("circle").attr("r",ep.TIER_RING_RADIUS[e]).attr("fill","none").attr("stroke",ep.TIER_COLORS[e]).attr("stroke-opacity",.14).attr("stroke-width",1).attr("stroke-dasharray","3 7");let ei=Q.selectAll("line").data(Y).join("line").attr("stroke","rgba(255,255,255,0.08)").attr("stroke-width",1),en=ee.selectAll("g").data(G,e=>e.id).join("g").attr("cursor","pointer");en.each(function(e){let t=(0,o.select)(this);if("d2"===e.kind){t.attr("opacity",f?.85:.55),t.append("circle").attr("class","og-base").attr("r",e.r).attr("fill",ep.TIER_COLORS[e.tier]||ep.TIER_COLORS.D);return}let r="user"===e.kind,i=e.connection,n=r?"#818cf8":ep.TIER_COLORS[e.tier]||ep.TIER_COLORS.D;if(!r&&!e.hub){t.attr("opacity",.75),t.append("circle").attr("class","og-base").attr("r",e.r).attr("fill",n);return}(r||"S"===e.tier||"A"===e.tier)&&t.append("circle").attr("r",1.8*e.r).attr("fill",n).attr("opacity",.25).attr("filter","url(#og-blur)"),i&&i.is_catalyst&&(t.append("circle").attr("r",e.r+3).attr("fill","none").attr("stroke",ep.TIER_COLORS.S).attr("stroke-width",1).attr("stroke-opacity",.9),t.append("text").text("⚡").attr("x",.85*e.r).attr("y",-(.7*e.r)).attr("font-size",9).attr("text-anchor","middle").style("pointer-events","none")),t.append("circle").attr("class","og-base").attr("r",e.r).attr("fill",r?"url(#og-user-grad)":n);let s=r?l:i?.name??"";t.append("text").attr("class","og-initials").text((0,ep.initialsFor)(s)).attr("text-anchor","middle").attr("dy","0.35em").attr("font-size",.8*e.r).attr("font-weight",700).attr("fill","#0b0b16").style("pointer-events","none");let d=r?a:i?.profile_image_url??null;if(d){let r=`og-clip-${String(e.id).replace(/[^a-zA-Z0-9_-]/g,"_")}`;X.append("clipPath").attr("id",r).append("circle").attr("r",e.r),t.append("image").attr("href",d).attr("x",-e.r).attr("y",-e.r).attr("width",2*e.r).attr("height",2*e.r).attr("clip-path",`url(#${r})`).attr("preserveAspectRatio","xMidYMid slice").on("error",function(){(0,o.select)(this).remove()})}t.append("circle").attr("class","og-sel").attr("r",e.r+5).attr("fill","none").attr("stroke","#ffffff").attr("stroke-width",1.5).style("opacity",0),r?t.append("text").text(l).attr("y",e.r+18).attr("text-anchor","middle").attr("font-size",12).attr("font-weight",600).attr("fill","#e2e8f0").attr("paint-order","stroke").attr("stroke","rgba(5,5,16,0.85)").attr("stroke-width",3).style("pointer-events","none"):t.append("text").attr("class","og-label").text(i?.name??"").attr("y",e.r+13).attr("text-anchor","middle").attr("font-size",10).attr("fill","#cbd5e1").attr("paint-order","stroke").attr("stroke","rgba(5,5,16,0.8)").attr("stroke-width",3).style("pointer-events","none").style("opacity",0).style("transition","opacity 160ms ease")});let el=en.select("text.og-label"),ea=null,es=()=>{el.style("opacity",e=>+(!0===e.hub||j.current>1.1||e.id===ea||e.id===w.current))};en.on("click",(e,t)=>{e.defaultPrevented||(e.stopPropagation(),k.current?.(t.connection))}),q.on("click",()=>k.current?.(null));let ed=v.current,eu=e=>{let t=m.current;if(!ed||!t)return;let r=t.getBoundingClientRect();ed.style.left=`${Math.min(e.clientX-r.left+14,r.width-190)}px`,ed.style.top=`${Math.max(e.clientY-r.top-8,8)}px`};F||en.on("mouseenter",(e,t)=>{ea=t.id,es(),((e,t)=>{if(!ed||!t.connection)return;let r=t.connection,i=[r.role||r.headline,r.company].filter(Boolean).map(String);ed.innerHTML=`<div style="font-weight:600;color:#f1f5f9">${eh(r.name)}</div>`+(i.length?`<div style="color:#94a3b8;margin-top:1px">${eh(i.join(" · "))}</div>`:"")+`<div style="margin-top:3px;color:${ep.TIER_COLORS[r.tier]||ep.TIER_COLORS.D}">`+`${eh(r.tier||"?")} \xb7 power ${Number(r.power_score||0).toFixed(1)}`+`${r.is_catalyst?" · ⚡ catalyst":""}</div>`,ed.style.opacity="1",eu(e)})(e,t)}).on("mousemove",e=>eu(e)).on("mouseleave",()=>{ea=null,es(),ed&&(ed.style.opacity="0")});let ef=()=>{ei.attr("x1",e=>e.source.x??0).attr("y1",e=>e.source.y??0).attr("x2",e=>e.target.x??0).attr("y2",e=>e.target.y??0),er.attr("x1",0).attr("y1",0).attr("x2",e=>e.x??0).attr("y2",e=>e.y??0),en.attr("transform",e=>`translate(${e.x??0},${e.y??0})`)},eg=null;if(F||f)ef();else{let e=(0,c.forceSimulation)(H).force("radial",g(e=>e.targetRadius,0,0).strength(e=>.9*("d1"===e.kind))).force("collide",(0,u.forceCollide)(e=>e.r+2.5)).force("charge",(0,h.forceManyBody)().strength(-18)).on("tick",ef);Y.length>0&&e.force("link",(0,p.forceLink)(Y).distance(26).strength(.7)),eg=e,ef();let t=eo().on("start",(t,r)=>{t.active||e.alphaTarget(.3).restart(),r.fx=r.x,r.fy=r.y}).on("drag",(e,t)=>{t.fx=e.x,t.fy=e.y}).on("end",(t,r)=>{t.active||e.alphaTarget(0),(r.connection?.circle_power===null||r.connection?.circle_power===void 0)&&(r.fx=null,r.fy=null)});en.filter(e=>"d1"===e.kind).call(t),en.on("dblclick",(t,r)=>{"d1"===r.kind&&(t.stopPropagation(),r.fx=null,r.fy=null,e.alphaTarget(.2).restart(),window.setTimeout(()=>e.alphaTarget(0),400))})}let ex=(0,s.default)().scaleExtent([.15,3]).on("zoom",e=>{K.attr("transform",e.transform.toString()),e.sourceEvent&&(_.current=e.transform),e.transform.k!==j.current&&(j.current=e.transform.k,es())});q.call(ex).on("dblclick.zoom",null);let ey=Math.max(.15,Math.min(3,Math.min(t,r)/(2*U))),em=_.current??d.identity.translate(t/2,r/2).scale(ey);q.call(ex.transform,em),S.current=e=>{ee.selectAll("circle.og-sel-temp").remove(),en.select("circle.og-sel").style("opacity",t=>+(t.id===e)),en.select("circle.og-base").attr("r",t=>t.id===e&&"user"!==t.kind?t.r+1.5:t.r),e&&en.filter(t=>t.id===e&&!t.hub&&"user"!==t.kind).append("circle").attr("class","og-sel-temp").attr("r",e=>e.r+3).attr("fill","none").attr("stroke","#ffffff").attr("stroke-width",1.2),es()},S.current(w.current);let eb=new Map(G.map(e=>[e.id,e]));return M.current=i=>{let n=eb.get(i);if(!n)return;let o=n.x??0,l=n.y??0,a=(0,ec.default)(e),s=d.identity.translate(t/2,r/2).scale(2.5).translate(-o,-l),c=performance.now(),p=e=>{let t=Math.min(1,(e-c)/650),r=1-Math.pow(1-t,3);ex.transform(q,d.identity.translate(a.x+(s.x-a.x)*r,a.y+(s.y-a.y)*r).scale(a.k+(s.k-a.k)*r)),t<1&&requestAnimationFrame(p)};requestAnimationFrame(p),window.setTimeout(()=>ex.transform(q,s),730),k.current?.(n.connection),w.current=i,S.current(i);let h=ee.append("circle").attr("cx",o).attr("cy",l).attr("r",n.r+2).attr("fill","none").attr("stroke","#ffffff").attr("stroke-width",2).attr("opacity",.9),u=performance.now(),f=e=>{let t=Math.min(1,(e-u)/700);h.attr("r",n.r+2+26*t).attr("opacity",.9*(1-t)),t<1?requestAnimationFrame(f):h.remove()};requestAnimationFrame(f),window.setTimeout(()=>h.remove(),800)},()=>{eg?.stop(),S.current=()=>{},M.current=()=>{},q.on(".zoom",null),q.on("click",null),q.selectAll("*").remove()}},[B,l,a,F,z,x]),(0,t.jsxs)("div",{ref:m,style:{position:"relative",flex:1,minHeight:0,width:"100%"},children:[(0,t.jsx)("svg",{ref:b,style:{display:"block",height:"100%",width:"100%",touchAction:"none",userSelect:"none"},role:"img","aria-label":"Your network as an orbital galaxy — closer orbits are higher-leverage tiers"}),(0,t.jsx)("div",{ref:v,"aria-hidden":!0,style:{position:"absolute",zIndex:20,maxWidth:190,pointerEvents:"none",padding:"6px 10px",fontSize:11.5,lineHeight:1.45,borderRadius:8,background:"rgba(10,10,26,0.92)",border:"1px solid rgba(255,255,255,0.12)",backdropFilter:"blur(8px)",opacity:0,transition:"opacity 150ms ease",left:0,top:0}})]})}),ef={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"},eg={1:"#FFD700",2:"#FF6B35",3:"#3498DB",4:"#9B59B6",5:"#00ff88",6:"#ff5050"},ex=-Math.PI/2;function ey(e){let t=e%(2*Math.PI);return t>Math.PI&&(t-=2*Math.PI),t<-Math.PI&&(t+=2*Math.PI),t}function em(e){let t=String(e||"");if(t.length<=16)return t;let r=t.trim().split(/\s+/).filter(Boolean);return r.length<2?`${t.slice(0,15)}…`:`${r[0]} ${r[r.length-1].charAt(0)}.`}let eb={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"},ev=["S","A","B","C","D"],ek={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"},ew={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"},ej=["S","A","B","C","D"],e_={S:0,A:1,B:2,C:3,D:4},eS=["S","A","B","C","D"];function eM(e){let t=parseFloat(e?.power_score);return Number.isFinite(t)?t:0}function ez(e){return Math.round(10*eM(e))/10}function eC(e){return String(e?.profile_url||"").split(/[?#]/)[0].replace(/\/+$/,"")||`id:${e?.id}`}let eF=(e,t)=>String(e??"").localeCompare(String(t??""),void 0,{numeric:!0});function eB(e,t){return(e_[e.tier]??9)-(e_[t.tier]??9)||eM(t)-eM(e)||String(e.name||"").localeCompare(String(t.name||""))||eF(e.id,t.id)}function eR(e,t){return e.bridge&&t.bridge?eB(e.bridge,t.bridge):e.bridge?-1:t.bridge?1:eF(e.id,t.id)}function eT(e,t){return t.score-e.score||t.waysIn-e.waysIn||eR(e.routes[0]||e$,t.routes[0]||e$)||String(e.person.name||"").localeCompare(String(t.person.name||""))||(e.key<t.key?-1:+(e.key>t.key))}let e$={id:null,bridge:null};function eI(e,t){return t.waysIn-e.waysIn||eT(e,t)}function eW(e){let t=String(e||"").trim().split(/\s+/).filter(Boolean);return t.length<2?t[0]||"":`${t[0]} ${t[t.length-1].charAt(0)}.`}function eA(e,t){let r=String(e||"");return t<=1?r?"…":"":r.length>t?`${r.slice(0,t-1)}…`:r}let eE={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"};function eD({person:e,size:r=32,tierColors:i=eE}){let n=i[e?.tier]||"#666";return(0,t.jsxs)("span",{style:{position:"relative",display:"inline-block",width:r,height:r,flexShrink:0,borderRadius:"50%",boxShadow:`0 0 0 ${r>=24?2:1}px ${n}`},children:[(0,t.jsx)("span",{style:{position:"absolute",inset:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:`${n}2e`,color:n,fontWeight:800,fontSize:Math.max(7,Math.round(.36*r)),lineHeight:1},children:(0,ep.initialsFor)(e?.name)}),e?.profile_image_url&&(0,t.jsx)("img",{src:e.profile_image_url,alt:"",loading:"lazy",decoding:"async",onError:e=>{e.currentTarget.style.display="none"},style:{position:"absolute",inset:0,width:r,height:r,borderRadius:"50%",objectFit:"cover"}})]})}let eO="#FF6B35",eL={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"},eP="a connection we can’t name",eN=e=>Number(e||0).toLocaleString("en-US"),eY=(e,t,r)=>`${eN(e)} ${1===e?t:r}`;function eU(e){return e.role&&e.company?`${e.role} @ ${e.company}`:e.headline||e.role||e.company||""}let eH=`
2
- .sepmap .sp { cursor: pointer; transition: opacity .12s; }
3
- .sepmap .ppl:hover .sp { opacity: .28; }
4
- .sepmap .ppl:hover .sp:hover, .sepmap .ppl:hover .sp.sel { opacity: 1; }
5
- .sepmap .sp:hover .rt, .sepmap .sp.sel .rt { stroke-opacity: 1; stroke-width: 2px; }
6
- .sepmap .br { cursor: pointer; }
7
- .sepmap .br:hover text { text-decoration: underline; }
8
- .sepmap .rt { pointer-events: none; }
9
- `,eG={paintOrder:"stroke",stroke:"#0a0a1a",strokeWidth:3,strokeLinejoin:"round"},eq=(0,r.memo)(function({layout:e,selectedKey:i,tierColors:n,youLabel:o,isMobile:l,onPick:a,onPickBridge:s}){let{width:d,height:c,you:p,people:h,bridges:u,links:f,spokes:g}=e,x=(0,r.useMemo)(()=>{let e=new Map;for(let t of f)e.has(t.key)||e.set(t.key,[]),e.get(t.key).push(t);return e},[f]),y=l?36:26,m=l?12:11;return(0,t.jsxs)("svg",{className:"sepmap",width:d,height:c,"aria-hidden":"true",style:{display:"block",overflow:"visible"},children:[(0,t.jsx)("style",{children:eH}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"sepYouGrad",x1:"0",y1:"0",x2:"1",y2:"1",children:[(0,t.jsx)("stop",{offset:"0",stopColor:"#FFD700"}),(0,t.jsx)("stop",{offset:"1",stopColor:"#FF6B35"})]})}),g.map(e=>(0,t.jsx)("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:"#fff",strokeOpacity:.12,strokeWidth:1},`s-${e.id??"unresolved"}`)),(0,t.jsx)("g",{className:"ppl",children:h.map(e=>{let{p:r}=e,o=n[r.tier]||"#888",l=e.key===i,s=r.routes.map(e=>e.bridge?e.bridge.name:eP).join(", ");return(0,t.jsxs)("g",{className:l?"sp sel":"sp",onClick:()=>a(r),children:[(0,t.jsx)("title",{children:`${r.person.name} \xb7 #${r.rank}${r.tied?"=":""} \xb7 ${r.tier} \xb7 ${r.score.toFixed(1)} \xb7 via ${s}`}),(x.get(e.key)||[]).map(r=>{let i=(r.x1+r.x2)/2,o=r.unresolved?"#777":r.primary?eO:n[r.tier]||"#888";return(0,t.jsx)("path",{className:"rt",d:`M${r.x1+5},${r.y1} C${i},${r.y1} ${i},${r.y2} ${r.x2-e.r},${r.y2}`,fill:"none",stroke:o,strokeWidth:r.primary?1.5:1,strokeOpacity:r.primary?.8:.35,strokeDasharray:r.primary?void 0:"3 3"},`${r.key}-${r.bridgeId??"u"}`)}),(0,t.jsx)("rect",{x:e.x-12,y:e.y-y/2,width:Math.max(0,d-e.x+12),height:y,fill:"transparent"}),l&&(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:e.r+3.5,fill:"none",stroke:"#fff",strokeWidth:1.5}),(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:e.r,fill:o}),(0,t.jsxs)("text",{x:e.x+14,y:e.y,dy:"0.35em",fontSize:m,fill:"#ddd",style:eG,children:[e.label,(0,t.jsx)("tspan",{dx:6,fill:o,fontWeight:700,children:r.score.toFixed(1)})]})]},e.key)})}),u.map(e=>{let r=e.unresolved?"#777":n[e.bridge.tier]||"#888";return(0,t.jsxs)("g",{className:e.unresolved?void 0:"br",onClick:e.unresolved?void 0:()=>s(e.bridge),children:[(0,t.jsx)("title",{children:e.unresolved?"Routes whose connection record doesn’t match anyone in your 1st-degree list, so who introduces you can’t be named":`${e.bridge.name} \xb7 ${e.bridge.tier}-tier \xb7 a way in to ${e.count} of these \xb7 click to open`}),(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:e.r,fill:e.unresolved?"none":r,stroke:e.unresolved?"#777":"#0a0a1a",strokeWidth:e.unresolved?1:1.5,strokeDasharray:e.unresolved?"2 2":void 0}),(0,t.jsx)("text",{x:e.x-9,y:e.y,dy:"0.35em",textAnchor:"end",fontSize:m-1,fill:r,fontStyle:e.unresolved?"italic":void 0,fontWeight:e.unresolved?400:600,style:eG,children:e.label})]},`b-${e.id??"unresolved"}`)}),(0,t.jsxs)("g",{children:[(0,t.jsx)("circle",{cx:p.x,cy:p.y,r:p.r,fill:"url(#sepYouGrad)"}),(0,t.jsx)("text",{x:p.x,y:p.y,dy:"0.35em",textAnchor:"middle",fontSize:o.length>2?9:10,fontWeight:800,fill:"#000",children:o})]})]})}),eX={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function eV({p:e,route:r,tierColors:i,compact:n}){if(!r?.bridge)return(0,t.jsxs)("span",{style:{...eX,color:"#777",fontStyle:"italic",fontSize:n?11:12},children:["via ",eP]});let o=r.bridge,l=e.waysIn-1;return(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:5,minWidth:0,fontSize:n?11:12},children:[(0,t.jsx)("span",{style:{color:"#666",flexShrink:0},children:"via"}),!n&&(0,t.jsx)(eD,{person:o,size:16,tierColors:i}),(0,t.jsx)("span",{style:{...eX,color:i[o.tier]||"#aaa",fontWeight:600,minWidth:0},children:n?eW(o.name):o.name}),l>0&&(0,t.jsxs)("span",{title:`Every way in:
10
- ${e.routes.map(e=>e.bridge?`${e.bridge.name} (${e.bridge.tier})`:eP).join("\n")}`,style:{flexShrink:0,padding:"1px 6px",borderRadius:8,fontSize:10,fontWeight:800,color:eO,background:"rgba(255,107,53,0.15)"},children:["+",l]})]})}let eK=(0,r.memo)(function({p:e,top:r,height:i,isMobile:n,selected:o,tierColors:l,onPick:a,q:s}){let{person:d}=e,c=l[e.tier]||"#888",p=function(e,t){if(t){let r=e.routes.find(e=>e.bridge&&String(e.bridge.name||"").toLowerCase().includes(t));if(r)return r}return e.routes[0]||null}(e,s),h=e.rank<=3,u=o?"rgba(255,107,53,0.08)":h?`${c}08`:"transparent",f="LinkedIn Member"===d.name,g=`#${e.rank}${e.tied?"=":""}`,x=e.waysIn-1,y=p?.bridge?`via ${p.bridge.name}${x>0?` and ${x} other${x>1?"s":""}`:""}`:`via ${eP}${x>0?` and ${x} other${x>1?"s":""}`:""}`;return(0,t.jsxs)("div",{role:"button",tabIndex:0,"aria-label":`Rank ${e.rank}${e.tied?", tied":""}, ${d.name}, ${e.tier} tier, ${e.score.toFixed(1)}, ${e.waysIn} way${1===e.waysIn?"":"s"} in, ${y}`,"aria-pressed":o,onClick:()=>a(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),a(e))},onMouseEnter:e=>{o||(e.currentTarget.style.background="rgba(255,255,255,0.04)")},onMouseLeave:e=>{e.currentTarget.style.background=u},style:{position:"absolute",top:r,left:0,right:0,height:i,boxSizing:"border-box",display:"grid",alignItems:"center",gap:10,padding:"0 12px",gridTemplateColumns:n?"44px 36px 1fr 44px":"64px 36px minmax(0,1.4fr) minmax(0,1fr) 96px 44px",borderLeft:`3px solid ${o?eO:"transparent"}`,borderBottom:"1px solid rgba(255,255,255,0.04)",background:u,cursor:"pointer"},children:[(0,t.jsx)("span",{style:{fontSize:n?11:12,fontWeight:800,color:h?c:"#555",whiteSpace:"nowrap"},children:g}),(0,t.jsx)(eD,{person:d,size:32,tierColors:l}),n?(0,t.jsxs)("div",{style:{minWidth:0,display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsxs)("span",{style:{...eX,fontSize:13,fontWeight:600,color:f?"#888":"#fff"},children:[d.name,f&&(0,t.jsx)("span",{style:{fontSize:10,color:"#666",fontWeight:400},children:" · out of network"})]}),(0,t.jsx)(eV,{p:e,route:p,tierColors:l,compact:!0}),(0,t.jsx)("span",{style:{...eX,fontSize:10,color:"#666"},children:eU(d)})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0},children:[(0,t.jsx)("span",{style:{...eX,fontSize:13,fontWeight:600,color:f?"#888":"#fff"},children:d.name}),(0,t.jsx)("span",{style:{flexShrink:0,fontSize:9,fontWeight:800,color:c,border:`1px solid ${c}55`,borderRadius:4,padding:"0 4px"},children:e.tier}),f&&(0,t.jsx)("span",{style:{flexShrink:0,fontSize:10,color:"#666"},children:"out of network"})]}),(0,t.jsx)("div",{style:{...eX,fontSize:10,color:"#777",marginTop:2},children:eU(d)})]}),(0,t.jsx)(eV,{p:e,route:p,tierColors:l}),(0,t.jsx)("div",{style:{height:6,background:"rgba(255,255,255,0.06)",borderRadius:3},children:(0,t.jsx)("div",{style:{height:"100%",borderRadius:3,background:c,width:`${100*Math.max(0,Math.min(1,e.score/10))}%`}})})]}),(0,t.jsxs)("div",{style:{textAlign:"right"},children:[(0,t.jsx)("div",{style:{fontSize:13,fontWeight:800,color:c},children:e.score.toFixed(1)}),n&&(0,t.jsx)("div",{style:{fontSize:9,color:"#666",fontWeight:700},children:e.tier})]})]})}),eJ={galaxy:{component:function({connections:e,degree2:i=[],onSelect:n,tierColors:f,mode:v,focusNodeRef:C,userName:F}){let B=(0,r.useRef)(null),R=(0,r.useRef)(null),T=(0,r.useRef)(v),L=(0,r.useRef)(null),U=(0,r.useRef)(null),[H,G]=(0,r.useState)(null),[q,V]=(0,r.useState)({width:800,height:600}),K=(0,r.useRef)(n);(0,r.useEffect)(()=>{K.current=n});let J="degrees"===v?i:null;return(0,r.useEffect)(()=>{let e=B.current?.parentElement;if(!e)return;let t=()=>{let t=Math.round(e.clientWidth),r=Math.round(e.clientHeight);V(e=>e.width===t&&e.height===r?e:{width:t,height:r})};t();let r=null,i=new ResizeObserver(()=>{clearTimeout(r),r=setTimeout(t,150)});return i.observe(e),()=>{i.disconnect(),clearTimeout(r)}},[]),(0,r.useEffect)(()=>{let e=e=>G(e.detail);return window.addEventListener("cluster-focus",e),()=>window.removeEventListener("cluster-focus",e)},[]),(0,r.useEffect)(()=>{if(!B.current||!e.length)return;let t=null,{width:r,height:i}=q,n=o.select(B.current);n.selectAll("*").remove();let H=v!==T.current;T.current=v;let G=H?null:R.current,V=e=>K.current?.(e);return t="degrees"===v?function(e,t,r,i,n,l,a,f,g,v,C,F){let B,R,T,L,U,H=new Set(i.map(e=>e.profile_url)),G=[...new Set(n.map(e=>e.source_connection_id).filter(Boolean))],q=i.filter(e=>G.includes(e.id));q.length;let V=t/2,K=r/2,J={S:350,A:600,B:820,C:1e3,D:1150},Z={S:40,A:70,B:100,C:125,D:145},Q=["S","A","B","C","D"],ee={id:"blake",name:v||"You",tier:"center",degree:0,power_score:10,nodeType:"center",fx:V,fy:K},et={},er={};q.forEach(e=>{let t=e.tier||"D";et[t]=(et[t]||0)+1,er[e.id]=er[e.id]||0});let ei={},en=q.map(e=>{let t=e.tier||"D",r=et[t]||1,i=ei[t]||0;ei[t]=i+1;let n=J[t]||600,o=2*Math.PI*i/r+(({S:0,A:Math.PI/7,B:Math.PI/4,C:Math.PI/3,D:Math.PI/2.5})[t]||0);return{id:e.id,name:e.name,tier:e.tier,degree:1,nodeType:"bridge",power_score:parseFloat(e.power_score)||1,company:e.company,role:e.role,headline:e.headline,profile_url:e.profile_url,profile_image_url:e.profile_image_url,seniority_score:e.seniority_score,company_prestige_score:e.company_prestige_score,is_catalyst:e.is_catalyst,catalyst_score:e.catalyst_score,circle_power:e.circle_power,circle_s_count:e.circle_s_count,circle_a_count:e.circle_a_count,unlocked_from_bridge_id:e.unlocked_from_bridge_id,unlocked_from_name:e.unlocked_from_name,_orbitRadius:n,x:V+Math.cos(o)*n,y:K+Math.sin(o)*n}}),eo=[];en.forEach(e=>{let t=n.filter(t=>t.source_connection_id===e.id),r={};Q.forEach(e=>{r[e]=[]}),t.forEach(e=>{(r[e.tier]||r.D).push(e)}),Q.forEach(t=>{let i=r[t],n=Z[t];i.forEach((t,r)=>{let o=2*Math.PI*r/Math.max(i.length,1)-Math.PI/2,l=H.has(t.profile_url);eo.push({id:t.id,name:t.name,tier:t.tier,degree:2,nodeType:"degree2",power_score:parseFloat(t.power_score)||1,company:t.company,role:t.role,headline:t.headline,profile_url:t.profile_url,profile_image_url:t.profile_image_url,source_connection_id:t.source_connection_id,seniority_score:t.seniority_score,company_prestige_score:t.company_prestige_score,isMutual:l,unlock_status:t.unlock_status,x:e.x+Math.cos(o)*n,y:e.y+Math.sin(o)*n})})})});let ec=[ee,...en,...eo],ep=[...en.map(e=>({source:"blake",target:e.id,linkType:"bridge"})),...eo.map(e=>({source:e.source_connection_id,target:e.id,linkType:"degree2"}))],eh={};en.forEach(e=>{eh[e.id]=e});let eu=e=>"center"===e.nodeType?24:"bridge"===e.nodeType?16:Math.max(4,Math.min(10,1.1*(e.power_score||1))),ef=e.append("g"),eg=s.default().scaleExtent([.15,5]).on("zoom",e=>{ef.attr("transform",e.transform),g&&(g.current=e.transform)});e.call(eg),f&&e.call(eg.transform,f),C&&(C.current=i=>{let n=t/2-2.5*i.x,o=r/2-2.5*i.y;e.transition().duration(750).call(eg.transform,d.identity.translate(n,o).scale(2.5))}),F&&(F.current=()=>{let i=(en.length>0?Math.max(...en.map(e=>e._orbitRadius||500)):500)+200,n=Math.min(t/(2.2*i),r/(2.2*i),.85);e.transition().duration(750).call(eg.transform,d.identity.translate(t/2,r/2).scale(n).translate(-V,-K))});let ex=e.append("defs"),ey=["#FFD700","#FF6B35","#9B59B6","#3498DB"],em=0,eb="#00ff88";en.forEach((e,t)=>{let r=e.is_catalyst?eb:ey[em++%ey.length];e._clusterColor=r;let i=ex.append("radialGradient").attr("id",`nebula-${t}`);i.append("stop").attr("offset","0%").attr("stop-color",r).attr("stop-opacity",.08),i.append("stop").attr("offset","40%").attr("stop-color",r).attr("stop-opacity",.03),i.append("stop").attr("offset","100%").attr("stop-color",r).attr("stop-opacity",0)});let ev=ex.append("filter").attr("id","glow").attr("x","-50%").attr("y","-50%").attr("width","200%").attr("height","200%");ev.append("feGaussianBlur").attr("stdDeviation","4").attr("result","blur"),ev.append("feMerge").html('<feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/>');let ek=ex.append("filter").attr("id","bridge-glow").attr("x","-80%").attr("y","-80%").attr("width","260%").attr("height","260%");ek.append("feGaussianBlur").attr("stdDeviation","8").attr("result","blur"),ek.append("feMerge").html('<feMergeNode in="blur"/><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/>'),ex.append("style").text(`
11
- @keyframes pulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }
12
- @keyframes selectedPulse { 0%,100% { stroke-opacity: 0.4; r: attr(r); } 50% { stroke-opacity: 1; } }
13
- .bridge-pulse { animation: pulse 2s ease-in-out infinite; }
14
- @keyframes boundary-breathe { 0%,100% { stroke-opacity: 0.5; } 50% { stroke-opacity: 0.75; } }
15
- .boundary-ring { animation: boundary-breathe 3s ease-in-out infinite; }
16
- `);let ew=ex.append("filter").attr("id","boundary-glow").attr("x","-20%").attr("y","-20%").attr("width","140%").attr("height","140%");ew.append("feGaussianBlur").attr("stdDeviation","3").attr("result","blur"),ew.append("feMerge").html('<feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/>');let ej=en.map((e,t)=>{let r=ef.append("g"),i=e._clusterColor,n=eo.filter(t=>t.source_connection_id===e.id).length,o=eo.filter(t=>t.source_connection_id===e.id&&"S"===t.tier).length;return r.append("circle").attr("r",200).attr("fill",`url(#nebula-${t})`),[{inner:0,outer:55,color:a.S,opacity:.06},{inner:55,outer:85,color:a.A,opacity:.05},{inner:85,outer:112,color:a.B,opacity:.04},{inner:112,outer:137,color:a.C,opacity:.03},{inner:137,outer:165,color:a.D,opacity:.02}].forEach(e=>{let t=(function(){var e=I,t=W,r=x(0),i=null,n=A,o=E,l=D,a=null,s=$(d);function d(){var d,c,p=+e.apply(this,arguments),h=+t.apply(this,arguments),u=n.apply(this,arguments)-S,f=o.apply(this,arguments)-S,g=y(f-u),x=f>u;if(a||(a=d=s()),h<p&&(c=h,h=p,p=c),h>1e-12)if(g>M-1e-12)a.moveTo(h*b(u),h*w(u)),a.arc(0,0,h,u,f,!x),p>1e-12&&(a.moveTo(p*b(f),p*w(f)),a.arc(0,0,p,f,u,x));else{var v,C,F=u,B=f,R=u,T=f,$=g,I=g,W=l.apply(this,arguments)/2,A=W>1e-12&&(i?+i.apply(this,arguments):j(p*p+h*h)),E=k(y(h-p)/2,+r.apply(this,arguments)),D=E,L=E;if(A>1e-12){var P=z(A/p*w(W)),N=z(A/h*w(W));($-=2*P)>1e-12?(P*=x?1:-1,R+=P,T-=P):($=0,R=T=(u+f)/2),(I-=2*N)>1e-12?(N*=x?1:-1,F+=N,B-=N):(I=0,F=B=(u+f)/2)}var Y=h*b(F),U=h*w(F),H=p*b(T),G=p*w(T);if(E>1e-12){var q,X=h*b(B),V=h*w(B),K=p*b(R),J=p*w(R);if(g<_)if(q=function(e,t,r,i,n,o,l,a){var s=r-e,d=i-t,c=l-n,p=a-o,h=p*s-c*d;if(!(h*h<1e-12))return h=(c*(t-o)-p*(e-n))/h,[e+h*s,t+h*d]}(Y,U,K,J,X,V,H,G)){var Z,Q=Y-q[0],ee=U-q[1],et=X-q[0],er=V-q[1],ei=1/w(((Z=(Q*et+ee*er)/(j(Q*Q+ee*ee)*j(et*et+er*er)))>1?0:Z<-1?_:Math.acos(Z))/2),en=j(q[0]*q[0]+q[1]*q[1]);D=k(E,(p-en)/(ei-1)),L=k(E,(h-en)/(ei+1))}else D=L=0}I>1e-12?L>1e-12?(v=O(K,J,Y,U,h,L,x),C=O(X,V,H,G,h,L,x),a.moveTo(v.cx+v.x01,v.cy+v.y01),L<E?a.arc(v.cx,v.cy,L,m(v.y01,v.x01),m(C.y01,C.x01),!x):(a.arc(v.cx,v.cy,L,m(v.y01,v.x01),m(v.y11,v.x11),!x),a.arc(0,0,h,m(v.cy+v.y11,v.cx+v.x11),m(C.cy+C.y11,C.cx+C.x11),!x),a.arc(C.cx,C.cy,L,m(C.y11,C.x11),m(C.y01,C.x01),!x))):(a.moveTo(Y,U),a.arc(0,0,h,F,B,!x)):a.moveTo(Y,U),p>1e-12&&$>1e-12?D>1e-12?(v=O(H,G,X,V,p,-D,x),C=O(Y,U,K,J,p,-D,x),a.lineTo(v.cx+v.x01,v.cy+v.y01),D<E?a.arc(v.cx,v.cy,D,m(v.y01,v.x01),m(C.y01,C.x01),!x):(a.arc(v.cx,v.cy,D,m(v.y01,v.x01),m(v.y11,v.x11),!x),a.arc(0,0,p,m(v.cy+v.y11,v.cx+v.x11),m(C.cy+C.y11,C.cx+C.x11),x),a.arc(C.cx,C.cy,D,m(C.y11,C.x11),m(C.y01,C.x01),!x))):a.arc(0,0,p,T,R,x):a.lineTo(H,G)}else a.moveTo(0,0);if(a.closePath(),d)return a=null,d+""||null}return d.centroid=function(){var r=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+n.apply(this,arguments)+ +o.apply(this,arguments))/2-_/2;return[b(i)*r,w(i)*r]},d.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:x(+t),d):e},d.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:x(+e),d):t},d.cornerRadius=function(e){return arguments.length?(r="function"==typeof e?e:x(+e),d):r},d.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:x(+e),d):i},d.startAngle=function(e){return arguments.length?(n="function"==typeof e?e:x(+e),d):n},d.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:x(+e),d):o},d.padAngle=function(e){return arguments.length?(l="function"==typeof e?e:x(+e),d):l},d.context=function(e){return arguments.length?(a=null==e?null:e,d):a},d})().innerRadius(e.inner).outerRadius(e.outer).startAngle(0).endAngle(2*Math.PI);r.append("path").attr("d",t()).attr("fill",e.color).attr("opacity",e.opacity)}),[{r:40,color:a.S,w:1.5,dash:"none"},{r:70,color:a.A,w:.8,dash:"4,4"},{r:100,color:a.B,w:.8,dash:"4,4"},{r:125,color:a.C,w:.6,dash:"3,5"},{r:145,color:a.D,w:.6,dash:"3,5"}].forEach(e=>{r.append("circle").attr("r",e.r).attr("fill","none").attr("stroke",e.color).attr("stroke-opacity",.2).attr("stroke-width",e.w).attr("stroke-dasharray",e.dash)}),r.append("circle").attr("r",25).attr("fill",i).attr("opacity",.15).attr("class","bridge-pulse"),e.is_catalyst&&(r.append("rect").attr("x",-40).attr("y",-185).attr("width",80).attr("height",18).attr("rx",9).attr("fill",eb).attr("opacity",.9),r.append("text").attr("y",-172).text("CATALYST").attr("fill","#000").attr("font-size",9).attr("font-weight",800).attr("text-anchor","middle").attr("letter-spacing",1)),r.append("text").attr("y",e.is_catalyst?-160:-170).text(e.name+(e.company?" · "+e.company:"")).attr("fill",i).attr("font-size",10).attr("font-weight",600).attr("text-anchor","middle").attr("opacity",.8),r.append("text").attr("y",e.is_catalyst?-148:-158).text(n+" connections · "+o+" S-tier").attr("fill","rgba(255,255,255,0.35)").attr("font-size",8).attr("text-anchor","middle"),r}),e_=en.map((e,t)=>ef.append("path").attr("fill","none").attr("stroke",a.D).attr("stroke-opacity",.5).attr("stroke-width",2.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("filter","url(#boundary-glow)").attr("class","boundary-ring")),eS=ef.append("g").selectAll("line").data(en).join("line").attr("stroke",e=>e._clusterColor).attr("stroke-opacity",.4).attr("stroke-width",2.5),eM=en.filter(e=>e.unlocked_from_bridge_id&&eh[e.unlocked_from_bridge_id]),ez=ef.append("g").selectAll("line").data(eM).join("line").attr("stroke","#FF6B35").attr("stroke-width",1.5).attr("stroke-dasharray","6,4").attr("stroke-opacity",.5),eC=ef.append("g").selectAll("text").data(eM).join("text").text(e=>"unlocked via "+(e.unlocked_from_name||eh[e.unlocked_from_bridge_id]?.name||"")).attr("fill","rgba(255,107,53,0.5)").attr("font-size",8).attr("text-anchor","middle").style("pointer-events","none"),eF=null,eB=ef.append("g").selectAll("circle").data(ec).join("circle").attr("r",eu).attr("fill",e=>"center"===e.nodeType?"#fff":"bridge"===e.nodeType?a[e.tier]||"#FFD700":a[e.tier]||"#666").attr("stroke",e=>"center"===e.nodeType?"#FFD700":"bridge"===e.nodeType?"#fff":e.isMutual?"#00ff88":"S"===e.tier?"rgba(255,215,0,0.5)":"none").attr("stroke-width",e=>"center"===e.nodeType||"bridge"===e.nodeType?3:e.isMutual?2.5:1.5*("S"===e.tier)).attr("filter",e=>"bridge"===e.nodeType?"url(#bridge-glow)":"S"===e.tier?"url(#glow)":null).style("cursor","pointer"),eR=ec.filter(e=>"center"===e.nodeType||"bridge"===e.nodeType||2===e.degree&&e.power_score>=7),eT=ef.append("g").selectAll("text").data(eR).join("text").text(e=>e.name).attr("font-size",e=>"center"===e.nodeType?15:"bridge"===e.nodeType?13:9).attr("font-weight",e=>"center"===e.nodeType||"bridge"===e.nodeType?700:600).attr("fill",e=>"center"===e.nodeType||"bridge"===e.nodeType?"#fff":a[e.tier]||"#FF6B35").attr("text-anchor","middle").attr("dy",e=>eu(e)+("bridge"===e.nodeType?24:15)).style("pointer-events","none").style("text-shadow",e=>"bridge"===e.nodeType?"0 0 10px rgba(0,0,0,0.8)":"none"),e$=ep.filter(e=>"bridge"===e.linkType),eI=new Map,eW={};eo.forEach(e=>{let t=e.source_connection_id;eW[t]||(eW[t]={});let r=e.tier||"D";eW[t][r]||(eW[t][r]=[]),eW[t][r].push(e)});let eA={S:0,A:Math.PI/5,B:Math.PI/3,C:Math.PI/2.2,D:Math.PI/1.7};for(let e in eW)for(let t in eW[e]){let r=eW[e][t],i=Math.min(Z[t]||130,160),n=eA[t]||0;r.forEach((t,o)=>{let l=2*Math.PI*o/r.length+n;eI.set(t.id,{angle:l,radius:i,bridgeId:e})})}let eE=c.forceSimulation(ec).force("charge",h.forceManyBody().strength(e=>"center"===e.nodeType?0:"bridge"===e.nodeType?-400:0)).force("bridgeOrbit",((T=e=>{if(!R)return;let t=R.fx??R.x,r=R.fy??R.y;for(let i of B){if("bridge"!==i.nodeType)continue;let n=i._orbitRadius||500,o=i.x-t,l=i.y-r,a=Math.sqrt(o*o+l*l)||1,s=a-n;i.vx-=o/a*s*e*.4,i.vy-=l/a*s*e*.4}}).initialize=e=>{B=e,R=e.find(e=>"blake"===e.id)},T)).force("clusterPositioning",((U=e=>{for(let t of L){if("degree2"!==t.nodeType)continue;let r=eI.get(t.id);if(!r)continue;let i=eh[r.bridgeId];if(!i)continue;let n=r.radius;for(let e=0;e<en.length;e++){let t=en[e];if(t.id===r.bridgeId)continue;let o=t.x-i.x,l=t.y-i.y,a=Math.sqrt(o*o+l*l);if(a<425){let e=Math.atan2(l,o),t=Math.abs(r.angle-e);if(t>Math.PI&&(t=2*Math.PI-t),t<Math.PI/1.5){let e=Math.pow(Math.cos(1.5*t/Math.PI*(Math.PI/2)),2),r=Math.max(a/2-6-12,25);r<n&&(n=n*(1-e)+r*e)}}}let o=i.x+Math.cos(r.angle)*n,l=i.y+Math.sin(r.angle)*n;t.vx+=(o-t.x)*e*.6,t.vy+=(l-t.y)*e*.6}}).initialize=e=>{L=e},U)).force("collision",u.forceCollide().radius(e=>20*("bridge"===e.nodeType))).force("link",p.forceLink(e$).id(e=>e.id).distance(e=>e.target?._orbitRadius||500).strength(.01)).alphaDecay(.02).velocityDecay(.4),eD=!1;eE.on("tick",()=>{eB.attr("cx",e=>e.x).attr("cy",e=>e.y),eT.attr("x",e=>e.x).attr("y",e=>e.y),ej.forEach((e,t)=>{e.attr("transform",`translate(${en[t].x},${en[t].y})`)}),en.forEach((e,t)=>{let r=[];for(let i=0;i<64;i++){let n=2*Math.PI*i/64,o=170;for(let r=0;r<en.length;r++){if(t===r)continue;let i=en[r],l=i.x-e.x,a=i.y-e.y,s=Math.sqrt(l*l+a*a);if(s<425){let e=Math.abs(n-Math.atan2(a,l));if(e>Math.PI&&(e=2*Math.PI-e),e<Math.PI/1.5){let t=Math.pow(Math.cos(1.5*e/Math.PI*(Math.PI/2)),2),r=Math.max(s/2-6,35);r<o&&(o=o*(1-t)+r*t)}}}r.push([e.x+Math.cos(n)*o,e.y+Math.sin(n)*o])}e_[t].attr("d",(function(e,t){var r=x(!0),i=null,n=P,o=null,l=$(a);function a(a){var s,d,c,p,h=(a="object"==typeof(s=a)&&"length"in s?s:Array.from(s)).length,u=!1;for(null==i&&(o=n(p=l())),d=0;d<=h;++d)!(d<h&&r(c=a[d],d,a))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(c,d,a),+t(c,d,a));if(p)return o=null,p+""||null}return e="function"==typeof e?e:void 0===e?N:x(e),t="function"==typeof t?t:void 0===t?Y:x(t),a.x=function(t){return arguments.length?(e="function"==typeof t?t:x(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:x(+e),a):t},a.defined=function(e){return arguments.length?(r="function"==typeof e?e:x(!!e),a):r},a.curve=function(e){return arguments.length?(n=e,null!=i&&(o=n(i)),a):n},a.context=function(e){return arguments.length?(null==e?i=o=null:o=n(i=e),a):i},a})().curve(X.tension(.3))(r))});let e=ee.fx??ee.x,t=ee.fy??ee.y;if(eS.attr("x1",e).attr("y1",t).attr("x2",e=>e.x).attr("y2",e=>e.y),ez.attr("x1",e=>eh[e.unlocked_from_bridge_id]?.x||0).attr("y1",e=>eh[e.unlocked_from_bridge_id]?.y||0).attr("x2",e=>e.x).attr("y2",e=>e.y),eC.attr("x",e=>((eh[e.unlocked_from_bridge_id]?.x||0)+e.x)/2).attr("y",e=>((eh[e.unlocked_from_bridge_id]?.y||0)+e.y)/2-8),!eD&&.05>eE.alpha()){eD=!0;let e=ep.filter(e=>"degree2"===e.linkType);eF=ef.insert("g",":first-child").selectAll("line").data(e).join("line").attr("x1",e=>e.source.x).attr("y1",e=>e.source.y).attr("x2",e=>e.target.x).attr("y2",e=>e.target.y).attr("stroke","rgba(255,255,255,0.04)").attr("stroke-width",.3)}eF&&eF.attr("x1",e=>e.source.x).attr("y1",e=>e.source.y).attr("x2",e=>e.target.x).attr("y2",e=>e.target.y)}),ed(eB,eE,"blake");let eO=es(),eL=o.select("body").append("div").attr("class","graph-tooltip").style("position","fixed").style("top","0px").style("left","0px").style("pointer-events","none").style("opacity",0).style("z-index",1001).style("transition","opacity 0.15s");if(eB.on("mouseover",function(e,t){if(o.select(this).attr("r",1.5*eu(t)).attr("filter","url(#glow)"),t.profile_image_url&&"blake"!==t.id){let r=Math.max(48,4*eu(t));eL.style("opacity",1),ea(eL,t,r,a[t.tier]||"#555"),eL.style("left",e.clientX-r/2+"px").style("top",e.clientY-r-8+"px")}let r="bridge"===t.nodeType?eo.filter(e=>e.source_connection_id===t.id).length+" connections":null,i="degree2"===t.nodeType?en.find(e=>e.id===t.source_connection_id)?.name:null;eO.style("opacity",1).html([`<strong>${el(t.name)}</strong>`,t.role?el(t.role.substring(0,60)):"",t.company?`<span style="color:${a[t.tier]||"#888"}">@ ${el(t.company)}</span>`:"",t.tier&&"center"!==t.tier?`Tier ${el(t.tier)} \xb7 Score: ${parseFloat(t.power_score).toFixed(1)}`:"",r?`<span style="color:#FFD700">${el(r)}</span>`:"",i?`<span style="color:#FF6B35">via ${el(i)}</span>`:"",t.isMutual?'<span style="color:#00ff88">Mutual connection</span>':""].filter(Boolean).join("<br/>")).style("left",e.clientX+12+"px").style("top",e.clientY+12+"px")}).on("mousemove",function(e,t){if(t.profile_image_url&&"blake"!==t.id){let r=Math.max(48,4*eu(t));eL.style("left",e.clientX-r/2+"px").style("top",e.clientY-r-8+"px")}eO.style("left",e.clientX+12+"px").style("top",e.clientY+12+"px")}).on("mouseout",function(e,t){o.select(this).attr("r",eu(t)).attr("filter","bridge"===t.nodeType?"url(#bridge-glow)":"S"===t.tier?"url(#glow)":null),eO.style("opacity",0),eL.style("opacity",0)}),eB.on("click",(t,r)=>{if("blake"!==r.id&&(ef.selectAll(".selected-glow").remove(),ef.append("circle").attr("class","selected-glow").attr("cx",r.x).attr("cy",r.y).attr("r",eu(r)+8).attr("fill","none").attr("stroke",a[r.tier]||"#FFD700").attr("stroke-width",2.5).attr("stroke-opacity",.8).style("animation","selectedPulse 1.5s ease-in-out infinite"),l(r),"bridge"===r.nodeType&&C?.current&&(C.current(r),window.dispatchEvent(new CustomEvent("cluster-focus",{detail:{id:r.id,name:r.name}}))),ef.selectAll(".unlock-overlay").remove(),"degree2"===r.nodeType&&("S"===r.tier||"A"===r.tier)&&"unlocked"!==r.unlock_status)){eE.stop();let i=r.x,n=r.y,o=ef.append("g").attr("class","unlock-overlay");eB.transition().duration(300).attr("opacity",e=>e.id===r.id||"blake"===e.id||e.id===r.source_connection_id?1:.2),eT.transition().duration(300).attr("opacity",e=>e.id===r.id||"blake"===e.id||e.id===r.source_connection_id?1:.1),[30,55,80].forEach(e=>{o.append("circle").attr("cx",i).attr("cy",n).attr("r",e).attr("fill","none").attr("stroke","rgba(255,215,0,0.12)").attr("stroke-dasharray","4,4").attr("stroke-width",.8)});for(let e=0;e<8;e++){let t=2*Math.PI*e/8,r=30+50*Math.random();o.append("circle").attr("cx",i+Math.cos(t)*r).attr("cy",n+Math.sin(t)*r).attr("r",3+3*Math.random()).attr("fill","rgba(255,255,255,0.06)").attr("stroke","rgba(255,255,255,0.08)").attr("stroke-width",.5)}let l=eh[r.source_connection_id];ee&&l&&(o.append("line").attr("x1",ee.x).attr("y1",ee.y).attr("x2",l.x).attr("y2",l.y).attr("stroke","#FFD700").attr("stroke-width",2).attr("stroke-opacity",.6),o.append("line").attr("x1",l.x).attr("y1",l.y).attr("x2",i).attr("y2",n).attr("stroke","#FF6B35").attr("stroke-width",2).attr("stroke-opacity",.6));let a="pending"===r.unlock_status;o.append("rect").attr("x",i-70).attr("y",n-115).attr("width",140).attr("height",a?40:55).attr("rx",8).attr("fill","rgba(0,0,0,0.92)").attr("stroke",a?"rgba(255,165,0,0.5)":"rgba(255,215,0,0.4)").attr("stroke-width",1),o.append("text").attr("x",i).attr("y",n-97).text(a?"PENDING...":"LOCKED PATH").attr("fill",a?"#FFA500":"#FFD700").attr("font-size",9).attr("font-weight",800).attr("text-anchor","middle").attr("letter-spacing",1),a?o.append("text").attr("x",i).attr("y",n-82).text("Run scraper to check").attr("fill","#888").attr("font-size",9).attr("text-anchor","middle"):(o.append("rect").attr("x",i-60).attr("y",n-84).attr("width",120).attr("height",24).attr("rx",6).attr("fill","#FFD700").style("cursor","pointer").on("click",e=>{e.stopPropagation();let t=eh[r.source_connection_id];fetch("/api/unlock",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:r.id,bridgeId:r.source_connection_id,bridgeName:t?.name||""})}).catch(()=>{}),window.open(r.profile_url,"_blank"),o.select("text").text("PENDING...")}),o.append("text").attr("x",i).attr("y",n-68).text("Connect to Unlock").attr("fill","#000").attr("font-size",10).attr("font-weight",700).attr("text-anchor","middle").style("pointer-events","none")),t.stopPropagation(),e.on("click.unlock",()=>{eB.transition().duration(300).attr("opacity",1),eT.transition().duration(300).attr("opacity",1),ef.selectAll(".unlock-overlay").remove(),e.on("click.unlock",null),eE.alpha(.1).restart()})}}),!f){let i=(en.length>0?Math.max(...en.map(e=>e._orbitRadius||500)):500)+200,n=Math.min(t/(2.2*i),r/(2.2*i),.85),o=d.identity.translate(t/2,r/2).scale(n).translate(-V,-K);e.call(eg.transform,o),g&&(g.current=o)}return eE}(n,r,i,e,J||[],V,f,G,R,F,L,U):function(e,t,r,i,n,l,a,f,x,y){let m=[{id:"blake",name:y||"You",tier:"center",degree:0,power_score:10,fx:t/2,fy:r/2},...i.map(e=>({id:e.id,name:e.name,tier:e.tier,degree:1,power_score:parseFloat(e.power_score)||1,company:e.company,role:e.role,headline:e.headline,profile_url:e.profile_url,profile_image_url:e.profile_image_url,connected_date:e.connected_date,seniority_score:e.seniority_score,company_prestige_score:e.company_prestige_score,influence_signals:e.influence_signals,is_catalyst:e.is_catalyst,catalyst_score:e.catalyst_score,circle_power:e.circle_power,circle_s_count:e.circle_s_count,circle_a_count:e.circle_a_count}))],b=i.map(e=>({source:"blake",target:e.id})),v=e=>{switch(e){case"S":return 150;case"A":return 250;case"B":return 350;case"C":return 450;default:return 520}},k=e=>"blake"===e.id?18:Math.max(3,Math.min(12,1.3*(e.power_score||1))),w=e.append("g"),j=s.default().scaleExtent([.3,4]).on("zoom",e=>{w.attr("transform",e.transform),x&&(x.current=e.transform)});e.call(j),f&&e.call(j.transform,f),a&&(a.current=i=>{let n=m.find(e=>e.id===i);if(!n)return;let o=t/2-2.5*n.x,a=r/2-2.5*n.y;e.transition().duration(750).call(j.transform,d.identity.translate(o,a).scale(2.5)),w.selectAll(".selected-glow").remove(),w.append("circle").attr("class","selected-glow").attr("cx",n.x).attr("cy",n.y).attr("r",k(n)+8).attr("fill","none").attr("stroke",l[n.tier]||"#FFD700").attr("stroke-width",2.5).attr("stroke-opacity",.8).style("animation","selectedPulse 1.5s ease-in-out infinite")});let _=t<768;if(_){let e={};m.forEach(t=>{let r=t.tier||"D";e[r]||(e[r]=[]),e[r].push(t)}),Object.entries(e).forEach(([e,i])=>{i.forEach((n,o)=>{if("blake"===n.id){n.x=t/2,n.y=r/2,n.fx=n.x,n.fy=n.y;return}let l=v(e),a=o/i.length*Math.PI*2-Math.PI/2;n.x=t/2+l*Math.cos(a),n.y=r/2+l*Math.sin(a),n.fx=n.x,n.fy=n.y})})}let S=c.forceSimulation(m).force("link",p.forceLink(b).id(e=>e.id).distance(e=>v(e.target.tier||"D")).strength(.1*!_)).force("charge",h.forceManyBody().strength(_?0:e=>"blake"===e.id?-300:-15)).force("center",_?null:function(e,t){var r,i=1;function n(){var n,o,l=r.length,a=0,s=0;for(n=0;n<l;++n)a+=(o=r[n]).x,s+=o.y;for(a=(a/l-e)*i,s=(s/l-t)*i,n=0;n<l;++n)o=r[n],o.x-=a,o.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n.strength=function(e){return arguments.length?(i=+e,n):i},n}(t/2,r/2)).force("collision",_?null:u.forceCollide().radius(e=>k(e)+2)).force("radial",_?null:g(e=>"blake"===e.id?0:v(e.tier),t/2,r/2).strength(.3)),M=w.append("g").selectAll("line").data(b).join("line").attr("stroke",e=>{let t=m.find(t=>t.id===(e.target.id||e.target));return l[t?.tier]||"#333"}).attr("stroke-opacity",.15).attr("stroke-width",.5),z=m.filter(e=>e.is_catalyst);if(z.length){let t=e.select("defs").size()?e.select("defs"):e.append("defs");if(!t.select("#catalyst-glow-nm").size()){let e=t.append("filter").attr("id","catalyst-glow-nm").attr("x","-60%").attr("y","-60%").attr("width","220%").attr("height","220%");e.append("feGaussianBlur").attr("stdDeviation","5").attr("result","blur"),e.append("feMerge").html('<feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/>')}w.append("g").selectAll("circle").data(z).join("circle").attr("r",e=>k(e)+6).attr("fill","none").attr("stroke","#00ff88").attr("stroke-width",2).attr("stroke-dasharray","3,3").attr("filter","url(#catalyst-glow-nm)").attr("cx",e=>e.x||0).attr("cy",e=>e.y||0).attr("class","catalyst-ring")}let C=w.append("g").selectAll("circle").data(m).join("circle").attr("r",k).attr("fill",e=>"blake"===e.id?"#fff":l[e.tier]||"#666").attr("stroke",e=>"blake"===e.id?"#FFD700":e.is_catalyst?"#00ff88":"none").attr("stroke-width",e=>"blake"===e.id?3:2.5*!!e.is_catalyst).style("cursor","pointer").on("click",(e,t)=>{if("blake"===t.id)return;w.selectAll(".selected-glow").remove();let r=k(t);w.append("circle").attr("class","selected-glow").attr("cx",t.x).attr("cy",t.y).attr("r",r+8).attr("fill","none").attr("stroke",l[t.tier]||"#FFD700").attr("stroke-width",2.5).attr("stroke-opacity",.8).style("animation","selectedPulse 1.5s ease-in-out infinite"),n(t)}),F=es(),B=o.select("body").append("div").attr("class","graph-tooltip").style("position","fixed").style("top","0px").style("left","0px").style("pointer-events","none").style("opacity",0).style("z-index",1001).style("transition","opacity 0.15s");C.on("mouseover",function(e,t){if(o.select(this).attr("r",1.5*k(t)),t.profile_image_url&&"blake"!==t.id){let r=Math.max(48,5*k(t));B.style("opacity",1),ea(B,t,r,l[t.tier]||"#555"),B.style("left",e.clientX-r/2+"px").style("top",e.clientY-r-8+"px"),F.style("opacity",1).html(`<strong>${el(t.name)}</strong>`).style("left",e.clientX-40+"px").style("top",e.clientY+12+"px").style("text-align","center").style("min-width","80px")}else F.style("opacity",1).html(`<strong>${el(t.name)}</strong>${t.company?"<br/>"+el(t.company):""}${t.tier?"<br/>Tier: "+el(t.tier):""}`).style("left",e.clientX+12+"px").style("top",e.clientY-10+"px")}).on("mousemove",function(e,t){if(t.profile_image_url&&"blake"!==t.id){let r=Math.max(48,5*k(t));B.style("left",e.clientX-r/2+"px").style("top",e.clientY-r-8+"px"),F.style("left",e.clientX-40+"px").style("top",e.clientY+12+"px")}else F.style("left",e.clientX+12+"px").style("top",e.clientY-10+"px")}).on("mouseout",function(e,t){o.select(this).attr("r",k(t)),F.style("opacity",0),B.style("opacity",0)}),ed(C,S,"blake");let R=w.append("g").selectAll("text").data(m.filter(e=>"blake"===e.id||"S"===e.tier||e.is_catalyst)).join("text").text(e=>e.is_catalyst&&"S"!==e.tier?e.name+" ⚡":e.name).attr("font-size",e=>"blake"===e.id?14:10).attr("font-weight",e=>"blake"===e.id?700:500).attr("fill",e=>"blake"===e.id?"#fff":e.is_catalyst?"#00ff88":l[e.tier]).attr("text-anchor","middle").attr("dy",e=>k(e)+14).style("pointer-events","none"),T=w.selectAll(".catalyst-ring");if(S.on("tick",()=>{M.attr("x1",e=>e.source.x).attr("y1",e=>e.source.y).attr("x2",e=>e.target.x).attr("y2",e=>e.target.y),C.attr("cx",e=>e.x).attr("cy",e=>e.y),T.attr("cx",e=>e.x).attr("cy",e=>e.y),R.attr("x",e=>e.x).attr("y",e=>e.y),w.selectAll(".selected-glow").each(function(){let e=o.select(this),t=m.find(t=>t.x&&30>Math.abs(t.x-parseFloat(e.attr("cx"))));t&&e.attr("cx",t.x).attr("cy",t.y)})}),!f&&t>0&&t<768){let i=Math.min(t/1248,r/1248),n=d.identity.translate(t/2,r/2).scale(i).translate(-t/2,-r/2);e.call(j.transform,n),x&&(x.current=n)}return S}(n,r,i,e,V,f,C,G,R,F),()=>{var e;t?.stop(),("string"==typeof(e=".graph-tooltip")?new a.Selection([document.querySelectorAll(e)],[document.documentElement]):new a.Selection([(0,l.default)(e)],a.root)).remove()}},[e,J,q,f,v]),(0,t.jsxs)("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[(0,t.jsx)("svg",{ref:B,width:q.width,height:q.height,style:{background:"#0a0a1a"}}),H&&"degrees"===v&&(0,t.jsx)("button",{onClick:()=>{G(null),U.current&&U.current()},style:{position:"absolute",top:16,left:16,zIndex:20,padding:"8px 16px",borderRadius:8,border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",color:"#fff",fontSize:12,fontWeight:600,backdropFilter:"blur(8px)"},children:"← All Bridges"}),(0,t.jsxs)("div",{style:{position:"absolute",bottom:20,left:20,display:"flex",gap:12,fontSize:11,color:"#888"},children:[Object.entries(f).map(([e,r])=>(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:r,display:"inline-block"}}),e]},e)),"degrees"===v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:0,border:"2px solid #00ff88",background:"transparent",display:"inline-block"}}),"Mutual"]}),(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:"#00ff88",display:"inline-block"}}),"Catalyst"]})]})]})]})},modes:["network"],label:"Galaxy",icon:"🌌",desc:"Force-directed layout"},orbit:{component:eu,modes:["network","degrees"],label:"Orbit",icon:"🪐",desc:"Tier orbits + circle dots; in Degrees, every mapped circle fanned out",allDegree2:!0},separation:{component:function({connections:e=[],degree2:i=[],onSelect:n,userName:o,selectedId:l,tierColors:a=eL}){let s=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>t(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),d=s?68:56,c=s?5:10,p=s?8:16,[h,u]=(0,r.useState)(""),f=(0,r.useDeferredValue)(h.trim().toLowerCase()),[g,x]=(0,r.useState)("power"),[y,m]=(0,r.useState)("all"),[b,v]=(0,r.useState)(0),[k,w]=(0,r.useState)({w:0,h:800}),[j,_]=(0,r.useState)(null),S=(0,r.useRef)(null),M=(0,r.useCallback)(e=>{S.current=e,_(e)},[]),z=(0,r.useRef)(null),C=(0,r.useMemo)(()=>(function(e=[],t=[]){let r=new Map;for(let e of t||[])r.set(e.id,e);let i=new Map,n=new Map;for(let t of e||[]){let e=eC(t);n.set(t.id,e);let r=i.get(e);r?function(e,t){let r=ez(e)-ez(t);if(r)return r>0;let i=!!e.profile_image_url;return!!t.profile_image_url!==i?i:0>eF(e.id,t.id)}(t,r.person)&&(r.person=t):(r={key:e,person:t,rowIds:[],routeIds:new Set},i.set(e,r)),r.rowIds.push(t.id),r.routeIds.add(t.source_connection_id??null)}let o={people:i.size,byTier:{S:0,A:0,B:0,C:0,D:0},multi:0,bridges:0,unresolvedIds:0,peopleOnlyUnresolved:0,onlyUnresolvedVia:0},l=new Set,a=new Set,s=new Set,d=[];for(let e of i.values()){let t=[...e.routeIds].map(e=>({id:e,bridge:r.get(e)??null}));t.sort(eR);let i=t.filter(e=>e.bridge);for(let e of t)(e.bridge?l:a).add(e.id);if(!i.length)for(let e of(o.peopleOnlyUnresolved++,t))s.add(e.id);let{person:n}=e,c=n.tier;void 0!==o.byTier[c]&&o.byTier[c]++,t.length>1&&o.multi++,d.push({key:e.key,person:n,score:ez(n),tier:c,routes:t,waysIn:t.length,rowIds:e.rowIds,haystack:[n.name,n.headline,n.company,n.role,...i.map(e=>e.bridge.name)].filter(Boolean).join("\n").toLowerCase(),rank:0,tied:!1})}return o.bridges=l.size,o.unresolvedIds=a.size,o.onlyUnresolvedVia=s.size,d.sort(eT),function(e){for(let t=0;t<e.length;t++){let r=e[t],i=e[t-1],n=i&&i.score===r.score&&i.waysIn===r.waysIn;r.rank=n?i.rank:t+1,n&&(r.tied=!0,i.tied=!0)}}(d),{people:d,rowToKey:n,summary:o}})(i,e),[i,e]),F=(0,r.useMemo)(()=>"ways"===g?[...C.people].sort(eI):C.people,[C,g]),B=(0,r.useMemo)(()=>f||"all"!==y?F.filter(e=>("all"===y||e.tier===y)&&(!f||e.haystack.includes(f))):F,[F,f,y]),R=(0,r.useMemo)(()=>B.slice(0,c),[B,c]),T=null!=l?C.rowToKey.get(l)??null:null,$=(0,r.useRef)(n);(0,r.useEffect)(()=>{$.current=n});let I=(0,r.useCallback)(e=>$.current?.(e.person),[]),W=(0,r.useCallback)(e=>{e&&$.current?.(e)},[]);(0,r.useEffect)(()=>{if(!j)return;let e=new ResizeObserver(()=>{let e=Math.round(j.clientWidth),t=Math.round(j.clientHeight);w(r=>r.w===e&&r.h===t?r:{w:e,h:t})});return e.observe(j),()=>e.disconnect()},[j]);let A=Math.max(0,Math.min(980,k.w-2*p)),E=(0,r.useMemo)(()=>(function(e=[],t=800,r=!1){let i=r?36:26,n=Math.round(.42*t),o=Math.round(.58*t),l=e.map((e,r)=>{var n;return{key:e.key,p:e,x:o,y:16+r*i,r:(n=e.waysIn)>=4?8.5:3===n?7:2===n?5.5:4,label:eA(`#${e.rank}${e.tied?"=":""} ${e.person.name||""}`,Math.floor((t-o-60)/6.2))}}),a=new Map,s="\0unresolved";for(let e of l)for(let t of e.p.routes){let r=t.bridge?t.id:s,i=a.get(r);i||(i={id:t.bridge?t.id:null,bridge:t.bridge,unresolved:!t.bridge,ys:[],count:0},a.set(r,i)),i.count++,i.ys.push(e.y)}let d=[...a.values()].map(e=>({...e,bary:e.ys.reduce((e,t)=>e+t,0)/e.ys.length}));d.sort((e,t)=>e.bary-t.bary||e.unresolved-t.unresolved||(e.bridge&&t.bridge?eB(e.bridge,t.bridge):0));let c=l.length?l[l.length-1].y:16,p=d.length>1?Math.max(18,(c-16)/(d.length-1)):0,h=Math.max(4,Math.floor((n-10-42)/6));d.forEach((e,t)=>{if(e.x=n,e.y=1===d.length?(16+c)/2:16+t*p,e.r=5,e.unresolved)e.label=eA(`can't be named (${e.count})`,h);else{let t=e.bridge.name||"";e.label=t.length<=h?t:eA(eW(t),h)}delete e.ys});let u=new Map(d.map(e=>[e.unresolved?s:e.id,e])),f=[];for(let e of l){let t=new Set;e.p.routes.forEach((r,i)=>{let n=r.bridge?r.id:s;if(t.has(n))return;t.add(n);let o=u.get(n);f.push({key:e.key,bridgeId:o.id,primary:0===i&&!o.unresolved,unresolved:o.unresolved,tier:o.bridge?.tier??null,x1:o.x,y1:o.y,x2:e.x,y2:e.y})})}let g=Math.max(c,d.length?d[d.length-1].y:0),x=l.length?Math.ceil(g+16):0,y={x:20,y:l.length?(16+Math.max(c,g))/2:16,r:14},m=d.map(e=>({id:e.id,x1:y.x,y1:y.y,x2:e.x,y2:e.y}));return{width:t,height:x,you:y,people:l,bridges:d,links:f,spokes:m}})(R,A||800,s),[R,A,s]),D=s?58:40,O=R.length?D+E.height+12:0,L=O+28,P=L+B.length*d+72,N=Math.max(0,Math.floor((b-L)/d)-8),Y=Math.min(B.length,N+Math.ceil(k.h/d)+16),U=(0,r.useCallback)(e=>{let t=16*Math.floor(e.currentTarget.scrollTop/16);v(e=>e===t?e:t)},[]),H=(0,r.useCallback)(()=>{S.current&&(S.current.scrollTop=0),v(0)},[]);(0,r.useEffect)(()=>{let e=e=>{if("/"!==e.key||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||t.isContentEditable)||(e.preventDefault(),z.current?.focus())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let G=e=>{u(e),H()},{summary:q}=C,X=!!f||"all"!==y,V=!o||/^you$/i.test(String(o).trim())?"You":(0,ep.initialsFor)(o),K=B.slice(N,Y);return(0,t.jsxs)("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",background:"#0a0a1a",color:"#fff",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{padding:"10px 56px 8px",flexShrink:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,t.jsx)("h2",{style:{margin:0,fontSize:18,fontWeight:800,background:"linear-gradient(135deg, #FFD700, #FF6B35)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"Separation"}),(0,t.jsx)("span",{style:{fontSize:12,color:"#aaa"},children:s?`${eY(q.people,"person","people")} \xb7 ${eN(q.byTier.S)} S \xb7 ${eN(q.multi)} with 2+ ways`:`${eY(q.people,"person","people")} two steps away \xb7 ${eN(q.byTier.S)} S-tier \xb7 ${eN(q.multi)} reachable 2+ ways \xb7 through ${eN(q.bridges)} of your connections`})]}),(0,t.jsx)("div",{"aria-hidden":"true",style:{display:"flex",gap:1,height:6,borderRadius:3,overflow:"hidden",margin:"8px 0 6px",background:"rgba(255,255,255,0.04)"},children:eS.filter(e=>q.byTier[e]>0).map(e=>(0,t.jsx)("div",{style:{flex:q.byTier[e],background:a[e]||"#555"}},e))}),(0,t.jsx)("div",{style:{fontSize:11,color:"#777",lineHeight:1.4},children:s?"Ranks reachability, not people · lists scanned so far":"Ranked by each person’s own score (title, company, headline). It ranks reachability, not people. From the lists scanned so far."}),q.peopleOnlyUnresolved>0&&(0,t.jsxs)("div",{style:{marginTop:8,padding:"8px 10px",borderRadius:8,fontSize:11.5,lineHeight:1.5,color:"#e8d9a0",background:"rgba(255,215,0,0.06)",border:"1px solid rgba(255,215,0,0.25)"},children:[eY(q.peopleOnlyUnresolved,"of these people","of these people")," ","came only through ",eY(q.onlyUnresolvedVia,"connection record","connection records")," ","that ",1===q.onlyUnresolvedVia?"doesn’t":"don’t"," match anyone in your 1st-degree list, so who introduces you can’t be named. They’re still ranked."]})]}),(0,t.jsxs)("div",{style:{padding:"0 56px 10px",flexShrink:0,display:"flex",gap:8,flexDirection:s?"column":"row",alignItems:s?"stretch":"center",flexWrap:s?"nowrap":"wrap",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,t.jsx)("input",{ref:z,type:"search",value:h,onChange:e=>G(e.target.value),onKeyDown:e=>{if("Enter"===e.key){let e=h.trim().toLowerCase(),t=F.find(t=>("all"===y||t.tier===y)&&(!e||t.haystack.includes(e)));t&&I(t)}else"Escape"===e.key&&(h?G(""):e.currentTarget.blur())},placeholder:"Search people, companies, or who knows them","aria-label":"Search people, companies, or who knows them",style:{flex:s?"none":"1 1 260px",minWidth:0,height:s?44:34,boxSizing:"border-box",padding:"0 12px",borderRadius:8,outline:"none",color:"#fff",fontSize:s?16:13,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(255,255,255,0.05)"}}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,flexWrap:s?"nowrap":"wrap",overflowX:s?"auto":"visible",scrollbarWidth:"thin",flexShrink:+!s},children:[(0,t.jsx)("div",{role:"group","aria-label":"Order",style:{display:"flex",flexShrink:0,background:"rgba(255,255,255,0.06)",borderRadius:8,padding:2},children:[["power","Power"],["ways","Ways in"]].map(([e,r])=>(0,t.jsx)("button",{type:"button","aria-pressed":g===e,onClick:()=>{x(e),H()},style:{height:s?40:30,padding:"0 12px",border:"none",borderRadius:6,cursor:"pointer",fontSize:12,fontWeight:700,whiteSpace:"nowrap",background:g===e?"linear-gradient(135deg, #FFD700, #FF6B35)":"transparent",color:g===e?"#000":"#999"},children:r},e))}),(0,t.jsx)("span",{style:{fontSize:10,color:"#666",whiteSpace:"nowrap",flexShrink:0,textTransform:"uppercase",letterSpacing:.5},children:"Their tier"}),["all",...eS].map(e=>{let r=y===e,i="all"===e?"#fff":a[e]||"#888",n="all"===e?q.people:q.byTier[e];return(0,t.jsxs)("button",{type:"button","aria-pressed":r,onClick:()=>{m(e),H()},style:{height:s?40:30,padding:"0 10px",borderRadius:15,cursor:"pointer",flexShrink:0,fontSize:12,fontWeight:700,whiteSpace:"nowrap",border:`1px solid ${r?i:"rgba(255,255,255,0.1)"}`,background:r?`${"#fff"===i?"#ffffff":i}22`:"rgba(255,255,255,0.03)",color:r?i:"#999"},children:["all"===e?"All":e,(0,t.jsx)("span",{style:{marginLeft:5,fontWeight:500,color:r?i:"#666",opacity:.85},children:eN(n)})]},e)})]})]}),(0,t.jsx)("div",{ref:M,onScroll:U,style:{flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden",position:"relative",padding:`0 ${p}px`},children:(0,t.jsxs)("div",{style:{position:"relative",maxWidth:980,margin:"0 auto",height:P},children:[R.length>0&&(0,t.jsxs)("div",{style:{height:O,boxSizing:"border-box",paddingTop:10},children:[(0,t.jsxs)("div",{style:{height:D-10,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{fontSize:12,fontWeight:700,color:"#ddd",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:["Top ",eN(R.length)," of ",eN(B.length),X?" shown":""," · every way in drawn"]}),(0,t.jsxs)("div",{style:{fontSize:10,color:"#777",marginTop:2,whiteSpace:s?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.35},children:[(0,t.jsx)("span",{style:{color:eO},children:"solid orange"})," = top-scored bridge · dashed = other routes · dot size = ways in"]})]}),A>0&&(0,t.jsx)(eq,{layout:E,selectedKey:T,tierColors:a,youLabel:V,isMobile:s,onPick:I,onPickBridge:W})]}),B.length>0&&(0,t.jsxs)("div",{style:{height:28,display:"grid",alignItems:"center",gap:10,padding:"0 12px 0 15px",gridTemplateColumns:s?"44px 36px 1fr 44px":"64px 36px minmax(0,1.4fr) minmax(0,1fr) 96px 44px",fontSize:9,fontWeight:700,color:"#555",textTransform:"uppercase",letterSpacing:.5,borderBottom:"1px solid rgba(255,255,255,0.08)",boxSizing:"border-box"},children:[(0,t.jsx)("span",{title:"Rank by score, then ways in. = means tied",children:"#"}),(0,t.jsx)("span",{}),s?(0,t.jsx)("span",{children:"Person · way in"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"Person"}),(0,t.jsx)("span",{children:"Way in"}),(0,t.jsx)("span",{children:"Power"})]}),(0,t.jsx)("span",{style:{textAlign:"right"},children:s?"Score":""})]}),K.map((e,r)=>(0,t.jsx)(eK,{p:e,top:L+(N+r)*d,height:d,isMobile:s,selected:e.key===T,tierColors:a,onPick:I,q:f},e.key)),0===B.length&&(0,t.jsxs)("div",{style:{position:"absolute",top:40,left:0,right:0,textAlign:"center",color:"#888",fontSize:13,padding:"0 16px"},children:[f?(0,t.jsxs)(t.Fragment,{children:["No one matches ‘",h.trim(),"’. Search covers names, headlines, companies and who knows them."]}):(0,t.jsxs)(t.Fragment,{children:["No ",y,"-tier people here."]}),(0,t.jsx)("div",{style:{marginTop:12},children:(0,t.jsx)("button",{type:"button",onClick:()=>{u(""),m("all"),H()},style:{padding:"8px 16px",borderRadius:8,cursor:"pointer",fontSize:12,fontWeight:700,border:"1px solid rgba(255,255,255,0.15)",background:"rgba(255,255,255,0.06)",color:"#fff"},children:"Clear"})})]})]})})]})},modes:["degrees"],label:"Separation",icon:"🏆",desc:"Every 2nd degree, ranked · every way in"},chain:{component:function({connections:e,degree2:i=[],onSelect:n,userName:o}){let l=(0,r.useRef)(null),[a,s]=(0,r.useState)(null),[d,c]=(0,r.useState)(null),[p,h]=(0,r.useState)(1.3),[u,f]=(0,r.useState)({w:800,h:600}),[g,x]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{let t=Math.round(e.clientWidth),r=Math.round(e.clientHeight);f(e=>e.w===t&&e.h===r?e:{w:t,h:r})},r=new ResizeObserver(t);return r.observe(e),t(),()=>r.disconnect()},[]);let y=(0,r.useRef)([]);(0,r.useEffect)(()=>{let t={};i.forEach(e=>{e.source_connection_id&&(t[e.source_connection_id]||(t[e.source_connection_id]=[]),t[e.source_connection_id].push(e))});let r=e.filter(e=>t[e.id]).sort((e,r)=>(t[r.id]?.length||0)-(t[e.id]?.length||0));y.current=r.map((e,t)=>({id:e.id,angle:t/r.length*Math.PI*2-Math.PI/2}))},[e,i]);let m=(0,r.useRef)(0);(0,r.useEffect)(()=>{let e=l.current;if(!e)return;let t=(t,r)=>{let i=e.getBoundingClientRect(),n=u.w/2,o=u.h/2,l=t-i.left,a=Math.atan2(r-i.top-o,l-n),s=null,d=1/0;return y.current.forEach(e=>{let t=Math.abs(a-e.angle);t>Math.PI&&(t=2*Math.PI-t),t<d&&(d=t,s=e.id)}),s},r=e=>{if(x(!0),e.touches[0]){let r=t(e.touches[0].clientX,e.touches[0].clientY);r&&s(r)}},i=e=>{e.preventDefault();let r=Date.now();if(!(r-m.current<16)&&(m.current=r,e.touches[0])){let r=t(e.touches[0].clientX,e.touches[0].clientY);r&&s(r)}},n=()=>{x(!1)};return e.addEventListener("touchstart",r,{passive:!1}),e.addEventListener("touchmove",i,{passive:!1}),e.addEventListener("touchend",n),()=>{e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",i),e.removeEventListener("touchend",n)}},[u,p]);let b={};i.forEach(e=>{e.source_connection_id&&(b[e.source_connection_id]||(b[e.source_connection_id]=[]),b[e.source_connection_id].push(e))});let v=e.filter(e=>b[e.id]&&b[e.id].length>0).sort((e,t)=>(b[t.id]?.length||0)-(b[e.id]?.length||0)),k=u.w/2,w=u.h/2,j=Math.min(k,w)-30;if(d){let r=v.find(e=>e.id===d);if(!r)return c(null),null;let i=(b[r.id]||[]).sort((e,t)=>{let r={S:0,A:1,B:2,C:3,D:4};return(r[e.tier]||9)-(r[t.tier]||9)||(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0)}),o=.7*j,p=(e,t)=>{if(!l.current)return;let r=l.current.getBoundingClientRect(),n=e-r.left,o=Math.atan2(t-r.top-w,n-k),a=null,d=1/0;i.forEach((e,t)=>{let r=Math.abs(o-(t/i.length*Math.PI*2-Math.PI/2));r>Math.PI&&(r=2*Math.PI-r),r<d&&(d=r,a=e.id)}),a&&s(a)};return(0,t.jsxs)("div",{ref:l,style:{flex:1,background:"#0a0a1a",position:"relative",overflow:"hidden"},onTouchStart:e=>{e.touches[0]&&p(e.touches[0].clientX,e.touches[0].clientY)},onTouchMove:e=>{e.preventDefault(),e.touches[0]&&p(e.touches[0].clientX,e.touches[0].clientY)},onTouchEnd:()=>{if(a){let e=i.find(e=>e.id===a);e&&n&&n(e)}},children:[(0,t.jsxs)("svg",{width:u.w,height:u.h,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"focusGlow",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"4",result:"blur"}),(0,t.jsxs)("feMerge",{children:[(0,t.jsx)("feMergeNode",{in:"blur"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})}),(0,t.jsx)("circle",{cx:k,cy:w,r:o,fill:"none",stroke:`${eg[2]}08`,strokeWidth:1}),a&&(0,t.jsx)("circle",{cx:k,cy:w,r:.93*j,fill:"none",stroke:`${eg[3]}10`,strokeWidth:1,strokeDasharray:"3,5"}),i.map((e,r)=>{let n=r/i.length*Math.PI*2-Math.PI/2,l=k+o*Math.cos(n),s=w+o*Math.sin(n),d=a===e.id;return(0,t.jsx)("line",{x1:k,y1:w,x2:l,y2:s,stroke:ef[e.tier]||"#555",strokeWidth:d?2:.5,strokeOpacity:d?.8:.12},"fl-"+r)}),i.map((r,l)=>{let d=l/i.length*Math.PI*2-Math.PI/2,c=k+o*Math.cos(d),p=w+o*Math.sin(d),h=a===r.id,u="S"===r.tier?7:"A"===r.tier?6:"B"===r.tier?5:4,f="accepted"===r.outreach_status||e.some(e=>e.profile_url===r.profile_url&&"accepted"===e.outreach_status),g=.93*j;return(0,t.jsxs)("g",{onClick:()=>n&&n(r),onMouseEnter:()=>s(r.id),onMouseLeave:()=>s(null),style:{cursor:"pointer"},children:[f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("circle",{cx:c,cy:p,r:u+6,fill:"none",stroke:eg[3],strokeWidth:1.5,strokeOpacity:.2,children:[(0,t.jsx)("animate",{attributeName:"r",values:`${u+4};${u+9};${u+4}`,dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"stroke-opacity",values:"0.1;0.4;0.1",dur:"2s",repeatCount:"indefinite"})]}),(0,t.jsxs)("circle",{cx:c,cy:p,r:u+1,fill:eg[3],fillOpacity:.3,stroke:"none",children:[(0,t.jsx)("animate",{attributeName:"fill",values:"#3498DB;#FFD700;#FF6B35;#9B59B6;#3498DB",dur:"4s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"fillOpacity",values:"0.2;0.4;0.2",dur:"2s",repeatCount:"indefinite"})]}),Array.from({length:3},(e,r)=>{let i=.25*Math.PI,n=d-i/2+r/2*i,o=k+g*Math.cos(n),l=w+g*Math.sin(n);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:c,y1:p,x2:o,y2:l,stroke:eg[3],strokeWidth:.6,strokeOpacity:.1,strokeDasharray:"3,4",children:(0,t.jsx)("animate",{attributeName:"stroke-opacity",values:"0.05;0.2;0.05",dur:"3s",repeatCount:"indefinite"})}),(0,t.jsxs)("circle",{cx:o,cy:l,r:4,fill:eg[3],fillOpacity:.2,stroke:eg[3],strokeWidth:.8,strokeOpacity:.2,children:[(0,t.jsx)("animate",{attributeName:"fillOpacity",values:"0.1;0.35;0.1",dur:"2.5s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"3s",repeatCount:"indefinite"})]})]},"d3g-"+r)})]}),!f&&("S"===r.tier||"A"===r.tier)&&(0,t.jsx)("circle",{cx:c,cy:p,r:u+4,fill:`${ef[r.tier]}12`}),(0,t.jsx)("circle",{cx:c,cy:p,r:h?u+2:u,fill:f?eg[3]:ef[r.tier]||"#555",fillOpacity:h?1:f?.7:.5,stroke:h?"#fff":f?eg[3]:"none",strokeWidth:h?2:1.5*!!f,children:f&&!h&&(0,t.jsx)("animate",{attributeName:"fill",values:"#3498DB;#FFD700;#FF6B35;#3498DB",dur:"4s",repeatCount:"indefinite"})}),h&&(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:c-70,y:p-36,width:140,height:28,rx:6,fill:"rgba(0,0,0,0.92)",stroke:f?eg[3]:ef[r.tier],strokeWidth:.5}),(0,t.jsx)("text",{x:c,y:p-20,textAnchor:"middle",fill:"#fff",fontSize:10,fontWeight:700,children:r.name?.substring(0,22)}),(0,t.jsx)("text",{x:c,y:p-10,textAnchor:"middle",fill:f?eg[3]:ef[r.tier],fontSize:8,children:f?"⚡ Bridge to unlock D3":`${r.tier} \xb7 ${parseFloat(r.power_score||0).toFixed(1)}`})]}),("S"===r.tier||f)&&!h&&(0,t.jsx)("text",{x:c,y:p+u+12,textAnchor:"middle",fill:f?eg[3]:"#aaa",fontSize:8,fontWeight:f?700:400,children:r.name?.split(" ")[0]})]},"fn-"+l)}),a&&(()=>{let e=i.findIndex(e=>e.id===a);if(-1===e)return null;let r=e/i.length*Math.PI*2-Math.PI/2,n=k+o*Math.cos(r),l=w+o*Math.sin(r),s=.93*j,d=.35*Math.PI;return Array.from({length:5},(e,i)=>{let o=r-d/2+i/4*d,a=k+s*Math.cos(o),c=w+s*Math.sin(o);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:n,y1:l,x2:a,y2:c,stroke:eg[3],strokeWidth:.8,strokeOpacity:.2,strokeDasharray:"3,3"}),(0,t.jsx)("circle",{cx:a,cy:c,r:9,fill:"rgba(52,152,219,0.06)",stroke:eg[3],strokeWidth:1.5,strokeOpacity:.3,strokeDasharray:"2,2"}),(0,t.jsx)("text",{x:a,y:c+4,textAnchor:"middle",fill:eg[3],fontSize:12,fontWeight:800,fillOpacity:.5,children:"?"})]},"g3-"+i)})})(),(0,t.jsx)("circle",{cx:k,cy:w,r:28,fill:"#0a0a1a",stroke:ef[r.tier],strokeWidth:3,filter:"url(#focusGlow)"}),r.profile_image_url?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("clipPath",{id:"focus-clip",children:(0,t.jsx)("circle",{cx:k,cy:w,r:24})}),(0,t.jsx)("image",{href:r.profile_image_url,x:k-24,y:w-24,width:48,height:48,clipPath:"url(#focus-clip)"})]}):(0,t.jsx)("text",{x:k,y:w+5,textAnchor:"middle",fill:ef[r.tier],fontSize:16,fontWeight:800,children:r.name?.charAt(0)}),(0,t.jsx)("text",{x:k,y:w+38,textAnchor:"middle",fill:"#fff",fontSize:11,fontWeight:700,children:r.name}),(0,t.jsxs)("text",{x:k,y:w+50,textAnchor:"middle",fill:"#888",fontSize:9,children:[i.length," D2 connections"]})]}),(0,t.jsx)("button",{onClick:()=>c(null),style:{position:"absolute",top:16,left:16,padding:"8px 16px",borderRadius:8,border:"none",cursor:"pointer",background:"rgba(255,255,255,0.08)",color:"#aaa",fontSize:12,fontWeight:600},children:"← All Bridges"}),(0,t.jsxs)("div",{style:{position:"absolute",bottom:20,left:20,background:"rgba(0,0,0,0.75)",borderRadius:10,padding:"10px 14px",backdropFilter:"blur(8px)"},children:[(0,t.jsx)("div",{style:{fontSize:9,fontWeight:700,color:"#666",letterSpacing:1,marginBottom:6},children:"CLUSTER BREAKDOWN"}),["S","A","B","C","D"].map(e=>{let r=i.filter(t=>t.tier===e).length;return 0===r?null:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[(0,t.jsx)("div",{style:{width:6,height:6,borderRadius:"50%",background:ef[e]}}),(0,t.jsxs)("span",{style:{fontSize:10,color:ef[e],fontWeight:600,width:40},children:[e,"-Tier"]}),(0,t.jsx)("span",{style:{fontSize:10,color:"#888"},children:r})]},e)})]})]})}let _=.55*j,S=.82*j,M=v.map((e,t)=>{let r=t/v.length*Math.PI*2-Math.PI/2;return{...e,x:k+_*Math.cos(r),y:w+_*Math.sin(r),angle:r,clusterSize:(b[e.id]||[]).length}}),z=e.filter(e=>"accepted"===e.outreach_status&&!b[e.id]);z.map((e,t)=>{let r=t/Math.max(z.length,1)*Math.PI*2-Math.PI/2;return{...e,x:k+S*Math.cos(r),y:w+S*Math.sin(r),angle:r}});let C=i.length,F=i.filter(e=>"S"===e.tier).length,B=i.filter(e=>"A"===e.tier).length;return(0,t.jsxs)("div",{ref:l,style:{flex:1,background:"#0a0a1a",position:"relative",overflow:"hidden"},children:[(0,t.jsx)("svg",{width:u.w,height:u.h,children:(0,t.jsxs)("g",{transform:`translate(${k*(1-p)}, ${w*(1-p)}) scale(${p})`,children:[(0,t.jsx)("circle",{cx:k,cy:w,r:_,fill:"none",stroke:`${eg[1]}10`,strokeWidth:1}),a&&(0,t.jsx)("circle",{cx:k,cy:w,r:.88*j,fill:"none",stroke:`${eg[2]}08`,strokeWidth:1}),a&&(()=>{let e=M.find(e=>e.id===a);if(!e)return null;let r=(b[e.id]||[]).filter(e=>"S"===e.tier||"A"===e.tier||"B"===e.tier),i=.75*j,n=.95*j,o=Math.min(.8*Math.PI,r.length/40*Math.PI),l=e.angle-o/2;return(0,t.jsxs)("g",{children:[(0,t.jsx)("circle",{cx:k,cy:w,r:i,fill:"none",stroke:`${eg[2]}06`,strokeWidth:1}),(0,t.jsx)("circle",{cx:k,cy:w,r:n,fill:"none",stroke:`${eg[3]}05`,strokeWidth:1,strokeDasharray:"3,5"}),r.map((a,s)=>{let d=l+(r.length>1?s/(r.length-1):.5)*o,c=k+i*Math.cos(d),p=w+i*Math.sin(d),h="S"===a.tier?5:"A"===a.tier?4:3,u="S"===a.tier||"A"===a.tier,f=k+n*Math.cos(d),g=w+n*Math.sin(d);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:e.x,y1:e.y,x2:c,y2:p,stroke:ef[a.tier],strokeWidth:.5,strokeOpacity:.15}),(0,t.jsx)("circle",{cx:c,cy:p,r:h,fill:ef[a.tier],fillOpacity:.45,stroke:ef[a.tier],strokeWidth:.5,strokeOpacity:.25}),"S"===a.tier&&(0,t.jsx)("text",{x:c,y:p+h+10,textAnchor:"middle",fill:"#aaa",fontSize:7,children:a.name?.split(" ")[0]}),u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("line",{x1:c,y1:p,x2:f,y2:g,stroke:eg[3],strokeWidth:.5,strokeOpacity:.12,strokeDasharray:"2,3"}),(0,t.jsx)("circle",{cx:f,cy:g,r:6,fill:"rgba(52,152,219,0.04)",stroke:eg[3],strokeWidth:1,strokeOpacity:.2,strokeDasharray:"2,2"}),(0,t.jsx)("text",{x:f,y:g+3.5,textAnchor:"middle",fill:eg[3],fontSize:9,fontWeight:700,fillOpacity:.35,children:"?"})]})]},"pv-"+s)})]})})(),a&&(()=>{let e=M.find(e=>e.id===a);if(!e)return null;let r=z.filter(t=>!!i.find(r=>r.profile_url===t.profile_url&&r.source_connection_id===e.id));if(0===r.length)return null;let o=.75*j;return r.map((r,i)=>{let l=Math.min(.8*Math.PI,(b[e.id]||[]).filter(e=>"S"===e.tier||"A"===e.tier||"B"===e.tier).length/40*Math.PI),a=e.angle+l/2+.15+.25*i,s=k+o*Math.cos(a),d=w+o*Math.sin(a),p=.95*j;return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:e.x,y1:e.y,x2:s,y2:d,stroke:eg[3],strokeWidth:1.5,strokeOpacity:.3,children:(0,t.jsx)("animate",{attributeName:"stroke-opacity",values:"0.15;0.5;0.15",dur:"2s",repeatCount:"indefinite"})}),(0,t.jsxs)("circle",{cx:s,cy:d,r:16,fill:"none",stroke:eg[3],strokeWidth:1,strokeOpacity:.1,children:[(0,t.jsx)("animate",{attributeName:"r",values:"14;19;14",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"stroke-opacity",values:"0.05;0.25;0.05",dur:"2s",repeatCount:"indefinite"})]}),(0,t.jsxs)("circle",{cx:s,cy:d,r:12,fill:eg[3],fillOpacity:.3,stroke:eg[3],strokeWidth:2,onClick:()=>{n&&n(r),c(e.id)},style:{cursor:"pointer"},children:[(0,t.jsx)("animate",{attributeName:"fill",values:"rgba(52,152,219,0.3);rgba(255,215,0,0.3);rgba(52,152,219,0.3)",dur:"3s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"stroke",values:"#3498DB;#FFD700;#3498DB",dur:"3s",repeatCount:"indefinite"})]}),(0,t.jsx)("text",{x:s,y:d+20,textAnchor:"middle",fill:"#fff",fontSize:9,fontWeight:700,children:r.name?.split(" ")[0]}),Array.from({length:4},(e,r)=>{let i=.3*Math.PI,n=a-i/2+r/3*i,o=k+p*Math.cos(n),l=w+p*Math.sin(n);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:s,y1:d,x2:o,y2:l,stroke:eg[3],strokeWidth:.5,strokeOpacity:.12,children:(0,t.jsx)("animate",{attributeName:"stroke-opacity",values:"0.06;0.18;0.06",dur:"2.5s",repeatCount:"indefinite"})}),(0,t.jsx)("circle",{cx:o,cy:l,r:5,fill:eg[3],fillOpacity:.25,stroke:eg[3],strokeWidth:1,strokeOpacity:.2,children:(0,t.jsx)("animate",{attributeName:"fillOpacity",values:"0.15;0.35;0.15",dur:"2s",repeatCount:"indefinite"})})]},"pg-"+r)})]},"promo-"+i)})})(),M.map(e=>{let r=a===e.id,n=(b[e.id]||[]).filter(e=>"S"===e.tier).length,o=(b[e.id]||[]).filter(e=>"A"===e.tier).length,l=z.some(t=>i.some(r=>r.profile_url===t.profile_url&&r.source_connection_id===e.id));return(0,t.jsxs)("g",{onClick:()=>c(e.id),onMouseEnter:()=>s(e.id),onMouseLeave:()=>s(null),style:{cursor:"pointer"},children:[(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:r?20:16,fill:`${ef[e.tier]}08`,stroke:`${ef[e.tier]}${r?"60":"25"}`,strokeWidth:1}),l&&(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:r?22:18,fill:"none",strokeWidth:2,strokeOpacity:.6,children:(0,t.jsx)("animate",{attributeName:"stroke",values:"#3498DB;#FFD700;#FF6B35;#9B59B6;#3498DB",dur:"4s",repeatCount:"indefinite"})}),(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:r?13:11,fill:e.profile_image_url?"#1a1a2e":ef[e.tier],stroke:r?"#fff":l?"#3498DB":ef[e.tier],strokeWidth:r?2.5:2,children:l&&!r&&(0,t.jsx)("animate",{attributeName:"stroke",values:"#3498DB;#FFD700;#FF6B35;#9B59B6;#3498DB",dur:"4s",repeatCount:"indefinite"})}),e.profile_image_url&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("clipPath",{id:"bc-"+e.id,children:(0,t.jsx)("circle",{cx:e.x,cy:e.y,r:r?11:9})}),(0,t.jsx)("image",{href:e.profile_image_url,x:e.x-(r?11:9),y:e.y-(r?11:9),width:r?22:18,height:r?22:18,clipPath:`url(#bc-${e.id})`})]}),!e.profile_image_url&&(0,t.jsx)("text",{x:e.x,y:e.y+4,textAnchor:"middle",fill:"S"===e.tier?"#000":"#fff",fontSize:11,fontWeight:700,children:e.name?.charAt(0)}),(0,t.jsx)("text",{x:e.x,y:e.y+(r?24:22),textAnchor:"middle",fill:"#fff",fontSize:9,fontWeight:600,children:e.name?.split(" ")[0]}),(0,t.jsxs)("text",{x:e.x,y:e.y+(r?34:32),textAnchor:"middle",fill:"#888",fontSize:7,children:[e.clusterSize," · ",n>0?n+"S ":"",o>0?o+"A":""]})]},"b-"+e.id)}),(0,t.jsx)("circle",{cx:k,cy:w,r:22,fill:"#0a0a1a",stroke:"#FFD700",strokeWidth:3}),(0,t.jsx)("text",{x:k,y:w+4,textAnchor:"middle",fill:"#FFD700",fontSize:11,fontWeight:800,children:o?.split(" ")[0]||"YOU"})]})}),(0,t.jsxs)("div",{style:{position:"absolute",bottom:20,right:20,zIndex:20,display:"flex",flexDirection:"column",gap:4},children:[(0,t.jsx)("button",{onClick:()=>h(e=>Math.min(3,e+.3)),style:{width:32,height:32,borderRadius:"50%",border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",color:"#fff",fontSize:18,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)"},children:"+"}),(0,t.jsx)("button",{onClick:()=>h(1.3),style:{width:32,height:32,borderRadius:"50%",border:"none",cursor:"pointer",background:"rgba(255,255,255,0.06)",color:"#666",fontSize:10,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center"},children:"⊙"}),(0,t.jsx)("button",{onClick:()=>h(e=>Math.max(.4,e-.3)),style:{width:32,height:32,borderRadius:"50%",border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",color:"#fff",fontSize:18,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)"},children:"−"})]}),(0,t.jsxs)("div",{style:{position:"absolute",bottom:16,left:12,background:"rgba(0,0,0,0.75)",borderRadius:10,padding:"10px 14px",backdropFilter:"blur(12px)",border:"1px solid rgba(255,255,255,0.06)",maxWidth:"calc(100vw - 80px)"},children:[(0,t.jsx)("div",{style:{fontSize:9,fontWeight:700,color:"#666",letterSpacing:1.5,marginBottom:8},children:"DEGREES OF SEPARATION"}),(0,t.jsx)("div",{style:{display:"flex",gap:8},children:[1,2,3,4,5,6].map(r=>(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsxs)("div",{style:{width:28,height:28,borderRadius:"50%",fontSize:11,fontWeight:800,display:"flex",alignItems:"center",justifyContent:"center",background:r<=2?eg[r]:"rgba(255,255,255,0.04)",color:r<=2?"#000":"#333",border:r<=2?"none":"1px solid rgba(255,255,255,0.08)",boxShadow:r<=2?`0 0 6px ${eg[r]}30`:"none"},children:["D",r]}),(0,t.jsx)("div",{style:{fontSize:7,color:r<=2?"#aaa":"#333",marginTop:3},children:1===r?e.length:2===r?C:"—"})]},r))}),(0,t.jsxs)("div",{style:{fontSize:9,color:"#555",marginTop:8},children:[v.length," bridges · ",F," S + ",B," A at D2"]}),(0,t.jsx)("div",{style:{fontSize:8,color:"#444",marginTop:4},children:"Click a bridge to see their D2 paths"})]})]})},modes:["degrees"],label:"Bridge Chains",icon:"🔗",desc:"Degree paths"},revolver:{component:function({connections:e=[],degree2:i=[],onSelect:n,userName:l="You",userImage:a=null}){let s=(0,r.useRef)(null),d=(0,r.useRef)(null),c=(0,r.useRef)(0),p=(0,r.useRef)(null),h=(0,r.useRef)(!1),u=(0,r.useRef)({onSelect:n}),[f,g]=(0,r.useState)({w:0,h:0}),[x,y]=(0,r.useState)(null),[m,b]=(0,r.useState)(0),v=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>t(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}();(0,r.useEffect)(()=>{u.current={onSelect:n}},[n]);let{bridges:k,clusters:w}=(0,r.useMemo)(()=>{let t=new Map;for(let e of i){let r=e.source_connection_id;if(!r)continue;let i=t.get(r);i?i.push(e):t.set(r,[e])}let r=e.filter(e=>t.has(e.id)).sort((e,t)=>(Number(t.circle_power)||0)-(Number(e.circle_power)||0));return{bridges:r.length?r:[...e].sort((e,t)=>(Number(t.power_score)||0)-(Number(e.power_score)||0)),clusters:t}},[e,i]),j=(0,r.useMemo)(()=>`${k.map(e=>e.id).join(",")}|${i.length}|${m}`,[k,i,m]),_=(0,r.useRef)({bridges:k,clusters:w});return(0,r.useEffect)(()=>{_.current={bridges:k,clusters:w}},[k,w]),(0,r.useEffect)(()=>{!x&&k.length&&y(k[0].id)},[x,k]),(0,r.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();g(e=>{let r=Math.round(t.width),i=Math.round(t.height);return e.w===r&&e.h===i?e:{w:r,h:i}})};t();let r=new ResizeObserver(t);return r.observe(e),window.addEventListener("resize",t),()=>{r.disconnect(),window.removeEventListener("resize",t)}},[]),(0,r.useEffect)(()=>{let e=d.current,{w:t,h:r}=f;if(!e||t<80||r<80)return;let{bridges:i,clusters:n}=_.current,s=i.length;if(0===s)return;let g=372*!v,k=v?56:70,w=v?32:40,j=k+2*w,S=Math.max(90,Math.min(v?150:230,(r-j-84)/2,(t-g)/2-56)),M=v?t/2:Math.max(S+60,(t-g)/2),z=Math.max(S+j+38,Math.min(r-S-46,r*(v?.42:.55))),C=Math.max(12,Math.floor(2*Math.PI*S/25)),F=Math.max(1,Math.ceil(s/C)),B=(m%F+F)%F,R=B*C,T=s>C?i.slice(R,R+C):i,$=T.length;if(0===$)return;let I=(0,o.select)(e);I.selectAll("*").remove(),I.attr("viewBox",`0 0 ${t} ${r}`),e.style.cursor="grab";let W=2*Math.PI/$,A=e=>ex+e*W,E=2*Math.PI*S/Math.max(1,$),D=Math.max(9,Math.min(26,E/2.6)),O=E>70,L=T.findIndex(e=>e.id===x);L<0&&(L=0);let P=T[L],N=I.append("defs");N.append("filter").attr("id","bridge-cloud-blur").attr("x","-40%").attr("y","-40%").attr("width","180%").attr("height","180%").append("feGaussianBlur").attr("stdDeviation",5);let Y=N.append("radialGradient").attr("id","bridge-nebula").attr("cx","50%").attr("cy","50%").attr("r","50%");function U(e,t){if(e.append("circle").attr("r",t.r).attr("fill",t.fill).attr("stroke","rgba(255,255,255,0.25)").attr("stroke-width",1),t.showInitials&&e.append("text").attr("text-anchor","middle").attr("dy","0.35em").attr("font-size",Math.max(6.5,.72*t.r)).attr("font-weight",700).attr("fill",t.textFill??"rgba(8,10,25,0.92)").attr("pointer-events","none").text((0,ep.initialsFor)(t.name)),t.imageUrl){let r=`bridgering-clip-${String(t.key).replace(/[^\w-]/g,"_")}`;N.append("clipPath").attr("id",r).append("circle").attr("r",t.r),e.append("image").attr("href",t.imageUrl).attr("x",-t.r).attr("y",-t.r).attr("width",2*t.r).attr("height",2*t.r).attr("clip-path",`url(#${r})`).attr("preserveAspectRatio","xMidYMid slice").attr("pointer-events","none").on("error",e=>{(0,o.select)(e.currentTarget).attr("display","none")})}}Y.append("stop").attr("offset","0%").attr("stop-color","currentColor").attr("stop-opacity",.22),Y.append("stop").attr("offset","60%").attr("stop-color","currentColor").attr("stop-opacity",.06),Y.append("stop").attr("offset","100%").attr("stop-color","currentColor").attr("stop-opacity",0),I.append("circle").attr("cx",M).attr("cy",z).attr("r",S).attr("fill","none").attr("stroke","rgba(255,255,255,0.06)").attr("stroke-width",1.5).attr("stroke-dasharray","2 7");let H=I.append("line").attr("x1",M).attr("y1",z).attr("stroke","rgba(255,255,255,0.15)").attr("stroke-width",1),G=I.append("g").attr("transform",`translate(${M}, ${z-S})`).append("g").attr("transform","scale(0.88)").style("opacity",0).style("transition","opacity 260ms ease"),q=null,X=null,V=e=>G.attr("transform",`scale(${e})`);function K(){G.style("opacity",0),V(.92)}function J(){let e,t;G.style("opacity",1),G.selectAll(".cluster-node, .cluster-chip").style("opacity",1),null!==q&&cancelAnimationFrame(q),null!==X&&clearTimeout(X),e=performance.now(),t=r=>{let i=Math.min(1,(r-e)/300);V(.9+.09999999999999998*(1-Math.pow(1-i,3))),q=i<1?requestAnimationFrame(t):null},q=requestAnimationFrame(t),X=setTimeout(()=>{V(1),X=null},420)}let Z=!1,Q=n.get(P.id)??[],ee=[...Q].sort((e,t)=>(Number(t.power_score)||0)-(Number(e.power_score)||0)).slice(0,24);if(ee.length>0){let e=ee.length<=6?2:3,t=100*Math.PI/180,r=Array.from({length:e},()=>[]);ee.forEach((t,i)=>r[i%e].push(i));let i=[];r.forEach((e,r)=>{let n=S+k+r*w;e.forEach((r,o)=>{let l=1===e.length?ex:ex-t/2+t*o/(e.length-1),a=ee[r];i.push({c:a,x:n*Math.cos(l),y:n*Math.sin(l)+S,r:Math.max(5,Math.min(9,5+(Number(a.power_score)||0)/13*4))})})});let n=[];i.forEach(e=>{for(let t=0;t<8;t++){let r=t/8*Math.PI*2;n.push({x:e.x+(e.r+18)*Math.cos(r),y:e.y+(e.r+18)*Math.sin(r)})}});let o=function(e){let t=e.length;if(t<3)return"";let r=`M ${e[0].x.toFixed(1)} ${e[0].y.toFixed(1)}`;for(let i=0;i<t;i++){let n=e[(i-1+t)%t],o=e[i],l=e[(i+1)%t],a=e[(i+2)%t],s=o.x+(l.x-n.x)/6,d=o.y+(l.y-n.y)/6,c=l.x-(a.x-o.x)/6,p=l.y-(a.y-o.y)/6;r+=` C ${s.toFixed(1)} ${d.toFixed(1)}, ${c.toFixed(1)} ${p.toFixed(1)}, ${l.x.toFixed(1)} ${l.y.toFixed(1)}`}return`${r} Z`}(function(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y);if(t.length<=2)return t;let r=(e,t,r)=>(t.x-e.x)*(r.y-e.y)-(t.y-e.y)*(r.x-e.x),i=[];for(let e of t){for(;i.length>=2&&0>=r(i[i.length-2],i[i.length-1],e);)i.pop();i.push(e)}let n=[];for(let e=t.length-1;e>=0;e--){let i=t[e];for(;n.length>=2&&0>=r(n[n.length-2],n[n.length-1],i);)n.pop();n.push(i)}return i.pop(),n.pop(),i.concat(n)}(n)),l=ep.TIER_COLORS[P.tier]||ep.TIER_COLORS.D,a=i.reduce((e,t)=>e+t.x,0)/i.length,s=i.reduce((e,t)=>e+t.y,0)/i.length,d=Math.max(...i.map(e=>Math.hypot(e.x-a,e.y-s)))+40;G.append("circle").attr("cx",a).attr("cy",s).attr("r",d).style("color",l).attr("fill","url(#bridge-nebula)"),o&&(G.append("path").attr("d",o).attr("fill",l).attr("fill-opacity",.07).attr("filter","url(#bridge-cloud-blur)"),G.append("path").attr("d",o).attr("fill","none").attr("stroke",l).attr("stroke-opacity",.2).attr("stroke-width",1)),i.forEach(e=>{G.append("line").attr("x1",0).attr("y1",0).attr("x2",e.x).attr("y2",e.y).attr("stroke","rgba(255,255,255,0.06)").attr("stroke-width",1)}),i.forEach((e,t)=>{let r=G.append("g").attr("class","cluster-node").attr("transform",`translate(${e.x}, ${e.y})`).style("cursor","pointer").style("opacity",0).style("transition",`opacity 200ms ease ${16*t}ms`);U(r,{key:`c-${e.c.id}`,r:e.r,fill:ep.TIER_COLORS[e.c.tier]||ep.TIER_COLORS.D,name:e.c.name,imageUrl:e.c.profile_image_url,showInitials:e.r>=8}),r.append("title").text(e.c.headline?`${e.c.name} — ${e.c.headline}`:e.c.name),r.on("click",t=>{if(t.stopPropagation(),Z){Z=!1;return}u.current.onSelect?.(e.c)})});let c=Math.min(...i.map(e=>e.y-e.r))-22,p=P.circle_s_count??0,h=P.circle_a_count??0,f=i.length<Q.length?`showing ${i.length} of ${Q.length}`:`${i.length} people`,g=P.is_catalyst?`⚡ catalyst circle \xb7 ${f}`:`circle unlocked \xb7 ${f} \xb7 ${p}S ${h}A`,x=G.append("g").attr("class","cluster-chip").attr("transform",`translate(${a}, ${c})`).style("opacity",0).style("transition",`opacity 240ms ease ${16*i.length+80}ms`),y=x.append("text").attr("text-anchor","middle").attr("dy","0.35em").attr("font-size",11).attr("font-weight",600).attr("fill",P.is_catalyst?ep.TIER_COLORS.S:"#e2e8f0").text(g),m=(y.node()?.getComputedTextLength()??6*g.length)+20;x.insert("rect","text").attr("x",-m/2).attr("y",-11).attr("width",m).attr("height",22).attr("rx",11).attr("fill","rgba(10,10,25,0.75)").attr("stroke",P.is_catalyst?ep.TIER_COLORS.S:"rgba(255,255,255,0.15)").attr("stroke-opacity",P.is_catalyst?.6:1).attr("stroke-width",1)}let et=I.append("g"),er=T.map((e,t)=>{let r=O?Math.min(D,14+(Number(e.power_score)||0)):D+4*(t===L),i=t===L,n=et.append("g").style("cursor","pointer").attr("opacity",i?1:.6);if(e.is_catalyst&&n.append("circle").attr("r",r+4).attr("fill","none").attr("stroke",ep.TIER_COLORS.S).attr("stroke-opacity",.85).attr("stroke-width",1.5),i&&n.append("circle").attr("r",r+(e.is_catalyst?8:5)).attr("fill","none").attr("stroke","rgba(255,255,255,0.35)").attr("stroke-width",1),U(n,{key:`b-${e.id}`,r,fill:ep.TIER_COLORS[e.tier]||ep.TIER_COLORS.D,name:e.name,imageUrl:e.profile_image_url,showInitials:!0}),!O&&!i)return n;let o=n.append("g").attr("opacity",i?1:v?.15:.7).attr("pointer-events","none");return o.append("text").attr("text-anchor","middle").attr("y",r+15).attr("font-size",11).attr("font-weight",i?700:500).attr("fill",i?"#f8fafc":"#94a3b8").text(em(e.name)),o.append("text").attr("text-anchor","middle").attr("y",r+28).attr("font-size",9.5).attr("fill",ep.TIER_COLORS[e.tier]||ep.TIER_COLORS.D).attr("fill-opacity",.9).text(`${(Number(e.circle_power)||0).toFixed(1)} circle power`),n.append("title").text(e.headline?`${e.name} — ${e.headline}`:e.name),n.on("click",e=>{if(e.stopPropagation(),Z){Z=!1;return}el(),ec(t)}),n}),ei=I.append("g").attr("transform",`translate(${M}, ${z})`),en=v?22:28;if(ei.append("circle").attr("r",en+6).attr("fill","none").attr("stroke","rgba(255,255,255,0.08)").attr("stroke-width",1),U(ei,{key:"user",r:en,fill:"#1c1c42",textFill:"#e2e8f0",name:l,imageUrl:a,showInitials:!0}),ei.append("text").attr("text-anchor","middle").attr("y",en+17).attr("font-size",11).attr("font-weight",600).attr("fill","#cbd5e1").text(em(l)),ei.append("text").attr("text-anchor","middle").attr("y",en+30).attr("font-size",9).attr("fill","#64748b").text("you"),s>12){let e=Math.max(20,z-S-(v?96:118)),t=R+1,r=R+$,i=[...new Set(T.map(e=>e.tier).filter(Boolean))].sort((e,t)=>"SABCD".indexOf(e)-"SABCD".indexOf(t)),n=I.append("g").attr("transform",`translate(${M}, ${e})`);n.append("text").attr("text-anchor","middle").attr("font-size",10.5).attr("fill","rgba(255,255,255,0.4)").attr("letter-spacing","0.06em").attr("pointer-events","none").text(F>1?`${t}\u2013${r} of ${s} \u00b7 page ${B+1}/${F} \u00b7 by circle power`:`all ${s} bridges \u00b7 by circle power`),n.append("text").attr("y",15).attr("text-anchor","middle").attr("font-size",10).attr("pointer-events","none").selectAll("tspan").data(i).join("tspan").attr("dx",(e,t)=>7*!!t).attr("fill",e=>ep.TIER_COLORS[e]||ep.TIER_COLORS.D).text(e=>e);let o=(e,t,r)=>{let i=n.append("g").attr("transform",`translate(${e}, 0)`).style("cursor","pointer");i.append("circle").attr("r",11).attr("fill","rgba(255,255,255,0.06)").attr("stroke","rgba(255,255,255,0.14)").attr("stroke-width",1),i.append("text").attr("text-anchor","middle").attr("dy","0.34em").attr("font-size",12).attr("fill","#cbd5e1").attr("pointer-events","none").text(r),i.append("title").text(t>0?"Next bridges":"Previous bridges"),i.on("click",e=>{e.stopPropagation(),Z=!0,b(e=>e+t)})};F>1&&(o(-(v?92:118),-1,"‹"),o(v?92:118,1,"›"))}let eo=h.current?null:I.append("text").attr("x",M).attr("y",Math.min(v?.54*r-12:r-12,z+S+(v?42:54))).attr("text-anchor","middle").attr("font-size",11).attr("fill","rgba(255,255,255,0.3)").attr("letter-spacing","0.08em").attr("pointer-events","none").style("transition","opacity 600ms ease").text("drag to rotate · release to snap");function el(){h.current||(h.current=!0,eo?.style("opacity",0))}function ea(){let e=c.current;er.forEach((t,r)=>{let i=A(r)+e;t.attr("transform",`translate(${M+S*Math.cos(i)}, ${z+S*Math.sin(i)})`)});let t=A(L)+e;H.attr("x2",M+S*Math.cos(t)).attr("y2",z+S*Math.sin(t))}let es=null;function ed(){null!==p.current&&(cancelAnimationFrame(p.current),p.current=null),null!==es&&(clearTimeout(es),es=null)}function ec(e){var t;let r,i,n,o,l,a,s=c.current+ey(ex-A(e)-c.current),d=T[e],h=d.id;h!==x&&K(),t=()=>{u.current.onSelect?.(d),h!==x?y(h):J()},ed(),i=ey(s-(r=c.current)),n=performance.now(),o=!1,l=()=>{o||(o=!0,ed(),c.current=r+i,ea(),t?.())},a=e=>{let t=Math.min(1,(e-n)/350);c.current=r+i*(1-Math.pow(1-t,3)),ea(),t<1?p.current=requestAnimationFrame(a):(p.current=null,l())},p.current=requestAnimationFrame(a),es=setTimeout(l,470)}let eh=!1,eu=!1,ef=0,eg=0,eb=0,ev=i=>{let n=e.getBoundingClientRect();return{x:n.width>0?(i.clientX-n.left)/n.width*t:0,y:n.height>0?(i.clientY-n.top)/n.height*r:0}};function ek(t){if("mouse"===t.pointerType&&0!==t.button)return;ed(),eh=!0,eu=!1,Z=!1,ef=t.clientX,eg=t.clientY;let r=ev(t);eb=Math.atan2(r.y-z,r.x-M);try{e.setPointerCapture(t.pointerId)}catch{}}function ew(t){if(!eh)return;if(!eu){if(6>Math.hypot(t.clientX-ef,t.clientY-eg))return;eu=!0,Z=!0,e.style.cursor="grabbing",K(),el()}let r=ev(t),i=Math.atan2(r.y-z,r.x-M);c.current+=ey(i-eb),eb=i,ea()}function ej(t){if(!eh)return;eh=!1,e.style.cursor="grab";try{e.releasePointerCapture(t.pointerId)}catch{}if(!eu)return;let r=0,i=1/0;for(let e=0;e<$;e++){let t=Math.abs(ey(A(e)+c.current-ex));t<i&&(i=t,r=e)}ec(r)}function e_(){if(Z){Z=!1;return}u.current.onSelect?.(null)}function eS(e){let t=0;if("ArrowRight"===e.key||"ArrowDown"===e.key)t=1;else{if("ArrowLeft"!==e.key&&"ArrowUp"!==e.key)return;t=-1}(e.preventDefault(),el(),e.shiftKey&&F>1)?b(e=>e+t):ec((L+t+$)%$)}e.addEventListener("pointerdown",ek),e.addEventListener("pointermove",ew),e.addEventListener("pointerup",ej),e.addEventListener("pointercancel",ej),e.addEventListener("click",e_),e.addEventListener("keydown",eS),c.current=ey(-L*W),ea();let eM=[],ez=!1,eC=()=>{ez||(ez=!0,J())};eM.push(requestAnimationFrame(()=>{eM.push(requestAnimationFrame(eC))}));let eF=setTimeout(eC,200);return()=>{ed(),null!==q&&cancelAnimationFrame(q),null!==X&&clearTimeout(X),clearTimeout(eF),eM.forEach(e=>cancelAnimationFrame(e)),e.removeEventListener("pointerdown",ek),e.removeEventListener("pointermove",ew),e.removeEventListener("pointerup",ej),e.removeEventListener("pointercancel",ej),e.removeEventListener("click",e_),e.removeEventListener("keydown",eS),I.selectAll("*").remove()}},[j,x,m,v,f,l,a]),(0,t.jsx)("div",{ref:s,style:{position:"relative",flex:1,minHeight:0,width:"100%"},children:(0,t.jsx)("svg",{ref:d,tabIndex:0,role:"application","aria-label":"Bridge dial. Drag to rotate, or use the arrow keys to select the previous or next bridge; the selected bridge sits at the top with their known circle fanned above.",style:{height:"100%",width:"100%",userSelect:"none",touchAction:"none",borderRadius:12,outline:"none"}})})},modes:["degrees"],label:"Revolver",icon:"🎯",desc:"Rotary dial · spin to switch"},rings:{component:function({connections:e,degree2:i=[],onSelect:n,mode:o}){let[l,a]=(0,r.useState)(null);if("degrees"===o&&i.length>0){let r={};i.forEach(e=>{e.source_connection_id&&(r[e.source_connection_id]||(r[e.source_connection_id]=[]),r[e.source_connection_id].push(e))});let o=Object.entries(r).map(([t,r])=>{let i=e.find(e=>e.id===t);if(!i)return null;let n=r.filter(e=>"S"===e.tier).length,o=r.filter(e=>"A"===e.tier).length;return{bridge:i,members:r,sCount:n,aCount:o,total:r.length,value:3*n+2*o+r.length}}).filter(Boolean).sort((e,t)=>t.value-e.value),s={S:36,A:28,B:22,C:16,D:12};return(0,t.jsx)("div",{style:{flex:1,overflow:"auto",background:"#0a0a1a",padding:"20px 10px"},children:(0,t.jsx)("div",{style:{maxWidth:1200,margin:"0 auto"},children:o.map((e,r)=>{let i={};return ej.forEach(e=>{i[e]=[]}),e.members.forEach(e=>{(i[e.tier]||i.D).push(e)}),ej.forEach(e=>{i[e].sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0))}),(0,t.jsxs)("div",{style:{marginBottom:30},children:[(0,t.jsx)("div",{style:{textAlign:"center",marginBottom:12},children:(0,t.jsxs)("div",{onClick:()=>n&&n(e.bridge),onMouseEnter:()=>a(e.bridge.id),onMouseLeave:()=>a(null),style:{display:"inline-block",cursor:"pointer",position:"relative"},children:[(0,t.jsx)("div",{style:{width:56,height:56,borderRadius:"50%",margin:"0 auto",border:`3px solid ${ew[e.bridge.tier]}`,overflow:"hidden",background:"#1a1a2e",boxShadow:l===e.bridge.id?`0 0 20px ${ew[e.bridge.tier]}60`:`0 0 10px ${ew[e.bridge.tier]}20`,transition:"box-shadow 0.2s"},children:e.bridge.profile_image_url?(0,t.jsx)("img",{src:e.bridge.profile_image_url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):(0,t.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:ew[e.bridge.tier],color:"S"===e.bridge.tier?"#000":"#fff",fontSize:20,fontWeight:800},children:e.bridge.name?.charAt(0)})}),(0,t.jsx)("div",{style:{fontSize:12,fontWeight:700,color:"#fff",marginTop:4},children:e.bridge.name}),(0,t.jsxs)("div",{style:{fontSize:9,color:ew[e.bridge.tier],fontWeight:600},children:[e.bridge.tier,"-Tier · ",e.total," connections · ",e.sCount>0?e.sCount+"S ":"",e.aCount>0?e.aCount+"A":""]})]})}),ej.map(e=>{let r=i[e];if(0===r.length)return null;let o=s[e],d="S"===e?10:"A"===e?6:4;return(0,t.jsxs)("div",{style:{marginBottom:6},children:[(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:d},children:r.map(r=>{let i=l===r.id;return(0,t.jsxs)("div",{onClick:()=>n&&n(r),onMouseEnter:()=>a(r.id),onMouseLeave:()=>a(null),style:{position:"relative",cursor:"pointer"},children:[(0,t.jsx)("div",{style:{width:o,height:o,borderRadius:"50%",border:`2px solid ${ew[e]}`,overflow:"hidden",background:r.profile_image_url?"#111":ew[e],transition:"transform 0.15s, box-shadow 0.15s",transform:i?"scale(1.3)":"scale(1)",boxShadow:i?`0 0 12px ${ew[e]}60`:"none"},children:r.profile_image_url?(0,t.jsx)("img",{src:r.profile_image_url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"},onError:t=>{t.target.style.display="none",t.target.parentElement.style.background=ew[e]}}):(0,t.jsx)("span",{style:{display:"flex",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",fontSize:.4*o,fontWeight:700,color:"S"===e?"#000":"#fff"},children:r.name?.charAt(0)})}),("S"===e||i)&&(0,t.jsx)("div",{style:{position:"absolute",top:o+2,left:"50%",transform:"translateX(-50%)",whiteSpace:"nowrap",textAlign:"center",zIndex:20,pointerEvents:"none"},children:(0,t.jsxs)("div",{style:{fontSize:i?10:8,fontWeight:600,color:i?"#fff":"#aaa",background:i?"rgba(0,0,0,0.85)":"transparent",padding:i?"3px 8px":0,borderRadius:4},children:[r.name?.split(" ")[0],i&&(0,t.jsx)("span",{style:{color:ew[e],marginLeft:4},children:parseFloat(r.power_score||0).toFixed(1)})]})})]},r.id)})}),(0,t.jsx)("div",{style:{height:1,margin:"6px auto 0",width:`${40+10*ej.indexOf(e)}%`,background:`linear-gradient(90deg, transparent, ${ew[e]}20, transparent)`}})]},e)})]},e.bridge.id)})})})}let s={};ej.forEach(e=>{s[e]=[]}),e.forEach(e=>{let t=e.tier||"D";s[t]&&s[t].push(e)}),ej.forEach(e=>{s[e].sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0))});let d={S:44,A:34,B:26,C:20,D:16};return(0,t.jsx)("div",{style:{flex:1,overflow:"auto",background:"#0a0a1a",padding:"20px 10px"},children:(0,t.jsx)("div",{style:{maxWidth:1200,margin:"0 auto"},children:ej.map((e,r)=>{let i=s[e];if(0===i.length)return null;let o=d[e],c="S"===e?12:"A"===e?8:"B"===e?6:4;return(0,t.jsxs)("div",{style:{marginBottom:"S"===e?20:"A"===e?16:10},children:[(0,t.jsxs)("div",{style:{textAlign:"center",marginBottom:8,fontSize:"S"===e?14:11,fontWeight:700,color:ew[e],opacity:"S"===e?1:.7},children:["S"===e&&"👑 ",e,"-Tier (",i.length,")"]}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:c,padding:"0 20px"},children:i.map(r=>{let i=l===r.id;return(0,t.jsxs)("div",{onClick:()=>n&&n(r),onMouseEnter:()=>a(r.id),onMouseLeave:()=>a(null),style:{position:"relative",cursor:"pointer"},children:[(0,t.jsx)("div",{style:{width:o,height:o,borderRadius:"50%",border:`2px solid ${ew[e]}`,overflow:"hidden",background:r.profile_image_url?"#111":ew[e],display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.15s, box-shadow 0.15s",transform:i?"scale(1.3)":"scale(1)",boxShadow:i?`0 0 16px ${ew[e]}60`:"none",zIndex:i?10:1,position:"relative"},children:r.profile_image_url?(0,t.jsx)("img",{src:r.profile_image_url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"},onError:t=>{t.target.style.display="none",t.target.parentElement.style.background=ew[e]}}):(0,t.jsx)("span",{style:{fontSize:.4*o,fontWeight:700,color:"S"===e?"#000":"#fff"},children:r.name?.charAt(0)})}),("S"===e||i)&&(0,t.jsxs)("div",{style:{position:"absolute",top:o+4,left:"50%",transform:"translateX(-50%)",whiteSpace:"nowrap",textAlign:"center",zIndex:20,pointerEvents:"none"},children:[(0,t.jsxs)("div",{style:{fontSize:"S"===e?9:10,fontWeight:600,color:i?"#fff":"#aaa",background:i?"rgba(0,0,0,0.85)":"transparent",padding:i?"3px 8px":0,borderRadius:4},children:[r.name?.split(" ")[0],i&&(0,t.jsx)("span",{style:{color:ew[e],marginLeft:4,fontWeight:800},children:parseFloat(r.power_score||0).toFixed(1)})]}),i&&r.headline&&(0,t.jsx)("div",{style:{fontSize:8,color:"#888",marginTop:2,background:"rgba(0,0,0,0.85)",padding:"2px 6px",borderRadius:3,maxWidth:160,overflow:"hidden",textOverflow:"ellipsis"},children:r.headline.substring(0,40)})]})]},r.id)})}),r<ej.length-1&&(0,t.jsx)("div",{style:{height:1,margin:"12px auto 0",width:`${50+12*r}%`,background:`linear-gradient(90deg, transparent, ${ew[e]}30, transparent)`}})]},e)})})})},modes:["network","degrees"],label:"Pyramid",icon:"🔺",desc:"Tier hierarchy"},list:{component:function({connections:e,degree2:r=[],onSelect:i,mode:n}){if("degrees"===n){let n={};r.forEach(e=>{e.source_connection_id&&(n[e.source_connection_id]||(n[e.source_connection_id]=[]),n[e.source_connection_id].push(e))});let o=Object.entries(n).map(([t,r])=>{let i=e.find(e=>e.id===t);if(!i)return null;let n=r.filter(e=>"S"===e.tier).length,o=r.filter(e=>"A"===e.tier).length,l=3*n+2*o+r.length;return{bridge:i,members:r,sCount:n,aCount:o,total:r.length,value:l}}).filter(Boolean).sort((e,t)=>t.value-e.value);return(0,t.jsx)("div",{style:{flex:1,overflow:"auto",padding:"16px 24px",background:"#0a0a1a"},children:(0,t.jsxs)("div",{style:{maxWidth:800,margin:"0 auto"},children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"40px 1fr 50px 50px 50px 80px",gap:8,padding:"8px 12px",fontSize:9,fontWeight:700,color:"#555",borderBottom:"1px solid rgba(255,255,255,0.1)",textTransform:"uppercase",letterSpacing:.5},children:[(0,t.jsx)("span",{children:"#"}),(0,t.jsx)("span",{children:"Bridge"}),(0,t.jsx)("span",{children:"S"}),(0,t.jsx)("span",{children:"A"}),(0,t.jsx)("span",{children:"Total"}),(0,t.jsx)("span",{children:"Value"})]}),o.map((e,r)=>(0,t.jsxs)("div",{onClick:()=>i&&i(e.bridge),style:{display:"grid",gridTemplateColumns:"40px 1fr 50px 50px 50px 80px",gap:8,padding:"10px 12px",alignItems:"center",cursor:"pointer",borderBottom:"1px solid rgba(255,255,255,0.04)",transition:"background 0.1s"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.04)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[(0,t.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"#444"},children:r+1}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[e.bridge.profile_image_url?(0,t.jsx)("img",{src:e.bridge.profile_image_url,alt:"",style:{width:28,height:28,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:`2px solid ${ek[e.bridge.tier]}`},onError:e=>{e.target.style.display="none"}}):(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:"50%",flexShrink:0,fontSize:10,fontWeight:700,background:ek[e.bridge.tier],color:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:e.bridge.name?.charAt(0)}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"#fff",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.bridge.name}),(0,t.jsxs)("div",{style:{fontSize:9,color:ek[e.bridge.tier],fontWeight:600},children:[e.bridge.tier,"-Tier"]})]})]}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:800,color:"#FFD700"},children:e.sCount}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"#9B59B6"},children:e.aCount}),(0,t.jsx)("span",{style:{fontSize:12,color:"#888"},children:e.total}),(0,t.jsx)("div",{children:(0,t.jsx)("div",{style:{height:6,background:"rgba(255,255,255,0.06)",borderRadius:3},children:(0,t.jsx)("div",{style:{height:"100%",borderRadius:3,background:`linear-gradient(90deg, ${ek[e.bridge.tier]}, #FF6B35)`,width:`${Math.min(100,e.value/Math.max(o[0]?.value||1,1)*100)}%`}})})})]},e.bridge.id))]})})}let o=[...e].sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0)),l=parseFloat(o[0]?.power_score)||10;return(0,t.jsx)("div",{style:{flex:1,overflow:"auto",padding:"16px 24px",background:"#0a0a1a"},children:(0,t.jsxs)("div",{style:{maxWidth:800,margin:"0 auto"},children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"40px 36px 1fr 60px 120px",gap:8,padding:"8px 12px",fontSize:9,fontWeight:700,color:"#555",borderBottom:"1px solid rgba(255,255,255,0.1)",textTransform:"uppercase",letterSpacing:.5},children:[(0,t.jsx)("span",{children:"#"}),(0,t.jsx)("span",{}),(0,t.jsx)("span",{children:"Name"}),(0,t.jsx)("span",{children:"Score"}),(0,t.jsx)("span",{children:"Power"})]}),o.map((e,r)=>(0,t.jsxs)("div",{onClick:()=>i&&i(e),style:{display:"grid",gridTemplateColumns:"40px 36px 1fr 60px 120px",gap:8,padding:"8px 12px",alignItems:"center",cursor:"pointer",borderBottom:"1px solid rgba(255,255,255,0.04)",background:r<3?`${ek[e.tier]}08`:"transparent",transition:"background 0.1s"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.04)",onMouseLeave:t=>t.currentTarget.style.background=r<3?`${ek[e.tier]}08`:"transparent",children:[(0,t.jsx)("span",{style:{fontSize:12,fontWeight:700,color:r<3?ek[e.tier]:"#444"},children:r+1}),e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:28,height:28,borderRadius:"50%",objectFit:"cover",border:`2px solid ${ek[e.tier]}`},onError:e=>{e.target.style.display="none"}}):(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:"50%",fontSize:10,fontWeight:700,background:ek[e.tier],color:"S"===e.tier?"#000":"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.name?.charAt(0)}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"#fff",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,t.jsx)("div",{style:{fontSize:9,color:"#666",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.headline?.substring(0,45)})]}),(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)("span",{style:{fontSize:13,fontWeight:800,color:ek[e.tier]},children:parseFloat(e.power_score||0).toFixed(1)}),(0,t.jsx)("div",{style:{fontSize:8,color:"#555"},children:e.tier})]}),(0,t.jsx)("div",{style:{height:6,background:"rgba(255,255,255,0.06)",borderRadius:3},children:(0,t.jsx)("div",{style:{height:"100%",borderRadius:3,background:ek[e.tier],width:`${parseFloat(e.power_score||0)/l*100}%`}})})]},e.id))]})})},modes:["network","degrees"],label:"List",icon:"☰",desc:"Ranked power list"},grid:{component:function({connections:e,degree2:r=[],onSelect:i,mode:n}){if("degrees"===n){let n={};r.forEach(e=>{e.source_connection_id&&(n[e.source_connection_id]||(n[e.source_connection_id]=[]),n[e.source_connection_id].push(e))});let o=Object.entries(n).map(([t,r])=>{let i=e.find(e=>e.id===t);if(!i)return null;let n=r.filter(e=>"S"===e.tier).length,o=r.filter(e=>"A"===e.tier).length;return{bridge:i,members:r,sCount:n,aCount:o,total:r.length}}).filter(Boolean).sort((e,t)=>3*t.sCount+2*t.aCount+t.total-(3*e.sCount+2*e.aCount+e.total));return(0,t.jsx)("div",{style:{flex:1,overflow:"auto",padding:20,background:"#0a0a1a"},children:(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:12,maxWidth:1200,margin:"0 auto"},children:o.map(e=>(0,t.jsxs)("div",{onClick:()=>i&&i(e.bridge),style:{padding:16,borderRadius:12,cursor:"pointer",background:"rgba(255,255,255,0.03)",border:`1px solid ${eb[e.bridge.tier]||"#333"}30`,borderLeft:`4px solid ${eb[e.bridge.tier]||"#555"}`,transition:"all 0.15s"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:e=>e.currentTarget.style.background="rgba(255,255,255,0.03)",children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[e.bridge.profile_image_url?(0,t.jsx)("img",{src:e.bridge.profile_image_url,alt:"",style:{width:40,height:40,borderRadius:"50%",objectFit:"cover",border:`2px solid ${eb[e.bridge.tier]}`},onError:e=>{e.target.style.display="none"}}):(0,t.jsx)("div",{style:{width:40,height:40,borderRadius:"50%",fontSize:16,fontWeight:700,background:eb[e.bridge.tier],color:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:e.bridge.name?.charAt(0)}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"#fff"},children:e.bridge.name}),(0,t.jsx)("div",{style:{fontSize:9,color:"#666",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.bridge.headline?.substring(0,40)})]}),(0,t.jsx)("span",{style:{fontSize:12,fontWeight:800,color:eb[e.bridge.tier]},children:e.bridge.tier})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,fontSize:10},children:[e.sCount>0&&(0,t.jsxs)("span",{style:{color:"#FFD700",fontWeight:600},children:[e.sCount,"S"]}),e.aCount>0&&(0,t.jsxs)("span",{style:{color:"#9B59B6",fontWeight:600},children:[e.aCount,"A"]}),(0,t.jsxs)("span",{style:{color:"#666"},children:[e.total," total"]})]}),(0,t.jsxs)("div",{style:{display:"flex",marginTop:8},children:[e.members.slice(0,8).map((e,r)=>(0,t.jsx)("div",{style:{width:22,height:22,borderRadius:"50%",fontSize:8,fontWeight:700,background:e.profile_image_url?"transparent":eb[e.tier]||"#333",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #0a0a1a",marginLeft:r>0?-6:0,position:"relative",zIndex:8-r,overflow:"hidden"},children:e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):e.name?.charAt(0)},e.id)),e.total>8&&(0,t.jsxs)("span",{style:{fontSize:9,color:"#555",marginLeft:4,alignSelf:"center"},children:["+",e.total-8]})]})]},e.bridge.id))})})}let o={};return ev.forEach(e=>{o[e]=[]}),e.forEach(e=>{let t=e.tier||"D";o[t]&&o[t].push(e)}),ev.forEach(e=>{o[e].sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0))}),(0,t.jsx)("div",{style:{flex:1,overflow:"auto",padding:20,background:"#0a0a1a"},children:(0,t.jsx)("div",{style:{maxWidth:1200,margin:"0 auto"},children:ev.map(e=>{let r=o[e];return 0===r.length?null:(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 0 10px",borderBottom:`2px solid ${eb[e]}30`,marginBottom:10},children:[(0,t.jsx)("div",{style:{width:10,height:10,borderRadius:"50%",background:eb[e]}}),(0,t.jsxs)("span",{style:{fontSize:15,fontWeight:800,color:eb[e]},children:[e,"-Tier"]}),(0,t.jsx)("span",{style:{fontSize:12,color:"#555"},children:r.length})]}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))",gap:8},children:r.map(r=>(0,t.jsxs)("div",{onClick:()=>i&&i(r),style:{padding:10,borderRadius:8,cursor:"pointer",background:"rgba(255,255,255,0.03)",border:`1px solid ${eb[e]}20`,transition:"all 0.15s"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:e=>e.currentTarget.style.background="rgba(255,255,255,0.03)",children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[r.profile_image_url?(0,t.jsx)("img",{src:r.profile_image_url,alt:"",style:{width:32,height:32,borderRadius:"50%",objectFit:"cover",border:`2px solid ${eb[e]}`},onError:e=>{e.target.style.display="none"}}):(0,t.jsx)("div",{style:{width:32,height:32,borderRadius:"50%",fontSize:12,fontWeight:700,background:eb[e],color:"S"===e?"#000":"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:r.name?.charAt(0)}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"#fff",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.name}),(0,t.jsx)("div",{style:{fontSize:8,color:"#666",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.headline?.substring(0,30)})]})]}),(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginTop:6,alignItems:"center"},children:[(0,t.jsx)("span",{style:{fontSize:10,fontWeight:700,color:eb[e]},children:parseFloat(r.power_score||0).toFixed(1)}),(0,t.jsx)("div",{style:{flex:1,marginLeft:8,height:3,background:"rgba(255,255,255,0.08)",borderRadius:2},children:(0,t.jsx)("div",{style:{height:"100%",borderRadius:2,background:eb[e],width:`${Math.min(100,10*(parseFloat(r.power_score)||0))}%`}})})]})]},r.id))})]},e)})})})},modes:["network","degrees"],label:"Grid",icon:"▦",desc:"Cards"}},eZ=["galaxy","orbit","separation","chain","revolver","rings","list"];function eQ(e){return eZ.filter(t=>eJ[t]?.modes.includes(e)).map(e=>({key:e,...eJ[e]}))}var e0=e.i(15812);function e1({selected:e,stats:i,tierColors:n,connections:o,degree2:l=[],mode:a,collapsed:s,filter:d,pending:c=[],onToggle:p,onSelect:h,onSwitchMode:u,onFocusNode:f,onMarkSent:g,onUndoPending:x}){let y,m="degrees"===a,{userId:b,userProfile:v}=(0,e0.useUser)(),[k,w]=(0,r.useState)(""),j=(0,r.useMemo)(()=>{let e={};return l.forEach(t=>{t.source_connection_id&&(e[t.source_connection_id]||(e[t.source_connection_id]=[]),e[t.source_connection_id].push(t))}),e},[l]),_=(0,r.useMemo)(()=>(function(e=[]){let t=new Map;for(let r of e||[]){let e=eC(r),i=t.get(e);i||(i=new Set,t.set(e,i)),i.add(r.source_connection_id??null)}return t})(l),[l]),S=(0,r.useMemo)(()=>new Map(o.map(e=>[e.id,e])),[o]);if(e){let r,i,o,a=1===e.degree&&j[e.id],d=j[e.id]||[],c=2===e.degree?e?[..._?.get(eC(e))??(null!=e.source_connection_id?new Set([e.source_connection_id]):new Set)].map(e=>({id:e,bridge:S?.get(e)??null})).sort(eR):[]:[];return(0,t.jsxs)(e5,{collapsed:s,onToggle:p,children:[(0,t.jsxs)("button",{onClick:()=>h&&h(null),style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",color:"#888",fontSize:12,cursor:"pointer",padding:"0 0 10px",fontWeight:600},children:[(0,t.jsx)("span",{style:{fontSize:16},children:"←"})," Back to list"]}),(0,t.jsx)("div",{style:{fontSize:10,color:"#888",marginBottom:8,letterSpacing:1,textTransform:"uppercase"},children:2===e.degree?"Degree 2 Connection":"Degree 1 Connection"}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,marginBottom:8,flexWrap:"wrap"},children:[(0,t.jsx)("div",{style:{background:2===e.degree?"#FF6B35":n[e.tier],color:"#000",display:"inline-block",padding:"2px 10px",borderRadius:12,fontSize:11,fontWeight:700},children:2===e.degree?`DEGREE 2 \xb7 TIER ${e.tier}`:`TIER ${e.tier}`}),e.unlocked_from_name&&(0,t.jsxs)("div",{style:{background:"rgba(52,152,219,0.08)",border:"1px solid rgba(52,152,219,0.28)",borderRadius:8,padding:"9px 11px",marginBottom:10,fontSize:11.5,color:"#8fb8d6",lineHeight:1.5},children:[1===e.degree?"You met them through ":"Reachable through ",(0,t.jsx)("b",{style:{color:"#cfe6f7"},children:e.unlocked_from_name})]}),e.is_catalyst&&(0,t.jsx)("div",{style:{background:"#00ff88",color:"#000",display:"inline-block",padding:"2px 10px",borderRadius:12,fontSize:11,fontWeight:800,letterSpacing:.5},children:"CATALYST"})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"center",marginBottom:16},children:[e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:e.name,style:{width:52,height:52,borderRadius:"50%",objectFit:"cover",border:`2px solid ${n[e.tier]||"#555"}`,flexShrink:0},onError:e=>{e.target.style.display="none",e.target.nextSibling.style.display="flex"}}):null,(0,t.jsx)("div",{style:{width:52,height:52,borderRadius:"50%",flexShrink:0,background:n[e.tier]||"#555",display:e.profile_image_url?"none":"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:700,color:"S"===e.tier?"#000":"#fff"},children:e.name?.charAt(0)}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:700,margin:0},children:e.name}),(0,t.jsx)("p",{style:{color:"#aaa",fontSize:11,margin:"3px 0 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.headline?.substring(0,60)}),e.profile_url&&(0,t.jsx)("a",{href:e.profile_url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:10,color:"#0077B5",textDecoration:"none",fontWeight:600},children:"View on LinkedIn"})]})]}),e.is_catalyst&&(0,t.jsxs)("div",{style:{background:"rgba(0,255,136,0.08)",border:"1px solid rgba(0,255,136,0.3)",borderRadius:8,padding:12,marginBottom:16},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"#00ff88",fontWeight:700,marginBottom:4,letterSpacing:1},children:"CATALYST NODE"}),(0,t.jsxs)("div",{style:{fontSize:12,color:"#ccc"},children:["This person's network power exceeds their own tier. They connect to"," ",(0,t.jsxs)("strong",{style:{color:"#00ff88"},children:[e.catalyst_score," S+A tier"]})," ","people — making them a high-value stepping stone to reach elite connections."]})]}),2===e.degree&&c.length>0&&(0,t.jsx)(e6,{routes:c,selected:e,tierColors:n,onSelect:h},e.id),(0,t.jsxs)("div",{style:{background:"rgba(255,255,255,0.04)",borderRadius:8,padding:12,marginBottom:16},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,t.jsx)("span",{style:{fontSize:11,color:"#888",fontWeight:600,letterSpacing:1,textTransform:"uppercase"},children:"Score"}),(0,t.jsx)("span",{style:{fontSize:28,fontWeight:800,color:n[e.tier]||"#fff"},children:parseFloat(e.power_score).toFixed(1)})]}),e.score_why&&(0,t.jsx)("div",{style:{fontSize:11,color:"#aab7b7",lineHeight:1.5,marginBottom:10},children:e.score_why}),(0,t.jsxs)("div",{style:{marginBottom:6},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"#888",marginBottom:2},children:[(0,t.jsx)("span",{children:"Title"}),(0,t.jsxs)("span",{children:[e.seniority_score||0,"/10"]})]}),(0,t.jsx)("div",{style:{height:4,background:"rgba(255,255,255,0.08)",borderRadius:2},children:(0,t.jsx)("div",{style:{height:"100%",width:`${10*(e.seniority_score||0)}%`,background:n[e.tier]||"#FFD700",borderRadius:2}})})]}),(0,t.jsxs)("div",{style:{marginBottom:6*(e.circle_power>0)},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"#888",marginBottom:2},children:[(0,t.jsx)("span",{children:"Company"}),(0,t.jsxs)("span",{children:[e.company_prestige_score||0,"/10"]})]}),(0,t.jsx)("div",{style:{height:4,background:"rgba(255,255,255,0.08)",borderRadius:2},children:(0,t.jsx)("div",{style:{height:"100%",width:`${10*(e.company_prestige_score||0)}%`,background:"#3498DB",borderRadius:2}})})]}),e.circle_power>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"#888",marginBottom:2},children:[(0,t.jsx)("span",{children:"Circle Power"}),(0,t.jsxs)("span",{style:{color:"#FF6B35"},children:[e.circle_s_count||0,"S · ",e.circle_a_count||0,"A"]})]}),(0,t.jsx)("div",{style:{height:4,background:"rgba(255,255,255,0.08)",borderRadius:2},children:(0,t.jsx)("div",{style:{height:"100%",width:`${Math.min(parseFloat(e.circle_power)/70*100,100)}%`,background:"#FF6B35",borderRadius:2}})})]})]}),(0,t.jsxs)("div",{style:{marginBottom:16},children:[(0,t.jsx)("div",{style:{fontSize:10,fontWeight:700,color:"#FFD700",letterSpacing:1,marginBottom:6,textTransform:"uppercase"},children:"Why This Matters"}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:11,color:"#ccc"},children:(function(e,t,r,i=[]){let n=[],o=(e.headline||"").toLowerCase(),l=(e.role||"").toLowerCase(),a=(e.company||"").toLowerCase(),s=t.sectors.map(e=>e.toLowerCase());l.match(/ceo|chief|founder|president|chairman/i)?n.push({icon:"👑",text:`${e.role} — C-suite executive, highest leverage contact`,color:"#FFD700"}):l.match(/vp|vice president|svp|evp|managing director/i)?n.push({icon:"⚡",text:`${e.role} — VP-level, strong decision-making authority`,color:"#FFD700"}):l.match(/director|head of|senior director/i)?n.push({icon:"🎯",text:`${e.role} — Senior leadership, controls team/budget`,color:"#FF6B35"}):l.match(/manager|lead|principal/i)&&n.push({icon:"📊",text:`${e.role} — Mid-senior, operational influence`,color:"#3498DB"});let d=["snap","google","meta","apple","amazon","microsoft","netflix","tesla","spotify","tiktok","bytedance","coca-cola","nike","disney","palantir","stripe","coinbase","polymarket","pinterest","whatnot","blackrock"].find(e=>a.includes(e)||o.includes(e));d&&n.push({icon:"🏢",text:`At ${d.charAt(0).toUpperCase()+d.slice(1)} — top-tier company network access`,color:"#9B59B6"});let c=o.match(/(?:former|ex|prev)[- ]?(snap|google|meta|apple|amazon|microsoft|blackrock|goldman|mckinsey|stripe|palantir)/i);c&&n.push({icon:"📜",text:`Former ${c[1]} — carries network from previous role`,color:"#95A5A6"});let p=s.filter(e=>o.includes(e)||a.includes(e));p.length>0&&n.push({icon:"🔗",text:`Shared sector: ${p.join(", ")} — direct industry relevance to you`,color:"#2ECC71"});let h=r.filter(t=>t.source_connection_id===e.id).length;if(h>0){let t=r.filter(t=>t.source_connection_id===e.id&&"S"===t.tier).length;n.push({icon:"🌐",text:`Gateway to ${h} degree-2 connections${t>0?` (${t} S-tier)`:""}`,color:"#FF6B35"})}if(e.is_catalyst&&n.push({icon:"⚡",text:"Catalyst — network power exceeds personal tier, high stepping-stone value",color:"#00ff88"}),2===e.degree&&i.length>0){let e=i.filter(e=>e.bridge);if(1===i.length)n.push(e.length?{icon:"🤝",text:`Reachable via ${e[0].bridge.name} (${e[0].bridge.tier}-tier)`,color:"#3498DB"}:{icon:"🤝",text:"Reachable through a connection we can’t name",color:"#888"});else{let t=e.slice(0,2).map(e=>`${String(e.bridge.name||"").trim().split(/\s+/)[0]} (${e.bridge.tier})`),r=i.length-t.length,o=0===t.length?"connections we can’t name":r>0?`${t.join(", ")} and ${r} more`:t.join(" and ");n.push({icon:"🤝",text:`Reachable ${i.length} ways — via ${o}`,color:"#3498DB"})}}return 0===n.length&&n.push({icon:"📌",text:`${e.tier}-tier connection with ${parseFloat(e.power_score).toFixed(1)} power score`,color:"#888"}),n.slice(0,5)})(e,v||{name:"User",sectors:[],goals:[]},l,c).map((e,r)=>(0,t.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"flex-start"},children:[(0,t.jsx)("span",{style:{color:e.color||"#888",fontSize:13,lineHeight:1},children:e.icon}),(0,t.jsx)("span",{children:e.text})]},r))})]}),e.company&&(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("div",{style:{color:"#666",fontSize:10},children:"Company"}),(0,t.jsx)("div",{style:{fontWeight:600,fontSize:12},children:e.company})]}),e.role&&(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsx)("div",{style:{color:"#666",fontSize:10},children:"Role"}),(0,t.jsx)("div",{style:{fontSize:12},children:e.role})]}),a&&d.length>0&&(r=d.filter(e=>"S"===e.tier),i=d.filter(e=>"A"===e.tier),o=[...d].sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0)).slice(0,8),(0,t.jsxs)("div",{style:{marginBottom:16},children:[(0,t.jsxs)("div",{style:{fontSize:10,fontWeight:700,color:"#FF6B35",letterSpacing:1,marginBottom:8,textTransform:"uppercase"},children:["Cluster Overview — ",d.length," connections"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,marginBottom:8,fontSize:10},children:[r.length>0&&(0,t.jsxs)("span",{style:{color:"#FFD700",fontWeight:600},children:[r.length," S-tier"]}),i.length>0&&(0,t.jsxs)("span",{style:{color:"#9B59B6",fontWeight:600},children:[i.length," A-tier"]})]}),(0,t.jsxs)("a",{href:`/queue?bridge=${e.id}&groupBy=bridge`,style:{display:"block",textAlign:"center",padding:"8px 12px",marginBottom:10,background:"linear-gradient(135deg, #FF6B35, #FFD700)",color:"#000",borderRadius:6,textDecoration:"none",fontWeight:700,fontSize:11},children:["Outlink Bridge → Add ",d.filter(e=>"S"===e.tier||"A"===e.tier||"B"===e.tier).length," People"]}),(0,t.jsx)("div",{style:{fontSize:10,color:"#888",marginBottom:8},children:"Most valuable in this cluster:"}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:o.map(e=>(0,t.jsxs)("div",{onClick:()=>h&&h(e),style:{display:"flex",alignItems:"center",gap:6,padding:"4px 6px",borderRadius:4,cursor:"pointer",borderLeft:`2px solid ${n[e.tier]||"#555"}`,background:"rgba(255,255,255,0.03)"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.08)",onMouseLeave:e=>e.currentTarget.style.background="rgba(255,255,255,0.03)",children:[e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:22,height:22,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:`1px solid ${n[e.tier]||"#555"}`},onError:e=>{e.target.style.display="none",e.target.nextSibling.style.display="flex"}}):null,(0,t.jsx)("div",{style:{width:22,height:22,borderRadius:"50%",flexShrink:0,fontSize:9,fontWeight:700,background:n[e.tier]||"#555",color:"S"===e.tier?"#000":"#fff",display:e.profile_image_url?"none":"flex",alignItems:"center",justifyContent:"center"},children:e.name?.charAt(0)}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:10,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,t.jsx)("div",{style:{fontSize:8,color:"#666",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.headline?.substring(0,40)})]}),(0,t.jsx)("span",{style:{fontSize:9,color:n[e.tier],fontWeight:600,flexShrink:0},children:parseFloat(e.power_score).toFixed(1)})]},e.id))})]})),a&&d.length>0&&(0,t.jsxs)("div",{style:{marginTop:16},children:[(0,t.jsxs)("div",{style:{fontSize:12,fontWeight:600,color:"#FF6B35",marginBottom:8},children:["Gateway to ",d.length," degree-2 connections:"]}),d.sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0)).slice(0,10).map(e=>(0,t.jsxs)("div",{style:{padding:"6px 8px",background:"rgba(255,107,53,0.08)",borderRadius:6,borderLeft:"3px solid #FF6B35",marginBottom:4,fontSize:12},children:[(0,t.jsx)("div",{style:{fontWeight:600},children:e.name}),(0,t.jsxs)("div",{style:{color:"#888",fontSize:11},children:[e.role,e.company?` @ ${e.company}`:""]}),(0,t.jsxs)("div",{style:{color:"#FF6B35",fontSize:10},children:["Score: ",parseFloat(e.power_score).toFixed(1)]})]},e.id))]}),!m&&a&&d.length>0&&u&&(0,t.jsxs)("button",{onClick:()=>{u("degrees")},style:{width:"100%",padding:"12px",borderRadius:8,border:"none",cursor:"pointer",background:"linear-gradient(135deg, #FF6B35, #FFD700)",color:"#000",fontWeight:700,fontSize:13,marginTop:12},children:["View Bridge → ",d.length," connections"]}),(2===e.degree||e.source_connection_id)&&1!==e.degree&&"unlocked"!==e.unlock_status&&(0,t.jsxs)("div",{style:{background:"rgba(255,215,0,0.06)",border:"1px solid rgba(255,215,0,0.25)",borderRadius:10,padding:16,marginTop:16,textAlign:"center"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"#FFD700",fontWeight:700,letterSpacing:1,marginBottom:6},children:"pending"===e.unlock_status?"CONNECTION PENDING":"LOCKED PATH"}),(0,t.jsx)("div",{style:{fontSize:13,color:"#ccc",marginBottom:12},children:"pending"===e.unlock_status?`Waiting for ${e.name} to accept. Run the scraper to check.`:`Connect with ${e.name} to unlock their network and extend your 6 degrees.`}),(0,t.jsx)("div",{style:{width:"100%",height:60,background:"rgba(255,255,255,0.03)",borderRadius:8,border:"1px dashed rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,color:"#444",marginBottom:12},children:"pending"===e.unlock_status?"[ Cluster Pending... ]":"[ Hidden Network ]"}),"pending"!==e.unlock_status&&(0,t.jsx)("a",{href:e.profile_url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",padding:"10px 16px",background:"linear-gradient(135deg, #FFD700, #FF6B35)",color:"#000",borderRadius:8,textDecoration:"none",fontWeight:700,fontSize:13},onClick:()=>{fetch("/api/unlock",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e.id})}).catch(()=>{}),fetch("/api/outreach",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"mark-sent",connectionId:e.id,profileUrl:e.profile_url,userId:b})}).catch(()=>{})},children:"Connect to Unlock Path"})]}),(1===e.degree||"accepted"===e.outreach_status)&&(0,t.jsx)(e3,{selected:e,degree2:l}),e.profile_url&&(0,t.jsx)("a",{href:e.profile_url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",textAlign:"center",padding:10,marginTop:16,background:"#0077B5",color:"#fff",borderRadius:8,textDecoration:"none",fontWeight:600,fontSize:13},children:"View LinkedIn Profile"})]})}if(m){let e,r,a,u;return(0,t.jsxs)(e5,{collapsed:s,onToggle:p,children:[(0,t.jsxs)("button",{onClick:p,style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",color:"#888",fontSize:12,cursor:"pointer",padding:"0 0 10px",fontWeight:600},children:[(0,t.jsx)("span",{style:{fontSize:16},children:"←"})," Close"]}),(0,t.jsx)("h3",{style:{fontSize:16,fontWeight:700,marginTop:0,color:"#FF6B35"},children:"Degrees"}),(0,t.jsx)("p",{style:{fontSize:12,color:"#888",marginBottom:12},children:"Your bridge connections and who they unlock."}),(0,t.jsx)(e7,{connections:o,degree2:l}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:12},children:[(0,t.jsx)(e2,{label:"Degree-2 Found",value:l.length}),(0,t.jsx)(e2,{label:"D2 S-Tier",value:i?.d2Tiers?.S||0}),(0,t.jsx)(e2,{label:"D2 A-Tier",value:i?.d2Tiers?.A||0}),(0,t.jsx)(e2,{label:"Bridges Used",value:Object.keys(j).length})]}),(0,t.jsxs)("div",{style:{position:"relative",marginBottom:16},children:[(0,t.jsx)("input",{type:"text",placeholder:"Search bridges or d2...",value:k,onChange:e=>w(e.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:8,fontSize:12,border:"1px solid rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.05)",color:"#fff",outline:"none",boxSizing:"border-box"}}),k.length>=2&&(e=k.toLowerCase(),r=o.filter(t=>l.some(e=>e.source_connection_id===t.id)&&t.name.toLowerCase().includes(e)).slice(0,5),a=l.filter(t=>t.name?.toLowerCase().includes(e)).slice(0,5),0===(u=[...r.map(e=>({...e,_matchType:"bridge"})),...a.map(e=>({...e,_matchType:"d2"}))]).length?null:(0,t.jsx)("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:50,background:"rgba(10,10,26,0.98)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,overflow:"hidden",maxHeight:200,overflowY:"auto",boxShadow:"0 8px 24px rgba(0,0,0,0.5)"},children:u.map(e=>(0,t.jsxs)("div",{onClick:()=>{h(e),w(""),f&&"bridge"===e._matchType&&f(e.id)},style:{padding:"8px 12px",cursor:"pointer",display:"flex",alignItems:"center",gap:8,borderBottom:"1px solid rgba(255,255,255,0.05)"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):(0,t.jsx)("div",{style:{width:24,height:24,borderRadius:"50%",background:n[e.tier]||"#555",fontSize:9,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff"},children:e.name?.charAt(0)}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,t.jsx)("div",{style:{fontSize:8,color:"#666"},children:"bridge"===e._matchType?"Bridge":"Degree-2"})]}),(0,t.jsx)("span",{style:{fontSize:9,fontWeight:700,color:n[e.tier]},children:e.tier})]},e.id))}))]}),"pending"===d&&c.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("h4",{style:{fontSize:13,fontWeight:600,color:"#FF6B35",marginBottom:8},children:["⏳ Pending Requests (",c.length,")"]}),(0,t.jsx)("p",{style:{fontSize:10,color:"#666",marginBottom:10,lineHeight:1.4},children:"Friend requests you've sent. When accepted, their cluster unlocks for bridging."}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:c.map(e=>{let r=2===e.degree?o.find(t=>t.id===e.source_connection_id):null;return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",background:"rgba(255,107,53,0.06)",borderRadius:8,border:"1px solid rgba(255,107,53,0.12)"},children:[e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:32,height:32,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:`2px solid ${n[e.tier]||"#555"}`},onError:e=>{e.target.style.display="none"}}):(0,t.jsx)("div",{style:{width:32,height:32,borderRadius:"50%",flexShrink:0,fontSize:12,fontWeight:700,background:n[e.tier]||"#555",color:"S"===e.tier?"#000":"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.name?.charAt(0)}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,t.jsx)("div",{style:{fontSize:8,color:"#888",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.headline?.substring(0,40)}),r&&(0,t.jsxs)("div",{style:{fontSize:8,color:"#FF6B35",marginTop:1},children:["via ",r.name?.split(" ")[0]]})]}),(0,t.jsxs)("div",{style:{textAlign:"center",flexShrink:0},children:[(0,t.jsx)("div",{style:{fontSize:9,fontWeight:800,color:n[e.tier]||"#888"},children:e.tier}),(0,t.jsx)("div",{style:{fontSize:8,color:"#666"},children:parseFloat(e.power_score||0).toFixed(1)})]}),(0,t.jsx)("button",{onClick:()=>x&&x(e),title:"Remove from pending",style:{background:"none",border:"none",color:"#555",cursor:"pointer",fontSize:12,padding:2,flexShrink:0},children:"✕"})]},e.id)})})]}),"pending"!==d&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h4",{style:{fontSize:13,fontWeight:600,color:"#FF6B35",marginBottom:8},children:"Most Valuable Clusters"}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:Object.entries(j).map(([e,t])=>{let r=o.find(t=>t.id===e);if(!r)return null;let i=t.length;if(0===i)return null;let n=t.filter(e=>"S"===e.tier),l=t.filter(e=>"A"===e.tier),a=t.filter(e=>"B"===e.tier),s=n.length,d=l.length,c=a.length,p=s>0?n.reduce((e,t)=>e+(parseFloat(t.power_score)||0),0)/s:0,h=d>0?l.reduce((e,t)=>e+(parseFloat(t.power_score)||0),0)/d:0,u=a.filter(e=>(parseFloat(e.power_score)||0)>=5).length,f=(s+d)/i,g=p/7*s*15+h/5.5*d*6+3*u+25*f+2*Math.log2(i+1)+10*!!r.is_catalyst,x=t.reduce((e,t)=>e+(parseFloat(t.power_score)||0),0)/i;return{bridge:r,members:i,sCount:s,aCount:d,bCount:c,risingCount:u,sAvgPower:p,avgPower:x,elitePct:f,clusterValue:g,sTier:n,aTier:l,topMembers:[...t].sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0))}}).filter(Boolean).sort((e,t)=>t.clusterValue-e.clusterValue).map((e,r)=>(0,t.jsx)(e4,{cs:e,rank:r+1,tierColors:n,onSelect:h},e.bridge.id))})]})]})}let M=[...o||[]].sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0)),z=k.length>=2?M.filter(e=>e.name.toLowerCase().includes(k.toLowerCase())).slice(0,8):[];return(0,t.jsxs)(e5,{collapsed:s,onToggle:p,children:[(0,t.jsxs)("button",{onClick:p,style:{display:"flex",alignItems:"center",gap:6,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:6,color:"#aaa",fontSize:12,cursor:"pointer",padding:"6px 12px",marginBottom:12,fontWeight:600},children:[(0,t.jsx)("span",{style:{fontSize:16},children:"←"})," Close"]}),(0,t.jsx)("h3",{style:{fontSize:16,fontWeight:700,marginTop:0},children:"Network Circle"}),i&&(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:16},children:[(0,t.jsx)(e2,{label:"Total Connections",value:i.total}),(0,t.jsx)(e2,{label:"S-Tier",value:i.tiers?.S||0}),(0,t.jsx)(e2,{label:"A-Tier",value:i.tiers?.A||0}),(0,t.jsx)(e2,{label:"B-Tier",value:i.tiers?.B||0})]}),(0,t.jsxs)("div",{style:{position:"relative",marginBottom:12},children:[(0,t.jsx)("input",{type:"text",placeholder:"Search connections...",value:k,onChange:e=>w(e.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:8,boxSizing:"border-box",border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.3)",color:"#fff",fontSize:12,outline:"none"}}),z.length>0&&(0,t.jsx)("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,background:"rgba(10,10,26,0.98)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,marginTop:4,overflow:"hidden",boxShadow:"0 8px 24px rgba(0,0,0,0.5)"},children:z.map(e=>(0,t.jsxs)("div",{onClick:()=>{h&&h(e),f&&f(e.id),w("")},style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",cursor:"pointer",borderBottom:"1px solid rgba(255,255,255,0.04)"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.08)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:24,height:24,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:`1.5px solid ${n[e.tier]||"#555"}`},onError:e=>{e.target.style.display="none"}}):(0,t.jsx)("div",{style:{width:24,height:24,borderRadius:"50%",flexShrink:0,fontSize:10,fontWeight:700,background:n[e.tier]||"#555",color:"S"===e.tier?"#000":"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.name?.charAt(0)}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:12,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,t.jsx)("div",{style:{fontSize:9,color:"#666"},children:e.headline?.substring(0,35)})]}),(0,t.jsx)("span",{style:{fontSize:10,color:n[e.tier],fontWeight:700},children:e.tier})]},e.id))})]}),(0,t.jsxs)("h4",{style:{fontSize:13,fontWeight:600,color:"#FFD700",marginBottom:8},children:["Power Rankings (",M.length,")"]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:(y={},M.map((e,r)=>{let i=r>0?M[r-1].tier:null,o=e.tier!==i;o&&(y[e.tier]=0),y[e.tier]=(y[e.tier]||0)+1;let l=y[e.tier],a={};return M.forEach(e=>{a[e.tier]=(a[e.tier]||0)+1}),(0,t.jsxs)("div",{children:[o&&(0,t.jsxs)("div",{style:{padding:"8px 10px",marginTop:8*(r>0),marginBottom:4,background:`${n[e.tier]||"#555"}15`,borderLeft:`3px solid ${n[e.tier]||"#555"}`,borderRadius:4,fontSize:11,fontWeight:700,color:n[e.tier]||"#888",display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:{S:"S-Tier — Elite",A:"A-Tier — High Value",B:"B-Tier — Notable",C:"C-Tier — Standard",D:"D-Tier — Entry"}[e.tier]||e.tier}),(0,t.jsx)("span",{style:{fontWeight:400,opacity:.7},children:a[e.tier]||0})]}),(0,t.jsxs)("div",{onClick:()=>{h&&h(e),f&&f(e.id)},style:{padding:"6px 8px",background:"rgba(255,255,255,0.03)",borderRadius:6,borderLeft:`3px solid ${n[e.tier]||"#555"}`,cursor:"pointer",display:"flex",alignItems:"center",gap:8,transition:"background 0.15s"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.1)",onMouseLeave:e=>e.currentTarget.style.background="rgba(255,255,255,0.03)",children:[(0,t.jsxs)("span",{style:{color:"#555",fontSize:10,fontWeight:600,minWidth:22,textAlign:"right"},children:["#",l]}),e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:28,height:28,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:`1.5px solid ${n[e.tier]||"#555"}`},onError:e=>{e.target.style.display="none",e.target.nextSibling.style.display="flex"}}):null,(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:"50%",flexShrink:0,background:n[e.tier]||"#555",display:e.profile_image_url?"none":"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,color:"S"===e.tier?"#000":"#fff"},children:e.name?.charAt(0)}),(0,t.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,t.jsx)("div",{style:{fontWeight:600,fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,t.jsx)("div",{style:{fontSize:9,color:"#666",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.headline?.substring(0,45)})]}),(0,t.jsxs)("div",{style:{textAlign:"right",flexShrink:0},children:[(0,t.jsx)("div",{style:{fontSize:10,fontWeight:700,color:n[e.tier]||"#555"},children:parseFloat(e.power_score).toFixed(1)}),(0,t.jsx)("div",{style:{fontSize:8,color:"#555"},children:e.tier})]})]})]},e.id)}))})]})}function e5({children:e,collapsed:i,onToggle:n}){let[o,l]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{let e=()=>l(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),i)?(0,t.jsxs)("div",{onClick:n,style:{position:"fixed",right:16,top:140,zIndex:30,cursor:"pointer",display:"flex",alignItems:"center",flexDirection:"row-reverse",gap:0,height:36,borderRadius:18,background:"rgba(255,215,0,0.15)",border:"2px solid rgba(255,215,0,0.5)",color:"#FFD700",fontWeight:700,boxShadow:"0 0 12px rgba(255,215,0,0.3)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",overflow:"hidden",transition:"width 0.25s ease",width:36,padding:"0 10px"},onMouseEnter:e=>{e.currentTarget.style.width="120px"},onMouseLeave:e=>{e.currentTarget.style.width="36px"},children:[(0,t.jsx)("span",{style:{fontSize:18,flexShrink:0,width:16,textAlign:"center"},children:"‹"}),(0,t.jsx)("span",{style:{fontSize:11,fontWeight:600,whiteSpace:"nowrap",marginRight:6,opacity:.9},children:"Details"})]}):(0,t.jsxs)("div",{style:o?{position:"fixed",top:0,right:0,bottom:0,zIndex:100,width:"100vw",pointerEvents:"auto"}:{flexShrink:0,height:"100%"},children:[o&&(0,t.jsx)("div",{onClick:n,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.5)"}}),(0,t.jsx)("div",{style:{width:o?"80vw":320,minWidth:320*!o,maxWidth:o?300:320,height:"100%",borderLeft:"1px solid rgba(255,215,0,0.12)",padding:o?"12px 10px":"16px 16px",overflowY:"auto",overflowX:"hidden",background:o?"rgba(15,12,5,0.98)":"rgba(15,12,5,0.65)",fontSize:13,backdropFilter:"blur(24px) saturate(1.4)",WebkitBackdropFilter:"blur(24px) saturate(1.4)",boxShadow:"inset 0 0 60px rgba(255,215,0,0.03), -4px 0 24px rgba(0,0,0,0.3)",marginLeft:o?"auto":0},children:e})]})}function e2({label:e,value:r}){return(0,t.jsxs)("div",{style:{background:"rgba(255,255,255,0.05)",padding:"10px 12px",borderRadius:8},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"#888",marginBottom:2},children:e}),(0,t.jsx)("div",{style:{fontSize:18,fontWeight:700},children:r})]})}function e8(){return(0,t.jsx)("span",{style:{color:"#555",fontSize:16},children:"→"})}function e6({routes:e,selected:i,tierColors:n,onSelect:o}){let[l,a]=(0,r.useState)(!1),s=e.length,d=l?e:e.slice(0,4),c={display:"flex",alignItems:"center",gap:6,fontSize:13,flexWrap:"wrap"};return(0,t.jsxs)("div",{style:{background:"rgba(255,107,53,0.1)",border:"1px solid rgba(255,107,53,0.3)",borderRadius:8,padding:12,marginBottom:16},children:[(0,t.jsxs)("div",{style:{fontSize:10,color:"#FF6B35",fontWeight:600,marginBottom:8},children:["PATH TO THIS PERSON",s>1?` \xb7 ${s} WAYS IN`:""]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:d.map((e,r)=>{if(!e.bridge)return(0,t.jsxs)("div",{title:"This route came from a scanned list whose connection record doesn’t match anyone in your 1st-degree list, so who introduces you can’t be named. The person is real, and still reachable.",style:{...c,color:"#888",fontStyle:"italic"},children:[(0,t.jsx)("span",{style:{fontWeight:700,fontStyle:"normal",color:"#fff"},children:"You"}),(0,t.jsx)(e8,{}),(0,t.jsx)("span",{children:"a connection we can’t name"}),(0,t.jsx)(e8,{}),(0,t.jsx)("span",{children:"them"})]},`unnamed-${e.id}`);let l=e.bridge,a=n[l.tier]||"#ccc",d=[[l.role,l.company].filter(Boolean).join(" @ "),l.tier?`${l.tier}-tier`:""].filter(Boolean).join(" · ");return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:c,children:[(0,t.jsx)("span",{style:{fontWeight:700},children:"You"}),(0,t.jsx)(e8,{}),(0,t.jsxs)("button",{onClick:()=>o&&o(l),title:`Open ${l.name}`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:0,border:"none",background:"none",cursor:"pointer",color:a,fontWeight:600,fontSize:13,textAlign:"left"},children:[(0,t.jsx)(eD,{person:l,size:18,tierColors:n}),l.name]}),(0,t.jsx)(e8,{}),(0,t.jsx)("span",{style:{color:"#FF6B35",fontWeight:600},children:i.name}),0===r&&s>1&&(0,t.jsx)("span",{style:{fontSize:9,fontWeight:700,color:"#FF6B35",padding:"1px 6px",borderRadius:8,background:"rgba(255,107,53,0.15)",whiteSpace:"nowrap"},children:"top-scored bridge"})]}),d&&(0,t.jsx)("div",{style:{fontSize:11,color:"#888",marginTop:3},children:d})]},e.id)})}),s>4&&(0,t.jsx)("button",{onClick:()=>a(e=>!e),style:{marginTop:10,padding:"4px 10px",borderRadius:6,cursor:"pointer",fontSize:11,fontWeight:600,border:"1px solid rgba(255,107,53,0.35)",background:"transparent",color:"#FF6B35"},children:l?"Show fewer":`Show all ${s}`})]})}function e3({selected:e,degree2:n}){let{userId:o}=(0,e0.useUser)(),[l,a]=(0,r.useState)("idle"),[s,d]=(0,r.useState)([]),c=n?.some(t=>t.source_connection_id===e.id),p=n?.filter(t=>t.source_connection_id===e.id).length||0;if(c&&"idle"===l)return(0,t.jsxs)("div",{style:{background:"rgba(0,255,136,0.06)",border:"1px solid rgba(0,255,136,0.2)",borderRadius:10,padding:16,marginTop:16,textAlign:"center"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"#00ff88",fontWeight:700,letterSpacing:1,marginBottom:4},children:"CLUSTER ACTIVE"}),(0,t.jsxs)("div",{style:{fontSize:13,color:"#aaa"},children:[p," connections mapped in 6 Degrees"]}),(0,t.jsx)("button",{onClick:h,style:{marginTop:10,padding:"8px 16px",borderRadius:6,border:"none",cursor:"pointer",background:"rgba(0,255,136,0.12)",color:"#00ff88",fontWeight:600,fontSize:11},children:"Rescan Cluster"})]});async function h(){a("checking"),d(["Checking the scraper..."]);let t=(0,i.notReadyMessage)(await (0,i.scraperStatus)().catch(()=>null));if(t){a("offline"),d([t]);return}a("scraping"),d(["Mapping the circle behind "+e.name+"..."]);try{let t=await (0,i.runScrape)("bridge",{name:e.name,onLog:d});0===t.exitCode?(a("done"),d(e=>[...e,"Done. Refresh to see the cluster."])):a("error")}catch{a("error"),d(["Failed to start scrape"])}}return(0,t.jsxs)("div",{style:{background:"rgba(155,89,182,0.08)",border:"1px solid rgba(155,89,182,0.3)",borderRadius:10,padding:16,marginTop:16},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"#9B59B6",fontWeight:700,letterSpacing:1,marginBottom:6,textAlign:"center"},children:"CREATE CLUSTER"}),(0,t.jsxs)("div",{style:{fontSize:12,color:"#ccc",marginBottom:12,textAlign:"center"},children:["Scrape ",e.name,"'s connections to map their network"]}),"idle"===l&&(0,t.jsxs)("button",{onClick:h,style:{width:"100%",padding:"12px",borderRadius:8,border:"none",cursor:"pointer",background:"linear-gradient(135deg, #9B59B6, #3498DB)",color:"#fff",fontWeight:700,fontSize:14},children:["Scan ",e.name,"'s Network"]}),"offline"===l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{padding:"10px",borderRadius:8,background:"rgba(255,80,80,0.1)",border:"1px solid rgba(255,80,80,0.3)",color:"#ff5050",fontSize:12,marginBottom:8,textAlign:"center"},children:"Scraper server offline"}),(0,t.jsxs)("div",{style:{fontSize:10,color:"#888",textAlign:"center",marginBottom:8},children:["Open the ",(0,t.jsx)("strong",{children:"Scan"})," page to finish setting the scraper up"]}),(0,t.jsx)("button",{onClick:()=>{a("idle")},style:{width:"100%",padding:"10px",borderRadius:8,border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",color:"#aaa",fontWeight:600,fontSize:12},children:"Retry"})]}),("checking"===l||"scraping"===l)&&(0,t.jsx)("div",{children:(0,t.jsxs)("div",{style:{padding:"10px",borderRadius:8,background:"rgba(155,89,182,0.1)",border:"1px solid rgba(155,89,182,0.3)",marginBottom:8},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[(0,t.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:"#9B59B6",animation:"pulse 1s infinite"}}),(0,t.jsx)("span",{style:{fontSize:11,fontWeight:600,color:"#9B59B6"},children:"Scanning..."})]}),(0,t.jsx)("div",{style:{fontFamily:"monospace",fontSize:10,color:"#888",maxHeight:100,overflow:"auto"},children:s.map((e,r)=>(0,t.jsx)("div",{children:e},r))})]})}),"done"===l&&(0,t.jsx)("div",{style:{padding:"10px",borderRadius:8,background:"rgba(0,255,136,0.1)",border:"1px solid rgba(0,255,136,0.3)",color:"#00ff88",fontSize:12,fontWeight:600,textAlign:"center"},children:"Cluster created! Refresh the page to see it."}),"error"===l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{padding:"10px",borderRadius:8,background:"rgba(255,80,80,0.1)",border:"1px solid rgba(255,80,80,0.3)",color:"#ff5050",fontSize:12,textAlign:"center",marginBottom:8},children:"Scrape failed — connections may be private"}),(0,t.jsx)("button",{onClick:()=>{a("idle"),d([])},style:{width:"100%",padding:"10px",borderRadius:8,border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",color:"#aaa",fontWeight:600,fontSize:12},children:"Try Again"})]})]})}function e4({cs:e,rank:i,tierColors:n,onSelect:o}){let[l,a]=(0,r.useState)(!1);return(0,t.jsxs)("div",{style:{background:"rgba(255,255,255,0.05)",borderRadius:6,borderLeft:`3px solid ${n[e.bridge.tier]||"#FF6B35"}`,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{padding:"10px 10px"},children:[(0,t.jsxs)("div",{onClick:()=>o&&o(e.bridge),style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.bridge.profile_image_url?(0,t.jsx)("img",{src:e.bridge.profile_image_url,alt:"",style:{width:28,height:28,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:`1.5px solid ${n[e.bridge.tier]||"#555"}`},onError:e=>{e.target.style.display="none"}}):(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:"50%",flexShrink:0,fontSize:11,fontWeight:700,background:n[e.bridge.tier]||"#555",color:"S"===e.bridge.tier?"#000":"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.bridge.name?.charAt(0)}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{fontWeight:600,fontSize:12},children:[(0,t.jsxs)("span",{style:{color:"#555",marginRight:4},children:["#",i]}),e.bridge.name]}),(0,t.jsx)("div",{style:{fontSize:9,color:"#666"},children:e.bridge.headline?.substring(0,40)})]})]}),(0,t.jsx)("span",{style:{fontSize:10,fontWeight:700,padding:"2px 6px",borderRadius:4,background:n[e.bridge.tier],color:"S"===e.bridge.tier?"#000":"#fff"},children:e.bridge.tier})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,marginTop:6,fontSize:10},children:[e.sCount>0&&(0,t.jsxs)("span",{style:{color:"#FFD700",fontWeight:600},children:[e.sCount,"S",e.sAvgPower>0?` (${e.sAvgPower.toFixed(1)})`:""]}),e.aCount>0&&(0,t.jsxs)("span",{style:{color:"#9B59B6",fontWeight:600},children:[e.aCount,"A"]}),e.bCount>0&&(0,t.jsxs)("span",{style:{color:"#3498DB"},children:[e.bCount,"B"]}),e.risingCount>0&&(0,t.jsxs)("span",{style:{color:"#2ECC71"},children:[e.risingCount," rising"]}),(0,t.jsxs)("span",{style:{color:"#555"},children:[e.members," total"]})]}),(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:4,fontSize:10},children:[(0,t.jsxs)("span",{style:{color:"#666"},children:["Elite: ",(100*e.elitePct).toFixed(0),"% · Avg: ",e.avgPower.toFixed(1)]}),(0,t.jsx)("span",{style:{color:"#FF6B35",fontWeight:700},children:e.clusterValue.toFixed(1)})]}),(e.sTier.length>0||e.aTier.length>0)&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:8},children:[[...e.sTier,...e.aTier].slice(0,4).map(e=>e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:e.name,style:{width:22,height:22,borderRadius:"50%",objectFit:"cover",border:`1.5px solid ${n[e.tier]||"#555"}`},onError:e=>{e.target.style.display="none"},title:e.name},e.id):(0,t.jsx)("div",{style:{width:22,height:22,borderRadius:"50%",fontSize:9,fontWeight:700,background:n[e.tier]||"#555",color:"S"===e.tier?"#000":"#fff",display:"flex",alignItems:"center",justifyContent:"center"},title:e.name,children:e.name?.charAt(0)},e.id)),e.sCount+e.aCount>4&&(0,t.jsxs)("span",{style:{fontSize:9,color:"#666"},children:["+",e.sCount+e.aCount-4," more"]})]}),(0,t.jsxs)("button",{onClick:()=>a(!l),style:{marginTop:6,background:"none",border:"none",color:"#888",fontSize:10,cursor:"pointer",padding:0,display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)("span",{style:{fontSize:12},children:l?"▾":"▸"}),l?"Hide members":`View all ${e.members} members`]})]}),l&&(0,t.jsx)("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)",padding:"6px 10px 10px",maxHeight:250,overflowY:"auto"},children:e.topMembers.map(e=>(0,t.jsxs)("div",{onClick:()=>o&&o(e),style:{display:"flex",alignItems:"center",gap:6,padding:"4px 2px",cursor:"pointer",borderRadius:4},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[e.profile_image_url?(0,t.jsx)("img",{src:e.profile_image_url,alt:"",style:{width:20,height:20,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:`1px solid ${n[e.tier]||"#555"}`},onError:e=>{e.target.style.display="none",e.target.nextSibling.style.display="flex"}}):null,(0,t.jsx)("div",{style:{width:20,height:20,borderRadius:"50%",flexShrink:0,fontSize:8,fontWeight:700,background:n[e.tier]||"#555",color:"S"===e.tier?"#000":"#fff",display:e.profile_image_url?"none":"flex",alignItems:"center",justifyContent:"center"},children:e.name?.charAt(0)}),(0,t.jsx)("div",{style:{minWidth:0,flex:1},children:(0,t.jsx)("div",{style:{fontSize:10,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name})}),(0,t.jsxs)("span",{style:{fontSize:9,color:n[e.tier]||"#555",fontWeight:600,flexShrink:0},children:[e.tier," ",parseFloat(e.power_score).toFixed(1)]})]},e.id))})]})}function e7({connections:e,degree2:n}){let[o,l]=(0,r.useState)("idle"),[a,s]=(0,r.useState)([]),[d,c]=(0,r.useState)(null),p=new Set(n.map(e=>e.source_connection_id).filter(Boolean)),h=(e||[]).filter(e=>("S"===e.tier||"A"===e.tier)&&!p.has(e.id)).sort((e,t)=>(parseFloat(t.power_score)||0)-(parseFloat(e.power_score)||0));if(0===h.length&&"idle"===o)return(0,t.jsx)("div",{style:{padding:"10px",borderRadius:8,marginBottom:16,background:"rgba(0,255,136,0.06)",border:"1px solid rgba(0,255,136,0.2)",color:"#00ff88",fontSize:11,fontWeight:600,textAlign:"center"},children:"All S/A-tier bridges mapped"});async function u(){let e=h[0];if(!e)return;c(e),l("checking"),s([`Scanning ${e.name}'s network...`]);let t=(0,i.notReadyMessage)(await (0,i.scraperStatus)().catch(()=>null));if(t){l("offline"),s([t]);return}l("scraping");try{let t=await (0,i.runScrape)("bridge",{name:e.name,onLog:s});l(0===t.exitCode?"done":"error")}catch{l("error")}}return(0,t.jsxs)("div",{style:{background:"rgba(155,89,182,0.08)",border:"1px solid rgba(155,89,182,0.2)",borderRadius:10,padding:14,marginBottom:16},children:["idle"===o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{fontSize:11,color:"#9B59B6",fontWeight:700,marginBottom:6},children:[h.length," bridges unmapped"]}),(0,t.jsxs)("div",{style:{fontSize:11,color:"#aaa",marginBottom:8},children:["Next: ",(0,t.jsx)("strong",{children:h[0]?.name})," (",h[0]?.tier,"-tier, ",parseFloat(h[0]?.power_score).toFixed(1),")"]}),(0,t.jsx)("button",{onClick:u,style:{width:"100%",padding:"10px",borderRadius:8,border:"none",cursor:"pointer",background:"linear-gradient(135deg, #9B59B6, #FF6B35)",color:"#fff",fontWeight:700,fontSize:13},children:"Auto-Bridge Next"})]}),"offline"===o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{padding:"8px",borderRadius:6,background:"rgba(255,80,80,0.1)",color:"#ff5050",fontSize:11,marginBottom:6,textAlign:"center"},children:"Scraper offline"}),(0,t.jsx)("button",{onClick:()=>l("idle"),style:{width:"100%",padding:"8px",borderRadius:6,border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",color:"#aaa",fontSize:11},children:"Retry"})]}),("checking"===o||"scraping"===o)&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[(0,t.jsx)("div",{style:{width:6,height:6,borderRadius:"50%",background:"#9B59B6",animation:"pulse 1s infinite"}}),(0,t.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"#9B59B6"},children:["Scanning ",d?.name,"..."]})]}),(0,t.jsx)("div",{style:{fontFamily:"monospace",fontSize:9,color:"#777",maxHeight:80,overflow:"auto"},children:a.map((e,r)=>(0,t.jsx)("div",{children:e},r))})]}),"done"===o&&(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsxs)("div",{style:{padding:"8px",borderRadius:6,background:"rgba(0,255,136,0.1)",color:"#00ff88",fontSize:11,fontWeight:600,marginBottom:6},children:[d?.name,"’s bridge mapped! Refresh to see."]}),(0,t.jsx)("button",{onClick:()=>{l("idle"),c(null),s([])},style:{width:"100%",padding:"8px",borderRadius:6,border:"none",cursor:"pointer",background:"linear-gradient(135deg, #9B59B6, #FF6B35)",color:"#fff",fontWeight:600,fontSize:11},children:"Bridge Next"})]}),"error"===o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{padding:"8px",borderRadius:6,background:"rgba(255,80,80,0.1)",color:"#ff5050",fontSize:11,marginBottom:6,textAlign:"center"},children:"Failed — connections may be private"}),(0,t.jsx)("button",{onClick:()=>{l("idle"),c(null),s([])},style:{width:"100%",padding:"8px",borderRadius:6,border:"none",cursor:"pointer",background:"rgba(255,255,255,0.1)",color:"#aaa",fontSize:11},children:"Try Next"})]})]})}let e9={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"};function te({collapsed:e,onToggle:i,mode:n,filter:o,onFilterChange:l,visualMode:a,onVisualModeChange:s,tierCounts:d,bridgeTierCounts:c}){let p=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>t(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),h="degrees"===n,u=eQ(h?"degrees":"network"),f=h?c||{}:d||{},g=h?Object.values(c||{}).reduce((e,t)=>e+t,0):Object.values(d||{}).reduce((e,t)=>e+t,0);return e?(0,t.jsxs)("div",{onClick:i,style:{position:"fixed",left:16,top:140,zIndex:30,cursor:"pointer",display:"flex",alignItems:"center",gap:0,height:36,borderRadius:18,background:"rgba(52,152,219,0.15)",border:"2px solid rgba(52,152,219,0.5)",color:"#3498DB",fontWeight:700,boxShadow:"0 0 12px rgba(52,152,219,0.3)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",overflow:"hidden",transition:"width 0.25s ease",width:36,padding:"0 10px"},onMouseEnter:e=>{e.currentTarget.style.width="120px"},onMouseLeave:e=>{e.currentTarget.style.width="36px"},children:[(0,t.jsx)("span",{style:{fontSize:18,flexShrink:0,width:16,textAlign:"center"},children:"›"}),(0,t.jsx)("span",{style:{fontSize:11,fontWeight:600,whiteSpace:"nowrap",marginLeft:6,opacity:.9},children:"Filters"})]}):(0,t.jsxs)("div",{style:p?{position:"fixed",top:0,left:0,bottom:0,zIndex:100,width:"100vw",pointerEvents:"auto"}:{flexShrink:0,height:"100%"},children:[p&&(0,t.jsx)("div",{onClick:i,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.5)"}}),(0,t.jsxs)("div",{style:{width:p?"80vw":320,minWidth:320*!p,maxWidth:p?300:320,height:"100%",borderRight:"1px solid rgba(52,152,219,0.15)",padding:p?"12px 10px":"16px 14px",overflowY:"auto",overflowX:"hidden",background:p?"rgba(10,15,30,0.98)":"rgba(10,15,30,0.65)",fontSize:13,backdropFilter:"blur(24px) saturate(1.4)",WebkitBackdropFilter:"blur(24px) saturate(1.4)",boxShadow:"inset 0 0 60px rgba(52,152,219,0.04), 4px 0 24px rgba(0,0,0,0.3)"},children:[(0,t.jsxs)("button",{onClick:i,style:{display:"flex",alignItems:"center",gap:6,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:6,color:"#aaa",fontSize:12,cursor:"pointer",padding:"6px 12px",marginBottom:14,fontWeight:600,width:"100%"},children:[(0,t.jsx)("span",{style:{fontSize:16},children:"›"})," Close"]}),(0,t.jsxs)("div",{style:{marginBottom:18},children:[(0,t.jsx)("div",{style:{fontSize:9,fontWeight:700,color:"#555",letterSpacing:1,marginBottom:8,textTransform:"uppercase"},children:"Visual"}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:u.map(e=>(0,t.jsxs)("button",{onClick:()=>s&&s(e.key),style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",borderRadius:6,border:"none",cursor:"pointer",width:"100%",textAlign:"left",background:a===e.key?"rgba(52,152,219,0.15)":"rgba(255,255,255,0.03)",color:a===e.key?"#3498DB":"#888",transition:"all 0.15s"},children:[(0,t.jsx)("span",{style:{fontSize:14,width:20,textAlign:"center"},children:e.icon}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600},children:e.label}),(0,t.jsx)("div",{style:{fontSize:8,color:"#555",marginTop:1},children:e.desc})]})]},e.key))})]}),(0,t.jsxs)("div",{style:{marginBottom:18},children:[(0,t.jsx)("div",{style:{fontSize:9,fontWeight:700,color:"#555",letterSpacing:1,marginBottom:8,textTransform:"uppercase"},children:h?"Filter by bridge tier":"Filter"}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:[(0,t.jsxs)("button",{onClick:()=>l&&l("all"),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"7px 10px",borderRadius:6,border:"none",cursor:"pointer",width:"100%",background:"all"===o?"rgba(255,255,255,0.12)":"rgba(255,255,255,0.03)",color:"all"===o?"#fff":"#888"},children:[(0,t.jsx)("span",{style:{fontSize:11,fontWeight:600},children:"All"}),(0,t.jsx)("span",{style:{fontSize:10,color:"#555"},children:g})]}),["S","A","B","C","D"].map(e=>(0,t.jsxs)("button",{onClick:()=>l&&l(e),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"7px 10px",borderRadius:6,border:"none",cursor:"pointer",width:"100%",background:o===e?`${e9[e]}20`:"rgba(255,255,255,0.03)",color:o===e?e9[e]:"#888",borderLeft:o===e?`3px solid ${e9[e]}`:"3px solid transparent"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:e9[e],opacity:o===e?1:.4}}),(0,t.jsxs)("span",{style:{fontSize:11,fontWeight:600},children:[e,"-Tier"]})]}),(0,t.jsx)("span",{style:{fontSize:10,color:"#555"},children:f[e]||0})]},e))]})]}),(0,t.jsxs)("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)",paddingTop:12},children:[(0,t.jsx)("div",{style:{fontSize:9,fontWeight:700,color:"#555",letterSpacing:1,marginBottom:8,textTransform:"uppercase"},children:"Stats"}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[Object.entries(f).filter(([e])=>["S","A","B"].includes(e)).map(([e,r])=>(0,t.jsxs)("div",{style:{padding:"6px 8px",borderRadius:6,background:`${e9[e]}10`,textAlign:"center"},children:[(0,t.jsx)("div",{style:{fontSize:16,fontWeight:800,color:e9[e]},children:r}),(0,t.jsxs)("div",{style:{fontSize:8,color:"#555"},children:[e,"-Tier"]})]},e)),(0,t.jsxs)("div",{style:{padding:"6px 8px",borderRadius:6,background:"rgba(255,255,255,0.04)",textAlign:"center"},children:[(0,t.jsx)("div",{style:{fontSize:16,fontWeight:800,color:"#fff"},children:g}),(0,t.jsx)("div",{style:{fontSize:8,color:"#555"},children:"Total"})]})]})]})]})]})}var tt=e.i(2776),tr=e.i(64745);function ti(){let[e,i]=(0,r.useState)(!1),[n,o]=(0,r.useState)("");async function l(){i(!0),o("");try{await (0,tr.loadSampleIntoSession)(),window.location.reload()}catch(e){o(e.message||"Could not load the sample network."),i(!1)}}return(0,t.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",padding:24,overflowY:"auto"},children:(0,t.jsxs)("div",{style:{maxWidth:520,width:"100%",textAlign:"center"},children:[(0,t.jsx)("div",{style:{width:68,height:68,borderRadius:"50%",margin:"0 auto 22px",border:"2px solid rgba(255,215,0,0.35)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26},children:"✦"}),(0,t.jsx)("h2",{style:{fontSize:28,fontWeight:800,margin:"0 0 10px",background:"linear-gradient(135deg, #FFD700, #9B59B6, #3498DB)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"Welcome to 6 Degrees"}),(0,t.jsx)("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:14.5,lineHeight:1.7,margin:"0 0 28px"},children:"Your network, drawn as a galaxy. Everything stays on this computer. Pick how to bring it in — you can switch later."}),(0,t.jsx)(tn,{href:"/setup",primary:!0,badge:"Recommended",title:"Scan my LinkedIn",body:"A few guided steps: set up the scanner, sign into LinkedIn yourself, and watch your galaxy fill in. The only way to see who your connections know."}),(0,t.jsx)(tn,{href:"/import",title:"Import my LinkedIn CSV",body:"LinkedIn’s official export, read in your browser. Takes about ten minutes to arrive by email. Shows the people you know, not who they know."}),(0,t.jsx)(tn,{onClick:l,disabled:e,title:e?"Loading…":"Explore a sample network",body:"150 invented connections and the 598 people they know. Every view except Outlink and Scan, which need your own scan. Nothing about you is used."}),n&&(0,t.jsx)("div",{style:{color:"#ff6b6b",fontSize:13,marginTop:18},children:n})]})})}function tn({href:e,onClick:r,disabled:i,primary:n,badge:o,title:l,body:a}){let s={display:"block",width:"100%",boxSizing:"border-box",textAlign:"left",padding:"16px 18px",borderRadius:12,marginBottom:12,textDecoration:"none",cursor:i?"default":"pointer",font:"inherit",border:n?"1px solid rgba(255,215,0,0.45)":"1px solid rgba(255,255,255,0.12)",background:n?"linear-gradient(135deg, rgba(255,215,0,0.12), rgba(155,89,182,0.14))":"rgba(255,255,255,0.03)",color:"#fff"},d=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:5},children:[(0,t.jsx)("span",{style:{fontSize:15.5,fontWeight:750},children:l}),o&&(0,t.jsx)("span",{style:{fontSize:10.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",padding:"3px 8px",borderRadius:20,background:"#FFD700",color:"#0a0a1a"},children:o}),(0,t.jsx)("span",{style:{marginLeft:"auto",color:"rgba(255,255,255,0.4)"},children:"→"})]}),(0,t.jsx)("div",{style:{fontSize:13,color:"rgba(255,255,255,0.5)",lineHeight:1.6},children:a})]});return e?(0,t.jsx)("a",{href:e,style:s,children:d}):(0,t.jsx)("button",{onClick:r,disabled:i,style:s,children:d})}var to=e.i(7837),tl=e.i(22016);let ta=[],ts={S:"#FFD700",A:"#9B59B6",B:"#3498DB",C:"#95A5A6",D:"#BDC3C7"};function td(){let e,o,l,a,{userId:s,userName:d}=(0,e0.useUser)(),c=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>t(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[p,h]=(0,r.useState)([]),[u,f]=(0,r.useState)([]),[g,x]=(0,r.useState)(null),y=(0,r.useRef)(null),[m,b]=(0,r.useState)("all"),[v,k]=(0,r.useState)("network"),[w,j]=(0,r.useState)(!0),[_,S]=(0,r.useState)(null),[M,z]=(0,r.useState)(!0),[C,F]=(0,r.useState)(!0),[B,R]=(0,r.useState)("galaxy"),[T,$]=(0,r.useState)([]),[I,W]=(0,r.useState)(!1),[A,E]=(0,r.useState)([]),[D,O]=(0,r.useState)(!1),[L,P]=(0,r.useState)("csv");(0,r.useEffect)(()=>{s&&(e(),tr.IS_DEMO||(0,to.hasCsvNetwork)()||(fetch(`/api/notifications?userId=${s}`).then(e=>e.json()).then(e=>$(e.notifications||[])).catch(()=>{}),fetch(`/api/outreach?userId=${s}`).then(e=>e.json()).then(e=>E(e.pending||[])).catch(()=>{})));async function e(){let e=(0,to.hasCsvNetwork)()?(0,to.loadCsvNetwork)():null;e&&(O(!0),P(e.source||"csv"));let{degree1:t,degree2:r}=tr.IS_DEMO?await (0,tr.loadDemoNetwork)():e||await (async()=>await (0,n.loadNetwork)(s))();h(t),f(r);let i={};t.forEach(e=>{i[e.tier]=(i[e.tier]||0)+1});let o={};r.forEach(e=>{o[e.tier]=(o[e.tier]||0)+1}),S({total:t.length,tiers:i,d2Total:r.length,d2Tiers:o}),j(!1)}},[s]);let N="degrees"===v,Y=(0,r.useMemo)(()=>"all"===m?p:p.filter(e=>e.tier===m),[p,m]),U=(0,r.useMemo)(()=>new Map(p.map(e=>[e.id,e])),[p]),H=(0,r.useMemo)(()=>new Set(u.map(e=>e.source_connection_id).filter(Boolean)),[u]),G=(0,r.useMemo)(()=>{let e={};return p.forEach(t=>{H.has(t.id)&&(e[t.tier]=(e[t.tier]||0)+1)}),e},[p,H]),q=(0,r.useMemo)(()=>N?"all"===m?u:u.filter(e=>U.get(e.source_connection_id)?.tier===m):ta,[N,m,U,u]),X=(0,r.useCallback)(e=>{x(e),e&&z(!1)},[]);if(w)return(0,t.jsxs)("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#0a0a1a",color:"#fff"},children:[(0,t.jsx)("div",{style:{fontSize:24,fontWeight:700},children:"Loading 6 Degrees of Separation..."}),(0,t.jsx)("div",{style:{fontSize:14,color:"#888",marginTop:8},children:"Mapping your LinkedIn network"})]});let V=(e=eJ[B])&&e.modes.includes(v)?{key:B,...e}:eQ(v)[0]??{key:"list",...eJ.list};return(0,t.jsxs)("div",{"data-map":!0,style:{height:"100vh",overflow:"hidden",background:"#0a0a1a",color:"#fff",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[(0,t.jsxs)("header",{style:{padding:c?"10px 12px":"20px 30px",borderBottom:"1px solid rgba(255,255,255,0.1)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:c?4:8,flexWrap:c?"wrap":"nowrap",gap:6*!!c},children:[(0,t.jsx)("h1",{style:{fontSize:c?16:28,fontWeight:700,margin:0,background:"linear-gradient(135deg, #FFD700, #9B59B6, #3498DB)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"6 Degrees"}),(0,t.jsxs)("div",{style:{display:"flex",gap:c?2:4,background:"rgba(255,255,255,0.08)",borderRadius:8,padding:c?2:3,flexWrap:c?"wrap":"nowrap"},children:[(0,t.jsx)("button",{onClick:()=>{k("network"),x(null),b("all"),R("galaxy")},style:{padding:c?"6px 10px":"8px 16px",borderRadius:6,border:"none",fontSize:c?11:13,fontWeight:600,cursor:"pointer",background:"network"===v?"#fff":"transparent",color:"network"===v?"#000":"#888"},children:c?"Circle":"Network Circle"}),(0,t.jsx)("button",{onClick:()=>{k("degrees"),x(null),b("all"),R("separation")},style:{padding:c?"6px 10px":"8px 16px",borderRadius:6,border:"none",fontSize:c?11:13,fontWeight:600,cursor:"pointer",background:"degrees"===v?"linear-gradient(135deg, #FFD700, #FF6B35)":"rgba(255,255,255,0.12)",color:"degrees"===v?"#000":"#fff"},children:"Degrees"}),D&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginLeft:c?4:10,padding:c?"4px 8px":"5px 10px",borderRadius:999,background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)"},children:[(0,t.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"sample"===L?"#9B59B6":"#2ecc71"}}),(0,t.jsx)("span",{style:{fontSize:c?10:12,color:"rgba(255,255,255,0.65)",whiteSpace:"nowrap"},children:"sample"===L?"Sample network":"Your CSV"}),(0,t.jsx)("button",{onClick:()=>{(0,to.clearCsvNetwork)(),window.location.href="/"},title:"sample"===L?"Leave the sample network":"Clear this import",style:{border:"none",background:"transparent",cursor:"pointer",color:"#888",fontSize:c?13:15,lineHeight:1,padding:"0 0 0 2px"},children:"×"})]}),!tr.IS_DEMO&&(0,t.jsx)(tl.default,{href:"/paths",style:{padding:c?"6px 10px":"8px 16px",borderRadius:6,border:"none",fontSize:c?11:13,fontWeight:600,background:"rgba(255,255,255,0.06)",color:"#00ff88",textDecoration:"none",display:"flex",alignItems:"center",gap:4},children:"Paths"}),!tr.IS_DEMO&&!D&&(0,t.jsx)(tl.default,{href:"/queue",style:{padding:c?"6px 10px":"8px 16px",borderRadius:6,border:"none",fontSize:c?11:13,fontWeight:600,background:"rgba(255,255,255,0.06)",color:"#FF6B35",textDecoration:"none",display:"flex",alignItems:"center",gap:4},children:"Outlink"}),!tr.IS_DEMO&&!D&&(0,t.jsx)(tl.default,{href:"/setup",style:{padding:c?"8px 12px":"8px 16px",borderRadius:6,border:"none",fontSize:13,fontWeight:600,background:"rgba(255,255,255,0.06)",color:"#666",textDecoration:"none",display:"flex",alignItems:"center",gap:4},children:"Scan"})]}),!tr.IS_DEMO&&!D&&(0,t.jsxs)("div",{style:{position:"relative",marginLeft:c?4:8},children:[(0,t.jsxs)("button",{onClick:()=>W(!I),style:{width:c?28:32,height:c?28:32,borderRadius:"50%",border:"none",cursor:"pointer",background:"rgba(255,255,255,0.06)",color:"#888",fontSize:c?12:14,display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:["🔔",T.filter(e=>!e.seen).length>0&&(0,t.jsx)("span",{style:{position:"absolute",top:-2,right:-2,width:16,height:16,borderRadius:"50%",background:"#ff5050",color:"#fff",fontSize:9,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center"},children:T.filter(e=>!e.seen).length})]}),I&&(0,t.jsxs)("div",{style:{position:"absolute",top:40,right:0,width:320,maxHeight:400,background:"rgba(10,10,26,0.98)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:12,overflow:"hidden",zIndex:100,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",boxShadow:"0 8px 32px rgba(0,0,0,0.5)"},children:[(0,t.jsxs)("div",{style:{padding:"12px 16px",borderBottom:"1px solid rgba(255,255,255,0.08)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)("span",{style:{fontWeight:700,fontSize:14},children:"Notifications"}),T.filter(e=>!e.seen).length>0&&(0,t.jsx)("button",{onClick:()=>{fetch("/api/notifications",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"mark-all-seen"})}),$(e=>e.map(e=>({...e,seen:!0})))},style:{background:"none",border:"none",color:"#3498DB",fontSize:11,cursor:"pointer",fontWeight:600},children:"Mark all read"})]}),(0,t.jsx)("div",{style:{overflowY:"auto",maxHeight:340},children:0===T.length?(0,t.jsx)("div",{style:{padding:20,textAlign:"center",color:"#555",fontSize:12},children:"No notifications yet"}):T.slice(0,20).map(e=>(0,t.jsx)("div",{style:{padding:"10px 16px",borderBottom:"1px solid rgba(255,255,255,0.04)",background:e.seen?"transparent":"rgba(255,215,0,0.04)"},children:(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,t.jsx)("span",{style:{fontSize:16},children:e.icon||"📌"}),(0,t.jsxs)("div",{style:{flex:1},children:[(0,t.jsx)("div",{style:{fontSize:12,fontWeight:600,color:e.seen?"#888":"#fff"},children:e.title}),e.message&&(0,t.jsx)("div",{style:{fontSize:10,color:"#666",marginTop:2},children:e.message}),(0,t.jsx)("div",{style:{fontSize:9,color:"#444",marginTop:3},children:new Date(e.created_at).toLocaleDateString()})]})]})},e.id))})]})]}),!tr.IS_DEMO&&!D&&(0,t.jsx)("button",{onClick:async()=>{try{let e=await (0,i.scraperStatus)(),t=(0,i.notReadyMessage)(e);if(t)return void alert(t);if(e.running)return void alert("The scraper is already busy.");await (0,i.startScrape)("refresh"),alert("Checking for new connections — watch it on the Scan page.")}catch(e){alert(e.message)}},title:"Refresh connections + bridges",style:{width:c?28:32,height:c?28:32,borderRadius:"50%",border:"none",cursor:"pointer",background:"rgba(255,255,255,0.06)",color:"#888",fontSize:c?12:14,display:c?"none":"flex",alignItems:"center",justifyContent:"center",marginLeft:8},children:"↻"}),(0,t.jsx)("a",{href:tr.IS_DEMO?"/launch":D?"/import":"/profile",style:{width:c?30:36,height:c?30:36,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #FFD700, #FF6B35)",color:"#000",fontWeight:800,fontSize:c?11:14,textDecoration:"none",marginLeft:c?6:12,flexShrink:0},children:(o=p.filter(e=>"S"===e.tier).length,l=p.filter(e=>"A"===e.tier).length,a=p.filter(e=>"B"===e.tier).length,Math.floor(Math.sqrt((100*o+40*l+15*a+200*p.filter(e=>H.has(e.id)).length+50*u.filter(e=>"S"===e.tier).length+p.length)/10)))})]}),N&&A.length>0&&(0,t.jsxs)(tl.default,{href:"/queue",style:{padding:"5px 12px",borderRadius:16,fontSize:12,fontWeight:600,textDecoration:"none",background:"rgba(255,107,53,0.12)",color:"#FF6B35",border:"1px solid rgba(255,107,53,0.25)",display:"inline-flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{style:{fontSize:10},children:"⏳"}),A.length," Pending"]})]}),(0,t.jsxs)("div",{style:{display:"flex",height:c?"calc(100vh - 70px)":"calc(100vh - 130px)",position:"relative"},children:[(0,t.jsx)(te,{collapsed:C,onToggle:()=>F(!C),mode:v,filter:m,onFilterChange:b,visualMode:B,onVisualModeChange:R,tierCounts:_?.tiers||{},bridgeTierCounts:G}),(()=>{if(0===p.length)return(0,t.jsx)(ti,{});if(N&&0===u.length)return(0,t.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",padding:24,textAlign:"center"},children:(0,t.jsxs)("div",{style:{maxWidth:440},children:[(0,t.jsx)("div",{style:{fontSize:40,marginBottom:16,opacity:.5},children:"🔗"}),(0,t.jsx)("h2",{style:{fontSize:22,fontWeight:800,margin:"0 0 12px",color:"#fff"},children:"Degrees need 2nd-degree data"}),(0,t.jsxs)("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:14,lineHeight:1.7,margin:"0 0 20px"},children:["This view maps who ",(0,t.jsx)("em",{children:"your connections"})," ","know — the people you haven’t met yet. LinkedIn’s CSV export only covers your own 1st-degree list, so there are no circles to open here."]}),(0,t.jsxs)("p",{style:{color:"#666",fontSize:13,lineHeight:1.7,margin:0},children:["The local scraper maps those circles (and captures real photos)."," ",(0,t.jsx)(tl.default,{href:"/setup",style:{color:"#3498DB",textDecoration:"none"},children:"Set up scanning →"})]})]})});let e=V.component,r={connections:Y,degree2:V.allDegree2?u:q,onSelect:X,mode:v,userName:d,userImage:null,selectedId:g?.id??null,tierColors:ts,focusNodeRef:y};return(0,t.jsx)(e,{...r})})(),(0,t.jsx)(e1,{selected:g,stats:_,tierColors:ts,connections:p,degree2:u,mode:v,collapsed:M,filter:m,pending:A,onToggle:()=>z(!M),onSelect:e=>{x(e||null)},onSwitchMode:e=>{k(e),b("all")},onFocusNode:e=>{y.current&&y.current(e)},onMarkSent:async e=>{if(tr.IS_DEMO)return;let t=e.id,r=e.profile_url;await fetch("/api/outreach",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"mark-sent",connectionId:t,profileUrl:r})}),E(t=>[...t,e])},onUndoPending:async e=>{if(tr.IS_DEMO)return;let t=e.id;await fetch("/api/outreach",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"undo",connectionId:t})}),E(e=>e.filter(e=>e.id!==t))}}),N&&"separation"!==V.key&&(0,t.jsxs)("div",{style:{position:"absolute",bottom:20,right:20,zIndex:20,display:"flex",alignItems:"center",gap:8,background:"rgba(0,0,0,0.7)",borderRadius:20,padding:"6px 14px",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.08)"},children:[(0,t.jsx)("span",{style:{fontSize:10,color:"#666"},children:"🧪 Galaxy"}),(0,t.jsx)("div",{onClick:()=>R("galaxy"===B?"chain":"galaxy"),style:{width:32,height:18,borderRadius:9,cursor:"pointer",background:"galaxy"===B?"#FF6B35":"rgba(255,255,255,0.15)",position:"relative",transition:"background 0.2s"},children:(0,t.jsx)("div",{style:{width:14,height:14,borderRadius:"50%",background:"#fff",position:"absolute",top:2,left:"galaxy"===B?16:2,transition:"left 0.2s"}})})]})]})]})}e.s(["default",0,function(){return(0,t.jsx)(tt.default,{children:(0,t.jsx)(td,{})})}],81694)}]);