@goodfish/jarvy 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Jarvy. Versions follow [semantic versioning](https://semver.org/) as used before 1.0: a patch release only fixes bugs; a minor release adds features or upgrades the database.
|
|
4
4
|
|
|
5
|
+
## 0.14.1 — 2026-11-13
|
|
6
|
+
|
|
7
|
+
No database change: the schema stays v31, and upgrading from 0.14.0 needs nothing else.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Antigravity lists the newest models an account has, such as Gemini 4 Hydrogen and Gemini 4 Carbon. A new model is recommended on Antigravity's daily endpoint before production lists it, and only production's recommendation list was kept, so these models were left out. The lists of all three endpoints are now merged, and Jarvy reports the same client version as Antigravity's current CLI (1.5.5), on which Google decides which models an account sees. Open the connection again, or reset its models, to see them. A model the model catalog doesn't price yet, such as Gemini 4 Carbon, shows no price.
|
|
12
|
+
|
|
5
13
|
## 0.14.0 — 2026-11-13
|
|
6
14
|
|
|
7
15
|
The database upgrades to v31 on first start: every existing channel gets the owner as its creator and no admins. Going back to 0.13.0 needs the database from before the upgrade. Nothing else to do: no new dependency, and every sandbox stays as it was.
|
package/dist/server/cli.js
CHANGED
|
@@ -2647,7 +2647,7 @@ var ENDPOINTS = [
|
|
|
2647
2647
|
"https://daily-cloudcode-pa.sandbox.googleapis.com",
|
|
2648
2648
|
"https://cloudcode-pa.googleapis.com"
|
|
2649
2649
|
];
|
|
2650
|
-
var USER_AGENT = "antigravity/cli/1.
|
|
2650
|
+
var USER_AGENT = "antigravity/cli/1.5.5 (aidev_client; os_type=linux; arch=amd64; cl=982146307; auth_method=consumer)";
|
|
2651
2651
|
var LOOKUP_TIMEOUT_MS = 8e3;
|
|
2652
2652
|
function apiHeaders(token2) {
|
|
2653
2653
|
return { Authorization: `Bearer ${token2}`, "Content-Type": "application/json", "User-Agent": USER_AGENT };
|
|
@@ -2710,19 +2710,20 @@ function uuidFrom(seed) {
|
|
|
2710
2710
|
async function fetchModels(token2, project, signal) {
|
|
2711
2711
|
const results = await Promise.allSettled(ENDPOINTS.map((endpoint) => call(endpoint, "fetchAvailableModels", token2, { project }, signal)));
|
|
2712
2712
|
const models = {};
|
|
2713
|
-
|
|
2713
|
+
const sorts = [];
|
|
2714
|
+
let failure;
|
|
2714
2715
|
for (const result of results) {
|
|
2715
2716
|
if (result.status === "rejected") {
|
|
2716
2717
|
failure ??= result.reason;
|
|
2717
2718
|
continue;
|
|
2718
2719
|
}
|
|
2719
2720
|
const data = result.value;
|
|
2720
|
-
if (!isRecord(data) || !isRecord(data.models)) continue;
|
|
2721
|
+
if (!isRecord(data) || !isRecord(data.models) || !Object.keys(data.models).length) continue;
|
|
2721
2722
|
for (const [id, info] of Object.entries(data.models)) if (isRecord(info)) models[id] = info;
|
|
2722
|
-
if (Array.isArray(data.agentModelSorts)) sorts
|
|
2723
|
+
if (Array.isArray(data.agentModelSorts)) sorts.push(...data.agentModelSorts);
|
|
2723
2724
|
}
|
|
2724
2725
|
if (!Object.keys(models).length) throw failure instanceof Error ? failure : new Error("fetchAvailableModels returned no models");
|
|
2725
|
-
return { models, sorts };
|
|
2726
|
+
return { models, ...sorts.length ? { sorts } : {} };
|
|
2726
2727
|
}
|
|
2727
2728
|
|
|
2728
2729
|
// src/server/infra/pi/antigravity/models.ts
|
|
@@ -813,7 +813,7 @@ ${e.tail}`:e.head+e.tail:""}const Pj=e=>e.omitted?`${y("npc.live.omitted",{count
|
|
|
813
813
|
`),title:e.state==="running"?y("npc.step.ask.running"):v?y("npc.step.ask.ok",{answer:v}):y(e.state==="failed"?"npc.live.askFailed":"npc.live.askClosed")}}if(c==="environments.switch")return{...n,look:"action",icon:"tool",title:y(`npc.live.switch.${Ka(e)}`),detail:r};const h=d?Ij(d):"",g=r0.has(c)?h?y(`npc.live.browse.${e.state==="running"?"running":"ok"}`,{chat:h}):y(`npc.live.browseAll.${e.state==="running"?"running":"ok"}`):y(`npc.live.tool.${Ka(e)}`,{tool:c||"chat"});return{...n,look:"action",icon:r0.has(c)?"chat":"tool",title:e.state==="failed"&&r0.has(c)?y("npc.live.tool.failed",{tool:c}):g,detail:r}}function YH(e){try{const n=JSON.parse(e.output?e.output.head+e.output.tail:"");return n.status!=="answered"?null:[...(n.selected??[]).map(a=>a.label??""),n.custom??""].filter(Boolean).join(y("common.listSeparator"))}catch{return null}}function Hj(e,n){const a=new Map(e.steps.map(o=>[o.id,o.parentId])),r=o=>{let c=0,d=o.parentId;for(;d&&c<4;)c++,d=a.get(d)??null;return c};return e.steps.map(o=>VH(o,r(o),n))}function Vd(e){var a;const n=((a=e.line)==null?void 0:a.length)??0;if(e.look==="speech"){const r=Math.min(7e3,Math.max(2500,1500+50*n))+Math.min(1500,n/.06);return{firm:r,light:r}}return e.look==="mutter"?{firm:1500,light:Math.min(3500,Math.max(1500,800+30*n))}:e.state==="failed"?{firm:2e3,light:2e3}:{firm:0,light:e.look==="action"?900:0}}const KH=4e3,qj=1500;function Fj(e,n,a,r){var b;const o=k=>k-a;let c=null;for(const k of e)k.state==="running"&&(!c||k.startedAt>=c.startedAt)&&(c=k);const d=[];for(const k of e.filter(S=>S.state!=="running"&&S.endedAt!==null&&Vd(S).firm).sort((S,N)=>S.endedAt-N.endedAt)){const S=o(k.endedAt),N=d.at(-1);N&&k.look==="speech"&&(N.end=Math.min(N.end,Math.max(N.start+qj,S)));const C=Math.max(S,(N==null?void 0:N.end)??0);C-S>KH||d.push({step:k,start:C,end:C+Vd(k).firm})}const f=(c==null?void 0:c.look)==="speech"?c:null;if(f){const k=o(f.startedAt);for(let S=d.length-1;S>=0;S--){const N=d[S];N.start>=k&&N.start>n?d.splice(S,1):N.end>k&&(N.end=Math.max(N.start+qj,k))}}let h=null;for(const k of e){if(k.state==="running"||k.endedAt===null||!Vd(k).light)continue;const S=o(k.endedAt)+Vd(k).light;S>n&&(!h||k.endedAt>=h.step.endedAt)&&(h={step:k,end:S})}const g=d.find(k=>k.start<=n&&n<k.end),v=(g==null?void 0:g.step)??(f||c&&c.look!=="thought"||h==null?void 0:h.step),p=v??f??c??(r?e.at(-1)??null:null),j=[...d.flatMap(k=>[k.start,k.end]),(h==null?void 0:h.end)??0].filter(k=>k>n);return{shown:p,lingering:!!v,next:j.length?Math.min(...j):0,wordsEnd:((b=d.at(-1))==null?void 0:b.end)??0}}const Uj=6e3,$j=500,XH=2e4,QH=10*6e4;function g6(e,n,a,r){var _;const{turn:o,last:c,skew:d}=UH(e),[f,h]=w.useState(null),[g,v]=w.useState(0),[p,j]=w.useState(0),[,b]=w.useState(0),k=w.useRef(new Set),S=w.useMemo(()=>o?Hj(o,n):c?Hj(c,n):[],[o,c,n]);w.useEffect(()=>{for(const z of(o==null?void 0:o.steps)??[])z.state==="failed"&&!k.current.has(z.id)&&(k.current.add(z.id),v(P=>P+1),h({mood:"dizzy",until:Date.now()+2600}))},[o]),w.useEffect(()=>{c&&(k.current.clear(),j(Math.max(Date.now(),Fj(S,Date.now(),d,!1).wordsEnd)+Uj),c.outcome==="completed"&&c.endedAt-c.startedAt>XH&&h({mood:"happy",until:Date.now()+3200}))},[c]);const N=Date.now(),C=Fj(S,N,d,o!==null),M=C.shown,E=S.filter(z=>z.state==="running").sort((z,P)=>P.startedAt-z.startedAt)[0],T=E&&E.look!=="thought"?o0(E):C.lingering&&M?o0(M):E?o0(E):o?{motion:"think",fast:!1}:r,R=!o&&!M&&c!==null&&N<p;return w.useEffect(()=>{const z=[(f==null?void 0:f.until)??0,p-$j,p,C.next].filter(H=>H>Date.now()),P=setTimeout(()=>b(H=>H+1),z.length?Math.min(...z)-Date.now()+20:1e3);return()=>clearTimeout(P)}),{view:{steps:S,shown:M,skew:d,startedAt:((_=o??c)==null?void 0:_.startedAt)??0,endedAt:o?null:(c==null?void 0:c.endedAt)??null,done:R?{ms:c.endedAt-c.startedAt,outcome:c.outcome,fading:N>=p-$j}:null},motion:T.motion,fast:T.fast,mood:f&&f.until>N?f.mood:a,shake:g,canRecap:!o&&c!==null&&!R&&N+d-c.endedAt<QH,showRecap:()=>j(Date.now()+Uj)}}const v6="jarvy-floating-bot",ko=10,ZH=4,Gd=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,Yd=new URLSearchParams(location.search).get("npc")==="demo",JH={zz:l.jsxs(l.Fragment,{children:[l.jsx("i",{children:"z"}),l.jsx("i",{children:"Z"})]}),ask:"?",sweat:l.jsxs("svg",{viewBox:"0 0 20 28",children:[l.jsx("path",{d:"M10 1C10 1 2 13 2 18.5a8 8 0 0 0 16 0C18 13 10 1 10 1Z"}),l.jsx("ellipse",{cx:"7",cy:"18",rx:"1.8",ry:"3"})]}),sparkle:l.jsx("svg",{viewBox:"0 0 100 100",children:[[14,22,9],[86,18,7],[90,46,4.5]].map(([e,n,a])=>l.jsx("path",{d:`M${e} ${n-a}Q${e} ${n} ${e+a} ${n}Q${e} ${n} ${e} ${n+a}Q${e} ${n} ${e-a} ${n}Q${e} ${n} ${e} ${n-a}Z`},e))})};function y6({motion:e}){const n=LI[e];return n?l.jsx("span",{className:"jv-figure-mark","data-mark":n,"aria-hidden":"true",children:JH[n]}):null}function Zf(e){return!e||e.status==="stop"?{motion:"sleep",fast:!1}:e.status!=="running"||e.activity==="asking"?{motion:"idle",fast:!1}:["compacting","retrying","aborting"].includes(e.phase)?{motion:"busy",fast:!1}:e.activity==="tool_calling"||e.phase==="tool"?{motion:"work",fast:!0}:e.activity==="texting"||e.phase==="texting"?{motion:"work",fast:!1}:{motion:"think",fast:!1}}function WH(){try{const e=JSON.parse(localStorage.getItem(v6)??"");if(e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1)return e}catch{}return{x:1,y:0}}function eq({bot:e,chatId:n,status:a,area:r,avoid:o,lastMine:c,onOpen:d}){const f=w.useRef(null),h=w.useRef(null),g=w.useRef(WH()),v=w.useRef(null),p=w.useRef(!1),j=w.useRef(null),[b]=w.useState(()=>new d6),k=b.input,S=b.persona,[N,C]=w.useState(!1),M=w.useRef(null),E=HH(Yd,e.mood),T=g6(Yd?null:e.id,n,e.mood,Zf(a)),R=Yd?E:T;k.motion=R.motion,k.fast=R.fast,k.mood=R.mood;function _(){const O=r.current.getBoundingClientRect(),I=f.current.offsetWidth,$=o.current?o.current.getBoundingClientRect().top-O.top:O.height,Q=Math.max(ko,O.width-I-ko),Y=Math.max(ko,$-I-ko);return{minX:ko,minY:ko,maxX:Q,maxY:Y}}function z(){var Q;const O=(Q=r.current)==null?void 0:Q.getBoundingClientRect(),I=f.current;if(!O||!I)return 0;const $=O.width/2-I.offsetWidth/2;return $>0?Math.max(-1,Math.min(1,($-I.offsetLeft)/$)):0}function P(){var $;if(!f.current||!r.current)return;const O=_(),I=f.current;I.style.left=`${O.minX+g.current.x*(O.maxX-O.minX)}px`,I.style.top=`${O.minY+g.current.y*(O.maxY-O.minY)}px`,($=M.current)==null||$.call(M)}w.useLayoutEffect(()=>{P();const O=new ResizeObserver(P);for(const I of[r.current,o.current,f.current])I&&O.observe(I);return()=>O.disconnect()},[]);const H=a!=null&&a.error?`${a.runId??""}:${a.error}`:null;return w.useEffect(()=>{(H||R.shake)&&b.shake()},[H,R.shake]),w.useEffect(()=>{const O=Q=>{(Q.pointerType==="mouse"||Q.type==="pointerdown")&&(j.current={x:Q.clientX,y:Q.clientY})},I=Q=>{Q.relatedTarget||(j.current=null)},$=Q=>{const Y=Q.target;if(Y.id!=="jarvy-composer")return;const q=Y.getBoundingClientRect();j.current={x:q.left+q.width/2,y:q.top+q.height/2}};return window.addEventListener("pointermove",O),window.addEventListener("pointerdown",O),document.addEventListener("pointerout",I),document.addEventListener("input",$),document.addEventListener("focusin",$),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerdown",O),document.removeEventListener("pointerout",I),document.removeEventListener("input",$),document.removeEventListener("focusin",$)}},[]),f6(S,R,n,c),b.color=(Ca[e.color]??Ca.gray).hex,b.crown=e.agent,w.useEffect(()=>{if(!h.current)return;b.onFrame=()=>{var K;const I=f.current;if(!I)return;const $=I.getBoundingClientRect(),Q=j.current;k.lookX=Q?Math.max(-1,Math.min(1,(Q.x-$.left-$.width/2)/320)):0,k.lookY=Q?Math.max(-1,Math.min(1,(Q.y-$.top-$.height/2)/320)):0;const Y=!!((K=v.current)!=null&&K.moved)&&k.motion==="idle";(k.faceX===void 0||!(Y||k.motion==="sleep"))&&(k.faceX=z());const q=S.playing??"";I.dataset.act!==q&&(q?I.dataset.act=q:delete I.dataset.act)};const O=b.add(h.current,.86);return C(b.start()),()=>{O(),b.stop(),b.onFrame=null}},[]),l.jsxs(l.Fragment,{children:[l.jsxs("button",{ref:f,type:"button",className:"jv-floating-bot","data-live":N||void 0,"data-motion":R.motion,title:e.name,"aria-label":y("avatar.openInfo",{name:e.name}),onPointerDown:O=>{if(O.button!==0)return;const I=O.currentTarget;I.setPointerCapture(O.pointerId),v.current={id:O.pointerId,x:O.clientX,y:O.clientY,left:I.offsetLeft,top:I.offsetTop,moved:!1}},onPointerMove:O=>{const I=v.current;if(!I||I.id!==O.pointerId)return;const $=O.clientX-I.x,Q=O.clientY-I.y;if(!I.moved&&Math.hypot($,Q)<ZH)return;!I.moved&&!Gd()&&S.carry(!0,performance.now()),I.moved=!0;const Y=_(),q=Math.min(Y.maxX,Math.max(Y.minX,I.left+$)),K=Math.min(Y.maxY,Math.max(Y.minY,I.top+Q));g.current={x:Y.maxX>Y.minX?(q-Y.minX)/(Y.maxX-Y.minX):0,y:Y.maxY>Y.minY?(K-Y.minY)/(Y.maxY-Y.minY):0},P()},onPointerUp:O=>{const I=v.current;!I||I.id!==O.pointerId||(v.current=null,p.current=I.moved,I.moved&&(localStorage.setItem(v6,JSON.stringify(g.current)),Gd()||S.carry(!1,performance.now())))},onPointerCancel:()=>{v.current=null,Gd()||S.carry(!1,performance.now())},onClick:()=>{if(p.current){p.current=!1;return}Gd()||S.play("poke",performance.now()),R.canRecap?R.showRecap():d()},style:{"--jv-avatar-size":"100%"},children:[l.jsx("canvas",{ref:h,"aria-hidden":"true"}),!N&&l.jsx(_a,{color:e.color,mood:R.mood,size:88,crown:e.agent,asleep:R.motion==="sleep"}),l.jsx(y6,{motion:R.motion})]}),l.jsx(m6,{view:R.view,name:e.name,cat:f,area:r,avoid:o,layout:M,facing:z,toolbar:Yd?(O,I)=>l.jsx(OH,{controls:E.controls,toolbar:O,onReplay:()=>{I(),E.controls.replay()}}):void 0})]})}function tq({className:e,...n}){return l.jsx("div",{"data-slot":"card",className:Dn("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...n})}function nq({className:e,...n}){return l.jsx("div",{"data-slot":"card-header",className:Dn("grid gap-1 px-5",e),...n})}function iq({className:e,...n}){return l.jsx("div",{"data-slot":"card-title",className:Dn("font-semibold leading-none",e),...n})}function aq({className:e,...n}){return l.jsx("div",{"data-slot":"card-content",className:Dn("px-5",e),...n})}function rq({bot:e,connections:n,onSaved:a,onManage:r}){return l.jsxs(tq,{className:"jarvy-model-picker jv-ui",children:[l.jsx(nq,{children:l.jsx(iq,{children:y("botModel.pickFor",{name:e.name})})}),l.jsx(aq,{children:l.jsx(xS,{bot:e,connections:n,onSaved:a,onManage:r})})]})}function lq({chat:e,inChannel:n,bots:a,members:r,meId:o,drafts:c,composeReady:d,botName:f,activeBot:h,status:g,connections:v,activity:p,history:j,divider:b,activeQuestion:k,pane:S,onPane:N,onToggleInfo:C,find:M,onNav:E,onBot:T,hasBotDirects:R,onInvite:_,onQuote:z,onReply:P,onReact:H,onFold:O,onJump:I,onSettled:$,onSend:Q,onPreview:Y,onSaveNote:q,notice:K,createBot:V,creating:X,updateBot:Z,onManageModels:D,error:se,chatArea:ne,transcript:B,composeWrap:F,hidden:ee,onOpenThread:W,onBotCard:de}){var Ke;const{messages:oe,loading:be,hasOlder:we,loadingOlder:ve,top:re,away:Ce,unseen:Ve,toLatest:He}=j,Ze=oe.filter(gt=>gt.senderId===o),Fe=(Ke=Ze[Ze.length-1])==null?void 0:Ke.id;return l.jsxs("main",{className:"ui-chat","aria-label":y("chat.area"),ref:ne,hidden:ee,children:[!n&&l.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only jv-floating-nav",label:y("common.openNav"),onClick:E}),!n&&R&&l.jsx(vt,{icon:"people",className:"jv-floating-dms",label:y("chat.botDms",{name:f}),"aria-pressed":(S==null?void 0:S.kind)==="botdms",onClick:()=>N((S==null?void 0:S.kind)==="botdms"?null:{kind:"botdms"})}),l.jsx("span",{className:"sr-only",role:"status","aria-label":y("chat.botStatus"),children:n?"":p}),e?l.jsxs(l.Fragment,{children:[n?l.jsx(VP,{chat:e,members:Na(r),bots:a,onNav:E,infoOpen:(S==null?void 0:S.kind)==="info"&&S.page==="main",onInfo:()=>C("main"),membersOpen:(S==null?void 0:S.kind)==="info"&&S.page==="members",onMembers:()=>C("members"),threadsOpen:(S==null?void 0:S.kind)==="threads",onThreads:()=>N((S==null?void 0:S.kind)==="threads"?null:{kind:"threads"}),searchOpen:(S==null?void 0:S.kind)==="search",onSearch:()=>(S==null?void 0:S.kind)==="search"?N(null):M.search(e)}):h&&!ee&&l.jsx(eq,{bot:h,chatId:e.id,status:g,area:ne,avoid:F,lastMine:Fe,onOpen:()=>T(h.id)}),n&&l.jsx(GP,{chat:e,onSave:q}),l.jsxs("div",{className:"jv-transcript",children:[l.jsxs("div",{className:`ui-transcript jarvy-transcript${n?" jv-channel-transcript":""}`,ref:B,"aria-label":y("chat.transcript"),role:"log",children:[!n&&!(h!=null&&h.connectionId)&&h&&l.jsx("div",{className:"jarvy-model-onboarding",children:l.jsx(rq,{bot:h,connections:v,onSaved:Z,onManage:D})}),be?l.jsx("p",{className:"jarvy-empty-text",children:y("chat.loading")}):oe.length===0?n?l.jsx("div",{className:"jarvy-empty-chat",children:l.jsx("p",{children:y("chat.empty")})}):h!=null&&h.connectionId?l.jsx("div",{className:"jarvy-empty-chat",children:l.jsx("h2",{children:y("chat.start",{name:f})})}):null:l.jsxs(l.Fragment,{children:[we&&l.jsx("div",{ref:re,className:"jv-history-more","aria-live":"polite",children:ve?y("chat.loadingOlder"):""}),n?l.jsx(wf,{messages:oe,members:r,bots:a,me:o,divider:b,activeQuestion:k,onSettled:$,onPreview:Y,onReply:P,onOpenThread:W,onQuote:z,onReact:H,onFold:O,onJump:I,onBotCard:de,onError:se}):l.jsx(u6,{messages:oe,members:r,me:o,activeQuestion:k,bot:h,onSettled:$,onPreview:Y,onQuote:z,onReact:H,onFold:O,onJump:I,onBotCard:de,onError:se})]})]}),Ce&&oe.length>0&&l.jsx("div",{className:"jv-to-latest",children:l.jsxs("button",{type:"button",onClick:He,"aria-label":y("chat.toLatest"),children:[Ve>0&&l.jsx("span",{children:y("chat.unseen",{count:Ve})}),l.jsx(Pe,{name:"chevron-down"})]})})]}),l.jsx(Eg,{chatId:e.id,id:"jarvy-composer",drafts:c,formRef:F,scrollRef:B,disabled:!d,placeholder:n?y("chat.toChannel",{name:e.title}):h!=null&&h.connectionId?y("chat.toBot",{name:f}):y("chat.pickModel"),mention:n?{bots:a,inside:Na(r).filter(gt=>gt.id!==o&&e.memberIds.includes(gt.id)),outside:Na(r).filter(gt=>!e.memberIds.includes(gt.id)),onInvite:gt=>_(e.id,gt)}:void 0,onSend:Q,onError:se,onNotice:K})]}):l.jsx("div",{className:"jarvy-empty-chat jarvy-first-chat",children:a.length?l.jsx("p",{children:y("chat.pick")}):l.jsxs("button",{className:"ui-button ui-primary",onClick:V,disabled:X,children:[l.jsx(Pe,{name:"person-add"}),y("sidebar.newBot")]})}),e&&l.jsx(Cg,{container:B,drafts:c,chatId:e.id,source:gt=>oe.find(qt=>qt.id===gt),members:r,onNotice:K})]})}const sq=10,Vj=288,Mr=12,oq=620;function cq(e,n,a){const r=Math.max(Mr,n.height-a-Mr),o=h=>Math.min(Math.max(Mr,h),r);if(n.width>oq)return{left:Math.min(Math.max(Mr,e.right+sq),n.width-Vj-Mr),top:o(e.top-8),width:Vj};const c=e.bottom+6,d=e.top-6-a,f=c+a+Mr<=n.height?c:d>=Mr?d:o(c);return{left:Mr,top:f,width:n.width-Mr*2}}function uq({bot:e,status:n,connections:a,anchor:r,onClose:o,onMessage:c,onInfo:d}){var b;const f=w.useRef(null);w.useEffect(()=>{const k=C=>{var E;const M=C.target;(E=f.current)!=null&&E.contains(M)||M!=null&&M.closest(".jv-avatar-button")||o()},S=C=>{C.key==="Escape"&&o()},N=C=>{var M;(M=f.current)!=null&&M.contains(C.target)||o()};return document.addEventListener("pointerdown",k),document.addEventListener("keydown",S),document.addEventListener("scroll",N,!0),()=>{document.removeEventListener("pointerdown",k),document.removeEventListener("keydown",S),document.removeEventListener("scroll",N,!0)}},[]),w.useEffect(()=>{var k;(k=f.current)==null||k.focus({preventScroll:!0})},[e.id]);const[h,g]=w.useState(0);w.useLayoutEffect(()=>{f.current&&g(f.current.offsetHeight)},[e.id,r]);const v=qS(e,n),p=(b=a.find(k=>k.id===e.connectionId))==null?void 0:b.models.find(k=>k.id===e.modelId),j=cq(r,{width:window.innerWidth,height:window.innerHeight},h);return Ol.createPortal(l.jsxs("div",{ref:f,className:"jv-bot-card",role:"dialog","aria-label":e.name,tabIndex:-1,style:j,children:[l.jsxs("header",{className:"jv-bot-card-head",children:[l.jsx(_a,{color:e.color,mood:e.mood,size:44,crown:e.agent,asleep:(n==null?void 0:n.status)==="stop"}),l.jsxs("div",{children:[l.jsx("h2",{children:e.name}),l.jsx("span",{className:"jv-bot-card-role",children:e.agent?y("botCard.agent"):"Bot"})]})]}),e.description&&l.jsx("p",{className:"jv-bot-card-about",children:e.description}),l.jsxs("dl",{className:"jv-bot-card-facts",children:[l.jsxs("div",{children:[l.jsx("dt",{children:y("botCard.state")}),l.jsx("dd",{"data-tone":v.tone,children:v.label})]}),l.jsxs("div",{children:[l.jsx("dt",{children:y("botCard.worksIn")}),l.jsx("dd",{children:EP(e)})]}),p&&l.jsxs("div",{children:[l.jsx("dt",{children:y("usage.model")}),l.jsx("dd",{title:p.name,children:p.name})]})]}),l.jsxs("div",{className:"jv-bot-card-actions",children:[l.jsx(Ee,{type:"button",className:"jv-primary",size:"sm",onClick:()=>{c(),o()},children:y("botCard.message")}),l.jsx(Ee,{type:"button",variant:"outline",size:"sm",onClick:()=>{d(),o()},children:y("botCard.info")})]})]}),document.body)}class dq{constructor(){qe(this,"listeners",new Set)}emit(n){for(const a of this.listeners)a(n)}on(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}}function Tg(e,n){const a=w.useRef(n);a.current=n,w.useEffect(()=>e.on(r=>a.current(r)),[e])}const cu=(e,n)=>e.some(a=>a.id===n.id)?e.map(a=>a.id===n.id?n:a):e;function Jf(e,n){if(e.some(r=>r.id===n.id))return cu(e,n);if(e[0]&&n.sequence<e[0].sequence)return e;const a=e.findIndex(r=>r.sequence>n.sequence);return a<0?[...e,n]:[...e.slice(0,a),n,...e.slice(a)]}const Mg=(e,n)=>e.sequence>n+1;function x6(e,n,a){var o;const r=((o=n.at(-1))==null?void 0:o.sequence)??a;return[...e.filter(c=>c.sequence<=a),...n,...e.filter(c=>c.sequence>r)]}const fq=e=>Si(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function hq(e,n){const[a,r]=w.useState([]);return w.useEffect(()=>{if(r([]),!e)return;let o=!0;return he.botDirects(e).then(c=>{o&&r(c.chats)}).catch(()=>{}),()=>{o=!1}},[e,n]),a}function mq({bot:e,chats:n,members:a,bots:r,me:o,live:c,onClose:d,onPreview:f,onError:h}){const[g,v]=w.useState(null),[p,j]=w.useState(null),[b,k]=w.useState(0);w.useEffect(()=>{if(!g){j(null);return}let C=!0;return he.messages(g).then(M=>{C&&j(M.messages)}).catch(M=>{C&&h(M)}),()=>{C=!1}},[g,b]),w.useEffect(()=>j(null),[g]),Tg(c,C=>{if(C.kind==="reconnected"){k(E=>E+1);return}if(C.kind==="chat"||C.message.chatId!==g)return;const M=C.message;j(E=>E&&(C.kind==="message"?Jf(E,M):cu(E,M)))});const S=C=>a.find(M=>M.id!==e.id&&C.memberIds.includes(M.id)),N=n.find(C=>C.id===g);return l.jsxs("aside",{className:"ui-pane jv-pane","aria-label":y("chat.botDms",{name:e.name}),children:[l.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[N&&l.jsx(vt,{icon:"chevron-left",label:y("directs.back"),onClick:()=>v(null)}),l.jsx("strong",{children:N?y("directs.between",{name:e.name,other:Ta(S(N))}):y("chat.botDms",{name:e.name})}),l.jsx("span",{className:"jv-spacer"}),l.jsx(vt,{icon:"close",label:y("common.close"),onClick:d})]}),N?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"ui-pane-body jv-pane-body",children:p===null?l.jsx("p",{className:"jv-picker-empty",children:y("threads.loading")}):p.length===0?l.jsx("p",{className:"jv-picker-empty",children:y("chat.empty")}):l.jsx(wf,{messages:p,members:a,bots:r,me:o,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:f})}),l.jsx("p",{className:"jv-readonly",children:y("directs.readOnly")})]}):l.jsx("div",{className:"ui-pane-body jv-pane-body",children:n.length===0?l.jsx("p",{className:"jv-picker-empty",children:y("sidebar.noDms")}):n.map(C=>{const M=S(C);return l.jsxs("button",{type:"button",className:"jv-thread-item",onClick:()=>v(C.id),children:[l.jsxs("span",{className:"jv-thread-item-head",children:[l.jsx(lr,{member:M,bots:r,size:20}),l.jsx("strong",{children:Ta(M)}),l.jsx("span",{className:"jv-muted",children:fq(C.updatedAt)})]}),C.lastMessage&&l.jsx("span",{className:"jv-muted jv-thread-item-meta",children:Os(C.lastMessage)})]},C.id)})})]})}function pq({x:e,y:n,admin:a,onAdmin:r,onRemove:o,onClose:c}){const d=w.useRef(null);w.useEffect(()=>{const h=v=>{var p;(p=d.current)!=null&&p.contains(v.target)||c()},g=v=>{v.key==="Escape"&&c()};return document.addEventListener("pointerdown",h),document.addEventListener("keydown",g),()=>{document.removeEventListener("pointerdown",h),document.removeEventListener("keydown",g)}},[c]);const f={right:Math.max(8,window.innerWidth-e),top:Math.max(8,Math.min(n,window.innerHeight-100))};return l.jsxs("div",{ref:d,className:"ui-popover jv-entry-menu",role:"menu","aria-label":y("members.menu"),style:f,children:[a!==null&&l.jsxs(l.Fragment,{children:[l.jsx("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{r(),c()},children:l.jsx("span",{className:"ui-menu-copy",children:y(a?"members.removeAdmin":"members.makeAdmin")})}),l.jsx("hr",{className:"ui-menu-divider"})]}),l.jsx("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{o(),c()},children:l.jsx("span",{className:"ui-menu-copy",children:y("members.removeFromChannel")})})]})}function gq({channel:e,members:n,bots:a,statuses:r,me:o,onAdd:c,onBot:d,onChanged:f,onError:h}){const[g,v]=w.useState(null),[p,j]=w.useState(null),b=async(M,E)=>{try{f(await he.setAdmin(e.id,M.id,E))}catch(T){h(T)}},k=n.filter(M=>e.memberIds.includes(M.id)),S=k.filter(M=>M.kind!=="bot").sort((M,E)=>+(E.id===o)-+(M.id===o)),N=k.filter(M=>M.kind==="bot"),C=M=>{const E=M.kind==="bot"?a.find(z=>z.id===M.id):void 0,T=r[M.id],R=M.kind==="bot"?qS(E,T):void 0,_=l.jsxs(l.Fragment,{children:[l.jsx(lr,{member:M,bots:a,size:28,working:(T==null?void 0:T.status)==="running"&&T.activity!=="asking"}),l.jsxs("span",{className:"jv-member-name",children:[M.name,M.id===o&&l.jsx("span",{className:"jv-role",children:y("common.you")}),M.id===e.createdBy?l.jsx("span",{className:"jv-role",children:y("members.creator")}):e.adminIds.includes(M.id)&&l.jsx("span",{className:"jv-role",children:y("members.admin")})]}),R&&l.jsx("span",{className:"jv-member-state","data-tone":R.tone,children:R.label})]});return l.jsxs("div",{className:"jv-member-row",children:[E?l.jsx("button",{type:"button",className:"jv-member-main","aria-label":y("members.view",{name:M.name}),onClick:()=>d(M.id),children:_}):l.jsx("div",{className:"jv-member-main",children:_}),M.id!==o&&l.jsx(vt,{icon:"more",label:y("members.more",{name:M.name}),className:"jv-member-remove",onClick:z=>{const P=z.currentTarget.getBoundingClientRect();j({member:M,x:P.right,y:P.bottom+4})}})]},M.id)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"jv-member-bar",children:[l.jsx("span",{children:y("members.count",{count:k.length})}),l.jsxs("button",{type:"button",className:"ui-button ui-primary jv-member-pane-add",onClick:c,children:[l.jsx(Pe,{name:"person-add"}),y("common.add")]})]}),l.jsx("div",{className:"ui-pane-body jv-pane-body",children:[["people",y("members.people"),S],["bots","Bot",N]].map(([M,E,T])=>T.length>0&&l.jsxs("section",{className:"jv-member-group","aria-label":E,children:[l.jsxs("h3",{children:[E," · ",T.length]}),T.map(C)]},M))}),p&&l.jsx(pq,{x:p.x,y:p.y,onClose:()=>j(null),onRemove:()=>v(p.member),admin:p.member.kind==="bot"&&p.member.id!==e.createdBy?e.adminIds.includes(p.member.id):null,onAdmin:()=>void b(p.member,!e.adminIds.includes(p.member.id))}),g&&l.jsx(t6,{title:y("members.removeTitle",{name:g.name,channel:e.title}),body:y("members.removeBody"),confirm:y("members.removeConfirm"),onClose:()=>v(null),onConfirm:async()=>{try{f(await he.removeMember(e.id,g.id)),v(null)}catch(M){h(M)}}})]})}function Gj({label:e,value:n,empty:a,maxLength:r,required:o=!1,onSave:c}){const d=w.useId(),[f,h]=w.useState(null),[g,v]=w.useState(!1);w.useEffect(()=>h(null),[n]);const p=async()=>{if(!(f===null||g||o&&!f.trim())){if(f.trim()===n){h(null);return}v(!0);try{await c(f.trim()),h(null)}catch{}finally{v(!1)}}};return l.jsxs("div",{className:"jv-info-field",children:[l.jsxs("div",{className:"jv-info-label",children:[l.jsx("label",{htmlFor:d,children:e}),f===null&&l.jsx(vt,{icon:"pencil",label:y("info.edit",{name:e}),className:"jv-info-edit",onClick:()=>h(n)})]}),f===null?l.jsx("p",{className:"jv-info-value","data-empty":!n||void 0,children:n||a}):l.jsxs("div",{className:"jv-inline-edit",children:[l.jsx("input",{id:d,value:f,maxLength:r,autoFocus:!0,placeholder:a,onChange:j=>h(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.nativeEvent.isComposing&&(j.preventDefault(),p()),j.key==="Escape"&&(j.stopPropagation(),h(null))}}),l.jsx("button",{type:"button",className:"ui-button",onClick:()=>h(null),children:y("common.cancel")}),l.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:g||o&&!f.trim(),onClick:()=>void p(),children:y("common.save")})]})]})}function vq({channel:e,page:n,sections:a,members:r,bots:o,statuses:c,me:d,onPage:f,onPin:h,onMute:g,onAdd:v,onBot:p,onDelete:j,onChanged:b,onClose:k,onError:S}){const N=w.useId(),C=async E=>{try{b(await he.updateChannel(e.id,E))}catch(T){throw S(T),T}},M=r.filter(E=>e.memberIds.includes(E.id)).length;return l.jsxs("aside",{className:"ui-pane jv-pane","aria-label":y(n==="members"?"info.memberList":"entry.channelInfo"),children:[l.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[n==="members"&&l.jsx(vt,{icon:"chevron-left",label:y("info.back"),className:"jv-pane-back",onClick:()=>f("main")}),l.jsx("strong",{children:y(n==="members"?"channel.members":"entry.channelInfo")}),l.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),l.jsx("span",{className:"jv-spacer"}),l.jsx(vt,{icon:"close",label:y("common.close"),onClick:k})]}),n==="members"?l.jsx(gq,{channel:e,members:r,bots:o,statuses:c,me:d,onAdd:v,onBot:p,onChanged:b,onError:S}):l.jsxs("div",{className:"ui-pane-body jv-pane-body jv-info",children:[l.jsxs("div",{className:"jv-info-actions",children:[l.jsxs("button",{type:"button","aria-pressed":e.pinned,onClick:h,children:[l.jsx(Pe,{name:"pin"}),y("entry.pin")]}),l.jsxs("button",{type:"button","aria-pressed":e.muted,onClick:g,children:[l.jsx(Pe,{name:e.muted?"bell-slash":"bell"}),y("entry.mute")]}),l.jsxs("button",{type:"button",onClick:v,children:[l.jsx(Pe,{name:"person-add"}),y("info.addMembers")]})]}),l.jsx(Gj,{label:y("info.name"),value:e.title,empty:y("info.newChannel"),maxLength:80,required:!0,onSave:E=>C({name:E})}),l.jsx(Gj,{label:y("info.topic"),value:e.topic,empty:y("info.noTopic"),maxLength:200,onSave:E=>C({topic:E})}),l.jsxs("div",{className:"jv-info-field",children:[l.jsx("div",{className:"jv-info-label",children:l.jsx("label",{htmlFor:N,children:y("info.section")})}),l.jsx(MS,{id:N,value:e.sectionId,sections:a,onChange:E=>void C({sectionId:E}).catch(()=>{})})]}),l.jsxs("nav",{className:"jv-info-menu","aria-label":y("info.menu"),children:[l.jsxs("button",{type:"button",className:"ui-menu-item",onClick:()=>f("members"),children:[l.jsx(Pe,{name:"people"}),l.jsx("span",{className:"ui-menu-copy",children:y("channel.members")}),l.jsx("span",{className:"jv-muted",children:M}),l.jsx(Pe,{name:"chevron-right"})]}),l.jsxs("button",{type:"button",className:"ui-menu-item jv-menu-danger",onClick:j,children:[l.jsx(Pe,{name:"trash"}),l.jsx("span",{className:"ui-menu-copy",children:y("entry.deleteChannel")})]})]})]})]})}function yq({chat:e,chats:n,members:a,focusKey:r,onOpenMessage:o,onClose:c,onError:d}){const[f,h]=w.useState(""),g=w.useRef(null);w.useEffect(()=>{var b,k;(b=g.current)==null||b.focus(),(k=g.current)==null||k.select()},[r,e.id]);const{result:v,loading:p}=n6(f,e.id,d),j=e.type==="channel"?`#${e.title}`:y(e.type==="thread"?"search.inThread":"search.inDm");return l.jsxs("aside",{className:"ui-pane jv-pane jv-search-pane","aria-label":y("search.paneLabel"),children:[l.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[l.jsx("strong",{children:y("search.title")}),l.jsx("span",{className:"jv-muted jv-pane-sub",children:j}),l.jsx("span",{className:"jv-spacer"}),l.jsx(vt,{icon:"close",label:y("search.close"),onClick:c})]}),l.jsx("div",{className:"jv-pane-search",children:l.jsx("input",{ref:g,type:"search",value:f,placeholder:y(e.type==="channel"?"search.channelPlaceholder":"search.placeholder"),"aria-label":y("search.placeholder"),onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Escape"&&(b.preventDefault(),f?h(""):c())}})}),l.jsx("div",{className:"ui-pane-body jv-pane-body jv-results","aria-live":"polite",children:f.trim()?v?v.messages.length?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"jv-result-count",children:y(v.messages.length>=60?"search.countLatest":"search.count",{count:v.messages.length})}),v.messages.map(({message:b,chat:k})=>l.jsx(r6,{message:b,chat:k,chats:n,members:a,query:f,showPlace:k.id!==e.id,onOpen:o},b.id))]}):l.jsx("p",{className:"jv-result-empty",children:y("search.noMessages")}):p&&l.jsx("p",{className:"jv-result-empty",children:y("search.searching")}):l.jsx("p",{className:"jv-result-empty",children:y("search.prompt")})})]})}const xq=e=>Si(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function bq({chat:e,channelName:n,expanded:a=!1,onTitle:r,onStatus:o,onSummary:c,onConclude:d}){var E;const[f,h]=w.useState(null),[g,v]=w.useState(null),[p,j]=w.useState(!1),[b,k]=w.useState(a);w.useEffect(()=>{h(null),v(null),k(a)},[e.id,a]);const S=async(T,R)=>{j(!0);try{await T(),R()}catch{}finally{j(!1)}},N=e.status==="done",C=e.note,M=((E=C==null?void 0:C.text.split(`
|
|
814
814
|
`).find(T=>T.trim()&&!T.startsWith("#")))==null?void 0:E.replace(/[*`|>-]/g,"").trim())??"";return l.jsxs("div",{className:"jv-thread-meta","data-open":b||void 0,children:[l.jsxs("div",{className:"jv-thread-title-row",children:[f===null?l.jsxs(l.Fragment,{children:[l.jsx("h2",{className:"jv-thread-title",title:e.title,children:e.title}),l.jsx(vt,{icon:"pencil",label:y("thread.rename"),onClick:()=>h(e.title)})]}):l.jsxs("form",{className:"jv-inline-edit",onSubmit:T=>{T.preventDefault(),f.trim()&&S(()=>r(f.trim()),()=>h(null))},children:[l.jsx("input",{value:f,autoFocus:!0,maxLength:80,"aria-label":y("thread.title"),onChange:T=>h(T.target.value),onKeyDown:T=>{T.key==="Escape"&&h(null)}}),l.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:p||!f.trim(),children:y("common.save")})]}),l.jsx("button",{type:"button",className:"jv-thread-status","data-done":N||void 0,disabled:p,title:y("thread.toggleStatus"),onClick:()=>void S(()=>o(N?"open":"done"),()=>{}),children:N?l.jsxs(l.Fragment,{children:[l.jsx(Pe,{name:"check"}),y("channel.threadDone")]}):y("threads.open")})]}),g!==null?l.jsxs("div",{className:"jv-summary","data-editing":!0,children:[l.jsx("textarea",{className:"jv-notice-input",value:g,autoFocus:!0,"aria-label":y("thread.summary"),onChange:T=>v(T.target.value)}),l.jsxs("div",{className:"jv-notice-actions",children:[l.jsx("button",{type:"button",className:"ui-button",onClick:()=>v(null),children:y("common.cancel")}),l.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:p||!g.trim(),onClick:()=>void S(()=>c(g.trim()),()=>v(null)),children:y("common.save")})]})]}):C?l.jsxs("div",{className:"jv-summary",children:[l.jsxs("div",{className:"jv-summary-head",children:[l.jsxs("button",{type:"button",className:"jv-summary-toggle","aria-expanded":b,onClick:()=>k(!b),children:[l.jsx("strong",{children:y("thread.summary")}),!b&&l.jsx("span",{className:"jv-summary-first",children:M}),l.jsx(Pe,{name:b?"chevron-down":"chevron-right"})]}),b&&l.jsxs("span",{className:"jv-muted jv-summary-meta",children:[C.updatedBy.name," · ",xq(C.updatedAt)," · ",y("notice.version",{version:C.version})]}),l.jsx(vt,{icon:"pencil",label:y("thread.editSummary"),onClick:()=>v(C.text)})]}),b&&l.jsx("div",{className:"jv-summary-body ui-bubble jv-flat",children:l.jsx(qo,{text:C.text})}),b&&!N&&l.jsxs("button",{type:"button",className:"ui-button jv-conclude",disabled:p,onClick:()=>void S(d,()=>{}),children:[l.jsx(Pe,{name:"check"}),y("thread.conclude",{channel:n})]})]}):l.jsxs("button",{type:"button",className:"jv-summary-empty",onClick:()=>v(""),children:[l.jsx(Pe,{name:"add"}),y("thread.addSummary")]})]})}const jq=20,Yj=500;class b6{constructor(){qe(this,"kept",new Map)}take(n){const a=this.kept.get(n);return this.kept.delete(n),a}keep(n,a){if(this.kept.delete(n),!(a.messages.length>Yj)){this.kept.set(n,a);for(const r of this.kept.keys()){if(this.kept.size<=jq)break;this.kept.delete(r)}}}removed(n){var a;for(const[r,o]of this.kept)(r===n||((a=o.chat)==null?void 0:a.parentId)===n)&&this.kept.delete(r)}clear(){this.kept.clear()}heard(n){var c;if(n.kind==="reconnected")return;if(n.kind==="chat"){const d=this.kept.get(n.chat.id);d!=null&&d.chat&&(d.chat=n.chat);return}const a=n.message;for(const d of this.kept.values())((c=d.root)==null?void 0:c.id)===a.id&&(d.root=a);const r=this.kept.get(a.chatId);if(!r)return;if(n.kind==="updated"||r.messages.some(d=>d.id===a.id)){r.messages=cu(r.messages,a);return}const o=r.messages.at(-1);if(o&&Mg(a,o.sequence)||r.messages.length>=Yj){this.kept.delete(a.chatId);return}r.messages=Jf(r.messages,a)}}function j6(e,n){if(e.scrollHeight-e.scrollTop-e.clientHeight<n)return{bottom:!0};const a=e.getBoundingClientRect();let r;for(const o of e.querySelectorAll("[data-message]")){const c=o.getBoundingClientRect();if(c.bottom<=a.top)continue;const d={bottom:!1,id:o.dataset.message,offset:c.top-a.top};if(c.top>=a.top&&c.top<a.bottom)return d;if(r??(r=d),c.top>=a.bottom)break}return r??{bottom:!0}}function Sf(e,n){if(n.bottom)return!1;const a=e.querySelector(`[data-message="${n.id}"]`);return a?(e.scrollTo({top:e.scrollTop+a.getBoundingClientRect().top-e.getBoundingClientRect().top-n.offset,behavior:"instant"}),!0):!1}class w6{constructor(){qe(this,"stop")}get on(){return this.stop!==void 0}start(n,a){this.release();const r=new ResizeObserver(()=>Sf(n,a));for(const d of n.children)r.observe(d);const o=["wheel","touchstart","pointerdown","keydown"],c=()=>this.release();for(const d of o)n.addEventListener(d,c,{passive:!0});this.stop=()=>{r.disconnect();for(const d of o)n.removeEventListener(d,c)}}release(){var n;(n=this.stop)==null||n.call(this),this.stop=void 0}}const c0=50;function Kj({threadId:e,mode:n,showSummary:a=!1,focus:r,onSearch:o,channel:c,drafts:d,members:f,bots:h,me:g,live:v,memory:p,onClose:j,onToggleMode:b,onNav:k,onChanged:S,onInvite:N,onPreview:C,onError:M,onNotice:E,onOpenMessage:T,onBotCard:R}){var Ln;const[_,z]=w.useState(null),[P,H]=w.useState(null),[O,I]=w.useState([]),[$,Q]=w.useState(null),[Y,q]=w.useState(!1),[K,V]=w.useState(!1),X=w.useRef(O),Z=w.useRef(Y),D=w.useRef(null),se=w.useRef(null),ne=w.useRef(!1);X.current=O,Z.current=Y;const B=w.useRef(null),F=w.useRef(null),ee=w.useRef(null),W=w.useRef(!1),de=w.useRef(!0),[oe,be]=w.useState(!1),we=w.useRef(0),ve=w.useRef(0),re=w.useRef(0),Ce=w.useRef({bottom:!0}),Ve=w.useRef(null),He=w.useRef(_),Ze=w.useRef(P),[Fe]=w.useState(()=>new w6),Ke=w.useRef(!1);He.current=_,Ze.current=P,w.useEffect(()=>{z(null),H(null),I([]),q(!1),Q(null),W.current=!1,de.current=!0,be(!1),we.current=0,ve.current=0,re.current=0},[e]);const gt=async me=>{const Ne=await he.message(me).catch(()=>null);if(!Ne||Ne.chatId!==e)return(Ne==null?void 0:Ne.chatId)??null;const _e=Math.max(0,Ne.sequence-1-c0/2);return{...await he.messages(e,_e),hasOlder:_e>0}},qt=async()=>{const me=X.current[0];if((me==null?void 0:me.chatId)===e)return{...await he.messages(e,me.sequence-1),after:me.sequence-1};const Ne=r&&ee.current!==e?await gt(r.id):null;return Ne&&typeof Ne=="object"?Ne:await he.latestMessages(e,c0)},Zt=me=>{const Ne=me.after;I(_e=>Ne===void 0?me.messages:x6(_e.filter(Be=>Be.chatId===e),me.messages,Ne)),me.hasOlder!==void 0&&q(me.hasOlder)},en=me=>{const Ne=X.current,_e=Ne.at(-1),Be=Math.max((_e==null?void 0:_e.chatId)===e?_e.sequence:0,re.current);if(Mg(me,Be)&&!Ne.some(Oe=>Oe.id===me.id)){qt().then(Zt).catch(M);return}re.current=Math.max(re.current,me.sequence),I(Oe=>Jf(Oe,me))};Tg(v,me=>{if(me.kind==="reconnected"){if(!W.current)return;Ke.current=!0,Promise.all([he.chat(e),qt()]).then(async([_e,Be])=>{z(_e),Zt(Be),Ke.current=!1,_e.rootMessageId&&H(await he.message(_e.rootMessageId))}).catch(M);return}if(me.kind==="chat"){const _e=me.chat;_e.id===e&&z(Be=>Be&&{..._e,readSequence:Math.max(Be.readSequence,_e.readSequence)});return}const Ne=me.message;Ne.id===(P==null?void 0:P.id)?H(Ne):Ne.chatId===e&&(me.kind==="message"?en(Ne):I(_e=>cu(_e,Ne)))});const kn=async()=>{var _e;const me=X.current[0],Ne=B.current;if(!(!me||!Z.current||ne.current)){ne.current=!0,V(!0);try{const Be=await he.olderMessages(e,me.sequence,c0);if(((_e=X.current[0])==null?void 0:_e.id)!==me.id)return;se.current=Ne?Ne.scrollHeight-Ne.scrollTop:null,I(Oe=>{var dt;return((dt=Oe[0])==null?void 0:dt.id)===me.id?[...Be.messages,...Oe]:Oe}),q(Be.hasOlder)}catch(Be){M(Be)}finally{ne.current=!1,V(!1)}}};w.useEffect(()=>{let me=!0;Ce.current={bottom:!0},Ve.current=null;const Ne=()=>{me=!1,Fe.release();const Be=He.current;W.current&&!Ke.current&&(Be==null?void 0:Be.id)===e&&p.keep(e,{messages:X.current.filter(Oe=>Oe.chatId===e),hasOlder:Z.current,place:Ce.current,seen:we.current,chat:Be,root:Ze.current})},_e=r?void 0:p.take(e);return _e!=null&&_e.chat?(Ve.current=_e.place,we.current=_e.seen,z(_e.chat),H(_e.root??null),I(_e.messages),q(_e.hasOlder),ee.current!==e&&(ee.current=e,Q(_e.chat.readSequence)),Ne):(Promise.all([he.chat(e),qt()]).then(async([Be,Oe])=>{if(me&&(z(Be),Zt(Oe),ee.current!==e&&(ee.current=e,Q(Be.readSequence)),Be.rootMessageId)){const dt=await he.message(Be.rootMessageId);me&&H(dt)}}).catch(Be=>{me&&M(Be)}),Ne)},[e]),w.useLayoutEffect(()=>{const me=B.current;if(!me||!_)return;if(se.current!==null){me.scrollTo({top:me.scrollHeight-se.current,behavior:"instant"}),se.current=null;return}const Ne=()=>me.scrollTo({top:me.scrollHeight,behavior:"instant"}),_e=O.at(-1),Be=(_e==null?void 0:_e.senderId)===g&&_e.sequence>ve.current;if(ve.current=Math.max(ve.current,(_e==null?void 0:_e.sequence)??0),W.current)(de.current||Be)&&(Fe.release(),me.scrollTo({top:me.scrollHeight,behavior:"smooth"}));else{if(!O.length&&!P)return;W.current=!0;const Oe=r?me.querySelector(`[data-message="${r.id}"]`):null;if(Oe){if(de.current=!1,Oe.scrollIntoView({block:"center"}),r!=null&&r.passage&&$S(Oe,r.passage))return;Oe.classList.add("jv-jump"),setTimeout(()=>Oe.classList.remove("jv-jump"),1600);return}const dt=Ve.current;if(Ve.current=null,dt&&Sf(me,dt)){de.current=!1,Ce.current=dt,Fe.start(me,dt),be(!0);return}Ne(),requestAnimationFrame(Ne)}(de.current||Be)&&(we.current=(_e==null?void 0:_e.sequence)??0)},[O,P,_]),w.useLayoutEffect(()=>{const me=B.current,Ne=Ce.current;me&&W.current&&Sf(me,Ne)&&Fe.start(me,Ne)},[n]),w.useEffect(()=>{W.current&&r&&Me(r.id,r.passage)},[r]),w.useEffect(()=>{const me=B.current,Ne=D.current;if(!me||!Ne||!Y||!W.current)return;const _e=new IntersectionObserver(Be=>{var Oe;(Oe=Be[0])!=null&&Oe.isIntersecting&&W.current&&kn()},{root:me,rootMargin:"400px 0px 0px 0px"});return _e.observe(Ne),()=>_e.disconnect()},[Y,O,e,_]),w.useEffect(()=>{const me=B.current,Ne=F.current;if(!me||!Ne)return;let _e=0;const Be=()=>{cancelAnimationFrame(_e),_e=requestAnimationFrame(()=>{W.current&&me.clientHeight&&!Fe.on&&(Ce.current=j6(me,120))})},Oe=new ResizeObserver(()=>{if(Be(),!!W.current){if(me.scrollHeight-me.clientHeight<8){dt();return}de.current&&(me.scrollHeight-me.scrollTop-me.clientHeight<8||me.scrollTo({top:me.scrollHeight,behavior:"instant"}))}});Oe.observe(Ne),Oe.observe(me);const dt=()=>{var ti;Fe.on||(de.current=me.scrollHeight-me.scrollTop-me.clientHeight<120,de.current&&(we.current=Math.max(we.current,((ti=X.current.at(-1))==null?void 0:ti.sequence)??0)),be(!de.current),Be())};return dt(),me.addEventListener("scroll",dt,{passive:!0}),()=>{Oe.disconnect(),me.removeEventListener("scroll",dt),cancelAnimationFrame(_e)}},[B.current,e,_]),w.useEffect(()=>{const me=O.at(-1);if(!_||!me||me.chatId!==_.id)return;const Ne=()=>{if(document.visibilityState!=="visible"||_.readSequence>=me.sequence)return;const _e={..._,readSequence:me.sequence,unread:0,mentions:0,alerts:0,atMe:!1,hint:null};z(_e),he.markRead(_.id,me.sequence).then(()=>S(_e)).catch(M)};return Ne(),document.addEventListener("visibilitychange",Ne),()=>document.removeEventListener("visibilitychange",Ne)},[O,_]);const vn=async me=>{try{const Ne=await me();z(Ne),S(Ne)}catch(Ne){throw M(Ne),Ne}},rn=async(me,Ne,_e)=>{try{const Be=await he.react(me.id,Ne,_e),Oe=dt=>dt.id===Be.id?{...dt,reactions:Be.reactions}:dt;I(dt=>dt.map(Oe)),H(dt=>dt&&Oe(dt))}catch(Be){M(Be)}},ge=async(me,Ne)=>{try{const _e=await he.fold(me.id,Ne),Be=Oe=>Oe.id===_e.id?{...Oe,folded:_e.folded}:Oe;I(Oe=>Oe.map(Be)),H(Oe=>Oe&&Be(Oe))}catch(_e){M(_e)}},Me=(me,Ne)=>{Fe.release();const _e=()=>{var Oe;return me?(Oe=B.current)==null?void 0:Oe.querySelector(`[data-message="${me}"]`):null},Be=_e();if(Be){jf(Be,Ne);return}if(!me){E(y("app.sourceGone"));return}gt(me).then(Oe=>{if(typeof Oe=="string"&&T){T(Oe,me,Ne);return}if(!Oe||typeof Oe=="string"){E(y("thread.sourceElsewhere"));return}Zt(Oe),requestAnimationFrame(()=>{const dt=_e();dt&&jf(dt,Ne)})})},Xe={onQuote:me=>Ng(d,me,f),onReact:rn,onFold:ge,onJump:Me,onError:M,...R?{onBotCard:R}:{}},Je=async(me,Ne,_e,Be,Oe=[],dt=!1)=>{const ti=await he.send(e,me,Ne,_e,dt,Be,Oe),_n=c?[...new Set(kg(me,Na(f)).filter(yn=>!c.memberIds.includes(yn.member.id)).map(yn=>yn.member.name))]:[];_n.length&&E(y("app.notInChannel",{names:_n.join(y("common.listSeparator")),count:_n.length})),en(ti)},rt=(c==null?void 0:c.title)??y("search.channel"),Jt=f.find(me=>me.id===(P==null?void 0:P.senderId)),An=oe?O.filter(me=>me.sequence>we.current&&me.senderId!==g).length:0,dn=new Set([...P?[P.senderId,...P.mentions]:[],...O.flatMap(me=>[me.senderId,...me.mentions])]);return dn.delete(g),l.jsxs("section",{role:n==="pane"?"complementary":n==="full"?"main":void 0,className:n==="pane"?"ui-pane jv-pane":n==="embed"?"ui-chat jv-thread-full jv-thread-embed":"ui-chat jv-thread-full","aria-label":y("thread.label"),onKeyDown:me=>{_&&o&&(me.ctrlKey||me.metaKey)&&me.key.toLowerCase()==="f"&&(me.preventDefault(),o(_))},children:[l.jsxs("header",{className:n==="pane"?"ui-pane-header jv-pane-header":"ui-chat-header jv-pane-header",children:[n==="full"&&l.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:y("common.openNav"),onClick:k}),n==="embed"&&l.jsx(vt,{icon:"chevron-left",className:"ui-mobile-only",label:y("thread.backToList"),onClick:j}),n==="full"?l.jsxs("button",{type:"button",className:"jv-crumb",onClick:j,children:[l.jsx(Pe,{name:"chevron-left"}),l.jsx("span",{className:"jv-hash",children:"#"}),rt]}):n==="embed"?l.jsxs("button",{type:"button",className:"jv-crumb",title:y("thread.inChannel"),onClick:b,children:[l.jsx("span",{className:"jv-hash",children:"#"}),rt]}):l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:y("thread.label")}),l.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",rt]})]}),l.jsx("span",{className:"jv-spacer"}),_&&o&&l.jsx(vt,{icon:"search",label:y("thread.search"),onClick:()=>o(_)}),_&&l.jsxs("button",{type:"button",className:"ui-button jv-follow","data-on":_.following||void 0,title:y(_.following?"thread.followingHint":"thread.notFollowingHint"),onClick:()=>void vn(()=>he.follow(e,!_.following)).catch(()=>{}),children:[l.jsx(Pe,{name:"bell"}),y(_.following?"threads.following":"thread.follow")]}),n!=="embed"&&l.jsx(vt,{icon:n==="pane"?"arrows-expand":"arrows-contract",className:"jv-desktop-only",label:y(n==="pane"?"thread.expand":"thread.collapse"),onClick:b}),n==="pane"&&l.jsx(vt,{icon:"close",label:y("thread.close"),onClick:j})]}),_&&l.jsx("div",{className:n==="pane"?"jv-thread-pin":"jv-thread-pin jv-thread-pin-wide",children:l.jsx(bq,{chat:_,channelName:rt,expanded:a,onTitle:me=>vn(()=>he.updateThread(e,{title:me})),onStatus:me=>vn(()=>he.updateThread(e,{status:me})),onSummary:me=>vn(()=>he.setNote(e,me)),onConclude:async()=>{var me;try{await Je(`${y("thread.conclusion")}
|
|
815
815
|
|
|
816
|
-
${((me=_.note)==null?void 0:me.text)??""}`,[],Array.from(crypto.getRandomValues(new Uint8Array(16)),Ne=>Ne.toString(16).padStart(2,"0")).join(""),void 0,[],!0),await vn(()=>he.updateThread(e,{status:"done"})),E(y("thread.concluded",{channel:rt}))}catch(Ne){throw M(Ne),Ne}}})}),l.jsxs("div",{className:"jv-transcript",children:[l.jsx("div",{ref:B,className:n==="pane"?"ui-pane-body jv-pane-body":"ui-transcript jv-thread-wide",children:l.jsxs("div",{ref:F,children:[P&&l.jsx(wf,{messages:[{...P,thread:null}],members:f,bots:h,me:g,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:C,onReact:rn,onFold:ge,onJump:Me,onError:M}),l.jsx("div",{className:"jv-divider","data-tone":"count",role:"separator",children:l.jsx("span",{children:O.length?y("channel.replies",{count:((Ln=P==null?void 0:P.thread)==null?void 0:Ln.replies)??O.length}):y("thread.noReplies")})}),Y&&l.jsx("div",{ref:D,className:"jv-history-more","aria-live":"polite",children:K?y("chat.loadingOlder"):""}),l.jsx(wf,{messages:O,members:f,bots:h,me:g,divider:$??Number.MAX_SAFE_INTEGER,before:P==null?void 0:P.createdAt,onSettled:me=>I(Ne=>Ne.map(_e=>_e.id===me.id?me:_e)),onPreview:C,...Xe})]})}),oe&&O.length>0&&l.jsx("div",{className:"jv-to-latest",children:l.jsxs("button",{type:"button","aria-label":y("thread.toLatest"),onClick:()=>{var me;Fe.release(),(me=B.current)==null||me.scrollTo({top:B.current.scrollHeight,behavior:"smooth"})},children:[An>0&&l.jsx("span",{children:y("chat.unseen",{count:An})}),l.jsx(Pe,{name:"chevron-down"})]})})]}),l.jsx(Eg,{chatId:e,id:"jarvy-thread-composer",drafts:d,placeholder:y("thread.reply"),scrollRef:B,disabled:!_,initialText:O.length===0&&P&&P.senderId!==g&&Jt&&!Jt.deleted?`@${Jt.name} `:void 0,mention:{bots:h,inside:Na(f).filter(me=>me.id!==g&&!!(c!=null&&c.memberIds.includes(me.id))),outside:Na(f).filter(me=>!(c!=null&&c.memberIds.includes(me.id))),onInvite:N,participants:dn},onSend:Je,onError:M,onNotice:E}),l.jsx(Cg,{container:B,drafts:d,chatId:e,members:f,onNotice:E,source:me=>me===(P==null?void 0:P.id)?P:O.find(Ne=>Ne.id===me)})]})}function Xj(e,n){const a=e.lastReplyAt??e.createdAt;return n==="created"?[0,-e.createdAt,e.id]:n==="status"?[e.status==="done"?1:0,-a,e.id]:[0,-a,e.id]}function wq(e,n){return e[0]-n[0]||e[1]-n[1]||(e[2]<n[2]?-1:e[2]>n[2]?1:0)}const Cf=e=>(n,a)=>wq(Xj(n,e),Xj(a,e)),u0={updated:"threadSort.updated",created:"threadSort.created",status:"threadSort.status"},kq=(e,n)=>[...e].sort(Cf(n));function k6(e){const n=`jarvy-thread-sort-${e}`,[a,r]=w.useState(()=>{const o=localStorage.getItem(n);return o==="created"||o==="status"?o:"updated"});return[a,o=>{r(o),localStorage.setItem(n,o)}]}function S6({value:e,onChange:n}){return l.jsxs(Hr,{value:e,onValueChange:a=>n(a),children:[l.jsxs(Fr,{className:"jv-thread-sort","aria-label":y("threadSort.current",{order:y(u0[e])}),title:y("threadSort.title"),children:[l.jsx(v9,{}),l.jsx(qr,{})]}),l.jsx(Ur,{className:"jv-select-menu",position:"popper",sideOffset:4,align:"end",children:Object.keys(u0).map(a=>l.jsx(Oi,{value:a,children:y(u0[a])},a))})]})}const Qj={epoch:0,unlisted:0,counts:{}},Sq=(e,n,a)=>({epoch:e.epoch,unlisted:e.unlisted+(a?1:0),counts:{...e.counts,[n]:(e.counts[n]??0)+1}}),Cq=e=>({...e,epoch:e.epoch+1}),Nq=(e,n)=>`${e.epoch}:${n?e.counts[n]??0:0}`,Eq=e=>`${e.epoch}:${e.unlisted}`,Tq=e=>Si(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function Mq({channel:e,members:n,bots:a,changes:r,onOpen:o,onClose:c,onError:d}){const[f,h]=w.useState(null),[g,v]=w.useState("open"),[p,j]=k6("channel");w.useEffect(()=>{let S=!0;return he.channelThreads(e.id).then(N=>{S&&h(N.threads)}).catch(N=>{S&&d(N)}),()=>{S=!1}},[e.id,Nq(r,e.id)]);const b=kq((f??[]).filter(S=>g==="all"||S.status===g),p),k=S=>(f??[]).filter(N=>N.status===S).length;return l.jsxs("aside",{className:"ui-pane jv-pane","aria-label":y("threads.list"),children:[l.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[l.jsx("strong",{children:y("channel.threads")}),l.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),l.jsx("span",{className:"jv-spacer"}),l.jsx(S6,{value:p,onChange:j}),l.jsx(vt,{icon:"close",label:y("threads.closeList"),onClick:c})]}),l.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":y("threads.byStatus"),children:[["open",y("threads.openCount",{count:k("open")})],["done",y("threads.doneCount",{count:k("done")})],["all",y("threads.all")]].map(([S,N])=>l.jsx("button",{type:"button",role:"tab","aria-selected":g===S,onClick:()=>v(S),children:N},S))}),l.jsx("div",{className:"ui-pane-body jv-pane-body",children:f===null?l.jsx("p",{className:"jv-picker-empty",children:y("threads.loading")}):b.length===0?l.jsx("p",{className:"jv-picker-empty",children:y("threads.none")}):b.map(S=>{const N=n.find(C=>{var M;return C.id===((M=S.root)==null?void 0:M.senderId)});return l.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":S.unread>0||void 0,onClick:()=>o(S.id),children:[l.jsxs("span",{className:"jv-thread-item-head",children:[l.jsx("strong",{children:S.title}),S.alerts>0?l.jsx("span",{className:"jv-badge",children:S.alerts}):S.unread>0&&l.jsx("span",{className:"jv-count",children:S.unread}),l.jsx("span",{className:"jv-thread-status","data-done":S.status==="done"||void 0,children:y(S.status==="done"?"channel.threadDone":"threads.open")})]}),S.root&&l.jsxs("span",{className:"jv-thread-item-root",children:[l.jsx(lr,{member:N,bots:a,size:16}),l.jsx("span",{children:Os(S.root)})]}),l.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:[y("channel.replies",{count:S.replies}),S.lastReplyAt?` · ${Tq(S.lastReplyAt)}`:"",S.following?` · ${y("threads.following")}`:""]})]},S.id)})})]})}class Aq{constructor(){qe(this,"listeners",new Set)}emit(n){for(const a of this.listeners)a(n)}on(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}}const d0=(e,n)=>n==="all"||(n==="unread"?e.unread>0:e.status===n),Kd=(e,n)=>[...new Map(e.map(a=>[a.id,a])).values()].sort(Cf(n));function _q(e,n,a){const[r,o]=w.useState({items:[],next:null,ready:!1}),[c,d]=w.useState(!1),[f,h]=w.useState(!1),g=w.useRef({filter:n,sort:a,generation:0}),v=w.useRef(r),p=w.useRef(new Map);v.current=r;const j=E=>{v.current=E,o(E)};async function b(E){const T=g.current.generation;d(!0),h(!1);try{const R=await he.followedThreads({filter:n,sort:a,cursor:E});if(T!==g.current.generation)return;const _=v.current,z=R.next?R.threads.at(-1):void 0,P=[...p.current.values()].filter(H=>d0(H,n)&&(!z||Cf(a)(H,z)<=0));j({items:Kd([...E?_.items:[],...R.threads,...P],a),next:R.next,ready:!0})}catch{T===g.current.generation&&h(!0)}finally{T===g.current.generation&&d(!1)}}w.useEffect(()=>{g.current={filter:n,sort:a,generation:g.current.generation+1},j({items:[],next:null,ready:!1}),b()},[n,a]);const k=w.useRef(new Map);function S(E){if(k.current.has(E)){k.current.set(E,!0);return}k.current.set(E,!1);const T=g.current.generation;he.followedThread(E).then(R=>N(R,T),R=>{R instanceof Wa&&R.status===404&&T===g.current.generation&&j({...v.current,items:v.current.items.filter(_=>_.id!==E)})}).finally(()=>{const R=k.current.get(E);k.current.delete(E),R&&S(E)})}function N(E,T){if(T!==g.current.generation)return;C(E);const R=v.current,_=R.items.some(H=>H.id===E.id),z=R.items.at(-1),P=E.following&&d0(E,g.current.filter)&&(R.next===null||!z||Cf(g.current.sort)(E,z)<0);(_||R.ready&&P)&&j({...R,items:Kd([...R.items,E],g.current.sort)})}w.useEffect(()=>e.on(E=>{if(E.kind==="changed")S(E.id);else if(E.kind==="reconnected")M();else{const T=E.chat,R=v.current,_=R.items.find(P=>P.id===T.id);if(!_){T.following&&S(T.id);return}const z={..._,title:T.title,status:T.status??_.status,unread:T.unread,mentions:T.mentions,alerts:T.alerts,following:T.following};C(z),j({...R,items:Kd([...R.items,z],g.current.sort)})}}),[e]);function C(E){E.following?p.current.delete(E.id):v.current.items.some(T=>T.id===E.id)&&p.current.set(E.id,E)}async function M(){const E=g.current.generation,T=await he.followedThreads({filter:g.current.filter,sort:g.current.sort}).catch(()=>null);if(!T||E!==g.current.generation)return;const R=v.current,_=R.items.length>T.threads.length;j({items:Kd([...R.items,...T.threads],g.current.sort),next:_?R.next:T.next,ready:!0})}return{items:r.items.filter(E=>d0(E,n)),find:E=>r.items.find(T=>T.id===E),ready:r.ready,more:r.next!==null,loading:c,failed:f,loadMore:()=>{r.next&&!c&&b(r.next)},retry:()=>void b(r.next??void 0)}}const Rq=e=>Si(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),zq={all:"threads.none",unread:"threads.noneUnread",open:"threads.noneOpen",done:"threads.noneDone"};function Oq({events:e,summary:n,chats:a,members:r,bots:o,onNav:c,renderThread:d}){const[f,h]=w.useState(null),[g,v]=w.useState("all"),[p,j]=k6("followed"),b=_q(e,g,p),k=f?b.find(f.id)??f:void 0,S=w.useRef(null),N=w.useRef(null);w.useEffect(()=>{if(!S.current||!N.current||!b.more||b.loading||b.failed)return;const M=new IntersectionObserver(E=>{var T;(T=E[0])!=null&&T.isIntersecting&&b.loadMore()},{root:S.current,rootMargin:"0px 0px 400px 0px"});return M.observe(N.current),()=>M.disconnect()},[b.more,b.loading,b.failed,b.items]);const C=[["all",y("threads.all")],["unread",n!=null&&n.unreadThreads?y("threads.unreadCount",{count:n.unreadThreads}):y("threads.unread")],["open",y("threads.openCount",{count:(n==null?void 0:n.open)??0})],["done",y("threads.doneCount",{count:(n==null?void 0:n.done)??0})]];return l.jsxs("main",{className:"ui-chat jv-followed-page","aria-label":y("sidebar.followed"),"data-open":k?"":void 0,children:[l.jsxs("section",{className:"jv-followed-list","aria-label":y("threads.list"),children:[l.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[l.jsxs("div",{className:"ui-header-left",children:[l.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:y("common.openNav"),onClick:c}),l.jsx("strong",{className:"jv-channel-title",children:y("sidebar.followed")})]}),l.jsx(S6,{value:p,onChange:j})]}),l.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":y("threads.filter"),children:C.map(([M,E])=>l.jsx("button",{type:"button",role:"tab","aria-selected":g===M,onClick:()=>v(M),children:E},M))}),l.jsxs("div",{className:"jv-followed-items",ref:S,children:[b.ready&&b.items.length===0&&!b.more?l.jsx("p",{className:"jv-picker-empty",children:y(zq[g])}):b.items.map(M=>{const E=r.find(R=>{var _;return R.id===((_=M.root)==null?void 0:_.senderId)}),T=a.find(R=>R.id===M.parentId);return l.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":M.unread>0||void 0,"aria-current":M.id===(f==null?void 0:f.id)||void 0,onClick:()=>h(M),children:[l.jsxs("span",{className:"jv-thread-item-head",children:[l.jsx("strong",{children:M.title}),M.alerts>0?l.jsx("span",{className:"jv-badge",children:M.alerts}):M.unread>0&&l.jsx("span",{className:"jv-count",children:M.unread}),l.jsx("span",{className:"jv-thread-status","data-done":M.status==="done"||void 0,children:y(M.status==="done"?"channel.threadDone":"threads.open")})]}),M.root&&l.jsxs("span",{className:"jv-thread-item-root",children:[l.jsx(lr,{member:E,bots:o,size:16}),l.jsx("span",{children:Os(M.root)})]}),l.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:["#",(T==null?void 0:T.title)??""," · ",y("channel.replies",{count:M.replies}),M.lastReplyAt?` · ${Rq(M.lastReplyAt)}`:"",M.following?"":` · ${y("threads.notFollowing")}`]})]},M.id)}),l.jsx("div",{ref:N,className:"jv-followed-end",children:b.failed?l.jsxs(l.Fragment,{children:[l.jsx("p",{role:"alert",children:y("threads.loadFailed")}),l.jsx(Ee,{variant:"outline",size:"sm",onClick:b.retry,children:y("common.retry")})]}):(b.loading||!b.ready)&&l.jsx("p",{role:"status",children:y("threads.loading")})})]})]}),k?d(k,()=>h(null)):l.jsx("div",{className:"jv-followed-empty",children:l.jsx("p",{children:y("threads.pick")})})]})}function Dq({pane:e,followedView:n,threadEvents:a,followed:r,chats:o,sections:c,members:d,bots:f,statuses:h,meId:g,drafts:v,changes:p,live:j,memory:b,paneChannel:k,activeBot:S,botDirects:N,find:C,onPane:M,onNav:E,onBackToChannel:T,onAddMembers:R,onOpenBot:_,onPin:z,onMute:P,onDeleteChannel:H,onChannelSaved:O,onThreadChanged:I,onInvite:$,onPreview:Q,onNotice:Y,onError:q,onBotCard:K,paneWidth:V,onResize:X}){var B,F;const Z=(e==null?void 0:e.kind)==="thread"?e:null,D=(Z==null?void 0:Z.mode)==="full",se=()=>M(null),ne=(ee,W,de)=>void he.chat(ee).then(oe=>C.openMessage(oe,W,de),q);return l.jsxs(l.Fragment,{children:[n&&!D&&l.jsx(Oq,{events:a,summary:r,chats:o,members:d,bots:f,onNav:E,renderThread:(ee,W)=>l.jsx(Kj,{threadId:ee.id,mode:"embed",channel:o.find(de=>de.id===ee.parentId),drafts:v,members:d,bots:f,me:g,live:j,memory:b,onNav:E,onChanged:I,onClose:W,onToggleMode:()=>T({id:ee.id,parentId:ee.parentId},!0),onInvite:de=>$(ee.parentId,de),onPreview:Q,onError:q,onNotice:Y,onOpenMessage:ne,onBotCard:K},ee.id)}),Z&&l.jsx(Kj,{threadId:Z.id,mode:Z.mode,showSummary:Z.summary,focus:Z.focus,onSearch:C.search,channel:o.find(ee=>ee.id===Z.parentId),drafts:v,members:d,bots:f,me:g,live:j,memory:b,onNav:E,onChanged:I,onClose:()=>D?T(Z,!1):se(),onToggleMode:()=>D?T(Z,!0):M({...Z,mode:"full"}),onInvite:ee=>$(Z.parentId,ee),onPreview:Q,onError:q,onNotice:Y,onOpenMessage:ne,onBotCard:K},`${Z.id}:${((B=Z.focus)==null?void 0:B.id)??""}:${((F=Z.focus)==null?void 0:F.passage)??""}`),(e==null?void 0:e.kind)==="search"&&l.jsx(yq,{chat:e.chat,chats:o,members:d,focusKey:C.focusKey,onOpenMessage:C.openMessage,onClose:se,onError:q}),(e==null?void 0:e.kind)==="threads"&&k&&l.jsx(Mq,{channel:k,members:d,bots:f,changes:p,onOpen:ee=>M({kind:"thread",id:ee,parentId:k.id,mode:"pane"}),onClose:se,onError:q}),(e==null?void 0:e.kind)==="info"&&k&&l.jsx(vq,{channel:k,page:e.page,sections:c,members:Na(d),bots:f,statuses:h,me:g,onPage:ee=>M({kind:"info",page:ee}),onPin:()=>z(k),onMute:()=>P(k),onAdd:()=>R(k),onBot:_,onDelete:()=>H(k),onChanged:O,onClose:se,onError:q}),(e==null?void 0:e.kind)==="botdms"&&S&&!k&&l.jsx(mq,{bot:S,chats:N,members:d,bots:f,me:g,live:j,onClose:se,onPreview:Q,onError:q}),e&&!D&&l.jsx("div",{className:"jv-resize",style:{right:V-4},onPointerDown:X,role:"separator","aria-orientation":"vertical","aria-label":y("app.resizePane")})]})}const Zj="@goodfish/jarvy",C6="0.14.0",Lq={url:"git+https://github.com/AzzzGoodFish/Jarvy.git"},Bq="Apache-2.0",c1=Lq.url.replace(/^git\+/,"").replace(/\.git$/,""),Jj=`${c1}/blob/v${C6}`,Iq=[{label:"about.source",detail:c1.replace(/^https:\/\//,""),href:c1},{label:"about.package",detail:Zj,href:`https://www.npmjs.com/package/${Zj}`},{label:"about.license",detail:Bq,href:`${Jj}/LICENSE`},{label:"about.notices",detail:"THIRD_PARTY_NOTICE.md",href:`${Jj}/THIRD_PARTY_NOTICE.md`}];function Pq(){return l.jsxs("div",{className:"jv-page",children:[l.jsx("header",{className:"jv-page-header",children:l.jsx("h2",{children:y("settings.about")})}),l.jsxs("div",{className:"jv-list",children:[l.jsxs("div",{className:"jv-list-row jv-static-row jv-about-intro",children:[l.jsxs("div",{className:"jv-row-text",children:[l.jsx("strong",{children:"Jarvy"}),l.jsx("span",{children:y("about.tagline")})]}),l.jsx("span",{className:"jv-row-meta",children:y("about.version",{version:C6})})]}),Iq.map(e=>l.jsxs("a",{className:"jv-list-row jv-link-row",href:e.href,target:"_blank",rel:"noreferrer",children:[l.jsxs("div",{className:"jv-row-text",children:[l.jsx("strong",{children:y(e.label)}),l.jsx("span",{children:e.detail})]}),l.jsx(b0,{"aria-hidden":"true"})]},e.label))]})]})}function Hq(){const[e,n]=w.useState(document.documentElement.classList.contains("dark")),a=o=>{xf(o?"dark":"light"),n(o)},r=(o,c,d,f,h)=>l.jsxs("button",{type:"button",role:"radio","aria-checked":d,lang:h,className:"jv-list-row jv-choice-row",onClick:f,children:[l.jsx("span",{className:"jv-row-text",children:l.jsx("strong",{children:c})}),d&&l.jsx(Li,{"aria-hidden":"true"})]},o);return l.jsxs("div",{className:"jv-page",children:[l.jsx("header",{className:"jv-page-header",children:l.jsx("h2",{children:y("settings.general")})}),l.jsxs("section",{className:"jv-section","aria-labelledby":"general-language",children:[l.jsx("h3",{id:"general-language",className:"jv-section-title",children:y("general.language")}),l.jsx("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-language",children:m4.map(o=>r(o,v0(o,"name"),Tl()===o,()=>v4(o),o))})]}),l.jsxs("section",{className:"jv-section","aria-labelledby":"general-theme",children:[l.jsx("h3",{id:"general-theme",className:"jv-section-title",children:y("general.theme")}),l.jsxs("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-theme",children:[r("light",y("general.light"),!e,()=>a(!1)),r("dark",y("general.dark"),e,()=>a(!0))]})]})]})}const qq=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.797 6.282a.451.451 0 01-.336-.315 1.019 1.019 0 010-.505c.156-.86.3-1.725.501-2.577.14-.7.42-1.367.823-1.96.305-.431.75-.746 1.262-.89.877-.217 1.24.629.937 1.348-.259.593-.877.914-1.334 1.348-.835.795-1.096 2.14-1.336 3.212a.427.427 0 01-.186.277.437.437 0 01-.331.062z" fill="url(#lobe-icons-ant-group-0-_R_0_)" transform="translate(3)"></path><path d="M6.334 4.672c.33-.121.682.146.946.297.278.145.587.219.901.214.231.01.466 0 .688.018 4.098.176 7.484 3.22 8.05 7.237.565 4.016-1.852 7.859-5.745 9.134-3.894 1.276-8.153-.38-10.126-3.935A8.339 8.339 0 013.133 7.081c.348-.278.716-.53 1.102-.755a8.404 8.404 0 001.318-.79c.28-.243.45-.742.781-.864zm4.406 2.15c-2.841.003-4.898 2.533-4.628 5.642.27 3.109 2.781 5.641 5.613 5.665 2.832.024 4.932-2.512 4.658-5.644-.273-3.133-2.802-5.666-5.643-5.663zm.357.57a4.707 4.707 0 013.304 1.446 5.703 5.703 0 011.643 3.49 4.841 4.841 0 01-1.141 3.705v.015a3.923 3.923 0 01-2.808 1.303 4.664 4.664 0 01-3.367-1.387 5.678 5.678 0 01-1.71-3.518 4.832 4.832 0 011.14-3.753 3.923 3.923 0 012.813-1.3h.126z" fill="url(#lobe-icons-ant-group-1-_R_0_)" transform="translate(3)"></path><path d="M2.346 2.054a1.26 1.26 0 01.384-.594.842.842 0 011.165.11c.694.82.169 2.078.142 3.02.013.805.208 1.597.57 2.318.084.134.147.279.186.43a.539.539 0 01-.3.577c-.345.17-.568-.19-.709-.446-.324-.6-.617-1.216-.877-1.846a8.698 8.698 0 01-.618-1.987 7.523 7.523 0 01-.051-.37 3.717 3.717 0 01-.024-.34 2.506 2.506 0 01.132-.872z" fill="url(#lobe-icons-ant-group-2-_R_0_)" transform="translate(3)"></path><defs><linearGradient id="lobe-icons-ant-group-0-_R_0_" x1="31.373%" x2="61.365%" y1="95.551%" y2="-.348%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-1-_R_0_" x1="4.366%" x2="94.359%" y1="65.982%" y2="32.918%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-2-_R_0_" x1="56.255%" x2="45.986%" y1="99.257%" y2="1.384%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient></defs></svg>
|
|
816
|
+
${((me=_.note)==null?void 0:me.text)??""}`,[],Array.from(crypto.getRandomValues(new Uint8Array(16)),Ne=>Ne.toString(16).padStart(2,"0")).join(""),void 0,[],!0),await vn(()=>he.updateThread(e,{status:"done"})),E(y("thread.concluded",{channel:rt}))}catch(Ne){throw M(Ne),Ne}}})}),l.jsxs("div",{className:"jv-transcript",children:[l.jsx("div",{ref:B,className:n==="pane"?"ui-pane-body jv-pane-body":"ui-transcript jv-thread-wide",children:l.jsxs("div",{ref:F,children:[P&&l.jsx(wf,{messages:[{...P,thread:null}],members:f,bots:h,me:g,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:C,onReact:rn,onFold:ge,onJump:Me,onError:M}),l.jsx("div",{className:"jv-divider","data-tone":"count",role:"separator",children:l.jsx("span",{children:O.length?y("channel.replies",{count:((Ln=P==null?void 0:P.thread)==null?void 0:Ln.replies)??O.length}):y("thread.noReplies")})}),Y&&l.jsx("div",{ref:D,className:"jv-history-more","aria-live":"polite",children:K?y("chat.loadingOlder"):""}),l.jsx(wf,{messages:O,members:f,bots:h,me:g,divider:$??Number.MAX_SAFE_INTEGER,before:P==null?void 0:P.createdAt,onSettled:me=>I(Ne=>Ne.map(_e=>_e.id===me.id?me:_e)),onPreview:C,...Xe})]})}),oe&&O.length>0&&l.jsx("div",{className:"jv-to-latest",children:l.jsxs("button",{type:"button","aria-label":y("thread.toLatest"),onClick:()=>{var me;Fe.release(),(me=B.current)==null||me.scrollTo({top:B.current.scrollHeight,behavior:"smooth"})},children:[An>0&&l.jsx("span",{children:y("chat.unseen",{count:An})}),l.jsx(Pe,{name:"chevron-down"})]})})]}),l.jsx(Eg,{chatId:e,id:"jarvy-thread-composer",drafts:d,placeholder:y("thread.reply"),scrollRef:B,disabled:!_,initialText:O.length===0&&P&&P.senderId!==g&&Jt&&!Jt.deleted?`@${Jt.name} `:void 0,mention:{bots:h,inside:Na(f).filter(me=>me.id!==g&&!!(c!=null&&c.memberIds.includes(me.id))),outside:Na(f).filter(me=>!(c!=null&&c.memberIds.includes(me.id))),onInvite:N,participants:dn},onSend:Je,onError:M,onNotice:E}),l.jsx(Cg,{container:B,drafts:d,chatId:e,members:f,onNotice:E,source:me=>me===(P==null?void 0:P.id)?P:O.find(Ne=>Ne.id===me)})]})}function Xj(e,n){const a=e.lastReplyAt??e.createdAt;return n==="created"?[0,-e.createdAt,e.id]:n==="status"?[e.status==="done"?1:0,-a,e.id]:[0,-a,e.id]}function wq(e,n){return e[0]-n[0]||e[1]-n[1]||(e[2]<n[2]?-1:e[2]>n[2]?1:0)}const Cf=e=>(n,a)=>wq(Xj(n,e),Xj(a,e)),u0={updated:"threadSort.updated",created:"threadSort.created",status:"threadSort.status"},kq=(e,n)=>[...e].sort(Cf(n));function k6(e){const n=`jarvy-thread-sort-${e}`,[a,r]=w.useState(()=>{const o=localStorage.getItem(n);return o==="created"||o==="status"?o:"updated"});return[a,o=>{r(o),localStorage.setItem(n,o)}]}function S6({value:e,onChange:n}){return l.jsxs(Hr,{value:e,onValueChange:a=>n(a),children:[l.jsxs(Fr,{className:"jv-thread-sort","aria-label":y("threadSort.current",{order:y(u0[e])}),title:y("threadSort.title"),children:[l.jsx(v9,{}),l.jsx(qr,{})]}),l.jsx(Ur,{className:"jv-select-menu",position:"popper",sideOffset:4,align:"end",children:Object.keys(u0).map(a=>l.jsx(Oi,{value:a,children:y(u0[a])},a))})]})}const Qj={epoch:0,unlisted:0,counts:{}},Sq=(e,n,a)=>({epoch:e.epoch,unlisted:e.unlisted+(a?1:0),counts:{...e.counts,[n]:(e.counts[n]??0)+1}}),Cq=e=>({...e,epoch:e.epoch+1}),Nq=(e,n)=>`${e.epoch}:${n?e.counts[n]??0:0}`,Eq=e=>`${e.epoch}:${e.unlisted}`,Tq=e=>Si(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function Mq({channel:e,members:n,bots:a,changes:r,onOpen:o,onClose:c,onError:d}){const[f,h]=w.useState(null),[g,v]=w.useState("open"),[p,j]=k6("channel");w.useEffect(()=>{let S=!0;return he.channelThreads(e.id).then(N=>{S&&h(N.threads)}).catch(N=>{S&&d(N)}),()=>{S=!1}},[e.id,Nq(r,e.id)]);const b=kq((f??[]).filter(S=>g==="all"||S.status===g),p),k=S=>(f??[]).filter(N=>N.status===S).length;return l.jsxs("aside",{className:"ui-pane jv-pane","aria-label":y("threads.list"),children:[l.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[l.jsx("strong",{children:y("channel.threads")}),l.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),l.jsx("span",{className:"jv-spacer"}),l.jsx(S6,{value:p,onChange:j}),l.jsx(vt,{icon:"close",label:y("threads.closeList"),onClick:c})]}),l.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":y("threads.byStatus"),children:[["open",y("threads.openCount",{count:k("open")})],["done",y("threads.doneCount",{count:k("done")})],["all",y("threads.all")]].map(([S,N])=>l.jsx("button",{type:"button",role:"tab","aria-selected":g===S,onClick:()=>v(S),children:N},S))}),l.jsx("div",{className:"ui-pane-body jv-pane-body",children:f===null?l.jsx("p",{className:"jv-picker-empty",children:y("threads.loading")}):b.length===0?l.jsx("p",{className:"jv-picker-empty",children:y("threads.none")}):b.map(S=>{const N=n.find(C=>{var M;return C.id===((M=S.root)==null?void 0:M.senderId)});return l.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":S.unread>0||void 0,onClick:()=>o(S.id),children:[l.jsxs("span",{className:"jv-thread-item-head",children:[l.jsx("strong",{children:S.title}),S.alerts>0?l.jsx("span",{className:"jv-badge",children:S.alerts}):S.unread>0&&l.jsx("span",{className:"jv-count",children:S.unread}),l.jsx("span",{className:"jv-thread-status","data-done":S.status==="done"||void 0,children:y(S.status==="done"?"channel.threadDone":"threads.open")})]}),S.root&&l.jsxs("span",{className:"jv-thread-item-root",children:[l.jsx(lr,{member:N,bots:a,size:16}),l.jsx("span",{children:Os(S.root)})]}),l.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:[y("channel.replies",{count:S.replies}),S.lastReplyAt?` · ${Tq(S.lastReplyAt)}`:"",S.following?` · ${y("threads.following")}`:""]})]},S.id)})})]})}class Aq{constructor(){qe(this,"listeners",new Set)}emit(n){for(const a of this.listeners)a(n)}on(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}}const d0=(e,n)=>n==="all"||(n==="unread"?e.unread>0:e.status===n),Kd=(e,n)=>[...new Map(e.map(a=>[a.id,a])).values()].sort(Cf(n));function _q(e,n,a){const[r,o]=w.useState({items:[],next:null,ready:!1}),[c,d]=w.useState(!1),[f,h]=w.useState(!1),g=w.useRef({filter:n,sort:a,generation:0}),v=w.useRef(r),p=w.useRef(new Map);v.current=r;const j=E=>{v.current=E,o(E)};async function b(E){const T=g.current.generation;d(!0),h(!1);try{const R=await he.followedThreads({filter:n,sort:a,cursor:E});if(T!==g.current.generation)return;const _=v.current,z=R.next?R.threads.at(-1):void 0,P=[...p.current.values()].filter(H=>d0(H,n)&&(!z||Cf(a)(H,z)<=0));j({items:Kd([...E?_.items:[],...R.threads,...P],a),next:R.next,ready:!0})}catch{T===g.current.generation&&h(!0)}finally{T===g.current.generation&&d(!1)}}w.useEffect(()=>{g.current={filter:n,sort:a,generation:g.current.generation+1},j({items:[],next:null,ready:!1}),b()},[n,a]);const k=w.useRef(new Map);function S(E){if(k.current.has(E)){k.current.set(E,!0);return}k.current.set(E,!1);const T=g.current.generation;he.followedThread(E).then(R=>N(R,T),R=>{R instanceof Wa&&R.status===404&&T===g.current.generation&&j({...v.current,items:v.current.items.filter(_=>_.id!==E)})}).finally(()=>{const R=k.current.get(E);k.current.delete(E),R&&S(E)})}function N(E,T){if(T!==g.current.generation)return;C(E);const R=v.current,_=R.items.some(H=>H.id===E.id),z=R.items.at(-1),P=E.following&&d0(E,g.current.filter)&&(R.next===null||!z||Cf(g.current.sort)(E,z)<0);(_||R.ready&&P)&&j({...R,items:Kd([...R.items,E],g.current.sort)})}w.useEffect(()=>e.on(E=>{if(E.kind==="changed")S(E.id);else if(E.kind==="reconnected")M();else{const T=E.chat,R=v.current,_=R.items.find(P=>P.id===T.id);if(!_){T.following&&S(T.id);return}const z={..._,title:T.title,status:T.status??_.status,unread:T.unread,mentions:T.mentions,alerts:T.alerts,following:T.following};C(z),j({...R,items:Kd([...R.items,z],g.current.sort)})}}),[e]);function C(E){E.following?p.current.delete(E.id):v.current.items.some(T=>T.id===E.id)&&p.current.set(E.id,E)}async function M(){const E=g.current.generation,T=await he.followedThreads({filter:g.current.filter,sort:g.current.sort}).catch(()=>null);if(!T||E!==g.current.generation)return;const R=v.current,_=R.items.length>T.threads.length;j({items:Kd([...R.items,...T.threads],g.current.sort),next:_?R.next:T.next,ready:!0})}return{items:r.items.filter(E=>d0(E,n)),find:E=>r.items.find(T=>T.id===E),ready:r.ready,more:r.next!==null,loading:c,failed:f,loadMore:()=>{r.next&&!c&&b(r.next)},retry:()=>void b(r.next??void 0)}}const Rq=e=>Si(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),zq={all:"threads.none",unread:"threads.noneUnread",open:"threads.noneOpen",done:"threads.noneDone"};function Oq({events:e,summary:n,chats:a,members:r,bots:o,onNav:c,renderThread:d}){const[f,h]=w.useState(null),[g,v]=w.useState("all"),[p,j]=k6("followed"),b=_q(e,g,p),k=f?b.find(f.id)??f:void 0,S=w.useRef(null),N=w.useRef(null);w.useEffect(()=>{if(!S.current||!N.current||!b.more||b.loading||b.failed)return;const M=new IntersectionObserver(E=>{var T;(T=E[0])!=null&&T.isIntersecting&&b.loadMore()},{root:S.current,rootMargin:"0px 0px 400px 0px"});return M.observe(N.current),()=>M.disconnect()},[b.more,b.loading,b.failed,b.items]);const C=[["all",y("threads.all")],["unread",n!=null&&n.unreadThreads?y("threads.unreadCount",{count:n.unreadThreads}):y("threads.unread")],["open",y("threads.openCount",{count:(n==null?void 0:n.open)??0})],["done",y("threads.doneCount",{count:(n==null?void 0:n.done)??0})]];return l.jsxs("main",{className:"ui-chat jv-followed-page","aria-label":y("sidebar.followed"),"data-open":k?"":void 0,children:[l.jsxs("section",{className:"jv-followed-list","aria-label":y("threads.list"),children:[l.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[l.jsxs("div",{className:"ui-header-left",children:[l.jsx(vt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:y("common.openNav"),onClick:c}),l.jsx("strong",{className:"jv-channel-title",children:y("sidebar.followed")})]}),l.jsx(S6,{value:p,onChange:j})]}),l.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":y("threads.filter"),children:C.map(([M,E])=>l.jsx("button",{type:"button",role:"tab","aria-selected":g===M,onClick:()=>v(M),children:E},M))}),l.jsxs("div",{className:"jv-followed-items",ref:S,children:[b.ready&&b.items.length===0&&!b.more?l.jsx("p",{className:"jv-picker-empty",children:y(zq[g])}):b.items.map(M=>{const E=r.find(R=>{var _;return R.id===((_=M.root)==null?void 0:_.senderId)}),T=a.find(R=>R.id===M.parentId);return l.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":M.unread>0||void 0,"aria-current":M.id===(f==null?void 0:f.id)||void 0,onClick:()=>h(M),children:[l.jsxs("span",{className:"jv-thread-item-head",children:[l.jsx("strong",{children:M.title}),M.alerts>0?l.jsx("span",{className:"jv-badge",children:M.alerts}):M.unread>0&&l.jsx("span",{className:"jv-count",children:M.unread}),l.jsx("span",{className:"jv-thread-status","data-done":M.status==="done"||void 0,children:y(M.status==="done"?"channel.threadDone":"threads.open")})]}),M.root&&l.jsxs("span",{className:"jv-thread-item-root",children:[l.jsx(lr,{member:E,bots:o,size:16}),l.jsx("span",{children:Os(M.root)})]}),l.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:["#",(T==null?void 0:T.title)??""," · ",y("channel.replies",{count:M.replies}),M.lastReplyAt?` · ${Rq(M.lastReplyAt)}`:"",M.following?"":` · ${y("threads.notFollowing")}`]})]},M.id)}),l.jsx("div",{ref:N,className:"jv-followed-end",children:b.failed?l.jsxs(l.Fragment,{children:[l.jsx("p",{role:"alert",children:y("threads.loadFailed")}),l.jsx(Ee,{variant:"outline",size:"sm",onClick:b.retry,children:y("common.retry")})]}):(b.loading||!b.ready)&&l.jsx("p",{role:"status",children:y("threads.loading")})})]})]}),k?d(k,()=>h(null)):l.jsx("div",{className:"jv-followed-empty",children:l.jsx("p",{children:y("threads.pick")})})]})}function Dq({pane:e,followedView:n,threadEvents:a,followed:r,chats:o,sections:c,members:d,bots:f,statuses:h,meId:g,drafts:v,changes:p,live:j,memory:b,paneChannel:k,activeBot:S,botDirects:N,find:C,onPane:M,onNav:E,onBackToChannel:T,onAddMembers:R,onOpenBot:_,onPin:z,onMute:P,onDeleteChannel:H,onChannelSaved:O,onThreadChanged:I,onInvite:$,onPreview:Q,onNotice:Y,onError:q,onBotCard:K,paneWidth:V,onResize:X}){var B,F;const Z=(e==null?void 0:e.kind)==="thread"?e:null,D=(Z==null?void 0:Z.mode)==="full",se=()=>M(null),ne=(ee,W,de)=>void he.chat(ee).then(oe=>C.openMessage(oe,W,de),q);return l.jsxs(l.Fragment,{children:[n&&!D&&l.jsx(Oq,{events:a,summary:r,chats:o,members:d,bots:f,onNav:E,renderThread:(ee,W)=>l.jsx(Kj,{threadId:ee.id,mode:"embed",channel:o.find(de=>de.id===ee.parentId),drafts:v,members:d,bots:f,me:g,live:j,memory:b,onNav:E,onChanged:I,onClose:W,onToggleMode:()=>T({id:ee.id,parentId:ee.parentId},!0),onInvite:de=>$(ee.parentId,de),onPreview:Q,onError:q,onNotice:Y,onOpenMessage:ne,onBotCard:K},ee.id)}),Z&&l.jsx(Kj,{threadId:Z.id,mode:Z.mode,showSummary:Z.summary,focus:Z.focus,onSearch:C.search,channel:o.find(ee=>ee.id===Z.parentId),drafts:v,members:d,bots:f,me:g,live:j,memory:b,onNav:E,onChanged:I,onClose:()=>D?T(Z,!1):se(),onToggleMode:()=>D?T(Z,!0):M({...Z,mode:"full"}),onInvite:ee=>$(Z.parentId,ee),onPreview:Q,onError:q,onNotice:Y,onOpenMessage:ne,onBotCard:K},`${Z.id}:${((B=Z.focus)==null?void 0:B.id)??""}:${((F=Z.focus)==null?void 0:F.passage)??""}`),(e==null?void 0:e.kind)==="search"&&l.jsx(yq,{chat:e.chat,chats:o,members:d,focusKey:C.focusKey,onOpenMessage:C.openMessage,onClose:se,onError:q}),(e==null?void 0:e.kind)==="threads"&&k&&l.jsx(Mq,{channel:k,members:d,bots:f,changes:p,onOpen:ee=>M({kind:"thread",id:ee,parentId:k.id,mode:"pane"}),onClose:se,onError:q}),(e==null?void 0:e.kind)==="info"&&k&&l.jsx(vq,{channel:k,page:e.page,sections:c,members:Na(d),bots:f,statuses:h,me:g,onPage:ee=>M({kind:"info",page:ee}),onPin:()=>z(k),onMute:()=>P(k),onAdd:()=>R(k),onBot:_,onDelete:()=>H(k),onChanged:O,onClose:se,onError:q}),(e==null?void 0:e.kind)==="botdms"&&S&&!k&&l.jsx(mq,{bot:S,chats:N,members:d,bots:f,me:g,live:j,onClose:se,onPreview:Q,onError:q}),e&&!D&&l.jsx("div",{className:"jv-resize",style:{right:V-4},onPointerDown:X,role:"separator","aria-orientation":"vertical","aria-label":y("app.resizePane")})]})}const Zj="@goodfish/jarvy",C6="0.14.1",Lq={url:"git+https://github.com/AzzzGoodFish/Jarvy.git"},Bq="Apache-2.0",c1=Lq.url.replace(/^git\+/,"").replace(/\.git$/,""),Jj=`${c1}/blob/v${C6}`,Iq=[{label:"about.source",detail:c1.replace(/^https:\/\//,""),href:c1},{label:"about.package",detail:Zj,href:`https://www.npmjs.com/package/${Zj}`},{label:"about.license",detail:Bq,href:`${Jj}/LICENSE`},{label:"about.notices",detail:"THIRD_PARTY_NOTICE.md",href:`${Jj}/THIRD_PARTY_NOTICE.md`}];function Pq(){return l.jsxs("div",{className:"jv-page",children:[l.jsx("header",{className:"jv-page-header",children:l.jsx("h2",{children:y("settings.about")})}),l.jsxs("div",{className:"jv-list",children:[l.jsxs("div",{className:"jv-list-row jv-static-row jv-about-intro",children:[l.jsxs("div",{className:"jv-row-text",children:[l.jsx("strong",{children:"Jarvy"}),l.jsx("span",{children:y("about.tagline")})]}),l.jsx("span",{className:"jv-row-meta",children:y("about.version",{version:C6})})]}),Iq.map(e=>l.jsxs("a",{className:"jv-list-row jv-link-row",href:e.href,target:"_blank",rel:"noreferrer",children:[l.jsxs("div",{className:"jv-row-text",children:[l.jsx("strong",{children:y(e.label)}),l.jsx("span",{children:e.detail})]}),l.jsx(b0,{"aria-hidden":"true"})]},e.label))]})]})}function Hq(){const[e,n]=w.useState(document.documentElement.classList.contains("dark")),a=o=>{xf(o?"dark":"light"),n(o)},r=(o,c,d,f,h)=>l.jsxs("button",{type:"button",role:"radio","aria-checked":d,lang:h,className:"jv-list-row jv-choice-row",onClick:f,children:[l.jsx("span",{className:"jv-row-text",children:l.jsx("strong",{children:c})}),d&&l.jsx(Li,{"aria-hidden":"true"})]},o);return l.jsxs("div",{className:"jv-page",children:[l.jsx("header",{className:"jv-page-header",children:l.jsx("h2",{children:y("settings.general")})}),l.jsxs("section",{className:"jv-section","aria-labelledby":"general-language",children:[l.jsx("h3",{id:"general-language",className:"jv-section-title",children:y("general.language")}),l.jsx("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-language",children:m4.map(o=>r(o,v0(o,"name"),Tl()===o,()=>v4(o),o))})]}),l.jsxs("section",{className:"jv-section","aria-labelledby":"general-theme",children:[l.jsx("h3",{id:"general-theme",className:"jv-section-title",children:y("general.theme")}),l.jsxs("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-theme",children:[r("light",y("general.light"),!e,()=>a(!1)),r("dark",y("general.dark"),e,()=>a(!0))]})]})]})}const qq=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.797 6.282a.451.451 0 01-.336-.315 1.019 1.019 0 010-.505c.156-.86.3-1.725.501-2.577.14-.7.42-1.367.823-1.96.305-.431.75-.746 1.262-.89.877-.217 1.24.629.937 1.348-.259.593-.877.914-1.334 1.348-.835.795-1.096 2.14-1.336 3.212a.427.427 0 01-.186.277.437.437 0 01-.331.062z" fill="url(#lobe-icons-ant-group-0-_R_0_)" transform="translate(3)"></path><path d="M6.334 4.672c.33-.121.682.146.946.297.278.145.587.219.901.214.231.01.466 0 .688.018 4.098.176 7.484 3.22 8.05 7.237.565 4.016-1.852 7.859-5.745 9.134-3.894 1.276-8.153-.38-10.126-3.935A8.339 8.339 0 013.133 7.081c.348-.278.716-.53 1.102-.755a8.404 8.404 0 001.318-.79c.28-.243.45-.742.781-.864zm4.406 2.15c-2.841.003-4.898 2.533-4.628 5.642.27 3.109 2.781 5.641 5.613 5.665 2.832.024 4.932-2.512 4.658-5.644-.273-3.133-2.802-5.666-5.643-5.663zm.357.57a4.707 4.707 0 013.304 1.446 5.703 5.703 0 011.643 3.49 4.841 4.841 0 01-1.141 3.705v.015a3.923 3.923 0 01-2.808 1.303 4.664 4.664 0 01-3.367-1.387 5.678 5.678 0 01-1.71-3.518 4.832 4.832 0 011.14-3.753 3.923 3.923 0 012.813-1.3h.126z" fill="url(#lobe-icons-ant-group-1-_R_0_)" transform="translate(3)"></path><path d="M2.346 2.054a1.26 1.26 0 01.384-.594.842.842 0 011.165.11c.694.82.169 2.078.142 3.02.013.805.208 1.597.57 2.318.084.134.147.279.186.43a.539.539 0 01-.3.577c-.345.17-.568-.19-.709-.446-.324-.6-.617-1.216-.877-1.846a8.698 8.698 0 01-.618-1.987 7.523 7.523 0 01-.051-.37 3.717 3.717 0 01-.024-.34 2.506 2.506 0 01.132-.872z" fill="url(#lobe-icons-ant-group-2-_R_0_)" transform="translate(3)"></path><defs><linearGradient id="lobe-icons-ant-group-0-_R_0_" x1="31.373%" x2="61.365%" y1="95.551%" y2="-.348%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-1-_R_0_" x1="4.366%" x2="94.359%" y1="65.982%" y2="32.918%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-2-_R_0_" x1="56.255%" x2="45.986%" y1="99.257%" y2="1.384%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient></defs></svg>
|
|
817
817
|
`,Fq=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>
|
|
818
818
|
`,Uq='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><mask height="23" id="lobe-icons-antigravity-0-_R_0_" maskUnits="userSpaceOnUse" width="24" x="0" y="1"><path d="M21.751 22.607c1.34 1.005 3.35.335 1.508-1.508C17.73 15.74 18.904 1 12.037 1 5.17 1 6.342 15.74.815 21.1c-2.01 2.009.167 2.511 1.507 1.506 5.192-3.517 4.857-9.714 9.715-9.714 4.857 0 4.522 6.197 9.714 9.715z" fill="#fff"></path></mask><g mask="url(#lobe-icons-antigravity-0-_R_0_)"><g filter="url(#lobe-icons-antigravity-1-_R_0_)"><path d="M-1.018-3.992c-.408 3.591 2.686 6.89 6.91 7.37 4.225.48 7.98-2.043 8.387-5.633.408-3.59-2.686-6.89-6.91-7.37-4.225-.479-7.98 2.043-8.387 5.633z" fill="#FFE432"></path></g><g filter="url(#lobe-icons-antigravity-2-_R_0_)"><path d="M15.269 7.747c1.058 4.557 5.691 7.374 10.348 6.293 4.657-1.082 7.575-5.653 6.516-10.21-1.058-4.556-5.691-7.374-10.348-6.292-4.657 1.082-7.575 5.653-6.516 10.21z" fill="#FC413D"></path></g><g filter="url(#lobe-icons-antigravity-3-_R_0_)"><path d="M-12.443 10.804c1.338 4.703 7.36 7.11 13.453 5.378 6.092-1.733 9.947-6.95 8.61-11.652C8.282-.173 2.26-2.58-3.833-.848-9.925.884-13.78 6.1-12.443 10.804z" fill="#00B95C"></path></g><g filter="url(#lobe-icons-antigravity-4-_R_0_)"><path d="M-12.443 10.804c1.338 4.703 7.36 7.11 13.453 5.378 6.092-1.733 9.947-6.95 8.61-11.652C8.282-.173 2.26-2.58-3.833-.848-9.925.884-13.78 6.1-12.443 10.804z" fill="#00B95C"></path></g><g filter="url(#lobe-icons-antigravity-5-_R_0_)"><path d="M-7.608 14.703c3.352 3.424 9.126 3.208 12.896-.483 3.77-3.69 4.108-9.459.756-12.883C2.69-2.087-3.083-1.871-6.853 1.82c-3.77 3.69-4.108 9.458-.755 12.883z" fill="#00B95C"></path></g><g filter="url(#lobe-icons-antigravity-6-_R_0_)"><path d="M9.932 27.617c1.04 4.482 5.384 7.303 9.7 6.3 4.316-1.002 6.971-5.448 5.93-9.93-1.04-4.483-5.384-7.304-9.7-6.301-4.316 1.002-6.971 5.448-5.93 9.93z" fill="#3186FF"></path></g><g filter="url(#lobe-icons-antigravity-7-_R_0_)"><path d="M2.572-8.185C.392-3.329 2.778 2.472 7.9 4.771c5.122 2.3 11.042.227 13.222-4.63 2.18-4.855-.205-10.656-5.327-12.955-5.122-2.3-11.042-.227-13.222 4.63z" fill="#FBBC04"></path></g><g filter="url(#lobe-icons-antigravity-8-_R_0_)"><path d="M-3.267 38.686c-5.277-2.072 3.742-19.117 5.984-24.83 2.243-5.712 8.34-8.664 13.616-6.592 5.278 2.071 11.533 13.482 9.29 19.195-2.242 5.713-23.613 14.298-28.89 12.227z" fill="#3186FF"></path></g><g filter="url(#lobe-icons-antigravity-9-_R_0_)"><path d="M28.71 17.471c-1.413 1.649-5.1.808-8.236-1.878-3.135-2.687-4.531-6.201-3.118-7.85 1.412-1.649 5.1-.808 8.235 1.878s4.532 6.2 3.119 7.85z" fill="#749BFF"></path></g><g filter="url(#lobe-icons-antigravity-10-_R_0_)"><path d="M18.163 9.077c5.81 3.93 12.502 4.19 14.946.577 2.443-3.612-.287-9.727-6.098-13.658-5.81-3.931-12.502-4.19-14.946-.577-2.443 3.612.287 9.727 6.098 13.658z" fill="#FC413D"></path></g><g filter="url(#lobe-icons-antigravity-11-_R_0_)"><path d="M-.915 2.684c-1.44 3.473-.97 6.967 1.05 7.804 2.02.837 4.824-1.3 6.264-4.772 1.44-3.473.97-6.967-1.05-7.804-2.02-.837-4.824 1.3-6.264 4.772z" fill="#FFEE48"></path></g></g><defs><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="17.587" id="lobe-icons-antigravity-1-_R_0_" width="19.838" x="-3.288" y="-11.917"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="1.117"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="38.565" id="lobe-icons-antigravity-2-_R_0_" width="38.9" x="4.251" y="-13.493"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="5.4"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="36.517" id="lobe-icons-antigravity-3-_R_0_" width="40.955" x="-21.889" y="-10.592"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.591"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="36.517" id="lobe-icons-antigravity-4-_R_0_" width="40.955" x="-21.889" y="-10.592"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.591"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="36.595" id="lobe-icons-antigravity-5-_R_0_" width="36.632" x="-19.099" y="-10.278"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.591"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="34.087" id="lobe-icons-antigravity-6-_R_0_" width="33.533" x=".981" y="8.758"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="4.363"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="35.276" id="lobe-icons-antigravity-7-_R_0_" width="35.978" x="-6.143" y="-21.659"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.954"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="46.523" id="lobe-icons-antigravity-8-_R_0_" width="45.114" x="-11.96" y="-.46"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.531"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="24.054" id="lobe-icons-antigravity-9-_R_0_" width="25.094" x="10.485" y=".58"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.159"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="30.007" id="lobe-icons-antigravity-10-_R_0_" width="33.508" x="5.833" y="-12.467"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="2.669"></feGaussianBlur></filter><filter color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse" height="26.151" id="lobe-icons-antigravity-11-_R_0_" width="22.194" x="-8.355" y="-8.876"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur result="effect1_foregroundBlur_977_115" stdDeviation="3.303"></feGaussianBlur></filter></defs></svg>',$q=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>
|
|
819
819
|
`,Vq=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></svg>
|
package/dist/web/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="theme-color" content="#fdfdfe"/><title>Jarvy</title><link rel="icon" href="/favicon.svg" type="image/svg+xml"/><link rel="icon" href="/favicon-32.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-touch-icon.png"/><link rel="manifest" href="/manifest.webmanifest"/> <script type="module" crossorigin src="/assets/index-
|
|
2
|
+
<html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="theme-color" content="#fdfdfe"/><title>Jarvy</title><link rel="icon" href="/favicon.svg" type="image/svg+xml"/><link rel="icon" href="/favicon-32.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-touch-icon.png"/><link rel="manifest" href="/manifest.webmanifest"/> <script type="module" crossorigin src="/assets/index-D3iESMj6.js"></script>
|
|
3
3
|
<link rel="stylesheet" crossorigin href="/assets/index-DYCjMJlL.css">
|
|
4
4
|
</head><body><div id="root"></div></body></html>
|
package/package.json
CHANGED