import{B as e,Bt as t,Ct as n,F as r,G as i,L as a,N as o,Nt as s,Pt as c,U as l,Vt as u,W as d,X as f,Y as p,_t as m,a as h,at as g,b as _,bt as v,d as y,ft as b,g as x,ht as S,it as C,o as w,ot as T,u as E,v as D,vt as O,x as k,z as A}from"./xY0c-UfG.js";import"./xihTtKlq.js";import{Y as j}from"./BW-sf0N4.js";import"./9K8VREGP.js";var M=A(`<div class="upload-bar-fill svelte-vaambt"></div>`),N=A(`<div role="progressbar" aria-label="Uploading"><!></div>`);function P(e,t){let r=w(t,`progress`,3,null),i=n(()=>r()===null||r()>=1),s=n(()=>r()===null?0:Math.max(0,Math.min(1,r()))*100);var c=N();let l;var d=b(c),p=e=>{var t=M();T(()=>_(t,`width: ${f(s)??``}%`)),a(e,t)};o(d,e=>{f(i)||e(p)}),u(c),T(e=>{l=k(c,1,`upload-bar svelte-vaambt`,null,l,{indeterminate:f(i)}),D(c,`aria-valuenow`,e)},[()=>r()===null?void 0:Math.round(f(s))]),a(e,c)}var F=A(`<div></div>`);function I(e,t){c(t,!0);let n=v(!1),r=0,o=null,l=v(null);function u(e){e.button===0&&(e.preventDefault(),O(n,!0),r=e.clientX,o=e.pointerId,f(l)?.setPointerCapture(e.pointerId),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,t.onresizestart?.())}function p(e){if(!f(n))return;if(e.buttons===0){m();return}let i=t.side===`right`?e.clientX-r:r-e.clientX;r=e.clientX,t.onresize(i)}function m(){if(f(n)&&(O(n,!1),document.body.style.cursor=``,document.body.style.userSelect=``,o!==null)){try{f(l)?.releasePointerCapture(o)}catch{}o=null}}var h=F();let g;y(h,e=>O(l,e),()=>f(l)),T(()=>g=k(h,1,`resize-handle svelte-tfh9g9`,null,g,{left:t.side===`left`,right:t.side===`right`,active:f(n)})),d(`pointerdown`,h,u),d(`pointermove`,h,p),d(`pointerup`,h,m),i(`pointercancel`,h,m),i(`lostpointercapture`,h,m),d(`dblclick`,h,function(...e){t.ondblclick?.apply(this,e)}),a(e,h),s()}l([`pointerdown`,`pointermove`,`pointerup`,`dblclick`]);function L(e,t,n,r=null){let i=Math.min(440,Math.max(280,Number.isFinite(e)?e:280)),a=Math.min(480,Math.max(340,Number.isFinite(t)?t:340));if(!Number.isFinite(n)||n<=0||i+a<=n)return{sidebar:i,rail:a};if(n<=620)return{sidebar:280,rail:340};if(r===`sidebar`){let e=Math.min(i,n-340);return{sidebar:e,rail:n-e}}if(r===`rail`){let e=Math.min(a,n-280);return{rail:e,sidebar:n-e}}let o=i+a-n,s=i-280,c=s+(a-340);if(c<=0)return{sidebar:280,rail:340};let l=i-o*s/c;return{sidebar:l,rail:n-l}}var R=`sg-sidebar-width`,z=`sg-agent-rail-width`;function B(e,t,n){if(typeof localStorage>`u`)return t;let r=Number(localStorage.getItem(e));return Number.isFinite(r)&&r>0?Math.min(n,Math.max(t,r)):t}function V(e,t){if(!(typeof localStorage>`u`))try{localStorage.setItem(e,String(t))}catch{}}function H(){let e=v(S(B(R,280,440))),t=v(S(B(z,340,480))),r=v(S(1/0)),i=v(null),a=0,o=0,s=n(()=>L(f(e),f(t),f(r),f(i))),c=()=>Number.isFinite(f(r))&&f(r)>0?Math.min(440,Math.max(280,f(r)-340)):440,l=()=>Number.isFinite(f(r))&&f(r)>0?Math.min(480,Math.max(340,f(r)-280)):480;return{get sidebarWidth(){return f(s).sidebar},get railWidth(){return f(s).rail},setAvailable(e){Number.isFinite(e)&&e>0&&O(r,e,!0)},startSidebarResize(){a=f(s).sidebar,O(e,a,!0),O(i,`sidebar`)},resizeSidebar(t){a+=t,O(e,Math.min(c(),Math.max(280,a)),!0),V(R,f(e))},startRailResize(){o=f(s).rail,O(t,o,!0),O(i,`rail`)},resizeRail(e){o+=e,O(t,Math.min(l(),Math.max(340,o)),!0),V(z,f(t))}}}var U=H();async function W(e){return j(`/api/notifications${e?.unreadOnly?`?unreadOnly=true`:``}`)}async function G(e){await j(`/api/notifications/${e}/read`,{method:`POST`})}async function K(){await j(`/api/notifications/read-all`,{method:`POST`})}async function q(){let{users:e}=await j(`/api/auth/users`);return e}var J=e(`<title> </title>`),Y=e(`<svg><!><path d="M24,6H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>`);function X(e,n){let i=h(n,[`children`,`$$slots`,`$$events`,`$$legacy`]),l=h(i,[`size`,`title`]);c(n,!1);let d=m(),_=m(),v=w(n,`size`,8,16),y=w(n,`title`,8,void 0);C(()=>(p(i),p(y())),()=>{O(d,i[`aria-label`]||i[`aria-labelledby`]||y())}),C(()=>(f(d),p(i)),()=>{O(_,{"aria-hidden":f(d)?void 0:!0,role:f(d)?`img`:void 0,focusable:Number(i.tabindex)===0?!0:void 0})}),g(),E();var S=Y();x(S,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:v(),height:v(),...f(_),...l}));var D=b(S),k=e=>{var t=J(),n=b(t,!0);u(t),T(()=>r(n,y())),a(e,t)};o(D,e=>{y()&&e(k)}),t(),u(S),a(e,S),s()}export{G as a,P as c,K as i,q as n,U as o,W as r,I as s,X as t};