Spaces:
Running
Running
Delete public/assets
Browse filesFiles changed (20)
- public/assets/AvatarCropper-43twomjP.cssDeleted-1
- public/assets/AvatarCropper-BrLwgiL8.jsDeleted-1
- public/assets/EmojiPanel-Bf-sbcJk.cssDeleted-1
- public/assets/EmojiPanel-C7Mc7Fox.jsDeleted-1
- public/assets/EncryptionModal-Bk9GLrBN.cssDeleted-1
- public/assets/EncryptionModal-BvD7I1MP.jsDeleted-1
- public/assets/MessengerPage-Dmr3RWrs.cssDeleted
- public/assets/MessengerPage-xXbl6QXh.jsDeleted
- public/assets/ModalShell-DWofhKyP.jsDeleted-1
- public/assets/ModalShell-DxpX6TOZ.cssDeleted-1
- public/assets/__vite-browser-external-BRm5n2qg.jsDeleted-1
- public/assets/encryption-CFSbljDF.jsDeleted-2
- public/assets/index-BxVTd_Wu.jsDeleted
- public/assets/index-CJLIHFQ-.cssDeleted-1
- public/assets/keyStore-DDPZ0U62.jsDeleted-1
- public/assets/libsodium-wrappers-DIT7SeqD.jsDeleted
- public/assets/rolldown-runtime-QTnfLwEv.jsDeleted-1
- public/assets/socket-CbQsWyoH.jsDeleted-1
- public/assets/storage-Ba-Lkq8l.jsDeleted-1
- public/assets/vendor-BbmWO_jh.jsDeleted
1._overlay_17o5h_1{z-index:2147483647;-webkit-backdrop-filter:blur();background:0 0;justify-content:center;align-items:center;width:100%;height:100%;transition:background .5s,-webkit-backdrop-filter .5s,backdrop-filter .5s;display:flex;position:fixed;top:0;left:0}._overlay_17o5h_1._open_17o5h_17{-webkit-backdrop-filter:blur(10px);background:#000000b3}._overlay_17o5h_1._closing_17o5h_23{-webkit-backdrop-filter:blur();pointer-events:none;background:0 0}._box_17o5h_30{border:1px solid rgba(var(--accent-rgb,167, 79, 255), .3);opacity:0;background:#1c1c23;border-radius:24px;flex-direction:column;align-items:center;gap:16px;width:340px;max-width:92vw;padding:25px;transition:all .5s cubic-bezier(.34,1.56,.64,1);display:flex;transform:scale(.9);box-shadow:0 20px 50px #00000080}._boxOpen_17o5h_47{opacity:1;transform:scale(1)}._boxClosing_17o5h_52{opacity:0;transition:all .4s cubic-bezier(.4,0,.2,1);transform:scale(.8)translateY(20px)}._title_17o5h_58{color:#fff;font-family:Plus Jakarta Sans,sans-serif;font-size:calc(18px * var(--font-size-scale));margin:0;font-weight:700}._stage_17o5h_66{touch-action:none;cursor:grab;-webkit-user-select:none;user-select:none;border:2px solid rgba(var(--accent-rgb,167, 79, 255), .4);background:#111;border-radius:50%;transition:border-color .3s;position:relative;overflow:hidden}._stage_17o5h_66:active{cursor:grabbing;border-color:var(--accent-solid,#a74fff)}._canvas_17o5h_83{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}._ring_17o5h_91{pointer-events:none;border:2px solid #ffffffd9;border-radius:50%;position:absolute;inset:0;box-shadow:0 0 0 9999px #00000080}._zoomLabel_17o5h_100{color:#888;text-transform:uppercase;letter-spacing:.5px;width:100%;font-size:12px}._zoom_17o5h_100{width:100%;accent-color:var(--accent-solid,#a74fff);height:6px}._actions_17o5h_114{gap:10px;width:100%;margin-top:4px;display:flex}._cancel_17o5h_121,._done_17o5h_122{cursor:pointer;border:none;border-radius:14px;flex:1;padding:12px;font-family:inherit;font-size:15px;font-weight:600;transition:background .2s,transform .15s}._cancel_17o5h_121{color:#ccc;background:#ffffff14}._cancel_17o5h_121:hover{background:#ffffff24}._cancel_17o5h_121:active{transform:scale(.96)}._done_17o5h_122{background:var(--accent-solid,#a74fff);color:var(--on-accent,#fff)}._done_17o5h_122:hover{filter:brightness(1.1)}._done_17o5h_122:active{transform:scale(.96)}1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{l as t,t as n,u as r}from"./vendor-BbmWO_jh.js";import{s as i}from"./index-BxVTd_Wu.js";var a=e(r(),1),o=e(t(),1),s={overlay:`_overlay_17o5h_1`,open:`_open_17o5h_17`,closing:`_closing_17o5h_23`,box:`_box_17o5h_30`,boxOpen:`_boxOpen_17o5h_47`,boxClosing:`_boxClosing_17o5h_52`,title:`_title_17o5h_58`,stage:`_stage_17o5h_66`,canvas:`_canvas_17o5h_83`,ring:`_ring_17o5h_91`,zoomLabel:`_zoomLabel_17o5h_100`,zoom:`_zoom_17o5h_100`,actions:`_actions_17o5h_114`,cancel:`_cancel_17o5h_121`,done:`_done_17o5h_122`},c=n(),l=260,u=512;function d({file:e,onCancel:t,onCrop:n}){let{t:r}=i(),d=(0,a.useRef)(null),f=(0,a.useRef)(null),p=(0,a.useRef)(null),[m,h]=(0,a.useState)(1),[g,_]=(0,a.useState)({x:0,y:0}),v=(0,a.useRef)(null),[y,b]=(0,a.useState)(!0),[x,S]=(0,a.useState)(!1),[C,w]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>S(!0))});return()=>cancelAnimationFrame(e)},[]),(0,a.useEffect)(()=>{if(!C)return;let e=setTimeout(()=>{b(!1),w(!1),S(!1),t()},400);return()=>clearTimeout(e)},[C,t]);let T=(0,a.useCallback)(()=>{C||w(!0)},[C]);(0,a.useEffect)(()=>{let e=e=>{e.key===`Escape`&&T()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[T]),(0,a.useEffect)(()=>{let t=new Image;return t.onload=()=>{f.current=t,h(.5),_({x:0,y:0}),E()},t.src=URL.createObjectURL(e),()=>URL.revokeObjectURL(t.src)},[e]);let E=(0,a.useCallback)(()=>{let e=d.current,t=f.current;if(!e||!t)return;let n=e.getContext(`2d`);if(!n)return;n.clearRect(0,0,l,l);let r=m,i=t.width*r,a=t.height*r;n.save(),n.beginPath(),n.arc(l/2,l/2,l/2,0,Math.PI*2),n.closePath(),n.clip(),n.drawImage(t,(l-i)/2+g.x,(l-a)/2+g.y,i,a),n.restore()},[m,g]);(0,a.useEffect)(()=>{E()},[E]);let D=e=>{e.target.setPointerCapture(e.pointerId),v.current={x:e.clientX,y:e.clientY,px:g.x,py:g.y}},O=e=>{if(!v.current)return;let t=e.clientX-v.current.x,n=e.clientY-v.current.y;_({x:v.current.px+t,y:v.current.py+n})},k=()=>{v.current=null};return y?(0,o.createPortal)((0,c.jsx)(`div`,{className:`${s.overlay} ${x&&!C?s.open:``} ${C?s.closing:``}`,onClick:T,children:(0,c.jsxs)(`div`,{className:`${s.box} ${x&&!C?s.boxOpen:``} ${C?s.boxClosing:``}`,onClick:e=>e.stopPropagation(),children:[(0,c.jsx)(`h3`,{className:s.title,children:r(`Обрезка аватара`)}),(0,c.jsxs)(`div`,{ref:p,className:s.stage,style:{width:l,height:l},onPointerDown:D,onPointerMove:O,onPointerUp:k,onPointerLeave:k,children:[(0,c.jsx)(`canvas`,{ref:d,width:l,height:l,className:s.canvas}),(0,c.jsx)(`div`,{className:s.ring})]}),(0,c.jsx)(`div`,{className:s.zoomLabel,children:r(`Масштаб`)}),(0,c.jsx)(`input`,{className:s.zoom,type:`range`,min:.5,max:4,step:.01,value:m,onChange:e=>h(parseFloat(e.target.value))}),(0,c.jsxs)(`div`,{className:s.actions,children:[(0,c.jsx)(`button`,{className:s.cancel,onClick:T,children:r(`Отмена`)}),(0,c.jsx)(`button`,{className:s.done,onClick:()=>{let e=document.createElement(`canvas`);e.width=u,e.height=u;let t=e.getContext(`2d`);if(!t||!f.current)return;t.beginPath(),t.arc(u/2,u/2,u/2,0,Math.PI*2),t.closePath(),t.clip();let r=u/l,i=m*r,a=f.current.width*i,o=f.current.height*i;t.drawImage(f.current,(u-a)/2+g.x*r,(u-o)/2+g.y*r,a,o),e.toBlob(e=>{e&&n(new File([e],`avatar.png`,{type:`image/png`}))},`image/png`)},children:r(`Готово`)})]})]})}),document.body):null}export{d as default};1._overlay_1qhis_1{z-index:9999;position:fixed;bottom:80px;left:auto;right:12px}._panel_1qhis_9{background:rgba(var(--card-rgb,42, 38, 51), .95);-webkit-backdrop-filter:blur(25px)saturate(180%);scrollbar-width:none;scrollbar-color:rgba(var(--accent-rgb,167, 79, 255), .3) transparent;will-change:transform, opacity;border:1px solid #ffffff1a;border-radius:20px;width:320px;max-height:380px;padding:10px;overflow-y:auto;box-shadow:0 15px 40px #0009}._panel_1qhis_9[data-entered]{transition:transform .3s cubic-bezier(.34,1.56,.64,1),opacity .25s}._panel_1qhis_9::-webkit-scrollbar{display:none}._tabs_1qhis_33{background:#0003;border-bottom:1px solid #ffffff0d;gap:0;margin-bottom:12px;display:flex}._tab_1qhis_33{text-align:center;color:#888;font-size:calc(13px * var(--font-size-scale));cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;flex:1;padding:10px;font-weight:600;transition:all .2s}._tab_1qhis_33._active_1qhis_57{color:var(--accent-solid);border-bottom-color:var(--accent-solid);background:rgba(var(--accent-rgb,167, 79, 255), .05)}._category_1qhis_63{margin-bottom:8px}._categoryTitle_1qhis_67{font-size:calc(12px * var(--font-size-scale));color:#888;text-transform:uppercase;letter-spacing:.5px;padding:4px 8px;font-weight:700}._grid_1qhis_76{grid-template-columns:repeat(8,1fr);gap:2px;display:grid}._emojiBtn_1qhis_82{aspect-ratio:1;cursor:pointer;width:100%;font-size:calc(24px * var(--font-size-scale));background:0 0;border:none;border-radius:8px;justify-content:center;align-items:center;transition:background .15s,transform .1s;display:flex}._emojiBtn_1qhis_82:hover{background:#ffffff1a;transform:scale(1.1)}._emojiBtn_1qhis_82:active{transform:scale(.9)}._stickerGrid_1qhis_105{grid-template-columns:repeat(4,1fr);gap:8px;max-height:300px;display:grid;overflow-y:auto}._stickerSlot_1qhis_113{aspect-ratio:1;border:2px dashed rgba(var(--accent-rgb,157, 78, 221), .2);cursor:pointer;border-radius:12px;justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative;overflow:hidden}._stickerSlot_1qhis_113:hover{border-color:var(--accent-solid);background:rgba(var(--accent-rgb,167, 79, 255), .05)}._stickerSlot_1qhis_113 img{object-fit:cover;border-radius:10px;width:100%;height:100%}._stickerDelete_1qhis_138{color:#fff;width:20px;height:20px;font-size:calc(12px * var(--font-size-scale));cursor:pointer;background:#ff3b30e6;border:none;border-radius:50%;justify-content:center;align-items:center;display:none;position:absolute;top:4px;right:4px}._stickerSlot_1qhis_113:hover ._stickerDelete_1qhis_138{display:flex}._stickerPlus_1qhis_159{font-size:calc(24px * var(--font-size-scale));color:rgba(var(--accent-rgb,157, 78, 221), .35);font-weight:300}@media (width<=768px){._overlay_1qhis_1{bottom:80px;left:15px;right:15px}._panel_1qhis_9{width:auto;max-height:380px}}1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t,u as n}from"./vendor-BbmWO_jh.js";import{s as r}from"./index-BxVTd_Wu.js";var i=e(n(),1),a={overlay:`_overlay_1qhis_1`,panel:`_panel_1qhis_9`,tabs:`_tabs_1qhis_33`,tab:`_tab_1qhis_33`,active:`_active_1qhis_57`,category:`_category_1qhis_63`,categoryTitle:`_categoryTitle_1qhis_67`,grid:`_grid_1qhis_76`,emojiBtn:`_emojiBtn_1qhis_82`,stickerGrid:`_stickerGrid_1qhis_105`,stickerSlot:`_stickerSlot_1qhis_113`,stickerDelete:`_stickerDelete_1qhis_138`,stickerPlus:`_stickerPlus_1qhis_159`},o=t(),s={Частые:[`😀`,`😂`,`😍`,`🥰`,`😎`,`🤔`,`😅`,`🙌`,`👍`,`👋`,`❤️`,`🔥`,`✨`,`🎉`,`💯`,`🙏`,`😢`,`😤`,`🫡`,`😈`],Смайлики:`😀.😃.😄.😁.😆.😅.🤣.😂.🙂.🙃.😉.😊.😇.🥰.😍.🤩.😘.😗.😚.😙.🥲.😋.😛.😜.🤪.😝.🤑.🤗.🤭.🫢.🤫.🤔.🫡.🤐.🤨.😐.😑.😶.🫥.😏.😒.🙄.😬.🤥.😌.😔.😪.🤤.😴.😷.🤒.🤕.🤢.🤮.🥵.🥶.🥴.😵.🤯.🤠.🥳.🥸.😎.🤓.🧐`.split(`.`),Жесты:`👋.🤚.🖐️.✋.🖖.🫱.🫲.🫳.🫴.👌.🤌.🤏.✌️.🤞.🫰.🤟.🤘.🤙.👈.👉.👆.🖕.👇.☝️.🫵.👍.👎.✊.👊.🤛.🤜.👏.🙌.🫶.👐.🤲.🤝.🙏.💪`.split(`.`),Сердце:[`❤️`,`🧡`,`💛`,`💚`,`💙`,`💜`,`🖤`,`🤍`,`🤎`,`💔`,`❤️🔥`,`❤️🩹`,`❣️`,`💕`,`💞`,`💓`,`💗`,`💖`,`💘`,`💝`],Животные:`🐶.🐱.🐭.🐹.🐰.🦊.🐻.🐼.🐻❄️.🐨.🐯.🦁.🐮.🐷.🐸.🐵.🙈.🙉.🙊.🐒.🐔.🐧.🐦.🐤.🐣.🐥.🦆.🦅.🦉.🦇.🐺.🐗.🐴.🦄.🐝.🪱.🐛.🦋.🐌.🐞`.split(`.`),Еда:`🍎.🍐.🍊.🍋.🍌.🍉.🍇.🍓.🫐.🍈.🍒.🍑.🥭.🍍.🥥.🥝.🍅.🥑.🍆.🥔.🥕.🌽.🌶️.🫑.🥒.🥬.🥦.🧄.🧅.🍄`.split(`.`),Объекты:`⌚.📱.💻.⌨️.🖥️.🖨️.🖱️.🖲️.💾.💿.📀.📼.📷.📸.📹.🎥.📽️.🎞️.📞.☎️.📟.📠.📺.📻.🎙️.🎚️.🎛️.🧭.⏱️.⏰.📦`.split(`.`)};function c(e){try{let t=localStorage.getItem(e);return t?JSON.parse(t):[]}catch{return[]}}function l(e,t){localStorage.setItem(e,JSON.stringify(t))}function u({onSelect:e,onClose:t,sourceRect:n,closing:u}){let{t:d}=r(),[f,p]=(0,i.useState)(`emoji`),[m,h]=(0,i.useState)(()=>c(`4send_saved_stickers`)),[g,_]=(0,i.useState)(()=>c(`4send_saved_gifs`)),v=(0,i.useRef)(null),y=(0,i.useRef)(null),b=(0,i.useRef)(null),[x,S]=(0,i.useState)(!1),[C,w]=(0,i.useState)(!1),[T,E]=(0,i.useState)(!1),[D,O]=(0,i.useState)(`50% 100%`),k=(0,i.useMemo)(()=>Object.keys(s),[]);(0,i.useLayoutEffect)(()=>{if(!T&&n&&b.current){let e=b.current.getBoundingClientRect();if(e.width>0&&e.height>0){let t=(n.left+n.width/2-e.left)/e.width*100,r=(n.top+n.height/2-e.top)/e.height*100;O(`${t}% ${r}%`),E(!0)}}},[n,T]),(0,i.useEffect)(()=>{T&&!C&&requestAnimationFrame(()=>{requestAnimationFrame(()=>w(!0))})},[T,C]),(0,i.useEffect)(()=>{u&&!x&&(S(!0),setTimeout(t,300))},[u,x,t]);let A=(0,i.useCallback)(()=>{x||(S(!0),setTimeout(t,300))},[t,x]);(0,i.useEffect)(()=>{if(x)return;let e=e=>{e.key===`Escape`&&A()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[x,A]);let j=(0,i.useMemo)(()=>T?{transformOrigin:D,transform:C&&!x?`scale(1)`:`scale(0)`,opacity:C&&!x?1:0}:{visibility:`hidden`,opacity:0},[D,T,C,x]),M=(0,i.useCallback)(t=>{e(t)},[e]),N=(0,i.useCallback)(e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{let e=n.result,t=[...m,e];h(t),l(`4send_saved_stickers`,t)},n.readAsDataURL(t),e.target.value=``},[m]),P=(0,i.useCallback)(e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{let e=n.result,t=[...g,e];_(t),l(`4send_saved_gifs`,t)},n.readAsDataURL(t),e.target.value=``},[g]),F=(0,i.useCallback)(e=>{let t=m.filter((t,n)=>n!==e);h(t),l(`4send_saved_stickers`,t)},[m]),I=(0,i.useCallback)(e=>{let t=g.filter((t,n)=>n!==e);_(t),l(`4send_saved_gifs`,t)},[g]);return(0,o.jsx)(`div`,{className:a.overlay,onClick:A,children:(0,o.jsxs)(`div`,{ref:b,className:a.panel,"data-entered":T||void 0,style:j,onClick:e=>e.stopPropagation(),children:[(0,o.jsxs)(`div`,{className:a.tabs,children:[(0,o.jsx)(`button`,{className:`${a.tab} ${f===`emoji`?a.active:``}`,onClick:()=>p(`emoji`),children:d(`Эмодзи`)}),(0,o.jsx)(`button`,{className:`${a.tab} ${f===`stickers`?a.active:``}`,onClick:()=>p(`stickers`),children:d(`Стикеры`)}),(0,o.jsx)(`button`,{className:`${a.tab} ${f===`gifs`?a.active:``}`,onClick:()=>p(`gifs`),children:`GIF`})]}),f===`emoji`&&k.map(e=>(0,o.jsxs)(`div`,{className:a.category,children:[(0,o.jsx)(`div`,{className:a.categoryTitle,children:d(e)}),(0,o.jsx)(`div`,{className:a.grid,children:s[e].map((t,n)=>(0,o.jsx)(`button`,{className:a.emojiBtn,onClick:()=>M(t),children:t},`${e}-${n}`))})]},e)),f===`stickers`&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`input`,{ref:v,type:`file`,accept:`image/*`,style:{display:`none`},onChange:N}),(0,o.jsxs)(`div`,{className:a.stickerGrid,children:[m.map((t,n)=>(0,o.jsxs)(`div`,{className:a.stickerSlot,onClick:()=>e(t),children:[(0,o.jsx)(`img`,{src:t,alt:``}),(0,o.jsx)(`button`,{className:a.stickerDelete,onClick:e=>{e.stopPropagation(),F(n)},children:`×`})]},n)),(0,o.jsx)(`div`,{className:a.stickerSlot,onClick:()=>v.current?.click(),children:(0,o.jsx)(`span`,{className:a.stickerPlus,children:`+`})})]})]}),f===`gifs`&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`input`,{ref:y,type:`file`,accept:`image/gif`,style:{display:`none`},onChange:P}),(0,o.jsxs)(`div`,{className:a.stickerGrid,style:{gridTemplateColumns:`repeat(3, 1fr)`},children:[g.map((t,n)=>(0,o.jsxs)(`div`,{className:a.stickerSlot,onClick:()=>e(t),children:[(0,o.jsx)(`img`,{src:t,alt:``}),(0,o.jsx)(`button`,{className:a.stickerDelete,onClick:e=>{e.stopPropagation(),I(n)},children:`×`})]},n)),(0,o.jsx)(`div`,{className:a.stickerSlot,onClick:()=>y.current?.click(),children:(0,o.jsx)(`span`,{className:a.stickerPlus,children:`+`})})]})]})]})})}export{u as default};1._step_1q5ed_1{flex-direction:column;align-items:center;gap:16px;padding:4px 0;display:flex}._heroIcon_1q5ed_9{margin-bottom:2px;animation:.5s cubic-bezier(.34,1.56,.64,1) _fadeInScale_1q5ed_1}@keyframes _fadeInScale_1q5ed_1{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}._infoBlock_1q5ed_19{flex-direction:column;gap:8px;width:100%;display:flex}._infoTitle_1q5ed_26{color:#999;text-transform:uppercase;letter-spacing:.6px;margin:0;font-size:13px;font-weight:600}._infoText_1q5ed_35{color:#bbb;margin:0;font-size:13.5px;line-height:1.55}._featureList_1q5ed_42{flex-direction:column;gap:6px;width:100%;display:flex}._featureItem_1q5ed_49{color:#e0e0e0;background:#ffffff0a;border-radius:12px;align-items:center;gap:10px;padding:10px 14px;font-size:14px;transition:background .15s;display:flex}._featureItem_1q5ed_49:hover{background:#ffffff0f}._dot_1q5ed_65{border-radius:50%;flex-shrink:0;width:7px;height:7px}._muted_1q5ed_72{color:#777;font-size:13px}._warnBox_1q5ed_77{color:#ff9500;background:#ff950014;border:1px solid #ff950033;border-radius:12px;align-items:flex-start;gap:10px;width:100%;padding:12px 14px;font-size:13px;line-height:1.45;display:flex}._warnText_1q5ed_91{margin:0;font-size:13px;line-height:1.45}._warnText_1q5ed_91+._warnText_1q5ed_91{opacity:.8;margin-top:2px}._fieldGroup_1q5ed_102{flex-direction:column;gap:8px;width:100%;display:flex}._fieldLabel_1q5ed_109{color:#999;margin:0;font-size:13px;font-weight:600}._passwordRow_1q5ed_116{gap:10px;width:100%;display:flex}._passwordInput_1q5ed_122{color:#fff;text-align:center;letter-spacing:6px;box-sizing:border-box;text-transform:uppercase;background:#ffffff0f;border:1.5px solid #ffffff1a;border-radius:14px;outline:none;flex:1;min-width:0;padding:14px 12px;font-family:SF Mono,Fira Code,monospace;font-size:22px;font-weight:700;transition:border-color .2s,box-shadow .2s}._passwordInput_1q5ed_122:focus{border-color:var(--accent-solid,#a74fff);box-shadow:0 0 0 3px rgba(var(--accent-rgb,167, 79, 255), .12)}._passwordInput_1q5ed_122::placeholder{color:#ffffff2e;letter-spacing:2px;font-weight:400}._activeBadge_1q5ed_152{color:#34c759;background:#34c7591f;border:1px solid #34c75940;border-radius:20px;align-items:center;gap:6px;padding:6px 16px;font-size:14px;font-weight:600;display:inline-flex}._error_1q5ed_165{color:#ff3b30;text-align:center;box-sizing:border-box;background:#ff3b301a;border:1px solid #ff3b3033;border-radius:10px;width:100%;padding:8px 12px;font-size:13px}._primaryBtn_1q5ed_177{background:var(--accent-solid,#a74fff);width:100%;color:var(--on-accent,#fff);cursor:pointer;border:none;border-radius:14px;padding:14px;font-family:inherit;font-size:16px;font-weight:600;transition:all .2s}._primaryBtn_1q5ed_177:hover:not(:disabled){filter:brightness(1.1);box-shadow:0 4px 16px rgba(var(--accent-rgb,167, 79, 255), .3);transform:translateY(-1px)}._primaryBtn_1q5ed_177:active:not(:disabled){transform:scale(.98)}._primaryBtn_1q5ed_177:disabled{opacity:.5;cursor:not-allowed}._dangerBtn_1q5ed_206{color:#ff3b30;cursor:pointer;background:#ff3b301f;border:1.5px solid #ff3b304d;border-radius:14px;width:100%;padding:14px;font-family:inherit;font-size:16px;font-weight:600;transition:all .2s}._dangerBtn_1q5ed_206:hover:not(:disabled){background:#ff3b3038;box-shadow:0 4px 16px #ff3b3026}._dangerBtn_1q5ed_206:active:not(:disabled){transform:scale(.98)}._dangerBtn_1q5ed_206:disabled{opacity:.5;cursor:not-allowed}._progressBar_1q5ed_234{background:#ffffff14;border-radius:3px;width:100%;height:6px;overflow:hidden}._progressFill_1q5ed_242{background:var(--accent-solid,#a74fff);border-radius:3px;height:100%;transition:width .4s cubic-bezier(.4,0,.2,1)}._progressText_1q5ed_249{color:#ccc;margin:0;font-size:15px}._doneText_1q5ed_255{color:#34c759;margin:0;font-size:18px;font-weight:700}1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t,u as n}from"./vendor-BbmWO_jh.js";import{r,s as i}from"./index-BxVTd_Wu.js";import{t as a}from"./ModalShell-DWofhKyP.js";var o=e(n(),1),s={step:`_step_1q5ed_1`,heroIcon:`_heroIcon_1q5ed_9`,fadeInScale:`_fadeInScale_1q5ed_1`,infoBlock:`_infoBlock_1q5ed_19`,infoTitle:`_infoTitle_1q5ed_26`,infoText:`_infoText_1q5ed_35`,featureList:`_featureList_1q5ed_42`,featureItem:`_featureItem_1q5ed_49`,dot:`_dot_1q5ed_65`,muted:`_muted_1q5ed_72`,warnBox:`_warnBox_1q5ed_77`,warnText:`_warnText_1q5ed_91`,fieldGroup:`_fieldGroup_1q5ed_102`,fieldLabel:`_fieldLabel_1q5ed_109`,passwordRow:`_passwordRow_1q5ed_116`,passwordInput:`_passwordInput_1q5ed_122`,activeBadge:`_activeBadge_1q5ed_152`,error:`_error_1q5ed_165`,primaryBtn:`_primaryBtn_1q5ed_177`,dangerBtn:`_dangerBtn_1q5ed_206`,progressBar:`_progressBar_1q5ed_234`,progressFill:`_progressFill_1q5ed_242`,progressText:`_progressText_1q5ed_249`,doneText:`_doneText_1q5ed_255`},c=t();function l({isOpen:e,onClose:t}){let{t:n}=i(),{isEncrypted:l,enableEncryption:u,disableEncryption:d,isLoading:f,error:p,setError:m}=r(),[h,g]=(0,o.useState)(`main`),[_,v]=(0,o.useState)(``),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)(``),[T,E]=(0,o.useState)(``),[D,O]=(0,o.useState)(``),[k,A]=(0,o.useState)(0);(0,o.useEffect)(()=>{e&&(g(`main`),m(null))},[e,m]);let j=(0,o.useRef)(null),M=(0,o.useCallback)(async()=>{let e=_.toLowerCase()+y;if(_.length!==3||y.length!==3){m(`Введите 3 буквы и 3 цифры`);return}if(e!==x.toLowerCase()+C){m(`Пароли не совпадают`);return}if(g(`progress`),A(10),setTimeout(()=>A(30),200),setTimeout(()=>A(60),500),setTimeout(()=>A(90),800),!await u(e)){g(`main`);return}A(100),setTimeout(()=>g(`done`),500)},[_,y,x,C,u,m]),N=(0,o.useCallback)(async()=>{let e=T.toLowerCase()+D;if(T.length!==3||D.length!==3){m(`Введите пароль`);return}await d(e)},[T,D,d,m]),P=(0,c.jsxs)(`svg`,{viewBox:`0 0 48 48`,width:`52`,height:`52`,fill:`none`,children:[(0,c.jsx)(`path`,{d:`M24 4L8 12v10c0 11.1 6.8 21.5 16 24 9.2-2.5 16-12.9 16-24V12L24 4z`,fill:`rgba(var(--accent-rgb,167,79,255),0.1)`,stroke:`var(--accent-solid,#a74fff)`,strokeWidth:`2`}),(0,c.jsx)(`path`,{d:`M20 24l3 3 6-6`,stroke:`var(--accent-solid,#a74fff)`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]});return(0,c.jsxs)(a,{isOpen:e,onClose:t,title:`Шифрование базы`,maxWidth:`400px`,closeRef:j,children:[h===`main`&&!l&&(0,c.jsxs)(`div`,{className:s.step,children:[(0,c.jsx)(`div`,{className:s.heroIcon,children:P}),(0,c.jsxs)(`div`,{className:s.infoBlock,children:[(0,c.jsx)(`p`,{className:s.infoTitle,children:n(`Что зашифровано`)}),(0,c.jsxs)(`div`,{className:s.featureList,children:[(0,c.jsxs)(`div`,{className:s.featureItem,children:[(0,c.jsx)(`span`,{className:s.dot,style:{background:`#34c759`}}),(0,c.jsx)(`span`,{children:n(`Сообщения, медиа, вложения`)})]}),(0,c.jsxs)(`div`,{className:s.featureItem,children:[(0,c.jsx)(`span`,{className:s.dot,style:{background:`#34c759`}}),(0,c.jsx)(`span`,{children:n(`Криптоключи E2EE (сессии, identity)`)})]}),(0,c.jsxs)(`div`,{className:s.featureItem,children:[(0,c.jsx)(`span`,{className:s.dot,style:{background:`#34c759`}}),(0,c.jsx)(`span`,{children:n(`Токен авторизации и данные аккаунтов`)})]}),(0,c.jsxs)(`div`,{className:s.featureItem,children:[(0,c.jsx)(`span`,{className:s.dot,style:{background:`#888`}}),(0,c.jsx)(`span`,{className:s.muted,children:n(`Настройки интерфейса без изменений`)})]})]})]}),(0,c.jsxs)(`div`,{className:s.infoBlock,children:[(0,c.jsx)(`p`,{className:s.infoTitle,children:n(`Как работает`)}),(0,c.jsx)(`p`,{className:s.infoText,children:n(`При включении задаётся пароль (3 буквы + 3 цифры). Данные шифруются на устройстве алгоритмом Argon2id + XChaCha20. При каждом запуске приложения потребуется ввести пароль.`)})]}),(0,c.jsxs)(`div`,{className:s.warnBox,children:[(0,c.jsx)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`#ff9500`,style:{flexShrink:0,marginTop:1},children:(0,c.jsx)(`path`,{d:`M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 10-2 0 1 1 0 002 0zm-1-2a.75.75 0 01-.75-.75v-3.5a.75.75 0 011.5 0v3.5A.75.75 0 0110 11z`})}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`p`,{className:s.warnText,children:n(`Восстановление пароля невозможно.`)}),(0,c.jsx)(`p`,{className:s.warnText,children:n(`При потере пароля данные будут безвозвратно утеряны.`)})]})]}),(0,c.jsxs)(`div`,{className:s.fieldGroup,children:[(0,c.jsx)(`label`,{className:s.fieldLabel,children:n(`Пароль`)}),(0,c.jsxs)(`div`,{className:s.passwordRow,children:[(0,c.jsx)(`input`,{className:s.passwordInput,type:`text`,maxLength:3,placeholder:`ABC`,value:_,onChange:e=>v(e.target.value.replace(/[^a-zA-Z]/g,``).slice(0,3)),autoComplete:`off`,autoCapitalize:`off`}),(0,c.jsx)(`input`,{className:s.passwordInput,type:`text`,maxLength:3,placeholder:`123`,value:y,onChange:e=>b(e.target.value.replace(/\D/g,``).slice(0,3)),autoComplete:`off`})]})]}),(0,c.jsxs)(`div`,{className:s.fieldGroup,children:[(0,c.jsx)(`label`,{className:s.fieldLabel,children:n(`Подтвердите пароль`)}),(0,c.jsxs)(`div`,{className:s.passwordRow,children:[(0,c.jsx)(`input`,{className:s.passwordInput,type:`text`,maxLength:3,placeholder:`ABC`,value:x,onChange:e=>S(e.target.value.replace(/[^a-zA-Z]/g,``).slice(0,3)),autoComplete:`off`,autoCapitalize:`off`}),(0,c.jsx)(`input`,{className:s.passwordInput,type:`text`,maxLength:3,placeholder:`123`,value:C,onChange:e=>w(e.target.value.replace(/\D/g,``).slice(0,3)),autoComplete:`off`})]})]}),p&&(0,c.jsx)(`div`,{className:s.error,children:p}),(0,c.jsx)(`button`,{className:s.primaryBtn,onClick:M,disabled:f||_.length<3||y.length<3,children:n(f?`Шифрование...`:`Включить шифрование`)})]}),h===`main`&&l&&(0,c.jsxs)(`div`,{className:s.step,children:[(0,c.jsx)(`div`,{className:s.heroIcon,children:(0,c.jsxs)(`svg`,{viewBox:`0 0 48 48`,width:`52`,height:`52`,fill:`none`,children:[(0,c.jsx)(`path`,{d:`M24 4L8 12v10c0 11.1 6.8 21.5 16 24 9.2-2.5 16-12.9 16-24V12L24 4z`,fill:`rgba(52,199,89,0.1)`,stroke:`#34c759`,strokeWidth:`2`}),(0,c.jsx)(`path`,{d:`M20 24l3 3 6-6`,stroke:`#34c759`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}),(0,c.jsx)(`div`,{className:s.activeBadge,children:n(`Шифрование активно`)}),(0,c.jsx)(`div`,{className:s.infoBlock,children:(0,c.jsx)(`p`,{className:s.infoText,children:n(`Сообщения, ключи E2EE и данные аккаунтов зашифрованы на этом устройстве.`)})}),(0,c.jsxs)(`div`,{className:s.infoBlock,children:[(0,c.jsx)(`p`,{className:s.infoTitle,children:n(`Отключение шифрования`)}),(0,c.jsx)(`p`,{className:s.infoText,children:n(`Все данные будут расшифрованы и сохранены в открытом виде. Пароль введите для подтверждения.`)})]}),(0,c.jsxs)(`div`,{className:s.fieldGroup,children:[(0,c.jsx)(`label`,{className:s.fieldLabel,children:n(`Пароль`)}),(0,c.jsxs)(`div`,{className:s.passwordRow,children:[(0,c.jsx)(`input`,{className:s.passwordInput,type:`text`,maxLength:3,placeholder:`ABC`,value:T,onChange:e=>E(e.target.value.replace(/[^a-zA-Z]/g,``).slice(0,3)),autoComplete:`off`,autoCapitalize:`off`}),(0,c.jsx)(`input`,{className:s.passwordInput,type:`text`,maxLength:3,placeholder:`123`,value:D,onChange:e=>O(e.target.value.replace(/\D/g,``).slice(0,3)),autoComplete:`off`})]})]}),p&&(0,c.jsx)(`div`,{className:s.error,children:p}),(0,c.jsx)(`button`,{className:s.dangerBtn,onClick:N,disabled:f||T.length<3||D.length<3,children:n(f?`Расшифровка...`:`Отключить шифрование`)})]}),h===`progress`&&(0,c.jsxs)(`div`,{className:s.step,children:[(0,c.jsx)(`div`,{className:s.heroIcon,children:P}),(0,c.jsx)(`p`,{className:s.progressText,children:n(`Шифрование базы данных...`)}),(0,c.jsx)(`div`,{className:s.progressBar,children:(0,c.jsx)(`div`,{className:s.progressFill,style:{width:`${k}%`}})})]}),h===`done`&&(0,c.jsxs)(`div`,{className:s.step,children:[(0,c.jsx)(`div`,{className:s.heroIcon,children:(0,c.jsxs)(`svg`,{viewBox:`0 0 48 48`,width:`52`,height:`52`,fill:`none`,children:[(0,c.jsx)(`circle`,{cx:`24`,cy:`24`,r:`20`,fill:`rgba(52,199,89,0.12)`,stroke:`#34c759`,strokeWidth:`2`}),(0,c.jsx)(`path`,{d:`M16 24l5 5 11-11`,stroke:`#34c759`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}),(0,c.jsx)(`p`,{className:s.doneText,children:n(`Шифрование активно`)}),(0,c.jsx)(`p`,{className:s.muted,children:n(`При следующем запуске потребуется ввести пароль.`)}),(0,c.jsx)(`button`,{className:s.primaryBtn,onClick:()=>j.current?.(),children:n(`Готово`)})]})]})}export{l as default};1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t,u as n}from"./vendor-BbmWO_jh.js";import{s as r}from"./index-BxVTd_Wu.js";var i=e(n(),1),a={overlay:`_overlay_jh7o2_11`,open:`_open_jh7o2_27`,closing:`_closing_jh7o2_33`,content:`_content_jh7o2_40`,dangerBorder:`_dangerBorder_jh7o2_72`,title:`_title_jh7o2_77`,closeBtn:`_closeBtn_jh7o2_86`,backBtn:`_backBtn_jh7o2_110`,fadeIn:`_fadeIn_jh7o2_1`,fadeOut:`_fadeOut_jh7o2_1`},o=t();function s({isOpen:e,onClose:t,children:n,maxWidth:s=`380px`,title:c,showClose:l=!0,danger:u=!1,dangerColor:d,onBack:f,closeRef:p}){let{t:m}=r(),[h,g]=(0,i.useState)(e),[_,v]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),x=(0,i.useRef)(t);x.current=t;let S=(0,i.useCallback)(()=>{_||v(!0)},[_]);return(0,i.useEffect)(()=>{p&&(p.current=S)},[p,S]),(0,i.useEffect)(()=>{if(e){g(!0),v(!1),b(!1);let e=requestAnimationFrame(()=>{requestAnimationFrame(()=>{b(!0)})});return()=>cancelAnimationFrame(e)}},[e]),(0,i.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>{g(!1),v(!1),b(!1),x.current()},400);return()=>clearTimeout(e)},[_]),(0,i.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&S()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,S]),h?(0,o.jsx)(`div`,{className:`${a.overlay} ${y&&!_?a.open:``} ${_?a.closing:``}`,onClick:S,children:(0,o.jsxs)(`div`,{className:`${a.content} ${u?a.dangerBorder:``}`,style:{maxWidth:s},onClick:e=>e.stopPropagation(),children:[f&&(0,o.jsx)(`button`,{className:a.backBtn,onClick:f,children:(0,o.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`22`,height:`22`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),c&&(0,o.jsx)(`h3`,{className:a.title,style:u?{color:d||`#ff3b30`}:void 0,children:m(c)}),n,l&&(0,o.jsx)(`button`,{className:a.closeBtn,onClick:S,children:m(`Закрыть`)})]})}):null}export{s as t};1@keyframes _fadeIn_jh7o2_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_jh7o2_1{0%{opacity:1}to{opacity:0}}._overlay_jh7o2_11{z-index:11000;background:rgba(var(--overlay-rgb,30, 27, 36), 0);-webkit-backdrop-filter:blur();justify-content:center;align-items:center;width:100%;height:100%;transition:background .5s,-webkit-backdrop-filter .5s,backdrop-filter .5s;display:flex;position:fixed;top:0;left:0}._overlay_jh7o2_11._open_jh7o2_27{background:rgba(var(--overlay-rgb,30, 27, 36), .95);-webkit-backdrop-filter:blur(20px)}._overlay_jh7o2_11._closing_jh7o2_33{background:rgba(var(--overlay-rgb,30, 27, 36), 0);-webkit-backdrop-filter:blur();pointer-events:none}._content_jh7o2_40{background:rgba(var(--card-rgb,42, 38, 51), .95);-webkit-backdrop-filter:blur(40px);border:1px solid rgba(var(--accent-rgb,157, 78, 221), .2);opacity:0;scrollbar-width:none;border-radius:24px;width:90%;max-width:380px;max-height:85vh;margin:0 auto;padding:32px 24px;transition:all .5s cubic-bezier(.34,1.56,.64,1);position:relative;overflow-y:auto;transform:scale(.9);box-shadow:0 20px 60px #00000080}._content_jh7o2_40::-webkit-scrollbar{display:none}._overlay_jh7o2_11._open_jh7o2_27 ._content_jh7o2_40{opacity:1;transform:translateY(0)scale(1)}._overlay_jh7o2_11._closing_jh7o2_33 ._content_jh7o2_40{opacity:0;transition:all .4s cubic-bezier(.4,0,.2,1);transform:scale(.8)translateY(20px)}._dangerBorder_jh7o2_72{border-color:#ff3b304d;box-shadow:0 20px 60px #00000080,0 0 40px #ff3b3033}._title_jh7o2_77{color:#fff;font-size:calc(22px * var(--font-size-scale));text-align:center;margin:0 0 24px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-weight:700}._closeBtn_jh7o2_86{background:rgba(var(--accent-rgb,157, 78, 221), .15);width:100%;color:var(--on-accent,#fff);border:2px solid rgba(var(--accent-rgb,157, 78, 221), .3);cursor:pointer;font-size:calc(16px * var(--font-size-scale));border-radius:14px;margin-top:12px;padding:16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-weight:600;transition:all .2s}._closeBtn_jh7o2_86:hover{background:rgba(var(--accent-rgb,157, 78, 221), .25);border-color:rgba(var(--accent-rgb,157, 78, 221), .5)}._closeBtn_jh7o2_86:active{transform:scale(.97)}._backBtn_jh7o2_110{cursor:pointer;color:#8e8e93;z-index:1;background:#ffffff14;border:none;border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;transition:all .2s;display:flex;position:absolute;top:24px;left:20px}._backBtn_jh7o2_110:hover{color:#fff;background:#ffffff26}._backBtn_jh7o2_110:active{transform:scale(.92)}1import{t as e}from"./rolldown-runtime-QTnfLwEv.js";var t=e(((e,t)=>{t.exports={}}));export{t};12const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/libsodium-wrappers-DIT7SeqD.js","assets/__vite-browser-external-BRm5n2qg.js","assets/rolldown-runtime-QTnfLwEv.js"])))=>i.map(i=>d[i]);import{n as e}from"./rolldown-runtime-QTnfLwEv.js";import{s as t}from"./vendor-BbmWO_jh.js";var n=e({createVerificationBlob:()=>g,decrypt:()=>h,decryptValue:()=>b,deriveKey:()=>f,encrypt:()=>p,encryptValue:()=>y,encryptWithSalt:()=>m,ensureReady:()=>u,generateSalt:()=>d,validatePasswordFormat:()=>v,verifyPassword:()=>_}),r=16,i=24,a=32,o=`4SEND_VERIFIED`,s=!1,c;async function l(){if(!c){let e=await t(()=>import(`./libsodium-wrappers-DIT7SeqD.js`),__vite__mapDeps([0,1,2]));c=e.default||e}return c}async function u(){s||=(await(await l()).ready,!0)}async function d(){return(await l()).randombytes_buf(r)}async function f(e,t){await u();let n=c;return n.crypto_pwhash(a,e,t,n.crypto_pwhash_OPSLIMIT_INTERACTIVE,n.crypto_pwhash_MEMLIMIT_INTERACTIVE,n.crypto_pwhash_ALG_ARGON2ID13)}async function p(e,t,n){await u();let r=c,a=r.randombytes_buf(i),o=r.crypto_aead_xchacha20poly1305_ietf_encrypt(r.from_string(e),r.from_string(n),null,a,t);return{v:2,salt:``,iv:r.to_base64(a),aad:n,data:r.to_base64(o)}}async function m(e,t,n,r){let i=await p(e,t,r);return i.salt=(await l()).to_base64(n),i}async function h(e,t){await u();let n=c,r=n.from_base64(e.iv),i=n.from_base64(e.data),a=n.from_string(e.aad),o=n.crypto_aead_xchacha20poly1305_ietf_decrypt(null,i,a,r,t);return n.to_string(o)}async function g(e,t){return m(o,e,t,`verify`)}async function _(e,t,n){try{return await h(n,await f(e,(await l()).from_base64(t)))===o}catch{return!1}}function v(e){return/^[a-zA-Z]{3}\d{3}$/.test(e)}async function y(e,t,n){return p(JSON.stringify(e),t,n)}async function b(e,t){let n=await h(e,t);return JSON.parse(n)}export{p as a,u as c,_ as d,f as i,d as l,h as n,y as o,b as r,n as s,g as t,v as u};1._authScreen_q4ig3_1{z-index:10000;background:#0b0b0e;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:fixed;top:0;left:0}._authScreen_q4ig3_1:after{content:"";background:radial-gradient(circle, rgba(var(--accent-rgb,167, 79, 255), .12) 0, transparent 70%);z-index:0;pointer-events:none;width:900px;height:900px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._authPattern_q4ig3_28{z-index:1;pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;overflow:hidden}._authCard_q4ig3_39{background:rgba(var(--card-rgb,26, 26, 36), .6);-webkit-backdrop-filter:blur(20px);z-index:10;box-sizing:border-box;border:1px solid #ffffff14;border-radius:32px;flex-direction:column;align-items:center;width:90%;max-width:380px;padding:40px 30px;animation:.6s cubic-bezier(.2,.8,.2,1) _slideUp_q4ig3_1;display:flex;position:relative;box-shadow:0 30px 60px #0009,inset 0 1px #ffffff1a}._authLogo_q4ig3_58{justify-content:center;align-items:center;width:64px;height:64px;margin-bottom:20px;display:flex}._authLogo_q4ig3_58 img{object-fit:contain;border-radius:16px;width:64px;height:64px}._authTitle_q4ig3_74{letter-spacing:2px;background:var(--accent);-webkit-text-fill-color:transparent;text-shadow:none;-webkit-background-clip:text;background-clip:text;margin:0 0 20px;font-size:52px;font-weight:900}._authTabs_q4ig3_86{box-sizing:border-box;background:#0000004d;border-radius:16px;width:100%;margin-bottom:25px;padding:4px;display:flex}._authTab_q4ig3_86{text-align:center;font-size:calc(14px * var(--font-size-scale));color:#888;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:12px;flex:1;padding:12px 0;font-weight:700;transition:all .3s}._authTab_q4ig3_86._active_q4ig3_109{background:rgba(var(--accent-rgb,167, 79, 255), .15);color:var(--accent-solid);box-shadow:0 4px 15px #0003}._inputGroup_q4ig3_115{width:100%;margin-bottom:16px;position:relative}._inputIcon_q4ig3_121{fill:#666;pointer-events:none;width:20px;height:20px;transition:all .3s;position:absolute;top:50%;left:18px;transform:translateY(-50%)}._inputGroup_q4ig3_115 input{background:rgba(var(--card-rgb,26, 26, 36), .5);color:#fff;width:100%;font-size:calc(15px * var(--font-size-scale));box-sizing:border-box;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid #ffffff1a;border-radius:14px;outline:none;padding:14px 14px 14px 45px;font-family:Plus Jakarta Sans,sans-serif;transition:border-color .2s,background-color .2s}._inputGroup_q4ig3_115 input:focus{border-color:var(--accent-solid);background:rgba(var(--accent-rgb,167, 79, 255), .05);box-shadow:0 0 20px rgba(var(--accent-rgb,167, 79, 255), .15)}._inputGroup_q4ig3_115 input:focus~._inputIcon_q4ig3_121{fill:var(--accent-solid)}._termsBox_q4ig3_158{box-sizing:border-box;flex-direction:column;gap:12px;width:100%;margin-bottom:20px;padding-left:2px;display:flex}._termsLabel_q4ig3_168{cursor:pointer;font-size:calc(12px * var(--font-size-scale));color:#aaa;text-align:left;align-items:center;gap:10px;line-height:1.4;display:flex}._termsLabel_q4ig3_168 input[type=checkbox]{display:none}._checkmark_q4ig3_183{background:#0000004d;border:2px solid #ffffff1a;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;width:20px;min-width:20px;height:20px;transition:all .2s;display:flex}._termsLabel_q4ig3_168 input[type=checkbox]:checked~._checkmark_q4ig3_183{background:var(--accent-solid);border-color:var(--accent-solid)}._checkmark_q4ig3_183:after{content:"";opacity:0;border:2px solid #fff;border-width:0 2px 2px 0;width:5px;height:10px;margin-bottom:2px;transition:all .2s;transform:rotate(45deg)}._termsLabel_q4ig3_168 input[type=checkbox]:checked~._checkmark_q4ig3_183:after{opacity:1}._termsText_q4ig3_218{flex:1;line-height:1.4}._termsText_q4ig3_218 a{color:var(--accent-solid);font-weight:600;text-decoration:none}._termsText_q4ig3_218 a:hover{text-decoration:underline}._submitBtn_q4ig3_233{background:linear-gradient(135deg, var(--accent-solid), var(--accent-hover));width:300px;color:var(--on-accent,#fff);font-weight:700;font-size:calc(15px * var(--font-size-scale));letter-spacing:1px;cursor:pointer;box-shadow:0 10px 25px rgba(var(--accent-rgb,167, 79, 255), .3);border:none;border-radius:14px;margin-top:12px;padding:14px;transition:transform .3s,box-shadow .3s,filter .3s}._submitBtn_q4ig3_233:hover{box-shadow:0 0 25px rgba(var(--accent-rgb,167, 79, 255), .5);filter:brightness(1.1);transform:scale(1.03)}._submitBtn_q4ig3_233:active{transform:scale(.97)}._submitBtn_q4ig3_233:disabled{opacity:.6;cursor:not-allowed;transform:none}._error_q4ig3_265{color:#ff4d4d;font-size:calc(13px * var(--font-size-scale));text-align:center;min-height:18px;margin-top:15px;font-weight:600;transition:padding .2s,background .2s,border-color .2s}._error_q4ig3_265._info_q4ig3_275{color:var(--accent-solid);background:rgba(var(--accent-rgb,167, 79, 255), .08);border:1px solid rgba(var(--accent-rgb,167, 79, 255), .2);border-radius:12px;width:100%;padding:10px 14px;font-weight:500;line-height:1.4}._langToggle_q4ig3_286{cursor:pointer;color:#888;font-weight:700;font-size:calc(14px * var(--font-size-scale));z-index:100;align-items:center;gap:6px;transition:all .2s;display:flex;position:absolute;top:20px;right:20px}._langToggle_q4ig3_286:hover{color:#fff}._langToggle_q4ig3_286 svg{fill:currentColor;width:20px;height:20px}._twoFAContainer_q4ig3_311{width:100%;animation:.3s _fadeSlideIn_q4ig3_1}._backLink_q4ig3_316{color:var(--accent-solid);font-size:calc(13px * var(--font-size-scale));cursor:pointer;text-align:center;margin-bottom:15px;font-weight:700}@keyframes _slideUp_q4ig3_1{0%{opacity:0;filter:blur(10px);transform:translateY(30px)}to{opacity:1;filter:blur();transform:translateY(0)}}@keyframes _fadeSlideIn_q4ig3_1{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes _authExit_q4ig3_1{0%{opacity:1;filter:blur();transform:scale(1)}to{opacity:0;filter:blur(20px);transform:scale(1.15)}}@keyframes _shake_q4ig3_1{0%,to{transform:translate(0)}25%{transform:translate(-10px)}75%{transform:translate(10px)}}@media (width<=400px){._authCard_q4ig3_39{width:95%!important;padding:30px 20px!important}}._container_1a69n_1{z-index:20000;pointer-events:none;flex-direction:column;align-items:center;gap:10px;width:100%;padding-top:30px;display:flex;position:fixed;top:0;left:0}._toast_1a69n_15{-webkit-backdrop-filter:blur(12px);pointer-events:auto;cursor:pointer;min-width:200px;max-width:90%;font-size:calc(14px * var(--font-size-scale));letter-spacing:.3px;color:#fff;text-align:center;border:1px solid #ffffff26;border-radius:15px;justify-content:center;align-items:center;padding:12px 22px 12px 42px;font-weight:600;animation:.35s cubic-bezier(.34,1.56,.64,1) forwards _toastIn_1a69n_1;display:flex;position:relative;box-shadow:0 10px 35px #0000008c}._toast_1a69n_15._leaving_1a69n_39{animation:.3s ease-in forwards _toastOut_1a69n_1}._icon_1a69n_43{fill:#fff;flex-shrink:0;width:20px;height:20px;position:absolute;top:50%;left:14px;transform:translateY(-50%)}._info_1a69n_54{background:rgba(var(--accent-rgb,167, 79, 255), .92);border-color:rgba(var(--accent-rgb,167, 79, 255), .5);box-shadow:0 10px 35px #0000008c, 0 0 25px rgba(var(--accent-rgb,167, 79, 255), .25)}._success_1a69n_60{background:#4caf50eb;border-color:#4caf5080;box-shadow:0 10px 35px #0000008c,0 0 25px #4caf504d}._error_1a69n_66{background:#ff4d4deb;border-color:#ff4d4d80;box-shadow:0 10px 35px #0000008c,0 0 25px #ff4d4d4d}@keyframes _toastIn_1a69n_1{0%{opacity:0;transform:translateY(-25px)scale(.9)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes _toastOut_1a69n_1{0%{opacity:1;transform:translateY(0)scale(1)}to{opacity:0;transform:translateY(-25px)scale(.9)}}._overlay_1md3i_1{background:var(--bg,#0a0a0c);z-index:2147483647;opacity:0;justify-content:center;align-items:center;transition:opacity .5s;display:flex;position:fixed;inset:0}._overlay_1md3i_1._visible_1md3i_13{opacity:1}._overlay_1md3i_1._closing_1md3i_17{opacity:0;transition:opacity .4s cubic-bezier(.4,0,.2,1)}._card_1md3i_22{flex-direction:column;align-items:center;gap:18px;width:90vw;max-width:380px;padding:40px 32px;display:flex}._heroIcon_1md3i_32{animation:3s ease-in-out infinite _pulse_1md3i_1}@keyframes _pulse_1md3i_1{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}._title_1md3i_41{color:#fff;text-align:center;margin:0;font-size:22px;font-weight:700}._subtitle_1md3i_49{color:#888;text-align:center;margin:0;font-size:14px}._passwordRow_1md3i_56{align-items:center;gap:10px;display:flex}._input_1md3i_62{color:#fff;text-align:center;letter-spacing:6px;text-transform:uppercase;background:#ffffff0f;border:2px solid #ffffff1a;border-radius:16px;outline:none;font-family:SF Mono,Fira Code,monospace;font-size:24px;font-weight:700;transition:border-color .2s}._input_1md3i_62:focus{border-color:var(--accent-solid,#a74fff);box-shadow:0 0 0 3px rgba(var(--accent-rgb,167, 79, 255), .15)}._input_1md3i_62::placeholder{color:#ffffff26;letter-spacing:2px;font-weight:400}._error_1md3i_88{color:#ff3b30;text-align:center;background:#ff3b301a;border-radius:10px;width:100%;padding:8px 16px;font-size:13px}._unlockBtn_1md3i_98{background:var(--accent-solid,#a74fff);width:100%;color:var(--on-accent,#fff);cursor:pointer;border:none;border-radius:16px;justify-content:center;align-items:center;min-height:52px;padding:16px;font-family:inherit;font-size:17px;font-weight:600;transition:all .2s;display:flex}._unlockBtn_1md3i_98:hover:not(:disabled){filter:brightness(1.1);box-shadow:0 6px 20px rgba(var(--accent-rgb,167, 79, 255), .3);transform:translateY(-1px)}._unlockBtn_1md3i_98:active:not(:disabled){transform:scale(.98)}._unlockBtn_1md3i_98:disabled{opacity:.5;cursor:not-allowed}._spinner_1md3i_131{border:2.5px solid #ffffff4d;border-top-color:#fff;border-radius:50%;width:22px;height:22px;animation:.7s linear infinite _spin_1md3i_131}@keyframes _spin_1md3i_131{to{transform:rotate(360deg)}}:root{--accent:linear-gradient(135deg, #a74fff, #6a11cb);--accent-solid:#a74fff;--accent-rgb:167, 79, 255;--accent-hover:#9147e0;--bg:#0a0a0c;--bg-elevated:#0f0f13;--sidebar:#121218;--sidebar-hover:#1a1a22;--card:#1a1a24;--card-hover:#22222c;--card-rgb:26, 26, 36;--bg-rgb:10, 10, 12;--border:#252530;--border-light:#2e2e3a;--sent:#2d1b4d;--sent-hover:#3a255a;--rcv:#1e1e24;--rcv-hover:#282830;--on-accent:#fff;--tg-blue:#50a2e9;--success:#4caf50;--warning:#ff9500;--error:#ff4d4d;--error-rgb:255, 77, 77;--error-bg:#ff4d4d26;--text-primary:#f0f0f0;--text-secondary:#aaa;--text-muted:#888;--text-dim:#777;--shadow-sm:0 2px 8px #0000004d;--shadow-md:0 8px 25px #0006;--shadow-lg:0 20px 60px #00000080;--shadow-glow:0 0 20px #a74fff4d;--radius-sm:8px;--radius-md:12px;--radius-lg:16px;--radius-xl:24px;--radius-full:50%;--transition-fast:.15s ease;--transition-base:.2s ease;--transition-smooth:.3s cubic-bezier(.4, 0, .2, 1);--transition-bounce:.35s cubic-bezier(.175, .885, .32, 1.275);--z-dropdown:1000;--z-modal:10000;--z-toast:20000;--z-lightbox:2147480000;--msg-text-size:15px;--font-size-base:15px;--font-size-scale:1;--fs-unit:1px;--font-main:"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-heading:"Ubuntu", sans-serif;--font-mono:"SF Mono", "Fira Code", monospace}*{box-sizing:border-box;font-family:var(--font-main,"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;margin:0;padding:0}[contenteditable=true],input,textarea{-webkit-user-select:text;user-select:text}html,body{background:var(--bg);color:#f0f0f0;overscroll-behavior-x:none;overscroll-behavior-y:none;width:100vw;height:100vh;font-size:var(--font-size-base,15px);overflow:hidden}#root{width:100%;height:100%}button,input,select,textarea{font-family:var(--font-main,"Plus Jakarta Sans", sans-serif)}a{color:var(--accent-solid);text-decoration:none}a:hover{text-decoration:underline}::selection{background:var(--accent-solid,#a74fff);color:var(--on-accent,#fff)}::selection{background:var(--accent-solid,#a74fff);color:var(--on-accent,#fff)}::-webkit-scrollbar-thumb{background:#a74fff4d;border-radius:10px;transition:all .3s}::-webkit-scrollbar-thumb:hover{background:var(--accent)}html[data-scrollbar=thin] ::-webkit-scrollbar{width:3px}html[data-scrollbar=normal] ::-webkit-scrollbar{width:5px}html[data-scrollbar=medium] ::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:0 0}*{scrollbar-color:#a74fff4d transparent}::-webkit-scrollbar{display:none!important}*{scrollbar-color:transparent transparent!important;scrollbar-width:none!important}.msgContainer,.contactList,.chatArea,[class*=scrollArea],[class*=leftPanel],[class*=rightPanel],[class*=menuList],[class*=results]{scrollbar-width:thin!important;scrollbar-color:#a74fff4d transparent!important}.msgContainer::-webkit-scrollbar{width:5px;display:block!important}.contactList::-webkit-scrollbar{width:5px;display:block!important}.chatArea::-webkit-scrollbar{width:5px;display:block!important}[class*=scrollArea]::-webkit-scrollbar{width:5px;display:block!important}[class*=leftPanel]::-webkit-scrollbar{width:5px;display:block!important}[class*=rightPanel]::-webkit-scrollbar{width:5px;display:block!important}[class*=menuList]::-webkit-scrollbar{width:5px;display:block!important}[class*=results]::-webkit-scrollbar{width:5px;display:block!important}html[data-sidebar=compact] [class*=sidebar_] [class*=infoBox],html[data-sidebar=compact] [class*=sidebar_] [class*=sidebarTitle]{display:none}html[data-sidebar=compact] [class*=sidebar_] [class*=sidebarHeaderLeft]{gap:0}html[data-sidebar=compact] [class*=sidebar_] [class*=sidebarHeader]{padding:12px 8px 12px 14px}html[data-sidebar=compact] [class*=sidebar_] [class*=searchWrapper],html[data-sidebar=compact] [class*=sidebarHeader] [class*=controlBtn]:last-child{display:none}html[data-sidebar=compact] [class*=sidebar_] [class*=contactItem]{justify-content:center;gap:0;padding:8px}html[data-sidebar=compact] [class*=sidebar_] [class*=unreadBadge]{border-radius:50%;min-width:8px;height:8px;padding:0;font-size:0;top:2px;right:2px}html[data-sidebar=compact] [class*=sidebar_] [class*=avatarBox]{margin:0}input,textarea,select{outline:none}input::placeholder,textarea::placeholder{color:#777}input:disabled,textarea:disabled,button:disabled{opacity:.5;cursor:not-allowed}img{max-width:100%;height:auto;display:block}[data-anim-off] *,[data-anim-off] :before,[data-anim-off] :after{transition:none!important;animation:none!important}[data-anim-fast] *,[data-anim-fast] :before,[data-anim-fast] :after{transition-duration:.12s;animation-duration:.12s}[data-anim-fast] [data-anim-preserve] *,[data-anim-fast] [data-anim-preserve] :before,[data-anim-fast] [data-anim-preserve] :after{animation-duration:initial;transition-duration:initial}[data-anim-off] [data-anim-preserve] *,[data-anim-off] [data-anim-preserve] :before,[data-anim-off] [data-anim-preserve] :after{animation:initial!important;transition:initial!important}@keyframes gpu-init{0%{transform:translateZ(0)}to{transform:translateZ(0)}}*,:before,:after{will-change:auto;backface-visibility:hidden}[style*=transform],[style*=animation],[style*=transition],[class*=modal],[class*=overlay],[class*=drawer],[class*=panel],[class*=context],[class*=toast],[class*=popup],[class*=menu],[class*=transition],[class*=slide],[class*=scale],[class*=fade],[class*=anim]{will-change:transform, opacity;contain:layout style}input,textarea{will-change:auto;contain:none}@keyframes loaderSpin{to{transform:rotate(360deg)}}@keyframes loaderFloat{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}@keyframes loaderShine{to{background-position:200%}}@keyframes loaderPulseText{0%,to{opacity:.3}50%{opacity:1}}@keyframes toastIn{0%{opacity:0;transform:translate(-50%)translateY(-40px)scale(.9)}to{opacity:1;transform:translate(-50%)translateY(0)scale(1)}}@keyframes toastOut{0%{opacity:1;transform:translate(-50%)translateY(0)scale(1)}to{opacity:0;transform:translate(-50%)translateY(-20px)scale(.9)}}@keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@keyframes modalPop{0%{opacity:0;transform:scale(.8)translateY(20px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes iosSlideIn{0%{opacity:0;transform:scale(.85)translateY(30px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes iosSlideOut{0%{opacity:1;transform:scale(1)translateY(0)}to{opacity:0;transform:scale(.85)translateY(30px)}}@keyframes fadeInBg{0%{-webkit-backdrop-filter:blur();backdrop-filter:blur();background:0 0}to{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#000c}}@keyframes springIn{0%{opacity:0;transform:scale(.7)translateY(40px)}50%{opacity:1;transform:scale(1.05)translateY(-5px)}70%{transform:scale(.98)translateY(2px)}to{transform:scale(1)translateY(0)}}@keyframes accountSpringIn{0%{opacity:0;transform:scale(.85)translateY(30px)}65%{opacity:1;transform:scale(1.03)translateY(-4px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes menuShow{0%{opacity:0;transform:scale(.95)translateY(-10px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes menuHide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.98)}}@keyframes menuPopUp{0%{opacity:0;transform:scale(.8)translateY(15px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes menuPopDown{0%{opacity:1;transform:scale(1)translateY(0)}to{opacity:0;transform:scale(.9)translateY(15px)}}@keyframes msgBounce{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes dateAppear{0%{opacity:0;transform:scale(.8)translateY(-10px)}to{opacity:1;transform:scale(1)translateY(0)}}@keyframes chatItemIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes tickArrival{0%{opacity:0;transform:translate(-5px)scale(.5)}to{opacity:1;transform:translate(0)scale(1)}}@keyframes tickFadeIn{0%{opacity:0;transform:scale(.5)translate(-5px)}to{opacity:1;transform:scale(1)translate(0)}}@keyframes floatEmpty{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes floatEmptyMedia{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes searchWobble{0%,to{transform:rotate(0)translate(0)}25%{transform:rotate(-10deg)translate(-3px)}75%{transform:rotate(10deg)translate(3px)}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes bgGlow{0%,to{opacity:.3;transform:scale(1)}50%{opacity:.6;transform:scale(1.2)}}@keyframes lockFloat{0%,to{transform:translateY(0)}50%{transform:translateY(-12px)}}@keyframes lockPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(1.4)}}@keyframes shakeError{0%,to{transform:translate(0)}25%{transform:translate(-4px)}50%{transform:translate(4px)}75%{transform:translate(-4px)}}@keyframes shake{0%,to{transform:translate(0)}25%{transform:translate(-10px)}75%{transform:translate(10px)}}@keyframes slideDownSearch{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUpSearch{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes doorOpen{0%,to{transform:translate(0)}50%{transform:translate(4px)}}@keyframes emojiPop{0%{opacity:0;transform:scale(0)}60%{transform:scale(1.2)}to{opacity:1;transform:scale(1)}}@keyframes fall{0%{opacity:1;transform:translateY(0)rotate(0)translate(0)}25%{transform:translateY(25vh)rotate(90deg)translate(30px)}50%{transform:translateY(50vh)rotate(180deg)translate(-30px)}75%{transform:translateY(75vh)rotate(270deg)translate(30px)}to{opacity:0;transform:translateY(110vh)rotate(720deg)translate(0)}}@keyframes authExit{0%{opacity:1;filter:blur();transform:scale(1)}to{opacity:0;filter:blur(20px);transform:scale(1.15)}}@keyframes slideUp{0%{opacity:0;filter:blur(10px);transform:translateY(30px)}to{opacity:1;filter:blur();transform:translateY(0)}}@keyframes fadeSlideIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes menuFadeIn{0%{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%)}}@keyframes typingDots{0%{opacity:.2}20%{opacity:1}to{opacity:.2}}@keyframes pulseBg{0%,to{opacity:.5;transform:translate(-50%,-50%)scale(1)}50%{opacity:1;transform:translate(-50%,-50%)scale(1.3)}}.animate-slide-down{animation:.2s ease-out forwards slideDownSearch}.animate-slide-up{animation:.2s ease-in forwards slideUpSearch}.animate-menu-pop{animation:.3s cubic-bezier(.34,1.56,.64,1) forwards menuPopUp}.animate-fade-in{animation:.3s forwards fadeIn}.animate-spin{animation:1s linear infinite spin}.animate-shake{animation:.4s ease-in-out both shakeError}1var e=null;function t(t){e=t}function n(){return e}export{t as n,n as t};1var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));export{s as n,l as r,o as t};1import{n as e}from"./rolldown-runtime-QTnfLwEv.js";var t=Object.create(null);t.open=`0`,t.close=`1`,t.ping=`2`,t.pong=`3`,t.message=`4`,t.upgrade=`5`,t.noop=`6`;var n=Object.create(null);Object.keys(t).forEach(e=>{n[t[e]]=e});var r={type:`error`,data:`parser error`},i=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,a=typeof ArrayBuffer==`function`,o=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,s=({type:e,data:n},r,s)=>i&&n instanceof Blob?r?s(n):c(n,s):a&&(n instanceof ArrayBuffer||o(n))?r?s(n):c(new Blob([n]),s):s(t[e]+(n||``)),c=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function l(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var u;function ee(e,t){if(i&&e.data instanceof Blob)return e.data.arrayBuffer().then(l).then(t);if(a&&(e.data instanceof ArrayBuffer||o(e.data)))return t(l(e.data));s(e,!1,e=>{u||=new TextEncoder,t(u.encode(e))})}var te=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,d=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)d[te.charCodeAt(e)]=e;var f=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=d[e.charCodeAt(r)],o=d[e.charCodeAt(r+1)],s=d[e.charCodeAt(r+2)],c=d[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},ne=typeof ArrayBuffer==`function`,p=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:m(e,t)};let i=e.charAt(0);return i===`b`?{type:`message`,data:re(e.substring(1),t)}:n[i]?e.length>1?{type:n[i],data:e.substring(1)}:{type:n[i]}:r},re=(e,t)=>ne?m(f(e),t):{base64:!0,data:e},m=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},h=``,ie=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{s(e,!1,e=>{r[a]=e,++i===n&&t(r.join(h))})})},ae=(e,t)=>{let n=e.split(h),r=[];for(let e=0;e<n.length;e++){let i=p(n[e],t);if(r.push(i),i.type===`error`)break}return r};function oe(){return new TransformStream({transform(e,t){ee(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var g;function _(e){return e.reduce((e,t)=>e+t.length,0)}function v(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function se(e,t){g||=new TextDecoder;let n=[],i=0,a=-1,o=!1;return new TransformStream({transform(s,c){for(n.push(s);;){if(i===0){if(_(n)<1)break;let e=v(n,1);o=(e[0]&128)==128,a=e[0]&127,i=a<126?3:a===126?1:2}else if(i===1){if(_(n)<2)break;let e=v(n,2);a=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),i=3}else if(i===2){if(_(n)<8)break;let e=v(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>2**21-1){c.enqueue(r);break}a=o*2**32+t.getUint32(4),i=3}else{if(_(n)<a)break;let e=v(n,a);c.enqueue(p(o?e:g.decode(e),t)),i=0}if(a===0||a>e){c.enqueue(r);break}}}})}function y(e){if(e)return b(e)}function b(e){for(var t in y.prototype)e[t]=y.prototype[t];return e}y.prototype.on=y.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},y.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},y.prototype.off=y.prototype.removeListener=y.prototype.removeAllListeners=y.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},y.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},y.prototype.emitReserved=y.prototype.emit,y.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},y.prototype.hasListeners=function(e){return!!this.listeners(e).length};var x=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),S=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),ce=`arraybuffer`;function C(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var le=S.setTimeout,ue=S.clearTimeout;function w(e,t){t.useNativeTimers?(e.setTimeoutFn=le.bind(S),e.clearTimeoutFn=ue.bind(S)):(e.setTimeoutFn=S.setTimeout.bind(S),e.clearTimeoutFn=S.clearTimeout.bind(S))}var de=1.33;function fe(e){return typeof e==`string`?pe(e):Math.ceil((e.byteLength||e.size)*de)}function pe(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function T(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function me(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function he(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var ge=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},E=class extends y{constructor(e){super(),this.writable=!1,w(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new ge(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=p(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=me(e);return t.length?`?`+t:``}},_e=class extends E{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){ae(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,ie(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=T()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},D=!1;try{D=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var ve=D;function ye(){}var be=class extends _e{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},O=class e extends y{constructor(e,t,n){super(),this.createRequest=e,w(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=C(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(this._xhr===void 0||this._xhr===null)){if(this._xhr.onreadystatechange=ye,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(O.requestsCount=0,O.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,k);else if(typeof addEventListener==`function`){let e=`onpagehide`in S?`pagehide`:`unload`;addEventListener(e,k,!1)}}function k(){for(let e in O.requests)O.requests.hasOwnProperty(e)&&O.requests[e].abort()}var xe=(function(){let e=A({xdomain:!1});return e&&e.responseType!==null})(),Se=class extends be{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=xe&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new O(A,this.uri(),e)}};function A(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||ve))return new XMLHttpRequest}catch{}if(!t)try{return new S[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var j=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,Ce=class extends E{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=j?{}:C(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;s(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&x(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=T()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},M=S.WebSocket||S.MozWebSocket,we={websocket:class extends Ce{createSocket(e,t,n){return j?new M(e,t,n):t?new M(e,t):new M(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends E{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=se(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=oe();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&x(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:Se},Te=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ee=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function N(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=Te.exec(e||``),a={},o=14;for(;o--;)a[Ee[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=De(a,a.path),a.queryKey=Oe(a,a.query),a}function De(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function Oe(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var P=typeof addEventListener==`function`&&typeof removeEventListener==`function`,F=[];P&&addEventListener(`offline`,()=>{F.forEach(e=>e())},!1);var I=class e extends y{constructor(e,t){if(super(),this.binaryType=ce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=N(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=N(t.host).host);w(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:`/engine.io`,agent:!1,withCredentials:!1,upgrade:!0,timestampParam:`t`,rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=he(this.opts.query)),P&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(`beforeunload`,this._beforeunloadEventListener,!1)),this.hostname!==`localhost`&&(this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})},F.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data);break}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved(`drain`):this.flush()}flush(){if(this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=fe(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,x(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),P&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=F.indexOf(this._offlineEventListener);e!==-1&&F.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};I.protocol=4;var ke=class extends I{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;I.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;I.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},L=class extends ke{constructor(e,t={}){let n=typeof e==`object`,r=n?{...e}:{...t};(!r.transports||r.transports&&typeof r.transports[0]==`string`)&&(r.transports=(r.transports||[`polling`,`websocket`,`webtransport`]).map(e=>we[e]).filter(e=>!!e)),super(n?r:e,r)}};L.protocol;function Ae(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=N(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var je=typeof ArrayBuffer==`function`,Me=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,R=Object.prototype.toString,Ne=typeof Blob==`function`||typeof Blob<`u`&&R.call(Blob)===`[object BlobConstructor]`,Pe=typeof File==`function`||typeof File<`u`&&R.call(File)===`[object FileConstructor]`;function z(e){return je&&(e instanceof ArrayBuffer||Me(e))||Ne&&e instanceof Blob||Pe&&e instanceof File}function B(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(B(e[t]))return!0;return!1}if(z(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return B(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&B(e[t]))return!0;return!1}function Fe(e){let t=[],n=e.data,r=e;return r.data=V(n,t),r.attachments=t.length,{packet:r,buffers:t}}function V(e,t,n){if(!e)return e;if(z(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=V(e[r],t);return n}else if(typeof e==`object`&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON==`function`&&!n)return V(e.toJSON(),t,!0);let r={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=V(e[n],t));return r}return e}function Ie(e,t){return e.data=H(e.data,t),delete e.attachments,e}function H(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=H(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=H(e[n],t));return e}var Le=e({Decoder:()=>ze,Encoder:()=>Re,PacketType:()=>W,isPacketValid:()=>Ue,protocol:()=>5}),U=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],W;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(W||={});var Re=class{constructor(e){this.replacer=e}encode(e){return(e.type===W.EVENT||e.type===W.ACK)&&B(e)?this.encodeAsBinary({type:e.type===W.EVENT?W.BINARY_EVENT:W.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===W.BINARY_EVENT||e.type===W.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Fe(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},ze=class e extends y{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===W.BINARY_EVENT;n||t.type===W.BINARY_ACK?(t.type=n?W.EVENT:W.ACK,this.reconstructor=new Be(t)):super.emitReserved(`decoded`,t)}else if(z(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(W[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===W.BINARY_EVENT||r.type===W.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!G(a)||a<1)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&!(t.charAt(n)===`,`||n===t.length););r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case W.CONNECT:return q(t);case W.DISCONNECT:return t===void 0;case W.CONNECT_ERROR:return typeof t==`string`||q(t);case W.EVENT:case W.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&U.indexOf(t[0])===-1);case W.ACK:case W.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},Be=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=Ie(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Ve(e){return typeof e==`string`}var G=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function K(e){return e===void 0||G(e)}function q(e){return Object.prototype.toString.call(e)===`[object Object]`}function He(e,t){switch(e){case W.CONNECT:return t===void 0||q(t);case W.DISCONNECT:return t===void 0;case W.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&U.indexOf(t[0])===-1);case W.ACK:return Array.isArray(t);case W.CONNECT_ERROR:return typeof t==`string`||q(t);default:return!1}}function Ue(e){return Ve(e.nsp)&&K(e.id)&&He(e.type,e.data)}function J(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var We=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Y=class extends y{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[J(e,`open`,this.onopen.bind(this)),J(e,`packet`,this.onpacket.bind(this)),J(e,`error`,this.onerror.bind(this)),J(e,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState===`open`&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(We.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:W.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:W.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case W.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case W.EVENT:case W.BINARY_EVENT:this.onevent(e);break;case W.ACK:case W.BINARY_ACK:this.onack(e);break;case W.DISCONNECT:this.ondisconnect();break;case W.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:W.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:W.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function X(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}X.prototype.duration=function(){var e=this.ms*this.factor**+this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},X.prototype.reset=function(){this.attempts=0},X.prototype.setMin=function(e){this.ms=e},X.prototype.setMax=function(e){this.max=e},X.prototype.setJitter=function(e){this.jitter=e};var Z=class extends y{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,w(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new X({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||Le;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new L(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=J(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=J(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(J(e,`ping`,this.onping.bind(this)),J(e,`data`,this.ondata.bind(this)),J(e,`error`,this.onerror.bind(this)),J(e,`close`,this.onclose.bind(this)),J(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){x(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Y(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},Q={};function $(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=Ae(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=Q[i]&&a in Q[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new Z(r,t):(Q[i]||(Q[i]=new Z(r,t)),c=Q[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign($,{Manager:Z,Socket:Y,io:$,connect:$});export{$ as t};1import{o as e,u as t}from"./MessengerPage-xXbl6QXh.js";export{e as getOneTimePreKeys,t as markOneTimePreKeyUsed};public/assets/AvatarCropper-43twomjP.cssDeleted-1
public/assets/AvatarCropper-BrLwgiL8.jsDeleted-1
public/assets/EmojiPanel-Bf-sbcJk.cssDeleted-1
public/assets/EmojiPanel-C7Mc7Fox.jsDeleted-1
public/assets/EncryptionModal-Bk9GLrBN.cssDeleted-1
public/assets/EncryptionModal-BvD7I1MP.jsDeleted-1
public/assets/MessengerPage-Dmr3RWrs.cssDeleted
public/assets/MessengerPage-xXbl6QXh.jsDeleted
public/assets/ModalShell-DWofhKyP.jsDeleted-1
public/assets/ModalShell-DxpX6TOZ.cssDeleted-1
public/assets/__vite-browser-external-BRm5n2qg.jsDeleted-1
public/assets/encryption-CFSbljDF.jsDeleted-2
public/assets/index-BxVTd_Wu.jsDeleted
public/assets/index-CJLIHFQ-.cssDeleted-1
public/assets/keyStore-DDPZ0U62.jsDeleted-1
public/assets/libsodium-wrappers-DIT7SeqD.jsDeleted
public/assets/rolldown-runtime-QTnfLwEv.jsDeleted-1
public/assets/socket-CbQsWyoH.jsDeleted-1
public/assets/storage-Ba-Lkq8l.jsDeleted-1
public/assets/vendor-BbmWO_jh.jsDeleted