verstak/cmd/verstak-gui/frontend-dist/assets/main-DZkGJWBF.js

17 lines
104 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var so=Object.defineProperty;var co=(l,e,t)=>e in l?so(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var ht=(l,e,t)=>co(l,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function G(){}function kn(l){return l()}function Qt(){return Object.create(null)}function ce(l){l.forEach(kn)}function gn(l){return typeof l=="function"}function Ve(l,e){return l!=l?e==e:l!==e||l&&typeof l=="object"||typeof l=="function"}let $e;function tt(l,e){return l===e?!0:($e||($e=document.createElement("a")),$e.href=e,l===$e.href)}function ro(l){return Object.keys(l).length===0}function ao(l){return l??""}function r(l,e){l.appendChild(e)}function g(l,e,t){l.insertBefore(e,t||null)}function k(l){l.parentNode&&l.parentNode.removeChild(l)}function ve(l,e){for(let t=0;t<l.length;t+=1)l[t]&&l[t].d(e)}function u(l){return document.createElement(l)}function W(l){return document.createElementNS("http://www.w3.org/2000/svg",l)}function I(l){return document.createTextNode(l)}function j(){return I(" ")}function ye(){return I("")}function A(l,e,t,n){return l.addEventListener(e,t,n),()=>l.removeEventListener(e,t,n)}function je(l){return function(e){return e.stopPropagation(),l.call(this,e)}}function Re(l){return function(e){e.target===this&&l.call(this,e)}}function c(l,e,t){t==null?l.removeAttribute(e):l.getAttribute(e)!==t&&l.setAttribute(e,t)}function yn(l){return l===""?null:+l}function fo(l){return Array.from(l.childNodes)}function H(l,e){e=""+e,l.data!==e&&(l.data=e)}function de(l,e){l.value=e??""}function Be(l,e,t){for(let n=0;n<l.options.length;n+=1){const i=l.options[n];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(l.selectedIndex=-1)}function bt(l){const e=l.querySelector(":checked");return e&&e.__value}function xt(l,e,t){l.classList.toggle(e,!!t)}function uo(l,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(l,{detail:e,bubbles:t,cancelable:n})}let Je;function Ue(l){Je=l}function wt(){if(!Je)throw new Error("Function called outside component initialization");return Je}function wn(l){wt().$$.on_mount.push(l)}function jn(l){wt().$$.on_destroy.push(l)}function nt(){const l=wt();return(e,t,{cancelable:n=!1}={})=>{const i=l.$$.callbacks[e];if(i){const s=uo(e,t,{cancelable:n});return i.slice().forEach(o=>{o.call(l,s)}),!s.defaultPrevented}return!0}}function _o(l,e){const t=l.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Fe=[],$t=[];let He=[];const el=[],po=Promise.resolve();let gt=!1;function mo(){gt||(gt=!0,po.then(zn))}function Oe(l){He.push(l)}const kt=new Set;let Ne=0;function zn(){if(Ne!==0)return;const l=Je;do{try{for(;Ne<Fe.length;){const e=Fe[Ne];Ne++,Ue(e),vo(e.$$)}}catch(e){throw Fe.length=0,Ne=0,e}for(Ue(null),Fe.length=0,Ne=0;$t.length;)$t.pop()();for(let e=0;e<He.length;e+=1){const t=He[e];kt.has(t)||(kt.add(t),t())}He.length=0}while(Fe.length);for(;el.length;)el.pop()();gt=!1,kt.clear(),Ue(l)}function vo(l){if(l.fragment!==null){l.update(),ce(l.before_update);const e=l.dirty;l.dirty=[-1],l.fragment&&l.fragment.p(l.ctx,e),l.after_update.forEach(Oe)}}function ho(l){const e=[],t=[];He.forEach(n=>l.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),He=e}const et=new Set;let De;function ze(){De={r:0,c:[],p:De}}function qe(){De.r||ce(De.c),De=De.p}function re(l,e){l&&l.i&&(et.delete(l),l.i(e))}function ue(l,e,t,n){if(l&&l.o){if(et.has(l))return;et.add(l),De.c.push(()=>{et.delete(l),n&&(t&&l.d(1),n())}),l.o(e)}else n&&n()}function ee(l){return(l==null?void 0:l.length)!==void 0?l:Array.from(l)}function bo(l,e){ue(l,1,1,()=>{e.delete(l.key)})}function ko(l,e,t,n,i,s,o,a,f,_,m,h){let p=l.length,v=s.length,w=p;const b={};for(;w--;)b[l[w].key]=w;const y=[],z=new Map,M=new Map,E=[];for(w=v;w--;){const S=h(i,s,w),T=t(S);let C=o.get(T);C?E.push(()=>C.p(S,e)):(C=_(T,S),C.c()),z.set(T,y[w]=C),T in b&&M.set(T,Math.abs(w-b[T]))}const q=new Set,N=new Set;function O(S){re(S,1),S.m(a,m),o.set(S.key,S),m=S.first,v--}for(;p&&v;){const S=y[v-1],T=l[p-1],C=S.key,D=T.key;S===T?(m=S.first,p--,v--):z.has(D)?!o.has(C)||q.has(C)?O(S):N.has(D)?p--:M.get(C)>M.get(D)?(N.add(C),O(S)):(q.add(D),p--):(f(T,o),p--)}for(;p--;){const S=l[p];z.has(S.key)||f(S,o)}for(;v;)O(y[v-1]);return ce(E),y}function Ie(l){l&&l.c()}function Me(l,e,t){const{fragment:n,after_update:i}=l.$$;n&&n.m(e,t),Oe(()=>{const s=l.$$.on_mount.map(kn).filter(gn);l.$$.on_destroy?l.$$.on_destroy.push(...s):ce(s),l.$$.on_mount=[]}),i.forEach(Oe)}function Le(l,e){const t=l.$$;t.fragment!==null&&(ho(t.after_update),ce(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function go(l,e){l.$$.dirty[0]===-1&&(Fe.push(l),mo(),l.$$.dirty.fill(0)),l.$$.dirty[e/31|0]|=1<<e%31}function Ke(l,e,t,n,i,s,o=null,a=[-1]){const f=Je;Ue(l);const _=l.$$={fragment:null,ctx:[],props:s,update:G,not_equal:i,bound:Qt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(f?f.$$.context:[])),callbacks:Qt(),dirty:a,skip_bound:!1,root:e.target||f.$$.root};o&&o(_.root);let m=!1;if(_.ctx=t?t(l,e.props||{},(h,p,...v)=>{const w=v.length?v[0]:p;return _.ctx&&i(_.ctx[h],_.ctx[h]=w)&&(!_.skip_bound&&_.bound[h]&&_.bound[h](w),m&&go(l,h)),p}):[],_.update(),m=!0,ce(_.before_update),_.fragment=n?n(_.ctx):!1,e.target){if(e.hydrate){const h=fo(e.target);_.fragment&&_.fragment.l(h),h.forEach(k)}else _.fragment&&_.fragment.c();e.intro&&re(l.$$.fragment),Me(l,e.target,e.anchor),zn()}Ue(f)}class We{constructor(){ht(this,"$$");ht(this,"$$set")}$destroy(){Le(this,1),this.$destroy=G}$on(e,t){if(!gn(t))return G;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!ro(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const yo="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(yo);function wo(l){let e,t;return{c(){e=W("path"),t=W("polyline"),c(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),c(t,"points","14 2 14 8 20 8")},m(n,i){g(n,e,i),g(n,t,i)},d(n){n&&(k(e),k(t))}}}function jo(l){let e,t,n,i,s;return{c(){e=W("path"),t=W("polyline"),n=W("line"),i=W("line"),s=W("polyline"),c(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),c(t,"points","14 2 14 8 20 8"),c(n,"x1","16"),c(n,"y1","13"),c(n,"x2","8"),c(n,"y2","13"),c(i,"x1","16"),c(i,"y1","17"),c(i,"x2","8"),c(i,"y2","17"),c(s,"points","10 9 9 9 8 9")},m(o,a){g(o,e,a),g(o,t,a),g(o,n,a),g(o,i,a),g(o,s,a)},d(o){o&&(k(e),k(t),k(n),k(i),k(s))}}}function zo(l){let e,t;return{c(){e=W("polyline"),t=W("polyline"),c(e,"points","16 18 22 12 16 6"),c(t,"points","8 6 2 12 8 18")},m(n,i){g(n,e,i),g(n,t,i)},d(n){n&&(k(e),k(t))}}}function qo(l){let e,t,n,i;return{c(){e=W("path"),t=W("polyline"),n=W("line"),i=W("rect"),c(e,"d","M21 8v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8"),c(t,"points","7 3 12 8 17 3"),c(n,"x1","3"),c(n,"y1","8"),c(n,"x2","21"),c(n,"y2","8"),c(i,"x","10"),c(i,"y","12"),c(i,"width","4"),c(i,"height","4"),c(i,"rx","1")},m(s,o){g(s,e,o),g(s,t,o),g(s,n,o),g(s,i,o)},d(s){s&&(k(e),k(t),k(n),k(i))}}}function Co(l){let e,t,n,i,s;return{c(){e=W("path"),t=W("polyline"),n=W("line"),i=W("line"),s=W("line"),c(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),c(t,"points","14 2 14 8 20 8"),c(n,"x1","9"),c(n,"y1","12"),c(n,"x2","15"),c(n,"y2","12"),c(i,"x1","9"),c(i,"y1","15"),c(i,"x2","13"),c(i,"y2","15"),c(s,"x1","12"),c(s,"y1","15"),c(s,"x2","12"),c(s,"y2","18")},m(o,a){g(o,e,a),g(o,t,a),g(o,n,a),g(o,i,a),g(o,s,a)},d(o){o&&(k(e),k(t),k(n),k(i),k(s))}}}function To(l){let e,t,n,i,s,o;return{c(){e=W("path"),t=W("polyline"),n=W("line"),i=W("line"),s=W("line"),o=W("line"),c(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),c(t,"points","14 2 14 8 20 8"),c(n,"x1","8"),c(n,"y1","12"),c(n,"x2","16"),c(n,"y2","12"),c(i,"x1","8"),c(i,"y1","16"),c(i,"x2","16"),c(i,"y2","16"),c(s,"x1","8"),c(s,"y1","14"),c(s,"x2","12"),c(s,"y2","14"),c(o,"x1","12"),c(o,"y1","12"),c(o,"x2","12"),c(o,"y2","18")},m(a,f){g(a,e,f),g(a,t,f),g(a,n,f),g(a,i,f),g(a,s,f),g(a,o,f)},d(a){a&&(k(e),k(t),k(n),k(i),k(s),k(o))}}}function Mo(l){let e,t,n,i;return{c(){e=W("path"),t=W("polyline"),n=W("line"),i=W("line"),c(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),c(t,"points","14 2 14 8 20 8"),c(n,"x1","16"),c(n,"y1","13"),c(n,"x2","8"),c(n,"y2","13"),c(i,"x1","16"),c(i,"y1","17"),c(i,"x2","8"),c(i,"y2","17")},m(s,o){g(s,e,o),g(s,t,o),g(s,n,o),g(s,i,o)},d(s){s&&(k(e),k(t),k(n),k(i))}}}function Lo(l){let e,t,n,i,s;return{c(){e=W("path"),t=W("polyline"),n=W("line"),i=W("line"),s=W("line"),c(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),c(t,"points","14 2 14 8 20 8"),c(n,"x1","8"),c(n,"y1","12"),c(n,"x2","16"),c(n,"y2","12"),c(i,"x1","8"),c(i,"y1","16"),c(i,"x2","16"),c(i,"y2","16"),c(s,"x1","8"),c(s,"y1","14"),c(s,"x2","12"),c(s,"y2","14")},m(o,a){g(o,e,a),g(o,t,a),g(o,n,a),g(o,i,a),g(o,s,a)},d(o){o&&(k(e),k(t),k(n),k(i),k(s))}}}function So(l){let e,t,n;return{c(){e=W("path"),t=W("circle"),n=W("circle"),c(e,"d","M9 18V5l12-2v13"),c(t,"cx","6"),c(t,"cy","18"),c(t,"r","3"),c(n,"cx","18"),c(n,"cy","16"),c(n,"r","3")},m(i,s){g(i,e,s),g(i,t,s),g(i,n,s)},d(i){i&&(k(e),k(t),k(n))}}}function Do(l){let e,t;return{c(){e=W("rect"),t=W("polyline"),c(e,"x","2"),c(e,"y","4"),c(e,"width","20"),c(e,"height","16"),c(e,"rx","2"),c(t,"points","10 9 16 12 10 15 10 9")},m(n,i){g(n,e,i),g(n,t,i)},d(n){n&&(k(e),k(t))}}}function Io(l){let e,t,n;return{c(){e=W("rect"),t=W("circle"),n=W("polyline"),c(e,"x","3"),c(e,"y","3"),c(e,"width","18"),c(e,"height","18"),c(e,"rx","2"),c(e,"ry","2"),c(t,"cx","8.5"),c(t,"cy","8.5"),c(t,"r","1.5"),c(n,"points","21 15 16 10 5 21")},m(i,s){g(i,e,s),g(i,t,s),g(i,n,s)},d(i){i&&(k(e),k(t),k(n))}}}function Eo(l){let e;return{c(){e=W("path"),c(e,"d","M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z")},m(t,n){g(t,e,n)},d(t){t&&k(e)}}}function Ao(l){let e;function t(s,o){return s[0]==="folder"?Eo:s[0]==="image"?Io:s[0]==="video"?Do:s[0]==="audio"?So:s[0]==="pdf"?Lo:s[0]==="document"?Mo:s[0]==="spreadsheet"?To:s[0]==="presentation"?Co:s[0]==="archive"?qo:s[0]==="code"?zo:s[0]==="text"?jo:wo}let n=t(l),i=n(l);return{c(){e=W("svg"),i.c(),c(e,"width",l[1]),c(e,"height",l[1]),c(e,"viewBox","0 0 24 24"),c(e,"fill","none"),c(e,"stroke","currentColor"),c(e,"stroke-width","1.5"),c(e,"stroke-linecap","round"),c(e,"stroke-linejoin","round"),c(e,"xmlns","http://www.w3.org/2000/svg")},m(s,o){g(s,e,o),i.m(e,null)},p(s,[o]){n!==(n=t(s))&&(i.d(1),i=n(s),i&&(i.c(),i.m(e,null))),o&2&&c(e,"width",s[1]),o&2&&c(e,"height",s[1])},i:G,o:G,d(s){s&&k(e),i.d()}}}function No(l,e,t){let{kind:n="generic"}=e,{size:i=20}=e;return l.$$set=s=>{"kind"in s&&t(0,n=s.kind),"size"in s&&t(1,i=s.size)},[n,i]}class qn extends We{constructor(e){super(),Ke(this,e,No,Ao,Ve,{kind:0,size:1})}}function lt(l){if(l==null||l<0)return"—";if(l===0)return"0 B";const e=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(l)/Math.log(1024)),e.length-1),n=l/Math.pow(1024,t);return(t===0?n.toFixed(0):n.toFixed(1))+" "+e[t]}const yt={"image/jpeg":"Изображение JPEG","image/png":"Изображение PNG","image/gif":"Изображение GIF","image/webp":"Изображение WebP","image/svg+xml":"Изображение SVG","image/bmp":"Изображение BMP","image/tiff":"Изображение TIFF","image/avif":"Изображение AVIF","application/pdf":"PDF документ","application/msword":"Документ Word","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"Документ Word","application/vnd.ms-excel":"Таблица Excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"Таблица Excel","application/vnd.ms-powerpoint":"Презентация PowerPoint","application/vnd.openxmlformats-officedocument.presentationml.presentation":"Презентация PowerPoint","application/zip":"ZIP архив","application/gzip":"GZIP архив","application/x-tar":"TAR архив","application/x-7z-compressed":"7z архив","application/x-rar-compressed":"RAR архив","text/plain":"Текстовый файл","text/html":"HTML файл","text/css":"CSS файл","text/javascript":"JavaScript файл","application/json":"JSON файл","application/xml":"XML файл","application/x-yaml":"YAML файл","application/octet-stream":"Бинарный файл","application/x-msdos-program":"Исполняемый файл","inode/directory":"Папка"};function tl(l){return l?yt[l]||l:"Неизвестно"}function Fo(l){if(l.type==="folder")return"Папка";const e=(l.mime||"").toLowerCase();if(yt[e])return yt[e];const n=(l.name||"").toLowerCase().split(".").pop();return n?n.toUpperCase():"Файл"}function Cn(l){if(l.type==="folder")return"folder";const e=(l.mime||"").toLowerCase();if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";if(e.startsWith("text/"))return"text";if(e.includes("pdf"))return"pdf";if(e.includes("word")||e.includes("document"))return"document";if(e.includes("spreadsheet")||e.includes("excel"))return"spreadsheet";if(e.includes("presentation")||e.includes("powerpoint"))return"presentation";if(e.includes("zip")||e.includes("tar")||e.includes("gzip")||e.includes("rar")||e.includes("7z")||e.includes("compress"))return"archive";if(e.includes("json")||e.includes("xml")||e.includes("yaml")||e.includes("javascript")||e.includes("css")||e.includes("html"))return"code";const n=(l.name||"").toLowerCase().split(".").pop();return["js","ts","jsx","tsx","vue","svelte","py","rs","go","c","cpp","h","hpp","java","kt","swift","rb","php","pl","sh","bash","zsh","fish","yml","yaml","json","xml","toml","ini","cfg","conf","md","markdown","css","scss","less","sass","sql","graphql","proto","gradle","cmake","makefile","dockerfile","env","gitignore"].includes(n)?"code":"generic"}const Ho=["image/jpeg","image/png","image/gif","image/webp","image/bmp","image/tiff","image/avif","image/svg+xml"],Bo=["text/plain","text/html","text/css","text/javascript","application/json","application/xml","application/x-yaml","text/x-shellscript"],Oo=["txt","log","conf","ini","yaml","yml","json","xml","csv","sh","py","js","ts","css","html","md","markdown","cfg"],Po=["jpg","jpeg","png","gif","webp","bmp","tiff","tif","avif","svg"];function Tn(l){const e=(l.mime||"").toLowerCase(),n=(l.name||"").toLowerCase().split(".").pop();return Ho.includes(e)||Po.includes(n)}function Mn(l){const e=(l.mime||"").toLowerCase(),n=(l.name||"").toLowerCase().split(".").pop();return Bo.includes(e)||Oo.includes(n)&&n!=="md"&&n!=="markdown"}function Ln(l){return(l.mime||"").toLowerCase().includes("pdf")}function Sn(l){const e=(l.name||"").toLowerCase();return e.endsWith(".md")||e.endsWith(".markdown")}function Vo(l){return Tn(l)||Ln(l)}function Ro(l){return Mn(l)||Sn(l)}function Ko(l){let e,t,n,i=lt(l[0].size)+"",s;return{c(){e=u("span"),e.textContent="·",t=j(),n=u("span"),s=I(i),c(e,"class","meta-sep svelte-1u905d2")},m(o,a){g(o,e,a),g(o,t,a),g(o,n,a),r(n,s)},p(o,a){a&1&&i!==(i=lt(o[0].size)+"")&&H(s,i)},d(o){o&&(k(e),k(t),k(n))}}}function Wo(l){let e,t,n;return{c(){e=u("button"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="9" y1="14" x2="15" y2="14"></line></svg>',c(e,"class","action-btn svelte-1u905d2"),c(e,"title","Открыть папку"),c(e,"aria-label","Открыть папку")},m(i,s){g(i,e,s),t||(n=A(e,"click",je(l[27])),t=!0)},p:G,d(i){i&&k(e),t=!1,n()}}}function Go(l){let e,t,n,i,s;return{c(){e=u("button"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>',t=j(),n=u("button"),n.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',c(e,"class","action-btn svelte-1u905d2"),c(e,"title","Предпросмотр"),c(e,"aria-label","Предпросмотр"),c(n,"class","action-btn svelte-1u905d2"),c(n,"title","Открыть во внешней программе"),c(n,"aria-label","Открыть внешне")},m(o,a){g(o,e,a),g(o,t,a),g(o,n,a),i||(s=[A(e,"click",je(l[26])),A(n,"click",je(l[8]))],i=!0)},p:G,d(o){o&&(k(e),k(t),k(n)),i=!1,ce(s)}}}function ll(l){let e,t,n,i,s,o,a,f,_,m,h,p,v,w,b,y,z,M,E,q,N,O,S,T=l[5]&&Uo(l);return{c(){e=u("div"),t=j(),n=u("div"),i=u("button"),i.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>
Открыть`,s=j(),o=u("button"),o.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
Открыть во внешней программе`,a=j(),T&&T.c(),f=j(),_=u("div"),m=j(),h=u("button"),h.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
Переименовать`,p=j(),v=u("button"),v.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
Дублировать`,w=j(),b=u("button"),b.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><line x1="20" y1="4" x2="8.12" y2="15.88"></line><line x1="8.12" y1="8.12" x2="20" y2="20"></line></svg>
Вырезать`,y=j(),z=u("button"),z.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
Копировать`,M=j(),E=u("div"),q=j(),N=u("button"),N.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>
Удалить`,c(e,"class","menu-backdrop svelte-1u905d2"),c(e,"role","presentation"),c(i,"class","menu-item svelte-1u905d2"),c(i,"role","menuitem"),c(o,"class","menu-item svelte-1u905d2"),c(o,"role","menuitem"),c(_,"class","menu-sep svelte-1u905d2"),c(h,"class","menu-item svelte-1u905d2"),c(h,"role","menuitem"),c(v,"class","menu-item svelte-1u905d2"),c(v,"role","menuitem"),c(b,"class","menu-item svelte-1u905d2"),c(b,"role","menuitem"),c(z,"class","menu-item svelte-1u905d2"),c(z,"role","menuitem"),c(E,"class","menu-sep svelte-1u905d2"),c(N,"class","menu-item menu-item-danger svelte-1u905d2"),c(N,"role","menuitem"),c(n,"class","menu svelte-1u905d2"),c(n,"role","menu")},m(C,D){g(C,e,D),g(C,t,D),g(C,n,D),r(n,i),r(n,s),r(n,o),r(n,a),T&&T.m(n,null),r(n,f),r(n,_),r(n,m),r(n,h),r(n,p),r(n,v),r(n,w),r(n,b),r(n,y),r(n,z),r(n,M),r(n,E),r(n,q),r(n,N),O||(S=[A(e,"click",je(l[17])),A(i,"click",l[15]),A(o,"click",l[8]),A(h,"click",l[11]),A(v,"click",l[12]),A(b,"click",l[13]),A(z,"click",l[14]),A(N,"click",l[10]),A(n,"click",je(l[25]))],O=!0)},p(C,D){C[5]&&T.p(C,D)},d(C){C&&(k(e),k(t),k(n)),T&&T.d(),O=!1,ce(S)}}}function Uo(l){let e,t,n;return{c(){e=u("button"),e.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>
Показать в проводнике`,c(e,"class","menu-item svelte-1u905d2"),c(e,"role","menuitem")},m(i,s){g(i,e,s),t||(n=A(e,"click",l[9]),t=!0)},p:G,d(i){i&&k(e),t=!1,n()}}}function Jo(l){let e,t,n,i,s,o,a=l[0].name+"",f,_,m,h,p,v,w,b,y,z,M,E,q,N,O,S,T,C,D,R,X,x;n=new qn({props:{kind:l[4],size:22}});let B=!l[5]&&Ko(l);function P(K,oe){return K[5]?Wo:Go}let U=P(l)(l),$=l[2]&&ll(l);return{c(){e=u("div"),t=u("div"),Ie(n.$$.fragment),i=j(),s=u("div"),o=u("div"),f=I(a),m=j(),h=u("div"),p=u("span"),p.textContent=`${l[6]}`,v=j(),B&&B.c(),w=j(),b=u("div"),U.c(),y=j(),z=u("button"),M=W("svg"),E=W("circle"),q=W("circle"),N=W("circle"),O=j(),S=u("button"),S.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>',C=j(),$&&$.c(),D=ye(),c(t,"class","file-row-icon svelte-1u905d2"),c(o,"class","file-row-name svelte-1u905d2"),c(o,"title",_=l[0].name),c(h,"class","file-row-meta svelte-1u905d2"),c(s,"class","file-row-body svelte-1u905d2"),c(E,"cx","12"),c(E,"cy","5"),c(E,"r","2"),c(q,"cx","12"),c(q,"cy","12"),c(q,"r","2"),c(N,"cx","12"),c(N,"cy","19"),c(N,"r","2"),c(M,"width","16"),c(M,"height","16"),c(M,"viewBox","0 0 24 24"),c(M,"fill","currentColor"),c(z,"class","action-btn svelte-1u905d2"),c(z,"title","Ещё"),c(z,"aria-label","Ещё"),c(z,"aria-expanded",l[2]),c(S,"class","action-btn action-btn-danger svelte-1u905d2"),c(S,"title","Удалить"),c(S,"aria-label","Удалить"),c(b,"class","file-row-actions svelte-1u905d2"),c(e,"class","file-row svelte-1u905d2"),c(e,"role","button"),c(e,"tabindex","0"),c(e,"draggable","true"),c(e,"aria-label",T=l[5]?`Папка ${l[0].name}`:`Файл ${l[0].name}`),xt(e,"file-row--selected",l[1])},m(K,oe){g(K,e,oe),r(e,t),Me(n,t,null),r(e,i),r(e,s),r(s,o),r(o,f),r(s,m),r(s,h),r(h,p),r(h,v),B&&B.m(h,null),r(e,w),r(e,b),U.m(b,null),r(b,y),r(b,z),r(z,M),r(M,E),r(M,q),r(M,N),r(b,O),r(b,S),g(K,C,oe),$&&$.m(K,oe),g(K,D,oe),R=!0,X||(x=[A(window,"click",l[17]),A(z,"click",je(l[16])),A(S,"click",je(l[10])),A(e,"click",l[7]),A(e,"contextmenu",l[21]),A(e,"dragstart",l[18]),A(e,"dragover",l[19]),A(e,"drop",l[20])],X=!0)},p(K,[oe]){(!R||oe&1)&&a!==(a=K[0].name+"")&&H(f,a),(!R||oe&1&&_!==(_=K[0].name))&&c(o,"title",_),K[5]||B.p(K,oe),U.p(K,oe),(!R||oe&4)&&c(z,"aria-expanded",K[2]),(!R||oe&1&&T!==(T=K[5]?`Папка ${K[0].name}`:`Файл ${K[0].name}`))&&c(e,"aria-label",T),(!R||oe&2)&&xt(e,"file-row--selected",K[1]),K[2]?$?$.p(K,oe):($=ll(K),$.c(),$.m(D.parentNode,D)):$&&($.d(1),$=null)},i(K){R||(re(n.$$.fragment,K),R=!0)},o(K){ue(n.$$.fragment,K),R=!1},d(K){K&&(k(e),k(C),k(D)),Le(n),B&&B.d(),U.d(),$&&$.d(K),X=!1,ce(x)}}}function Xo(l,e,t){let{item:n}=e,{selected:i=!1}=e,{onDragStart:s}=e,{onDragOver:o}=e,{onDrop:a}=e;const f=nt(),_=Cn(n),m=n.type==="folder",h=Fo(n);let p=!1,v=null;function w(F){F.ctrlKey||F.metaKey?f("toggleSelect",n.id):F.shiftKey?f("rangeSelect",n.id):v?(clearTimeout(v),v=null,m?f("navigate",n.id):f("preview",n)):v=setTimeout(()=>{v=null,f("selectOne",n.id)},250)}function b(){f("openExternal",n.fileId)}function y(){f("showInFolder",n.id)}function z(){t(2,p=!1),f("delete",{id:n.id,type:n.type})}function M(){t(2,p=!1),f("rename",{id:n.id,name:n.name})}function E(){t(2,p=!1),f("duplicate",n.id)}function q(){t(2,p=!1),f("cut",n.id)}function N(){t(2,p=!1),f("copy",n.id)}function O(){t(2,p=!1),m?f("navigate",n.id):f("preview",n)}function S(){t(2,p=!p)}function T(){t(2,p=!1)}function C(F){s&&s(F,n.id)}function D(F){o&&m&&o(F,n.id)}function R(F){a&&m&&a(F,n.id)}function X(F){F.preventDefault(),t(2,p=!0)}function x(F){_o.call(this,l,F)}const B=()=>f("preview",n),P=()=>f("navigate",n.id);return l.$$set=F=>{"item"in F&&t(0,n=F.item),"selected"in F&&t(1,i=F.selected),"onDragStart"in F&&t(22,s=F.onDragStart),"onDragOver"in F&&t(23,o=F.onDragOver),"onDrop"in F&&t(24,a=F.onDrop)},[n,i,p,f,_,m,h,w,b,y,z,M,E,q,N,O,S,T,C,D,R,X,s,o,a,x,B,P]}class Zo extends We{constructor(e){super(),Ke(this,e,Xo,Jo,Ve,{item:0,selected:1,onDragStart:22,onDragOver:23,onDrop:24})}}function nl(l,e,t){const n=l.slice();return n[4]=e[t],n[6]=t,n}function Yo(l){let e;return{c(){e=u("span"),e.textContent="/",c(e,"class","sep svelte-csi2lb")},m(t,n){g(t,e,n)},d(t){t&&k(e)}}}function Qo(l){let e,t=l[4].name+"",n,i,s;function o(){return l[2](l[6])}return{c(){e=u("button"),n=I(t),c(e,"class","crumb crumb--link svelte-csi2lb")},m(a,f){g(a,e,f),r(e,n),i||(s=A(e,"click",o),i=!0)},p(a,f){l=a,f&1&&t!==(t=l[4].name+"")&&H(n,t)},d(a){a&&k(e),i=!1,s()}}}function xo(l){let e,t=l[4].name+"",n;return{c(){e=u("span"),n=I(t),c(e,"class","crumb crumb--current svelte-csi2lb")},m(i,s){g(i,e,s),r(e,n)},p(i,s){s&1&&t!==(t=i[4].name+"")&&H(n,t)},d(i){i&&k(e)}}}function il(l){let e,t,n=l[6]>0&&Yo();function i(a,f){return a[6]===a[0].length-1?xo:Qo}let s=i(l),o=s(l);return{c(){n&&n.c(),e=j(),o.c(),t=ye()},m(a,f){n&&n.m(a,f),g(a,e,f),o.m(a,f),g(a,t,f)},p(a,f){s===(s=i(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(t.parentNode,t)))},d(a){a&&(k(e),k(t)),n&&n.d(a),o.d(a)}}}function $o(l){let e,t=ee(l[0]),n=[];for(let i=0;i<t.length;i+=1)n[i]=il(nl(l,t,i));return{c(){e=u("nav");for(let i=0;i<n.length;i+=1)n[i].c();c(e,"class","breadcrumbs svelte-csi2lb")},m(i,s){g(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,[s]){if(s&3){t=ee(i[0]);let o;for(o=0;o<t.length;o+=1){const a=nl(i,t,o);n[o]?n[o].p(a,s):(n[o]=il(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},i:G,o:G,d(i){i&&k(e),ve(n,i)}}}function es(l,e,t){let{crumbs:n=[]}=e;const i=nt();function s(a){i("navigate",a)}const o=a=>s(a);return l.$$set=a=>{"crumbs"in a&&t(0,n=a.crumbs)},[n,s,o]}class Dn extends We{constructor(e){super(),Ke(this,e,es,$o,Ve,{crumbs:0})}}function ts(l){let e,t,n,i,s,o;return{c(){e=u("div"),t=u("p"),t.textContent="Предпросмотр недоступен для этого типа файлов.",n=j(),i=u("button"),i.textContent="Открыть во внешней программе",c(i,"class","btn btn-sm svelte-1cw3u0m"),c(e,"class","preview-status svelte-1cw3u0m")},m(a,f){g(a,e,f),r(e,t),r(e,n),r(e,i),s||(o=A(i,"click",l[9]),s=!0)},p:G,d(a){a&&k(e),s=!1,o()}}}function ls(l){let e,t;function n(o,a){return a&2&&(e=null),e==null&&(e=!!(o[1]&&o[1].startsWith("data:"))),e?rs:cs}let i=n(l,-1),s=i(l);return{c(){s.c(),t=ye()},m(o,a){s.m(o,a),g(o,t,a)},p(o,a){i===(i=n(o,a))&&s?s.p(o,a):(s.d(1),s=i(o),s&&(s.c(),s.m(t.parentNode,t)))},d(o){o&&k(t),s.d(o)}}}function ns(l){let e,t,n;return{c(){e=u("pre"),t=u("code"),n=I(l[1]),c(e,"class","preview-text svelte-1cw3u0m")},m(i,s){g(i,e,s),r(e,t),r(t,n)},p(i,s){s&2&&H(n,i[1])},d(i){i&&k(e)}}}function is(l){let e,t,n,i;return{c(){e=u("div"),t=u("img"),tt(t.src,n=l[1])||c(t,"src",n),c(t,"alt",i=l[0].name),c(t,"class","preview-image svelte-1cw3u0m"),c(e,"class","preview-image-container svelte-1cw3u0m")},m(s,o){g(s,e,o),r(e,t)},p(s,o){o&2&&!tt(t.src,n=s[1])&&c(t,"src",n),o&1&&i!==(i=s[0].name)&&c(t,"alt",i)},d(s){s&&k(e)}}}function os(l){let e,t,n,i,s,o,a;return{c(){e=u("div"),t=u("p"),n=I(l[3]),i=j(),s=u("button"),s.textContent="Открыть во внешней программе",c(s,"class","btn btn-sm svelte-1cw3u0m"),c(e,"class","preview-status svelte-1cw3u0m")},m(f,_){g(f,e,_),r(e,t),r(t,n),r(e,i),r(e,s),o||(a=A(s,"click",l[9]),o=!0)},p(f,_){_&8&&H(n,f[3])},d(f){f&&k(e),o=!1,a()}}}function ss(l){let e;return{c(){e=u("div"),e.innerHTML="<p>Загрузка...</p>",c(e,"class","preview-status svelte-1cw3u0m")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function cs(l){let e,t,n,i,s,o;return{c(){e=u("div"),t=u("p"),t.textContent="Предпросмотр PDF недоступен.",n=j(),i=u("button"),i.textContent="Открыть во внешней программе",c(i,"class","btn btn-sm svelte-1cw3u0m"),c(e,"class","preview-status svelte-1cw3u0m")},m(a,f){g(a,e,f),r(e,t),r(e,n),r(e,i),s||(o=A(i,"click",l[9]),s=!0)},p:G,d(a){a&&k(e),s=!1,o()}}}function rs(l){let e,t,n;return{c(){e=u("div"),t=u("embed"),tt(t.src,n=l[1])||c(t,"src",n),c(t,"type","application/pdf"),c(t,"class","preview-pdf svelte-1cw3u0m"),c(e,"class","preview-pdf-container svelte-1cw3u0m")},m(i,s){g(i,e,s),r(e,t)},p(i,s){s&2&&!tt(t.src,n=i[1])&&c(t,"src",n)},d(i){i&&k(e)}}}function as(l){let e,t,n,i,s,o,a,f=l[0].name+"",_,m,h,p,v=lt(l[0].size)+"",w,b,y=tl(l[0].mime)+"",z,M,E,q,N,O,S,T,C,D,R,X;s=new qn({props:{kind:l[8],size:18}});function x(F,U){return F[2]?ss:F[3]?os:F[6]&&F[1]?is:F[5]&&F[1]?ns:F[4]?ls:ts}let B=x(l),P=B(l);return{c(){e=u("div"),t=u("div"),n=u("header"),i=u("div"),Ie(s.$$.fragment),o=j(),a=u("span"),_=I(f),h=j(),p=u("div"),w=I(v),b=I(" · "),z=I(y),M=j(),E=u("div"),q=u("button"),q.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',N=j(),O=u("button"),O.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',S=j(),T=u("div"),P.c(),c(a,"class","preview-name svelte-1cw3u0m"),c(a,"title",m=l[0].name),c(i,"class","preview-title svelte-1cw3u0m"),c(p,"class","preview-meta svelte-1cw3u0m"),c(q,"class","action-btn svelte-1cw3u0m"),c(q,"title","Открыть во внешней программе"),c(q,"aria-label","Открыть внешне"),c(O,"class","action-btn action-btn-close svelte-1cw3u0m"),c(O,"title","Close"),c(O,"aria-label","Close preview"),c(E,"class","preview-actions svelte-1cw3u0m"),c(n,"class","preview-header svelte-1cw3u0m"),c(T,"class","preview-body svelte-1cw3u0m"),c(t,"class","modal svelte-1cw3u0m"),c(e,"class","overlay svelte-1cw3u0m"),c(e,"role","dialog"),c(e,"aria-modal","true"),c(e,"aria-label",C=`Preview: ${l[0].name}`)},m(F,U){g(F,e,U),r(e,t),r(t,n),r(n,i),Me(s,i,null),r(i,o),r(i,a),r(a,_),r(n,h),r(n,p),r(p,w),r(p,b),r(p,z),r(n,M),r(n,E),r(E,q),r(E,N),r(E,O),r(t,S),r(t,T),P.m(T,null),D=!0,R||(X=[A(q,"click",l[9]),A(O,"click",l[10]),A(e,"click",Re(l[11]))],R=!0)},p(F,[U]){(!D||U&1)&&f!==(f=F[0].name+"")&&H(_,f),(!D||U&1&&m!==(m=F[0].name))&&c(a,"title",m),(!D||U&1)&&v!==(v=lt(F[0].size)+"")&&H(w,v),(!D||U&1)&&y!==(y=tl(F[0].mime)+"")&&H(z,y),B===(B=x(F))&&P?P.p(F,U):(P.d(1),P=B(F),P&&(P.c(),P.m(T,null))),(!D||U&1&&C!==(C=`Preview: ${F[0].name}`))&&c(e,"aria-label",C)},i(F){D||(re(s.$$.fragment,F),D=!0)},o(F){ue(s.$$.fragment,F),D=!1},d(F){F&&k(e),Le(s),P.d(),R=!1,ce(X)}}}function fs(l,e,t){let n,i,s,{item:o}=e,{content:a=""}=e,{loading:f=!1}=e,{error:_=""}=e;const m=nt(),h=Cn(o);function p(y){y.key==="Escape"&&m("close")}function v(){m("openExternal",o.fileId)}wn(()=>{window.addEventListener("keydown",p)}),jn(()=>{window.removeEventListener("keydown",p)});const w=()=>m("close"),b=()=>m("close");return l.$$set=y=>{"item"in y&&t(0,o=y.item),"content"in y&&t(1,a=y.content),"loading"in y&&t(2,f=y.loading),"error"in y&&t(3,_=y.error)},l.$$.update=()=>{l.$$.dirty&3&&t(6,n=Tn(o)&&a&&a.startsWith("data:")),l.$$.dirty&1&&t(5,i=Mn(o)||Sn(o)),l.$$.dirty&1&&t(4,s=Ln(o))},[o,a,f,_,s,i,n,m,h,v,w,b]}class us extends We{constructor(e){super(),Ke(this,e,fs,as,Ve,{item:0,content:1,loading:2,error:3})}}function ds(l){let e,t,n,i,s,o,a,f,_,m,h,p,v,w,b,y,z;return{c(){e=u("div"),t=u("div"),n=u("h3"),i=I(l[0]),s=j(),o=u("p"),a=I(l[1]),f=j(),_=u("div"),m=u("button"),h=I(l[2]),v=j(),w=u("button"),b=I(l[3]),c(n,"class","svelte-1fv6yyk"),c(o,"class","message svelte-1fv6yyk"),c(m,"class",p="btn "+(l[4]?"btn-danger":"btn-primary")+" svelte-1fv6yyk"),c(w,"class","btn svelte-1fv6yyk"),c(_,"class","actions svelte-1fv6yyk"),c(t,"class","modal svelte-1fv6yyk"),c(e,"class","overlay svelte-1fv6yyk"),c(e,"role","dialog"),c(e,"aria-modal","true"),c(e,"aria-label",l[0])},m(M,E){g(M,e,E),r(e,t),r(t,n),r(n,i),r(t,s),r(t,o),r(o,a),r(t,f),r(t,_),r(_,m),r(m,h),r(_,v),r(_,w),r(w,b),y||(z=[A(m,"click",l[6]),A(w,"click",l[7]),A(e,"click",Re(l[8]))],y=!0)},p(M,[E]){E&1&&H(i,M[0]),E&2&&H(a,M[1]),E&4&&H(h,M[2]),E&16&&p!==(p="btn "+(M[4]?"btn-danger":"btn-primary")+" svelte-1fv6yyk")&&c(m,"class",p),E&8&&H(b,M[3]),E&1&&c(e,"aria-label",M[0])},i:G,o:G,d(M){M&&k(e),y=!1,ce(z)}}}function _s(l,e,t){let{title:n="Подтверждение"}=e,{message:i=""}=e,{confirmText:s="Удалить"}=e,{cancelText:o="Отмена"}=e,{danger:a=!1}=e;const f=nt(),_=()=>f("confirm"),m=()=>f("cancel"),h=()=>f("cancel");return l.$$set=p=>{"title"in p&&t(0,n=p.title),"message"in p&&t(1,i=p.message),"confirmText"in p&&t(2,s=p.confirmText),"cancelText"in p&&t(3,o=p.cancelText),"danger"in p&&t(4,a=p.danger)},[n,i,s,o,a,f,_,m,h]}class ps extends We{constructor(e){super(),Ke(this,e,_s,ds,Ve,{title:0,message:1,confirmText:2,cancelText:3,danger:4})}}function ol(l,e,t){const n=l.slice();return n[181]=e[t],n}function sl(l,e,t){const n=l.slice();return n[184]=e[t],n}function cl(l,e,t){const n=l.slice();return n[187]=e[t],n}function rl(l,e,t){const n=l.slice();return n[206]=e[t],n}function al(l,e,t){const n=l.slice();return n[206]=e[t],n}function fl(l,e,t){const n=l.slice();return n[214]=e[t],n}function ul(l,e,t){const n=l.slice();return n[206]=e[t],n}function dl(l,e,t){const n=l.slice();return n[206]=e[t],n}function _l(l,e,t){const n=l.slice();return n[190]=e[t],n}function pl(l,e,t){const n=l.slice();return n[201]=e[t],n}function ml(l,e,t){const n=l.slice();return n[198]=e[t],n}function vl(l,e,t){const n=l.slice();return n[193]=e[t],n}function hl(l,e,t){const n=l.slice();return n[190]=e[t],n}function bl(l,e,t){const n=l.slice();return n[193]=e[t],n}function kl(l,e,t){const n=l.slice();return n[209]=e[t],n}function gl(l,e,t){const n=l.slice();return n[187]=e[t],n}function yl(l,e,t){const n=l.slice();return n[223]=e[t],n}function wl(l,e,t){const n=l.slice();return n[226]=e[t],n}function jl(l){let e,t=l[226].label+"",n,i,s,o,a;function f(){return l[99](l[226])}return{c(){e=u("button"),n=I(t),i=j(),c(e,"class",s="nav-item "+(l[7]===l[226].id?"selected":"")+" svelte-oqcj5z")},m(_,m){g(_,e,m),r(e,n),r(e,i),o||(a=A(e,"click",f),o=!0)},p(_,m){l=_,m[0]&1&&t!==(t=l[226].label+"")&&H(n,t),m[0]&129&&s!==(s="nav-item "+(l[7]===l[226].id?"selected":"")+" svelte-oqcj5z")&&c(e,"class",s)},d(_){_&&k(e),o=!1,a()}}}function zl(l){let e,t,n,i,s,o=l[1].length>0&&ql(l),a=ee(l[1]),f=[];for(let m=0;m<a.length;m+=1)f[m]=Cl(yl(l,a,m));let _=l[1].length===0&&Tl();return{c(){e=u("div"),t=u("div"),n=I("Дела "),o&&o.c(),i=j();for(let m=0;m<f.length;m+=1)f[m].c();s=j(),_&&_.c(),c(t,"class","nav-label svelte-oqcj5z"),c(e,"class","nav-group svelte-oqcj5z")},m(m,h){g(m,e,h),r(e,t),r(t,n),o&&o.m(t,null),r(e,i);for(let p=0;p<f.length;p+=1)f[p]&&f[p].m(e,null);r(e,s),_&&_.m(e,null)},p(m,h){if(m[1].length>0?o?o.p(m,h):(o=ql(m),o.c(),o.m(t,null)):o&&(o.d(1),o=null),h[0]&258|h[1]&2097152){a=ee(m[1]);let p;for(p=0;p<a.length;p+=1){const v=yl(m,a,p);f[p]?f[p].p(v,h):(f[p]=Cl(v),f[p].c(),f[p].m(e,s))}for(;p<f.length;p+=1)f[p].d(1);f.length=a.length}m[1].length===0?_||(_=Tl(),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},d(m){m&&k(e),o&&o.d(),ve(f,m),_&&_.d()}}}function ql(l){let e,t=l[1].length+"",n,i;return{c(){e=I("("),n=I(t),i=I(")")},m(s,o){g(s,e,o),g(s,n,o),g(s,i,o)},p(s,o){o[0]&2&&t!==(t=s[1].length+"")&&H(n,t)},d(s){s&&(k(e),k(n),k(i))}}}function Cl(l){let e,t=l[223].title+"",n,i,s,o;function a(){return l[100](l[223])}return{c(){e=u("button"),n=I(t),c(e,"class",i="nav-item "+(l[8]&&l[8].id===l[223].id?"selected":"")+" svelte-oqcj5z")},m(f,_){g(f,e,_),r(e,n),s||(o=A(e,"click",a),s=!0)},p(f,_){l=f,_[0]&2&&t!==(t=l[223].title+"")&&H(n,t),_[0]&258&&i!==(i="nav-item "+(l[8]&&l[8].id===l[223].id?"selected":"")+" svelte-oqcj5z")&&c(e,"class",i)},d(f){f&&k(e),s=!1,o()}}}function Tl(l){let e;return{c(){e=u("div"),e.textContent="Нет дел",c(e,"class","nav-empty svelte-oqcj5z")},m(t,n){g(t,e,n)},d(t){t&&k(e)}}}function ms(l){let e;return{c(){e=u("span"),e.textContent="Выберите раздел или дело",c(e,"class","crumb placeholder svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function vs(l){let e,t=ee(l[0]),n=[];for(let i=0;i<t.length;i+=1)n[i]=Ml(gl(l,t,i));return{c(){e=u("span");for(let i=0;i<n.length;i+=1)n[i].c();c(e,"class","crumb svelte-oqcj5z")},m(i,s){g(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s[0]&129){t=ee(i[0]);let o;for(o=0;o<t.length;o+=1){const a=gl(i,t,o);n[o]?n[o].p(a,s):(n[o]=Ml(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&k(e),ve(n,i)}}}function hs(l){let e,t=l[8].title+"",n,i,s,o=l[8].type+"",a;return{c(){e=u("span"),n=I(t),i=j(),s=u("span"),a=I(o),c(e,"class","crumb svelte-oqcj5z"),c(s,"class","crumb-type svelte-oqcj5z")},m(f,_){g(f,e,_),r(e,n),g(f,i,_),g(f,s,_),r(s,a)},p(f,_){_[0]&256&&t!==(t=f[8].title+"")&&H(n,t),_[0]&256&&o!==(o=f[8].type+"")&&H(a,o)},d(f){f&&(k(e),k(i),k(s))}}}function Ml(l){let e=(l[187].id===l[7]?l[187].label:"")+"",t;return{c(){t=I(e)},m(n,i){g(n,t,i)},p(n,i){i[0]&129&&e!==(e=(n[187].id===n[7]?n[187].label:"")+"")&&H(t,e)},d(n){n&&k(t)}}}function Ll(l){let e,t,n,i,s,o;return{c(){e=u("div"),t=I(l[6]),n=j(),i=u("button"),i.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><line x1="18" y1="6" x2="6" y2="18" class="svelte-oqcj5z"></line><line x1="6" y1="6" x2="18" y2="18" class="svelte-oqcj5z"></line></svg>',c(i,"class","dismiss-btn svelte-oqcj5z"),c(i,"aria-label","Dismiss"),c(e,"class","error-banner svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,t),r(e,n),r(e,i),s||(o=[A(i,"click",je(l[101])),A(e,"click",l[102])],s=!0)},p(a,f){f[0]&64&&H(t,a[6])},d(a){a&&k(e),s=!1,ce(o)}}}function bs(l){let e,t,n;function i(a,f){if(a[27])return qs;if(a[0].length>0)return zs;if(a[6])return js}let s=i(l),o=s&&s(l);return{c(){e=u("div"),t=u("h2"),t.textContent="Верстак",n=j(),o&&o.c(),c(t,"class","svelte-oqcj5z"),c(e,"class","welcome svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,t),r(e,n),o&&o.m(e,null)},p(a,f){s===(s=i(a))&&o?o.p(a,f):(o&&o.d(1),o=s&&s(a),o&&(o.c(),o.m(e,null)))},i:G,o:G,d(a){a&&k(e),o&&o.d()}}}function ks(l){let e,t,n;function i(a,f){return a[3].length===0?Ts:Cs}let s=i(l),o=s(l);return{c(){e=u("div"),t=u("div"),t.innerHTML='<h2 class="svelte-oqcj5z">Активность</h2>',n=j(),o.c(),c(t,"class","activity-feed-header svelte-oqcj5z"),c(e,"class","activity-feed svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,t),r(e,n),o.m(e,null)},p(a,f){s===(s=i(a))&&o?o.p(a,f):(o.d(1),o=s(a),o&&(o.c(),o.m(e,null)))},i:G,o:G,d(a){a&&k(e),o.d()}}}function gs(l){let e,t,n,i,s,o=l[2].date+"",a,f,_,m=l[2].summary&&Il(l);function h(w,b){return w[2].groups&&w[2].groups.length>0?Ls:Ms}let p=h(l),v=p(l);return{c(){e=u("div"),t=u("div"),n=u("h2"),n.textContent="Сегодня",i=j(),s=u("span"),a=I(o),f=j(),m&&m.c(),_=j(),v.c(),c(n,"class","svelte-oqcj5z"),c(s,"class","today-date svelte-oqcj5z"),c(t,"class","today-header svelte-oqcj5z"),c(e,"class","today-dashboard svelte-oqcj5z")},m(w,b){g(w,e,b),r(e,t),r(t,n),r(t,i),r(t,s),r(s,a),r(e,f),m&&m.m(e,null),r(e,_),v.m(e,null)},p(w,b){b[0]&4&&o!==(o=w[2].date+"")&&H(a,o),w[2].summary?m?m.p(w,b):(m=Il(w),m.c(),m.m(e,_)):m&&(m.d(1),m=null),p===(p=h(w))&&v?v.p(w,b):(v.d(1),v=p(w),v&&(v.c(),v.m(e,null)))},i:G,o:G,d(w){w&&k(e),m&&m.d(),v.d()}}}function ys(l){let e,t,n,i,s,o,a=ee(l[50]),f=[];for(let p=0;p<a.length;p+=1)f[p]=Rl(kl(l,a,p));const _=[Hs,Fs,Ns,As,Es,Is],m=[];function h(p,v){return p[9]==="overview"?0:p[9]==="notes"?1:p[9]==="files"?2:p[9]==="actions"?3:p[9]==="worklog"?4:p[9]==="activity"?5:-1}return~(i=h(l))&&(s=m[i]=_[i](l)),{c(){e=u("div");for(let p=0;p<f.length;p+=1)f[p].c();t=j(),n=u("div"),s&&s.c(),c(e,"class","tabs svelte-oqcj5z"),c(n,"class","tab-content svelte-oqcj5z")},m(p,v){g(p,e,v);for(let w=0;w<f.length;w+=1)f[w]&&f[w].m(e,null);g(p,t,v),g(p,n,v),~i&&m[i].m(n,null),o=!0},p(p,v){if(v[0]&768|v[1]&4718602|v[2]&1073741824){a=ee(p[50]);let b;for(b=0;b<a.length;b+=1){const y=kl(p,a,b);f[b]?f[b].p(y,v):(f[b]=Rl(y),f[b].c(),f[b].m(e,null))}for(;b<f.length;b+=1)f[b].d(1);f.length=a.length}let w=i;i=h(p),i===w?~i&&m[i].p(p,v):(s&&(ze(),ue(m[w],1,1,()=>{m[w]=null}),qe()),~i?(s=m[i],s?s.p(p,v):(s=m[i]=_[i](p),s.c()),re(s,1),s.m(n,null)):s=null)},i(p){o||(re(s),o=!0)},o(p){ue(s),o=!1},d(p){p&&(k(e),k(t),k(n)),ve(f,p),~i&&m[i].d()}}}function ws(l){let e,t,n,i=l[11].title+"",s,o,a,f,_,m,h,p,v,w,b,y=l[11].dirty&&nn();return{c(){e=u("div"),t=u("div"),n=u("span"),s=I(i),o=j(),y&&y.c(),a=j(),f=u("div"),_=u("button"),_.textContent="Сохранить",m=j(),h=u("button"),h.textContent="Закрыть",p=j(),v=u("textarea"),c(n,"class","note-title svelte-oqcj5z"),c(_,"class","btn btn-primary svelte-oqcj5z"),c(h,"class","btn svelte-oqcj5z"),c(f,"class","note-editor-actions svelte-oqcj5z"),c(t,"class","note-editor-header svelte-oqcj5z"),c(v,"class","note-textarea svelte-oqcj5z"),c(v,"placeholder","Начните писать..."),c(e,"class","note-editor svelte-oqcj5z")},m(z,M){g(z,e,M),r(e,t),r(t,n),r(n,s),r(t,o),y&&y.m(t,null),r(t,a),r(t,f),r(f,_),r(f,m),r(f,h),r(e,p),r(e,v),de(v,l[11].content),w||(b=[A(_,"click",l[85]),A(h,"click",l[83]),A(v,"input",l[103]),A(v,"input",l[84])],w=!0)},p(z,M){M[0]&2048&&i!==(i=z[11].title+"")&&H(s,i),z[11].dirty?y||(y=nn(),y.c(),y.m(t,a)):y&&(y.d(1),y=null),M[0]&2048&&de(v,z[11].content)},i:G,o:G,d(z){z&&k(e),y&&y.d(),w=!1,ce(b)}}}function js(l){let e,t,n;return{c(){e=u("p"),t=I("Ошибка: "),n=I(l[6]),c(e,"class","error-text svelte-oqcj5z")},m(i,s){g(i,e,s),r(e,t),r(e,n)},p(i,s){s[0]&64&&H(n,i[6])},d(i){i&&k(e)}}}function zs(l){let e,t,n;return{c(){e=u("p"),e.textContent="Выберите раздел в боковой панели.",t=j(),n=u("p"),n.textContent="Или создайте новое дело кнопкой «+».",c(e,"class","svelte-oqcj5z"),c(n,"class","hint svelte-oqcj5z")},m(i,s){g(i,e,s),g(i,t,s),g(i,n,s)},p:G,d(i){i&&(k(e),k(t),k(n))}}}function qs(l){let e;return{c(){e=u("p"),e.textContent="Загрузка...",c(e,"class","svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function Cs(l){let e,t=ee(l[3]),n=[];for(let i=0;i<t.length;i+=1)n[i]=Dl(rl(l,t,i));return{c(){e=u("div");for(let i=0;i<n.length;i+=1)n[i].c();c(e,"class","activity-feed-events svelte-oqcj5z")},m(i,s){g(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s[0]&8|s[3]&32){t=ee(i[3]);let o;for(o=0;o<t.length;o+=1){const a=rl(i,t,o);n[o]?n[o].p(a,s):(n[o]=Dl(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&k(e),ve(n,i)}}}function Ts(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Активность пока не зафиксирована</p>',c(e,"class","empty-state svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function Sl(l){let e,t=l[206].targetType+"",n;return{c(){e=u("span"),n=I(t),c(e,"class","activity-feed-target svelte-oqcj5z")},m(i,s){g(i,e,s),r(e,n)},p(i,s){s[0]&8&&t!==(t=i[206].targetType+"")&&H(n,t)},d(i){i&&k(e)}}}function Dl(l){let e,t,n=Pe(l[206].eventType)+"",i,s,o,a,f=l[206].title+"",_,m,h,p,v=Ce(l[206].eventType)+"",w,b,y,z,M=ke(l[206].createdAt)+"",E,q,N=be(l[206].createdAt)+"",O,S,T,C,D=l[206].targetType&&Sl(l);function R(){return l[136](l[206])}function X(...x){return l[137](l[206],...x)}return{c(){e=u("div"),t=u("span"),i=I(n),s=j(),o=u("div"),a=u("span"),_=I(f),m=j(),h=u("div"),p=u("span"),w=I(v),b=j(),D&&D.c(),y=j(),z=u("span"),E=I(M),q=j(),O=I(N),S=j(),c(t,"class","activity-feed-icon svelte-oqcj5z"),c(a,"class","activity-feed-title svelte-oqcj5z"),c(p,"class","activity-feed-type svelte-oqcj5z"),c(z,"class","activity-feed-time svelte-oqcj5z"),c(h,"class","activity-feed-meta svelte-oqcj5z"),c(o,"class","activity-feed-body svelte-oqcj5z"),c(e,"class","activity-feed-event svelte-oqcj5z"),c(e,"role","button"),c(e,"tabindex","0")},m(x,B){g(x,e,B),r(e,t),r(t,i),r(e,s),r(e,o),r(o,a),r(a,_),r(o,m),r(o,h),r(h,p),r(p,w),r(h,b),D&&D.m(h,null),r(h,y),r(h,z),r(z,E),r(z,q),r(z,O),r(e,S),T||(C=[A(e,"click",R),A(e,"keydown",X)],T=!0)},p(x,B){l=x,B[0]&8&&n!==(n=Pe(l[206].eventType)+"")&&H(i,n),B[0]&8&&f!==(f=l[206].title+"")&&H(_,f),B[0]&8&&v!==(v=Ce(l[206].eventType)+"")&&H(w,v),l[206].targetType?D?D.p(l,B):(D=Sl(l),D.c(),D.m(h,y)):D&&(D.d(1),D=null),B[0]&8&&M!==(M=ke(l[206].createdAt)+"")&&H(E,M),B[0]&8&&N!==(N=be(l[206].createdAt)+"")&&H(O,N)},d(x){x&&k(e),D&&D.d(),T=!1,ce(C)}}}function Il(l){let e,t,n,i=l[2].summary.changedCases>0&&El(l),s=l[2].summary.notes>0&&Al(l),o=l[2].summary.files>0&&Nl(l);return{c(){e=u("div"),i&&i.c(),t=j(),s&&s.c(),n=j(),o&&o.c(),c(e,"class","today-summary svelte-oqcj5z")},m(a,f){g(a,e,f),i&&i.m(e,null),r(e,t),s&&s.m(e,null),r(e,n),o&&o.m(e,null)},p(a,f){a[2].summary.changedCases>0?i?i.p(a,f):(i=El(a),i.c(),i.m(e,t)):i&&(i.d(1),i=null),a[2].summary.notes>0?s?s.p(a,f):(s=Al(a),s.c(),s.m(e,n)):s&&(s.d(1),s=null),a[2].summary.files>0?o?o.p(a,f):(o=Nl(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),i&&i.d(),s&&s.d(),o&&o.d()}}}function El(l){let e,t=l[2].summary.changedCases+"",n,i,s=Te(l[2].summary.changedCases,"дело","дела","дел")+"",o;return{c(){e=u("span"),n=I(t),i=j(),o=I(s),c(e,"class","summary-chip svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,n),r(e,i),r(e,o)},p(a,f){f[0]&4&&t!==(t=a[2].summary.changedCases+"")&&H(n,t),f[0]&4&&s!==(s=Te(a[2].summary.changedCases,"дело","дела","дел")+"")&&H(o,s)},d(a){a&&k(e)}}}function Al(l){let e,t=l[2].summary.notes+"",n,i,s=Te(l[2].summary.notes,"заметка","заметки","заметок")+"",o;return{c(){e=u("span"),n=I(t),i=j(),o=I(s),c(e,"class","summary-chip svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,n),r(e,i),r(e,o)},p(a,f){f[0]&4&&t!==(t=a[2].summary.notes+"")&&H(n,t),f[0]&4&&s!==(s=Te(a[2].summary.notes,"заметка","заметки","заметок")+"")&&H(o,s)},d(a){a&&k(e)}}}function Nl(l){let e,t=l[2].summary.files+"",n,i,s=Te(l[2].summary.files,"файл","файла","файлов")+"",o;return{c(){e=u("span"),n=I(t),i=j(),o=I(s),c(e,"class","summary-chip svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,n),r(e,i),r(e,o)},p(a,f){f[0]&4&&t!==(t=a[2].summary.files+"")&&H(n,t),f[0]&4&&s!==(s=Te(a[2].summary.files,"файл","файла","файлов")+"")&&H(o,s)},d(a){a&&k(e)}}}function Ms(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Сегодня пока тихо</p> <p class="hint svelte-oqcj5z">Здесь появятся дела, заметки, файлы и действия, с которыми вы работали сегодня.</p>',c(e,"class","today-empty svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function Ls(l){let e,t,n=ee(l[2].groups),i=[];for(let o=0;o<n.length;o+=1)i[o]=Ol(fl(l,n,o));let s=l[2].events&&l[2].events.length>0&&Pl(l);return{c(){for(let o=0;o<i.length;o+=1)i[o].c();e=j(),s&&s.c(),t=ye()},m(o,a){for(let f=0;f<i.length;f+=1)i[f]&&i[f].m(o,a);g(o,e,a),s&&s.m(o,a),g(o,t,a)},p(o,a){if(a[0]&4|a[3]&32){n=ee(o[2].groups);let f;for(f=0;f<n.length;f+=1){const _=fl(o,n,f);i[f]?i[f].p(_,a):(i[f]=Ol(_),i[f].c(),i[f].m(e.parentNode,e))}for(;f<i.length;f+=1)i[f].d(1);i.length=n.length}o[2].events&&o[2].events.length>0?s?s.p(o,a):(s=Pl(o),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(o){o&&(k(e),k(t)),ve(i,o),s&&s.d(o)}}}function Fl(l){let e,t=l[214].events.length+"",n,i,s=Te(l[214].events.length,"событие","события","событий")+"",o;return{c(){e=u("span"),n=I(t),i=j(),o=I(s),c(e,"class","today-case-count svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,n),r(e,i),r(e,o)},p(a,f){f[0]&4&&t!==(t=a[214].events.length+"")&&H(n,t),f[0]&4&&s!==(s=Te(a[214].events.length,"событие","события","событий")+"")&&H(o,s)},d(a){a&&k(e)}}}function Ss(l){let e;return{c(){e=u("div"),e.textContent="Изменён сегодня",c(e,"class","today-events-empty svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function Ds(l){let e,t=ee(l[214].events),n=[];for(let i=0;i<t.length;i+=1)n[i]=Bl(ul(l,t,i));return{c(){e=u("div");for(let i=0;i<n.length;i+=1)n[i].c();c(e,"class","today-events svelte-oqcj5z")},m(i,s){g(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s[0]&4|s[3]&32){t=ee(i[214].events);let o;for(o=0;o<t.length;o+=1){const a=ul(i,t,o);n[o]?n[o].p(a,s):(n[o]=Bl(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&k(e),ve(n,i)}}}function Hl(l){let e,t=l[206].targetType+"",n;return{c(){e=u("span"),n=I(t),c(e,"class","activity-event-target svelte-oqcj5z")},m(i,s){g(i,e,s),r(e,n)},p(i,s){s[0]&4&&t!==(t=i[206].targetType+"")&&H(n,t)},d(i){i&&k(e)}}}function Bl(l){let e,t,n=Pe(l[206].eventType)+"",i,s,o,a=l[206].title+"",f,_,m,h=Ce(l[206].eventType)+"",p,v,w,b,y=be(l[206].createdAt)+"",z,M,E,q=l[206].targetType&&Hl(l);function N(){return l[132](l[214])}function O(...S){return l[133](l[214],...S)}return{c(){e=u("div"),t=u("span"),i=I(n),s=j(),o=u("span"),f=I(a),_=j(),m=u("span"),p=I(h),v=j(),q&&q.c(),w=j(),b=u("span"),z=I(y),c(t,"class","today-event-icon svelte-oqcj5z"),c(o,"class","today-event-title svelte-oqcj5z"),c(m,"class","today-event-type svelte-oqcj5z"),c(b,"class","today-event-time svelte-oqcj5z"),c(e,"class","today-event svelte-oqcj5z"),c(e,"role","button"),c(e,"tabindex","0")},m(S,T){g(S,e,T),r(e,t),r(t,i),r(e,s),r(e,o),r(o,f),r(e,_),r(e,m),r(m,p),r(e,v),q&&q.m(e,null),r(e,w),r(e,b),r(b,z),M||(E=[A(e,"click",N),A(e,"keydown",O)],M=!0)},p(S,T){l=S,T[0]&4&&n!==(n=Pe(l[206].eventType)+"")&&H(i,n),T[0]&4&&a!==(a=l[206].title+"")&&H(f,a),T[0]&4&&h!==(h=Ce(l[206].eventType)+"")&&H(p,h),l[206].targetType?q?q.p(l,T):(q=Hl(l),q.c(),q.m(e,w)):q&&(q.d(1),q=null),T[0]&4&&y!==(y=be(l[206].createdAt)+"")&&H(z,y)},d(S){S&&k(e),q&&q.d(),M=!1,ce(E)}}}function Ol(l){let e,t,n,i=l[214].nodeTitle+"",s,o,a,f=hn(l[214].nodeKind)+"",_,m,h,p,v=be(l[214].lastActivityAt)+"",w,b,y,z,M=l[214].events&&Fl(l);function E(){return l[130](l[214])}function q(...T){return l[131](l[214],...T)}function N(T,C){return T[214].events&&T[214].events.length>0?Ds:Ss}let O=N(l),S=O(l);return{c(){e=u("div"),t=u("div"),n=u("span"),s=I(i),o=j(),a=u("span"),_=I(f),m=j(),M&&M.c(),h=j(),p=u("span"),w=I(v),b=j(),S.c(),c(n,"class","today-case-title svelte-oqcj5z"),c(a,"class","today-case-type svelte-oqcj5z"),c(p,"class","today-case-time svelte-oqcj5z"),c(t,"class","today-case-header svelte-oqcj5z"),c(t,"role","button"),c(t,"tabindex","0"),c(e,"class","today-case svelte-oqcj5z")},m(T,C){g(T,e,C),r(e,t),r(t,n),r(n,s),r(t,o),r(t,a),r(a,_),r(t,m),M&&M.m(t,null),r(t,h),r(t,p),r(p,w),r(e,b),S.m(e,null),y||(z=[A(t,"click",E),A(t,"keydown",q)],y=!0)},p(T,C){l=T,C[0]&4&&i!==(i=l[214].nodeTitle+"")&&H(s,i),C[0]&4&&f!==(f=hn(l[214].nodeKind)+"")&&H(_,f),l[214].events?M?M.p(l,C):(M=Fl(l),M.c(),M.m(t,h)):M&&(M.d(1),M=null),C[0]&4&&v!==(v=be(l[214].lastActivityAt)+"")&&H(w,v),O===(O=N(l))&&S?S.p(l,C):(S.d(1),S=O(l),S&&(S.c(),S.m(e,null)))},d(T){T&&k(e),M&&M.d(),S.d(),y=!1,ce(z)}}}function Pl(l){let e,t,n,i=ee(l[2].events),s=[];for(let o=0;o<i.length;o+=1)s[o]=Vl(al(l,i,o));return{c(){e=u("div"),t=u("h3"),t.textContent="Лента за сегодня",n=j();for(let o=0;o<s.length;o+=1)s[o].c();c(t,"class","svelte-oqcj5z"),c(e,"class","today-timeline svelte-oqcj5z")},m(o,a){g(o,e,a),r(e,t),r(e,n);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(e,null)},p(o,a){if(a[0]&4|a[3]&32){i=ee(o[2].events);let f;for(f=0;f<i.length;f+=1){const _=al(o,i,f);s[f]?s[f].p(_,a):(s[f]=Vl(_),s[f].c(),s[f].m(e,null))}for(;f<s.length;f+=1)s[f].d(1);s.length=i.length}},d(o){o&&k(e),ve(s,o)}}}function Vl(l){let e,t,n,i,s=l[206].title+"",o,a,f,_=Ce(l[206].eventType)+"",m,h,p,v=be(l[206].createdAt)+"",w,b,y,z;function M(){return l[134](l[206])}function E(...q){return l[135](l[206],...q)}return{c(){e=u("div"),t=u("span"),n=j(),i=u("span"),o=I(s),a=j(),f=u("span"),m=I(_),h=j(),p=u("span"),w=I(v),b=j(),c(t,"class","timeline-dot svelte-oqcj5z"),c(i,"class","timeline-title svelte-oqcj5z"),c(f,"class","timeline-type svelte-oqcj5z"),c(p,"class","timeline-time svelte-oqcj5z"),c(e,"class","timeline-event svelte-oqcj5z"),c(e,"role","button"),c(e,"tabindex","0")},m(q,N){g(q,e,N),r(e,t),r(e,n),r(e,i),r(i,o),r(e,a),r(e,f),r(f,m),r(e,h),r(e,p),r(p,w),r(e,b),y||(z=[A(e,"click",M),A(e,"keydown",E)],y=!0)},p(q,N){l=q,N[0]&4&&s!==(s=l[206].title+"")&&H(o,s),N[0]&4&&_!==(_=Ce(l[206].eventType)+"")&&H(m,_),N[0]&4&&v!==(v=be(l[206].createdAt)+"")&&H(w,v)},d(q){q&&k(e),y=!1,ce(z)}}}function Rl(l){let e,t=l[209].label+"",n,i,s;function o(){return l[104](l[209])}return{c(){e=u("button"),n=I(t),c(e,"class",ao(l[92](l[209].id))+" svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,n),i||(s=A(e,"click",o),i=!0)},p(a,f){l=a},d(a){a&&k(e),i=!1,s()}}}function Is(l){let e;function t(s,o){return s[4].length===0?Os:Bs}let n=t(l),i=n(l);return{c(){e=u("div"),i.c(),c(e,"class","activity-tab svelte-oqcj5z")},m(s,o){g(s,e,o),i.m(e,null)},p(s,o){n===(n=t(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e,null)))},i:G,o:G,d(s){s&&k(e),i.d()}}}function Es(l){let e,t,n,i,s,o,a,f,_,m,h,p;function v(y,z){return y[13].length===0?Vs:Ps}let w=v(l),b=w(l);return{c(){e=u("div"),t=u("div"),n=u("input"),i=j(),s=u("input"),o=j(),a=u("button"),f=I("Записать"),m=j(),b.c(),c(n,"type","text"),c(n,"placeholder","Что сделано"),c(n,"class","svelte-oqcj5z"),c(s,"type","number"),c(s,"placeholder","Мин"),c(s,"min","1"),c(s,"class","svelte-oqcj5z"),c(a,"class","btn btn-primary svelte-oqcj5z"),a.disabled=_=!l[15].trim()||!l[14],c(t,"class","worklog-form svelte-oqcj5z"),c(e,"class","worklog-tab svelte-oqcj5z")},m(y,z){g(y,e,z),r(e,t),r(t,n),de(n,l[15]),r(t,i),r(t,s),de(s,l[14]),r(t,o),r(t,a),r(a,f),r(e,m),b.m(e,null),h||(p=[A(n,"input",l[128]),A(s,"input",l[129]),A(a,"click",l[86])],h=!0)},p(y,z){z[0]&32768&&n.value!==y[15]&&de(n,y[15]),z[0]&16384&&yn(s.value)!==y[14]&&de(s,y[14]),z[0]&49152&&_!==(_=!y[15].trim()||!y[14])&&(a.disabled=_),w===(w=v(y))&&b?b.p(y,z):(b.d(1),b=w(y),b&&(b.c(),b.m(e,null)))},i:G,o:G,d(y){y&&k(e),b.d(),h=!1,ce(p)}}}function As(l){let e,t,n,i,s,o;function a(m,h){return m[12].length===0?Ks:Rs}let f=a(l),_=f(l);return{c(){e=u("div"),t=u("div"),n=u("button"),n.textContent="+ Добавить действие",i=j(),_.c(),c(n,"class","btn btn-primary svelte-oqcj5z"),c(t,"class","tab-toolbar svelte-oqcj5z"),c(e,"class","actions-tab svelte-oqcj5z")},m(m,h){g(m,e,h),r(e,t),r(t,n),r(e,i),_.m(e,null),s||(o=A(n,"click",l[93]),s=!0)},p(m,h){f===(f=a(m))&&_?_.p(m,h):(_.d(1),_=f(m),_&&(_.c(),_.m(e,null)))},i:G,o:G,d(m){m&&k(e),_.d(),s=!1,o()}}}function Ns(l){let e,t,n,i,s,o,a,f,_,m,h,p,v,w,b,y,z,M,E,q=l[39].items.length>0&&Jl(l);const N=[Gs,Ws],O=[];function S(D,R){return D[31]?0:1}p=S(l),v=O[p]=N[p](l);let T=l[28]&&!l[30]&&Zl(),C=l[35]&&Yl(l);return{c(){e=u("div"),t=u("div"),n=u("button"),i=I("+ Добавить файл"),s=j(),o=u("button"),a=I("+ Добавить папку"),f=j(),_=u("button"),_.textContent="+ Новый файл",m=j(),q&&q.c(),h=j(),v.c(),w=j(),T&&T.c(),b=j(),C&&C.c(),y=ye(),c(n,"class","btn btn-primary svelte-oqcj5z"),n.disabled=l[28],c(o,"class","btn svelte-oqcj5z"),o.disabled=l[28],c(_,"class","btn svelte-oqcj5z"),c(t,"class","tab-toolbar svelte-oqcj5z"),c(e,"class","files-tab svelte-oqcj5z")},m(D,R){g(D,e,R),r(e,t),r(t,n),r(n,i),r(t,s),r(t,o),r(o,a),r(t,f),r(t,_),r(t,m),q&&q.m(t,null),r(e,h),O[p].m(e,null),r(e,w),T&&T.m(e,null),g(D,b,R),C&&C.m(D,R),g(D,y,R),z=!0,M||(E=[A(n,"click",l[87]),A(o,"click",l[88]),A(_,"click",l[59])],M=!0)},p(D,R){(!z||R[0]&268435456)&&(n.disabled=D[28]),(!z||R[0]&268435456)&&(o.disabled=D[28]),D[39].items.length>0?q?q.p(D,R):(q=Jl(D),q.c(),q.m(t,null)):q&&(q.d(1),q=null);let X=p;p=S(D),p===X?O[p].p(D,R):(ze(),ue(O[X],1,1,()=>{O[X]=null}),qe(),v=O[p],v?v.p(D,R):(v=O[p]=N[p](D),v.c()),re(v,1),v.m(e,w)),D[28]&&!D[30]?T||(T=Zl(),T.c(),T.m(e,null)):T&&(T.d(1),T=null),D[35]?C?(C.p(D,R),R[1]&16&&re(C,1)):(C=Yl(D),C.c(),re(C,1),C.m(y.parentNode,y)):C&&(ze(),ue(C,1,1,()=>{C=null}),qe())},i(D){z||(re(v),re(C),z=!0)},o(D){ue(v),ue(C),z=!1},d(D){D&&(k(e),k(b),k(y)),q&&q.d(),O[p].d(),T&&T.d(),C&&C.d(D),M=!1,ce(E)}}}function Fs(l){let e,t,n,i,s,o,a,f=l[21]&&Ql(l);function _(p,v){return p[10].length===0&&!p[21]?Qs:Ys}let m=_(l),h=m(l);return{c(){e=u("div"),t=u("div"),n=u("button"),n.textContent="+ Добавить заметку",i=j(),f&&f.c(),s=j(),h.c(),c(n,"class","btn btn-primary svelte-oqcj5z"),c(t,"class","tab-toolbar svelte-oqcj5z"),c(e,"class","notes-tab svelte-oqcj5z")},m(p,v){g(p,e,v),r(e,t),r(t,n),r(e,i),f&&f.m(e,null),r(e,s),h.m(e,null),o||(a=A(n,"click",l[79]),o=!0)},p(p,v){p[21]?f?f.p(p,v):(f=Ql(p),f.c(),f.m(e,s)):f&&(f.d(1),f=null),m===(m=_(p))&&h?h.p(p,v):(h.d(1),h=m(p),h&&(h.c(),h.m(e,null)))},i:G,o:G,d(p){p&&k(e),f&&f.d(),h.d(),o=!1,a()}}}function Hs(l){let e,t,n=l[8].title+"",i,s,o,a,f,_,m=l[8].type+"",h,p,v,w,b,y=(l[8].section||"")+"",z,M,E,q,N,O=ke(l[8].createdAt)+"",S,T,C,D,R,X,x,B,P,F,U,$,K,oe,ie=l[10].length>0&&$l(l),te=l[13].length>0&&tn(l);return{c(){e=u("div"),t=u("h2"),i=I(n),s=j(),o=u("div"),a=u("div"),f=u("span"),f.textContent="Тип",_=u("span"),h=I(m),p=j(),v=u("div"),w=u("span"),w.textContent="Раздел",b=u("span"),z=I(y),M=j(),E=u("div"),q=u("span"),q.textContent="Создано",N=u("span"),S=I(O),T=j(),C=u("div"),D=u("button"),D.innerHTML=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><path d="M12 20h9" class="svelte-oqcj5z"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" class="svelte-oqcj5z"></path></svg>
Новая заметка`,R=j(),X=u("button"),X.innerHTML=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" class="svelte-oqcj5z"></path></svg>
Добавить файл`,x=j(),B=u("button"),B.innerHTML=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" class="svelte-oqcj5z"></polygon></svg>
Добавить действие`,P=j(),F=u("button"),F.innerHTML=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><circle cx="12" cy="12" r="10" class="svelte-oqcj5z"></circle><polyline points="12 6 12 12 16 14" class="svelte-oqcj5z"></polyline></svg>
Записать время`,U=j(),ie&&ie.c(),$=j(),te&&te.c(),c(t,"class","svelte-oqcj5z"),c(f,"class","meta-label svelte-oqcj5z"),c(_,"class","svelte-oqcj5z"),c(a,"class","meta-item svelte-oqcj5z"),c(w,"class","meta-label svelte-oqcj5z"),c(b,"class","svelte-oqcj5z"),c(v,"class","meta-item svelte-oqcj5z"),c(q,"class","meta-label svelte-oqcj5z"),c(N,"class","svelte-oqcj5z"),c(E,"class","meta-item svelte-oqcj5z"),c(o,"class","meta-grid svelte-oqcj5z"),c(D,"class","qa-btn svelte-oqcj5z"),c(X,"class","qa-btn svelte-oqcj5z"),c(B,"class","qa-btn svelte-oqcj5z"),c(F,"class","qa-btn svelte-oqcj5z"),c(C,"class","quick-actions svelte-oqcj5z"),c(e,"class","overview svelte-oqcj5z")},m(Z,J){g(Z,e,J),r(e,t),r(t,i),r(e,s),r(e,o),r(o,a),r(a,f),r(a,_),r(_,h),r(o,p),r(o,v),r(v,w),r(v,b),r(b,z),r(o,M),r(o,E),r(E,q),r(E,N),r(N,S),r(e,T),r(e,C),r(C,D),r(C,R),r(C,X),r(C,x),r(C,B),r(C,P),r(C,F),r(e,U),ie&&ie.m(e,null),r(e,$),te&&te.m(e,null),K||(oe=[A(D,"click",l[105]),A(X,"click",l[106]),A(B,"click",l[93]),A(F,"click",l[107])],K=!0)},p(Z,J){J[0]&256&&n!==(n=Z[8].title+"")&&H(i,n),J[0]&256&&m!==(m=Z[8].type+"")&&H(h,m),J[0]&256&&y!==(y=(Z[8].section||"—")+"")&&H(z,y),J[0]&256&&O!==(O=ke(Z[8].createdAt)+"")&&H(S,O),Z[10].length>0?ie?ie.p(Z,J):(ie=$l(Z),ie.c(),ie.m(e,$)):ie&&(ie.d(1),ie=null),Z[13].length>0?te?te.p(Z,J):(te=tn(Z),te.c(),te.m(e,null)):te&&(te.d(1),te=null)},i:G,o:G,d(Z){Z&&k(e),ie&&ie.d(),te&&te.d(),K=!1,ce(oe)}}}function Bs(l){let e,t=ee(l[4]),n=[];for(let i=0;i<t.length;i+=1)n[i]=Wl(dl(l,t,i));return{c(){e=u("div");for(let i=0;i<n.length;i+=1)n[i].c();c(e,"class","activity-events svelte-oqcj5z")},m(i,s){g(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s[0]&16){t=ee(i[4]);let o;for(o=0;o<t.length;o+=1){const a=dl(i,t,o);n[o]?n[o].p(a,s):(n[o]=Wl(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&k(e),ve(n,i)}}}function Os(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Активность пока не зафиксирована</p>',c(e,"class","empty-state svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function Kl(l){let e,t=l[206].targetType+"",n;return{c(){e=u("span"),n=I(t),c(e,"class","activity-event-target svelte-oqcj5z")},m(i,s){g(i,e,s),r(e,n)},p(i,s){s[0]&16&&t!==(t=i[206].targetType+"")&&H(n,t)},d(i){i&&k(e)}}}function Wl(l){let e,t,n=Pe(l[206].eventType)+"",i,s,o,a=l[206].title+"",f,_,m,h=Ce(l[206].eventType)+"",p,v,w,b,y=be(l[206].createdAt)+"",z,M,E=l[206].targetType&&Kl(l);return{c(){e=u("div"),t=u("span"),i=I(n),s=j(),o=u("span"),f=I(a),_=j(),m=u("span"),p=I(h),v=j(),E&&E.c(),w=j(),b=u("span"),z=I(y),M=j(),c(t,"class","activity-event-icon svelte-oqcj5z"),c(o,"class","activity-event-title svelte-oqcj5z"),c(m,"class","activity-event-type svelte-oqcj5z"),c(b,"class","activity-event-time svelte-oqcj5z"),c(e,"class","activity-event svelte-oqcj5z")},m(q,N){g(q,e,N),r(e,t),r(t,i),r(e,s),r(e,o),r(o,f),r(e,_),r(e,m),r(m,p),r(e,v),E&&E.m(e,null),r(e,w),r(e,b),r(b,z),r(e,M)},p(q,N){N[0]&16&&n!==(n=Pe(q[206].eventType)+"")&&H(i,n),N[0]&16&&a!==(a=q[206].title+"")&&H(f,a),N[0]&16&&h!==(h=Ce(q[206].eventType)+"")&&H(p,h),q[206].targetType?E?E.p(q,N):(E=Kl(q),E.c(),E.m(e,w)):E&&(E.d(1),E=null),N[0]&16&&y!==(y=be(q[206].createdAt)+"")&&H(z,y)},d(q){q&&k(e),E&&E.d()}}}function Ps(l){let e,t=ee(l[13]),n=[];for(let i=0;i<t.length;i+=1)n[i]=Gl(_l(l,t,i));return{c(){for(let i=0;i<n.length;i+=1)n[i].c();e=ye()},m(i,s){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(i,s);g(i,e,s)},p(i,s){if(s[0]&8192){t=ee(i[13]);let o;for(o=0;o<t.length;o+=1){const a=_l(i,t,o);n[o]?n[o].p(a,s):(n[o]=Gl(a),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&k(e),ve(n,i)}}}function Vs(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Записей работы пока нет</p>',c(e,"class","empty-state svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function Gl(l){let e,t,n=l[190].summary+"",i,s,o,a=l[190].minutes+"",f,_,m=ke(l[190].createdAt)+"",h,p;return{c(){e=u("div"),t=u("div"),i=I(n),s=j(),o=u("div"),f=I(a),_=I(" мин · "),h=I(m),p=j(),c(t,"class","svelte-oqcj5z"),c(o,"class","wl-meta svelte-oqcj5z"),c(e,"class","worklog-entry svelte-oqcj5z")},m(v,w){g(v,e,w),r(e,t),r(t,i),r(e,s),r(e,o),r(o,f),r(o,_),r(o,h),r(e,p)},p(v,w){w[0]&8192&&n!==(n=v[190].summary+"")&&H(i,n),w[0]&8192&&a!==(a=v[190].minutes+"")&&H(f,a),w[0]&8192&&m!==(m=ke(v[190].createdAt)+"")&&H(h,m)},d(v){v&&k(e)}}}function Rs(l){let e,t=ee(l[12]),n=[];for(let i=0;i<t.length;i+=1)n[i]=Ul(pl(l,t,i));return{c(){for(let i=0;i<n.length;i+=1)n[i].c();e=ye()},m(i,s){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(i,s);g(i,e,s)},p(i,s){if(s[0]&4096|s[3]&24){t=ee(i[12]);let o;for(o=0;o<t.length;o+=1){const a=pl(i,t,o);n[o]?n[o].p(a,s):(n[o]=Ul(a),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&k(e),ve(n,i)}}}function Ks(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Действий пока нет</p>',c(e,"class","empty-state svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function Ul(l){let e,t,n,i=l[201].title+"",s,o,a,f=l[97](l[201].type)+"",_,m,h,p=l[201].data+"",v,w,b,y,z,M,E,q,N;function O(){return l[126](l[201])}function S(){return l[127](l[201])}return{c(){e=u("div"),t=u("div"),n=u("span"),s=I(i),o=j(),a=u("span"),_=I(f),m=j(),h=u("span"),v=I(p),w=j(),b=u("div"),y=u("button"),y.textContent="Запустить",z=j(),M=u("button"),M.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><polyline points="3 6 5 6 21 6" class="svelte-oqcj5z"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" class="svelte-oqcj5z"></path></svg>',E=j(),c(n,"class","action-title svelte-oqcj5z"),c(a,"class","action-type svelte-oqcj5z"),c(h,"class","action-data svelte-oqcj5z"),c(t,"class","action-info svelte-oqcj5z"),c(y,"class","btn btn-sm svelte-oqcj5z"),c(M,"class","btn btn-sm btn-danger svelte-oqcj5z"),c(b,"class","action-btns svelte-oqcj5z"),c(e,"class","action-card svelte-oqcj5z")},m(T,C){g(T,e,C),r(e,t),r(t,n),r(n,s),r(t,o),r(t,a),r(a,_),r(t,m),r(t,h),r(h,v),r(e,w),r(e,b),r(b,y),r(b,z),r(b,M),r(e,E),q||(N=[A(y,"click",O),A(M,"click",S)],q=!0)},p(T,C){l=T,C[0]&4096&&i!==(i=l[201].title+"")&&H(s,i),C[0]&4096&&f!==(f=l[97](l[201].type)+"")&&H(_,f),C[0]&4096&&p!==(p=l[201].data+"")&&H(v,p)},d(T){T&&k(e),q=!1,ce(N)}}}function Jl(l){let e,t,n=l[39].items.length+"",i,s,o;return{c(){e=u("button"),t=I("Вставить "),i=I(n),c(e,"class","btn svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,t),r(e,i),s||(o=A(e,"click",l[64]),s=!0)},p(a,f){f[1]&256&&n!==(n=a[39].items.length+"")&&H(i,n)},d(a){a&&k(e),s=!1,o()}}}function Ws(l){let e,t,n,i,s,o,a;const f=[Js,Us],_=[];function m(w,b){return w[33].length>0?0:1}e=m(l),t=_[e]=f[e](l);const h=[Zs,Xs],p=[];function v(w,b){return w[34].length===0?0:1}return i=v(l),s=p[i]=h[i](l),{c(){t.c(),n=j(),s.c(),o=ye()},m(w,b){_[e].m(w,b),g(w,n,b),p[i].m(w,b),g(w,o,b),a=!0},p(w,b){let y=e;e=m(w),e===y?_[e].p(w,b):(ze(),ue(_[y],1,1,()=>{_[y]=null}),qe(),t=_[e],t?t.p(w,b):(t=_[e]=f[e](w),t.c()),re(t,1),t.m(n.parentNode,n));let z=i;i=v(w),i===z?p[i].p(w,b):(ze(),ue(p[z],1,1,()=>{p[z]=null}),qe(),s=p[i],s?s.p(w,b):(s=p[i]=h[i](w),s.c()),re(s,1),s.m(o.parentNode,o))},i(w){a||(re(t),re(s),a=!0)},o(w){ue(t),ue(s),a=!1},d(w){w&&(k(n),k(o)),_[e].d(w),p[i].d(w)}}}function Gs(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Загрузка...</p>',c(e,"class","empty-state svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,i:G,o:G,d(t){t&&k(e)}}}function Us(l){let e,t;return e=new Dn({props:{crumbs:[{name:"Файлы"}]}}),{c(){Ie(e.$$.fragment)},m(n,i){Me(e,n,i),t=!0},p:G,i(n){t||(re(e.$$.fragment,n),t=!0)},o(n){ue(e.$$.fragment,n),t=!1},d(n){Le(e,n)}}}function Js(l){let e,t,n,i,s,o;return e=new Dn({props:{crumbs:[{name:"Файлы"},...l[33]]}}),e.$on("navigate",l[112]),{c(){Ie(e.$$.fragment),t=j(),n=u("button"),n.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><line x1="19" y1="12" x2="5" y2="12" class="svelte-oqcj5z"></line><polyline points="12 19 5 12 12 5" class="svelte-oqcj5z"></polyline></svg>
Back`,c(n,"class","btn btn-sm back-btn svelte-oqcj5z")},m(a,f){Me(e,a,f),g(a,t,f),g(a,n,f),i=!0,s||(o=A(n,"click",l[55]),s=!0)},p(a,f){const _={};f[1]&4&&(_.crumbs=[{name:"Файлы"},...a[33]]),e.$set(_)},i(a){i||(re(e.$$.fragment,a),i=!0)},o(a){ue(e.$$.fragment,a),i=!1},d(a){a&&(k(t),k(n)),Le(e,a),s=!1,o()}}}function Xs(l){let e,t=[],n=new Map,i,s=ee(l[34]);const o=a=>a[198].id;for(let a=0;a<s.length;a+=1){let f=ml(l,s,a),_=o(f);n.set(_,t[a]=Xl(_,f))}return{c(){e=u("div");for(let a=0;a<t.length;a+=1)t[a].c();c(e,"class","file-list svelte-oqcj5z")},m(a,f){g(a,e,f);for(let _=0;_<t.length;_+=1)t[_]&&t[_].m(e,null);i=!0},p(a,f){f[1]&1686110728|f[2]&536871419&&(s=ee(a[34]),ze(),t=ko(t,f,o,1,a,s,n,e,bo,Xl,null,ml),qe())},i(a){if(!i){for(let f=0;f<s.length;f+=1)re(t[f]);i=!0}},o(a){for(let f=0;f<t.length;f+=1)ue(t[f]);i=!1},d(a){a&&k(e);for(let f=0;f<t.length;f+=1)t[f].d()}}}function Zs(l){let e,t,n,i,s=l[33].length>0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов",o,a,f,_,m,h,p,v,w,b;return{c(){e=u("div"),t=u("div"),t.innerHTML='<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="svelte-oqcj5z"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" class="svelte-oqcj5z"></path><polyline points="14 2 14 8 20 8" class="svelte-oqcj5z"></polyline></svg>',n=j(),i=u("p"),o=I(s),a=j(),f=u("p"),f.textContent="Добавьте файл или папку, чтобы сохранить материалы проекта.",_=j(),m=u("div"),h=u("button"),h.textContent="Добавить файл",p=j(),v=u("button"),v.textContent="Добавить папку",c(t,"class","empty-icon svelte-oqcj5z"),c(i,"class","svelte-oqcj5z"),c(f,"class","hint svelte-oqcj5z"),c(h,"class","btn btn-primary svelte-oqcj5z"),c(v,"class","btn svelte-oqcj5z"),c(m,"class","empty-actions svelte-oqcj5z"),c(e,"class","empty-state svelte-oqcj5z")},m(y,z){g(y,e,z),r(e,t),r(e,n),r(e,i),r(i,o),r(e,a),r(e,f),r(e,_),r(e,m),r(m,h),r(m,p),r(m,v),w||(b=[A(h,"click",l[87]),A(v,"click",l[88])],w=!0)},p(y,z){z[1]&4&&s!==(s=y[33].length>0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов")&&H(o,s)},i:G,o:G,d(y){y&&k(e),w=!1,ce(b)}}}function Xl(l,e){let t,n,i;return n=new Zo({props:{item:e[198],selected:e[40].includes(e[198].id),onDragStart:e[68],onDragOver:e[69],onDrop:e[70]}}),n.$on("navigate",e[113]),n.$on("preview",e[114]),n.$on("openExternal",e[115]),n.$on("showInFolder",e[116]),n.$on("delete",e[117]),n.$on("rename",e[118]),n.$on("duplicate",e[119]),n.$on("cut",e[120]),n.$on("copy",e[121]),n.$on("selectOne",e[122]),n.$on("toggleSelect",e[123]),n.$on("rangeSelect",e[124]),{key:l,first:null,c(){t=ye(),Ie(n.$$.fragment),this.first=t},m(s,o){g(s,t,o),Me(n,s,o),i=!0},p(s,o){e=s;const a={};o[1]&8&&(a.item=e[198]),o[1]&520&&(a.selected=e[40].includes(e[198].id)),n.$set(a)},i(s){i||(re(n.$$.fragment,s),i=!0)},o(s){ue(n.$$.fragment,s),i=!1},d(s){s&&k(t),Le(n,s)}}}function Zl(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Сканирование...</p>',c(e,"class","empty-state svelte-oqcj5z")},m(t,n){g(t,e,n)},d(t){t&&k(e)}}}function Yl(l){let e,t;return e=new us({props:{item:l[35],content:l[36],loading:l[37],error:l[38]}}),e.$on("close",l[58]),e.$on("openExternal",l[125]),{c(){Ie(e.$$.fragment)},m(n,i){Me(e,n,i),t=!0},p(n,i){const s={};i[1]&16&&(s.item=n[35]),i[1]&32&&(s.content=n[36]),i[1]&64&&(s.loading=n[37]),i[1]&128&&(s.error=n[38]),e.$set(s)},i(n){t||(re(e.$$.fragment,n),t=!0)},o(n){ue(e.$$.fragment,n),t=!1},d(n){Le(e,n)}}}function Ql(l){let e,t,n,i,s,o,a,f,_;return{c(){e=u("div"),t=u("input"),n=j(),i=u("div"),s=u("button"),s.textContent="Создать",o=j(),a=u("button"),a.textContent="Отмена",c(t,"type","text"),c(t,"placeholder","Название заметки"),c(t,"class","svelte-oqcj5z"),c(s,"class","btn btn-primary svelte-oqcj5z"),c(a,"class","btn svelte-oqcj5z"),c(i,"class","form-actions svelte-oqcj5z"),c(e,"class","create-form svelte-oqcj5z")},m(m,h){g(m,e,h),r(e,t),de(t,l[22]),r(e,n),r(e,i),r(i,s),r(i,o),r(i,a),f||(_=[A(t,"input",l[109]),A(t,"keydown",l[110]),A(s,"click",l[81]),A(a,"click",l[80])],f=!0)},p(m,h){h[0]&4194304&&t.value!==m[22]&&de(t,m[22])},d(m){m&&k(e),f=!1,ce(_)}}}function Ys(l){let e,t=ee(l[10]),n=[];for(let i=0;i<t.length;i+=1)n[i]=xl(vl(l,t,i));return{c(){e=u("div");for(let i=0;i<n.length;i+=1)n[i].c();c(e,"class","notes-list svelte-oqcj5z")},m(i,s){g(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s[0]&1024|s[2]&1048576){t=ee(i[10]);let o;for(o=0;o<t.length;o+=1){const a=vl(i,t,o);n[o]?n[o].p(a,s):(n[o]=xl(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&k(e),ve(n,i)}}}function Qs(l){let e;return{c(){e=u("div"),e.innerHTML='<p class="svelte-oqcj5z">Нет заметок</p><p class="hint svelte-oqcj5z">Создайте первую заметку для этого дела.</p>',c(e,"class","empty-state svelte-oqcj5z")},m(t,n){g(t,e,n)},p:G,d(t){t&&k(e)}}}function xl(l){let e,t,n=l[193].title+"",i,s,o,a=ke(l[193].createdAt)+"",f,_,m,h;function p(){return l[111](l[193])}return{c(){e=u("div"),t=u("div"),i=I(n),s=j(),o=u("div"),f=I(a),_=j(),c(t,"class","note-card-title svelte-oqcj5z"),c(o,"class","note-card-date svelte-oqcj5z"),c(e,"class","note-card svelte-oqcj5z")},m(v,w){g(v,e,w),r(e,t),r(t,i),r(e,s),r(e,o),r(o,f),r(e,_),m||(h=A(e,"click",p),m=!0)},p(v,w){l=v,w[0]&1024&&n!==(n=l[193].title+"")&&H(i,n),w[0]&1024&&a!==(a=ke(l[193].createdAt)+"")&&H(f,a)},d(v){v&&k(e),m=!1,h()}}}function $l(l){let e,t,n,i=ee(l[10].slice(0,5)),s=[];for(let o=0;o<i.length;o+=1)s[o]=en(bl(l,i,o));return{c(){e=u("div"),t=u("h3"),t.textContent="Последние заметки",n=j();for(let o=0;o<s.length;o+=1)s[o].c();c(t,"class","svelte-oqcj5z"),c(e,"class","recent-section svelte-oqcj5z")},m(o,a){g(o,e,a),r(e,t),r(e,n);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(e,null)},p(o,a){if(a[0]&1024|a[2]&1048576){i=ee(o[10].slice(0,5));let f;for(f=0;f<i.length;f+=1){const _=bl(o,i,f);s[f]?s[f].p(_,a):(s[f]=en(_),s[f].c(),s[f].m(e,null))}for(;f<s.length;f+=1)s[f].d(1);s.length=i.length}},d(o){o&&k(e),ve(s,o)}}}function en(l){let e,t,n=l[193].title+"",i,s,o=ke(l[193].createdAt)+"",a,f,_,m;function h(){return l[108](l[193])}return{c(){e=u("div"),t=u("span"),i=I(n),s=u("span"),a=I(o),f=j(),c(t,"class","svelte-oqcj5z"),c(s,"class","recent-date svelte-oqcj5z"),c(e,"class","recent-note svelte-oqcj5z")},m(p,v){g(p,e,v),r(e,t),r(t,i),r(e,s),r(s,a),r(e,f),_||(m=A(e,"click",h),_=!0)},p(p,v){l=p,v[0]&1024&&n!==(n=l[193].title+"")&&H(i,n),v[0]&1024&&o!==(o=ke(l[193].createdAt)+"")&&H(a,o)},d(p){p&&k(e),_=!1,m()}}}function tn(l){let e,t,n,i=ee(l[13].slice(0,3)),s=[];for(let o=0;o<i.length;o+=1)s[o]=ln(hl(l,i,o));return{c(){e=u("div"),t=u("h3"),t.textContent="Последние записи",n=j();for(let o=0;o<s.length;o+=1)s[o].c();c(t,"class","svelte-oqcj5z"),c(e,"class","recent-section svelte-oqcj5z")},m(o,a){g(o,e,a),r(e,t),r(e,n);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(e,null)},p(o,a){if(a[0]&8192){i=ee(o[13].slice(0,3));let f;for(f=0;f<i.length;f+=1){const _=hl(o,i,f);s[f]?s[f].p(_,a):(s[f]=ln(_),s[f].c(),s[f].m(e,null))}for(;f<s.length;f+=1)s[f].d(1);s.length=i.length}},d(o){o&&k(e),ve(s,o)}}}function ln(l){let e,t=l[190].summary+"",n,i,s=l[190].minutes+"",o,a;return{c(){e=u("div"),n=I(t),i=I(" ("),o=I(s),a=I(" мин)"),c(e,"class","recent-entry svelte-oqcj5z")},m(f,_){g(f,e,_),r(e,n),r(e,i),r(e,o),r(e,a)},p(f,_){_[0]&8192&&t!==(t=f[190].summary+"")&&H(n,t),_[0]&8192&&s!==(s=f[190].minutes+"")&&H(o,s)},d(f){f&&k(e)}}}function nn(l){let e;return{c(){e=u("span"),e.textContent="●",c(e,"class","dirty-mark svelte-oqcj5z")},m(t,n){g(t,e,n)},d(t){t&&k(e)}}}function on(l){let e,t,n;return{c(){e=u("div"),e.textContent="+",c(e,"class","fab svelte-oqcj5z"),c(e,"title","Добавить дело")},m(i,s){g(i,e,s),t||(n=A(e,"click",l[76]),t=!0)},p:G,d(i){i&&k(e),t=!1,n()}}}function sn(l){let e,t,n,i,s,o,a,f,_,m,h,p,v,w,b,y,z,M,E,q,N,O=ee(l[0].filter(bn)),S=[];for(let C=0;C<O.length;C+=1)S[C]=cn(cl(l,O,C));let T=l[20].length>0&&rn(l);return{c(){e=u("div"),t=u("div"),n=u("h3"),n.textContent="Новое дело",i=j(),s=u("div"),o=u("label"),o.textContent="Название",a=j(),f=u("input"),_=j(),m=u("div"),h=u("label"),h.textContent="Раздел",p=j(),v=u("select");for(let C=0;C<S.length;C+=1)S[C].c();w=j(),T&&T.c(),b=j(),y=u("div"),z=u("button"),z.textContent="Создать",M=j(),E=u("button"),E.textContent="Отмена",c(n,"class","svelte-oqcj5z"),c(o,"class","svelte-oqcj5z"),c(f,"type","text"),c(f,"placeholder","Название дела"),f.autofocus=!0,c(f,"class","svelte-oqcj5z"),c(s,"class","form-group svelte-oqcj5z"),c(h,"class","svelte-oqcj5z"),c(v,"class","svelte-oqcj5z"),l[18]===void 0&&Oe(()=>l[140].call(v)),c(m,"class","form-group svelte-oqcj5z"),c(z,"class","btn btn-primary svelte-oqcj5z"),c(E,"class","btn svelte-oqcj5z"),c(y,"class","modal-actions svelte-oqcj5z"),c(t,"class","modal svelte-oqcj5z"),c(e,"class","modal-overlay svelte-oqcj5z")},m(C,D){g(C,e,D),r(e,t),r(t,n),r(t,i),r(t,s),r(s,o),r(s,a),r(s,f),de(f,l[17]),r(t,_),r(t,m),r(m,h),r(m,p),r(m,v);for(let R=0;R<S.length;R+=1)S[R]&&S[R].m(v,null);Be(v,l[18],!0),r(t,w),T&&T.m(t,null),r(t,b),r(t,y),r(y,z),r(y,M),r(y,E),f.focus(),q||(N=[A(f,"input",l[138]),A(f,"keydown",l[139]),A(v,"change",l[140]),A(z,"click",l[78]),A(E,"click",l[77]),A(e,"click",Re(l[77]))],q=!0)},p(C,D){if(D[0]&131072&&f.value!==C[17]&&de(f,C[17]),D[0]&1){O=ee(C[0].filter(bn));let R;for(R=0;R<O.length;R+=1){const X=cl(C,O,R);S[R]?S[R].p(X,D):(S[R]=cn(X),S[R].c(),S[R].m(v,null))}for(;R<S.length;R+=1)S[R].d(1);S.length=O.length}D[0]&262145&&Be(v,C[18]),C[20].length>0?T?T.p(C,D):(T=rn(C),T.c(),T.m(t,b)):T&&(T.d(1),T=null)},d(C){C&&k(e),ve(S,C),T&&T.d(),q=!1,ce(N)}}}function cn(l){let e,t=l[187].label+"",n,i;return{c(){e=u("option"),n=I(t),e.__value=i=l[187].id,de(e,e.__value),c(e,"class","svelte-oqcj5z")},m(s,o){g(s,e,o),r(e,n)},p(s,o){o[0]&1&&t!==(t=s[187].label+"")&&H(n,t),o[0]&1&&i!==(i=s[187].id)&&(e.__value=i,de(e,e.__value))},d(s){s&&k(e)}}}function rn(l){let e,t,n,i,s,o,a,f=ee(l[20]),_=[];for(let m=0;m<f.length;m+=1)_[m]=an(sl(l,f,m));return{c(){e=u("div"),t=u("label"),t.textContent="Шаблон (опционально)",n=j(),i=u("select"),s=u("option"),s.textContent="Без шаблона";for(let m=0;m<_.length;m+=1)_[m].c();c(t,"class","svelte-oqcj5z"),s.__value="",de(s,s.__value),c(s,"class","svelte-oqcj5z"),c(i,"class","svelte-oqcj5z"),l[19]===void 0&&Oe(()=>l[141].call(i)),c(e,"class","form-group svelte-oqcj5z")},m(m,h){g(m,e,h),r(e,t),r(e,n),r(e,i),r(i,s);for(let p=0;p<_.length;p+=1)_[p]&&_[p].m(i,null);Be(i,l[19],!0),o||(a=A(i,"change",l[141]),o=!0)},p(m,h){if(h[0]&1048576){f=ee(m[20]);let p;for(p=0;p<f.length;p+=1){const v=sl(m,f,p);_[p]?_[p].p(v,h):(_[p]=an(v),_[p].c(),_[p].m(i,null))}for(;p<_.length;p+=1)_[p].d(1);_.length=f.length}h[0]&1572864&&Be(i,m[19])},d(m){m&&k(e),ve(_,m),o=!1,a()}}}function an(l){let e,t=l[184].name+"",n,i=l[184].description?" — "+l[184].description:"",s,o;return{c(){e=u("option"),n=I(t),s=I(i),e.__value=o=l[184].name,de(e,e.__value),c(e,"class","svelte-oqcj5z")},m(a,f){g(a,e,f),r(e,n),r(e,s)},p(a,f){f[0]&1048576&&t!==(t=a[184].name+"")&&H(n,t),f[0]&1048576&&i!==(i=a[184].description?" — "+a[184].description:"")&&H(s,i),f[0]&1048576&&o!==(o=a[184].name)&&(e.__value=o,de(e,e.__value))},d(a){a&&k(e)}}}function fn(l){let e,t,n,i,s,o,a,f,_,m,h,p,v,w,b,y,z=l[25]==="open_url"?"URL":l[25]==="open_folder"||l[25]==="open_file"?"Путь":"Команда",M,E,q,N,O,S,T,C,D,R,X,x=ee(l[49]),B=[];for(let P=0;P<x.length;P+=1)B[P]=un(ol(l,x,P));return{c(){e=u("div"),t=u("div"),n=u("h3"),n.textContent="Новое действие",i=j(),s=u("div"),o=u("label"),o.textContent="Название",a=j(),f=u("input"),_=j(),m=u("div"),h=u("label"),h.textContent="Тип",p=j(),v=u("select");for(let P=0;P<B.length;P+=1)B[P].c();w=j(),b=u("div"),y=u("label"),M=I(z),E=j(),q=u("input"),O=j(),S=u("div"),T=u("button"),T.textContent="Создать",C=j(),D=u("button"),D.textContent="Отмена",c(n,"class","svelte-oqcj5z"),c(o,"class","svelte-oqcj5z"),c(f,"type","text"),c(f,"placeholder","Например: Открыть сайт"),f.autofocus=!0,c(f,"class","svelte-oqcj5z"),c(s,"class","form-group svelte-oqcj5z"),c(h,"class","svelte-oqcj5z"),c(v,"class","svelte-oqcj5z"),l[25]===void 0&&Oe(()=>l[144].call(v)),c(m,"class","form-group svelte-oqcj5z"),c(y,"class","svelte-oqcj5z"),c(q,"type","text"),c(q,"placeholder",N=l[25]==="open_url"?"https://example.com":l[25]==="open_folder"||l[25]==="open_file"?"/path/to/file":"команда"),c(q,"class","svelte-oqcj5z"),c(b,"class","form-group svelte-oqcj5z"),c(T,"class","btn btn-primary svelte-oqcj5z"),c(D,"class","btn svelte-oqcj5z"),c(S,"class","modal-actions svelte-oqcj5z"),c(t,"class","modal svelte-oqcj5z"),c(e,"class","modal-overlay svelte-oqcj5z")},m(P,F){g(P,e,F),r(e,t),r(t,n),r(t,i),r(t,s),r(s,o),r(s,a),r(s,f),de(f,l[24]),r(t,_),r(t,m),r(m,h),r(m,p),r(m,v);for(let U=0;U<B.length;U+=1)B[U]&&B[U].m(v,null);Be(v,l[25],!0),r(t,w),r(t,b),r(b,y),r(y,M),r(b,E),r(b,q),de(q,l[26]),r(t,O),r(t,S),r(S,T),r(S,C),r(S,D),f.focus(),R||(X=[A(f,"input",l[142]),A(f,"keydown",l[143]),A(v,"change",l[144]),A(q,"input",l[145]),A(q,"keydown",l[146]),A(T,"click",l[95]),A(D,"click",l[94]),A(e,"click",Re(l[94]))],R=!0)},p(P,F){if(F[0]&16777216&&f.value!==P[24]&&de(f,P[24]),F[1]&262144){x=ee(P[49]);let U;for(U=0;U<x.length;U+=1){const $=ol(P,x,U);B[U]?B[U].p($,F):(B[U]=un($),B[U].c(),B[U].m(v,null))}for(;U<B.length;U+=1)B[U].d(1);B.length=x.length}F[0]&33554432|F[1]&262144&&Be(v,P[25]),F[0]&33554432&&z!==(z=P[25]==="open_url"?"URL":P[25]==="open_folder"||P[25]==="open_file"?"Путь":"Команда")&&H(M,z),F[0]&33554432|F[1]&262144&&N!==(N=P[25]==="open_url"?"https://example.com":P[25]==="open_folder"||P[25]==="open_file"?"/path/to/file":"команда")&&c(q,"placeholder",N),F[0]&67108864&&q.value!==P[26]&&de(q,P[26])},d(P){P&&k(e),ve(B,P),R=!1,ce(X)}}}function un(l){let e,t=l[181].label+"",n;return{c(){e=u("option"),n=I(t),e.__value=l[181].id,de(e,e.__value),c(e,"class","svelte-oqcj5z")},m(i,s){g(i,e,s),r(e,n)},p:G,d(i){i&&k(e)}}}function dn(l){let e,t,n,i,s=(l[8]?l[8].title:"")+"",o,a,f,_,m,h,p,v=l[29].files+"",w,b,y,z,M,E=l[29].folders+"",q,N,O,S,T,C=(l[29].totalBytes/1024).toFixed(1)+"",D,R,X,x,B,P,F,U,$,K,oe,ie,te=l[29].isDangerous&&_n(l);return{c(){e=u("div"),t=u("div"),n=u("h3"),i=I("Добавить в «"),o=I(s),a=I("»"),f=j(),_=u("div"),m=u("div"),h=u("span"),h.textContent="Файлов:",p=u("span"),w=I(v),b=j(),y=u("div"),z=u("span"),z.textContent="Папок:",M=u("span"),q=I(E),N=j(),O=u("div"),S=u("span"),S.textContent="Размер:",T=u("span"),D=I(C),R=I(" KB"),X=j(),te&&te.c(),x=j(),B=u("div"),P=u("button"),P.textContent="Скопировать",F=j(),U=u("button"),U.textContent="Привязать",$=j(),K=u("button"),K.textContent="Отмена",c(n,"class","svelte-oqcj5z"),c(h,"class","svelte-oqcj5z"),c(p,"class","svelte-oqcj5z"),c(m,"class","summary-row svelte-oqcj5z"),c(z,"class","svelte-oqcj5z"),c(M,"class","svelte-oqcj5z"),c(y,"class","summary-row svelte-oqcj5z"),c(S,"class","svelte-oqcj5z"),c(T,"class","svelte-oqcj5z"),c(O,"class","summary-row svelte-oqcj5z"),c(_,"class","import-summary svelte-oqcj5z"),c(P,"class","btn btn-primary svelte-oqcj5z"),c(U,"class","btn svelte-oqcj5z"),c(K,"class","btn svelte-oqcj5z"),c(B,"class","modal-actions svelte-oqcj5z"),c(t,"class","modal svelte-oqcj5z"),c(e,"class","modal-overlay svelte-oqcj5z")},m(Z,J){g(Z,e,J),r(e,t),r(t,n),r(n,i),r(n,o),r(n,a),r(t,f),r(t,_),r(_,m),r(m,h),r(m,p),r(p,w),r(_,b),r(_,y),r(y,z),r(y,M),r(M,q),r(_,N),r(_,O),r(O,S),r(O,T),r(T,D),r(T,R),r(_,X),te&&te.m(_,null),r(t,x),r(t,B),r(B,P),r(B,F),r(B,U),r(B,$),r(B,K),oe||(ie=[A(P,"click",l[147]),A(U,"click",l[148]),A(K,"click",l[90]),A(e,"click",Re(l[90]))],oe=!0)},p(Z,J){J[0]&256&&s!==(s=(Z[8]?Z[8].title:"")+"")&&H(o,s),J[0]&536870912&&v!==(v=Z[29].files+"")&&H(w,v),J[0]&536870912&&E!==(E=Z[29].folders+"")&&H(q,E),J[0]&536870912&&C!==(C=(Z[29].totalBytes/1024).toFixed(1)+"")&&H(D,C),Z[29].isDangerous?te?te.p(Z,J):(te=_n(Z),te.c(),te.m(_,null)):te&&(te.d(1),te=null)},d(Z){Z&&k(e),te&&te.d(),oe=!1,ce(ie)}}}function _n(l){let e,t,n,i,s,o,a=l[29].dangerReason+"",f;return{c(){e=u("div"),t=W("svg"),n=W("path"),i=W("line"),s=W("line"),o=j(),f=I(a),c(n,"d","M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"),c(n,"class","svelte-oqcj5z"),c(i,"x1","12"),c(i,"y1","9"),c(i,"x2","12"),c(i,"y2","13"),c(i,"class","svelte-oqcj5z"),c(s,"x1","12"),c(s,"y1","17"),c(s,"x2","12.01"),c(s,"y2","17"),c(s,"class","svelte-oqcj5z"),c(t,"width","14"),c(t,"height","14"),c(t,"viewBox","0 0 24 24"),c(t,"fill","none"),c(t,"stroke","currentColor"),c(t,"stroke-width","2"),c(t,"stroke-linecap","round"),c(t,"stroke-linejoin","round"),c(t,"class","svelte-oqcj5z"),c(e,"class","summary-warn svelte-oqcj5z")},m(_,m){g(_,e,m),r(e,t),r(t,n),r(t,i),r(t,s),r(e,o),r(e,f)},p(_,m){m[0]&536870912&&a!==(a=_[29].dangerReason+"")&&H(f,a)},d(_){_&&k(e)}}}function pn(l){let e,t,n,i,s,o,a,f,_,m,h,p,v,w,b,y,z=l[48]&&mn(l);return{c(){e=u("div"),t=u("div"),n=u("h3"),n.textContent="Переименовать",i=j(),s=u("div"),o=u("label"),o.textContent="Новое имя",a=j(),f=u("input"),_=j(),z&&z.c(),m=j(),h=u("div"),p=u("button"),p.textContent="Переименовать",v=j(),w=u("button"),w.textContent="Отмена",c(n,"class","svelte-oqcj5z"),c(o,"class","svelte-oqcj5z"),c(f,"type","text"),c(f,"class","svelte-oqcj5z"),c(s,"class","form-group svelte-oqcj5z"),c(p,"class","btn btn-primary svelte-oqcj5z"),c(w,"class","btn svelte-oqcj5z"),c(h,"class","modal-actions svelte-oqcj5z"),c(t,"class","modal svelte-oqcj5z"),c(e,"class","modal-overlay svelte-oqcj5z")},m(M,E){g(M,e,E),r(e,t),r(t,n),r(t,i),r(t,s),r(s,o),r(s,a),r(s,f),de(f,l[47]),r(t,_),z&&z.m(t,null),r(t,m),r(t,h),r(h,p),r(h,v),r(h,w),b||(y=[A(f,"input",l[149]),A(f,"keydown",l[73]),A(p,"click",l[71]),A(w,"click",l[72]),A(e,"click",Re(l[72]))],b=!0)},p(M,E){E[1]&65536&&f.value!==M[47]&&de(f,M[47]),M[48]?z?z.p(M,E):(z=mn(M),z.c(),z.m(t,m)):z&&(z.d(1),z=null)},d(M){M&&k(e),z&&z.d(),b=!1,ce(y)}}}function mn(l){let e,t;return{c(){e=u("div"),t=I(l[48]),c(e,"class","rename-error svelte-oqcj5z")},m(n,i){g(n,e,i),r(e,t)},p(n,i){i[1]&131072&&H(t,n[48])},d(n){n&&k(e)}}}function vn(l){let e,t;return e=new ps({props:{title:l[42],message:l[43],confirmText:l[45],danger:l[44]}}),e.$on("confirm",l[74]),e.$on("cancel",l[75]),{c(){Ie(e.$$.fragment)},m(n,i){Me(e,n,i),t=!0},p(n,i){const s={};i[1]&2048&&(s.title=n[42]),i[1]&4096&&(s.message=n[43]),i[1]&16384&&(s.confirmText=n[45]),i[1]&8192&&(s.danger=n[44]),e.$set(s)},i(n){t||(re(e.$$.fragment,n),t=!0)},o(n){ue(e.$$.fragment,n),t=!1},d(n){Le(e,n)}}}function xs(l){let e,t,n,i,s,o,a,f,_,m,h,p,v,w,b,y,z,M,E,q,N,O,S,T,C,D,R,X,x=ee(l[0]),B=[];for(let V=0;V<x.length;V+=1)B[V]=jl(wl(l,x,V));let P=l[7]&&l[7]!=="today"&&l[7]!=="inbox"&&l[7]!=="activity"&&zl(l);function F(V,fe){return V[8]?hs:V[7]?vs:ms}let U=F(l),$=U(l),K=l[6]&&Ll(l);const oe=[ws,ys,gs,ks,bs],ie=[];function te(V,fe){return V[11]?0:V[8]?1:V[7]==="today"&&V[2]?2:V[7]==="activity"?3:4}q=te(l),N=ie[q]=oe[q](l);let Z=!l[11]&&!l[8]&&l[7]!=="today"&&l[7]!=="inbox"&&l[7]!=="activity"&&on(l),J=l[16]&&sn(l),le=l[23]&&fn(l),ne=l[30]&&l[29]&&dn(l),_e=l[46]&&pn(l),ae=l[41]&&vn(l);return{c(){e=u("div"),t=u("aside"),n=u("div"),n.innerHTML='<span class="logo svelte-oqcj5z">⚒</span> <span class="brand-name svelte-oqcj5z">Верстак</span>',i=j(),s=u("nav"),o=u("div"),a=u("div"),a.textContent="Разделы",f=j();for(let V=0;V<B.length;V+=1)B[V].c();_=j(),P&&P.c(),m=j(),h=u("div"),p=u("span"),v=I(l[5]),w=j(),b=u("main"),y=u("header"),z=u("div"),$.c(),M=j(),K&&K.c(),E=j(),N.c(),O=j(),Z&&Z.c(),S=j(),J&&J.c(),T=j(),le&&le.c(),C=j(),ne&&ne.c(),D=j(),_e&&_e.c(),R=j(),ae&&ae.c(),c(n,"class","sidebar-brand svelte-oqcj5z"),c(a,"class","nav-label svelte-oqcj5z"),c(o,"class","nav-group svelte-oqcj5z"),c(s,"class","sidebar-nav svelte-oqcj5z"),c(p,"class","version svelte-oqcj5z"),c(h,"class","sidebar-footer svelte-oqcj5z"),c(t,"class","sidebar svelte-oqcj5z"),c(z,"class","header-left svelte-oqcj5z"),c(y,"class","header svelte-oqcj5z"),c(b,"class","main svelte-oqcj5z"),c(e,"class","app svelte-oqcj5z")},m(V,fe){g(V,e,fe),r(e,t),r(t,n),r(t,i),r(t,s),r(s,o),r(o,a),r(o,f);for(let pe=0;pe<B.length;pe+=1)B[pe]&&B[pe].m(o,null);r(s,_),P&&P.m(s,null),r(t,m),r(t,h),r(h,p),r(p,v),r(e,w),r(e,b),r(b,y),r(y,z),$.m(z,null),r(b,M),K&&K.m(b,null),r(b,E),ie[q].m(b,null),r(b,O),Z&&Z.m(b,null),r(b,S),J&&J.m(b,null),r(b,T),le&&le.m(b,null),r(b,C),ne&&ne.m(b,null),r(b,D),_e&&_e.m(b,null),r(b,R),ae&&ae.m(b,null),X=!0},p(V,fe){if(fe[0]&129|fe[1]&1048576){x=ee(V[0]);let Y;for(Y=0;Y<x.length;Y+=1){const we=wl(V,x,Y);B[Y]?B[Y].p(we,fe):(B[Y]=jl(we),B[Y].c(),B[Y].m(o,null))}for(;Y<B.length;Y+=1)B[Y].d(1);B.length=x.length}V[7]&&V[7]!=="today"&&V[7]!=="inbox"&&V[7]!=="activity"?P?P.p(V,fe):(P=zl(V),P.c(),P.m(s,null)):P&&(P.d(1),P=null),(!X||fe[0]&32)&&H(v,V[5]),U===(U=F(V))&&$?$.p(V,fe):($.d(1),$=U(V),$&&($.c(),$.m(z,null))),V[6]?K?K.p(V,fe):(K=Ll(V),K.c(),K.m(b,E)):K&&(K.d(1),K=null);let pe=q;q=te(V),q===pe?ie[q].p(V,fe):(ze(),ue(ie[pe],1,1,()=>{ie[pe]=null}),qe(),N=ie[q],N?N.p(V,fe):(N=ie[q]=oe[q](V),N.c()),re(N,1),N.m(b,O)),!V[11]&&!V[8]&&V[7]!=="today"&&V[7]!=="inbox"&&V[7]!=="activity"?Z?Z.p(V,fe):(Z=on(V),Z.c(),Z.m(b,S)):Z&&(Z.d(1),Z=null),V[16]?J?J.p(V,fe):(J=sn(V),J.c(),J.m(b,T)):J&&(J.d(1),J=null),V[23]?le?le.p(V,fe):(le=fn(V),le.c(),le.m(b,C)):le&&(le.d(1),le=null),V[30]&&V[29]?ne?ne.p(V,fe):(ne=dn(V),ne.c(),ne.m(b,D)):ne&&(ne.d(1),ne=null),V[46]?_e?_e.p(V,fe):(_e=pn(V),_e.c(),_e.m(b,R)):_e&&(_e.d(1),_e=null),V[41]?ae?(ae.p(V,fe),fe[1]&1024&&re(ae,1)):(ae=vn(V),ae.c(),re(ae,1),ae.m(b,null)):ae&&(ze(),ue(ae,1,1,()=>{ae=null}),qe())},i(V){X||(re(N),re(ae),X=!0)},o(V){ue(N),ue(ae),X=!1},d(V){V&&k(e),ve(B,V),P&&P.d(),$.d(),K&&K.d(),ie[q].d(),Z&&Z.d(),J&&J.d(),le&&le.d(),ne&&ne.d(),_e&&_e.d(),ae&&ae.d()}}}function Q(l,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[l];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails call error:",l,t)}return Promise.reject(new Error("Wails not connected: "+l))}function Ce(l){return{note_created:"Заметка создана",note_updated:"Заметка изменена",file_added:"Файл добавлен",file_deleted:"Файл удалён",file_renamed:"Файл переименован",file_copied:"Файл скопирован",file_moved:"Файл перемещён",folder_added:"Папка добавлена",folder_deleted:"Папка удалена",folder_renamed:"Папка переименована",node_created:"Дело создано",node_updated:"Дело изменено"}[l]||l}function Pe(l){return l==="note_created"||l==="file_added"||l==="folder_added"||l==="node_created"?"+":l==="file_deleted"||l==="folder_deleted"?"×":l==="file_renamed"||l==="folder_renamed"||l==="note_updated"||l==="node_updated"?"~":l==="file_copied"?"⧉":l==="file_moved"?"→":"•"}function be(l){if(!l)return"";try{return new Date(l).toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"})}catch{return""}}function ke(l){if(!l)return"";try{return new Date(l).toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}catch{return l}}function hn(l){return{project:"Проект",client:"Клиент",document:"Документ",recipe:"Рецепт",archive:"Архив",case:"Дело"}[l]||l||"Дело"}function Te(l,e,t,n){return l=Math.abs(l)%100,l>=5&&l<=20?n:(l%=10,l===1?e:l>=2&&l<=4?t:n)}const bn=l=>l.id!=="today"&&l.id!=="inbox"&&l.id!=="activity";function $s(l,e,t){let n=[],i=[],s=null,o=[],a=0,f=!0,_=[],m="",h="",p="",v=null,w="overview",b=[],y=null,z=[],M=[],E=[],q="",N="",O=!1,S="",T="clients",C="",D=[],R=!1,X="",x=!1,B="",P="open_url",F="",U=[{id:"open_url",label:"Открыть URL"},{id:"open_file",label:"Открыть файл"},{id:"open_folder",label:"Открыть папку"},{id:"run_command",label:"Запустить команду"},{id:"run_script",label:"Запустить скрипт"},{id:"open_terminal",label:"Открыть терминал"},{id:"launch_app",label:"Запустить приложение"}],$=!0,K=!1,oe=null,ie=!1,te="",Z=!1,J=null,le=[],ne=[],_e=null,ae="",V=!1,fe="",pe={items:[],mode:"copy"},Y=[],we=[],it=!1,jt="",zt="",qt=!1,Ct="Удалить",Xe=null,Ze=null,Ye=!1,Qe="",Ee="",Ae="";const In=[{id:"overview",label:"Обзор"},{id:"notes",label:"Заметки"},{id:"files",label:"Файлы"},{id:"actions",label:"Действия"},{id:"worklog",label:"Журнал"},{id:"activity",label:"Активность"}];let ot=null;wn(async()=>{try{t(5,m=await Q("VerstakVersion")||"verstak-gui/v2"),t(0,n=await Q("ListSections")||[])}catch(d){t(6,h=String(d)),t(0,n=[{id:"today",label:"Сегодня"},{id:"inbox",label:"Неразобранное"},{id:"activity",label:"Активность"},{id:"clients",label:"Клиенты"},{id:"projects",label:"Проекты"},{id:"recipes",label:"Рецепты"},{id:"documents",label:"Документы"},{id:"archive",label:"Архив"}])}window.runtime&&window.runtime.EventsOn&&(window.runtime.EventsOn("files-dropped",ni),ot=()=>window.runtime.EventsOff("files-dropped")),window.addEventListener("keydown",Bt),t(27,$=!1)}),jn(()=>{ot&&ot(),window.removeEventListener("keydown",Bt)});async function st(d){t(7,p=d),t(8,v=null),t(9,w="overview"),t(10,b=[]),z=[],t(12,M=[]),t(13,E=[]),t(16,O=!1),t(6,h=""),t(2,s=null),t(3,o=[]),a=0,f=!0,t(1,i=[]);try{d==="today"?t(2,s=await Q("ListTodayView")||{cases:[]}):d==="activity"?(t(3,o=await Q("ListActivityFeed",50,0)||[]),a=o.length,f=o.length===50):t(1,i=await Q("ListNodesBySection",d)||[])}catch(L){t(6,h=String(L)),t(1,i=[]),t(2,s={cases:[]}),t(3,o=[])}}async function ct(d){t(8,v=d),t(9,w="overview"),t(10,b=[]),z=[],t(12,M=[]),t(13,E=[]),t(34,ne=[]),t(33,le=[]),t(32,J=null),t(35,_e=null),t(36,ae=""),t(40,Y=[]),we=[],t(11,y=null),t(16,O=!1),t(21,R=!1),t(6,h=""),t(4,_=[]),await Tt(d.id)}async function Tt(d){try{t(10,b=await Q("ListNotes",d)||[])}catch{}try{z=await Q("ListFiles",d)||[]}catch{}try{t(12,M=await Q("ListActions",d)||[])}catch{}try{t(13,E=await Q("ListWorklog",d)||[])}catch{}try{t(4,_=await Q("ListActivityByNode",d,50,0)||[])}catch{}}async function he(d){t(31,Z=!0);try{let L=await Q("ListItems",d)||[];L.sort((se,me)=>se.type!==me.type?se.type==="folder"?-1:1:(se.name||"").localeCompare(me.name||"")),t(34,ne=L)}catch{t(34,ne=[])}t(31,Z=!1)}async function rt(d){if(v){try{const L=await Q("GetNodeDetail",d);L&&t(33,le=[...le,{id:d,name:L.title}])}catch{t(33,le=[...le,{id:d,name:"..."}])}t(32,J=d),await he(d)}}function Mt(){if(le.length<2)t(33,le=[]),t(32,J=null),he(v.id);else{const d=le[le.length-2];t(33,le=le.slice(0,-1)),t(32,J=d.id),he(d.id)}}function Lt(d){const L=le[d];t(33,le=le.slice(0,d+1)),t(32,J=L.id),he(L.id)}async function at(d){t(35,_e=d),t(36,ae=""),t(38,fe=""),t(37,V=!0);try{Vo(d)?t(36,ae=await Q("GetFileBase64",d.fileId)||""):Ro(d)&&t(36,ae=await Q("ReadFileText",d.fileId)||"")}catch(L){t(38,fe=String(L))}t(37,V=!1)}function ft(){t(35,_e=null),t(36,ae=""),t(38,fe="")}async function En(){const d=prompt("Введите имя файла:");if(!(!d||!d.trim()))try{const L=J||v.id;await Q("CreateEmptyFile",L,d.trim()),await he(L)}catch(L){t(6,h=String(L))}}async function St(d){try{await Q("DuplicateNode",d);const L=J||v.id;await he(L)}catch(L){t(6,h=String(L))}}function Dt(d){const L=ne.find(se=>se.id===d);L&&Pt(L.id,L.name)}function It(d){t(39,pe={items:[d],mode:"cut"})}function Et(d){t(39,pe={items:[d],mode:"copy"})}async function At(){if(pe.items.length===0)return;const d=J||v.id;try{if(pe.mode==="copy")for(const L of pe.items)await Q("DuplicateNode",L);else for(const L of pe.items)await Q("MoveNode",L,d);t(39,pe={items:[],mode:"copy"}),await he(d)}catch(L){t(6,h=String(L))}}function Nt(d){Y.includes(d)?t(40,Y=Y.filter(L=>L!==d)):t(40,Y=[...Y,d])}function Ft(d){t(40,Y=[d])}function An(){t(40,Y=ne.map(d=>d.id))}function Ht(d){if(ne.length===0)return;const L=Y.length>0?Y[Y.length-1]:ne[0].id,se=ne.findIndex(Se=>Se.id===L),me=ne.findIndex(Se=>Se.id===d);if(se===-1||me===-1)return;const Ge=Math.min(se,me),vt=Math.max(se,me),oo=ne.slice(Ge,vt+1).map(Se=>Se.id),Yt=new Set(Y);oo.forEach(Se=>Yt.add(Se)),t(40,Y=[...Yt])}function Nn(){t(40,Y=[])}function ut(d){return d.length>0?d:ne.map(L=>L.id)}async function Fn(){var se;const d=ut(Y),L=d.length===1&&((se=ne.find(me=>me.id===d[0]))==null?void 0:se.type)==="folder"?"папку":`файлов (${d.length})`;xe({title:"Удаление",message:`Удалить ${L}?`,confirmText:"Удалить",danger:!0,onConfirm:async()=>{for(const Ge of d)try{await Q("DeleteFileOrFolder",Ge)}catch(vt){t(6,h=String(vt))}t(40,Y=[]);const me=J||v.id;await he(me)}})}function Hn(){const d=ut(Y);t(39,pe={items:d,mode:"cut"}),t(40,Y=[])}function Bn(){const d=ut(Y);t(39,pe={items:d,mode:"copy"}),t(40,Y=[])}function On(d,L){const se=Y.includes(L)?Y:[L];we=se,d.dataTransfer.effectAllowed="move",d.dataTransfer.setData("text/plain",se.join(","))}function Pn(d,L){const se=ne.find(me=>me.id===L);se&&se.type==="folder"&&(d.preventDefault(),d.dataTransfer.dropEffect="move")}async function Vn(d,L){if(d.preventDefault(),we.length!==0){for(const se of we)try{await Q("MoveNode",se,L)}catch(me){t(6,h=String(me))}we=[],t(40,Y=[]),await he(J||v.id)}}function Bt(d){if(w==="files"&&!(d.target.tagName==="INPUT"||d.target.tagName==="TEXTAREA"))if(d.ctrlKey||d.metaKey)d.key==="c"||d.key==="C"?(d.preventDefault(),Bn()):d.key==="x"||d.key==="X"?(d.preventDefault(),Hn()):d.key==="v"||d.key==="V"?(d.preventDefault(),At()):d.key==="a"||d.key==="A"?(d.preventDefault(),An()):d.key==="o"||d.key==="O"?(d.preventDefault(),Rn()):d.key==="Enter"&&(d.preventDefault(),Ot());else if(d.key==="Enter")d.preventDefault(),Ot();else if(d.key==="Delete"||d.key==="Backspace"){if(_e){d.preventDefault(),ft();return}if(Y.length>0){d.preventDefault(),Fn();return}if(d.key==="Backspace"&&le.length>0){d.preventDefault(),Mt();return}}else if(d.key==="Escape"){if(_e){ft();return}if(Y.length>0){Nn();return}}else d.key==="F2"&&(d.preventDefault(),Kn())}function Ot(){if(Y.length===1){const d=ne.find(L=>L.id===Y[0]);d&&(d.type==="folder"?rt(d.id):at(d))}}function Rn(){if(Y.length===1){const d=ne.find(L=>L.id===Y[0]);d&&d.fileId&&Q("OpenFile",d.fileId)}}function Pt(d,L){Qe=d,t(47,Ee=L),t(48,Ae=""),t(46,Ye=!0)}function Kn(){if(Y.length===1){const d=ne.find(L=>L.id===Y[0]);d&&Pt(d.id,d.name)}}async function Vt(){const d=Ee.trim();if(!d){t(48,Ae="Имя не может быть пустым");return}try{await Q("ValidateName",d)}catch{t(48,Ae="Недопустимое имя");return}t(46,Ye=!1),Qe="";try{await Q("RenameNode",Qe,d);const L=J||v.id;await he(L)}catch(L){t(6,h=String(L))}}function Wn(){t(46,Ye=!1),Qe="",t(47,Ee=""),t(48,Ae="")}function Gn(d){d.key==="Enter"?Vt():t(48,Ae="")}function xe(d){t(42,jt=d.title||"Подтверждение"),t(43,zt=d.message||""),t(44,qt=d.danger!==void 0?d.danger:!0),t(45,Ct=d.confirmText||"Удалить"),Xe=d.onConfirm||null,Ze=d.onCancel||null,t(41,it=!0)}function Rt(){t(41,it=!1),Xe=null,Ze=null}function Un(){Xe&&Xe(),Rt()}function Jn(){Ze&&Ze(),Rt()}function Xn(){t(16,O=!0),t(17,S=""),t(18,T=p||"clients"),t(19,C=""),Q("ListTemplates").then(d=>{t(20,D=d||[])}).catch(()=>{t(20,D=[])})}function Zn(){t(16,O=!1),t(17,S="")}async function Kt(){if(S.trim())try{let d;C?d=await Q("FromTemplate","","case",S.trim(),T,C):d=await Q("CreateNode","","case",S.trim(),T),t(16,O=!1),t(17,S=""),t(19,C=""),await st(T)}catch(d){t(6,h=String(d))}}function Wt(){t(21,R=!0),t(22,X="")}function Yn(){t(21,R=!1),t(22,X="")}async function Gt(){if(!(!X.trim()||!v))try{const d=await Q("CreateNote",v.id,X.trim());t(10,b=[...b,d&&d.id?d:{id:Date.now().toString(),title:X.trim(),createdAt:new Date().toISOString()}]),t(21,R=!1),t(22,X="")}catch{const L={id:Date.now().toString(),title:X.trim(),createdAt:new Date().toISOString()};t(10,b=[...b,L]),t(21,R=!1),t(22,X="")}}async function dt(d){if(y&&y.dirty){xe({title:"Несохранённые изменения",message:"Закрыть редактор? Все несохранённые изменения будут потеряны.",confirmText:"Закрыть",danger:!1,onConfirm:async()=>{await Ut(d)}});return}await Ut(d)}async function Ut(d){try{const L=await Q("ReadNote",d.id);t(11,y={id:d.id,title:d.title,content:L||"",dirty:!1})}catch{t(11,y={id:d.id,title:d.title,content:"# "+d.title+`
`,dirty:!1})}}function Qn(){if(y&&y.dirty){xe({title:"Несохранённые изменения",message:"Закрыть редактор? Все несохранённые изменения будут потеряны.",confirmText:"Закрыть",danger:!1,onConfirm:()=>{t(11,y=null)}});return}t(11,y=null)}function xn(d){y&&(t(11,y.content=d.target.value,y),t(11,y.dirty=!0,y))}async function $n(){if(y)try{await Q("SaveNote",y.id,y.content),t(11,y.dirty=!1,y)}catch{t(11,y.dirty=!1,y)}}async function ei(){const d=parseInt(q,10);if(!(!N.trim()||isNaN(d)||d<=0||!v)){try{const L=await Q("CreateWorklog",v.id,N.trim(),d);t(13,E=[...E,L&&L.id?L:{id:Date.now().toString(),nodeId:v.id,summary:N.trim(),minutes:d,createdAt:new Date().toISOString()}])}catch{t(13,E=[...E,{id:Date.now().toString(),nodeId:v.id,summary:N.trim(),minutes:d,createdAt:new Date().toISOString()}])}t(15,N=""),t(14,q="")}}async function Jt(){const d=await Q("PickFile");d&&await _t(v.id,d)}async function ti(){const d=await Q("PickDirectory");d&&await _t(v.id,d)}async function _t(d,L){t(28,K=!0);try{const se=await Q("PreviewImport",L);t(29,oe=se),te=L,t(30,ie=!0)}catch(se){t(6,h=String(se))}t(28,K=!1)}async function pt(d){try{const L=d==="copy"?await Q("AddPathCopy",v.id,te):await Q("AddPathLink",v.id,te);t(30,ie=!1),t(29,oe=null),t(33,le=[]),t(32,J=null),await Promise.all([Tt(v.id),he(v.id)])}catch(L){t(6,h=String(L))}}function li(){t(30,ie=!1),t(29,oe=null)}async function Xt({id:d,type:L}){xe({title:"Удаление",message:`Удалить ${L==="folder"?"папку":"файл"}?`,confirmText:"Удалить",danger:!0,onConfirm:async()=>{try{await Q("DeleteFileOrFolder",d),z=z.filter(Ge=>Ge.nodeId!==d);const me=J||v.id;await he(me)}catch(me){t(6,h=String(me))}}})}async function ni(d){if(!d||d.length===0)return;if(!v){t(6,h="Сначала выберите дело для добавления файлов");return}const L=d[0];await _t(v.id,L)}function ii(d){return w===d?"tab active":"tab"}function oi(){t(23,x=!0),t(24,B=""),t(25,P="open_url"),t(26,F="")}function si(){t(23,x=!1),t(24,B=""),t(26,F="")}async function mt(){if(!(!B.trim()||!F.trim()||!v))try{const d=await Q("CreateAction",v.id,P,B.trim(),F.trim());d&&d.id&&t(12,M=[...M,d]),t(23,x=!1),t(24,B=""),t(26,F="")}catch(d){t(6,h=String(d))}}async function Zt(d){try{await Q("DeleteAction",d),t(12,M=M.filter(L=>L.id!==d))}catch(L){t(6,h=String(L))}}function ci(d){const L=U.find(se=>se.id===d);return L?L.label:d}async function ge(d){try{const L=await Q("GetNodeDetail",d);L&&ct(L)}catch(L){t(6,h=String(L))}}const ri=d=>st(d.id),ai=d=>ct(d),fi=()=>t(6,h=""),ui=()=>t(6,h="");function di(){y.content=this.value,t(11,y)}const _i=d=>{t(9,w=d.id),d.id==="files"&&v&&ne.length===0&&!J&&he(v.id)},pi=()=>{t(9,w="notes"),Wt()},mi=()=>{t(9,w="files"),Jt()},vi=()=>t(9,w="worklog"),hi=d=>dt(d);function bi(){X=this.value,t(22,X)}const ki=d=>d.key==="Enter"&&Gt(),gi=d=>dt(d),yi=d=>{const L=d.detail;L===0?(t(33,le=[]),t(32,J=null),he(v.id)):Lt(L-1)},wi=d=>rt(d.detail),ji=d=>at(d.detail),zi=d=>Q("OpenFile",d.detail),qi=d=>Q("OpenFolder",d.detail),Ci=d=>Xt(d.detail),Ti=d=>Dt(d.detail.id),Mi=d=>St(d.detail),Li=d=>It(d.detail),Si=d=>Et(d.detail),Di=d=>Ft(d.detail),Ii=d=>Nt(d.detail),Ei=d=>Ht(d.detail),Ai=d=>Q("OpenFile",d.detail),Ni=d=>Q("RunAction",d.id),Fi=d=>Zt(d.id);function Hi(){N=this.value,t(15,N)}function Bi(){q=yn(this.value),t(14,q)}const Oi=d=>ge(d.nodeId),Pi=(d,L)=>L.key==="Enter"&&ge(d.nodeId),Vi=d=>ge(d.nodeId),Ri=(d,L)=>L.key==="Enter"&&ge(d.nodeId),Ki=d=>ge(d.nodeId),Wi=(d,L)=>L.key==="Enter"&&ge(d.nodeId),Gi=d=>ge(d.nodeId),Ui=(d,L)=>L.key==="Enter"&&ge(d.nodeId);function Ji(){S=this.value,t(17,S)}const Xi=d=>d.key==="Enter"&&Kt();function Zi(){T=bt(this),t(18,T),t(0,n)}function Yi(){C=bt(this),t(19,C),t(20,D)}function Qi(){B=this.value,t(24,B)}const xi=d=>d.key==="Enter"&&mt();function $i(){P=bt(this),t(25,P),t(49,U)}function eo(){F=this.value,t(26,F)}const to=d=>d.key==="Enter"&&mt(),lo=()=>pt("copy"),no=()=>pt("link");function io(){Ee=this.value,t(47,Ee)}return[n,i,s,o,_,m,h,p,v,w,b,y,M,E,q,N,O,S,T,C,D,R,X,x,B,P,F,$,K,oe,ie,Z,J,le,ne,_e,ae,V,fe,pe,Y,it,jt,zt,qt,Ct,Ye,Ee,Ae,U,In,st,ct,he,rt,Mt,Lt,at,ft,En,St,Dt,It,Et,At,Nt,Ft,Ht,On,Pn,Vn,Vt,Wn,Gn,Un,Jn,Xn,Zn,Kt,Wt,Yn,Gt,dt,Qn,xn,$n,ei,Jt,ti,pt,li,Xt,ii,oi,si,mt,Zt,ci,ge,ri,ai,fi,ui,di,_i,pi,mi,vi,hi,bi,ki,gi,yi,wi,ji,zi,qi,Ci,Ti,Mi,Li,Si,Di,Ii,Ei,Ai,Ni,Fi,Hi,Bi,Oi,Pi,Vi,Ri,Ki,Wi,Gi,Ui,Ji,Xi,Zi,Yi,Qi,xi,$i,eo,to,lo,no,io]}class ec extends We{constructor(e){super(),Ke(this,e,$s,xs,Ve,{},null,[-1,-1,-1,-1,-1,-1,-1,-1])}}new ec({target:document.getElementById("app")});