koishi-plugin-chat-patch 5.5.0 → 5.6.0
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/client/vue/index.vue +8 -1
- package/client/web/dist/assets/{Chat-DTEsebnY.css → Chat-BXVWj5Bd.css} +1 -1
- package/client/web/dist/assets/{Chat-Clqxn7CB.js → Chat-m4-U5uHa.js} +4 -4
- package/client/web/dist/assets/{MsgBody-C0TKsXhC.js → MsgBody-CzrxyiFO.js} +1 -1
- package/client/web/dist/assets/MsgBody.vue_vue_type_script_setup_true_lang-BBF1uxm6.js +67 -0
- package/client/web/dist/assets/{index-BA37EQGa.js → index-EJ2CcODr.js} +72 -78
- package/client/web/dist/assets/index-X9hFOAza.css +1 -0
- package/client/web/dist/index.html +2 -2
- package/client/web/src/App.vue +7 -0
- package/client/web/src/assets/css/chat.css +6 -4
- package/client/web/src/assets/l10n/zh-CN.po +0 -6
- package/client/web/src/components/History.vue +27 -0
- package/client/web/src/components/MsgBody.vue +18 -9
- package/client/web/src/function/connect.ts +208 -46
- package/client/web/src/function/msg.ts +8 -6
- package/client/web/src/function/option.ts +1 -1
- package/client/web/src/function/satori-model.ts +20 -2
- package/client/web/src/function/satori.ts +64 -0
- package/client/web/src/pages/Chat.vue +0 -4
- package/client/web/src/pages/Friends.vue +7 -9
- package/client/web/src/pages/Messages.vue +6 -7
- package/client/web/src/pages/options/OptDev.vue +1 -25
- package/client/web/src/pages/options/OptFunction.vue +23 -0
- package/client/web/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/lib/bootstrap.d.ts +6 -0
- package/lib/database.d.ts +5 -2
- package/lib/gateway.d.ts +46 -0
- package/lib/index.js +1468 -131
- package/lib/recorder.d.ts +3 -5
- package/lib/satori.d.ts +3 -0
- package/lib/types.d.ts +17 -0
- package/package.json +4 -1
- package/src/bootstrap.ts +5 -10
- package/src/database.ts +745 -662
- package/src/gateway.ts +259 -0
- package/src/index.ts +63 -53
- package/src/recorder.ts +97 -77
- package/src/satori.ts +19 -0
- package/src/server.d.ts +26 -26
- package/src/types.ts +19 -0
- package/client/web/dist/assets/MsgBody.vue_vue_type_script_setup_true_lang-CCdBwlN_.js +0 -67
- package/client/web/dist/assets/index-B71pPwae.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Cg_esKB0.js","./core-DhEqZVGG.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{d as Bt,w as Ce,u as B,o as W,c as ee,r as Pt,a as me,b as Me,e as It,F as Ie,f as vt,m as ci,t as mo,n as gt,g as In,h as bi,i as ie,j as ge,k as Ut,l as ye,p as cn,q as wt,s as go,v as Gn,x as _t,y as sn,z as vo,A as En,B as ki,C as xn,D as Ii,E as Fn,G as Ln,H as g,I as G,J as Sn,K as Ke,T as _i,L as un,M as it,N as fi,O as di,P as Jt,Q as ut,R as Be,S as Si,_ as $n,U as Ci,V as bt,W as po,X as Mi,Y as yo,Z as Kn,$ as Ai,a0 as wo,a1 as gn,a2 as hi,a3 as Ti,a4 as jn,a5 as Ei,a6 as xi,a7 as qn,a8 as Vn,a9 as bo,aa as ko,ab as tn,ac as vn,ad as mi,ae as Io,af as _o,ag as Dt,ah as pn,ai as So,aj as yn,ak as nn,al as on,am as an,an as Un,ao as Co,ap as Mo,aq as Ao,ar as To,as as Eo,at as gi,au as vi,av as xo,aw as Nt,ax as Fo,ay as Lo,az as wn,aA as $o,aB as Ro,aC as Do,aD as Bo,aE as Oo,aF as Uo,aG as zo,aH as No,aI as Ho}from"./index-BA37EQGa.js";import{_ as Wn,E as rn,a as ln}from"./MsgBody.vue_vue_type_script_setup_true_lang-CCdBwlN_.js";function Jn(n,f,D){if(!D)return f;const r=n==null?void 0:n[D];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${D}')`);return r}function bn(n,f){return n.map((D,r)=>Jn(D,r,f))}function Po(n,f,D){const r=[],e=[];for(let t=0;t<n.length;t++){const l=n[t],u=Jn(l,t,f),w=D(l,t,u);r.push(u),e.push(typeof w=="number"&&w>0?w:null)}return{keys:r,sizes:e}}function jo(n,f,D){if(!n||n.keys.length!==f.length||n.sizes.length!==f.length)return!1;for(let r=0;r<f.length;r++)if(n.keys[r]!==Jn(f[r],r,D))return!1;return!0}function qo(n,f,D){if(!jo(n,f,D))return{};const r={};for(let e=0;e<n.keys.length;e++){const t=n.sizes[e];typeof t=="number"&&t>0&&(r[n.keys[e]]=t)}return r}function Vo(n,f){if(!n.length||f.length<=n.length)return 0;const D=n[0],r=f.indexOf(D);if(r<=0||r+n.length<f.length&&n.length>f.length-r)return 0;for(let e=0;e<n.length;e++)if(f[r+e]!==n[e])return 0;return r}function pi(n,f,D,r,e,t=0){const l=e??"start";if(l==="nearest"){const u=D+r,w=n+f;return n>=D&&w<=u?null:n<D?n+t:w-r+t}return l==="end"?n+f-r+t:l==="center"?n+(f-r)/2+t:n+t}const Wo={itemsLimit:1e3};function Fi(n){return typeof window<"u"&&n===window}const Qo=(()=>{if(typeof document>"u")return"negative";const n=document.createElement("div"),f=document.createElement("div");n.style.width="4px",n.style.height="1px",n.style.overflow="auto",n.style.direction="rtl",f.style.width="8px",f.style.height="1px",n.appendChild(f),document.body.appendChild(n),n.scrollLeft=-1;const D=n.scrollLeft<0;return document.body.removeChild(n),D?"negative":"default"})();function Gt(n,f,D){return f!=="horizontal"||!D||Fi(D)||getComputedStyle(D).direction!=="rtl"?n:Qo==="negative"?-n:n}function Go(n,f,D){return Gt(n,f,D)}function zn(n,f,D,r){const e=Go(D,f,n),t=!!(r!=null&&r.smooth);if(Fi(n)){f==="vertical"?n.scrollTo({top:e,behavior:t?"smooth":"auto"}):n.scrollTo({left:e,behavior:t?"smooth":"auto"});return}if(typeof n.scrollTo=="function"){n.scrollTo(f==="vertical"?{top:e,behavior:t?"smooth":"auto"}:{left:e,behavior:t?"smooth":"auto"});return}f==="vertical"?n.scrollTop=e:n.scrollLeft=e}function Ko(n,f,D){return D?f==="vertical"?window.innerHeight:window.innerWidth:f==="vertical"?n.clientHeight:n.clientWidth}const Jo=/auto|scroll/;function Li(n,f){return n.parentNode===null?f:Li(n.parentNode,[...f,n])}function Nn(n,f){return getComputedStyle(n,null).getPropertyValue(f)}function Yo(n){return Nn(n,"overflow")+Nn(n,"overflow-y")+Nn(n,"overflow-x")}function Xo(n){return Jo.test(Yo(n))}function kn(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const f=Li(n.parentNode,[]);for(let D=0;D<f.length;D+=1)if(f[D]instanceof Element&&Xo(f[D]))return f[D];return document.scrollingElement||document.documentElement}let Qn=!1;function Zo(){return Qn}if(typeof window<"u"){Qn=!1;try{const n=Object.defineProperty({},"passive",{get(){Qn=!0}});window.addEventListener("test",null,n)}catch{}}let ea=0;function Hn(n){const f=n;f._vs_styleStamp++}function ta(n,f,D){const r=n==null?void 0:n[D];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${D}')`);return r}function na(n,f,D,r,e){const t=ge([]),l=ge(0),u=ge(!1);let w=0,L=0;const i=new Map,a=new Map;let o=!1,d=0,v=0,R=!1,k=null,T=null,K=null,P=0,x=null,q=[],M=null,N=null,y=null,p=!1;const F=new Set,_=ge({}),S=Ut(()=>{const H=ye(n);return H.items.length>0&&typeof H.items[0]!="object"}),A=Ut(()=>{const H=ye(n);if(H.itemSize===null){const V={[-1]:{accumulator:0}},te=H.items,ae=H.sizeField??"size",se=H.minItemSize,le=_.value;let ce=1e4,Te=0,tt;for(let je=0,nt=te.length;je<nt;je++){const Ne=S.value?je:ta(te[je],je,H.keyField);tt=le[Ne]||te[je][ae]||se,tt<ce&&(ce=tt),Te+=tt,V[je]={accumulator:Te,size:tt}}return P=ce,V}return[]}),I=Ut(()=>t.value.filter(H=>H.nr.used).sort((H,V)=>H.nr.index-V.nr.index)),$=Ut(()=>{const H=ye(n),V=S.value?null:H.keyField;return Po(H.items,V,(te,ae,se)=>H.itemSize!=null?H.itemSize:_.value[se]||(te==null?void 0:te[H.sizeField??"size"])||void 0)});function m(H){const V=ye(n);return _.value=qo(H,V.items,S.value?null:V.keyField),Object.keys(_.value).length>0}function h(H){let V=a.get(H);return V||(V=[],a.set(H,V)),V}function O(H,V,te,ae,se){const le=sn({id:ea++,index:V,used:!0,key:ae,type:se}),ce=vo({item:te,position:0,offset:0,nr:le,_vs_styleStamp:0});return H.push(ce),ce}function C(H){const V=h(H);if(V&&V.length){const te=V.pop();return te.nr.used=!0,Hn(te),te}}function z(H){const V=H.nr.type;h(V).push(H),H.nr.used=!1,H.position=-9999,Hn(H),i.delete(H.nr.key)}function Q(){i.clear(),a.clear();for(let H=0,V=t.value.length;H<V;H++){const te=t.value[H];te&&z(te)}}function Y(H){let V=-1;return V=requestAnimationFrame(()=>{F.delete(V),H()}),F.add(V),V}function ne(){for(const H of F)cancelAnimationFrame(H);F.clear()}function X(){k&&(clearTimeout(k),k=null),T&&(clearTimeout(T),T=null),K&&(clearTimeout(K),K=null),N&&(clearTimeout(N),N=null),y&&(clearTimeout(y),y=null)}function j(){var H;(H=e==null?void 0:e.onResize)==null||H.call(e),u.value&&ue(!1)}function re(){M&&!p&&_e();const H=ye(n);if(!o){if(o=!0,k)return;const V=()=>Y(()=>{o=!1;const{continuous:te}=ue(!1,!0);te||(T&&clearTimeout(T),T=setTimeout(re,H.updateInterval+100))});V(),H.updateInterval&&(k=setTimeout(()=>{k=null,o&&V()},H.updateInterval))}}function Re(H,V){var te,ae;u.value&&(H||V.boundingClientRect.width!==0||V.boundingClientRect.height!==0?((te=e==null?void 0:e.onVisible)==null||te.call(e),Y(()=>{ue(!1)})):(ae=e==null?void 0:e.onHidden)==null||ae.call(e))}function Ae(){const H=ye(f),V=H?kn(H):void 0;return window.document&&(V===window.document.documentElement||V===window.document.body)?window:V||window}function fe(){const H=ye(D);return H?ye(n).direction==="vertical"?H.scrollHeight:H.scrollWidth:0}function ve(){const H=ye(f);if(!H)return{start:0,end:0};const V=ye(n),te=V.direction==="vertical";let ae;if(V.pageMode){const se=H.getBoundingClientRect(),le=te?se.height:se.width;let ce=-(te?se.top:se.left),Te=te?window.innerHeight:window.innerWidth;ce<0&&(Te+=ce,ce=0),ce+Te>le&&(Te=le-ce),ae={start:ce,end:ce+Te}}else te?ae={start:H.scrollTop,end:H.scrollTop+H.clientHeight}:ae={start:Gt(H.scrollLeft,V.direction,H),end:Gt(H.scrollLeft,V.direction,H)+H.clientWidth};return ae}function xe(){const H=ye(f);if(!H)return{start:0,end:0};if(ye(n).direction==="vertical"){const V=Gt(H.scrollLeft,"horizontal",H);return{start:V,end:V+H.clientWidth}}return{start:H.scrollTop,end:H.scrollTop+H.clientHeight}}function Fe(H){const V=ye(n);if(V.itemSize!=null)return V.itemSize;const te=A.value[H];return(te==null?void 0:te.size)||Number(V.minItemSize)||0}function qe(H){var V;const te=ye(n),ae=te.gridItems||1;return H<=0?0:te.itemSize!=null?Math.floor(H/ae)*te.itemSize:((V=A.value[H-1])==null?void 0:V.accumulator)||0}function Je(H){const V=ye(n),te=V.items.length,ae=V.gridItems||1;if(!te)return 0;if(V.itemSize!=null){const Te=Math.floor(H/V.itemSize)*ae;return Math.min(Math.max(Te,0),te-1)}let se=0,le=te-1,ce=0;for(;se<=le;){const Te=Math.floor((se+le)/2);qe(Te)<=H?(ce=Te,se=Te+1):le=Te-1}return ce}function _e(){N&&(clearTimeout(N),N=null),M=null}function Oe(){N&&clearTimeout(N),N=setTimeout(()=>{M=null,N=null},150)}function De(H,V){if(!H.length){_e();return}const te=Math.max(ve().start-fe(),0),ae=Math.min(Je(te),H.length-1),se=H[ae],le=V?se==null?void 0:se[V]:ae;if(le==null){_e();return}const ce=fe()+qe(ae);M={key:le,offset:ve().start-ce}}function Se(H){if(!M)return!1;const V=ye(n),te=H??V.items,ae=S.value?null:V.keyField,se=bn(te,ae).indexOf(M.key);if(se===-1)return _e(),!1;const le=fe()+qe(se)+M.offset,ce=ve().start;return Math.abs(le-ce)<.5?!1:(p=!0,rt(le),Y(()=>{p=!1}),!0)}function Ve(){ye(n).pageMode?ot():Le()}function ot(){x=Ae(),x.addEventListener("scroll",re,Zo()?{passive:!0}:!1),x.addEventListener("resize",j)}function Le(){x&&(x.removeEventListener("scroll",re),x.removeEventListener("resize",j),x=null)}function ct(H,V,te,ae,se,le){const ce=Math.ceil(H/V)*te,Te=Math.max(0,Math.floor(se.start/te)),tt=Math.min(Math.ceil(se.end/te),Math.ceil(H/V)),je=Math.max(0,Math.floor(le.start/ae)),nt=Math.min(Math.ceil(le.end/ae),V),Ne=[];for(let lt=Te;lt<tt;lt++){const pt=lt*V;for(let Ye=je;Ye<nt;Ye++){const at=pt+Ye;if(at>=H)break;Ne.push(at)}}const be=Ne[0]??0,Ue=Ne.at(-1)??-1;return{renderedIndices:Ne,startIndex:be,endIndex:Ue+1,visibleStartIndex:be,visibleEndIndex:Ue,totalSize:ce}}function Pe(){const H=ye(n);if(!H.gridItems||H.itemSize==null)return!1;const V=ye(f);if(!V)return!1;const te=H.itemSecondarySize||H.itemSize,ae=H.direction==="vertical"?V.clientWidth:V.clientHeight;return te*H.gridItems>ae}function ue(H,V=!1){var te,ae;const se=ye(n),le=se.itemSize,ce=se.gridItems||1,Te=se.itemSecondarySize||le,tt=P,je=se.typeField,nt=S.value?null:se.keyField,Ne=se.items,be=Ne.length,Ue=A.value,lt=i,pt=t.value;let Ye=null,at=null,We,ze,Lt,kt,yt;if(!be)We=ze=kt=yt=Lt=0;else if(R)We=kt=0,ze=yt=Math.min(se.prerender,Ne.length),Lt=0;else{const ke=ve(),st=xe();if(V){let Xe=ke.start-d;Xe<0&&(Xe=-Xe);let He=st.start-v;He<0&&(He=-He);const $t=le===null&&Xe>=tt||le!==null&&Xe>=le,ht=ce>1&&le!=null&&He>=Te;if(!$t&&!ht)return{continuous:!0}}d=ke.start,v=st.start;const At=se.buffer;ke.start-=At,ke.end+=At,st.start-=At,st.end+=At;let Et=0;const Vt=ye(D);Vt&&(Et=Vt.scrollHeight,ke.start-=Et);const dn=ye(r);if(dn){const Xe=dn.scrollHeight;ke.end+=Xe}if(le===null){let Xe,He=0,$t=be-1,ht=~~(be/2),Xt;do Xt=ht,Xe=Ue[ht].accumulator,Xe<ke.start?He=ht:ht<be-1&&Ue[ht+1].accumulator>ke.start&&($t=ht),ht=~~((He+$t)/2);while(ht!==Xt);for(ht<0&&(ht=0),We=ht,Lt=Ue[be-1].accumulator,ze=ht;ze<be&&Ue[ze].accumulator<ke.end;ze++);for(ze===-1?ze=Ne.length-1:(ze++,ze>be&&(ze=be)),kt=We;kt<be&&Et+Ue[kt].accumulator<ke.start;kt++);for(yt=kt;yt<be&&Et+Ue[yt].accumulator<ke.end;yt++);}else if(ce>1){const Xe=ct(be,ce,le,Te,ke,st);Ye=Xe.renderedIndices,at=new Set(Ye),We=Xe.startIndex,ze=Xe.endIndex,kt=Xe.visibleStartIndex,yt=Xe.visibleEndIndex,Lt=Xe.totalSize}else{We=~~(ke.start/le*ce);const Xe=We%ce;We-=Xe,ze=Math.ceil(ke.end/le*ce),kt=Math.max(0,Math.floor((ke.start-Et)/le*ce)),yt=Math.floor((ke.end-Et)/le*ce),We<0&&(We=0),ze>be&&(ze=be),kt<0&&(kt=0),yt>be&&(yt=be),Lt=Math.ceil(be/ce)*le}}ze-We>Wo.itemsLimit&&ft(),l.value=Lt;let Ee;const fn=We<=L&&ze>=w;if(!fn||H)Q();else for(let ke=0,st=pt.length;ke<st;ke++){const At=pt[ke];if(At&&(Ee=At,Ee.nr.used)){const Et=at?at.has(Ee.nr.index):Ee.nr.index>=We&&Ee.nr.index<ze,Vt=le||Ue[Ee.nr.index]&&Ue[Ee.nr.index].size;(!Et||!Vt)&&z(Ee)}}let Mt,qt;const Yt=Ye??Array.from({length:Math.max(0,ze-We)},(ke,st)=>We+st);for(const ke of Yt){if(!(le||Ue[ke]&&Ue[ke].size))continue;Mt=Ne[ke];const st=nt?Mt[nt]:ke;if(st==null)throw new Error(`Key is ${st} on item (keyField is '${nt}')`);if(Ee=lt.get(st),Ee)Ee.item!==Mt&&(Ee.item=Mt),Ee.nr.used||console.warn(`Expected existing view's used flag to be true, got ${Ee.nr.used}`);else{if(qt=Mt[je],Ee=C(qt),Ee){const At=Ee.nr.index!==ke||Ee.nr.key!==st;Ee.item=Mt,Ee.nr.index=ke,Ee.nr.key=st,Ee.nr.type!==qt&&console.warn("Reused view's type does not match pool's type"),At&&Hn(Ee)}else Ee=O(pt,ke,Mt,st,qt);lt.set(st,Ee)}le===null?(Ee.position=((te=Ue[ke-1])==null?void 0:te.accumulator)||0,Ee.offset=0):(Ee.position=Math.floor(ke/ce)*le,Ee.offset=ke%ce*Te)}return w=We,L=ze,se.emitUpdate&&((ae=e==null?void 0:e.onUpdate)==null||ae.call(e,We,ze,kt,yt)),K&&clearTimeout(K),K=setTimeout(Ft,se.updateInterval+300),{continuous:fn}}function ft(){throw y=setTimeout(()=>{y=null,console.warn("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",ye(f)),console.warn("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")}function Ct(){if(Pe())return!1;const H=t.value.filter(({nr:V})=>V.used);for(let V=1;V<H.length;V++)if(H[V].nr.index!==H[V-1].nr.index+1)return!0;return!1}function Ft(){t.value.sort((H,V)=>H.nr.index-V.nr.index),Ct()&&(ue(!1),K&&clearTimeout(K))}function et(H,V){const te=ye(n),ae=ye(f);if(!ae)return;const se=Math.max(0,Math.min(H,te.items.length-1)),le=ve().start,ce=Ko(ae,te.direction,te.pageMode),Te=qe(se),tt=Fe(se),je=pi(Te,tt,le,ce,V==null?void 0:V.align,(V==null?void 0:V.offset)??0);if(je!=null&&(rt(je,V),te.gridItems&&te.itemSize!=null)){const nt=ye(f);if(!nt)return;const Ne=te.gridItems,be=te.itemSecondarySize||te.itemSize,Ue=se%Ne*be,lt=te.direction==="vertical"?"horizontal":"vertical",pt=lt==="horizontal"?Gt(nt.scrollLeft,"horizontal",nt):nt.scrollTop,Ye=lt==="horizontal"?nt.clientWidth:nt.clientHeight,at=pi(Ue,be,pt,Ye,V==null?void 0:V.align,(V==null?void 0:V.offset)??0);at!=null&&zn(nt,lt,at,V)}}function rt(H,V){const te=ye(n),ae=ye(f);if(ae)if(te.pageMode){const se=kn(ae),le=se.getBoundingClientRect(),ce=ae.getBoundingClientRect(),Te=te.direction==="vertical"?"top":"left",tt=kn(ae)===document.documentElement||kn(ae)===document.body?te.direction==="vertical"?window.scrollY:window.scrollX:Gt(te.direction==="vertical"?se.scrollTop:se.scrollLeft,te.direction,se),je=ce[Te]-le[Te];zn(se.tagName==="HTML"?window:se,te.direction,H+tt+je,V)}else zn(ae,te.direction,H,V)}const we=ye(n);return q=bn(we.items,we.items.length>0&&typeof we.items[0]!="object"?null:we.keyField),we.cache&&m(we.cache),we.prerender&&(R=!0,ue(!1)),we.gridItems&&!we.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems"),cn(()=>{Ve(),wt(()=>{R=!1,ue(!0),u.value=!0})}),go(()=>{const H=d;typeof H=="number"&&wt(()=>{rt(H)})}),Gn(()=>{X(),ne(),Le()}),_t(()=>ye(n).cache,H=>{m(H),ue(!0)}),_t(()=>ye(n).items,(H,V)=>{const te=ye(n),ae=S.value?null:te.keyField,se=bn(H,ae);if(te.shift){const le=V?bn(V,ae):q;Vo(le,se)>0?De(V??[],ae):_e()}else _e();q=se,Se(H),ue(!0)}),_t(()=>ye(n).pageMode,()=>{Ve(),ue(!1)}),_t(A,()=>{Se()&&Oe(),ue(!1)},{deep:!0}),_t(()=>ye(n).gridItems,()=>{ue(!0)}),_t(()=>ye(n).itemSecondarySize,()=>{ue(!0)}),{pool:t,visiblePool:I,totalSize:l,ready:u,sizes:A,simpleArray:S,scrollToItem:et,scrollToPosition:rt,getScroll:ve,findItemIndex:Je,getItemOffset:qe,getItemSize:Fe,cacheSnapshot:$,restoreCache:m,updateVisibleItems:ue,handleScroll:re,handleResize:j,handleVisibilityChange:Re,sortViews:Ft}}const Yn=new WeakMap;function ia(n){return typeof n=="function"?{callback:n,observer:null,intersection:void 0,visible:null}:{callback:n.callback,observer:null,intersection:n.intersection,visible:null}}function yi(n,f){$i(n);const D=ia(f.value);if(Yn.set(n,D),typeof IntersectionObserver>"u"){const r=n.getBoundingClientRect();D.visible=!0,D.callback(!0,{boundingClientRect:r});return}D.observer=new IntersectionObserver(r=>{const e=r[0],t=!!(e!=null&&e.isIntersecting);D.visible!==null&&D.visible===t||(D.visible=t,D.callback(t,e))},D.intersection),D.observer.observe(n)}function $i(n){const f=Yn.get(n);f!=null&&f.observer&&(f.observer.disconnect(),f.observer=null)}const oa={mounted(n,f){yi(n,f)},updated(n,f){f.value!==f.oldValue&&yi(n,f)},unmounted(n){$i(n),Yn.delete(n)}},aa=Bt({__name:"ItemView",props:{view:{},itemTag:{}},setup(n){const f=n;return(D,r)=>(W(),Me(bi(f.itemTag),{class:"vue-recycle-scroller__item-view"},{default:It(()=>[Pt(D.$slots,"default",{item:f.view.item,index:f.view.nr.index,active:f.view.nr.used})]),_:3}))}}),sa=Bt({__name:"ResizeObserver",emits:["notify"],setup(n,{emit:f}){const D=f,r=ge();let e=null,t=null;function l(){D("notify")}return cn(()=>{var u;const w=(u=r.value)==null?void 0:u.parentElement;if(w){if(typeof ResizeObserver<"u"){e=new ResizeObserver(()=>{l()}),e.observe(w);return}t=()=>l(),window.addEventListener("resize",t)}}),Gn(()=>{e&&(e.disconnect(),e=null),t&&(window.removeEventListener("resize",t),t=null)}),(u,w)=>(W(),ee("div",{ref_key:"el",ref:r,class:"vue-recycle-scroller__resize-observer","aria-hidden":"true"},null,512))}}),ra=(n,f)=>{const D=n.__vccOpts||n;for(const[r,e]of f)D[r]=e;return D},la=ra(sa,[["__scopeId","data-v-08cc04ab"]]),ua=Bt({__name:"RecycleScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},itemSize:{default:null},gridItems:{default:void 0},itemSecondarySize:{default:void 0},minItemSize:{default:null},sizeField:{default:"size"},typeField:{default:"type"},buffer:{default:200},pageMode:{type:Boolean,default:!1},shift:{type:Boolean,default:!1},cache:{default:void 0},prerender:{default:0},emitUpdate:{type:Boolean,default:!1},disableTransform:{type:Boolean,default:!1},updateInterval:{default:0},skipHover:{type:Boolean,default:!1},listClass:{default:""},itemClass:{default:""}},emits:["resize","visible","hidden","update","scrollStart","scrollEnd"],setup(n,{expose:f,emit:D}){const r=n,e=D,t=oa,l=ge(),u=ge(),w=ge(),L=ge(null),i=na(r,l,u,w,{onResize:()=>e("resize"),onVisible:()=>e("visible"),onHidden:()=>e("hidden"),onUpdate:(I,$,m,h)=>{e("update",I,$,m,h),m<=0&&e("scrollStart"),h>=r.items.length-1&&e("scrollEnd")}}),{pool:a,visiblePool:o,totalSize:d,ready:v,scrollToItem:R,scrollToPosition:k,getScroll:T,findItemIndex:K,getItemOffset:P,getItemSize:x,cacheSnapshot:q,restoreCache:M,updateVisibleItems:N,handleScroll:y,handleResize:p,handleVisibilityChange:F}=i;function _(I){L.value=I}function S(){L.value=null}const A=Ut(()=>{const I={[r.direction==="vertical"?"minHeight":"minWidth"]:`${d.value}px`};if(r.gridItems&&r.itemSize!=null){const $=(r.itemSecondarySize||r.itemSize)*r.gridItems;I[r.direction==="vertical"?"minWidth":"minHeight"]=`${$}px`}return I});return f({el:l,visiblePool:o,scrollToItem:R,scrollToPosition:k,getScroll:T,findItemIndex:K,getItemOffset:P,getItemSize:x,cacheSnapshot:q,restoreCache:M,updateVisibleItems:N}),(I,$)=>Ce((W(),ee("div",{ref_key:"el",ref:l,class:gt(["vue-recycle-scroller",{"grid-mode":r.gridItems,ready:B(v),"page-mode":r.pageMode,[`direction-${r.direction}`]:!0}]),onScrollPassive:$[0]||($[0]=(...m)=>B(y)&&B(y)(...m))},[I.$slots.before?(W(),ee("div",{key:0,ref_key:"before",ref:u,class:"vue-recycle-scroller__slot"},[Pt(I.$slots,"before")],512)):me("",!0),(W(),Me(bi(r.listTag),{style:In(A.value),class:gt(["vue-recycle-scroller__item-wrapper",r.listClass])},{default:It(()=>[(W(!0),ee(Ie,null,vt(B(a),m=>(W(),Me(aa,ci({key:m.nr.id,view:m,"item-tag":r.itemTag,style:B(v)?[r.disableTransform?{[r.direction==="vertical"?"top":"left"]:`${m.position}px`,willChange:"unset"}:{transform:`translate${r.direction==="vertical"?"Y":"X"}(${m.position}px) translate${r.direction==="vertical"?"X":"Y"}(${m.offset}px)`},{width:r.gridItems?`${r.direction==="vertical"&&r.itemSecondarySize||r.itemSize}px`:void 0,height:r.gridItems?`${r.direction==="horizontal"&&r.itemSecondarySize||r.itemSize}px`:void 0,visibility:m.nr.used?"visible":"hidden"}]:null,class:["vue-recycle-scroller__item-view",[r.itemClass,{hover:!r.skipHover&&L.value===m.nr.key}]]},mo(r.skipHover?{}:{mouseenter:()=>{_(m.nr.key)},mouseleave:()=>{S()}})),{default:It(h=>[Pt(I.$slots,"default",ci({ref_for:!0},h))]),_:2},1040,["view","item-tag","style","class"]))),128)),r.items.length===0?Pt(I.$slots,"empty",{key:0}):me("",!0)]),_:3},8,["style","class"])),I.$slots.after?(W(),ee("div",{key:1,ref_key:"after",ref:w,class:"vue-recycle-scroller__slot"},[Pt(I.$slots,"after")],512)):me("",!0),ie(la,{onNotify:B(p)},null,8,["onNotify"])],34)),[[B(t),B(F)]])}}),ca={key:0,class:"chat-info-pan"},fa={class:"ss-card chat-info"},da={key:0},ha={key:1},ma={class:"chat-info-base user"},ga=["src"],va={key:0},pa={class:"info-copy"},ya={class:"info-copy"},wa={class:"info-copy"},ba={style:{"word-break":"break-all"}},ka={key:1},Ia=["innerHTML"],_a={class:"tags"},Sa={key:2},Ca={class:"info-copy"},Ma={class:"info-copy"},Aa={class:"info-copy"},Ta={style:{"word-break":"break-all"}},Ea={class:"info-copy"},xa=["name"],Fa={class:"search-view"},La={for:"info-member-search",class:"sr-only"},$a=["placeholder"],Ra={class:"member-item edit"},Da=["src"],Ba=["onClick"],Oa=["onClick"],Ua=["src"],za={class:"opt-item"},Na={for:"info-member-card"},Ha={key:0,class:"opt-item"},Pa={for:"info-member-title"},ja={class:"opt-item"},qa={for:"info-member-ban-min"},Va=Bt({name:"ViewInfo",__name:"Info",props:{tags:{},chat:{}},emits:["close"],setup(n,{emit:f}){const D=En(),r=ki(),e=xn(),t=Ii(),l=n,u=f,{t:w}=Fn.global;function L(O){const C=String(O??"");return!C||C==="/img/icons/icon.svg"||C.includes("/img/icons/icon.svg")}function i(){return String(l.chat.show.channel_id||l.chat.show.channelId||l.chat.info.user_info.channel_id||l.chat.info.user_info.channelId||String(l.chat.show.id))}function a(){return String(l.chat.show.channel_id||l.chat.show.channelId||l.chat.info.group_info.channel_id||l.chat.info.group_info.channelId||String(l.chat.show.id))}const o=ge([]),d=ge(""),v=ge({}),R=ge({});function k(O){return typeof O!="object"||O===null?{}:O}function T(O){return String(k(O).user_id??"")}function K(O){const C=k(O);return String(C.card||C.nickname||C.name||T(O))}function P(O){return String(k(O).avatar??"")}function x(O){return String(k(O).role??"")}const q=ge({banMin:0});function M(O,C,z){const Q={title:w("提醒"),html:`<span>${w("真的要将 {user} 移出群聊吗",{user:O})}</span>`,button:[{text:w("确定"),fun:()=>{it.send("set_group_kick",{group_id:C,user_id:z},"setGroupKick"),t.popBoxList.shift(),v.value={};const Y={title:w("操作"),html:`<span>${w("正在确认操作……")}</span>`};t.popBoxList.push(Y),fi(1e3).then(()=>(di(String(e.chatInfo.show.id)),fi(1e3))).then(()=>{di(String(e.chatInfo.show.id)),t.popBoxList.shift()})}},{text:w("取消"),master:!0,fun:()=>{t.popBoxList.shift()}}]};t.popBoxList.push(Q)}function N(O){const C=new ut;Jt.config.globalProperties.$copyText(String(O)).then(()=>{C.add(Be.INFO,w("复制成功"),!0)},()=>{C.add(Be.ERR,w("复制失败"),!0)})}function y(O,C){const z=O.target.value;if(z!==""){const Q=parseInt(z);if(Q>0){const Y={title:w("操作"),html:`<span>${w("确认禁言?")}</span>`,button:[{text:w("确认"),fun:()=>{var X;const ne=(X=D.jsonMap.ban_mumber)==null?void 0:X.name;ne&&it.send(ne,{group_id:e.chatInfo.show.id,user_id:C.user_id,duration:Q*60},"banMumber"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Y)}}}function p(O,C){const z=O.target.value;if(v.value.card!==z){const Q={title:w("操作"),html:`<span>${w("确认修改昵称?")}</span>`,button:[{text:w("确认"),fun:()=>{var ne;const Y=(ne=D.jsonMap.set_group_nickname)==null?void 0:ne.name;Y&&it.send(Y,{group_id:e.chatInfo.show.id,user_id:C.user_id,card:z},"updateGroupMemberInfo"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Q)}}function F(O,C){const z=O.target.value;if(v.value.card!==z){const Q={title:w("操作"),html:`<span>${w("确认修改头衔?")}</span>`,button:[{text:w("确认"),fun:()=>{var ne;const Y=(ne=D.jsonMap.set_group_title)==null?void 0:ne.name;Y&&it.send(Y,{group_id:e.chatInfo.show.id,user_id:C.user_id,special_title:z},"updateGroupMemberInfo"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Q)}}function _(O){O<1e10&&(O*=1e3);const C=new Date().getTime(),z=O-C;return z>0?Math.floor(z/1e3/60):0}function S(O){const C=O.target.value;if(C!==""){const z=parseInt(C);isNaN(z)?O.target.value="":z<0&&(O.target.value="0")}}function A(){v.value={},u("close")}function I(O){if(O.user_id!=D.loginInfo.uin){let C=r.userList.find(z=>z.user_id==O.user_id);C||(C={user_id:O.user_id,nickname:w("临时会话"),remark:O.user_id,group_id:O.group_id,group_name:""}),r.baseOnMsgList.set(String(O.user_id),C),wt(()=>{if(C){const z=document.getElementById("user-"+C.user_id);z&&z.click()}})}}function $(O){h(O.role)?(v.value=O,R.value=JSON.parse(JSON.stringify(O)),q.value.banMin=_(O.shut_up_timestamp)):N(O.user_id)}function m(O){O&&(d.value=O.target.value);const C=d.value.trim();if(!C){o.value=[];return}const z=C.toLowerCase(),Q=Array.isArray(l.chat.info.group_members)?l.chat.info.group_members:[];o.value=Si(Q).filter(Y=>{const ne=K(Y).toLowerCase(),X=T(Y);return ne.includes(z)||X.includes(C)||X.toLowerCase().includes(z)})}_t(()=>l.chat.info.group_members,()=>{d.value.trim()&&m()},{deep:!0});function h(O){return l.chat.info.me_info.role==="owner"||l.chat.info.me_info.role==="admin"&&O!=="owner"}return(O,C)=>{const z=Ln("font-awesome-icon");return n.tags.openChatInfo?(W(),ee("div",ca,[g("div",fa,[g("header",null,[n.chat.show.type==="group"?(W(),ee("span",da,G(B(w)("群资料")),1)):me("",!0),n.chat.show.type==="user"?(W(),ee("span",ha,G(B(w)("好友")),1)):me("",!0),ie(z,{icon:["fas","xmark"],onClick:A})]),g("div",ma,[g("div",null,[g("img",{"data-avatar":"",src:n.chat.show.avatar||"/img/icons/icon.svg",onError:C[0]||(C[0]=(...Q)=>B(Sn)&&B(Sn)(...Q))},null,40,ga),g("div",null,[g("a",null,G(n.chat.show.name),1),g("span",null,G(n.chat.show.id),1)]),g("div",{style:{display:"flex","align-items":"center","justify-content":"center",cursor:"pointer"},onClick:C[1]||(C[1]=Q=>N(n.chat.show.id))},[ie(z,{icon:["fas","copy"]})])]),n.chat.show.type==="group"?(W(),ee("div",va,[g("header",null,[g("span",null,G(B(w)("群组 ID")),1)]),g("div",pa,[g("span",null,G(n.chat.show.id),1),ie(z,{icon:["fas","copy"],onClick:C[2]||(C[2]=Q=>N(n.chat.show.id))})]),g("header",null,[g("span",null,G(B(w)("频道 ID")),1)]),g("div",ya,[g("span",null,G(a()),1),ie(z,{icon:["fas","copy"],onClick:C[3]||(C[3]=Q=>N(a()))})]),g("header",null,[g("span",null,G(B(w)("群头像")),1)]),g("div",wa,[g("span",ba,G(L(n.chat.show.avatar)?B(w)("无"):n.chat.show.avatar),1),L(n.chat.show.avatar)?me("",!0):(W(),Me(z,{key:0,icon:["fas","copy"],onClick:C[4]||(C[4]=Q=>N(n.chat.show.avatar))}))])])):me("",!0),n.chat.show.type==="group"?Ce((W(),ee("div",ka,[g("header",null,[g("span",null,G(B(w)("介绍")),1)]),g("span",{innerHTML:n.chat.info.group_info.gIntro===void 0||n.chat.info.group_info.gIntro===""?B(w)("群主很懒,还没有群介绍哦~"):n.chat.info.group_info.gIntro},null,8,Ia),g("div",_a,[(W(!0),ee(Ie,null,vt(n.chat.info.group_info.tags,Q=>(W(),ee("div",{key:Q.md},G(Q.tag),1))),128))])],512)),[[Ke,Object.keys(n.chat.info.group_info).length>0]]):n.chat.show.type==="user"?(W(),ee("div",Sa,[g("header",null,[g("span",null,G(B(w)("用户 ID")),1)]),g("div",Ca,[g("span",null,G(n.chat.show.id),1),ie(z,{icon:["fas","copy"],onClick:C[5]||(C[5]=Q=>N(n.chat.show.id))})]),g("header",null,[g("span",null,G(B(w)("用户名称")),1)]),g("div",Ma,[g("span",null,G(n.chat.show.name),1),ie(z,{icon:["fas","copy"],onClick:C[6]||(C[6]=Q=>N(n.chat.show.name))})]),g("header",null,[g("span",null,G(B(w)("用户头像链接")),1)]),g("div",Aa,[g("span",Ta,G(L(n.chat.show.avatar)?B(w)("无"):n.chat.show.avatar),1),L(n.chat.show.avatar)?me("",!0):(W(),Me(z,{key:0,icon:["fas","copy"],onClick:C[7]||(C[7]=Q=>N(n.chat.show.avatar))}))]),g("header",null,[g("span",null,G(B(w)("频道 ID")),1)]),g("div",Ea,[g("span",null,G(i()),1),ie(z,{icon:["fas","copy"],onClick:C[8]||(C[8]=Q=>N(i()))})])])):me("",!0)]),n.chat.show.type==="group"?(W(),Me(B(_i),{key:0,class:"chat-info-tab"},{default:It(()=>[g("div",{name:B(w)("成员")},[g("div",Fa,[g("label",La,G(B(w)("搜索成员")),1),g("input",{id:"info-member-search",placeholder:B(w)("搜索 ……"),onInput:C[9]||(C[9]=Q=>m(Q))},null,40,$a)]),ie(B(ua),{class:"member-scroller",items:d.value.trim()?o.value:n.chat.info.group_members,"item-size":60,"key-field":"user_id"},{default:It(({item:Q})=>[g("div",Ra,[g("img",{alt:"nk",loading:"lazy","data-avatar":"",src:P(Q)||"/img/icons/icon.svg"},null,8,Da),g("div",null,[g("a",{onClick:Y=>I(Q)},G(K(Q)),9,Ba),x(Q)==="owner"?(W(),Me(z,{key:0,icon:["fas","crown"]})):me("",!0),x(Q)==="admin"?(W(),Me(z,{key:1,icon:["fas","star"]})):me("",!0)]),g("span",{onClick:Y=>$(Q)},G(T(Q)),9,Oa),h(x(Q))?(W(),Me(z,{key:0,icon:["fas","wrench"],onClick:Y=>$(Q)},null,8,["onClick"])):(W(),Me(z,{key:1,icon:["fas","copy"],onClick:Y=>N(T(Q))},null,8,["onClick"]))])]),_:1},8,["items"])],8,xa)]),_:1})):me("",!0),g("div",{class:gt("ss-card user-config"+(Object.keys(v.value).length>0?" show":""))},[g("div",null,[g("img",{alt:"nk","data-avatar":"",src:v.value.avatar||"/img/icons/icon.svg"},null,8,Ua),g("div",null,[g("a",null,G(v.value.card!=""?v.value.card:v.value.nickname),1),g("span",null,G(v.value.user_id),1)]),ie(z,{style:{"margin-right":"20px"},icon:["fas","copy"],onClick:C[10]||(C[10]=Q=>N(v.value.user_id))}),ie(z,{icon:["fas","angle-down"],onClick:C[11]||(C[11]=Q=>v.value={})})]),g("div",null,[g("header",null,G(B(w)("成员信息")),1),g("div",za,[ie(z,{icon:["fas","clipboard-list"]}),g("div",null,[g("label",Na,G(B(w)("成员昵称")),1),g("span",null,G(B(w)("啊吧啊吧……")),1)]),Ce(g("input",{id:"info-member-card","onUpdate:modelValue":C[12]||(C[12]=Q=>R.value.card=Q),style:{width:"50%"},class:"ss-input",type:"text",onChange:C[13]||(C[13]=Q=>p(Q,v.value))},null,544),[[un,R.value.card]])]),n.chat.info.me_info.role==="owner"?(W(),ee("div",Ha,[ie(z,{icon:["fas","clipboard-list"]}),g("div",null,[g("label",Pa,G(B(w)("成员头衔")),1),g("span",null,G(B(w)("猪咪猪咪")),1)]),Ce(g("input",{id:"info-member-title","onUpdate:modelValue":C[14]||(C[14]=Q=>R.value.title=Q),style:{width:"50%"},class:"ss-input",type:"text",onChange:C[15]||(C[15]=Q=>F(Q,v.value))},null,544),[[un,R.value.title]])])):me("",!0),n.chat.info.me_info.role==="owner"&&v.value.role!="owner"||n.chat.info.me_info.role==="admin"&&v.value.role==="member"?(W(),ee(Ie,{key:1},[g("header",null,G(B(w)("操作")),1),g("div",ja,[ie(z,{icon:["fas","clipboard-list"]}),g("div",null,[g("label",qa,G(B(w)("禁言成员")),1),g("span",null,G(B(w)("要让小猫咪不许说话几分钟呢?")),1)]),Ce(g("input",{id:"info-member-ban-min","onUpdate:modelValue":C[16]||(C[16]=Q=>q.value.banMin=Q),style:{width:"50%"},class:"ss-input",type:"text",onInput:S,onChange:C[17]||(C[17]=Q=>y(Q,v.value))},null,544),[[un,q.value.banMin]])]),g("button",{class:"ss-button",onClick:C[18]||(C[18]=Q=>M(v.value.nickname,n.chat.show.id,v.value.user_id))},G(B(w)("移出群聊")),1)],64)):me("",!0)])],2)])])):me("",!0)}}}),Wa=$n(Va,[["__scopeId","data-v-317c0ff8"]]),Qa=["id"],Ga={key:0,class:"note-recall note-base"},Ka={key:1,class:"note-ban note-base"},Ja={key:1},Ya={key:2,class:"note-recall note-base"},Xa=["innerHTML"],Za={key:4,class:"note-time note-base"},Ht=Bt({name:"NoticeBody",__name:"NoticeBody",props:["data","id"],emits:["reedit"],setup(n){const f=Fn.global.t,D=En(),r=xn(),e=n,t=Ci(),l=ge(e.data);function u(i){return D.loginInfo.uin===i}function w(i){const a=r.chatInfo.info.group_members.filter(o=>o.user_id===i);return a.length===1?a[0].card===""||a[0].card==null?a[0].nickname:a[0].card:i}function L(i){const a=Math.floor(i/86400),o=Math.floor(i%86400/3600),d=Math.floor(i%3600/60),v=i%60;let R="";return a>0&&(R+=`${a} ${f("天")} `),o>0&&(R+=`${o} ${f("小时")} `),d>0&&(R+=`${d} ${f("分钟")} `),v>0&&(R+=`${v} ${f("秒")} `),R}return cn(async()=>{var a;let i=null;if(i=await bt.call(void 0,"win:getWindowInfo",!0),l.value.notice_type&&l.value.notice_type.indexOf("recall")>=0)if(r.chatInfo.show.type==="group"){const o=l.value.operator_id;if(r.chatInfo.info.group_members!==void 0){const d=r.chatInfo.info.group_members.filter(v=>v.user_id===Number(o));d.length===1?l.value.name=d[0].card===""||d[0].card==null?d[0].nickname:d[0].card:l.value.name=o}else l.value.name=o}else l.value.name=r.chatInfo.show.name;if(l.value.sub_type==="poke"&&l.value.pokeMe&&l.value==r.messageList[r.messageList.length-1]){let o=document.getElementById("app");bt.isDesktop()&&(o=(a=document.getElementById("notice-"+e.id))==null?void 0:a.getElementsByClassName("space")[0]),po(o,i)}}),(i,a)=>(W(),ee("div",{id:"notice-"+n.id,class:"note"},[n.data.notice_type&&n.data.notice_type.indexOf("recall")>=0?(W(),ee("div",Ga,[g("a",null,G(l.value.name),1),g("span",null,G(B(f)("撤回了一条消息")),1),a[1]||(a[1]=g("div",null,null,-1)),n.data.originMsg?(W(),ee("a",{key:0,onClick:a[0]||(a[0]=o=>i.$emit("reedit",n.data.originMsg))},G(B(f)("重新编辑")),1)):me("",!0)])):n.data.notice_type=="group_ban"?(W(),ee("div",Ka,[n.data.sub_type==="ban"?(W(),ee(Ie,{key:0},[u(n.data.user_id)?(W(),ee(Ie,{key:0},[g("span",null,G(B(f)("成员类型_admin")),1),g("a",null," "+G(w(n.data.operator_id))+" ",1),g("span",null,G(B(f)("禁言了你")),1),g("span",null," "+G(L(n.data.duration)),1)],64)):(W(),ee(Ie,{key:1},[g("span",null,G(B(f)("管理员禁言了")),1),g("a",null," "+G(w(n.data.user_id))+" ",1),g("span",null,G(L(n.data.duration)),1)],64))],64)):(W(),ee("span",Ja,G(B(f)("管理员解除了 {name} 的禁言",{name:u(n.data.user_id)?B(f)("你"):w(n.data.user_id)})),1))])):n.data.sub_type==="delete"?(W(),ee("div",Ya,[g("span",null,G(B(f)("这条消息迷失在虚空里了")),1),a[2]||(a[2]=g("div",null,null,-1))])):n.data.sub_type==="poke"?(W(),ee("div",{key:3,class:"note-notify note-base",innerHTML:n.data.str+"<div class='space'</div>"},null,8,Xa)):n.data.sub_type==="time"&&n.data.time!=null?(W(),ee("div",Za,[g("a",null,G(Intl.DateTimeFormat(B(t),B(Mi)(new Date(n.data.time*1e3))).format(new Date(n.data.time*1e3))),1)])):me("",!0)],8,Qa))}}),es=["src","alt"],ts=Bt({__name:"CustomFaceTooltip",props:{url:{}},setup(n){return(f,D)=>(W(),ee("img",{src:n.url,alt:f.$t("预览图片加载失败"),class:"custom-face-tooltip"},null,8,es))}}),ns=$n(ts,[["__scopeId","data-v-28512f0d"]]),is={class:"ss-card face-pan"},os={icon:"fa-solid fa-face-laugh-squint"},as={class:"system-face-bar"},ss={class:"title"},rs={class:"face"},ls={class:"title"},us={class:"face"},cs={icon:"fa-solid fa-heart"},fs={class:"title"},ds={class:"face"},hs=["src","alt","onClick"],ms={class:"title"},gs={class:"face"},vs={key:0,class:"ss-card"},ps=["src","alt","onClick"],ys={key:0,icon:"fa-solid fa-folder-open"},ws={class:"system-face-bar custom-face-bar"},bs={class:"title"},ks={class:"face"},Is=["src","alt","onClick"],_s={class:"title"},Ss={class:"face"},Cs={key:0,class:"ss-card"},Ms={key:1,class:"ss-card"},As=["src","alt","onClick"],Ts=Bt({__name:"FacePan",emits:["addSpecialMsg","sendMsg"],setup(n,{emit:f}){const{recordList:D,showList:r}=y("recent-emojis-id"),{recordList:e,showList:t}=y("recent-custom-faces-id"),{recordList:l,showList:u}=y("recent-local-faces-id"),w=Ut(()=>{const _=[];for(const S of u.value){const A=v.value.find(I=>I.path===S);A&&_.push(A)}return _}),L=new ut,i=yo(),a=Kn(),o=En(),d=hi(1),v=hi([]),R=f;i.stickerCache&&i.stickerCache.length==0&&o.jsonMap.roaming_stamp&&K(),bt.isDesktop()&&a.sysConfig.local_emoji_folder&&M();function k(_,S){R("addSpecialMsg",{addText:S,msgObj:_})}function T(_){p(D,_),_<5e3?k({type:"face",id:_},!0):k({type:"text",text:rn.get(_).value},!0)}function K(){i.stickerCache=void 0,o.jsonMap.roaming_stamp.pagerType=="full"?it.send(o.jsonMap.roaming_stamp.name,{count:48},"getRoamingStamp_48"):it.send(o.jsonMap.roaming_stamp.name,{},"getRoamingStamp")}function P(_){const S=_.target;if(S.scrollHeight-S.scrollTop<S.clientHeight+.5&&i.stickerCache&&o.jsonMap.roaming_stamp.pagerType=="full"&&i.stickerCache[i.stickerCache.length-1]!="end"){const A=48+48*d.value;it.send(o.jsonMap.roaming_stamp.name,{count:A},"getRoamingStamp_"+A),d.value++}}function x(_){p(e,_),k({type:"image",file:_,subType:1},!0),a.sysConfig.send_face==!0&&R("sendMsg")}async function q(){const{$t:_}=Jt.config.globalProperties;try{const S=await bt.call(void 0,"sys:selectFolder",!0);S&&(Ti.save("local_emoji_folder",S),L.add(Be.INFO,_("已设置本地表情文件夹")),M())}catch{L.add(Be.ERR,_("选择文件夹失败"))}}async function M(){try{const _=a.sysConfig.local_emoji_folder;if(!_){v.value=[];return}const S=await bt.call(void 0,"sys:getLocalEmojis",!0,_);if(S&&Array.isArray(S))if(bt.type==="tauri"){const{convertFileSrc:A}=await Ai(async()=>{const{convertFileSrc:I}=await import("./core-DhEqZVGG.js");return{convertFileSrc:I}},[],import.meta.url);v.value=S.map(I=>({name:I.name,path:I.path,url:A(I.path)}))}else v.value=S.map(A=>({name:A.name,path:A.path,url:A.url}));else v.value=[]}catch{v.value=[]}}async function N(_){try{const S=await bt.call(void 0,"sys:readFileAsBase64",!0,_.path);p(l,_.path),k({type:"image",file:"base64://"+S,subType:1},!0),a.sysConfig.send_face==!0&&R("sendMsg")}catch{const{$t:A}=Jt.config.globalProperties;L.add(Be.ERR,A("添加本地表情失败"))}}function y(_){const S=wo(_,[]),A=Ut(()=>{if(a.sysConfig.record_recent_emoji==="none")return[];if(a.sysConfig.record_recent_emoji==="order")return S.value.slice(0,30);{const I=new Map;for(const $ of S.value)I.set($,(I.get($)||0)+1);return Array.from(I.entries()).sort(($,m)=>m[1]-$[1]).map($=>$[0]).slice(0,30)}});return{recordList:S,showList:A}}function p(_,S){if(a.sysConfig.record_recent_emoji==="none")return;let A;switch(a.sysConfig.record_recent_emoji){case"order":A=30;break;case"100times":A=100;break;case"500times":A=500;break;default:throw new Error("Invalid recent emoji record setting")}const I=_.value;if(a.sysConfig.record_recent_emoji==="order"){const $=I.indexOf(S);$!==-1&&I.splice($,1)}I.unshift(S),I.length>A&&I.pop(),_.value=I}function F(_){return{comp:ns,model:void 0,props:{url:_}}}return(_,S)=>{const A=Ln("font-awesome-icon");return W(),ee("div",is,[ie(B(_i),null,{default:It(()=>[g("div",os,[g("div",as,[B(r).length>0?(W(),ee(Ie,{key:0},[g("div",ss,[g("span",null,G(_.$t("最近使用")),1)]),g("div",rs,[(W(!0),ee(Ie,null,vt(B(r),I=>(W(),ee("div",{key:I},[ie(Wn,{emoji:B(rn).get(I),onClick:$=>T(I)},null,8,["emoji","onClick"])]))),128))])],64)):me("",!0),g("div",ls,[g("span",null,G(_.$t("emoji 表情")),1)]),g("div",us,[(W(!0),ee(Ie,null,vt(B(rn).emojiList,I=>(W(),ee("div",{key:I},[ie(Wn,{emoji:B(rn).get(I),onClick:$=>T(I)},null,8,["emoji","onClick"])]))),128))])])]),g("div",cs,[g("div",{class:"system-face-bar custom-face-bar",onScroll:P},[B(t).length>0?(W(),ee(Ie,{key:0},[g("div",fs,[g("span",null,G(_.$t("最近使用")),1)]),g("div",ds,[(W(!0),ee(Ie,null,vt(B(t),(I,$)=>Ce((W(),ee("span",{key:$},[g("img",{loading:"lazy",src:I,alt:"["+_.$t("动画表情")+"]",onClick:m=>x(I)},null,8,hs)])),[[B(gn),F(I)]])),128))])],64)):me("",!0),g("div",ms,[g("span",null,G(_.$t("收藏的表情")),1),ie(A,{icon:["fas","fa-rotate-right"],onClick:K})]),g("div",gs,[B(i).stickerCache&&B(i).stickerCache.length<=0?(W(),ee("div",vs,[ie(A,{icon:["fas","face-dizzy"]}),g("span",null,G(_.$t("一无所有")),1)])):B(i).stickerCache&&B(i).stickerCache.length>0?(W(!0),ee(Ie,{key:1},vt(B(i).stickerCache,(I,$)=>(W(),ee("span",{key:"stickers-"+$},[Ce(g("img",{loading:"lazy",src:I,alt:"["+_.$t("动画表情")+"]",onClick:m=>x(I)},null,8,ps),[[Ke,I!="end"],[B(gn),F(I)]])]))),128)):me("",!0)])],32)]),B(bt).isDesktop()?(W(),ee("div",ys,[g("div",ws,[w.value.length>0?(W(),ee(Ie,{key:0},[g("div",bs,[g("span",null,G(_.$t("最近使用")),1)]),g("div",ks,[(W(!0),ee(Ie,null,vt(w.value,(I,$)=>(W(),ee("span",{key:$},[Ce(g("img",{loading:"lazy",src:I.url,alt:"["+_.$t("动画表情")+"]",onClick:m=>N(I)},null,8,Is),[[B(gn),F(I.url)]])]))),128))])],64)):me("",!0),g("div",_s,[g("span",null,G(_.$t("本地表情")),1),ie(A,{icon:["fas","fa-folder-plus"],title:_.$t("选择文件夹"),onClick:q},null,8,["title"]),B(a).sysConfig.local_emoji_folder?(W(),Me(A,{key:0,icon:["fas","fa-rotate-right"],title:_.$t("重新加载"),onClick:M},null,8,["title"])):me("",!0)]),g("div",Ss,[B(a).sysConfig.local_emoji_folder?B(a).sysConfig.local_emoji_folder&&v.value.length<=0?(W(),ee("div",Ms,[ie(A,{icon:["fas","face-dizzy"]}),g("span",null,G(_.$t("暂无图片")),1)])):B(a).sysConfig.local_emoji_folder&&v.value.length>0?(W(!0),ee(Ie,{key:2},vt(v.value,(I,$)=>(W(),ee("span",{key:$},[Ce(g("img",{loading:"lazy",src:I.url,alt:"["+_.$t("动画表情")+"]",onClick:m=>N(I)},null,8,As),[[B(gn),F(I.url)]])]))),128)):me("",!0):(W(),ee("div",Cs,[ie(A,{icon:["fas","folder-open"]}),g("span",null,G(_.$t("选择文件夹")),1)]))])])])):me("",!0)]),_:1})])}}}),Es={class:"ss-card"},xs={key:0},Fs=Bt({name:"MergePan",__name:"MergePan",setup(n,{expose:f}){const D=Fn.global.t,r=xn(),e=Kn(),t=r.mergeMsgStack,l=ge(),u=Ut(()=>{var a;return Vn.fromList((((a=l.value)==null?void 0:a.imageList)??[]).map(o=>o.img_url))});function w(){t.length--}function L(){t.length=0}function i(){return t.length>0}return f({closeMergeMsg:L,isMergeOpen:i}),cn(()=>{_t(()=>r.mergeMsgStack.length,()=>{t.length===0?r.mergeMessageImgList=void 0:l.value=t.at(-1)}),_t(()=>{var a;return(a=l.value)==null?void 0:a.imageList},()=>{var a;r.mergeMsgStack.length===0||((a=l.value)==null?void 0:a.imageList)===void 0||(r.mergeMessageImgList=l.value.imageList)})}),(a,o)=>{const d=Ln("font-awesome-icon");return W(),ee("div",{class:gt("merge-pan"+(B(r).mergeMsgStack.length>0?" show":""))},[g("div",{onClick:L}),g("div",Es,[g("div",null,[ie(d,{style:{"margin-top":"5px"},icon:["fas","message"]}),g("span",null,G(B(D)("合并消息")),1),B(t).length<=1?(W(),Me(d,{key:0,icon:["fas","xmark"],onClick:w})):(W(),Me(d,{key:1,icon:["fas","angles-left"],onClick:w}))]),l.value===void 0?(W(),ee("div",xs)):(W(),Me(qn,{key:1,name:B(e).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:It(()=>[(W(!0),ee(Ie,null,vt(l.value.messageList,(v,R)=>(W(),ee(Ie,{key:"merge-"+l.value.forwardMsg.message[0].id+"-"+R},[B(jn)(l.value.messageList[R-1]?l.value.messageList[R-1].time:void 0,v.time,R==0)?(W(),Me(Ht,{id:B(Ei)(),key:"notice-time-"+R,data:{sub_type:"time",time:v.time}},null,8,["id","data"])):B(xi)(v)?(W(),Me(Ht,{key:"delete-"+v.message_id,data:{sub_type:"delete"}})):me("",!0),ie(ln,{data:v,type:"merge","image-list-header":u.value},null,8,["data","image-list-header"])],64))),128))]),_:1},8,["name"]))])],2)}}}),Ls=$n(Fs,[["__scopeId","data-v-5a030688"]]);function $s(n,f){return f.forEach((function(D){D&&typeof D!="string"&&!Array.isArray(D)&&Object.keys(D).forEach((function(r){if(r!=="default"&&!(r in n)){var e=Object.getOwnPropertyDescriptor(D,r);Object.defineProperty(n,r,e.get?e:{enumerable:!0,get:function(){return D[r]}})}}))})),Object.freeze(n)}function Ri(n,f){return new Promise((function(D,r){let e;return Rs(n).then((function(t){try{return e=t,D(new Blob([f.slice(0,2),e,f.slice(2)],{type:"image/jpeg"}))}catch(l){return r(l)}}),r)}))}const Rs=n=>new Promise(((f,D)=>{const r=new FileReader;r.addEventListener("load",(({target:{result:e}})=>{const t=new DataView(e);let l=0;if(t.getUint16(l)!==65496)return D("not a valid JPEG");for(l+=2;;){const u=t.getUint16(l);if(u===65498)break;const w=t.getUint16(l+2);if(u===65505&&t.getUint32(l+4)===1165519206){const L=l+10;let i;switch(t.getUint16(L)){case 18761:i=!0;break;case 19789:i=!1;break;default:return D("TIFF header contains invalid endian")}if(t.getUint16(L+2,i)!==42)return D("TIFF header contains invalid version");const a=t.getUint32(L+4,i),o=L+a+2+12*t.getUint16(L+a,i);for(let d=L+a+2;d<o;d+=12)if(t.getUint16(d,i)==274){if(t.getUint16(d+2,i)!==3)return D("Orientation data type is invalid");if(t.getUint32(d+4,i)!==1)return D("Orientation data count is invalid");t.setUint16(d+8,1,i);break}return f(e.slice(l,l+2+w))}l+=2+w}return f(new Blob)})),r.readAsArrayBuffer(n)}));var Cn={},Ds={get exports(){return Cn},set exports(n){Cn=n}};(function(n){var f,D,r={};Ds.exports=r,r.parse=function(e,t){for(var l=r.bin.readUshort,u=r.bin.readUint,w=0,L={},i=new Uint8Array(e),a=i.length-4;u(i,a)!=101010256;)a--;w=a,w+=4;var o=l(i,w+=4);l(i,w+=2);var d=u(i,w+=2),v=u(i,w+=4);w+=4,w=v;for(var R=0;R<o;R++){u(i,w),w+=4,w+=4,w+=4,u(i,w+=4),d=u(i,w+=4);var k=u(i,w+=4),T=l(i,w+=4),K=l(i,w+2),P=l(i,w+4);w+=6;var x=u(i,w+=8);w+=4,w+=T+K+P,r._readLocal(i,x,L,d,k,t)}return L},r._readLocal=function(e,t,l,u,w,L){var i=r.bin.readUshort,a=r.bin.readUint;a(e,t),i(e,t+=4),i(e,t+=2);var o=i(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var d=i(e,t+=8),v=i(e,t+=2);t+=2;var R=r.bin.readUTF8(e,t,d);if(t+=d,t+=v,L)l[R]={size:w,csize:u};else{var k=new Uint8Array(e.buffer,t);if(o==0)l[R]=new Uint8Array(k.buffer.slice(t,t+u));else{if(o!=8)throw"unknown compression method: "+o;var T=new Uint8Array(w);r.inflateRaw(k,T),l[R]=T}}},r.inflateRaw=function(e,t){return r.F.inflate(e,t)},r.inflate=function(e,t){return e[0],e[1],r.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},r.deflate=function(e,t){t==null&&(t={level:6});var l=0,u=new Uint8Array(50+Math.floor(1.1*e.length));u[l]=120,u[l+1]=156,l+=2,l=r.F.deflateRaw(e,u,l,t.level);var w=r.adler(e,0,e.length);return u[l+0]=w>>>24&255,u[l+1]=w>>>16&255,u[l+2]=w>>>8&255,u[l+3]=w>>>0&255,new Uint8Array(u.buffer,0,l+4)},r.deflateRaw=function(e,t){t==null&&(t={level:6});var l=new Uint8Array(50+Math.floor(1.1*e.length)),u=r.F.deflateRaw(e,l,u,t.level);return new Uint8Array(l.buffer,0,u)},r.encode=function(e,t){t==null&&(t=!1);var l=0,u=r.bin.writeUint,w=r.bin.writeUshort,L={};for(var i in e){var a=!r._noNeed(i)&&!t,o=e[i],d=r.crc.crc(o,0,o.length);L[i]={cpr:a,usize:o.length,crc:d,file:a?r.deflateRaw(o):o}}for(var i in L)l+=L[i].file.length+30+46+2*r.bin.sizeUTF8(i);l+=22;var v=new Uint8Array(l),R=0,k=[];for(var i in L){var T=L[i];k.push(R),R=r._writeHeader(v,R,i,T,0)}var K=0,P=R;for(var i in L)T=L[i],k.push(R),R=r._writeHeader(v,R,i,T,1,k[K++]);var x=R-P;return u(v,R,101010256),R+=4,w(v,R+=4,K),w(v,R+=2,K),u(v,R+=2,x),u(v,R+=4,P),R+=4,R+=2,v.buffer},r._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(t)!=-1},r._writeHeader=function(e,t,l,u,w,L){var i=r.bin.writeUint,a=r.bin.writeUshort,o=u.file;return i(e,t,w==0?67324752:33639248),t+=4,w==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,u.cpr?8:0),i(e,t+=2,0),i(e,t+=4,u.crc),i(e,t+=4,o.length),i(e,t+=4,u.usize),a(e,t+=4,r.bin.sizeUTF8(l)),a(e,t+=2,0),t+=2,w==1&&(t+=2,t+=2,i(e,t+=6,L),t+=4),t+=r.bin.writeUTF8(e,t,l),w==0&&(e.set(o,t),t+=o.length),t},r.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var l=t,u=0;u<8;u++)1&l?l=3988292384^l>>>1:l>>>=1;e[t]=l}return e})(),update:function(e,t,l,u){for(var w=0;w<u;w++)e=r.crc.table[255&(e^t[l+w])]^e>>>8;return e},crc:function(e,t,l){return 4294967295^r.crc.update(4294967295,e,t,l)}},r.adler=function(e,t,l){for(var u=1,w=0,L=t,i=t+l;L<i;){for(var a=Math.min(L+5552,i);L<a;)w+=u+=e[L++];u%=65521,w%=65521}return w<<16|u},r.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,l){e[t]=255&l,e[t+1]=l>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,l){e[t]=255&l,e[t+1]=l>>8&255,e[t+2]=l>>16&255,e[t+3]=l>>24&255},readASCII:function(e,t,l){for(var u="",w=0;w<l;w++)u+=String.fromCharCode(e[t+w]);return u},writeASCII:function(e,t,l){for(var u=0;u<l.length;u++)e[t+u]=l.charCodeAt(u)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,l){for(var u,w="",L=0;L<l;L++)w+="%"+r.bin.pad(e[t+L].toString(16));try{u=decodeURIComponent(w)}catch{return r.bin.readASCII(e,t,l)}return u},writeUTF8:function(e,t,l){for(var u=l.length,w=0,L=0;L<u;L++){var i=l.charCodeAt(L);if((4294967168&i)==0)e[t+w]=i,w++;else if((4294965248&i)==0)e[t+w]=192|i>>6,e[t+w+1]=128|i>>0&63,w+=2;else if((4294901760&i)==0)e[t+w]=224|i>>12,e[t+w+1]=128|i>>6&63,e[t+w+2]=128|i>>0&63,w+=3;else{if((4292870144&i)!=0)throw"e";e[t+w]=240|i>>18,e[t+w+1]=128|i>>12&63,e[t+w+2]=128|i>>6&63,e[t+w+3]=128|i>>0&63,w+=4}}return w},sizeUTF8:function(e){for(var t=e.length,l=0,u=0;u<t;u++){var w=e.charCodeAt(u);if((4294967168&w)==0)l++;else if((4294965248&w)==0)l+=2;else if((4294901760&w)==0)l+=3;else{if((4292870144&w)!=0)throw"e";l+=4}}return l}},r.F={},r.F.deflateRaw=function(e,t,l,u){var w=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][u],L=r.F.U,i=r.F._goodIndex;r.F._hash;var a=r.F._putsE,o=0,d=l<<3,v=0,R=e.length;if(u==0){for(;o<R;)a(t,d,o+(_=Math.min(65535,R-o))==R?1:0),d=r.F._copyExact(e,o,_,t,d+8),o+=_;return d>>>3}var k=L.lits,T=L.strt,K=L.prev,P=0,x=0,q=0,M=0,N=0,y=0;for(R>2&&(T[y=r.F._hash(e,0)]=0),o=0;o<R;o++){if(N=y,o+1<R-2){y=r.F._hash(e,o+1);var p=o+1&32767;K[p]=T[y],T[y]=p}if(v<=o){(P>14e3||x>26697)&&R-o>100&&(v<o&&(k[P]=o-v,P+=2,v=o),d=r.F._writeBlock(o==R-1||v==R?1:0,k,P,M,e,q,o-q,t,d),P=x=M=0,q=o);var F=0;o<R-2&&(F=r.F._bestMatch(e,o,K,N,Math.min(w[2],R-o),w[3]));var _=F>>>16,S=65535&F;if(F!=0){S=65535&F;var A=i(_=F>>>16,L.of0);L.lhst[257+A]++;var I=i(S,L.df0);L.dhst[I]++,M+=L.exb[A]+L.dxb[I],k[P]=_<<23|o-v,k[P+1]=S<<16|A<<8|I,P+=2,v=o+_}else L.lhst[e[o]]++;x++}}for(q==o&&e.length!=0||(v<o&&(k[P]=o-v,P+=2,v=o),d=r.F._writeBlock(1,k,P,M,e,q,o-q,t,d),P=0,x=0,P=x=M=0,q=o);(7&d)!=0;)d++;return d>>>3},r.F._bestMatch=function(e,t,l,u,w,L){var i=32767&t,a=l[i],o=i-a+32768&32767;if(a==i||u!=r.F._hash(e,t-o))return 0;for(var d=0,v=0,R=Math.min(32767,t);o<=R&&--L!=0&&a!=i;){if(d==0||e[t+d]==e[t+d-o]){var k=r.F._howLong(e,t,o);if(k>d){if(v=o,(d=k)>=w)break;o+2<k&&(k=o+2);for(var T=0,K=0;K<k-2;K++){var P=t-o+K+32768&32767,x=P-l[P]+32768&32767;x>T&&(T=x,a=P)}}}o+=(i=a)-(a=l[i])+32768&32767}return d<<16|v},r.F._howLong=function(e,t,l){if(e[t]!=e[t-l]||e[t+1]!=e[t+1-l]||e[t+2]!=e[t+2-l])return 0;var u=t,w=Math.min(e.length,t+258);for(t+=3;t<w&&e[t]==e[t-l];)t++;return t-u},r.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(e,t,l,u,w,L,i,a,o){var d,v,R,k,T,K,P,x,q,M=r.F.U,N=r.F._putsF,y=r.F._putsE;M.lhst[256]++,v=(d=r.F.getTrees())[0],R=d[1],k=d[2],T=d[3],K=d[4],P=d[5],x=d[6],q=d[7];var p=32+((o+3&7)==0?0:8-(o+3&7))+(i<<3),F=u+r.F.contSize(M.fltree,M.lhst)+r.F.contSize(M.fdtree,M.dhst),_=u+r.F.contSize(M.ltree,M.lhst)+r.F.contSize(M.dtree,M.dhst);_+=14+3*P+r.F.contSize(M.itree,M.ihst)+(2*M.ihst[16]+3*M.ihst[17]+7*M.ihst[18]);for(var S=0;S<286;S++)M.lhst[S]=0;for(S=0;S<30;S++)M.dhst[S]=0;for(S=0;S<19;S++)M.ihst[S]=0;var A=p<F&&p<_?0:F<_?1:2;if(N(a,o,e),N(a,o+1,A),o+=3,A==0){for(;(7&o)!=0;)o++;o=r.F._copyExact(w,L,i,a,o)}else{var I,$;if(A==1&&(I=M.fltree,$=M.fdtree),A==2){r.F.makeCodes(M.ltree,v),r.F.revCodes(M.ltree,v),r.F.makeCodes(M.dtree,R),r.F.revCodes(M.dtree,R),r.F.makeCodes(M.itree,k),r.F.revCodes(M.itree,k),I=M.ltree,$=M.dtree,y(a,o,T-257),y(a,o+=5,K-1),y(a,o+=5,P-4),o+=4;for(var m=0;m<P;m++)y(a,o+3*m,M.itree[1+(M.ordr[m]<<1)]);o+=3*P,o=r.F._codeTiny(x,M.itree,a,o),o=r.F._codeTiny(q,M.itree,a,o)}for(var h=L,O=0;O<l;O+=2){for(var C=t[O],z=C>>>23,Q=h+(8388607&C);h<Q;)o=r.F._writeLit(w[h++],I,a,o);if(z!=0){var Y=t[O+1],ne=Y>>16,X=Y>>8&255,j=255&Y;y(a,o=r.F._writeLit(257+X,I,a,o),z-M.of0[X]),o+=M.exb[X],N(a,o=r.F._writeLit(j,$,a,o),ne-M.df0[j]),o+=M.dxb[j],h+=z}}o=r.F._writeLit(256,I,a,o)}return o},r.F._copyExact=function(e,t,l,u,w){var L=w>>>3;return u[L]=l,u[L+1]=l>>>8,u[L+2]=255-u[L],u[L+3]=255-u[L+1],L+=4,u.set(new Uint8Array(e.buffer,t,l),L),w+(l+4<<3)},r.F.getTrees=function(){for(var e=r.F.U,t=r.F._hufTree(e.lhst,e.ltree,15),l=r.F._hufTree(e.dhst,e.dtree,15),u=[],w=r.F._lenCodes(e.ltree,u),L=[],i=r.F._lenCodes(e.dtree,L),a=0;a<u.length;a+=2)e.ihst[u[a]]++;for(a=0;a<L.length;a+=2)e.ihst[L[a]]++;for(var o=r.F._hufTree(e.ihst,e.itree,7),d=19;d>4&&e.itree[1+(e.ordr[d-1]<<1)]==0;)d--;return[t,l,o,w,i,d,u,L]},r.F.getSecond=function(e){for(var t=[],l=0;l<e.length;l+=2)t.push(e[l+1]);return t},r.F.nonZero=function(e){for(var t="",l=0;l<e.length;l+=2)e[l+1]!=0&&(t+=(l>>1)+",");return t},r.F.contSize=function(e,t){for(var l=0,u=0;u<t.length;u++)l+=t[u]*e[1+(u<<1)];return l},r.F._codeTiny=function(e,t,l,u){for(var w=0;w<e.length;w+=2){var L=e[w],i=e[w+1];u=r.F._writeLit(L,t,l,u);var a=L==16?2:L==17?3:7;L>15&&(r.F._putsE(l,u,i,a),u+=a)}return u},r.F._lenCodes=function(e,t){for(var l=e.length;l!=2&&e[l-1]==0;)l-=2;for(var u=0;u<l;u+=2){var w=e[u+1],L=u+3<l?e[u+3]:-1,i=u+5<l?e[u+5]:-1,a=u==0?-1:e[u-1];if(w==0&&L==w&&i==w){for(var o=u+5;o+2<l&&e[o+2]==w;)o+=2;(d=Math.min(o+1-u>>>1,138))<11?t.push(17,d-3):t.push(18,d-11),u+=2*d-2}else if(w==a&&L==w&&i==w){for(o=u+5;o+2<l&&e[o+2]==w;)o+=2;var d=Math.min(o+1-u>>>1,6);t.push(16,d-3),u+=2*d-2}else t.push(w,0)}return l>>>1},r.F._hufTree=function(e,t,l){var u=[],w=e.length,L=t.length,i=0;for(i=0;i<L;i+=2)t[i]=0,t[i+1]=0;for(i=0;i<w;i++)e[i]!=0&&u.push({lit:i,f:e[i]});var a=u.length,o=u.slice(0);if(a==0)return 0;if(a==1){var d=u[0].lit;return o=d==0?1:0,t[1+(d<<1)]=1,t[1+(o<<1)]=1,1}u.sort((function(x,q){return x.f-q.f}));var v=u[0],R=u[1],k=0,T=1,K=2;for(u[0]={lit:-1,f:v.f+R.f,l:v,r:R,d:0};T!=a-1;)v=k!=T&&(K==a||u[k].f<u[K].f)?u[k++]:u[K++],R=k!=T&&(K==a||u[k].f<u[K].f)?u[k++]:u[K++],u[T++]={lit:-1,f:v.f+R.f,l:v,r:R};var P=r.F.setDepth(u[T-1],0);for(P>l&&(r.F.restrictDepth(o,l,P),P=l),i=0;i<a;i++)t[1+(o[i].lit<<1)]=o[i].d;return P},r.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(r.F.setDepth(e.l,t+1),r.F.setDepth(e.r,t+1))},r.F.restrictDepth=function(e,t,l){var u=0,w=1<<l-t,L=0;for(e.sort((function(a,o){return o.d==a.d?a.f-o.f:o.d-a.d})),u=0;u<e.length&&e[u].d>t;u++){var i=e[u].d;e[u].d=t,L+=w-(1<<l-i)}for(L>>>=l-t;L>0;)(i=e[u].d)<t?(e[u].d++,L-=1<<t-i-1):u++;for(;u>=0;u--)e[u].d==t&&L<0&&(e[u].d--,L++);L!=0&&console.log("debt left")},r.F._goodIndex=function(e,t){var l=0;return t[16|l]<=e&&(l|=16),t[8|l]<=e&&(l|=8),t[4|l]<=e&&(l|=4),t[2|l]<=e&&(l|=2),t[1|l]<=e&&(l|=1),l},r.F._writeLit=function(e,t,l,u){return r.F._putsF(l,u,t[e<<1]),u+t[1+(e<<1)]},r.F.inflate=function(e,t){var l=Uint8Array;if(e[0]==3&&e[1]==0)return t||new l(0);var u=r.F,w=u._bitsF,L=u._bitsE,i=u._decodeTiny,a=u.makeCodes,o=u.codes2map,d=u._get17,v=u.U,R=t==null;R&&(t=new l(e.length>>>2<<3));for(var k,T,K=0,P=0,x=0,q=0,M=0,N=0,y=0,p=0,F=0;K==0;)if(K=w(e,F,1),P=w(e,F+1,2),F+=3,P!=0){if(R&&(t=r.F._check(t,p+(1<<17))),P==1&&(k=v.flmap,T=v.fdmap,N=511,y=31),P==2){x=L(e,F,5)+257,q=L(e,F+5,5)+1,M=L(e,F+10,4)+4,F+=14;for(var _=0;_<38;_+=2)v.itree[_]=0,v.itree[_+1]=0;var S=1;for(_=0;_<M;_++){var A=L(e,F+3*_,3);v.itree[1+(v.ordr[_]<<1)]=A,A>S&&(S=A)}F+=3*M,a(v.itree,S),o(v.itree,S,v.imap),k=v.lmap,T=v.dmap,F=i(v.imap,(1<<S)-1,x+q,e,F,v.ttree);var I=u._copyOut(v.ttree,0,x,v.ltree);N=(1<<I)-1;var $=u._copyOut(v.ttree,x,q,v.dtree);y=(1<<$)-1,a(v.ltree,I),o(v.ltree,I,k),a(v.dtree,$),o(v.dtree,$,T)}for(;;){var m=k[d(e,F)&N];F+=15&m;var h=m>>>4;if(!(h>>>8))t[p++]=h;else{if(h==256)break;var O=p+h-254;if(h>264){var C=v.ldef[h-257];O=p+(C>>>3)+L(e,F,7&C),F+=7&C}var z=T[d(e,F)&y];F+=15&z;var Q=z>>>4,Y=v.ddef[Q],ne=(Y>>>4)+w(e,F,15&Y);for(F+=15&Y,R&&(t=r.F._check(t,p+(1<<17)));p<O;)t[p]=t[p++-ne],t[p]=t[p++-ne],t[p]=t[p++-ne],t[p]=t[p++-ne];p=O}}}else{(7&F)!=0&&(F+=8-(7&F));var X=4+(F>>>3),j=e[X-4]|e[X-3]<<8;R&&(t=r.F._check(t,p+j)),t.set(new l(e.buffer,e.byteOffset+X,j),p),F=X+j<<3,p+=j}return t.length==p?t:t.slice(0,p)},r.F._check=function(e,t){var l=e.length;if(t<=l)return e;var u=new Uint8Array(Math.max(l<<1,t));return u.set(e,0),u},r.F._decodeTiny=function(e,t,l,u,w,L){for(var i=r.F._bitsE,a=r.F._get17,o=0;o<l;){var d=e[a(u,w)&t];w+=15&d;var v=d>>>4;if(v<=15)L[o]=v,o++;else{var R=0,k=0;v==16?(k=3+i(u,w,2),w+=2,R=L[o-1]):v==17?(k=3+i(u,w,3),w+=3):v==18&&(k=11+i(u,w,7),w+=7);for(var T=o+k;o<T;)L[o]=R,o++}}return w},r.F._copyOut=function(e,t,l,u){for(var w=0,L=0,i=u.length>>>1;L<l;){var a=e[L+t];u[L<<1]=0,u[1+(L<<1)]=a,a>w&&(w=a),L++}for(;L<i;)u[L<<1]=0,u[1+(L<<1)]=0,L++;return w},r.F.makeCodes=function(e,t){for(var l,u,w,L,i=r.F.U,a=e.length,o=i.bl_count,d=0;d<=t;d++)o[d]=0;for(d=1;d<a;d+=2)o[e[d]]++;var v=i.next_code;for(l=0,o[0]=0,u=1;u<=t;u++)l=l+o[u-1]<<1,v[u]=l;for(w=0;w<a;w+=2)(L=e[w+1])!=0&&(e[w]=v[L],v[L]++)},r.F.codes2map=function(e,t,l){for(var u=e.length,w=r.F.U.rev15,L=0;L<u;L+=2)if(e[L+1]!=0)for(var i=L>>1,a=e[L+1],o=i<<4|a,d=t-a,v=e[L]<<d,R=v+(1<<d);v!=R;)l[w[v]>>>15-t]=o,v++},r.F.revCodes=function(e,t){for(var l=r.F.U.rev15,u=15-t,w=0;w<e.length;w+=2){var L=e[w]<<t-e[w+1];e[w]=l[L]>>>u}},r.F._putsE=function(e,t,l){l<<=7&t;var u=t>>>3;e[u]|=l,e[u+1]|=l>>>8},r.F._putsF=function(e,t,l){l<<=7&t;var u=t>>>3;e[u]|=l,e[u+1]|=l>>>8,e[u+2]|=l>>>16},r.F._bitsE=function(e,t,l){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<l)-1},r.F._bitsF=function(e,t,l){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<l)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(f=Uint16Array,D=Uint32Array,{next_code:new f(16),bl_count:new f(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new f(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new D(32),flmap:new f(512),fltree:[],fdmap:new f(32),fdtree:[],lmap:new f(32768),ltree:[],ttree:[],dmap:new f(32768),dtree:[],imap:new f(512),itree:[],rev15:new f(32768),lhst:new D(286),dhst:new D(30),ihst:new D(19),lits:new D(15e3),strt:new f(65536),prev:new f(32768)}),(function(){for(var e=r.F.U,t=0;t<32768;t++){var l=t;l=(4278255360&(l=(4042322160&(l=(3435973836&(l=(2863311530&l)>>>1|(1431655765&l)<<1))>>>2|(858993459&l)<<2))>>>4|(252645135&l)<<4))>>>8|(16711935&l)<<8,e.rev15[t]=(l>>>16|l<<16)>>>17}function u(w,L,i){for(;L--!=0;)w.push(0,i)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];u(e.fltree,144,8),u(e.fltree,112,9),u(e.fltree,24,7),u(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),u(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),u(e.itree,19,0),u(e.ltree,286,0),u(e.dtree,30,0),u(e.ttree,320,0)})()})();var Bs=$s({__proto__:null,default:Cn},[Cn]);const Tt=(function(){var n={nextZero(i,a){for(;i[a]!=0;)a++;return a},readUshort:(i,a)=>i[a]<<8|i[a+1],writeUshort(i,a,o){i[a]=o>>8&255,i[a+1]=255&o},readUint:(i,a)=>16777216*i[a]+(i[a+1]<<16|i[a+2]<<8|i[a+3]),writeUint(i,a,o){i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o},readASCII(i,a,o){let d="";for(let v=0;v<o;v++)d+=String.fromCharCode(i[a+v]);return d},writeASCII(i,a,o){for(let d=0;d<o.length;d++)i[a+d]=o.charCodeAt(d)},readBytes(i,a,o){const d=[];for(let v=0;v<o;v++)d.push(i[a+v]);return d},pad:i=>i.length<2?`0${i}`:i,readUTF8(i,a,o){let d,v="";for(let R=0;R<o;R++)v+=`%${n.pad(i[a+R].toString(16))}`;try{d=decodeURIComponent(v)}catch{return n.readASCII(i,a,o)}return d}};function f(i,a,o,d){const v=a*o,R=t(d),k=Math.ceil(a*R/8),T=new Uint8Array(4*v),K=new Uint32Array(T.buffer),{ctype:P}=d,{depth:x}=d,q=n.readUshort;if(P==6){const C=v<<2;if(x==8)for(var M=0;M<C;M+=4)T[M]=i[M],T[M+1]=i[M+1],T[M+2]=i[M+2],T[M+3]=i[M+3];if(x==16)for(M=0;M<C;M++)T[M]=i[M<<1]}else if(P==2){const C=d.tabs.tRNS;if(C==null){if(x==8)for(M=0;M<v;M++){var N=3*M;K[M]=255<<24|i[N+2]<<16|i[N+1]<<8|i[N]}if(x==16)for(M=0;M<v;M++)N=6*M,K[M]=255<<24|i[N+4]<<16|i[N+2]<<8|i[N]}else{var y=C[0];const z=C[1],Q=C[2];if(x==8)for(M=0;M<v;M++){var p=M<<2;N=3*M,K[M]=255<<24|i[N+2]<<16|i[N+1]<<8|i[N],i[N]==y&&i[N+1]==z&&i[N+2]==Q&&(T[p+3]=0)}if(x==16)for(M=0;M<v;M++)p=M<<2,N=6*M,K[M]=255<<24|i[N+4]<<16|i[N+2]<<8|i[N],q(i,N)==y&&q(i,N+2)==z&&q(i,N+4)==Q&&(T[p+3]=0)}}else if(P==3){const C=d.tabs.PLTE,z=d.tabs.tRNS,Q=z?z.length:0;if(x==1)for(var F=0;F<o;F++){var _=F*k,S=F*a;for(M=0;M<a;M++){p=S+M<<2;var A=3*(I=i[_+(M>>3)]>>7-((7&M)<<0)&1);T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255}}if(x==2)for(F=0;F<o;F++)for(_=F*k,S=F*a,M=0;M<a;M++)p=S+M<<2,A=3*(I=i[_+(M>>2)]>>6-((3&M)<<1)&3),T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255;if(x==4)for(F=0;F<o;F++)for(_=F*k,S=F*a,M=0;M<a;M++)p=S+M<<2,A=3*(I=i[_+(M>>1)]>>4-((1&M)<<2)&15),T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255;if(x==8)for(M=0;M<v;M++){var I;p=M<<2,A=3*(I=i[M]),T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255}}else if(P==4){if(x==8)for(M=0;M<v;M++){p=M<<2;var $=i[m=M<<1];T[p]=$,T[p+1]=$,T[p+2]=$,T[p+3]=i[m+1]}if(x==16)for(M=0;M<v;M++){var m;p=M<<2,$=i[m=M<<2],T[p]=$,T[p+1]=$,T[p+2]=$,T[p+3]=i[m+2]}}else if(P==0)for(y=d.tabs.tRNS?d.tabs.tRNS:-1,F=0;F<o;F++){const C=F*k,z=F*a;if(x==1)for(var h=0;h<a;h++){var O=($=255*(i[C+(h>>>3)]>>>7-(7&h)&1))==255*y?0:255;K[z+h]=O<<24|$<<16|$<<8|$}else if(x==2)for(h=0;h<a;h++)O=($=85*(i[C+(h>>>2)]>>>6-((3&h)<<1)&3))==85*y?0:255,K[z+h]=O<<24|$<<16|$<<8|$;else if(x==4)for(h=0;h<a;h++)O=($=17*(i[C+(h>>>1)]>>>4-((1&h)<<2)&15))==17*y?0:255,K[z+h]=O<<24|$<<16|$<<8|$;else if(x==8)for(h=0;h<a;h++)O=($=i[C+h])==y?0:255,K[z+h]=O<<24|$<<16|$<<8|$;else if(x==16)for(h=0;h<a;h++)$=i[C+(h<<1)],O=q(i,C+(h<<1))==y?0:255,K[z+h]=O<<24|$<<16|$<<8|$}return T}function D(i,a,o,d){const v=t(i),R=Math.ceil(o*v/8),k=new Uint8Array((R+1+i.interlace)*d);return a=i.tabs.CgBI?e(a,k):r(a,k),i.interlace==0?a=l(a,i,0,o,d):i.interlace==1&&(a=(function(K,P){const x=P.width,q=P.height,M=t(P),N=M>>3,y=Math.ceil(x*M/8),p=new Uint8Array(q*y);let F=0;const _=[0,0,4,0,2,0,1],S=[0,4,0,2,0,1,0],A=[8,8,8,4,4,2,2],I=[8,8,4,4,2,2,1];let $=0;for(;$<7;){const h=A[$],O=I[$];let C=0,z=0,Q=_[$];for(;Q<q;)Q+=h,z++;let Y=S[$];for(;Y<x;)Y+=O,C++;const ne=Math.ceil(C*M/8);l(K,P,F,C,z);let X=0,j=_[$];for(;j<q;){let re=S[$],Re=F+X*ne<<3;for(;re<x;){var m;if(M==1&&(m=(m=K[Re>>3])>>7-(7&Re)&1,p[j*y+(re>>3)]|=m<<7-((7&re)<<0)),M==2&&(m=(m=K[Re>>3])>>6-(7&Re)&3,p[j*y+(re>>2)]|=m<<6-((3&re)<<1)),M==4&&(m=(m=K[Re>>3])>>4-(7&Re)&15,p[j*y+(re>>1)]|=m<<4-((1&re)<<2)),M>=8){const Ae=j*y+re*N;for(let fe=0;fe<N;fe++)p[Ae+fe]=K[(Re>>3)+fe]}Re+=M,re+=O}X++,j+=h}C*z!=0&&(F+=z*(1+ne)),$+=1}return p})(a,i)),a}function r(i,a){return e(new Uint8Array(i.buffer,2,i.length-6),a)}var e=(function(){const i={H:{}};return i.H.N=function(a,o){const d=Uint8Array;let v,R,k=0,T=0,K=0,P=0,x=0,q=0,M=0,N=0,y=0;if(a[0]==3&&a[1]==0)return o||new d(0);const p=i.H,F=p.b,_=p.e,S=p.R,A=p.n,I=p.A,$=p.Z,m=p.m,h=o==null;for(h&&(o=new d(a.length>>>2<<5));k==0;)if(k=F(a,y,1),T=F(a,y+1,2),y+=3,T!=0){if(h&&(o=i.H.W(o,N+(1<<17))),T==1&&(v=m.J,R=m.h,q=511,M=31),T==2){K=_(a,y,5)+257,P=_(a,y+5,5)+1,x=_(a,y+10,4)+4,y+=14;let C=1;for(var O=0;O<38;O+=2)m.Q[O]=0,m.Q[O+1]=0;for(O=0;O<x;O++){const Y=_(a,y+3*O,3);m.Q[1+(m.X[O]<<1)]=Y,Y>C&&(C=Y)}y+=3*x,A(m.Q,C),I(m.Q,C,m.u),v=m.w,R=m.d,y=S(m.u,(1<<C)-1,K+P,a,y,m.v);const z=p.V(m.v,0,K,m.C);q=(1<<z)-1;const Q=p.V(m.v,K,P,m.D);M=(1<<Q)-1,A(m.C,z),I(m.C,z,v),A(m.D,Q),I(m.D,Q,R)}for(;;){const C=v[$(a,y)&q];y+=15&C;const z=C>>>4;if(!(z>>>8))o[N++]=z;else{if(z==256)break;{let Q=N+z-254;if(z>264){const re=m.q[z-257];Q=N+(re>>>3)+_(a,y,7&re),y+=7&re}const Y=R[$(a,y)&M];y+=15&Y;const ne=Y>>>4,X=m.c[ne],j=(X>>>4)+F(a,y,15&X);for(y+=15&X;N<Q;)o[N]=o[N++-j],o[N]=o[N++-j],o[N]=o[N++-j],o[N]=o[N++-j];N=Q}}}}else{(7&y)!=0&&(y+=8-(7&y));const C=4+(y>>>3),z=a[C-4]|a[C-3]<<8;h&&(o=i.H.W(o,N+z)),o.set(new d(a.buffer,a.byteOffset+C,z),N),y=C+z<<3,N+=z}return o.length==N?o:o.slice(0,N)},i.H.W=function(a,o){const d=a.length;if(o<=d)return a;const v=new Uint8Array(d<<1);return v.set(a,0),v},i.H.R=function(a,o,d,v,R,k){const T=i.H.e,K=i.H.Z;let P=0;for(;P<d;){const x=a[K(v,R)&o];R+=15&x;const q=x>>>4;if(q<=15)k[P]=q,P++;else{let M=0,N=0;q==16?(N=3+T(v,R,2),R+=2,M=k[P-1]):q==17?(N=3+T(v,R,3),R+=3):q==18&&(N=11+T(v,R,7),R+=7);const y=P+N;for(;P<y;)k[P]=M,P++}}return R},i.H.V=function(a,o,d,v){let R=0,k=0;const T=v.length>>>1;for(;k<d;){const K=a[k+o];v[k<<1]=0,v[1+(k<<1)]=K,K>R&&(R=K),k++}for(;k<T;)v[k<<1]=0,v[1+(k<<1)]=0,k++;return R},i.H.n=function(a,o){const d=i.H.m,v=a.length;let R,k,T,K;const P=d.j;for(var x=0;x<=o;x++)P[x]=0;for(x=1;x<v;x+=2)P[a[x]]++;const q=d.K;for(R=0,P[0]=0,k=1;k<=o;k++)R=R+P[k-1]<<1,q[k]=R;for(T=0;T<v;T+=2)K=a[T+1],K!=0&&(a[T]=q[K],q[K]++)},i.H.A=function(a,o,d){const v=a.length,R=i.H.m.r;for(let k=0;k<v;k+=2)if(a[k+1]!=0){const T=k>>1,K=a[k+1],P=T<<4|K,x=o-K;let q=a[k]<<x;const M=q+(1<<x);for(;q!=M;)d[R[q]>>>15-o]=P,q++}},i.H.l=function(a,o){const d=i.H.m.r,v=15-o;for(let R=0;R<a.length;R+=2){const k=a[R]<<o-a[R+1];a[R]=d[k]>>>v}},i.H.M=function(a,o,d){d<<=7&o;const v=o>>>3;a[v]|=d,a[v+1]|=d>>>8},i.H.I=function(a,o,d){d<<=7&o;const v=o>>>3;a[v]|=d,a[v+1]|=d>>>8,a[v+2]|=d>>>16},i.H.e=function(a,o,d){return(a[o>>>3]|a[1+(o>>>3)]<<8)>>>(7&o)&(1<<d)-1},i.H.b=function(a,o,d){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)&(1<<d)-1},i.H.Z=function(a,o){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)},i.H.i=function(a,o){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16|a[3+(o>>>3)]<<24)>>>(7&o)},i.H.m=(function(){const a=Uint16Array,o=Uint32Array;return{K:new a(16),j:new a(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new a(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new o(32),J:new a(512),_:[],h:new a(32),$:[],w:new a(32768),C:[],v:[],d:new a(32768),D:[],u:new a(512),Q:[],r:new a(32768),s:new o(286),Y:new o(30),a:new o(19),t:new o(15e3),k:new a(65536),g:new a(32768)}})(),(function(){const a=i.H.m;for(var o=0;o<32768;o++){let v=o;v=(2863311530&v)>>>1|(1431655765&v)<<1,v=(3435973836&v)>>>2|(858993459&v)<<2,v=(4042322160&v)>>>4|(252645135&v)<<4,v=(4278255360&v)>>>8|(16711935&v)<<8,a.r[o]=(v>>>16|v<<16)>>>17}function d(v,R,k){for(;R--!=0;)v.push(0,k)}for(o=0;o<32;o++)a.q[o]=a.S[o]<<3|a.T[o],a.c[o]=a.p[o]<<4|a.z[o];d(a._,144,8),d(a._,112,9),d(a._,24,7),d(a._,8,8),i.H.n(a._,9),i.H.A(a._,9,a.J),i.H.l(a._,9),d(a.$,32,5),i.H.n(a.$,5),i.H.A(a.$,5,a.h),i.H.l(a.$,5),d(a.Q,19,0),d(a.C,286,0),d(a.D,30,0),d(a.v,320,0)})(),i.H.N})();function t(i){return[1,null,3,1,2,null,4][i.ctype]*i.depth}function l(i,a,o,d,v){let R=t(a);const k=Math.ceil(d*R/8);let T,K;R=Math.ceil(R/8);let P=i[o],x=0;if(P>1&&(i[o]=[0,0,1][P-2]),P==3)for(x=R;x<k;x++)i[x+1]=i[x+1]+(i[x+1-R]>>>1)&255;for(let q=0;q<v;q++)if(T=o+q*k,K=T+q+1,P=i[K-1],x=0,P==0)for(;x<k;x++)i[T+x]=i[K+x];else if(P==1){for(;x<R;x++)i[T+x]=i[K+x];for(;x<k;x++)i[T+x]=i[K+x]+i[T+x-R]}else if(P==2)for(;x<k;x++)i[T+x]=i[K+x]+i[T+x-k];else if(P==3){for(;x<R;x++)i[T+x]=i[K+x]+(i[T+x-k]>>>1);for(;x<k;x++)i[T+x]=i[K+x]+(i[T+x-k]+i[T+x-R]>>>1)}else{for(;x<R;x++)i[T+x]=i[K+x]+u(0,i[T+x-k],0);for(;x<k;x++)i[T+x]=i[K+x]+u(i[T+x-R],i[T+x-k],i[T+x-R-k])}return i}function u(i,a,o){const d=i+a-o,v=d-i,R=d-a,k=d-o;return v*v<=R*R&&v*v<=k*k?i:R*R<=k*k?a:o}function w(i,a,o){o.width=n.readUint(i,a),a+=4,o.height=n.readUint(i,a),a+=4,o.depth=i[a],a++,o.ctype=i[a],a++,o.compress=i[a],a++,o.filter=i[a],a++,o.interlace=i[a],a++}function L(i,a,o,d,v,R,k,T,K){const P=Math.min(a,v),x=Math.min(o,R);let q=0,M=0;for(let $=0;$<x;$++)for(let m=0;m<P;m++)if(k>=0&&T>=0?(q=$*a+m<<2,M=(T+$)*v+k+m<<2):(q=(-T+$)*a-k+m<<2,M=$*v+m<<2),K==0)d[M]=i[q],d[M+1]=i[q+1],d[M+2]=i[q+2],d[M+3]=i[q+3];else if(K==1){var N=i[q+3]*.00392156862745098,y=i[q]*N,p=i[q+1]*N,F=i[q+2]*N,_=d[M+3]*(1/255),S=d[M]*_,A=d[M+1]*_,I=d[M+2]*_;const h=1-N,O=N+_*h,C=O==0?0:1/O;d[M+3]=255*O,d[M+0]=(y+S*h)*C,d[M+1]=(p+A*h)*C,d[M+2]=(F+I*h)*C}else if(K==2)N=i[q+3],y=i[q],p=i[q+1],F=i[q+2],_=d[M+3],S=d[M],A=d[M+1],I=d[M+2],N==_&&y==S&&p==A&&F==I?(d[M]=0,d[M+1]=0,d[M+2]=0,d[M+3]=0):(d[M]=y,d[M+1]=p,d[M+2]=F,d[M+3]=N);else if(K==3){if(N=i[q+3],y=i[q],p=i[q+1],F=i[q+2],_=d[M+3],S=d[M],A=d[M+1],I=d[M+2],N==_&&y==S&&p==A&&F==I)continue;if(N<220&&_>20)return!1}return!0}return{decode:function(a){const o=new Uint8Array(a);let d=8;const v=n,R=v.readUshort,k=v.readUint,T={tabs:{},frames:[]},K=new Uint8Array(o.length);let P,x=0,q=0;const M=[137,80,78,71,13,10,26,10];for(var N=0;N<8;N++)if(o[N]!=M[N])throw"The input is not a PNG file!";for(;d<o.length;){const $=v.readUint(o,d);d+=4;const m=v.readASCII(o,d,4);if(d+=4,m=="IHDR")w(o,d,T);else if(m=="iCCP"){for(var y=d;o[y]!=0;)y++;v.readASCII(o,d,y-d),o[y+1];const h=o.slice(y+2,d+$);let O=null;try{O=r(h)}catch{O=e(h)}T.tabs[m]=O}else if(m=="CgBI")T.tabs[m]=o.slice(d,d+4);else if(m=="IDAT"){for(N=0;N<$;N++)K[x+N]=o[d+N];x+=$}else if(m=="acTL")T.tabs[m]={num_frames:k(o,d),num_plays:k(o,d+4)},P=new Uint8Array(o.length);else if(m=="fcTL"){q!=0&&((I=T.frames[T.frames.length-1]).data=D(T,P.slice(0,q),I.rect.width,I.rect.height),q=0);const h={x:k(o,d+12),y:k(o,d+16),width:k(o,d+4),height:k(o,d+8)};let O=R(o,d+22);O=R(o,d+20)/(O==0?100:O);const C={rect:h,delay:Math.round(1e3*O),dispose:o[d+24],blend:o[d+25]};T.frames.push(C)}else if(m=="fdAT"){for(N=0;N<$-4;N++)P[q+N]=o[d+N+4];q+=$-4}else if(m=="pHYs")T.tabs[m]=[v.readUint(o,d),v.readUint(o,d+4),o[d+8]];else if(m=="cHRM")for(T.tabs[m]=[],N=0;N<8;N++)T.tabs[m].push(v.readUint(o,d+4*N));else if(m=="tEXt"||m=="zTXt"){T.tabs[m]==null&&(T.tabs[m]={});var p=v.nextZero(o,d),F=v.readASCII(o,d,p-d),_=d+$-p-1;if(m=="tEXt")A=v.readASCII(o,p+1,_);else{var S=r(o.slice(p+2,p+2+_));A=v.readUTF8(S,0,S.length)}T.tabs[m][F]=A}else if(m=="iTXt"){T.tabs[m]==null&&(T.tabs[m]={}),p=0,y=d,p=v.nextZero(o,y),F=v.readASCII(o,y,p-y);const h=o[y=p+1];var A;o[y+1],y+=2,p=v.nextZero(o,y),v.readASCII(o,y,p-y),y=p+1,p=v.nextZero(o,y),v.readUTF8(o,y,p-y),_=$-((y=p+1)-d),h==0?A=v.readUTF8(o,y,_):(S=r(o.slice(y,y+_)),A=v.readUTF8(S,0,S.length)),T.tabs[m][F]=A}else if(m=="PLTE")T.tabs[m]=v.readBytes(o,d,$);else if(m=="hIST"){const h=T.tabs.PLTE.length/3;for(T.tabs[m]=[],N=0;N<h;N++)T.tabs[m].push(R(o,d+2*N))}else if(m=="tRNS")T.ctype==3?T.tabs[m]=v.readBytes(o,d,$):T.ctype==0?T.tabs[m]=R(o,d):T.ctype==2&&(T.tabs[m]=[R(o,d),R(o,d+2),R(o,d+4)]);else if(m=="gAMA")T.tabs[m]=v.readUint(o,d)/1e5;else if(m=="sRGB")T.tabs[m]=o[d];else if(m=="bKGD")T.ctype==0||T.ctype==4?T.tabs[m]=[R(o,d)]:T.ctype==2||T.ctype==6?T.tabs[m]=[R(o,d),R(o,d+2),R(o,d+4)]:T.ctype==3&&(T.tabs[m]=o[d]);else if(m=="IEND")break;d+=$,v.readUint(o,d),d+=4}var I;return q!=0&&((I=T.frames[T.frames.length-1]).data=D(T,P.slice(0,q),I.rect.width,I.rect.height)),T.data=D(T,K,T.width,T.height),delete T.compress,delete T.interlace,delete T.filter,T},toRGBA8:function(a){const o=a.width,d=a.height;if(a.tabs.acTL==null)return[f(a.data,o,d,a).buffer];const v=[];a.frames[0].data==null&&(a.frames[0].data=a.data);const R=o*d*4,k=new Uint8Array(R),T=new Uint8Array(R),K=new Uint8Array(R);for(let x=0;x<a.frames.length;x++){const q=a.frames[x],M=q.rect.x,N=q.rect.y,y=q.rect.width,p=q.rect.height,F=f(q.data,y,p,a);if(x!=0)for(var P=0;P<R;P++)K[P]=k[P];if(q.blend==0?L(F,y,p,k,o,d,M,N,0):q.blend==1&&L(F,y,p,k,o,d,M,N,1),v.push(k.buffer.slice(0)),q.dispose!=0){if(q.dispose==1)L(T,y,p,k,o,d,M,N,0);else if(q.dispose==2)for(P=0;P<R;P++)k[P]=K[P]}}return v},_paeth:u,_copyTile:L,_bin:n}})();(function(){const{_copyTile:n}=Tt,{_bin:f}=Tt,D=Tt._paeth;var r={table:(function(){const y=new Uint32Array(256);for(let p=0;p<256;p++){let F=p;for(let _=0;_<8;_++)1&F?F=3988292384^F>>>1:F>>>=1;y[p]=F}return y})(),update(y,p,F,_){for(let S=0;S<_;S++)y=r.table[255&(y^p[F+S])]^y>>>8;return y},crc:(y,p,F)=>4294967295^r.update(4294967295,y,p,F)};function e(y,p,F,_){p[F]+=y[0]*_>>4,p[F+1]+=y[1]*_>>4,p[F+2]+=y[2]*_>>4,p[F+3]+=y[3]*_>>4}function t(y){return Math.max(0,Math.min(255,y))}function l(y,p){const F=y[0]-p[0],_=y[1]-p[1],S=y[2]-p[2],A=y[3]-p[3];return F*F+_*_+S*S+A*A}function u(y,p,F,_,S,A,I){I==null&&(I=1);const $=_.length,m=[];for(var h=0;h<$;h++){const j=_[h];m.push([j>>>0&255,j>>>8&255,j>>>16&255,j>>>24&255])}for(h=0;h<$;h++){let j=4294967295;for(var O=0,C=0;C<$;C++){var z=l(m[h],m[C]);C!=h&&z<j&&(j=z,O=C)}}const Q=new Uint32Array(S.buffer),Y=new Int16Array(p*F*4),ne=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<ne.length;h++)ne[h]=255*((ne[h]+.5)/16-.5);for(let j=0;j<F;j++)for(let re=0;re<p;re++){var X;h=4*(j*p+re),I!=2?X=[t(y[h]+Y[h]),t(y[h+1]+Y[h+1]),t(y[h+2]+Y[h+2]),t(y[h+3]+Y[h+3])]:(z=ne[4*(3&j)+(3&re)],X=[t(y[h]+z),t(y[h+1]+z),t(y[h+2]+z),t(y[h+3]+z)]),O=0;let Re=16777215;for(C=0;C<$;C++){const ve=l(X,m[C]);ve<Re&&(Re=ve,O=C)}const Ae=m[O],fe=[X[0]-Ae[0],X[1]-Ae[1],X[2]-Ae[2],X[3]-Ae[3]];I==1&&(re!=p-1&&e(fe,Y,h+4,7),j!=F-1&&(re!=0&&e(fe,Y,h+4*p-4,3),e(fe,Y,h+4*p,5),re!=p-1&&e(fe,Y,h+4*p+4,1))),A[h>>2]=O,Q[h>>2]=_[O]}}function w(y,p,F,_,S){S==null&&(S={});const{crc:A}=r,I=f.writeUint,$=f.writeUshort,m=f.writeASCII;let h=8;const O=y.frames.length>1;let C,z=!1,Q=33+(O?20:0);if(S.sRGB!=null&&(Q+=13),S.pHYs!=null&&(Q+=21),S.iCCP!=null&&(C=pako.deflate(S.iCCP),Q+=21+C.length+4),y.ctype==3){for(var Y=y.plte.length,ne=0;ne<Y;ne++)y.plte[ne]>>>24!=255&&(z=!0);Q+=8+3*Y+4+(z?8+1*Y+4:0)}for(var X=0;X<y.frames.length;X++)O&&(Q+=38),Q+=(Ae=y.frames[X]).cimg.length+12,X!=0&&(Q+=4);Q+=12;const j=new Uint8Array(Q),re=[137,80,78,71,13,10,26,10];for(ne=0;ne<8;ne++)j[ne]=re[ne];if(I(j,h,13),h+=4,m(j,h,"IHDR"),h+=4,I(j,h,p),h+=4,I(j,h,F),h+=4,j[h]=y.depth,h++,j[h]=y.ctype,h++,j[h]=0,h++,j[h]=0,h++,j[h]=0,h++,I(j,h,A(j,h-17,17)),h+=4,S.sRGB!=null&&(I(j,h,1),h+=4,m(j,h,"sRGB"),h+=4,j[h]=S.sRGB,h++,I(j,h,A(j,h-5,5)),h+=4),S.iCCP!=null){const fe=13+C.length;I(j,h,fe),h+=4,m(j,h,"iCCP"),h+=4,m(j,h,"ICC profile"),h+=11,h+=2,j.set(C,h),h+=C.length,I(j,h,A(j,h-(fe+4),fe+4)),h+=4}if(S.pHYs!=null&&(I(j,h,9),h+=4,m(j,h,"pHYs"),h+=4,I(j,h,S.pHYs[0]),h+=4,I(j,h,S.pHYs[1]),h+=4,j[h]=S.pHYs[2],h++,I(j,h,A(j,h-13,13)),h+=4),O&&(I(j,h,8),h+=4,m(j,h,"acTL"),h+=4,I(j,h,y.frames.length),h+=4,I(j,h,S.loop!=null?S.loop:0),h+=4,I(j,h,A(j,h-12,12)),h+=4),y.ctype==3){for(I(j,h,3*(Y=y.plte.length)),h+=4,m(j,h,"PLTE"),h+=4,ne=0;ne<Y;ne++){const fe=3*ne,ve=y.plte[ne],xe=255&ve,Fe=ve>>>8&255,qe=ve>>>16&255;j[h+fe+0]=xe,j[h+fe+1]=Fe,j[h+fe+2]=qe}if(h+=3*Y,I(j,h,A(j,h-3*Y-4,3*Y+4)),h+=4,z){for(I(j,h,Y),h+=4,m(j,h,"tRNS"),h+=4,ne=0;ne<Y;ne++)j[h+ne]=y.plte[ne]>>>24&255;h+=Y,I(j,h,A(j,h-Y-4,Y+4)),h+=4}}let Re=0;for(X=0;X<y.frames.length;X++){var Ae=y.frames[X];O&&(I(j,h,26),h+=4,m(j,h,"fcTL"),h+=4,I(j,h,Re++),h+=4,I(j,h,Ae.rect.width),h+=4,I(j,h,Ae.rect.height),h+=4,I(j,h,Ae.rect.x),h+=4,I(j,h,Ae.rect.y),h+=4,$(j,h,_[X]),h+=2,$(j,h,1e3),h+=2,j[h]=Ae.dispose,h++,j[h]=Ae.blend,h++,I(j,h,A(j,h-30,30)),h+=4);const fe=Ae.cimg;I(j,h,(Y=fe.length)+(X==0?0:4)),h+=4;const ve=h;m(j,h,X==0?"IDAT":"fdAT"),h+=4,X!=0&&(I(j,h,Re++),h+=4),j.set(fe,h),h+=Y,I(j,h,A(j,ve,h-ve)),h+=4}return I(j,h,0),h+=4,m(j,h,"IEND"),h+=4,I(j,h,A(j,h-4,4)),h+=4,j.buffer}function L(y,p,F){for(let _=0;_<y.frames.length;_++){const S=y.frames[_];S.rect.width;const A=S.rect.height,I=new Uint8Array(A*S.bpl+A);S.cimg=d(S.img,A,S.bpp,S.bpl,I,p,F)}}function i(y,p,F,_,S){const A=S[0],I=S[1],$=S[2],m=S[3],h=S[4],O=S[5];let C=6,z=8,Q=255;for(var Y=0;Y<y.length;Y++){const Oe=new Uint8Array(y[Y]);for(var ne=Oe.length,X=0;X<ne;X+=4)Q&=Oe[X+3]}const j=Q!=255,re=(function(De,Se,Ve,ot,Le,ct){const Pe=[];for(var ue=0;ue<De.length;ue++){const we=new Uint8Array(De[ue]),H=new Uint32Array(we.buffer);var ft;let V=0,te=0,ae=Se,se=Ve,le=ot?1:0;if(ue!=0){const ce=ct||ot||ue==1||Pe[ue-2].dispose!=0?1:2;let Te=0,tt=1e9;for(let je=0;je<ce;je++){var Ct=new Uint8Array(De[ue-1-je]);const nt=new Uint32Array(De[ue-1-je]);let Ne=Se,be=Ve,Ue=-1,lt=-1;for(let Ye=0;Ye<Ve;Ye++)for(let at=0;at<Se;at++)H[et=Ye*Se+at]!=nt[et]&&(at<Ne&&(Ne=at),at>Ue&&(Ue=at),Ye<be&&(be=Ye),Ye>lt&&(lt=Ye));Ue==-1&&(Ne=be=Ue=lt=0),Le&&((1&Ne)==1&&Ne--,(1&be)==1&&be--);const pt=(Ue-Ne+1)*(lt-be+1);pt<tt&&(tt=pt,Te=je,V=Ne,te=be,ae=Ue-Ne+1,se=lt-be+1)}Ct=new Uint8Array(De[ue-1-Te]),Te==1&&(Pe[ue-1].dispose=2),ft=new Uint8Array(ae*se*4),n(Ct,Se,Ve,ft,ae,se,-V,-te,0),le=n(we,Se,Ve,ft,ae,se,-V,-te,3)?1:0,le==1?o(we,Se,Ve,ft,{x:V,y:te,width:ae,height:se}):n(we,Se,Ve,ft,ae,se,-V,-te,0)}else ft=we.slice(0);Pe.push({rect:{x:V,y:te,width:ae,height:se},img:ft,blend:le,dispose:0})}if(ot)for(ue=0;ue<Pe.length;ue++){if((rt=Pe[ue]).blend==1)continue;const we=rt.rect,H=Pe[ue-1].rect,V=Math.min(we.x,H.x),te=Math.min(we.y,H.y),ae={x:V,y:te,width:Math.max(we.x+we.width,H.x+H.width)-V,height:Math.max(we.y+we.height,H.y+H.height)-te};Pe[ue-1].dispose=1,ue-1!=0&&a(De,Se,Ve,Pe,ue-1,ae,Le),a(De,Se,Ve,Pe,ue,ae,Le)}let Ft=0;if(De.length!=1)for(var et=0;et<Pe.length;et++){var rt;Ft+=(rt=Pe[et]).rect.width*rt.rect.height}return Pe})(y,p,F,A,I,$),Re={},Ae=[],fe=[];if(_!=0){const Oe=[];for(X=0;X<re.length;X++)Oe.push(re[X].img.buffer);const De=(function(Le){let ct=0;for(var Pe=0;Pe<Le.length;Pe++)ct+=Le[Pe].byteLength;const ue=new Uint8Array(ct);let ft=0;for(Pe=0;Pe<Le.length;Pe++){const Ct=new Uint8Array(Le[Pe]),Ft=Ct.length;for(let et=0;et<Ft;et+=4){let rt=Ct[et],we=Ct[et+1],H=Ct[et+2];const V=Ct[et+3];V==0&&(rt=we=H=0),ue[ft+et]=rt,ue[ft+et+1]=we,ue[ft+et+2]=H,ue[ft+et+3]=V}ft+=Ft}return ue.buffer})(Oe),Se=R(De,_);for(X=0;X<Se.plte.length;X++)Ae.push(Se.plte[X].est.rgba);let Ve=0;for(X=0;X<re.length;X++){const ot=(xe=re[X]).img.length;var ve=new Uint8Array(Se.inds.buffer,Ve>>2,ot>>2);fe.push(ve);const Le=new Uint8Array(Se.abuf,Ve,ot);O&&u(xe.img,xe.rect.width,xe.rect.height,Ae,Le,ve),xe.img.set(Le),Ve+=ot}}else for(Y=0;Y<re.length;Y++){var xe=re[Y];const Oe=new Uint32Array(xe.img.buffer);var Fe=xe.rect.width;for(ne=Oe.length,ve=new Uint8Array(ne),fe.push(ve),X=0;X<ne;X++){const De=Oe[X];if(X!=0&&De==Oe[X-1])ve[X]=ve[X-1];else if(X>Fe&&De==Oe[X-Fe])ve[X]=ve[X-Fe];else{let Se=Re[De];if(Se==null&&(Re[De]=Se=Ae.length,Ae.push(De),Ae.length>=300))break;ve[X]=Se}}}const qe=Ae.length;for(qe<=256&&h==0&&(z=qe<=2?1:qe<=4?2:qe<=16?4:8,z=Math.max(z,m)),Y=0;Y<re.length;Y++){(xe=re[Y]).rect.x,xe.rect.y,Fe=xe.rect.width;const Oe=xe.rect.height;let De=xe.img;new Uint32Array(De.buffer);let Se=4*Fe,Ve=4;if(qe<=256&&h==0){Se=Math.ceil(z*Fe/8);var Je=new Uint8Array(Se*Oe);const ot=fe[Y];for(let Le=0;Le<Oe;Le++){X=Le*Se;const ct=Le*Fe;if(z==8)for(var _e=0;_e<Fe;_e++)Je[X+_e]=ot[ct+_e];else if(z==4)for(_e=0;_e<Fe;_e++)Je[X+(_e>>1)]|=ot[ct+_e]<<4-4*(1&_e);else if(z==2)for(_e=0;_e<Fe;_e++)Je[X+(_e>>2)]|=ot[ct+_e]<<6-2*(3&_e);else if(z==1)for(_e=0;_e<Fe;_e++)Je[X+(_e>>3)]|=ot[ct+_e]<<7-1*(7&_e)}De=Je,C=3,Ve=1}else if(j==0&&re.length==1){Je=new Uint8Array(Fe*Oe*3);const ot=Fe*Oe;for(X=0;X<ot;X++){const Le=3*X,ct=4*X;Je[Le]=De[ct],Je[Le+1]=De[ct+1],Je[Le+2]=De[ct+2]}De=Je,C=2,Ve=3,Se=3*Fe}xe.img=De,xe.bpl=Se,xe.bpp=Ve}return{ctype:C,depth:z,plte:Ae,frames:re}}function a(y,p,F,_,S,A,I){const $=Uint8Array,m=Uint32Array,h=new $(y[S-1]),O=new m(y[S-1]),C=S+1<y.length?new $(y[S+1]):null,z=new $(y[S]),Q=new m(z.buffer);let Y=p,ne=F,X=-1,j=-1;for(let Re=0;Re<A.height;Re++)for(let Ae=0;Ae<A.width;Ae++){const fe=A.x+Ae,ve=A.y+Re,xe=ve*p+fe,Fe=Q[xe];Fe==0||_[S-1].dispose==0&&O[xe]==Fe&&(C==null||C[4*xe+3]!=0)||(fe<Y&&(Y=fe),fe>X&&(X=fe),ve<ne&&(ne=ve),ve>j&&(j=ve))}X==-1&&(Y=ne=X=j=0),I&&((1&Y)==1&&Y--,(1&ne)==1&&ne--),A={x:Y,y:ne,width:X-Y+1,height:j-ne+1};const re=_[S];re.rect=A,re.blend=1,re.img=new Uint8Array(A.width*A.height*4),_[S-1].dispose==0?(n(h,p,F,re.img,A.width,A.height,-A.x,-A.y,0),o(z,p,F,re.img,A)):n(z,p,F,re.img,A.width,A.height,-A.x,-A.y,0)}function o(y,p,F,_,S){n(y,p,F,_,S.width,S.height,-S.x,-S.y,2)}function d(y,p,F,_,S,A,I){const $=[];let m,h=[0,1,2,3,4];A!=-1?h=[A]:(p*_>5e5||F==1)&&(h=[0]),I&&(m={level:0});const O=Bs;for(var C=0;C<h.length;C++){for(let Y=0;Y<p;Y++)v(S,y,Y,_,F,h[C]);$.push(O.deflate(S,m))}let z,Q=1e9;for(C=0;C<$.length;C++)$[C].length<Q&&(z=C,Q=$[C].length);return $[z]}function v(y,p,F,_,S,A){const I=F*_;let $=I+F;if(y[$]=A,$++,A==0)if(_<500)for(var m=0;m<_;m++)y[$+m]=p[I+m];else y.set(new Uint8Array(p.buffer,I,_),$);else if(A==1){for(m=0;m<S;m++)y[$+m]=p[I+m];for(m=S;m<_;m++)y[$+m]=p[I+m]-p[I+m-S]+256&255}else if(F==0){for(m=0;m<S;m++)y[$+m]=p[I+m];if(A==2)for(m=S;m<_;m++)y[$+m]=p[I+m];if(A==3)for(m=S;m<_;m++)y[$+m]=p[I+m]-(p[I+m-S]>>1)+256&255;if(A==4)for(m=S;m<_;m++)y[$+m]=p[I+m]-D(p[I+m-S],0,0)+256&255}else{if(A==2)for(m=0;m<_;m++)y[$+m]=p[I+m]+256-p[I+m-_]&255;if(A==3){for(m=0;m<S;m++)y[$+m]=p[I+m]+256-(p[I+m-_]>>1)&255;for(m=S;m<_;m++)y[$+m]=p[I+m]+256-(p[I+m-_]+p[I+m-S]>>1)&255}if(A==4){for(m=0;m<S;m++)y[$+m]=p[I+m]+256-D(0,p[I+m-_],0)&255;for(m=S;m<_;m++)y[$+m]=p[I+m]+256-D(p[I+m-S],p[I+m-_],p[I+m-S-_])&255}}}function R(y,p){const F=new Uint8Array(y),_=F.slice(0),S=new Uint32Array(_.buffer),A=k(_,p),I=A[0],$=A[1],m=F.length,h=new Uint8Array(m>>2);let O;if(F.length<2e7)for(var C=0;C<m;C+=4)O=T(I,z=F[C]*(1/255),Q=F[C+1]*(1/255),Y=F[C+2]*(1/255),ne=F[C+3]*(1/255)),h[C>>2]=O.ind,S[C>>2]=O.est.rgba;else for(C=0;C<m;C+=4){var z=F[C]*.00392156862745098,Q=F[C+1]*(1/255),Y=F[C+2]*(1/255),ne=F[C+3]*(1/255);for(O=I;O.left;)O=K(O.est,z,Q,Y,ne)<=0?O.left:O.right;h[C>>2]=O.ind,S[C>>2]=O.est.rgba}return{abuf:_.buffer,inds:h,plte:$}}function k(y,p,F){F==null&&(F=1e-4);const _=new Uint32Array(y.buffer),S={i0:0,i1:y.length,bst:null,est:null,tdst:0,left:null,right:null};S.bst=q(y,S.i0,S.i1),S.est=M(S.bst);const A=[S];for(;A.length<p;){let $=0,m=0;for(var I=0;I<A.length;I++)A[I].est.L>$&&($=A[I].est.L,m=I);if($<F)break;const h=A[m],O=P(y,_,h.i0,h.i1,h.est.e,h.est.eMq255);if(h.i0>=O||h.i1<=O){h.est.L=0;continue}const C={i0:h.i0,i1:O,bst:null,est:null,tdst:0,left:null,right:null};C.bst=q(y,C.i0,C.i1),C.est=M(C.bst);const z={i0:O,i1:h.i1,bst:null,est:null,tdst:0,left:null,right:null};for(z.bst={R:[],m:[],N:h.bst.N-C.bst.N},I=0;I<16;I++)z.bst.R[I]=h.bst.R[I]-C.bst.R[I];for(I=0;I<4;I++)z.bst.m[I]=h.bst.m[I]-C.bst.m[I];z.est=M(z.bst),h.left=C,h.right=z,A[m]=C,A.push(z)}for(A.sort((($,m)=>m.bst.N-$.bst.N)),I=0;I<A.length;I++)A[I].ind=I;return[S,A]}function T(y,p,F,_,S){if(y.left==null)return y.tdst=(function(C,z,Q,Y,ne){const X=z-C[0],j=Q-C[1],re=Y-C[2],Re=ne-C[3];return X*X+j*j+re*re+Re*Re})(y.est.q,p,F,_,S),y;const A=K(y.est,p,F,_,S);let I=y.left,$=y.right;A>0&&(I=y.right,$=y.left);const m=T(I,p,F,_,S);if(m.tdst<=A*A)return m;const h=T($,p,F,_,S);return h.tdst<m.tdst?h:m}function K(y,p,F,_,S){const{e:A}=y;return A[0]*p+A[1]*F+A[2]*_+A[3]*S-y.eMq}function P(y,p,F,_,S,A){for(_-=4;F<_;){for(;x(y,F,S)<=A;)F+=4;for(;x(y,_,S)>A;)_-=4;if(F>=_)break;const I=p[F>>2];p[F>>2]=p[_>>2],p[_>>2]=I,F+=4,_-=4}for(;x(y,F,S)>A;)F-=4;return F+4}function x(y,p,F){return y[p]*F[0]+y[p+1]*F[1]+y[p+2]*F[2]+y[p+3]*F[3]}function q(y,p,F){const _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],S=[0,0,0,0],A=F-p>>2;for(let I=p;I<F;I+=4){const $=y[I]*.00392156862745098,m=y[I+1]*(1/255),h=y[I+2]*(1/255),O=y[I+3]*(1/255);S[0]+=$,S[1]+=m,S[2]+=h,S[3]+=O,_[0]+=$*$,_[1]+=$*m,_[2]+=$*h,_[3]+=$*O,_[5]+=m*m,_[6]+=m*h,_[7]+=m*O,_[10]+=h*h,_[11]+=h*O,_[15]+=O*O}return _[4]=_[1],_[8]=_[2],_[9]=_[6],_[12]=_[3],_[13]=_[7],_[14]=_[11],{R:_,m:S,N:A}}function M(y){const{R:p}=y,{m:F}=y,{N:_}=y,S=F[0],A=F[1],I=F[2],$=F[3],m=_==0?0:1/_,h=[p[0]-S*S*m,p[1]-S*A*m,p[2]-S*I*m,p[3]-S*$*m,p[4]-A*S*m,p[5]-A*A*m,p[6]-A*I*m,p[7]-A*$*m,p[8]-I*S*m,p[9]-I*A*m,p[10]-I*I*m,p[11]-I*$*m,p[12]-$*S*m,p[13]-$*A*m,p[14]-$*I*m,p[15]-$*$*m],O=h,C=N;let z=[Math.random(),Math.random(),Math.random(),Math.random()],Q=0,Y=0;if(_!=0)for(let X=0;X<16&&(z=C.multVec(O,z),Y=Math.sqrt(C.dot(z,z)),z=C.sml(1/Y,z),!(X!=0&&Math.abs(Y-Q)<1e-9));X++)Q=Y;const ne=[S*m,A*m,I*m,$*m];return{Cov:h,q:ne,e:z,L:Q,eMq255:C.dot(C.sml(255,ne),z),eMq:C.dot(z,ne),rgba:(Math.round(255*ne[3])<<24|Math.round(255*ne[2])<<16|Math.round(255*ne[1])<<8|Math.round(255*ne[0])<<0)>>>0}}var N={multVec:(y,p)=>[y[0]*p[0]+y[1]*p[1]+y[2]*p[2]+y[3]*p[3],y[4]*p[0]+y[5]*p[1]+y[6]*p[2]+y[7]*p[3],y[8]*p[0]+y[9]*p[1]+y[10]*p[2]+y[11]*p[3],y[12]*p[0]+y[13]*p[1]+y[14]*p[2]+y[15]*p[3]],dot:(y,p)=>y[0]*p[0]+y[1]*p[1]+y[2]*p[2]+y[3]*p[3],sml:(y,p)=>[y*p[0],y*p[1],y*p[2],y*p[3]]};Tt.encode=function(p,F,_,S,A,I,$){S==null&&(S=0),$==null&&($=!1);const m=i(p,F,_,S,[!1,!1,!1,0,$,!1]);return L(m,-1),w(m,F,_,A,I)},Tt.encodeLL=function(p,F,_,S,A,I,$,m){const h={ctype:0+(S==1?0:2)+(A==0?0:4),depth:I,frames:[]},O=(S+A)*I,C=O*F;for(let z=0;z<p.length;z++)h.frames.push({rect:{x:0,y:0,width:F,height:_},img:new Uint8Array(p[z]),blend:0,dispose:1,bpp:Math.ceil(O/8),bpl:Math.ceil(C/8)});return L(h,0,!0),w(h,F,_,$,m)},Tt.encode.compress=i,Tt.encode.dither=u,Tt.quantize=R,Tt.quantize.getKDtree=k,Tt.quantize.getNearest=T})();const Di={toArrayBuffer(n,f){const D=n.width,r=n.height,e=D<<2,t=n.getContext("2d").getImageData(0,0,D,r),l=new Uint32Array(t.data.buffer),u=(32*D+31)/32<<2,w=u*r,L=122+w,i=new ArrayBuffer(L),a=new DataView(i),o=1<<20;let d,v,R,k,T=o,K=0,P=0,x=0;function q(y){a.setUint16(P,y,!0),P+=2}function M(y){a.setUint32(P,y,!0),P+=4}function N(y){P+=y}q(19778),M(L),N(4),M(122),M(108),M(D),M(-r>>>0),q(1),q(32),M(3),M(w),M(2835),M(2835),N(8),M(16711680),M(65280),M(255),M(4278190080),M(1466527264),(function y(){for(;K<r&&T>0;){for(k=122+K*u,d=0;d<e;)T--,v=l[x++],R=v>>>24,a.setUint32(k+d,v<<8|R),d+=4;K++}x<l.length?(T=o,setTimeout(y,Di._dly)):f(i)})()},toBlob(n,f){this.toArrayBuffer(n,(D=>{f(new Blob([D],{type:"image/bmp"}))}))},_dly:9};var St={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Os={[St.CHROME]:16384,[St.FIREFOX]:11180,[St.DESKTOP_SAFARI]:16384,[St.IE]:8192,[St.IOS]:4096,[St.ETC]:8192};const Xn=typeof window<"u",Bi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Mn=Xn&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Us=(Xn||Bi)&&(Mn&&Mn.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Oi=(Xn||Bi)&&(Mn&&Mn.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function Zn(n,f,D=Date.now()){return new Promise((r=>{const e=n.split(","),t=e[0].match(/:(.*?);/)[1],l=globalThis.atob(e[1]);let u=l.length;const w=new Uint8Array(u);for(;u--;)w[u]=l.charCodeAt(u);const L=new Blob([w],{type:t});L.name=f,L.lastModified=D,r(L)}))}function Ui(n){return new Promise(((f,D)=>{const r=new Oi;r.onload=()=>f(r.result),r.onerror=e=>D(e),r.readAsDataURL(n)}))}function zi(n){return new Promise(((f,D)=>{const r=new Image;r.onload=()=>f(r),r.onerror=e=>D(e),r.src=n}))}function jt(){if(jt.cachedResult!==void 0)return jt.cachedResult;let n=St.ETC;const{userAgent:f}=navigator;return/Chrom(e|ium)/i.test(f)?n=St.CHROME:/iP(ad|od|hone)/i.test(f)&&/WebKit/i.test(f)?n=St.IOS:/Safari/i.test(f)?n=St.DESKTOP_SAFARI:/Firefox/i.test(f)?n=St.FIREFOX:(/MSIE/i.test(f)||document.documentMode)&&(n=St.IE),jt.cachedResult=n,jt.cachedResult}function Ni(n,f){const D=jt(),r=Os[D];let e=n,t=f,l=e*t;const u=e>t?t/e:e/t;for(;l>r*r;){const w=(r+e)/2,L=(r+t)/2;w<L?(t=L,e=L*u):(t=w*u,e=w),l=e*t}return{width:e,height:t}}function Rn(n,f){let D,r;try{if(D=new OffscreenCanvas(n,f),r=D.getContext("2d"),r===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{D=document.createElement("canvas"),r=D.getContext("2d")}return D.width=n,D.height=f,[D,r]}function Hi(n,f){const{width:D,height:r}=Ni(n.width,n.height),[e,t]=Rn(D,r);return f&&/jpe?g/.test(f)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(n,0,0,e.width,e.height),e}function _n(){return _n.cachedResult!==void 0||(_n.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),_n.cachedResult}function An(n,f={}){return new Promise((function(D,r){let e,t;var l=function(){try{return t=Hi(e,f.fileType||n.type),D([e,t])}catch(w){return r(w)}},u=function(w){try{var L=function(i){try{throw i}catch(a){return r(a)}};try{let i;return Ui(n).then((function(a){try{return i=a,zi(i).then((function(o){try{return e=o,(function(){try{return l()}catch(d){return r(d)}})()}catch(d){return L(d)}}),L)}catch(o){return L(o)}}),L)}catch(i){L(i)}}catch(i){return r(i)}};try{if(_n()||[St.DESKTOP_SAFARI,St.MOBILE_SAFARI].includes(jt()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(n).then((function(w){try{return e=w,l()}catch{return u()}}),u)}catch{u()}}))}function Tn(n,f,D,r,e=1){return new Promise((function(t,l){let u;if(f==="image/png"){let L,i,a;return L=n.getContext("2d"),{data:i}=L.getImageData(0,0,n.width,n.height),a=Tt.encode([i.buffer],n.width,n.height,4096*e),u=new Blob([a],{type:f}),u.name=D,u.lastModified=r,w.call(this)}{let L=function(){return w.call(this)};if(f==="image/bmp")return new Promise((i=>Di.toBlob(n,i))).then((function(i){try{return u=i,u.name=D,u.lastModified=r,L.call(this)}catch(a){return l(a)}}).bind(this),l);{let i=function(){return L.call(this)};if(typeof OffscreenCanvas=="function"&&n instanceof OffscreenCanvas)return n.convertToBlob({type:f,quality:e}).then((function(a){try{return u=a,u.name=D,u.lastModified=r,i.call(this)}catch(o){return l(o)}}).bind(this),l);{let a;return a=n.toDataURL(f,e),Zn(a,D,r).then((function(o){try{return u=o,i.call(this)}catch(d){return l(d)}}).bind(this),l)}}}function w(){return t(u)}}))}function xt(n){n.width=0,n.height=0}function Kt(){return new Promise((function(n,f){let D,r,e,t;return Kt.cachedResult!==void 0?n(Kt.cachedResult):Zn("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(l){try{return D=l,An(D).then((function(u){try{return r=u[1],Tn(r,D.type,D.name,D.lastModified).then((function(w){try{return e=w,xt(r),An(e).then((function(L){try{return t=L[0],Kt.cachedResult=t.width===1&&t.height===2,n(Kt.cachedResult)}catch(i){return f(i)}}),f)}catch(L){return f(L)}}),f)}catch(w){return f(w)}}),f)}catch(u){return f(u)}}),f)}))}function Pi(n){return new Promise(((f,D)=>{const r=new Oi;r.onload=e=>{const t=new DataView(e.target.result);if(t.getUint16(0,!1)!=65496)return f(-2);const l=t.byteLength;let u=2;for(;u<l;){if(t.getUint16(u+2,!1)<=8)return f(-1);const w=t.getUint16(u,!1);if(u+=2,w==65505){if(t.getUint32(u+=2,!1)!=1165519206)return f(-1);const L=t.getUint16(u+=6,!1)==18761;u+=t.getUint32(u+4,L);const i=t.getUint16(u,L);u+=2;for(let a=0;a<i;a++)if(t.getUint16(u+12*a,L)==274)return f(t.getUint16(u+12*a+8,L))}else{if((65280&w)!=65280)break;u+=t.getUint16(u,!1)}}return f(-1)},r.onerror=e=>D(e),r.readAsArrayBuffer(n)}))}function ji(n,f){const{width:D}=n,{height:r}=n,{maxWidthOrHeight:e}=f;let t,l=n;return isFinite(e)&&(D>e||r>e)&&([l,t]=Rn(D,r),D>r?(l.width=e,l.height=r/D*e):(l.width=D/r*e,l.height=e),t.drawImage(n,0,0,l.width,l.height),xt(n)),l}function qi(n,f){const{width:D}=n,{height:r}=n,[e,t]=Rn(D,r);switch(f>4&&f<9?(e.width=r,e.height=D):(e.width=D,e.height=r),f){case 2:t.transform(-1,0,0,1,D,0);break;case 3:t.transform(-1,0,0,-1,D,r);break;case 4:t.transform(1,0,0,-1,0,r);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,r,0);break;case 7:t.transform(0,-1,-1,0,r,D);break;case 8:t.transform(0,-1,1,0,0,D)}return t.drawImage(n,0,0,D,r),xt(n),e}function wi(n,f,D=0){return new Promise((function(r,e){let t,l,u,w,L,i,a,o,d,v,R,k,T,K,P,x,q,M,N,y;function p(_=5){if(f.signal&&f.signal.aborted)throw f.signal.reason;t+=_,f.onProgress(Math.min(t,100))}function F(_){if(f.signal&&f.signal.aborted)throw f.signal.reason;t=Math.min(Math.max(_,t),100),f.onProgress(t)}return t=D,l=f.maxIteration||10,u=1024*f.maxSizeMB*1024,p(),An(n,f).then((function(_){try{return[,w]=_,p(),L=ji(w,f),p(),new Promise((function(S,A){var I;if(!(I=f.exifOrientation))return Pi(n).then((function(m){try{return I=m,$.call(this)}catch(h){return A(h)}}).bind(this),A);function $(){return S(I)}return $.call(this)})).then((function(S){try{return i=S,p(),Kt().then((function(A){try{return a=A?L:qi(L,i),p(),o=f.initialQuality||1,d=f.fileType||n.type,Tn(a,d,n.name,n.lastModified,o).then((function(I){try{{let m=function(){if(l--&&(P>u||P>T)){let O,C;return O=y?.95*N.width:N.width,C=y?.95*N.height:N.height,[q,M]=Rn(O,C),M.drawImage(N,0,0,O,C),o*=d==="image/png"?.85:.95,Tn(q,d,n.name,n.lastModified,o).then((function(z){try{return x=z,xt(N),N=q,P=x.size,F(Math.min(99,Math.floor((K-P)/(K-u)*100))),m}catch(Q){return e(Q)}}),e)}return[1]},h=function(){return xt(N),xt(q),xt(L),xt(a),xt(w),F(100),r(x)};if(v=I,p(),R=v.size>u,k=v.size>n.size,!R&&!k)return F(100),r(v);var $;return T=n.size,K=v.size,P=K,N=a,y=!f.alwaysKeepResolution&&R,($=(function(O){for(;O;){if(O.then)return void O.then($,e);try{if(O.pop){if(O.length)return O.pop()?h.call(this):O;O=m}else O=O.call(this)}catch(C){return e(C)}}}).bind(this))(m)}}catch(m){return e(m)}}).bind(this),e)}catch(I){return e(I)}}).bind(this),e)}catch(A){return e(A)}}).bind(this),e)}catch(S){return e(S)}}).bind(this),e)}))}const zs=`
|
|
2
|
+
import{d as Bt,w as Ce,u as B,o as W,c as ee,r as Pt,a as me,b as Me,e as It,F as Ie,f as vt,m as ui,t as mo,n as gt,g as In,h as wi,i as ie,j as ge,k as Ut,l as ye,p as cn,q as wt,s as go,v as Gn,x as _t,y as sn,z as vo,A as En,B as bi,C as xn,D as ki,E as Fn,G as Ln,H as y,I as K,J as Sn,K as Ze,T as Ii,L as un,M as it,N as ci,O as fi,P as Jt,Q as ut,R as Be,S as _i,_ as $n,U as Si,V as bt,W as po,X as Ci,Y as yo,Z as Kn,$ as Mi,a0 as wo,a1 as gn,a2 as di,a3 as Ai,a4 as jn,a5 as Ti,a6 as Ei,a7 as qn,a8 as Vn,a9 as bo,aa as ko,ab as tn,ac as vn,ad as hi,ae as Io,af as _o,ag as Dt,ah as pn,ai as So,aj as yn,ak as nn,al as on,am as an,an as Un,ao as Co,ap as Mo,aq as Ao,ar as To,as as Eo,at as mi,au as gi,av as xo,aw as Nt,ax as Fo,ay as Lo,az as wn,aA as $o,aB as Ro,aC as Do,aD as Bo,aE as Oo,aF as Uo,aG as zo,aH as No,aI as Ho}from"./index-EJ2CcODr.js";import{_ as Wn,E as rn,a as ln}from"./MsgBody.vue_vue_type_script_setup_true_lang-BBF1uxm6.js";function Jn(n,f,D){if(!D)return f;const r=n==null?void 0:n[D];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${D}')`);return r}function bn(n,f){return n.map((D,r)=>Jn(D,r,f))}function Po(n,f,D){const r=[],e=[];for(let t=0;t<n.length;t++){const l=n[t],u=Jn(l,t,f),w=D(l,t,u);r.push(u),e.push(typeof w=="number"&&w>0?w:null)}return{keys:r,sizes:e}}function jo(n,f,D){if(!n||n.keys.length!==f.length||n.sizes.length!==f.length)return!1;for(let r=0;r<f.length;r++)if(n.keys[r]!==Jn(f[r],r,D))return!1;return!0}function qo(n,f,D){if(!jo(n,f,D))return{};const r={};for(let e=0;e<n.keys.length;e++){const t=n.sizes[e];typeof t=="number"&&t>0&&(r[n.keys[e]]=t)}return r}function Vo(n,f){if(!n.length||f.length<=n.length)return 0;const D=n[0],r=f.indexOf(D);if(r<=0||r+n.length<f.length&&n.length>f.length-r)return 0;for(let e=0;e<n.length;e++)if(f[r+e]!==n[e])return 0;return r}function vi(n,f,D,r,e,t=0){const l=e??"start";if(l==="nearest"){const u=D+r,w=n+f;return n>=D&&w<=u?null:n<D?n+t:w-r+t}return l==="end"?n+f-r+t:l==="center"?n+(f-r)/2+t:n+t}const Wo={itemsLimit:1e3};function xi(n){return typeof window<"u"&&n===window}const Qo=(()=>{if(typeof document>"u")return"negative";const n=document.createElement("div"),f=document.createElement("div");n.style.width="4px",n.style.height="1px",n.style.overflow="auto",n.style.direction="rtl",f.style.width="8px",f.style.height="1px",n.appendChild(f),document.body.appendChild(n),n.scrollLeft=-1;const D=n.scrollLeft<0;return document.body.removeChild(n),D?"negative":"default"})();function Gt(n,f,D){return f!=="horizontal"||!D||xi(D)||getComputedStyle(D).direction!=="rtl"?n:Qo==="negative"?-n:n}function Go(n,f,D){return Gt(n,f,D)}function zn(n,f,D,r){const e=Go(D,f,n),t=!!(r!=null&&r.smooth);if(xi(n)){f==="vertical"?n.scrollTo({top:e,behavior:t?"smooth":"auto"}):n.scrollTo({left:e,behavior:t?"smooth":"auto"});return}if(typeof n.scrollTo=="function"){n.scrollTo(f==="vertical"?{top:e,behavior:t?"smooth":"auto"}:{left:e,behavior:t?"smooth":"auto"});return}f==="vertical"?n.scrollTop=e:n.scrollLeft=e}function Ko(n,f,D){return D?f==="vertical"?window.innerHeight:window.innerWidth:f==="vertical"?n.clientHeight:n.clientWidth}const Jo=/auto|scroll/;function Fi(n,f){return n.parentNode===null?f:Fi(n.parentNode,[...f,n])}function Nn(n,f){return getComputedStyle(n,null).getPropertyValue(f)}function Yo(n){return Nn(n,"overflow")+Nn(n,"overflow-y")+Nn(n,"overflow-x")}function Xo(n){return Jo.test(Yo(n))}function kn(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const f=Fi(n.parentNode,[]);for(let D=0;D<f.length;D+=1)if(f[D]instanceof Element&&Xo(f[D]))return f[D];return document.scrollingElement||document.documentElement}let Qn=!1;function Zo(){return Qn}if(typeof window<"u"){Qn=!1;try{const n=Object.defineProperty({},"passive",{get(){Qn=!0}});window.addEventListener("test",null,n)}catch{}}let ea=0;function Hn(n){const f=n;f._vs_styleStamp++}function ta(n,f,D){const r=n==null?void 0:n[D];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${D}')`);return r}function na(n,f,D,r,e){const t=ge([]),l=ge(0),u=ge(!1);let w=0,L=0;const i=new Map,a=new Map;let o=!1,d=0,g=0,R=!1,k=null,T=null,G=null,P=0,x=null,q=[],M=null,N=null,p=null,v=!1;const F=new Set,_=ge({}),S=Ut(()=>{const H=ye(n);return H.items.length>0&&typeof H.items[0]!="object"}),A=Ut(()=>{const H=ye(n);if(H.itemSize===null){const V={[-1]:{accumulator:0}},te=H.items,ae=H.sizeField??"size",se=H.minItemSize,le=_.value;let ce=1e4,Te=0,tt;for(let je=0,nt=te.length;je<nt;je++){const Ne=S.value?je:ta(te[je],je,H.keyField);tt=le[Ne]||te[je][ae]||se,tt<ce&&(ce=tt),Te+=tt,V[je]={accumulator:Te,size:tt}}return P=ce,V}return[]}),I=Ut(()=>t.value.filter(H=>H.nr.used).sort((H,V)=>H.nr.index-V.nr.index)),$=Ut(()=>{const H=ye(n),V=S.value?null:H.keyField;return Po(H.items,V,(te,ae,se)=>H.itemSize!=null?H.itemSize:_.value[se]||(te==null?void 0:te[H.sizeField??"size"])||void 0)});function m(H){const V=ye(n);return _.value=qo(H,V.items,S.value?null:V.keyField),Object.keys(_.value).length>0}function h(H){let V=a.get(H);return V||(V=[],a.set(H,V)),V}function O(H,V,te,ae,se){const le=sn({id:ea++,index:V,used:!0,key:ae,type:se}),ce=vo({item:te,position:0,offset:0,nr:le,_vs_styleStamp:0});return H.push(ce),ce}function C(H){const V=h(H);if(V&&V.length){const te=V.pop();return te.nr.used=!0,Hn(te),te}}function z(H){const V=H.nr.type;h(V).push(H),H.nr.used=!1,H.position=-9999,Hn(H),i.delete(H.nr.key)}function Q(){i.clear(),a.clear();for(let H=0,V=t.value.length;H<V;H++){const te=t.value[H];te&&z(te)}}function Y(H){let V=-1;return V=requestAnimationFrame(()=>{F.delete(V),H()}),F.add(V),V}function ne(){for(const H of F)cancelAnimationFrame(H);F.clear()}function X(){k&&(clearTimeout(k),k=null),T&&(clearTimeout(T),T=null),G&&(clearTimeout(G),G=null),N&&(clearTimeout(N),N=null),p&&(clearTimeout(p),p=null)}function j(){var H;(H=e==null?void 0:e.onResize)==null||H.call(e),u.value&&ue(!1)}function re(){M&&!v&&_e();const H=ye(n);if(!o){if(o=!0,k)return;const V=()=>Y(()=>{o=!1;const{continuous:te}=ue(!1,!0);te||(T&&clearTimeout(T),T=setTimeout(re,H.updateInterval+100))});V(),H.updateInterval&&(k=setTimeout(()=>{k=null,o&&V()},H.updateInterval))}}function Re(H,V){var te,ae;u.value&&(H||V.boundingClientRect.width!==0||V.boundingClientRect.height!==0?((te=e==null?void 0:e.onVisible)==null||te.call(e),Y(()=>{ue(!1)})):(ae=e==null?void 0:e.onHidden)==null||ae.call(e))}function Ae(){const H=ye(f),V=H?kn(H):void 0;return window.document&&(V===window.document.documentElement||V===window.document.body)?window:V||window}function fe(){const H=ye(D);return H?ye(n).direction==="vertical"?H.scrollHeight:H.scrollWidth:0}function ve(){const H=ye(f);if(!H)return{start:0,end:0};const V=ye(n),te=V.direction==="vertical";let ae;if(V.pageMode){const se=H.getBoundingClientRect(),le=te?se.height:se.width;let ce=-(te?se.top:se.left),Te=te?window.innerHeight:window.innerWidth;ce<0&&(Te+=ce,ce=0),ce+Te>le&&(Te=le-ce),ae={start:ce,end:ce+Te}}else te?ae={start:H.scrollTop,end:H.scrollTop+H.clientHeight}:ae={start:Gt(H.scrollLeft,V.direction,H),end:Gt(H.scrollLeft,V.direction,H)+H.clientWidth};return ae}function xe(){const H=ye(f);if(!H)return{start:0,end:0};if(ye(n).direction==="vertical"){const V=Gt(H.scrollLeft,"horizontal",H);return{start:V,end:V+H.clientWidth}}return{start:H.scrollTop,end:H.scrollTop+H.clientHeight}}function Fe(H){const V=ye(n);if(V.itemSize!=null)return V.itemSize;const te=A.value[H];return(te==null?void 0:te.size)||Number(V.minItemSize)||0}function qe(H){var V;const te=ye(n),ae=te.gridItems||1;return H<=0?0:te.itemSize!=null?Math.floor(H/ae)*te.itemSize:((V=A.value[H-1])==null?void 0:V.accumulator)||0}function Ke(H){const V=ye(n),te=V.items.length,ae=V.gridItems||1;if(!te)return 0;if(V.itemSize!=null){const Te=Math.floor(H/V.itemSize)*ae;return Math.min(Math.max(Te,0),te-1)}let se=0,le=te-1,ce=0;for(;se<=le;){const Te=Math.floor((se+le)/2);qe(Te)<=H?(ce=Te,se=Te+1):le=Te-1}return ce}function _e(){N&&(clearTimeout(N),N=null),M=null}function Oe(){N&&clearTimeout(N),N=setTimeout(()=>{M=null,N=null},150)}function De(H,V){if(!H.length){_e();return}const te=Math.max(ve().start-fe(),0),ae=Math.min(Ke(te),H.length-1),se=H[ae],le=V?se==null?void 0:se[V]:ae;if(le==null){_e();return}const ce=fe()+qe(ae);M={key:le,offset:ve().start-ce}}function Se(H){if(!M)return!1;const V=ye(n),te=H??V.items,ae=S.value?null:V.keyField,se=bn(te,ae).indexOf(M.key);if(se===-1)return _e(),!1;const le=fe()+qe(se)+M.offset,ce=ve().start;return Math.abs(le-ce)<.5?!1:(v=!0,rt(le),Y(()=>{v=!1}),!0)}function Ve(){ye(n).pageMode?ot():Le()}function ot(){x=Ae(),x.addEventListener("scroll",re,Zo()?{passive:!0}:!1),x.addEventListener("resize",j)}function Le(){x&&(x.removeEventListener("scroll",re),x.removeEventListener("resize",j),x=null)}function ct(H,V,te,ae,se,le){const ce=Math.ceil(H/V)*te,Te=Math.max(0,Math.floor(se.start/te)),tt=Math.min(Math.ceil(se.end/te),Math.ceil(H/V)),je=Math.max(0,Math.floor(le.start/ae)),nt=Math.min(Math.ceil(le.end/ae),V),Ne=[];for(let lt=Te;lt<tt;lt++){const pt=lt*V;for(let Je=je;Je<nt;Je++){const at=pt+Je;if(at>=H)break;Ne.push(at)}}const be=Ne[0]??0,Ue=Ne.at(-1)??-1;return{renderedIndices:Ne,startIndex:be,endIndex:Ue+1,visibleStartIndex:be,visibleEndIndex:Ue,totalSize:ce}}function Pe(){const H=ye(n);if(!H.gridItems||H.itemSize==null)return!1;const V=ye(f);if(!V)return!1;const te=H.itemSecondarySize||H.itemSize,ae=H.direction==="vertical"?V.clientWidth:V.clientHeight;return te*H.gridItems>ae}function ue(H,V=!1){var te,ae;const se=ye(n),le=se.itemSize,ce=se.gridItems||1,Te=se.itemSecondarySize||le,tt=P,je=se.typeField,nt=S.value?null:se.keyField,Ne=se.items,be=Ne.length,Ue=A.value,lt=i,pt=t.value;let Je=null,at=null,We,ze,Lt,kt,yt;if(!be)We=ze=kt=yt=Lt=0;else if(R)We=kt=0,ze=yt=Math.min(se.prerender,Ne.length),Lt=0;else{const ke=ve(),st=xe();if(V){let Ye=ke.start-d;Ye<0&&(Ye=-Ye);let He=st.start-g;He<0&&(He=-He);const $t=le===null&&Ye>=tt||le!==null&&Ye>=le,ht=ce>1&&le!=null&&He>=Te;if(!$t&&!ht)return{continuous:!0}}d=ke.start,g=st.start;const At=se.buffer;ke.start-=At,ke.end+=At,st.start-=At,st.end+=At;let Et=0;const Vt=ye(D);Vt&&(Et=Vt.scrollHeight,ke.start-=Et);const dn=ye(r);if(dn){const Ye=dn.scrollHeight;ke.end+=Ye}if(le===null){let Ye,He=0,$t=be-1,ht=~~(be/2),Xt;do Xt=ht,Ye=Ue[ht].accumulator,Ye<ke.start?He=ht:ht<be-1&&Ue[ht+1].accumulator>ke.start&&($t=ht),ht=~~((He+$t)/2);while(ht!==Xt);for(ht<0&&(ht=0),We=ht,Lt=Ue[be-1].accumulator,ze=ht;ze<be&&Ue[ze].accumulator<ke.end;ze++);for(ze===-1?ze=Ne.length-1:(ze++,ze>be&&(ze=be)),kt=We;kt<be&&Et+Ue[kt].accumulator<ke.start;kt++);for(yt=kt;yt<be&&Et+Ue[yt].accumulator<ke.end;yt++);}else if(ce>1){const Ye=ct(be,ce,le,Te,ke,st);Je=Ye.renderedIndices,at=new Set(Je),We=Ye.startIndex,ze=Ye.endIndex,kt=Ye.visibleStartIndex,yt=Ye.visibleEndIndex,Lt=Ye.totalSize}else{We=~~(ke.start/le*ce);const Ye=We%ce;We-=Ye,ze=Math.ceil(ke.end/le*ce),kt=Math.max(0,Math.floor((ke.start-Et)/le*ce)),yt=Math.floor((ke.end-Et)/le*ce),We<0&&(We=0),ze>be&&(ze=be),kt<0&&(kt=0),yt>be&&(yt=be),Lt=Math.ceil(be/ce)*le}}ze-We>Wo.itemsLimit&&ft(),l.value=Lt;let Ee;const fn=We<=L&&ze>=w;if(!fn||H)Q();else for(let ke=0,st=pt.length;ke<st;ke++){const At=pt[ke];if(At&&(Ee=At,Ee.nr.used)){const Et=at?at.has(Ee.nr.index):Ee.nr.index>=We&&Ee.nr.index<ze,Vt=le||Ue[Ee.nr.index]&&Ue[Ee.nr.index].size;(!Et||!Vt)&&z(Ee)}}let Mt,qt;const Yt=Je??Array.from({length:Math.max(0,ze-We)},(ke,st)=>We+st);for(const ke of Yt){if(!(le||Ue[ke]&&Ue[ke].size))continue;Mt=Ne[ke];const st=nt?Mt[nt]:ke;if(st==null)throw new Error(`Key is ${st} on item (keyField is '${nt}')`);if(Ee=lt.get(st),Ee)Ee.item!==Mt&&(Ee.item=Mt),Ee.nr.used||console.warn(`Expected existing view's used flag to be true, got ${Ee.nr.used}`);else{if(qt=Mt[je],Ee=C(qt),Ee){const At=Ee.nr.index!==ke||Ee.nr.key!==st;Ee.item=Mt,Ee.nr.index=ke,Ee.nr.key=st,Ee.nr.type!==qt&&console.warn("Reused view's type does not match pool's type"),At&&Hn(Ee)}else Ee=O(pt,ke,Mt,st,qt);lt.set(st,Ee)}le===null?(Ee.position=((te=Ue[ke-1])==null?void 0:te.accumulator)||0,Ee.offset=0):(Ee.position=Math.floor(ke/ce)*le,Ee.offset=ke%ce*Te)}return w=We,L=ze,se.emitUpdate&&((ae=e==null?void 0:e.onUpdate)==null||ae.call(e,We,ze,kt,yt)),G&&clearTimeout(G),G=setTimeout(Ft,se.updateInterval+300),{continuous:fn}}function ft(){throw p=setTimeout(()=>{p=null,console.warn("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",ye(f)),console.warn("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")}function Ct(){if(Pe())return!1;const H=t.value.filter(({nr:V})=>V.used);for(let V=1;V<H.length;V++)if(H[V].nr.index!==H[V-1].nr.index+1)return!0;return!1}function Ft(){t.value.sort((H,V)=>H.nr.index-V.nr.index),Ct()&&(ue(!1),G&&clearTimeout(G))}function et(H,V){const te=ye(n),ae=ye(f);if(!ae)return;const se=Math.max(0,Math.min(H,te.items.length-1)),le=ve().start,ce=Ko(ae,te.direction,te.pageMode),Te=qe(se),tt=Fe(se),je=vi(Te,tt,le,ce,V==null?void 0:V.align,(V==null?void 0:V.offset)??0);if(je!=null&&(rt(je,V),te.gridItems&&te.itemSize!=null)){const nt=ye(f);if(!nt)return;const Ne=te.gridItems,be=te.itemSecondarySize||te.itemSize,Ue=se%Ne*be,lt=te.direction==="vertical"?"horizontal":"vertical",pt=lt==="horizontal"?Gt(nt.scrollLeft,"horizontal",nt):nt.scrollTop,Je=lt==="horizontal"?nt.clientWidth:nt.clientHeight,at=vi(Ue,be,pt,Je,V==null?void 0:V.align,(V==null?void 0:V.offset)??0);at!=null&&zn(nt,lt,at,V)}}function rt(H,V){const te=ye(n),ae=ye(f);if(ae)if(te.pageMode){const se=kn(ae),le=se.getBoundingClientRect(),ce=ae.getBoundingClientRect(),Te=te.direction==="vertical"?"top":"left",tt=kn(ae)===document.documentElement||kn(ae)===document.body?te.direction==="vertical"?window.scrollY:window.scrollX:Gt(te.direction==="vertical"?se.scrollTop:se.scrollLeft,te.direction,se),je=ce[Te]-le[Te];zn(se.tagName==="HTML"?window:se,te.direction,H+tt+je,V)}else zn(ae,te.direction,H,V)}const we=ye(n);return q=bn(we.items,we.items.length>0&&typeof we.items[0]!="object"?null:we.keyField),we.cache&&m(we.cache),we.prerender&&(R=!0,ue(!1)),we.gridItems&&!we.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems"),cn(()=>{Ve(),wt(()=>{R=!1,ue(!0),u.value=!0})}),go(()=>{const H=d;typeof H=="number"&&wt(()=>{rt(H)})}),Gn(()=>{X(),ne(),Le()}),_t(()=>ye(n).cache,H=>{m(H),ue(!0)}),_t(()=>ye(n).items,(H,V)=>{const te=ye(n),ae=S.value?null:te.keyField,se=bn(H,ae);if(te.shift){const le=V?bn(V,ae):q;Vo(le,se)>0?De(V??[],ae):_e()}else _e();q=se,Se(H),ue(!0)}),_t(()=>ye(n).pageMode,()=>{Ve(),ue(!1)}),_t(A,()=>{Se()&&Oe(),ue(!1)},{deep:!0}),_t(()=>ye(n).gridItems,()=>{ue(!0)}),_t(()=>ye(n).itemSecondarySize,()=>{ue(!0)}),{pool:t,visiblePool:I,totalSize:l,ready:u,sizes:A,simpleArray:S,scrollToItem:et,scrollToPosition:rt,getScroll:ve,findItemIndex:Ke,getItemOffset:qe,getItemSize:Fe,cacheSnapshot:$,restoreCache:m,updateVisibleItems:ue,handleScroll:re,handleResize:j,handleVisibilityChange:Re,sortViews:Ft}}const Yn=new WeakMap;function ia(n){return typeof n=="function"?{callback:n,observer:null,intersection:void 0,visible:null}:{callback:n.callback,observer:null,intersection:n.intersection,visible:null}}function pi(n,f){Li(n);const D=ia(f.value);if(Yn.set(n,D),typeof IntersectionObserver>"u"){const r=n.getBoundingClientRect();D.visible=!0,D.callback(!0,{boundingClientRect:r});return}D.observer=new IntersectionObserver(r=>{const e=r[0],t=!!(e!=null&&e.isIntersecting);D.visible!==null&&D.visible===t||(D.visible=t,D.callback(t,e))},D.intersection),D.observer.observe(n)}function Li(n){const f=Yn.get(n);f!=null&&f.observer&&(f.observer.disconnect(),f.observer=null)}const oa={mounted(n,f){pi(n,f)},updated(n,f){f.value!==f.oldValue&&pi(n,f)},unmounted(n){Li(n),Yn.delete(n)}},aa=Bt({__name:"ItemView",props:{view:{},itemTag:{}},setup(n){const f=n;return(D,r)=>(W(),Me(wi(f.itemTag),{class:"vue-recycle-scroller__item-view"},{default:It(()=>[Pt(D.$slots,"default",{item:f.view.item,index:f.view.nr.index,active:f.view.nr.used})]),_:3}))}}),sa=Bt({__name:"ResizeObserver",emits:["notify"],setup(n,{emit:f}){const D=f,r=ge();let e=null,t=null;function l(){D("notify")}return cn(()=>{var u;const w=(u=r.value)==null?void 0:u.parentElement;if(w){if(typeof ResizeObserver<"u"){e=new ResizeObserver(()=>{l()}),e.observe(w);return}t=()=>l(),window.addEventListener("resize",t)}}),Gn(()=>{e&&(e.disconnect(),e=null),t&&(window.removeEventListener("resize",t),t=null)}),(u,w)=>(W(),ee("div",{ref_key:"el",ref:r,class:"vue-recycle-scroller__resize-observer","aria-hidden":"true"},null,512))}}),ra=(n,f)=>{const D=n.__vccOpts||n;for(const[r,e]of f)D[r]=e;return D},la=ra(sa,[["__scopeId","data-v-08cc04ab"]]),ua=Bt({__name:"RecycleScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},itemSize:{default:null},gridItems:{default:void 0},itemSecondarySize:{default:void 0},minItemSize:{default:null},sizeField:{default:"size"},typeField:{default:"type"},buffer:{default:200},pageMode:{type:Boolean,default:!1},shift:{type:Boolean,default:!1},cache:{default:void 0},prerender:{default:0},emitUpdate:{type:Boolean,default:!1},disableTransform:{type:Boolean,default:!1},updateInterval:{default:0},skipHover:{type:Boolean,default:!1},listClass:{default:""},itemClass:{default:""}},emits:["resize","visible","hidden","update","scrollStart","scrollEnd"],setup(n,{expose:f,emit:D}){const r=n,e=D,t=oa,l=ge(),u=ge(),w=ge(),L=ge(null),i=na(r,l,u,w,{onResize:()=>e("resize"),onVisible:()=>e("visible"),onHidden:()=>e("hidden"),onUpdate:(I,$,m,h)=>{e("update",I,$,m,h),m<=0&&e("scrollStart"),h>=r.items.length-1&&e("scrollEnd")}}),{pool:a,visiblePool:o,totalSize:d,ready:g,scrollToItem:R,scrollToPosition:k,getScroll:T,findItemIndex:G,getItemOffset:P,getItemSize:x,cacheSnapshot:q,restoreCache:M,updateVisibleItems:N,handleScroll:p,handleResize:v,handleVisibilityChange:F}=i;function _(I){L.value=I}function S(){L.value=null}const A=Ut(()=>{const I={[r.direction==="vertical"?"minHeight":"minWidth"]:`${d.value}px`};if(r.gridItems&&r.itemSize!=null){const $=(r.itemSecondarySize||r.itemSize)*r.gridItems;I[r.direction==="vertical"?"minWidth":"minHeight"]=`${$}px`}return I});return f({el:l,visiblePool:o,scrollToItem:R,scrollToPosition:k,getScroll:T,findItemIndex:G,getItemOffset:P,getItemSize:x,cacheSnapshot:q,restoreCache:M,updateVisibleItems:N}),(I,$)=>Ce((W(),ee("div",{ref_key:"el",ref:l,class:gt(["vue-recycle-scroller",{"grid-mode":r.gridItems,ready:B(g),"page-mode":r.pageMode,[`direction-${r.direction}`]:!0}]),onScrollPassive:$[0]||($[0]=(...m)=>B(p)&&B(p)(...m))},[I.$slots.before?(W(),ee("div",{key:0,ref_key:"before",ref:u,class:"vue-recycle-scroller__slot"},[Pt(I.$slots,"before")],512)):me("",!0),(W(),Me(wi(r.listTag),{style:In(A.value),class:gt(["vue-recycle-scroller__item-wrapper",r.listClass])},{default:It(()=>[(W(!0),ee(Ie,null,vt(B(a),m=>(W(),Me(aa,ui({key:m.nr.id,view:m,"item-tag":r.itemTag,style:B(g)?[r.disableTransform?{[r.direction==="vertical"?"top":"left"]:`${m.position}px`,willChange:"unset"}:{transform:`translate${r.direction==="vertical"?"Y":"X"}(${m.position}px) translate${r.direction==="vertical"?"X":"Y"}(${m.offset}px)`},{width:r.gridItems?`${r.direction==="vertical"&&r.itemSecondarySize||r.itemSize}px`:void 0,height:r.gridItems?`${r.direction==="horizontal"&&r.itemSecondarySize||r.itemSize}px`:void 0,visibility:m.nr.used?"visible":"hidden"}]:null,class:["vue-recycle-scroller__item-view",[r.itemClass,{hover:!r.skipHover&&L.value===m.nr.key}]]},mo(r.skipHover?{}:{mouseenter:()=>{_(m.nr.key)},mouseleave:()=>{S()}})),{default:It(h=>[Pt(I.$slots,"default",ui({ref_for:!0},h))]),_:2},1040,["view","item-tag","style","class"]))),128)),r.items.length===0?Pt(I.$slots,"empty",{key:0}):me("",!0)]),_:3},8,["style","class"])),I.$slots.after?(W(),ee("div",{key:1,ref_key:"after",ref:w,class:"vue-recycle-scroller__slot"},[Pt(I.$slots,"after")],512)):me("",!0),ie(la,{onNotify:B(v)},null,8,["onNotify"])],34)),[[B(t),B(F)]])}}),ca={key:0,class:"chat-info-pan"},fa={class:"ss-card chat-info"},da={key:0},ha={key:1},ma={class:"chat-info-base user"},ga=["src"],va={key:0},pa={class:"info-copy"},ya={class:"info-copy"},wa={class:"info-copy"},ba={style:{"word-break":"break-all"}},ka={key:1},Ia=["innerHTML"],_a={class:"tags"},Sa={key:2},Ca={class:"info-copy"},Ma={class:"info-copy"},Aa={class:"info-copy"},Ta={style:{"word-break":"break-all"}},Ea={class:"info-copy"},xa=["name"],Fa={class:"search-view"},La={for:"info-member-search",class:"sr-only"},$a=["placeholder"],Ra={class:"member-item edit"},Da=["src"],Ba=["onClick"],Oa=["onClick"],Ua=["src"],za={class:"opt-item"},Na={for:"info-member-card"},Ha={key:0,class:"opt-item"},Pa={for:"info-member-title"},ja={class:"opt-item"},qa={for:"info-member-ban-min"},Va=Bt({name:"ViewInfo",__name:"Info",props:{tags:{},chat:{}},emits:["close"],setup(n,{emit:f}){const D=En(),r=bi(),e=xn(),t=ki(),l=n,u=f,{t:w}=Fn.global;function L(O){const C=String(O??"");return!C||C==="/img/icons/icon.svg"||C.includes("/img/icons/icon.svg")}function i(){return String(l.chat.show.channel_id||l.chat.show.channelId||l.chat.info.user_info.channel_id||l.chat.info.user_info.channelId||String(l.chat.show.id))}function a(){return String(l.chat.show.channel_id||l.chat.show.channelId||l.chat.info.group_info.channel_id||l.chat.info.group_info.channelId||String(l.chat.show.id))}const o=ge([]),d=ge(""),g=ge({}),R=ge({});function k(O){return typeof O!="object"||O===null?{}:O}function T(O){return String(k(O).user_id??"")}function G(O){const C=k(O);return String(C.card||C.nickname||C.name||T(O))}function P(O){return String(k(O).avatar??"")}function x(O){return String(k(O).role??"")}const q=ge({banMin:0});function M(O,C,z){const Q={title:w("提醒"),html:`<span>${w("真的要将 {user} 移出群聊吗",{user:O})}</span>`,button:[{text:w("确定"),fun:()=>{it.send("set_group_kick",{group_id:C,user_id:z},"setGroupKick"),t.popBoxList.shift(),g.value={};const Y={title:w("操作"),html:`<span>${w("正在确认操作……")}</span>`};t.popBoxList.push(Y),ci(1e3).then(()=>(fi(String(e.chatInfo.show.id)),ci(1e3))).then(()=>{fi(String(e.chatInfo.show.id)),t.popBoxList.shift()})}},{text:w("取消"),master:!0,fun:()=>{t.popBoxList.shift()}}]};t.popBoxList.push(Q)}function N(O){const C=new ut;Jt.config.globalProperties.$copyText(String(O)).then(()=>{C.add(Be.INFO,w("复制成功"),!0)},()=>{C.add(Be.ERR,w("复制失败"),!0)})}function p(O,C){const z=O.target.value;if(z!==""){const Q=parseInt(z);if(Q>0){const Y={title:w("操作"),html:`<span>${w("确认禁言?")}</span>`,button:[{text:w("确认"),fun:()=>{var X;const ne=(X=D.jsonMap.ban_mumber)==null?void 0:X.name;ne&&it.send(ne,{group_id:e.chatInfo.show.id,user_id:C.user_id,duration:Q*60},"banMumber"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Y)}}}function v(O,C){const z=O.target.value;if(g.value.card!==z){const Q={title:w("操作"),html:`<span>${w("确认修改昵称?")}</span>`,button:[{text:w("确认"),fun:()=>{var ne;const Y=(ne=D.jsonMap.set_group_nickname)==null?void 0:ne.name;Y&&it.send(Y,{group_id:e.chatInfo.show.id,user_id:C.user_id,card:z},"updateGroupMemberInfo"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Q)}}function F(O,C){const z=O.target.value;if(g.value.card!==z){const Q={title:w("操作"),html:`<span>${w("确认修改头衔?")}</span>`,button:[{text:w("确认"),fun:()=>{var ne;const Y=(ne=D.jsonMap.set_group_title)==null?void 0:ne.name;Y&&it.send(Y,{group_id:e.chatInfo.show.id,user_id:C.user_id,special_title:z},"updateGroupMemberInfo"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Q)}}function _(O){O<1e10&&(O*=1e3);const C=new Date().getTime(),z=O-C;return z>0?Math.floor(z/1e3/60):0}function S(O){const C=O.target.value;if(C!==""){const z=parseInt(C);isNaN(z)?O.target.value="":z<0&&(O.target.value="0")}}function A(){g.value={},u("close")}function I(O){if(O.user_id!=D.loginInfo.uin){let C=r.userList.find(z=>z.user_id==O.user_id);C||(C={user_id:O.user_id,nickname:w("临时会话"),remark:O.user_id,group_id:O.group_id,group_name:""}),r.baseOnMsgList.set(String(O.user_id),C),wt(()=>{if(C){const z=document.getElementById("user-"+C.user_id);z&&z.click()}})}}function $(O){h(O.role)?(g.value=O,R.value=JSON.parse(JSON.stringify(O)),q.value.banMin=_(O.shut_up_timestamp)):N(O.user_id)}function m(O){O&&(d.value=O.target.value);const C=d.value.trim();if(!C){o.value=[];return}const z=C.toLowerCase(),Q=Array.isArray(l.chat.info.group_members)?l.chat.info.group_members:[];o.value=_i(Q).filter(Y=>{const ne=G(Y).toLowerCase(),X=T(Y);return ne.includes(z)||X.includes(C)||X.toLowerCase().includes(z)})}_t(()=>l.chat.info.group_members,()=>{d.value.trim()&&m()},{deep:!0});function h(O){return l.chat.info.me_info.role==="owner"||l.chat.info.me_info.role==="admin"&&O!=="owner"}return(O,C)=>{const z=Ln("font-awesome-icon");return n.tags.openChatInfo?(W(),ee("div",ca,[y("div",fa,[y("header",null,[n.chat.show.type==="group"?(W(),ee("span",da,K(B(w)("群资料")),1)):me("",!0),n.chat.show.type==="user"?(W(),ee("span",ha,K(B(w)("好友")),1)):me("",!0),ie(z,{icon:["fas","xmark"],onClick:A})]),y("div",ma,[y("div",null,[y("img",{"data-avatar":"",src:n.chat.show.avatar||"/img/icons/icon.svg",onError:C[0]||(C[0]=(...Q)=>B(Sn)&&B(Sn)(...Q))},null,40,ga),y("div",null,[y("a",null,K(n.chat.show.name),1),y("span",null,K(n.chat.show.id),1)]),y("div",{style:{display:"flex","align-items":"center","justify-content":"center",cursor:"pointer"},onClick:C[1]||(C[1]=Q=>N(n.chat.show.id))},[ie(z,{icon:["fas","copy"]})])]),n.chat.show.type==="group"?(W(),ee("div",va,[y("header",null,[y("span",null,K(B(w)("群组 ID")),1)]),y("div",pa,[y("span",null,K(n.chat.show.id),1),ie(z,{icon:["fas","copy"],onClick:C[2]||(C[2]=Q=>N(n.chat.show.id))})]),y("header",null,[y("span",null,K(B(w)("频道 ID")),1)]),y("div",ya,[y("span",null,K(a()),1),ie(z,{icon:["fas","copy"],onClick:C[3]||(C[3]=Q=>N(a()))})]),y("header",null,[y("span",null,K(B(w)("群头像")),1)]),y("div",wa,[y("span",ba,K(L(n.chat.show.avatar)?B(w)("无"):n.chat.show.avatar),1),L(n.chat.show.avatar)?me("",!0):(W(),Me(z,{key:0,icon:["fas","copy"],onClick:C[4]||(C[4]=Q=>N(n.chat.show.avatar))}))])])):me("",!0),n.chat.show.type==="group"?Ce((W(),ee("div",ka,[y("header",null,[y("span",null,K(B(w)("介绍")),1)]),y("span",{innerHTML:n.chat.info.group_info.gIntro===void 0||n.chat.info.group_info.gIntro===""?B(w)("群主很懒,还没有群介绍哦~"):n.chat.info.group_info.gIntro},null,8,Ia),y("div",_a,[(W(!0),ee(Ie,null,vt(n.chat.info.group_info.tags,Q=>(W(),ee("div",{key:Q.md},K(Q.tag),1))),128))])],512)),[[Ze,Object.keys(n.chat.info.group_info).length>0]]):n.chat.show.type==="user"?(W(),ee("div",Sa,[y("header",null,[y("span",null,K(B(w)("用户 ID")),1)]),y("div",Ca,[y("span",null,K(n.chat.show.id),1),ie(z,{icon:["fas","copy"],onClick:C[5]||(C[5]=Q=>N(n.chat.show.id))})]),y("header",null,[y("span",null,K(B(w)("用户名称")),1)]),y("div",Ma,[y("span",null,K(n.chat.show.name),1),ie(z,{icon:["fas","copy"],onClick:C[6]||(C[6]=Q=>N(n.chat.show.name))})]),y("header",null,[y("span",null,K(B(w)("用户头像链接")),1)]),y("div",Aa,[y("span",Ta,K(L(n.chat.show.avatar)?B(w)("无"):n.chat.show.avatar),1),L(n.chat.show.avatar)?me("",!0):(W(),Me(z,{key:0,icon:["fas","copy"],onClick:C[7]||(C[7]=Q=>N(n.chat.show.avatar))}))]),y("header",null,[y("span",null,K(B(w)("频道 ID")),1)]),y("div",Ea,[y("span",null,K(i()),1),ie(z,{icon:["fas","copy"],onClick:C[8]||(C[8]=Q=>N(i()))})])])):me("",!0)]),n.chat.show.type==="group"?(W(),Me(B(Ii),{key:0,class:"chat-info-tab"},{default:It(()=>[y("div",{name:B(w)("成员")},[y("div",Fa,[y("label",La,K(B(w)("搜索成员")),1),y("input",{id:"info-member-search",placeholder:B(w)("搜索 ……"),onInput:C[9]||(C[9]=Q=>m(Q))},null,40,$a)]),ie(B(ua),{class:"member-scroller",items:d.value.trim()?o.value:n.chat.info.group_members,"item-size":60,"key-field":"user_id"},{default:It(({item:Q})=>[y("div",Ra,[y("img",{alt:"nk",loading:"lazy","data-avatar":"",src:P(Q)||"/img/icons/icon.svg"},null,8,Da),y("div",null,[y("a",{onClick:Y=>I(Q)},K(G(Q)),9,Ba),x(Q)==="owner"?(W(),Me(z,{key:0,icon:["fas","crown"]})):me("",!0),x(Q)==="admin"?(W(),Me(z,{key:1,icon:["fas","star"]})):me("",!0)]),y("span",{onClick:Y=>$(Q)},K(T(Q)),9,Oa),h(x(Q))?(W(),Me(z,{key:0,icon:["fas","wrench"],onClick:Y=>$(Q)},null,8,["onClick"])):(W(),Me(z,{key:1,icon:["fas","copy"],onClick:Y=>N(T(Q))},null,8,["onClick"]))])]),_:1},8,["items"])],8,xa)]),_:1})):me("",!0),y("div",{class:gt("ss-card user-config"+(Object.keys(g.value).length>0?" show":""))},[y("div",null,[y("img",{alt:"nk","data-avatar":"",src:g.value.avatar||"/img/icons/icon.svg"},null,8,Ua),y("div",null,[y("a",null,K(g.value.card!=""?g.value.card:g.value.nickname),1),y("span",null,K(g.value.user_id),1)]),ie(z,{style:{"margin-right":"20px"},icon:["fas","copy"],onClick:C[10]||(C[10]=Q=>N(g.value.user_id))}),ie(z,{icon:["fas","angle-down"],onClick:C[11]||(C[11]=Q=>g.value={})})]),y("div",null,[y("header",null,K(B(w)("成员信息")),1),y("div",za,[ie(z,{icon:["fas","clipboard-list"]}),y("div",null,[y("label",Na,K(B(w)("成员昵称")),1),y("span",null,K(B(w)("啊吧啊吧……")),1)]),Ce(y("input",{id:"info-member-card","onUpdate:modelValue":C[12]||(C[12]=Q=>R.value.card=Q),style:{width:"50%"},class:"ss-input",type:"text",onChange:C[13]||(C[13]=Q=>v(Q,g.value))},null,544),[[un,R.value.card]])]),n.chat.info.me_info.role==="owner"?(W(),ee("div",Ha,[ie(z,{icon:["fas","clipboard-list"]}),y("div",null,[y("label",Pa,K(B(w)("成员头衔")),1),y("span",null,K(B(w)("猪咪猪咪")),1)]),Ce(y("input",{id:"info-member-title","onUpdate:modelValue":C[14]||(C[14]=Q=>R.value.title=Q),style:{width:"50%"},class:"ss-input",type:"text",onChange:C[15]||(C[15]=Q=>F(Q,g.value))},null,544),[[un,R.value.title]])])):me("",!0),n.chat.info.me_info.role==="owner"&&g.value.role!="owner"||n.chat.info.me_info.role==="admin"&&g.value.role==="member"?(W(),ee(Ie,{key:1},[y("header",null,K(B(w)("操作")),1),y("div",ja,[ie(z,{icon:["fas","clipboard-list"]}),y("div",null,[y("label",qa,K(B(w)("禁言成员")),1),y("span",null,K(B(w)("要让小猫咪不许说话几分钟呢?")),1)]),Ce(y("input",{id:"info-member-ban-min","onUpdate:modelValue":C[16]||(C[16]=Q=>q.value.banMin=Q),style:{width:"50%"},class:"ss-input",type:"text",onInput:S,onChange:C[17]||(C[17]=Q=>p(Q,g.value))},null,544),[[un,q.value.banMin]])]),y("button",{class:"ss-button",onClick:C[18]||(C[18]=Q=>M(g.value.nickname,n.chat.show.id,g.value.user_id))},K(B(w)("移出群聊")),1)],64)):me("",!0)])],2)])])):me("",!0)}}}),Wa=$n(Va,[["__scopeId","data-v-317c0ff8"]]),Qa=["id"],Ga={key:0,class:"note-recall note-base"},Ka={key:1,class:"note-ban note-base"},Ja={key:1},Ya={key:2,class:"note-recall note-base"},Xa=["innerHTML"],Za={key:4,class:"note-time note-base"},Ht=Bt({name:"NoticeBody",__name:"NoticeBody",props:["data","id"],emits:["reedit"],setup(n){const f=Fn.global.t,D=En(),r=xn(),e=n,t=Si(),l=ge(e.data);function u(i){return D.loginInfo.uin===i}function w(i){const a=r.chatInfo.info.group_members.filter(o=>o.user_id===i);return a.length===1?a[0].card===""||a[0].card==null?a[0].nickname:a[0].card:i}function L(i){const a=Math.floor(i/86400),o=Math.floor(i%86400/3600),d=Math.floor(i%3600/60),g=i%60;let R="";return a>0&&(R+=`${a} ${f("天")} `),o>0&&(R+=`${o} ${f("小时")} `),d>0&&(R+=`${d} ${f("分钟")} `),g>0&&(R+=`${g} ${f("秒")} `),R}return cn(async()=>{var a;let i=null;if(i=await bt.call(void 0,"win:getWindowInfo",!0),l.value.notice_type&&l.value.notice_type.indexOf("recall")>=0)if(r.chatInfo.show.type==="group"){const o=l.value.operator_id;if(r.chatInfo.info.group_members!==void 0){const d=r.chatInfo.info.group_members.filter(g=>g.user_id===Number(o));d.length===1?l.value.name=d[0].card===""||d[0].card==null?d[0].nickname:d[0].card:l.value.name=o}else l.value.name=o}else l.value.name=r.chatInfo.show.name;if(l.value.sub_type==="poke"&&l.value.pokeMe&&l.value==r.messageList[r.messageList.length-1]){let o=document.getElementById("app");bt.isDesktop()&&(o=(a=document.getElementById("notice-"+e.id))==null?void 0:a.getElementsByClassName("space")[0]),po(o,i)}}),(i,a)=>(W(),ee("div",{id:"notice-"+n.id,class:"note"},[n.data.notice_type&&n.data.notice_type.indexOf("recall")>=0?(W(),ee("div",Ga,[y("a",null,K(l.value.name),1),y("span",null,K(B(f)("撤回了一条消息")),1),a[1]||(a[1]=y("div",null,null,-1)),n.data.originMsg?(W(),ee("a",{key:0,onClick:a[0]||(a[0]=o=>i.$emit("reedit",n.data.originMsg))},K(B(f)("重新编辑")),1)):me("",!0)])):n.data.notice_type=="group_ban"?(W(),ee("div",Ka,[n.data.sub_type==="ban"?(W(),ee(Ie,{key:0},[u(n.data.user_id)?(W(),ee(Ie,{key:0},[y("span",null,K(B(f)("成员类型_admin")),1),y("a",null," "+K(w(n.data.operator_id))+" ",1),y("span",null,K(B(f)("禁言了你")),1),y("span",null," "+K(L(n.data.duration)),1)],64)):(W(),ee(Ie,{key:1},[y("span",null,K(B(f)("管理员禁言了")),1),y("a",null," "+K(w(n.data.user_id))+" ",1),y("span",null,K(L(n.data.duration)),1)],64))],64)):(W(),ee("span",Ja,K(B(f)("管理员解除了 {name} 的禁言",{name:u(n.data.user_id)?B(f)("你"):w(n.data.user_id)})),1))])):n.data.sub_type==="delete"?(W(),ee("div",Ya,[y("span",null,K(B(f)("这条消息迷失在虚空里了")),1),a[2]||(a[2]=y("div",null,null,-1))])):n.data.sub_type==="poke"?(W(),ee("div",{key:3,class:"note-notify note-base",innerHTML:n.data.str+"<div class='space'</div>"},null,8,Xa)):n.data.sub_type==="time"&&n.data.time!=null?(W(),ee("div",Za,[y("a",null,K(Intl.DateTimeFormat(B(t),B(Ci)(new Date(n.data.time*1e3))).format(new Date(n.data.time*1e3))),1)])):me("",!0)],8,Qa))}}),es=["src","alt"],ts=Bt({__name:"CustomFaceTooltip",props:{url:{}},setup(n){return(f,D)=>(W(),ee("img",{src:n.url,alt:f.$t("预览图片加载失败"),class:"custom-face-tooltip"},null,8,es))}}),ns=$n(ts,[["__scopeId","data-v-28512f0d"]]),is={class:"ss-card face-pan"},os={icon:"fa-solid fa-face-laugh-squint"},as={class:"system-face-bar"},ss={class:"title"},rs={class:"face"},ls={class:"title"},us={class:"face"},cs={icon:"fa-solid fa-heart"},fs={class:"title"},ds={class:"face"},hs=["src","alt","onClick"],ms={class:"title"},gs={class:"face"},vs={key:0,class:"ss-card"},ps=["src","alt","onClick"],ys={key:0,icon:"fa-solid fa-folder-open"},ws={class:"system-face-bar custom-face-bar"},bs={class:"title"},ks={class:"face"},Is=["src","alt","onClick"],_s={class:"title"},Ss={class:"face"},Cs={key:0,class:"ss-card"},Ms={key:1,class:"ss-card"},As=["src","alt","onClick"],Ts=Bt({__name:"FacePan",emits:["addSpecialMsg","sendMsg"],setup(n,{emit:f}){const{recordList:D,showList:r}=p("recent-emojis-id"),{recordList:e,showList:t}=p("recent-custom-faces-id"),{recordList:l,showList:u}=p("recent-local-faces-id"),w=Ut(()=>{const _=[];for(const S of u.value){const A=g.value.find(I=>I.path===S);A&&_.push(A)}return _}),L=new ut,i=yo(),a=Kn(),o=En(),d=di(1),g=di([]),R=f;i.stickerCache&&i.stickerCache.length==0&&o.jsonMap.roaming_stamp&&G(),bt.isDesktop()&&a.sysConfig.local_emoji_folder&&M();function k(_,S){R("addSpecialMsg",{addText:S,msgObj:_})}function T(_){v(D,_),_<5e3?k({type:"face",id:_},!0):k({type:"text",text:rn.get(_).value},!0)}function G(){i.stickerCache=void 0,o.jsonMap.roaming_stamp.pagerType=="full"?it.send(o.jsonMap.roaming_stamp.name,{count:48},"getRoamingStamp_48"):it.send(o.jsonMap.roaming_stamp.name,{},"getRoamingStamp")}function P(_){const S=_.target;if(S.scrollHeight-S.scrollTop<S.clientHeight+.5&&i.stickerCache&&o.jsonMap.roaming_stamp.pagerType=="full"&&i.stickerCache[i.stickerCache.length-1]!="end"){const A=48+48*d.value;it.send(o.jsonMap.roaming_stamp.name,{count:A},"getRoamingStamp_"+A),d.value++}}function x(_){v(e,_),k({type:"image",file:_,subType:1},!0),a.sysConfig.send_face==!0&&R("sendMsg")}async function q(){const{$t:_}=Jt.config.globalProperties;try{const S=await bt.call(void 0,"sys:selectFolder",!0);S&&(Ai.save("local_emoji_folder",S),L.add(Be.INFO,_("已设置本地表情文件夹")),M())}catch{L.add(Be.ERR,_("选择文件夹失败"))}}async function M(){try{const _=a.sysConfig.local_emoji_folder;if(!_){g.value=[];return}const S=await bt.call(void 0,"sys:getLocalEmojis",!0,_);if(S&&Array.isArray(S))if(bt.type==="tauri"){const{convertFileSrc:A}=await Mi(async()=>{const{convertFileSrc:I}=await import("./core-DhEqZVGG.js");return{convertFileSrc:I}},[],import.meta.url);g.value=S.map(I=>({name:I.name,path:I.path,url:A(I.path)}))}else g.value=S.map(A=>({name:A.name,path:A.path,url:A.url}));else g.value=[]}catch{g.value=[]}}async function N(_){try{const S=await bt.call(void 0,"sys:readFileAsBase64",!0,_.path);v(l,_.path),k({type:"image",file:"base64://"+S,subType:1},!0),a.sysConfig.send_face==!0&&R("sendMsg")}catch{const{$t:A}=Jt.config.globalProperties;L.add(Be.ERR,A("添加本地表情失败"))}}function p(_){const S=wo(_,[]),A=Ut(()=>{if(a.sysConfig.record_recent_emoji==="none")return[];if(a.sysConfig.record_recent_emoji==="order")return S.value.slice(0,30);{const I=new Map;for(const $ of S.value)I.set($,(I.get($)||0)+1);return Array.from(I.entries()).sort(($,m)=>m[1]-$[1]).map($=>$[0]).slice(0,30)}});return{recordList:S,showList:A}}function v(_,S){if(a.sysConfig.record_recent_emoji==="none")return;let A;switch(a.sysConfig.record_recent_emoji){case"order":A=30;break;case"100times":A=100;break;case"500times":A=500;break;default:throw new Error("Invalid recent emoji record setting")}const I=_.value;if(a.sysConfig.record_recent_emoji==="order"){const $=I.indexOf(S);$!==-1&&I.splice($,1)}I.unshift(S),I.length>A&&I.pop(),_.value=I}function F(_){return{comp:ns,model:void 0,props:{url:_}}}return(_,S)=>{const A=Ln("font-awesome-icon");return W(),ee("div",is,[ie(B(Ii),null,{default:It(()=>[y("div",os,[y("div",as,[B(r).length>0?(W(),ee(Ie,{key:0},[y("div",ss,[y("span",null,K(_.$t("最近使用")),1)]),y("div",rs,[(W(!0),ee(Ie,null,vt(B(r),I=>(W(),ee("div",{key:I},[ie(Wn,{emoji:B(rn).get(I),onClick:$=>T(I)},null,8,["emoji","onClick"])]))),128))])],64)):me("",!0),y("div",ls,[y("span",null,K(_.$t("emoji 表情")),1)]),y("div",us,[(W(!0),ee(Ie,null,vt(B(rn).emojiList,I=>(W(),ee("div",{key:I},[ie(Wn,{emoji:B(rn).get(I),onClick:$=>T(I)},null,8,["emoji","onClick"])]))),128))])])]),y("div",cs,[y("div",{class:"system-face-bar custom-face-bar",onScroll:P},[B(t).length>0?(W(),ee(Ie,{key:0},[y("div",fs,[y("span",null,K(_.$t("最近使用")),1)]),y("div",ds,[(W(!0),ee(Ie,null,vt(B(t),(I,$)=>Ce((W(),ee("span",{key:$},[y("img",{loading:"lazy",src:I,alt:"["+_.$t("动画表情")+"]",onClick:m=>x(I)},null,8,hs)])),[[B(gn),F(I)]])),128))])],64)):me("",!0),y("div",ms,[y("span",null,K(_.$t("收藏的表情")),1),ie(A,{icon:["fas","fa-rotate-right"],onClick:G})]),y("div",gs,[B(i).stickerCache&&B(i).stickerCache.length<=0?(W(),ee("div",vs,[ie(A,{icon:["fas","face-dizzy"]}),y("span",null,K(_.$t("一无所有")),1)])):B(i).stickerCache&&B(i).stickerCache.length>0?(W(!0),ee(Ie,{key:1},vt(B(i).stickerCache,(I,$)=>(W(),ee("span",{key:"stickers-"+$},[Ce(y("img",{loading:"lazy",src:I,alt:"["+_.$t("动画表情")+"]",onClick:m=>x(I)},null,8,ps),[[Ze,I!="end"],[B(gn),F(I)]])]))),128)):me("",!0)])],32)]),B(bt).isDesktop()?(W(),ee("div",ys,[y("div",ws,[w.value.length>0?(W(),ee(Ie,{key:0},[y("div",bs,[y("span",null,K(_.$t("最近使用")),1)]),y("div",ks,[(W(!0),ee(Ie,null,vt(w.value,(I,$)=>(W(),ee("span",{key:$},[Ce(y("img",{loading:"lazy",src:I.url,alt:"["+_.$t("动画表情")+"]",onClick:m=>N(I)},null,8,Is),[[B(gn),F(I.url)]])]))),128))])],64)):me("",!0),y("div",_s,[y("span",null,K(_.$t("本地表情")),1),ie(A,{icon:["fas","fa-folder-plus"],title:_.$t("选择文件夹"),onClick:q},null,8,["title"]),B(a).sysConfig.local_emoji_folder?(W(),Me(A,{key:0,icon:["fas","fa-rotate-right"],title:_.$t("重新加载"),onClick:M},null,8,["title"])):me("",!0)]),y("div",Ss,[B(a).sysConfig.local_emoji_folder?B(a).sysConfig.local_emoji_folder&&g.value.length<=0?(W(),ee("div",Ms,[ie(A,{icon:["fas","face-dizzy"]}),y("span",null,K(_.$t("暂无图片")),1)])):B(a).sysConfig.local_emoji_folder&&g.value.length>0?(W(!0),ee(Ie,{key:2},vt(g.value,(I,$)=>(W(),ee("span",{key:$},[Ce(y("img",{loading:"lazy",src:I.url,alt:"["+_.$t("动画表情")+"]",onClick:m=>N(I)},null,8,As),[[B(gn),F(I.url)]])]))),128)):me("",!0):(W(),ee("div",Cs,[ie(A,{icon:["fas","folder-open"]}),y("span",null,K(_.$t("选择文件夹")),1)]))])])])):me("",!0)]),_:1})])}}}),Es={class:"ss-card"},xs={key:0},Fs=Bt({name:"MergePan",__name:"MergePan",setup(n,{expose:f}){const D=Fn.global.t,r=xn(),e=Kn(),t=r.mergeMsgStack,l=ge(),u=Ut(()=>{var a;return Vn.fromList((((a=l.value)==null?void 0:a.imageList)??[]).map(o=>o.img_url))});function w(){t.length--}function L(){t.length=0}function i(){return t.length>0}return f({closeMergeMsg:L,isMergeOpen:i}),cn(()=>{_t(()=>r.mergeMsgStack.length,()=>{t.length===0?r.mergeMessageImgList=void 0:l.value=t.at(-1)}),_t(()=>{var a;return(a=l.value)==null?void 0:a.imageList},()=>{var a;r.mergeMsgStack.length===0||((a=l.value)==null?void 0:a.imageList)===void 0||(r.mergeMessageImgList=l.value.imageList)})}),(a,o)=>{const d=Ln("font-awesome-icon");return W(),ee("div",{class:gt("merge-pan"+(B(r).mergeMsgStack.length>0?" show":""))},[y("div",{onClick:L}),y("div",Es,[y("div",null,[ie(d,{style:{"margin-top":"5px"},icon:["fas","message"]}),y("span",null,K(B(D)("合并消息")),1),B(t).length<=1?(W(),Me(d,{key:0,icon:["fas","xmark"],onClick:w})):(W(),Me(d,{key:1,icon:["fas","angles-left"],onClick:w}))]),l.value===void 0?(W(),ee("div",xs)):(W(),Me(qn,{key:1,name:B(e).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:It(()=>[(W(!0),ee(Ie,null,vt(l.value.messageList,(g,R)=>(W(),ee(Ie,{key:"merge-"+l.value.forwardMsg.message[0].id+"-"+R},[B(jn)(l.value.messageList[R-1]?l.value.messageList[R-1].time:void 0,g.time,R==0)?(W(),Me(Ht,{id:B(Ti)(),key:"notice-time-"+R,data:{sub_type:"time",time:g.time}},null,8,["id","data"])):B(Ei)(g)?(W(),Me(Ht,{key:"delete-"+g.message_id,data:{sub_type:"delete"}})):me("",!0),ie(ln,{data:g,type:"merge","image-list-header":u.value},null,8,["data","image-list-header"])],64))),128))]),_:1},8,["name"]))])],2)}}}),Ls=$n(Fs,[["__scopeId","data-v-5a030688"]]);function $s(n,f){return f.forEach((function(D){D&&typeof D!="string"&&!Array.isArray(D)&&Object.keys(D).forEach((function(r){if(r!=="default"&&!(r in n)){var e=Object.getOwnPropertyDescriptor(D,r);Object.defineProperty(n,r,e.get?e:{enumerable:!0,get:function(){return D[r]}})}}))})),Object.freeze(n)}function $i(n,f){return new Promise((function(D,r){let e;return Rs(n).then((function(t){try{return e=t,D(new Blob([f.slice(0,2),e,f.slice(2)],{type:"image/jpeg"}))}catch(l){return r(l)}}),r)}))}const Rs=n=>new Promise(((f,D)=>{const r=new FileReader;r.addEventListener("load",(({target:{result:e}})=>{const t=new DataView(e);let l=0;if(t.getUint16(l)!==65496)return D("not a valid JPEG");for(l+=2;;){const u=t.getUint16(l);if(u===65498)break;const w=t.getUint16(l+2);if(u===65505&&t.getUint32(l+4)===1165519206){const L=l+10;let i;switch(t.getUint16(L)){case 18761:i=!0;break;case 19789:i=!1;break;default:return D("TIFF header contains invalid endian")}if(t.getUint16(L+2,i)!==42)return D("TIFF header contains invalid version");const a=t.getUint32(L+4,i),o=L+a+2+12*t.getUint16(L+a,i);for(let d=L+a+2;d<o;d+=12)if(t.getUint16(d,i)==274){if(t.getUint16(d+2,i)!==3)return D("Orientation data type is invalid");if(t.getUint32(d+4,i)!==1)return D("Orientation data count is invalid");t.setUint16(d+8,1,i);break}return f(e.slice(l,l+2+w))}l+=2+w}return f(new Blob)})),r.readAsArrayBuffer(n)}));var Cn={},Ds={get exports(){return Cn},set exports(n){Cn=n}};(function(n){var f,D,r={};Ds.exports=r,r.parse=function(e,t){for(var l=r.bin.readUshort,u=r.bin.readUint,w=0,L={},i=new Uint8Array(e),a=i.length-4;u(i,a)!=101010256;)a--;w=a,w+=4;var o=l(i,w+=4);l(i,w+=2);var d=u(i,w+=2),g=u(i,w+=4);w+=4,w=g;for(var R=0;R<o;R++){u(i,w),w+=4,w+=4,w+=4,u(i,w+=4),d=u(i,w+=4);var k=u(i,w+=4),T=l(i,w+=4),G=l(i,w+2),P=l(i,w+4);w+=6;var x=u(i,w+=8);w+=4,w+=T+G+P,r._readLocal(i,x,L,d,k,t)}return L},r._readLocal=function(e,t,l,u,w,L){var i=r.bin.readUshort,a=r.bin.readUint;a(e,t),i(e,t+=4),i(e,t+=2);var o=i(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var d=i(e,t+=8),g=i(e,t+=2);t+=2;var R=r.bin.readUTF8(e,t,d);if(t+=d,t+=g,L)l[R]={size:w,csize:u};else{var k=new Uint8Array(e.buffer,t);if(o==0)l[R]=new Uint8Array(k.buffer.slice(t,t+u));else{if(o!=8)throw"unknown compression method: "+o;var T=new Uint8Array(w);r.inflateRaw(k,T),l[R]=T}}},r.inflateRaw=function(e,t){return r.F.inflate(e,t)},r.inflate=function(e,t){return e[0],e[1],r.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},r.deflate=function(e,t){t==null&&(t={level:6});var l=0,u=new Uint8Array(50+Math.floor(1.1*e.length));u[l]=120,u[l+1]=156,l+=2,l=r.F.deflateRaw(e,u,l,t.level);var w=r.adler(e,0,e.length);return u[l+0]=w>>>24&255,u[l+1]=w>>>16&255,u[l+2]=w>>>8&255,u[l+3]=w>>>0&255,new Uint8Array(u.buffer,0,l+4)},r.deflateRaw=function(e,t){t==null&&(t={level:6});var l=new Uint8Array(50+Math.floor(1.1*e.length)),u=r.F.deflateRaw(e,l,u,t.level);return new Uint8Array(l.buffer,0,u)},r.encode=function(e,t){t==null&&(t=!1);var l=0,u=r.bin.writeUint,w=r.bin.writeUshort,L={};for(var i in e){var a=!r._noNeed(i)&&!t,o=e[i],d=r.crc.crc(o,0,o.length);L[i]={cpr:a,usize:o.length,crc:d,file:a?r.deflateRaw(o):o}}for(var i in L)l+=L[i].file.length+30+46+2*r.bin.sizeUTF8(i);l+=22;var g=new Uint8Array(l),R=0,k=[];for(var i in L){var T=L[i];k.push(R),R=r._writeHeader(g,R,i,T,0)}var G=0,P=R;for(var i in L)T=L[i],k.push(R),R=r._writeHeader(g,R,i,T,1,k[G++]);var x=R-P;return u(g,R,101010256),R+=4,w(g,R+=4,G),w(g,R+=2,G),u(g,R+=2,x),u(g,R+=4,P),R+=4,R+=2,g.buffer},r._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(t)!=-1},r._writeHeader=function(e,t,l,u,w,L){var i=r.bin.writeUint,a=r.bin.writeUshort,o=u.file;return i(e,t,w==0?67324752:33639248),t+=4,w==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,u.cpr?8:0),i(e,t+=2,0),i(e,t+=4,u.crc),i(e,t+=4,o.length),i(e,t+=4,u.usize),a(e,t+=4,r.bin.sizeUTF8(l)),a(e,t+=2,0),t+=2,w==1&&(t+=2,t+=2,i(e,t+=6,L),t+=4),t+=r.bin.writeUTF8(e,t,l),w==0&&(e.set(o,t),t+=o.length),t},r.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var l=t,u=0;u<8;u++)1&l?l=3988292384^l>>>1:l>>>=1;e[t]=l}return e})(),update:function(e,t,l,u){for(var w=0;w<u;w++)e=r.crc.table[255&(e^t[l+w])]^e>>>8;return e},crc:function(e,t,l){return 4294967295^r.crc.update(4294967295,e,t,l)}},r.adler=function(e,t,l){for(var u=1,w=0,L=t,i=t+l;L<i;){for(var a=Math.min(L+5552,i);L<a;)w+=u+=e[L++];u%=65521,w%=65521}return w<<16|u},r.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,l){e[t]=255&l,e[t+1]=l>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,l){e[t]=255&l,e[t+1]=l>>8&255,e[t+2]=l>>16&255,e[t+3]=l>>24&255},readASCII:function(e,t,l){for(var u="",w=0;w<l;w++)u+=String.fromCharCode(e[t+w]);return u},writeASCII:function(e,t,l){for(var u=0;u<l.length;u++)e[t+u]=l.charCodeAt(u)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,l){for(var u,w="",L=0;L<l;L++)w+="%"+r.bin.pad(e[t+L].toString(16));try{u=decodeURIComponent(w)}catch{return r.bin.readASCII(e,t,l)}return u},writeUTF8:function(e,t,l){for(var u=l.length,w=0,L=0;L<u;L++){var i=l.charCodeAt(L);if((4294967168&i)==0)e[t+w]=i,w++;else if((4294965248&i)==0)e[t+w]=192|i>>6,e[t+w+1]=128|i>>0&63,w+=2;else if((4294901760&i)==0)e[t+w]=224|i>>12,e[t+w+1]=128|i>>6&63,e[t+w+2]=128|i>>0&63,w+=3;else{if((4292870144&i)!=0)throw"e";e[t+w]=240|i>>18,e[t+w+1]=128|i>>12&63,e[t+w+2]=128|i>>6&63,e[t+w+3]=128|i>>0&63,w+=4}}return w},sizeUTF8:function(e){for(var t=e.length,l=0,u=0;u<t;u++){var w=e.charCodeAt(u);if((4294967168&w)==0)l++;else if((4294965248&w)==0)l+=2;else if((4294901760&w)==0)l+=3;else{if((4292870144&w)!=0)throw"e";l+=4}}return l}},r.F={},r.F.deflateRaw=function(e,t,l,u){var w=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][u],L=r.F.U,i=r.F._goodIndex;r.F._hash;var a=r.F._putsE,o=0,d=l<<3,g=0,R=e.length;if(u==0){for(;o<R;)a(t,d,o+(_=Math.min(65535,R-o))==R?1:0),d=r.F._copyExact(e,o,_,t,d+8),o+=_;return d>>>3}var k=L.lits,T=L.strt,G=L.prev,P=0,x=0,q=0,M=0,N=0,p=0;for(R>2&&(T[p=r.F._hash(e,0)]=0),o=0;o<R;o++){if(N=p,o+1<R-2){p=r.F._hash(e,o+1);var v=o+1&32767;G[v]=T[p],T[p]=v}if(g<=o){(P>14e3||x>26697)&&R-o>100&&(g<o&&(k[P]=o-g,P+=2,g=o),d=r.F._writeBlock(o==R-1||g==R?1:0,k,P,M,e,q,o-q,t,d),P=x=M=0,q=o);var F=0;o<R-2&&(F=r.F._bestMatch(e,o,G,N,Math.min(w[2],R-o),w[3]));var _=F>>>16,S=65535&F;if(F!=0){S=65535&F;var A=i(_=F>>>16,L.of0);L.lhst[257+A]++;var I=i(S,L.df0);L.dhst[I]++,M+=L.exb[A]+L.dxb[I],k[P]=_<<23|o-g,k[P+1]=S<<16|A<<8|I,P+=2,g=o+_}else L.lhst[e[o]]++;x++}}for(q==o&&e.length!=0||(g<o&&(k[P]=o-g,P+=2,g=o),d=r.F._writeBlock(1,k,P,M,e,q,o-q,t,d),P=0,x=0,P=x=M=0,q=o);(7&d)!=0;)d++;return d>>>3},r.F._bestMatch=function(e,t,l,u,w,L){var i=32767&t,a=l[i],o=i-a+32768&32767;if(a==i||u!=r.F._hash(e,t-o))return 0;for(var d=0,g=0,R=Math.min(32767,t);o<=R&&--L!=0&&a!=i;){if(d==0||e[t+d]==e[t+d-o]){var k=r.F._howLong(e,t,o);if(k>d){if(g=o,(d=k)>=w)break;o+2<k&&(k=o+2);for(var T=0,G=0;G<k-2;G++){var P=t-o+G+32768&32767,x=P-l[P]+32768&32767;x>T&&(T=x,a=P)}}}o+=(i=a)-(a=l[i])+32768&32767}return d<<16|g},r.F._howLong=function(e,t,l){if(e[t]!=e[t-l]||e[t+1]!=e[t+1-l]||e[t+2]!=e[t+2-l])return 0;var u=t,w=Math.min(e.length,t+258);for(t+=3;t<w&&e[t]==e[t-l];)t++;return t-u},r.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(e,t,l,u,w,L,i,a,o){var d,g,R,k,T,G,P,x,q,M=r.F.U,N=r.F._putsF,p=r.F._putsE;M.lhst[256]++,g=(d=r.F.getTrees())[0],R=d[1],k=d[2],T=d[3],G=d[4],P=d[5],x=d[6],q=d[7];var v=32+((o+3&7)==0?0:8-(o+3&7))+(i<<3),F=u+r.F.contSize(M.fltree,M.lhst)+r.F.contSize(M.fdtree,M.dhst),_=u+r.F.contSize(M.ltree,M.lhst)+r.F.contSize(M.dtree,M.dhst);_+=14+3*P+r.F.contSize(M.itree,M.ihst)+(2*M.ihst[16]+3*M.ihst[17]+7*M.ihst[18]);for(var S=0;S<286;S++)M.lhst[S]=0;for(S=0;S<30;S++)M.dhst[S]=0;for(S=0;S<19;S++)M.ihst[S]=0;var A=v<F&&v<_?0:F<_?1:2;if(N(a,o,e),N(a,o+1,A),o+=3,A==0){for(;(7&o)!=0;)o++;o=r.F._copyExact(w,L,i,a,o)}else{var I,$;if(A==1&&(I=M.fltree,$=M.fdtree),A==2){r.F.makeCodes(M.ltree,g),r.F.revCodes(M.ltree,g),r.F.makeCodes(M.dtree,R),r.F.revCodes(M.dtree,R),r.F.makeCodes(M.itree,k),r.F.revCodes(M.itree,k),I=M.ltree,$=M.dtree,p(a,o,T-257),p(a,o+=5,G-1),p(a,o+=5,P-4),o+=4;for(var m=0;m<P;m++)p(a,o+3*m,M.itree[1+(M.ordr[m]<<1)]);o+=3*P,o=r.F._codeTiny(x,M.itree,a,o),o=r.F._codeTiny(q,M.itree,a,o)}for(var h=L,O=0;O<l;O+=2){for(var C=t[O],z=C>>>23,Q=h+(8388607&C);h<Q;)o=r.F._writeLit(w[h++],I,a,o);if(z!=0){var Y=t[O+1],ne=Y>>16,X=Y>>8&255,j=255&Y;p(a,o=r.F._writeLit(257+X,I,a,o),z-M.of0[X]),o+=M.exb[X],N(a,o=r.F._writeLit(j,$,a,o),ne-M.df0[j]),o+=M.dxb[j],h+=z}}o=r.F._writeLit(256,I,a,o)}return o},r.F._copyExact=function(e,t,l,u,w){var L=w>>>3;return u[L]=l,u[L+1]=l>>>8,u[L+2]=255-u[L],u[L+3]=255-u[L+1],L+=4,u.set(new Uint8Array(e.buffer,t,l),L),w+(l+4<<3)},r.F.getTrees=function(){for(var e=r.F.U,t=r.F._hufTree(e.lhst,e.ltree,15),l=r.F._hufTree(e.dhst,e.dtree,15),u=[],w=r.F._lenCodes(e.ltree,u),L=[],i=r.F._lenCodes(e.dtree,L),a=0;a<u.length;a+=2)e.ihst[u[a]]++;for(a=0;a<L.length;a+=2)e.ihst[L[a]]++;for(var o=r.F._hufTree(e.ihst,e.itree,7),d=19;d>4&&e.itree[1+(e.ordr[d-1]<<1)]==0;)d--;return[t,l,o,w,i,d,u,L]},r.F.getSecond=function(e){for(var t=[],l=0;l<e.length;l+=2)t.push(e[l+1]);return t},r.F.nonZero=function(e){for(var t="",l=0;l<e.length;l+=2)e[l+1]!=0&&(t+=(l>>1)+",");return t},r.F.contSize=function(e,t){for(var l=0,u=0;u<t.length;u++)l+=t[u]*e[1+(u<<1)];return l},r.F._codeTiny=function(e,t,l,u){for(var w=0;w<e.length;w+=2){var L=e[w],i=e[w+1];u=r.F._writeLit(L,t,l,u);var a=L==16?2:L==17?3:7;L>15&&(r.F._putsE(l,u,i,a),u+=a)}return u},r.F._lenCodes=function(e,t){for(var l=e.length;l!=2&&e[l-1]==0;)l-=2;for(var u=0;u<l;u+=2){var w=e[u+1],L=u+3<l?e[u+3]:-1,i=u+5<l?e[u+5]:-1,a=u==0?-1:e[u-1];if(w==0&&L==w&&i==w){for(var o=u+5;o+2<l&&e[o+2]==w;)o+=2;(d=Math.min(o+1-u>>>1,138))<11?t.push(17,d-3):t.push(18,d-11),u+=2*d-2}else if(w==a&&L==w&&i==w){for(o=u+5;o+2<l&&e[o+2]==w;)o+=2;var d=Math.min(o+1-u>>>1,6);t.push(16,d-3),u+=2*d-2}else t.push(w,0)}return l>>>1},r.F._hufTree=function(e,t,l){var u=[],w=e.length,L=t.length,i=0;for(i=0;i<L;i+=2)t[i]=0,t[i+1]=0;for(i=0;i<w;i++)e[i]!=0&&u.push({lit:i,f:e[i]});var a=u.length,o=u.slice(0);if(a==0)return 0;if(a==1){var d=u[0].lit;return o=d==0?1:0,t[1+(d<<1)]=1,t[1+(o<<1)]=1,1}u.sort((function(x,q){return x.f-q.f}));var g=u[0],R=u[1],k=0,T=1,G=2;for(u[0]={lit:-1,f:g.f+R.f,l:g,r:R,d:0};T!=a-1;)g=k!=T&&(G==a||u[k].f<u[G].f)?u[k++]:u[G++],R=k!=T&&(G==a||u[k].f<u[G].f)?u[k++]:u[G++],u[T++]={lit:-1,f:g.f+R.f,l:g,r:R};var P=r.F.setDepth(u[T-1],0);for(P>l&&(r.F.restrictDepth(o,l,P),P=l),i=0;i<a;i++)t[1+(o[i].lit<<1)]=o[i].d;return P},r.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(r.F.setDepth(e.l,t+1),r.F.setDepth(e.r,t+1))},r.F.restrictDepth=function(e,t,l){var u=0,w=1<<l-t,L=0;for(e.sort((function(a,o){return o.d==a.d?a.f-o.f:o.d-a.d})),u=0;u<e.length&&e[u].d>t;u++){var i=e[u].d;e[u].d=t,L+=w-(1<<l-i)}for(L>>>=l-t;L>0;)(i=e[u].d)<t?(e[u].d++,L-=1<<t-i-1):u++;for(;u>=0;u--)e[u].d==t&&L<0&&(e[u].d--,L++);L!=0&&console.log("debt left")},r.F._goodIndex=function(e,t){var l=0;return t[16|l]<=e&&(l|=16),t[8|l]<=e&&(l|=8),t[4|l]<=e&&(l|=4),t[2|l]<=e&&(l|=2),t[1|l]<=e&&(l|=1),l},r.F._writeLit=function(e,t,l,u){return r.F._putsF(l,u,t[e<<1]),u+t[1+(e<<1)]},r.F.inflate=function(e,t){var l=Uint8Array;if(e[0]==3&&e[1]==0)return t||new l(0);var u=r.F,w=u._bitsF,L=u._bitsE,i=u._decodeTiny,a=u.makeCodes,o=u.codes2map,d=u._get17,g=u.U,R=t==null;R&&(t=new l(e.length>>>2<<3));for(var k,T,G=0,P=0,x=0,q=0,M=0,N=0,p=0,v=0,F=0;G==0;)if(G=w(e,F,1),P=w(e,F+1,2),F+=3,P!=0){if(R&&(t=r.F._check(t,v+(1<<17))),P==1&&(k=g.flmap,T=g.fdmap,N=511,p=31),P==2){x=L(e,F,5)+257,q=L(e,F+5,5)+1,M=L(e,F+10,4)+4,F+=14;for(var _=0;_<38;_+=2)g.itree[_]=0,g.itree[_+1]=0;var S=1;for(_=0;_<M;_++){var A=L(e,F+3*_,3);g.itree[1+(g.ordr[_]<<1)]=A,A>S&&(S=A)}F+=3*M,a(g.itree,S),o(g.itree,S,g.imap),k=g.lmap,T=g.dmap,F=i(g.imap,(1<<S)-1,x+q,e,F,g.ttree);var I=u._copyOut(g.ttree,0,x,g.ltree);N=(1<<I)-1;var $=u._copyOut(g.ttree,x,q,g.dtree);p=(1<<$)-1,a(g.ltree,I),o(g.ltree,I,k),a(g.dtree,$),o(g.dtree,$,T)}for(;;){var m=k[d(e,F)&N];F+=15&m;var h=m>>>4;if(!(h>>>8))t[v++]=h;else{if(h==256)break;var O=v+h-254;if(h>264){var C=g.ldef[h-257];O=v+(C>>>3)+L(e,F,7&C),F+=7&C}var z=T[d(e,F)&p];F+=15&z;var Q=z>>>4,Y=g.ddef[Q],ne=(Y>>>4)+w(e,F,15&Y);for(F+=15&Y,R&&(t=r.F._check(t,v+(1<<17)));v<O;)t[v]=t[v++-ne],t[v]=t[v++-ne],t[v]=t[v++-ne],t[v]=t[v++-ne];v=O}}}else{(7&F)!=0&&(F+=8-(7&F));var X=4+(F>>>3),j=e[X-4]|e[X-3]<<8;R&&(t=r.F._check(t,v+j)),t.set(new l(e.buffer,e.byteOffset+X,j),v),F=X+j<<3,v+=j}return t.length==v?t:t.slice(0,v)},r.F._check=function(e,t){var l=e.length;if(t<=l)return e;var u=new Uint8Array(Math.max(l<<1,t));return u.set(e,0),u},r.F._decodeTiny=function(e,t,l,u,w,L){for(var i=r.F._bitsE,a=r.F._get17,o=0;o<l;){var d=e[a(u,w)&t];w+=15&d;var g=d>>>4;if(g<=15)L[o]=g,o++;else{var R=0,k=0;g==16?(k=3+i(u,w,2),w+=2,R=L[o-1]):g==17?(k=3+i(u,w,3),w+=3):g==18&&(k=11+i(u,w,7),w+=7);for(var T=o+k;o<T;)L[o]=R,o++}}return w},r.F._copyOut=function(e,t,l,u){for(var w=0,L=0,i=u.length>>>1;L<l;){var a=e[L+t];u[L<<1]=0,u[1+(L<<1)]=a,a>w&&(w=a),L++}for(;L<i;)u[L<<1]=0,u[1+(L<<1)]=0,L++;return w},r.F.makeCodes=function(e,t){for(var l,u,w,L,i=r.F.U,a=e.length,o=i.bl_count,d=0;d<=t;d++)o[d]=0;for(d=1;d<a;d+=2)o[e[d]]++;var g=i.next_code;for(l=0,o[0]=0,u=1;u<=t;u++)l=l+o[u-1]<<1,g[u]=l;for(w=0;w<a;w+=2)(L=e[w+1])!=0&&(e[w]=g[L],g[L]++)},r.F.codes2map=function(e,t,l){for(var u=e.length,w=r.F.U.rev15,L=0;L<u;L+=2)if(e[L+1]!=0)for(var i=L>>1,a=e[L+1],o=i<<4|a,d=t-a,g=e[L]<<d,R=g+(1<<d);g!=R;)l[w[g]>>>15-t]=o,g++},r.F.revCodes=function(e,t){for(var l=r.F.U.rev15,u=15-t,w=0;w<e.length;w+=2){var L=e[w]<<t-e[w+1];e[w]=l[L]>>>u}},r.F._putsE=function(e,t,l){l<<=7&t;var u=t>>>3;e[u]|=l,e[u+1]|=l>>>8},r.F._putsF=function(e,t,l){l<<=7&t;var u=t>>>3;e[u]|=l,e[u+1]|=l>>>8,e[u+2]|=l>>>16},r.F._bitsE=function(e,t,l){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<l)-1},r.F._bitsF=function(e,t,l){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<l)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(f=Uint16Array,D=Uint32Array,{next_code:new f(16),bl_count:new f(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new f(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new D(32),flmap:new f(512),fltree:[],fdmap:new f(32),fdtree:[],lmap:new f(32768),ltree:[],ttree:[],dmap:new f(32768),dtree:[],imap:new f(512),itree:[],rev15:new f(32768),lhst:new D(286),dhst:new D(30),ihst:new D(19),lits:new D(15e3),strt:new f(65536),prev:new f(32768)}),(function(){for(var e=r.F.U,t=0;t<32768;t++){var l=t;l=(4278255360&(l=(4042322160&(l=(3435973836&(l=(2863311530&l)>>>1|(1431655765&l)<<1))>>>2|(858993459&l)<<2))>>>4|(252645135&l)<<4))>>>8|(16711935&l)<<8,e.rev15[t]=(l>>>16|l<<16)>>>17}function u(w,L,i){for(;L--!=0;)w.push(0,i)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];u(e.fltree,144,8),u(e.fltree,112,9),u(e.fltree,24,7),u(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),u(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),u(e.itree,19,0),u(e.ltree,286,0),u(e.dtree,30,0),u(e.ttree,320,0)})()})();var Bs=$s({__proto__:null,default:Cn},[Cn]);const Tt=(function(){var n={nextZero(i,a){for(;i[a]!=0;)a++;return a},readUshort:(i,a)=>i[a]<<8|i[a+1],writeUshort(i,a,o){i[a]=o>>8&255,i[a+1]=255&o},readUint:(i,a)=>16777216*i[a]+(i[a+1]<<16|i[a+2]<<8|i[a+3]),writeUint(i,a,o){i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o},readASCII(i,a,o){let d="";for(let g=0;g<o;g++)d+=String.fromCharCode(i[a+g]);return d},writeASCII(i,a,o){for(let d=0;d<o.length;d++)i[a+d]=o.charCodeAt(d)},readBytes(i,a,o){const d=[];for(let g=0;g<o;g++)d.push(i[a+g]);return d},pad:i=>i.length<2?`0${i}`:i,readUTF8(i,a,o){let d,g="";for(let R=0;R<o;R++)g+=`%${n.pad(i[a+R].toString(16))}`;try{d=decodeURIComponent(g)}catch{return n.readASCII(i,a,o)}return d}};function f(i,a,o,d){const g=a*o,R=t(d),k=Math.ceil(a*R/8),T=new Uint8Array(4*g),G=new Uint32Array(T.buffer),{ctype:P}=d,{depth:x}=d,q=n.readUshort;if(P==6){const C=g<<2;if(x==8)for(var M=0;M<C;M+=4)T[M]=i[M],T[M+1]=i[M+1],T[M+2]=i[M+2],T[M+3]=i[M+3];if(x==16)for(M=0;M<C;M++)T[M]=i[M<<1]}else if(P==2){const C=d.tabs.tRNS;if(C==null){if(x==8)for(M=0;M<g;M++){var N=3*M;G[M]=255<<24|i[N+2]<<16|i[N+1]<<8|i[N]}if(x==16)for(M=0;M<g;M++)N=6*M,G[M]=255<<24|i[N+4]<<16|i[N+2]<<8|i[N]}else{var p=C[0];const z=C[1],Q=C[2];if(x==8)for(M=0;M<g;M++){var v=M<<2;N=3*M,G[M]=255<<24|i[N+2]<<16|i[N+1]<<8|i[N],i[N]==p&&i[N+1]==z&&i[N+2]==Q&&(T[v+3]=0)}if(x==16)for(M=0;M<g;M++)v=M<<2,N=6*M,G[M]=255<<24|i[N+4]<<16|i[N+2]<<8|i[N],q(i,N)==p&&q(i,N+2)==z&&q(i,N+4)==Q&&(T[v+3]=0)}}else if(P==3){const C=d.tabs.PLTE,z=d.tabs.tRNS,Q=z?z.length:0;if(x==1)for(var F=0;F<o;F++){var _=F*k,S=F*a;for(M=0;M<a;M++){v=S+M<<2;var A=3*(I=i[_+(M>>3)]>>7-((7&M)<<0)&1);T[v]=C[A],T[v+1]=C[A+1],T[v+2]=C[A+2],T[v+3]=I<Q?z[I]:255}}if(x==2)for(F=0;F<o;F++)for(_=F*k,S=F*a,M=0;M<a;M++)v=S+M<<2,A=3*(I=i[_+(M>>2)]>>6-((3&M)<<1)&3),T[v]=C[A],T[v+1]=C[A+1],T[v+2]=C[A+2],T[v+3]=I<Q?z[I]:255;if(x==4)for(F=0;F<o;F++)for(_=F*k,S=F*a,M=0;M<a;M++)v=S+M<<2,A=3*(I=i[_+(M>>1)]>>4-((1&M)<<2)&15),T[v]=C[A],T[v+1]=C[A+1],T[v+2]=C[A+2],T[v+3]=I<Q?z[I]:255;if(x==8)for(M=0;M<g;M++){var I;v=M<<2,A=3*(I=i[M]),T[v]=C[A],T[v+1]=C[A+1],T[v+2]=C[A+2],T[v+3]=I<Q?z[I]:255}}else if(P==4){if(x==8)for(M=0;M<g;M++){v=M<<2;var $=i[m=M<<1];T[v]=$,T[v+1]=$,T[v+2]=$,T[v+3]=i[m+1]}if(x==16)for(M=0;M<g;M++){var m;v=M<<2,$=i[m=M<<2],T[v]=$,T[v+1]=$,T[v+2]=$,T[v+3]=i[m+2]}}else if(P==0)for(p=d.tabs.tRNS?d.tabs.tRNS:-1,F=0;F<o;F++){const C=F*k,z=F*a;if(x==1)for(var h=0;h<a;h++){var O=($=255*(i[C+(h>>>3)]>>>7-(7&h)&1))==255*p?0:255;G[z+h]=O<<24|$<<16|$<<8|$}else if(x==2)for(h=0;h<a;h++)O=($=85*(i[C+(h>>>2)]>>>6-((3&h)<<1)&3))==85*p?0:255,G[z+h]=O<<24|$<<16|$<<8|$;else if(x==4)for(h=0;h<a;h++)O=($=17*(i[C+(h>>>1)]>>>4-((1&h)<<2)&15))==17*p?0:255,G[z+h]=O<<24|$<<16|$<<8|$;else if(x==8)for(h=0;h<a;h++)O=($=i[C+h])==p?0:255,G[z+h]=O<<24|$<<16|$<<8|$;else if(x==16)for(h=0;h<a;h++)$=i[C+(h<<1)],O=q(i,C+(h<<1))==p?0:255,G[z+h]=O<<24|$<<16|$<<8|$}return T}function D(i,a,o,d){const g=t(i),R=Math.ceil(o*g/8),k=new Uint8Array((R+1+i.interlace)*d);return a=i.tabs.CgBI?e(a,k):r(a,k),i.interlace==0?a=l(a,i,0,o,d):i.interlace==1&&(a=(function(G,P){const x=P.width,q=P.height,M=t(P),N=M>>3,p=Math.ceil(x*M/8),v=new Uint8Array(q*p);let F=0;const _=[0,0,4,0,2,0,1],S=[0,4,0,2,0,1,0],A=[8,8,8,4,4,2,2],I=[8,8,4,4,2,2,1];let $=0;for(;$<7;){const h=A[$],O=I[$];let C=0,z=0,Q=_[$];for(;Q<q;)Q+=h,z++;let Y=S[$];for(;Y<x;)Y+=O,C++;const ne=Math.ceil(C*M/8);l(G,P,F,C,z);let X=0,j=_[$];for(;j<q;){let re=S[$],Re=F+X*ne<<3;for(;re<x;){var m;if(M==1&&(m=(m=G[Re>>3])>>7-(7&Re)&1,v[j*p+(re>>3)]|=m<<7-((7&re)<<0)),M==2&&(m=(m=G[Re>>3])>>6-(7&Re)&3,v[j*p+(re>>2)]|=m<<6-((3&re)<<1)),M==4&&(m=(m=G[Re>>3])>>4-(7&Re)&15,v[j*p+(re>>1)]|=m<<4-((1&re)<<2)),M>=8){const Ae=j*p+re*N;for(let fe=0;fe<N;fe++)v[Ae+fe]=G[(Re>>3)+fe]}Re+=M,re+=O}X++,j+=h}C*z!=0&&(F+=z*(1+ne)),$+=1}return v})(a,i)),a}function r(i,a){return e(new Uint8Array(i.buffer,2,i.length-6),a)}var e=(function(){const i={H:{}};return i.H.N=function(a,o){const d=Uint8Array;let g,R,k=0,T=0,G=0,P=0,x=0,q=0,M=0,N=0,p=0;if(a[0]==3&&a[1]==0)return o||new d(0);const v=i.H,F=v.b,_=v.e,S=v.R,A=v.n,I=v.A,$=v.Z,m=v.m,h=o==null;for(h&&(o=new d(a.length>>>2<<5));k==0;)if(k=F(a,p,1),T=F(a,p+1,2),p+=3,T!=0){if(h&&(o=i.H.W(o,N+(1<<17))),T==1&&(g=m.J,R=m.h,q=511,M=31),T==2){G=_(a,p,5)+257,P=_(a,p+5,5)+1,x=_(a,p+10,4)+4,p+=14;let C=1;for(var O=0;O<38;O+=2)m.Q[O]=0,m.Q[O+1]=0;for(O=0;O<x;O++){const Y=_(a,p+3*O,3);m.Q[1+(m.X[O]<<1)]=Y,Y>C&&(C=Y)}p+=3*x,A(m.Q,C),I(m.Q,C,m.u),g=m.w,R=m.d,p=S(m.u,(1<<C)-1,G+P,a,p,m.v);const z=v.V(m.v,0,G,m.C);q=(1<<z)-1;const Q=v.V(m.v,G,P,m.D);M=(1<<Q)-1,A(m.C,z),I(m.C,z,g),A(m.D,Q),I(m.D,Q,R)}for(;;){const C=g[$(a,p)&q];p+=15&C;const z=C>>>4;if(!(z>>>8))o[N++]=z;else{if(z==256)break;{let Q=N+z-254;if(z>264){const re=m.q[z-257];Q=N+(re>>>3)+_(a,p,7&re),p+=7&re}const Y=R[$(a,p)&M];p+=15&Y;const ne=Y>>>4,X=m.c[ne],j=(X>>>4)+F(a,p,15&X);for(p+=15&X;N<Q;)o[N]=o[N++-j],o[N]=o[N++-j],o[N]=o[N++-j],o[N]=o[N++-j];N=Q}}}}else{(7&p)!=0&&(p+=8-(7&p));const C=4+(p>>>3),z=a[C-4]|a[C-3]<<8;h&&(o=i.H.W(o,N+z)),o.set(new d(a.buffer,a.byteOffset+C,z),N),p=C+z<<3,N+=z}return o.length==N?o:o.slice(0,N)},i.H.W=function(a,o){const d=a.length;if(o<=d)return a;const g=new Uint8Array(d<<1);return g.set(a,0),g},i.H.R=function(a,o,d,g,R,k){const T=i.H.e,G=i.H.Z;let P=0;for(;P<d;){const x=a[G(g,R)&o];R+=15&x;const q=x>>>4;if(q<=15)k[P]=q,P++;else{let M=0,N=0;q==16?(N=3+T(g,R,2),R+=2,M=k[P-1]):q==17?(N=3+T(g,R,3),R+=3):q==18&&(N=11+T(g,R,7),R+=7);const p=P+N;for(;P<p;)k[P]=M,P++}}return R},i.H.V=function(a,o,d,g){let R=0,k=0;const T=g.length>>>1;for(;k<d;){const G=a[k+o];g[k<<1]=0,g[1+(k<<1)]=G,G>R&&(R=G),k++}for(;k<T;)g[k<<1]=0,g[1+(k<<1)]=0,k++;return R},i.H.n=function(a,o){const d=i.H.m,g=a.length;let R,k,T,G;const P=d.j;for(var x=0;x<=o;x++)P[x]=0;for(x=1;x<g;x+=2)P[a[x]]++;const q=d.K;for(R=0,P[0]=0,k=1;k<=o;k++)R=R+P[k-1]<<1,q[k]=R;for(T=0;T<g;T+=2)G=a[T+1],G!=0&&(a[T]=q[G],q[G]++)},i.H.A=function(a,o,d){const g=a.length,R=i.H.m.r;for(let k=0;k<g;k+=2)if(a[k+1]!=0){const T=k>>1,G=a[k+1],P=T<<4|G,x=o-G;let q=a[k]<<x;const M=q+(1<<x);for(;q!=M;)d[R[q]>>>15-o]=P,q++}},i.H.l=function(a,o){const d=i.H.m.r,g=15-o;for(let R=0;R<a.length;R+=2){const k=a[R]<<o-a[R+1];a[R]=d[k]>>>g}},i.H.M=function(a,o,d){d<<=7&o;const g=o>>>3;a[g]|=d,a[g+1]|=d>>>8},i.H.I=function(a,o,d){d<<=7&o;const g=o>>>3;a[g]|=d,a[g+1]|=d>>>8,a[g+2]|=d>>>16},i.H.e=function(a,o,d){return(a[o>>>3]|a[1+(o>>>3)]<<8)>>>(7&o)&(1<<d)-1},i.H.b=function(a,o,d){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)&(1<<d)-1},i.H.Z=function(a,o){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)},i.H.i=function(a,o){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16|a[3+(o>>>3)]<<24)>>>(7&o)},i.H.m=(function(){const a=Uint16Array,o=Uint32Array;return{K:new a(16),j:new a(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new a(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new o(32),J:new a(512),_:[],h:new a(32),$:[],w:new a(32768),C:[],v:[],d:new a(32768),D:[],u:new a(512),Q:[],r:new a(32768),s:new o(286),Y:new o(30),a:new o(19),t:new o(15e3),k:new a(65536),g:new a(32768)}})(),(function(){const a=i.H.m;for(var o=0;o<32768;o++){let g=o;g=(2863311530&g)>>>1|(1431655765&g)<<1,g=(3435973836&g)>>>2|(858993459&g)<<2,g=(4042322160&g)>>>4|(252645135&g)<<4,g=(4278255360&g)>>>8|(16711935&g)<<8,a.r[o]=(g>>>16|g<<16)>>>17}function d(g,R,k){for(;R--!=0;)g.push(0,k)}for(o=0;o<32;o++)a.q[o]=a.S[o]<<3|a.T[o],a.c[o]=a.p[o]<<4|a.z[o];d(a._,144,8),d(a._,112,9),d(a._,24,7),d(a._,8,8),i.H.n(a._,9),i.H.A(a._,9,a.J),i.H.l(a._,9),d(a.$,32,5),i.H.n(a.$,5),i.H.A(a.$,5,a.h),i.H.l(a.$,5),d(a.Q,19,0),d(a.C,286,0),d(a.D,30,0),d(a.v,320,0)})(),i.H.N})();function t(i){return[1,null,3,1,2,null,4][i.ctype]*i.depth}function l(i,a,o,d,g){let R=t(a);const k=Math.ceil(d*R/8);let T,G;R=Math.ceil(R/8);let P=i[o],x=0;if(P>1&&(i[o]=[0,0,1][P-2]),P==3)for(x=R;x<k;x++)i[x+1]=i[x+1]+(i[x+1-R]>>>1)&255;for(let q=0;q<g;q++)if(T=o+q*k,G=T+q+1,P=i[G-1],x=0,P==0)for(;x<k;x++)i[T+x]=i[G+x];else if(P==1){for(;x<R;x++)i[T+x]=i[G+x];for(;x<k;x++)i[T+x]=i[G+x]+i[T+x-R]}else if(P==2)for(;x<k;x++)i[T+x]=i[G+x]+i[T+x-k];else if(P==3){for(;x<R;x++)i[T+x]=i[G+x]+(i[T+x-k]>>>1);for(;x<k;x++)i[T+x]=i[G+x]+(i[T+x-k]+i[T+x-R]>>>1)}else{for(;x<R;x++)i[T+x]=i[G+x]+u(0,i[T+x-k],0);for(;x<k;x++)i[T+x]=i[G+x]+u(i[T+x-R],i[T+x-k],i[T+x-R-k])}return i}function u(i,a,o){const d=i+a-o,g=d-i,R=d-a,k=d-o;return g*g<=R*R&&g*g<=k*k?i:R*R<=k*k?a:o}function w(i,a,o){o.width=n.readUint(i,a),a+=4,o.height=n.readUint(i,a),a+=4,o.depth=i[a],a++,o.ctype=i[a],a++,o.compress=i[a],a++,o.filter=i[a],a++,o.interlace=i[a],a++}function L(i,a,o,d,g,R,k,T,G){const P=Math.min(a,g),x=Math.min(o,R);let q=0,M=0;for(let $=0;$<x;$++)for(let m=0;m<P;m++)if(k>=0&&T>=0?(q=$*a+m<<2,M=(T+$)*g+k+m<<2):(q=(-T+$)*a-k+m<<2,M=$*g+m<<2),G==0)d[M]=i[q],d[M+1]=i[q+1],d[M+2]=i[q+2],d[M+3]=i[q+3];else if(G==1){var N=i[q+3]*.00392156862745098,p=i[q]*N,v=i[q+1]*N,F=i[q+2]*N,_=d[M+3]*(1/255),S=d[M]*_,A=d[M+1]*_,I=d[M+2]*_;const h=1-N,O=N+_*h,C=O==0?0:1/O;d[M+3]=255*O,d[M+0]=(p+S*h)*C,d[M+1]=(v+A*h)*C,d[M+2]=(F+I*h)*C}else if(G==2)N=i[q+3],p=i[q],v=i[q+1],F=i[q+2],_=d[M+3],S=d[M],A=d[M+1],I=d[M+2],N==_&&p==S&&v==A&&F==I?(d[M]=0,d[M+1]=0,d[M+2]=0,d[M+3]=0):(d[M]=p,d[M+1]=v,d[M+2]=F,d[M+3]=N);else if(G==3){if(N=i[q+3],p=i[q],v=i[q+1],F=i[q+2],_=d[M+3],S=d[M],A=d[M+1],I=d[M+2],N==_&&p==S&&v==A&&F==I)continue;if(N<220&&_>20)return!1}return!0}return{decode:function(a){const o=new Uint8Array(a);let d=8;const g=n,R=g.readUshort,k=g.readUint,T={tabs:{},frames:[]},G=new Uint8Array(o.length);let P,x=0,q=0;const M=[137,80,78,71,13,10,26,10];for(var N=0;N<8;N++)if(o[N]!=M[N])throw"The input is not a PNG file!";for(;d<o.length;){const $=g.readUint(o,d);d+=4;const m=g.readASCII(o,d,4);if(d+=4,m=="IHDR")w(o,d,T);else if(m=="iCCP"){for(var p=d;o[p]!=0;)p++;g.readASCII(o,d,p-d),o[p+1];const h=o.slice(p+2,d+$);let O=null;try{O=r(h)}catch{O=e(h)}T.tabs[m]=O}else if(m=="CgBI")T.tabs[m]=o.slice(d,d+4);else if(m=="IDAT"){for(N=0;N<$;N++)G[x+N]=o[d+N];x+=$}else if(m=="acTL")T.tabs[m]={num_frames:k(o,d),num_plays:k(o,d+4)},P=new Uint8Array(o.length);else if(m=="fcTL"){q!=0&&((I=T.frames[T.frames.length-1]).data=D(T,P.slice(0,q),I.rect.width,I.rect.height),q=0);const h={x:k(o,d+12),y:k(o,d+16),width:k(o,d+4),height:k(o,d+8)};let O=R(o,d+22);O=R(o,d+20)/(O==0?100:O);const C={rect:h,delay:Math.round(1e3*O),dispose:o[d+24],blend:o[d+25]};T.frames.push(C)}else if(m=="fdAT"){for(N=0;N<$-4;N++)P[q+N]=o[d+N+4];q+=$-4}else if(m=="pHYs")T.tabs[m]=[g.readUint(o,d),g.readUint(o,d+4),o[d+8]];else if(m=="cHRM")for(T.tabs[m]=[],N=0;N<8;N++)T.tabs[m].push(g.readUint(o,d+4*N));else if(m=="tEXt"||m=="zTXt"){T.tabs[m]==null&&(T.tabs[m]={});var v=g.nextZero(o,d),F=g.readASCII(o,d,v-d),_=d+$-v-1;if(m=="tEXt")A=g.readASCII(o,v+1,_);else{var S=r(o.slice(v+2,v+2+_));A=g.readUTF8(S,0,S.length)}T.tabs[m][F]=A}else if(m=="iTXt"){T.tabs[m]==null&&(T.tabs[m]={}),v=0,p=d,v=g.nextZero(o,p),F=g.readASCII(o,p,v-p);const h=o[p=v+1];var A;o[p+1],p+=2,v=g.nextZero(o,p),g.readASCII(o,p,v-p),p=v+1,v=g.nextZero(o,p),g.readUTF8(o,p,v-p),_=$-((p=v+1)-d),h==0?A=g.readUTF8(o,p,_):(S=r(o.slice(p,p+_)),A=g.readUTF8(S,0,S.length)),T.tabs[m][F]=A}else if(m=="PLTE")T.tabs[m]=g.readBytes(o,d,$);else if(m=="hIST"){const h=T.tabs.PLTE.length/3;for(T.tabs[m]=[],N=0;N<h;N++)T.tabs[m].push(R(o,d+2*N))}else if(m=="tRNS")T.ctype==3?T.tabs[m]=g.readBytes(o,d,$):T.ctype==0?T.tabs[m]=R(o,d):T.ctype==2&&(T.tabs[m]=[R(o,d),R(o,d+2),R(o,d+4)]);else if(m=="gAMA")T.tabs[m]=g.readUint(o,d)/1e5;else if(m=="sRGB")T.tabs[m]=o[d];else if(m=="bKGD")T.ctype==0||T.ctype==4?T.tabs[m]=[R(o,d)]:T.ctype==2||T.ctype==6?T.tabs[m]=[R(o,d),R(o,d+2),R(o,d+4)]:T.ctype==3&&(T.tabs[m]=o[d]);else if(m=="IEND")break;d+=$,g.readUint(o,d),d+=4}var I;return q!=0&&((I=T.frames[T.frames.length-1]).data=D(T,P.slice(0,q),I.rect.width,I.rect.height)),T.data=D(T,G,T.width,T.height),delete T.compress,delete T.interlace,delete T.filter,T},toRGBA8:function(a){const o=a.width,d=a.height;if(a.tabs.acTL==null)return[f(a.data,o,d,a).buffer];const g=[];a.frames[0].data==null&&(a.frames[0].data=a.data);const R=o*d*4,k=new Uint8Array(R),T=new Uint8Array(R),G=new Uint8Array(R);for(let x=0;x<a.frames.length;x++){const q=a.frames[x],M=q.rect.x,N=q.rect.y,p=q.rect.width,v=q.rect.height,F=f(q.data,p,v,a);if(x!=0)for(var P=0;P<R;P++)G[P]=k[P];if(q.blend==0?L(F,p,v,k,o,d,M,N,0):q.blend==1&&L(F,p,v,k,o,d,M,N,1),g.push(k.buffer.slice(0)),q.dispose!=0){if(q.dispose==1)L(T,p,v,k,o,d,M,N,0);else if(q.dispose==2)for(P=0;P<R;P++)k[P]=G[P]}}return g},_paeth:u,_copyTile:L,_bin:n}})();(function(){const{_copyTile:n}=Tt,{_bin:f}=Tt,D=Tt._paeth;var r={table:(function(){const p=new Uint32Array(256);for(let v=0;v<256;v++){let F=v;for(let _=0;_<8;_++)1&F?F=3988292384^F>>>1:F>>>=1;p[v]=F}return p})(),update(p,v,F,_){for(let S=0;S<_;S++)p=r.table[255&(p^v[F+S])]^p>>>8;return p},crc:(p,v,F)=>4294967295^r.update(4294967295,p,v,F)};function e(p,v,F,_){v[F]+=p[0]*_>>4,v[F+1]+=p[1]*_>>4,v[F+2]+=p[2]*_>>4,v[F+3]+=p[3]*_>>4}function t(p){return Math.max(0,Math.min(255,p))}function l(p,v){const F=p[0]-v[0],_=p[1]-v[1],S=p[2]-v[2],A=p[3]-v[3];return F*F+_*_+S*S+A*A}function u(p,v,F,_,S,A,I){I==null&&(I=1);const $=_.length,m=[];for(var h=0;h<$;h++){const j=_[h];m.push([j>>>0&255,j>>>8&255,j>>>16&255,j>>>24&255])}for(h=0;h<$;h++){let j=4294967295;for(var O=0,C=0;C<$;C++){var z=l(m[h],m[C]);C!=h&&z<j&&(j=z,O=C)}}const Q=new Uint32Array(S.buffer),Y=new Int16Array(v*F*4),ne=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<ne.length;h++)ne[h]=255*((ne[h]+.5)/16-.5);for(let j=0;j<F;j++)for(let re=0;re<v;re++){var X;h=4*(j*v+re),I!=2?X=[t(p[h]+Y[h]),t(p[h+1]+Y[h+1]),t(p[h+2]+Y[h+2]),t(p[h+3]+Y[h+3])]:(z=ne[4*(3&j)+(3&re)],X=[t(p[h]+z),t(p[h+1]+z),t(p[h+2]+z),t(p[h+3]+z)]),O=0;let Re=16777215;for(C=0;C<$;C++){const ve=l(X,m[C]);ve<Re&&(Re=ve,O=C)}const Ae=m[O],fe=[X[0]-Ae[0],X[1]-Ae[1],X[2]-Ae[2],X[3]-Ae[3]];I==1&&(re!=v-1&&e(fe,Y,h+4,7),j!=F-1&&(re!=0&&e(fe,Y,h+4*v-4,3),e(fe,Y,h+4*v,5),re!=v-1&&e(fe,Y,h+4*v+4,1))),A[h>>2]=O,Q[h>>2]=_[O]}}function w(p,v,F,_,S){S==null&&(S={});const{crc:A}=r,I=f.writeUint,$=f.writeUshort,m=f.writeASCII;let h=8;const O=p.frames.length>1;let C,z=!1,Q=33+(O?20:0);if(S.sRGB!=null&&(Q+=13),S.pHYs!=null&&(Q+=21),S.iCCP!=null&&(C=pako.deflate(S.iCCP),Q+=21+C.length+4),p.ctype==3){for(var Y=p.plte.length,ne=0;ne<Y;ne++)p.plte[ne]>>>24!=255&&(z=!0);Q+=8+3*Y+4+(z?8+1*Y+4:0)}for(var X=0;X<p.frames.length;X++)O&&(Q+=38),Q+=(Ae=p.frames[X]).cimg.length+12,X!=0&&(Q+=4);Q+=12;const j=new Uint8Array(Q),re=[137,80,78,71,13,10,26,10];for(ne=0;ne<8;ne++)j[ne]=re[ne];if(I(j,h,13),h+=4,m(j,h,"IHDR"),h+=4,I(j,h,v),h+=4,I(j,h,F),h+=4,j[h]=p.depth,h++,j[h]=p.ctype,h++,j[h]=0,h++,j[h]=0,h++,j[h]=0,h++,I(j,h,A(j,h-17,17)),h+=4,S.sRGB!=null&&(I(j,h,1),h+=4,m(j,h,"sRGB"),h+=4,j[h]=S.sRGB,h++,I(j,h,A(j,h-5,5)),h+=4),S.iCCP!=null){const fe=13+C.length;I(j,h,fe),h+=4,m(j,h,"iCCP"),h+=4,m(j,h,"ICC profile"),h+=11,h+=2,j.set(C,h),h+=C.length,I(j,h,A(j,h-(fe+4),fe+4)),h+=4}if(S.pHYs!=null&&(I(j,h,9),h+=4,m(j,h,"pHYs"),h+=4,I(j,h,S.pHYs[0]),h+=4,I(j,h,S.pHYs[1]),h+=4,j[h]=S.pHYs[2],h++,I(j,h,A(j,h-13,13)),h+=4),O&&(I(j,h,8),h+=4,m(j,h,"acTL"),h+=4,I(j,h,p.frames.length),h+=4,I(j,h,S.loop!=null?S.loop:0),h+=4,I(j,h,A(j,h-12,12)),h+=4),p.ctype==3){for(I(j,h,3*(Y=p.plte.length)),h+=4,m(j,h,"PLTE"),h+=4,ne=0;ne<Y;ne++){const fe=3*ne,ve=p.plte[ne],xe=255&ve,Fe=ve>>>8&255,qe=ve>>>16&255;j[h+fe+0]=xe,j[h+fe+1]=Fe,j[h+fe+2]=qe}if(h+=3*Y,I(j,h,A(j,h-3*Y-4,3*Y+4)),h+=4,z){for(I(j,h,Y),h+=4,m(j,h,"tRNS"),h+=4,ne=0;ne<Y;ne++)j[h+ne]=p.plte[ne]>>>24&255;h+=Y,I(j,h,A(j,h-Y-4,Y+4)),h+=4}}let Re=0;for(X=0;X<p.frames.length;X++){var Ae=p.frames[X];O&&(I(j,h,26),h+=4,m(j,h,"fcTL"),h+=4,I(j,h,Re++),h+=4,I(j,h,Ae.rect.width),h+=4,I(j,h,Ae.rect.height),h+=4,I(j,h,Ae.rect.x),h+=4,I(j,h,Ae.rect.y),h+=4,$(j,h,_[X]),h+=2,$(j,h,1e3),h+=2,j[h]=Ae.dispose,h++,j[h]=Ae.blend,h++,I(j,h,A(j,h-30,30)),h+=4);const fe=Ae.cimg;I(j,h,(Y=fe.length)+(X==0?0:4)),h+=4;const ve=h;m(j,h,X==0?"IDAT":"fdAT"),h+=4,X!=0&&(I(j,h,Re++),h+=4),j.set(fe,h),h+=Y,I(j,h,A(j,ve,h-ve)),h+=4}return I(j,h,0),h+=4,m(j,h,"IEND"),h+=4,I(j,h,A(j,h-4,4)),h+=4,j.buffer}function L(p,v,F){for(let _=0;_<p.frames.length;_++){const S=p.frames[_];S.rect.width;const A=S.rect.height,I=new Uint8Array(A*S.bpl+A);S.cimg=d(S.img,A,S.bpp,S.bpl,I,v,F)}}function i(p,v,F,_,S){const A=S[0],I=S[1],$=S[2],m=S[3],h=S[4],O=S[5];let C=6,z=8,Q=255;for(var Y=0;Y<p.length;Y++){const Oe=new Uint8Array(p[Y]);for(var ne=Oe.length,X=0;X<ne;X+=4)Q&=Oe[X+3]}const j=Q!=255,re=(function(De,Se,Ve,ot,Le,ct){const Pe=[];for(var ue=0;ue<De.length;ue++){const we=new Uint8Array(De[ue]),H=new Uint32Array(we.buffer);var ft;let V=0,te=0,ae=Se,se=Ve,le=ot?1:0;if(ue!=0){const ce=ct||ot||ue==1||Pe[ue-2].dispose!=0?1:2;let Te=0,tt=1e9;for(let je=0;je<ce;je++){var Ct=new Uint8Array(De[ue-1-je]);const nt=new Uint32Array(De[ue-1-je]);let Ne=Se,be=Ve,Ue=-1,lt=-1;for(let Je=0;Je<Ve;Je++)for(let at=0;at<Se;at++)H[et=Je*Se+at]!=nt[et]&&(at<Ne&&(Ne=at),at>Ue&&(Ue=at),Je<be&&(be=Je),Je>lt&&(lt=Je));Ue==-1&&(Ne=be=Ue=lt=0),Le&&((1&Ne)==1&&Ne--,(1&be)==1&&be--);const pt=(Ue-Ne+1)*(lt-be+1);pt<tt&&(tt=pt,Te=je,V=Ne,te=be,ae=Ue-Ne+1,se=lt-be+1)}Ct=new Uint8Array(De[ue-1-Te]),Te==1&&(Pe[ue-1].dispose=2),ft=new Uint8Array(ae*se*4),n(Ct,Se,Ve,ft,ae,se,-V,-te,0),le=n(we,Se,Ve,ft,ae,se,-V,-te,3)?1:0,le==1?o(we,Se,Ve,ft,{x:V,y:te,width:ae,height:se}):n(we,Se,Ve,ft,ae,se,-V,-te,0)}else ft=we.slice(0);Pe.push({rect:{x:V,y:te,width:ae,height:se},img:ft,blend:le,dispose:0})}if(ot)for(ue=0;ue<Pe.length;ue++){if((rt=Pe[ue]).blend==1)continue;const we=rt.rect,H=Pe[ue-1].rect,V=Math.min(we.x,H.x),te=Math.min(we.y,H.y),ae={x:V,y:te,width:Math.max(we.x+we.width,H.x+H.width)-V,height:Math.max(we.y+we.height,H.y+H.height)-te};Pe[ue-1].dispose=1,ue-1!=0&&a(De,Se,Ve,Pe,ue-1,ae,Le),a(De,Se,Ve,Pe,ue,ae,Le)}let Ft=0;if(De.length!=1)for(var et=0;et<Pe.length;et++){var rt;Ft+=(rt=Pe[et]).rect.width*rt.rect.height}return Pe})(p,v,F,A,I,$),Re={},Ae=[],fe=[];if(_!=0){const Oe=[];for(X=0;X<re.length;X++)Oe.push(re[X].img.buffer);const De=(function(Le){let ct=0;for(var Pe=0;Pe<Le.length;Pe++)ct+=Le[Pe].byteLength;const ue=new Uint8Array(ct);let ft=0;for(Pe=0;Pe<Le.length;Pe++){const Ct=new Uint8Array(Le[Pe]),Ft=Ct.length;for(let et=0;et<Ft;et+=4){let rt=Ct[et],we=Ct[et+1],H=Ct[et+2];const V=Ct[et+3];V==0&&(rt=we=H=0),ue[ft+et]=rt,ue[ft+et+1]=we,ue[ft+et+2]=H,ue[ft+et+3]=V}ft+=Ft}return ue.buffer})(Oe),Se=R(De,_);for(X=0;X<Se.plte.length;X++)Ae.push(Se.plte[X].est.rgba);let Ve=0;for(X=0;X<re.length;X++){const ot=(xe=re[X]).img.length;var ve=new Uint8Array(Se.inds.buffer,Ve>>2,ot>>2);fe.push(ve);const Le=new Uint8Array(Se.abuf,Ve,ot);O&&u(xe.img,xe.rect.width,xe.rect.height,Ae,Le,ve),xe.img.set(Le),Ve+=ot}}else for(Y=0;Y<re.length;Y++){var xe=re[Y];const Oe=new Uint32Array(xe.img.buffer);var Fe=xe.rect.width;for(ne=Oe.length,ve=new Uint8Array(ne),fe.push(ve),X=0;X<ne;X++){const De=Oe[X];if(X!=0&&De==Oe[X-1])ve[X]=ve[X-1];else if(X>Fe&&De==Oe[X-Fe])ve[X]=ve[X-Fe];else{let Se=Re[De];if(Se==null&&(Re[De]=Se=Ae.length,Ae.push(De),Ae.length>=300))break;ve[X]=Se}}}const qe=Ae.length;for(qe<=256&&h==0&&(z=qe<=2?1:qe<=4?2:qe<=16?4:8,z=Math.max(z,m)),Y=0;Y<re.length;Y++){(xe=re[Y]).rect.x,xe.rect.y,Fe=xe.rect.width;const Oe=xe.rect.height;let De=xe.img;new Uint32Array(De.buffer);let Se=4*Fe,Ve=4;if(qe<=256&&h==0){Se=Math.ceil(z*Fe/8);var Ke=new Uint8Array(Se*Oe);const ot=fe[Y];for(let Le=0;Le<Oe;Le++){X=Le*Se;const ct=Le*Fe;if(z==8)for(var _e=0;_e<Fe;_e++)Ke[X+_e]=ot[ct+_e];else if(z==4)for(_e=0;_e<Fe;_e++)Ke[X+(_e>>1)]|=ot[ct+_e]<<4-4*(1&_e);else if(z==2)for(_e=0;_e<Fe;_e++)Ke[X+(_e>>2)]|=ot[ct+_e]<<6-2*(3&_e);else if(z==1)for(_e=0;_e<Fe;_e++)Ke[X+(_e>>3)]|=ot[ct+_e]<<7-1*(7&_e)}De=Ke,C=3,Ve=1}else if(j==0&&re.length==1){Ke=new Uint8Array(Fe*Oe*3);const ot=Fe*Oe;for(X=0;X<ot;X++){const Le=3*X,ct=4*X;Ke[Le]=De[ct],Ke[Le+1]=De[ct+1],Ke[Le+2]=De[ct+2]}De=Ke,C=2,Ve=3,Se=3*Fe}xe.img=De,xe.bpl=Se,xe.bpp=Ve}return{ctype:C,depth:z,plte:Ae,frames:re}}function a(p,v,F,_,S,A,I){const $=Uint8Array,m=Uint32Array,h=new $(p[S-1]),O=new m(p[S-1]),C=S+1<p.length?new $(p[S+1]):null,z=new $(p[S]),Q=new m(z.buffer);let Y=v,ne=F,X=-1,j=-1;for(let Re=0;Re<A.height;Re++)for(let Ae=0;Ae<A.width;Ae++){const fe=A.x+Ae,ve=A.y+Re,xe=ve*v+fe,Fe=Q[xe];Fe==0||_[S-1].dispose==0&&O[xe]==Fe&&(C==null||C[4*xe+3]!=0)||(fe<Y&&(Y=fe),fe>X&&(X=fe),ve<ne&&(ne=ve),ve>j&&(j=ve))}X==-1&&(Y=ne=X=j=0),I&&((1&Y)==1&&Y--,(1&ne)==1&&ne--),A={x:Y,y:ne,width:X-Y+1,height:j-ne+1};const re=_[S];re.rect=A,re.blend=1,re.img=new Uint8Array(A.width*A.height*4),_[S-1].dispose==0?(n(h,v,F,re.img,A.width,A.height,-A.x,-A.y,0),o(z,v,F,re.img,A)):n(z,v,F,re.img,A.width,A.height,-A.x,-A.y,0)}function o(p,v,F,_,S){n(p,v,F,_,S.width,S.height,-S.x,-S.y,2)}function d(p,v,F,_,S,A,I){const $=[];let m,h=[0,1,2,3,4];A!=-1?h=[A]:(v*_>5e5||F==1)&&(h=[0]),I&&(m={level:0});const O=Bs;for(var C=0;C<h.length;C++){for(let Y=0;Y<v;Y++)g(S,p,Y,_,F,h[C]);$.push(O.deflate(S,m))}let z,Q=1e9;for(C=0;C<$.length;C++)$[C].length<Q&&(z=C,Q=$[C].length);return $[z]}function g(p,v,F,_,S,A){const I=F*_;let $=I+F;if(p[$]=A,$++,A==0)if(_<500)for(var m=0;m<_;m++)p[$+m]=v[I+m];else p.set(new Uint8Array(v.buffer,I,_),$);else if(A==1){for(m=0;m<S;m++)p[$+m]=v[I+m];for(m=S;m<_;m++)p[$+m]=v[I+m]-v[I+m-S]+256&255}else if(F==0){for(m=0;m<S;m++)p[$+m]=v[I+m];if(A==2)for(m=S;m<_;m++)p[$+m]=v[I+m];if(A==3)for(m=S;m<_;m++)p[$+m]=v[I+m]-(v[I+m-S]>>1)+256&255;if(A==4)for(m=S;m<_;m++)p[$+m]=v[I+m]-D(v[I+m-S],0,0)+256&255}else{if(A==2)for(m=0;m<_;m++)p[$+m]=v[I+m]+256-v[I+m-_]&255;if(A==3){for(m=0;m<S;m++)p[$+m]=v[I+m]+256-(v[I+m-_]>>1)&255;for(m=S;m<_;m++)p[$+m]=v[I+m]+256-(v[I+m-_]+v[I+m-S]>>1)&255}if(A==4){for(m=0;m<S;m++)p[$+m]=v[I+m]+256-D(0,v[I+m-_],0)&255;for(m=S;m<_;m++)p[$+m]=v[I+m]+256-D(v[I+m-S],v[I+m-_],v[I+m-S-_])&255}}}function R(p,v){const F=new Uint8Array(p),_=F.slice(0),S=new Uint32Array(_.buffer),A=k(_,v),I=A[0],$=A[1],m=F.length,h=new Uint8Array(m>>2);let O;if(F.length<2e7)for(var C=0;C<m;C+=4)O=T(I,z=F[C]*(1/255),Q=F[C+1]*(1/255),Y=F[C+2]*(1/255),ne=F[C+3]*(1/255)),h[C>>2]=O.ind,S[C>>2]=O.est.rgba;else for(C=0;C<m;C+=4){var z=F[C]*.00392156862745098,Q=F[C+1]*(1/255),Y=F[C+2]*(1/255),ne=F[C+3]*(1/255);for(O=I;O.left;)O=G(O.est,z,Q,Y,ne)<=0?O.left:O.right;h[C>>2]=O.ind,S[C>>2]=O.est.rgba}return{abuf:_.buffer,inds:h,plte:$}}function k(p,v,F){F==null&&(F=1e-4);const _=new Uint32Array(p.buffer),S={i0:0,i1:p.length,bst:null,est:null,tdst:0,left:null,right:null};S.bst=q(p,S.i0,S.i1),S.est=M(S.bst);const A=[S];for(;A.length<v;){let $=0,m=0;for(var I=0;I<A.length;I++)A[I].est.L>$&&($=A[I].est.L,m=I);if($<F)break;const h=A[m],O=P(p,_,h.i0,h.i1,h.est.e,h.est.eMq255);if(h.i0>=O||h.i1<=O){h.est.L=0;continue}const C={i0:h.i0,i1:O,bst:null,est:null,tdst:0,left:null,right:null};C.bst=q(p,C.i0,C.i1),C.est=M(C.bst);const z={i0:O,i1:h.i1,bst:null,est:null,tdst:0,left:null,right:null};for(z.bst={R:[],m:[],N:h.bst.N-C.bst.N},I=0;I<16;I++)z.bst.R[I]=h.bst.R[I]-C.bst.R[I];for(I=0;I<4;I++)z.bst.m[I]=h.bst.m[I]-C.bst.m[I];z.est=M(z.bst),h.left=C,h.right=z,A[m]=C,A.push(z)}for(A.sort((($,m)=>m.bst.N-$.bst.N)),I=0;I<A.length;I++)A[I].ind=I;return[S,A]}function T(p,v,F,_,S){if(p.left==null)return p.tdst=(function(C,z,Q,Y,ne){const X=z-C[0],j=Q-C[1],re=Y-C[2],Re=ne-C[3];return X*X+j*j+re*re+Re*Re})(p.est.q,v,F,_,S),p;const A=G(p.est,v,F,_,S);let I=p.left,$=p.right;A>0&&(I=p.right,$=p.left);const m=T(I,v,F,_,S);if(m.tdst<=A*A)return m;const h=T($,v,F,_,S);return h.tdst<m.tdst?h:m}function G(p,v,F,_,S){const{e:A}=p;return A[0]*v+A[1]*F+A[2]*_+A[3]*S-p.eMq}function P(p,v,F,_,S,A){for(_-=4;F<_;){for(;x(p,F,S)<=A;)F+=4;for(;x(p,_,S)>A;)_-=4;if(F>=_)break;const I=v[F>>2];v[F>>2]=v[_>>2],v[_>>2]=I,F+=4,_-=4}for(;x(p,F,S)>A;)F-=4;return F+4}function x(p,v,F){return p[v]*F[0]+p[v+1]*F[1]+p[v+2]*F[2]+p[v+3]*F[3]}function q(p,v,F){const _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],S=[0,0,0,0],A=F-v>>2;for(let I=v;I<F;I+=4){const $=p[I]*.00392156862745098,m=p[I+1]*(1/255),h=p[I+2]*(1/255),O=p[I+3]*(1/255);S[0]+=$,S[1]+=m,S[2]+=h,S[3]+=O,_[0]+=$*$,_[1]+=$*m,_[2]+=$*h,_[3]+=$*O,_[5]+=m*m,_[6]+=m*h,_[7]+=m*O,_[10]+=h*h,_[11]+=h*O,_[15]+=O*O}return _[4]=_[1],_[8]=_[2],_[9]=_[6],_[12]=_[3],_[13]=_[7],_[14]=_[11],{R:_,m:S,N:A}}function M(p){const{R:v}=p,{m:F}=p,{N:_}=p,S=F[0],A=F[1],I=F[2],$=F[3],m=_==0?0:1/_,h=[v[0]-S*S*m,v[1]-S*A*m,v[2]-S*I*m,v[3]-S*$*m,v[4]-A*S*m,v[5]-A*A*m,v[6]-A*I*m,v[7]-A*$*m,v[8]-I*S*m,v[9]-I*A*m,v[10]-I*I*m,v[11]-I*$*m,v[12]-$*S*m,v[13]-$*A*m,v[14]-$*I*m,v[15]-$*$*m],O=h,C=N;let z=[Math.random(),Math.random(),Math.random(),Math.random()],Q=0,Y=0;if(_!=0)for(let X=0;X<16&&(z=C.multVec(O,z),Y=Math.sqrt(C.dot(z,z)),z=C.sml(1/Y,z),!(X!=0&&Math.abs(Y-Q)<1e-9));X++)Q=Y;const ne=[S*m,A*m,I*m,$*m];return{Cov:h,q:ne,e:z,L:Q,eMq255:C.dot(C.sml(255,ne),z),eMq:C.dot(z,ne),rgba:(Math.round(255*ne[3])<<24|Math.round(255*ne[2])<<16|Math.round(255*ne[1])<<8|Math.round(255*ne[0])<<0)>>>0}}var N={multVec:(p,v)=>[p[0]*v[0]+p[1]*v[1]+p[2]*v[2]+p[3]*v[3],p[4]*v[0]+p[5]*v[1]+p[6]*v[2]+p[7]*v[3],p[8]*v[0]+p[9]*v[1]+p[10]*v[2]+p[11]*v[3],p[12]*v[0]+p[13]*v[1]+p[14]*v[2]+p[15]*v[3]],dot:(p,v)=>p[0]*v[0]+p[1]*v[1]+p[2]*v[2]+p[3]*v[3],sml:(p,v)=>[p*v[0],p*v[1],p*v[2],p*v[3]]};Tt.encode=function(v,F,_,S,A,I,$){S==null&&(S=0),$==null&&($=!1);const m=i(v,F,_,S,[!1,!1,!1,0,$,!1]);return L(m,-1),w(m,F,_,A,I)},Tt.encodeLL=function(v,F,_,S,A,I,$,m){const h={ctype:0+(S==1?0:2)+(A==0?0:4),depth:I,frames:[]},O=(S+A)*I,C=O*F;for(let z=0;z<v.length;z++)h.frames.push({rect:{x:0,y:0,width:F,height:_},img:new Uint8Array(v[z]),blend:0,dispose:1,bpp:Math.ceil(O/8),bpl:Math.ceil(C/8)});return L(h,0,!0),w(h,F,_,$,m)},Tt.encode.compress=i,Tt.encode.dither=u,Tt.quantize=R,Tt.quantize.getKDtree=k,Tt.quantize.getNearest=T})();const Ri={toArrayBuffer(n,f){const D=n.width,r=n.height,e=D<<2,t=n.getContext("2d").getImageData(0,0,D,r),l=new Uint32Array(t.data.buffer),u=(32*D+31)/32<<2,w=u*r,L=122+w,i=new ArrayBuffer(L),a=new DataView(i),o=1<<20;let d,g,R,k,T=o,G=0,P=0,x=0;function q(p){a.setUint16(P,p,!0),P+=2}function M(p){a.setUint32(P,p,!0),P+=4}function N(p){P+=p}q(19778),M(L),N(4),M(122),M(108),M(D),M(-r>>>0),q(1),q(32),M(3),M(w),M(2835),M(2835),N(8),M(16711680),M(65280),M(255),M(4278190080),M(1466527264),(function p(){for(;G<r&&T>0;){for(k=122+G*u,d=0;d<e;)T--,g=l[x++],R=g>>>24,a.setUint32(k+d,g<<8|R),d+=4;G++}x<l.length?(T=o,setTimeout(p,Ri._dly)):f(i)})()},toBlob(n,f){this.toArrayBuffer(n,(D=>{f(new Blob([D],{type:"image/bmp"}))}))},_dly:9};var St={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Os={[St.CHROME]:16384,[St.FIREFOX]:11180,[St.DESKTOP_SAFARI]:16384,[St.IE]:8192,[St.IOS]:4096,[St.ETC]:8192};const Xn=typeof window<"u",Di=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Mn=Xn&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Us=(Xn||Di)&&(Mn&&Mn.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Bi=(Xn||Di)&&(Mn&&Mn.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function Zn(n,f,D=Date.now()){return new Promise((r=>{const e=n.split(","),t=e[0].match(/:(.*?);/)[1],l=globalThis.atob(e[1]);let u=l.length;const w=new Uint8Array(u);for(;u--;)w[u]=l.charCodeAt(u);const L=new Blob([w],{type:t});L.name=f,L.lastModified=D,r(L)}))}function Oi(n){return new Promise(((f,D)=>{const r=new Bi;r.onload=()=>f(r.result),r.onerror=e=>D(e),r.readAsDataURL(n)}))}function Ui(n){return new Promise(((f,D)=>{const r=new Image;r.onload=()=>f(r),r.onerror=e=>D(e),r.src=n}))}function jt(){if(jt.cachedResult!==void 0)return jt.cachedResult;let n=St.ETC;const{userAgent:f}=navigator;return/Chrom(e|ium)/i.test(f)?n=St.CHROME:/iP(ad|od|hone)/i.test(f)&&/WebKit/i.test(f)?n=St.IOS:/Safari/i.test(f)?n=St.DESKTOP_SAFARI:/Firefox/i.test(f)?n=St.FIREFOX:(/MSIE/i.test(f)||document.documentMode)&&(n=St.IE),jt.cachedResult=n,jt.cachedResult}function zi(n,f){const D=jt(),r=Os[D];let e=n,t=f,l=e*t;const u=e>t?t/e:e/t;for(;l>r*r;){const w=(r+e)/2,L=(r+t)/2;w<L?(t=L,e=L*u):(t=w*u,e=w),l=e*t}return{width:e,height:t}}function Rn(n,f){let D,r;try{if(D=new OffscreenCanvas(n,f),r=D.getContext("2d"),r===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{D=document.createElement("canvas"),r=D.getContext("2d")}return D.width=n,D.height=f,[D,r]}function Ni(n,f){const{width:D,height:r}=zi(n.width,n.height),[e,t]=Rn(D,r);return f&&/jpe?g/.test(f)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(n,0,0,e.width,e.height),e}function _n(){return _n.cachedResult!==void 0||(_n.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),_n.cachedResult}function An(n,f={}){return new Promise((function(D,r){let e,t;var l=function(){try{return t=Ni(e,f.fileType||n.type),D([e,t])}catch(w){return r(w)}},u=function(w){try{var L=function(i){try{throw i}catch(a){return r(a)}};try{let i;return Oi(n).then((function(a){try{return i=a,Ui(i).then((function(o){try{return e=o,(function(){try{return l()}catch(d){return r(d)}})()}catch(d){return L(d)}}),L)}catch(o){return L(o)}}),L)}catch(i){L(i)}}catch(i){return r(i)}};try{if(_n()||[St.DESKTOP_SAFARI,St.MOBILE_SAFARI].includes(jt()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(n).then((function(w){try{return e=w,l()}catch{return u()}}),u)}catch{u()}}))}function Tn(n,f,D,r,e=1){return new Promise((function(t,l){let u;if(f==="image/png"){let L,i,a;return L=n.getContext("2d"),{data:i}=L.getImageData(0,0,n.width,n.height),a=Tt.encode([i.buffer],n.width,n.height,4096*e),u=new Blob([a],{type:f}),u.name=D,u.lastModified=r,w.call(this)}{let L=function(){return w.call(this)};if(f==="image/bmp")return new Promise((i=>Ri.toBlob(n,i))).then((function(i){try{return u=i,u.name=D,u.lastModified=r,L.call(this)}catch(a){return l(a)}}).bind(this),l);{let i=function(){return L.call(this)};if(typeof OffscreenCanvas=="function"&&n instanceof OffscreenCanvas)return n.convertToBlob({type:f,quality:e}).then((function(a){try{return u=a,u.name=D,u.lastModified=r,i.call(this)}catch(o){return l(o)}}).bind(this),l);{let a;return a=n.toDataURL(f,e),Zn(a,D,r).then((function(o){try{return u=o,i.call(this)}catch(d){return l(d)}}).bind(this),l)}}}function w(){return t(u)}}))}function xt(n){n.width=0,n.height=0}function Kt(){return new Promise((function(n,f){let D,r,e,t;return Kt.cachedResult!==void 0?n(Kt.cachedResult):Zn("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(l){try{return D=l,An(D).then((function(u){try{return r=u[1],Tn(r,D.type,D.name,D.lastModified).then((function(w){try{return e=w,xt(r),An(e).then((function(L){try{return t=L[0],Kt.cachedResult=t.width===1&&t.height===2,n(Kt.cachedResult)}catch(i){return f(i)}}),f)}catch(L){return f(L)}}),f)}catch(w){return f(w)}}),f)}catch(u){return f(u)}}),f)}))}function Hi(n){return new Promise(((f,D)=>{const r=new Bi;r.onload=e=>{const t=new DataView(e.target.result);if(t.getUint16(0,!1)!=65496)return f(-2);const l=t.byteLength;let u=2;for(;u<l;){if(t.getUint16(u+2,!1)<=8)return f(-1);const w=t.getUint16(u,!1);if(u+=2,w==65505){if(t.getUint32(u+=2,!1)!=1165519206)return f(-1);const L=t.getUint16(u+=6,!1)==18761;u+=t.getUint32(u+4,L);const i=t.getUint16(u,L);u+=2;for(let a=0;a<i;a++)if(t.getUint16(u+12*a,L)==274)return f(t.getUint16(u+12*a+8,L))}else{if((65280&w)!=65280)break;u+=t.getUint16(u,!1)}}return f(-1)},r.onerror=e=>D(e),r.readAsArrayBuffer(n)}))}function Pi(n,f){const{width:D}=n,{height:r}=n,{maxWidthOrHeight:e}=f;let t,l=n;return isFinite(e)&&(D>e||r>e)&&([l,t]=Rn(D,r),D>r?(l.width=e,l.height=r/D*e):(l.width=D/r*e,l.height=e),t.drawImage(n,0,0,l.width,l.height),xt(n)),l}function ji(n,f){const{width:D}=n,{height:r}=n,[e,t]=Rn(D,r);switch(f>4&&f<9?(e.width=r,e.height=D):(e.width=D,e.height=r),f){case 2:t.transform(-1,0,0,1,D,0);break;case 3:t.transform(-1,0,0,-1,D,r);break;case 4:t.transform(1,0,0,-1,0,r);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,r,0);break;case 7:t.transform(0,-1,-1,0,r,D);break;case 8:t.transform(0,-1,1,0,0,D)}return t.drawImage(n,0,0,D,r),xt(n),e}function yi(n,f,D=0){return new Promise((function(r,e){let t,l,u,w,L,i,a,o,d,g,R,k,T,G,P,x,q,M,N,p;function v(_=5){if(f.signal&&f.signal.aborted)throw f.signal.reason;t+=_,f.onProgress(Math.min(t,100))}function F(_){if(f.signal&&f.signal.aborted)throw f.signal.reason;t=Math.min(Math.max(_,t),100),f.onProgress(t)}return t=D,l=f.maxIteration||10,u=1024*f.maxSizeMB*1024,v(),An(n,f).then((function(_){try{return[,w]=_,v(),L=Pi(w,f),v(),new Promise((function(S,A){var I;if(!(I=f.exifOrientation))return Hi(n).then((function(m){try{return I=m,$.call(this)}catch(h){return A(h)}}).bind(this),A);function $(){return S(I)}return $.call(this)})).then((function(S){try{return i=S,v(),Kt().then((function(A){try{return a=A?L:ji(L,i),v(),o=f.initialQuality||1,d=f.fileType||n.type,Tn(a,d,n.name,n.lastModified,o).then((function(I){try{{let m=function(){if(l--&&(P>u||P>T)){let O,C;return O=p?.95*N.width:N.width,C=p?.95*N.height:N.height,[q,M]=Rn(O,C),M.drawImage(N,0,0,O,C),o*=d==="image/png"?.85:.95,Tn(q,d,n.name,n.lastModified,o).then((function(z){try{return x=z,xt(N),N=q,P=x.size,F(Math.min(99,Math.floor((G-P)/(G-u)*100))),m}catch(Q){return e(Q)}}),e)}return[1]},h=function(){return xt(N),xt(q),xt(L),xt(a),xt(w),F(100),r(x)};if(g=I,v(),R=g.size>u,k=g.size>n.size,!R&&!k)return F(100),r(g);var $;return T=n.size,G=g.size,P=G,N=a,p=!f.alwaysKeepResolution&&R,($=(function(O){for(;O;){if(O.then)return void O.then($,e);try{if(O.pop){if(O.length)return O.pop()?h.call(this):O;O=m}else O=O.call(this)}catch(C){return e(C)}}}).bind(this))(m)}}catch(m){return e(m)}}).bind(this),e)}catch(I){return e(I)}}).bind(this),e)}catch(A){return e(A)}}).bind(this),e)}catch(S){return e(S)}}).bind(this),e)}))}const zs=`
|
|
3
3
|
let scriptImported = false
|
|
4
4
|
self.addEventListener('message', async (e) => {
|
|
5
5
|
const { file, id, imageCompressionLibUrl, options } = e.data
|
|
@@ -18,11 +18,11 @@ self.addEventListener('message', async (e) => {
|
|
|
18
18
|
self.postMessage({ error: e.message + '\\n' + e.stack, id })
|
|
19
19
|
}
|
|
20
20
|
})
|
|
21
|
-
`;let Pn;function Ns(n,f){return new Promise(((D,r)=>{Pn||(Pn=(function(l){const u=[];return u.push(l),URL.createObjectURL(new Blob(u))})(zs));const e=new Worker(Pn);e.addEventListener("message",(function(l){if(f.signal&&f.signal.aborted)e.terminate();else if(l.data.progress===void 0){if(l.data.error)return r(new Error(l.data.error)),void e.terminate();D(l.data.file),e.terminate()}else f.onProgress(l.data.progress)})),e.addEventListener("error",r),f.signal&&f.signal.addEventListener("abort",(()=>{r(f.signal.reason),e.terminate()})),e.postMessage({file:n,imageCompressionLibUrl:f.libURL,options:{...f,onProgress:void 0,signal:void 0}})}))}function mt(n,f){return new Promise((function(D,r){let e,t,l,u,w,L;if(e={...f},l=0,{onProgress:u}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,w=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=d=>{l=d,typeof u=="function"&&u(l)},!(n instanceof Blob||n instanceof Us))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(n.type))return r(new Error("The file given is not an image"));if(L=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!w||typeof Worker!="function"||L)return wi(n,e).then((function(d){try{return t=d,o.call(this)}catch(v){return r(v)}}).bind(this),r);var i=(function(){try{return o.call(this)}catch(d){return r(d)}}).bind(this),a=function(d){try{return wi(n,e).then((function(v){try{return t=v,i()}catch(R){return r(R)}}),r)}catch(v){return r(v)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Ns(n,e).then((function(d){try{return t=d,i()}catch{return a()}}),a)}catch{a()}function o(){try{t.name=n.name,t.lastModified=n.lastModified}catch{}try{e.preserveExif&&n.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===n.type)&&(t=Ri(n,t))}catch{}return D(t)}}))}mt.getDataUrlFromFile=Ui,mt.getFilefromDataUrl=Zn,mt.loadImage=zi,mt.drawImageInCanvas=Hi,mt.drawFileInCanvas=An,mt.canvasToFile=Tn,mt.getExifOrientation=Pi,mt.handleMaxWidthOrHeight=ji,mt.followExifOrientation=qi,mt.cleanupCanvasMemory=xt,mt.isAutoOrientationInBrowser=Kt,mt.approximateBelowMaximumCanvasSizeOfBrowser=Ni,mt.copyExifWithoutOrientation=Ri,mt.getBrowserName=jt,mt.version="2.0.2";const Hs={class:"info"},Ps=["src"],js={class:"info"},qs={key:0},Vs={key:1},Ws={class:"more"},Qs={key:0,class:"note note-nomsg"},Gs={key:1,class:"note note-nomsg"},Ks={class:"ss-card"},Js={key:0},Ys={class:"ss-card jin-pan"},Xs=["src"],Zs={class:"context"},er={key:0},tr=["src","onClick"],nr={class:"jin-pan-load"},ir={class:"imgs"},or={class:"img-btns"},ar=["onClick"],sr=["onClick"],rr={class:"img"},lr=["src"],ur=["onClick"],cr={key:0,class:"emp"},fr=["title"],dr={for:"choice-pic",class:"sr-only"},hr=["title"],mr={for:"choice-file",class:"sr-only"},gr=["title"],vr={for:"choice-video",class:"sr-only"},pr={class:"voice-menu-wrap"},yr=["title"],wr=["title"],br={for:"main-input",class:"sr-only"},kr=["disabled","placeholder"],Ir={for:"main-input-ex",class:"sr-only"},_r=["disabled"],Sr={key:0,class:"forward-pan"},Cr={class:"ss-card card"},Mr={for:"chat-forward-search",class:"sr-only"},Ar=["placeholder"],Tr=["onClick"],Er=["title","src"],xr=4,Fr=Bt({name:"ViewChat",__name:"Chat",props:{chat:{},list:{},imgView:{}},setup(n){const f=Fn.global.t,{viewer:D}=bo("viewer",{viewer:null}),r=ko(),e=Ii(),t=Kn(),l=En(),u=xn(),w=ki(),L=tn("mergePan"),i=tn("msgPan"),a=tn("chatPadding"),o=tn("sendMore"),d=tn("mainInput"),v=ge([]),R=ge("single-message"),k=ge({sendTag:"REFUSE",showBottomButton:!1,showMoreDetail:!1,showMsgMenu:!1,showForwardPan:!1,openChatInfo:!1,isReply:!1,isJinLoading:!1,onAtFind:!1,menuDisplay:{menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,copyImg:!1,downloadImg:!1,revoke:!1,reedit:!1,at:!0,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1},search:{userId:-1,list:vn(n.list)},msgTouch:{x:-1,y:-1,msgOnTouchDown:!1,onMove:"no"},checkNewLineFlag:!1}),T=ge([{open:!1},{open:!1},{open:!1},{open:!1}]),K=ge([]),P=ge(0),x=ge(""),q=ge(""),M=ge(new Map),N=ge(!1),y=ge(null),p=ge(!1),F=ge(null);let _=[];const S=ge([]),A=ge(null),I=ge(""),$=ge(null),m=ge(0),h=ge(null),O=ge(null),C=ge(null),z=ge(0),Q=ge(w.userList),Y=ge(void 0),ne=Ci();function X(s){const c=Number((s==null?void 0:s.local_time)??(s==null?void 0:s.timestamp_ms)??(s==null?void 0:s.time_ms)??0);if(c)return c;const b=Number((s==null?void 0:s.time)??0);return Number.isFinite(b)&&b>0?b*1e3:0}async function j(){const s=n.chat.show.id;if(!s||s===0||T.value[3].open||k.value.showForwardPan)return;const c=(n.chat.show.type==="group",String(n.chat.show.channel_id??s));let b=[];try{b=await gi({platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:c,limit:30})}catch{return}if(!b.length||String(n.chat.show.id)!==String(s))return;const U=new Set,E=oe=>{const he=String((oe==null?void 0:oe.message_id)??""),pe=String((oe==null?void 0:oe.fake_message_id)??"");he&&U.add(he),pe&&U.add(pe)},J=[...u.messageList];for(const oe of J)E(oe);let Z=!1;for(const oe of b){const he=String(oe.message_id??""),pe=String(oe.fake_message_id??"");he&&U.has(he)||pe&&U.has(pe)||!he&&!pe||(E(oe),J.push(oe),Z=!0)}Z&&(J.sort((oe,he)=>X(oe)-X(he)),u.messageList.splice(0,u.messageList.length,...J))}function re(){n.chat.show.id&&j()}const Re={beforeHook:s=>{const c=On();if(!c)return;c.style.transition="all 0s";const b=document.getElementById("chat-pan");if(!b)return;const U=b.getElementsByClassName("chat")[0];U&&(U.style.overflowY="hidden")},moveHook:(s,c)=>{const b=On();b&&(b.style.transform="translateX("+c+"px)")},endHook:s=>{const c=document.getElementById("chat-pan"),b=c==null?void 0:c.getElementsByClassName("chat")[0];b&&(b.style.overflowY="scroll");const U=On();U&&(U.style.transition="transform 0.3s",U.style.transform="")},rightLimit:{value:100,type:"%"},speedCondition:{minMove:{value:.5*e.inch,type:"px"},minSpeed:5*e.inch},moveCondition:{minMove:{value:33,type:"%"}}};function Ae(){P.value=0,k.value={sendTag:"REFUSE",showBottomButton:!1,showMoreDetail:!1,showMsgMenu:!1,showForwardPan:!1,openChatInfo:!1,isReply:!1,isJinLoading:!1,onAtFind:!1,menuDisplay:{menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,copyImg:!1,downloadImg:!1,revoke:!1,reedit:!1,at:!0,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1},search:{userId:-1,list:vn(n.list)},msgTouch:{x:-1,y:-1,msgOnTouchDown:!1,onMove:"no"},checkNewLineFlag:!1},K.value=[],Je=!0}_t(()=>n.chat,()=>{Ae(),S.value=[],M.value.clear(),v.value=[],Ue(),wt(()=>{Oe(),Le(),ue()}),re();const s=mi(),c=n.chat.show.id,b=[...w.userList].find(U=>(U.user_id??U.group_id)===c);b&&s.add(b)}),_t(()=>x.value,(s,c)=>{q.value=c,Oe()}),cn(()=>{re();const s=mi(),c=n.chat.show.id,b=[...w.userList].find(U=>(U.user_id??U.group_id)===c);b&&s.add(b),ai(n.list.length,0),_t(()=>n.list.map(U=>U.message_id+"_"+U.fake_msg),(U,E=[])=>{ai(U.length,E.length),U.length>0&&E.length===0&&wt(we)}),_t(()=>n.chat.info.jin_info.list.length,()=>{k.value.isJinLoading=!1}),bt.type=="capacitor"&&bt.platform==="android"&&bt.addListener("App","backButton",()=>{hn()}),_t(()=>r.backTimes,()=>{hn()}),wt(()=>{Ve(),ot(),Oe(),Le(),ue()})}),Gn(()=>{if(fe!==null&&(cancelAnimationFrame(fe),fe=null),ve!==null&&(cancelAnimationFrame(ve),ve=null),xe!==null&&(xe.disconnect(),xe=null),Fe!==null&&(Fe.disconnect(),Fe=null),qe!==null){const s=i.value;s==null||s.removeEventListener("load",qe,!0),s==null||s.removeEventListener("error",qe,!0),s==null||s.removeEventListener("loadedmetadata",qe,!0),s==null||s.removeEventListener("loadeddata",qe,!0),qe=null}});let fe=null,ve=null,xe=null,Fe=null,qe=null,Je=!0,_e=[];function Oe(s,c=!1){wt(()=>{fe!==null&&cancelAnimationFrame(fe),fe=requestAnimationFrame(()=>{fe=null,ct(s??d.value),Se(c?()=>we():void 0)})})}function De(){const s=o.value,c=a.value,b=i.value;if(!s||!c||!b)return;const U=Array.from(s.children).flatMap(Z=>Array.from(Z.children)).filter(Z=>Z instanceof HTMLElement&&Z.offsetHeight>0),E=U.length>0?U.reduce((Z,oe)=>Math.min(Z,oe.getBoundingClientRect().top),Number.POSITIVE_INFINITY):s.getBoundingClientRect().top,J=b.getBoundingClientRect().bottom;c.style.height=Math.max(0,J-E)+"px"}function Se(s){s&&_e.push(s),ve===null&&(ve=requestAnimationFrame(()=>{ve=null,De();const c=_e;_e=[],c.forEach(b=>b())}))}function Ve(){if(xe!==null)return;const s=o.value;if(!s||typeof ResizeObserver>"u"){Se();return}xe=new ResizeObserver(()=>{Se()}),xe.observe(s),Se()}function ot(){const s=i.value;if(!s||Fe!==null||qe!==null)return;const c=()=>{ue(),Le()};qe=c,s.addEventListener("load",c,!0),s.addEventListener("error",c,!0),s.addEventListener("loadedmetadata",c,!0),s.addEventListener("loadeddata",c,!0),!(typeof ResizeObserver>"u")&&(Fe=new ResizeObserver(()=>{c()}),Fe.observe(s),s.firstElementChild&&Fe.observe(s.firstElementChild))}function Le(){!Je||!i.value||(we(!1),requestAnimationFrame(()=>{!Je||!i.value||(we(!1),requestAnimationFrame(()=>{Je&&i.value&&we(!1)}))}))}function ct(s){const c=s??d.value;if(!c)return;if(t.sysConfig.send_key==="none"){c.style.height="";return}if(!(c instanceof HTMLTextAreaElement)){c.style.height="";return}const b=getComputedStyle(c),U=Number.parseFloat(b.lineHeight),E=Number.parseFloat(b.fontSize),J=Number.isFinite(U)?U:E,Z=Number.parseFloat(b.paddingTop)||0,oe=Number.parseFloat(b.paddingBottom)||0,he=Number.parseFloat(b.borderTopWidth)||0,pe=Number.parseFloat(b.borderBottomWidth)||0;let de=(Number.isFinite(J)?J:0)+Z+oe+he+pe;if(de<=0){const Qe=c.offsetHeight||Number.parseFloat(b.height)||E;Qe&&Number.isFinite(Qe)&&(de=Qe)}c.dataset.baseHeight||(c.dataset.baseHeight=String(de));const Ze=c.style.transition;c.style.transition="none";const dt=c.style.overflow,$e=Number.parseFloat(c.dataset.baseHeight)||de;if(c.value==="")c.style.height=$e+"px";else{c.style.overflow="hidden",c.style.height="0px";const Qe=Math.max(c.scrollHeight-xr,$e);c.style.height=Qe+"px",c.style.overflow=dt}c.getBoundingClientRect(),c.style.transition=Ze}function Pe(){ri(),wt(()=>{var s;A.value&&(nn("chat-"+((s=A.value)==null?void 0:s.message_id),!0),He())})}function ue(){const s=i.value;if(!s)return;const c=s.scrollHeight>s.clientHeight+1,b=s.scrollTop+s.clientHeight+10>=s.scrollHeight;k.value.showBottomButton=c&&!b}function ft(s,c){if(c)return;const b=s.target;b.scrollTop===0&&n.list.length>0&&Ct(),b.scrollTop+b.clientHeight+10>=b.scrollHeight?(Je=!0,P.value=0,k.value.showBottomButton=!1):(Je&&(Je=!1),ue())}async function Ct(){if(!e.nowGetHistory&&e.canLoadHistory!==!1){const s=n.list[0],c=s.message_id,b=Number(s==null?void 0:s.time),U=Number((s==null?void 0:s.local_time)??(s==null?void 0:s.timestamp_ms)??(s==null?void 0:s.time_ms)??0)||(Number.isFinite(b)?b*1e3:0),E=t.sysConfig.enable_local_history&&t.sysConfig.mixed_load_messages!==!1;e.nowGetHistory=!0,E&&Number.isFinite(b)?e.historyBeforeTime=b:e.historyBeforeTime=void 0,e.loadHistoryFail=!1;const J=String(u.chatInfo.show.channel_id??u.chatInfo.show.id??"");if(E){let pe=[];if(Number.isFinite(b)?pe=await To(l.loginInfo.uin,J,b,20):pe=await Eo(l.loginInfo.uin,J,c,20),pe.length>0){const de=new Set(u.messageList.map(Qe=>String(Qe.message_id??""))),Ze=pe.filter(Qe=>{const Ge=String((Qe==null?void 0:Qe.message_id)??"");return Ge.length===0||!de.has(Ge)});Ze.length>0&&u.messageList.splice(0,0,...Ze);const dt=n.list[Ze.length]??n.list[Ze.length-1],$e=Ft([...Ze,dt]);$e.length>0&&et($e)}}const Z=await gi({platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:J,limit:20,beforeTimeMs:U>0?U:void 0}),oe=new Set(u.messageList.map(pe=>String(pe.message_id??""))),he=Z.filter(pe=>{const de=String(pe.message_id??"");return de.length===0||!oe.has(de)});he.length>0&&u.messageList.splice(0,0,...he),Z.length<20&&(e.canLoadHistory=!1),e.nowGetHistory=!1}}function Ft(s){const c=[];for(let b=0;b<s.length-1;b++){const U=s[b].message_seq??s[b].seq??null,E=s[b+1].message_seq??s[b+1].seq??null;if(U==null||E==null)return[];E-U>1&&c.push(s[b+1].message_id)}return c}function et(s){var Z;const c=u.chatInfo.show.type,b=u.chatInfo.show.id,U=String(u.chatInfo.show.channel_id??b),E=String(u.chatInfo.show.guild_id??b);let J;l.jsonMap.message_list&&c!="group"?J=l.jsonMap.message_list.private_name:J=(Z=l.jsonMap.message_list)==null?void 0:Z.name;for(const oe of s)it.send(J??"get_chat_history",{group_id:c=="group"?E||b:void 0,guild_id:c=="group"?E||b:void 0,channel_id:U,user_id:c!="group"?b:void 0,message_id:oe,count:20},"getChatHistoryGapFill_"+oe)}function rt(s,c=!0){const b=document.getElementById("msgPan");b!==null&&s&&(c===!1?b.style.scrollBehavior="unset":b.style.scrollBehavior="smooth",b.scrollTop=s,b.style.scrollBehavior="smooth")}function we(s=!1){const c=document.getElementById("msgPan");c!==null&&rt(c.scrollHeight,s)}function H(s){nn(s,!0)||new ut().add(Be.INFO,f("无法定位上下文"))}function V(s){const c=document.getElementById("msgPan");c&&(n.list.length<=20&&!k.value.showBottomButton?we():rt(c.scrollTop+s,!1))}function te(s){if(ae(s)||k.value.onAtFind||s.key!=="Enter")return;let c=!1;switch(t.sysConfig.send_key){case"none":if(s.shiftKey||s.ctrlKey||s.altKey||s.metaKey)break;c=!0;break;case"shift":if(!s.shiftKey)break;c=!0;break;case"ctrl":if(!s.ctrlKey)break;c=!0;break;case"alt":if(!s.altKey)break;c=!0;break;case"meta":if(!s.metaKey)break;c=!0;break}c&&k.value.sendTag!="PASS"&&(k.value.sendTag="READY"),k.value.sendTag=="READY"&&x.value!==""?(s.preventDefault(),Zt()):s.key==="Enter"&&(s.ctrlKey||s.metaKey||s.altKey)&&(x.value+=`
|
|
21
|
+
`;let Pn;function Ns(n,f){return new Promise(((D,r)=>{Pn||(Pn=(function(l){const u=[];return u.push(l),URL.createObjectURL(new Blob(u))})(zs));const e=new Worker(Pn);e.addEventListener("message",(function(l){if(f.signal&&f.signal.aborted)e.terminate();else if(l.data.progress===void 0){if(l.data.error)return r(new Error(l.data.error)),void e.terminate();D(l.data.file),e.terminate()}else f.onProgress(l.data.progress)})),e.addEventListener("error",r),f.signal&&f.signal.addEventListener("abort",(()=>{r(f.signal.reason),e.terminate()})),e.postMessage({file:n,imageCompressionLibUrl:f.libURL,options:{...f,onProgress:void 0,signal:void 0}})}))}function mt(n,f){return new Promise((function(D,r){let e,t,l,u,w,L;if(e={...f},l=0,{onProgress:u}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,w=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=d=>{l=d,typeof u=="function"&&u(l)},!(n instanceof Blob||n instanceof Us))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(n.type))return r(new Error("The file given is not an image"));if(L=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!w||typeof Worker!="function"||L)return yi(n,e).then((function(d){try{return t=d,o.call(this)}catch(g){return r(g)}}).bind(this),r);var i=(function(){try{return o.call(this)}catch(d){return r(d)}}).bind(this),a=function(d){try{return yi(n,e).then((function(g){try{return t=g,i()}catch(R){return r(R)}}),r)}catch(g){return r(g)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Ns(n,e).then((function(d){try{return t=d,i()}catch{return a()}}),a)}catch{a()}function o(){try{t.name=n.name,t.lastModified=n.lastModified}catch{}try{e.preserveExif&&n.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===n.type)&&(t=$i(n,t))}catch{}return D(t)}}))}mt.getDataUrlFromFile=Oi,mt.getFilefromDataUrl=Zn,mt.loadImage=Ui,mt.drawImageInCanvas=Ni,mt.drawFileInCanvas=An,mt.canvasToFile=Tn,mt.getExifOrientation=Hi,mt.handleMaxWidthOrHeight=Pi,mt.followExifOrientation=ji,mt.cleanupCanvasMemory=xt,mt.isAutoOrientationInBrowser=Kt,mt.approximateBelowMaximumCanvasSizeOfBrowser=zi,mt.copyExifWithoutOrientation=$i,mt.getBrowserName=jt,mt.version="2.0.2";const Hs={class:"info"},Ps=["src"],js={class:"info"},qs={key:0},Vs={key:1},Ws={class:"more"},Qs={key:0,class:"note note-nomsg"},Gs={key:1,class:"note note-nomsg"},Ks={class:"ss-card"},Js={key:0},Ys={class:"ss-card jin-pan"},Xs=["src"],Zs={class:"context"},er={key:0},tr=["src","onClick"],nr={class:"jin-pan-load"},ir={class:"imgs"},or={class:"img-btns"},ar=["onClick"],sr=["onClick"],rr={class:"img"},lr=["src"],ur=["onClick"],cr={key:0,class:"emp"},fr=["title"],dr={for:"choice-pic",class:"sr-only"},hr=["title"],mr={for:"choice-file",class:"sr-only"},gr=["title"],vr={for:"choice-video",class:"sr-only"},pr={class:"voice-menu-wrap"},yr=["title"],wr=["title"],br={for:"main-input",class:"sr-only"},kr=["disabled","placeholder"],Ir={for:"main-input-ex",class:"sr-only"},_r=["disabled"],Sr={key:0,class:"forward-pan"},Cr={class:"ss-card card"},Mr={for:"chat-forward-search",class:"sr-only"},Ar=["placeholder"],Tr=["onClick"],Er=["title","src"],xr=4,Fr=Bt({name:"ViewChat",__name:"Chat",props:{chat:{},list:{},imgView:{}},setup(n){const f=Fn.global.t,{viewer:D}=bo("viewer",{viewer:null}),r=ko(),e=ki(),t=Kn(),l=En(),u=xn(),w=bi(),L=tn("mergePan"),i=tn("msgPan"),a=tn("chatPadding"),o=tn("sendMore"),d=tn("mainInput"),g=ge([]),R=ge("single-message"),k=ge({sendTag:"REFUSE",showBottomButton:!1,showMoreDetail:!1,showMsgMenu:!1,showForwardPan:!1,openChatInfo:!1,isReply:!1,isJinLoading:!1,onAtFind:!1,menuDisplay:{menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,copyImg:!1,downloadImg:!1,revoke:!1,reedit:!1,at:!0,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1},search:{userId:-1,list:vn(n.list)},msgTouch:{x:-1,y:-1,msgOnTouchDown:!1,onMove:"no"},checkNewLineFlag:!1}),T=ge([{open:!1},{open:!1},{open:!1},{open:!1}]),G=ge([]),P=ge(0),x=ge(""),q=ge(""),M=ge(new Map),N=ge(!1),p=ge(null),v=ge(!1),F=ge(null);let _=[];const S=ge([]),A=ge(null),I=ge(""),$=ge(null),m=ge(0),h=ge(null),O=ge(null),C=ge(null),z=ge(0),Q=ge(w.userList),Y=ge(void 0),ne=Si();function X(s){const c=Number((s==null?void 0:s.local_time)??(s==null?void 0:s.timestamp_ms)??(s==null?void 0:s.time_ms)??0);if(c)return c;const b=Number((s==null?void 0:s.time)??0);return Number.isFinite(b)&&b>0?b*1e3:0}async function j(){const s=n.chat.show.id;if(!s||s===0||T.value[3].open||k.value.showForwardPan)return;const c=(n.chat.show.type==="group",String(n.chat.show.channel_id??s));let b=[];try{b=await mi({platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:c,limit:30})}catch{return}if(!b.length||String(n.chat.show.id)!==String(s))return;const U=new Set,E=oe=>{const he=String((oe==null?void 0:oe.message_id)??""),pe=String((oe==null?void 0:oe.fake_message_id)??"");he&&U.add(he),pe&&U.add(pe)},J=[...u.messageList];for(const oe of J)E(oe);let Z=!1;for(const oe of b){const he=String(oe.message_id??""),pe=String(oe.fake_message_id??"");he&&U.has(he)||pe&&U.has(pe)||!he&&!pe||(E(oe),J.push(oe),Z=!0)}Z&&(J.sort((oe,he)=>X(oe)-X(he)),u.messageList.splice(0,u.messageList.length,...J))}function re(){n.chat.show.id&&j()}const Re={beforeHook:s=>{const c=On();if(!c)return;c.style.transition="all 0s";const b=document.getElementById("chat-pan");if(!b)return;const U=b.getElementsByClassName("chat")[0];U&&(U.style.overflowY="hidden")},moveHook:(s,c)=>{const b=On();b&&(b.style.transform="translateX("+c+"px)")},endHook:s=>{const c=document.getElementById("chat-pan"),b=c==null?void 0:c.getElementsByClassName("chat")[0];b&&(b.style.overflowY="scroll");const U=On();U&&(U.style.transition="transform 0.3s",U.style.transform="")},rightLimit:{value:100,type:"%"},speedCondition:{minMove:{value:.5*e.inch,type:"px"},minSpeed:5*e.inch},moveCondition:{minMove:{value:33,type:"%"}}};function Ae(){P.value=0,k.value={sendTag:"REFUSE",showBottomButton:!1,showMoreDetail:!1,showMsgMenu:!1,showForwardPan:!1,openChatInfo:!1,isReply:!1,isJinLoading:!1,onAtFind:!1,menuDisplay:{menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,copyImg:!1,downloadImg:!1,revoke:!1,reedit:!1,at:!0,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1},search:{userId:-1,list:vn(n.list)},msgTouch:{x:-1,y:-1,msgOnTouchDown:!1,onMove:"no"},checkNewLineFlag:!1},G.value=[],Ke=!0}_t(()=>n.chat,()=>{Ae(),S.value=[],M.value.clear(),g.value=[],Ue(),wt(()=>{Oe(),Le(),ue()}),re();const s=hi(),c=n.chat.show.id,b=[...w.userList].find(U=>(U.user_id??U.group_id)===c);b&&s.add(b)}),_t(()=>x.value,(s,c)=>{q.value=c,Oe()}),cn(()=>{re();const s=hi(),c=n.chat.show.id,b=[...w.userList].find(U=>(U.user_id??U.group_id)===c);b&&s.add(b),ai(n.list.length,0),_t(()=>n.list.map(U=>U.message_id+"_"+U.fake_msg),(U,E=[])=>{ai(U.length,E.length),U.length>0&&E.length===0&&wt(we)}),_t(()=>n.chat.info.jin_info.list.length,()=>{k.value.isJinLoading=!1}),bt.type=="capacitor"&&bt.platform==="android"&&bt.addListener("App","backButton",()=>{hn()}),_t(()=>r.backTimes,()=>{hn()}),wt(()=>{Ve(),ot(),Oe(),Le(),ue()})}),Gn(()=>{if(fe!==null&&(cancelAnimationFrame(fe),fe=null),ve!==null&&(cancelAnimationFrame(ve),ve=null),xe!==null&&(xe.disconnect(),xe=null),Fe!==null&&(Fe.disconnect(),Fe=null),qe!==null){const s=i.value;s==null||s.removeEventListener("load",qe,!0),s==null||s.removeEventListener("error",qe,!0),s==null||s.removeEventListener("loadedmetadata",qe,!0),s==null||s.removeEventListener("loadeddata",qe,!0),qe=null}});let fe=null,ve=null,xe=null,Fe=null,qe=null,Ke=!0,_e=[];function Oe(s,c=!1){wt(()=>{fe!==null&&cancelAnimationFrame(fe),fe=requestAnimationFrame(()=>{fe=null,ct(s??d.value),Se(c?()=>we():void 0)})})}function De(){const s=o.value,c=a.value,b=i.value;if(!s||!c||!b)return;const U=Array.from(s.children).flatMap(Z=>Array.from(Z.children)).filter(Z=>Z instanceof HTMLElement&&Z.offsetHeight>0),E=U.length>0?U.reduce((Z,oe)=>Math.min(Z,oe.getBoundingClientRect().top),Number.POSITIVE_INFINITY):s.getBoundingClientRect().top,J=b.getBoundingClientRect().bottom;c.style.height=Math.max(0,J-E)+"px"}function Se(s){s&&_e.push(s),ve===null&&(ve=requestAnimationFrame(()=>{ve=null,De();const c=_e;_e=[],c.forEach(b=>b())}))}function Ve(){if(xe!==null)return;const s=o.value;if(!s||typeof ResizeObserver>"u"){Se();return}xe=new ResizeObserver(()=>{Se()}),xe.observe(s),Se()}function ot(){const s=i.value;if(!s||Fe!==null||qe!==null)return;const c=()=>{ue(),Le()};qe=c,s.addEventListener("load",c,!0),s.addEventListener("error",c,!0),s.addEventListener("loadedmetadata",c,!0),s.addEventListener("loadeddata",c,!0),!(typeof ResizeObserver>"u")&&(Fe=new ResizeObserver(()=>{c()}),Fe.observe(s),s.firstElementChild&&Fe.observe(s.firstElementChild))}function Le(){!Ke||!i.value||(we(!1),requestAnimationFrame(()=>{!Ke||!i.value||(we(!1),requestAnimationFrame(()=>{Ke&&i.value&&we(!1)}))}))}function ct(s){const c=s??d.value;if(!c)return;if(t.sysConfig.send_key==="none"){c.style.height="";return}if(!(c instanceof HTMLTextAreaElement)){c.style.height="";return}const b=getComputedStyle(c),U=Number.parseFloat(b.lineHeight),E=Number.parseFloat(b.fontSize),J=Number.isFinite(U)?U:E,Z=Number.parseFloat(b.paddingTop)||0,oe=Number.parseFloat(b.paddingBottom)||0,he=Number.parseFloat(b.borderTopWidth)||0,pe=Number.parseFloat(b.borderBottomWidth)||0;let de=(Number.isFinite(J)?J:0)+Z+oe+he+pe;if(de<=0){const Qe=c.offsetHeight||Number.parseFloat(b.height)||E;Qe&&Number.isFinite(Qe)&&(de=Qe)}c.dataset.baseHeight||(c.dataset.baseHeight=String(de));const Xe=c.style.transition;c.style.transition="none";const dt=c.style.overflow,$e=Number.parseFloat(c.dataset.baseHeight)||de;if(c.value==="")c.style.height=$e+"px";else{c.style.overflow="hidden",c.style.height="0px";const Qe=Math.max(c.scrollHeight-xr,$e);c.style.height=Qe+"px",c.style.overflow=dt}c.getBoundingClientRect(),c.style.transition=Xe}function Pe(){ri(),wt(()=>{var s;A.value&&(nn("chat-"+((s=A.value)==null?void 0:s.message_id),!0),He())})}function ue(){const s=i.value;if(!s)return;const c=s.scrollHeight>s.clientHeight+1,b=s.scrollTop+s.clientHeight+10>=s.scrollHeight;k.value.showBottomButton=c&&!b}function ft(s,c){if(c)return;const b=s.target;b.scrollTop===0&&n.list.length>0&&Ct(),b.scrollTop+b.clientHeight+10>=b.scrollHeight?(Ke=!0,P.value=0,k.value.showBottomButton=!1):(Ke&&(Ke=!1),ue())}async function Ct(){if(!e.nowGetHistory&&e.canLoadHistory!==!1){const s=n.list[0],c=s.message_id,b=Number(s==null?void 0:s.time),U=Number((s==null?void 0:s.local_time)??(s==null?void 0:s.timestamp_ms)??(s==null?void 0:s.time_ms)??0)||(Number.isFinite(b)?b*1e3:0),E=t.sysConfig.enable_local_history&&t.sysConfig.mixed_load_messages!==!1;e.nowGetHistory=!0,E&&Number.isFinite(b)?e.historyBeforeTime=b:e.historyBeforeTime=void 0,e.loadHistoryFail=!1;const J=String(u.chatInfo.show.channel_id??u.chatInfo.show.id??"");if(E){let pe=[];if(Number.isFinite(b)?pe=await To(l.loginInfo.uin,J,b,20):pe=await Eo(l.loginInfo.uin,J,c,20),pe.length>0){const de=new Set(u.messageList.map(Qe=>String(Qe.message_id??""))),Xe=pe.filter(Qe=>{const Ge=String((Qe==null?void 0:Qe.message_id)??"");return Ge.length===0||!de.has(Ge)});Xe.length>0&&u.messageList.splice(0,0,...Xe);const dt=n.list[Xe.length]??n.list[Xe.length-1],$e=Ft([...Xe,dt]);$e.length>0&&et($e)}}const Z=await mi({platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:J,limit:20,beforeTimeMs:U>0?U:void 0}),oe=new Set(u.messageList.map(pe=>String(pe.message_id??""))),he=Z.filter(pe=>{const de=String(pe.message_id??"");return de.length===0||!oe.has(de)});he.length>0&&u.messageList.splice(0,0,...he),Z.length<20&&(e.canLoadHistory=!1),e.nowGetHistory=!1}}function Ft(s){const c=[];for(let b=0;b<s.length-1;b++){const U=s[b].message_seq??s[b].seq??null,E=s[b+1].message_seq??s[b+1].seq??null;if(U==null||E==null)return[];E-U>1&&c.push(s[b+1].message_id)}return c}function et(s){var Z;const c=u.chatInfo.show.type,b=u.chatInfo.show.id,U=String(u.chatInfo.show.channel_id??b),E=String(u.chatInfo.show.guild_id??b);let J;l.jsonMap.message_list&&c!="group"?J=l.jsonMap.message_list.private_name:J=(Z=l.jsonMap.message_list)==null?void 0:Z.name;for(const oe of s)it.send(J??"get_chat_history",{group_id:c=="group"?E||b:void 0,guild_id:c=="group"?E||b:void 0,channel_id:U,user_id:c!="group"?b:void 0,message_id:oe,count:20},"getChatHistoryGapFill_"+oe)}function rt(s,c=!0){const b=document.getElementById("msgPan");b!==null&&s&&(c===!1?b.style.scrollBehavior="unset":b.style.scrollBehavior="smooth",b.scrollTop=s,b.style.scrollBehavior="smooth")}function we(s=!1){const c=document.getElementById("msgPan");c!==null&&rt(c.scrollHeight,s)}function H(s){nn(s,!0)||new ut().add(Be.INFO,f("无法定位上下文"))}function V(s){const c=document.getElementById("msgPan");c&&(n.list.length<=20&&!k.value.showBottomButton?we():rt(c.scrollTop+s,!1))}function te(s){if(ae(s)||k.value.onAtFind||s.key!=="Enter")return;let c=!1;switch(t.sysConfig.send_key){case"none":if(s.shiftKey||s.ctrlKey||s.altKey||s.metaKey)break;c=!0;break;case"shift":if(!s.shiftKey)break;c=!0;break;case"ctrl":if(!s.ctrlKey)break;c=!0;break;case"alt":if(!s.altKey)break;c=!0;break;case"meta":if(!s.metaKey)break;c=!0;break}c&&k.value.sendTag!="PASS"&&(k.value.sendTag="READY"),k.value.sendTag=="READY"&&x.value!==""?(s.preventDefault(),Zt()):s.key==="Enter"&&(s.ctrlKey||s.metaKey||s.altKey)&&(x.value+=`
|
|
22
22
|
`),k.value.sendTag="REFUSE"}function ae(s){var c;if(!k.value.onAtFind)return!1;if(s.keyCode===38||s.keyCode===40){s.preventDefault();const b=s.keyCode===38?-1:1;return nt(b),h.value!==null||(h.value=setTimeout(()=>{O.value=setInterval(()=>{nt(b)},50)},300)),!0}if(s.keyCode===13){s.preventDefault();const b=(c=$.value)==null?void 0:c[m.value];return b&&tt(b.user_id),!0}return s.keyCode===27?(s.preventDefault(),k.value.onAtFind=!1,$.value=null,m.value=0,!0):!1}function se(){k.value.sendTag="REFUSE"}function le(){k.value.sendTag="PASS",setTimeout(()=>{k.value.sendTag="REFUSE"},50)}function ce(s){const c=new Dt;if(s.keyCode!==27&&((s.keyCode===38||s.keyCode===40)&&(h.value!==null&&(clearTimeout(h.value),h.value=null),O.value!==null&&(clearInterval(O.value),O.value=null)),k.value.checkNewLineFlag&&(k.value.checkNewLineFlag=!1,x.value==`
|
|
23
|
-
`&&(x.value="",Oe())),!(k.value.onAtFind&&$.value&&$.value.length>0&&(s.keyCode===38||s.keyCode===40||s.keyCode===13||s.keyCode===27))&&s.keyCode!=13)){const b=x.value.substring(x.value.length-1);if(!k.value.onAtFind&&b=="@"&&u.chatInfo.info.group_members.length>0&&u.chatInfo.show.type=="group"&&(c.add(pn.UI,"开始匹配群成员列表 ……"),k.value.onAtFind=!0,m.value=0),k.value.onAtFind)if(x.value.lastIndexOf("@")<0)c.add(pn.UI,"匹配群成员列表被打断 ……"),k.value.onAtFind=!1,$.value=null,m.value=0;else{const U=x.value.substring(x.value.lastIndexOf("@")+1).toLowerCase();$.value=u.chatInfo.info.group_members.filter(E=>E.card!=""&&E.card!=null&&E.card.toLowerCase().indexOf(U)>=0||E.nickname.toLowerCase().indexOf(U)>=0||U==E.user_id.toString()),$.value.length==0&&($.value=u.chatInfo.info.group_members),m.value=0}}}function Te(s){s.preventDefault(),x.value!=""&&Zt()}function tt(s){s!=null&&(x.value=x.value.substring(0,x.value.lastIndexOf("@")),zt({msgObj:{type:"at",qq:String(s)},addText:!0})),Wt(),k.value.onAtFind=!1,$.value=null,m.value=0}function je(){wt(()=>{const s=document.querySelector(".at-tag.show"),c=document.querySelector(".at-tag.show > div.selected");if(s&&c){const b=s.getBoundingClientRect(),U=c.getBoundingClientRect();U.top<b.top?c.scrollIntoView({block:"nearest",behavior:"smooth"}):U.bottom>b.bottom&&c.scrollIntoView({block:"nearest",behavior:"smooth"})}})}function nt(s){!$.value||$.value.length===0||(s===-1?m.value=m.value>0?m.value-1:$.value.length-1:m.value=m.value<$.value.length-1?m.value+1:0,je())}function Ne(){const s=document.getElementById("main-input")??document.getElementById("main-input-ex");if(s!==null&&s.selectionStart===s.selectionEnd){let c=-1;typeof s.selectionStart=="number"&&(c=s.selectionStart);const b=vi.getSQList(x.value);b!=null&&b.forEach(U=>{const E=x.value.indexOf(U),J=E+U.length;E!==-1&&c>E&&c<J&&wt(()=>{s.selectionStart=E,s.selectionEnd=J})})}}function be(s,c){var J;if(A.value=c,k.value.menuDisplay.menuSelectedMsgId=c.message_id,Ti.get("log_level")==="debug"&&new Dt().debug("右击消息:"+c),v.value.length>0)return;const b=document.getElementById("msgMenu"),U=s.target;let E="member";if(u.chatInfo.show.type=="group"&&u.chatInfo.info.group_members&&u.chatInfo.info.group_members.forEach(Z=>{Z.user_id==c.sender.user_id&&(E=Z.role)}),b!==null&&c!==null){if(xo("close_respond")==!0&&(k.value.menuDisplay.showRespond=!1),U.nodeName=="IMG"&&U.name=="avatar")Object.keys(k.value.menuDisplay).forEach(de=>{k.value.menuDisplay[de]=!1}),k.value.menuDisplay.showRespond=!1,k.value.menuDisplay.at=!0,k.value.menuDisplay.poke=!0,k.value.menuDisplay.remove=!0,(u.chatInfo.show.type!="group"||c.sender.user_id===l.loginInfo.uin||u.chatInfo.info.me_info.role==="member"||E=="owner"||E=="admin"&&u.chatInfo.info.me_info.role!="owner")&&(k.value.menuDisplay.remove=!1),c.sender.user_id===l.loginInfo.uin&&(k.value.menuDisplay.at=!1),u.chatInfo.show.type=="group"&&u.chatInfo.info.me_info.role!="member"&&(k.value.menuDisplay.config=!0);else{(c.sender.user_id===l.loginInfo.uin||u.chatInfo.info.me_info.role==="admin"||u.chatInfo.info.me_info.role==="owner")&&(k.value.menuDisplay.revoke=!0),k.value.menuDisplay.reedit=k.value.menuDisplay.revoke&&c.sender.user_id===l.loginInfo.uin,c.revoke===!0&&(k.value.menuDisplay.relpy=!1,k.value.menuDisplay.forward=!1,k.value.menuDisplay.revoke=!1,k.value.menuDisplay.select=!1),T.value[3].open&&(Object.keys(k.value.menuDisplay).forEach(Ge=>{k.value.menuDisplay[Ge]=!1}),k.value.menuDisplay.jumpToMsg=!0);const de=document.getSelection(),Ze=(J=de==null?void 0:de.anchorNode)==null?void 0:J.parentElement;let dt=null,$e=Ze;if($e)for(;$e.className!="chat";){if($e.className.startsWith("message")&&$e.className.indexOf("-")<0){dt=$e;break}if($e=$e.parentElement,!$e)break}Ze&&Ze.className.indexOf("msg-text")>-1&&de.focusNode==de.anchorNode&&dt&&dt.id==c.message_id&&(I.value=de.toString(),I.value.length>0&&(k.value.menuDisplay.copySelect=!0));const Qe=["xml","json"];c.message.forEach(Ge=>{Qe.indexOf(Ge.type)>0&&(k.value.menuDisplay.forward=!1,k.value.menuDisplay.add=!1)}),U.nodeName=="IMG"&&U.src.length>0&&(k.value.menuDisplay.downloadImg=U.src,bt.isDesktop()&&(k.value.menuDisplay.copyImg=!0))}const Z=s.x,oe=s.y;b.style.marginLeft=Z+"px",b.style.marginTop=oe+"px";let he=b.clientWidth;k.value.menuDisplay.showRespond&&(he=b.children[0].clientWidth);const pe=window.innerWidth;Z+he>pe+27&&(b.style.marginLeft=pe+7-he+"px"),k.value.showMsgMenu=!0,wt(()=>{const de=b.clientHeight,Ze=document.body.clientHeight;oe+de>Ze-20&&(b.classList.add("topOut"),b.style.marginTop=Ze-de-10+"px")})}}function Ue(){k.value.menuDisplay={menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,downloadImg:!1,copyImg:!1,revoke:!1,reedit:!1,at:!1,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1}}function lt(s=!0){const c=A.value;c&&(pt(c),s&&He())}function pt(s){const c=s.message_id;A.value=s,zt({msgObj:{type:"reply",id:String(c)},addText:!1,addTop:!0}),k.value.isReply=!0,Wt()}function Ye(){S.value=S.value.filter(s=>s.type!=="reply"),k.value.isReply=!1}function at(){var c;if(!A.value)return;const s=((c=A.value)==null?void 0:c._rawSatori)??A.value;try{console.log(JSON.stringify(s,null,2))}catch{console.dir(s,{depth:null})}He()}function We(){Q.value=w.userList,k.value.showForwardPan=!1,R.value="single-message",He()}function ze(s,...c){const b=s;for(const U of c){const E=b[U],J=typeof E=="string"||typeof E=="number"?String(E):"";if(J&&J!=="undefined")return J}return""}function Lt(s){if(s.group_id)return ze(s,"group_name","name")||String(s.group_id);const c=ze(s,"nickname","name","nick","username","remark")||String(s.user_id??""),b=String(s.user_id??"");return b?`${c}(${b})`:c}function kt(s){const c=s.target.value;Q.value=w.userList.filter(b=>{const U=b.user_id?ze(b,"nickname","name","nick","remark")||String(b.user_id):ze(b,"group_name","name")||String(b.group_id||""),E=String(b.user_id??b.group_id??"");return U.toLowerCase().indexOf(c.toLowerCase())!==-1||E.length>0&&E===c})}function yt(s="single-message"){R.value=s,k.value.showForwardPan=!0,[...w.onMsgList].reverse().forEach(b=>{const U=Q.value.indexOf(b);U>-1&&(Q.value.splice(U,1),Q.value.unshift(b))}),He()}function Ee(){if(A.value){const s=JSON.parse(JSON.stringify(A.value));Nt(n.chat.show.id,n.chat.show.type,s.message,!0)}He()}function fn(){A.value&&v.value.push(A.value.message_id),He()}function Mt(s){const c=Si(s);if(typeof structuredClone=="function")try{return structuredClone(c)}catch{return JSON.parse(JSON.stringify(c))}return JSON.parse(JSON.stringify(c))}function qt(s){const c=R.value,b=A.value?Mt(A.value):null,U=s.group_id?s.group_id:s.user_id,E=String(U),J=s.group_id?"group":"user",Z=String(s.channel_id??s.channelId??""),oe=String(s.guild_id??s.guildId??""),he=u.messageList.filter(de=>v.value.includes(de.message_id)),pe=()=>String(n.chat.show.id)===E&&n.chat.show.type===J;if(c!=="single-message"&&he.length===0){We();return}if(c==="individual-messages"){const de={title:f("逐条转发"),html:f("将按顺序逐条转发 {count} 条消息,是否继续?",{count:he.length}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:()=>{he.forEach(Ze=>{Nt(E,J,Mt(Ze.message),pe(),"sendMsgBack",Z||void 0,oe||void 0)}),v.value=[],e.popBoxList.shift(),Yt(s,U)}}]};e.popBoxList.push(de)}else if(c==="merged-messages"){const de={app:"com.tencent.multimsg",meta:{detail:{source:f("合并转发消息"),news:[...he.slice(0,3).map($e=>({text:($e.sender.card&&$e.sender.card!=""?$e.sender.card:$e.sender.nickname)+": "+an($e)}))],summary:f("查看 {count} 条转发消息",{count:he.length}),resid:""}}},Ze={message:[{type:"json",data:JSON.stringify(de),id:""}],sender:{user_id:l.loginInfo.uin,nickname:l.loginInfo.nickname,avatar:l.loginInfo.avatar}},dt={title:f("合并转发消息"),template:sn(ln),templateValue:sn({data:Ze,type:"forward"}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:async()=>{const $e=he.map(Ge=>{var Ot,mn,en;return{type:"node",id:Ge.message_id,user_id:String(((Ot=Ge.sender)==null?void 0:Ot.user_id)??""),nickname:String(((mn=Ge.sender)==null?void 0:mn.card)||((en=Ge.sender)==null?void 0:en.nickname)||""),time:Ge.time,content:Mt(Ge.message)}}),Qe=await Fo(String(l.loginInfo.platform??""),String(l.loginInfo.uin??""),J,E,$e,Z||void 0);if(!Qe.ok)new ut().add(Be.ERR,f("合并转发发送失败"));else{const Ge=Date.now(),Ot={fake_msg:"pending",message_id:"forward-"+Ge,fake_message_id:"forward-"+Ge,message_type:J,channel_type:J==="group"?0:1,time:Math.floor(Ge/1e3),local_time:Ge,timestamp_ms:Ge,post_type:"message",sender:{user_id:String(l.loginInfo.uin??""),nickname:String(l.loginInfo.nickname??""),avatar:String(l.loginInfo.avatar??"")},message:[{type:"forward",id:"",content:$e.map(Rt=>({message_id:String(Rt.id??""),time:Number(Rt.time??Math.floor(Ge/1e3)),sender:{user_id:String(Rt.user_id??""),nickname:String(Rt.nickname??"")},message:Rt.content??[]}))}],raw_message:`[${f("聊天记录")}]`};pe()&&(u.messageList.push(Ot),wt(()=>{nn("chat-"+Ot.message_id,!0)}));const mn=Qe.channelId||Z||E;Qe.native&&!Qe.messageId||await Lo({id:String(Ot.fake_message_id??""),platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:mn,guildId:oe||void 0,channelType:J,messageId:Qe.messageId,content:String(Ot.raw_message??""),message:Ot.message,forwardContent:$e,source:"webui",sentAt:Ge,kind:"forward"});const en=Z||E,Qt=w.baseOnMsgList.get(wn(en));if(Qt){const Rt=`[${f("聊天记录")}]`;Qt.raw_msg_base=Rt,Qt.raw_msg=Qt.group_id?`${String(l.loginInfo.nickname??"")}: ${Rt}`:Rt,Qt.time=Math.floor(Ge/1e3),w.baseOnMsgList.set(wn(en),Qt),$o()}}v.value=[],e.popBoxList.shift(),Yt(s,U)}}]};e.popBoxList.push(dt)}else if(A.value&&b){const de={title:f("转发消息"),template:sn(ln),templateValue:sn({data:b,type:"forward"}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:()=>{Nt(E,J,Mt(b.message),pe(),"sendMsgBack",Z||void 0,oe||void 0),e.popBoxList.shift(),Yt(s,U)}}]};e.popBoxList.push(de)}}function Yt(s,c){We();const b=String(s.channel_id??s.channelId??c??"");w.baseOnMsgList.get(wn(b))==null&&w.baseOnMsgList.set(wn(b),s),wt(()=>{const U=document.getElementById("user-"+c);U&&U.click()})}function ke(){const s=A.value;if(s!==null){s.raw_message||(s.raw_message=an(s));const c=new ut;Jt.config.globalProperties.$copyText(s.raw_message).then(()=>{c.add(Be.INFO,f("复制成功"),!0)},()=>{c.add(Be.ERR,f("复制失败"),!0)})}He()}function st(){if(I.value!=""){const s=new ut;Jt.config.globalProperties.$copyText(I.value).then(()=>{s.add(Be.INFO,f("复制成功"),!0)},()=>{s.add(Be.ERR,f("复制失败"),!0)})}He()}async function At(){const s=k.value.menuDisplay.downloadImg;if(!s)return;He();const{blob:c,buffer:b}=await Ro(s),U=new ut;if(bt.type==="tauri")try{await(await Ai(()=>import("./index-Cg_esKB0.js"),__vite__mapDeps([0,1]),import.meta.url)).writeImage(b),U.add(Be.INFO,f("复制成功"))}catch(E){U.add(Be.ERR,f("复制失败")),new Dt().error(E,"复制图片失败")}else{const E=new ClipboardItem({[c.type]:c});try{await Do([E]),U.add(Be.INFO,f("复制成功"))}catch(J){U.add(Be.ERR,f("复制失败")),new Dt().error(J,"复制图片失败")}}}function Et(){const s=k.value.menuDisplay.downloadImg;s!=!1&&Bo(s,`img_${new Date().getTime()}.png`,()=>{},()=>{}),He()}async function Vt(){const s=A.value;if(He(),!s){new ut().add(Be.ERR,f("获取选中消息失败"));return}const c=s.message_id,b=String(s.channel_id??s.channelId??u.chatInfo.show.channel_id??n.chat.show.id);try{await it.callApi("delete_msg",{channel_id:b,message_id:c})}catch{new ut().add(Be.ERR,f("撤回失败"));return}s.revoke=!0,s.revoked=!0,s.revokeTime=Date.now()/1e3}async function dn(){const s=A.value;if(He(),!s){new ut().add(Be.ERR,f("获取选中消息失败"));return}const c=s.message_id,b=String(s.channel_id??s.channelId??u.chatInfo.show.channel_id??n.chat.show.id);await it.callApi("delete_msg",{channel_id:b,message_id:c}),co(s)}function Xe(){const s=A.value;if(s!==null){const c={title:f("提醒"),html:`<span>${f("真的要将 {user} 移出群聊吗",{user:s.sender.nickname})}</span>`,button:[{text:f("确定"),fun:()=>{s&&(it.send("set_group_kick",{group_id:u.chatInfo.show.id,user_id:s.sender.user_id},"setGroupKick"),He(),e.popBoxList.shift())}},{text:f("取消"),master:!0,fun:()=>{e.popBoxList.shift()}}]};e.popBoxList.push(c)}}function He(){k.value.showMsgMenu=!1,k.value.menuDisplay.menuSelectedMsgId=null,setTimeout(()=>{Ue()},300)}function $t(){var s,c,b,U,E,J,Z;if(k.value.openChatInfo=!k.value.openChatInfo,k.value.openChatInfo){if(n.chat.show.type==="group"&&((s=n.chat.info.group_info)==null?void 0:s.gc)!==n.chat.show.id){const he=`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_info_all?gc=${n.chat.show.id}&bkn=${l.loginInfo.bkn}`;it.send("http_proxy",{url:he},"getMoreGroupInfo")}else if(n.chat.show.type==="user"&&((c=n.chat.info.user_info)==null?void 0:c.uin)!==n.chat.show.id){const he=(U=(b=l.jsonMap)==null?void 0:b.friend_info)==null?void 0:U.name;he!=null&&it.send(he,{user_id:n.chat.show.id},"getMoreUserInfo")}const oe=(J=(E=l.jsonMap)==null?void 0:E.group_notices)==null?void 0:J.name;if(n.chat.show.type==="group"&&(n.chat.info.group_notices===void 0||Object.keys(n.chat.info.group_notices??{}).length===0)&&oe&&it.send(oe,{group_id:n.chat.show.id},"getGroupNotices"),n.chat.show.type==="group"&&Object.keys(n.chat.info.group_files??{}).length===0){const he=(Z=l.jsonMap.group_files)==null?void 0:Z.name;he&&it.send(he,{group_id:n.chat.show.id},"getGroupFiles")}}}function ht(s,c,b){let U=-1;for(let E=0;E<b;E++)if(U=s.indexOf(c,U+1),U<0)return s;return U<0?s:s.slice(0,U)+s.slice(U+c.length)}function Xt(s){const c=S.value[s];if((c==null?void 0:c.type)==="image")return"[图片]";if((c==null?void 0:c.type)==="at"){const b=String(c.qq??c.id??""),U=u.chatInfo.info.group_members.find(J=>String(J.user_id)===b);return"[@"+String(c.text||(U==null?void 0:U.card)||(U==null?void 0:U.nickname)||b)+"]"}return"[SQ:"+s+"]"}function Dn(s){var b;M.value.delete(s);const c=S.value[s];if((c==null?void 0:c.type)==="image"){let U=0;for(let E=0;E<=s;E++)((b=S.value[E])==null?void 0:b.type)==="image"&&U++;x.value=ht(x.value,"[图片]",U)}else x.value=x.value.replace("[SQ:"+s+"]",""),x.value=x.value.replace("[SQ:"+s,"")}async function Vi(s){const c=M.value.get(s);if(!c||!(D!=null&&D.value))return;const b=await D.value.edit(c);M.value.set(s,b)}function zt(s){const c=document.getElementById("main-input")??document.getElementById("main-input-ex");if(s!==void 0){if(s.msgObj.type==="at"){const J=String(s.msgObj.qq??s.msgObj.id??""),Z=u.chatInfo.info.group_members.find(oe=>String(oe.user_id)===J);s.msgObj={...s.msgObj,qq:J,text:String((Z==null?void 0:Z.card)||(Z==null?void 0:Z.nickname)||J)}}const b=S.value.length;if(S.value.push(s.msgObj),!s.addText)return b;const U=Xt(b),E=s.msgObj.type==="at"?" ":"";if(s.addTop===!0)x.value=U+E+x.value;else{const J=c==null?void 0:c.selectionStart,Z=(c==null?void 0:c.selectionEnd)??J;if(J!=null){const oe=x.value.substring(0,J),he=x.value.substring(Z,x.value.length);x.value=oe+U+E+he,wt(()=>{const pe=J+U.length+E.length;c.selectionStart=pe,c.selectionEnd=pe})}else x.value+=U+E}return b}return-1}function ei(s){if(s.clipboardData&&s.clipboardData.items)for(let c=0,b=s.clipboardData.items.length;c<b;c++){const U=s.clipboardData.items[c];U.kind==="file"&&(Bn(U.getAsFile()),s.preventDefault())}}function ti(){const s=document.getElementById("choice-pic");s&&s.click()}function Wi(s){k.value.showMoreDetail=!1;const c=s.target;c&&c.files&&Bn(c.files[0])}function ni(){const s=document.getElementById("choice-file");s&&s.click()}function Qi(){const s=document.getElementById("choice-video");s&&s.click()}function Gi(s){k.value.showMoreDetail=!1;const c=s.target;if(c.files!=null){const b=c.files[0],U=b.name;if(b.size>500*1024*1024){const J={title:f("提醒"),html:`<span>${f("文件大于 500MB。发送速度可能会非常缓慢;确认要发送吗?")}</span>`,button:[{text:f("发送"),fun:()=>{e.popBoxList.shift()}},{text:f("取消"),master:!0,fun:()=>{e.popBoxList.shift()}}]};e.popBoxList.push(J)}else Ji(b,U);c.value=""}}function Ki(s){k.value.showMoreDetail=!1;const c=s.target;if(c.files!=null){const b=c.files[0],U=b.name;b.size>500*1024*1024?new ut().add(Be.ERR,f("视频文件不能超过 500MB")):Yi(b,U),c.value=""}}function ii(s,c,b){const U=c??s.name??f("未知文件"),E=No({fileName:U,fileSize:s.size,execute:J=>{const Z=new FileReader;Z.onprogress=oe=>{oe.lengthComputable&&J(oe.loaded,oe.total)},Z.readAsDataURL(s),Z.onloadend=()=>{let oe=Z.result;oe=oe.substring(oe.indexOf("base64,")+7,oe.length),S.value=[],M.value.clear(),x.value="",zt({addText:!0,msgObj:{type:b,file:"base64://"+oe,name:U}}),Zt("sendFileBack_"+E)},Z.onerror=()=>{Ho(E,"文件读取失败")}}})}function Ji(s,c){ii(s,c,"file")}function Yi(s,c){ii(s,c,"video")}async function Xi(s){if(s.type==="image/gif"||/\.gif$/i.test(s.name||""))return!0;try{const c=await s.slice(0,6).arrayBuffer(),b=new Uint8Array(c);return b.length>=6&&b[0]===71&&b[1]===73&&b[2]===70&&b[3]===56&&(b[4]===55||b[4]===57)&&b[5]===97}catch{return!1}}async function Bn(s){const c=new ut;if(!s||!s.type.includes("image/")||s.size===0)return;const b=await Xi(s);if(s.size>3145728&&!b){const Z={maxSizeMB:3,useWebWorker:!0};try{c.add(Be.INFO,f("正在压缩图片 ……"));const oe=await mt(s,Z);new Dt().add(pn.INFO,"图片压缩成功,原大小:"+s.size/1024/1024+" MB,压缩后大小:"+oe.size/1024/1024+" MB"),Bn(oe)}catch(oe){new Dt().error(oe,"图片压缩失败"),c.add(Be.INFO,f("压缩图片失败"))}return}const U=await oi(s),E=S.value.length,J={type:"image",text:`[${f("图片")}]`};M.value.set(E,U),zt({addText:!0,msgObj:J})}async function oi(s){return new Promise((c,b)=>{const U=new FileReader;U.onload=function(E){E.target?c(E.target.result):b(new Error("读取文件失败"))},U.onerror=function(E){b(E)},U.readAsDataURL(s)})}function Zi(s){return new Promise((c,b)=>{const U=new FileReader;U.onload=function(E){var oe;const J=String(((oe=E.target)==null?void 0:oe.result)??""),Z=J.indexOf("base64,");c(Z>=0?J.slice(Z+7):J)},U.onerror=function(E){b(E)},U.readAsDataURL(s)})}function eo(){var s;if(N.value){(s=F.value)==null||s.stop(),p.value=!1;return}p.value=!p.value}async function to(){var s,c;if(p.value=!1,!N.value){if(!((s=navigator.mediaDevices)!=null&&s.getUserMedia)||typeof MediaRecorder>"u"){new ut().add(Be.ERR,f("当前浏览器不支持录音"));return}try{if((c=navigator.permissions)!=null&&c.query)try{if((await navigator.permissions.query({name:"microphone"})).state==="denied"){new ut().add(Be.ERR,f("麦克风权限被拒绝,请在浏览器设置中允许访问麦克风"));return}}catch{}const b=await navigator.mediaDevices.getUserMedia({audio:!0});_=[];const U=new MediaRecorder(b);F.value=U,N.value=!0,U.ondataavailable=E=>{E.data.size>0&&_.push(E.data)},U.onstop=async()=>{N.value=!1,F.value=null,b.getTracks().forEach(he=>he.stop());const E=new Blob(_,{type:U.mimeType||"audio/webm"}),J=await Zi(E),Z=U.mimeType.includes("mp4")?"voice.m4a":"voice.webm",oe=U.mimeType.includes("mp4")?"audio/mp4":"audio/webm";_.length>0&&(y.value={type:"record",file:"base64://"+J,url:`data:${oe};base64,${J}`,fileName:Z,name:f("语音")},x.value="",S.value=[],M.value.clear()),_=[]},U.start()}catch(b){N.value=!1,F.value=null,b instanceof DOMException&&b.name==="NotAllowedError"&&new ut().add(Be.ERR,f("麦克风权限被拒绝,请在浏览器设置中允许访问麦克风")),new Dt().error(b,f("录音失败"))}}}function no(){y.value=null,p.value=!1,_=[],x.value="",Wt()}function io(){p.value=!1;const s=document.getElementById("choice-audio");s==null||s.click()}async function oo(s){var E;const c=s.target,b=(E=c.files)==null?void 0:E[0];if(c.value="",!b)return;if(!b.type.startsWith("audio/")&&!/\.(mp3|wav|m4a|aac|ogg|webm|flac)$/i.test(b.name)){new ut().add(Be.ERR,f("请选择音频文件"));return}const U=await oi(b);y.value={type:"record",file:U,url:U,fileName:b.name,name:f("语音")},x.value="",S.value=[],M.value.clear(),_=[]}function Wt(){const s=document.getElementById("main-input")??document.getElementById("main-input-ex");s!==null&&s.focus()}function Zt(s="sendMsgBack"){if(T.value[3].open)return;if(T.value.forEach(b=>{b.open=!1}),y.value){const b=y.value;y.value=null,p.value=!1,_=[],n.chat.show.temp?Nt(n.chat.show.id+"/"+n.chat.show.temp,n.chat.show.type,[b],!0,s):Nt(n.chat.show.id,n.chat.show.type,[b],!0,s),x.value="",S.value=[],M.value.clear();return}for(const[b,U]of M.value)S.value[b]={type:"image",file:"base64://"+U.substring(U.indexOf("base64,")+7,U.length)};const c=vi.parseMsg(x.value,S.value,[]);n.chat.show.temp?Nt(n.chat.show.id+"/"+n.chat.show.temp,n.chat.show.type,c,!0,s):Nt(n.chat.show.id,n.chat.show.type,c,!0,s),k.value.checkNewLineFlag=!0,x.value="",S.value=[],M.value.clear(),we(),Ye(),Oe(void 0,!0)}function ai(s,c){var U,E;if(c==0&&s>0){const J=((U=l.jsonMap.set_message_read)==null?void 0:U.name)??void 0;if(!J)return;let Z=((E=l.jsonMap.set_message_read)==null?void 0:E.private_name)??J;Z||(Z=J),u.chatInfo.show.type=="group"?it.send(J,{group_id:n.chat.show.id,message_id:n.list[n.list.length-1].message_id},"setMessageRead"):it.send(Z,{user_id:n.chat.show.id,message_id:n.list[n.list.length-1].message_id},"setMessageRead"),Io()&&Wt()}if(k.value.showBottomButton&&!e.nowGetHistory&&c>0&&(P.value!==0?P.value=P.value+Math.abs(s-c):P.value=Math.abs(s-c)),n.list.length>200&&!e.nowGetHistory&&!k.value.showBottomButton){u.messageList=[];const J={type:n.chat.show.type,id:n.chat.show.id,name:n.chat.show.name,avatar:n.chat.show.avatar,jump:n.chat.show.jump};_o(J),e.nowGetHistory=!0}const b=document.getElementById("msgPan");if(b!==null){const J=b.scrollHeight;wt(()=>{const Z=document.getElementById("msgPan");Z!==null&&(e.nowGetHistory&&rt(Z.scrollHeight-J,!1),e.nowGetHistory||(k.value.showBottomButton||rt(Z.scrollHeight),c<=0&&(rt(Z.scrollHeight,!1),Le()),ue()));const oe=()=>{const he=[];for(const pe of n.list)if(pe.message!==void 0)for(const de of pe.message)de.type==="image"&&de.file!="marketface"&&he.push(de.url);return he};Y.value=Vn.fromList(oe()),u.chatInfo.show&&u.chatInfo.show.jump&&(new Dt().debug("进入跳转至消息:"+u.chatInfo.show.jump),H("chat-"+u.chatInfo.show.jump),u.chatInfo.show.jump=void 0)})}}function ao(s,c){const b=c.message_id;v.value.length>0&&(v.value.indexOf(b)>-1?v.value=v.value.filter(U=>U!=b):v.value.push(b))}function so(){new ut().add(Be.INFO,f("欸嘿,这个按钮只是用来占位置的"))}function ro(){const s=n.list.filter(E=>v.value.indexOf(E.message_id)>-1);let c="",b="";s.forEach(E=>{const J=new Date(Oo(E.time)),Z=J.getFullYear()+"-"+(J.getMonth()+1)+"-"+J.getDate();Z!=b&&(c+=`
|
|
23
|
+
`&&(x.value="",Oe())),!(k.value.onAtFind&&$.value&&$.value.length>0&&(s.keyCode===38||s.keyCode===40||s.keyCode===13||s.keyCode===27))&&s.keyCode!=13)){const b=x.value.substring(x.value.length-1);if(!k.value.onAtFind&&b=="@"&&u.chatInfo.info.group_members.length>0&&u.chatInfo.show.type=="group"&&(c.add(pn.UI,"开始匹配群成员列表 ……"),k.value.onAtFind=!0,m.value=0),k.value.onAtFind)if(x.value.lastIndexOf("@")<0)c.add(pn.UI,"匹配群成员列表被打断 ……"),k.value.onAtFind=!1,$.value=null,m.value=0;else{const U=x.value.substring(x.value.lastIndexOf("@")+1).toLowerCase();$.value=u.chatInfo.info.group_members.filter(E=>E.card!=""&&E.card!=null&&E.card.toLowerCase().indexOf(U)>=0||E.nickname.toLowerCase().indexOf(U)>=0||U==E.user_id.toString()),$.value.length==0&&($.value=u.chatInfo.info.group_members),m.value=0}}}function Te(s){s.preventDefault(),x.value!=""&&Zt()}function tt(s){s!=null&&(x.value=x.value.substring(0,x.value.lastIndexOf("@")),zt({msgObj:{type:"at",qq:String(s)},addText:!0})),Wt(),k.value.onAtFind=!1,$.value=null,m.value=0}function je(){wt(()=>{const s=document.querySelector(".at-tag.show"),c=document.querySelector(".at-tag.show > div.selected");if(s&&c){const b=s.getBoundingClientRect(),U=c.getBoundingClientRect();U.top<b.top?c.scrollIntoView({block:"nearest",behavior:"smooth"}):U.bottom>b.bottom&&c.scrollIntoView({block:"nearest",behavior:"smooth"})}})}function nt(s){!$.value||$.value.length===0||(s===-1?m.value=m.value>0?m.value-1:$.value.length-1:m.value=m.value<$.value.length-1?m.value+1:0,je())}function Ne(){const s=document.getElementById("main-input")??document.getElementById("main-input-ex");if(s!==null&&s.selectionStart===s.selectionEnd){let c=-1;typeof s.selectionStart=="number"&&(c=s.selectionStart);const b=gi.getSQList(x.value);b!=null&&b.forEach(U=>{const E=x.value.indexOf(U),J=E+U.length;E!==-1&&c>E&&c<J&&wt(()=>{s.selectionStart=E,s.selectionEnd=J})})}}function be(s,c){var J;if(A.value=c,k.value.menuDisplay.menuSelectedMsgId=c.message_id,Ai.get("log_level")==="debug"&&new Dt().debug("右击消息:"+c),g.value.length>0)return;const b=document.getElementById("msgMenu"),U=s.target;let E="member";if(u.chatInfo.show.type=="group"&&u.chatInfo.info.group_members&&u.chatInfo.info.group_members.forEach(Z=>{Z.user_id==c.sender.user_id&&(E=Z.role)}),b!==null&&c!==null){if(xo("close_respond")==!0&&(k.value.menuDisplay.showRespond=!1),U.nodeName=="IMG"&&U.name=="avatar")Object.keys(k.value.menuDisplay).forEach(de=>{k.value.menuDisplay[de]=!1}),k.value.menuDisplay.showRespond=!1,k.value.menuDisplay.at=!0,k.value.menuDisplay.poke=!0,k.value.menuDisplay.remove=!0,(u.chatInfo.show.type!="group"||c.sender.user_id===l.loginInfo.uin||u.chatInfo.info.me_info.role==="member"||E=="owner"||E=="admin"&&u.chatInfo.info.me_info.role!="owner")&&(k.value.menuDisplay.remove=!1),c.sender.user_id===l.loginInfo.uin&&(k.value.menuDisplay.at=!1),u.chatInfo.show.type=="group"&&u.chatInfo.info.me_info.role!="member"&&(k.value.menuDisplay.config=!0);else{(c.sender.user_id===l.loginInfo.uin||u.chatInfo.info.me_info.role==="admin"||u.chatInfo.info.me_info.role==="owner")&&(k.value.menuDisplay.revoke=!0),k.value.menuDisplay.reedit=k.value.menuDisplay.revoke&&c.sender.user_id===l.loginInfo.uin,c.revoke===!0&&(k.value.menuDisplay.relpy=!1,k.value.menuDisplay.forward=!1,k.value.menuDisplay.revoke=!1,k.value.menuDisplay.select=!1),T.value[3].open&&(Object.keys(k.value.menuDisplay).forEach(Ge=>{k.value.menuDisplay[Ge]=!1}),k.value.menuDisplay.jumpToMsg=!0);const de=document.getSelection(),Xe=(J=de==null?void 0:de.anchorNode)==null?void 0:J.parentElement;let dt=null,$e=Xe;if($e)for(;$e.className!="chat";){if($e.className.startsWith("message")&&$e.className.indexOf("-")<0){dt=$e;break}if($e=$e.parentElement,!$e)break}Xe&&Xe.className.indexOf("msg-text")>-1&&de.focusNode==de.anchorNode&&dt&&dt.id==c.message_id&&(I.value=de.toString(),I.value.length>0&&(k.value.menuDisplay.copySelect=!0));const Qe=["xml","json"];c.message.forEach(Ge=>{Qe.indexOf(Ge.type)>0&&(k.value.menuDisplay.forward=!1,k.value.menuDisplay.add=!1)}),U.nodeName=="IMG"&&U.src.length>0&&(k.value.menuDisplay.downloadImg=U.src,bt.isDesktop()&&(k.value.menuDisplay.copyImg=!0))}const Z=s.x,oe=s.y;b.style.marginLeft=Z+"px",b.style.marginTop=oe+"px";let he=b.clientWidth;k.value.menuDisplay.showRespond&&(he=b.children[0].clientWidth);const pe=window.innerWidth;Z+he>pe+27&&(b.style.marginLeft=pe+7-he+"px"),k.value.showMsgMenu=!0,wt(()=>{const de=b.clientHeight,Xe=document.body.clientHeight;oe+de>Xe-20&&(b.classList.add("topOut"),b.style.marginTop=Xe-de-10+"px")})}}function Ue(){k.value.menuDisplay={menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,downloadImg:!1,copyImg:!1,revoke:!1,reedit:!1,at:!1,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1}}function lt(s=!0){const c=A.value;c&&(pt(c),s&&He())}function pt(s){const c=s.message_id;A.value=s,zt({msgObj:{type:"reply",id:String(c)},addText:!1,addTop:!0}),k.value.isReply=!0,Wt()}function Je(){S.value=S.value.filter(s=>s.type!=="reply"),k.value.isReply=!1}function at(){var c;if(!A.value)return;const s=((c=A.value)==null?void 0:c._rawSatori)??A.value;try{console.log(JSON.stringify(s,null,2))}catch{console.dir(s,{depth:null})}He()}function We(){Q.value=w.userList,k.value.showForwardPan=!1,R.value="single-message",He()}function ze(s,...c){const b=s;for(const U of c){const E=b[U],J=typeof E=="string"||typeof E=="number"?String(E):"";if(J&&J!=="undefined")return J}return""}function Lt(s){if(s.group_id)return ze(s,"group_name","name")||String(s.group_id);const c=ze(s,"nickname","name","nick","username","remark")||String(s.user_id??""),b=String(s.user_id??"");return b?`${c}(${b})`:c}function kt(s){const c=s.target.value;Q.value=w.userList.filter(b=>{const U=b.user_id?ze(b,"nickname","name","nick","remark")||String(b.user_id):ze(b,"group_name","name")||String(b.group_id||""),E=String(b.user_id??b.group_id??"");return U.toLowerCase().indexOf(c.toLowerCase())!==-1||E.length>0&&E===c})}function yt(s="single-message"){R.value=s,k.value.showForwardPan=!0,[...w.onMsgList].reverse().forEach(b=>{const U=Q.value.indexOf(b);U>-1&&(Q.value.splice(U,1),Q.value.unshift(b))}),He()}function Ee(){if(A.value){const s=JSON.parse(JSON.stringify(A.value));Nt(n.chat.show.id,n.chat.show.type,s.message,!0)}He()}function fn(){A.value&&g.value.push(A.value.message_id),He()}function Mt(s){const c=_i(s);if(typeof structuredClone=="function")try{return structuredClone(c)}catch{return JSON.parse(JSON.stringify(c))}return JSON.parse(JSON.stringify(c))}function qt(s){const c=R.value,b=A.value?Mt(A.value):null,U=s.group_id?s.group_id:s.user_id,E=String(U),J=s.group_id?"group":"user",Z=String(s.channel_id??s.channelId??""),oe=String(s.guild_id??s.guildId??""),he=u.messageList.filter(de=>g.value.includes(de.message_id)),pe=()=>String(n.chat.show.id)===E&&n.chat.show.type===J;if(c!=="single-message"&&he.length===0){We();return}if(c==="individual-messages"){const de={title:f("逐条转发"),html:f("将按顺序逐条转发 {count} 条消息,是否继续?",{count:he.length}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:()=>{he.forEach(Xe=>{Nt(E,J,Mt(Xe.message),pe(),"sendMsgBack",Z||void 0,oe||void 0)}),g.value=[],e.popBoxList.shift(),Yt(s,U)}}]};e.popBoxList.push(de)}else if(c==="merged-messages"){const de={app:"com.tencent.multimsg",meta:{detail:{source:f("合并转发消息"),news:[...he.slice(0,3).map($e=>({text:($e.sender.card&&$e.sender.card!=""?$e.sender.card:$e.sender.nickname)+": "+an($e)}))],summary:f("查看 {count} 条转发消息",{count:he.length}),resid:""}}},Xe={message:[{type:"json",data:JSON.stringify(de),id:""}],sender:{user_id:l.loginInfo.uin,nickname:l.loginInfo.nickname,avatar:l.loginInfo.avatar}},dt={title:f("合并转发消息"),template:sn(ln),templateValue:sn({data:Xe,type:"forward"}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:async()=>{const $e=he.map(Ge=>{var Ot,mn,en;return{type:"node",id:Ge.message_id,user_id:String(((Ot=Ge.sender)==null?void 0:Ot.user_id)??""),nickname:String(((mn=Ge.sender)==null?void 0:mn.card)||((en=Ge.sender)==null?void 0:en.nickname)||""),time:Ge.time,content:Mt(Ge.message)}}),Qe=await Fo(String(l.loginInfo.platform??""),String(l.loginInfo.uin??""),J,E,$e,Z||void 0);if(!Qe.ok)new ut().add(Be.ERR,f("合并转发发送失败"));else{const Ge=Date.now(),Ot={fake_msg:"pending",message_id:"forward-"+Ge,fake_message_id:"forward-"+Ge,message_type:J,channel_type:J==="group"?0:1,time:Math.floor(Ge/1e3),local_time:Ge,timestamp_ms:Ge,post_type:"message",sender:{user_id:String(l.loginInfo.uin??""),nickname:String(l.loginInfo.nickname??""),avatar:String(l.loginInfo.avatar??"")},message:[{type:"forward",id:"",content:$e.map(Rt=>({message_id:String(Rt.id??""),time:Number(Rt.time??Math.floor(Ge/1e3)),sender:{user_id:String(Rt.user_id??""),nickname:String(Rt.nickname??"")},message:Rt.content??[]}))}],raw_message:`[${f("聊天记录")}]`};pe()&&(u.messageList.push(Ot),wt(()=>{nn("chat-"+Ot.message_id,!0)}));const mn=Qe.channelId||Z||E;Qe.native&&!Qe.messageId||await Lo({id:String(Ot.fake_message_id??""),platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:mn,guildId:oe||void 0,channelType:J,messageId:Qe.messageId,content:String(Ot.raw_message??""),message:Ot.message,forwardContent:$e,source:"webui",sentAt:Ge,kind:"forward"});const en=Z||E,Qt=w.baseOnMsgList.get(wn(en));if(Qt){const Rt=`[${f("聊天记录")}]`;Qt.raw_msg_base=Rt,Qt.raw_msg=Qt.group_id?`${String(l.loginInfo.nickname??"")}: ${Rt}`:Rt,Qt.time=Math.floor(Ge/1e3),w.baseOnMsgList.set(wn(en),Qt),$o()}}g.value=[],e.popBoxList.shift(),Yt(s,U)}}]};e.popBoxList.push(dt)}else if(A.value&&b){const de={title:f("转发消息"),template:sn(ln),templateValue:sn({data:b,type:"forward"}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:()=>{Nt(E,J,Mt(b.message),pe(),"sendMsgBack",Z||void 0,oe||void 0),e.popBoxList.shift(),Yt(s,U)}}]};e.popBoxList.push(de)}}function Yt(s,c){We();const b=String(s.channel_id??s.channelId??c??"");w.baseOnMsgList.get(wn(b))==null&&w.baseOnMsgList.set(wn(b),s),wt(()=>{const U=document.getElementById("user-"+c);U&&U.click()})}function ke(){const s=A.value;if(s!==null){s.raw_message||(s.raw_message=an(s));const c=new ut;Jt.config.globalProperties.$copyText(s.raw_message).then(()=>{c.add(Be.INFO,f("复制成功"),!0)},()=>{c.add(Be.ERR,f("复制失败"),!0)})}He()}function st(){if(I.value!=""){const s=new ut;Jt.config.globalProperties.$copyText(I.value).then(()=>{s.add(Be.INFO,f("复制成功"),!0)},()=>{s.add(Be.ERR,f("复制失败"),!0)})}He()}async function At(){const s=k.value.menuDisplay.downloadImg;if(!s)return;He();const{blob:c,buffer:b}=await Ro(s),U=new ut;if(bt.type==="tauri")try{await(await Mi(()=>import("./index-Cg_esKB0.js"),__vite__mapDeps([0,1]),import.meta.url)).writeImage(b),U.add(Be.INFO,f("复制成功"))}catch(E){U.add(Be.ERR,f("复制失败")),new Dt().error(E,"复制图片失败")}else{const E=new ClipboardItem({[c.type]:c});try{await Do([E]),U.add(Be.INFO,f("复制成功"))}catch(J){U.add(Be.ERR,f("复制失败")),new Dt().error(J,"复制图片失败")}}}function Et(){const s=k.value.menuDisplay.downloadImg;s!=!1&&Bo(s,`img_${new Date().getTime()}.png`,()=>{},()=>{}),He()}async function Vt(){const s=A.value;if(He(),!s){new ut().add(Be.ERR,f("获取选中消息失败"));return}const c=s.message_id,b=String(s.channel_id??s.channelId??u.chatInfo.show.channel_id??n.chat.show.id);try{await it.callApi("delete_msg",{channel_id:b,message_id:c})}catch{new ut().add(Be.ERR,f("撤回失败"));return}s.revoke=!0,s.revoked=!0,s.revokeTime=Date.now()/1e3}async function dn(){const s=A.value;if(He(),!s){new ut().add(Be.ERR,f("获取选中消息失败"));return}const c=s.message_id,b=String(s.channel_id??s.channelId??u.chatInfo.show.channel_id??n.chat.show.id);await it.callApi("delete_msg",{channel_id:b,message_id:c}),co(s)}function Ye(){const s=A.value;if(s!==null){const c={title:f("提醒"),html:`<span>${f("真的要将 {user} 移出群聊吗",{user:s.sender.nickname})}</span>`,button:[{text:f("确定"),fun:()=>{s&&(it.send("set_group_kick",{group_id:u.chatInfo.show.id,user_id:s.sender.user_id},"setGroupKick"),He(),e.popBoxList.shift())}},{text:f("取消"),master:!0,fun:()=>{e.popBoxList.shift()}}]};e.popBoxList.push(c)}}function He(){k.value.showMsgMenu=!1,k.value.menuDisplay.menuSelectedMsgId=null,setTimeout(()=>{Ue()},300)}function $t(){var s,c,b,U,E,J,Z;if(k.value.openChatInfo=!k.value.openChatInfo,k.value.openChatInfo){if(n.chat.show.type==="group"&&((s=n.chat.info.group_info)==null?void 0:s.gc)!==n.chat.show.id){const he=`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_info_all?gc=${n.chat.show.id}&bkn=${l.loginInfo.bkn}`;it.send("http_proxy",{url:he},"getMoreGroupInfo")}else if(n.chat.show.type==="user"&&((c=n.chat.info.user_info)==null?void 0:c.uin)!==n.chat.show.id){const he=(U=(b=l.jsonMap)==null?void 0:b.friend_info)==null?void 0:U.name;he!=null&&it.send(he,{user_id:n.chat.show.id},"getMoreUserInfo")}const oe=(J=(E=l.jsonMap)==null?void 0:E.group_notices)==null?void 0:J.name;if(n.chat.show.type==="group"&&(n.chat.info.group_notices===void 0||Object.keys(n.chat.info.group_notices??{}).length===0)&&oe&&it.send(oe,{group_id:n.chat.show.id},"getGroupNotices"),n.chat.show.type==="group"&&Object.keys(n.chat.info.group_files??{}).length===0){const he=(Z=l.jsonMap.group_files)==null?void 0:Z.name;he&&it.send(he,{group_id:n.chat.show.id},"getGroupFiles")}}}function ht(s,c,b){let U=-1;for(let E=0;E<b;E++)if(U=s.indexOf(c,U+1),U<0)return s;return U<0?s:s.slice(0,U)+s.slice(U+c.length)}function Xt(s){const c=S.value[s];if((c==null?void 0:c.type)==="image")return"[图片]";if((c==null?void 0:c.type)==="at"){const b=String(c.qq??c.id??""),U=u.chatInfo.info.group_members.find(J=>String(J.user_id)===b);return"[@"+String(c.text||(U==null?void 0:U.card)||(U==null?void 0:U.nickname)||b)+"]"}return"[SQ:"+s+"]"}function Dn(s){var b;M.value.delete(s);const c=S.value[s];if((c==null?void 0:c.type)==="image"){let U=0;for(let E=0;E<=s;E++)((b=S.value[E])==null?void 0:b.type)==="image"&&U++;x.value=ht(x.value,"[图片]",U)}else x.value=x.value.replace("[SQ:"+s+"]",""),x.value=x.value.replace("[SQ:"+s,"")}async function qi(s){const c=M.value.get(s);if(!c||!(D!=null&&D.value))return;const b=await D.value.edit(c);M.value.set(s,b)}function zt(s){const c=document.getElementById("main-input")??document.getElementById("main-input-ex");if(s!==void 0){if(s.msgObj.type==="at"){const J=String(s.msgObj.qq??s.msgObj.id??""),Z=u.chatInfo.info.group_members.find(oe=>String(oe.user_id)===J);s.msgObj={...s.msgObj,qq:J,text:String((Z==null?void 0:Z.card)||(Z==null?void 0:Z.nickname)||J)}}const b=S.value.length;if(S.value.push(s.msgObj),!s.addText)return b;const U=Xt(b),E=s.msgObj.type==="at"?" ":"";if(s.addTop===!0)x.value=U+E+x.value;else{const J=c==null?void 0:c.selectionStart,Z=(c==null?void 0:c.selectionEnd)??J;if(J!=null){const oe=x.value.substring(0,J),he=x.value.substring(Z,x.value.length);x.value=oe+U+E+he,wt(()=>{const pe=J+U.length+E.length;c.selectionStart=pe,c.selectionEnd=pe})}else x.value+=U+E}return b}return-1}function ei(s){if(s.clipboardData&&s.clipboardData.items)for(let c=0,b=s.clipboardData.items.length;c<b;c++){const U=s.clipboardData.items[c];U.kind==="file"&&(Bn(U.getAsFile()),s.preventDefault())}}function ti(){const s=document.getElementById("choice-pic");s&&s.click()}function Vi(s){k.value.showMoreDetail=!1;const c=s.target;c&&c.files&&Bn(c.files[0])}function ni(){const s=document.getElementById("choice-file");s&&s.click()}function Wi(){const s=document.getElementById("choice-video");s&&s.click()}function Qi(s){k.value.showMoreDetail=!1;const c=s.target;if(c.files!=null){const b=c.files[0],U=b.name;if(b.size>500*1024*1024){const J={title:f("提醒"),html:`<span>${f("文件大于 500MB。发送速度可能会非常缓慢;确认要发送吗?")}</span>`,button:[{text:f("发送"),fun:()=>{e.popBoxList.shift()}},{text:f("取消"),master:!0,fun:()=>{e.popBoxList.shift()}}]};e.popBoxList.push(J)}else Ki(b,U);c.value=""}}function Gi(s){k.value.showMoreDetail=!1;const c=s.target;if(c.files!=null){const b=c.files[0],U=b.name;b.size>500*1024*1024?new ut().add(Be.ERR,f("视频文件不能超过 500MB")):Ji(b,U),c.value=""}}function ii(s,c,b){const U=c??s.name??f("未知文件"),E=No({fileName:U,fileSize:s.size,execute:J=>{const Z=new FileReader;Z.onprogress=oe=>{oe.lengthComputable&&J(oe.loaded,oe.total)},Z.readAsDataURL(s),Z.onloadend=()=>{let oe=Z.result;oe=oe.substring(oe.indexOf("base64,")+7,oe.length),S.value=[],M.value.clear(),x.value="",zt({addText:!0,msgObj:{type:b,file:"base64://"+oe,name:U}}),Zt("sendFileBack_"+E)},Z.onerror=()=>{Ho(E,"文件读取失败")}}})}function Ki(s,c){ii(s,c,"file")}function Ji(s,c){ii(s,c,"video")}async function Yi(s){if(s.type==="image/gif"||/\.gif$/i.test(s.name||""))return!0;try{const c=await s.slice(0,6).arrayBuffer(),b=new Uint8Array(c);return b.length>=6&&b[0]===71&&b[1]===73&&b[2]===70&&b[3]===56&&(b[4]===55||b[4]===57)&&b[5]===97}catch{return!1}}async function Bn(s){const c=new ut;if(!s||!s.type.includes("image/")||s.size===0)return;const b=await Yi(s);if(s.size>3145728&&!b){const Z={maxSizeMB:3,useWebWorker:!0};try{c.add(Be.INFO,f("正在压缩图片 ……"));const oe=await mt(s,Z);new Dt().add(pn.INFO,"图片压缩成功,原大小:"+s.size/1024/1024+" MB,压缩后大小:"+oe.size/1024/1024+" MB"),Bn(oe)}catch(oe){new Dt().error(oe,"图片压缩失败"),c.add(Be.INFO,f("压缩图片失败"))}return}const U=await oi(s),E=S.value.length,J={type:"image",text:`[${f("图片")}]`};M.value.set(E,U),zt({addText:!0,msgObj:J})}async function oi(s){return new Promise((c,b)=>{const U=new FileReader;U.onload=function(E){E.target?c(E.target.result):b(new Error("读取文件失败"))},U.onerror=function(E){b(E)},U.readAsDataURL(s)})}function Xi(s){return new Promise((c,b)=>{const U=new FileReader;U.onload=function(E){var oe;const J=String(((oe=E.target)==null?void 0:oe.result)??""),Z=J.indexOf("base64,");c(Z>=0?J.slice(Z+7):J)},U.onerror=function(E){b(E)},U.readAsDataURL(s)})}function Zi(){var s;if(N.value){(s=F.value)==null||s.stop(),v.value=!1;return}v.value=!v.value}async function eo(){var s,c;if(v.value=!1,!N.value){if(!((s=navigator.mediaDevices)!=null&&s.getUserMedia)||typeof MediaRecorder>"u"){new ut().add(Be.ERR,f("当前浏览器不支持录音"));return}try{if((c=navigator.permissions)!=null&&c.query)try{if((await navigator.permissions.query({name:"microphone"})).state==="denied"){new ut().add(Be.ERR,f("麦克风权限被拒绝,请在浏览器设置中允许访问麦克风"));return}}catch{}const b=await navigator.mediaDevices.getUserMedia({audio:!0});_=[];const U=new MediaRecorder(b);F.value=U,N.value=!0,U.ondataavailable=E=>{E.data.size>0&&_.push(E.data)},U.onstop=async()=>{N.value=!1,F.value=null,b.getTracks().forEach(he=>he.stop());const E=new Blob(_,{type:U.mimeType||"audio/webm"}),J=await Xi(E),Z=U.mimeType.includes("mp4")?"voice.m4a":"voice.webm",oe=U.mimeType.includes("mp4")?"audio/mp4":"audio/webm";_.length>0&&(p.value={type:"record",file:"base64://"+J,url:`data:${oe};base64,${J}`,fileName:Z,name:f("语音")},x.value="",S.value=[],M.value.clear()),_=[]},U.start()}catch(b){N.value=!1,F.value=null,b instanceof DOMException&&b.name==="NotAllowedError"&&new ut().add(Be.ERR,f("麦克风权限被拒绝,请在浏览器设置中允许访问麦克风")),new Dt().error(b,f("录音失败"))}}}function to(){p.value=null,v.value=!1,_=[],x.value="",Wt()}function no(){v.value=!1;const s=document.getElementById("choice-audio");s==null||s.click()}async function io(s){var E;const c=s.target,b=(E=c.files)==null?void 0:E[0];if(c.value="",!b)return;if(!b.type.startsWith("audio/")&&!/\.(mp3|wav|m4a|aac|ogg|webm|flac)$/i.test(b.name)){new ut().add(Be.ERR,f("请选择音频文件"));return}const U=await oi(b);p.value={type:"record",file:U,url:U,fileName:b.name,name:f("语音")},x.value="",S.value=[],M.value.clear(),_=[]}function Wt(){const s=document.getElementById("main-input")??document.getElementById("main-input-ex");s!==null&&s.focus()}function Zt(s="sendMsgBack"){if(T.value[3].open)return;if(T.value.forEach(b=>{b.open=!1}),p.value){const b=p.value;p.value=null,v.value=!1,_=[],n.chat.show.temp?Nt(n.chat.show.id+"/"+n.chat.show.temp,n.chat.show.type,[b],!0,s):Nt(n.chat.show.id,n.chat.show.type,[b],!0,s),x.value="",S.value=[],M.value.clear();return}for(const[b,U]of M.value)S.value[b]={type:"image",file:"base64://"+U.substring(U.indexOf("base64,")+7,U.length)};const c=gi.parseMsg(x.value,S.value,[]);n.chat.show.temp?Nt(n.chat.show.id+"/"+n.chat.show.temp,n.chat.show.type,c,!0,s):Nt(n.chat.show.id,n.chat.show.type,c,!0,s),k.value.checkNewLineFlag=!0,x.value="",S.value=[],M.value.clear(),we(),Je(),Oe(void 0,!0)}function ai(s,c){var U,E;if(c==0&&s>0){const J=((U=l.jsonMap.set_message_read)==null?void 0:U.name)??void 0;if(!J)return;let Z=((E=l.jsonMap.set_message_read)==null?void 0:E.private_name)??J;Z||(Z=J),u.chatInfo.show.type=="group"?it.send(J,{group_id:n.chat.show.id,message_id:n.list[n.list.length-1].message_id},"setMessageRead"):it.send(Z,{user_id:n.chat.show.id,message_id:n.list[n.list.length-1].message_id},"setMessageRead"),Io()&&Wt()}if(k.value.showBottomButton&&!e.nowGetHistory&&c>0&&(P.value!==0?P.value=P.value+Math.abs(s-c):P.value=Math.abs(s-c)),n.list.length>200&&!e.nowGetHistory&&!k.value.showBottomButton){u.messageList=[];const J={type:n.chat.show.type,id:n.chat.show.id,name:n.chat.show.name,avatar:n.chat.show.avatar,jump:n.chat.show.jump};_o(J),e.nowGetHistory=!0}const b=document.getElementById("msgPan");if(b!==null){const J=b.scrollHeight;wt(()=>{const Z=document.getElementById("msgPan");Z!==null&&(e.nowGetHistory&&rt(Z.scrollHeight-J,!1),e.nowGetHistory||(k.value.showBottomButton||rt(Z.scrollHeight),c<=0&&(rt(Z.scrollHeight,!1),Le()),ue()));const oe=()=>{const he=[];for(const pe of n.list)if(pe.message!==void 0)for(const de of pe.message)de.type==="image"&&de.file!="marketface"&&he.push(de.url);return he};Y.value=Vn.fromList(oe()),u.chatInfo.show&&u.chatInfo.show.jump&&(new Dt().debug("进入跳转至消息:"+u.chatInfo.show.jump),H("chat-"+u.chatInfo.show.jump),u.chatInfo.show.jump=void 0)})}}function oo(s,c){const b=c.message_id;g.value.length>0&&(g.value.indexOf(b)>-1?g.value=g.value.filter(U=>U!=b):g.value.push(b))}function ao(){new ut().add(Be.INFO,f("欸嘿,这个按钮只是用来占位置的"))}function so(){const s=n.list.filter(E=>g.value.indexOf(E.message_id)>-1);let c="",b="";s.forEach(E=>{const J=new Date(Oo(E.time)),Z=J.getFullYear()+"-"+(J.getMonth()+1)+"-"+J.getDate();Z!=b&&(c+=`
|
|
24
24
|
—— `+Z+` ——
|
|
25
25
|
`,b=Z),c+=E.sender.nickname+" "+J.getHours()+":"+J.getMinutes()+":"+J.getSeconds()+`
|
|
26
26
|
`+an(E)+`
|
|
27
27
|
|
|
28
|
-
`});const U=new ut;Jt.config.globalProperties.$copyText(c).then(()=>{U.add(Be.INFO,f("复制成功"),!0),v.value=[]},()=>{U.add(Be.ERR,f("复制失败"),!0)})}async function lo(){const s=n.list.filter(b=>v.value.includes(b.message_id)),c=[];for(const b of s){const U=b.message_id,E=String(b.channel_id??b.channelId??u.chatInfo.show.channel_id??n.chat.show.id);c.push(it.callApi("delete_msg",{channel_id:E,message_id:U}))}v.value=[],await Promise.all(c)}async function si(s){const c=s.target;Oe(c);const b=Uo(x.value,q.value);let{end:U,str:E}={end:0,str:""};if(b.length>0&&({end:U,str:E}=b[0]),E.indexOf("]")>=0){const J=q.value.substring(0,U),Z=J.lastIndexOf("[图片]");if(Z>=0&&Z<U){let pe=0,de=-1;for(;(de=J.indexOf("[图片]",de+1))>=0;)pe++;const dt=S.value.map(($e,Qe)=>($e==null?void 0:$e.type)==="image"?Qe:-1).filter($e=>$e>=0)[pe-1];dt!==void 0&&M.value.has(dt)&&Dn(dt)}const oe=q.value.substring(0,U).lastIndexOf("[SQ:");if(oe>=0&&oe<U){const pe=q.value.substring(oe),Ze=q.value.slice(oe,pe.indexOf("]")+oe+1).replace("[SQ:","").replace("]",""),dt=Number(Ze);!isNaN(dt)&&M.value.has(dt)&&Dn(dt)}if(q.value.substring(0,U).match(/\[@[^\]]+\]$/)){const pe=S.value.findIndex(de=>(de==null?void 0:de.type)==="at");pe>=0&&S.value.splice(pe,1)}}if(T.value[3].open){C.value&&(clearTimeout(C.value),C.value=null);const J=c.value;if(J.length==0)z.value++,k.value.search.list=vn(n.list);else if(t.sysConfig.enable_local_history){const Z=++z.value;C.value=setTimeout(async()=>{const oe=await zo(l.loginInfo.uin,u.chatInfo.show.channel_id??u.chatInfo.show.id,J);Z!==z.value||!T.value[3].open||(k.value.search.list=oe)},180)}else z.value++,k.value.search.list=n.list.filter(Z=>an(Z).indexOf(J)!==-1)}}function uo(){T.value[3].open=!T.value[3].open,k.value.showMoreDetail=!k.value.showMoreDetail}function ri(){C.value&&(clearTimeout(C.value),C.value=null),z.value++,T.value[3].open=!T.value[3].open,x.value="",k.value.search.list=vn(n.list),Oe()}function li(s){var c;if(l.jsonMap.poke){let b=(c=l.jsonMap.poke)==null?void 0:c.name;n.chat.show.type=="user"&&l.jsonMap.poke.private_name&&(b=l.jsonMap.poke.private_name),it.send(b,{user_id:s,group_id:n.chat.show.id},"sendPoke")}k.value.showMoreDetail=!1,k.value.menuDisplay.poke=!1}function co(s){x.value="",S.value=[],M.value.clear(),Ye();for(const c of s.message)if(c.type==="text")x.value+=c.text;else if(c.type==="reply"){const b=n.list.find(U=>U.message_id==c.id);if(!b)continue;pt(b)}else c.type==="record"||c.type==="audio"?(y.value={...c,name:c.name||f("语音")},x.value="",S.value=[],M.value.clear()):(zt({addText:!1,msgObj:c}),x.value+=Xt(S.value.length-1));Wt()}function fo(s){var b,U;const c=s.target;if(c.scrollTop+c.clientHeight===c.scrollHeight&&!k.value.isJinLoading&&n.chat.info.jin_info.is_end==!1){k.value.isJinLoading=!0;const E=((U=(b=l.jsonMap)==null?void 0:b.group_essence)==null?void 0:U.name)??"get_essence_msg_list";it.send(E,{group_id:n.chat.show.id,pages:n.chat.info.jin_info.pages+1},"getJin")}}function ho(s){D!=null&&D.value&&D.value.open(new Vn(s))}function ui(s="default"){let c=!1;if(T.value.forEach(b=>{b.open&&(c=!0),b.open=!1}),!c){if(k.value.showMoreDetail){k.value.showMoreDetail=!1;return}switch(s){case"default":k.value.showMoreDetail=!0;break;case"img":ti();break;case"file":ni();break;case"face":T.value[1].open=!T.value[1].open;break}}}function On(){var c;const s=document.getElementById("chat-pan");if(s)return k.value.openChatInfo?s.getElementsByClassName("chat-info-pan")[0]:(c=L.value)!=null&&c.isMergeOpen()?s.getElementsByClassName("merge-pan")[0]:s}function hn(){var s,c;k.value.openChatInfo?$t():(s=L.value)!=null&&s.isMergeOpen()?((c=L.value)==null||c.closeMergeMsg(),setTimeout(()=>{const U=document.getElementById("chat-pan").getElementsByClassName("merge-pan")[0];U&&(U.style.transform="")},500)):(u.chatInfo.show.id=0,e.openSideBar=!0,new Dt().add(pn.UI,"右滑打开侧边栏触发完成"))}return(s,c)=>{var U;const b=Ln("font-awesome-icon");return Ce((W(),ee("div",{id:"chat-pan",class:gt("chat-pan"+(B(e).openSideBar?" open":"")+(["linux","win32"].includes(B(bt).platform??"")?" withBar":"")),style:In({"background-image":B(Ao)(B(t).sysConfig.chat_more_blur?"":B(t).sysConfig.chat_background),"background-position":B(t).sysConfig.chat_background_align??"center","background-size":B(t).sysConfig.chat_background_fit??"cover"}),onVMoveRight:c[22]||(c[22]=Un(E=>hn(),["prevent"]))},[Pt(s.$slots,"chat-extra",{},void 0,!0),g("div",Hs,[ie(b,{class:"back",icon:["fas","angle-left"],onClick:hn}),g("img",{"data-avatar":"",src:n.chat.show.avatar||"/img/icons/icon.svg",onError:c[0]||(c[0]=(...E)=>B(Sn)&&B(Sn)(...E))},null,40,Ps),g("div",js,[g("p",null,[yn(G(n.chat.show.name)+" ",1),n.chat.show.type=="group"?(W(),ee(Ie,{key:0},[yn(" ("+G(n.chat.info.group_members.length)+") ",1)],64)):me("",!0)]),n.chat.show.temp?(W(),ee("span",qs,G(B(f)("来自群聊:{group}",{group:n.chat.show.temp})),1)):(W(),ee("span",Vs,[n.chat.show.appendInfo?(W(),ee(Ie,{key:0},[yn(G(n.chat.show.appendInfo),1)],64)):(W(),ee(Ie,{key:1},[yn(G(n.list[n.list.length-1]?B(f)("上次消息 - {time}",{time:Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(n.list[n.list.length-1].time*1e3))}):B(f)("暂无消息")),1)],64))]))]),c[23]||(c[23]=g("div",{class:"space"},null,-1)),g("div",Ws,[ie(b,{icon:["fas","ellipsis-vertical"],onClick:$t})])]),g("div",{class:gt("loading"+(B(e).nowGetHistory&&B(e).canLoadHistory?" show":""))},[ie(b,{icon:["fas","spinner"]}),g("span",null,G(B(f)("加载中")),1)],2),g("div",{id:"msgPan",ref_key:"msgPan",ref:i,class:"chat",style:{"scroll-behavior":"smooth"},onScroll:c[1]||(c[1]=E=>ft(E,T.value[3].open))},[T.value[3].open?(W(),Me(qn,{key:1,name:B(t).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:It(()=>[(W(!0),ee(Ie,null,vt(k.value.search.list,(E,J)=>(W(),ee(Ie,null,[B(jn)(n.list[Number(J)-1]?n.list[Number(J)-1].time:void 0,E.time)?(W(),Me(Ht,{key:"notice-time-"+J,data:{sub_type:"time",time:E.time}},null,8,["data"])):me("",!0),(E.post_type==="message"||E.post_type==="message_sent")&&E.message.length>0?(W(),Me(ln,{key:E.fake_message_id??E.message_id,selected:v.value.includes(E.message_id)||k.value.menuDisplay.menuSelectedMsgId==E.message_id,selecting:v.value.length>0,data:E,onScrollToMsg:B(nn),onShowMenu:be,onImageLoaded:V,onLeftMove:pt,onContentRendered:Le},null,8,["selected","selecting","data","onScrollToMsg"])):me("",!0)],64))),256))]),_:1},8,["name"])):(W(),ee(Ie,{key:0},[B(e).canLoadHistory?me("",!0):(W(),ee("div",Qs,[c[24]||(c[24]=g("hr",null,null,-1)),g("a",null,G(B(f)("没有更多消息了")),1)])),B(e).loadHistoryFail?(W(),ee("div",Gs,[c[25]||(c[25]=g("hr",null,null,-1)),g("a",null,G(B(f)("获取历史记录失败")),1)])):me("",!0),B(e).nowGetHistory&&n.list.length>0?(W(),Me(Ht,{key:2,data:{sub_type:"time",time:n.list[0].time}},null,8,["data"])):me("",!0),ie(qn,{name:B(t).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:It(()=>[(W(!0),ee(Ie,null,vt(n.list,(E,J)=>(W(),ee(Ie,null,[B(jn)(n.list[Number(J)-1]?n.list[Number(J)-1].time:void 0,E.time)?(W(),Me(Ht,{key:"notice-time-"+(E.time/240).toFixed(0),data:{sub_type:"time",time:E.time}},null,8,["data"])):me("",!0),B(xi)(E)?(W(),Me(Ht,{key:"delete-"+E.message_id,data:{sub_type:"delete"}})):(E.post_type==="message"||E.post_type==="message_sent")&&E.message.length>0?(W(),Me(ln,{key:E.fake_message_id??E.message_id,selected:v.value.includes(E.message_id)||k.value.menuDisplay.menuSelectedMsgId==E.message_id,selecting:v.value.length>0,data:E,"image-list-header":Y.value,onClick:Z=>ao(Z,E),onShowMenu:be,onScrollToMsg:B(nn),onImageLoaded:V,onLeftMove:pt,onSendPoke:li,onContentRendered:Le},null,8,["selected","selecting","data","image-list-header","onClick","onScrollToMsg"])):E.post_type==="notice"?(W(),Me(Ht,{id:B(Ei)(),key:"notice-"+J,data:E},null,8,["id","data"])):me("",!0)],64))),256))]),_:1},8,["name"])],64)),g("span",{ref_key:"chatPadding",ref:a,class:"chat-padding"}," ",512)],544),g("div",{class:"new-msg",style:In({opacity:k.value.showBottomButton?1:0}),onClick:c[2]||(c[2]=E=>we(!0))},[g("div",Ks,[ie(b,{icon:["fas","angle-down"]}),P.value>0?(W(),ee("span",Js,G(P.value),1)):me("",!0)])],4),g("div",{id:"send-more",ref_key:"sendMore",ref:o,class:"more"},[g("div",null,[g("div",null,[ie(on,{name:"pan"},{default:It(()=>[Ce(ie(Ts,{onAddSpecialMsg:zt,onSendMsg:Zt},null,512),[[Ke,T.value[1].open]])]),_:1}),ie(on,{name:"pan"},{default:It(()=>[Ce(g("div",Ys,[g("div",null,[ie(b,{icon:["fas","message"]}),g("span",null,G(B(f)("精华消息")),1),ie(b,{icon:["fas","xmark"],onClick:c[3]||(c[3]=E=>T.value[2].open=!T.value[2].open)})]),g("div",{class:"jin-pan-body",onScroll:fo},[(W(!0),ee(Ie,null,vt(n.chat.info.jin_info.list,(E,J)=>(W(),ee("div",{key:"jin-"+J},[g("div",null,[g("img",{"data-avatar":"",src:E.sender_avatar||"/img/icons/icon.svg"},null,8,Xs),g("div",null,[g("a",null,G(E.sender_nick),1),g("span",null,G(E.sender_time?Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric"}).format(new Date(E.sender_time*1e3)):"")+" "+G(B(f)("发送")),1)]),g("span",null,G(B(f)("{time},由 {name} 设置",{time:E.sender_time?Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric"}).format(new Date(E.sender_time*1e3)):"",name:E.add_digest_nick})),1)]),g("div",Zs,[(W(!0),ee(Ie,null,vt(E.msg_content,(Z,oe)=>(W(),ee(Ie,{key:"jinc-"+J+"-"+oe},[Z.type==="text"?(W(),ee("span",er,G(Z.data.text),1)):me("",!0),Z.type==="face"?(W(),Me(Wn,{key:1,emoji:B(rn).get(Number(Z.data.id))},null,8,["emoji"])):me("",!0),Z.type==="image"?(W(),ee("img",{key:2,src:Z.data.url,onClick:he=>ho(Z.data.url)},null,8,tr)):me("",!0)],64))),128))])]))),128)),Ce(g("div",nr,[ie(b,{icon:["fas","spinner"]})],512),[[Ke,k.value.isJinLoading]])],32)],512),[[Ke,T.value[2].open&&n.chat.info.jin_info.list.length>0]])]),_:1})]),g("div",{class:gt(v.value.length>0?"select-tag show":"select-tag")},[g("div",null,[ie(b,{icon:["fas","share-from-square"],onClick:c[4]||(c[4]=E=>yt("individual-messages"))}),g("span",null,G(B(f)("逐条转发")),1)]),g("div",null,[ie(b,{icon:["fas","share"],onClick:c[5]||(c[5]=E=>yt("merged-messages"))}),g("span",null,G(B(f)("合并转发")),1)]),g("div",null,[ie(b,{icon:["fas","scissors"]}),g("span",null,G(B(f)("截图")),1)]),g("div",null,[ie(b,{icon:["fas","trash-can"],onClick:so}),g("span",null,G(B(f)("删除")),1)]),g("div",null,[ie(b,{icon:["fas","copy"],onClick:ro}),g("span",null,G(B(f)("复制")),1)]),g("div",null,[ie(b,{icon:["fas","xmark"],onClick:lo}),g("span",null,G(B(f)("撤回")),1)]),g("div",null,[g("span",{onClick:c[6]||(c[6]=E=>v.value=[])},G(v.value.length),1),g("span",null,G(B(f)("取消")),1)])],2),ie(on,{name:"img-pan"},{default:It(()=>[Ce(g("div",{class:gt({"img-pan":!0,"ss-card":!0}),onWheel:c[7]||(c[7]=E=>E.currentTarget.scrollLeft+=E.deltaY)},[g("div",ir,[(W(!0),ee(Ie,null,vt(M.value,([E,J])=>(W(),ee("div",{key:"imgCache-"+E},[g("div",or,[g("div",{onClick:Z=>Vi(E)},[ie(b,{icon:["fas","pencil"]})],8,ar),c[26]||(c[26]=g("hr",null,null,-1)),g("div",{onClick:Z=>Dn(E)},[ie(b,{style:{color:"var(--color-red)"},icon:["fas","xmark"]})],8,sr)]),g("div",rr,[g("img",{src:J,alt:"[图片]"},null,8,lr)]),g("span",null,"#"+G(E),1)]))),128))])],544),[[Ke,M.value.size>0]])]),_:1}),g("div",{class:gt(T.value[3].open?"search-tag show":"search-tag")},[ie(b,{icon:["fas","search"]}),g("span",null,G(B(t).sysConfig.enable_local_history?B(f)("搜索已保存的消息"):B(f)("搜索已加载的消息")),1),g("div",{onClick:ri},[ie(b,{icon:["fas","xmark"]})])],2),g("div",{class:gt(k.value.isReply?"replay-tag show":"replay-tag")},[ie(b,{icon:["fas","reply"]}),g("span",null,G(A.value===null?"":A.value.sender.nickname+": "+B(an)(A.value)),1),g("div",{onClick:Ye},[ie(b,{icon:["fas","xmark"]})])],2),g("div",{class:gt($.value!=null?"at-tag show":"at-tag"),contenteditable:"true",onBlur:c[8]||(c[8]=E=>tt(void 0))},[(W(!0),ee(Ie,null,vt($.value!=null?$.value:[],(E,J)=>(W(),ee("div",{key:"atFind-"+E.user_id,class:gt({selected:J===m.value}),onClick:Z=>tt(E.user_id)},[c[27]||(c[27]=g("img",{src:"/img/icons/icon.svg"},null,-1)),g("span",null,G(E.card!=""&&E.card!=null?E.card:E.nickname),1),g("a",null,G(E.user_id),1)],10,ur))),128)),((U=$.value)==null?void 0:U.length)==0?(W(),ee("div",cr,[g("span",null,G(B(f)("没有找到匹配的群成员")),1)])):me("",!0)],34),g("div",{class:gt((k.value.showMoreDetail?"more-detail show":"more-detail")+(p.value?" voice-menu-open":"")),onClick:c[10]||(c[10]=E=>p.value=!1)},[g("div",{title:B(f)("图片"),onClick:ti},[ie(b,{icon:["fas","image"]}),g("input",{id:"choice-pic",type:"file",accept:"image/*",style:{display:"none"},onChange:Wi},null,32),g("label",dr,G(B(f)("选择图片")),1)],8,fr),g("div",{title:B(f)("文件"),onClick:ni},[ie(b,{icon:["fas","folder"]}),g("input",{id:"choice-file",type:"file",style:{display:"none"},onChange:Gi},null,32),g("label",mr,G(B(f)("选择文件")),1)],8,hr),g("div",{title:B(f)("视频"),onClick:Qi},[ie(b,{icon:["fas","video"]}),g("input",{id:"choice-video",type:"file",accept:"video/*",style:{display:"none"},onChange:Ki},null,32),g("label",vr,G(B(f)("选择视频")),1)],8,gr),g("div",pr,[g("div",{title:N.value?B(f)("停止录音"):B(f)("发送语音"),class:gt({active:N.value}),onClick:Un(eo,["stop"])},[ie(b,{icon:["fas",N.value?"stop":"microphone"]},null,8,["icon"])],10,yr),p.value?(W(),ee("div",{key:0,class:"voice-menu",onClick:c[9]||(c[9]=Un(()=>{},["stop"]))},[g("div",{onClick:to},G(B(f)("浏览器录音")),1),g("div",{onClick:io},G(B(f)("音频文件")),1)])):me("",!0),g("input",{id:"choice-audio",type:"file",accept:"audio/*",style:{display:"none"},onChange:oo},null,32)]),c[28]||(c[28]=g("div",{class:"space"},null,-1)),g("div",{title:B(f)("搜索消息"),onClick:uo},[ie(b,{icon:["fas","search"]})],8,wr)],2)]),g("div",null,[Ce((W(),ee("div",{onClick:c[11]||(c[11]=E=>ui(B(t).sysConfig.quick_send))},[k.value.showMoreDetail||T.value.find(E=>E.open)?(W(),Me(b,{key:0,icon:["fas","minus"]})):B(t).sysConfig.quick_send=="default"?(W(),Me(b,{key:1,icon:["fas","plus"]})):B(t).sysConfig.quick_send=="img"?(W(),Me(b,{key:2,icon:["fas","image"]})):B(t).sysConfig.quick_send=="file"?(W(),Me(b,{key:3,icon:["fas","folder"]})):me("",!0)])),[[B(Co),E=>ui(),void 0,{prevent:!0}]]),g("div",null,[g("form",{onSubmit:Te},[y.value?(W(),ee("div",{key:0,id:"voice-pending-input",class:"voice-pending",role:"button",onClick:no},[g("span",null,"["+G(B(f)("语音"))+"]",1),ie(b,{icon:["fas","xmark"]})])):(W(),ee(Ie,{key:1},[B(t).sysConfig.send_key==="none"?(W(),ee(Ie,{key:0},[g("label",br,G(B(f)("消息输入框")),1),Ce(g("input",{id:"main-input",ref_key:"mainInput",ref:d,"onUpdate:modelValue":c[12]||(c[12]=E=>x.value=E),type:"text",autocomplete:"off",disabled:B(e).openSideBar||n.chat.info.me_info.shut_up_timestamp>0,placeholder:n.chat.info.me_info.shut_up_timestamp>0?B(f)("已被禁言至:{time}",{time:Intl.DateTimeFormat(B(ne),B(Mi)(new Date(n.chat.info.me_info.shut_up_timestamp*1e3))).format(new Date(n.chat.info.me_info.shut_up_timestamp*1e3))}):"",onPaste:ei,onKeydown:ae,onKeyup:ce,onClick:Ne,onInput:si},null,40,kr),[[un,x.value]])],64)):(W(),ee(Ie,{key:1},[g("label",Ir,G(B(f)("消息输入框")),1),Ce(g("textarea",{id:"main-input-ex",ref_key:"mainInput",ref:d,"onUpdate:modelValue":c[13]||(c[13]=E=>x.value=E),type:"text",disabled:B(e).openSideBar,onPaste:ei,onKeydown:te,onKeyup:ce,onClick:Ne,onInput:si,onCompositionstart:se,onCompositionend:le},null,40,_r),[[un,x.value]])],64))],64))],32),Pt(s.$slots,"main-input-button",{},void 0,!0),g("div",{onClick:c[14]||(c[14]=E=>Zt("sendMsgBack"))},[T.value[3].open?(W(),Me(b,{key:0,icon:["fas","search"]})):(W(),Me(b,{key:1,icon:["fas","angle-right"]}))])])]),c[29]||(c[29]=g("div",null,null,-1))],512),ie(Ls,{ref_key:"mergePan",ref:L},null,512),(W(),Me(Mo,{to:"body"},[g("div",{class:gt("msg-menu"+(["linux","win32"].includes(B(bt).platform??"")?" withBar":""))},[Ce(g("div",{class:"msg-menu-bg",onClick:He},null,512),[[Ke,k.value.showMsgMenu]]),g("div",{id:"msgMenu",class:gt(k.value.showMsgMenu?"ss-card msg-menu-body show":"ss-card msg-menu-body")},[Ce(g("div",{onClick:c[15]||(c[15]=E=>Ee())},[g("div",null,[ie(b,{icon:["fas","plus"]})]),g("a",null,G(B(f)("+ 1")),1)],512),[[Ke,k.value.menuDisplay.add]]),Ce(g("div",{onClick:c[16]||(c[16]=E=>lt(!0))},[g("div",null,[ie(b,{icon:["fas","message"]})]),g("a",null,G(B(f)("回复")),1)],512),[[Ke,k.value.menuDisplay.relpy]]),Ce(g("div",{onClick:c[17]||(c[17]=E=>yt())},[g("div",null,[ie(b,{icon:["fas","share"]})]),g("a",null,G(B(f)("转发")),1)],512),[[Ke,k.value.menuDisplay.forward]]),Ce(g("div",{onClick:c[18]||(c[18]=E=>fn())},[g("div",null,[ie(b,{icon:["fas","circle-check"]})]),g("a",null,G(B(f)("多选")),1)],512),[[Ke,k.value.menuDisplay.select]]),Ce(g("div",{onClick:ke},[g("div",null,[ie(b,{icon:["fas","clipboard"]})]),g("a",null,G(B(f)("复制")),1)],512),[[Ke,k.value.menuDisplay.copy]]),Ce(g("div",{onClick:st},[g("div",null,[ie(b,{icon:["fas","code"]})]),g("a",null,G(B(f)("复制选中文本")),1)],512),[[Ke,k.value.menuDisplay.copySelect]]),Ce(g("div",{onClick:At},[g("div",null,[ie(b,{icon:["fas","object-ungroup"]})]),g("a",null,G(B(f)("复制图片")),1)],512),[[Ke,k.value.menuDisplay.copyImg]]),Ce(g("div",{onClick:Et},[g("div",null,[ie(b,{icon:["fas","floppy-disk"]})]),g("a",null,G(B(f)("下载图片")),1)],512),[[Ke,k.value.menuDisplay.downloadImg!=!1]]),Ce(g("div",{onClick:Vt},[g("div",null,[ie(b,{icon:["fas","xmark"]})]),g("a",null,G(B(f)("撤回")),1)],512),[[Ke,k.value.menuDisplay.revoke]]),Ce(g("div",{onClick:dn},[g("div",null,[ie(b,{icon:["fas","pencil"]})]),g("a",null,G(B(f)("重新编辑")),1)],512),[[Ke,k.value.menuDisplay.reedit]]),Ce(g("div",{onClick:c[19]||(c[19]=E=>{A.value&&zt({msgObj:{type:"at",qq:Number(A.value.sender.user_id)},addText:!0}),Wt(),He()})},[g("div",null,[ie(b,{icon:["fas","at"]})]),g("a",null,G(B(f)("提及")),1)],512),[[Ke,k.value.menuDisplay.at]]),Ce(g("div",{onClick:c[20]||(c[20]=E=>li(A.value?A.value.sender.user_id:void 0))},[g("div",null,[ie(b,{icon:["fas","fa-hand-point-up"]})]),g("a",null,G(B(f)("戳一戳")),1)],512),[[Ke,k.value.menuDisplay.poke]]),Ce(g("div",{onClick:Xe},[g("div",null,[ie(b,{icon:["fas","trash-can"]})]),g("a",null,G(B(f)("移出群聊")),1)],512),[[Ke,k.value.menuDisplay.remove]]),Ce(g("div",{onClick:c[21]||(c[21]=E=>{var J;$t(),s.$refs.infoRef.openMoreConfig((J=A.value)==null?void 0:J.sender.user_id),He()})},[g("div",null,[ie(b,{icon:["fas","cog"]})]),g("a",null,G(B(f)("成员设置")),1)],512),[[Ke,k.value.menuDisplay.config]]),Ce(g("div",{onClick:Pe},[g("div",null,[ie(b,{icon:["fas","arrow-up-right-from-square"]})]),g("a",null,G(B(f)("跳转到消息")),1)],512),[[Ke,k.value.menuDisplay.jumpToMsg]]),g("div",{onClick:at},[g("div",null,[ie(b,{icon:["fas","screwdriver-wrench"]})]),g("a",null,G(B(f)("调试信息")),1)])],2)],2)])),ie(on,{name:"chat-info-float",duration:{enter:300,leave:200}},{default:It(()=>[ie(Wa,{ref:"infoRef",chat:n.chat,tags:k.value,onClose:$t},null,8,["chat","tags"])]),_:1}),ie(on,null,{default:It(()=>[k.value.showForwardPan?(W(),ee("div",Sr,[g("div",Cr,[g("header",null,[g("span",null,G(B(f)("转发消息")),1),ie(b,{icon:["fas","xmark"],onClick:We})]),g("label",Mr,G(B(f)("搜索转发对象")),1),g("input",{id:"chat-forward-search",placeholder:B(f)("搜索 ……"),onInput:kt},null,40,Ar),g("div",null,[(W(!0),ee(Ie,null,vt(Q.value,E=>(W(),ee("div",{key:"forwardList-"+(E.user_id??E.group_id),onClick:J=>qt(E)},[g("img",{loading:"lazy",title:Lt(E),src:E.avatar||"/img/icons/icon.svg"},null,8,Er),g("div",null,[g("p",null,G(Lt(E)),1),g("span",null,G(E.group_id?B(f)("群组"):B(f)("好友")),1)])],8,Tr))),128))])]),g("div",{class:"bg",onClick:We})])):me("",!0)]),_:1}),g("div",{class:"bg",style:In({"backdrop-filter":`blur(${B(t).sysConfig.chat_more_blur?0:B(t).sysConfig.chat_background_blur}px)`})},null,4)],38)),[[B(So),Re]])}}}),Rr=$n(Fr,[["__scopeId","data-v-8f8b9b74"]]);export{Rr as default};
|
|
28
|
+
`});const U=new ut;Jt.config.globalProperties.$copyText(c).then(()=>{U.add(Be.INFO,f("复制成功"),!0),g.value=[]},()=>{U.add(Be.ERR,f("复制失败"),!0)})}async function ro(){const s=n.list.filter(b=>g.value.includes(b.message_id)),c=[];for(const b of s){const U=b.message_id,E=String(b.channel_id??b.channelId??u.chatInfo.show.channel_id??n.chat.show.id);c.push(it.callApi("delete_msg",{channel_id:E,message_id:U}))}g.value=[],await Promise.all(c)}async function si(s){const c=s.target;Oe(c);const b=Uo(x.value,q.value);let{end:U,str:E}={end:0,str:""};if(b.length>0&&({end:U,str:E}=b[0]),E.indexOf("]")>=0){const J=q.value.substring(0,U),Z=J.lastIndexOf("[图片]");if(Z>=0&&Z<U){let pe=0,de=-1;for(;(de=J.indexOf("[图片]",de+1))>=0;)pe++;const dt=S.value.map(($e,Qe)=>($e==null?void 0:$e.type)==="image"?Qe:-1).filter($e=>$e>=0)[pe-1];dt!==void 0&&M.value.has(dt)&&Dn(dt)}const oe=q.value.substring(0,U).lastIndexOf("[SQ:");if(oe>=0&&oe<U){const pe=q.value.substring(oe),Xe=q.value.slice(oe,pe.indexOf("]")+oe+1).replace("[SQ:","").replace("]",""),dt=Number(Xe);!isNaN(dt)&&M.value.has(dt)&&Dn(dt)}if(q.value.substring(0,U).match(/\[@[^\]]+\]$/)){const pe=S.value.findIndex(de=>(de==null?void 0:de.type)==="at");pe>=0&&S.value.splice(pe,1)}}if(T.value[3].open){C.value&&(clearTimeout(C.value),C.value=null);const J=c.value;if(J.length==0)z.value++,k.value.search.list=vn(n.list);else if(t.sysConfig.enable_local_history){const Z=++z.value;C.value=setTimeout(async()=>{const oe=await zo(l.loginInfo.uin,u.chatInfo.show.channel_id??u.chatInfo.show.id,J);Z!==z.value||!T.value[3].open||(k.value.search.list=oe)},180)}else z.value++,k.value.search.list=n.list.filter(Z=>an(Z).indexOf(J)!==-1)}}function lo(){T.value[3].open=!T.value[3].open,k.value.showMoreDetail=!k.value.showMoreDetail}function ri(){C.value&&(clearTimeout(C.value),C.value=null),z.value++,T.value[3].open=!T.value[3].open,x.value="",k.value.search.list=vn(n.list),Oe()}function uo(s){var c;if(l.jsonMap.poke){let b=(c=l.jsonMap.poke)==null?void 0:c.name;n.chat.show.type=="user"&&l.jsonMap.poke.private_name&&(b=l.jsonMap.poke.private_name),it.send(b,{user_id:s,group_id:n.chat.show.id},"sendPoke")}k.value.showMoreDetail=!1,k.value.menuDisplay.poke=!1}function co(s){x.value="",S.value=[],M.value.clear(),Je();for(const c of s.message)if(c.type==="text")x.value+=c.text;else if(c.type==="reply"){const b=n.list.find(U=>U.message_id==c.id);if(!b)continue;pt(b)}else c.type==="record"||c.type==="audio"?(p.value={...c,name:c.name||f("语音")},x.value="",S.value=[],M.value.clear()):(zt({addText:!1,msgObj:c}),x.value+=Xt(S.value.length-1));Wt()}function fo(s){var b,U;const c=s.target;if(c.scrollTop+c.clientHeight===c.scrollHeight&&!k.value.isJinLoading&&n.chat.info.jin_info.is_end==!1){k.value.isJinLoading=!0;const E=((U=(b=l.jsonMap)==null?void 0:b.group_essence)==null?void 0:U.name)??"get_essence_msg_list";it.send(E,{group_id:n.chat.show.id,pages:n.chat.info.jin_info.pages+1},"getJin")}}function ho(s){D!=null&&D.value&&D.value.open(new Vn(s))}function li(s="default"){let c=!1;if(T.value.forEach(b=>{b.open&&(c=!0),b.open=!1}),!c){if(k.value.showMoreDetail){k.value.showMoreDetail=!1;return}switch(s){case"default":k.value.showMoreDetail=!0;break;case"img":ti();break;case"file":ni();break;case"face":T.value[1].open=!T.value[1].open;break}}}function On(){var c;const s=document.getElementById("chat-pan");if(s)return k.value.openChatInfo?s.getElementsByClassName("chat-info-pan")[0]:(c=L.value)!=null&&c.isMergeOpen()?s.getElementsByClassName("merge-pan")[0]:s}function hn(){var s,c;k.value.openChatInfo?$t():(s=L.value)!=null&&s.isMergeOpen()?((c=L.value)==null||c.closeMergeMsg(),setTimeout(()=>{const U=document.getElementById("chat-pan").getElementsByClassName("merge-pan")[0];U&&(U.style.transform="")},500)):(u.chatInfo.show.id=0,e.openSideBar=!0,new Dt().add(pn.UI,"右滑打开侧边栏触发完成"))}return(s,c)=>{var U;const b=Ln("font-awesome-icon");return Ce((W(),ee("div",{id:"chat-pan",class:gt("chat-pan"+(B(e).openSideBar?" open":"")+(["linux","win32"].includes(B(bt).platform??"")?" withBar":"")),style:In({"background-image":B(Ao)(B(t).sysConfig.chat_more_blur?"":B(t).sysConfig.chat_background),"background-position":B(t).sysConfig.chat_background_align??"center","background-size":B(t).sysConfig.chat_background_fit??"cover"}),onVMoveRight:c[21]||(c[21]=Un(E=>hn(),["prevent"]))},[Pt(s.$slots,"chat-extra",{},void 0,!0),y("div",Hs,[ie(b,{class:"back",icon:["fas","angle-left"],onClick:hn}),y("img",{"data-avatar":"",src:n.chat.show.avatar||"/img/icons/icon.svg",onError:c[0]||(c[0]=(...E)=>B(Sn)&&B(Sn)(...E))},null,40,Ps),y("div",js,[y("p",null,[yn(K(n.chat.show.name)+" ",1),n.chat.show.type=="group"?(W(),ee(Ie,{key:0},[yn(" ("+K(n.chat.info.group_members.length)+") ",1)],64)):me("",!0)]),n.chat.show.temp?(W(),ee("span",qs,K(B(f)("来自群聊:{group}",{group:n.chat.show.temp})),1)):(W(),ee("span",Vs,[n.chat.show.appendInfo?(W(),ee(Ie,{key:0},[yn(K(n.chat.show.appendInfo),1)],64)):(W(),ee(Ie,{key:1},[yn(K(n.list[n.list.length-1]?B(f)("上次消息 - {time}",{time:Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(n.list[n.list.length-1].time*1e3))}):B(f)("暂无消息")),1)],64))]))]),c[22]||(c[22]=y("div",{class:"space"},null,-1)),y("div",Ws,[ie(b,{icon:["fas","ellipsis-vertical"],onClick:$t})])]),y("div",{class:gt("loading"+(B(e).nowGetHistory&&B(e).canLoadHistory?" show":""))},[ie(b,{icon:["fas","spinner"]}),y("span",null,K(B(f)("加载中")),1)],2),y("div",{id:"msgPan",ref_key:"msgPan",ref:i,class:"chat",style:{"scroll-behavior":"smooth"},onScroll:c[1]||(c[1]=E=>ft(E,T.value[3].open))},[T.value[3].open?(W(),Me(qn,{key:1,name:B(t).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:It(()=>[(W(!0),ee(Ie,null,vt(k.value.search.list,(E,J)=>(W(),ee(Ie,null,[B(jn)(n.list[Number(J)-1]?n.list[Number(J)-1].time:void 0,E.time)?(W(),Me(Ht,{key:"notice-time-"+J,data:{sub_type:"time",time:E.time}},null,8,["data"])):me("",!0),(E.post_type==="message"||E.post_type==="message_sent")&&E.message.length>0?(W(),Me(ln,{key:E.fake_message_id??E.message_id,selected:g.value.includes(E.message_id)||k.value.menuDisplay.menuSelectedMsgId==E.message_id,selecting:g.value.length>0,data:E,onScrollToMsg:B(nn),onShowMenu:be,onImageLoaded:V,onLeftMove:pt,onContentRendered:Le},null,8,["selected","selecting","data","onScrollToMsg"])):me("",!0)],64))),256))]),_:1},8,["name"])):(W(),ee(Ie,{key:0},[B(e).canLoadHistory?me("",!0):(W(),ee("div",Qs,[c[23]||(c[23]=y("hr",null,null,-1)),y("a",null,K(B(f)("没有更多消息了")),1)])),B(e).loadHistoryFail?(W(),ee("div",Gs,[c[24]||(c[24]=y("hr",null,null,-1)),y("a",null,K(B(f)("获取历史记录失败")),1)])):me("",!0),B(e).nowGetHistory&&n.list.length>0?(W(),Me(Ht,{key:2,data:{sub_type:"time",time:n.list[0].time}},null,8,["data"])):me("",!0),ie(qn,{name:B(t).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:It(()=>[(W(!0),ee(Ie,null,vt(n.list,(E,J)=>(W(),ee(Ie,null,[B(jn)(n.list[Number(J)-1]?n.list[Number(J)-1].time:void 0,E.time)?(W(),Me(Ht,{key:"notice-time-"+(E.time/240).toFixed(0),data:{sub_type:"time",time:E.time}},null,8,["data"])):me("",!0),B(Ei)(E)?(W(),Me(Ht,{key:"delete-"+E.message_id,data:{sub_type:"delete"}})):(E.post_type==="message"||E.post_type==="message_sent")&&E.message.length>0?(W(),Me(ln,{key:E.fake_message_id??E.message_id,selected:g.value.includes(E.message_id)||k.value.menuDisplay.menuSelectedMsgId==E.message_id,selecting:g.value.length>0,data:E,"image-list-header":Y.value,onClick:Z=>oo(Z,E),onShowMenu:be,onScrollToMsg:B(nn),onImageLoaded:V,onLeftMove:pt,onSendPoke:uo,onContentRendered:Le},null,8,["selected","selecting","data","image-list-header","onClick","onScrollToMsg"])):E.post_type==="notice"?(W(),Me(Ht,{id:B(Ti)(),key:"notice-"+J,data:E},null,8,["id","data"])):me("",!0)],64))),256))]),_:1},8,["name"])],64)),y("span",{ref_key:"chatPadding",ref:a,class:"chat-padding"}," ",512)],544),y("div",{class:"new-msg",style:In({opacity:k.value.showBottomButton?1:0}),onClick:c[2]||(c[2]=E=>we(!0))},[y("div",Ks,[ie(b,{icon:["fas","angle-down"]}),P.value>0?(W(),ee("span",Js,K(P.value),1)):me("",!0)])],4),y("div",{id:"send-more",ref_key:"sendMore",ref:o,class:"more"},[y("div",null,[y("div",null,[ie(on,{name:"pan"},{default:It(()=>[Ce(ie(Ts,{onAddSpecialMsg:zt,onSendMsg:Zt},null,512),[[Ze,T.value[1].open]])]),_:1}),ie(on,{name:"pan"},{default:It(()=>[Ce(y("div",Ys,[y("div",null,[ie(b,{icon:["fas","message"]}),y("span",null,K(B(f)("精华消息")),1),ie(b,{icon:["fas","xmark"],onClick:c[3]||(c[3]=E=>T.value[2].open=!T.value[2].open)})]),y("div",{class:"jin-pan-body",onScroll:fo},[(W(!0),ee(Ie,null,vt(n.chat.info.jin_info.list,(E,J)=>(W(),ee("div",{key:"jin-"+J},[y("div",null,[y("img",{"data-avatar":"",src:E.sender_avatar||"/img/icons/icon.svg"},null,8,Xs),y("div",null,[y("a",null,K(E.sender_nick),1),y("span",null,K(E.sender_time?Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric"}).format(new Date(E.sender_time*1e3)):"")+" "+K(B(f)("发送")),1)]),y("span",null,K(B(f)("{time},由 {name} 设置",{time:E.sender_time?Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric"}).format(new Date(E.sender_time*1e3)):"",name:E.add_digest_nick})),1)]),y("div",Zs,[(W(!0),ee(Ie,null,vt(E.msg_content,(Z,oe)=>(W(),ee(Ie,{key:"jinc-"+J+"-"+oe},[Z.type==="text"?(W(),ee("span",er,K(Z.data.text),1)):me("",!0),Z.type==="face"?(W(),Me(Wn,{key:1,emoji:B(rn).get(Number(Z.data.id))},null,8,["emoji"])):me("",!0),Z.type==="image"?(W(),ee("img",{key:2,src:Z.data.url,onClick:he=>ho(Z.data.url)},null,8,tr)):me("",!0)],64))),128))])]))),128)),Ce(y("div",nr,[ie(b,{icon:["fas","spinner"]})],512),[[Ze,k.value.isJinLoading]])],32)],512),[[Ze,T.value[2].open&&n.chat.info.jin_info.list.length>0]])]),_:1})]),y("div",{class:gt(g.value.length>0?"select-tag show":"select-tag")},[y("div",null,[ie(b,{icon:["fas","share-from-square"],onClick:c[4]||(c[4]=E=>yt("individual-messages"))}),y("span",null,K(B(f)("逐条转发")),1)]),y("div",null,[ie(b,{icon:["fas","share"],onClick:c[5]||(c[5]=E=>yt("merged-messages"))}),y("span",null,K(B(f)("合并转发")),1)]),y("div",null,[ie(b,{icon:["fas","scissors"]}),y("span",null,K(B(f)("截图")),1)]),y("div",null,[ie(b,{icon:["fas","trash-can"],onClick:ao}),y("span",null,K(B(f)("删除")),1)]),y("div",null,[ie(b,{icon:["fas","copy"],onClick:so}),y("span",null,K(B(f)("复制")),1)]),y("div",null,[ie(b,{icon:["fas","xmark"],onClick:ro}),y("span",null,K(B(f)("撤回")),1)]),y("div",null,[y("span",{onClick:c[6]||(c[6]=E=>g.value=[])},K(g.value.length),1),y("span",null,K(B(f)("取消")),1)])],2),ie(on,{name:"img-pan"},{default:It(()=>[Ce(y("div",{class:gt({"img-pan":!0,"ss-card":!0}),onWheel:c[7]||(c[7]=E=>E.currentTarget.scrollLeft+=E.deltaY)},[y("div",ir,[(W(!0),ee(Ie,null,vt(M.value,([E,J])=>(W(),ee("div",{key:"imgCache-"+E},[y("div",or,[y("div",{onClick:Z=>qi(E)},[ie(b,{icon:["fas","pencil"]})],8,ar),c[25]||(c[25]=y("hr",null,null,-1)),y("div",{onClick:Z=>Dn(E)},[ie(b,{style:{color:"var(--color-red)"},icon:["fas","xmark"]})],8,sr)]),y("div",rr,[y("img",{src:J,alt:"[图片]"},null,8,lr)]),y("span",null,"#"+K(E),1)]))),128))])],544),[[Ze,M.value.size>0]])]),_:1}),y("div",{class:gt(T.value[3].open?"search-tag show":"search-tag")},[ie(b,{icon:["fas","search"]}),y("span",null,K(B(t).sysConfig.enable_local_history?B(f)("搜索已保存的消息"):B(f)("搜索已加载的消息")),1),y("div",{onClick:ri},[ie(b,{icon:["fas","xmark"]})])],2),y("div",{class:gt(k.value.isReply?"replay-tag show":"replay-tag")},[ie(b,{icon:["fas","reply"]}),y("span",null,K(A.value===null?"":A.value.sender.nickname+": "+B(an)(A.value)),1),y("div",{onClick:Je},[ie(b,{icon:["fas","xmark"]})])],2),y("div",{class:gt($.value!=null?"at-tag show":"at-tag"),contenteditable:"true",onBlur:c[8]||(c[8]=E=>tt(void 0))},[(W(!0),ee(Ie,null,vt($.value!=null?$.value:[],(E,J)=>(W(),ee("div",{key:"atFind-"+E.user_id,class:gt({selected:J===m.value}),onClick:Z=>tt(E.user_id)},[c[26]||(c[26]=y("img",{src:"/img/icons/icon.svg"},null,-1)),y("span",null,K(E.card!=""&&E.card!=null?E.card:E.nickname),1),y("a",null,K(E.user_id),1)],10,ur))),128)),((U=$.value)==null?void 0:U.length)==0?(W(),ee("div",cr,[y("span",null,K(B(f)("没有找到匹配的群成员")),1)])):me("",!0)],34),y("div",{class:gt((k.value.showMoreDetail?"more-detail show":"more-detail")+(v.value?" voice-menu-open":"")),onClick:c[10]||(c[10]=E=>v.value=!1)},[y("div",{title:B(f)("图片"),onClick:ti},[ie(b,{icon:["fas","image"]}),y("input",{id:"choice-pic",type:"file",accept:"image/*",style:{display:"none"},onChange:Vi},null,32),y("label",dr,K(B(f)("选择图片")),1)],8,fr),y("div",{title:B(f)("文件"),onClick:ni},[ie(b,{icon:["fas","folder"]}),y("input",{id:"choice-file",type:"file",style:{display:"none"},onChange:Qi},null,32),y("label",mr,K(B(f)("选择文件")),1)],8,hr),y("div",{title:B(f)("视频"),onClick:Wi},[ie(b,{icon:["fas","video"]}),y("input",{id:"choice-video",type:"file",accept:"video/*",style:{display:"none"},onChange:Gi},null,32),y("label",vr,K(B(f)("选择视频")),1)],8,gr),y("div",pr,[y("div",{title:N.value?B(f)("停止录音"):B(f)("发送语音"),class:gt({active:N.value}),onClick:Un(Zi,["stop"])},[ie(b,{icon:["fas",N.value?"stop":"microphone"]},null,8,["icon"])],10,yr),v.value?(W(),ee("div",{key:0,class:"voice-menu",onClick:c[9]||(c[9]=Un(()=>{},["stop"]))},[y("div",{onClick:eo},K(B(f)("浏览器录音")),1),y("div",{onClick:no},K(B(f)("音频文件")),1)])):me("",!0),y("input",{id:"choice-audio",type:"file",accept:"audio/*",style:{display:"none"},onChange:io},null,32)]),c[27]||(c[27]=y("div",{class:"space"},null,-1)),y("div",{title:B(f)("搜索消息"),onClick:lo},[ie(b,{icon:["fas","search"]})],8,wr)],2)]),y("div",null,[Ce((W(),ee("div",{onClick:c[11]||(c[11]=E=>li(B(t).sysConfig.quick_send))},[k.value.showMoreDetail||T.value.find(E=>E.open)?(W(),Me(b,{key:0,icon:["fas","minus"]})):B(t).sysConfig.quick_send=="default"?(W(),Me(b,{key:1,icon:["fas","plus"]})):B(t).sysConfig.quick_send=="img"?(W(),Me(b,{key:2,icon:["fas","image"]})):B(t).sysConfig.quick_send=="file"?(W(),Me(b,{key:3,icon:["fas","folder"]})):me("",!0)])),[[B(Co),E=>li(),void 0,{prevent:!0}]]),y("div",null,[y("form",{onSubmit:Te},[p.value?(W(),ee("div",{key:0,id:"voice-pending-input",class:"voice-pending",role:"button",onClick:to},[y("span",null,"["+K(B(f)("语音"))+"]",1),ie(b,{icon:["fas","xmark"]})])):(W(),ee(Ie,{key:1},[B(t).sysConfig.send_key==="none"?(W(),ee(Ie,{key:0},[y("label",br,K(B(f)("消息输入框")),1),Ce(y("input",{id:"main-input",ref_key:"mainInput",ref:d,"onUpdate:modelValue":c[12]||(c[12]=E=>x.value=E),type:"text",autocomplete:"off",disabled:B(e).openSideBar||n.chat.info.me_info.shut_up_timestamp>0,placeholder:n.chat.info.me_info.shut_up_timestamp>0?B(f)("已被禁言至:{time}",{time:Intl.DateTimeFormat(B(ne),B(Ci)(new Date(n.chat.info.me_info.shut_up_timestamp*1e3))).format(new Date(n.chat.info.me_info.shut_up_timestamp*1e3))}):"",onPaste:ei,onKeydown:ae,onKeyup:ce,onClick:Ne,onInput:si},null,40,kr),[[un,x.value]])],64)):(W(),ee(Ie,{key:1},[y("label",Ir,K(B(f)("消息输入框")),1),Ce(y("textarea",{id:"main-input-ex",ref_key:"mainInput",ref:d,"onUpdate:modelValue":c[13]||(c[13]=E=>x.value=E),type:"text",disabled:B(e).openSideBar,onPaste:ei,onKeydown:te,onKeyup:ce,onClick:Ne,onInput:si,onCompositionstart:se,onCompositionend:le},null,40,_r),[[un,x.value]])],64))],64))],32),Pt(s.$slots,"main-input-button",{},void 0,!0),y("div",{onClick:c[14]||(c[14]=E=>Zt("sendMsgBack"))},[T.value[3].open?(W(),Me(b,{key:0,icon:["fas","search"]})):(W(),Me(b,{key:1,icon:["fas","angle-right"]}))])])]),c[28]||(c[28]=y("div",null,null,-1))],512),ie(Ls,{ref_key:"mergePan",ref:L},null,512),(W(),Me(Mo,{to:"body"},[y("div",{class:gt("msg-menu"+(["linux","win32"].includes(B(bt).platform??"")?" withBar":""))},[Ce(y("div",{class:"msg-menu-bg",onClick:He},null,512),[[Ze,k.value.showMsgMenu]]),y("div",{id:"msgMenu",class:gt(k.value.showMsgMenu?"ss-card msg-menu-body show":"ss-card msg-menu-body")},[Ce(y("div",{onClick:c[15]||(c[15]=E=>Ee())},[y("div",null,[ie(b,{icon:["fas","plus"]})]),y("a",null,K(B(f)("+ 1")),1)],512),[[Ze,k.value.menuDisplay.add]]),Ce(y("div",{onClick:c[16]||(c[16]=E=>lt(!0))},[y("div",null,[ie(b,{icon:["fas","message"]})]),y("a",null,K(B(f)("回复")),1)],512),[[Ze,k.value.menuDisplay.relpy]]),Ce(y("div",{onClick:c[17]||(c[17]=E=>yt())},[y("div",null,[ie(b,{icon:["fas","share"]})]),y("a",null,K(B(f)("转发")),1)],512),[[Ze,k.value.menuDisplay.forward]]),Ce(y("div",{onClick:c[18]||(c[18]=E=>fn())},[y("div",null,[ie(b,{icon:["fas","circle-check"]})]),y("a",null,K(B(f)("多选")),1)],512),[[Ze,k.value.menuDisplay.select]]),Ce(y("div",{onClick:ke},[y("div",null,[ie(b,{icon:["fas","clipboard"]})]),y("a",null,K(B(f)("复制")),1)],512),[[Ze,k.value.menuDisplay.copy]]),Ce(y("div",{onClick:st},[y("div",null,[ie(b,{icon:["fas","code"]})]),y("a",null,K(B(f)("复制选中文本")),1)],512),[[Ze,k.value.menuDisplay.copySelect]]),Ce(y("div",{onClick:At},[y("div",null,[ie(b,{icon:["fas","object-ungroup"]})]),y("a",null,K(B(f)("复制图片")),1)],512),[[Ze,k.value.menuDisplay.copyImg]]),Ce(y("div",{onClick:Et},[y("div",null,[ie(b,{icon:["fas","floppy-disk"]})]),y("a",null,K(B(f)("下载图片")),1)],512),[[Ze,k.value.menuDisplay.downloadImg!=!1]]),Ce(y("div",{onClick:Vt},[y("div",null,[ie(b,{icon:["fas","xmark"]})]),y("a",null,K(B(f)("撤回")),1)],512),[[Ze,k.value.menuDisplay.revoke]]),Ce(y("div",{onClick:dn},[y("div",null,[ie(b,{icon:["fas","pencil"]})]),y("a",null,K(B(f)("重新编辑")),1)],512),[[Ze,k.value.menuDisplay.reedit]]),Ce(y("div",{onClick:c[19]||(c[19]=E=>{A.value&&zt({msgObj:{type:"at",qq:Number(A.value.sender.user_id)},addText:!0}),Wt(),He()})},[y("div",null,[ie(b,{icon:["fas","at"]})]),y("a",null,K(B(f)("提及")),1)],512),[[Ze,k.value.menuDisplay.at]]),Ce(y("div",{onClick:Ye},[y("div",null,[ie(b,{icon:["fas","trash-can"]})]),y("a",null,K(B(f)("移出群聊")),1)],512),[[Ze,k.value.menuDisplay.remove]]),Ce(y("div",{onClick:c[20]||(c[20]=E=>{var J;$t(),s.$refs.infoRef.openMoreConfig((J=A.value)==null?void 0:J.sender.user_id),He()})},[y("div",null,[ie(b,{icon:["fas","cog"]})]),y("a",null,K(B(f)("成员设置")),1)],512),[[Ze,k.value.menuDisplay.config]]),Ce(y("div",{onClick:Pe},[y("div",null,[ie(b,{icon:["fas","arrow-up-right-from-square"]})]),y("a",null,K(B(f)("跳转到消息")),1)],512),[[Ze,k.value.menuDisplay.jumpToMsg]]),y("div",{onClick:at},[y("div",null,[ie(b,{icon:["fas","screwdriver-wrench"]})]),y("a",null,K(B(f)("调试信息")),1)])],2)],2)])),ie(on,{name:"chat-info-float",duration:{enter:300,leave:200}},{default:It(()=>[ie(Wa,{ref:"infoRef",chat:n.chat,tags:k.value,onClose:$t},null,8,["chat","tags"])]),_:1}),ie(on,null,{default:It(()=>[k.value.showForwardPan?(W(),ee("div",Sr,[y("div",Cr,[y("header",null,[y("span",null,K(B(f)("转发消息")),1),ie(b,{icon:["fas","xmark"],onClick:We})]),y("label",Mr,K(B(f)("搜索转发对象")),1),y("input",{id:"chat-forward-search",placeholder:B(f)("搜索 ……"),onInput:kt},null,40,Ar),y("div",null,[(W(!0),ee(Ie,null,vt(Q.value,E=>(W(),ee("div",{key:"forwardList-"+(E.user_id??E.group_id),onClick:J=>qt(E)},[y("img",{loading:"lazy",title:Lt(E),src:E.avatar||"/img/icons/icon.svg"},null,8,Er),y("div",null,[y("p",null,K(Lt(E)),1),y("span",null,K(E.group_id?B(f)("群组"):B(f)("好友")),1)])],8,Tr))),128))])]),y("div",{class:"bg",onClick:We})])):me("",!0)]),_:1}),y("div",{class:"bg",style:In({"backdrop-filter":`blur(${B(t).sysConfig.chat_more_blur?0:B(t).sysConfig.chat_background_blur}px)`})},null,4)],38)),[[B(So),Re]])}}}),Rr=$n(Fr,[["__scopeId","data-v-4d48a31a"]]);export{Rr as default};
|