chatlab-cli 0.30.2-beta.1 → 0.30.2

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 (37) hide show
  1. package/dist-web/assets/{BufferResource-CYSOCeE0.js → BufferResource-q3rzaWWd.js} +1 -1
  2. package/dist-web/assets/{CanvasRenderer-j7Z_ij_m.js → CanvasRenderer-BRk1y8tp.js} +1 -1
  3. package/dist-web/assets/{DebugToolsPanel.vue_vue_type_script_setup_true_lang-Bk9RvIsW.js → DebugToolsPanel.vue_vue_type_script_setup_true_lang-F4n0zNX2.js} +4 -4
  4. package/dist-web/assets/{Filter-BgGyBeXz.js → Filter-BJwode73.js} +1 -1
  5. package/dist-web/assets/{MessageExportModal-BkEhC8s3.js → MessageExportModal-CGcdMOyw.js} +1 -1
  6. package/dist-web/assets/{PageHeader-CUwv2AFR.js → PageHeader-CZaqOdBQ.js} +1 -1
  7. package/dist-web/assets/{RelationshipGalaxyCanvas-D2owKyDp.js → RelationshipGalaxyCanvas-CORMD7vL.js} +3 -3
  8. package/dist-web/assets/{RelationshipGalaxyThreeCanvas-DfJ2x8y9.js → RelationshipGalaxyThreeCanvas-B_w_P4ob.js} +1 -1
  9. package/dist-web/assets/{RenderTargetSystem-BQ__RbzR.js → RenderTargetSystem-CGhV9R9E.js} +1 -1
  10. package/dist-web/assets/{WebGLRenderer-DuThUm1R.js → WebGLRenderer-CAokTE5X.js} +1 -1
  11. package/dist-web/assets/{WebGPURenderer-d8BwTpxP.js → WebGPURenderer-DzP4ggSy.js} +1 -1
  12. package/dist-web/assets/{browserAll-t_tpJM2L.js → browserAll-CAZCK6dd.js} +1 -1
  13. package/dist-web/assets/{electron-6T3FvCfK.js → electron-CkPDbAaS.js} +1 -1
  14. package/dist-web/assets/{fetch-BgIWhYDV.js → fetch--UbRoBT7.js} +1 -1
  15. package/dist-web/assets/{fetch-HpiZrx8C.js → fetch-1pB-HbYw.js} +1 -1
  16. package/dist-web/assets/{fetch-BgeRLaoA.js → fetch-Apd5OLJw.js} +1 -1
  17. package/dist-web/assets/{fetch-Y-LYZmiT.js → fetch-B8rik0TM.js} +1 -1
  18. package/dist-web/assets/{fetch-BLTlXcRA.js → fetch-BIEXkvDq.js} +1 -1
  19. package/dist-web/assets/{fetch-D0ccqGk_.js → fetch-CF_3ZqRa.js} +1 -1
  20. package/dist-web/assets/{fetch-BVM5kQ6-.js → fetch-DQ9UNNAy.js} +1 -1
  21. package/dist-web/assets/{fetch-DdoIAbX4.js → fetch-FSNxSnAp.js} +1 -1
  22. package/dist-web/assets/{fetch-DFifsv8L.js → fetch-LX9jrJCC.js} +1 -1
  23. package/dist-web/assets/{fetch-C7rlHKE7.js → fetch-wqMSiaK3.js} +1 -1
  24. package/dist-web/assets/{index-cyh3gOBe.js → index-B01uUoHE.js} +1 -1
  25. package/dist-web/assets/{index-Tgk7RCvc.js → index-BSIyyt0z.js} +1 -1
  26. package/dist-web/assets/{index-B5YKZflT.js → index-Bh8z441f.js} +2 -2
  27. package/dist-web/assets/{index-g8yqhgfj.js → index-C0rya8v4.js} +1 -1
  28. package/dist-web/assets/{index-CQsrsY5d.js → index-CZbZv2fh.js} +3 -3
  29. package/dist-web/assets/{index-CdsKtFEJ.js → index-CqUuHQBQ.js} +3 -3
  30. package/dist-web/assets/{index-DraLHiEK.js → index-CzeTP5MJ.js} +2 -2
  31. package/dist-web/assets/{index-IL5tkxhM.js → index-DgNxTM_8.js} +2 -2
  32. package/dist-web/assets/{index-BA87rT8F.js → index-S-YQRH1E.js} +1 -1
  33. package/dist-web/assets/web-DbKs6-1b.js +1 -0
  34. package/dist-web/assets/{webworkerAll-CoXPTsvw.js → webworkerAll-Bhv-hBqR.js} +1 -1
  35. package/dist-web/index.html +1 -1
  36. package/package.json +1 -1
  37. package/dist-web/assets/web-DAgXT8gQ.js +0 -1
@@ -1,4 +1,4 @@
1
- import{Y as Ve,N as oe,M as m,G as Ne,b as je,a as $e,Z as le,j as l,r as W,_ as w,$ as qe,a0 as z,a1 as T,R as V,a2 as de,a3 as Ke,T as f,c as g,K as D,a4 as ue,w as ce,a5 as ee,a6 as he,a7 as pe,a8 as fe,a9 as me,x as P,aa as Ye,C as E,D as N,L as y,ab as B,ac as Je,P as Xe,ad as Ze,I as Qe,t as te,ae as re,af as p,e as et,q as O,ag as tt,ah as rt,ai as st,aj as nt}from"./RelationshipGalaxyCanvas-D2owKyDp.js";import{F as at}from"./Filter-BgGyBeXz.js";var it=`in vec2 vMaskCoord;
1
+ import{Y as Ve,N as oe,M as m,G as Ne,b as je,a as $e,Z as le,j as l,r as W,_ as w,$ as qe,a0 as z,a1 as T,R as V,a2 as de,a3 as Ke,T as f,c as g,K as D,a4 as ue,w as ce,a5 as ee,a6 as he,a7 as pe,a8 as fe,a9 as me,x as P,aa as Ye,C as E,D as N,L as y,ab as B,ac as Je,P as Xe,ad as Ze,I as Qe,t as te,ae as re,af as p,e as et,q as O,ag as tt,ah as rt,ai as st,aj as nt}from"./RelationshipGalaxyCanvas-CORMD7vL.js";import{F as at}from"./Filter-BJwode73.js";var it=`in vec2 vMaskCoord;
2
2
  in vec2 vTextureCoord;
3
3
 
4
4
  uniform sampler2D uTexture;
@@ -1,4 +1,4 @@
1
- import{D as R,a as F,j as d,z as P,d as B,w as b,g as q,b as Ce,S as O,T as S,ak as Ne,L as Z,al as De,c as T,ab as X,q as y,K as C,N as M,r as g,M as J,am as Q,an as Ie,ao as ee,ap as Ge,aq as Ue,A as Fe,R as Pe}from"./RelationshipGalaxyCanvas-D2owKyDp.js";import{e as Oe,G as Me,c as Le,b as we,U as He,B as te,d as N,f as re,g as Ve}from"./BufferResource-CYSOCeE0.js";import{R as Xe,S as ke,d as We}from"./RenderTargetSystem-BQ__RbzR.js";import"./vendor-snapdom-XnBoh1gd.js";import"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./index-IL5tkxhM.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import"./people-page-header-Mupn-U_b.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BgGyBeXz.js";function je(){const{userAgent:t}=R.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}class ne{constructor(){this._tempState=F.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,r,n){const s=e.renderer,i=this._didUploadHash[n.uid];s.shader.bind(n,i),i||(this._didUploadHash[n.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,n.glProgram)}execute(e,r){const n=e.renderer;this._tempState.blendMode=r.blendMode,n.state.set(this._tempState);const s=r.textures.textures;for(let i=0;i<r.textures.count;i++)n.texture.bind(s[i],i);n.geometry.draw(r.topology,r.size,r.start)}}ne.extension={type:[d.WebGLPipesAdaptor],name:"batch"};var A=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(A||{});class Ke{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}class se{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new P({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,n=this.getGlBuffer(e);r.bindBuffer(n.type,n.buffer)}bindBufferBase(e,r){const{_gl:n}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,n.bindBufferBase(n.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let n=0,s=this._nextBindBaseIndex;for(;n<2;){s>=this._maxBindings&&(s=this._minBaseLocation,n++);const i=this._boundBufferBases[s];if(i&&i._lastBindCallId===this._bindCallId){s++;continue}break}return r=s,this._nextBindBaseIndex=s+1,n>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,n,s){const{_gl:i}=this;n||(n=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,n*256,s||256)}updateBuffer(e){const{_gl:r}=this,n=this.getGlBuffer(e);if(e._updateID===n.updateID)return n;n.updateID=e._updateID,r.bindBuffer(n.type,n.buffer);const s=e.data,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return s?n.byteLength>=s.byteLength?r.bufferSubData(n.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(n.byteLength=s.byteLength,r.bufferData(n.type,s,i)):(n.byteLength=e.descriptor.size,r.bufferData(n.type,n.byteLength,i)),n}destroyAll(e=!1){this._managedBuffers.removeAll(e)}onBufferUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];n&&(r||this._gl.deleteBuffer(n.buffer))}createGLBuffer(e){const{_gl:r}=this;let n=A.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?n=A.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(n=A.UNIFORM_BUFFER);const s=new Ke(r.createBuffer(),n);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null)}}se.extension={type:[d.WebGLSystem],name:"buffer"};const L=class ie{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...ie.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(b("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=R.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const n=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:n,premultipliedAlpha:s,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&b("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width<e.width||r.height<e.height)&&(r.width=Math.max(e.width,e.width),r.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof R.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let n;const s=this.canvas;if(e===2&&(n=s.getContext("webgl2",r)),!n&&(n=s.getContext("webgl",r),!n))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=n,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const n=e.getExtension("WEBGL_provoking_vertex");n&&n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=this.supports,s=this.webGLVersion===2,i=this.extensions;n.uint32Indices=s||!!i.uint32ElementIndex,n.uniformBufferObject=s,n.vertexArrayObject=s||!!i.vertexArrayObject,n.srgbTextures=s||!!i.srgb,n.nonPowOf2wrapping=s,n.nonPowOf2mipmaps=s,n.msaa=s,n.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};L.extension={type:[d.WebGLSystem],name:"context"};L.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let $e=L;var G=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(G||{}),w=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(w||{}),h=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(h||{});const k={uint8x2:h.UNSIGNED_BYTE,uint8x4:h.UNSIGNED_BYTE,sint8x2:h.BYTE,sint8x4:h.BYTE,unorm8x2:h.UNSIGNED_BYTE,unorm8x4:h.UNSIGNED_BYTE,snorm8x2:h.BYTE,snorm8x4:h.BYTE,uint16x2:h.UNSIGNED_SHORT,uint16x4:h.UNSIGNED_SHORT,sint16x2:h.SHORT,sint16x4:h.SHORT,unorm16x2:h.UNSIGNED_SHORT,unorm16x4:h.UNSIGNED_SHORT,snorm16x2:h.SHORT,snorm16x4:h.SHORT,float16x2:h.HALF_FLOAT,float16x4:h.HALF_FLOAT,float32:h.FLOAT,float32x2:h.FLOAT,float32x3:h.FLOAT,float32x4:h.FLOAT,uint32:h.UNSIGNED_INT,uint32x2:h.UNSIGNED_INT,uint32x3:h.UNSIGNED_INT,uint32x4:h.UNSIGNED_INT,sint32:h.INT,sint32x2:h.INT,sint32x3:h.INT,sint32x4:h.INT};function Ye(t){return k[t]??k.float32}const ze={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class qe{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}}class ae{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new P({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=s=>r.bindVertexArrayOES(s),e.deleteVertexArray=s=>r.deleteVertexArrayOES(s));const n=this._renderer.context.extensions.vertexAttribDivisorANGLE;n&&(e.drawArraysInstanced=(s,i,a,c)=>{n.drawArraysInstancedANGLE(s,i,a,c)},e.drawElementsInstanced=(s,i,a,c,o)=>{n.drawElementsInstancedANGLE(s,i,a,c,o)},e.vertexAttribDivisor=(s,i)=>n.vertexAttribDivisorANGLE(s,i)),this._activeGeometry=null,this._activeVao=null}bind(e,r){const n=this.gl;this._activeGeometry=e;const s=this.getVao(e,r);this._activeVao!==s&&(this._activeVao=s,n.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let n=0;n<e.buffers.length;n++){const s=e.buffers[n];r.updateBuffer(s)}e._gcLastUsed=this._renderer.gc.now}checkCompatibility(e,r){const n=e.attributes,s=r._attributeData;for(const i in s)if(!n[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const n=e.attributes,s=r._attributeData,i=["g",e.uid];for(const a in n)s[a]&&i.push(a,s[a].location);return i.join("-")}getVao(e,r){return e._gpuData[this._renderer.uid]?.vaoCache[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,n=!0){const s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);let c=e._gpuData[this._renderer.uid];c||(c=new qe,e._gpuData[this._renderer.uid]=c,this._managedGeometries.add(e));const o=c.vaoCache;let u=o[a];if(u)return o[r._key]=u,u;Oe(e,r._attributeData);const _=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let l=0;l<_.length;l++){const f=_[l];i.bind(f)}return this.activateVao(e,r),o[r._key]=u,o[a]=u,s.bindVertexArray(null),u}onGeometryUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];if(!n)return;const s=n.vaoCache;if(!r)for(const i in s)this._activeVao!==s[i]&&this.resetState(),this.gl.deleteVertexArray(s[i])}destroyAll(e=!1){this._managedGeometries.removeAll(e)}activateVao(e,r){const n=this._renderer.gl,s=this._renderer.buffer,i=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let a=null;for(const c in i){const o=i[c],u=o.buffer,_=s.getGlBuffer(u),l=r._attributeData[c];if(l){a!==_&&(s.bind(u),a=_);const f=l.location;n.enableVertexAttribArray(f);const m=q(o.format),p=Ye(o.format);if(l.format?.substring(1,4)==="int"?n.vertexAttribIPointer(f,m.size,p,o.stride,o.offset):n.vertexAttribPointer(f,m.size,p,m.normalised,o.stride,o.offset),o.instance)if(this.hasInstance){const E=o.divisor??1;n.vertexAttribDivisor(f,E)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,s){const{gl:i}=this._renderer,a=this._activeGeometry,c=ze[e||a.topology];if(s??(s=a.instanceCount),a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s!==1?i.drawElementsInstanced(c,r||a.indexBuffer.data.length,u,(n||0)*o,s):i.drawElements(c,r||a.indexBuffer.data.length,u,(n||0)*o)}else s!==1?i.drawArraysInstanced(c,n||0,r||a.getSize(),s):i.drawArrays(c,n||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[d.WebGLSystem],name:"geometry"};const Ze=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),H=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:n}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=n,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=F.for2d();const s=new Ce({vertex:`
1
+ import{D as R,a as F,j as d,z as P,d as B,w as b,g as q,b as Ce,S as O,T as S,ak as Ne,L as Z,al as De,c as T,ab as X,q as y,K as C,N as M,r as g,M as J,am as Q,an as Ie,ao as ee,ap as Ge,aq as Ue,A as Fe,R as Pe}from"./RelationshipGalaxyCanvas-CORMD7vL.js";import{e as Oe,G as Me,c as Le,b as we,U as He,B as te,d as N,f as re,g as Ve}from"./BufferResource-q3rzaWWd.js";import{R as Xe,S as ke,d as We}from"./RenderTargetSystem-CGhV9R9E.js";import"./vendor-snapdom-XnBoh1gd.js";import"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./index-DgNxTM_8.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import"./people-page-header-Mupn-U_b.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BJwode73.js";function je(){const{userAgent:t}=R.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}class ne{constructor(){this._tempState=F.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,r,n){const s=e.renderer,i=this._didUploadHash[n.uid];s.shader.bind(n,i),i||(this._didUploadHash[n.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,n.glProgram)}execute(e,r){const n=e.renderer;this._tempState.blendMode=r.blendMode,n.state.set(this._tempState);const s=r.textures.textures;for(let i=0;i<r.textures.count;i++)n.texture.bind(s[i],i);n.geometry.draw(r.topology,r.size,r.start)}}ne.extension={type:[d.WebGLPipesAdaptor],name:"batch"};var A=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(A||{});class Ke{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1}}class se{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new P({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"})}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={}}contextChange(){this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,n=this.getGlBuffer(e);r.bindBuffer(n.type,n.buffer)}bindBufferBase(e,r){const{_gl:n}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,n.bindBufferBase(n.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let n=0,s=this._nextBindBaseIndex;for(;n<2;){s>=this._maxBindings&&(s=this._minBaseLocation,n++);const i=this._boundBufferBases[s];if(i&&i._lastBindCallId===this._bindCallId){s++;continue}break}return r=s,this._nextBindBaseIndex=s+1,n>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,n,s){const{_gl:i}=this;n||(n=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,n*256,s||256)}updateBuffer(e){const{_gl:r}=this,n=this.getGlBuffer(e);if(e._updateID===n.updateID)return n;n.updateID=e._updateID,r.bindBuffer(n.type,n.buffer);const s=e.data,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return s?n.byteLength>=s.byteLength?r.bufferSubData(n.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(n.byteLength=s.byteLength,r.bufferData(n.type,s,i)):(n.byteLength=e.descriptor.size,r.bufferData(n.type,n.byteLength,i)),n}destroyAll(e=!1){this._managedBuffers.removeAll(e)}onBufferUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];n&&(r||this._gl.deleteBuffer(n.buffer))}createGLBuffer(e){const{_gl:r}=this;let n=A.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?n=A.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(n=A.UNIFORM_BUFFER);const s=new Ke(r.createBuffer(),n);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null)}}se.extension={type:[d.WebGLSystem],name:"buffer"};const L=class ie{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...ie.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(b("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=R.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const n=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:n,premultipliedAlpha:s,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&b("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width<e.width||r.height<e.height)&&(r.width=Math.max(e.width,e.width),r.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof R.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let n;const s=this.canvas;if(e===2&&(n=s.getContext("webgl2",r)),!n&&(n=s.getContext("webgl",r),!n))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=n,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const n=e.getExtension("WEBGL_provoking_vertex");n&&n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=this.supports,s=this.webGLVersion===2,i=this.extensions;n.uint32Indices=s||!!i.uint32ElementIndex,n.uniformBufferObject=s,n.vertexArrayObject=s||!!i.vertexArrayObject,n.srgbTextures=s||!!i.srgb,n.nonPowOf2wrapping=s,n.nonPowOf2mipmaps=s,n.msaa=s,n.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};L.extension={type:[d.WebGLSystem],name:"context"};L.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let $e=L;var G=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(G||{}),w=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(w||{}),h=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(h||{});const k={uint8x2:h.UNSIGNED_BYTE,uint8x4:h.UNSIGNED_BYTE,sint8x2:h.BYTE,sint8x4:h.BYTE,unorm8x2:h.UNSIGNED_BYTE,unorm8x4:h.UNSIGNED_BYTE,snorm8x2:h.BYTE,snorm8x4:h.BYTE,uint16x2:h.UNSIGNED_SHORT,uint16x4:h.UNSIGNED_SHORT,sint16x2:h.SHORT,sint16x4:h.SHORT,unorm16x2:h.UNSIGNED_SHORT,unorm16x4:h.UNSIGNED_SHORT,snorm16x2:h.SHORT,snorm16x4:h.SHORT,float16x2:h.HALF_FLOAT,float16x4:h.HALF_FLOAT,float32:h.FLOAT,float32x2:h.FLOAT,float32x3:h.FLOAT,float32x4:h.FLOAT,uint32:h.UNSIGNED_INT,uint32x2:h.UNSIGNED_INT,uint32x3:h.UNSIGNED_INT,uint32x4:h.UNSIGNED_INT,sint32:h.INT,sint32x2:h.INT,sint32x3:h.INT,sint32x4:h.INT};function Ye(t){return k[t]??k.float32}const ze={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class qe{constructor(){this.vaoCache=Object.create(null)}destroy(){this.vaoCache=Object.create(null)}}class ae{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new P({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"})}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");this.destroyAll(!0);const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=s=>r.bindVertexArrayOES(s),e.deleteVertexArray=s=>r.deleteVertexArrayOES(s));const n=this._renderer.context.extensions.vertexAttribDivisorANGLE;n&&(e.drawArraysInstanced=(s,i,a,c)=>{n.drawArraysInstancedANGLE(s,i,a,c)},e.drawElementsInstanced=(s,i,a,c,o)=>{n.drawElementsInstancedANGLE(s,i,a,c,o)},e.vertexAttribDivisor=(s,i)=>n.vertexAttribDivisorANGLE(s,i)),this._activeGeometry=null,this._activeVao=null}bind(e,r){const n=this.gl;this._activeGeometry=e;const s=this.getVao(e,r);this._activeVao!==s&&(this._activeVao=s,n.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let n=0;n<e.buffers.length;n++){const s=e.buffers[n];r.updateBuffer(s)}e._gcLastUsed=this._renderer.gc.now}checkCompatibility(e,r){const n=e.attributes,s=r._attributeData;for(const i in s)if(!n[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const n=e.attributes,s=r._attributeData,i=["g",e.uid];for(const a in n)s[a]&&i.push(a,s[a].location);return i.join("-")}getVao(e,r){return e._gpuData[this._renderer.uid]?.vaoCache[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,n=!0){const s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);let c=e._gpuData[this._renderer.uid];c||(c=new qe,e._gpuData[this._renderer.uid]=c,this._managedGeometries.add(e));const o=c.vaoCache;let u=o[a];if(u)return o[r._key]=u,u;Oe(e,r._attributeData);const _=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let l=0;l<_.length;l++){const f=_[l];i.bind(f)}return this.activateVao(e,r),o[r._key]=u,o[a]=u,s.bindVertexArray(null),u}onGeometryUnload(e,r=!1){const n=e._gpuData[this._renderer.uid];if(!n)return;const s=n.vaoCache;if(!r)for(const i in s)this._activeVao!==s[i]&&this.resetState(),this.gl.deleteVertexArray(s[i])}destroyAll(e=!1){this._managedGeometries.removeAll(e)}activateVao(e,r){const n=this._renderer.gl,s=this._renderer.buffer,i=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let a=null;for(const c in i){const o=i[c],u=o.buffer,_=s.getGlBuffer(u),l=r._attributeData[c];if(l){a!==_&&(s.bind(u),a=_);const f=l.location;n.enableVertexAttribArray(f);const m=q(o.format),p=Ye(o.format);if(l.format?.substring(1,4)==="int"?n.vertexAttribIPointer(f,m.size,p,o.stride,o.offset):n.vertexAttribPointer(f,m.size,p,m.normalised,o.stride,o.offset),o.instance)if(this.hasInstance){const E=o.divisor??1;n.vertexAttribDivisor(f,E)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,s){const{gl:i}=this._renderer,a=this._activeGeometry,c=ze[e||a.topology];if(s??(s=a.instanceCount),a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,u=o===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s!==1?i.drawElementsInstanced(c,r||a.indexBuffer.data.length,u,(n||0)*o,s):i.drawElements(c,r||a.indexBuffer.data.length,u,(n||0)*o)}else s!==1?i.drawArraysInstanced(c,n||0,r||a.getSize(),s):i.drawArrays(c,n||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[d.WebGLSystem],name:"geometry"};const Ze=new Ne({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),H=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:n}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=n,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=F.for2d();const s=new Ce({vertex:`
2
2
  attribute vec2 aPosition;
3
3
  out vec2 vUv;
4
4
 
@@ -1,4 +1,4 @@
1
- import{y as L,a as D,j as l,z as k,e as pe,H as le,D as T,c as C,d as B,B as fe,I as z,J as w,w as v,K as y,q as ge,L as me,N as O,O as R,r as G,M as F,Q as I,V as _e,W,X as be,S as H,T as E,A as xe,R as ye}from"./RelationshipGalaxyCanvas-D2owKyDp.js";import{c as Ge,u as Pe,U as Se,B as Te,G as Be,e as Ce,l as ve,a as Ue,t as Me}from"./BufferResource-CYSOCeE0.js";import{R as we,S as Re,d as Ee}from"./RenderTargetSystem-BQ__RbzR.js";import"./vendor-snapdom-XnBoh1gd.js";import"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./index-IL5tkxhM.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import"./people-page-header-Mupn-U_b.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BgGyBeXz.js";const P=D.for2d();class N{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),P.blendMode="normal",s.pipeline.getPipeline(t,n,P);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=L(u.textures,u.count,s.limits.maxBatchableTextures)}P.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,P,t.topology);t.bindGroup._touch(s.gc.now,s.tick),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}N.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class V{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const g in i){const p=e.resources[g]??e.resources[i[g]];let h;if(p._resourceType==="uniformGroup"){const d=p;o.ubo.updateUniformGroup(d);const f=d.buffer;h={buffer:o.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(p._resourceType==="buffer"){const d=p;h={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(p._resourceType==="bufferResource"){const d=p;h={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(p._resourceType==="textureSampler"){const d=p;h=o.texture.getGpuSampler(d)}else if(p._resourceType==="textureSource"){const d=p;h=o.texture.getTextureView(d)}n.push({binding:i[g],resource:h})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){this._hash=null,this._renderer=null}}V.extension={type:[l.WebGPUSystem],name:"bindGroup"};class Ae{constructor(e){this.gpuBuffer=e}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}}class j{constructor(e){this._renderer=e,this._managedBuffers=new k({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(e){this._gpu=e}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){const t=this.getGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this)}createGPUBuffer(e){const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=pe("resource"),e.data&&(le(e.data.buffer,t.getMappedRange(),e.data.byteOffset,e.data.byteLength),t.unmap()),e._gpuData[this._renderer.uid]=new Ae(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}}j.extension={type:[l.WebGPUSystem],name:"buffer"};class Le{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this.data=null}}class K{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}K.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await T.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class q{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.gc.now,this._renderer.tick);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(parseInt(s,10),e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}q.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class Y{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}Y.extension={type:[l.WebGPUSystem],name:"limits"};class ${constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:C.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}$.extension={type:[l.WebGPUSystem],name:"stencil"};const S={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function De(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=S[s.data.type].size;const n=S[s.data.type].align;if(!S[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function ke(a,e){const{size:t,align:r}=S[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
1
+ import{y as L,a as D,j as l,z as k,e as pe,H as le,D as T,c as C,d as B,B as fe,I as z,J as w,w as v,K as y,q as ge,L as me,N as O,O as R,r as G,M as F,Q as I,V as _e,W,X as be,S as H,T as E,A as xe,R as ye}from"./RelationshipGalaxyCanvas-CORMD7vL.js";import{c as Ge,u as Pe,U as Se,B as Te,G as Be,e as Ce,l as ve,a as Ue,t as Me}from"./BufferResource-q3rzaWWd.js";import{R as we,S as Re,d as Ee}from"./RenderTargetSystem-CGhV9R9E.js";import"./vendor-snapdom-XnBoh1gd.js";import"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./index-DgNxTM_8.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import"./people-page-header-Mupn-U_b.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BJwode73.js";const P=D.for2d();class N{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),P.blendMode="normal",s.pipeline.getPipeline(t,n,P);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=L(u.textures,u.count,s.limits.maxBatchableTextures)}P.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,P,t.topology);t.bindGroup._touch(s.gc.now,s.tick),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}N.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class V{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const g in i){const p=e.resources[g]??e.resources[i[g]];let h;if(p._resourceType==="uniformGroup"){const d=p;o.ubo.updateUniformGroup(d);const f=d.buffer;h={buffer:o.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(p._resourceType==="buffer"){const d=p;h={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(p._resourceType==="bufferResource"){const d=p;h={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(p._resourceType==="textureSampler"){const d=p;h=o.texture.getGpuSampler(d)}else if(p._resourceType==="textureSource"){const d=p;h=o.texture.getTextureView(d)}n.push({binding:i[g],resource:h})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){this._hash=null,this._renderer=null}}V.extension={type:[l.WebGPUSystem],name:"bindGroup"};class Ae{constructor(e){this.gpuBuffer=e}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null}}class j{constructor(e){this._renderer=e,this._managedBuffers=new k({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"})}contextChange(e){this._gpu=e}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){const t=this.getGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){this._managedBuffers.removeAll()}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this)}createGPUBuffer(e){const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=pe("resource"),e.data&&(le(e.data.buffer,t.getMappedRange(),e.data.byteOffset,e.data.byteLength),t.unmap()),e._gpuData[this._renderer.uid]=new Ae(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e)}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null}}j.extension={type:[l.WebGPUSystem],name:"buffer"};class Le{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this.data=null}}class K{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}K.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this.extensions={transientAttachment:typeof GPUTextureUsage.TRANSIENT_ATTACHMENT=="number"},this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await T.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this.extensions=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class q{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.gc.now,this._renderer.tick);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(parseInt(s,10),e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}q.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class Y{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}Y.extension={type:[l.WebGPUSystem],name:"limits"};class ${constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:C.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}$.extension={type:[l.WebGPUSystem],name:"stencil"};const S={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function De(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=S[s.data.type].size;const n=S[s.data.type].align;if(!S[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function ke(a,e){const{size:t,align:r}=S[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
2
2
  v = uv.${a.data.name};
3
3
  ${e!==0?`offset += ${e};`:""}
4
4
 
@@ -1,4 +1,4 @@
1
- import{t as M,U as Z,P as m,v as te,j as y,E as ie,w as g,r as P,x as V}from"./RelationshipGalaxyCanvas-D2owKyDp.js";import"./webworkerAll-CoXPTsvw.js";import"./vendor-snapdom-XnBoh1gd.js";import"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./index-IL5tkxhM.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import"./people-page-header-Mupn-U_b.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BgGyBeXz.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i,$=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function j(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||$(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||$(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n(N),chrome:n(F),device:n(K)||n(Y)||n(H)||n(N)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=j.default??j,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,W=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=W.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
1
+ import{t as M,U as Z,P as m,v as te,j as y,E as ie,w as g,r as P,x as V}from"./RelationshipGalaxyCanvas-CORMD7vL.js";import"./webworkerAll-Bhv-hBqR.js";import"./vendor-snapdom-XnBoh1gd.js";import"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./index-DgNxTM_8.js";import"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import"./people-page-header-Mupn-U_b.js";import"./relationship-galaxy-viewport-Cwfa51ER.js";import"./Filter-BJwode73.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i,$=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function j(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||$(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||$(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n(N),chrome:n(F),device:n(K)||n(Y)||n(H)||n(N)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=j.default??j,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,W=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=W.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
2
2
  color: transparent;
3
3
  pointer-events: none;
4
4
  padding: 0;
@@ -1 +1 @@
1
- import{FetchAIAdapter as t}from"./fetch-D0ccqGk_.js";import"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class l extends t{async exportFilterResultToFile(r){return window.aiApi.exportFilterResultToFile(r)}onExportProgress(r){return window.aiApi.onExportProgress(r)}}export{l as ElectronAIAdapter};
1
+ import{FetchAIAdapter as t}from"./fetch-CF_3ZqRa.js";import"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class l extends t{async exportFilterResultToFile(r){return window.aiApi.exportFilterResultToFile(r)}onExportProgress(r){return window.aiApi.onExportProgress(r)}}export{l as ElectronAIAdapter};
@@ -1 +1 @@
1
- import{g as a,a as s,b as i,d as n}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class p{async getAll(){return a("/ai/assistants")}async getConfig(t){try{return await a(`/ai/assistants/${t}`)}catch{return null}}async create(t){return s("/ai/assistants",t)}async update(t,r){return i(`/ai/assistants/${t}`,r)}async delete(t){return n(`/ai/assistants/${t}`)}async reset(t){return s(`/ai/assistants/${t}/reset`,{})}async importFromMd(t){return s("/ai/assistants/import",{rawMd:t})}async getBuiltinCatalog(){return[]}async importBuiltin(t){return s("/ai/assistants/import-builtin",{builtinId:t})}async reimport(t){return s(`/ai/assistants/${t}/reimport`,{})}async getBuiltinToolCatalog(){return a("/ai/tools/catalog")}}export{p as FetchAssistantAdapter};
1
+ import{g as a,a as s,b as i,d as n}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class p{async getAll(){return a("/ai/assistants")}async getConfig(t){try{return await a(`/ai/assistants/${t}`)}catch{return null}}async create(t){return s("/ai/assistants",t)}async update(t,r){return i(`/ai/assistants/${t}`,r)}async delete(t){return n(`/ai/assistants/${t}`)}async reset(t){return s(`/ai/assistants/${t}/reset`,{})}async importFromMd(t){return s("/ai/assistants/import",{rawMd:t})}async getBuiltinCatalog(){return[]}async importBuiltin(t){return s("/ai/assistants/import-builtin",{builtinId:t})}async reimport(t){return s(`/ai/assistants/${t}/reimport`,{})}async getBuiltinToolCatalog(){return a("/ai/tools/catalog")}}export{p as FetchAssistantAdapter};
@@ -1,3 +1,3 @@
1
- import{f as a,h as i,g as h}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";async function l(y,t,s){const r=y.body?.getReader();if(!r)return t;const e=new TextDecoder;let o="",n=t;for(;;){const{done:u,value:w}=await r.read();if(u)break;o+=e.decode(w,{stream:!0});const f=o.split(`
1
+ import{f as a,h as i,g as h}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";async function l(y,t,s){const r=y.body?.getReader();if(!r)return t;const e=new TextDecoder;let o="",n=t;for(;;){const{done:u,value:w}=await r.read();if(u)break;o+=e.decode(w,{stream:!0});const f=o.split(`
2
2
  `);o=f.pop()||"";let d="";for(const c of f)if(c.startsWith("event: "))d=c.slice(7).trim();else if(c.startsWith("data: ")){const p=JSON.parse(c.slice(6));d==="progress"?s?.(p):(d==="done"||d==="error")&&(n=p),d=""}}return n}class S{async importFile(t,s,r){if(typeof t=="string")return{success:!1,error:"File path import is not supported in Web mode"};const e=new FormData;e.append("file",t),s?.formatId&&e.append("formatId",s.formatId),s?.chatIndex!==void 0&&e.append("chatIndex",String(s.chatIndex));const o=await a(`${i()}/import`,{method:"POST",body:e});if(!o.ok){const n=await o.text();return{success:!1,error:`HTTP ${o.status}: ${n}`}}return l(o,{success:!1,error:"Unknown error"},r)}async detectFormat(t){if(typeof t=="string")return null;const s=new FormData;s.append("file",t);const r=await a(`${i()}/detect-format`,{method:"POST",body:s});return r.ok?(await r.json()).format:null}async scanMultiChatFile(t){if(typeof t=="string")return[];const s=new FormData;s.append("file",t);const r=await a(`${i()}/scan-multi-chat`,{method:"POST",body:s});return r.ok?(await r.json()).chats:[]}async prepareImportSource(t){if(typeof t=="string")return{success:!1,error:"File path import is not supported in Web mode"};const s=new FormData;s.append("file",t);const r=await a(`${i()}/import-sources`,{method:"POST",body:s}),e=await r.json().catch(()=>null);return r.ok?e??{success:!1,error:"Invalid import source response"}:{success:!1,error:e?.error||`HTTP ${r.status}`}}async importPreparedChat(t,s,r){const e=await a(`${i()}/import-sources/${encodeURIComponent(t)}/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({chatId:s})});if(!e.ok){const o=await e.text();return{success:!1,error:`HTTP ${e.status}: ${o}`}}return l(e,{success:!1,error:"Unknown error"},r)}async releaseImportSource(t){await a(`${i()}/import-sources/${encodeURIComponent(t)}`,{method:"DELETE"})}getSupportedFormats(){return h("/supported-formats")}async importDemo(t,s){return new Promise(r=>{a(`${i()}/demo/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:t})}).then(async e=>{if(!e.ok||!e.body){r({success:!1,error:`HTTP ${e.status}`});return}const o=e.body.getReader(),n=new TextDecoder;let u="";for(;;){const{done:w,value:f}=await o.read();if(w)break;u+=n.decode(f,{stream:!0});const d=u.split(`
3
3
  `);u=d.pop()||"";let c="";for(const p of d)if(p.startsWith("event: "))c=p.slice(7).trim();else if(p.startsWith("data: ")){const m=JSON.parse(p.slice(6));if(c==="progress")(m.stage==="downloading"||m.stage==="importing")&&s?.({stage:m.stage});else if(c==="result"){r(m);return}c=""}}r({success:!1,error:"Stream ended without result"})}).catch(e=>r({success:!1,error:String(e)}))})}async analyzeIncrementalImport(t,s){if(typeof s=="string")return{newMessageCount:0,duplicateCount:0,totalInFile:0,error:"File path not supported in Web mode"};const r=new FormData;r.append("file",s);const e=await a(`${i()}/sessions/${t}/import/incremental/analyze`,{method:"POST",body:r});if(!e.ok){const o=await e.text();return{newMessageCount:0,duplicateCount:0,totalInFile:0,error:`HTTP ${e.status}: ${o}`}}return await e.json()}async incrementalImport(t,s,r){if(typeof s=="string")return{success:!1,newMessageCount:0,error:"File path not supported in Web mode"};const e=new FormData;e.append("file",s);const o=await a(`${i()}/sessions/${t}/import/incremental`,{method:"POST",body:e});if(!o.ok){const n=await o.text();return{success:!1,newMessageCount:0,error:`HTTP ${o.status}: ${n}`}}return l(o,{success:!1,newMessageCount:0,error:"Unknown error"},r)}async importDirectory(t,s,r){if(typeof t=="string")return{success:!1,error:"Directory path import is not supported in Web mode"};if(t.length===0)return{success:!1,error:"No files in directory"};const e=new FormData;for(const n of t)e.append("files",n),e.append("relativePaths",n.webkitRelativePath||n.name);const o=await a(`${i()}/import-directory`,{method:"POST",body:e});if(!o.ok){const n=await o.text();return{success:!1,error:`HTTP ${o.status}: ${n}`}}return l(o,{success:!1,error:"Unknown error"},r)}}export{S as FetchImportAdapter};
@@ -1,4 +1,4 @@
1
- import{f as r,e as d}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";function c(){return d("data")}const u=`(SELECT mc.message_id FROM message_context mc
1
+ import{f as r,e as d}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";function c(){return d("data")}const u=`(SELECT mc.message_id FROM message_context mc
2
2
  WHERE mc.segment_id = segment.id ORDER BY mc.message_id LIMIT 1) as firstMessageId`;class S{async generate(e,t=1800){const s=await r(`/_web/sessions/${e}/generate-index`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gapThreshold:t})});if(!s.ok)throw new Error(`Failed to generate session index: ${s.status}`);return(await s.json()).sessionCount}async generateIncremental(e,t=1800){const s=await r(`/_web/sessions/${e}/generate-incremental-index`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gapThreshold:t})});if(!s.ok)throw new Error(`Failed to generate incremental session index: ${s.status}`);return(await s.json()).sessionCount}async hasIndex(e){return(await this.getStats(e)).hasIndex}async getStats(e){try{const s=(await c().pluginQuery(e,"SELECT COUNT(*) as cnt FROM segment",[]))[0]?.cnt??0;return{hasIndex:s>0,sessionCount:s,gapThreshold:1800}}catch{return{hasIndex:!1,sessionCount:0,gapThreshold:1800}}}async getAllIndexStats(){const e=await r("/_web/sessions/index-stats");return e.ok?await e.json():[]}async clear(e){return await r(`/_web/sessions/${e}/clear-index`,{method:"POST"}),!0}async updateGapThreshold(e,t){return!0}async getSessions(e){return c().pluginQuery(e,`SELECT id, start_ts as startTs, end_ts as endTs, message_count as messageCount, summary, ${u}
3
3
  FROM segment ORDER BY start_ts ASC`,[])}async getByTimeRange(e,t,s){return c().pluginQuery(e,`SELECT id, start_ts as startTs, end_ts as endTs, message_count as messageCount, summary, ${u}
4
4
  FROM segment WHERE start_ts >= ? AND end_ts <= ? ORDER BY start_ts ASC`,[t,s])}async getRecent(e,t){return c().pluginQuery(e,`SELECT id, start_ts as startTs, end_ts as endTs, message_count as messageCount, summary, ${u}
@@ -1,4 +1,4 @@
1
- import{e as T}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";const R=`
1
+ import{e as T}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";const R=`
2
2
  msg.id,
3
3
  m.id as senderId,
4
4
  COALESCE(m.group_nickname, m.account_name, m.platform_id) as senderName,
@@ -1 +1 @@
1
- import{g as i,a as r,b as s,d as l}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class p{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{p as FetchSkillAdapter};
1
+ import{g as i,a as r,b as s,d as l}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class p{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{p as FetchSkillAdapter};
@@ -1 +1 @@
1
- import{g as r,a,b as u,d as l,f as h}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";const g="This feature is not available in web mode";class p{async getAIChat(e){try{return await r(`/ai/chats/${e}`)}catch{return null}}async getAIChats(e){return r(`/ai/chats?sessionId=${encodeURIComponent(e)}`)}async createAIChat(e,t,s){return a("/ai/chats",{sessionId:e,title:t,assistantId:s})}async updateAIChatTitle(e,t){return u(`/ai/chats/${e}/title`,{title:t})}async deleteAIChat(e){return l(`/ai/chats/${e}`)}async getMessages(e){return r(`/ai/chats/${e}/messages`)}async addMessage(e,t,s,c,n,o,i){return a(`/ai/chats/${e}/messages`,{role:t,content:s,dataKeywords:c,dataMessageCount:n,contentBlocks:o,tokenUsage:i})}async deleteMessagesFrom(e,t){return a(`/ai/chats/${e}/messages/${t}/delete-from`,{})}async forkAIChat(e,t,s){return a(`/ai/chats/${e}/fork`,{upToMessageId:t,title:s})}async updateMessageContent(e,t){await u(`/ai/messages/${e}/content`,{content:t})}async deleteAndRelinkMessage(e,t){await a(`/ai/chats/${e}/messages/${t}/delete-relink`,{})}async insertMessageAfter(e,t,s,c,n,o){return a(`/ai/chats/${e}/messages/insert-after`,{afterMessageId:t,role:s,content:c,contentBlocks:n,tokenUsage:o})}async getAIChatTokenUsage(e){return r(`/ai/chats/${e}/token-usage`)}async estimateContextTokens(e){try{return await r(`/ai/chats/${e}/estimate-tokens`)}catch(t){return{success:!1,tokens:0,error:t instanceof Error?t.message:String(t)}}}async exportFilterResultToFile(e){try{const t=await h(`/_web/sessions/${e.sessionId}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionName:e.sessionName,format:e.format||"txt",timeFilter:e.timeFilter})});if(!t.ok)return{success:!1,error:(await t.json().catch(()=>null))?.error||`HTTP ${t.status}`};const s=await t.blob(),c=t.headers.get("Content-Disposition")?.match(/filename="?(.+?)"?$/)?.[1]||`${e.sessionName}_export.txt`,n=URL.createObjectURL(s),o=document.createElement("a");return o.href=n,o.download=decodeURIComponent(c),o.click(),URL.revokeObjectURL(n),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}onExportProgress(e){return()=>{}}async executeAiSQL(e){return a("/ai/debug/execute-sql",{sql:e})}async getAiSchema(){return r("/ai/debug/schema")}async clearDebugContext(){return a("/ai/debug/clear-debug-context",{})}async getToolCatalog(){try{return await r("/ai/tools/full-catalog")}catch{return r("/ai/tools/catalog")}}async executeTool(e,t,s,c){try{return await a("/ai/tools/execute",{testId:e,toolName:t,params:s,sessionId:c})}catch(n){return{success:!1,error:String(n)}}}async cancelToolTest(e){try{return await a("/ai/tools/cancel",{testId:e})}catch{return{success:!1}}}async getDefaultDesensitizeRules(e){try{return await r(`/ai/desensitize-rules/defaults?locale=${encodeURIComponent(e)}`)}catch{return[]}}async mergeDesensitizeRules(e,t,s={}){try{return await a("/ai/desensitize-rules/merge",{existingRules:e,locale:t,overrides:s})}catch{return e}}async showAiLogFile(){try{return await a("/ai/logs/show")}catch(e){return{success:!1,error:e instanceof Error?e.message:g}}}}export{p as FetchAIAdapter};
1
+ import{g as r,a,b as u,d as l,f as h}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";const g="This feature is not available in web mode";class p{async getAIChat(e){try{return await r(`/ai/chats/${e}`)}catch{return null}}async getAIChats(e){return r(`/ai/chats?sessionId=${encodeURIComponent(e)}`)}async createAIChat(e,t,s){return a("/ai/chats",{sessionId:e,title:t,assistantId:s})}async updateAIChatTitle(e,t){return u(`/ai/chats/${e}/title`,{title:t})}async deleteAIChat(e){return l(`/ai/chats/${e}`)}async getMessages(e){return r(`/ai/chats/${e}/messages`)}async addMessage(e,t,s,c,n,o,i){return a(`/ai/chats/${e}/messages`,{role:t,content:s,dataKeywords:c,dataMessageCount:n,contentBlocks:o,tokenUsage:i})}async deleteMessagesFrom(e,t){return a(`/ai/chats/${e}/messages/${t}/delete-from`,{})}async forkAIChat(e,t,s){return a(`/ai/chats/${e}/fork`,{upToMessageId:t,title:s})}async updateMessageContent(e,t){await u(`/ai/messages/${e}/content`,{content:t})}async deleteAndRelinkMessage(e,t){await a(`/ai/chats/${e}/messages/${t}/delete-relink`,{})}async insertMessageAfter(e,t,s,c,n,o){return a(`/ai/chats/${e}/messages/insert-after`,{afterMessageId:t,role:s,content:c,contentBlocks:n,tokenUsage:o})}async getAIChatTokenUsage(e){return r(`/ai/chats/${e}/token-usage`)}async estimateContextTokens(e){try{return await r(`/ai/chats/${e}/estimate-tokens`)}catch(t){return{success:!1,tokens:0,error:t instanceof Error?t.message:String(t)}}}async exportFilterResultToFile(e){try{const t=await h(`/_web/sessions/${e.sessionId}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionName:e.sessionName,format:e.format||"txt",timeFilter:e.timeFilter})});if(!t.ok)return{success:!1,error:(await t.json().catch(()=>null))?.error||`HTTP ${t.status}`};const s=await t.blob(),c=t.headers.get("Content-Disposition")?.match(/filename="?(.+?)"?$/)?.[1]||`${e.sessionName}_export.txt`,n=URL.createObjectURL(s),o=document.createElement("a");return o.href=n,o.download=decodeURIComponent(c),o.click(),URL.revokeObjectURL(n),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}onExportProgress(e){return()=>{}}async executeAiSQL(e){return a("/ai/debug/execute-sql",{sql:e})}async getAiSchema(){return r("/ai/debug/schema")}async clearDebugContext(){return a("/ai/debug/clear-debug-context",{})}async getToolCatalog(){try{return await r("/ai/tools/full-catalog")}catch{return r("/ai/tools/catalog")}}async executeTool(e,t,s,c){try{return await a("/ai/tools/execute",{testId:e,toolName:t,params:s,sessionId:c})}catch(n){return{success:!1,error:String(n)}}}async cancelToolTest(e){try{return await a("/ai/tools/cancel",{testId:e})}catch{return{success:!1}}}async getDefaultDesensitizeRules(e){try{return await r(`/ai/desensitize-rules/defaults?locale=${encodeURIComponent(e)}`)}catch{return[]}}async mergeDesensitizeRules(e,t,s={}){try{return await a("/ai/desensitize-rules/merge",{existingRules:e,locale:t,overrides:s})}catch{return e}}async showAiLogFile(){try{return await a("/ai/logs/show")}catch(e){return{success:!1,error:e instanceof Error?e.message:g}}}}export{p as FetchAIAdapter};
@@ -1 +1 @@
1
- import{g as t,a as e}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class h{async getInfo(){return t("/cache/info")}async clear(a){return e("/cache/clear",{cacheId:a})}async getDataDir(){return t("/cache/data-dir")}async setDataDir(a,r=!0){return e("/cache/data-dir",{path:a,migrate:r})}async getLatestImportLog(){return t("/cache/latest-import-log")}async saveToDownloads(a,r){return e("/cache/save-to-downloads",{filename:a,dataUrl:r})}async openDir(a){return e("/cache/open-dir",{cacheId:a})}async showInFolder(a){return e("/cache/show-in-folder",{filePath:a})}}export{h as FetchCacheAdapter};
1
+ import{g as t,a as e}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class h{async getInfo(){return t("/cache/info")}async clear(a){return e("/cache/clear",{cacheId:a})}async getDataDir(){return t("/cache/data-dir")}async setDataDir(a,r=!0){return e("/cache/data-dir",{path:a,migrate:r})}async getLatestImportLog(){return t("/cache/latest-import-log")}async saveToDownloads(a,r){return e("/cache/save-to-downloads",{filename:a,dataUrl:r})}async openDir(a){return e("/cache/open-dir",{cacheId:a})}async showInFolder(a){return e("/cache/show-in-folder",{filePath:a})}}export{h as FetchCacheAdapter};
@@ -1 +1 @@
1
- import{g as c,d as o,p as u,a as m,b as l,c as a}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";function n(g){if(!g)return"";const e=new URLSearchParams;g.startTs&&e.set("startTs",String(g.startTs)),g.endTs&&e.set("endTs",String(g.endTs)),g.memberId&&e.set("memberId",String(g.memberId));const s=e.toString();return s?`?${s}`:""}class p{getSessions(){return c("/sessions")}getSession(e){return c(`/sessions/${e}`)}async deleteSession(e){return(await o(`/sessions/${e}`)).success}async renameSession(e,s){return(await u(`/sessions/${e}/name`,{name:s})).success}async updateSessionOwnerId(e,s){return(await u(`/sessions/${e}/owner`,{ownerId:s})).success}tryApplyOwnerProfile(e){return m(`/sessions/${e}/owner/apply-profile`,{})}setOwnerAndApplyProfile(e,s){return m(`/sessions/${e}/owner/select`,{ownerPlatformId:s})}async dismissOwnerPrompt(e){return(await m(`/sessions/${e}/owner/dismiss-prompt`,{})).success}getContacts(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/contacts${t?`?${t}`:""}`)}getContactDetail(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/contacts/${encodeURIComponent(e)}/detail${r?`?${r}`:""}`)}recomputeContacts(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/contacts/recompute${t?`?${t}`:""}`,{})}async markContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await l(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}async unmarkContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await o(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}getPeopleRelationships(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/people/relationships${t?`?${t}`:""}`)}recomputePeopleRelationships(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/people/relationships/recompute${t?`?${t}`:""}`,{})}getPeopleRelationshipNeighborhood(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/people/relationships/${encodeURIComponent(e)}/neighborhood${r?`?${r}`:""}`)}getAvailableYears(e){return c(`/sessions/${e}/years`)}getTimeRange(e){return c(`/sessions/${e}/time-range`)}getMemberActivity(e,s){return a(`/sessions/${e}/stats/member-activity${n(s)}`)}getHourlyActivity(e,s){return a(`/sessions/${e}/stats/hourly${n(s)}`)}getDailyActivity(e,s){return a(`/sessions/${e}/stats/daily${n(s)}`)}getWeekdayActivity(e,s){return a(`/sessions/${e}/stats/weekday${n(s)}`)}getMonthlyActivity(e,s){return a(`/sessions/${e}/analytics/monthly-activity${n(s)}`)}getYearlyActivity(e,s){return a(`/sessions/${e}/analytics/yearly-activity${n(s)}`)}getMessageLengthDistribution(e,s){return a(`/sessions/${e}/analytics/message-length-distribution${n(s)}`)}getMessageTypeDistribution(e,s){return a(`/sessions/${e}/stats/message-types${n(s)}`)}getTextStats(e,s){return a(`/sessions/${e}/analytics/text-stats${n(s)}`)}getLongMessageCount(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t!=null&&r.set("minLength",String(t));const i=r.toString();return a(`/sessions/${e}/analytics/long-message-count${i?`?${i}`:""}`)}getMemberMonthlyTrend(e,s){return a(`/sessions/${e}/analytics/member-monthly-trend${n(s)}`)}getTextLengthPercentiles(e,s){return a(`/sessions/${e}/analytics/text-length-percentiles${n(s)}`)}getDragonKingAnalysis(e,s){return a(`/sessions/${e}/analytics/dragon-king${n(s)}`)}getDivingAnalysis(e,s){return a(`/sessions/${e}/analytics/diving${n(s)}`)}getCheckInAnalysis(e,s){return a(`/sessions/${e}/analytics/check-in${n(s)}`)}getMemeBattleAnalysis(e,s){return a(`/sessions/${e}/analytics/meme-battle${n(s)}`)}getNightOwlAnalysis(e,s){return a(`/sessions/${e}/analytics/night-owl${n(s)}`)}getRepeatAnalysis(e,s){return a(`/sessions/${e}/analytics/repeat${n(s)}`)}getMembers(e){return c(`/sessions/${e}/members`)}getMembersPaginated(e,s){const t=new URLSearchParams({page:String(s.page),pageSize:String(s.pageSize)});return s.search&&t.set("search",s.search),s.sortOrder&&t.set("sortOrder",s.sortOrder),c(`/sessions/${e}/members/paginated?${t}`)}getMemberNameHistory(e,s){return c(`/sessions/${e}/members/${s}/history`)}async updateMemberAliases(e,s,t){return(await u(`/sessions/${e}/members/${s}/aliases`,{aliases:t})).success}async mergeMembers(e,s,t){return(await m(`/sessions/${e}/members/merge`,{memberId1:s,memberId2:t})).success}async deleteMember(e,s){return(await o(`/sessions/${e}/members/${s}`)).success}getCatchphraseAnalysis(e,s){return a(`/sessions/${e}/analytics/catchphrase${n(s)}`)}getLanguagePreferenceAnalysis(e,s,t,r){const i=new URLSearchParams;return i.set("locale",s),t?.startTs&&i.set("startTs",String(t.startTs)),t?.endTs&&i.set("endTs",String(t.endTs)),t?.memberId&&i.set("memberId",String(t.memberId)),a(`/sessions/${e}/analytics/language-preference?${i}`)}getMentionAnalysis(e,s){return a(`/sessions/${e}/analytics/mention${n(s)}`)}getMentionGraph(e,s){return a(`/sessions/${e}/analytics/mention-graph${n(s)}`)}getClusterGraph(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t?.topEdges&&r.set("topEdges",String(t.topEdges)),t?.lookAhead&&r.set("lookAhead",String(t.lookAhead)),t?.decaySeconds&&r.set("decaySeconds",String(t.decaySeconds));const i=r.toString();return a(`/sessions/${e}/analytics/cluster${i?`?${i}`:""}`)}getLaughAnalysis(e,s,t){return a(`/sessions/${e}/analytics/laugh${n(s)}`)}getRelationshipStats(e,s,t){return a(`/sessions/${e}/analytics/relationship${n(s)}`)}executeSQL(e,s){return m(`/sessions/${e}/sql`,{sql:s})}getSchema(e){return c(`/sessions/${e}/schema`)}pluginQuery(e,s,t){return m(`/sessions/${e}/query`,{sql:s,params:t??[]})}}export{p as FetchDataAdapter};
1
+ import{g as c,d as o,p as u,a as m,b as l,c as a}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";function n(g){if(!g)return"";const e=new URLSearchParams;g.startTs&&e.set("startTs",String(g.startTs)),g.endTs&&e.set("endTs",String(g.endTs)),g.memberId&&e.set("memberId",String(g.memberId));const s=e.toString();return s?`?${s}`:""}class p{getSessions(){return c("/sessions")}getSession(e){return c(`/sessions/${e}`)}async deleteSession(e){return(await o(`/sessions/${e}`)).success}async renameSession(e,s){return(await u(`/sessions/${e}/name`,{name:s})).success}async updateSessionOwnerId(e,s){return(await u(`/sessions/${e}/owner`,{ownerId:s})).success}tryApplyOwnerProfile(e){return m(`/sessions/${e}/owner/apply-profile`,{})}setOwnerAndApplyProfile(e,s){return m(`/sessions/${e}/owner/select`,{ownerPlatformId:s})}async dismissOwnerPrompt(e){return(await m(`/sessions/${e}/owner/dismiss-prompt`,{})).success}getContacts(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/contacts${t?`?${t}`:""}`)}getContactDetail(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/contacts/${encodeURIComponent(e)}/detail${r?`?${r}`:""}`)}recomputeContacts(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/contacts/recompute${t?`?${t}`:""}`,{})}async markContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await l(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}async unmarkContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await o(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}getPeopleRelationships(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/people/relationships${t?`?${t}`:""}`)}recomputePeopleRelationships(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/people/relationships/recompute${t?`?${t}`:""}`,{})}getPeopleRelationshipNeighborhood(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/people/relationships/${encodeURIComponent(e)}/neighborhood${r?`?${r}`:""}`)}getAvailableYears(e){return c(`/sessions/${e}/years`)}getTimeRange(e){return c(`/sessions/${e}/time-range`)}getMemberActivity(e,s){return a(`/sessions/${e}/stats/member-activity${n(s)}`)}getHourlyActivity(e,s){return a(`/sessions/${e}/stats/hourly${n(s)}`)}getDailyActivity(e,s){return a(`/sessions/${e}/stats/daily${n(s)}`)}getWeekdayActivity(e,s){return a(`/sessions/${e}/stats/weekday${n(s)}`)}getMonthlyActivity(e,s){return a(`/sessions/${e}/analytics/monthly-activity${n(s)}`)}getYearlyActivity(e,s){return a(`/sessions/${e}/analytics/yearly-activity${n(s)}`)}getMessageLengthDistribution(e,s){return a(`/sessions/${e}/analytics/message-length-distribution${n(s)}`)}getMessageTypeDistribution(e,s){return a(`/sessions/${e}/stats/message-types${n(s)}`)}getTextStats(e,s){return a(`/sessions/${e}/analytics/text-stats${n(s)}`)}getLongMessageCount(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t!=null&&r.set("minLength",String(t));const i=r.toString();return a(`/sessions/${e}/analytics/long-message-count${i?`?${i}`:""}`)}getMemberMonthlyTrend(e,s){return a(`/sessions/${e}/analytics/member-monthly-trend${n(s)}`)}getTextLengthPercentiles(e,s){return a(`/sessions/${e}/analytics/text-length-percentiles${n(s)}`)}getDragonKingAnalysis(e,s){return a(`/sessions/${e}/analytics/dragon-king${n(s)}`)}getDivingAnalysis(e,s){return a(`/sessions/${e}/analytics/diving${n(s)}`)}getCheckInAnalysis(e,s){return a(`/sessions/${e}/analytics/check-in${n(s)}`)}getMemeBattleAnalysis(e,s){return a(`/sessions/${e}/analytics/meme-battle${n(s)}`)}getNightOwlAnalysis(e,s){return a(`/sessions/${e}/analytics/night-owl${n(s)}`)}getRepeatAnalysis(e,s){return a(`/sessions/${e}/analytics/repeat${n(s)}`)}getMembers(e){return c(`/sessions/${e}/members`)}getMembersPaginated(e,s){const t=new URLSearchParams({page:String(s.page),pageSize:String(s.pageSize)});return s.search&&t.set("search",s.search),s.sortOrder&&t.set("sortOrder",s.sortOrder),c(`/sessions/${e}/members/paginated?${t}`)}getMemberNameHistory(e,s){return c(`/sessions/${e}/members/${s}/history`)}async updateMemberAliases(e,s,t){return(await u(`/sessions/${e}/members/${s}/aliases`,{aliases:t})).success}async mergeMembers(e,s,t){return(await m(`/sessions/${e}/members/merge`,{memberId1:s,memberId2:t})).success}async deleteMember(e,s){return(await o(`/sessions/${e}/members/${s}`)).success}getCatchphraseAnalysis(e,s){return a(`/sessions/${e}/analytics/catchphrase${n(s)}`)}getLanguagePreferenceAnalysis(e,s,t,r){const i=new URLSearchParams;return i.set("locale",s),t?.startTs&&i.set("startTs",String(t.startTs)),t?.endTs&&i.set("endTs",String(t.endTs)),t?.memberId&&i.set("memberId",String(t.memberId)),a(`/sessions/${e}/analytics/language-preference?${i}`)}getMentionAnalysis(e,s){return a(`/sessions/${e}/analytics/mention${n(s)}`)}getMentionGraph(e,s){return a(`/sessions/${e}/analytics/mention-graph${n(s)}`)}getClusterGraph(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t?.topEdges&&r.set("topEdges",String(t.topEdges)),t?.lookAhead&&r.set("lookAhead",String(t.lookAhead)),t?.decaySeconds&&r.set("decaySeconds",String(t.decaySeconds));const i=r.toString();return a(`/sessions/${e}/analytics/cluster${i?`?${i}`:""}`)}getLaughAnalysis(e,s,t){return a(`/sessions/${e}/analytics/laugh${n(s)}`)}getRelationshipStats(e,s,t){return a(`/sessions/${e}/analytics/relationship${n(s)}`)}executeSQL(e,s){return m(`/sessions/${e}/sql`,{sql:s})}getSchema(e){return c(`/sessions/${e}/schema`)}pluginQuery(e,s,t){return m(`/sessions/${e}/query`,{sql:s,params:t??[]})}}export{p as FetchDataAdapter};
@@ -1 +1 @@
1
- import{g as s,b as o,a as r,d as i}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class f{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(t,e){return o("/ai/llm/default-assistant-slot",{configId:t,modelId:e})}async setFastModel(t){return o("/ai/llm/fast-model-slot",t)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(t){return r("/ai/llm/configs",t)}async updateConfig(t,e){return o(`/ai/llm/configs/${t}`,e)}async deleteConfig(t){return i(`/ai/llm/configs/${t}`)}async validateApiKey(t,e,a,l,n,m){return r("/ai/llm/validate-key",{provider:t,apiKey:e,baseUrl:a,model:l,apiFormat:n,configId:m})}async fetchRemoteModels(t,e,a,l,n){return r("/ai/llm/remote-models",{provider:t,apiKey:e,baseUrl:a,apiFormat:l,configId:n})}async addCustomProvider(t){return r("/ai/llm/custom-providers",t)}async updateCustomProvider(t,e){return o(`/ai/llm/custom-providers/${t}`,e)}async deleteCustomProvider(t){return i(`/ai/llm/custom-providers/${t}`)}async addCustomModel(t){return r("/ai/llm/custom-models",t)}async updateCustomModel(t,e,a){return o(`/ai/llm/custom-models/${t}/${encodeURIComponent(e)}`,a)}async deleteCustomModel(t,e){return i(`/ai/llm/custom-models/${t}/${encodeURIComponent(e)}`)}}export{f as FetchLLMAdapter};
1
+ import{g as s,b as o,a as r,d as i}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class f{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(t,e){return o("/ai/llm/default-assistant-slot",{configId:t,modelId:e})}async setFastModel(t){return o("/ai/llm/fast-model-slot",t)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(t){return r("/ai/llm/configs",t)}async updateConfig(t,e){return o(`/ai/llm/configs/${t}`,e)}async deleteConfig(t){return i(`/ai/llm/configs/${t}`)}async validateApiKey(t,e,a,l,n,m){return r("/ai/llm/validate-key",{provider:t,apiKey:e,baseUrl:a,model:l,apiFormat:n,configId:m})}async fetchRemoteModels(t,e,a,l,n){return r("/ai/llm/remote-models",{provider:t,apiKey:e,baseUrl:a,apiFormat:l,configId:n})}async addCustomProvider(t){return r("/ai/llm/custom-providers",t)}async updateCustomProvider(t,e){return o(`/ai/llm/custom-providers/${t}`,e)}async deleteCustomProvider(t){return i(`/ai/llm/custom-providers/${t}`)}async addCustomModel(t){return r("/ai/llm/custom-models",t)}async updateCustomModel(t,e,a){return o(`/ai/llm/custom-models/${t}/${encodeURIComponent(e)}`,a)}async deleteCustomModel(t,e){return i(`/ai/llm/custom-models/${t}/${encodeURIComponent(e)}`)}}export{f as FetchLLMAdapter};
@@ -1 +1 @@
1
- import{g as r,p as n}from"./index-CdsKtFEJ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class f{getPreferences(){return r("/preferences")}savePreferences(e){return n("/preferences",e)}getUiConfig(){return r("/preferences/ui-config")}saveUiConfig(e){return n("/preferences/ui-config",e)}async getLocale(){return(await r("/preferences/locale")).lang}saveLocale(e){return n("/preferences/locale",{lang:e})}}export{f as FetchPreferencesAdapter};
1
+ import{g as r,p as n}from"./index-CqUuHQBQ.js";import"./vendor-reka-ui-CzM4kDQ7.js";import"./vendor-nuxt-ui-DaLxYaC4.js";import"./vendor-snapdom-XnBoh1gd.js";class f{getPreferences(){return r("/preferences")}savePreferences(e){return n("/preferences",e)}getUiConfig(){return r("/preferences/ui-config")}saveUiConfig(e){return n("/preferences/ui-config",e)}async getLocale(){return(await r("/preferences/locale")).lang}saveLocale(e){return n("/preferences/locale",{lang:e})}}export{f as FetchPreferencesAdapter};
@@ -1 +1 @@
1
- import{_ as B,R as P,g as R,c as V,e as $}from"./vendor-nuxt-ui-DaLxYaC4.js";import{p as k,G as a,P as s,u as e,Z as h,a3 as v,H as m,K as r,L as d,a5 as p,T as u,Q as y,h as g,U as _,R as H,by as I,I as N}from"./vendor-reka-ui-CzM4kDQ7.js";import{u as w,_ as z}from"./index-CdsKtFEJ.js";import{P as L}from"./PageHeader-CUwv2AFR.js";import{p as S}from"./people-page-header-Mupn-U_b.js";import"./vendor-snapdom-XnBoh1gd.js";const T=["aria-label"],U={class:"whitespace-nowrap"},D=k({__name:"PeopleSubnav",props:{active:{}},setup(x){const o=x,{t:c}=w(),l=g(()=>[{id:"contacts",label:c("contacts.title"),icon:"i-lucide-users",to:{name:"people-contacts"}},{id:"relationships",label:c("relationships.title"),icon:"i-lucide-git-fork",to:{name:"people-relationships"}}]);return(f,t)=>{const b=B;return a(),s("nav",{class:"flex shrink-0 items-center gap-0.5 overflow-x-auto scrollbar-hide","aria-label":e(c)("relationships.nav")},[(a(!0),s(h,null,v(l.value,i=>(a(),m(e(P),{key:i.id,to:i.to,class:y(["flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",o.active===i.id?"bg-pink-500 text-white dark:bg-pink-900/30 dark:text-pink-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white"])},{default:r(()=>[d(b,{name:i.icon,class:"h-3.5 w-3.5"},null,8,["name"]),p("span",U,u(i.label),1)]),_:2},1032,["to","class"]))),128))],8,T)}}}),j={class:"flex h-full flex-col bg-white text-gray-900 dark:bg-page-dark dark:text-gray-100",style:{"padding-top":"var(--titlebar-area-height)"}},E={class:"mt-3 flex items-center justify-between gap-3 pb-1.5"},F={key:0,class:"hidden items-center gap-5 text-[11px] sm:flex"},G={key:0,class:"h-3 w-px bg-gray-250 dark:bg-white/10"},K={class:"flex items-center gap-1.5"},Q={class:"text-gray-400 dark:text-gray-500"},Z={class:"font-mono font-bold text-gray-900 dark:text-white"},q=k({__name:"index",setup(x){const{t:o}=w(),c=$(),l=g(()=>c.name==="people-relationships"?"relationships":"contacts"),f=g(()=>l.value==="relationships"?{title:o("layout.relationships"),description:o("relationships.subtitle"),icon:"i-lucide-git-fork",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm"}:{title:o("layout.relationships"),description:o("contacts.subtitle",{count:0}),icon:"i-lucide-users",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm"}),{header:t}=S(f);return(b,i)=>{const C=V;return a(),s("div",j,[d(L,{title:e(t).title,description:e(t).description,size:"compact",icon:e(t).icon,"icon-class":e(t).iconClass},{actions:r(()=>[e(t).action?(a(),m(C,{key:0,icon:e(t).action.icon,color:"primary",variant:"soft",size:"sm",class:y(["rounded-xl",e(t).action.class]),loading:e(t).action.loading,disabled:e(t).action.disabled,onClick:e(t).action.onClick},{default:r(()=>[H(u(e(t).action.label),1)]),_:1},8,["icon","class","loading","disabled","onClick"])):_("",!0)]),default:r(()=>[p("div",E,[d(D,{active:l.value},null,8,["active"]),e(t).stats?.length?(a(),s("div",F,[(a(!0),s(h,null,v(e(t).stats,n=>(a(),s(h,{key:n.id},[n.dividerBefore?(a(),s("div",G)):_("",!0),p("div",K,[p("span",Q,u(n.label),1),p("span",Z,u(n.value),1)])],64))),128))])):_("",!0)])]),_:1},8,["title","description","icon","icon-class"]),d(e(R),null,{default:r(({Component:n})=>[d(I,{name:"people-tab-slide",mode:"out-in"},{default:r(()=>[(a(),m(N(n),{key:l.value}))]),_:2},1024)]),_:1})])}}}),Y=z(q,[["__scopeId","data-v-19e6af8b"]]);export{Y as default};
1
+ import{_ as B,R as P,g as R,c as V,e as $}from"./vendor-nuxt-ui-DaLxYaC4.js";import{p as k,G as a,P as s,u as e,Z as h,a3 as v,H as m,K as r,L as d,a5 as p,T as u,Q as y,h as g,U as _,R as H,by as I,I as N}from"./vendor-reka-ui-CzM4kDQ7.js";import{u as w,_ as z}from"./index-CqUuHQBQ.js";import{P as L}from"./PageHeader-CZaqOdBQ.js";import{p as S}from"./people-page-header-Mupn-U_b.js";import"./vendor-snapdom-XnBoh1gd.js";const T=["aria-label"],U={class:"whitespace-nowrap"},D=k({__name:"PeopleSubnav",props:{active:{}},setup(x){const o=x,{t:c}=w(),l=g(()=>[{id:"contacts",label:c("contacts.title"),icon:"i-lucide-users",to:{name:"people-contacts"}},{id:"relationships",label:c("relationships.title"),icon:"i-lucide-git-fork",to:{name:"people-relationships"}}]);return(f,t)=>{const b=B;return a(),s("nav",{class:"flex shrink-0 items-center gap-0.5 overflow-x-auto scrollbar-hide","aria-label":e(c)("relationships.nav")},[(a(!0),s(h,null,v(l.value,i=>(a(),m(e(P),{key:i.id,to:i.to,class:y(["flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",o.active===i.id?"bg-pink-500 text-white dark:bg-pink-900/30 dark:text-pink-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white"])},{default:r(()=>[d(b,{name:i.icon,class:"h-3.5 w-3.5"},null,8,["name"]),p("span",U,u(i.label),1)]),_:2},1032,["to","class"]))),128))],8,T)}}}),j={class:"flex h-full flex-col bg-white text-gray-900 dark:bg-page-dark dark:text-gray-100",style:{"padding-top":"var(--titlebar-area-height)"}},E={class:"mt-3 flex items-center justify-between gap-3 pb-1.5"},F={key:0,class:"hidden items-center gap-5 text-[11px] sm:flex"},G={key:0,class:"h-3 w-px bg-gray-250 dark:bg-white/10"},K={class:"flex items-center gap-1.5"},Q={class:"text-gray-400 dark:text-gray-500"},Z={class:"font-mono font-bold text-gray-900 dark:text-white"},q=k({__name:"index",setup(x){const{t:o}=w(),c=$(),l=g(()=>c.name==="people-relationships"?"relationships":"contacts"),f=g(()=>l.value==="relationships"?{title:o("layout.relationships"),description:o("relationships.subtitle"),icon:"i-lucide-git-fork",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm"}:{title:o("layout.relationships"),description:o("contacts.subtitle",{count:0}),icon:"i-lucide-users",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm"}),{header:t}=S(f);return(b,i)=>{const C=V;return a(),s("div",j,[d(L,{title:e(t).title,description:e(t).description,size:"compact",icon:e(t).icon,"icon-class":e(t).iconClass},{actions:r(()=>[e(t).action?(a(),m(C,{key:0,icon:e(t).action.icon,color:"primary",variant:"soft",size:"sm",class:y(["rounded-xl",e(t).action.class]),loading:e(t).action.loading,disabled:e(t).action.disabled,onClick:e(t).action.onClick},{default:r(()=>[H(u(e(t).action.label),1)]),_:1},8,["icon","class","loading","disabled","onClick"])):_("",!0)]),default:r(()=>[p("div",E,[d(D,{active:l.value},null,8,["active"]),e(t).stats?.length?(a(),s("div",F,[(a(!0),s(h,null,v(e(t).stats,n=>(a(),s(h,{key:n.id},[n.dividerBefore?(a(),s("div",G)):_("",!0),p("div",K,[p("span",Q,u(n.label),1),p("span",Z,u(n.value),1)])],64))),128))])):_("",!0)])]),_:1},8,["title","description","icon","icon-class"]),d(e(R),null,{default:r(({Component:n})=>[d(I,{name:"people-tab-slide",mode:"out-in"},{default:r(()=>[(a(),m(N(n),{key:l.value}))]),_:2},1024)]),_:1})])}}}),Y=z(q,[["__scopeId","data-v-19e6af8b"]]);export{Y as default};
@@ -1 +1 @@
1
- import{c as be,_ as _e,i as $t,h as It,d as Pt,u as Ft}from"./vendor-nuxt-ui-DaLxYaC4.js";import{u as Se,_ as De,j as Mt,m as zt,o as At,q as Nt,C as Et}from"./index-CdsKtFEJ.js";import{p as we,H as fe,K as T,by as Bt,G as c,P as f,a5 as a,T as o,u as r,L as h,Z as O,a3 as ke,U as E,R as J,h as u,bB as jt,w as U,d as Vt,F as Gt,a0 as X,Q as H,b as x,au as Dt,n as je}from"./vendor-reka-ui-CzM4kDQ7.js";import{_ as Ut}from"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import{u as Ht}from"./people-page-header-Mupn-U_b.js";import"./vendor-snapdom-XnBoh1gd.js";const Ot={key:0,class:"flex h-full w-[420px] max-w-[80vw] shrink-0 flex-col border-l border-gray-200 bg-white dark:border-gray-800 dark:bg-page-dark",style:{"-webkit-app-region":"no-drag"}},Rt={class:"flex items-center justify-between border-b border-gray-200 px-4 py-3 dark:border-gray-800"},qt={class:"text-base font-semibold text-gray-900 dark:text-white"},Kt={key:0,class:"flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-gray-400 dark:text-gray-500"},Yt={key:1,class:"min-h-0 flex-1 overflow-y-auto"},Qt={class:"px-5 py-5"},Wt={class:"flex items-start gap-4"},Zt={class:"relative shrink-0"},Xt=["src","alt"],Jt={key:1,class:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-gray-155 to-gray-200 text-lg font-bold text-gray-700 dark:from-gray-800 dark:to-page-dark dark:text-gray-200"},ea={class:"min-w-0 flex-1 pt-1"},ta={class:"truncate text-lg font-bold tracking-tight text-gray-900 dark:text-white"},aa={class:"mt-1 truncate font-mono text-xs text-gray-400 dark:text-gray-500"},na={key:0,class:"mt-2 flex flex-wrap gap-1.5"},sa={key:1,class:"mt-3 flex flex-wrap items-center gap-2"},oa={class:"border-t border-gray-100 px-5 py-4 dark:border-white/5"},ra={class:"mb-3 text-[10px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500"},ia={class:"space-y-2.5"},la={class:"flex items-center justify-between gap-2"},ca={class:"truncate text-xs font-semibold text-gray-700 dark:text-gray-300"},da={class:"flex items-center gap-1 text-[10px] font-bold text-gray-400 transition group-hover/item:text-pink-500 dark:text-gray-500"},ua={class:"mt-1.5 truncate text-[11px] font-medium text-gray-400 dark:text-gray-500"},fa={class:"mt-2 flex flex-wrap gap-1.5"},pa=we({__name:"ContactDetailPanel",props:{selectedKey:{},contact:{},isLoading:{type:Boolean},isFriendActionLoading:{type:Boolean}},emits:["clear","openSource","viewSourceRecords","markFriend","unmarkFriend"],setup(n,{emit:s}){const k=n,S=s,{t:C}=Se(),A=u(()=>{const m=k.contact;if(!m)return[];const v=new Set([m.displayName.trim().toLowerCase(),m.platformId.trim().toLowerCase()]);return m.aliases.filter(w=>!v.has(w.trim().toLowerCase()))}),I=u(()=>k.contact?.pool==="non_friend"),P=u(()=>k.contact?.friendSource==="manual"),B=u(()=>I.value||P.value);function F(m){return m.displayName.trim().slice(0,1).toUpperCase()||"?"}return(m,v)=>{const w=be,R=_e;return c(),fe(Bt,{name:"contact-detail-panel"},{default:T(()=>[n.selectedKey?(c(),f("aside",Ot,[a("div",Rt,[a("h3",qt,o(r(C)("contacts.detail.title")),1),h(w,{"aria-label":r(C)("contacts.actions.clearSelection"),icon:"i-heroicons-x-mark",color:"neutral",variant:"ghost",size:"sm",onClick:v[0]||(v[0]=y=>S("clear"))},null,8,["aria-label"])]),n.isLoading?(c(),f("div",Kt,[h(R,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(C)("common.loading")),1)])):n.contact?(c(),f("div",Yt,[a("section",Qt,[a("div",Wt,[a("div",Zt,[n.contact.avatar?(c(),f("img",{key:0,src:n.contact.avatar,alt:n.contact.displayName,loading:"lazy",decoding:"async",class:"h-16 w-16 rounded-2xl object-cover shadow-sm ring-2 ring-white dark:ring-page-dark"},null,8,Xt)):(c(),f("div",Jt,o(F(n.contact)),1))]),a("div",ea,[a("h2",ta,o(n.contact.displayName),1),a("p",aa,o(n.contact.platform)+" · "+o(n.contact.platformId),1),A.value.length>0?(c(),f("div",na,[(c(!0),f(O,null,ke(A.value.slice(0,4),y=>(c(),f("span",{key:y,class:"max-w-full truncate rounded-md bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-500 dark:bg-white/5 dark:text-gray-400"},o(y),1))),128))])):E("",!0),B.value?(c(),f("div",sa,[I.value?(c(),fe(w,{key:0,icon:"i-lucide-user-plus",color:"primary",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[1]||(v[1]=y=>S("markFriend"))},{default:T(()=>[J(o(r(C)("contacts.actions.markFriend")),1)]),_:1},8,["loading"])):P.value?(c(),fe(w,{key:1,icon:"i-lucide-user-minus",color:"neutral",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[2]||(v[2]=y=>S("unmarkFriend"))},{default:T(()=>[J(o(r(C)("contacts.actions.unmarkFriend")),1)]),_:1},8,["loading"])):E("",!0)])):E("",!0)])])]),a("section",oa,[a("h3",ra,o(r(C)("contacts.detail.sources")),1),a("div",ia,[(c(!0),f(O,null,ke(n.contact.sourceSessions,y=>(c(),f("div",{key:y.id,class:"w-full rounded-2xl border border-gray-100 bg-white/40 px-3.5 py-3 text-left transition duration-300 hover:border-gray-200 hover:shadow-sm dark:border-white/5 dark:bg-page-dark/10 dark:hover:border-white/10"},[a("div",la,[a("span",ca,o(y.name),1),a("span",da,o(y.type==="private"?r(C)("contacts.detail.sourceType.private"):r(C)("contacts.detail.sourceType.group")),1)]),a("div",ua,o(y.privateMessageCount!=null?r(C)("contacts.metrics.privateMessages",{count:y.privateMessageCount}):r(C)("contacts.metrics.groupSignals",{count:y.coOccurrenceCount??0})),1),a("div",fa,[h(w,{icon:"i-lucide-arrow-up-right",color:"primary",variant:"soft",size:"xs",onClick:j=>S("openSource",y)},{default:T(()=>[J(o(r(C)("contacts.actions.openSourceSession")),1)]),_:1},8,["onClick"]),h(w,{icon:"i-lucide-messages-square",color:"primary",variant:"soft",size:"xs",onClick:j=>S("viewSourceRecords",y)},{default:T(()=>[J(o(r(C)("contacts.actions.viewSourceRecords")),1)]),_:1},8,["onClick"])])]))),128))])])])):E("",!0)])):E("",!0)]),_:1})}}}),ma=De(pa,[["__scopeId","data-v-ec47ac84"]]),ga={key:0,class:"flex items-center gap-3.5 rounded-2xl border border-amber-200/60 bg-amber-50/40 p-4 text-sm text-amber-800 dark:border-amber-900/40 dark:bg-amber-950/10 dark:text-amber-200 backdrop-blur-sm shadow-sm"},va={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-amber-100/80 dark:bg-amber-950/50"},ya={class:"font-medium"},xa={key:1,class:"flex flex-col gap-4 rounded-2xl border border-zinc-200/80 bg-zinc-50/60 p-4 text-sm text-zinc-700 dark:border-zinc-800/80 dark:bg-page-dark/40 dark:text-zinc-300 sm:flex-row sm:items-center sm:justify-between backdrop-blur-sm shadow-sm"},ha={class:"flex items-center gap-3.5"},ka={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-zinc-100 dark:bg-zinc-800/80"},ba={class:"font-medium"},_a={class:"flex items-center shrink-0 self-end sm:self-center"},Sa={key:2,class:"flex flex-col gap-4 rounded-2xl border border-red-200/60 bg-red-50/40 p-4 text-sm text-red-700 dark:border-red-900/40 dark:bg-red-950/10 dark:text-red-300 sm:flex-row sm:items-center sm:justify-between backdrop-blur-sm shadow-sm"},wa={class:"flex min-w-0 items-center gap-3.5"},Ca={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-red-100/80 dark:bg-red-950/50"},Ta={class:"truncate font-medium"},La={class:"flex items-center shrink-0 self-end sm:self-center"},$a=we({__name:"ContactsStatusBlocks",props:{showDisabledNotice:{type:Boolean},activePrivateSessionCount:{},cacheStatus:{},taskFailed:{type:Boolean},taskLastError:{},isTaskRunning:{type:Boolean},isRecomputing:{type:Boolean}},emits:["recompute"],setup(n,{emit:s}){const k=s,{t:S}=Se();return(C,A)=>{const I=_e,P=be;return c(),f(O,null,[n.showDisabledNotice?(c(),f("div",ga,[a("div",va,[h(I,{name:"i-lucide-alert-triangle",class:"h-5 w-5 text-amber-500"})]),a("span",ya,o(r(S)("contacts.disabled",{count:n.activePrivateSessionCount})),1)])):E("",!0),n.cacheStatus==="stale"&&!n.isTaskRunning?(c(),f("div",xa,[a("div",ha,[a("div",ka,[h(I,{name:"i-lucide-history",class:"h-5 w-5 text-zinc-500 dark:text-zinc-400"})]),a("span",ba,o(r(S)("contacts.stale.inline")),1)]),a("div",_a,[h(P,{size:"sm",color:"primary",variant:"soft",class:"rounded-xl px-4 font-medium",loading:n.isRecomputing||n.isTaskRunning,disabled:n.isTaskRunning,onClick:A[0]||(A[0]=B=>k("recompute"))},{default:T(()=>[J(o(r(S)("contacts.actions.recompute")),1)]),_:1},8,["loading","disabled"])])])):E("",!0),n.taskFailed?(c(),f("div",Sa,[a("div",wa,[a("div",Ca,[h(I,{name:"i-lucide-alert-circle",class:"h-5 w-5 text-red-500"})]),a("span",Ta,o(n.taskLastError||r(S)("contacts.task.failed")),1)]),a("div",La,[h(P,{size:"sm",color:"error",variant:"soft",class:"rounded-xl px-4 font-medium",onClick:A[1]||(A[1]=B=>k("recompute"))},{default:T(()=>[J(o(r(S)("contacts.task.retry")),1)]),_:1})])])):E("",!0)],64)}}});function Ia(n){return!!n.diagnostics&&!n.showLoadingState&&!n.diagnostics.contactsEnabled}function Pa(n){return n.previousScrollTop}function Ve(n){return n!=="friend"}function Fa(n){return n.friendInitialLoading||n.groupmateInitialLoading}function Ma(n){return n.activeSection==="non_friend"||n.friendSectionReady}function za(n){return n.friendInitialLoading||n.groupmateInitialLoading||n.completionProgressVisible===!0||n.activeTaskStatus==="running"||n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"}function Aa(n){return n.previousStatus==="running"&&n.nextStatus==="succeeded"&&n.nextTotalSessions>0&&n.nextProcessedSessions>=n.nextTotalSessions&&n.previousProcessedSessions<n.nextTotalSessions}function Na(n){return n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"?["friend","non_friend"]:[n.activePool]}function Ea(n){const s=[{type:"section",key:"section:friend",pool:"friend"}];return s.push(...n.friends.map(k=>({type:"contact",key:k.key,pool:"friend",contact:k}))),n.friendLoadingMore&&s.push({type:"loading",key:"loading:friend",pool:"friend"}),n.showGroupSection&&(s.push({type:"section",key:"section:non_friend",pool:"non_friend"}),s.push(...n.groupmates.map(k=>({type:"contact",key:k.key,pool:"non_friend",contact:k}))),n.groupmateLoadingMore&&s.push({type:"loading",key:"loading:non_friend",pool:"non_friend"})),s}const Ba={class:"flex min-h-0 flex-1 flex-col bg-white text-gray-900 dark:bg-page-dark dark:text-gray-100"},ja={class:"flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2 px-3 py-2 lg:px-0 lg:py-0"},Va={class:"flex min-h-0 flex-1 overflow-hidden"},Ga={class:"mx-auto flex w-full max-w-[1800px] flex-col gap-6 px-6 pb-6 pt-0 lg:px-8"},Da={class:"flex flex-col gap-4"},Ua={key:1,class:"rounded-2xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-700 dark:border-red-900/30 dark:bg-red-950/20 dark:text-red-300"},Ha={key:2,class:"min-h-0"},Oa={key:0,class:"flex flex-col items-center justify-center rounded-3xl border border-dashed border-gray-250 p-16 text-center dark:border-white/5"},Ra={class:"flex h-12 w-12 items-center justify-center rounded-2xl bg-gray-50 text-gray-400 dark:bg-white/5 dark:text-gray-500"},qa={class:"mt-4 text-sm font-medium text-gray-400 dark:text-gray-500"},Ka={key:1,class:"min-w-0"},Ya={class:"sticky top-0 z-20 overflow-hidden border-b border-gray-100 bg-white dark:border-gray-800/40 dark:bg-page-dark"},Qa={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Wa={class:"truncate"},Za={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},Xa={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Ja={class:"truncate"},en={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},tn=["aria-label","onClick"],an={class:"group flex min-w-0 w-full items-center gap-3"},nn={class:"relative shrink-0 overflow-hidden rounded-lg"},sn=["src","alt"],on={key:1,class:"flex h-10 w-10 items-center justify-center bg-gradient-to-br from-gray-50 to-gray-100 text-sm font-bold text-gray-500 transition-transform duration-300 group-hover:scale-105 dark:from-gray-800 dark:to-gray-800/60 dark:text-gray-400"},rn={class:"min-w-0 flex-1"},ln={class:"flex min-w-0 items-center gap-1"},cn={class:"mt-1 inline-flex items-center rounded bg-gray-50 px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase tracking-wider text-gray-400 dark:bg-white/5 dark:text-gray-500"},dn={class:"contact-table-value"},un={class:"contact-table-value"},fn={class:"contact-table-value"},pn={class:"contact-table-value"},mn=100,Ge=69,gn=20,vn=we({__name:"index",setup(n){const{t:s}=Se(),k=Mt(),S=zt(),C=At(),A=Ft(),I=x(!1),P=x(""),B=x(""),F=x("1y"),m=x("friend"),v=x(null),w=x(null),R=x(!1),y=x(!1),j=x(null),pe=x(!1),q=x(null),ee=x(null),te=x(null),M=x(null),ae={friend:null,non_friend:null},K=x(!1),Y=x(null),ne=x(null),Ce=x(0),se=x({});function me(){return{items:[],response:null,page:0,total:0,hasMore:!1,isLoadingInitial:!1,isLoadingMore:!1,error:"",requestId:0,scrollOffset:0}}const V=x({friend:me(),non_friend:me()}),ie=u(()=>V.value[m.value]),b=u(()=>V.value.friend),p=u(()=>V.value.non_friend),Te=u(()=>!!b.value.response&&!b.value.hasMore&&!b.value.isLoadingInitial),ge=u(()=>Ma({activeSection:m.value,friendSectionReady:Te.value,groupmateHasItems:p.value.items.length>0,groupmateLoading:p.value.isLoadingInitial||p.value.isLoadingMore})),N=u(()=>Ea({friends:b.value.items,groupmates:p.value.items,showGroupSection:ge.value,friendLoadingMore:b.value.isLoadingMore,groupmateLoadingMore:p.value.isLoadingInitial||p.value.isLoadingMore})),le=u(()=>ie.value.response??b.value.response??p.value.response),ve=u(()=>[ie.value.response,b.value.response,p.value.response].find(e=>e?.task?.status==="running")??le.value),Ue=u(()=>b.value.items.length+p.value.items.length>0),He=u(()=>!Ue.value&&!!b.value.response&&!!p.value.response&&!b.value.hasMore&&!p.value.hasMore&&!b.value.isLoadingInitial&&!p.value.isLoadingInitial),Le=u(()=>b.value.error||p.value.error),ye=u(()=>le.value?.diagnostics),z=u(()=>ve.value?.task),ce=u(()=>q.value??z.value),Q=u(()=>z.value?.status==="running"),Oe=u(()=>z.value?.status==="failed"),$e=u(()=>za({activeTaskStatus:ie.value.response?.task?.status,friendTaskStatus:b.value.response?.task?.status,groupmateTaskStatus:p.value.response?.task?.status,friendInitialLoading:b.value.isLoadingInitial,groupmateInitialLoading:p.value.isLoadingInitial,completionProgressVisible:q.value!==null})),Re=u(()=>q.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):ve.value?.cache.status==="stale"&&Q.value?s("contacts.task.updating"):ve.value?.cache.status==="missing"&&Q.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):s("common.loading")),qe=u(()=>Ia({diagnostics:ye.value,showLoadingState:$e.value})),oe=u(()=>{const e=le.value?.stats,t=e?.friendsTotal??0,i=e?.nonFriendsTotal??0;return{total:t+i,friends:t,nonFriends:i}}),Ke=u(()=>[{id:"friend",label:`${s("contacts.tabs.friends")} ${oe.value.friends.toLocaleString()}`,icon:"i-heroicons-user"},{id:"non_friend",label:`${s("contacts.tabs.groupContacts")} ${oe.value.nonFriends.toLocaleString()}`,icon:"i-heroicons-user-group"}]),Ye=u(()=>Et.map(e=>({label:s(`contacts.timeRange.${e}`),value:e}))),de=jt(u(()=>({count:N.value.length,getScrollElement:()=>Y.value,estimateSize:e=>et(N.value[e]),overscan:10,getItemKey:e=>N.value[e]?.key??e}))),xe=u(()=>de.value.getVirtualItems()),Qe=u(()=>de.value.getTotalSize());U(P,e=>{te.value&&clearTimeout(te.value),te.value=setTimeout(()=>{B.value=e.trim()},300)}),U(()=>z.value?.status,()=>Me()),U(()=>({status:z.value?.status,processedSessions:z.value?.processedSessions??0,totalSessions:z.value?.totalSessions??0}),(e,t)=>{e.status==="running"&&ue(),z.value&&Aa({previousStatus:t?.status,nextStatus:e.status,previousProcessedSessions:t?.processedSessions??0,nextProcessedSessions:e.processedSessions,nextTotalSessions:e.totalSessions})&&it(z.value)}),U([B,F],()=>{st(),Ie()}),U(()=>N.value.length,()=>{de.value.measure()}),U(xe,()=>{Je()},{flush:"post"}),U(N,()=>{v.value&&(b.value.items.some(e=>e.key===v.value)||p.value.items.some(e=>e.key===v.value)||re())}),Vt(()=>{Ie()}),Gt(()=>{ze(),ue(),te.value&&clearTimeout(te.value),M.value&&clearTimeout(M.value)});async function G(e,t){const i=W(e,1,{...t,replace:!0});ae[e]=i;try{await i}finally{ae[e]===i&&(ae[e]=null)}}async function Ie(){await Promise.all([G("friend"),G("non_friend")])}async function Pe(e){const t=V.value[e];!t.hasMore||t.isLoadingInitial||t.isLoadingMore||await W(e,t.page+1,{acceptStale:!0,replace:!1})}async function W(e,t,i){const d=V.value[e],_=i?.replace!==!1,L=d.requestId+1;d.requestId=L,d.error="",i?.silent||(_?d.isLoadingInitial=d.items.length===0:d.isLoadingMore=!0);try{const $={acceptStale:i?.acceptStale,timeRangePreset:F.value,pool:e,page:t,pageSize:mn,query:B.value||void 0},l=i?.force?await S.recomputeContacts($):await S.getContacts($);if(d.requestId!==L)return;Ze(d,l,_,{preserveExisting:i?.preserveExisting}),Me()}catch($){if(d.requestId===L&&(d.error=String($)),i?.throwOnError)throw $}finally{d.requestId===L&&(d.isLoadingInitial=!1,d.isLoadingMore=!1)}}async function Fe(){I.value=!0;try{await W(m.value,1,{acceptStale:!0,force:!0,replace:!0,throwOnError:!0}),k.success(s("contacts.toast.recomputeStarted"))}catch(e){k.fail(s("contacts.toast.recomputeFailed"),{description:String(e)})}finally{I.value=!1}}const We=u(()=>({title:s("layout.relationships"),description:s("contacts.subtitle",{count:ye.value?.privateSessionCount??0}),icon:"i-lucide-users",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm",action:{label:s("contacts.actions.recompute"),icon:"i-lucide-refresh-cw",loading:I.value,disabled:Q.value,class:"border border-pink-100 hover:border-pink-200 dark:border-pink-950/30 dark:hover:border-pink-900/50",onClick:Fe},stats:[{id:"total",label:s("contacts.stats.total"),value:oe.value.total.toLocaleString()},{id:"friends",label:s("contacts.stats.friends"),value:oe.value.friends.toLocaleString()},{id:"nonFriends",label:s("contacts.stats.nonFriends"),value:oe.value.nonFriends.toLocaleString(),dividerBefore:!0}]}));Ht(We);function Ze(e,t,i,d){const _=e.response?.cache.signature,L=t.cache.signature,$=!!_&&!!L&&_!==L;if(e.response=t,e.total=t.pagination.total,d?.preserveExisting&&!$&&e.items.length>0){e.hasMore=e.items.length<t.pagination.total;return}e.page=t.pagination.page,e.hasMore=t.pagination.hasMore,e.items=i||$?t.contacts:Xe(e.items,t.contacts),$&&re()}function Xe(e,t){const i=new Set(e.map(_=>_.key)),d=[...e];for(const _ of t)i.has(_.key)||(i.add(_.key),d.push(_));return d}function Je(){const t=xe.value.at(-1);if(!t||t.index<N.value.length-gn)return;if(D(t.index).pool==="friend"){if(b.value.hasMore){Pe("friend");return}Te.value&&!p.value.response&&!p.value.isLoadingInitial&&G("non_friend");return}if(!p.value.response&&!p.value.isLoadingInitial){G("non_friend");return}p.value.hasMore&&Pe("non_friend")}function D(e){return N.value[e]}function g(e){return D(e)}function et(e){return e?.type==="section"?e.pool==="non_friend"?42:1:e?.type==="loading"?44:Ge}async function tt(e){const t=e==="non_friend"?"non_friend":"friend";m.value=t,K.value=!0,M.value&&clearTimeout(M.value),t==="non_friend"&&await at(),await je();const i=N.value.findIndex(d=>d.type==="section"&&d.pool===t);if(i>=0){const d=t==="non_friend"?Math.min(i+1,N.value.length-1):i;de.value.scrollToIndex(d,{align:"start"})}M.value=setTimeout(()=>{K.value=!1,m.value=t},350)}async function at(){!p.value.response&&!p.value.isLoadingInitial&&await G("non_friend",{acceptStale:!0}),await nt()}async function nt(e){if(!Fa({friendInitialLoading:b.value.isLoadingInitial,groupmateInitialLoading:p.value.isLoadingInitial}))return;const t=[ae.friend,ae.non_friend].filter(i=>!!i);t.length!==0&&await Promise.allSettled(t)}function st(){K.value=!1,M.value&&clearTimeout(M.value),ue();for(const e of["friend","non_friend"])V.value[e].requestId++,V.value[e]=me();re(),se.value={},Y.value&&(Y.value.scrollTop=0)}function Me(){Q.value?ot():ze()}function ot(){j.value||(j.value=setInterval(()=>{rt()},1500))}async function rt(){if(!pe.value){pe.value=!0;try{const e=Na({activePool:m.value,friendTaskStatus:b.value.response?.task?.status,groupmateTaskStatus:p.value.response?.task?.status});await Promise.all(e.map(t=>W(t,1,{acceptStale:!0,replace:!0,preserveExisting:!0,silent:!0})))}finally{pe.value=!1}}}function ze(){j.value&&(clearInterval(j.value),j.value=null)}function it(e){ue(),q.value={...e,processedSessions:e.totalSessions},ee.value=setTimeout(()=>{q.value=null,ee.value=null},450)}function ue(){ee.value&&(clearTimeout(ee.value),ee.value=null),q.value=null}async function lt(e){v.value=e.key,await Ae(e.key)}async function Ae(e,t){const i=`${F.value}:${e}`,d=se.value[i];if(d&&!t?.skipCache){w.value=d;return}w.value=null,R.value=!0;try{const _=await S.getContactDetail(e,{acceptStale:!0,timeRangePreset:F.value});if(v.value!==e)return;w.value=_.contact,_.contact&&(se.value={...se.value,[i]:_.contact})}catch(_){k.fail(s("contacts.toast.recomputeFailed"),{description:String(_)})}finally{v.value===e&&(R.value=!1)}}async function ct(){const e=w.value?.key;if(!(!e||y.value)){y.value=!0;try{await S.markContactAsFriend(e,{timeRangePreset:F.value}),k.success(s("contacts.toast.markFriendSucceeded")),await Ne(e)}catch(t){k.fail(s("contacts.toast.markFriendFailed"),{description:String(t)})}finally{y.value=!1}}}async function dt(){const e=w.value?.key;if(!(!e||y.value)){y.value=!0;try{await S.unmarkContactAsFriend(e,{timeRangePreset:F.value}),k.success(s("contacts.toast.unmarkFriendSucceeded")),await Ne(e)}catch(t){k.fail(s("contacts.toast.unmarkFriendFailed"),{description:String(t)})}finally{y.value=!1}}}async function Ne(e){const t=m.value,i=Y.value?.scrollTop??0,d=w.value?.pool??t;if(se.value={},d==="non_friend"){ut(e),re(),await Be(t,i),await ft();return}await Promise.all([G("friend",{acceptStale:!0}),G("non_friend",{acceptStale:!0})]),v.value=e,await Ae(e,{skipCache:!0}),await Be(t,i)}function ut(e){const t=p.value,i=t.items.filter(d=>d.key!==e);i.length!==t.items.length&&(t.items=i,t.total=Math.max(0,t.total-1),t.hasMore=t.items.length<t.total)}async function ft(){await Promise.all([W("friend",1,{acceptStale:!0,replace:!0,preserveExisting:Ve("friend"),silent:!0}),W("non_friend",1,{acceptStale:!0,replace:!0,preserveExisting:Ve("non_friend"),silent:!0})])}function re(){v.value=null,w.value=null,R.value=!1}function pt(e){return e.friendSource==="manual"?s("contacts.pool.manualFriend"):e.pool==="friend"?s("contacts.pool.friend"):s("contacts.pool.nonFriend")}function mt(e){return e.friendSource==="manual"?"bg-indigo-50 text-indigo-600 dark:bg-indigo-500/10 dark:text-indigo-400 border border-indigo-100/50 dark:border-indigo-500/20":e.pool==="friend"?"bg-sky-50 text-sky-600 dark:bg-sky-500/10 dark:text-sky-400 border border-sky-100/50 dark:border-sky-500/20":"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400 border border-emerald-100/50 dark:border-emerald-500/20"}function he(e){return e==="friend"?"contact-table-grid--friends":"contact-table-grid--group-contacts"}function gt(e,t){return Z(e==="friend"?t.scoreBreakdown.privateMessageCount:t.scoreBreakdown.commonGroupCount)}function vt(e,t){return Z(e==="friend"?t.scoreBreakdown.activePrivateMonths:t.scoreBreakdown.coOccurrenceCount)}function yt(e,t){return Z(e==="friend"?t.scoreBreakdown.commonGroupCount:t.scoreBreakdown.replyInteractionCount)}function xt(e){return(e.displayName||e.platformId||"?").slice(0,1)}function ht(e){return Math.round(e*100).toString()}function kt(e){return e.friendSource==="manual"?"-":ht(e.score)}function Z(e){return String(e??0)}function bt(e){return e?new Date(e*1e3).toLocaleDateString():s("contacts.emptyValue")}function _t(e){A.push({name:e.type==="private"?"private-chat":"group-chat",params:{id:e.id}})}function St(e){C.openChatRecordDrawer({sessionId:e.id})}function wt(e){const t=e.target;if(ie.value.scrollOffset=t.scrollTop,K.value)return;const i=Tt(t);m.value!==i&&(m.value=i)}function Ct(e){Ce.value=e.target.scrollLeft}function Tt(e){return!ge.value||!ne.value?"friend":e.scrollTop+42>=ne.value.offsetTop+Ee()?"non_friend":"friend"}function Ee(){return 1+b.value.items.length*Ge+(b.value.isLoadingMore?44:0)}async function Be(e,t){m.value=e,await je();const i=Y.value;i&&(K.value=!0,M.value&&clearTimeout(M.value),i.scrollTop=Pa({previousScrollTop:t,groupSectionScrollTop:Lt()}),M.value=setTimeout(()=>{K.value=!1,m.value=e},150))}function Lt(){return!ge.value||!ne.value?null:ne.value.offsetTop+Ee()-42}return(e,t)=>{const i=It,d=be,_=Pt,L=_e,$=$t;return c(),f("div",Ba,[h(r(Nt),{modelValue:m.value,"onUpdate:modelValue":t[3]||(t[3]=l=>m.value=l),items:Ke.value,"persist-key":"contactsTab",onChange:tt},{right:T(()=>[a("div",ja,[h(i,{modelValue:F.value,"onUpdate:modelValue":t[0]||(t[0]=l=>F.value=l),items:Ye.value,content:!1,size:"xs",class:"min-w-max gap-0",disabled:Q.value},null,8,["modelValue","items","disabled"]),h(_,{modelValue:P.value,"onUpdate:modelValue":t[2]||(t[2]=l=>P.value=l),icon:"i-lucide-search",placeholder:r(s)("contacts.search"),size:"sm",class:"w-full sm:w-32"},Dt({_:2},[P.value?{name:"trailing",fn:T(()=>[h(d,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs","aria-label":r(s)("contacts.actions.clearSearch"),onClick:t[1]||(t[1]=l=>P.value="")},null,8,["aria-label"])]),key:"0"}:void 0]),1032,["modelValue","placeholder"])])]),_:1},8,["modelValue","items"]),a("div",Va,[a("main",{ref_key:"scrollContainerRef",ref:Y,class:"min-h-0 min-w-0 flex-1 overflow-y-auto",onScroll:wt},[a("div",Ga,[h($a,{"show-disabled-notice":qe.value,"active-private-session-count":ye.value?.activePrivateSessionCount??0,"cache-status":le.value?.cache.status,"task-failed":Oe.value,"task-last-error":z.value?.lastError,"is-task-running":Q.value,"is-recomputing":I.value,onRecompute:Fe},null,8,["show-disabled-notice","active-private-session-count","cache-status","task-failed","task-last-error","is-task-running","is-recomputing"]),a("section",Da,[$e.value?(c(),fe(r(Ut),{key:0,text:Re.value,height:"py-16"},null,8,["text"])):Le.value?(c(),f("div",Ua,o(Le.value),1)):(c(),f("div",Ha,[He.value?(c(),f("div",Oa,[a("div",Ra,[h(L,{name:"i-lucide-users-2",class:"h-6 w-6"})]),a("p",qa,o(r(s)("contacts.empty")),1)])):(c(),f("div",Ka,[a("div",Ya,[a("div",{class:H(["contact-table-grid min-w-[720px] px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500",he(m.value)]),style:X({transform:`translateX(-${Ce.value}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),m.value==="friend"?(c(),f(O,{key:0},[a("span",null,o(r(s)("contacts.metrics.privateMessagesLabel")),1),a("span",null,o(r(s)("contacts.metrics.activeMonths")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1)],64)):(c(),f(O,{key:1},[a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1)],64)),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Qa,[a("span",Wa,o(r(s)("contacts.detail.score")),1),h($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",Za,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[h(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)]),a("div",{ref_key:"tableBodyRef",ref:ne,class:"overflow-x-auto scrollbar-hide",onScroll:Ct},[a("div",{class:"relative min-w-[720px]",style:X({height:`${Qe.value}px`})},[(c(!0),f(O,null,ke(xe.value,l=>(c(),f(O,{key:String(l.key)},[D(l.index).type==="section"&&D(l.index).pool==="friend"?(c(),f("div",{key:0,class:"absolute left-0 top-0 h-px w-full",style:X({transform:`translateY(${l.start}px)`}),"aria-hidden":"true"},null,4)):D(l.index).type==="section"?(c(),f("div",{key:1,class:H(["contact-table-grid absolute left-0 top-0 w-full border-b border-gray-100 bg-white px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:border-gray-800/40 dark:bg-page-dark dark:text-gray-500",he(D(l.index).pool)]),style:X({transform:`translateY(${l.start}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Xa,[a("span",Ja,o(r(s)("contacts.detail.score")),1),h($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",en,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[h(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)):D(l.index).type==="contact"?(c(),f("button",{key:2,type:"button",class:H(["contact-table-grid absolute left-0 top-0 w-full px-4 py-3.5 text-left outline-none transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",[he(g(l.index).pool),v.value===g(l.index).contact.key?"border-b border-primary-500/20 bg-primary-500/[0.03] dark:bg-primary-500/[0.04]":"border-b border-gray-100/50 bg-transparent hover:bg-gray-50/50 dark:border-white/5 dark:hover:bg-gray-800/20"]]),style:X({transform:`translateY(${l.start}px)`}),"aria-label":r(s)("contacts.actions.viewDetail",{name:g(l.index).contact.displayName}),onClick:yn=>lt(g(l.index).contact)},[a("div",{class:H(["absolute left-0 top-1/4 h-1/2 w-1 rounded-r-full bg-primary-500 transition-all duration-300",v.value===g(l.index).contact.key?"scale-100 opacity-100":"scale-75 opacity-0"])},null,2),a("div",an,[a("div",nn,[g(l.index).contact.avatar?(c(),f("img",{key:0,src:g(l.index).contact.avatar??"",alt:g(l.index).contact.displayName,loading:"lazy",decoding:"async",class:"h-10 w-10 object-cover transition-transform duration-300 group-hover:scale-105"},null,8,sn)):(c(),f("div",on,o(xt(g(l.index).contact)),1))]),a("div",rn,[a("div",ln,[a("span",{class:H(["truncate text-sm font-semibold leading-tight tracking-tight text-gray-800 transition-colors group-hover:text-primary-600 group-focus-visible:text-primary-600 dark:text-gray-200 dark:group-hover:text-primary-400 dark:group-focus-visible:text-primary-400",v.value===g(l.index).contact.key?"text-primary-600 dark:text-primary-400":""])},o(g(l.index).contact.displayName),3)]),a("span",cn,o(g(l.index).contact.platform),1)])]),a("span",{class:H(["inline-flex w-fit justify-self-start rounded-lg px-2.5 py-1 text-xs font-semibold",mt(g(l.index).contact)])},o(pt(g(l.index).contact)),3),a("span",dn,o(gt(g(l.index).pool,g(l.index).contact)),1),a("span",un,o(vt(g(l.index).pool,g(l.index).contact)),1),a("span",fn,o(yt(g(l.index).pool,g(l.index).contact)),1),a("span",pn,o(bt(g(l.index).contact.lastInteractionTs)),1),a("span",{class:H(["inline-flex h-7 w-12 items-center justify-center justify-self-end rounded-lg font-mono text-xs font-bold tabular-nums transition-colors duration-200",v.value===g(l.index).contact.key?"bg-primary-500 text-white":"bg-primary-50 text-primary-600 dark:bg-primary-500/10 dark:text-primary-400"])},o(kt(g(l.index).contact)),3)],14,tn)):(c(),f("div",{key:3,class:"absolute left-0 top-0 flex h-11 w-full items-center justify-center gap-2 border-b border-gray-100/50 text-xs font-semibold text-gray-500 dark:border-white/5 dark:text-gray-400",style:X({transform:`translateY(${l.start}px)`})},[h(L,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(s)("common.loading")),1)],4))],64))),128))],4)],544)]))]))])])],544),h(ma,{"selected-key":v.value,contact:w.value,"is-loading":R.value,"is-friend-action-loading":y.value,onClear:re,onOpenSource:_t,onViewSourceRecords:St,onMarkFriend:ct,onUnmarkFriend:dt},null,8,["selected-key","contact","is-loading","is-friend-action-loading"])])])}}}),wn=De(vn,[["__scopeId","data-v-03aeb54c"]]);export{wn as default};
1
+ import{c as be,_ as _e,i as $t,h as It,d as Pt,u as Ft}from"./vendor-nuxt-ui-DaLxYaC4.js";import{u as Se,_ as De,j as Mt,m as zt,o as At,q as Nt,C as Et}from"./index-CqUuHQBQ.js";import{p as we,H as fe,K as T,by as Bt,G as c,P as f,a5 as a,T as o,u as r,L as h,Z as O,a3 as ke,U as E,R as J,h as u,bB as jt,w as U,d as Vt,F as Gt,a0 as X,Q as H,b as x,au as Dt,n as je}from"./vendor-reka-ui-CzM4kDQ7.js";import{_ as Ut}from"./LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js";import{u as Ht}from"./people-page-header-Mupn-U_b.js";import"./vendor-snapdom-XnBoh1gd.js";const Ot={key:0,class:"flex h-full w-[420px] max-w-[80vw] shrink-0 flex-col border-l border-gray-200 bg-white dark:border-gray-800 dark:bg-page-dark",style:{"-webkit-app-region":"no-drag"}},Rt={class:"flex items-center justify-between border-b border-gray-200 px-4 py-3 dark:border-gray-800"},qt={class:"text-base font-semibold text-gray-900 dark:text-white"},Kt={key:0,class:"flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-gray-400 dark:text-gray-500"},Yt={key:1,class:"min-h-0 flex-1 overflow-y-auto"},Qt={class:"px-5 py-5"},Wt={class:"flex items-start gap-4"},Zt={class:"relative shrink-0"},Xt=["src","alt"],Jt={key:1,class:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-gray-155 to-gray-200 text-lg font-bold text-gray-700 dark:from-gray-800 dark:to-page-dark dark:text-gray-200"},ea={class:"min-w-0 flex-1 pt-1"},ta={class:"truncate text-lg font-bold tracking-tight text-gray-900 dark:text-white"},aa={class:"mt-1 truncate font-mono text-xs text-gray-400 dark:text-gray-500"},na={key:0,class:"mt-2 flex flex-wrap gap-1.5"},sa={key:1,class:"mt-3 flex flex-wrap items-center gap-2"},oa={class:"border-t border-gray-100 px-5 py-4 dark:border-white/5"},ra={class:"mb-3 text-[10px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500"},ia={class:"space-y-2.5"},la={class:"flex items-center justify-between gap-2"},ca={class:"truncate text-xs font-semibold text-gray-700 dark:text-gray-300"},da={class:"flex items-center gap-1 text-[10px] font-bold text-gray-400 transition group-hover/item:text-pink-500 dark:text-gray-500"},ua={class:"mt-1.5 truncate text-[11px] font-medium text-gray-400 dark:text-gray-500"},fa={class:"mt-2 flex flex-wrap gap-1.5"},pa=we({__name:"ContactDetailPanel",props:{selectedKey:{},contact:{},isLoading:{type:Boolean},isFriendActionLoading:{type:Boolean}},emits:["clear","openSource","viewSourceRecords","markFriend","unmarkFriend"],setup(n,{emit:s}){const k=n,S=s,{t:C}=Se(),A=u(()=>{const m=k.contact;if(!m)return[];const v=new Set([m.displayName.trim().toLowerCase(),m.platformId.trim().toLowerCase()]);return m.aliases.filter(w=>!v.has(w.trim().toLowerCase()))}),I=u(()=>k.contact?.pool==="non_friend"),P=u(()=>k.contact?.friendSource==="manual"),B=u(()=>I.value||P.value);function F(m){return m.displayName.trim().slice(0,1).toUpperCase()||"?"}return(m,v)=>{const w=be,R=_e;return c(),fe(Bt,{name:"contact-detail-panel"},{default:T(()=>[n.selectedKey?(c(),f("aside",Ot,[a("div",Rt,[a("h3",qt,o(r(C)("contacts.detail.title")),1),h(w,{"aria-label":r(C)("contacts.actions.clearSelection"),icon:"i-heroicons-x-mark",color:"neutral",variant:"ghost",size:"sm",onClick:v[0]||(v[0]=y=>S("clear"))},null,8,["aria-label"])]),n.isLoading?(c(),f("div",Kt,[h(R,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(C)("common.loading")),1)])):n.contact?(c(),f("div",Yt,[a("section",Qt,[a("div",Wt,[a("div",Zt,[n.contact.avatar?(c(),f("img",{key:0,src:n.contact.avatar,alt:n.contact.displayName,loading:"lazy",decoding:"async",class:"h-16 w-16 rounded-2xl object-cover shadow-sm ring-2 ring-white dark:ring-page-dark"},null,8,Xt)):(c(),f("div",Jt,o(F(n.contact)),1))]),a("div",ea,[a("h2",ta,o(n.contact.displayName),1),a("p",aa,o(n.contact.platform)+" · "+o(n.contact.platformId),1),A.value.length>0?(c(),f("div",na,[(c(!0),f(O,null,ke(A.value.slice(0,4),y=>(c(),f("span",{key:y,class:"max-w-full truncate rounded-md bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-500 dark:bg-white/5 dark:text-gray-400"},o(y),1))),128))])):E("",!0),B.value?(c(),f("div",sa,[I.value?(c(),fe(w,{key:0,icon:"i-lucide-user-plus",color:"primary",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[1]||(v[1]=y=>S("markFriend"))},{default:T(()=>[J(o(r(C)("contacts.actions.markFriend")),1)]),_:1},8,["loading"])):P.value?(c(),fe(w,{key:1,icon:"i-lucide-user-minus",color:"neutral",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[2]||(v[2]=y=>S("unmarkFriend"))},{default:T(()=>[J(o(r(C)("contacts.actions.unmarkFriend")),1)]),_:1},8,["loading"])):E("",!0)])):E("",!0)])])]),a("section",oa,[a("h3",ra,o(r(C)("contacts.detail.sources")),1),a("div",ia,[(c(!0),f(O,null,ke(n.contact.sourceSessions,y=>(c(),f("div",{key:y.id,class:"w-full rounded-2xl border border-gray-100 bg-white/40 px-3.5 py-3 text-left transition duration-300 hover:border-gray-200 hover:shadow-sm dark:border-white/5 dark:bg-page-dark/10 dark:hover:border-white/10"},[a("div",la,[a("span",ca,o(y.name),1),a("span",da,o(y.type==="private"?r(C)("contacts.detail.sourceType.private"):r(C)("contacts.detail.sourceType.group")),1)]),a("div",ua,o(y.privateMessageCount!=null?r(C)("contacts.metrics.privateMessages",{count:y.privateMessageCount}):r(C)("contacts.metrics.groupSignals",{count:y.coOccurrenceCount??0})),1),a("div",fa,[h(w,{icon:"i-lucide-arrow-up-right",color:"primary",variant:"soft",size:"xs",onClick:j=>S("openSource",y)},{default:T(()=>[J(o(r(C)("contacts.actions.openSourceSession")),1)]),_:1},8,["onClick"]),h(w,{icon:"i-lucide-messages-square",color:"primary",variant:"soft",size:"xs",onClick:j=>S("viewSourceRecords",y)},{default:T(()=>[J(o(r(C)("contacts.actions.viewSourceRecords")),1)]),_:1},8,["onClick"])])]))),128))])])])):E("",!0)])):E("",!0)]),_:1})}}}),ma=De(pa,[["__scopeId","data-v-ec47ac84"]]),ga={key:0,class:"flex items-center gap-3.5 rounded-2xl border border-amber-200/60 bg-amber-50/40 p-4 text-sm text-amber-800 dark:border-amber-900/40 dark:bg-amber-950/10 dark:text-amber-200 backdrop-blur-sm shadow-sm"},va={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-amber-100/80 dark:bg-amber-950/50"},ya={class:"font-medium"},xa={key:1,class:"flex flex-col gap-4 rounded-2xl border border-zinc-200/80 bg-zinc-50/60 p-4 text-sm text-zinc-700 dark:border-zinc-800/80 dark:bg-page-dark/40 dark:text-zinc-300 sm:flex-row sm:items-center sm:justify-between backdrop-blur-sm shadow-sm"},ha={class:"flex items-center gap-3.5"},ka={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-zinc-100 dark:bg-zinc-800/80"},ba={class:"font-medium"},_a={class:"flex items-center shrink-0 self-end sm:self-center"},Sa={key:2,class:"flex flex-col gap-4 rounded-2xl border border-red-200/60 bg-red-50/40 p-4 text-sm text-red-700 dark:border-red-900/40 dark:bg-red-950/10 dark:text-red-300 sm:flex-row sm:items-center sm:justify-between backdrop-blur-sm shadow-sm"},wa={class:"flex min-w-0 items-center gap-3.5"},Ca={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-red-100/80 dark:bg-red-950/50"},Ta={class:"truncate font-medium"},La={class:"flex items-center shrink-0 self-end sm:self-center"},$a=we({__name:"ContactsStatusBlocks",props:{showDisabledNotice:{type:Boolean},activePrivateSessionCount:{},cacheStatus:{},taskFailed:{type:Boolean},taskLastError:{},isTaskRunning:{type:Boolean},isRecomputing:{type:Boolean}},emits:["recompute"],setup(n,{emit:s}){const k=s,{t:S}=Se();return(C,A)=>{const I=_e,P=be;return c(),f(O,null,[n.showDisabledNotice?(c(),f("div",ga,[a("div",va,[h(I,{name:"i-lucide-alert-triangle",class:"h-5 w-5 text-amber-500"})]),a("span",ya,o(r(S)("contacts.disabled",{count:n.activePrivateSessionCount})),1)])):E("",!0),n.cacheStatus==="stale"&&!n.isTaskRunning?(c(),f("div",xa,[a("div",ha,[a("div",ka,[h(I,{name:"i-lucide-history",class:"h-5 w-5 text-zinc-500 dark:text-zinc-400"})]),a("span",ba,o(r(S)("contacts.stale.inline")),1)]),a("div",_a,[h(P,{size:"sm",color:"primary",variant:"soft",class:"rounded-xl px-4 font-medium",loading:n.isRecomputing||n.isTaskRunning,disabled:n.isTaskRunning,onClick:A[0]||(A[0]=B=>k("recompute"))},{default:T(()=>[J(o(r(S)("contacts.actions.recompute")),1)]),_:1},8,["loading","disabled"])])])):E("",!0),n.taskFailed?(c(),f("div",Sa,[a("div",wa,[a("div",Ca,[h(I,{name:"i-lucide-alert-circle",class:"h-5 w-5 text-red-500"})]),a("span",Ta,o(n.taskLastError||r(S)("contacts.task.failed")),1)]),a("div",La,[h(P,{size:"sm",color:"error",variant:"soft",class:"rounded-xl px-4 font-medium",onClick:A[1]||(A[1]=B=>k("recompute"))},{default:T(()=>[J(o(r(S)("contacts.task.retry")),1)]),_:1})])])):E("",!0)],64)}}});function Ia(n){return!!n.diagnostics&&!n.showLoadingState&&!n.diagnostics.contactsEnabled}function Pa(n){return n.previousScrollTop}function Ve(n){return n!=="friend"}function Fa(n){return n.friendInitialLoading||n.groupmateInitialLoading}function Ma(n){return n.activeSection==="non_friend"||n.friendSectionReady}function za(n){return n.friendInitialLoading||n.groupmateInitialLoading||n.completionProgressVisible===!0||n.activeTaskStatus==="running"||n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"}function Aa(n){return n.previousStatus==="running"&&n.nextStatus==="succeeded"&&n.nextTotalSessions>0&&n.nextProcessedSessions>=n.nextTotalSessions&&n.previousProcessedSessions<n.nextTotalSessions}function Na(n){return n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"?["friend","non_friend"]:[n.activePool]}function Ea(n){const s=[{type:"section",key:"section:friend",pool:"friend"}];return s.push(...n.friends.map(k=>({type:"contact",key:k.key,pool:"friend",contact:k}))),n.friendLoadingMore&&s.push({type:"loading",key:"loading:friend",pool:"friend"}),n.showGroupSection&&(s.push({type:"section",key:"section:non_friend",pool:"non_friend"}),s.push(...n.groupmates.map(k=>({type:"contact",key:k.key,pool:"non_friend",contact:k}))),n.groupmateLoadingMore&&s.push({type:"loading",key:"loading:non_friend",pool:"non_friend"})),s}const Ba={class:"flex min-h-0 flex-1 flex-col bg-white text-gray-900 dark:bg-page-dark dark:text-gray-100"},ja={class:"flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2 px-3 py-2 lg:px-0 lg:py-0"},Va={class:"flex min-h-0 flex-1 overflow-hidden"},Ga={class:"mx-auto flex w-full max-w-[1800px] flex-col gap-6 px-6 pb-6 pt-0 lg:px-8"},Da={class:"flex flex-col gap-4"},Ua={key:1,class:"rounded-2xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-700 dark:border-red-900/30 dark:bg-red-950/20 dark:text-red-300"},Ha={key:2,class:"min-h-0"},Oa={key:0,class:"flex flex-col items-center justify-center rounded-3xl border border-dashed border-gray-250 p-16 text-center dark:border-white/5"},Ra={class:"flex h-12 w-12 items-center justify-center rounded-2xl bg-gray-50 text-gray-400 dark:bg-white/5 dark:text-gray-500"},qa={class:"mt-4 text-sm font-medium text-gray-400 dark:text-gray-500"},Ka={key:1,class:"min-w-0"},Ya={class:"sticky top-0 z-20 overflow-hidden border-b border-gray-100 bg-white dark:border-gray-800/40 dark:bg-page-dark"},Qa={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Wa={class:"truncate"},Za={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},Xa={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Ja={class:"truncate"},en={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},tn=["aria-label","onClick"],an={class:"group flex min-w-0 w-full items-center gap-3"},nn={class:"relative shrink-0 overflow-hidden rounded-lg"},sn=["src","alt"],on={key:1,class:"flex h-10 w-10 items-center justify-center bg-gradient-to-br from-gray-50 to-gray-100 text-sm font-bold text-gray-500 transition-transform duration-300 group-hover:scale-105 dark:from-gray-800 dark:to-gray-800/60 dark:text-gray-400"},rn={class:"min-w-0 flex-1"},ln={class:"flex min-w-0 items-center gap-1"},cn={class:"mt-1 inline-flex items-center rounded bg-gray-50 px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase tracking-wider text-gray-400 dark:bg-white/5 dark:text-gray-500"},dn={class:"contact-table-value"},un={class:"contact-table-value"},fn={class:"contact-table-value"},pn={class:"contact-table-value"},mn=100,Ge=69,gn=20,vn=we({__name:"index",setup(n){const{t:s}=Se(),k=Mt(),S=zt(),C=At(),A=Ft(),I=x(!1),P=x(""),B=x(""),F=x("1y"),m=x("friend"),v=x(null),w=x(null),R=x(!1),y=x(!1),j=x(null),pe=x(!1),q=x(null),ee=x(null),te=x(null),M=x(null),ae={friend:null,non_friend:null},K=x(!1),Y=x(null),ne=x(null),Ce=x(0),se=x({});function me(){return{items:[],response:null,page:0,total:0,hasMore:!1,isLoadingInitial:!1,isLoadingMore:!1,error:"",requestId:0,scrollOffset:0}}const V=x({friend:me(),non_friend:me()}),ie=u(()=>V.value[m.value]),b=u(()=>V.value.friend),p=u(()=>V.value.non_friend),Te=u(()=>!!b.value.response&&!b.value.hasMore&&!b.value.isLoadingInitial),ge=u(()=>Ma({activeSection:m.value,friendSectionReady:Te.value,groupmateHasItems:p.value.items.length>0,groupmateLoading:p.value.isLoadingInitial||p.value.isLoadingMore})),N=u(()=>Ea({friends:b.value.items,groupmates:p.value.items,showGroupSection:ge.value,friendLoadingMore:b.value.isLoadingMore,groupmateLoadingMore:p.value.isLoadingInitial||p.value.isLoadingMore})),le=u(()=>ie.value.response??b.value.response??p.value.response),ve=u(()=>[ie.value.response,b.value.response,p.value.response].find(e=>e?.task?.status==="running")??le.value),Ue=u(()=>b.value.items.length+p.value.items.length>0),He=u(()=>!Ue.value&&!!b.value.response&&!!p.value.response&&!b.value.hasMore&&!p.value.hasMore&&!b.value.isLoadingInitial&&!p.value.isLoadingInitial),Le=u(()=>b.value.error||p.value.error),ye=u(()=>le.value?.diagnostics),z=u(()=>ve.value?.task),ce=u(()=>q.value??z.value),Q=u(()=>z.value?.status==="running"),Oe=u(()=>z.value?.status==="failed"),$e=u(()=>za({activeTaskStatus:ie.value.response?.task?.status,friendTaskStatus:b.value.response?.task?.status,groupmateTaskStatus:p.value.response?.task?.status,friendInitialLoading:b.value.isLoadingInitial,groupmateInitialLoading:p.value.isLoadingInitial,completionProgressVisible:q.value!==null})),Re=u(()=>q.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):ve.value?.cache.status==="stale"&&Q.value?s("contacts.task.updating"):ve.value?.cache.status==="missing"&&Q.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):s("common.loading")),qe=u(()=>Ia({diagnostics:ye.value,showLoadingState:$e.value})),oe=u(()=>{const e=le.value?.stats,t=e?.friendsTotal??0,i=e?.nonFriendsTotal??0;return{total:t+i,friends:t,nonFriends:i}}),Ke=u(()=>[{id:"friend",label:`${s("contacts.tabs.friends")} ${oe.value.friends.toLocaleString()}`,icon:"i-heroicons-user"},{id:"non_friend",label:`${s("contacts.tabs.groupContacts")} ${oe.value.nonFriends.toLocaleString()}`,icon:"i-heroicons-user-group"}]),Ye=u(()=>Et.map(e=>({label:s(`contacts.timeRange.${e}`),value:e}))),de=jt(u(()=>({count:N.value.length,getScrollElement:()=>Y.value,estimateSize:e=>et(N.value[e]),overscan:10,getItemKey:e=>N.value[e]?.key??e}))),xe=u(()=>de.value.getVirtualItems()),Qe=u(()=>de.value.getTotalSize());U(P,e=>{te.value&&clearTimeout(te.value),te.value=setTimeout(()=>{B.value=e.trim()},300)}),U(()=>z.value?.status,()=>Me()),U(()=>({status:z.value?.status,processedSessions:z.value?.processedSessions??0,totalSessions:z.value?.totalSessions??0}),(e,t)=>{e.status==="running"&&ue(),z.value&&Aa({previousStatus:t?.status,nextStatus:e.status,previousProcessedSessions:t?.processedSessions??0,nextProcessedSessions:e.processedSessions,nextTotalSessions:e.totalSessions})&&it(z.value)}),U([B,F],()=>{st(),Ie()}),U(()=>N.value.length,()=>{de.value.measure()}),U(xe,()=>{Je()},{flush:"post"}),U(N,()=>{v.value&&(b.value.items.some(e=>e.key===v.value)||p.value.items.some(e=>e.key===v.value)||re())}),Vt(()=>{Ie()}),Gt(()=>{ze(),ue(),te.value&&clearTimeout(te.value),M.value&&clearTimeout(M.value)});async function G(e,t){const i=W(e,1,{...t,replace:!0});ae[e]=i;try{await i}finally{ae[e]===i&&(ae[e]=null)}}async function Ie(){await Promise.all([G("friend"),G("non_friend")])}async function Pe(e){const t=V.value[e];!t.hasMore||t.isLoadingInitial||t.isLoadingMore||await W(e,t.page+1,{acceptStale:!0,replace:!1})}async function W(e,t,i){const d=V.value[e],_=i?.replace!==!1,L=d.requestId+1;d.requestId=L,d.error="",i?.silent||(_?d.isLoadingInitial=d.items.length===0:d.isLoadingMore=!0);try{const $={acceptStale:i?.acceptStale,timeRangePreset:F.value,pool:e,page:t,pageSize:mn,query:B.value||void 0},l=i?.force?await S.recomputeContacts($):await S.getContacts($);if(d.requestId!==L)return;Ze(d,l,_,{preserveExisting:i?.preserveExisting}),Me()}catch($){if(d.requestId===L&&(d.error=String($)),i?.throwOnError)throw $}finally{d.requestId===L&&(d.isLoadingInitial=!1,d.isLoadingMore=!1)}}async function Fe(){I.value=!0;try{await W(m.value,1,{acceptStale:!0,force:!0,replace:!0,throwOnError:!0}),k.success(s("contacts.toast.recomputeStarted"))}catch(e){k.fail(s("contacts.toast.recomputeFailed"),{description:String(e)})}finally{I.value=!1}}const We=u(()=>({title:s("layout.relationships"),description:s("contacts.subtitle",{count:ye.value?.privateSessionCount??0}),icon:"i-lucide-users",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm",action:{label:s("contacts.actions.recompute"),icon:"i-lucide-refresh-cw",loading:I.value,disabled:Q.value,class:"border border-pink-100 hover:border-pink-200 dark:border-pink-950/30 dark:hover:border-pink-900/50",onClick:Fe},stats:[{id:"total",label:s("contacts.stats.total"),value:oe.value.total.toLocaleString()},{id:"friends",label:s("contacts.stats.friends"),value:oe.value.friends.toLocaleString()},{id:"nonFriends",label:s("contacts.stats.nonFriends"),value:oe.value.nonFriends.toLocaleString(),dividerBefore:!0}]}));Ht(We);function Ze(e,t,i,d){const _=e.response?.cache.signature,L=t.cache.signature,$=!!_&&!!L&&_!==L;if(e.response=t,e.total=t.pagination.total,d?.preserveExisting&&!$&&e.items.length>0){e.hasMore=e.items.length<t.pagination.total;return}e.page=t.pagination.page,e.hasMore=t.pagination.hasMore,e.items=i||$?t.contacts:Xe(e.items,t.contacts),$&&re()}function Xe(e,t){const i=new Set(e.map(_=>_.key)),d=[...e];for(const _ of t)i.has(_.key)||(i.add(_.key),d.push(_));return d}function Je(){const t=xe.value.at(-1);if(!t||t.index<N.value.length-gn)return;if(D(t.index).pool==="friend"){if(b.value.hasMore){Pe("friend");return}Te.value&&!p.value.response&&!p.value.isLoadingInitial&&G("non_friend");return}if(!p.value.response&&!p.value.isLoadingInitial){G("non_friend");return}p.value.hasMore&&Pe("non_friend")}function D(e){return N.value[e]}function g(e){return D(e)}function et(e){return e?.type==="section"?e.pool==="non_friend"?42:1:e?.type==="loading"?44:Ge}async function tt(e){const t=e==="non_friend"?"non_friend":"friend";m.value=t,K.value=!0,M.value&&clearTimeout(M.value),t==="non_friend"&&await at(),await je();const i=N.value.findIndex(d=>d.type==="section"&&d.pool===t);if(i>=0){const d=t==="non_friend"?Math.min(i+1,N.value.length-1):i;de.value.scrollToIndex(d,{align:"start"})}M.value=setTimeout(()=>{K.value=!1,m.value=t},350)}async function at(){!p.value.response&&!p.value.isLoadingInitial&&await G("non_friend",{acceptStale:!0}),await nt()}async function nt(e){if(!Fa({friendInitialLoading:b.value.isLoadingInitial,groupmateInitialLoading:p.value.isLoadingInitial}))return;const t=[ae.friend,ae.non_friend].filter(i=>!!i);t.length!==0&&await Promise.allSettled(t)}function st(){K.value=!1,M.value&&clearTimeout(M.value),ue();for(const e of["friend","non_friend"])V.value[e].requestId++,V.value[e]=me();re(),se.value={},Y.value&&(Y.value.scrollTop=0)}function Me(){Q.value?ot():ze()}function ot(){j.value||(j.value=setInterval(()=>{rt()},1500))}async function rt(){if(!pe.value){pe.value=!0;try{const e=Na({activePool:m.value,friendTaskStatus:b.value.response?.task?.status,groupmateTaskStatus:p.value.response?.task?.status});await Promise.all(e.map(t=>W(t,1,{acceptStale:!0,replace:!0,preserveExisting:!0,silent:!0})))}finally{pe.value=!1}}}function ze(){j.value&&(clearInterval(j.value),j.value=null)}function it(e){ue(),q.value={...e,processedSessions:e.totalSessions},ee.value=setTimeout(()=>{q.value=null,ee.value=null},450)}function ue(){ee.value&&(clearTimeout(ee.value),ee.value=null),q.value=null}async function lt(e){v.value=e.key,await Ae(e.key)}async function Ae(e,t){const i=`${F.value}:${e}`,d=se.value[i];if(d&&!t?.skipCache){w.value=d;return}w.value=null,R.value=!0;try{const _=await S.getContactDetail(e,{acceptStale:!0,timeRangePreset:F.value});if(v.value!==e)return;w.value=_.contact,_.contact&&(se.value={...se.value,[i]:_.contact})}catch(_){k.fail(s("contacts.toast.recomputeFailed"),{description:String(_)})}finally{v.value===e&&(R.value=!1)}}async function ct(){const e=w.value?.key;if(!(!e||y.value)){y.value=!0;try{await S.markContactAsFriend(e,{timeRangePreset:F.value}),k.success(s("contacts.toast.markFriendSucceeded")),await Ne(e)}catch(t){k.fail(s("contacts.toast.markFriendFailed"),{description:String(t)})}finally{y.value=!1}}}async function dt(){const e=w.value?.key;if(!(!e||y.value)){y.value=!0;try{await S.unmarkContactAsFriend(e,{timeRangePreset:F.value}),k.success(s("contacts.toast.unmarkFriendSucceeded")),await Ne(e)}catch(t){k.fail(s("contacts.toast.unmarkFriendFailed"),{description:String(t)})}finally{y.value=!1}}}async function Ne(e){const t=m.value,i=Y.value?.scrollTop??0,d=w.value?.pool??t;if(se.value={},d==="non_friend"){ut(e),re(),await Be(t,i),await ft();return}await Promise.all([G("friend",{acceptStale:!0}),G("non_friend",{acceptStale:!0})]),v.value=e,await Ae(e,{skipCache:!0}),await Be(t,i)}function ut(e){const t=p.value,i=t.items.filter(d=>d.key!==e);i.length!==t.items.length&&(t.items=i,t.total=Math.max(0,t.total-1),t.hasMore=t.items.length<t.total)}async function ft(){await Promise.all([W("friend",1,{acceptStale:!0,replace:!0,preserveExisting:Ve("friend"),silent:!0}),W("non_friend",1,{acceptStale:!0,replace:!0,preserveExisting:Ve("non_friend"),silent:!0})])}function re(){v.value=null,w.value=null,R.value=!1}function pt(e){return e.friendSource==="manual"?s("contacts.pool.manualFriend"):e.pool==="friend"?s("contacts.pool.friend"):s("contacts.pool.nonFriend")}function mt(e){return e.friendSource==="manual"?"bg-indigo-50 text-indigo-600 dark:bg-indigo-500/10 dark:text-indigo-400 border border-indigo-100/50 dark:border-indigo-500/20":e.pool==="friend"?"bg-sky-50 text-sky-600 dark:bg-sky-500/10 dark:text-sky-400 border border-sky-100/50 dark:border-sky-500/20":"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400 border border-emerald-100/50 dark:border-emerald-500/20"}function he(e){return e==="friend"?"contact-table-grid--friends":"contact-table-grid--group-contacts"}function gt(e,t){return Z(e==="friend"?t.scoreBreakdown.privateMessageCount:t.scoreBreakdown.commonGroupCount)}function vt(e,t){return Z(e==="friend"?t.scoreBreakdown.activePrivateMonths:t.scoreBreakdown.coOccurrenceCount)}function yt(e,t){return Z(e==="friend"?t.scoreBreakdown.commonGroupCount:t.scoreBreakdown.replyInteractionCount)}function xt(e){return(e.displayName||e.platformId||"?").slice(0,1)}function ht(e){return Math.round(e*100).toString()}function kt(e){return e.friendSource==="manual"?"-":ht(e.score)}function Z(e){return String(e??0)}function bt(e){return e?new Date(e*1e3).toLocaleDateString():s("contacts.emptyValue")}function _t(e){A.push({name:e.type==="private"?"private-chat":"group-chat",params:{id:e.id}})}function St(e){C.openChatRecordDrawer({sessionId:e.id})}function wt(e){const t=e.target;if(ie.value.scrollOffset=t.scrollTop,K.value)return;const i=Tt(t);m.value!==i&&(m.value=i)}function Ct(e){Ce.value=e.target.scrollLeft}function Tt(e){return!ge.value||!ne.value?"friend":e.scrollTop+42>=ne.value.offsetTop+Ee()?"non_friend":"friend"}function Ee(){return 1+b.value.items.length*Ge+(b.value.isLoadingMore?44:0)}async function Be(e,t){m.value=e,await je();const i=Y.value;i&&(K.value=!0,M.value&&clearTimeout(M.value),i.scrollTop=Pa({previousScrollTop:t,groupSectionScrollTop:Lt()}),M.value=setTimeout(()=>{K.value=!1,m.value=e},150))}function Lt(){return!ge.value||!ne.value?null:ne.value.offsetTop+Ee()-42}return(e,t)=>{const i=It,d=be,_=Pt,L=_e,$=$t;return c(),f("div",Ba,[h(r(Nt),{modelValue:m.value,"onUpdate:modelValue":t[3]||(t[3]=l=>m.value=l),items:Ke.value,"persist-key":"contactsTab",onChange:tt},{right:T(()=>[a("div",ja,[h(i,{modelValue:F.value,"onUpdate:modelValue":t[0]||(t[0]=l=>F.value=l),items:Ye.value,content:!1,size:"xs",class:"min-w-max gap-0",disabled:Q.value},null,8,["modelValue","items","disabled"]),h(_,{modelValue:P.value,"onUpdate:modelValue":t[2]||(t[2]=l=>P.value=l),icon:"i-lucide-search",placeholder:r(s)("contacts.search"),size:"sm",class:"w-full sm:w-32"},Dt({_:2},[P.value?{name:"trailing",fn:T(()=>[h(d,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs","aria-label":r(s)("contacts.actions.clearSearch"),onClick:t[1]||(t[1]=l=>P.value="")},null,8,["aria-label"])]),key:"0"}:void 0]),1032,["modelValue","placeholder"])])]),_:1},8,["modelValue","items"]),a("div",Va,[a("main",{ref_key:"scrollContainerRef",ref:Y,class:"min-h-0 min-w-0 flex-1 overflow-y-auto",onScroll:wt},[a("div",Ga,[h($a,{"show-disabled-notice":qe.value,"active-private-session-count":ye.value?.activePrivateSessionCount??0,"cache-status":le.value?.cache.status,"task-failed":Oe.value,"task-last-error":z.value?.lastError,"is-task-running":Q.value,"is-recomputing":I.value,onRecompute:Fe},null,8,["show-disabled-notice","active-private-session-count","cache-status","task-failed","task-last-error","is-task-running","is-recomputing"]),a("section",Da,[$e.value?(c(),fe(r(Ut),{key:0,text:Re.value,height:"py-16"},null,8,["text"])):Le.value?(c(),f("div",Ua,o(Le.value),1)):(c(),f("div",Ha,[He.value?(c(),f("div",Oa,[a("div",Ra,[h(L,{name:"i-lucide-users-2",class:"h-6 w-6"})]),a("p",qa,o(r(s)("contacts.empty")),1)])):(c(),f("div",Ka,[a("div",Ya,[a("div",{class:H(["contact-table-grid min-w-[720px] px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500",he(m.value)]),style:X({transform:`translateX(-${Ce.value}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),m.value==="friend"?(c(),f(O,{key:0},[a("span",null,o(r(s)("contacts.metrics.privateMessagesLabel")),1),a("span",null,o(r(s)("contacts.metrics.activeMonths")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1)],64)):(c(),f(O,{key:1},[a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1)],64)),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Qa,[a("span",Wa,o(r(s)("contacts.detail.score")),1),h($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",Za,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[h(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)]),a("div",{ref_key:"tableBodyRef",ref:ne,class:"overflow-x-auto scrollbar-hide",onScroll:Ct},[a("div",{class:"relative min-w-[720px]",style:X({height:`${Qe.value}px`})},[(c(!0),f(O,null,ke(xe.value,l=>(c(),f(O,{key:String(l.key)},[D(l.index).type==="section"&&D(l.index).pool==="friend"?(c(),f("div",{key:0,class:"absolute left-0 top-0 h-px w-full",style:X({transform:`translateY(${l.start}px)`}),"aria-hidden":"true"},null,4)):D(l.index).type==="section"?(c(),f("div",{key:1,class:H(["contact-table-grid absolute left-0 top-0 w-full border-b border-gray-100 bg-white px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:border-gray-800/40 dark:bg-page-dark dark:text-gray-500",he(D(l.index).pool)]),style:X({transform:`translateY(${l.start}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Xa,[a("span",Ja,o(r(s)("contacts.detail.score")),1),h($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",en,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[h(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)):D(l.index).type==="contact"?(c(),f("button",{key:2,type:"button",class:H(["contact-table-grid absolute left-0 top-0 w-full px-4 py-3.5 text-left outline-none transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",[he(g(l.index).pool),v.value===g(l.index).contact.key?"border-b border-primary-500/20 bg-primary-500/[0.03] dark:bg-primary-500/[0.04]":"border-b border-gray-100/50 bg-transparent hover:bg-gray-50/50 dark:border-white/5 dark:hover:bg-gray-800/20"]]),style:X({transform:`translateY(${l.start}px)`}),"aria-label":r(s)("contacts.actions.viewDetail",{name:g(l.index).contact.displayName}),onClick:yn=>lt(g(l.index).contact)},[a("div",{class:H(["absolute left-0 top-1/4 h-1/2 w-1 rounded-r-full bg-primary-500 transition-all duration-300",v.value===g(l.index).contact.key?"scale-100 opacity-100":"scale-75 opacity-0"])},null,2),a("div",an,[a("div",nn,[g(l.index).contact.avatar?(c(),f("img",{key:0,src:g(l.index).contact.avatar??"",alt:g(l.index).contact.displayName,loading:"lazy",decoding:"async",class:"h-10 w-10 object-cover transition-transform duration-300 group-hover:scale-105"},null,8,sn)):(c(),f("div",on,o(xt(g(l.index).contact)),1))]),a("div",rn,[a("div",ln,[a("span",{class:H(["truncate text-sm font-semibold leading-tight tracking-tight text-gray-800 transition-colors group-hover:text-primary-600 group-focus-visible:text-primary-600 dark:text-gray-200 dark:group-hover:text-primary-400 dark:group-focus-visible:text-primary-400",v.value===g(l.index).contact.key?"text-primary-600 dark:text-primary-400":""])},o(g(l.index).contact.displayName),3)]),a("span",cn,o(g(l.index).contact.platform),1)])]),a("span",{class:H(["inline-flex w-fit justify-self-start rounded-lg px-2.5 py-1 text-xs font-semibold",mt(g(l.index).contact)])},o(pt(g(l.index).contact)),3),a("span",dn,o(gt(g(l.index).pool,g(l.index).contact)),1),a("span",un,o(vt(g(l.index).pool,g(l.index).contact)),1),a("span",fn,o(yt(g(l.index).pool,g(l.index).contact)),1),a("span",pn,o(bt(g(l.index).contact.lastInteractionTs)),1),a("span",{class:H(["inline-flex h-7 w-12 items-center justify-center justify-self-end rounded-lg font-mono text-xs font-bold tabular-nums transition-colors duration-200",v.value===g(l.index).contact.key?"bg-primary-500 text-white":"bg-primary-50 text-primary-600 dark:bg-primary-500/10 dark:text-primary-400"])},o(kt(g(l.index).contact)),3)],14,tn)):(c(),f("div",{key:3,class:"absolute left-0 top-0 flex h-11 w-full items-center justify-center gap-2 border-b border-gray-100/50 text-xs font-semibold text-gray-500 dark:border-white/5 dark:text-gray-400",style:X({transform:`translateY(${l.start}px)`})},[h(L,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(s)("common.loading")),1)],4))],64))),128))],4)],544)]))]))])])],544),h(ma,{"selected-key":v.value,contact:w.value,"is-loading":R.value,"is-friend-action-loading":y.value,onClear:re,onOpenSource:_t,onViewSourceRecords:St,onMarkFriend:ct,onUnmarkFriend:dt},null,8,["selected-key","contact","is-loading","is-friend-action-loading"])])])}}}),wn=De(vn,[["__scopeId","data-v-03aeb54c"]]);export{wn as default};