88 lines
551 KiB
JavaScript
88 lines
551 KiB
JavaScript
var tg=Object.defineProperty;var ng=(n,e,t)=>e in n?tg(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var lt=(n,e,t)=>ng(n,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"]'))l(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();function se(){}function lg(n,e){for(const t in e)n[t]=e[t];return n}function Of(n){return n()}function Uo(){return Object.create(null)}function Ce(n){n.forEach(Of)}function pl(n){return typeof n=="function"}function at(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let bi;function Pl(n,e){return n===e?!0:(bi||(bi=document.createElement("a")),bi.href=e,n===bi.href)}function ig(n){return Object.keys(n).length===0}function sg(n,e,t,l){if(n){const i=Df(n,e,t,l);return n[0](i)}}function Df(n,e,t,l){return n[1]&&l?lg(t.ctx.slice(),n[1](l(e))):t.ctx}function og(n,e,t,l){if(n[2]&&l){const i=n[2](l(t));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let c=0;c<s;c+=1)o[c]=e.dirty[c]|i[c];return o}return e.dirty|i}return e.dirty}function rg(n,e,t,l,i,o){if(i){const s=Df(e,t,l,o);n.p(s,i)}}function ag(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let l=0;l<t;l++)e[l]=-1;return e}return-1}function Ho(n){return n??""}const Ls=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function a(n,e){n.appendChild(e)}function C(n,e,t){n.insertBefore(e,t||null)}function S(n){n.parentNode&&n.parentNode.removeChild(n)}function et(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function f(n){return document.createElement(n)}function ae(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function H(n){return document.createTextNode(n)}function w(){return H(" ")}function kt(){return H("")}function P(n,e,t,l){return n.addEventListener(e,t,l),()=>n.removeEventListener(e,t,l)}function ji(n){return function(e){return e.preventDefault(),n.call(this,e)}}function We(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function xt(n){return function(e){e.target===this&&n.call(this,e)}}function r(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function zl(n){return n===""?null:+n}function cg(n){return Array.from(n.childNodes)}function Q(n,e){e=""+e,n.data!==e&&(n.data=e)}function Me(n,e){n.value=e??""}function sn(n,e,t,l){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Yn(n,e,t){for(let l=0;l<n.options.length;l+=1){const i=n.options[l];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function Ci(n){const e=n.querySelector(":checked");return e&&e.__value}function ce(n,e,t){n.classList.toggle(e,!!t)}function ug(n,e,{bubbles:t=!1,cancelable:l=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:l})}class Ri{constructor(e=!1){lt(this,"is_svg",!1);lt(this,"e");lt(this,"n");lt(this,"t");lt(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,l=null){this.e||(this.is_svg?this.e=ae(t.nodeName):this.e=f(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(l)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)C(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(S)}}let $l;function xl(n){$l=n}function Os(){if(!$l)throw new Error("Function called outside component initialization");return $l}function li(n){Os().$$.on_mount.push(n)}function ii(n){Os().$$.on_destroy.push(n)}function pn(){const n=Os();return(e,t,{cancelable:l=!1}={})=>{const i=n.$$.callbacks[e];if(i){const o=ug(e,t,{cancelable:l});return i.slice().forEach(s=>{s.call(n,o)}),!o.defaultPrevented}return!0}}function Ds(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(l=>l.call(this,e))}const Ll=[],In=[];let Dl=[];const Wo=[],Pf=Promise.resolve();let Ts=!1;function qf(){Ts||(Ts=!0,Pf.then(zf))}function fg(){return qf(),Pf}function hl(n){Dl.push(n)}const ps=new Set;let Al=0;function zf(){if(Al!==0)return;const n=$l;do{try{for(;Al<Ll.length;){const e=Ll[Al];Al++,xl(e),dg(e.$$)}}catch(e){throw Ll.length=0,Al=0,e}for(xl(null),Ll.length=0,Al=0;In.length;)In.pop()();for(let e=0;e<Dl.length;e+=1){const t=Dl[e];ps.has(t)||(ps.add(t),t())}Dl.length=0}while(Ll.length);for(;Wo.length;)Wo.pop()();Ts=!1,ps.clear(),xl(n)}function dg(n){if(n.fragment!==null){n.update(),Ce(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(hl)}}function pg(n){const e=[],t=[];Dl.forEach(l=>n.indexOf(l)===-1?e.push(l):t.push(l)),t.forEach(l=>l()),Dl=e}const Ai=new Set;let ul;function yt(){ul={r:0,c:[],p:ul}}function Et(){ul.r||Ce(ul.c),ul=ul.p}function ge(n,e){n&&n.i&&(Ai.delete(n),n.i(e))}function ke(n,e,t,l){if(n&&n.o){if(Ai.has(n))return;Ai.add(n),ul.c.push(()=>{Ai.delete(n),l&&(t&&n.d(1),l())}),n.o(e)}else l&&l()}function Te(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Bf(n,e){ke(n,1,1,()=>{e.delete(n.key)})}function Ff(n,e,t,l,i,o,s,c,u,d,p,h){let m=n.length,g=o.length,b=m;const v={};for(;b--;)v[n[b].key]=b;const y=[],E=new Map,T=new Map,N=[];for(b=g;b--;){const R=h(i,o,b),D=t(R);let B=s.get(D);B?N.push(()=>B.p(R,e)):(B=d(D,R),B.c()),E.set(D,y[b]=B),D in v&&T.set(D,Math.abs(b-v[D]))}const A=new Set,I=new Set;function O(R){ge(R,1),R.m(c,p),s.set(R.key,R),p=R.first,g--}for(;m&&g;){const R=y[g-1],D=n[m-1],B=R.key,j=D.key;R===D?(p=R.first,m--,g--):E.has(j)?!s.has(B)||A.has(B)?O(R):I.has(j)?m--:T.get(B)>T.get(j)?(I.add(B),O(R)):(A.add(j),m--):(u(D,s),m--)}for(;m--;){const R=n[m];E.has(R.key)||u(R,s)}for(;g;)O(y[g-1]);return Ce(N),y}function Qe(n){n&&n.c()}function Ye(n,e,t){const{fragment:l,after_update:i}=n.$$;l&&l.m(e,t),hl(()=>{const o=n.$$.on_mount.map(Of).filter(pl);n.$$.on_destroy?n.$$.on_destroy.push(...o):Ce(o),n.$$.on_mount=[]}),i.forEach(hl)}function Xe(n,e){const t=n.$$;t.fragment!==null&&(pg(t.after_update),Ce(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function hg(n,e){n.$$.dirty[0]===-1&&(Ll.push(n),qf(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function ct(n,e,t,l,i,o,s=null,c=[-1]){const u=$l;xl(n);const d=n.$$={fragment:null,ctx:[],props:o,update:se,not_equal:i,bound:Uo(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Uo(),dirty:c,skip_bound:!1,root:e.target||u.$$.root};s&&s(d.root);let p=!1;if(d.ctx=t?t(n,e.props||{},(h,m,...g)=>{const b=g.length?g[0]:m;return d.ctx&&i(d.ctx[h],d.ctx[h]=b)&&(!d.skip_bound&&d.bound[h]&&d.bound[h](b),p&&hg(n,h)),m}):[],d.update(),p=!0,Ce(d.before_update),d.fragment=l?l(d.ctx):!1,e.target){if(e.hydrate){const h=cg(e.target);d.fragment&&d.fragment.l(h),h.forEach(S)}else d.fragment&&d.fragment.c();e.intro&&ge(n.$$.fragment),Ye(n,e.target,e.anchor),zf()}xl(u)}class ut{constructor(){lt(this,"$$");lt(this,"$$set")}$destroy(){Xe(this,1),this.$destroy=se}$on(e,t){if(!pl(t))return se;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(t),()=>{const i=l.indexOf(t);i!==-1&&l.splice(i,1)}}$set(e){this.$$set&&!ig(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mg="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mg);function gg(n){let e,t;return{c(){e=ae("path"),t=ae("polyline"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function _g(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("polyline"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","16"),r(l,"y1","13"),r(l,"x2","8"),r(l,"y2","13"),r(i,"x1","16"),r(i,"y1","17"),r(i,"x2","8"),r(i,"y2","17"),r(o,"points","10 9 9 9 8 9")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function bg(n){let e,t;return{c(){e=ae("polyline"),t=ae("polyline"),r(e,"points","16 18 22 12 16 6"),r(t,"points","8 6 2 12 8 18")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function kg(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("rect"),r(e,"d","M21 8v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8"),r(t,"points","7 3 12 8 17 3"),r(l,"x1","3"),r(l,"y1","8"),r(l,"x2","21"),r(l,"y2","8"),r(i,"x","10"),r(i,"y","12"),r(i,"width","4"),r(i,"height","4"),r(i,"rx","1")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function vg(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","9"),r(l,"y1","12"),r(l,"x2","15"),r(l,"y2","12"),r(i,"x1","9"),r(i,"y1","15"),r(i,"x2","13"),r(i,"y2","15"),r(o,"x1","12"),r(o,"y1","15"),r(o,"x2","12"),r(o,"y2","18")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function wg(n){let e,t,l,i,o,s;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("line"),s=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","8"),r(l,"y1","12"),r(l,"x2","16"),r(l,"y2","12"),r(i,"x1","8"),r(i,"y1","16"),r(i,"x2","16"),r(i,"y2","16"),r(o,"x1","8"),r(o,"y1","14"),r(o,"x2","12"),r(o,"y2","14"),r(s,"x1","12"),r(s,"y1","12"),r(s,"x2","12"),r(s,"y2","18")},m(c,u){C(c,e,u),C(c,t,u),C(c,l,u),C(c,i,u),C(c,o,u),C(c,s,u)},d(c){c&&(S(e),S(t),S(l),S(i),S(o),S(s))}}}function yg(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","16"),r(l,"y1","13"),r(l,"x2","8"),r(l,"y2","13"),r(i,"x1","16"),r(i,"y1","17"),r(i,"x2","8"),r(i,"y2","17")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function Eg(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","8"),r(l,"y1","12"),r(l,"x2","16"),r(l,"y2","12"),r(i,"x1","8"),r(i,"y1","16"),r(i,"x2","16"),r(i,"y2","16"),r(o,"x1","8"),r(o,"y1","14"),r(o,"x2","12"),r(o,"y2","14")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function Tg(n){let e,t,l;return{c(){e=ae("path"),t=ae("circle"),l=ae("circle"),r(e,"d","M9 18V5l12-2v13"),r(t,"cx","6"),r(t,"cy","18"),r(t,"r","3"),r(l,"cx","18"),r(l,"cy","16"),r(l,"r","3")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function Sg(n){let e,t;return{c(){e=ae("rect"),t=ae("polyline"),r(e,"x","2"),r(e,"y","4"),r(e,"width","20"),r(e,"height","16"),r(e,"rx","2"),r(t,"points","10 9 16 12 10 15 10 9")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function Cg(n){let e,t,l;return{c(){e=ae("rect"),t=ae("circle"),l=ae("polyline"),r(e,"x","3"),r(e,"y","3"),r(e,"width","18"),r(e,"height","18"),r(e,"rx","2"),r(e,"ry","2"),r(t,"cx","8.5"),r(t,"cy","8.5"),r(t,"r","1.5"),r(l,"points","21 15 16 10 5 21")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function Ag(n){let e;return{c(){e=ae("path"),r(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,l){C(t,e,l)},d(t){t&&S(e)}}}function Ng(n){let e;function t(o,s){return o[0]==="folder"?Ag:o[0]==="image"?Cg:o[0]==="video"?Sg:o[0]==="audio"?Tg:o[0]==="pdf"?Eg:o[0]==="document"?yg:o[0]==="spreadsheet"?wg:o[0]==="presentation"?vg:o[0]==="archive"?kg:o[0]==="code"?bg:o[0]==="text"?_g:gg}let l=t(n),i=l(n);return{c(){e=ae("svg"),i.c(),r(e,"width",n[1]),r(e,"height",n[1]),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","1.5"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round"),r(e,"xmlns","http://www.w3.org/2000/svg")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l!==(l=t(o))&&(i.d(1),i=l(o),i&&(i.c(),i.m(e,null))),s&2&&r(e,"width",o[1]),s&2&&r(e,"height",o[1])},i:se,o:se,d(o){o&&S(e),i.d()}}}function Ig(n,e,t){let{kind:l="generic"}=e,{size:i=20}=e;return n.$$set=o=>{"kind"in o&&t(0,l=o.kind),"size"in o&&t(1,i=o.size)},[l,i]}class jf extends ut{constructor(e){super(),ct(this,e,Ig,Ng,at,{kind:0,size:1})}}const Rg={"nav.today":"Сегодня","nav.inbox":"Неразобранное","nav.trash":"Корзина","nav.activity":"Активность","nav.journal":"Журнал","nav.clients":"Клиенты","nav.projects":"Проекты","nav.recipes":"Рецепты","nav.documents":"Документы","nav.archive":"Архив","nav.sections":"Разделы","nav.cases":"Дела","nav.noCases":"Нет дел","nav.sync":"Синхронизация","nav.syncSettings":"Настройки синхронизации","nav.syncNow":"Синхронизировать","nav.selectPrompt":"Выберите раздел или дело","nav.brand":"Верстак","nav.system":"Системное","nav.workspace":"Рабочее пространство","nav.noNodes":"Нет узлов","nav.openFolder":"Открыть папку","nav.createInside":"Создать внутри","nav.createNode":"Создать элемент","nav.moveToRoot":"Переместить в корень","inbox.subtitle":"Захваченные материалы, которые нужно разложить по делам","inbox.sortByDate":"по дате","inbox.sortByName":"по имени","inbox.sortByType":"по типу","inbox.sortAsc":"по возрастанию","inbox.sortDesc":"по убыванию","inbox.groupByContext":"Группировать по месту захвата","inbox.noContext":"Без места захвата","inbox.empty":"Неразобранных элементов нет","inbox.pasteClipboard":"Вставить из буфера","inbox.captured":"Добавлено","inbox.clipboardEmpty":"Буфер обмена пуст","inbox.clipboardUnavailable":"Буфер обмена недоступен","inbox.assign":"Разложить","inbox.keepHere":"Прикрепить в захваченном месте","inbox.localEmpty":"Для этого дела неразобранных материалов нет","inbox.capturedIn":"Захвачено в","inbox.suggestedTarget":"Цель","inbox.assignTitle":"Разложить материал","inbox.assignTarget":"Дело","inbox.assignSearchPlaceholder":"Найти дело","inbox.assignSearchHint":"Начните набирать название Дела","inbox.deleteTitle":"Удалить материал","inbox.deleteConfirm":"Удалить «{title}» из неразобранного?","capture.kind.text":"Текст","capture.kind.url":"Ссылка","capture.kind.file":"Файл","capture.kind.folder":"Папка","capture.kind.image":"Изображение","capture.source.clipboard":"Буфер обмена","capture.source.clipboard_button":"Кнопка буфера","capture.source.drop":"Перетаскивание","capture.source.paste":"Вставка","capture.source.browser":"Браузер","capture.source.manual":"Вручную","capture.dropOverlayNode":"Будет добавлено в Неразобранное для: {title}","capture.dropOverlayGlobal":"Будет добавлено в глобальное Неразобранное","trash.openFolder":"Открыть папку корзины","trash.empty":"Корзина пуста","trash.emptyTrash":"Очистить корзину","trash.restore":"Восстановить","trash.deletedNodes":"Удаленные элементы","tab.overview":"Обзор","tab.notes":"Заметки","tab.files":"Файлы","tab.inbox":"Неразобранное","tab.links":"Ссылки","tab.actions":"Действия","tab.worklog":"Журнал","tab.activity":"Активность","common.save":"Сохранить","common.cancel":"Отмена","common.delete":"Удалить","common.rename":"Переименовать","common.close":"Закрыть","common.create":"Создать","common.confirm":"Подтверждение","common.back":"← Назад","common.backLabel":"Назад","common.loading":"Загрузка...","common.error":"Ошибка:","common.yes":"Да","common.ok":"OK","common.copy":"Копировать","common.cut":"Вырезать","common.paste":"Вставить","common.duplicate":"Дублировать","common.run":"Запустить","common.test":"Test","common.all":"Все","common.open":"Открыть","common.no":"Нет","common.date":"Дата","common.search":"Найти","common.testAgain":"Проверить","common.connect":"Подключиться","common.disconnect":"Отключиться","common.settings":"Настройки","common.name":"Название","common.type":"Тип","common.section":"Раздел","common.created":"Создано","common.empty":"Нет","common.newName":"Новое имя","search.placeholder":"Поиск по Верстаку...","search.noResults":"Ничего не найдено","welcome.title":"Верстак","welcome.selectSection":"Выберите раздел в боковой панели.","welcome.createCase":"Или создайте новое дело кнопкой «+».","welcome.addCase":"Добавить дело","event.noteCreated":"Заметка создана","event.noteUpdated":"Заметка изменена","event.fileAdded":"Файл добавлен","event.fileDeleted":"Файл удалён","event.fileRenamed":"Файл переименован","event.fileCopied":"Файл скопирован","event.fileMoved":"Файл перемещён","event.folderAdded":"Папка добавлена","event.folderDeleted":"Папка удалена","event.folderRenamed":"Папка переименована","event.caseCreated":"Дело создано","event.caseUpdated":"Дело изменено","event.noteDeleted":"Заметка удалена","event.folderMoved":"Папка перемещена","event.nodeDeleted":"Узел удалён","event.actionCreated":"Действие создано","event.actionDone":"Действие выполнено","event.worklogAdded":"Запись времени добавлена","kind.project":"Проект","kind.client":"Клиент","kind.document":"Документ","kind.recipe":"Рецепт","kind.folder":"Папка","kind.note":"Заметка","kind.file":"Файл","kind.archive":"Архив","kind.case":"Дело","kind.link":"Ссылка","kind.action":"Действие","links.empty":"Ссылок пока нет","links.editTitle":"Редактировать ссылку","links.note":"Заметка","links.copyUrl":"Копировать URL","links.copied":"URL скопирован","links.copyUnavailable":"Не удалось скопировать URL","links.deleteTitle":"Удалить ссылку","links.deleteConfirm":"Удалить ссылку «{title}»?","action.openUrl":"Открыть URL","action.openFile":"Открыть файл","action.openFolder":"Открыть папку","action.runCommand":"Запустить команду","action.runScript":"Запустить скрипт","action.openTerminal":"Открыть терминал","action.launchApp":"Запустить приложение","action.addAction":"+ Добавить действие","action.newAction":"Новое действие","action.noActions":"Действий пока нет","action.run":"Запустить","action.dataUrl":"URL","action.dataPath":"Путь","action.dataCommand":"Команда","action.urlPlaceholder":"https://example.com","action.pathPlaceholder":"/path/to/file","action.commandPlaceholder":"команда","action.namePlaceholder":"Например: Открыть сайт","note.add":"+ Добавить заметку","note.new":"Новая заметка","note.title":"Название заметки","note.noNotes":"Нет заметок","note.createFirst":"Создайте первую заметку для этого дела.","note.placeholder":"Начните писать...","note.unsavedTitle":"Несохранённые изменения","note.unsavedMessage":"Закрыть редактор? Все несохранённые изменения будут потеряны.","note.unsavedClose":"Закрыть","note.mode.edit":"Редактор","note.mode.preview":"Просмотр","note.mode.split":"Разделённый","note.toolbar.bold":"Жирный (Ctrl+B)","note.toolbar.italic":"Курсив (Ctrl+I)","note.toolbar.heading":"Заголовок","note.toolbar.link":"Ссылка","note.toolbar.code":"Код","note.toolbar.codeBlock":"Блок кода","note.toolbar.bulletList":"Маркированный список","note.toolbar.numberedList":"Нумерованный список","note.toolbar.checkbox":"Чекбокс","note.toolbar.quote":"Цитата","note.toolbar.internalLink":"Внутренняя ссылка Verstak","note.internal.secretNotImplemented":"Сейф доступов ещё не реализован","note.internal.caseNotFound":"Дело не найдено","note.internal.noteNotFound":"Заметка не найдена","note.internal.fileNotFound":"Файл не найден","note.internal.fileFound":"Файл найден: {title}","note.rename":"Переименовать заметку","note.deleteConfirm":"Удалить заметку «{title}»?","note.renameError":"Не удалось переименовать заметку","note.internalLink.title":"Вставить внутреннюю ссылку","note.internalLink.label":"Текст ссылки","note.internalLink.url":"Адрес ссылки","note.internalLink.labelPlaceholder":"Например: Админка","note.internalLink.urlPlaceholder":"verstak://secret/sec_...","note.preview.empty":"Пустая заметка. Переключитесь в режим редактора, чтобы начать писать.","note.preview.error":"Ошибка рендеринга markdown","link.label":"Текст ссылки","link.url":"URL или verstak:// ссылка","link.urlPlaceholder":"https://... или verstak://secret/sec_...","link.insert":"Вставить","file.addFile":"+ Добавить файл","file.addFolder":"+ Добавить папку","file.newFile":"+ Новый файл","file.addFileSimple":"Добавить файл","file.addFolderSimple":"Добавить папку","file.noFiles":"В этой папке пока нет файлов","file.noFilesCase":"В этом проекте пока нет файлов","file.hint":"Добавьте файл или папку, чтобы сохранить материалы проекта.","file.root":"Файлы","file.preview":"Предпросмотр","file.openExternal":"Открыть во внешней программе","file.openFolder":"Открыть папку","file.showInExplorer":"Показать в проводнике","file.more":"Ещё","file.delete":"Удалить","file.ariaFolder":"Папка","file.ariaFile":"Файл","file.scanning":"Сканирование...","file.pickSingle":"Выберите файл","file.pickMultiple":"Выберите файлы","file.pickDirectory":"Выберите папку","file.importTitle":"Добавить в","file.importFiles":"Файлов:","file.importFolders":"Папок:","file.importSize":"Размер:","file.importCopy":"Скопировать","file.importLink":"Привязать","file.selectCaseFirst":"Сначала выберите дело для добавления файлов","worklog.title":"Журнал","worklog.whatDone":"Что сделано","worklog.minutes":"Мин","worklog.min":"мин","worklog.log":"Записать","worklog.addEntry":"Добавить запись","worklog.acceptSuggestion":"Принять предложение","worklog.editEntry":"Редактировать запись","worklog.deleteEntry":"Удалить запись","worklog.deleteConfirm":"Удалить эту запись работы? Связанные события останутся в активности, но связь с записью будет удалена.","worklog.date":"Дата","worklog.empty":"Записей работы пока нет","worklog.details":"Детали","worklog.source":"Источник","worklog.sourceSuggestion":"Из предложения","worklog.sourceSuggestionNoEvents":"Из предложения, но связанные события отсутствуют","worklog.sourceManual":"Ручная запись","worklog.sourceUnknown":"Источник неизвестен","worklog.suggestions":"Предложения на сегодня","worklog.apply":"Применить","sync.title":"Синхронизация","sync.settings":"Настройки синхронизации","sync.status":"Статус","sync.server":"Сервер","sync.device":"Устройство","sync.deviceId":"ID устройства","sync.unpushed":"Неотправлено","sync.lastSync":"Последняя синх.","sync.revoked":"Отозвано","sync.connected":"Подключено","sync.notConnected":"Не подключено","sync.disabled":"Отключена","sync.serverUrl":"URL сервера","sync.serverUrlPlaceholder":"https://example.com:47732","sync.username":"Логин","sync.usernamePlaceholder":"username","sync.password":"Пароль","sync.passwordPlaceholder":"password","sync.interval":"Автосинхронизация (мин)","sync.saveInterval":"Сохранить интервал","sync.syncNow":"Синхронизировать","sync.disconnect":"Отключиться","sync.connect":"Подключиться","sync.test":"Проверить","sync.settingsSaved":"интервал сохранён","today.title":"Сегодня","today.changedCases":"Изменён сегодня","today.timeline":"Лента за сегодня","today.empty":"Сегодня пока тихо","today.emptyHint":"Здесь появятся дела, заметки, файлы и действия, с которыми вы работали сегодня.","today.plural.case_one":"дело","today.plural.case_few":"дела","today.plural.case_many":"дел","today.plural.note_one":"заметка","today.plural.note_few":"заметки","today.plural.note_many":"заметок","today.plural.file_one":"файл","today.plural.file_few":"файла","today.plural.file_many":"файлов","today.plural.event_one":"событие","today.plural.event_few":"события","today.plural.event_many":"событий","today.feed":"Лента","today.suggestionsTab":"Предложения","today.inProgress":"В работе","today.captured":"Захвачено","today.feedEmpty":"Сегодня событий нет","today.inProgressEmpty":"Сегодня ничего не изменяли","today.capturedEmpty":"Сегодня ничего не захвачено","today.feedHint":"События за сегодня: изменения файлов, заметок, действий и другие события.","today.sortByTime":"по времени","today.sortByName":"по имени","today.sortByType":"по типу","today.sortAsc":"по возрастанию","today.sortDesc":"по убыванию","journal.title":"Журнал работы","journal.worklogTab":"Журнал работы","journal.empty":"Нет записей за выбранный период","journal.dateFrom":"От","journal.dateTo":"До","journal.filter":"Фильтр","journal.total":"Всего","journal.exportCSV":"CSV","journal.exportMarkdown":"Markdown","journal.billable":"К оплате","journal.billableYes":"К оплате","journal.billableNo":"Не к оплате","journal.billableHint":"К оплате — можно включать в счёт клиенту","journal.approx":"Тип времени","journal.approxExact":"Точное","journal.approxEstimated":"Оценочное","journal.approxHint":"Оценочное — время предложено системой или введено как примерное","journal.includeChildrenDisabledHint":"Работает только при выбранном деле/клиенте/проекте","journal.node":"Дело","journal.path":"Путь","journal.byDay":"По дням","journal.byNode":"По делам","journal.includeChildren":"Учитывать вложенные дела","journal.nodeSearch":"Поиск дела...","journal.relatedEvents":"Связанные события","journal.filterHeading":"Фильтры","journal.exportHeading":"Экспорт отчёта","journal.reset":"Сбросить","suggest.title":"Предложения на сегодня","suggest.apply":"Записать","suggest.dismiss":"Скрыть","suggest.open":"Открыть","suggest.confidence.low":"Низкая уверенность","suggest.confidence.medium":"Средняя уверенность","suggest.confidence.high":"Высокая уверенность","suggest.minutes":"мин","suggest.edit":"Изменить","suggest.noSuggestions":"Нет предложений для журнала","suggest.detectedEvents":"Что обнаружено","activity.title":"Активность","activity.empty":"Активность пока не зафиксирована","activity.perCaseEmpty":"Активность пока не зафиксирована","overview.type":"Тип","overview.section":"Раздел","overview.created":"Создано","overview.newNote":"Новая заметка","overview.addFile":"Добавить файл","overview.addAction":"Добавить действие","overview.logTime":"Записать время","overview.recentNotes":"Последние заметки","overview.recentEntries":"Последние записи","rename.title":"Переименовать","rename.emptyError":"Имя не может быть пустым","rename.invalidError":"Недопустимое имя","delete.confirmTitle":"Удаление","delete.confirmMessage":"Удалить","delete.folder":"папку","delete.file":"файл","template.optionNone":"Пустое дело","template.optional":"Шаблон (опционально)","template.none.desc":"Без шаблона, простой узел-контейнер","template.folder":"Папка","template.folder.desc":"Папка для группировки элементов внутри рабочего пространства","template.project":"Проект","template.project.desc":"Отдельный проект или задача с файлами, заметками и журналом","template.client":"Клиент","template.client.desc":"Организация или человек, для которых ведутся работы","template.document":"Документ","template.document.desc":"Документ с описанием, заметками и файлами","template.recipe":"Рецепт","template.recipe.desc":"Повторяемая процедура или инструкция","template.note":"Заметка","template.file":"Файл","template.select":"Выберите тип","mime.jpeg":"Изображение JPEG","mime.png":"Изображение PNG","mime.gif":"Изображение GIF","mime.webp":"Изображение WebP","mime.svg":"Изображение SVG","mime.bmp":"Изображение BMP","mime.tiff":"Изображение TIFF","mime.avif":"Изображение AVIF","mime.pdf":"PDF документ","mime.word":"Документ Word","mime.excel":"Таблица Excel","mime.ppt":"Презентация PowerPoint","mime.zip":"ZIP архив","mime.gzip":"GZIP архив","mime.tar":"TAR архив","mime.sevenz":"7z архив","mime.rar":"RAR архив","mime.text":"Текстовый файл","mime.html":"HTML файл","mime.css":"CSS файл","mime.js":"JavaScript файл","mime.json":"JSON файл","mime.xml":"XML файл","mime.yaml":"YAML файл","mime.binary":"Бинарный файл","mime.executable":"Исполняемый файл","mime.folder":"Папка","mime.unknown":"Неизвестно","mime.file":"Файл","error.nameEmpty":"Имя не может быть пустым","error.nameInvalid":"Недопустимое имя","error.selectCaseFirst":"Сначала выберите дело","error.vaultNotOpen":"Хранилище не открыто","delete.files":"файлов ({count})","file.namePrompt":"Введите имя файла:","file.pdfUnavailable":"Предпросмотр PDF недоступен.","file.previewUnavailable":"Предпросмотр недоступен для этого типа файлов.","case.new":"Новое дело","case.namePlaceholder":"Название дела","settings.title":"Настройки","settings.general":"Общие","settings.generalDesc":"Основные настройки интерфейса.","settings.workspace":"Рабочее пространство","settings.workspaceDesc":"Управление хранилищем данных.","settings.appearance":"Внешний вид","settings.localization":"Локализация","settings.templates":"Шаблоны","settings.plugins":"Плагины","settings.files":"Файлы","settings.activity":"Активность","settings.sync":"Синхронизация","settings.backup":"Резервные копии","settings.close":"Закрыть настройки","settings.noPlugins":"Плагины пока не установлены.","settings.openPluginsDir":"Открыть папку plugins","settings.activityStub":"Здесь будут настройки отслеживания активности.","settings.backupStub":"Здесь будут настройки резервного копирования.","settings.theme":"Тема интерфейса","settings.themeSystem":"Системная","settings.themeLight":"Светлая","settings.themeDark":"Тёмная","settings.language":"Язык интерфейса","settings.langRu":"Русский","settings.langEn":"Английский","settings.langSoon":"будет доступно позже","settings.save":"Сохранить настройки","settings.saved":"Настройки сохранены","settings.vaultPath":"Путь к рабочему пространству","settings.noVaultInfo":"Нет информации о хранилище.","settings.vaultInfo":"Информация о рабочем пространстве","settings.openVault":"Открыть папку vault","settings.changeVault":"Изменить путь","settings.checkIntegrity":"Проверить целостность","settings.templatesDesc":"Включите или выключите шаблоны создания элементов.","settings.templateEnabled":"Включён","settings.templateDisabled":"Выключен","settings.filesStub":"Здесь будут настройки файлового хранилища.","settings.syncEnabled":"Синхронизация включена","settings.syncDisabled":"Синхронизация отключена","settings.syncDesc":"Настройте подключение к серверу синхронизации.","settings.serverUrl":"URL сервера","settings.deviceName":"Имя устройства","settings.deviceId":"ID устройства","settings.lastSync":"Последняя синхронизация","settings.lastError":"Последняя ошибка","settings.pendingChanges":"Ожидающие изменения","settings.checkConnection":"Проверить подключение","settings.syncNow":"Синхронизировать сейчас","settings.reconnect":"Переподключить","settings.disconnect":"Отключить устройство","settings.resetKey":"Сбросить ключ","settings.confirmDisconnect":"Вы уверены, что хотите отключить устройство?","settings.confirmDisconnectDesc":"Синхронизация будет остановлена. Для повторного подключения потребуется логин и пароль.","settings.confirmResetKey":"Сбросить ключ синхронизации?","settings.confirmResetKeyDesc":"Текущий ключ устройства будет удалён. Потребуется переподключение.","settings.connected":"Подключено","settings.disconnected":"Не подключено","settings.notConfigured":"Не настроено","settings.error":"Ошибка","settings.revoked":"Отозвано","settings.status":"Статус","firstrun.title":"Добро пожаловать в Верстак","firstrun.desc":"Верстак хранит данные в локальном рабочем пространстве — vault.","firstrun.pathLabel":"Путь к vault","firstrun.defaultPath":"Путь по умолчанию","firstrun.browse":"Выбрать папку","firstrun.create":"Создать рабочее пространство","firstrun.quit":"Выйти","firstrun.pathExists":"Папка существует. Будет создан новый vault.","firstrun.pathHasVault":"Найден существующий vault. Будет подключён.","firstrun.pathNew":"Путь не существует. Будет создан новый vault.","firstrun.errorNoWrite":"Нет прав на запись в выбранную папку.","firstrun.creating":"Создание рабочего пространства...","firstrun.created":"Рабочее пространство создано!","recovery.title":"Рабочее пространство не найдено","recovery.expected":"Ожидался путь","recovery.choose":"Выбрать другой vault","recovery.create":"Создать новый vault","recovery.settings":"Открыть настройки","recovery.quit":"Выйти","recovery.createConfirm":"Будет создано новое пустое рабочее пространство. Старый путь в настройках будет заменён.","recovery.createConfirmTitle":"Создать новое рабочее пространство?","sync.status.connected":"Синхронизация доступна","sync.status.disconnected":"Сервер недоступен","sync.status.disabled":"Синхронизация не настроена","sync.status.syncing":"Синхронизация...","sync.status.error":"Ошибка синхронизации","sync.changes":"изменений","sync.details":"Подробнее","sync.configure":"Настроить","sync.retry":"Повторить","sync.run":"Синхронизировать","sync.running":"Синхронизация...","sync.conflictsCount":"Конфликты: {count}","sync.applyErrorsCount":"Ошибки применения: {count}","sync.pushedPulled":"Отправлено: {pushed}, получено: {pulled}","error.generic":"Произошла ошибка","error.invalidCredentials":"Неверный логин или пароль","error.accountBlocked":"Аккаунт заблокирован","error.emailNotConfirmed":"Email не подтверждён","error.tokenInvalid":"Неверный или просроченный токен","error.tokenExpired":"Срок действия токена истёк"},Mg={"nav.today":"Today","nav.inbox":"Inbox","nav.trash":"Trash","nav.activity":"Activity","nav.journal":"Journal","nav.clients":"Clients","nav.projects":"Projects","nav.recipes":"Recipes","nav.documents":"Documents","nav.archive":"Archive","nav.sections":"Sections","nav.cases":"Cases","nav.noCases":"No cases","nav.sync":"Sync","nav.syncSettings":"Sync settings","nav.syncNow":"Sync now","nav.selectPrompt":"Select a section or case","nav.brand":"Verstak","nav.system":"System","nav.workspace":"Workspace","nav.noNodes":"No nodes","nav.openFolder":"Open folder","nav.createInside":"Create inside","nav.createNode":"Create element","nav.moveToRoot":"Move to root","inbox.subtitle":"Captured materials that still need to be assigned to cases","inbox.sortByDate":"by date","inbox.sortByName":"by name","inbox.sortByType":"by type","inbox.sortAsc":"ascending","inbox.sortDesc":"descending","inbox.groupByContext":"Group by capture location","inbox.noContext":"No capture location","inbox.empty":"No unprocessed items","inbox.pasteClipboard":"Paste from clipboard","inbox.captured":"Added","inbox.clipboardEmpty":"Clipboard is empty","inbox.clipboardUnavailable":"Clipboard is unavailable","inbox.assign":"Assign","inbox.keepHere":"Attach at captured location","inbox.localEmpty":"No unprocessed materials for this case","inbox.capturedIn":"Captured in","inbox.suggestedTarget":"Target","inbox.assignTitle":"Assign material","inbox.assignTarget":"Case","inbox.assignSearchPlaceholder":"Find case","inbox.assignSearchHint":"Start typing a Case name","inbox.deleteTitle":"Delete material","inbox.deleteConfirm":'Delete "{title}" from inbox?',"capture.kind.text":"Text","capture.kind.url":"Link","capture.kind.file":"File","capture.kind.folder":"Folder","capture.kind.image":"Image","capture.source.clipboard":"Clipboard","capture.source.clipboard_button":"Clipboard button","capture.source.drop":"Drop","capture.source.paste":"Paste","capture.source.browser":"Browser","capture.source.manual":"Manual","capture.dropOverlayNode":"Will be added to Inbox for: {title}","capture.dropOverlayGlobal":"Will be added to global Inbox","trash.openFolder":"Open trash folder","trash.empty":"Trash is empty","trash.emptyTrash":"Empty trash","trash.restore":"Restore","trash.deletedNodes":"Deleted items","tab.overview":"Overview","tab.notes":"Notes","tab.files":"Files","tab.inbox":"Inbox","tab.links":"Links","tab.actions":"Actions","tab.worklog":"Work Log","tab.activity":"Activity","common.save":"Save","common.cancel":"Cancel","common.delete":"Delete","common.rename":"Rename","common.close":"Close","common.create":"Create","common.confirm":"Confirm","common.back":"← Back","common.backLabel":"Back","common.loading":"Loading...","common.error":"Error:","common.yes":"Yes","common.ok":"OK","common.copy":"Copy","common.cut":"Cut","common.paste":"Paste","common.duplicate":"Duplicate","common.run":"Run","common.test":"Test","common.all":"All","common.open":"Open","common.no":"No","common.date":"Date","common.search":"Search","common.testAgain":"Check","common.connect":"Connect","common.disconnect":"Disconnect","common.settings":"Settings","common.name":"Name","common.type":"Type","common.section":"Section","common.created":"Created","common.empty":"None","common.newName":"New name","search.placeholder":"Search Verstak...","search.noResults":"No results found","welcome.title":"Verstak","welcome.selectSection":"Select a section in the sidebar.","welcome.createCase":"Or create a new case with the + button.","welcome.addCase":"Add case","event.noteCreated":"Note created","event.noteUpdated":"Note updated","event.fileAdded":"File added","event.fileDeleted":"File deleted","event.fileRenamed":"File renamed","event.fileCopied":"File copied","event.fileMoved":"File moved","event.folderAdded":"Folder added","event.folderDeleted":"Folder deleted","event.folderRenamed":"Folder renamed","event.caseCreated":"Case created","event.caseUpdated":"Case updated","event.noteDeleted":"Note deleted","event.folderMoved":"Folder moved","event.nodeDeleted":"Node deleted","event.actionCreated":"Action created","event.actionDone":"Action completed","event.worklogAdded":"Time entry added","kind.project":"Project","kind.client":"Client","kind.document":"Document","kind.recipe":"Recipe","kind.folder":"Folder","kind.note":"Note","kind.file":"File","kind.archive":"Archive","kind.case":"Case","kind.link":"Link","kind.action":"Action","links.empty":"No links yet","links.editTitle":"Edit link","links.note":"Note","links.copyUrl":"Copy URL","links.copied":"URL copied","links.copyUnavailable":"Could not copy URL","links.deleteTitle":"Delete link","links.deleteConfirm":'Delete link "{title}"?',"action.openUrl":"Open URL","action.openFile":"Open file","action.openFolder":"Open folder","action.runCommand":"Run command","action.runScript":"Run script","action.openTerminal":"Open terminal","action.launchApp":"Launch app","action.addAction":"+ Add action","action.newAction":"New action","action.noActions":"No actions yet","action.run":"Run","action.dataUrl":"URL","action.dataPath":"Path","action.dataCommand":"Command","action.urlPlaceholder":"https://example.com","action.pathPlaceholder":"/path/to/file","action.commandPlaceholder":"command","action.namePlaceholder":"Example: Open website","note.add":"+ Add note","note.new":"New note","note.title":"Note title","note.noNotes":"No notes","note.createFirst":"Create the first note for this case.","note.placeholder":"Start writing...","note.unsavedTitle":"Unsaved changes","note.unsavedMessage":"Close the editor? All unsaved changes will be lost.","note.unsavedClose":"Close","note.mode.edit":"Edit","note.mode.preview":"Preview","note.mode.split":"Split","note.toolbar.bold":"Bold (Ctrl+B)","note.toolbar.italic":"Italic (Ctrl+I)","note.toolbar.heading":"Heading","note.toolbar.link":"Link","note.toolbar.code":"Code","note.toolbar.codeBlock":"Code block","note.toolbar.bulletList":"Bullet list","note.toolbar.numberedList":"Numbered list","note.toolbar.checkbox":"Checkbox","note.toolbar.quote":"Quote","note.toolbar.internalLink":"Verstak internal link","note.internal.secretNotImplemented":"Secrets vault is not yet implemented","note.internal.caseNotImplemented":"Case navigation is not yet implemented","note.internal.noteNotImplemented":"Note navigation is not yet implemented","note.internal.fileNotImplemented":"File navigation is not yet implemented","note.rename":"Rename note","note.deleteConfirm":'Delete note "{title}"?',"note.renameError":"Failed to rename note","note.internalLink.title":"Insert internal link","note.internalLink.label":"Link text","note.internalLink.url":"Link address","note.internalLink.labelPlaceholder":"e.g. Admin panel","note.internalLink.urlPlaceholder":"verstak://secret/sec_...","note.preview.empty":"Empty note. Switch to edit mode to start writing.","note.preview.error":"Markdown render error","link.label":"Link text","link.url":"URL or verstak:// link","link.urlPlaceholder":"https://... or verstak://secret/sec_...","link.insert":"Insert","file.addFile":"+ Add file","file.addFolder":"+ Add folder","file.newFile":"+ New file","file.addFileSimple":"Add file","file.addFolderSimple":"Add folder","file.noFiles":"No files in this folder yet","file.noFilesCase":"No files in this project yet","file.hint":"Add a file or folder to store project materials.","file.root":"Files","file.preview":"Preview","file.openExternal":"Open in external program","file.openFolder":"Open folder","file.showInExplorer":"Show in explorer","file.more":"More","file.delete":"Delete","file.ariaFolder":"Folder","file.ariaFile":"File","file.scanning":"Scanning...","file.pickSingle":"Select file","file.pickMultiple":"Select files","file.pickDirectory":"Select folder","file.importTitle":"Add to","file.importFiles":"Files:","file.importFolders":"Folders:","file.importSize":"Size:","file.importCopy":"Copy","file.importLink":"Link","file.selectCaseFirst":"Select a case before adding files","worklog.title":"Work Log","worklog.whatDone":"What was done","worklog.minutes":"Min","worklog.min":"min","worklog.log":"Log","worklog.addEntry":"Add entry","worklog.acceptSuggestion":"Accept suggestion","worklog.editEntry":"Edit entry","worklog.deleteEntry":"Delete entry","worklog.deleteConfirm":"Delete this work entry? Related events stay in activity, but their link to this entry will be removed.","worklog.date":"Date","worklog.empty":"No work logged yet","worklog.details":"Details","worklog.source":"Source","worklog.sourceSuggestion":"From suggestion","worklog.sourceSuggestionNoEvents":"From suggestion, but related events missing","worklog.sourceManual":"Manual entry","worklog.sourceUnknown":"Unknown source","worklog.suggestions":"Suggestions for today","worklog.apply":"Apply","sync.title":"Sync","sync.settings":"Sync settings","sync.status":"Status","sync.server":"Server","sync.device":"Device","sync.deviceId":"Device ID","sync.unpushed":"Unpushed","sync.lastSync":"Last sync","sync.revoked":"Revoked","sync.connected":"Connected","sync.notConnected":"Not connected","sync.disabled":"Disabled","sync.serverUrl":"Server URL","sync.serverUrlPlaceholder":"https://example.com:47732","sync.username":"Username","sync.usernamePlaceholder":"username","sync.password":"Password","sync.passwordPlaceholder":"password","sync.interval":"Auto sync (min)","sync.saveInterval":"Save interval","sync.syncNow":"Sync now","sync.disconnect":"Disconnect","sync.connect":"Connect","sync.test":"Check","sync.settingsSaved":"interval saved","today.title":"Today","today.changedCases":"Changed today","today.timeline":"Timeline for today","today.empty":"Nothing happened today yet","today.emptyHint":"Cases, notes, files, and actions you worked with today will appear here.","today.plural.case_one":"case","today.plural.case_few":"cases","today.plural.case_many":"cases","today.plural.note_one":"note","today.plural.note_few":"notes","today.plural.note_many":"notes","today.plural.file_one":"file","today.plural.file_few":"files","today.plural.file_many":"files","today.plural.event_one":"event","today.plural.event_few":"events","today.plural.event_many":"events","today.feed":"Feed","today.suggestionsTab":"Suggestions","today.inProgress":"In Progress","today.captured":"Captured","today.feedEmpty":"No events today","today.inProgressEmpty":"Nothing modified today","today.capturedEmpty":"Nothing captured today","today.feedHint":"Today's events: file changes, notes, actions and other events.","today.sortByTime":"by time","today.sortByName":"by name","today.sortByType":"by type","today.sortAsc":"ascending","today.sortDesc":"descending","journal.title":"Work Log","journal.worklogTab":"Work Log","journal.empty":"No entries for the selected period","journal.dateFrom":"From","journal.dateTo":"To","journal.filter":"Filter","journal.total":"Total","journal.exportCSV":"CSV","journal.exportMarkdown":"Markdown","journal.billable":"Billable","journal.billableYes":"Billable","journal.billableNo":"Not billable","journal.billableHint":"Billable — can be included in client invoice","journal.approx":"Time type","journal.approxExact":"Exact","journal.approxEstimated":"Estimated","journal.approxHint":"Estimated — time suggested by the system or entered as approximate","journal.includeChildrenDisabledHint":"Only works when a case/client/project is selected","journal.node":"Case","journal.path":"Path","journal.byDay":"By day","journal.byNode":"By case","journal.includeChildren":"Include subtasks","journal.nodeSearch":"Search case...","journal.relatedEvents":"Related events","journal.filterHeading":"Filters","journal.exportHeading":"Export Report","journal.reset":"Reset","suggest.title":"Suggestions","suggest.apply":"Log","suggest.dismiss":"Dismiss","suggest.open":"Open","suggest.confidence.low":"Low confidence","suggest.confidence.medium":"Medium confidence","suggest.confidence.high":"High confidence","suggest.minutes":"min","suggest.edit":"Edit","suggest.noSuggestions":"No suggestions","suggest.detectedEvents":"What was detected","activity.title":"Activity","activity.empty":"No activity recorded yet","activity.perCaseEmpty":"No activity recorded yet","overview.type":"Type","overview.section":"Section","overview.created":"Created","overview.newNote":"New note","overview.addFile":"Add file","overview.addAction":"Add action","overview.logTime":"Log time","overview.recentNotes":"Recent notes","overview.recentEntries":"Recent entries","rename.title":"Rename","rename.emptyError":"Name cannot be empty","rename.invalidError":"Invalid name","delete.confirmTitle":"Delete","delete.confirmMessage":"Delete","delete.folder":"folder","delete.file":"file","template.optionNone":"Empty case","template.optional":"Template (optional)","template.none.desc":"No template, simple container node","template.folder":"Folder","template.folder.desc":"A folder to group items inside a workspace","template.project":"Project","template.project.desc":"A distinct project or task with files, notes and work log","template.client":"Client","template.client.desc":"An organization or person for whom work is performed","template.document":"Document","template.document.desc":"A document with description, notes and files","template.recipe":"Recipe","template.recipe.desc":"A repeatable procedure or instruction","template.note":"Note","template.file":"File","template.select":"Select type","mime.jpeg":"JPEG image","mime.png":"PNG image","mime.gif":"GIF image","mime.webp":"WebP image","mime.svg":"SVG image","mime.bmp":"BMP image","mime.tiff":"TIFF image","mime.avif":"AVIF image","mime.pdf":"PDF document","mime.word":"Word document","mime.excel":"Excel spreadsheet","mime.ppt":"PowerPoint presentation","mime.zip":"ZIP archive","mime.gzip":"GZIP archive","mime.tar":"TAR archive","mime.sevenz":"7z archive","mime.rar":"RAR archive","mime.text":"Text file","mime.html":"HTML file","mime.css":"CSS file","mime.js":"JavaScript file","mime.json":"JSON file","mime.xml":"XML file","mime.yaml":"YAML file","mime.binary":"Binary file","mime.executable":"Executable file","mime.folder":"Folder","mime.unknown":"Unknown","mime.file":"File","error.nameEmpty":"Name cannot be empty","error.nameInvalid":"Invalid name","error.selectCaseFirst":"Select a case first","error.vaultNotOpen":"Vault not open","delete.files":"files ({count})","file.namePrompt":"Enter file name:","file.pdfUnavailable":"PDF preview is unavailable.","file.previewUnavailable":"Preview is unavailable for this file type.","case.new":"New case","case.namePlaceholder":"Case name","settings.title":"Settings","settings.general":"General","settings.generalDesc":"Basic interface settings.","settings.workspace":"Workspace","settings.workspaceDesc":"Manage data storage.","settings.appearance":"Appearance","settings.localization":"Localization","settings.templates":"Templates","settings.plugins":"Plugins","settings.files":"Files","settings.activity":"Activity","settings.sync":"Sync","settings.backup":"Backups","settings.close":"Close settings","settings.noPlugins":"No plugins installed yet.","settings.openPluginsDir":"Open plugins folder","settings.activityStub":"Activity tracking settings will be here.","settings.backupStub":"Backup settings will be here.","settings.theme":"Interface theme","settings.themeSystem":"System","settings.themeLight":"Light","settings.themeDark":"Dark","settings.language":"Interface language","settings.langRu":"Russian","settings.langEn":"English","settings.langSoon":"coming soon","settings.save":"Save settings","settings.saved":"Settings saved","settings.vaultPath":"Workspace path","settings.noVaultInfo":"No workspace information.","settings.vaultInfo":"Workspace information","settings.openVault":"Open vault folder","settings.changeVault":"Change path","settings.checkIntegrity":"Check integrity","settings.templatesDesc":"Enable or disable templates for creating items.","settings.templateEnabled":"Enabled","settings.templateDisabled":"Disabled","settings.filesStub":"File storage settings will be here.","settings.syncEnabled":"Sync enabled","settings.syncDisabled":"Sync disabled","settings.syncDesc":"Configure connection to the sync server.","settings.serverUrl":"Server URL","settings.deviceName":"Device name","settings.deviceId":"Device ID","settings.lastSync":"Last sync","settings.lastError":"Last error","settings.pendingChanges":"Pending changes","settings.checkConnection":"Check connection","settings.syncNow":"Sync now","settings.reconnect":"Reconnect","settings.disconnect":"Disconnect device","settings.resetKey":"Reset key","settings.confirmDisconnect":"Are you sure you want to disconnect this device?","settings.confirmDisconnectDesc":"Sync will stop. Reconnecting will require username and password.","settings.confirmResetKey":"Reset sync key?","settings.confirmResetKeyDesc":"The current device key will be removed. Reconnection will be required.","settings.connected":"Connected","settings.disconnected":"Disconnected","settings.notConfigured":"Not configured","settings.error":"Error","settings.revoked":"Revoked","settings.status":"Status","firstrun.title":"Welcome to Verstak","firstrun.desc":"Verstak stores data in a local workspace called a vault.","firstrun.pathLabel":"Vault path","firstrun.defaultPath":"Default path","firstrun.browse":"Choose folder","firstrun.create":"Create workspace","firstrun.quit":"Quit","firstrun.pathExists":"The folder exists. A new vault will be created.","firstrun.pathHasVault":"Existing vault found. It will be connected.","firstrun.pathNew":"The path does not exist. A new vault will be created.","firstrun.errorNoWrite":"No write permission for the selected folder.","firstrun.creating":"Creating workspace...","firstrun.created":"Workspace created!","recovery.title":"Workspace not found","recovery.expected":"Expected path","recovery.choose":"Choose another vault","recovery.create":"Create new vault","recovery.settings":"Open settings","recovery.quit":"Quit","recovery.createConfirm":"A new empty workspace will be created. The old path in settings will be replaced.","recovery.createConfirmTitle":"Create a new workspace?","sync.status.connected":"Sync available","sync.status.disconnected":"Server unavailable","sync.status.disabled":"Sync is not configured","sync.status.syncing":"Syncing...","sync.status.error":"Sync error","sync.changes":"changes","sync.details":"Details","sync.configure":"Configure","sync.retry":"Retry","sync.run":"Sync","sync.running":"Syncing...","sync.conflictsCount":"Conflicts: {count}","sync.applyErrorsCount":"Apply errors: {count}","sync.pushedPulled":"Pushed: {pushed}, pulled: {pulled}","error.generic":"An error occurred","error.invalidCredentials":"Invalid username or password","error.accountBlocked":"Account blocked","error.emailNotConfirmed":"Email not confirmed","error.tokenInvalid":"Invalid or expired token","error.tokenExpired":"Token expired"},Go={ru:Rg,en:Mg};let Ko="ru";function k(n,e){var i;const t=Go[Ko];let l=t==null?void 0:t[n];if(l==null&&Ko!=="ru"&&(l=(i=Go.ru)==null?void 0:i[n]),l==null&&(l=n),e!=null)for(const[o,s]of Object.entries(e))l=l.replace(`{${o}}`,String(s));return l}function Mi(n){if(n==null||n<0)return"—";if(n===0)return"0 B";const e=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(n)/Math.log(1024)),e.length-1),l=n/Math.pow(1024,t);return(t===0?l.toFixed(0):l.toFixed(1))+" "+e[t]}const Ss={"image/jpeg":k("mime.jpeg"),"image/png":k("mime.png"),"image/gif":k("mime.gif"),"image/webp":k("mime.webp"),"image/svg+xml":k("mime.svg"),"image/bmp":k("mime.bmp"),"image/tiff":k("mime.tiff"),"image/avif":k("mime.avif"),"application/pdf":k("mime.pdf"),"application/msword":k("mime.word"),"application/vnd.openxmlformats-officedocument.wordprocessingml.document":k("mime.word"),"application/vnd.ms-excel":k("mime.excel"),"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":k("mime.excel"),"application/vnd.ms-powerpoint":k("mime.ppt"),"application/vnd.openxmlformats-officedocument.presentationml.presentation":k("mime.ppt"),"application/zip":k("mime.zip"),"application/gzip":k("mime.gzip"),"application/x-tar":k("mime.tar"),"application/x-7z-compressed":k("mime.sevenz"),"application/x-rar-compressed":k("mime.rar"),"text/plain":k("mime.text"),"text/html":k("mime.html"),"text/css":k("mime.css"),"text/javascript":k("mime.js"),"application/json":k("mime.json"),"application/xml":k("mime.xml"),"application/x-yaml":k("mime.yaml"),"application/octet-stream":k("mime.binary"),"application/x-msdos-program":k("mime.executable"),"inode/directory":k("mime.folder")};function Vo(n){return n?Ss[n]||n:k("mime.unknown")}function Lg(n){if(n.type==="folder")return k("mime.folder");const e=(n.mime||"").toLowerCase();if(Ss[e])return Ss[e];const l=(n.name||"").toLowerCase().split(".").pop();return l?l.toUpperCase():k("mime.file")}function Uf(n){if(n.type==="folder")return"folder";const e=(n.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 l=(n.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(l)?"code":"generic"}const Hf=["image/jpeg","image/png","image/gif","image/webp","image/bmp","image/tiff","image/avif","image/svg+xml"],Wf=["text/plain","text/html","text/css","text/javascript","application/json","application/xml","application/x-yaml","text/x-shellscript","text/csv","text/tab-separated-values","text/x-python","text/x-java","text/x-c","text/x-cpp","text/x-ruby","text/x-perl","text/x-php","text/x-go","text/x-rust","text/markdown"],Gf=["txt","log","conf","ini","yaml","yml","json","xml","csv","tsv","sh","py","js","ts","css","html","md","markdown","cfg","env","gitignore","dockerignore","toml","bat","cmd","ps1","sql","graphql","proto","gradle","cmake","makefile","dockerfile","vbs","lua","r","m","scala","kt","swift","dart","elm","erl","ex","exs","fs","fsi","fsx","hs","lhs","ml","mli","pl","pm","rb","rake","rs","scm","ss","clj","cljs","cljc","edn","lisp","lsp","el","vim","vimrc","zsh","bash","fish","csh","ksh","tcsh","awk","sed","make","mk","nim","nims","d","go","java","svelte","vue","jsx","tsx","coffee","litcoffee","scss","sass","less","styl","properties","dotenv","editorconfig","gitattributes","browserslistrc","htaccess","nginx","shader","glsl","vert","frag","asm","h","hpp","cxx","cc","cpp","capnp","flatbuf","prisma","dtd","xsl","xsd","sch","svg","vtt","srt","sub","m3u","m3u8","pls","xspf","cue","toc","nfo","diz","readme","changelog","copying","license","authors","contributors","setup","config","strings","po","pot","locale","translation"],Kf=["jpg","jpeg","png","gif","webp","bmp","tiff","tif","avif","svg"];function Og(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return!!(Hf.includes(e)||Kf.includes(l)||e.includes("pdf")||Wf.includes(e)||Gf.includes(l))}function Vf(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return Hf.includes(e)||Kf.includes(l)}function Zf(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return Wf.includes(e)||Gf.includes(l)&&l!=="md"&&l!=="markdown"}function Yf(n){return(n.mime||"").toLowerCase().includes("pdf")}function Li(n){const e=(n.name||"").toLowerCase();return e.endsWith(".md")||e.endsWith(".markdown")}function Dg(n){return Vf(n)||Yf(n)}function Pg(n){return Zf(n)||Li(n)}const{window:qg}=Ls;function zg(n){let e,t,l,i=Mi(n[0].size)+"",o;return{c(){e=f("span"),e.textContent="·",t=w(),l=f("span"),o=H(i),r(e,"class","meta-sep svelte-1skuef2")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),a(l,o)},p(s,c){c[0]&1&&i!==(i=Mi(s[0].size)+"")&&Q(o,i)},d(s){s&&(S(e),S(t),S(l))}}}function Bg(n){let e,t,l,i,o;return{c(){e=f("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>',t=w(),l=f("button"),l.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></svg>',r(e,"class","action-btn svelte-1skuef2"),r(e,"title",k("file.openFolder")),r(e,"aria-label",k("file.openFolder")),r(l,"class","action-btn svelte-1skuef2"),r(l,"title",k("file.showInExplorer")),r(l,"aria-label",k("file.showInExplorer"))},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),i||(o=[P(e,"click",We(n[30])),P(l,"click",We(n[11]))],i=!0)},p:se,d(s){s&&(S(e),S(t),S(l)),i=!1,Ce(o)}}}function Fg(n){let e,t,l,i,o,s,c;return{c(){e=f("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=w(),l=f("button"),l.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>',i=w(),o=f("button"),o.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></svg>',r(e,"class","action-btn svelte-1skuef2"),r(e,"title",k("file.preview")),r(e,"aria-label",k("file.preview")),r(l,"class","action-btn svelte-1skuef2"),r(l,"title",k("file.openExternal")),r(l,"aria-label",k("file.openExternal")),r(o,"class","action-btn svelte-1skuef2"),r(o,"title",k("file.showInExplorer")),r(o,"aria-label",k("file.showInExplorer"))},m(u,d){C(u,e,d),C(u,t,d),C(u,l,d),C(u,i,d),C(u,o,d),s||(c=[P(e,"click",We(n[29])),P(l,"click",We(n[10])),P(o,"click",We(n[11]))],s=!0)},p:se,d(u){u&&(S(e),S(t),S(l),S(i),S(o)),s=!1,Ce(c)}}}function Zo(n){let e,t,l,i,o,s,c,u,d=k("common.open")+"",p,h,m,g,b,v,y,E,T=k("file.openExternal")+"",N,A,I,O,R,D,B=k("file.showInExplorer")+"",j,U,z,W,K,Y,F,L,M,q=k("common.rename")+"",X,Z,J,ee,te,le,_e,oe=k("common.duplicate")+"",ze,Ge,Ie,ne,re,Ne,Fe,we,je,xe=k("common.cut")+"",Ae,Ve,Ue,Se,He,Oe,Ke,Pe=k("common.copy")+"",ue,be,x,ye,me,Re,ft,it,Ze,dt=k("common.delete")+"",Je,pe,qe;return{c(){e=f("div"),t=w(),l=f("div"),i=f("button"),o=ae("svg"),s=ae("path"),c=ae("circle"),u=w(),p=H(d),h=w(),m=f("button"),g=ae("svg"),b=ae("path"),v=ae("polyline"),y=ae("line"),E=w(),N=H(T),A=w(),I=f("button"),O=ae("svg"),R=ae("path"),D=w(),j=H(B),U=w(),z=f("div"),W=w(),K=f("button"),Y=ae("svg"),F=ae("path"),L=ae("path"),M=w(),X=H(q),Z=w(),J=f("button"),ee=ae("svg"),te=ae("rect"),le=ae("path"),_e=w(),ze=H(oe),Ge=w(),Ie=f("button"),ne=ae("svg"),re=ae("circle"),Ne=ae("circle"),Fe=ae("line"),we=ae("line"),je=w(),Ae=H(xe),Ve=w(),Ue=f("button"),Se=ae("svg"),He=ae("rect"),Oe=ae("path"),Ke=w(),ue=H(Pe),be=w(),x=f("div"),ye=w(),me=f("button"),Re=ae("svg"),ft=ae("polyline"),it=ae("path"),Ze=w(),Je=H(dt),r(e,"class","menu-backdrop svelte-1skuef2"),r(e,"role","presentation"),r(s,"d","M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"),r(c,"cx","12"),r(c,"cy","12"),r(c,"r","3"),r(o,"width","14"),r(o,"height","14"),r(o,"viewBox","0 0 24 24"),r(o,"fill","none"),r(o,"stroke","currentColor"),r(o,"stroke-width","2"),r(o,"stroke-linecap","round"),r(o,"stroke-linejoin","round"),r(i,"class","menu-item svelte-1skuef2"),r(i,"role","menuitem"),r(b,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),r(v,"points","15 3 21 3 21 9"),r(y,"x1","10"),r(y,"y1","14"),r(y,"x2","21"),r(y,"y2","3"),r(g,"width","14"),r(g,"height","14"),r(g,"viewBox","0 0 24 24"),r(g,"fill","none"),r(g,"stroke","currentColor"),r(g,"stroke-width","2"),r(g,"stroke-linecap","round"),r(g,"stroke-linejoin","round"),r(m,"class","menu-item svelte-1skuef2"),r(m,"role","menuitem"),r(R,"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"),r(O,"width","14"),r(O,"height","14"),r(O,"viewBox","0 0 24 24"),r(O,"fill","none"),r(O,"stroke","currentColor"),r(O,"stroke-width","2"),r(O,"stroke-linecap","round"),r(O,"stroke-linejoin","round"),r(I,"class","menu-item svelte-1skuef2"),r(I,"role","menuitem"),r(z,"class","menu-sep svelte-1skuef2"),r(F,"d","M12 20h9"),r(L,"d","M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"),r(Y,"width","14"),r(Y,"height","14"),r(Y,"viewBox","0 0 24 24"),r(Y,"fill","none"),r(Y,"stroke","currentColor"),r(Y,"stroke-width","2"),r(Y,"stroke-linecap","round"),r(Y,"stroke-linejoin","round"),r(K,"class","menu-item svelte-1skuef2"),r(K,"role","menuitem"),r(te,"x","9"),r(te,"y","9"),r(te,"width","13"),r(te,"height","13"),r(te,"rx","2"),r(te,"ry","2"),r(le,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),r(ee,"width","14"),r(ee,"height","14"),r(ee,"viewBox","0 0 24 24"),r(ee,"fill","none"),r(ee,"stroke","currentColor"),r(ee,"stroke-width","2"),r(ee,"stroke-linecap","round"),r(ee,"stroke-linejoin","round"),r(J,"class","menu-item svelte-1skuef2"),r(J,"role","menuitem"),r(re,"cx","6"),r(re,"cy","6"),r(re,"r","3"),r(Ne,"cx","6"),r(Ne,"cy","18"),r(Ne,"r","3"),r(Fe,"x1","20"),r(Fe,"y1","4"),r(Fe,"x2","8.12"),r(Fe,"y2","15.88"),r(we,"x1","8.12"),r(we,"y1","8.12"),r(we,"x2","20"),r(we,"y2","20"),r(ne,"width","14"),r(ne,"height","14"),r(ne,"viewBox","0 0 24 24"),r(ne,"fill","none"),r(ne,"stroke","currentColor"),r(ne,"stroke-width","2"),r(ne,"stroke-linecap","round"),r(ne,"stroke-linejoin","round"),r(Ie,"class","menu-item svelte-1skuef2"),r(Ie,"role","menuitem"),r(He,"x","9"),r(He,"y","9"),r(He,"width","13"),r(He,"height","13"),r(He,"rx","2"),r(He,"ry","2"),r(Oe,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),r(Se,"width","14"),r(Se,"height","14"),r(Se,"viewBox","0 0 24 24"),r(Se,"fill","none"),r(Se,"stroke","currentColor"),r(Se,"stroke-width","2"),r(Se,"stroke-linecap","round"),r(Se,"stroke-linejoin","round"),r(Ue,"class","menu-item svelte-1skuef2"),r(Ue,"role","menuitem"),r(x,"class","menu-sep svelte-1skuef2"),r(ft,"points","3 6 5 6 21 6"),r(it,"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"),r(Re,"width","14"),r(Re,"height","14"),r(Re,"viewBox","0 0 24 24"),r(Re,"fill","none"),r(Re,"stroke","currentColor"),r(Re,"stroke-width","2"),r(Re,"stroke-linecap","round"),r(Re,"stroke-linejoin","round"),r(me,"class","menu-item menu-item-danger svelte-1skuef2"),r(me,"role","menuitem"),r(l,"class","menu svelte-1skuef2"),sn(l,"left",n[3]+"px"),sn(l,"top",n[4]+"px"),sn(l,"position","fixed"),r(l,"role","menu"),r(l,"tabindex","-1")},m(pt,vt){C(pt,e,vt),C(pt,t,vt),C(pt,l,vt),a(l,i),a(i,o),a(o,s),a(o,c),a(i,u),a(i,p),a(l,h),a(l,m),a(m,g),a(g,b),a(g,v),a(g,y),a(m,E),a(m,N),a(l,A),a(l,I),a(I,O),a(O,R),a(I,D),a(I,j),a(l,U),a(l,z),a(l,W),a(l,K),a(K,Y),a(Y,F),a(Y,L),a(K,M),a(K,X),a(l,Z),a(l,J),a(J,ee),a(ee,te),a(ee,le),a(J,_e),a(J,ze),a(l,Ge),a(l,Ie),a(Ie,ne),a(ne,re),a(ne,Ne),a(ne,Fe),a(ne,we),a(Ie,je),a(Ie,Ae),a(l,Ve),a(l,Ue),a(Ue,Se),a(Se,He),a(Se,Oe),a(Ue,Ke),a(Ue,ue),a(l,be),a(l,x),a(l,ye),a(l,me),a(me,Re),a(Re,ft),a(Re,it),a(me,Ze),a(me,Je),pe||(qe=[P(e,"click",We(n[19])),P(i,"click",n[17]),P(m,"click",n[10]),P(I,"click",n[11]),P(K,"click",n[13]),P(J,"click",n[14]),P(Ie,"click",n[15]),P(Ue,"click",n[16]),P(me,"click",n[12]),P(l,"click",We(n[28])),P(l,"keydown",n[31])],pe=!0)},p(pt,vt){vt[0]&8&&sn(l,"left",pt[3]+"px"),vt[0]&16&&sn(l,"top",pt[4]+"px")},d(pt){pt&&(S(e),S(t),S(l)),pe=!1,Ce(qe)}}}function jg(n){let e,t,l,i,o,s,c=n[0].name+"",u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z,W;l=new jf({props:{kind:n[6],size:22}});let K=!n[7]&&zg(n);function Y(q,X){return q[7]?Bg:Fg}let L=Y(n)(n),M=n[2]&&Zo(n);return{c(){e=f("div"),t=f("div"),Qe(l.$$.fragment),i=w(),o=f("div"),s=f("div"),u=H(c),p=w(),h=f("div"),m=f("span"),m.textContent=`${n[8]}`,g=w(),K&&K.c(),b=w(),v=f("div"),L.c(),y=w(),E=f("button"),T=ae("svg"),N=ae("circle"),A=ae("circle"),I=ae("circle"),O=w(),R=f("button"),R.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>',B=w(),M&&M.c(),j=kt(),r(t,"class","file-row-icon svelte-1skuef2"),r(s,"class","file-row-name svelte-1skuef2"),r(s,"title",d=n[0].name),r(h,"class","file-row-meta svelte-1skuef2"),r(o,"class","file-row-body svelte-1skuef2"),r(N,"cx","12"),r(N,"cy","5"),r(N,"r","2"),r(A,"cx","12"),r(A,"cy","12"),r(A,"r","2"),r(I,"cx","12"),r(I,"cy","19"),r(I,"r","2"),r(T,"width","16"),r(T,"height","16"),r(T,"viewBox","0 0 24 24"),r(T,"fill","currentColor"),r(E,"class","action-btn svelte-1skuef2"),r(E,"title",k("file.more")),r(E,"aria-label",k("file.more")),r(E,"aria-expanded",n[2]),r(R,"class","action-btn action-btn-danger svelte-1skuef2"),r(R,"title",k("common.delete")),r(R,"aria-label",k("common.delete")),r(v,"class","file-row-actions svelte-1skuef2"),r(e,"class","file-row svelte-1skuef2"),r(e,"role","button"),r(e,"tabindex","0"),r(e,"draggable","true"),r(e,"aria-label",D=n[7]?k("file.ariaFolder")+" "+n[0].name:k("file.ariaFile")+" "+n[0].name),ce(e,"file-row--selected",n[1])},m(q,X){C(q,e,X),a(e,t),Ye(l,t,null),a(e,i),a(e,o),a(o,s),a(s,u),a(o,p),a(o,h),a(h,m),a(h,g),K&&K.m(h,null),a(e,b),a(e,v),L.m(v,null),a(v,y),a(v,E),a(E,T),a(T,N),a(T,A),a(T,I),a(v,O),a(v,R),C(q,B,X),M&&M.m(q,X),C(q,j,X),U=!0,z||(W=[P(qg,"click",n[19]),P(E,"click",We(n[18])),P(R,"click",We(n[12])),P(e,"click",n[9]),P(e,"keydown",n[24]),P(e,"contextmenu",n[23]),P(e,"dragstart",n[20]),P(e,"dragover",n[21]),P(e,"drop",n[22])],z=!0)},p(q,X){(!U||X[0]&1)&&c!==(c=q[0].name+"")&&Q(u,c),(!U||X[0]&1&&d!==(d=q[0].name))&&r(s,"title",d),q[7]||K.p(q,X),L.p(q,X),(!U||X[0]&4)&&r(E,"aria-expanded",q[2]),(!U||X[0]&1&&D!==(D=q[7]?k("file.ariaFolder")+" "+q[0].name:k("file.ariaFile")+" "+q[0].name))&&r(e,"aria-label",D),(!U||X[0]&2)&&ce(e,"file-row--selected",q[1]),q[2]?M?M.p(q,X):(M=Zo(q),M.c(),M.m(j.parentNode,j)):M&&(M.d(1),M=null)},i(q){U||(ge(l.$$.fragment,q),U=!0)},o(q){ke(l.$$.fragment,q),U=!1},d(q){q&&(S(e),S(B),S(j)),Xe(l),K&&K.d(),L.d(),M&&M.d(q),z=!1,Ce(W)}}}function Ug(n,e,t){let{item:l}=e,{selected:i=!1}=e,{onDragStart:o}=e,{onDragOver:s}=e,{onDrop:c}=e;const u=pn(),d=Uf(l),p=l.type==="folder",h=Lg(l);let m=!1,g=0,b=0,v=null;function y(X){X.ctrlKey||X.metaKey?u("toggleSelect",l.id):X.shiftKey?u("rangeSelect",l.id):v?(clearTimeout(v),v=null,p?u("navigate",l.id):u("preview",l)):v=setTimeout(()=>{v=null,u("selectOne",l.id)},250)}function E(){u("openExternal",l.fileId)}function T(){t(2,m=!1),u("showInFolder",l.nodeId||l.id)}function N(){t(2,m=!1),u("delete",{id:l.id,type:l.type})}function A(){t(2,m=!1),u("rename",{id:l.id,name:l.name})}function I(){t(2,m=!1),u("duplicate",l.id)}function O(){t(2,m=!1),u("cut",l.id)}function R(){t(2,m=!1),u("copy",l.id)}function D(){t(2,m=!1),p?u("navigate",l.id):u("preview",l)}function B(X){if(X){X.stopPropagation();const Z=X.currentTarget.getBoundingClientRect();t(3,g=Math.min(Z.right,window.innerWidth-240)),t(4,b=Math.min(Z.bottom,window.innerHeight-320)),console.log("[FileTreeRow] menu source=button x="+g+" y="+b)}t(2,m=!m)}function j(){t(2,m=!1)}function U(X){o&&o(X,l.id)}function z(X){s&&p&&s(X,l.id)}function W(X){c&&p&&c(X,l.id)}function K(X){X.preventDefault(),t(3,g=Math.min(X.clientX,window.innerWidth-240)),t(4,b=Math.min(X.clientY,window.innerHeight-320)),console.log("[FileTreeRow] menu source=contextmenu x="+g+" y="+b),t(2,m=!0)}function Y(X){(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),y(X))}function F(X){Ds.call(this,n,X)}const L=()=>u("preview",l),M=()=>u("navigate",l.id),q=X=>{X.key==="Escape"&&(X.stopPropagation(),j())};return n.$$set=X=>{"item"in X&&t(0,l=X.item),"selected"in X&&t(1,i=X.selected),"onDragStart"in X&&t(25,o=X.onDragStart),"onDragOver"in X&&t(26,s=X.onDragOver),"onDrop"in X&&t(27,c=X.onDrop)},[l,i,m,g,b,u,d,p,h,y,E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,o,s,c,F,L,M,q]}class Hg extends ut{constructor(e){super(),ct(this,e,Ug,jg,at,{item:0,selected:1,onDragStart:25,onDragOver:26,onDrop:27},null,[-1,-1])}}function Yo(n,e,t){const l=n.slice();return l[4]=e[t],l[6]=t,l}function Wg(n){let e;return{c(){e=f("span"),e.textContent="/",r(e,"class","sep svelte-csi2lb")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Gg(n){let e,t=n[4].name+"",l,i,o;function s(){return n[2](n[6])}return{c(){e=f("button"),l=H(t),r(e,"class","crumb crumb--link svelte-csi2lb")},m(c,u){C(c,e,u),a(e,l),i||(o=P(e,"click",s),i=!0)},p(c,u){n=c,u&1&&t!==(t=n[4].name+"")&&Q(l,t)},d(c){c&&S(e),i=!1,o()}}}function Kg(n){let e,t=n[4].name+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","crumb crumb--current svelte-csi2lb")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&1&&t!==(t=i[4].name+"")&&Q(l,t)},d(i){i&&S(e)}}}function Xo(n){let e,t,l=n[6]>0&&Wg();function i(c,u){return c[6]===c[0].length-1?Kg:Gg}let o=i(n),s=o(n);return{c(){l&&l.c(),e=w(),s.c(),t=kt()},m(c,u){l&&l.m(c,u),C(c,e,u),s.m(c,u),C(c,t,u)},p(c,u){o===(o=i(c))&&s?s.p(c,u):(s.d(1),s=o(c),s&&(s.c(),s.m(t.parentNode,t)))},d(c){c&&(S(e),S(t)),l&&l.d(c),s.d(c)}}}function Vg(n){let e,t=Te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Xo(Yo(n,t,i));return{c(){e=f("nav");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","breadcrumbs svelte-csi2lb")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,[o]){if(o&3){t=Te(i[0]);let s;for(s=0;s<t.length;s+=1){const c=Yo(i,t,s);l[s]?l[s].p(c,o):(l[s]=Xo(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},i:se,o:se,d(i){i&&S(e),et(l,i)}}}function Zg(n,e,t){let{crumbs:l=[]}=e;const i=pn();function o(c){i("navigate",c)}const s=c=>o(c);return n.$$set=c=>{"crumbs"in c&&t(0,l=c.crumbs)},[l,o,s]}class Xf extends ut{constructor(e){super(),ct(this,e,Zg,Vg,at,{crumbs:0})}}function Ps(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var gl=Ps();function Jf(n){gl=n}var cl={exec:()=>null};function Nl(n){let e=[];return t=>{let l=Math.max(0,Math.min(3,t-1)),i=e[l];return i||(i=n(l),e[l]=i),i}}function rt(n,e=""){let t=typeof n=="string"?n:n.source,l={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(Vt.caret,"$1"),t=t.replace(i,s),l},getRegex:()=>new RegExp(t,e)};return l}var Yg=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),Vt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Nl(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Nl(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Nl(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Nl(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Nl(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Nl(n=>new RegExp(`^ {0,${n}}>`))},Xg=/^(?:[ \t]*(?:\n|$))+/,Jg=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qg=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,si=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xg=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qs=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xf=rt(Qf).replace(/bull/g,qs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$g=rt(Qf).replace(/bull/g,qs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,e_=/^[^\n]+/,Bs=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,t_=rt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Bs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),n_=rt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,qs).getRegex(),Ui="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Fs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,l_=rt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Fs).replace("tag",Ui).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$f=rt(zs).replace("hr",si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ui).getRegex(),i_=rt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$f).getRegex(),js={blockquote:i_,code:Jg,def:t_,fences:Qg,heading:xg,hr:si,html:l_,lheading:xf,list:n_,newline:Xg,paragraph:$f,table:cl,text:e_},Jo=rt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ui).getRegex(),s_={...js,lheading:$g,table:Jo,paragraph:rt(zs).replace("hr",si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jo).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ui).getRegex()},o_={...js,html:rt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:rt(zs).replace("hr",si).replace("heading",` *#{1,6} *[^
|
||
]`).replace("lheading",xf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},r_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,a_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ed=/^( {2,}|\\)\n(?!\s*$)/,c_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Bl=/[\p{P}\p{S}]/u,Hi=/[\s\p{P}\p{S}]/u,Us=/[^\s\p{P}\p{S}]/u,u_=rt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Hi).getRegex(),td=/(?!~)[\p{P}\p{S}]/u,f_=/(?!~)[\s\p{P}\p{S}]/u,d_=/(?:[^\s\p{P}\p{S}]|~)/u,p_=rt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Yg?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),nd=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,h_=rt(nd,"u").replace(/punct/g,Bl).getRegex(),m_=rt(nd,"u").replace(/punct/g,td).getRegex(),ld="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",g_=rt(ld,"gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,Hi).replace(/punct/g,Bl).getRegex(),__=rt(ld,"gu").replace(/notPunctSpace/g,d_).replace(/punctSpace/g,f_).replace(/punct/g,td).getRegex(),b_=rt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,Hi).replace(/punct/g,Bl).getRegex(),k_=rt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Bl).getRegex(),v_="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",w_=rt(v_,"gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,Hi).replace(/punct/g,Bl).getRegex(),y_=rt(/\\(punct)/,"gu").replace(/punct/g,Bl).getRegex(),E_=rt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),T_=rt(Fs).replace("(?:-->|$)","-->").getRegex(),S_=rt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",T_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Oi=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,C_=rt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Oi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),id=rt(/^!?\[(label)\]\[(ref)\]/).replace("label",Oi).replace("ref",Bs).getRegex(),sd=rt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Bs).getRegex(),A_=rt("reflink|nolink(?!\\()","g").replace("reflink",id).replace("nolink",sd).getRegex(),Qo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Hs={_backpedal:cl,anyPunctuation:y_,autolink:E_,blockSkip:p_,br:ed,code:a_,del:cl,delLDelim:cl,delRDelim:cl,emStrongLDelim:h_,emStrongRDelimAst:g_,emStrongRDelimUnd:b_,escape:r_,link:C_,nolink:sd,punctuation:u_,reflink:id,reflinkSearch:A_,tag:S_,text:c_,url:cl},N_={...Hs,link:rt(/^!?\[(label)\]\((.*?)\)/).replace("label",Oi).getRegex(),reflink:rt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Oi).getRegex()},Cs={...Hs,emStrongRDelimAst:__,emStrongLDelim:m_,delLDelim:k_,delRDelim:w_,url:rt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Qo).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:rt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Qo).getRegex()},I_={...Cs,br:rt(ed).replace("{2,}","*").getRegex(),text:rt(Cs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ki={normal:js,gfm:s_,pedantic:o_},Kl={normal:Hs,gfm:Cs,breaks:I_,pedantic:N_},R_={"&":"&","<":"<",">":">",'"':""","'":"'"},xo=n=>R_[n];function An(n,e){if(e){if(Vt.escapeTest.test(n))return n.replace(Vt.escapeReplace,xo)}else if(Vt.escapeTestNoEncode.test(n))return n.replace(Vt.escapeReplaceNoEncode,xo);return n}function $o(n){try{n=encodeURI(n).replace(Vt.percentDecode,"%")}catch{return null}return n}function er(n,e){var o;let t=n.replace(Vt.findPipe,(s,c,u)=>{let d=!1,p=c;for(;--p>=0&&u[p]==="\\";)d=!d;return d?"|":" |"}),l=t.split(Vt.splitPipe),i=0;if(l[0].trim()||l.shift(),l.length>0&&!((o=l.at(-1))!=null&&o.trim())&&l.pop(),e)if(l.length>e)l.splice(e);else for(;l.length<e;)l.push("");for(;i<l.length;i++)l[i]=l[i].trim().replace(Vt.slashPipe,"|");return l}function Gn(n,e,t){let l=n.length;if(l===0)return"";let i=0;for(;i<l&&n.charAt(l-i-1)===e;)i++;return n.slice(0,l-i)}function tr(n){let e=n.split(`
|
||
`),t=e.length-1;for(;t>=0&&Vt.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(`
|
||
`)}function M_(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let l=0;l<n.length;l++)if(n[l]==="\\")l++;else if(n[l]===e[0])t++;else if(n[l]===e[1]&&(t--,t<0))return l;return t>0?-2:-1}function L_(n,e=0){let t=e,l="";for(let i of n)if(i===" "){let o=4-t%4;l+=" ".repeat(o),t+=o}else l+=i,t++;return l}function nr(n,e,t,l,i){let o=e.href,s=e.title||null,c=n[1].replace(i.other.outputLinkReplace,"$1");l.state.inLink=!0;let u={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:o,title:s,text:c,tokens:l.inlineTokens(c)};return l.state.inLink=!1,u}function O_(n,e,t){let l=n.match(t.other.indentCodeCompensation);if(l===null)return e;let i=l[1];return e.split(`
|
||
`).map(o=>{let s=o.match(t.other.beginningSpace);if(s===null)return o;let[c]=s;return c.length>=i.length?o.slice(i.length):o}).join(`
|
||
`)}var Di=class{constructor(n){lt(this,"options");lt(this,"rules");lt(this,"lexer");this.options=n||gl}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=this.options.pedantic?e[0]:tr(e[0]),l=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:l}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],l=O_(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:l}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let l=Gn(t,"#");(this.options.pedantic||!l||this.rules.other.endingSpaceChar.test(l))&&(t=l.trim())}return{type:"heading",raw:Gn(e[0],`
|
||
`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Gn(e[0],`
|
||
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Gn(e[0],`
|
||
`).split(`
|
||
`),l="",i="",o=[];for(;t.length>0;){let s=!1,c=[],u;for(u=0;u<t.length;u++)if(this.rules.other.blockquoteStart.test(t[u]))c.push(t[u]),s=!0;else if(!s)c.push(t[u]);else break;t=t.slice(u);let d=c.join(`
|
||
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
||
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");l=l?`${l}
|
||
${d}`:d,i=i?`${i}
|
||
${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=h,t.length===0)break;let m=o.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let g=m,b=g.raw+`
|
||
`+t.join(`
|
||
`),v=this.blockquote(b);o[o.length-1]=v,l=l.substring(0,l.length-g.raw.length)+v.raw,i=i.substring(0,i.length-g.text.length)+v.text;break}else if((m==null?void 0:m.type)==="list"){let g=m,b=g.raw+`
|
||
`+t.join(`
|
||
`),v=this.list(b);o[o.length-1]=v,l=l.substring(0,l.length-m.raw.length)+v.raw,i=i.substring(0,i.length-g.raw.length)+v.raw,t=b.substring(o.at(-1).raw.length).split(`
|
||
`);continue}}return{type:"blockquote",raw:l,tokens:o,text:i}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),l=t.length>1,i={type:"list",raw:"",ordered:l,start:l?+t.slice(0,-1):"",loose:!1,items:[]};t=l?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=l?t:"[*+-]");let o=this.rules.other.listItemRegex(t),s=!1;for(;n;){let u=!1,d="",p="";if(!(e=o.exec(n))||this.rules.block.hr.test(n))break;d=e[0],n=n.substring(d.length);let h=L_(e[2].split(`
|
||
`,1)[0],e[1].length),m=n.split(`
|
||
`,1)[0],g=!h.trim(),b=0;if(this.options.pedantic?(b=2,p=h.trimStart()):g?b=e[1].length+1:(b=h.search(this.rules.other.nonSpaceChar),b=b>4?1:b,p=h.slice(b),b+=e[1].length),g&&this.rules.other.blankLine.test(m)&&(d+=m+`
|
||
`,n=n.substring(m.length+1),u=!0),!u){let v=this.rules.other.nextBulletRegex(b),y=this.rules.other.hrRegex(b),E=this.rules.other.fencesBeginRegex(b),T=this.rules.other.headingBeginRegex(b),N=this.rules.other.htmlBeginRegex(b),A=this.rules.other.blockquoteBeginRegex(b);for(;n;){let I=n.split(`
|
||
`,1)[0],O;if(m=I,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),O=m):O=m.replace(this.rules.other.tabCharGlobal," "),E.test(m)||T.test(m)||N.test(m)||A.test(m)||v.test(m)||y.test(m))break;if(O.search(this.rules.other.nonSpaceChar)>=b||!m.trim())p+=`
|
||
`+O.slice(b);else{if(g||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(h)||T.test(h)||y.test(h))break;p+=`
|
||
`+m}g=!m.trim(),d+=I+`
|
||
`,n=n.substring(I.length+1),h=O.slice(b)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(s=!0)),i.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=d}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let d=u.tokens[0];if(u.task&&((d==null?void 0:d.type)==="text"||(d==null?void 0:d.type)==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(u.raw);if(p){let h={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};u.checked=h.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=h.raw+u.tokens[0].raw,u.tokens[0].text=h.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(h)):u.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):u.tokens.unshift(h)}}else u.task&&(u.task=!1);if(!i.loose){let p=u.tokens.filter(m=>m.type==="space"),h=p.length>0&&p.some(m=>this.rules.other.anyLine.test(m.raw));i.loose=h}}if(i.loose)for(let u of i.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return i}}html(n){let e=this.rules.block.html.exec(n);if(e){let t=tr(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:Gn(e[0],`
|
||
`),href:l,title:i}}}table(n){var s;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=er(e[1]),l=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(s=e[3])!=null&&s.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||
`):[],o={type:"table",raw:Gn(e[0],`
|
||
`),header:[],align:[],rows:[]};if(t.length===l.length){for(let c of l)this.rules.other.tableAlignRight.test(c)?o.align.push("right"):this.rules.other.tableAlignCenter.test(c)?o.align.push("center"):this.rules.other.tableAlignLeft.test(c)?o.align.push("left"):o.align.push(null);for(let c=0;c<t.length;c++)o.header.push({text:t[c],tokens:this.lexer.inline(t[c]),header:!0,align:o.align[c]});for(let c of i)o.rows.push(er(c,o.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:o.align[d]})));return o}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:Gn(e[0],`
|
||
`),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
|
||
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let o=Gn(t.slice(0,-1),"\\");if((t.length-o.length)%2===0)return}else{let o=M_(e[2],"()");if(o===-2)return;if(o>-1){let s=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let l=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(l);o&&(l=o[1],i=o[3])}else i=e[3]?e[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?l=l.slice(1):l=l.slice(1,-1)),nr(e,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let l=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[l.toLowerCase()];if(!i){let o=t[0].charAt(0);return{type:"text",raw:o,text:o}}return nr(t,i,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let l=this.rules.inline.emStrongLDelim.exec(n);if(!(!l||!l[1]&&!l[2]&&!l[3]&&!l[4]||l[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[3])||!t||this.rules.inline.punctuation.exec(t))){let i=[...l[0]].length-1,o,s,c=i,u=0,d=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+i);(l=d.exec(e))!==null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o)continue;if(s=[...o].length,l[3]||l[4]){c+=s;continue}else if((l[5]||l[6])&&i%3&&!((i+s)%3)){u+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c+u);let p=[...l[0]][0].length,h=n.slice(0,i+l.index+p+s);if(Math.min(i,s)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let m=h.slice(2,-2);return{type:"strong",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return l&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let l=this.rules.inline.delLDelim.exec(n);if(l&&(!l[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...l[0]].length-1,o,s,c=i,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*n.length+i);(l=u.exec(e))!==null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o||(s=[...o].length,s!==i))continue;if(l[3]||l[4]){c+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c);let d=[...l[0]][0].length,p=n.slice(0,i+l.index+d+s),h=p.slice(i,-i);return{type:"del",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,l;return e[2]==="@"?(t=e[1],l="mailto:"+t):(t=e[1],l=t),{type:"link",raw:e[0],text:t,href:l,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let l,i;if(e[2]==="@")l=e[0],i="mailto:"+l;else{let o;do o=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(o!==e[0]);l=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:l,href:i,tokens:[{type:"text",raw:l,text:l}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},gn=class As{constructor(e){lt(this,"tokens");lt(this,"options");lt(this,"state");lt(this,"inlineQueue");lt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||gl,this.options.tokenizer=this.options.tokenizer||new Di,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Vt,block:ki.normal,inline:Kl.normal};this.options.pedantic?(t.block=ki.pedantic,t.inline=Kl.pedantic):this.options.gfm&&(t.block=ki.gfm,this.options.breaks?t.inline=Kl.breaks:t.inline=Kl.gfm),this.tokenizer.rules=t}static get rules(){return{block:ki,inline:Kl}}static lex(e,t){return new As(t).lex(e)}static lexInline(e,t){return new As(t).inlineTokens(e)}lex(e){e=e.replace(Vt.carriageReturn,`
|
||
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let l=this.inlineQueue[t];this.inlineTokens(l.src,l.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],l=!1){var o,s,c;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Vt.tabCharGlobal," ").replace(Vt.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let u;if((s=(o=this.options.extensions)==null?void 0:o.block)!=null&&s.some(p=>(u=p.call({lexer:this},e,t))?(e=e.substring(u.raw.length),t.push(u),!0):!1))continue;if(u=this.tokenizer.space(e)){e=e.substring(u.raw.length);let p=t.at(-1);u.raw.length===1&&p!==void 0?p.raw+=`
|
||
`:t.push(u);continue}if(u=this.tokenizer.code(e)){e=e.substring(u.raw.length);let p=t.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
||
`)?"":`
|
||
`)+u.raw,p.text+=`
|
||
`+u.text,this.inlineQueue.at(-1).src=p.text):t.push(u);continue}if(u=this.tokenizer.fences(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.heading(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.hr(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.blockquote(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.list(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.html(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.def(e)){e=e.substring(u.raw.length);let p=t.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
||
`)?"":`
|
||
`)+u.raw,p.text+=`
|
||
`+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},t.push(u));continue}if(u=this.tokenizer.table(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.lheading(e)){e=e.substring(u.raw.length),t.push(u);continue}let d=e;if((c=this.options.extensions)!=null&&c.startBlock){let p=1/0,h=e.slice(1),m;this.options.extensions.startBlock.forEach(g=>{m=g.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(d=e.substring(0,p+1))}if(this.state.top&&(u=this.tokenizer.paragraph(d))){let p=t.at(-1);l&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
|
||
`)?"":`
|
||
`)+u.raw,p.text+=`
|
||
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):t.push(u),l=d.length!==e.length,e=e.substring(u.raw.length);continue}if(u=this.tokenizer.text(e)){e=e.substring(u.raw.length);let p=t.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
||
`)?"":`
|
||
`)+u.raw,p.text+=`
|
||
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):t.push(u);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var d,p,h,m,g;this.tokenizer.lexer=this;let l=e,i=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(l))!==null;)b.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(l))!==null;)l=l.slice(0,i.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(l))!==null;)o=i[2]?i[2].length:0,l=l.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);l=((p=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:p.call({lexer:this},l))??l;let s=!1,c="",u=1/0;for(;e;){if(e.length<u)u=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}s||(c=""),s=!1;let b;if((m=(h=this.options.extensions)==null?void 0:h.inline)!=null&&m.some(y=>(b=y.call({lexer:this},e,t))?(e=e.substring(b.raw.length),t.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let y=t.at(-1);b.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=b.raw,y.text+=b.text):t.push(b);continue}if(b=this.tokenizer.emStrong(e,l,c)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.del(e,l,c)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),t.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),t.push(b);continue}let v=e;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0,E=e.slice(1),T;this.options.extensions.startInline.forEach(N=>{T=N.call({lexer:this},E),typeof T=="number"&&T>=0&&(y=Math.min(y,T))}),y<1/0&&y>=0&&(v=e.substring(0,y+1))}if(b=this.tokenizer.inlineText(v)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(c=b.raw.slice(-1)),s=!0;let y=t.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=b.raw,y.text+=b.text):t.push(b);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},Pi=class{constructor(n){lt(this,"options");lt(this,"parser");this.options=n||gl}space(n){return""}code({text:n,lang:e,escaped:t}){var o;let l=(o=(e||"").match(Vt.notSpaceStart))==null?void 0:o[0],i=n.replace(Vt.endingNewline,"")+`
|
||
`;return l?'<pre><code class="language-'+An(l)+'">'+(t?i:An(i,!0))+`</code></pre>
|
||
`:"<pre><code>"+(t?i:An(i,!0))+`</code></pre>
|
||
`}blockquote({tokens:n}){return`<blockquote>
|
||
${this.parser.parse(n)}</blockquote>
|
||
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
||
`}hr(n){return`<hr>
|
||
`}list(n){let e=n.ordered,t=n.start,l="";for(let s=0;s<n.items.length;s++){let c=n.items[s];l+=this.listitem(c)}let i=e?"ol":"ul",o=e&&t!==1?' start="'+t+'"':"";return"<"+i+o+`>
|
||
`+l+"</"+i+`>
|
||
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
||
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
||
`}table(n){let e="",t="";for(let i=0;i<n.header.length;i++)t+=this.tablecell(n.header[i]);e+=this.tablerow({text:t});let l="";for(let i=0;i<n.rows.length;i++){let o=n.rows[i];t="";for(let s=0;s<o.length;s++)t+=this.tablecell(o[s]);l+=this.tablerow({text:t})}return l&&(l=`<tbody>${l}</tbody>`),`<table>
|
||
<thead>
|
||
`+e+`</thead>
|
||
`+l+`</table>
|
||
`}tablerow({text:n}){return`<tr>
|
||
${n}</tr>
|
||
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
||
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${An(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let l=this.parser.parseInline(t),i=$o(n);if(i===null)return l;n=i;let o='<a href="'+n+'"';return e&&(o+=' title="'+An(e)+'"'),o+=">"+l+"</a>",o}image({href:n,title:e,text:t,tokens:l}){l&&(t=this.parser.parseInline(l,this.parser.textRenderer));let i=$o(n);if(i===null)return An(t);n=i;let o=`<img src="${n}" alt="${An(t)}"`;return e&&(o+=` title="${An(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:An(n.text)}},Ws=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},_n=class Ns{constructor(e){lt(this,"options");lt(this,"renderer");lt(this,"textRenderer");this.options=e||gl,this.options.renderer=this.options.renderer||new Pi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ws}static parse(e,t){return new Ns(t).parse(e)}static parseInline(e,t){return new Ns(t).parseInline(e)}parse(e){var l,i;this.renderer.parser=this;let t="";for(let o=0;o<e.length;o++){let s=e[o];if((i=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&i[s.type]){let u=s,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){t+=d||"";continue}}let c=s;switch(c.type){case"space":{t+=this.renderer.space(c);break}case"hr":{t+=this.renderer.hr(c);break}case"heading":{t+=this.renderer.heading(c);break}case"code":{t+=this.renderer.code(c);break}case"table":{t+=this.renderer.table(c);break}case"blockquote":{t+=this.renderer.blockquote(c);break}case"list":{t+=this.renderer.list(c);break}case"checkbox":{t+=this.renderer.checkbox(c);break}case"html":{t+=this.renderer.html(c);break}case"def":{t+=this.renderer.def(c);break}case"paragraph":{t+=this.renderer.paragraph(c);break}case"text":{t+=this.renderer.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return t}parseInline(e,t=this.renderer){var i,o;this.renderer.parser=this;let l="";for(let s=0;s<e.length;s++){let c=e[s];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){l+=d||"";continue}}let u=c;switch(u.type){case"escape":{l+=t.text(u);break}case"html":{l+=t.html(u);break}case"link":{l+=t.link(u);break}case"image":{l+=t.image(u);break}case"checkbox":{l+=t.checkbox(u);break}case"strong":{l+=t.strong(u);break}case"em":{l+=t.em(u);break}case"codespan":{l+=t.codespan(u);break}case"br":{l+=t.br(u);break}case"del":{l+=t.del(u);break}case"text":{l+=t.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return l}},Si,Xl=(Si=class{constructor(n){lt(this,"options");lt(this,"block");this.options=n||gl}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?gn.lex:gn.lexInline}provideParser(n=this.block){return n?_n.parse:_n.parseInline}},lt(Si,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),lt(Si,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Si),D_=class{constructor(...n){lt(this,"defaults",Ps());lt(this,"options",this.setOptions);lt(this,"parse",this.parseMarkdown(!0));lt(this,"parseInline",this.parseMarkdown(!1));lt(this,"Parser",_n);lt(this,"Renderer",Pi);lt(this,"TextRenderer",Ws);lt(this,"Lexer",gn);lt(this,"Tokenizer",Di);lt(this,"Hooks",Xl);this.use(...n)}walkTokens(n,e){var l,i;let t=[];for(let o of n)switch(t=t.concat(e.call(this,o)),o.type){case"table":{let s=o;for(let c of s.header)t=t.concat(this.walkTokens(c.tokens,e));for(let c of s.rows)for(let u of c)t=t.concat(this.walkTokens(u.tokens,e));break}case"list":{let s=o;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=o;(i=(l=this.defaults.extensions)==null?void 0:l.childTokens)!=null&&i[s.type]?this.defaults.extensions.childTokens[s.type].forEach(c=>{let u=s[c].flat(1/0);t=t.concat(this.walkTokens(u,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let l={...t};if(l.async=this.defaults.async||l.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let o=e.renderers[i.name];o?e.renderers[i.name]=function(...s){let c=i.renderer.apply(this,s);return c===!1&&(c=o.apply(this,s)),c}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[i.level];o?o.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),l.extensions=e),t.renderer){let i=this.defaults.renderer||new Pi(this.defaults);for(let o in t.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,c=t.renderer[s],u=i[s];i[s]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p||""}}l.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Di(this.defaults);for(let o in t.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,c=t.tokenizer[s],u=i[s];i[s]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}l.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new Xl;for(let o in t.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,c=t.hooks[s],u=i[s];Xl.passThroughHooks.has(o)?i[s]=d=>{if(this.defaults.async&&Xl.passThroughHooksRespectAsync.has(o))return(async()=>{let h=await c.call(i,d);return u.call(i,h)})();let p=c.call(i,d);return u.call(i,p)}:i[s]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await c.apply(i,d);return h===!1&&(h=await u.apply(i,d)),h})();let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}l.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,o=t.walkTokens;l.walkTokens=function(s){let c=[];return c.push(o.call(this,s)),i&&(c=c.concat(i.call(this,s))),c}}this.defaults={...this.defaults,...l}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return gn.lex(n,e??this.defaults)}parser(n,e){return _n.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let l={...t},i={...this.defaults,...l},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&l.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let s=i.hooks?await i.hooks.preprocess(e):e,c=await(i.hooks?await i.hooks.provideLexer(n):n?gn.lex:gn.lexInline)(s,i),u=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(n):n?_n.parse:_n.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(o);try{i.hooks&&(e=i.hooks.preprocess(e));let s=(i.hooks?i.hooks.provideLexer(n):n?gn.lex:gn.lexInline)(e,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(n):n?_n.parse:_n.parseInline)(s,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(s){return o(s)}}}onError(n,e){return t=>{if(t.message+=`
|
||
Please report this to https://github.com/markedjs/marked.`,n){let l="<p>An error occurred:</p><pre>"+An(t.message+"",!0)+"</pre>";return e?Promise.resolve(l):l}if(e)return Promise.reject(t);throw t}}},ml=new D_;function ht(n,e){return ml.parse(n,e)}ht.options=ht.setOptions=function(n){return ml.setOptions(n),ht.defaults=ml.defaults,Jf(ht.defaults),ht};ht.getDefaults=Ps;ht.defaults=gl;ht.use=function(...n){return ml.use(...n),ht.defaults=ml.defaults,Jf(ht.defaults),ht};ht.walkTokens=function(n,e){return ml.walkTokens(n,e)};ht.parseInline=ml.parseInline;ht.Parser=_n;ht.parser=_n.parse;ht.Renderer=Pi;ht.TextRenderer=Ws;ht.Lexer=gn;ht.lexer=gn.lex;ht.Tokenizer=Di;ht.Hooks=Xl;ht.parse=ht;ht.options;ht.setOptions;ht.use;ht.walkTokens;ht.parseInline;_n.parse;gn.lex;/*! @license DOMPurify 3.4.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.10/LICENSE */function lr(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,l=Array(e);t<e;t++)l[t]=n[t];return l}function P_(n){if(Array.isArray(n))return n}function q_(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var l,i,o,s,c=[],u=!0,d=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(u=(l=o.call(t)).done)&&(c.push(l.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return c}}function z_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B_(n,e){return P_(n)||q_(n,e)||F_(n,e)||z_()}function F_(n,e){if(n){if(typeof n=="string")return lr(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lr(n,e):void 0}}const od=Object.entries,ir=Object.setPrototypeOf,j_=Object.isFrozen,U_=Object.getPrototypeOf,H_=Object.getOwnPropertyDescriptor;let Bt=Object.freeze,Ft=Object.seal,Ol=Object.create,rd=typeof Reflect<"u"&&Reflect,Is=rd.apply,Rs=rd.construct;Bt||(Bt=function(e){return e});Ft||(Ft=function(e){return e});Is||(Is=function(e,t){for(var l=arguments.length,i=new Array(l>2?l-2:0),o=2;o<l;o++)i[o-2]=arguments[o];return e.apply(t,i)});Rs||(Rs=function(e){for(var t=arguments.length,l=new Array(t>1?t-1:0),i=1;i<t;i++)l[i-1]=arguments[i];return new e(...l)});const Vl=Nt(Array.prototype.forEach),W_=Nt(Array.prototype.lastIndexOf),sr=Nt(Array.prototype.pop),Il=Nt(Array.prototype.push),G_=Nt(Array.prototype.splice),Zn=Array.isArray,Jl=Nt(String.prototype.toLowerCase),hs=Nt(String.prototype.toString),or=Nt(String.prototype.match),Zl=Nt(String.prototype.replace),rr=Nt(String.prototype.indexOf),K_=Nt(String.prototype.trim),V_=Nt(Number.prototype.toString),Z_=Nt(Boolean.prototype.toString),ar=typeof BigInt>"u"?null:Nt(BigInt.prototype.toString),cr=typeof Symbol>"u"?null:Nt(Symbol.prototype.toString),Qt=Nt(Object.prototype.hasOwnProperty),Yl=Nt(Object.prototype.toString),zt=Nt(RegExp.prototype.test),sl=Y_(TypeError);function Nt(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,l=new Array(t>1?t-1:0),i=1;i<t;i++)l[i-1]=arguments[i];return Is(n,e,l)}}function Y_(n){return function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return Rs(n,t)}}function ot(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jl;if(ir&&ir(n,null),!Zn(e))return n;let l=e.length;for(;l--;){let i=e[l];if(typeof i=="string"){const o=t(i);o!==i&&(j_(e)||(e[l]=o),i=o)}n[i]=!0}return n}function X_(n){for(let e=0;e<n.length;e++)Qt(n,e)||(n[e]=null);return n}function Jt(n){const e=Ol(null);for(const l of od(n)){var t=B_(l,2);const i=t[0],o=t[1];Qt(n,i)&&(Zn(o)?e[i]=X_(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=Jt(o):e[i]=o)}return e}function J_(n){switch(typeof n){case"string":return n;case"number":return V_(n);case"boolean":return Z_(n);case"bigint":return ar?ar(n):"0";case"symbol":return cr?cr(n):"Symbol()";case"undefined":return Yl(n);case"function":case"object":{if(n===null)return Yl(n);const e=n,t=Nn(e,"toString");if(typeof t=="function"){const l=t(e);return typeof l=="string"?l:Yl(l)}return Yl(n)}default:return Yl(n)}}function Nn(n,e){for(;n!==null;){const l=H_(n,e);if(l){if(l.get)return Nt(l.get);if(typeof l.value=="function")return Nt(l.value)}n=U_(n)}function t(){return null}return t}function Q_(n){try{return zt(n,""),!0}catch{return!1}}const ur=Bt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ms=Bt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),gs=Bt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),x_=Bt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_s=Bt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$_=Bt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fr=Bt(["#text"]),dr=Bt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),bs=Bt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),pr=Bt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vi=Bt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eb=Ft(/{{[\w\W]*|^[\w\W]*}}/g),tb=Ft(/<%[\w\W]*|^[\w\W]*%>/g),nb=Ft(/\${[\w\W]*/g),lb=Ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),ib=Ft(/^aria-[\-\w]+$/),hr=Ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sb=Ft(/^(?:\w+script|data):/i),ob=Ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rb=Ft(/^html$/i),ab=Ft(/^[a-z][.\w]*(-[.\w]+)+$/i),mr=Ft(/<[/\w!]/g),cb=Ft(/<[/\w]/g),ub=Ft(/<\/no(script|embed|frames)/i),fb=Ft(/\/>/i),Cn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},db=function(){return typeof window>"u"?null:window},pb=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let l=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(l=t.getAttribute(i));const o="dompurify"+(l?"#"+l:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},gr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Kn=function(e,t,l,i){return Qt(e,t)&&Zn(e[t])?ot(i.base?Jt(i.base):{},e[t],i.transform):l};function ad(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:db();const e=Ee=>ad(Ee);if(e.version="3.4.10",e.removed=[],!n||!n.document||n.document.nodeType!==Cn.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const l=t,i=l.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,s=n.Node,c=n.Element,u=n.NodeFilter,d=n.NamedNodeMap;d===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const p=n.DOMParser,h=n.trustedTypes,m=c.prototype,g=Nn(m,"cloneNode"),b=Nn(m,"remove"),v=Nn(m,"nextSibling"),y=Nn(m,"childNodes"),E=Nn(m,"parentNode"),T=Nn(m,"shadowRoot"),N=Nn(m,"attributes"),A=s&&s.prototype?Nn(s.prototype,"nodeType"):null,I=s&&s.prototype?Nn(s.prototype,"nodeName"):null;if(typeof o=="function"){const Ee=t.createElement("template");Ee.content&&Ee.content.ownerDocument&&(t=Ee.content.ownerDocument)}let O,R="",D,B=!1,j=0;const U=function(){if(j>0)throw sl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(V){U(),j++;try{return O.createHTML(V)}finally{j--}},W=function(V){U(),j++;try{return O.createScriptURL(V)}finally{j--}},K=function(){return B||(D=pb(h,i),B=!0),D},Y=t,F=Y.implementation,L=Y.createNodeIterator,M=Y.createDocumentFragment,q=Y.getElementsByTagName,X=l.importNode;let Z=gr();e.isSupported=typeof od=="function"&&typeof E=="function"&&F&&F.createHTMLDocument!==void 0;const J=eb,ee=tb,te=nb,le=lb,_e=ib,oe=sb,ze=ob,Ge=ab;let Ie=hr,ne=null;const re=ot({},[...ur,...ms,...gs,..._s,...fr]);let Ne=null;const Fe=ot({},[...dr,...bs,...pr,...vi]);let we=Object.seal(Ol(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),je=null,xe=null;const Ae=Object.seal(Ol(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ve=!0,Ue=!0,Se=!1,He=!0,Oe=!1,Ke=!0,Pe=!1,ue=!1,be=!1,x=!1,ye=!1,me=!1,Re=!0,ft=!1;const it="user-content-";let Ze=!0,dt=!1,Je={},pe=null;const qe=ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let pt=null;const vt=ot({},["audio","video","img","source","image","track"]);let At=null;const Zt=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mt="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xhtml";let jt=It,an=!1,cn=null;const Ut=ot({},[mt,Mt,It],hs),Rn=Bt(["mi","mo","mn","ms","mtext"]);let Ct=ot({},Rn);const Lt=Bt(["annotation-xml"]);let gt=ot({},Lt);const bl=ot({},["title","style","font","a","script"]);let bn=null;const kl=["application/xhtml+xml","text/html"],en="text/html";let _t=null,Ot=null;const tn=t.createElement("form"),un=function(V){return V instanceof RegExp||V instanceof Function},Ht=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ot&&Ot===V)return;(!V||typeof V!="object")&&(V={}),V=Jt(V),bn=kl.indexOf(V.PARSER_MEDIA_TYPE)===-1?en:V.PARSER_MEDIA_TYPE,_t=bn==="application/xhtml+xml"?hs:Jl,ne=Kn(V,"ALLOWED_TAGS",re,{transform:_t}),Ne=Kn(V,"ALLOWED_ATTR",Fe,{transform:_t}),cn=Kn(V,"ALLOWED_NAMESPACES",Ut,{transform:hs}),At=Kn(V,"ADD_URI_SAFE_ATTR",Zt,{transform:_t,base:Zt}),pt=Kn(V,"ADD_DATA_URI_TAGS",vt,{transform:_t,base:vt}),pe=Kn(V,"FORBID_CONTENTS",qe,{transform:_t}),je=Kn(V,"FORBID_TAGS",Jt({}),{transform:_t}),xe=Kn(V,"FORBID_ATTR",Jt({}),{transform:_t}),Je=Qt(V,"USE_PROFILES")?V.USE_PROFILES&&typeof V.USE_PROFILES=="object"?Jt(V.USE_PROFILES):V.USE_PROFILES:!1,Ve=V.ALLOW_ARIA_ATTR!==!1,Ue=V.ALLOW_DATA_ATTR!==!1,Se=V.ALLOW_UNKNOWN_PROTOCOLS||!1,He=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Oe=V.SAFE_FOR_TEMPLATES||!1,Ke=V.SAFE_FOR_XML!==!1,Pe=V.WHOLE_DOCUMENT||!1,x=V.RETURN_DOM||!1,ye=V.RETURN_DOM_FRAGMENT||!1,me=V.RETURN_TRUSTED_TYPE||!1,be=V.FORCE_BODY||!1,Re=V.SANITIZE_DOM!==!1,ft=V.SANITIZE_NAMED_PROPS||!1,Ze=V.KEEP_CONTENT!==!1,dt=V.IN_PLACE||!1,Ie=Q_(V.ALLOWED_URI_REGEXP)?V.ALLOWED_URI_REGEXP:hr,jt=typeof V.NAMESPACE=="string"?V.NAMESPACE:It,Ct=Qt(V,"MATHML_TEXT_INTEGRATION_POINTS")&&V.MATHML_TEXT_INTEGRATION_POINTS&&typeof V.MATHML_TEXT_INTEGRATION_POINTS=="object"?Jt(V.MATHML_TEXT_INTEGRATION_POINTS):ot({},Rn),gt=Qt(V,"HTML_INTEGRATION_POINTS")&&V.HTML_INTEGRATION_POINTS&&typeof V.HTML_INTEGRATION_POINTS=="object"?Jt(V.HTML_INTEGRATION_POINTS):ot({},Lt);const ie=Qt(V,"CUSTOM_ELEMENT_HANDLING")&&V.CUSTOM_ELEMENT_HANDLING&&typeof V.CUSTOM_ELEMENT_HANDLING=="object"?Jt(V.CUSTOM_ELEMENT_HANDLING):Ol(null);if(we=Ol(null),Qt(ie,"tagNameCheck")&&un(ie.tagNameCheck)&&(we.tagNameCheck=ie.tagNameCheck),Qt(ie,"attributeNameCheck")&&un(ie.attributeNameCheck)&&(we.attributeNameCheck=ie.attributeNameCheck),Qt(ie,"allowCustomizedBuiltInElements")&&typeof ie.allowCustomizedBuiltInElements=="boolean"&&(we.allowCustomizedBuiltInElements=ie.allowCustomizedBuiltInElements),Ft(we),Oe&&(Ue=!1),ye&&(x=!0),Je&&(ne=ot({},fr),Ne=Ol(null),Je.html===!0&&(ot(ne,ur),ot(Ne,dr)),Je.svg===!0&&(ot(ne,ms),ot(Ne,bs),ot(Ne,vi)),Je.svgFilters===!0&&(ot(ne,gs),ot(Ne,bs),ot(Ne,vi)),Je.mathMl===!0&&(ot(ne,_s),ot(Ne,pr),ot(Ne,vi))),Ae.tagCheck=null,Ae.attributeCheck=null,Qt(V,"ADD_TAGS")&&(typeof V.ADD_TAGS=="function"?Ae.tagCheck=V.ADD_TAGS:Zn(V.ADD_TAGS)&&(ne===re&&(ne=Jt(ne)),ot(ne,V.ADD_TAGS,_t))),Qt(V,"ADD_ATTR")&&(typeof V.ADD_ATTR=="function"?Ae.attributeCheck=V.ADD_ATTR:Zn(V.ADD_ATTR)&&(Ne===Fe&&(Ne=Jt(Ne)),ot(Ne,V.ADD_ATTR,_t))),Qt(V,"ADD_URI_SAFE_ATTR")&&Zn(V.ADD_URI_SAFE_ATTR)&&ot(At,V.ADD_URI_SAFE_ATTR,_t),Qt(V,"FORBID_CONTENTS")&&Zn(V.FORBID_CONTENTS)&&(pe===qe&&(pe=Jt(pe)),ot(pe,V.FORBID_CONTENTS,_t)),Qt(V,"ADD_FORBID_CONTENTS")&&Zn(V.ADD_FORBID_CONTENTS)&&(pe===qe&&(pe=Jt(pe)),ot(pe,V.ADD_FORBID_CONTENTS,_t)),Ze&&(ne["#text"]=!0),Pe&&ot(ne,["html","head","body"]),ne.table&&(ot(ne,["tbody"]),delete je.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw sl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ve=O;O=V.TRUSTED_TYPES_POLICY;try{R=z("")}catch(De){throw O=ve,De}}else V.TRUSTED_TYPES_POLICY===null?(O=void 0,R=""):(O===void 0&&(O=K()),O&&typeof R=="string"&&(R=z("")));(Z.uponSanitizeElement.length>0||Z.uponSanitizeAttribute.length>0)&&ne===re&&(ne=Jt(ne)),Z.uponSanitizeAttribute.length>0&&Ne===Fe&&(Ne=Jt(Ne)),Bt&&Bt(V),Ot=V},$t=ot({},[...ms,...gs,...x_]),kn=ot({},[..._s,...$_]),fn=function(V,ie,ve){return ie.namespaceURI===It?V==="svg":ie.namespaceURI===mt?V==="svg"&&(ve==="annotation-xml"||Ct[ve]):!!$t[V]},$=function(V,ie,ve){return ie.namespaceURI===It?V==="math":ie.namespaceURI===Mt?V==="math"&>[ve]:!!kn[V]},he=function(V,ie,ve){return ie.namespaceURI===Mt&&!gt[ve]||ie.namespaceURI===mt&&!Ct[ve]?!1:!kn[V]&&(bl[V]||!$t[V])},tt=function(V){let ie=E(V);(!ie||!ie.tagName)&&(ie={namespaceURI:jt,tagName:"template"});const ve=Jl(V.tagName),De=Jl(ie.tagName);return cn[V.namespaceURI]?V.namespaceURI===Mt?fn(ve,ie,De):V.namespaceURI===mt?$(ve,ie,De):V.namespaceURI===It?he(ve,ie,De):!!(bn==="application/xhtml+xml"&&cn[V.namespaceURI]):!1},st=function(V){Il(e.removed,{element:V});try{E(V).removeChild(V)}catch{if(b(V),!E(V))throw sl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Yt=function(V){const ie=y(V);if(ie){const De=[];Vl(ie,$e=>{Il(De,$e)}),Vl(De,$e=>{try{b($e)}catch{}})}const ve=N(V);if(ve)for(let De=ve.length-1;De>=0;--De){const $e=ve[De],nt=$e&&$e.name;if(typeof nt=="string")try{V.removeAttribute(nt)}catch{}}},Wt=function(V,ie){try{Il(e.removed,{attribute:ie.getAttributeNode(V),from:ie})}catch{Il(e.removed,{attribute:null,from:ie})}if(ie.removeAttribute(V),V==="is")if(x||ye)try{st(ie)}catch{}else try{ie.setAttribute(V,"")}catch{}},vn=function(V){const ie=N(V);if(ie)for(let ve=ie.length-1;ve>=0;--ve){const De=ie[ve],$e=De&&De.name;if(!(typeof $e!="string"||Ne[_t($e)]))try{V.removeAttribute($e)}catch{}}},Bn=function(V){const ie=[V];for(;ie.length>0;){const ve=ie.pop();(A?A(ve):ve.nodeType)===Cn.element&&vn(ve);const $e=y(ve);if($e)for(let nt=$e.length-1;nt>=0;--nt)ie.push($e[nt])}},Xt=function(V){let ie=null,ve=null;if(be)V="<remove></remove>"+V;else{const nt=or(V,/^[\r\n\t ]+/);ve=nt&&nt[0]}bn==="application/xhtml+xml"&&jt===It&&(V='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+V+"</body></html>");const De=O?z(V):V;if(jt===It)try{ie=new p().parseFromString(De,bn)}catch{}if(!ie||!ie.documentElement){ie=F.createDocument(jt,"template",null);try{ie.documentElement.innerHTML=an?R:De}catch{}}const $e=ie.body||ie.documentElement;return V&&ve&&$e.insertBefore(t.createTextNode(ve),$e.childNodes[0]||null),jt===It?q.call(ie,Pe?"html":"body")[0]:Pe?ie.documentElement:$e},vl=function(V){return L.call(V.ownerDocument||V,V,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},wn=function(V){return V=Zl(V,J," "),V=Zl(V,ee," "),V=Zl(V,te," "),V},yn=function(V){var ie;V.normalize();const ve=L.call(V.ownerDocument||V,V,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let De=ve.nextNode();for(;De;)De.data=wn(De.data),De=ve.nextNode();const $e=(ie=V.querySelectorAll)===null||ie===void 0?void 0:ie.call(V,"template");$e&&Vl($e,nt=>{dn(nt.content)&&yn(nt.content)})},Fn=function(V){const ie=I?I(V):null;return typeof ie!="string"||_t(ie)!=="form"?!1:typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||V.attributes!==N(V)||typeof V.removeAttribute!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function"||V.nodeType!==A(V)||V.childNodes!==y(V)},dn=function(V){if(!A||typeof V!="object"||V===null)return!1;try{return A(V)===Cn.documentFragment}catch{return!1}},Mn=function(V){if(!A||typeof V!="object"||V===null)return!1;try{return typeof A(V)=="number"}catch{return!1}};function Gt(Ee,V,ie){Ee.length!==0&&Vl(Ee,ve=>{ve.call(e,V,ie,Ot)})}const wl=function(V,ie){return!!(Ke&&V.hasChildNodes()&&!Mn(V.firstElementChild)&&zt(mr,V.textContent)&&zt(mr,V.innerHTML)||Ke&&V.namespaceURI===It&&ie==="style"&&Mn(V.firstElementChild)||V.nodeType===Cn.processingInstruction||Ke&&V.nodeType===Cn.comment&&zt(cb,V.data))},oi=function(V,ie){if(!je[ie]&&Jn(ie)&&(we.tagNameCheck instanceof RegExp&&zt(we.tagNameCheck,ie)||we.tagNameCheck instanceof Function&&we.tagNameCheck(ie)))return!1;if(Ze&&!pe[ie]){const ve=E(V),De=y(V);if(De&&ve){const $e=De.length;for(let nt=$e-1;nt>=0;--nt){const St=dt?De[nt]:g(De[nt],!0);ve.insertBefore(St,v(V))}}}return st(V),!0},jl=function(V){if(Gt(Z.beforeSanitizeElements,V,null),Fn(V))return st(V),!0;const ie=_t(I?I(V):V.nodeName);if(Gt(Z.uponSanitizeElement,V,{tagName:ie,allowedTags:ne}),wl(V,ie))return st(V),!0;if(je[ie]||!(Ae.tagCheck instanceof Function&&Ae.tagCheck(ie))&&!ne[ie])return oi(V,ie);if((A?A(V):V.nodeType)===Cn.element&&!tt(V)||(ie==="noscript"||ie==="noembed"||ie==="noframes")&&zt(ub,V.innerHTML))return st(V),!0;if(Oe&&V.nodeType===Cn.text){const De=wn(V.textContent);V.textContent!==De&&(Il(e.removed,{element:V.cloneNode()}),V.textContent=De)}return Gt(Z.afterSanitizeElements,V,null),!1},Ul=function(V,ie,ve){if(xe[ie]||Re&&(ie==="id"||ie==="name")&&(ve in t||ve in tn))return!1;const De=Ne[ie]||Ae.attributeCheck instanceof Function&&Ae.attributeCheck(ie,V);if(!(Ue&&zt(le,ie))){if(!(Ve&&zt(_e,ie))){if(De){if(!At[ie]){if(!zt(Ie,Zl(ve,ze,""))){if(!((ie==="src"||ie==="xlink:href"||ie==="href")&&V!=="script"&&rr(ve,"data:")===0&&pt[V])){if(!(Se&&!zt(oe,Zl(ve,ze,"")))){if(ve)return!1}}}}}else if(!(Jn(V)&&(we.tagNameCheck instanceof RegExp&&zt(we.tagNameCheck,V)||we.tagNameCheck instanceof Function&&we.tagNameCheck(V))&&(we.attributeNameCheck instanceof RegExp&&zt(we.attributeNameCheck,ie)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(ie,V))||ie==="is"&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&zt(we.tagNameCheck,ve)||we.tagNameCheck instanceof Function&&we.tagNameCheck(ve))))return!1}}return!0},ri=ot({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Jn=function(V){return!ri[Jl(V)]&&zt(Ge,V)},yl=function(V,ie,ve,De){if(O&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!ve)switch(h.getAttributeType(V,ie)){case"TrustedHTML":return z(De);case"TrustedScriptURL":return W(De)}return De},jn=function(V,ie,ve,De){try{ve?V.setAttributeNS(ve,ie,De):V.setAttribute(ie,De),Fn(V)?st(V):sr(e.removed)}catch{Wt(ie,V)}},Qn=function(V){Gt(Z.beforeSanitizeAttributes,V,null);const ie=V.attributes;if(!ie||Fn(V))return;const ve={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne,forceKeepAttr:void 0};let De=ie.length;const $e=_t(V.nodeName);for(;De--;){const nt=ie[De],St=nt.name,wt=nt.namespaceURI,Dt=nt.value,nn=_t(St),xn=Dt;let Pt=St==="value"?xn:K_(xn);if(ve.attrName=nn,ve.attrValue=Pt,ve.keepAttr=!0,ve.forceKeepAttr=void 0,Gt(Z.uponSanitizeAttribute,V,ve),Pt=ve.attrValue,ft&&(nn==="id"||nn==="name")&&rr(Pt,it)!==0&&(Wt(St,V),Pt=it+Pt),Ke&&zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pt)){Wt(St,V);continue}if(nn==="attributename"&&or(Pt,"href")){Wt(St,V);continue}if(!ve.forceKeepAttr){if(!ve.keepAttr){Wt(St,V);continue}if(!He&&zt(fb,Pt)){Wt(St,V);continue}if(Oe&&(Pt=wn(Pt)),!Ul($e,nn,Pt)){Wt(St,V);continue}Pt=yl($e,nn,wt,Pt),Pt!==xn&&jn(V,St,wt,Pt)}}Gt(Z.afterSanitizeAttributes,V,null)},hn=function(V){let ie=null;const ve=vl(V);for(Gt(Z.beforeSanitizeShadowDOM,V,null);ie=ve.nextNode();)if(Gt(Z.uponSanitizeShadowNode,ie,null),jl(ie),Qn(ie),dn(ie.content)&&hn(ie.content),(A?A(ie):ie.nodeType)===Cn.element){const $e=T(ie);dn($e)&&(En($e),hn($e))}Gt(Z.afterSanitizeShadowDOM,V,null)},En=function(V){const ie=[{node:V,shadow:null}];for(;ie.length>0;){const ve=ie.pop();if(ve.shadow){hn(ve.shadow);continue}const De=ve.node,nt=(A?A(De):De.nodeType)===Cn.element,St=y(De);if(St)for(let wt=St.length-1;wt>=0;--wt)ie.push({node:St[wt],shadow:null});if(nt){const wt=I?I(De):null;if(typeof wt=="string"&&_t(wt)==="template"){const Dt=De.content;dn(Dt)&&ie.push({node:Dt,shadow:null})}}if(nt){const wt=T(De);dn(wt)&&ie.push({node:null,shadow:wt},{node:wt,shadow:null})}}};return e.sanitize=function(Ee){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=null,ve=null,De=null,$e=null;if(an=!Ee,an&&(Ee="<!-->"),typeof Ee!="string"&&!Mn(Ee)&&(Ee=J_(Ee),typeof Ee!="string"))throw sl("dirty is not a string, aborting");if(!e.isSupported)return Ee;ue||Ht(V),e.removed=[];const nt=dt&&typeof Ee!="string"&&Mn(Ee);if(nt){const Dt=I?I(Ee):Ee.nodeName;if(typeof Dt=="string"){const nn=_t(Dt);if(!ne[nn]||je[nn])throw sl("root node is forbidden and cannot be sanitized in-place")}if(Fn(Ee))throw sl("root node is clobbered and cannot be sanitized in-place");try{En(Ee)}catch(nn){throw Yt(Ee),nn}}else if(Mn(Ee))ie=Xt("<!---->"),ve=ie.ownerDocument.importNode(Ee,!0),ve.nodeType===Cn.element&&ve.nodeName==="BODY"||ve.nodeName==="HTML"?ie=ve:ie.appendChild(ve),En(ve);else{if(!x&&!Oe&&!Pe&&Ee.indexOf("<")===-1)return O&&me?z(Ee):Ee;if(ie=Xt(Ee),!ie)return x?null:me?R:""}ie&&be&&st(ie.firstChild);const St=vl(nt?Ee:ie);try{for(;De=St.nextNode();)jl(De),Qn(De),dn(De.content)&&hn(De.content)}catch(Dt){throw nt&&Yt(Ee),Dt}if(nt)return Vl(e.removed,Dt=>{Dt.element&&Bn(Dt.element)}),Oe&&yn(Ee),Ee;if(x){if(Oe&&yn(ie),ye)for($e=M.call(ie.ownerDocument);ie.firstChild;)$e.appendChild(ie.firstChild);else $e=ie;return(Ne.shadowroot||Ne.shadowrootmode)&&($e=X.call(l,$e,!0)),$e}let wt=Pe?ie.outerHTML:ie.innerHTML;return Pe&&ne["!doctype"]&&ie.ownerDocument&&ie.ownerDocument.doctype&&ie.ownerDocument.doctype.name&&zt(rb,ie.ownerDocument.doctype.name)&&(wt="<!DOCTYPE "+ie.ownerDocument.doctype.name+`>
|
||
`+wt),Oe&&(wt=wn(wt)),O&&me?z(wt):wt},e.setConfig=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ht(Ee),ue=!0},e.clearConfig=function(){Ot=null,ue=!1,O=D,R=""},e.isValidAttribute=function(Ee,V,ie){Ot||Ht({});const ve=_t(Ee),De=_t(V);return Ul(ve,De,ie)},e.addHook=function(Ee,V){typeof V=="function"&&Il(Z[Ee],V)},e.removeHook=function(Ee,V){if(V!==void 0){const ie=W_(Z[Ee],V);return ie===-1?void 0:G_(Z[Ee],ie,1)[0]}return sr(Z[Ee])},e.removeHooks=function(Ee){Z[Ee]=[]},e.removeAllHooks=function(){Z=gr()},e}var cd=ad();function hb(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function ud(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e],l=typeof t;(l==="object"||l==="function")&&!Object.isFrozen(t)&&ud(t)}),n}class _r{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function fd(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Xn(n,...e){const t=Object.create(null);for(const l in n)t[l]=n[l];return e.forEach(function(l){for(const i in l)t[i]=l[i]}),t}const mb="</span>",br=n=>!!n.scope,gb=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map((l,i)=>`${l}${"_".repeat(i+1)}`)].join(" ")}return`${e}${n}`};class _b{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=fd(e)}openNode(e){if(!br(e))return;const t=gb(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){br(e)&&(this.buffer+=mb)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const kr=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class Gs{constructor(){this.rootNode=kr(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=kr({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(l=>this._walk(e,l)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{Gs._collapse(t)}))}}class bb extends Gs{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const l=e.root;t&&(l.scope=`language:${t}`),this.add(l)}toHTML(){return new _b(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ei(n){return n?typeof n=="string"?n:n.source:null}function dd(n){return _l("(?=",n,")")}function kb(n){return _l("(?:",n,")*")}function vb(n){return _l("(?:",n,")?")}function _l(...n){return n.map(t=>ei(t)).join("")}function wb(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function Ks(...n){return"("+(wb(n).capture?"":"?:")+n.map(l=>ei(l)).join("|")+")"}function pd(n){return new RegExp(n.toString()+"|").exec("").length-1}function yb(n,e){const t=n&&n.exec(e);return t&&t.index===0}const Eb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Vs(n,{joinWith:e}){let t=0;return n.map(l=>{t+=1;const i=t;let o=ei(l),s="";for(;o.length>0;){const c=Eb.exec(o);if(!c){s+=o;break}s+=o.substring(0,c.index),o=o.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+i):(s+=c[0],c[0]==="("&&t++)}return s}).map(l=>`(${l})`).join(e)}const Tb=/\b\B/,hd="[a-zA-Z]\\w*",Zs="[a-zA-Z_]\\w*",md="\\b\\d+(\\.\\d+)?",gd="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_d="\\b(0b[01]+)",Sb="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Cb=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=_l(e,/.*\b/,n.binary,/\b.*/)),Xn({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,l)=>{t.index!==0&&l.ignoreMatch()}},n)},ti={begin:"\\\\[\\s\\S]",relevance:0},Ab={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ti]},Nb={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ti]},Ib={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Wi=function(n,e,t={}){const l=Xn({scope:"comment",begin:n,end:e,contains:[]},t);l.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Ks("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return l.contains.push({begin:_l(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),l},Rb=Wi("//","$"),Mb=Wi("/\\*","\\*/"),Lb=Wi("#","$"),Ob={scope:"number",begin:md,relevance:0},Db={scope:"number",begin:gd,relevance:0},Pb={scope:"number",begin:_d,relevance:0},qb={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ti,{begin:/\[/,end:/\]/,relevance:0,contains:[ti]}]},zb={scope:"title",begin:hd,relevance:0},Bb={scope:"title",begin:Zs,relevance:0},Fb={begin:"\\.\\s*"+Zs,relevance:0},jb=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var wi=Object.freeze({__proto__:null,APOS_STRING_MODE:Ab,BACKSLASH_ESCAPE:ti,BINARY_NUMBER_MODE:Pb,BINARY_NUMBER_RE:_d,COMMENT:Wi,C_BLOCK_COMMENT_MODE:Mb,C_LINE_COMMENT_MODE:Rb,C_NUMBER_MODE:Db,C_NUMBER_RE:gd,END_SAME_AS_BEGIN:jb,HASH_COMMENT_MODE:Lb,IDENT_RE:hd,MATCH_NOTHING_RE:Tb,METHOD_GUARD:Fb,NUMBER_MODE:Ob,NUMBER_RE:md,PHRASAL_WORDS_MODE:Ib,QUOTE_STRING_MODE:Nb,REGEXP_MODE:qb,RE_STARTERS_RE:Sb,SHEBANG:Cb,TITLE_MODE:zb,UNDERSCORE_IDENT_RE:Zs,UNDERSCORE_TITLE_MODE:Bb});function Ub(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function Hb(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function Wb(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=Ub,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function Gb(n,e){Array.isArray(n.illegal)&&(n.illegal=Ks(...n.illegal))}function Kb(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function Vb(n,e){n.relevance===void 0&&(n.relevance=1)}const Zb=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach(l=>{delete n[l]}),n.keywords=t.keywords,n.begin=_l(t.beforeMatch,dd(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},Yb=["of","and","for","in","not","or","if","then","parent","list","value"],Xb="keyword";function bd(n,e,t=Xb){const l=Object.create(null);return typeof n=="string"?i(t,n.split(" ")):Array.isArray(n)?i(t,n):Object.keys(n).forEach(function(o){Object.assign(l,bd(n[o],e,o))}),l;function i(o,s){e&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){const u=c.split("|");l[u[0]]=[o,Jb(u[0],u[1])]})}}function Jb(n,e){return e?Number(e):Qb(n)?0:1}function Qb(n){return Yb.includes(n.toLowerCase())}const vr={},dl=n=>{console.error(n)},wr=(n,...e)=>{console.log(`WARN: ${n}`,...e)},Rl=(n,e)=>{vr[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),vr[`${n}/${e}`]=!0)},qi=new Error;function kd(n,e,{key:t}){let l=0;const i=n[t],o={},s={};for(let c=1;c<=e.length;c++)s[c+l]=i[c],o[c+l]=!0,l+=pd(e[c-1]);n[t]=s,n[t]._emit=o,n[t]._multi=!0}function xb(n){if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw dl("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qi;if(typeof n.beginScope!="object"||n.beginScope===null)throw dl("beginScope must be object"),qi;kd(n,n.begin,{key:"beginScope"}),n.begin=Vs(n.begin,{joinWith:""})}}function $b(n){if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw dl("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qi;if(typeof n.endScope!="object"||n.endScope===null)throw dl("endScope must be object"),qi;kd(n,n.end,{key:"endScope"}),n.end=Vs(n.end,{joinWith:""})}}function ek(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function tk(n){ek(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),xb(n),$b(n)}function nk(n){function e(s,c){return new RegExp(ei(s),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(c?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=pd(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(u=>u[1]);this.matcherRe=e(Vs(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(c);if(!u)return null;const d=u.findIndex((h,m)=>m>0&&h!==void 0),p=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,p)}}class l{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const u=new t;return this.rules.slice(c).forEach(([d,p])=>u.addRule(d,p)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(c);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,d=p.exec(c)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){const c=new l;return s.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function o(s,c){const u=s;if(s.isCompiled)return u;[Hb,Kb,tk,Zb].forEach(p=>p(s,c)),n.compilerExtensions.forEach(p=>p(s,c)),s.__beforeBegin=null,[Wb,Gb,Vb].forEach(p=>p(s,c)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=bd(s.keywords,n.case_insensitive)),u.keywordPatternRe=e(d,!0),c&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=ei(u.end)||"",s.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(p){return lk(p==="self"?s:p)})),s.contains.forEach(function(p){o(p,u)}),s.starts&&o(s.starts,c),u.matcher=i(u),u}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=Xn(n.classNameAliases||{}),o(n)}function vd(n){return n?n.endsWithParent||vd(n.starts):!1}function lk(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return Xn(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:vd(n)?Xn(n,{starts:n.starts?Xn(n.starts):null}):Object.isFrozen(n)?Xn(n):n}var ik="11.11.1";class sk extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const ks=fd,yr=Xn,Er=Symbol("nomatch"),ok=7,wd=function(n){const e=Object.create(null),t=Object.create(null),l=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:bb};function u(F){return c.noHighlightRe.test(F)}function d(F){let L=F.className+" ";L+=F.parentNode?F.parentNode.className:"";const M=c.languageDetectRe.exec(L);if(M){const q=D(M[1]);return q||(wr(o.replace("{}",M[1])),wr("Falling back to no-highlight mode for this block.",F)),q?M[1]:"no-highlight"}return L.split(/\s+/).find(q=>u(q)||D(q))}function p(F,L,M){let q="",X="";typeof L=="object"?(q=F,M=L.ignoreIllegals,X=L.language):(Rl("10.7.0","highlight(lang, code, ...args) has been deprecated."),Rl("10.7.0",`Please use highlight(code, options) instead.
|
||
https://github.com/highlightjs/highlight.js/issues/2277`),X=F,q=L),M===void 0&&(M=!0);const Z={code:q,language:X};K("before:highlight",Z);const J=Z.result?Z.result:h(Z.language,Z.code,M);return J.code=Z.code,K("after:highlight",J),J}function h(F,L,M,q){const X=Object.create(null);function Z(ue,be){return ue.keywords[be]}function J(){if(!Ae.keywords){Ue.addText(Se);return}let ue=0;Ae.keywordPatternRe.lastIndex=0;let be=Ae.keywordPatternRe.exec(Se),x="";for(;be;){x+=Se.substring(ue,be.index);const ye=we.case_insensitive?be[0].toLowerCase():be[0],me=Z(Ae,ye);if(me){const[Re,ft]=me;if(Ue.addText(x),x="",X[ye]=(X[ye]||0)+1,X[ye]<=ok&&(He+=ft),Re.startsWith("_"))x+=be[0];else{const it=we.classNameAliases[Re]||Re;le(be[0],it)}}else x+=be[0];ue=Ae.keywordPatternRe.lastIndex,be=Ae.keywordPatternRe.exec(Se)}x+=Se.substring(ue),Ue.addText(x)}function ee(){if(Se==="")return;let ue=null;if(typeof Ae.subLanguage=="string"){if(!e[Ae.subLanguage]){Ue.addText(Se);return}ue=h(Ae.subLanguage,Se,!0,Ve[Ae.subLanguage]),Ve[Ae.subLanguage]=ue._top}else ue=g(Se,Ae.subLanguage.length?Ae.subLanguage:null);Ae.relevance>0&&(He+=ue.relevance),Ue.__addSublanguage(ue._emitter,ue.language)}function te(){Ae.subLanguage!=null?ee():J(),Se=""}function le(ue,be){ue!==""&&(Ue.startScope(be),Ue.addText(ue),Ue.endScope())}function _e(ue,be){let x=1;const ye=be.length-1;for(;x<=ye;){if(!ue._emit[x]){x++;continue}const me=we.classNameAliases[ue[x]]||ue[x],Re=be[x];me?le(Re,me):(Se=Re,J(),Se=""),x++}}function oe(ue,be){return ue.scope&&typeof ue.scope=="string"&&Ue.openNode(we.classNameAliases[ue.scope]||ue.scope),ue.beginScope&&(ue.beginScope._wrap?(le(Se,we.classNameAliases[ue.beginScope._wrap]||ue.beginScope._wrap),Se=""):ue.beginScope._multi&&(_e(ue.beginScope,be),Se="")),Ae=Object.create(ue,{parent:{value:Ae}}),Ae}function ze(ue,be,x){let ye=yb(ue.endRe,x);if(ye){if(ue["on:end"]){const me=new _r(ue);ue["on:end"](be,me),me.isMatchIgnored&&(ye=!1)}if(ye){for(;ue.endsParent&&ue.parent;)ue=ue.parent;return ue}}if(ue.endsWithParent)return ze(ue.parent,be,x)}function Ge(ue){return Ae.matcher.regexIndex===0?(Se+=ue[0],1):(Pe=!0,0)}function Ie(ue){const be=ue[0],x=ue.rule,ye=new _r(x),me=[x.__beforeBegin,x["on:begin"]];for(const Re of me)if(Re&&(Re(ue,ye),ye.isMatchIgnored))return Ge(be);return x.skip?Se+=be:(x.excludeBegin&&(Se+=be),te(),!x.returnBegin&&!x.excludeBegin&&(Se=be)),oe(x,ue),x.returnBegin?0:be.length}function ne(ue){const be=ue[0],x=L.substring(ue.index),ye=ze(Ae,ue,x);if(!ye)return Er;const me=Ae;Ae.endScope&&Ae.endScope._wrap?(te(),le(be,Ae.endScope._wrap)):Ae.endScope&&Ae.endScope._multi?(te(),_e(Ae.endScope,ue)):me.skip?Se+=be:(me.returnEnd||me.excludeEnd||(Se+=be),te(),me.excludeEnd&&(Se=be));do Ae.scope&&Ue.closeNode(),!Ae.skip&&!Ae.subLanguage&&(He+=Ae.relevance),Ae=Ae.parent;while(Ae!==ye.parent);return ye.starts&&oe(ye.starts,ue),me.returnEnd?0:be.length}function re(){const ue=[];for(let be=Ae;be!==we;be=be.parent)be.scope&&ue.unshift(be.scope);ue.forEach(be=>Ue.openNode(be))}let Ne={};function Fe(ue,be){const x=be&&be[0];if(Se+=ue,x==null)return te(),0;if(Ne.type==="begin"&&be.type==="end"&&Ne.index===be.index&&x===""){if(Se+=L.slice(be.index,be.index+1),!i){const ye=new Error(`0 width match regex (${F})`);throw ye.languageName=F,ye.badRule=Ne.rule,ye}return 1}if(Ne=be,be.type==="begin")return Ie(be);if(be.type==="illegal"&&!M){const ye=new Error('Illegal lexeme "'+x+'" for mode "'+(Ae.scope||"<unnamed>")+'"');throw ye.mode=Ae,ye}else if(be.type==="end"){const ye=ne(be);if(ye!==Er)return ye}if(be.type==="illegal"&&x==="")return Se+=`
|
||
`,1;if(Ke>1e5&&Ke>be.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=x,x.length}const we=D(F);if(!we)throw dl(o.replace("{}",F)),new Error('Unknown language: "'+F+'"');const je=nk(we);let xe="",Ae=q||je;const Ve={},Ue=new c.__emitter(c);re();let Se="",He=0,Oe=0,Ke=0,Pe=!1;try{if(we.__emitTokens)we.__emitTokens(L,Ue);else{for(Ae.matcher.considerAll();;){Ke++,Pe?Pe=!1:Ae.matcher.considerAll(),Ae.matcher.lastIndex=Oe;const ue=Ae.matcher.exec(L);if(!ue)break;const be=L.substring(Oe,ue.index),x=Fe(be,ue);Oe=ue.index+x}Fe(L.substring(Oe))}return Ue.finalize(),xe=Ue.toHTML(),{language:F,value:xe,relevance:He,illegal:!1,_emitter:Ue,_top:Ae}}catch(ue){if(ue.message&&ue.message.includes("Illegal"))return{language:F,value:ks(L),illegal:!0,relevance:0,_illegalBy:{message:ue.message,index:Oe,context:L.slice(Oe-100,Oe+100),mode:ue.mode,resultSoFar:xe},_emitter:Ue};if(i)return{language:F,value:ks(L),illegal:!1,relevance:0,errorRaised:ue,_emitter:Ue,_top:Ae};throw ue}}function m(F){const L={value:ks(F),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return L._emitter.addText(F),L}function g(F,L){L=L||c.languages||Object.keys(e);const M=m(F),q=L.filter(D).filter(j).map(te=>h(te,F,!1));q.unshift(M);const X=q.sort((te,le)=>{if(te.relevance!==le.relevance)return le.relevance-te.relevance;if(te.language&&le.language){if(D(te.language).supersetOf===le.language)return 1;if(D(le.language).supersetOf===te.language)return-1}return 0}),[Z,J]=X,ee=Z;return ee.secondBest=J,ee}function b(F,L,M){const q=L&&t[L]||M;F.classList.add("hljs"),F.classList.add(`language-${q}`)}function v(F){let L=null;const M=d(F);if(u(M))return;if(K("before:highlightElement",{el:F,language:M}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),c.throwUnescapedHTML))throw new sk("One of your code blocks includes unescaped HTML.",F.innerHTML);L=F;const q=L.textContent,X=M?p(q,{language:M,ignoreIllegals:!0}):g(q);F.innerHTML=X.value,F.dataset.highlighted="yes",b(F,M,X.language),F.result={language:X.language,re:X.relevance,relevance:X.relevance},X.secondBest&&(F.secondBest={language:X.secondBest.language,relevance:X.secondBest.relevance}),K("after:highlightElement",{el:F,result:X,text:q})}function y(F){c=yr(c,F)}const E=()=>{A(),Rl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function T(){A(),Rl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let N=!1;function A(){function F(){A()}if(document.readyState==="loading"){N||window.addEventListener("DOMContentLoaded",F,!1),N=!0;return}document.querySelectorAll(c.cssSelector).forEach(v)}function I(F,L){let M=null;try{M=L(n)}catch(q){if(dl("Language definition for '{}' could not be registered.".replace("{}",F)),i)dl(q);else throw q;M=s}M.name||(M.name=F),e[F]=M,M.rawDefinition=L.bind(null,n),M.aliases&&B(M.aliases,{languageName:F})}function O(F){delete e[F];for(const L of Object.keys(t))t[L]===F&&delete t[L]}function R(){return Object.keys(e)}function D(F){return F=(F||"").toLowerCase(),e[F]||e[t[F]]}function B(F,{languageName:L}){typeof F=="string"&&(F=[F]),F.forEach(M=>{t[M.toLowerCase()]=L})}function j(F){const L=D(F);return L&&!L.disableAutodetect}function U(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=L=>{F["before:highlightBlock"](Object.assign({block:L.el},L))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=L=>{F["after:highlightBlock"](Object.assign({block:L.el},L))})}function z(F){U(F),l.push(F)}function W(F){const L=l.indexOf(F);L!==-1&&l.splice(L,1)}function K(F,L){const M=F;l.forEach(function(q){q[M]&&q[M](L)})}function Y(F){return Rl("10.7.0","highlightBlock will be removed entirely in v12.0"),Rl("10.7.0","Please use highlightElement now."),v(F)}Object.assign(n,{highlight:p,highlightAuto:g,highlightAll:A,highlightElement:v,highlightBlock:Y,configure:y,initHighlighting:E,initHighlightingOnLoad:T,registerLanguage:I,unregisterLanguage:O,listLanguages:R,getLanguage:D,registerAliases:B,autoDetection:j,inherit:yr,addPlugin:z,removePlugin:W}),n.debugMode=function(){i=!1},n.safeMode=function(){i=!0},n.versionString=ik,n.regex={concat:_l,lookahead:dd,either:Ks,optional:vb,anyNumberOfTimes:kb};for(const F in wi)typeof wi[F]=="object"&&ud(wi[F]);return Object.assign(n,wi),n},ql=wd({});ql.newInstance=()=>wd({});var rk=ql;ql.HighlightJS=ql;ql.default=ql;const on=hb(rk),Tr="[A-Za-z$_][0-9A-Za-z$_]*",ak=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ck=["true","false","null","undefined","NaN","Infinity"],yd=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ed=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Td=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],uk=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],fk=[].concat(Td,yd,Ed);function dk(n){const e=n.regex,t=(M,{after:q})=>{const X="</"+M[0].slice(1);return M.input.indexOf(X,q)!==-1},l=Tr,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,q)=>{const X=M[0].length+M.index,Z=M.input[X];if(Z==="<"||Z===","){q.ignoreMatch();return}Z===">"&&(t(M,{after:X})||q.ignoreMatch());let J;const ee=M.input.substring(X);if(J=ee.match(/^\s*=/)){q.ignoreMatch();return}if((J=ee.match(/^\s+extends\s+/))&&J.index===0){q.ignoreMatch();return}}},c={$pattern:Tr,keyword:ak,literal:ck,built_in:fk,"variable.language":uk},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,m]},T={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},N=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,b,v,y,{match:/\$\d+/},h];m.contains=N.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(N)});const A=[].concat(T,m.contains),I=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:I},R={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,e.concat(l,"(",e.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...yd,...Ed]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function z(M){return e.concat("(?!",M.join("|"),")")}const W={match:e.concat(/\b/,z([...Td,"super","import"].map(M=>`${M}\\s*\\(`)),l,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,b,v,y,T,{match:/\$\d+/},h,D,{scope:"attr",match:l+e.lookahead(":"),relevance:0},L,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,n.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,n.inherit(n.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},W,U,R,Y,{match:/\$[(.]/}]}}const zi="[A-Za-z$_][0-9A-Za-z$_]*",Sd=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Cd=["true","false","null","undefined","NaN","Infinity"],Ad=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Nd=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Id=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Rd=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Md=[].concat(Id,Ad,Nd);function pk(n){const e=n.regex,t=(M,{after:q})=>{const X="</"+M[0].slice(1);return M.input.indexOf(X,q)!==-1},l=zi,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,q)=>{const X=M[0].length+M.index,Z=M.input[X];if(Z==="<"||Z===","){q.ignoreMatch();return}Z===">"&&(t(M,{after:X})||q.ignoreMatch());let J;const ee=M.input.substring(X);if(J=ee.match(/^\s*=/)){q.ignoreMatch();return}if((J=ee.match(/^\s+extends\s+/))&&J.index===0){q.ignoreMatch();return}}},c={$pattern:zi,keyword:Sd,literal:Cd,built_in:Md,"variable.language":Rd},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,m]},T={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},N=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,b,v,y,{match:/\$\d+/},h];m.contains=N.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(N)});const A=[].concat(T,m.contains),I=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:I},R={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,e.concat(l,"(",e.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ad,...Nd]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function z(M){return e.concat("(?!",M.join("|"),")")}const W={match:e.concat(/\b/,z([...Id,"super","import"].map(M=>`${M}\\s*\\(`)),l,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,b,v,y,T,{match:/\$\d+/},h,D,{scope:"attr",match:l+e.lookahead(":"),relevance:0},L,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,n.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,n.inherit(n.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},W,U,R,Y,{match:/\$[(.]/}]}}function hk(n){const e=n.regex,t=pk(n),l=zi,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[t.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:zi,keyword:Sd.concat(u),literal:Cd,built_in:Md.concat(i),"variable.language":Rd},p={className:"meta",begin:"@"+l},h=(v,y,E)=>{const T=v.contains.findIndex(N=>N.label===y);if(T===-1)throw new Error("can not find mode to replace");v.contains.splice(T,1,E)};Object.assign(t.keywords,d),t.exports.PARAMS_CONTAINS.push(p);const m=t.contains.find(v=>v.scope==="attr"),g=Object.assign({},m,{match:e.concat(l,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,m,g]),t.contains=t.contains.concat([p,o,s,g]),h(t,"shebang",n.SHEBANG()),h(t,"use_strict",c);const b=t.contains.find(v=>v.label==="func.def");return b.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function mk(n){const e=n.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},p={begin:/\{\{/,relevance:0},h={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u,p,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,p,d]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",g=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,b=`\\b|${l.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${g}))[eE][+-]?(${m})[jJ]?(?=${b})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${m})[jJ](?=${b})`}]},y={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,v,h,n.HASH_COMMENT_MODE]}]};return d.contains=[h,v,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,y,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[E]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,E,h]}]}}function gk(n){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"string",variants:[n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[n.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function _k(n){const e=n.regex,t={},l={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},l]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},o=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,i]};i.contains.push(c);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},p={match:/\\'/},h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],E={match:/(\/[a-z._-]+)+/},T=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],N=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],I=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:v,literal:y,built_in:[...T,...N,"set","shopt",...A,...I]},contains:[g,n.SHEBANG(),b,h,o,s,E,c,u,d,p,t]}}function bk(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},l=["true","false","null"],i={scope:"literal",beginKeywords:l.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:l},contains:[e,t,n.QUOTE_STRING_MODE,i,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function kk(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",l={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,i]},c=n.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},g={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},b={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},y=[l,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},m,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},b,v,o,s],E=[...y];return E.pop(),E.push(c),g.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}function vk(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},l={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=n.inherit(d,{contains:[]}),m=n.inherit(p,{contains:[]});d.contains.push(m),p.contains.push(h);let g=[t,u];return[d,p,h,m].forEach(E=>{E.contains=E.contains.concat(g)}),g=g.concat(d,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},t,o,d,p,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},i,l,u,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}const wk=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),yk=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ek=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Tk=[...yk,...Ek],Sk=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ck=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Ak=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Nk=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Ik(n){const e=n.regex,t=wk(n),l={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",c=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,l,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ck.join("|")+")"},{begin:":(:)?("+Ak.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Nk.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Sk.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Tk.join("|")+")\\b"}]}}function Rk(n){const e=n.regex,t=n.COMMENT("--","$"),l={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=p,b=[...d,...u].filter(I=>!p.includes(I)),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function T(I){return e.concat(/\b/,e.either(...I.map(O=>O.replace(/\s+/,"\\s+"))),/\b/)}const N={scope:"keyword",match:T(m),relevance:0};function A(I,{exceptions:O,when:R}={}){const D=R;return O=O||[],I.map(B=>B.match(/\|\d+$/)||O.includes(B)?B:D(B)?`${B}|0`:B)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(b,{when:I=>I.length<3}),literal:o,type:c,built_in:h},contains:[{scope:"type",match:T(s)},N,E,v,l,i,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,y]}}function Mk(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),l=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=n.inherit(o,{begin:/\(/,end:/\)/}),c=n.inherit(n.APOS_STRING_MODE,{className:"string"}),u=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:l,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,u,c,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,u,c]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}on.registerLanguage("javascript",dk);on.registerLanguage("typescript",hk);on.registerLanguage("python",mk);on.registerLanguage("go",gk);on.registerLanguage("bash",_k);on.registerLanguage("json",bk);on.registerLanguage("yaml",kk);on.registerLanguage("markdown",vk);on.registerLanguage("css",Ik);on.registerLanguage("sql",Rk);on.registerLanguage("xml",Mk);const Ld=/^(https?|mailto|verstak):/i,Od=new Set(["case","note","file","secret"]);cd.addHook("afterSanitizeAttributes",n=>{if(n.tagName==="A"){const e=(n.getAttribute("href")||"").trim();if(n.hasAttribute("data-verstak-href"))return;Ld.test(e)||(n.removeAttribute("href"),n.setAttribute("data-blocked-href",e),n.classList.add("md-link--blocked"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}n.tagName==="IMG"&&n.remove()});const Fl=new ht.Renderer;Fl.link=function({href:n,title:e,text:t}){const l=(n||"").trim();if(!Ld.test(l)){const c=fl(t);return`<span class="md-link--blocked" data-blocked-href="${Vn(l)}" role="link" aria-disabled="true">${c}</span>`}if(l.startsWith("verstak://")){const c=Dd(l);if(c&&Od.has(c.type)){const p=Vn(l),h=fl(t);return`<a href="#" class="md-link md-link--internal" data-verstak-href="${p}" data-verstak-type="${Vn(c.type)}" data-verstak-id="${Vn(c.id)}">${h}</a>`}const u=fl(t);return`<span class="md-link--blocked" data-blocked-href="${Vn(l)}">${u}</span>`}const i=Vn(l),o=fl(t),s=e?` title="${Vn(e)}"`:"";return`<a href="${i}" class="md-link md-link--external" target="_blank" rel="noopener noreferrer"${s}>${o}</a>`};Fl.image=function({href:n,title:e,text:t}){return`<span class="md-image-blocked" title="Images are not supported yet">[Image: ${fl(t)}]</span>`};Fl.code=function({text:n,lang:e}){const t=e&&on.getLanguage(e)?e:"plaintext";let l;try{l=on.highlight(n,{language:t}).value}catch{l=fl(n)}return`<pre class="md-code-block"><code class="hljs language-${Vn(t)}">${l}</code></pre>`};Fl.codespan=function({text:n}){return`<code class="md-code-inline">${fl(n)}</code>`};Fl.listitem=function({text:n,task:e,checked:t}){return e?`<li class="md-task-item"><input type="checkbox" disabled ${t?"checked":""} class="md-task-checkbox"/><span class="md-task-text">${n}</span></li>`:`<li>${n}</li>`};ht.setOptions({renderer:Fl,gfm:!0,breaks:!1,pedantic:!1});function Lk(n){const e=ht.parse(n);return cd.sanitize(e,{ADD_ATTR:["target","class","data-verstak-href","data-verstak-type","data-verstak-id","data-blocked-href","role","aria-disabled","checked"],ADD_TAGS:["input","span"],ALLOW_UNKNOWN_PROTOCOLS:!0})}function Dd(n){const e=n.match(/^verstak:\/\/([a-zA-Z_]+)\/(.+)$/);return e?{type:e[1],id:e[2]}:null}function Ok(n){return n.replace(/([[\]()])/g,"\\$1")}function Dk(n){return Od.has(n)}function fl(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vn(n){return n.replace(/"/g,""").replace(/'/g,"'")}function Pk(n){let e,t;return{c(){e=new Ri(!1),t=kt(),e.a=t},m(l,i){e.m(n[1],l,i),C(l,t,i)},p(l,i){i&2&&e.p(l[1])},d(l){l&&(S(t),e.d())}}}function qk(n){let e;return{c(){e=f("div"),e.textContent=`${k("note.preview.empty")}`,r(e,"class","md-empty svelte-jdvhib")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function zk(n){let e,t,l,i,o;return{c(){e=f("div"),t=f("p"),t.textContent=`⚠️ ${k("note.preview.error")}`,l=w(),i=f("p"),o=H(n[2]),r(i,"class","md-error-detail svelte-jdvhib"),r(e,"class","md-error svelte-jdvhib")},m(s,c){C(s,e,c),a(e,t),a(e,l),a(e,i),a(i,o)},p(s,c){c&4&&Q(o,s[2])},d(s){s&&S(e)}}}function Bk(n){let e,t,l,i;function o(u,d){var p;return d&1&&(t=null),u[2]?zk:(t==null&&(t=!((p=u[0])!=null&&p.trim())),t?qk:Pk)}let s=o(n,-1),c=s(n);return{c(){e=f("div"),c.c(),r(e,"class","markdown-body svelte-jdvhib"),r(e,"role","article"),r(e,"tabindex","0")},m(u,d){C(u,e,d),c.m(e,null),l||(i=[P(e,"click",n[3]),P(e,"keydown",n[4])],l=!0)},p(u,[d]){s===(s=o(u,d))&&c?c.p(u,d):(c.d(1),c=s(u),c&&(c.c(),c.m(e,null)))},i:se,o:se,d(u){u&&S(e),c.d(),l=!1,Ce(i)}}}function Fk(n,e,t){let{content:l=""}=e;const i=pn();let o="",s="";function c(d){const p=d.target.closest("[data-verstak-href]");if(!p)return;const h=p.getAttribute("data-verstak-href");if(!h)return;d.preventDefault(),d.stopPropagation();const m=Dd(h);!m||!Dk(m.type)||i("verstak-link",{type:m.type,id:m.id,href:h})}const u=d=>{(d.key==="Enter"||d.key===" ")&&c(d)};return n.$$set=d=>{"content"in d&&t(0,l=d.content)},n.$$.update=()=>{if(n.$$.dirty&1)try{t(1,o=Lk(l||"")),t(2,s="")}catch(d){t(2,s=String(d)),t(1,o="")}},[l,o,s,c,u]}class Ys extends ut{constructor(e){super(),ct(this,e,Fk,Bk,at,{content:0})}}function jk(n){let e,t,l,i,o,s;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("file.previewUnavailable")}`,l=w(),i=f("button"),i.textContent=`${k("file.openExternal")}`,r(i,"class","btn btn-sm svelte-1h605ik"),r(e,"class","preview-status svelte-1h605ik")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),o||(s=P(i,"click",n[10]),o=!0)},p:se,i:se,o:se,d(c){c&&S(e),o=!1,s()}}}function Uk(n){let e,t;function l(s,c){return c&2&&(e=null),e==null&&(e=!!(s[1]&&s[1].startsWith("data:"))),e?Yk:Zk}let i=l(n,-1),o=i(n);return{c(){o.c(),t=kt()},m(s,c){o.m(s,c),C(s,t,c)},p(s,c){i===(i=l(s,c))&&o?o.p(s,c):(o.d(1),o=i(s),o&&(o.c(),o.m(t.parentNode,t)))},i:se,o:se,d(s){s&&S(t),o.d(s)}}}function Hk(n){let e,t,l;return{c(){e=f("pre"),t=f("code"),l=H(n[1]),r(e,"class","preview-text svelte-1h605ik")},m(i,o){C(i,e,o),a(e,t),a(t,l)},p(i,o){o&2&&Q(l,i[1])},i:se,o:se,d(i){i&&S(e)}}}function Wk(n){let e,t,l;return t=new Ys({props:{content:n[1]}}),{c(){e=f("div"),Qe(t.$$.fragment),r(e,"class","preview-markdown-container svelte-1h605ik")},m(i,o){C(i,e,o),Ye(t,e,null),l=!0},p(i,o){const s={};o&2&&(s.content=i[1]),t.$set(s)},i(i){l||(ge(t.$$.fragment,i),l=!0)},o(i){ke(t.$$.fragment,i),l=!1},d(i){i&&S(e),Xe(t)}}}function Gk(n){let e,t,l,i;return{c(){e=f("div"),t=f("img"),Pl(t.src,l=n[1])||r(t,"src",l),r(t,"alt",i=n[0].name),r(t,"class","preview-image svelte-1h605ik"),r(e,"class","preview-image-container svelte-1h605ik")},m(o,s){C(o,e,s),a(e,t)},p(o,s){s&2&&!Pl(t.src,l=o[1])&&r(t,"src",l),s&1&&i!==(i=o[0].name)&&r(t,"alt",i)},i:se,o:se,d(o){o&&S(e)}}}function Kk(n){let e,t,l,i,o,s,c;return{c(){e=f("div"),t=f("p"),l=H(n[3]),i=w(),o=f("button"),o.textContent=`${k("file.openExternal")}`,r(o,"class","btn btn-sm svelte-1h605ik"),r(e,"class","preview-status svelte-1h605ik")},m(u,d){C(u,e,d),a(e,t),a(t,l),a(e,i),a(e,o),s||(c=P(o,"click",n[10]),s=!0)},p(u,d){d&8&&Q(l,u[3])},i:se,o:se,d(u){u&&S(e),s=!1,c()}}}function Vk(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("common.loading")}`,r(e,"class","preview-status svelte-1h605ik")},m(l,i){C(l,e,i),a(e,t)},p:se,i:se,o:se,d(l){l&&S(e)}}}function Zk(n){let e,t,l,i,o,s;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("file.pdfUnavailable")}`,l=w(),i=f("button"),i.textContent=`${k("file.openExternal")}`,r(i,"class","btn btn-sm svelte-1h605ik"),r(e,"class","preview-status svelte-1h605ik")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),o||(s=P(i,"click",n[10]),o=!0)},p:se,d(c){c&&S(e),o=!1,s()}}}function Yk(n){let e,t,l;return{c(){e=f("div"),t=f("embed"),Pl(t.src,l=n[1])||r(t,"src",l),r(t,"type","application/pdf"),r(t,"class","preview-pdf svelte-1h605ik"),r(e,"class","preview-pdf-container svelte-1h605ik")},m(i,o){C(i,e,o),a(e,t)},p(i,o){o&2&&!Pl(t.src,l=i[1])&&r(t,"src",l)},d(i){i&&S(e)}}}function Xk(n){let e,t,l,i,o,s,c,u=n[0].name+"",d,p,h,m,g=Mi(n[0].size)+"",b,v,y=Vo(n[0].mime)+"",E,T,N,A,I,O,R,D,B,j,U,z,W,K;o=new jf({props:{kind:n[9],size:18}});const Y=[Vk,Kk,Gk,Wk,Hk,Uk,jk],F=[];function L(M,q){return M[2]?0:M[3]?1:M[7]&&M[1]?2:M[4]?3:M[6]?4:M[5]?5:6}return R=L(n),D=F[R]=Y[R](n),{c(){e=f("div"),t=f("div"),l=f("header"),i=f("div"),Qe(o.$$.fragment),s=w(),c=f("span"),d=H(u),h=w(),m=f("div"),b=H(g),v=H(" · "),E=H(y),T=w(),N=f("div"),A=f("button"),A.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>',I=w(),O=f("div"),D.c(),B=w(),j=f("footer"),U=f("button"),U.textContent=`${k("file.openExternal")}`,r(c,"class","preview-name svelte-1h605ik"),r(c,"title",p=n[0].name),r(i,"class","preview-title svelte-1h605ik"),r(m,"class","preview-meta svelte-1h605ik"),r(A,"class","action-btn action-btn-close svelte-1h605ik"),r(A,"title","Close"),r(A,"aria-label","Close preview"),r(N,"class","preview-actions svelte-1h605ik"),r(l,"class","preview-header svelte-1h605ik"),r(O,"class","preview-body svelte-1h605ik"),r(U,"class","btn btn-sm svelte-1h605ik"),r(j,"class","preview-footer svelte-1h605ik"),r(t,"class","modal svelte-1h605ik"),r(e,"class","overlay svelte-1h605ik"),r(e,"role","presentation")},m(M,q){C(M,e,q),a(e,t),a(t,l),a(l,i),Ye(o,i,null),a(i,s),a(i,c),a(c,d),a(l,h),a(l,m),a(m,b),a(m,v),a(m,E),a(l,T),a(l,N),a(N,A),a(t,I),a(t,O),F[R].m(O,null),a(t,B),a(t,j),a(j,U),z=!0,W||(K=[P(A,"click",n[11]),P(U,"click",n[10]),P(e,"click",xt(n[12])),P(e,"keydown",n[13])],W=!0)},p(M,[q]){(!z||q&1)&&u!==(u=M[0].name+"")&&Q(d,u),(!z||q&1&&p!==(p=M[0].name))&&r(c,"title",p),(!z||q&1)&&g!==(g=Mi(M[0].size)+"")&&Q(b,g),(!z||q&1)&&y!==(y=Vo(M[0].mime)+"")&&Q(E,y);let X=R;R=L(M),R===X?F[R].p(M,q):(yt(),ke(F[X],1,1,()=>{F[X]=null}),Et(),D=F[R],D?D.p(M,q):(D=F[R]=Y[R](M),D.c()),ge(D,1),D.m(O,null))},i(M){z||(ge(o.$$.fragment,M),ge(D),z=!0)},o(M){ke(o.$$.fragment,M),ke(D),z=!1},d(M){M&&S(e),Xe(o),F[R].d(),W=!1,Ce(K)}}}function Jk(n,e,t){let l,i,o,s,{item:c}=e,{content:u=""}=e,{loading:d=!1}=e,{error:p=""}=e;const h=pn(),m=Uf(c);function g(T){T.key==="Escape"&&h("close")}function b(){h("openExternal",c.fileId)}li(()=>{window.addEventListener("keydown",g)}),ii(()=>{window.removeEventListener("keydown",g)});const v=()=>h("close"),y=()=>h("close"),E=T=>{T.key==="Escape"&&(T.preventDefault(),h("close"))};return n.$$set=T=>{"item"in T&&t(0,c=T.item),"content"in T&&t(1,u=T.content),"loading"in T&&t(2,d=T.loading),"error"in T&&t(3,p=T.error)},n.$$.update=()=>{n.$$.dirty&3&&t(7,l=Vf(c)&&u&&u.startsWith("data:")),n.$$.dirty&3&&t(4,i=Li(c)&&u),n.$$.dirty&19&&t(6,o=(Zf(c)||Li(c))&&u&&!i),n.$$.dirty&1&&t(5,s=Yf(c))},[c,u,d,p,i,s,o,l,h,m,b,v,y,E]}class Pd extends ut{constructor(e){super(),ct(this,e,Jk,Xk,at,{item:0,content:1,loading:2,error:3})}}function Qk(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E;return{c(){e=f("div"),t=f("div"),l=f("h3"),i=H(n[0]),o=w(),s=f("p"),c=H(n[1]),u=w(),d=f("div"),p=f("button"),h=H(n[2]),g=w(),b=f("button"),v=H(n[3]),r(l,"class","svelte-1fv6yyk"),r(s,"class","message svelte-1fv6yyk"),r(p,"class",m="btn "+(n[4]?"btn-danger":"btn-primary")+" svelte-1fv6yyk"),r(b,"class","btn svelte-1fv6yyk"),r(d,"class","actions svelte-1fv6yyk"),r(t,"class","modal svelte-1fv6yyk"),r(e,"class","overlay svelte-1fv6yyk"),r(e,"role","presentation")},m(T,N){C(T,e,N),a(e,t),a(t,l),a(l,i),a(t,o),a(t,s),a(s,c),a(t,u),a(t,d),a(d,p),a(p,h),a(d,g),a(d,b),a(b,v),y||(E=[P(p,"click",n[6]),P(b,"click",n[7]),P(e,"click",xt(n[8])),P(e,"keydown",n[9])],y=!0)},p(T,[N]){N&1&&Q(i,T[0]),N&2&&Q(c,T[1]),N&4&&Q(h,T[2]),N&16&&m!==(m="btn "+(T[4]?"btn-danger":"btn-primary")+" svelte-1fv6yyk")&&r(p,"class",m),N&8&&Q(v,T[3])},i:se,o:se,d(T){T&&S(e),y=!1,Ce(E)}}}function xk(n,e,t){let{title:l=k("common.confirm")}=e,{message:i=""}=e,{confirmText:o=k("common.delete")}=e,{cancelText:s=k("common.cancel")}=e,{danger:c=!1}=e;const u=pn(),d=()=>u("confirm"),p=()=>u("cancel"),h=()=>u("cancel"),m=g=>{g.key==="Escape"&&(g.preventDefault(),u("cancel"))};return n.$$set=g=>{"title"in g&&t(0,l=g.title),"message"in g&&t(1,i=g.message),"confirmText"in g&&t(2,o=g.confirmText),"cancelText"in g&&t(3,s=g.cancelText),"danger"in g&&t(4,c=g.danger)},[l,i,o,s,c,u,d,p,h,m]}class qd extends ut{constructor(e){super(),ct(this,e,xk,Qk,at,{title:0,message:1,confirmText:2,cancelText:3,danger:4})}}function $k(n){let e,t,l;return{c(){e=ae("circle"),t=ae("line"),l=ae("line"),r(e,"cx","12"),r(e,"cy","12"),r(e,"r","10"),r(t,"x1","12"),r(t,"y1","16"),r(t,"x2","12"),r(t,"y2","12"),r(l,"x1","12"),r(l,"y1","8"),r(l,"x2","12.01"),r(l,"y2","8")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function ev(n){let e,t,l,i;return{c(){e=ae("rect"),t=ae("polyline"),l=ae("line"),i=ae("line"),r(e,"x","3"),r(e,"y","5"),r(e,"width","18"),r(e,"height","14"),r(e,"rx","2"),r(t,"points","3 10 21 10"),r(l,"x1","8"),r(l,"y1","5"),r(l,"x2","8"),r(l,"y2","19"),r(i,"x1","16"),r(i,"y1","5"),r(i,"x2","16"),r(i,"y2","19")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function tv(n){let e,t;return{c(){e=ae("path"),t=ae("polyline"),r(e,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),r(t,"points","13 2 13 9 20 9")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function nv(n){let e,t;return{c(){e=ae("path"),t=ae("path"),r(e,"d","M12 20h9"),r(t,"d","M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function lv(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("path"),l=ae("line"),i=ae("line"),o=ae("line"),r(e,"d","M4 19.5A2.5 2.5 0 0 1 6.5 17H20"),r(t,"d","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"),r(l,"x1","8"),r(l,"y1","7"),r(l,"x2","16"),r(l,"y2","7"),r(i,"x1","8"),r(i,"y1","11"),r(i,"x2","14"),r(i,"y2","11"),r(o,"x1","8"),r(o,"y1","15"),r(o,"x2","12"),r(o,"y2","15")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function iv(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","16"),r(l,"y1","13"),r(l,"x2","8"),r(l,"y2","13"),r(i,"x1","16"),r(i,"y1","17"),r(i,"x2","8"),r(i,"y2","17")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function sv(n){let e,t;return{c(){e=ae("path"),t=ae("circle"),r(e,"d","M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"),r(t,"cx","12"),r(t,"cy","7"),r(t,"r","4")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function ov(n){let e,t,l,i;return{c(){e=ae("rect"),t=ae("rect"),l=ae("rect"),i=ae("rect"),r(e,"x","3"),r(e,"y","3"),r(e,"width","7"),r(e,"height","7"),r(e,"rx","1"),r(t,"x","14"),r(t,"y","3"),r(t,"width","7"),r(t,"height","4"),r(t,"rx","1"),r(l,"x","14"),r(l,"y","10"),r(l,"width","7"),r(l,"height","11"),r(l,"rx","1"),r(i,"x","3"),r(i,"y","14"),r(i,"width","7"),r(i,"height","7"),r(i,"rx","1")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function rv(n){let e;return{c(){e=ae("path"),r(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,l){C(t,e,l)},d(t){t&&S(e)}}}function av(n){let e;function t(o,s){return o[0]==="folder"?rv:o[0]==="project"?ov:o[0]==="client"?sv:o[0]==="document"?iv:o[0]==="recipe"?lv:o[0]==="note"?nv:o[0]==="file"?tv:o[0]==="case"?ev:$k}let l=t(n),i=l(n);return{c(){e=ae("svg"),i.c(),r(e,"width",n[1]),r(e,"height",n[1]),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","1.5"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round"),r(e,"xmlns","http://www.w3.org/2000/svg")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l!==(l=t(o))&&(i.d(1),i=l(o),i&&(i.c(),i.m(e,null))),s&2&&r(e,"width",o[1]),s&2&&r(e,"height",o[1])},i:se,o:se,d(o){o&&S(e),i.d()}}}function cv(n,e,t){let{kind:l="generic"}=e,{size:i=18}=e;return n.$$set=o=>{"kind"in o&&t(0,l=o.kind),"size"in o&&t(1,i=o.size)},[l,i]}class Gi extends ut{constructor(e){super(),ct(this,e,cv,av,at,{kind:0,size:1})}}function Sr(n,e,t){const l=n.slice();return l[44]=e[t],l}function uv(n){let e;return{c(){e=f("span"),r(e,"class","tree-toggle-placeholder svelte-zj71cl")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function fv(n){let e,t,l=n[1][n[44].id]?"▾":"▸",i,o,s;function c(){return n[25](n[44])}return{c(){e=f("button"),t=f("span"),i=H(l),r(t,"class","tree-arrow"),r(e,"class","tree-toggle svelte-zj71cl")},m(u,d){C(u,e,d),a(e,t),a(t,i),o||(s=P(e,"click",We(c)),o=!0)},p(u,d){n=u,d[0]&3&&l!==(l=n[1][n[44].id]?"▾":"▸")&&Q(i,l)},d(u){u&&S(e),o=!1,s()}}}function Cr(n){let e,t;return e=new zd({props:{nodes:n[44].children||[],expanded:n[1],selectedNodeId:n[2],level:n[3]+1,onSelect:n[4],onToggle:n[5],onContextMenu:n[6],onDrop:n[7]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[0]&1&&(o.nodes=l[44].children||[]),i[0]&2&&(o.expanded=l[1]),i[0]&4&&(o.selectedNodeId=l[2]),i[0]&8&&(o.level=l[3]+1),i[0]&16&&(o.onSelect=l[4]),i[0]&32&&(o.onToggle=l[5]),i[0]&64&&(o.onContextMenu=l[6]),i[0]&128&&(o.onDrop=l[7]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function Ar(n,e){let t,l,i,o,s,c,u,d=e[44].title+"",p,h,m=e[1][e[44].id]&&Ms(e[44]),g,b,v,y;function E(L,M){return M[0]&1&&(l=null),l==null&&(l=!!Ql(L[44])),l?fv:uv}let T=E(e,[-1,-1]),N=T(e);s=new Gi({props:{kind:Nr(e[44]),size:16}});function A(...L){return e[26](e[44],...L)}function I(...L){return e[27](e[44],...L)}function O(){return e[28](e[44])}function R(...L){return e[29](e[44],...L)}function D(...L){return e[30](e[44],...L)}function B(...L){return e[31](e[44],...L)}function j(...L){return e[32](e[44],...L)}function U(...L){return e[33](e[44],...L)}function z(...L){return e[34](e[44],...L)}function W(...L){return e[35](e[44],...L)}function K(...L){return e[36](e[44],...L)}function Y(...L){return e[37](e[44],...L)}let F=m&&Cr(e);return{key:n,first:null,c(){t=f("div"),N.c(),i=w(),o=f("span"),Qe(s.$$.fragment),c=w(),u=f("span"),p=H(d),h=w(),F&&F.c(),g=kt(),r(o,"class","tree-icon svelte-zj71cl"),r(o,"role","button"),r(o,"tabindex","-1"),r(u,"class","tree-label svelte-zj71cl"),r(u,"role","button"),r(u,"tabindex","-1"),r(t,"class","tree-item svelte-zj71cl"),sn(t,"padding-left",e[3]*16+4+"px"),r(t,"draggable","true"),r(t,"role","button"),r(t,"tabindex","0"),ce(t,"selected",e[2]===e[44].id),ce(t,"drop-valid",e[8]===e[44].id&&e[9][e[44].id]),ce(t,"drop-invalid",e[8]===e[44].id&&!e[9][e[44].id]),this.first=t},m(L,M){C(L,t,M),N.m(t,null),a(t,i),a(t,o),Ye(s,o,null),a(t,c),a(t,u),a(u,p),C(L,h,M),F&&F.m(L,M),C(L,g,M),b=!0,v||(y=[P(o,"click",A),P(o,"keydown",I),P(o,"dblclick",We(e[24])),P(u,"click",We(O)),P(u,"keydown",R),P(t,"dragstart",D),P(t,"dragover",B),P(t,"dragleave",j),P(t,"drop",U),P(t,"click",z),P(t,"keydown",W),P(t,"dblclick",K),P(t,"contextmenu",ji(Y))],v=!0)},p(L,M){e=L,T===(T=E(e,M))&&N?N.p(e,M):(N.d(1),N=T(e),N&&(N.c(),N.m(t,i)));const q={};M[0]&1&&(q.kind=Nr(e[44])),s.$set(q),(!b||M[0]&1)&&d!==(d=e[44].title+"")&&Q(p,d),(!b||M[0]&8)&&sn(t,"padding-left",e[3]*16+4+"px"),(!b||M[0]&5)&&ce(t,"selected",e[2]===e[44].id),(!b||M[0]&769)&&ce(t,"drop-valid",e[8]===e[44].id&&e[9][e[44].id]),(!b||M[0]&769)&&ce(t,"drop-invalid",e[8]===e[44].id&&!e[9][e[44].id]),M[0]&3&&(m=e[1][e[44].id]&&Ms(e[44])),m?F?(F.p(e,M),M[0]&3&&ge(F,1)):(F=Cr(e),F.c(),ge(F,1),F.m(g.parentNode,g)):F&&(yt(),ke(F,1,1,()=>{F=null}),Et())},i(L){b||(ge(s.$$.fragment,L),ge(F),b=!0)},o(L){ke(s.$$.fragment,L),ke(F),b=!1},d(L){L&&(S(t),S(h),S(g)),N.d(),Xe(s),F&&F.d(L),v=!1,Ce(y)}}}function dv(n){let e=[],t=new Map,l,i,o,s,c=Te(n[0]);const u=d=>d[44].id;for(let d=0;d<c.length;d+=1){let p=Sr(n,c,d),h=u(p);t.set(h,e[d]=Ar(h,p))}return{c(){for(let d=0;d<e.length;d+=1)e[d].c();l=kt()},m(d,p){for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(d,p);C(d,l,p),i=!0,o||(s=P(window,"dragend",n[14]),o=!0)},p(d,p){p[0]&2080767&&(c=Te(d[0]),yt(),e=Ff(e,p,u,1,d,c,t,l.parentNode,Bf,Ar,l,Sr),Et())},i(d){if(!i){for(let p=0;p<c.length;p+=1)ge(e[p]);i=!0}},o(d){for(let p=0;p<e.length;p+=1)ke(e[p]);i=!1},d(d){d&&S(l);for(let p=0;p<e.length;p+=1)e[p].d(d);o=!1,s()}}}function Nr(n){return n.type==="client"||n.template_id==="client.default"?"client":n.type==="project"||n.template_id==="project.default"?"project":n.type==="document"||n.template_id==="document.default"?"document":n.type==="recipe"||n.template_id==="recipe.default"?"recipe":n.type==="folder"||n.template_id==="folder.default"?"folder":n.type==="case"?"case":n.type==="note"?"note":n.type==="file"?"file":"generic"}function Ms(n){return n.children!==void 0}function Ql(n){return Ms(n)?n.children.length>0:n.has_children===!0}function Ir(n){const e={};function t(l,i){for(const o of l)e[o.id]=i,o.children&&t(o.children,o.id)}return t(n,""),e}function Rr(n){const e=[];function t(l){for(const i of l)e.push(i),i.children&&t(i.children)}return t(n),e}function pv(n){try{return n.dataTransfer.getData("text/plain")}catch{return""}}function hv(n,e,t){let l,i,o,{nodes:s=[]}=e,{expanded:c={}}=e,{selectedNodeId:u=""}=e,{level:d=0}=e,{onSelect:p=void 0}=e,{onToggle:h=void 0}=e,{onContextMenu:m=void 0}=e,{onDrop:g=void 0}=e,b={},v=null,y="",E="";const T=["folder","project","client","document","recipe","case"];ii(()=>{for(const ne of Object.keys(b))clearTimeout(b[ne]);v&&clearInterval(v)});function N(ne){return T.includes(ne.type)}function A(ne,re,Ne){if(!ne||!re||re===ne.id||!N(ne))return!1;let Fe=ne.id;for(;Fe;){if(Fe===re)return!1;Fe=Ne[Fe]||""}return!0}function I(ne,re){ne.stopPropagation(),ne.dataTransfer.effectAllowed="move",ne.dataTransfer.setData("text/plain",re.id),t(21,y=re.id)}function O(ne,re){ne.preventDefault(),ne.stopPropagation(),ne.dataTransfer.dropEffect="move",E!==re.id&&t(8,E=re.id),Ql(re)&&!c[re.id]&&!b[re.id]&&(b[re.id]=setTimeout(()=>{h&&h(re.id),delete b[re.id]},600));const Ne=ne.currentTarget.closest(".workspace-tree-area");if(Ne){const Fe=Ne.getBoundingClientRect(),we=30;ne.clientY-Fe.top<we?v||(v=setInterval(()=>{Ne.scrollTop-=10},50)):Fe.bottom-ne.clientY<we?v||(v=setInterval(()=>{Ne.scrollTop+=10},50)):v&&(clearInterval(v),v=null)}}function R(ne,re){const Ne=ne.relatedTarget;Ne&&ne.currentTarget.contains(Ne)||(E===re.id&&t(8,E=""),b[re.id]&&(clearTimeout(b[re.id]),delete b[re.id]),v&&(clearInterval(v),v=null))}function D(ne,re){ne.preventDefault(),ne.stopPropagation(),b[re.id]&&(clearTimeout(b[re.id]),delete b[re.id]),v&&(clearInterval(v),v=null);const Ne=Rr(s),Fe=Ir(Ne),we=pv(ne);if(!A(re,we,Fe)){t(8,E=""),t(21,y="");return}g&&g(we,re.id),t(8,E=""),t(21,y="")}function B(){t(8,E=""),t(21,y="");for(const ne of Object.keys(b))clearTimeout(b[ne]),delete b[ne];v&&(clearInterval(v),v=null)}function j(ne,re){ne.target.closest(".tree-toggle")||ne.target.closest(".tree-icon")||p&&p(re)}function U(ne,re){Ql(re)&&h&&h(re.id)}function z(ne,re){(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),p&&p(re))}function W(ne,re){ne.stopPropagation(),Ql(re)&&h&&h(re.id)}function K(ne,re){(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),ne.stopPropagation(),Ql(re)&&h&&h(re.id))}function Y(ne,re){(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),p&&p(re))}function F(ne,re,Ne){const Fe={};function we(je){for(const xe of je)Fe[xe.id]=A(xe,re,Ne),xe.children&&we(xe.children)}return we(ne),Fe}function L(ne){Ds.call(this,n,ne)}const M=ne=>h&&h(ne.id),q=(ne,re)=>W(re,ne),X=(ne,re)=>K(re,ne),Z=ne=>p&&p(ne),J=(ne,re)=>Y(re,ne),ee=(ne,re)=>I(re,ne),te=(ne,re)=>O(re,ne),le=(ne,re)=>R(re,ne),_e=(ne,re)=>D(re,ne),oe=(ne,re)=>j(re,ne),ze=(ne,re)=>z(re,ne),Ge=(ne,re)=>U(re,ne),Ie=(ne,re)=>m&&m(re,ne);return n.$$set=ne=>{"nodes"in ne&&t(0,s=ne.nodes),"expanded"in ne&&t(1,c=ne.expanded),"selectedNodeId"in ne&&t(2,u=ne.selectedNodeId),"level"in ne&&t(3,d=ne.level),"onSelect"in ne&&t(4,p=ne.onSelect),"onToggle"in ne&&t(5,h=ne.onToggle),"onContextMenu"in ne&&t(6,m=ne.onContextMenu),"onDrop"in ne&&t(7,g=ne.onDrop)},n.$$.update=()=>{n.$$.dirty[0]&1&&t(23,l=Rr(s)),n.$$.dirty[0]&8388608&&t(22,i=Ir(l)),n.$$.dirty[0]&14680064&&t(9,o=F(l,y,i))},[s,c,u,d,p,h,m,g,E,o,I,O,R,D,B,j,U,z,W,K,Y,y,i,l,L,M,q,X,Z,J,ee,te,le,_e,oe,ze,Ge,Ie]}class zd extends ut{constructor(e){super(),ct(this,e,hv,dv,at,{nodes:0,expanded:1,selectedNodeId:2,level:3,onSelect:4,onToggle:5,onContextMenu:6,onDrop:7},null,[-1,-1])}}function Mr(n){let e,t;return{c(){e=f("div"),t=H(n[4]),r(e,"class","path-info svelte-a9f1pd")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&16&&Q(t,l[4])},d(l){l&&S(e)}}}function Lr(n){let e,t;return{c(){e=f("div"),t=H(n[3]),r(e,"class","error-msg svelte-a9f1pd")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&8&&Q(t,l[3])},d(l){l&&S(e)}}}function mv(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T=k("firstrun.browse")+"",N,A,I,O,R,D,B=(n[2]?k("firstrun.creating"):k("firstrun.create"))+"",j,U,z,W,K,Y,F=n[4]&&Mr(n),L=n[3]&&Lr(n);return{c(){e=f("div"),t=f("div"),l=f("img"),o=w(),s=f("h1"),s.textContent=`${k("firstrun.title")}`,c=w(),u=f("p"),u.textContent=`${k("firstrun.desc")}`,d=w(),p=f("div"),h=f("label"),h.textContent=`${k("firstrun.pathLabel")}`,m=w(),g=f("div"),b=f("input"),y=w(),E=f("button"),N=H(T),A=w(),F&&F.c(),I=w(),L&&L.c(),O=w(),R=f("div"),D=f("button"),j=H(B),z=w(),W=f("button"),W.textContent=`${k("firstrun.quit")}`,r(l,"class","first-run-logo svelte-a9f1pd"),Pl(l.src,i="/assets/app-icons/icon_64x64.png")||r(l,"src",i),r(l,"width","64"),r(l,"height","64"),r(l,"alt",""),r(s,"class","svelte-a9f1pd"),r(u,"class","first-run-desc svelte-a9f1pd"),r(h,"class","form-label svelte-a9f1pd"),r(h,"for","vault-path"),r(b,"id","vault-path"),r(b,"type","text"),r(b,"placeholder",v=n[1]||k("firstrun.defaultPath")),b.disabled=n[2],r(b,"class","svelte-a9f1pd"),r(E,"class","btn"),E.disabled=n[2],r(g,"class","input-row svelte-a9f1pd"),r(p,"class","form-group svelte-a9f1pd"),r(D,"class","btn btn-primary btn-lg svelte-a9f1pd"),D.disabled=U=!n[0].trim()||n[2],r(W,"class","btn btn-lg svelte-a9f1pd"),r(R,"class","first-run-actions svelte-a9f1pd"),r(t,"class","first-run-card svelte-a9f1pd"),r(e,"class","first-run-screen svelte-a9f1pd")},m(M,q){C(M,e,q),a(e,t),a(t,l),a(t,o),a(t,s),a(t,c),a(t,u),a(t,d),a(t,p),a(p,h),a(p,m),a(p,g),a(g,b),Me(b,n[0]),a(g,y),a(g,E),a(E,N),a(t,A),F&&F.m(t,null),a(t,I),L&&L.m(t,null),a(t,O),a(t,R),a(R,D),a(D,j),a(R,z),a(R,W),K||(Y=[P(b,"input",n[12]),P(b,"input",n[6]),P(b,"keydown",n[9]),P(E,"click",n[5]),P(D,"click",n[7]),P(W,"click",n[8])],K=!0)},p(M,[q]){q&2&&v!==(v=M[1]||k("firstrun.defaultPath"))&&r(b,"placeholder",v),q&4&&(b.disabled=M[2]),q&1&&b.value!==M[0]&&Me(b,M[0]),q&4&&(E.disabled=M[2]),M[4]?F?F.p(M,q):(F=Mr(M),F.c(),F.m(t,I)):F&&(F.d(1),F=null),M[3]?L?L.p(M,q):(L=Lr(M),L.c(),L.m(t,O)):L&&(L.d(1),L=null),q&4&&B!==(B=(M[2]?k("firstrun.creating"):k("firstrun.create"))+"")&&Q(j,B),q&5&&U!==(U=!M[0].trim()||M[2])&&(D.disabled=U)},i:se,o:se,d(M){M&&S(e),F&&F.d(),L&&L.d(),K=!1,Ce(Y)}}}function yi(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function gv(n,e,t){let{onComplete:l=null}=e,{onQuit:i=null}=e,o="",s="",c=!1,u="",d="",p=null;async function h(){try{const T=await yi("GetDefaultVaultPath");t(1,s=T||""),t(0,o=s||""),o&&await g()}catch{t(1,s="")}}h();async function m(){try{const T=await yi("PickDirectory");T&&(t(0,o=T),await g())}catch(T){t(3,u=String(T))}}async function g(){if(!o||!o.trim()){t(4,d=""),p=null;return}try{p=await yi("CheckVaultPath",o.trim()),p&&t(4,d=p.description)}catch{t(4,d=""),p=null}}async function b(){if(!(!o||!o.trim())){if(t(2,c=!0),t(3,u=""),p&&!p.writable){t(3,u=k("firstrun.errorNoWrite")),t(2,c=!1);return}try{const T=await yi("CreateVault",o.trim());T&&T.status==="ready"&&l&&l(T)}catch(T){t(3,u=String(T))}t(2,c=!1)}}function v(){i&&i()}function y(T){T.key==="Enter"&&!c&&o.trim()&&b()}function E(){o=this.value,t(0,o)}return n.$$set=T=>{"onComplete"in T&&t(10,l=T.onComplete),"onQuit"in T&&t(11,i=T.onQuit)},[o,s,c,u,d,m,g,b,v,y,l,i,E]}class _v extends ut{constructor(e){super(),ct(this,e,gv,mv,at,{onComplete:10,onQuit:11})}}function Or(n){let e,t;return{c(){e=f("div"),t=H(n[2]),r(e,"class","error-msg svelte-s3o8c3")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&4&&Q(t,l[2])},d(l){l&&S(e)}}}function Dr(n){let e,t,l,i,o,s,c,u,d=k("common.yes")+"",p,h,m,g,b;return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("recovery.createConfirmTitle")}`,i=w(),o=f("p"),o.textContent=`${k("recovery.createConfirm")}`,s=w(),c=f("div"),u=f("button"),p=H(d),h=w(),m=f("button"),m.textContent=`${k("common.cancel")}`,r(l,"class","svelte-s3o8c3"),r(o,"class","modal-desc svelte-s3o8c3"),r(u,"class","btn btn-primary"),u.disabled=n[1],r(m,"class","btn"),r(c,"class","modal-actions svelte-s3o8c3"),r(t,"class","modal svelte-s3o8c3"),r(e,"class","modal-overlay svelte-s3o8c3"),r(e,"role","button"),r(e,"tabindex","0")},m(v,y){C(v,e,y),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(c,u),a(u,p),a(c,h),a(c,m),g||(b=[P(u,"click",n[6]),P(m,"click",n[7]),P(e,"click",xt(n[7])),P(e,"keydown",n[11])],g=!0)},p(v,y){y&2&&(u.disabled=v[1])},d(v){v&&S(e),g=!1,Ce(b)}}}function bv(n){let e,t,l,i,o,s,c,u,d,p=(n[0]||"—")+"",h,m,g,b,v,y=k("recovery.choose")+"",E,T,N,A=k("recovery.create")+"",I,O,R,D,B,j,U,z=n[2]&&Or(n),W=n[3]&&Dr(n);return{c(){e=f("div"),t=f("div"),l=f("div"),l.textContent="⚠",i=w(),o=f("h1"),o.textContent=`${k("recovery.title")}`,s=w(),c=f("p"),c.textContent=`${k("recovery.expected")}:`,u=w(),d=f("code"),h=H(p),m=w(),z&&z.c(),g=w(),b=f("div"),v=f("button"),E=H(y),T=w(),N=f("button"),I=H(A),O=w(),R=f("button"),R.textContent=`${k("recovery.quit")}`,D=w(),W&&W.c(),B=kt(),r(l,"class","recovery-icon svelte-s3o8c3"),r(o,"class","svelte-s3o8c3"),r(c,"class","recovery-desc svelte-s3o8c3"),r(d,"class","recovery-path svelte-s3o8c3"),r(v,"class","btn btn-primary btn-lg svelte-s3o8c3"),v.disabled=n[1],r(N,"class","btn btn-lg svelte-s3o8c3"),N.disabled=n[1],r(R,"class","btn btn-lg svelte-s3o8c3"),r(b,"class","recovery-actions svelte-s3o8c3"),r(t,"class","recovery-card svelte-s3o8c3"),r(e,"class","recovery-screen svelte-s3o8c3")},m(K,Y){C(K,e,Y),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(t,u),a(t,d),a(d,h),a(t,m),z&&z.m(t,null),a(t,g),a(t,b),a(b,v),a(v,E),a(b,T),a(b,N),a(N,I),a(b,O),a(b,R),C(K,D,Y),W&&W.m(K,Y),C(K,B,Y),j||(U=[P(v,"click",n[4]),P(N,"click",n[5]),P(R,"click",n[8])],j=!0)},p(K,[Y]){Y&1&&p!==(p=(K[0]||"—")+"")&&Q(h,p),K[2]?z?z.p(K,Y):(z=Or(K),z.c(),z.m(t,g)):z&&(z.d(1),z=null),Y&2&&(v.disabled=K[1]),Y&2&&(N.disabled=K[1]),K[3]?W?W.p(K,Y):(W=Dr(K),W.c(),W.m(B.parentNode,B)):W&&(W.d(1),W=null)},i:se,o:se,d(K){K&&(S(e),S(D),S(B)),z&&z.d(),W&&W.d(K),j=!1,Ce(U)}}}function vs(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function kv(n,e,t){let{vaultPath:l=""}=e,{onComplete:i=null}=e,{onQuit:o=null}=e,s=!1,c="",u=!1;async function d(){try{const v=await vs("PickDirectory");if(!v)return;t(1,s=!0),t(2,c="");const y=await vs("OpenVault",v);y&&y.status==="ready"&&i&&i(y)}catch(v){t(2,c=String(v))}t(1,s=!1)}function p(){t(3,u=!0)}async function h(){t(3,u=!1),t(1,s=!0),t(2,c="");try{const v=await vs("CreateVault",l);v&&v.status==="ready"&&i&&i(v)}catch(v){t(2,c=String(v))}t(1,s=!1)}function m(){t(3,u=!1)}function g(){o&&o()}const b=v=>v.key==="Enter"&&m();return n.$$set=v=>{"vaultPath"in v&&t(0,l=v.vaultPath),"onComplete"in v&&t(9,i=v.onComplete),"onQuit"in v&&t(10,o=v.onQuit)},[l,s,c,u,d,p,h,m,g,i,o,b]}class vv extends ut{constructor(e){super(),ct(this,e,kv,bv,at,{vaultPath:0,onComplete:9,onQuit:10})}}function Pr(n,e,t){const l=n.slice();return l[5]=e[t],l}function wv(n){let e,t;return{c(){e=ae("circle"),t=ae("path"),r(e,"cx","12"),r(e,"cy","12"),r(e,"r","3"),r(t,"d","M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function yv(n){let e,t,l;return{c(){e=ae("path"),t=ae("path"),l=ae("path"),r(e,"d","M5 4h12l2 2v14H5z"),r(t,"d","M8 4v6h8V4"),r(l,"d","M8 20v-6h8v6")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function Ev(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("path"),l=ae("path"),i=ae("path"),r(e,"d","M20 11a8 8 0 0 0-14-4l-2 2"),r(t,"d","M4 5v4h4"),r(l,"d","M4 13a8 8 0 0 0 14 4l2-2"),r(i,"d","M20 19v-4h-4")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function Tv(n){let e;return{c(){e=ae("path"),r(e,"d","M4 19V9M10 19V5M16 19v-7M22 19H2")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Sv(n){let e;return{c(){e=ae("path"),r(e,"d","M3 6h6l2 2h10v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6z")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Cv(n){let e,t;return{c(){e=ae("path"),t=ae("path"),r(e,"d","M9 3v5M15 3v5M7 8h10v3a5 5 0 0 1-10 0V8z"),r(t,"d","M12 16v5")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function Av(n){let e,t;return{c(){e=ae("rect"),t=ae("path"),r(e,"x","4"),r(e,"y","3"),r(e,"width","16"),r(e,"height","18"),r(e,"rx","2"),r(t,"d","M8 7h8M8 11h8M8 15h5")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function Nv(n){let e,t,l;return{c(){e=ae("path"),t=ae("path"),l=ae("path"),r(e,"d","M3 10.5 12 3l9 7.5"),r(t,"d","M5 9.5V21h14V9.5"),r(l,"d","M10 21v-6h4v6")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function Iv(n){let e,t;return{c(){e=ae("circle"),t=ae("path"),r(e,"cx","12"),r(e,"cy","12"),r(e,"r","3"),r(t,"d","M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 0 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V22h-4v-.2a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 0 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H2v-4h.2a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 0 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3 1.7 1.7 0 0 0 1-1.5V2h4v.2a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 0 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8 1.7 1.7 0 0 0 1.5 1h.2v4h-.2a1.7 1.7 0 0 0-1.4 1z")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function qr(n){let e,t,l,i,o,s,c,u;function d(g,b){if(g[5].id==="general")return Iv;if(g[5].id==="workspace")return Nv;if(g[5].id==="templates")return Av;if(g[5].id==="plugins")return Cv;if(g[5].id==="files")return Sv;if(g[5].id==="activity")return Tv;if(g[5].id==="sync")return Ev;if(g[5].id==="backup")return yv;if(g[5].id==="browserBridge")return wv}let p=d(n),h=p&&p(n);function m(){return n[4](n[5])}return{c(){e=f("button"),t=f("span"),l=ae("svg"),h&&h.c(),i=w(),o=f("span"),o.textContent=`${n[5].label}`,s=w(),r(l,"width","16"),r(l,"height","16"),r(l,"viewBox","0 0 24 24"),r(l,"fill","none"),r(l,"stroke","currentColor"),r(l,"stroke-width","1.8"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"aria-hidden","true"),r(t,"class","settings-nav-icon svelte-8ag2z0"),r(o,"class","settings-nav-label svelte-8ag2z0"),r(e,"class","settings-nav-item svelte-8ag2z0"),ce(e,"active",n[0]===n[5].id),ce(e,"disabled",n[5].id==="files"||n[5].id==="activity"||n[5].id==="backup")},m(g,b){C(g,e,b),a(e,t),a(t,l),h&&h.m(l,null),a(e,i),a(e,o),a(e,s),c||(u=P(e,"click",m),c=!0)},p(g,b){n=g,b&3&&ce(e,"active",n[0]===n[5].id)},d(g){g&&S(e),h&&h.d(),c=!1,u()}}}function Rv(n){let e,t=Te(n[1]),l=[];for(let i=0;i<t.length;i+=1)l[i]=qr(Pr(n,t,i));return{c(){e=f("nav");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","settings-sidebar svelte-8ag2z0")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,[o]){if(o&7){t=Te(i[1]);let s;for(s=0;s<t.length;s+=1){const c=Pr(i,t,s);l[s]?l[s].p(c,o):(l[s]=qr(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},i:se,o:se,d(i){i&&S(e),et(l,i)}}}function Mv(n,e,t){let{activeSection:l="general"}=e,{onSelect:i=null}=e;const o=[{id:"general",label:k("settings.general")},{id:"workspace",label:k("settings.workspace")},{id:"templates",label:k("settings.templates")},{id:"plugins",label:k("settings.plugins")},{id:"files",label:k("settings.files")},{id:"activity",label:k("settings.activity")},{id:"sync",label:k("settings.sync")},{id:"backup",label:k("settings.backup")},{id:"browserBridge",label:"Browser Bridge"}];function s(u){i&&i(u)}const c=u=>s(u.id);return n.$$set=u=>{"activeSection"in u&&t(0,l=u.activeSection),"onSelect"in u&&t(3,i=u.onSelect)},[l,o,s,i,c]}class Lv extends ut{constructor(e){super(),ct(this,e,Mv,Rv,at,{activeSection:0,onSelect:3})}}function zr(n){let e;return{c(){e=f("div"),e.textContent=`${k("settings.saved")}`,r(e,"class","save-notice svelte-1e2uhdh")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Ov(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M=n[1]&&zr();return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("settings.general")}`,l=w(),i=f("p"),i.textContent=`${k("settings.generalDesc")}`,o=w(),s=f("div"),c=f("h3"),c.textContent=`${k("settings.appearance")}`,u=w(),d=f("div"),p=f("label"),h=f("span"),h.textContent=`${k("settings.theme")}`,m=w(),g=f("select"),b=f("option"),b.textContent=`${k("settings.themeSystem")}`,v=f("option"),v.textContent=`${k("settings.themeLight")} (${k("settings.langSoon")})`,y=f("option"),y.textContent=`${k("settings.themeDark")} (${k("settings.langSoon")})`,E=w(),T=f("div"),N=f("h3"),N.textContent=`${k("settings.localization")}`,A=w(),I=f("div"),O=f("label"),R=f("span"),R.textContent=`${k("settings.language")}`,D=w(),B=f("select"),j=f("option"),j.textContent=`${k("settings.langRu")}`,U=f("option"),U.textContent=`${k("settings.langEn")} (${k("settings.langSoon")})`,z=w(),W=f("div"),M&&M.c(),K=w(),Y=f("button"),Y.textContent=`${k("settings.save")}`,r(t,"class","svelte-1e2uhdh"),r(i,"class","section-desc svelte-1e2uhdh"),r(c,"class","card-title svelte-1e2uhdh"),r(h,"class","label-text svelte-1e2uhdh"),b.__value="system",Me(b,b.__value),v.__value="light",Me(v,v.__value),v.disabled=!0,y.__value="dark",Me(y,y.__value),y.disabled=!0,n[0]===void 0&&hl(()=>n[5].call(g)),r(d,"class","form-group svelte-1e2uhdh"),r(s,"class","settings-card svelte-1e2uhdh"),r(N,"class","card-title svelte-1e2uhdh"),r(R,"class","label-text svelte-1e2uhdh"),j.__value="ru",Me(j,j.__value),U.__value="en",Me(U,U.__value),B.disabled=!0,r(I,"class","form-group svelte-1e2uhdh"),r(T,"class","settings-card svelte-1e2uhdh"),r(Y,"class","btn btn-primary"),r(W,"class","settings-actions svelte-1e2uhdh"),r(e,"class","settings-section svelte-1e2uhdh")},m(q,X){C(q,e,X),a(e,t),a(e,l),a(e,i),a(e,o),a(e,s),a(s,c),a(s,u),a(s,d),a(d,p),a(p,h),a(p,m),a(p,g),a(g,b),a(g,v),a(g,y),Yn(g,n[0],!0),a(e,E),a(e,T),a(T,N),a(T,A),a(T,I),a(I,O),a(O,R),a(O,D),a(O,B),a(B,j),a(B,U),a(e,z),a(e,W),M&&M.m(W,null),a(W,K),a(W,Y),F||(L=[P(g,"change",n[5]),P(Y,"click",n[2])],F=!0)},p(q,[X]){X&1&&Yn(g,q[0]),q[1]?M||(M=zr(),M.c(),M.m(W,K)):M&&(M.d(1),M=null)},i:se,o:se,d(q){q&&S(e),M&&M.d(),F=!1,Ce(L)}}}function Dv(n,e,t){let{appConfig:l=null}=e,{onSave:i=null}=e,o="system",s=!1;function c(){l&&t(0,o=l.theme||"system")}async function u(){l&&(t(3,l.theme=o,l),i&&await i(l),t(1,s=!0),setTimeout(()=>t(1,s=!1),2e3))}function d(){o=Ci(this),t(0,o)}return n.$$set=p=>{"appConfig"in p&&t(3,l=p.appConfig),"onSave"in p&&t(4,i=p.onSave)},n.$$.update=()=>{n.$$.dirty&8&&l&&c()},[o,s,u,l,i,d]}class Pv extends ut{constructor(e){super(),ct(this,e,Dv,Ov,at,{appConfig:3,onSave:4})}}function Br(n){let e,t;return{c(){e=f("div"),t=H(n[1]),r(e,"class","notice svelte-1zbky3")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&2&&Q(t,l[1])},d(l){l&&S(e)}}}function qv(n){let e;return{c(){e=f("p"),e.textContent=`${k("settings.noVaultInfo")}`,r(e,"class","no-data svelte-1zbky3")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function zv(n){let e,t,l,i,o,s=n[0].path+"",c,u,d,p,h,m,g=n[0].dbPath+"",b,v,y,E=n[0].nodeCount!==void 0&&Fr(n),T=n[0].fileCount!==void 0&&jr(n);return{c(){e=f("div"),t=f("div"),l=f("span"),l.textContent=`${k("settings.vaultPath")}`,i=w(),o=f("span"),c=H(s),u=w(),d=f("div"),p=f("span"),p.textContent="DB",h=w(),m=f("span"),b=H(g),v=w(),E&&E.c(),y=w(),T&&T.c(),r(l,"class","info-label svelte-1zbky3"),r(o,"class","info-value mono svelte-1zbky3"),r(t,"class","info-row svelte-1zbky3"),r(p,"class","info-label svelte-1zbky3"),r(m,"class","info-value mono small svelte-1zbky3"),r(d,"class","info-row svelte-1zbky3"),r(e,"class","vault-info svelte-1zbky3")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(t,i),a(t,o),a(o,c),a(e,u),a(e,d),a(d,p),a(d,h),a(d,m),a(m,b),a(e,v),E&&E.m(e,null),a(e,y),T&&T.m(e,null)},p(N,A){A&1&&s!==(s=N[0].path+"")&&Q(c,s),A&1&&g!==(g=N[0].dbPath+"")&&Q(b,g),N[0].nodeCount!==void 0?E?E.p(N,A):(E=Fr(N),E.c(),E.m(e,y)):E&&(E.d(1),E=null),N[0].fileCount!==void 0?T?T.p(N,A):(T=jr(N),T.c(),T.m(e,null)):T&&(T.d(1),T=null)},d(N){N&&S(e),E&&E.d(),T&&T.d()}}}function Fr(n){let e,t,l,i,o=n[0].nodeCount+"",s;return{c(){e=f("div"),t=f("span"),t.textContent="Nodes",l=w(),i=f("span"),s=H(o),r(t,"class","info-label svelte-1zbky3"),r(i,"class","info-value svelte-1zbky3"),r(e,"class","info-row svelte-1zbky3")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u&1&&o!==(o=c[0].nodeCount+"")&&Q(s,o)},d(c){c&&S(e)}}}function jr(n){let e,t,l,i,o=n[0].fileCount+"",s;return{c(){e=f("div"),t=f("span"),t.textContent="Files",l=w(),i=f("span"),s=H(o),r(t,"class","info-label svelte-1zbky3"),r(i,"class","info-value svelte-1zbky3"),r(e,"class","info-row svelte-1zbky3")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u&1&&o!==(o=c[0].fileCount+"")&&Q(s,o)},d(c){c&&S(e)}}}function Bv(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E=n[1]&&Br(n);function T(I,O){return I[0]?zv:qv}let N=T(n),A=N(n);return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("settings.workspace")}`,l=w(),i=f("p"),i.textContent=`${k("settings.workspaceDesc")}`,o=w(),E&&E.c(),s=w(),c=f("div"),A.c(),u=w(),d=f("div"),p=f("button"),p.textContent=`${k("settings.openVault")}`,h=w(),m=f("button"),m.textContent=`${k("settings.changeVault")}`,g=w(),b=f("button"),b.textContent=`${k("settings.checkIntegrity")}`,r(t,"class","svelte-1zbky3"),r(i,"class","section-desc svelte-1zbky3"),r(c,"class","settings-card svelte-1zbky3"),r(p,"class","btn svelte-1zbky3"),r(m,"class","btn svelte-1zbky3"),r(b,"class","btn svelte-1zbky3"),r(d,"class","workspace-actions svelte-1zbky3"),r(e,"class","settings-section svelte-1zbky3")},m(I,O){C(I,e,O),a(e,t),a(e,l),a(e,i),a(e,o),E&&E.m(e,null),a(e,s),a(e,c),A.m(c,null),a(e,u),a(e,d),a(d,p),a(d,h),a(d,m),a(d,g),a(d,b),v||(y=[P(p,"click",n[2]),P(m,"click",n[4]),P(b,"click",n[3])],v=!0)},p(I,[O]){I[1]?E?E.p(I,O):(E=Br(I),E.c(),E.m(e,s)):E&&(E.d(1),E=null),N===(N=T(I))&&A?A.p(I,O):(A.d(1),A=N(I),A&&(A.c(),A.m(c,null)))},i:se,o:se,d(I){I&&S(e),E&&E.d(),A.d(),v=!1,Ce(y)}}}function Ml(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function Fv(n,e,t){let{onRefresh:l=null}=e,i=null,o="";async function s(){try{t(0,i=await Ml("GetVaultInfo"))}catch{t(0,i=null)}}s();async function c(){try{await Ml("OpenVaultFolder")}catch(p){t(1,o=String(p))}}async function u(){try{const p=await Ml("VaultCheck");p.healthy?t(1,o="Vault healthy"):t(1,o="Issues found: "+(p.errors||[]).join("; "))}catch(p){t(1,o=String(p))}}async function d(){try{const p=await Ml("PickDirectory");if(!p)return;const h=await Ml("OpenVault",p);h&&h.status==="ready"&&(t(0,i=await Ml("GetVaultInfo")),l&&l())}catch(p){t(1,o=String(p))}}return n.$$set=p=>{"onRefresh"in p&&t(5,l=p.onRefresh)},[i,o,c,u,d,l]}class jv extends ut{constructor(e){super(),ct(this,e,Fv,Bv,at,{onRefresh:5})}}function Ur(n,e,t){const l=n.slice();return l[6]=e[t],l}function Uv(n){let e,t=Te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Hr(Ur(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","template-list svelte-ksamnw")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o&5){t=Te(i[0]);let s;for(s=0;s<t.length;s+=1){const c=Ur(i,t,s);l[s]?l[s].p(c,o):(l[s]=Hr(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Hv(n){let e;return{c(){e=f("p"),e.textContent=`${k("common.empty")}`,r(e,"class","no-data svelte-ksamnw")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Wv(n){let e;return{c(){e=f("p"),e.textContent=`${k("common.loading")}`,r(e,"class","loading svelte-ksamnw")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Hr(n){let e,t,l,i=(k("template."+n[6].id)||n[6].title)+"",o,s,c,u,d=n[6].type+"",p,h,m,g,b,v,y,E,T=(n[6].enabled?k("settings.templateEnabled"):k("settings.templateDisabled"))+"",N,A,I,O;function R(){return n[4](n[6])}return{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("span"),u=H("("),p=H(d),h=H(")"),m=w(),g=f("label"),b=f("input"),y=w(),E=f("span"),N=H(T),A=w(),r(l,"class","template-name svelte-ksamnw"),r(c,"class","template-type svelte-ksamnw"),r(t,"class","template-info svelte-ksamnw"),r(b,"type","checkbox"),b.checked=v=n[6].enabled,r(b,"class","svelte-ksamnw"),r(E,"class","toggle-text svelte-ksamnw"),r(g,"class","toggle-label svelte-ksamnw"),r(e,"class","template-item svelte-ksamnw")},m(D,B){C(D,e,B),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,u),a(c,p),a(c,h),a(e,m),a(e,g),a(g,b),a(g,y),a(g,E),a(E,N),a(e,A),I||(O=P(b,"change",R),I=!0)},p(D,B){n=D,B&1&&i!==(i=(k("template."+n[6].id)||n[6].title)+"")&&Q(o,i),B&1&&d!==(d=n[6].type+"")&&Q(p,d),B&1&&v!==(v=n[6].enabled)&&(b.checked=v),B&1&&T!==(T=(n[6].enabled?k("settings.templateEnabled"):k("settings.templateDisabled"))+"")&&Q(N,T)},d(D){D&&S(e),I=!1,O()}}}function Gv(n){let e,t,l,i,o;function s(d,p){return d[1]?Wv:d[0].length===0?Hv:Uv}let c=s(n),u=c(n);return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("settings.templates")}`,l=w(),i=f("p"),i.textContent=`${k("settings.templatesDesc")}`,o=w(),u.c(),r(t,"class","svelte-ksamnw"),r(i,"class","section-desc svelte-ksamnw"),r(e,"class","settings-section svelte-ksamnw")},m(d,p){C(d,e,p),a(e,t),a(e,l),a(e,i),a(e,o),u.m(e,null)},p(d,[p]){c===(c=s(d))&&u?u.p(d,p):(u.d(1),u=c(d),u&&(u.c(),u.m(e,null)))},i:se,o:se,d(d){d&&S(e),u.d()}}}function Wr(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function Kv(n,e,t){let{onRefresh:l=null}=e,i=[],o=!0;async function s(){t(1,o=!0);try{t(0,i=await Wr("AllTemplates")||[])}catch{t(0,i=[])}t(1,o=!1)}s();async function c(d){const p=!d.enabled;try{await Wr("SetTemplateEnabled",d.id,p),d.enabled=p,t(0,i),l&&l()}catch(h){console.error(h)}}const u=d=>c(d);return n.$$set=d=>{"onRefresh"in d&&t(3,l=d.onRefresh)},[i,o,c,l,u]}class Vv extends ut{constructor(e){super(),ct(this,e,Kv,Gv,at,{onRefresh:3})}}function Gr(n,e,t){const l=n.slice();return l[12]=e[t],l}function Zv(n){let e,t=Te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Qr(Gr(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","plugin-list svelte-i9gngw")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o&57){t=Te(i[0]);let s;for(s=0;s<t.length;s+=1){const c=Gr(i,t,s);l[s]?l[s].p(c,o):(l[s]=Qr(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Yv(n){let e;return{c(){e=f("div"),e.innerHTML='<p>Нет установленных плагинов.</p> <p class="hint svelte-i9gngw">Создайте папку <code class="svelte-i9gngw">.verstak/plugins/</code> в хранилище и добавьте туда плагины.</p>',r(e,"class","empty-state svelte-i9gngw")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Xv(n){let e,t;return{c(){e=f("p"),t=H(n[2]),r(e,"class","error svelte-i9gngw")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&4&&Q(t,l[2])},d(l){l&&S(e)}}}function Jv(n){let e;return{c(){e=f("p"),e.textContent=`${k("common.loading")}`,r(e,"class","loading svelte-i9gngw")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Kr(n){let e,t,l=n[12].version+"",i;return{c(){e=f("span"),t=H("v"),i=H(l),r(e,"class","plugin-version svelte-i9gngw")},m(o,s){C(o,e,s),a(e,t),a(e,i)},p(o,s){s&1&&l!==(l=o[12].version+"")&&Q(i,l)},d(o){o&&S(e)}}}function Vr(n){let e,t=n[12].description+"",l;return{c(){e=f("div"),l=H(t),r(e,"class","plugin-desc svelte-i9gngw")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&1&&t!==(t=i[12].description+"")&&Q(l,t)},d(i){i&&S(e)}}}function Zr(n){let e,t=(k("settings.author")||"Автор")+"",l,i,o=n[12].author+"",s;return{c(){e=f("span"),l=H(t),i=H(": "),s=H(o)},m(c,u){C(c,e,u),a(e,l),a(e,i),a(e,s)},p(c,u){u&1&&o!==(o=c[12].author+"")&&Q(s,o)},d(c){c&&S(e)}}}function Yr(n){let e,t=n[12].uiContribs.sidebarItems.length+"",l,i;return{c(){e=f("span"),l=H(t),i=H(" пункт(а) в сайдбаре")},m(o,s){C(o,e,s),a(e,l),a(e,i)},p(o,s){s&1&&t!==(t=o[12].uiContribs.sidebarItems.length+"")&&Q(l,t)},d(o){o&&S(e)}}}function Xr(n){let e,t=n[12].uiContribs.nodeTabs.length+"",l,i;return{c(){e=f("span"),l=H(t),i=H(" вкладок(и) в карточке дела")},m(o,s){C(o,e,s),a(e,l),a(e,i)},p(o,s){s&1&&t!==(t=o[12].uiContribs.nodeTabs.length+"")&&Q(l,t)},d(o){o&&S(e)}}}function Jr(n){let e;return{c(){e=f("span"),e.textContent="🗖 HTML-панель"},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Qv(n){let e,t,l,i,o,s,c,u;function d(){return n[8](n[12])}function p(){return n[9](n[12])}return{c(){e=f("div"),t=f("button"),l=f("span"),o=w(),s=f("button"),s.textContent="🗑",r(l,"class","toggle-knob svelte-i9gngw"),r(t,"class","toggle-btn svelte-i9gngw"),r(t,"role","switch"),r(t,"aria-checked",i=n[12].active),ce(t,"active",n[12].active),r(s,"class","uninstall-btn btn-sm svelte-i9gngw"),r(s,"title","Удалить плагин (очистить данные)"),r(e,"class","toggle-group svelte-i9gngw")},m(h,m){C(h,e,m),a(e,t),a(t,l),a(e,o),a(e,s),c||(u=[P(t,"click",d),P(s,"click",p)],c=!0)},p(h,m){n=h,m&1&&i!==(i=n[12].active)&&r(t,"aria-checked",i),m&1&&ce(t,"active",n[12].active)},d(h){h&&S(e),c=!1,Ce(u)}}}function xv(n){let e,t,l;function i(){return n[7](n[12])}return{c(){e=f("button"),e.textContent="📦 Установить",r(e,"class","install-btn svelte-i9gngw")},m(o,s){C(o,e,s),t||(l=P(e,"click",i),t=!0)},p(o,s){n=o},d(o){o&&S(e),t=!1,l()}}}function Qr(n){var B,j,U,z;let e,t,l,i=n[12].name+"",o,s,c,u,d,p,h,m,g,b,v,y=n[12].version&&Kr(n),E=n[12].description&&Vr(n),T=n[12].author&&Zr(n),N=((j=(B=n[12].uiContribs)==null?void 0:B.sidebarItems)==null?void 0:j.length)&&Yr(n),A=((z=(U=n[12].uiContribs)==null?void 0:U.nodeTabs)==null?void 0:z.length)&&Xr(n),I=n[12].hasPanel&&Jr();function O(W,K){return W[12].installed?Qv:xv}let R=O(n),D=R(n);return{c(){e=f("div"),t=f("div"),l=f("div"),o=H(i),s=w(),y&&y.c(),c=w(),E&&E.c(),u=w(),d=f("div"),T&&T.c(),p=w(),N&&N.c(),h=w(),A&&A.c(),m=w(),I&&I.c(),g=w(),b=f("div"),D.c(),v=w(),r(l,"class","plugin-name svelte-i9gngw"),r(d,"class","plugin-meta svelte-i9gngw"),r(t,"class","plugin-info svelte-i9gngw"),r(b,"class","plugin-toggle svelte-i9gngw"),r(e,"class","plugin-card svelte-i9gngw")},m(W,K){C(W,e,K),a(e,t),a(t,l),a(l,o),a(l,s),y&&y.m(l,null),a(t,c),E&&E.m(t,null),a(t,u),a(t,d),T&&T.m(d,null),a(d,p),N&&N.m(d,null),a(d,h),A&&A.m(d,null),a(d,m),I&&I.m(d,null),a(e,g),a(e,b),D.m(b,null),a(e,v)},p(W,K){var Y,F,L,M;K&1&&i!==(i=W[12].name+"")&&Q(o,i),W[12].version?y?y.p(W,K):(y=Kr(W),y.c(),y.m(l,null)):y&&(y.d(1),y=null),W[12].description?E?E.p(W,K):(E=Vr(W),E.c(),E.m(t,u)):E&&(E.d(1),E=null),W[12].author?T?T.p(W,K):(T=Zr(W),T.c(),T.m(d,p)):T&&(T.d(1),T=null),(F=(Y=W[12].uiContribs)==null?void 0:Y.sidebarItems)!=null&&F.length?N?N.p(W,K):(N=Yr(W),N.c(),N.m(d,h)):N&&(N.d(1),N=null),(M=(L=W[12].uiContribs)==null?void 0:L.nodeTabs)!=null&&M.length?A?A.p(W,K):(A=Xr(W),A.c(),A.m(d,m)):A&&(A.d(1),A=null),W[12].hasPanel?I||(I=Jr(),I.c(),I.m(d,null)):I&&(I.d(1),I=null),R===(R=O(W))&&D?D.p(W,K):(D.d(1),D=R(W),D&&(D.c(),D.m(b,null)))},d(W){W&&S(e),y&&y.d(),E&&E.d(),T&&T.d(),N&&N.d(),A&&A.d(),I&&I.d(),D.d()}}}function $v(n){let e,t,l,i,o;function s(d,p){return d[1]?Jv:d[2]?Xv:d[0].length===0?Yv:Zv}let c=s(n),u=c(n);return{c(){e=f("div"),t=f("h3"),t.textContent=`${k("settings.plugins")||"Плагины"}`,l=w(),i=f("p"),i.textContent="Включение и отключение плагинов. Изменения применяются сразу.",o=w(),u.c(),r(t,"class","svelte-i9gngw"),r(i,"class","hint svelte-i9gngw"),r(e,"class","settings-plugins svelte-i9gngw")},m(d,p){C(d,e,p),a(e,t),a(e,l),a(e,i),a(e,o),u.m(e,null)},p(d,[p]){c===(c=s(d))&&u?u.p(d,p):(u.d(1),u=c(d),u&&(u.c(),u.m(e,null)))},i:se,o:se,d(d){d&&S(e),u.d()}}}function ol(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function e0(n,e,t){let{onPluginToggle:l=null}=e,i=[],o=!0,s="";li(async()=>{try{t(0,i=await ol("ListPlugins")||[])}catch(g){t(2,s=String(g))}t(1,o=!1)});async function c(g){const b=!g.active;try{await ol("SetPluginEnabled",g.name,b),t(0,i=await ol("ListPlugins")||[]),l&&l()}catch(v){t(2,s=String(v))}}async function u(g){t(2,s="");try{await ol("InstallPlugin",g.name),g.installed=!0,t(0,i=await ol("ListPlugins")||[]),l&&l()}catch(b){t(2,s=String(b))}}async function d(g){if(confirm(`Удалить плагин «${g.name}»? Все данные плагина будут очищены. Файлы плагина сохранятся.`)){t(2,s="");try{await ol("UninstallPlugin",g.name),g.installed=!1,g.active=!1,t(0,i=await ol("ListPlugins")||[]),l&&l()}catch(b){t(2,s=String(b))}}}const p=g=>u(g),h=g=>c(g),m=g=>d(g);return n.$$set=g=>{"onPluginToggle"in g&&t(6,l=g.onPluginToggle)},n.$$.update=()=>{n.$$.dirty&1&&i.reduce((g,b)=>{var v,y;return g+(((y=(v=b.uiContribs)==null?void 0:v.sidebarItems)==null?void 0:y.length)||0)},0),n.$$.dirty&1&&i.reduce((g,b)=>{var v,y;return g+(((y=(v=b.uiContribs)==null?void 0:v.nodeTabs)==null?void 0:y.length)||0)},0)},[i,o,s,c,u,d,l,p,h,m]}class t0 extends ut{constructor(e){super(),ct(this,e,e0,$v,at,{onPluginToggle:6})}}function n0(n){let e,t,l,i;return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("settings.files")}`,l=w(),i=f("p"),i.textContent=`${k("settings.filesStub")}`,r(t,"class","svelte-19bo7bn"),r(i,"class","section-desc svelte-19bo7bn"),r(e,"class","settings-section svelte-19bo7bn")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:se,i:se,o:se,d(o){o&&S(e)}}}class l0 extends ut{constructor(e){super(),ct(this,e,null,n0,at,{})}}function i0(n){let e,t,l,i;return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("settings.activity")}`,l=w(),i=f("p"),i.textContent=`${k("settings.activityStub")}`,r(t,"class","svelte-19bo7bn"),r(i,"class","section-desc svelte-19bo7bn"),r(e,"class","settings-section svelte-19bo7bn")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:se,i:se,o:se,d(o){o&&S(e)}}}class s0 extends ut{constructor(e){super(),ct(this,e,null,i0,at,{})}}function xr(n){let e,t;return{c(){e=f("div"),t=H(n[2]),r(e,"class","error-msg svelte-1fx1e1e")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&4&&Q(t,l[2])},d(l){l&&S(e)}}}function $r(n){let e,t;return{c(){e=f("div"),t=H(n[3]),r(e,"class","result-msg svelte-1fx1e1e"),ce(e,"warning",n[4]==="warning")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&8&&Q(t,l[3]),i[0]&16&&ce(e,"warning",l[4]==="warning")},d(l){l&&S(e)}}}function o0(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R=k("settings.checkConnection")+"",D,B,j,U,z=k("common.connect")+"",W,K,Y,F,L,M=n[11]!==null&&ea(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("label"),o=f("span"),o.textContent=`${k("settings.serverUrl")}`,s=w(),c=f("input"),u=w(),d=f("div"),p=f("label"),h=f("span"),h.textContent=`${k("sync.username")}`,m=w(),g=f("input"),b=w(),v=f("div"),y=f("label"),E=f("span"),E.textContent=`${k("sync.password")}`,T=w(),N=f("input"),A=w(),I=f("div"),O=f("button"),D=H(R),j=w(),U=f("button"),W=H(z),Y=w(),M&&M.c(),r(o,"class","label-text"),r(c,"type","text"),r(c,"placeholder","https://example.com"),r(l,"class","form-group svelte-1fx1e1e"),r(h,"class","label-text"),r(g,"type","text"),r(d,"class","form-group svelte-1fx1e1e"),r(E,"class","label-text"),r(N,"type","password"),r(v,"class","form-group svelte-1fx1e1e"),r(O,"class","btn"),O.disabled=B=n[1]||!n[5],r(U,"class","btn btn-primary"),U.disabled=K=n[1]||!n[5]||!n[6]||!n[7],r(I,"class","sync-setup-actions svelte-1fx1e1e"),r(t,"class","sync-setup svelte-1fx1e1e"),r(e,"class","settings-card svelte-1fx1e1e")},m(q,X){C(q,e,X),a(e,t),a(t,l),a(l,i),a(i,o),a(i,s),a(i,c),Me(c,n[5]),a(t,u),a(t,d),a(d,p),a(p,h),a(p,m),a(p,g),Me(g,n[6]),a(t,b),a(t,v),a(v,y),a(y,E),a(y,T),a(y,N),Me(N,n[7]),a(t,A),a(t,I),a(I,O),a(O,D),a(I,j),a(I,U),a(U,W),a(t,Y),M&&M.m(t,null),F||(L=[P(c,"input",n[23]),P(g,"input",n[24]),P(N,"input",n[25]),P(O,"click",n[12]),P(U,"click",n[13])],F=!0)},p(q,X){X[0]&32&&c.value!==q[5]&&Me(c,q[5]),X[0]&64&&g.value!==q[6]&&Me(g,q[6]),X[0]&128&&N.value!==q[7]&&Me(N,q[7]),X[0]&34&&B!==(B=q[1]||!q[5])&&(O.disabled=B),X[0]&226&&K!==(K=q[1]||!q[5]||!q[6]||!q[7])&&(U.disabled=K),q[11]!==null?M?M.p(q,X):(M=ea(q),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},d(q){q&&S(e),M&&M.d(),F=!1,Ce(L)}}}function r0(n){let e,t,l,i,o,s,c=n[20](n[0].lastStatus)+"",u,d,p,h,m,g,b,v,y,E=k("settings.syncNow")+"",T,N,A,I=k("settings.disconnect")+"",O,R,D,B=k("settings.resetKey")+"",j,U,z,W,K,Y,F,L,M,q,X,Z,J=n[0].serverUrl&&ta(n),ee=n[0].deviceName&&na(n),te=n[0].deviceId&&la(n),le=n[0].lastSyncAt&&ia(n),_e=n[0].lastError&&sa(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("span"),i.textContent=`${k("settings.status")}`,o=w(),s=f("span"),u=H(c),d=w(),J&&J.c(),p=w(),ee&&ee.c(),h=w(),te&&te.c(),m=w(),le&&le.c(),g=w(),_e&&_e.c(),b=w(),v=f("div"),y=f("button"),T=H(E),N=w(),A=f("button"),O=H(I),R=w(),D=f("button"),j=H(B),U=w(),z=f("div"),W=f("label"),K=f("span"),K.textContent=`${k("sync.interval")}`,Y=w(),F=f("div"),L=f("input"),M=w(),q=f("button"),q.textContent=`${k("common.save")}`,r(i,"class","info-label svelte-1fx1e1e"),r(s,"class","info-value svelte-1fx1e1e"),ce(s,"status-ok",n[0].lastStatus==="connected"),ce(s,"status-err",n[0].lastStatus==="error"||n[0].lastStatus==="revoked"),r(l,"class","info-row svelte-1fx1e1e"),r(t,"class","sync-info svelte-1fx1e1e"),r(e,"class","settings-card svelte-1fx1e1e"),r(y,"class","btn btn-primary"),y.disabled=n[1],r(A,"class","btn"),A.disabled=n[1],r(D,"class","btn"),D.disabled=n[1],r(v,"class","sync-actions svelte-1fx1e1e"),r(K,"class","label-text"),r(L,"type","number"),r(L,"min","0"),r(L,"placeholder","0"),r(L,"class","svelte-1fx1e1e"),r(q,"class","btn btn-sm"),r(F,"class","interval-row svelte-1fx1e1e"),r(z,"class","sync-interval svelte-1fx1e1e")},m(oe,ze){C(oe,e,ze),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(s,u),a(t,d),J&&J.m(t,null),a(t,p),ee&&ee.m(t,null),a(t,h),te&&te.m(t,null),a(t,m),le&&le.m(t,null),a(t,g),_e&&_e.m(t,null),C(oe,b,ze),C(oe,v,ze),a(v,y),a(y,T),a(v,N),a(v,A),a(A,O),a(v,R),a(v,D),a(D,j),C(oe,U,ze),C(oe,z,ze),a(z,W),a(W,K),a(W,Y),a(W,F),a(F,L),Me(L,n[8]),a(F,M),a(F,q),X||(Z=[P(y,"click",n[14]),P(A,"click",n[16]),P(D,"click",n[18]),P(L,"input",n[22]),P(q,"click",n[15])],X=!0)},p(oe,ze){ze[0]&1&&c!==(c=oe[20](oe[0].lastStatus)+"")&&Q(u,c),ze[0]&1&&ce(s,"status-ok",oe[0].lastStatus==="connected"),ze[0]&1&&ce(s,"status-err",oe[0].lastStatus==="error"||oe[0].lastStatus==="revoked"),oe[0].serverUrl?J?J.p(oe,ze):(J=ta(oe),J.c(),J.m(t,p)):J&&(J.d(1),J=null),oe[0].deviceName?ee?ee.p(oe,ze):(ee=na(oe),ee.c(),ee.m(t,h)):ee&&(ee.d(1),ee=null),oe[0].deviceId?te?te.p(oe,ze):(te=la(oe),te.c(),te.m(t,m)):te&&(te.d(1),te=null),oe[0].lastSyncAt?le?le.p(oe,ze):(le=ia(oe),le.c(),le.m(t,g)):le&&(le.d(1),le=null),oe[0].lastError?_e?_e.p(oe,ze):(_e=sa(oe),_e.c(),_e.m(t,null)):_e&&(_e.d(1),_e=null),ze[0]&2&&(y.disabled=oe[1]),ze[0]&2&&(A.disabled=oe[1]),ze[0]&2&&(D.disabled=oe[1]),ze[0]&256&&zl(L.value)!==oe[8]&&Me(L,oe[8])},d(oe){oe&&(S(e),S(b),S(v),S(U),S(z)),J&&J.d(),ee&&ee.d(),te&&te.d(),le&&le.d(),_e&&_e.d(),X=!1,Ce(Z)}}}function ea(n){let e,t=(n[11]?k("common.test")+" OK":k("error.generic"))+"",l;return{c(){e=f("div"),l=H(t),r(e,"class","connection-result svelte-1fx1e1e"),ce(e,"ok",n[11]),ce(e,"fail",!n[11])},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&2048&&t!==(t=(i[11]?k("common.test")+" OK":k("error.generic"))+"")&&Q(l,t),o[0]&2048&&ce(e,"ok",i[11]),o[0]&2048&&ce(e,"fail",!i[11])},d(i){i&&S(e)}}}function ta(n){let e,t,l,i,o=n[0].serverUrl+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${k("settings.serverUrl")}`,l=w(),i=f("span"),s=H(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value mono svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].serverUrl+"")&&Q(s,o)},d(c){c&&S(e)}}}function na(n){let e,t,l,i,o=n[0].deviceName+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${k("settings.deviceName")}`,l=w(),i=f("span"),s=H(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].deviceName+"")&&Q(s,o)},d(c){c&&S(e)}}}function la(n){let e,t,l,i,o=n[0].deviceId+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${k("settings.deviceId")}`,l=w(),i=f("span"),s=H(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value mono svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].deviceId+"")&&Q(s,o)},d(c){c&&S(e)}}}function ia(n){let e,t,l,i,o=n[0].lastSyncAt+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${k("settings.lastSync")}`,l=w(),i=f("span"),s=H(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].lastSyncAt+"")&&Q(s,o)},d(c){c&&S(e)}}}function sa(n){let e,t,l,i,o=n[0].lastError+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${k("settings.lastError")}`,l=w(),i=f("span"),s=H(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value error svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].lastError+"")&&Q(s,o)},d(c){c&&S(e)}}}function oa(n){let e,t,l,i,o,s,c,u,d,p,h,m;return{c(){e=f("button"),t=f("div"),l=f("h3"),l.textContent=`${k("settings.confirmDisconnect")}`,i=w(),o=f("p"),o.textContent=`${k("settings.confirmDisconnectDesc")}`,s=w(),c=f("div"),u=f("button"),u.textContent=`${k("common.disconnect")}`,d=w(),p=f("button"),p.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1fx1e1e"),r(o,"class","modal-desc svelte-1fx1e1e"),r(u,"class","btn btn-danger"),r(p,"class","btn"),r(c,"class","modal-actions svelte-1fx1e1e"),r(t,"class","modal svelte-1fx1e1e"),r(e,"class","modal-overlay svelte-1fx1e1e")},m(g,b){C(g,e,b),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(c,u),a(c,d),a(c,p),h||(m=[P(u,"click",n[17]),P(p,"click",n[26]),P(e,"click",n[27])],h=!0)},p:se,d(g){g&&S(e),h=!1,Ce(m)}}}function ra(n){let e,t,l,i,o,s,c,u,d,p,h,m;return{c(){e=f("button"),t=f("div"),l=f("h3"),l.textContent=`${k("settings.confirmResetKey")}`,i=w(),o=f("p"),o.textContent=`${k("settings.confirmResetKeyDesc")}`,s=w(),c=f("div"),u=f("button"),u.textContent=`${k("settings.resetKey")}`,d=w(),p=f("button"),p.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1fx1e1e"),r(o,"class","modal-desc svelte-1fx1e1e"),r(u,"class","btn btn-danger"),r(p,"class","btn"),r(c,"class","modal-actions svelte-1fx1e1e"),r(t,"class","modal svelte-1fx1e1e"),r(e,"class","modal-overlay svelte-1fx1e1e")},m(g,b){C(g,e,b),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(c,u),a(c,d),a(c,p),h||(m=[P(u,"click",n[19]),P(p,"click",n[28]),P(e,"click",n[29])],h=!0)},p:se,d(g){g&&S(e),h=!1,Ce(m)}}}function a0(n){let e,t,l,i,o,s,c,u,d,p,h=n[2]&&xr(n),m=n[3]&&!n[2]&&$r(n);function g(T,N){return T[0]&&T[0].enabled?r0:o0}let b=g(n),v=b(n),y=n[9]&&oa(n),E=n[10]&&ra(n);return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("settings.sync")}`,l=w(),i=f("p"),i.textContent=`${k("settings.syncDesc")}`,o=w(),h&&h.c(),s=w(),m&&m.c(),c=w(),v.c(),u=w(),y&&y.c(),d=w(),E&&E.c(),p=kt(),r(t,"class","svelte-1fx1e1e"),r(i,"class","section-desc svelte-1fx1e1e"),r(e,"class","settings-section svelte-1fx1e1e")},m(T,N){C(T,e,N),a(e,t),a(e,l),a(e,i),a(e,o),h&&h.m(e,null),a(e,s),m&&m.m(e,null),a(e,c),v.m(e,null),C(T,u,N),y&&y.m(T,N),C(T,d,N),E&&E.m(T,N),C(T,p,N)},p(T,N){T[2]?h?h.p(T,N):(h=xr(T),h.c(),h.m(e,s)):h&&(h.d(1),h=null),T[3]&&!T[2]?m?m.p(T,N):(m=$r(T),m.c(),m.m(e,c)):m&&(m.d(1),m=null),b===(b=g(T))&&v?v.p(T,N):(v.d(1),v=b(T),v&&(v.c(),v.m(e,null))),T[9]?y?y.p(T,N):(y=oa(T),y.c(),y.m(d.parentNode,d)):y&&(y.d(1),y=null),T[10]?E?E.p(T,N):(E=ra(T),E.c(),E.m(p.parentNode,p)):E&&(E.d(1),E=null)},i:se,o:se,d(T){T&&(S(e),S(u),S(d),S(p)),h&&h.d(),m&&m.d(),v.d(),y&&y.d(T),E&&E.d(T)}}}function rl(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function c0(n,e,t){let{onRefresh:l=null}=e,i=null,o=!1,s="",c="",u="",d="",p="",h="",m=0,g=!1,b=!1,v=null;async function y(){try{t(0,i=await rl("GetSyncSettings")),i&&(t(5,d=i.serverUrl||""),t(8,m=i.syncInterval||0))}catch{t(0,i=null)}}y();async function E(){t(1,o=!0),t(2,s=""),t(4,u=""),t(11,v=null);try{await rl("SyncTestConnection",d,p,h),t(11,v=!0),t(3,c="connection ok")}catch(q){t(11,v=!1),t(3,c="connection failed: "+String(q))}t(1,o=!1)}async function T(){t(1,o=!0),t(2,s=""),t(4,u="");try{await rl("SyncConfigure",d,p,h),t(3,c="configured"),t(6,p=""),t(7,h=""),await y(),l&&l()}catch(q){t(2,s=String(q))}t(1,o=!1)}function N(q){const X=Array.isArray(q==null?void 0:q.conflicts)?q.conflicts:[],Z=Array.isArray(q==null?void 0:q.applyErrors)?q.applyErrors:[],J=[];return X.length>0&&J.push(k("sync.conflictsCount",{count:X.length})),Z.length>0&&J.push(k("sync.applyErrorsCount",{count:Z.length})),J.join(" · ")}async function A(){t(1,o=!0),t(2,s=""),t(4,u="");try{const q=await rl("SyncNow"),X=k("sync.pushedPulled",{pushed:(q==null?void 0:q.pushed)||0,pulled:(q==null?void 0:q.pulled)||0}),Z=N(q);t(3,c=Z?X+" · "+Z:X),t(4,u=Z?"warning":""),await y(),l&&l()}catch(q){t(2,s=String(q))}t(1,o=!1)}async function I(){try{await rl("SyncSetInterval",m),t(3,c=k("sync.settingsSaved")),t(4,u="")}catch(q){t(2,s=String(q))}}function O(){t(9,g=!0)}async function R(){t(9,g=!1),t(1,o=!0),t(4,u="");try{await rl("SyncDisconnect"),t(3,c="disconnected"),await y(),l&&l()}catch(q){t(2,s=String(q))}t(1,o=!1)}function D(){t(10,b=!0)}async function B(){t(10,b=!1),t(1,o=!0),t(4,u="");try{await rl("ResetSyncKey"),t(3,c="key reset"),await y(),l&&l()}catch(q){t(2,s=String(q))}t(1,o=!1)}function j(q){return q?{connected:k("settings.connected"),disconnected:k("settings.disconnected"),disabled:k("settings.notConfigured"),error:k("settings.error"),revoked:k("settings.revoked")}[q]||q:k("settings.notConfigured")}function U(){m=zl(this.value),t(8,m)}function z(){d=this.value,t(5,d)}function W(){p=this.value,t(6,p)}function K(){h=this.value,t(7,h)}const Y=()=>t(9,g=!1),F=()=>t(9,g=!1),L=()=>t(10,b=!1),M=()=>t(10,b=!1);return n.$$set=q=>{"onRefresh"in q&&t(21,l=q.onRefresh)},[i,o,s,c,u,d,p,h,m,g,b,v,E,T,A,I,O,R,D,B,j,l,U,z,W,K,Y,F,L,M]}class u0 extends ut{constructor(e){super(),ct(this,e,c0,a0,at,{onRefresh:21},null,[-1,-1])}}function f0(n){let e,t,l,i;return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("settings.backup")}`,l=w(),i=f("p"),i.textContent=`${k("settings.backupStub")}`,r(t,"class","svelte-19bo7bn"),r(i,"class","section-desc svelte-19bo7bn"),r(e,"class","settings-section svelte-19bo7bn")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:se,i:se,o:se,d(o){o&&S(e)}}}class d0 extends ut{constructor(e){super(),ct(this,e,null,f0,at,{})}}function aa(n){let e,t;return{c(){e=f("div"),t=H(n[5]),r(e,"class","status-msg svelte-13i6m7m"),ce(e,"ok",n[6]==="ok"),ce(e,"error",n[6]==="error")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&32&&Q(t,l[5]),i&64&&ce(e,"ok",l[6]==="ok"),i&64&&ce(e,"error",l[6]==="error")},d(l){l&&S(e)}}}function ca(n){let e,t,l,i,o,s;return{c(){e=f("div"),t=f("span"),t.textContent="Активный порт",l=w(),i=f("span"),o=H("127.0.0.1:"),s=H(n[3]),r(t,"class","info-label svelte-13i6m7m"),r(i,"class","info-value mono svelte-13i6m7m"),r(e,"class","info-row svelte-13i6m7m")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,o),a(i,s)},p(c,u){u&8&&Q(s,c[3])},d(c){c&&S(e)}}}function ua(n){let e,t,l,i;return{c(){e=f("button"),t=H("Перезапустить сервер"),r(e,"class","btn"),e.disabled=n[4]},m(o,s){C(o,e,s),a(e,t),l||(i=P(e,"click",n[8]),l=!0)},p(o,s){s&16&&(e.disabled=o[4])},d(o){o&&S(e),l=!1,i()}}}function p0(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z=n[2]?"Запущен":"Остановлен",W,K,Y,F,L,M,q,X,Z,J=n[5]&&aa(n),ee=n[2]&&n[3]&&ca(n),te=n[0]&&ua(n);return{c(){e=f("div"),t=f("h2"),t.textContent="Browser Bridge",l=w(),i=f("p"),i.textContent=`Локальный HTTP-сервер для приёма событий от браузерного расширения Verstak Bridge.
|
||
Работает только на 127.0.0.1.`,o=w(),J&&J.c(),s=w(),c=f("div"),u=f("div"),d=f("label"),p=f("input"),h=w(),m=f("span"),m.textContent="Включить Browser Bridge",g=w(),b=f("div"),v=f("label"),y=f("span"),y.textContent="Порт",E=w(),T=f("input"),A=w(),I=f("p"),I.textContent="По умолчанию: 9786. Требуется перезапуск сервера при изменении.",O=w(),R=f("div"),D=f("div"),B=f("span"),B.textContent="Статус",j=w(),U=f("span"),W=H(z),K=w(),ee&&ee.c(),Y=w(),F=f("div"),L=f("button"),M=H("Сохранить"),q=w(),te&&te.c(),r(t,"class","svelte-13i6m7m"),r(i,"class","section-desc svelte-13i6m7m"),r(p,"type","checkbox"),r(m,"class","toggle-text svelte-13i6m7m"),r(d,"class","toggle-label svelte-13i6m7m"),r(u,"class","form-group svelte-13i6m7m"),r(y,"class","label-text svelte-13i6m7m"),r(T,"type","number"),r(T,"min","1024"),r(T,"max","65535"),T.disabled=N=!n[0],r(T,"class","svelte-13i6m7m"),r(I,"class","field-hint svelte-13i6m7m"),r(b,"class","form-group svelte-13i6m7m"),r(B,"class","info-label svelte-13i6m7m"),r(U,"class","info-value svelte-13i6m7m"),ce(U,"status-ok",n[2]),ce(U,"status-off",!n[2]),r(D,"class","info-row svelte-13i6m7m"),r(R,"class","bridge-status svelte-13i6m7m"),r(c,"class","settings-card svelte-13i6m7m"),r(L,"class","btn btn-primary"),L.disabled=n[4],r(F,"class","actions svelte-13i6m7m"),r(e,"class","settings-section svelte-13i6m7m")},m(le,_e){C(le,e,_e),a(e,t),a(e,l),a(e,i),a(e,o),J&&J.m(e,null),a(e,s),a(e,c),a(c,u),a(u,d),a(d,p),p.checked=n[0],a(d,h),a(d,m),a(c,g),a(c,b),a(b,v),a(v,y),a(v,E),a(v,T),Me(T,n[1]),a(b,A),a(b,I),a(c,O),a(c,R),a(R,D),a(D,B),a(D,j),a(D,U),a(U,W),a(R,K),ee&&ee.m(R,null),a(e,Y),a(e,F),a(F,L),a(L,M),a(F,q),te&&te.m(F,null),X||(Z=[P(p,"change",n[10]),P(T,"input",n[11]),P(L,"click",n[7])],X=!0)},p(le,[_e]){le[5]?J?J.p(le,_e):(J=aa(le),J.c(),J.m(e,s)):J&&(J.d(1),J=null),_e&1&&(p.checked=le[0]),_e&1&&N!==(N=!le[0])&&(T.disabled=N),_e&2&&zl(T.value)!==le[1]&&Me(T,le[1]),_e&4&&z!==(z=le[2]?"Запущен":"Остановлен")&&Q(W,z),_e&4&&ce(U,"status-ok",le[2]),_e&4&&ce(U,"status-off",!le[2]),le[2]&&le[3]?ee?ee.p(le,_e):(ee=ca(le),ee.c(),ee.m(R,null)):ee&&(ee.d(1),ee=null),_e&16&&(L.disabled=le[4]),le[0]?te?te.p(le,_e):(te=ua(le),te.c(),te.m(F,null)):te&&(te.d(1),te=null)},i:se,o:se,d(le){le&&S(e),J&&J.d(),ee&&ee.d(),te&&te.d(),X=!1,Ce(Z)}}}function h0(n,e,t){let{appConfig:l=null}=e,i=!1,o=9786,s=!1,c=0,u=!1,d="",p="";function h(){if(l&&l.vault&&l.vault.bridge){const E=l.vault.bridge;t(0,i=E.enabled!==!1),t(1,o=E.port||9786)}}async function m(){try{if(window.go&&window.go.main&&window.go.main.App){const E=await window.go.main.App.BridgeInfo();t(2,s=E.running||!1),t(3,c=E.port||0)}}catch{t(2,s=!1),t(3,c=0)}}h(),m();async function g(){t(4,u=!0),t(5,d=""),t(6,p="");try{l||t(9,l={}),l.vault||t(9,l.vault={},l),l.vault.bridge||t(9,l.vault.bridge={},l),t(9,l.vault.bridge.enabled=i,l),t(9,l.vault.bridge.port=o,l),window.go&&window.go.main&&window.go.main.App&&await window.go.main.App.SaveAppConfig(l),t(5,d="saved"),t(6,p="ok"),await m()}catch(E){t(5,d=String(E)),t(6,p="error")}t(4,u=!1)}async function b(){t(4,u=!0),t(5,d=""),t(6,p="");try{window.go&&window.go.main&&window.go.main.App&&await window.go.main.App.RestartBridge(),t(5,d="bridge restarted"),t(6,p="ok"),await m()}catch(E){t(5,d=String(E)),t(6,p="error")}t(4,u=!1)}function v(){i=this.checked,t(0,i)}function y(){o=zl(this.value),t(1,o)}return n.$$set=E=>{"appConfig"in E&&t(9,l=E.appConfig)},[i,o,s,c,u,d,p,g,b,l,v,y]}class m0 extends ut{constructor(e){super(),ct(this,e,h0,p0,at,{appConfig:9})}}const{window:g0}=Ls;function _0(n){let e,t;return e=new m0({props:{appConfig:n[2]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i&4&&(o.appConfig=l[2]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function b0(n){let e,t;return e=new d0({}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function k0(n){let e,t;return e=new u0({props:{onRefresh:n[7]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function v0(n){let e,t;return e=new s0({}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function w0(n){let e,t;return e=new l0({}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function y0(n){let e,t;return e=new t0({props:{onPluginToggle:n[0]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i&1&&(o.onPluginToggle=l[0]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function E0(n){let e,t;return e=new Vv({props:{onRefresh:n[3]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function T0(n){let e,t;return e=new jv({props:{onRefresh:n[3]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function S0(n){let e,t;return e=new Pv({props:{appConfig:n[2],onSave:n[6]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i&4&&(o.appConfig=l[2]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function C0(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y;d=new Lv({props:{activeSection:n[1],onSelect:n[4]}});const E=[S0,T0,E0,y0,w0,v0,k0,b0,_0],T=[];function N(A,I){return A[1]==="general"?0:A[1]==="workspace"?1:A[1]==="templates"?2:A[1]==="plugins"?3:A[1]==="files"?4:A[1]==="activity"?5:A[1]==="sync"?6:A[1]==="backup"?7:A[1]==="browserBridge"?8:-1}return~(m=N(n))&&(g=T[m]=E[m](n)),{c(){e=f("button"),t=f("div"),l=f("div"),i=f("h2"),i.textContent=`${k("settings.title")}`,o=w(),s=f("button"),s.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>',c=w(),u=f("div"),Qe(d.$$.fragment),p=w(),h=f("div"),g&&g.c(),r(i,"class","svelte-zf2zsc"),r(s,"class","close-btn svelte-zf2zsc"),r(s,"title",k("settings.close")),r(l,"class","settings-header svelte-zf2zsc"),r(h,"class","settings-content svelte-zf2zsc"),r(u,"class","settings-body svelte-zf2zsc"),r(t,"class","settings-window svelte-zf2zsc"),r(e,"class","settings-overlay svelte-zf2zsc")},m(A,I){C(A,e,I),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(t,c),a(t,u),Ye(d,u,null),a(u,p),a(u,h),~m&&T[m].m(h,null),b=!0,v||(y=[P(g0,"keydown",n[8]),P(s,"click",n[5]),P(e,"click",xt(n[5]))],v=!0)},p(A,[I]){const O={};I&2&&(O.activeSection=A[1]),d.$set(O);let R=m;m=N(A),m===R?~m&&T[m].p(A,I):(g&&(yt(),ke(T[R],1,1,()=>{T[R]=null}),Et()),~m?(g=T[m],g?g.p(A,I):(g=T[m]=E[m](A),g.c()),ge(g,1),g.m(h,null)):g=null)},i(A){b||(ge(d.$$.fragment,A),ge(g),b=!0)},o(A){ke(d.$$.fragment,A),ke(g),b=!1},d(A){A&&S(e),Xe(d),~m&&T[m].d(),v=!1,Ce(y)}}}function fa(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function A0(n,e,t){let{onClose:l=null}=e,{onSyncRefresh:i=null}=e,{onPluginToggle:o=null}=e,{initialSection:s="general"}=e,c=s,u=null;async function d(){try{t(2,u=await fa("GetAppConfig"))}catch{t(2,u=null)}}d();function p(v){t(1,c=v)}function h(){l&&l()}async function m(v){try{await fa("SaveAppConfig",v),t(2,u=v)}catch(y){console.error(y)}}function g(){i&&i()}function b(v){v.key==="Escape"&&h()}return n.$$set=v=>{"onClose"in v&&t(9,l=v.onClose),"onSyncRefresh"in v&&t(10,i=v.onSyncRefresh),"onPluginToggle"in v&&t(0,o=v.onPluginToggle),"initialSection"in v&&t(11,s=v.initialSection)},[o,c,u,d,p,h,m,g,b,l,i,s]}class N0 extends ut{constructor(e){super(),ct(this,e,A0,C0,at,{onClose:9,onSyncRefresh:10,onPluginToggle:0,initialSection:11})}}function I0(n){let e,t,l,i,o,s,c,u;return{c(){e=f("div"),t=f("span"),l=w(),i=f("span"),i.textContent=`${k("sync.status.disabled")}`,o=w(),s=f("button"),s.textContent=`${k("sync.configure")}`,r(t,"class","sync-dot dot-disabled svelte-1rxbx0"),r(i,"class","sync-label svelte-1rxbx0"),r(s,"class","btn btn-xs svelte-1rxbx0"),r(e,"class","sync-status-row svelte-1rxbx0")},m(d,p){C(d,e,p),a(e,t),a(e,l),a(e,i),a(e,o),a(e,s),c||(u=P(s,"click",function(){pl(n[5])&&n[5].apply(this,arguments)}),c=!0)},p(d,p){n=d},d(d){d&&S(e),c=!1,u()}}}function R0(n){let e,t,l,i,o,s=n[7](n[0])+"",c,u,d,p,h,m=(n[1]?k("sync.running"):k("sync.run"))+"",g,b,v,y,E,T,N,A=n[0].unpushedOps>0&&da(n),I=n[2]&&pa(n);return{c(){e=f("div"),t=f("span"),i=w(),o=f("span"),c=H(s),u=w(),A&&A.c(),d=w(),p=f("div"),h=f("button"),g=H(m),b=w(),v=f("button"),v.textContent=`${k("sync.details")}`,y=w(),I&&I.c(),E=kt(),r(t,"class",l="sync-dot "+n[6](n[0])+" svelte-1rxbx0"),r(o,"class","sync-label svelte-1rxbx0"),r(h,"class","btn btn-xs svelte-1rxbx0"),h.disabled=n[1],r(v,"class","btn btn-xs btn-link svelte-1rxbx0"),r(p,"class","sync-actions-row svelte-1rxbx0"),r(e,"class","sync-status-row svelte-1rxbx0")},m(O,R){C(O,e,R),a(e,t),a(e,i),a(e,o),a(o,c),a(e,u),A&&A.m(e,null),a(e,d),a(e,p),a(p,h),a(h,g),a(p,b),a(p,v),C(O,y,R),I&&I.m(O,R),C(O,E,R),T||(N=[P(h,"click",function(){pl(n[4])&&n[4].apply(this,arguments)}),P(v,"click",function(){pl(n[5])&&n[5].apply(this,arguments)})],T=!0)},p(O,R){n=O,R&1&&l!==(l="sync-dot "+n[6](n[0])+" svelte-1rxbx0")&&r(t,"class",l),R&1&&s!==(s=n[7](n[0])+"")&&Q(c,s),n[0].unpushedOps>0?A?A.p(n,R):(A=da(n),A.c(),A.m(e,d)):A&&(A.d(1),A=null),R&2&&m!==(m=(n[1]?k("sync.running"):k("sync.run"))+"")&&Q(g,m),R&2&&(h.disabled=n[1]),n[2]?I?I.p(n,R):(I=pa(n),I.c(),I.m(E.parentNode,E)):I&&(I.d(1),I=null)},d(O){O&&(S(e),S(y),S(E)),A&&A.d(),I&&I.d(O),T=!1,Ce(N)}}}function da(n){let e,t=n[0].unpushedOps+"",l,i,o=k("sync.changes")+"",s;return{c(){e=f("span"),l=H(t),i=w(),s=H(o),r(e,"class","sync-count svelte-1rxbx0")},m(c,u){C(c,e,u),a(e,l),a(e,i),a(e,s)},p(c,u){u&1&&t!==(t=c[0].unpushedOps+"")&&Q(l,t)},d(c){c&&S(e)}}}function pa(n){let e,t,l;return{c(){e=f("div"),t=H(n[2]),r(e,"class",l=Ho(n[3]==="warning"?"sync-message sync-message-warning":"sync-message")+" svelte-1rxbx0")},m(i,o){C(i,e,o),a(e,t)},p(i,o){o&4&&Q(t,i[2]),o&8&&l!==(l=Ho(i[3]==="warning"?"sync-message sync-message-warning":"sync-message")+" svelte-1rxbx0")&&r(e,"class",l)},d(i){i&&S(e)}}}function M0(n){let e;function t(o,s){var c;return(c=o[0])!=null&&c.configured?R0:I0}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","sync-status-widget svelte-1rxbx0")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:se,o:se,d(o){o&&S(e),i.d()}}}function L0(n,e,t){let{syncStatus:l=null}=e,{syncLoading:i=!1}=e,{syncMessage:o=""}=e,{syncMessageKind:s=""}=e,{onSync:c=null}=e,{onOpenSettings:u=null}=e;function d(h){return!h||!h.configured?"dot-disabled":i?"dot-syncing":h.revoked?"dot-disabled":h.connected?"dot-connected":h.configured?"dot-warning":"dot-disabled"}function p(h){return!h||!h.configured?k("sync.status.disabled"):i?k("sync.status.syncing"):h.revoked?k("sync.status.error"):h.connected?k("sync.status.connected"):k("sync.status.disconnected")}return n.$$set=h=>{"syncStatus"in h&&t(0,l=h.syncStatus),"syncLoading"in h&&t(1,i=h.syncLoading),"syncMessage"in h&&t(2,o=h.syncMessage),"syncMessageKind"in h&&t(3,s=h.syncMessageKind),"onSync"in h&&t(4,c=h.onSync),"onOpenSettings"in h&&t(5,u=h.onOpenSettings)},[l,i,o,s,c,u,d,p]}class O0 extends ut{constructor(e){super(),ct(this,e,L0,M0,at,{syncStatus:0,syncLoading:1,syncMessage:2,syncMessageKind:3,onSync:4,onOpenSettings:5})}}function ha(n,e,t){const l=n.slice();return l[10]=e[t],l}function D0(n){let e,t=Te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=va(ha(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","event-list svelte-slao4o")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o&93){t=Te(i[0]);let s;for(s=0;s<t.length;s+=1){const c=ha(i,t,s);l[s]?l[s].p(c,o):(l[s]=va(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function P0(n){let e;function t(o,s){return o[1]?z0:q0}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","empty-state svelte-slao4o")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l!==(l=t(o))&&(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},d(o){o&&S(e),i.d()}}}function ma(n){let e,t=n[10].active_seconds+"",l,i;return{c(){e=f("span"),l=H(t),i=H("с"),r(e,"class","duration svelte-slao4o")},m(o,s){C(o,e,s),a(e,l),a(e,i)},p(o,s){s&1&&t!==(t=o[10].active_seconds+"")&&Q(l,t)},d(o){o&&S(e)}}}function ga(n){let e,t=n[6](n[10].ts_start)+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","time svelte-slao4o")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&65&&t!==(t=i[6](i[10].ts_start)+"")&&Q(l,t)},d(i){i&&S(e)}}}function _a(n){let e,t=n[10].status+"",l,i;return{c(){e=f("span"),l=H(t),r(e,"class",i="status-badge status-"+n[10].status+" svelte-slao4o")},m(o,s){C(o,e,s),a(e,l)},p(o,s){s&1&&t!==(t=o[10].status+"")&&Q(l,t),s&1&&i!==(i="status-badge status-"+o[10].status+" svelte-slao4o")&&r(e,"class",i)},d(o){o&&S(e)}}}function ba(n){let e,t,l=Bi(n[10].selected_text,120)+"",i,o;return{c(){e=f("div"),t=H('"'),i=H(l),o=H('"'),r(e,"class","event-text svelte-slao4o")},m(s,c){C(s,e,c),a(e,t),a(e,i),a(e,o)},p(s,c){c&1&&l!==(l=Bi(s[10].selected_text,120)+"")&&Q(i,l)},d(s){s&&S(e)}}}function ka(n){let e,t,l,i,o,s,c,u;function d(){return n[7](n[10])}function p(){return n[8](n[10])}function h(){return n[9](n[10])}return{c(){e=f("div"),t=f("button"),t.textContent="✓",l=w(),i=f("button"),i.textContent="📎",o=w(),s=f("button"),s.textContent="✕",r(t,"class","btn-accept svelte-slao4o"),r(t,"title","Принять как worklog"),r(i,"class","btn-attach svelte-slao4o"),r(i,"title","Прикрепить к делу"),r(s,"class","btn-dismiss svelte-slao4o"),r(s,"title","Удалить"),r(e,"class","event-actions svelte-slao4o")},m(m,g){C(m,e,g),a(e,t),a(e,l),a(e,i),a(e,o),a(e,s),c||(u=[P(t,"click",d),P(i,"click",p),P(s,"click",h)],c=!0)},p(m,g){n=m},d(m){m&&S(e),c=!1,Ce(u)}}}function va(n){let e,t,l=wa(n[10].type)+"",i,o,s,c,u=(n[10].domain||"?")+"",d,p,h,m=Bi(n[10].title||n[10].url,80)+"",g,b,v,y,E,T,N,A,I,O=n[10].active_seconds>0&&ma(n),R=n[10].ts_start&&ga(n),D=n[10].status!=="pending"&&_a(n),B=n[10].selected_text&&ba(n),j=n[10].status==="pending"&&ka(n);return{c(){e=f("div"),t=f("div"),i=H(l),o=w(),s=f("div"),c=f("div"),d=H(u),p=w(),h=f("div"),g=H(m),v=w(),y=f("div"),O&&O.c(),E=w(),R&&R.c(),T=w(),D&&D.c(),N=w(),B&&B.c(),A=w(),j&&j.c(),I=w(),r(t,"class","event-icon svelte-slao4o"),r(c,"class","event-domain svelte-slao4o"),r(h,"class","event-title svelte-slao4o"),r(h,"title",b=n[10].title),r(y,"class","event-meta svelte-slao4o"),r(s,"class","event-body svelte-slao4o"),r(e,"class","event-item svelte-slao4o"),ce(e,"pending",n[10].status==="pending")},m(U,z){C(U,e,z),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,d),a(s,p),a(s,h),a(h,g),a(s,v),a(s,y),O&&O.m(y,null),a(y,E),R&&R.m(y,null),a(y,T),D&&D.m(y,null),a(s,N),B&&B.m(s,null),a(e,A),j&&j.m(e,null),a(e,I)},p(U,z){z&1&&l!==(l=wa(U[10].type)+"")&&Q(i,l),z&1&&u!==(u=(U[10].domain||"?")+"")&&Q(d,u),z&1&&m!==(m=Bi(U[10].title||U[10].url,80)+"")&&Q(g,m),z&1&&b!==(b=U[10].title)&&r(h,"title",b),U[10].active_seconds>0?O?O.p(U,z):(O=ma(U),O.c(),O.m(y,E)):O&&(O.d(1),O=null),U[10].ts_start?R?R.p(U,z):(R=ga(U),R.c(),R.m(y,T)):R&&(R.d(1),R=null),U[10].status!=="pending"?D?D.p(U,z):(D=_a(U),D.c(),D.m(y,null)):D&&(D.d(1),D=null),U[10].selected_text?B?B.p(U,z):(B=ba(U),B.c(),B.m(s,null)):B&&(B.d(1),B=null),U[10].status==="pending"?j?j.p(U,z):(j=ka(U),j.c(),j.m(e,I)):j&&(j.d(1),j=null),z&1&&ce(e,"pending",U[10].status==="pending")},d(U){U&&S(e),O&&O.d(),R&&R.d(),D&&D.d(),B&&B.d(),j&&j.d()}}}function q0(n){let e;return{c(){e=f("p"),e.textContent=`${k("noBrowserEvents","Нет событий браузера")}`,r(e,"class","empty-text svelte-slao4o")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function z0(n){let e;return{c(){e=f("p"),e.textContent=`${k("loading","Загрузка...")}`,r(e,"class","loading svelte-slao4o")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function B0(n){let e,t,l,i,o,s=n[1]?"⏳":"🔄",c,u,d,p;function h(b,v){return b[0].length===0?P0:D0}let m=h(n),g=m(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("browserEvents","События браузера")}`,i=w(),o=f("button"),c=H(s),u=w(),g.c(),r(l,"class","svelte-slao4o"),r(o,"class","refresh-btn svelte-slao4o"),o.disabled=n[1],r(t,"class","browser-header svelte-slao4o"),r(e,"class","browser-events svelte-slao4o")},m(b,v){C(b,e,v),a(e,t),a(t,l),a(t,i),a(t,o),a(o,c),a(e,u),g.m(e,null),d||(p=P(o,"click",function(){pl(n[5])&&n[5].apply(this,arguments)}),d=!0)},p(b,[v]){n=b,v&2&&s!==(s=n[1]?"⏳":"🔄")&&Q(c,s),v&2&&(o.disabled=n[1]),m===(m=h(n))&&g?g.p(n,v):(g.d(1),g=m(n),g&&(g.c(),g.m(e,null)))},i:se,o:se,d(b){b&&S(e),g.d(),d=!1,p()}}}function wa(n){return n==="page_visit"?"🌐":n==="note_capture"?"📝":n==="screenshot"?"📸":"•"}function Bi(n,e){return n?n.length>e?n.substring(0,e)+"...":n:""}function F0(n,e,t){let{events:l=[]}=e,{loading:i=!1}=e,{onAccept:o=g=>{}}=e,{onDismiss:s=g=>{}}=e,{onAttach:c=g=>{}}=e,{onRefresh:u=()=>{}}=e,{formatTime:d=g=>""}=e;const p=g=>o(g),h=g=>c(g),m=g=>s(g);return n.$$set=g=>{"events"in g&&t(0,l=g.events),"loading"in g&&t(1,i=g.loading),"onAccept"in g&&t(2,o=g.onAccept),"onDismiss"in g&&t(3,s=g.onDismiss),"onAttach"in g&&t(4,c=g.onAttach),"onRefresh"in g&&t(5,u=g.onRefresh),"formatTime"in g&&t(6,d=g.formatTime)},[l,i,o,s,c,u,d,p,h,m]}class j0 extends ut{constructor(e){super(),ct(this,e,F0,B0,at,{events:0,loading:1,onAccept:2,onDismiss:3,onAttach:4,onRefresh:5,formatTime:6})}}function ya(n,e,t){const l=n.slice();return l[69]=e[t],l}function Ea(n,e,t){const l=n.slice();return l[69]=e[t],l}function Ta(n,e,t){const l=n.slice();return l[64]=e[t],l[65]=e,l[66]=t,l}function Sa(n,e,t){const l=n.slice();return l[61]=e[t],l}function Ca(n,e,t){const l=n.slice();return l[61]=e[t],l}function Aa(n){let e,t;return{c(){e=f("span"),t=H(n[4]),r(e,"class","tab-badge svelte-ii7vwz")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&16&&Q(t,l[4])},d(l){l&&S(e)}}}function Na(n){let e,t=n[3].length+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","tab-badge svelte-ii7vwz")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&8&&t!==(t=i[3].length+"")&&Q(l,t)},d(i){i&&S(e)}}}function Ia(n){let e,t=n[15].length+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","tab-badge svelte-ii7vwz")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&32768&&t!==(t=i[15].length+"")&&Q(l,t)},d(i){i&&S(e)}}}function U0(n){let e,t,l;return t=new j0({props:{events:n[15],loading:n[16],formatTime:n[5],onAccept:n[17],onDismiss:n[18],onAttach:n[19],onRefresh:n[20]}}),{c(){e=f("div"),Qe(t.$$.fragment),r(e,"class","today-tab-content svelte-ii7vwz")},m(i,o){C(i,e,o),Ye(t,e,null),l=!0},p(i,o){const s={};o[0]&32768&&(s.events=i[15]),o[0]&65536&&(s.loading=i[16]),o[0]&32&&(s.formatTime=i[5]),o[0]&131072&&(s.onAccept=i[17]),o[0]&262144&&(s.onDismiss=i[18]),o[0]&524288&&(s.onAttach=i[19]),o[0]&1048576&&(s.onRefresh=i[20]),t.$set(s)},i(i){l||(ge(t.$$.fragment,i),l=!0)},o(i){ke(t.$$.fragment,i),l=!1},d(i){i&&S(e),Xe(t)}}}function H0(n){let e,t,l,i,o,s,c,u,d,p,h=n[25]==="asc"?"↑":"↓",m,g,b,v;function y(N,A){return N[3].length===0?Z0:V0}let E=y(n),T=E(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),i.textContent=`${k("today.sortByTime")}`,o=w(),s=f("button"),s.textContent=`${k("today.sortByName")}`,c=w(),u=f("button"),u.textContent=`${k("today.sortByType")}`,d=w(),p=f("span"),m=H(h),g=w(),T.c(),r(i,"class","sort-btn svelte-ii7vwz"),ce(i,"active",n[24]==="time"),r(s,"class","sort-btn svelte-ii7vwz"),ce(s,"active",n[24]==="name"),r(u,"class","sort-btn svelte-ii7vwz"),ce(u,"active",n[24]==="type"),r(p,"class","sort-dir svelte-ii7vwz"),r(l,"class","sort-controls svelte-ii7vwz"),r(t,"class","tab-controls svelte-ii7vwz"),r(e,"class","today-tab-content svelte-ii7vwz")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(l,c),a(l,u),a(l,d),a(l,p),a(p,m),a(e,g),T.m(e,null),b||(v=[P(i,"click",n[56]),P(s,"click",n[57]),P(u,"click",n[58])],b=!0)},p(N,A){A[0]&16777216&&ce(i,"active",N[24]==="time"),A[0]&16777216&&ce(s,"active",N[24]==="name"),A[0]&16777216&&ce(u,"active",N[24]==="type"),A[0]&33554432&&h!==(h=N[25]==="asc"?"↑":"↓")&&Q(m,h),E===(E=y(N))&&T?T.p(N,A):(T.d(1),T=E(N),T&&(T.c(),T.m(e,null)))},i:se,o:se,d(N){N&&S(e),T.d(),b=!1,Ce(v)}}}function W0(n){let e,t,l,i,o,s,c,u,d,p,h=n[23]==="asc"?"↑":"↓",m,g,b,v;function y(N,A){return N[2].length===0?X0:Y0}let E=y(n),T=E(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),i.textContent=`${k("today.sortByTime")}`,o=w(),s=f("button"),s.textContent=`${k("today.sortByName")}`,c=w(),u=f("button"),u.textContent=`${k("today.sortByType")}`,d=w(),p=f("span"),m=H(h),g=w(),T.c(),r(i,"class","sort-btn svelte-ii7vwz"),ce(i,"active",n[22]==="time"),r(s,"class","sort-btn svelte-ii7vwz"),ce(s,"active",n[22]==="name"),r(u,"class","sort-btn svelte-ii7vwz"),ce(u,"active",n[22]==="type"),r(p,"class","sort-dir svelte-ii7vwz"),r(l,"class","sort-controls svelte-ii7vwz"),r(t,"class","tab-controls svelte-ii7vwz"),r(e,"class","today-tab-content svelte-ii7vwz")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(l,c),a(l,u),a(l,d),a(l,p),a(p,m),a(e,g),T.m(e,null),b||(v=[P(i,"click",n[51]),P(s,"click",n[52]),P(u,"click",n[53])],b=!0)},p(N,A){A[0]&4194304&&ce(i,"active",N[22]==="time"),A[0]&4194304&&ce(s,"active",N[22]==="name"),A[0]&4194304&&ce(u,"active",N[22]==="type"),A[0]&8388608&&h!==(h=N[23]==="asc"?"↑":"↓")&&Q(m,h),E===(E=y(N))&&T?T.p(N,A):(T.d(1),T=E(N),T&&(T.c(),T.m(e,null)))},i:se,o:se,d(N){N&&S(e),T.d(),b=!1,Ce(v)}}}function G0(n){let e;function t(o,s){return o[0].length===0?Q0:J0}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","today-tab-content svelte-ii7vwz")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:se,o:se,d(o){o&&S(e),i.d()}}}function K0(n){let e;function t(o,s){return!o[1]||!o[1].events||o[1].events.length===0?$0:x0}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","today-tab-content svelte-ii7vwz")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:se,o:se,d(o){o&&S(e),i.d()}}}function V0(n){let e,t=Te(Ha(n[3],n[24],n[25])),l=[];for(let i=0;i<t.length;i+=1)l[i]=Ra(ya(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","capture-list svelte-ii7vwz")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[0]&50348328){t=Te(Ha(i[3],i[24],i[25]));let s;for(s=0;s<t.length;s+=1){const c=ya(i,t,s);l[s]?l[s].p(c,o):(l[s]=Ra(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Z0(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("today.capturedEmpty")}`,r(t,"class","svelte-ii7vwz"),r(e,"class","today-empty svelte-ii7vwz")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Ra(n){let e,t,l=Wa(n[69].captureKind||n[69].sourceKind)+"",i,o,s,c,u=n[69].title+"",d,p,h,m=n[8](n[69])+"",g,b,v,y=n[5](n[69].capturedAt||n[69].createdAt)+"",E,T,N,A;function I(){return n[59](n[69])}function O(...R){return n[60](n[69],...R)}return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),s=f("div"),c=f("span"),d=H(u),p=w(),h=f("span"),g=H(m),b=w(),v=f("span"),E=H(y),T=w(),r(t,"class","capture-icon svelte-ii7vwz"),r(c,"class","capture-title svelte-ii7vwz"),r(h,"class","capture-meta svelte-ii7vwz"),r(s,"class","capture-body svelte-ii7vwz"),r(v,"class","capture-time svelte-ii7vwz"),r(e,"class","capture-item svelte-ii7vwz"),r(e,"role","button"),r(e,"tabindex","0")},m(R,D){C(R,e,D),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,d),a(s,p),a(s,h),a(h,g),a(e,b),a(e,v),a(v,E),a(e,T),N||(A=[P(e,"click",I),P(e,"keydown",O)],N=!0)},p(R,D){n=R,D[0]&50331656&&l!==(l=Wa(n[69].captureKind||n[69].sourceKind)+"")&&Q(i,l),D[0]&50331656&&u!==(u=n[69].title+"")&&Q(d,u),D[0]&50331912&&m!==(m=n[8](n[69])+"")&&Q(g,m),D[0]&50331688&&y!==(y=n[5](n[69].capturedAt||n[69].createdAt)+"")&&Q(E,y)},d(R){R&&S(e),N=!1,Ce(A)}}}function Y0(n){let e,t=Te(n[30](n[2],n[22],n[23])),l=[];for(let i=0;i<t.length;i+=1)l[i]=La(Ea(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","ip-list svelte-ii7vwz")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[0]&1086325988){t=Te(i[30](i[2],i[22],i[23]));let s;for(s=0;s<t.length;s+=1){const c=Ea(i,t,s);l[s]?l[s].p(c,o):(l[s]=La(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function X0(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("today.inProgressEmpty")}`,r(t,"class","svelte-ii7vwz"),r(e,"class","today-empty svelte-ii7vwz")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Ma(n){let e,t=n[69].nodePath+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","ip-path svelte-ii7vwz")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&12582916&&t!==(t=i[69].nodePath+"")&&Q(l,t)},d(i){i&&S(e)}}}function La(n){let e,t,l=n[7](n[69].eventType)+"",i,o,s,c,u=n[69].title+"",d,p,h,m,g=n[6](n[69].eventType)+"",b,v,y,E=n[5](n[69].createdAt)+"",T,N,A,I,O=n[69].nodePath&&Ma(n);function R(){return n[54](n[69])}function D(...B){return n[55](n[69],...B)}return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),s=f("div"),c=f("span"),d=H(u),p=w(),O&&O.c(),h=w(),m=f("span"),b=H(g),v=w(),y=f("span"),T=H(E),N=w(),r(t,"class","ip-icon svelte-ii7vwz"),r(c,"class","ip-title svelte-ii7vwz"),r(s,"class","ip-body svelte-ii7vwz"),r(m,"class","ip-type svelte-ii7vwz"),r(y,"class","ip-time svelte-ii7vwz"),r(e,"class","ip-item svelte-ii7vwz"),r(e,"role","button"),r(e,"tabindex","0")},m(B,j){C(B,e,j),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,d),a(s,p),O&&O.m(s,null),a(e,h),a(e,m),a(m,b),a(e,v),a(e,y),a(y,T),a(e,N),A||(I=[P(e,"click",R),P(e,"keydown",D)],A=!0)},p(B,j){n=B,j[0]&12583044&&l!==(l=n[7](n[69].eventType)+"")&&Q(i,l),j[0]&12582916&&u!==(u=n[69].title+"")&&Q(d,u),n[69].nodePath?O?O.p(n,j):(O=Ma(n),O.c(),O.m(s,null)):O&&(O.d(1),O=null),j[0]&12582980&&g!==(g=n[6](n[69].eventType)+"")&&Q(b,g),j[0]&12582948&&E!==(E=n[5](n[69].createdAt)+"")&&Q(T,E)},d(B){B&&S(e),O&&O.d(),A=!1,Ce(I)}}}function J0(n){let e,t=Te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Ba(Ta(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","suggestions-list svelte-ii7vwz")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[0]&201341537){t=Te(i[0]);let s;for(s=0;s<t.length;s+=1){const c=Ta(i,t,s);l[s]?l[s].p(c,o):(l[s]=Ba(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Q0(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("suggest.noSuggestions")}`,r(t,"class","svelte-ii7vwz"),r(e,"class","today-empty svelte-ii7vwz")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Oa(n){let e,t=n[64].events.length+"",l,i,o=k("suggest.detectedEvents")+"",s;return{c(){e=H("· "),l=H(t),i=w(),s=H(o)},m(c,u){C(c,e,u),C(c,l,u),C(c,i,u),C(c,s,u)},p(c,u){u[0]&1&&t!==(t=c[64].events.length+"")&&Q(l,t)},d(c){c&&(S(e),S(l),S(i),S(s))}}}function Da(n){let e,t,l,i=Te(n[64].events),o=[];for(let s=0;s<i.length;s+=1)o[s]=za(Sa(n,i,s));return{c(){e=f("div"),t=f("div"),t.textContent=`${k("suggest.detectedEvents")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","suggestion-detail-title svelte-ii7vwz"),r(e,"class","suggestion-detail svelte-ii7vwz")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[0]&10337){i=Te(s[64].events);let u;for(u=0;u<i.length;u+=1){const d=Sa(s,i,u);o[u]?o[u].p(d,c):(o[u]=za(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function Pa(n){let e,t=n[61].nodePath+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","suggestion-event-path svelte-ii7vwz")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&1&&t!==(t=i[61].nodePath+"")&&Q(l,t)},d(i){i&&S(e)}}}function qa(n){let e,t,l;function i(){return n[50](n[61])}return{c(){e=f("button"),e.textContent=`${k("file.showInExplorer")}`,r(e,"class","link-btn svelte-ii7vwz")},m(o,s){C(o,e,s),t||(l=P(e,"click",i),t=!0)},p(o,s){n=o},d(o){o&&S(e),t=!1,l()}}}function za(n){let e,t,l=n[5](n[61].createdAt)+"",i,o,s,c,u=n[6](n[61].eventType)+"",d,p,h,m=n[61].title+"",g,b,v,y,E=n[61].targetType==="file"||n[61].eventType.startsWith("file_"),T,N,A,I=n[61].nodePath&&Pa(n);function O(){return n[49](n[61])}let R=E&&qa(n);return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),I&&I.c(),s=w(),c=f("span"),d=H(u),p=w(),h=f("span"),g=H(m),b=w(),v=f("button"),v.textContent=`${k("common.open")}`,y=w(),R&&R.c(),T=w(),r(t,"class","suggestion-event-time svelte-ii7vwz"),r(c,"class","suggestion-event-type svelte-ii7vwz"),r(h,"class","suggestion-event-title svelte-ii7vwz"),r(v,"class","link-btn svelte-ii7vwz"),r(e,"class","suggestion-detail-event svelte-ii7vwz")},m(D,B){C(D,e,B),a(e,t),a(t,i),a(e,o),I&&I.m(e,null),a(e,s),a(e,c),a(c,d),a(e,p),a(e,h),a(h,g),a(e,b),a(e,v),a(e,y),R&&R.m(e,null),a(e,T),N||(A=P(v,"click",O),N=!0)},p(D,B){n=D,B[0]&33&&l!==(l=n[5](n[61].createdAt)+"")&&Q(i,l),n[61].nodePath?I?I.p(n,B):(I=Pa(n),I.c(),I.m(e,s)):I&&(I.d(1),I=null),B[0]&65&&u!==(u=n[6](n[61].eventType)+"")&&Q(d,u),B[0]&1&&m!==(m=n[61].title+"")&&Q(g,m),B[0]&1&&(E=n[61].targetType==="file"||n[61].eventType.startsWith("file_")),E?R?R.p(n,B):(R=qa(n),R.c(),R.m(e,T)):R&&(R.d(1),R=null)},d(D){D&&S(e),I&&I.d(),R&&R.d(),N=!1,A()}}}function Ba(n){let e,t,l,i,o=n[64].nodeTitle+"",s,c,u,d=n[64].summary+"",p,h,m,g=n[64].suggestedMin+"",b,v,y=k("worklog.min")+"",E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M,q,X,Z;function J(){return n[42](n[64])}let ee=n[64].events&&n[64].events.length>0&&Oa(n);function te(...ne){return n[43](n[64],n[65],n[66],...ne)}function le(){return n[44](n[64])}function _e(){return n[45](n[64])}function oe(){return n[46](n[64])}function ze(){return n[47](n[64],n[65],n[66])}function Ge(...ne){return n[48](n[64],n[65],n[66],...ne)}let Ie=n[64]._expanded&&n[64].events&&n[64].events.length>0&&Da(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),s=H(o),c=w(),u=f("span"),p=H(d),h=w(),m=f("span"),b=H(g),v=w(),E=H(y),ee&&ee.c(),T=w(),N=f("div"),A=f("span"),R=w(),D=f("input"),j=w(),U=f("span"),U.textContent=`${k("suggest.minutes")}`,z=w(),W=f("button"),W.textContent=`${k("suggest.edit")}`,K=w(),Y=f("button"),Y.textContent=`${k("suggest.apply")}`,F=w(),L=f("button"),L.textContent=`${k("common.delete")}`,M=w(),Ie&&Ie.c(),q=w(),r(i,"class","suggestion-node link-btn svelte-ii7vwz"),r(u,"class","suggestion-summary svelte-ii7vwz"),r(m,"class","suggestion-meta svelte-ii7vwz"),r(l,"class","suggestion-info svelte-ii7vwz"),r(A,"class","suggestion-confidence-dot svelte-ii7vwz"),r(A,"title",I=k("suggest.confidence."+n[64].confidence)),r(A,"aria-label",O=k("suggest.confidence."+n[64].confidence)),ce(A,"low",n[64].confidence==="low"),ce(A,"medium",n[64].confidence==="medium"),ce(A,"high",n[64].confidence==="high"),r(D,"type","number"),r(D,"class","suggestion-min-input svelte-ii7vwz"),D.value=B=n[64].suggestedMin,r(D,"min","1"),r(D,"max","480"),r(U,"class","suggestion-min-label svelte-ii7vwz"),r(W,"class","btn btn-sm svelte-ii7vwz"),r(Y,"class","btn btn-sm btn-primary svelte-ii7vwz"),r(L,"class","btn btn-sm btn-danger svelte-ii7vwz"),r(N,"class","suggestion-actions svelte-ii7vwz"),r(t,"class","suggestion-main svelte-ii7vwz"),r(t,"role","button"),r(t,"tabindex","0"),r(e,"class","suggestion-card svelte-ii7vwz"),ce(e,"expanded",n[64]._expanded)},m(ne,re){C(ne,e,re),a(e,t),a(t,l),a(l,i),a(i,s),a(l,c),a(l,u),a(u,p),a(l,h),a(l,m),a(m,b),a(m,v),a(m,E),ee&&ee.m(m,null),a(t,T),a(t,N),a(N,A),a(N,R),a(N,D),a(N,j),a(N,U),a(N,z),a(N,W),a(N,K),a(N,Y),a(N,F),a(N,L),a(e,M),Ie&&Ie.m(e,null),a(e,q),X||(Z=[P(i,"click",We(J)),P(D,"change",We(te)),P(W,"click",We(le)),P(Y,"click",We(_e)),P(L,"click",We(oe)),P(t,"click",ze),P(t,"keydown",Ge)],X=!0)},p(ne,re){n=ne,re[0]&1&&o!==(o=n[64].nodeTitle+"")&&Q(s,o),re[0]&1&&d!==(d=n[64].summary+"")&&Q(p,d),re[0]&1&&g!==(g=n[64].suggestedMin+"")&&Q(b,g),n[64].events&&n[64].events.length>0?ee?ee.p(n,re):(ee=Oa(n),ee.c(),ee.m(m,null)):ee&&(ee.d(1),ee=null),re[0]&1&&I!==(I=k("suggest.confidence."+n[64].confidence))&&r(A,"title",I),re[0]&1&&O!==(O=k("suggest.confidence."+n[64].confidence))&&r(A,"aria-label",O),re[0]&1&&ce(A,"low",n[64].confidence==="low"),re[0]&1&&ce(A,"medium",n[64].confidence==="medium"),re[0]&1&&ce(A,"high",n[64].confidence==="high"),re[0]&1&&B!==(B=n[64].suggestedMin)&&D.value!==B&&(D.value=B),n[64]._expanded&&n[64].events&&n[64].events.length>0?Ie?Ie.p(n,re):(Ie=Da(n),Ie.c(),Ie.m(e,q)):Ie&&(Ie.d(1),Ie=null),re[0]&1&&ce(e,"expanded",n[64]._expanded)},d(ne){ne&&S(e),ee&&ee.d(),Ie&&Ie.d(),X=!1,Ce(Z)}}}function x0(n){let e,t=Te(n[1].events),l=[];for(let i=0;i<t.length;i+=1)l[i]=ja(Ca(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","feed-list svelte-ii7vwz")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[0]&805306466){t=Te(i[1].events);let s;for(s=0;s<t.length;s+=1){const c=Ca(i,t,s);l[s]?l[s].p(c,o):(l[s]=ja(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function $0(n){let e,t,l,i;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("today.feedEmpty")}`,l=w(),i=f("p"),i.textContent=`${k("today.feedHint")}`,r(t,"class","svelte-ii7vwz"),r(i,"class","hint svelte-ii7vwz"),r(e,"class","today-empty svelte-ii7vwz")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:se,d(o){o&&S(e)}}}function Fa(n){let e,t=Fi(n[61])+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","feed-path svelte-ii7vwz")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&2&&t!==(t=Fi(i[61])+"")&&Q(l,t)},d(i){i&&S(e)}}}function ja(n){let e,t,l=Ua(n[61].eventType)+"",i,o,s,c,u,d=n[28](n[61])+"",p,h,m,g,b,v=(n[61].title||"")+"",y,E,T,N=Fi(n[61]),A,I,O=n[6](n[61].eventType)+"",R,D,B,j=n[5](n[61].createdAt)+"",U,z,W,K,Y,F,L=N&&Fa(n);function M(){return n[39](n[61])}function q(){return n[40](n[61])}function X(...Z){return n[41](n[61],...Z)}return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),s=f("div"),c=f("div"),u=f("span"),p=H(d),h=w(),m=f("span"),m.textContent=":",g=w(),b=f("span"),y=H(v),E=w(),T=f("div"),L&&L.c(),A=w(),I=f("span"),R=H(O),D=w(),B=f("span"),U=H(j),z=w(),W=f("button"),W.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="9 18 15 12 9 6"></polyline></svg>',K=w(),r(t,"class","feed-icon svelte-ii7vwz"),r(u,"class","feed-type svelte-ii7vwz"),r(m,"class","feed-colon svelte-ii7vwz"),r(b,"class","feed-title link-btn svelte-ii7vwz"),r(c,"class","feed-title-line svelte-ii7vwz"),r(I,"class","feed-event-type svelte-ii7vwz"),r(B,"class","feed-time svelte-ii7vwz"),r(T,"class","feed-meta-line svelte-ii7vwz"),r(s,"class","feed-body svelte-ii7vwz"),r(W,"class","feed-nav-btn svelte-ii7vwz"),r(W,"title",k("common.open")),r(e,"class","feed-item svelte-ii7vwz"),r(e,"role","button"),r(e,"tabindex","0")},m(Z,J){C(Z,e,J),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,u),a(u,p),a(c,h),a(c,m),a(c,g),a(c,b),a(b,y),a(s,E),a(s,T),L&&L.m(T,null),a(T,A),a(T,I),a(I,R),a(T,D),a(T,B),a(B,U),a(e,z),a(e,W),a(e,K),Y||(F=[P(W,"click",We(M)),P(e,"click",q),P(e,"keydown",X)],Y=!0)},p(Z,J){n=Z,J[0]&2&&l!==(l=Ua(n[61].eventType)+"")&&Q(i,l),J[0]&2&&d!==(d=n[28](n[61])+"")&&Q(p,d),J[0]&2&&v!==(v=(n[61].title||"")+"")&&Q(y,v),J[0]&2&&(N=Fi(n[61])),N?L?L.p(n,J):(L=Fa(n),L.c(),L.m(T,A)):L&&(L.d(1),L=null),J[0]&66&&O!==(O=n[6](n[61].eventType)+"")&&Q(R,O),J[0]&34&&j!==(j=n[5](n[61].createdAt)+"")&&Q(U,j)},d(Z){Z&&S(e),L&&L.d(),Y=!1,Ce(F)}}}function e2(n){var X;let e,t,l,i=(((X=n[1])==null?void 0:X.date)||"")+"",o,s,c,u,d,p,h=k("today.suggestionsTab")+"",m,g,b,v,y,E,T=k("today.captured")+"",N,A,I,O,R,D,B,j,U,z,W,K=n[4]>0&&Aa(n),Y=n[3].length>0&&Na(n),F=n[15].length>0&&Ia(n);const L=[K0,G0,W0,H0,U0],M=[];function q(Z,J){return Z[21]==="feed"?0:Z[21]==="suggestions"?1:Z[21]==="inprogress"?2:Z[21]==="captured"?3:Z[21]==="browser"?4:-1}return~(B=q(n))&&(j=M[B]=L[B](n)),{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("div"),u=f("button"),u.textContent=`${k("today.feed")}`,d=w(),p=f("button"),m=H(h),g=w(),K&&K.c(),b=w(),v=f("button"),v.textContent=`${k("today.inProgress")}`,y=w(),E=f("button"),N=H(T),A=w(),Y&&Y.c(),I=w(),O=f("button"),R=H(`Браузер
|
||
`),F&&F.c(),D=w(),j&&j.c(),r(l,"class","today-date svelte-ii7vwz"),r(t,"class","today-header svelte-ii7vwz"),r(u,"class","today-tab svelte-ii7vwz"),ce(u,"active",n[21]==="feed"),r(p,"class","today-tab svelte-ii7vwz"),ce(p,"active",n[21]==="suggestions"),r(v,"class","today-tab svelte-ii7vwz"),ce(v,"active",n[21]==="inprogress"),r(E,"class","today-tab svelte-ii7vwz"),ce(E,"active",n[21]==="captured"),r(O,"class","today-tab svelte-ii7vwz"),ce(O,"active",n[21]==="browser"),r(c,"class","today-tabs svelte-ii7vwz"),r(e,"class","today-screen svelte-ii7vwz")},m(Z,J){C(Z,e,J),a(e,t),a(t,l),a(l,o),a(e,s),a(e,c),a(c,u),a(c,d),a(c,p),a(p,m),a(p,g),K&&K.m(p,null),a(c,b),a(c,v),a(c,y),a(c,E),a(E,N),a(E,A),Y&&Y.m(E,null),a(c,I),a(c,O),a(O,R),F&&F.m(O,null),a(e,D),~B&&M[B].m(e,null),U=!0,z||(W=[P(u,"click",n[34]),P(p,"click",n[35]),P(v,"click",n[36]),P(E,"click",n[37]),P(O,"click",n[38])],z=!0)},p(Z,J){var te;(!U||J[0]&2)&&i!==(i=(((te=Z[1])==null?void 0:te.date)||"")+"")&&Q(o,i),(!U||J[0]&2097152)&&ce(u,"active",Z[21]==="feed"),Z[4]>0?K?K.p(Z,J):(K=Aa(Z),K.c(),K.m(p,null)):K&&(K.d(1),K=null),(!U||J[0]&2097152)&&ce(p,"active",Z[21]==="suggestions"),(!U||J[0]&2097152)&&ce(v,"active",Z[21]==="inprogress"),Z[3].length>0?Y?Y.p(Z,J):(Y=Na(Z),Y.c(),Y.m(E,null)):Y&&(Y.d(1),Y=null),(!U||J[0]&2097152)&&ce(E,"active",Z[21]==="captured"),Z[15].length>0?F?F.p(Z,J):(F=Ia(Z),F.c(),F.m(O,null)):F&&(F.d(1),F=null),(!U||J[0]&2097152)&&ce(O,"active",Z[21]==="browser");let ee=B;B=q(Z),B===ee?~B&&M[B].p(Z,J):(j&&(yt(),ke(M[ee],1,1,()=>{M[ee]=null}),Et()),~B?(j=M[B],j?j.p(Z,J):(j=M[B]=L[B](Z),j.c()),ge(j,1),j.m(e,null)):j=null)},i(Z){U||(ge(j),U=!0)},o(Z){ke(j),U=!1},d(Z){Z&&S(e),K&&K.d(),Y&&Y.d(),F&&F.d(),~B&&M[B].d(),z=!1,Ce(W)}}}function Ua(n){return n==="note_created"||n==="file_added"||n==="folder_added"||n==="node_created"?"+":n==="file_deleted"||n==="folder_deleted"?"×":n==="file_renamed"||n==="folder_renamed"||n==="node_updated"?"~":n==="file_copied"?"⧉":n==="file_moved"||n==="folder_moved"?"→":n==="note_updated"?"✎":n==="action_created"?"▶":n==="action_done"?"✓":n==="worklog_added"?"⏱":"•"}function Fi(n){const e=[];return n.nodePath&&e.push(n.nodePath),e.length>0?e.join(" → "):""}function Ha(n,e,t){const l=[...n];return l.sort((i,o)=>{let s=0;if(e==="name")s=(i.title||"").localeCompare(o.title||"");else if(e==="type"){const c=i.captureKind||i.sourceKind||"",u=o.captureKind||o.sourceKind||"";s=c.localeCompare(u)}else s=(i.capturedAt||i.createdAt||"").localeCompare(o.capturedAt||o.createdAt||"");return t==="asc"?s:-s}),l}function Wa(n){return{text:"📝",url:"🔗",file:"📄",image:"🖼",folder:"📁"}[n]||"📦"}function t2(n,e,t){let{todayDashboard:l=null}=e,{suggestions:i=[]}=e,{inProgressItems:o=[]}=e,{todayCaptures:s=[]}=e,{suggestionCount:c=0}=e,{formatTime:u=x=>""}=e,{eventLabel:d=x=>x}=e,{eventIcon:p=x=>""}=e,{inboxMetaText:h=x=>""}=e,{onOpenNodeById:m=x=>{}}=e,{onOpenActivityEvent:g=x=>{}}=e,{onOpenActivityTarget:b=x=>{}}=e,{onOpenSuggestionWorklog:v=x=>{}}=e,{onAcceptSuggestion:y=x=>{}}=e,{onDeleteSuggestion:E=x=>{}}=e,{onOpenNodeFolder:T=x=>{}}=e,{onOpenInboxArtifact:N=x=>{}}=e,{onOpenTrashNode:A=x=>{}}=e,{browserEvents:I=[]}=e,{browserLoading:O=!1}=e,{onBrowserAccept:R=x=>{}}=e,{onBrowserDismiss:D=x=>{}}=e,{onBrowserAttach:B=x=>{}}=e,{onBrowserRefresh:j=()=>{}}=e,U="feed";function z(x){y(x)}function W(x){E(x)}function K(x){return!x||!x.eventType?"":d(x.eventType)}function Y(x){if(!(!x||!x.eventType)){if(x.eventType==="folder_deleted"){x.targetId&&A(x.targetId);return}if(["file_added","file_deleted","file_renamed","file_copied","file_moved","folder_added","folder_renamed","folder_moved"].includes(x.eventType)){x.targetId?b(x):x.nodeId&&m(x.nodeId);return}if(["note_created","note_updated","note_deleted"].includes(x.eventType)){x.targetType==="note"&&x.targetId?b(x):x.nodeId&&m(x.nodeId);return}if(x.eventType==="worklog_added"){x.nodeId&&m(x.nodeId);return}if(["action_created","action_done"].includes(x.eventType)){x.nodeId&&m(x.nodeId);return}(x.id||x.nodeId)&&g(x)}}function F(x,ye,me){const Re=[...x];return Re.sort((ft,it)=>{let Ze=0;return ye==="name"?Ze=(ft.title||"").localeCompare(it.title||""):ye==="type"?Ze=(d(ft.eventType)||"").localeCompare(d(it.eventType)||""):Ze=(ft.createdAt||"").localeCompare(it.createdAt||""),me==="asc"?Ze:-Ze}),Re}let L="time",M="desc",q="time",X="desc";const Z=()=>t(21,U="feed"),J=()=>t(21,U="suggestions"),ee=()=>t(21,U="inprogress"),te=()=>t(21,U="captured"),le=()=>t(21,U="browser"),_e=x=>Y(x),oe=x=>Y(x),ze=(x,ye)=>ye.key==="Enter"&&Y(x),Ge=x=>m(x.nodeId),Ie=(x,ye,me,Re)=>t(0,ye[me].suggestedMin=parseInt(Re.target.value),i),ne=x=>v(x),re=x=>z(x),Ne=x=>W(x),Fe=(x,ye,me)=>t(0,ye[me]._expanded=!x._expanded,i),we=(x,ye,me,Re)=>Re.key==="Enter"&&t(0,ye[me]._expanded=!x._expanded,i),je=x=>b(x),xe=x=>T(x.nodeId),Ae=()=>{t(22,L="time"),t(23,M=L==="time"&&M==="desc"?"asc":"desc")},Ve=()=>{t(22,L="name"),t(23,M=L==="name"&&M==="desc"?"asc":"desc")},Ue=()=>{t(22,L="type"),t(23,M=L==="type"&&M==="desc"?"asc":"desc")},Se=x=>g(x),He=(x,ye)=>ye.key==="Enter"&&g(x),Oe=()=>{t(24,q="time"),t(25,X=q==="time"&&X==="desc"?"asc":"desc")},Ke=()=>{t(24,q="name"),t(25,X=q==="name"&&X==="desc"?"asc":"desc")},Pe=()=>{t(24,q="type"),t(25,X=q==="type"&&X==="desc"?"asc":"desc")},ue=x=>N(x),be=(x,ye)=>ye.key==="Enter"&&N(x);return n.$$set=x=>{"todayDashboard"in x&&t(1,l=x.todayDashboard),"suggestions"in x&&t(0,i=x.suggestions),"inProgressItems"in x&&t(2,o=x.inProgressItems),"todayCaptures"in x&&t(3,s=x.todayCaptures),"suggestionCount"in x&&t(4,c=x.suggestionCount),"formatTime"in x&&t(5,u=x.formatTime),"eventLabel"in x&&t(6,d=x.eventLabel),"eventIcon"in x&&t(7,p=x.eventIcon),"inboxMetaText"in x&&t(8,h=x.inboxMetaText),"onOpenNodeById"in x&&t(9,m=x.onOpenNodeById),"onOpenActivityEvent"in x&&t(10,g=x.onOpenActivityEvent),"onOpenActivityTarget"in x&&t(11,b=x.onOpenActivityTarget),"onOpenSuggestionWorklog"in x&&t(12,v=x.onOpenSuggestionWorklog),"onAcceptSuggestion"in x&&t(31,y=x.onAcceptSuggestion),"onDeleteSuggestion"in x&&t(32,E=x.onDeleteSuggestion),"onOpenNodeFolder"in x&&t(13,T=x.onOpenNodeFolder),"onOpenInboxArtifact"in x&&t(14,N=x.onOpenInboxArtifact),"onOpenTrashNode"in x&&t(33,A=x.onOpenTrashNode),"browserEvents"in x&&t(15,I=x.browserEvents),"browserLoading"in x&&t(16,O=x.browserLoading),"onBrowserAccept"in x&&t(17,R=x.onBrowserAccept),"onBrowserDismiss"in x&&t(18,D=x.onBrowserDismiss),"onBrowserAttach"in x&&t(19,B=x.onBrowserAttach),"onBrowserRefresh"in x&&t(20,j=x.onBrowserRefresh)},[i,l,o,s,c,u,d,p,h,m,g,b,v,T,N,I,O,R,D,B,j,U,L,M,q,X,z,W,K,Y,F,y,E,A,Z,J,ee,te,le,_e,oe,ze,Ge,Ie,ne,re,Ne,Fe,we,je,xe,Ae,Ve,Ue,Se,He,Oe,Ke,Pe,ue,be]}class n2 extends ut{constructor(e){super(),ct(this,e,t2,e2,at,{todayDashboard:1,suggestions:0,inProgressItems:2,todayCaptures:3,suggestionCount:4,formatTime:5,eventLabel:6,eventIcon:7,inboxMetaText:8,onOpenNodeById:9,onOpenActivityEvent:10,onOpenActivityTarget:11,onOpenSuggestionWorklog:12,onAcceptSuggestion:31,onDeleteSuggestion:32,onOpenNodeFolder:13,onOpenInboxArtifact:14,onOpenTrashNode:33,browserEvents:15,browserLoading:16,onBrowserAccept:17,onBrowserDismiss:18,onBrowserAttach:19,onBrowserRefresh:20},null,[-1,-1,-1])}}function l2(n){let e,t,l,i,o=n[3]&&Ga(n);return{c(){e=f("div"),o&&o.c(),t=w(),l=f("iframe"),r(l,"class","plugin-frame svelte-xgfxht"),r(l,"srcdoc",n[1]),r(l,"sandbox","allow-scripts allow-same-origin"),r(l,"title",i=n[0]+" panel"),r(e,"class","plugin-frame-container svelte-xgfxht")},m(s,c){C(s,e,c),o&&o.m(e,null),a(e,t),a(e,l),n[9](l)},p(s,c){s[3]?o?o.p(s,c):(o=Ga(s),o.c(),o.m(e,t)):o&&(o.d(1),o=null),c&2&&r(l,"srcdoc",s[1]),c&1&&i!==(i=s[0]+" panel")&&r(l,"title",i)},d(s){s&&S(e),o&&o.d(),n[9](null)}}}function i2(n){let e,t,l,i,o,s,c;return{c(){e=f("div"),t=f("p"),l=H("Плагин «"),i=H(n[0]),o=H("» активен, но HTML-панель не настроена."),s=w(),c=f("p"),c.innerHTML='Для отображения контента добавьте поле <code class="svelte-xgfxht">panel</code> в <code class="svelte-xgfxht">plugin.json</code>.',r(c,"class","hint"),r(e,"class","empty-state svelte-xgfxht")},m(u,d){C(u,e,d),a(e,t),a(t,l),a(t,i),a(t,o),a(e,s),a(e,c)},p(u,d){d&1&&Q(i,u[0])},d(u){u&&S(e)}}}function s2(n){let e;return{c(){e=f("p"),e.textContent="Загрузка…",r(e,"class","loading svelte-xgfxht")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Ga(n){let e,t,l;return{c(){e=f("div"),t=H("⚠ "),l=H(n[3]),r(e,"class","plugin-error-bar svelte-xgfxht")},m(i,o){C(i,e,o),a(e,t),a(e,l)},p(i,o){o&8&&Q(l,i[3])},d(i){i&&S(e)}}}function o2(n){let e;function t(o,s){return o[2]?s2:o[1]?l2:i2}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","plugin-page svelte-xgfxht")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:se,o:se,d(o){o&&S(e),i.d()}}}function al(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function r2(n,e,t){let l,i,o,s,{sectionId:c=""}=e,u="",d=!0,p="",h=null,m=[],g=!1;function b(R){console.log("[CalendarPluginPage] postToIframe: iframeReady="+g+", hasEl="+!!h+", hasCW="+!!(h!=null&&h.contentWindow)),h&&h.contentWindow&&g?(console.log("[CalendarPluginPage] postToIframe: sending msg.type="+R.type),h.contentWindow.postMessage(R,"*")):(console.log("[CalendarPluginPage] postToIframe: queuing msg.type="+R.type),m.push(R))}function v(R){if(!h||!h.contentWindow||R.source!==h.contentWindow)return;const D=R.data;if(!(!D||typeof D!="object")&&!(!D.source||typeof D.source!="string")&&!(!D.action||typeof D.action!="string"))switch(D.action){case"ready":for(g=!0;m.length>0;)h.contentWindow.postMessage(m.shift(),"*");y();break;case"get-events":E(D.data);break;case"create-event":T(D.data);break;case"update-event":N(D.data);break;case"delete-event":A(D.data);break;default:console.log("[CalendarPluginPage] Unknown iframe action:",D.action)}}async function y(){try{console.log("[CalendarPluginPage] loadCalendarData: step 1");const R=new Date,D=R.getFullYear(),B=R.getMonth(),j=new Date(D,B,1).toISOString().slice(0,10)+"T00:00:00",U=new Date(D,B+1,0).toISOString().slice(0,10)+"T23:59:59";console.log("[CalendarPluginPage] loadCalendarData: step 2, start="+j+", end="+U),console.log("[CalendarPluginPage] loadCalendarData: step 3, calling get_events...");const z=al("CallPluginFunction",i,s+"get_events",JSON.stringify({start:j,end:U}));console.log("[CalendarPluginPage] loadCalendarData: step 4, calling get_categories...");const W=al("CallPluginFunction",i,s+"get_categories","{}");console.log("[CalendarPluginPage] loadCalendarData: step 5, awaiting Promise.all...");const[K,Y]=await Promise.all([z,W]);console.log("[CalendarPluginPage] loadCalendarData: step 6, got results, eventsRaw="+typeof K+", categoriesRaw="+typeof Y);const F=K?JSON.parse(K):[],L=Y?JSON.parse(Y):[];b({source:"verstak",type:"calendar-data",events:F,categories:L});try{window.go.main.App.WriteDebugLog("[CalendarPluginPage] calendar-data sent to iframe, events.len="+F.length+", categories.len="+((L==null?void 0:L.length)||0)+", typeof events="+typeof F+", typeof eventsRaw="+typeof K+", eventsRaw.length="+K.length+", eventsRaw.substr(0,10)="+String(K).substring(0,10))}catch{}}catch(R){console.error("[CalendarPluginPage] loadCalendarData:",R),console.log("[CalendarPluginPage] error details:",JSON.stringify({message:String(R),stack:R==null?void 0:R.stack})),t(3,p=String(R))}}async function E(R){try{const D=JSON.stringify({start:R.start,end:R.end}),B=await al("CallPluginFunction",i,s+"get_events",D),j=B?JSON.parse(B):[];b({source:"verstak",type:"calendar-data",events:j})}catch(D){console.error("[CalendarPluginPage] get-events:",D)}}async function T(R){try{const D=JSON.stringify(R),B=await al("CallPluginFunction",i,s+"create_event",D),j=B?JSON.parse(B):{};b({source:"verstak",type:"event-created",event:j}),y()}catch(D){console.error("[CalendarPluginPage] create-event:",D),b({source:"verstak",type:"error",message:String(D)})}}async function N(R){try{const D=JSON.stringify(R);await al("CallPluginFunction",i,s+"update_event",D),b({source:"verstak",type:"event-updated",event:R}),y()}catch(D){console.error("[CalendarPluginPage] update-event:",D)}}async function A(R){try{const D=JSON.stringify({id:R.id});await al("CallPluginFunction",i,s+"delete_event",D),b({source:"verstak",type:"event-deleted",id:R.id}),y()}catch(D){console.error("[CalendarPluginPage] delete-event:",D)}}li(async()=>{try{t(1,u=await al("GetPluginPanelHTML",i)||"")}catch(R){t(3,p=String(R))}t(2,d=!1),window.addEventListener("message",v)}),ii(()=>{window.removeEventListener("message",v)});function I(R,D){b({source:"verstak",type:"drop",date:D,data:R})}function O(R){In[R?"unshift":"push"](()=>{h=R,t(4,h)})}return n.$$set=R=>{"sectionId"in R&&t(5,c=R.sectionId)},n.$$.update=()=>{n.$$.dirty&32&&t(8,l=c.split(":")),n.$$.dirty&256&&t(0,i=l[1]||""),n.$$.dirty&256&&t(7,o=l[2]||"main"),n.$$.dirty&128&&o.charAt(0).toUpperCase()+o.slice(1),n.$$.dirty&1&&(s=i?i+".":"")},[i,u,d,p,h,c,I,o,l,O]}class a2 extends ut{constructor(e){super(),ct(this,e,r2,o2,at,{sectionId:5,handleDrop:6})}get handleDrop(){return this.$$.ctx[6]}}const Bd={й:"q",ц:"w",у:"e",к:"r",е:"t",н:"y",г:"u",ш:"i",щ:"o",з:"p",х:"[",ъ:"]",ф:"a",ы:"s",в:"d",а:"f",п:"g",р:"h",о:"j",л:"k",д:"l",ж:";",э:"'",я:"z",ч:"x",с:"c",м:"v",и:"b",т:"n",ь:"m",ю:",",ё:"`",Й:"Q",Ц:"W",У:"E",К:"R",Е:"T",Н:"Y",Г:"U",Ш:"I",Щ:"O",З:"P",Х:"{",Ъ:"}",Ф:"A",Ы:"S",В:"D",А:"F",П:"G",Р:"H",О:"J",Л:"K",Д:"L",Ж:":",Э:'"',Я:"Z",Ч:"X",С:"C",М:"V",И:"B",Т:"N",Ь:"M",Ю:"<",Ё:"~"},Fd={};for(const[n,e]of Object.entries(Bd))Fd[e]=n;function jd(n,e){let t="";for(const l of n)t+=e[l]??l;return t}function c2(n){return jd(n,Bd)}function u2(n){return jd(n,Fd)}function Ud(n){const e=new Set;e.add(n);const t=c2(n);t!==n&&e.add(t);const l=u2(n);l!==n&&e.add(l);const i=new Set;for(const o of e)i.add(o.toLowerCase());for(const o of i)e.add(o);return Array.from(e)}function Ka(n,e,t){const l=n.slice();return l[25]=e[t],l[27]=t,l}function Va(n){let e;function t(o,s){return o[3]?p2:o[1].length===0?d2:f2}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","global-search-results svelte-1dlr37h")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},d(o){o&&S(e),i.d()}}}function f2(n){let e,t=Te(n[1]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Xa(Ka(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=kt()},m(i,o){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,o);C(i,e,o)},p(i,o){if(o&338){t=Te(i[1]);let s;for(s=0;s<t.length;s+=1){const c=Ka(i,t,s);l[s]?l[s].p(c,o):(l[s]=Xa(c),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function d2(n){let e;return{c(){e=f("div"),e.textContent=`${k("search.noResults")}`,r(e,"class","global-search-empty svelte-1dlr37h")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function p2(n){let e;return{c(){e=f("div"),e.textContent=`${k("common.loading")}`,r(e,"class","global-search-empty svelte-1dlr37h")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Za(n){let e,t=n[6](n[25])+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","global-search-meta svelte-1dlr37h")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&2&&t!==(t=i[6](i[25])+"")&&Q(l,t)},d(i){i&&S(e)}}}function Ya(n){let e,t=n[25].snippet+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","global-search-snippet svelte-1dlr37h")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&2&&t!==(t=i[25].snippet+"")&&Q(l,t)},d(i){i&&S(e)}}}function Xa(n){let e,t,l=n[25].title+"",i,o,s=n[6](n[25]),c,u,d,p,h=s&&Za(n),m=n[25].snippet&&Ya(n);function g(){return n[17](n[25])}return{c(){e=f("button"),t=f("span"),i=H(l),o=w(),h&&h.c(),c=w(),m&&m.c(),u=w(),r(t,"class","global-search-title svelte-1dlr37h"),r(e,"class","global-search-result svelte-1dlr37h"),ce(e,"selected",n[27]===n[4])},m(b,v){C(b,e,v),a(e,t),a(t,i),a(e,o),h&&h.m(e,null),a(e,c),m&&m.m(e,null),a(e,u),d||(p=P(e,"mousedown",ji(g)),d=!0)},p(b,v){n=b,v&2&&l!==(l=n[25].title+"")&&Q(i,l),v&2&&(s=n[6](n[25])),s?h?h.p(n,v):(h=Za(n),h.c(),h.m(e,c)):h&&(h.d(1),h=null),n[25].snippet?m?m.p(n,v):(m=Ya(n),m.c(),m.m(e,u)):m&&(m.d(1),m=null),v&16&&ce(e,"selected",n[27]===n[4])},d(b){b&&S(e),h&&h.d(),m&&m.d(),d=!1,p()}}}function h2(n){let e,t,l,i,o,s=n[2]&&Va(n);return{c(){e=f("div"),t=f("input"),l=w(),s&&s.c(),r(t,"class","global-search-input svelte-1dlr37h"),r(t,"type","search"),r(t,"placeholder",k("search.placeholder")),r(t,"aria-label",k("search.placeholder")),r(t,"autocomplete","off"),r(e,"class","global-search svelte-1dlr37h")},m(c,u){C(c,e,u),a(e,t),n[13](t),Me(t,n[0]),a(e,l),s&&s.m(e,null),i||(o=[P(t,"input",n[14]),P(t,"input",n[9]),P(t,"focus",n[15]),P(t,"keydown",n[10]),P(t,"blur",n[16])],i=!0)},p(c,[u]){u&1&&t.value!==c[0]&&Me(t,c[0]),c[2]?s?s.p(c,u):(s=Va(c),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i:se,o:se,d(c){c&&S(e),n[13](null),s&&s.d(),i=!1,Ce(o)}}}function Hd(n){return String(n||"").trim()}function m2(n){return Hd(n.path)}function g2(n){return!n||!(n instanceof Element)?!1:!!n.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')}function _2(n,e,t){let{wailsCall:l=async()=>[]}=e,{typeLabel:i=z=>z||""}=e;const o=pn();let s="",c=[],u=!1,d=!1,p=0,h,m;function g(z){const W=[],K=i(z.type),Y=m2(z);return K&&W.push(K),Y&&W.push(Y),W.join(" · ")}async function b(){const z=Hd(s);if(z.length<2){t(1,c=[]),t(2,u=!1),t(3,d=!1);return}t(3,d=!0);try{const W=Ud(z),K=new Set,Y=[];for(const M of W)K.has(M)||(K.add(M),Y.push(M));const F=await Promise.all(Y.map(M=>l("Search",M).catch(()=>[]))),L=new Map;for(let M=0;M<F.length;M++){const q=F[M]||[];for(const X of q){const Z=X.type+":"+X.nodeId+":"+(X.targetId||"")+":"+X.title;L.has(Z)||L.set(Z,X)}}t(1,c=Array.from(L.values())),t(4,p=0),t(2,u=c.length>0)}catch{t(1,c=[]),t(2,u=!1)}finally{t(3,d=!1)}}function v(){clearTimeout(m),m=setTimeout(b,180)}function y(){t(2,u=!1),t(4,p=0)}function E(){t(0,s=""),t(1,c=[]),y()}function T(z){z&&(o("open",z),E(),h==null||h.blur())}function N(){v()}function A(z){if(z.key==="Escape"){z.preventDefault(),E(),h==null||h.blur();return}!u||c.length===0||(z.key==="ArrowDown"?(z.preventDefault(),t(4,p=Math.min(c.length-1,p+1))):z.key==="ArrowUp"?(z.preventDefault(),t(4,p=Math.max(0,p-1))):z.key==="Enter"&&(z.preventDefault(),T(c[p])))}async function I(){await fg(),h==null||h.focus(),h==null||h.select()}function O(z){if((z.ctrlKey||z.metaKey)&&z.key.toLowerCase()==="k"){z.preventDefault(),I();return}z.key==="/"&&!g2(z.target)&&(z.preventDefault(),I())}li(()=>{window.addEventListener("keydown",O)}),ii(()=>{window.removeEventListener("keydown",O),clearTimeout(m)});function R(z){In[z?"unshift":"push"](()=>{h=z,t(5,h)})}function D(){s=this.value,t(0,s)}const B=()=>{c.length>0&&t(2,u=!0)},j=()=>setTimeout(y,160),U=z=>T(z);return n.$$set=z=>{"wailsCall"in z&&t(11,l=z.wailsCall),"typeLabel"in z&&t(12,i=z.typeLabel)},[s,c,u,d,p,h,g,y,T,N,A,l,i,R,D,B,j,U]}class b2 extends ut{constructor(e){super(),ct(this,e,_2,h2,at,{wailsCall:11,typeLabel:12})}}const k2=n=>({}),Ja=n=>({});function Qa(n){let e,t;return{c(){e=f("span"),t=H(n[1]),r(e,"class","header-subtitle svelte-7x8q9h")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&2&&Q(t,l[1])},d(l){l&&S(e)}}}function v2(n){let e,t,l,i=(n[0]||"")+"",o,s,c,u,d,p,h,m=n[1]&&Qa(n);d=new b2({props:{wailsCall:n[2],typeLabel:n[3]}}),d.$on("open",n[7]);const g=n[6].actions,b=sg(g,n,n[5],Ja);return{c(){e=f("header"),t=f("div"),l=f("span"),o=H(i),s=w(),m&&m.c(),c=w(),u=f("div"),Qe(d.$$.fragment),p=w(),b&&b.c(),r(l,"class","header-title svelte-7x8q9h"),ce(l,"placeholder",!n[0]),r(t,"class","header-left svelte-7x8q9h"),r(u,"class","header-right svelte-7x8q9h"),r(e,"class","header svelte-7x8q9h")},m(v,y){C(v,e,y),a(e,t),a(t,l),a(l,o),a(t,s),m&&m.m(t,null),a(e,c),a(e,u),Ye(d,u,null),a(u,p),b&&b.m(u,null),h=!0},p(v,[y]){(!h||y&1)&&i!==(i=(v[0]||"")+"")&&Q(o,i),(!h||y&1)&&ce(l,"placeholder",!v[0]),v[1]?m?m.p(v,y):(m=Qa(v),m.c(),m.m(t,null)):m&&(m.d(1),m=null);const E={};y&4&&(E.wailsCall=v[2]),y&8&&(E.typeLabel=v[3]),d.$set(E),b&&b.p&&(!h||y&32)&&rg(b,g,v,v[5],h?og(g,v[5],y,k2):ag(v[5]),Ja)},i(v){h||(ge(d.$$.fragment,v),ge(b,v),h=!0)},o(v){ke(d.$$.fragment,v),ke(b,v),h=!1},d(v){v&&S(e),m&&m.d(),Xe(d),b&&b.d(v)}}}function w2(n,e,t){let{$$slots:l={},$$scope:i}=e,{title:o=""}=e,{subtitle:s=""}=e,{wailsCall:c=async()=>[]}=e,{typeLabel:u=h=>h||""}=e,{onOpenSearchResult:d=()=>{}}=e;const p=h=>d(h.detail);return n.$$set=h=>{"title"in h&&t(0,o=h.title),"subtitle"in h&&t(1,s=h.subtitle),"wailsCall"in h&&t(2,c=h.wailsCall),"typeLabel"in h&&t(3,u=h.typeLabel),"onOpenSearchResult"in h&&t(4,d=h.onOpenSearchResult),"$$scope"in h&&t(5,i=h.$$scope)},[o,s,c,u,d,i,l,p]}class y2 extends ut{constructor(e){super(),ct(this,e,w2,v2,at,{title:0,subtitle:1,wailsCall:2,typeLabel:3,onOpenSearchResult:4})}}const E2={open:'<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',showInExplorer:'<path d="M3 6.5A2.5 2.5 0 0 1 5.5 4H9l2 2h8.5A2.5 2.5 0 0 1 22 8.5v8A2.5 2.5 0 0 1 19.5 19h-15A2.5 2.5 0 0 1 2 16.5v-10"/><path d="M12 11h6"/><path d="m15 8 3 3-3 3"/>',delete:'<polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14H6L5 6"/><path d="M10 11v6"/><path d="M14 11v6"/><path d="M9 6V4h6v2"/>',restore:'<path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-15-6.7L3 13"/><path d="M12 12v5"/><path d="m9 14 3-3 3 3"/>',purge:'<path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="m9 11 6 6"/><path d="m15 11-6 6"/><path d="M6 6l1 14h10l1-14"/>',move:'<path d="M5 9V5h4"/><path d="m5 5 6 6"/><path d="M19 15v4h-4"/><path d="m19 19-6-6"/><path d="M19 5h-4"/><path d="M19 5v4"/><path d="m14 10 5-5"/><path d="M5 19h4"/><path d="M5 19v-4"/><path d="m10 14-5 5"/>',attach:'<path d="M21.44 11.05 12 20.49a6 6 0 0 1-8.49-8.49l9.44-9.44a4 4 0 1 1 5.66 5.66L9.17 17.66a2 2 0 1 1-2.83-2.83l8.49-8.48"/>',back:'<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',emptyTrash:'<path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M6 6l1 14h10l1-14"/><path d="M10 11v5"/><path d="M14 11v5"/>',folder:'<path d="M3 6.5A2.5 2.5 0 0 1 5.5 4H9l2 2h8.5A2.5 2.5 0 0 1 22 8.5v8A2.5 2.5 0 0 1 19.5 19h-15A2.5 2.5 0 0 1 2 16.5v-10"/>'};function Tt(n,e=16){return`<svg width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${E2[n]||""}</svg>`}function T2(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M,q,X,Z,J;return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),i.innerHTML='<span class="md-btn-label md-btn-bold svelte-1etjgc1">B</span>',o=w(),s=f("button"),s.innerHTML='<span class="md-btn-label md-btn-italic svelte-1etjgc1">I</span>',c=w(),u=f("button"),u.innerHTML='<span class="md-btn-label svelte-1etjgc1">H</span>',d=w(),p=f("div"),h=w(),m=f("div"),g=f("button"),g.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="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>',b=w(),v=f("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"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>',y=w(),E=f("button"),T=f("span"),T.textContent="</>",N=w(),A=f("div"),I=w(),O=f("div"),R=f("button"),R.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',D=w(),B=f("button"),B.innerHTML='<span class="md-btn-label md-btn-sm svelte-1etjgc1">1.</span>',j=w(),U=f("button"),U.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="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg>',z=w(),W=f("button"),W.innerHTML='<span class="md-btn-label md-btn-sm md-btn-quote svelte-1etjgc1">"</span>',K=w(),Y=f("div"),F=w(),L=f("div"),M=f("button"),M.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="12" cy="12" r="3"></circle><path d="M12 2v2"></path><path d="M12 20v2"></path><path d="M4.93 4.93l1.41 1.41"></path><path d="M17.66 17.66l1.41 1.41"></path><path d="M2 12h2"></path><path d="M20 12h2"></path><path d="M6.34 17.66l-1.41 1.41"></path><path d="M19.07 4.93l-1.41 1.41"></path></svg>',q=w(),X=f("textarea"),r(i,"type","button"),r(i,"class","md-toolbar-btn svelte-1etjgc1"),r(i,"title",k("note.toolbar.bold")),r(i,"aria-label",k("note.toolbar.bold")),r(s,"type","button"),r(s,"class","md-toolbar-btn svelte-1etjgc1"),r(s,"title",k("note.toolbar.italic")),r(s,"aria-label",k("note.toolbar.italic")),r(u,"type","button"),r(u,"class","md-toolbar-btn svelte-1etjgc1"),r(u,"title",k("note.toolbar.heading")),r(u,"aria-label",k("note.toolbar.heading")),r(l,"class","md-toolbar-group svelte-1etjgc1"),r(p,"class","md-toolbar-sep svelte-1etjgc1"),r(g,"type","button"),r(g,"class","md-toolbar-btn svelte-1etjgc1"),r(g,"title",k("note.toolbar.link")),r(g,"aria-label",k("note.toolbar.link")),r(v,"type","button"),r(v,"class","md-toolbar-btn svelte-1etjgc1"),r(v,"title",k("note.toolbar.code")),r(v,"aria-label",k("note.toolbar.code")),r(T,"class","md-btn-label md-btn-sm svelte-1etjgc1"),r(E,"type","button"),r(E,"class","md-toolbar-btn svelte-1etjgc1"),r(E,"title",k("note.toolbar.codeBlock")),r(E,"aria-label",k("note.toolbar.codeBlock")),r(m,"class","md-toolbar-group svelte-1etjgc1"),r(A,"class","md-toolbar-sep svelte-1etjgc1"),r(R,"type","button"),r(R,"class","md-toolbar-btn svelte-1etjgc1"),r(R,"title",k("note.toolbar.bulletList")),r(R,"aria-label",k("note.toolbar.bulletList")),r(B,"type","button"),r(B,"class","md-toolbar-btn svelte-1etjgc1"),r(B,"title",k("note.toolbar.numberedList")),r(B,"aria-label",k("note.toolbar.numberedList")),r(U,"type","button"),r(U,"class","md-toolbar-btn svelte-1etjgc1"),r(U,"title",k("note.toolbar.checkbox")),r(U,"aria-label",k("note.toolbar.checkbox")),r(W,"type","button"),r(W,"class","md-toolbar-btn svelte-1etjgc1"),r(W,"title",k("note.toolbar.quote")),r(W,"aria-label",k("note.toolbar.quote")),r(O,"class","md-toolbar-group svelte-1etjgc1"),r(Y,"class","md-toolbar-sep svelte-1etjgc1"),r(M,"type","button"),r(M,"class","md-toolbar-btn md-toolbar-btn--internal svelte-1etjgc1"),r(M,"title",k("note.toolbar.internalLink")),r(M,"aria-label",k("note.toolbar.internalLink")),r(L,"class","md-toolbar-group svelte-1etjgc1"),r(t,"class","md-toolbar svelte-1etjgc1"),r(t,"role","toolbar"),r(t,"aria-label","Markdown formatting"),r(X,"class","md-textarea svelte-1etjgc1"),r(X,"placeholder",n[2]),r(X,"spellcheck","true"),r(e,"class","md-editor svelte-1etjgc1"),ce(e,"mode-edit",n[1]==="edit"||n[1]==="split")},m(ee,te){C(ee,e,te),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(l,c),a(l,u),a(t,d),a(t,p),a(t,h),a(t,m),a(m,g),a(m,b),a(m,v),a(m,y),a(m,E),a(E,T),a(t,N),a(t,A),a(t,I),a(t,O),a(O,R),a(O,D),a(O,B),a(O,j),a(O,U),a(O,z),a(O,W),a(t,K),a(t,Y),a(t,F),a(t,L),a(L,M),a(e,q),a(e,X),Me(X,n[0]),n[19](X),Z||(J=[P(i,"click",n[4]),P(s,"click",n[5]),P(u,"click",n[8]),P(g,"click",n[7]),P(v,"click",n[6]),P(E,"click",n[13]),P(R,"click",n[10]),P(B,"click",n[11]),P(U,"click",n[12]),P(W,"click",n[9]),P(M,"click",n[14]),P(X,"input",n[18]),P(X,"input",n[15]),P(X,"keydown",n[16])],Z=!0)},p(ee,[te]){te&4&&r(X,"placeholder",ee[2]),te&1&&Me(X,ee[0]),te&2&&ce(e,"mode-edit",ee[1]==="edit"||ee[1]==="split")},i:se,o:se,d(ee){ee&&S(e),n[19](null),Z=!1,Ce(J)}}}function S2(n,e,t){let{content:l=""}=e,{viewMode:i="edit"}=e,{placeholder:o=""}=e;const s=pn();let c;function u(j){const U=c;if(!U)return;const z=U.selectionStart,W=U.selectionEnd,K=l.substring(0,z),Y=l.substring(W),F=K+j+Y;t(0,l=F),s("content-change",{content:F}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=U.selectionEnd=z+j.length})}function d(j,U="",z=""){const W=c;if(!W)return;const K=W.selectionStart,Y=W.selectionEnd,F=l.substring(K,Y),M=j+(F||z)+U,q=l.substring(0,K)+M+l.substring(Y);t(0,l=q),s("content-change",{content:q}),requestAnimationFrame(()=>{W.focus(),F?(W.selectionStart=K+j.length,W.selectionEnd=K+j.length+F.length):(W.selectionStart=K+j.length,W.selectionEnd=K+j.length+z.length)})}function p(j){const U=c;if(!U)return;const z=U.selectionStart,W=U.selectionEnd;let K=z;for(;K>0&&l[K-1]!==`
|
||
`;)K--;let Y=W;for(;Y<l.length&&l[Y]!==`
|
||
`;)Y++;const q=l.substring(K,Y).split(`
|
||
`).map(Z=>Z.startsWith(j)?Z:j+Z).join(`
|
||
`),X=l.substring(0,K)+q+l.substring(Y);t(0,l=X),s("content-change",{content:X}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=K,U.selectionEnd=K+q.length})}function h(){d("**","**","bold text")}function m(){d("*","*","italic text")}function g(){d("`","`","code")}function b(){s("insert-link")}function v(){p("## ")}function y(){p("> ")}function E(){p("- ")}function T(){const j=c;if(!j)return;let z=j.selectionStart;for(;z>0&&l[z-1]!==`
|
||
`;)z--;let W=j.selectionEnd;for(;W<l.length&&l[W]!==`
|
||
`;)W++;const Y=l.substring(z,W).split(`
|
||
`);let F=1;const M=Y.map(X=>{const Z=X.trim();return X.replace(/^\s*\d+\.\s*/,""),`${F++}. ${Z||"item"}`}).join(`
|
||
`),q=l.substring(0,z)+M+l.substring(W);t(0,l=q),s("content-change",{content:q}),requestAnimationFrame(()=>{j.focus(),j.selectionStart=z,j.selectionEnd=z+M.length})}function N(){p("- [ ] ")}function A(){const j=c;if(!j)return;const U=j.selectionStart,z=j.selectionEnd,W=l.substring(U,z),K=W?"```\n"+W+"\n```":"```\ncode here\n```",Y=l.substring(0,U)+K+l.substring(z);t(0,l=Y),s("content-change",{content:Y}),requestAnimationFrame(()=>{j.focus(),W?(j.selectionStart=U+4,j.selectionEnd=U+4+W.length):(j.selectionStart=U+4,j.selectionEnd=U+4+9)})}function I(){s("insert-internal-link")}function O(j){t(0,l=j.target.value),s("content-change",{content:l})}function R(j){if((j.ctrlKey||j.metaKey)&&j.key==="s"){j.preventDefault(),s("save");return}if(j.key==="Tab"){j.preventDefault();const U=j.target,z=U.selectionStart,W=U.selectionEnd;if(j.shiftKey){let K=z;for(;K>0&&l[K-1]!==`
|
||
`;)K--;let Y=W;for(;Y<l.length&&l[Y]!==`
|
||
`;)Y++;const L=l.substring(K,Y).replace(/^ {1,2}/gm,""),M=l.substring(0,K)+L+l.substring(Y);t(0,l=M),s("content-change",{content:M}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=K,U.selectionEnd=K+L.length})}else if(z===W){const K=l.substring(0,z)+" "+l.substring(W);t(0,l=K),s("content-change",{content:K}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=U.selectionEnd=z+2})}else{let K=z;for(;K>0&&l[K-1]!==`
|
||
`;)K--;let Y=W;for(;Y<l.length&&l[Y]!==`
|
||
`;)Y++;const L=l.substring(K,Y).replace(/^/gm," "),M=l.substring(0,K)+L+l.substring(Y);t(0,l=M),s("content-change",{content:M}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=K,U.selectionEnd=K+L.length})}}}function D(){l=this.value,t(0,l)}function B(j){In[j?"unshift":"push"](()=>{c=j,t(3,c)})}return n.$$set=j=>{"content"in j&&t(0,l=j.content),"viewMode"in j&&t(1,i=j.viewMode),"placeholder"in j&&t(2,o=j.placeholder)},[l,i,o,c,h,m,g,b,v,y,E,T,N,A,I,O,R,u,D,B]}class Wd extends ut{constructor(e){super(),ct(this,e,S2,T2,at,{content:0,viewMode:1,placeholder:2,insertText:17})}get insertText(){return this.$$.ctx[17]}}function C2(n){let e,t,l,i,o,s,c,u={content:n[0],placeholder:n[2],viewMode:"split"};return l=new Wd({props:u}),n[15](l),l.$on("content-change",n[5]),l.$on("save",n[6]),l.$on("insert-link",n[7]),l.$on("insert-internal-link",n[8]),s=new Ys({props:{content:n[0]}}),s.$on("verstak-link",n[9]),{c(){e=f("div"),t=f("div"),Qe(l.$$.fragment),i=w(),o=f("div"),Qe(s.$$.fragment),r(t,"class","split-editor svelte-8tdyp9"),r(o,"class","split-preview svelte-8tdyp9"),r(e,"class","split-pane svelte-8tdyp9")},m(d,p){C(d,e,p),a(e,t),Ye(l,t,null),a(e,i),a(e,o),Ye(s,o,null),c=!0},p(d,p){const h={};p&1&&(h.content=d[0]),p&4&&(h.placeholder=d[2]),l.$set(h);const m={};p&1&&(m.content=d[0]),s.$set(m)},i(d){c||(ge(l.$$.fragment,d),ge(s.$$.fragment,d),c=!0)},o(d){ke(l.$$.fragment,d),ke(s.$$.fragment,d),c=!1},d(d){d&&S(e),n[15](null),Xe(l),Xe(s)}}}function A2(n){let e,t,l;return t=new Ys({props:{content:n[0]}}),t.$on("verstak-link",n[9]),{c(){e=f("div"),Qe(t.$$.fragment),r(e,"class","preview-pane svelte-8tdyp9")},m(i,o){C(i,e,o),Ye(t,e,null),l=!0},p(i,o){const s={};o&1&&(s.content=i[0]),t.$set(s)},i(i){l||(ge(t.$$.fragment,i),l=!0)},o(i){ke(t.$$.fragment,i),l=!1},d(i){i&&S(e),Xe(t)}}}function N2(n){let e,t,l={content:n[0],placeholder:n[2],viewMode:"edit"};return e=new Wd({props:l}),n[14](e),e.$on("content-change",n[5]),e.$on("save",n[6]),e.$on("insert-link",n[7]),e.$on("insert-internal-link",n[8]),{c(){Qe(e.$$.fragment)},m(i,o){Ye(e,i,o),t=!0},p(i,o){const s={};o&1&&(s.content=i[0]),o&4&&(s.placeholder=i[2]),e.$set(s)},i(i){t||(ge(e.$$.fragment,i),t=!0)},o(i){ke(e.$$.fragment,i),t=!1},d(i){n[14](null),Xe(e,i)}}}function I2(n){let e,t,l,i=k("note.mode.edit")+"",o,s,c,u,d=k("note.mode.preview")+"",p,h,m,g,b=k("note.mode.split")+"",v,y,E,T,N,A,I,O,R;const D=[N2,A2,C2],B=[];function j(U,z){return U[1]==="edit"?0:U[1]==="preview"?1:U[1]==="split"?2:-1}return~(N=j(n))&&(A=B[N]=D[N](n)),{c(){e=f("div"),t=f("div"),l=f("button"),o=H(i),c=w(),u=f("button"),p=H(d),m=w(),g=f("button"),v=H(b),E=w(),T=f("div"),A&&A.c(),r(l,"type","button"),r(l,"class","mode-btn svelte-8tdyp9"),r(l,"role","tab"),r(l,"aria-selected",s=n[1]==="edit"),ce(l,"active",n[1]==="edit"),r(u,"type","button"),r(u,"class","mode-btn svelte-8tdyp9"),r(u,"role","tab"),r(u,"aria-selected",h=n[1]==="preview"),ce(u,"active",n[1]==="preview"),r(g,"type","button"),r(g,"class","mode-btn svelte-8tdyp9"),r(g,"role","tab"),r(g,"aria-selected",y=n[1]==="split"),ce(g,"active",n[1]==="split"),r(t,"class","mode-switcher svelte-8tdyp9"),r(t,"role","tablist"),r(t,"aria-label","Note view mode"),r(T,"class","panel-content svelte-8tdyp9"),r(e,"class","note-editor-panel svelte-8tdyp9"),ce(e,"mode-edit",n[1]==="edit"),ce(e,"mode-preview",n[1]==="preview"),ce(e,"mode-split",n[1]==="split")},m(U,z){C(U,e,z),a(e,t),a(t,l),a(l,o),a(t,c),a(t,u),a(u,p),a(t,m),a(t,g),a(g,v),a(e,E),a(e,T),~N&&B[N].m(T,null),I=!0,O||(R=[P(l,"click",n[11]),P(u,"click",n[12]),P(g,"click",n[13])],O=!0)},p(U,[z]){(!I||z&2&&s!==(s=U[1]==="edit"))&&r(l,"aria-selected",s),(!I||z&2)&&ce(l,"active",U[1]==="edit"),(!I||z&2&&h!==(h=U[1]==="preview"))&&r(u,"aria-selected",h),(!I||z&2)&&ce(u,"active",U[1]==="preview"),(!I||z&2&&y!==(y=U[1]==="split"))&&r(g,"aria-selected",y),(!I||z&2)&&ce(g,"active",U[1]==="split");let W=N;N=j(U),N===W?~N&&B[N].p(U,z):(A&&(yt(),ke(B[W],1,1,()=>{B[W]=null}),Et()),~N?(A=B[N],A?A.p(U,z):(A=B[N]=D[N](U),A.c()),ge(A,1),A.m(T,null)):A=null),(!I||z&2)&&ce(e,"mode-edit",U[1]==="edit"),(!I||z&2)&&ce(e,"mode-preview",U[1]==="preview"),(!I||z&2)&&ce(e,"mode-split",U[1]==="split")},i(U){I||(ge(A),I=!0)},o(U){ke(A),I=!1},d(U){U&&S(e),~N&&B[N].d(),O=!1,Ce(R)}}}function R2(n,e,t){let{content:l=""}=e,{viewMode:i="edit"}=e,{placeholder:o=""}=e;const s=pn();let c;function u(A){s("mode-change",{mode:A})}function d(A){t(0,l=A.detail.content),s("content-change",A.detail)}function p(){s("save")}function h(){s("insert-link")}function m(){s("insert-internal-link")}function g(A){s("verstak-link",A.detail)}function b(A){c&&typeof c.insertText=="function"&&c.insertText(A)}const v=()=>u("edit"),y=()=>u("preview"),E=()=>u("split");function T(A){In[A?"unshift":"push"](()=>{c=A,t(3,c)})}function N(A){In[A?"unshift":"push"](()=>{c=A,t(3,c)})}return n.$$set=A=>{"content"in A&&t(0,l=A.content),"viewMode"in A&&t(1,i=A.viewMode),"placeholder"in A&&t(2,o=A.placeholder)},[l,i,o,c,u,d,p,h,m,g,b,v,y,E,T,N]}class M2 extends ut{constructor(e){super(),ct(this,e,R2,I2,at,{content:0,viewMode:1,placeholder:2,insertText:10})}get insertText(){return this.$$.ctx[10]}}function xa(n,e,t){const l=n.slice();return l[25]=e[t],l[27]=t,l}function $a(n,e,t){const l=n.slice();return l[28]=e[t],l}function ec(n){let e,t,l,i,o,s,c,u,d,p,h,m,g=Te(n[10]),b=[];for(let T=0;T<g.length;T+=1)b[T]=tc($a(n,g,T));function v(T,N){return T[2]==="secret"?O2:L2}let y=v(n),E=y(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("input"),o=w(),s=f("div");for(let T=0;T<b.length;T+=1)b[T].c();c=w(),E.c(),u=w(),d=f("div"),p=f("button"),p.textContent="Отмена",r(i,"type","text"),r(i,"placeholder","Поиск..."),r(i,"class","picker-search-input svelte-12kipyi"),r(i,"autocomplete","off"),r(l,"class","picker-header svelte-12kipyi"),r(s,"class","picker-types svelte-12kipyi"),r(s,"role","tablist"),r(s,"aria-label","Тип объекта"),r(p,"type","button"),r(p,"class","btn"),r(d,"class","picker-footer svelte-12kipyi"),r(t,"class","picker-modal svelte-12kipyi"),r(t,"role","dialog"),r(t,"aria-modal","true"),r(t,"aria-label","Выбрать объект"),r(e,"class","picker-modal-overlay svelte-12kipyi")},m(T,N){C(T,e,N),a(e,t),a(t,l),a(l,i),n[15](i),Me(i,n[3]),a(t,o),a(t,s);for(let A=0;A<b.length;A+=1)b[A]&&b[A].m(s,null);a(t,c),E.m(t,null),a(t,u),a(t,d),a(d,p),h||(m=[P(i,"input",n[16]),P(i,"input",n[11]),P(i,"keydown",n[12]),P(p,"click",n[19]),P(e,"click",xt(n[20])),P(e,"keydown",n[21])],h=!0)},p(T,N){if(N&8&&i.value!==T[3]&&Me(i,T[3]),N&17412){g=Te(T[10]);let A;for(A=0;A<g.length;A+=1){const I=$a(T,g,A);b[A]?b[A].p(I,N):(b[A]=tc(I),b[A].c(),b[A].m(s,null))}for(;A<b.length;A+=1)b[A].d(1);b.length=g.length}y===(y=v(T))&&E?E.p(T,N):(E.d(1),E=y(T),E&&(E.c(),E.m(t,u)))},d(T){T&&S(e),n[15](null),et(b,T),E.d(),h=!1,Ce(m)}}}function tc(n){let e,t=n[28].label+"",l,i,o,s,c;function u(){return n[17](n[28])}return{c(){e=f("button"),l=H(t),i=w(),r(e,"type","button"),r(e,"class","picker-type-btn svelte-12kipyi"),r(e,"role","tab"),r(e,"aria-selected",o=n[2]===n[28].id),e.disabled=n[28].id==="secret",ce(e,"active",n[2]===n[28].id),ce(e,"disabled",n[28].id==="secret")},m(d,p){C(d,e,p),a(e,l),a(e,i),s||(c=P(e,"click",u),s=!0)},p(d,p){n=d,p&4&&o!==(o=n[2]===n[28].id)&&r(e,"aria-selected",o),p&1028&&ce(e,"active",n[2]===n[28].id)},d(d){d&&S(e),s=!1,c()}}}function L2(n){let e,t;function l(s,c){return c&168&&(t=null),s[7]?z2:s[8]?q2:(t==null&&(t=s[3].trim().length>=2&&s[5].length===0&&!s[7]),t?P2:D2)}let i=l(n,-1),o=i(n);return{c(){e=f("div"),o.c(),r(e,"class","picker-results svelte-12kipyi"),r(e,"role","listbox")},m(s,c){C(s,e,c),o.m(e,null)},p(s,c){i===(i=l(s,c))&&o?o.p(s,c):(o.d(1),o=i(s),o&&(o.c(),o.m(e,null)))},d(s){s&&S(e),o.d()}}}function O2(n){let e;return{c(){e=f("div"),e.innerHTML="<p>🔒 Сейф доступов ещё не реализован</p>",r(e,"class","picker-secret-placeholder svelte-12kipyi")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function D2(n){let e,t=Te(n[5]),l=[];for(let i=0;i<t.length;i+=1)l[i]=lc(xa(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=kt()},m(i,o){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,o);C(i,e,o)},p(i,o){if(o&8288){t=Te(i[5]);let s;for(s=0;s<t.length;s+=1){const c=xa(i,t,s);l[s]?l[s].p(c,o):(l[s]=lc(c),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function P2(n){let e,t=n[4].length>0?"Нет результатов для этого типа":"Ничего не найдено",l;return{c(){e=f("div"),l=H(t),r(e,"class","picker-empty svelte-12kipyi")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&16&&t!==(t=i[4].length>0?"Нет результатов для этого типа":"Ничего не найдено")&&Q(l,t)},d(i){i&&S(e)}}}function q2(n){let e,t;return{c(){e=f("div"),t=H(n[8]),r(e,"class","picker-error svelte-12kipyi")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&256&&Q(t,l[8])},d(l){l&&S(e)}}}function z2(n){let e;return{c(){e=f("div"),e.textContent="Загрузка...",r(e,"class","picker-loading svelte-12kipyi")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function nc(n){let e,t=n[25].path+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","picker-result-path svelte-12kipyi")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&32&&t!==(t=i[25].path+"")&&Q(l,t)},d(i){i&&S(e)}}}function lc(n){let e,t,l=n[25].title+"",i,o,s,c,u,d,p=n[25].path&&nc(n);function h(){return n[18](n[25])}return{c(){e=f("button"),t=f("span"),i=H(l),o=w(),p&&p.c(),s=w(),r(t,"class","picker-result-title svelte-12kipyi"),r(e,"type","button"),r(e,"class","picker-result svelte-12kipyi"),r(e,"role","option"),r(e,"aria-selected",c=n[27]===n[6]),ce(e,"selected",n[27]===n[6])},m(m,g){C(m,e,g),a(e,t),a(t,i),a(e,o),p&&p.m(e,null),a(e,s),u||(d=P(e,"click",h),u=!0)},p(m,g){n=m,g&32&&l!==(l=n[25].title+"")&&Q(i,l),n[25].path?p?p.p(n,g):(p=nc(n),p.c(),p.m(e,s)):p&&(p.d(1),p=null),g&64&&c!==(c=n[27]===n[6])&&r(e,"aria-selected",c),g&64&&ce(e,"selected",n[27]===n[6])},d(m){m&&S(e),p&&p.d(),u=!1,d()}}}function B2(n){let e,t=n[0]&&ec(n);return{c(){t&&t.c(),e=kt()},m(l,i){t&&t.m(l,i),C(l,e,i)},p(l,[i]){l[0]?t?t.p(l,i):(t=ec(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:se,o:se,d(l){l&&S(e),t&&t.d(l)}}}function ic(n){return n==="note"?"note":n==="file"?"file":n==="secret"?"secret":"case"}function F2(n,e,t){let{visible:l=!1}=e;const i=pn(),o=[{id:"case",label:"Дело"},{id:"note",label:"Заметка"},{id:"file",label:"Файл"},{id:"secret",label:"Секрет"}];let s="note",c="",u=[],d=[],p=0,h=!1,m="",g;function b(){t(5,d=u.filter(z=>ic(z.type)===s)),t(6,p=0)}async function v(){if(!c.trim()||c.trim().length<2){t(4,u=[]),t(5,d=[]);return}t(7,h=!0),t(8,m="");try{const z=Ud(c.trim()),W=new Set,K=[];for(const L of z)W.has(L)||(W.add(L),K.push(L));const Y=await Promise.all(K.map(L=>window.go.main.App.SearchNodes(L).catch(()=>[]))),F=new Map;for(const L of Y)for(const M of L||[])F.has(M.id)||F.set(M.id,M);t(4,u=Array.from(F.values())),b()}catch(z){t(8,m=String(z)),t(4,u=[]),t(5,d=[])}finally{t(7,h=!1)}}function y(){clearTimeout(A),A=setTimeout(v,250)}function E(z){z.key==="ArrowDown"?(z.preventDefault(),t(6,p=Math.min(p+1,d.length-1))):z.key==="ArrowUp"?(z.preventDefault(),t(6,p=Math.max(p-1,0))):z.key==="Enter"?(z.preventDefault(),d[p]&&T(d[p])):z.key==="Escape"&&i("close")}function T(z){const K=`[${Ok(z.title||z.id)}](verstak://${ic(z.type)}/${z.id})`;i("insert",{markdown:K})}function N(z){t(2,s=z),b(),g&&g.focus()}let A;function I(z){In[z?"unshift":"push"](()=>{g=z,t(1,g)})}function O(){c=this.value,t(3,c)}const R=z=>z.id!=="secret"&&N(z.id),D=z=>T(z),B=()=>i("close"),j=()=>i("close"),U=z=>z.key==="Escape"&&i("close");return n.$$set=z=>{"visible"in z&&t(0,l=z.visible)},n.$$.update=()=>{n.$$.dirty&3&&l&&g&&setTimeout(()=>g.focus(),50)},[l,g,s,c,u,d,p,h,m,i,o,y,E,T,N,I,O,R,D,B,j,U]}class j2 extends ut{constructor(e){super(),ct(this,e,F2,B2,at,{visible:0})}}function sc(n,e,t){const l=n.slice();return l[18]=e[t],l}function oc(n){let e,t,l,i,o,s,c,u,d;return{c(){e=f("div"),t=f("input"),l=w(),i=f("div"),o=f("button"),o.textContent="Создать",s=w(),c=f("button"),c.textContent="Отмена",r(t,"type","text"),r(t,"placeholder","Название заметки"),r(t,"class","svelte-1d78tu1"),r(o,"class","btn btn-primary svelte-1d78tu1"),r(c,"class","btn svelte-1d78tu1"),r(i,"class","form-actions svelte-1d78tu1"),r(e,"class","create-form svelte-1d78tu1")},m(p,h){C(p,e,h),a(e,t),Me(t,n[3]),a(e,l),a(e,i),a(i,o),a(i,s),a(i,c),u||(d=[P(t,"input",n[12]),P(t,"keydown",n[7]),P(o,"click",n[6]),P(c,"click",n[5])],u=!0)},p(p,h){h&8&&t.value!==p[3]&&Me(t,p[3])},d(p){p&&S(e),u=!1,Ce(d)}}}function U2(n){let e,t=Te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=rc(sc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","notes-list svelte-1d78tu1")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o&1795){t=Te(i[0]);let s;for(s=0;s<t.length;s+=1){const c=sc(i,t,s);l[s]?l[s].p(c,o):(l[s]=rc(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function H2(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1d78tu1">Нет заметок</p><p class="hint svelte-1d78tu1">Создайте первую заметку</p>',r(e,"class","empty-state svelte-1d78tu1")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function rc(n){let e,t,l,i=n[18].title+"",o,s,c,u=n[1](n[18].createdAt)+"",d,p,h,m,g,b,v,y,E;function T(){return n[13](n[18])}function N(){return n[14](n[18])}function A(){return n[15](n[18])}function I(...O){return n[16](n[18],...O)}return{c(){e=f("div"),t=f("div"),l=f("div"),o=H(i),s=w(),c=f("div"),d=H(u),p=w(),h=f("div"),m=f("button"),m.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"></path></svg>',g=w(),b=f("button"),b.innerHTML='<svg width="12" height="12" 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>',v=w(),r(l,"class","note-card-title svelte-1d78tu1"),r(c,"class","note-card-date svelte-1d78tu1"),r(t,"class","note-card-info svelte-1d78tu1"),r(m,"class","note-action-btn svelte-1d78tu1"),r(m,"title","Переименовать"),r(b,"class","note-action-btn note-action-danger svelte-1d78tu1"),r(b,"title","Удалить"),r(h,"class","note-card-actions svelte-1d78tu1"),r(e,"class","note-card svelte-1d78tu1"),r(e,"role","button"),r(e,"tabindex","0")},m(O,R){C(O,e,R),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(e,p),a(e,h),a(h,m),a(h,g),a(h,b),a(e,v),y||(E=[P(m,"click",T),P(b,"click",N),P(h,"click",We(n[11])),P(e,"click",A),P(e,"keydown",I)],y=!0)},p(O,R){n=O,R&1&&i!==(i=n[18].title+"")&&Q(o,i),R&3&&u!==(u=n[1](n[18].createdAt)+"")&&Q(d,u)},d(O){O&&S(e),y=!1,Ce(E)}}}function W2(n){let e,t,l,i,o,s,c,u=n[2]&&oc(n);function d(m,g){if(m[0].length===0&&!m[2])return H2;if(m[0].length>0)return U2}let p=d(n),h=p&&p(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent="Добавить заметку",i=w(),u&&u.c(),o=w(),h&&h.c(),r(l,"class","btn btn-primary svelte-1d78tu1"),r(t,"class","tab-toolbar svelte-1d78tu1"),r(e,"class","notes-tab svelte-1d78tu1")},m(m,g){C(m,e,g),a(e,t),a(t,l),a(e,i),u&&u.m(e,null),a(e,o),h&&h.m(e,null),s||(c=P(l,"click",n[4]),s=!0)},p(m,[g]){m[2]?u?u.p(m,g):(u=oc(m),u.c(),u.m(e,o)):u&&(u.d(1),u=null),p===(p=d(m))&&h?h.p(m,g):(h&&h.d(1),h=p&&p(m),h&&(h.c(),h.m(e,null)))},i:se,o:se,d(m){m&&S(e),u&&u.d(),h&&h.d(),s=!1,c()}}}function G2(n,e,t){let{notes:l=[]}=e,{formatDate:i=I=>""}=e;const o=pn();let s=!1,c="";function u(){t(2,s=!0),t(3,c="")}function d(){t(2,s=!1),t(3,c="")}function p(){c.trim()&&(o("submitCreateNote",{title:c.trim()}),t(2,s=!1),t(3,c=""))}function h(I){I.key==="Enter"&&p()}function m(I){o("openNote",{note:I})}function g(I,O){o("startRename",{noteId:I,currentTitle:O})}function b(I){o("deleteNote",{note:I})}function v(I){Ds.call(this,n,I)}function y(){c=this.value,t(3,c)}const E=I=>g(I.id,I.title),T=I=>b(I),N=I=>m(I),A=(I,O)=>O.key==="Enter"&&m(I);return n.$$set=I=>{"notes"in I&&t(0,l=I.notes),"formatDate"in I&&t(1,i=I.formatDate)},[l,i,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A]}class K2 extends ut{constructor(e){super(),ct(this,e,G2,W2,at,{notes:0,formatDate:1})}}function ac(n,e,t){const l=n.slice();return l[13]=e[t],l}function cc(n,e,t){const l=n.slice();return l[16]=e[t],l}function uc(n){let e,t,l,i=Te(n[1].slice(0,5)),o=[];for(let s=0;s<i.length;s+=1)o[s]=fc(cc(n,i,s));return{c(){e=f("div"),t=f("h3"),t.textContent=`${k("overview.recentNotes")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","svelte-3r30e3"),r(e,"class","recent-section svelte-3r30e3")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c&522){i=Te(s[1].slice(0,5));let u;for(u=0;u<i.length;u+=1){const d=cc(s,i,u);o[u]?o[u].p(d,c):(o[u]=fc(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function fc(n){let e,t,l=n[16].title+"",i,o,s=n[3](n[16].createdAt)+"",c,u,d,p;function h(){return n[10](n[16])}function m(...g){return n[11](n[16],...g)}return{c(){e=f("div"),t=f("span"),i=H(l),o=f("span"),c=H(s),u=w(),r(o,"class","recent-date svelte-3r30e3"),r(e,"class","recent-note svelte-3r30e3"),r(e,"role","button"),r(e,"tabindex","0")},m(g,b){C(g,e,b),a(e,t),a(t,i),a(e,o),a(o,c),a(e,u),d||(p=[P(e,"click",h),P(e,"keydown",m)],d=!0)},p(g,b){n=g,b&2&&l!==(l=n[16].title+"")&&Q(i,l),b&10&&s!==(s=n[3](n[16].createdAt)+"")&&Q(c,s)},d(g){g&&S(e),d=!1,Ce(p)}}}function dc(n){let e,t,l,i=Te(n[2].slice(0,3)),o=[];for(let s=0;s<i.length;s+=1)o[s]=pc(ac(n,i,s));return{c(){e=f("div"),t=f("h3"),t.textContent=`${k("overview.recentEntries")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","svelte-3r30e3"),r(e,"class","recent-section svelte-3r30e3")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c&4){i=Te(s[2].slice(0,3));let u;for(u=0;u<i.length;u+=1){const d=ac(s,i,u);o[u]?o[u].p(d,c):(o[u]=pc(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function pc(n){let e,t=n[13].summary+"",l,i,o=n[13].minutes+"",s,c,u=k("worklog.min")+"",d,p;return{c(){e=f("div"),l=H(t),i=H(" ("),s=H(o),c=w(),d=H(u),p=H(")"),r(e,"class","recent-entry svelte-3r30e3")},m(h,m){C(h,e,m),a(e,l),a(e,i),a(e,s),a(e,c),a(e,d),a(e,p)},p(h,m){m&4&&t!==(t=h[13].summary+"")&&Q(l,t),m&4&&o!==(o=h[13].minutes+"")&&Q(s,o)},d(h){h&&S(e)}}}function V2(n){let e,t,l=n[0].title+"",i,o,s,c,u,d,p=n[4](n[0].type)+"",h,m,g,b,v,y=(n[0].section||"—")+"",E,T,N,A,I,O=n[3](n[0].createdAt)+"",R,D,B,j,U,z,W,K,Y=k("overview.newNote")+"",F,L,M,q,X,Z,J=k("overview.addFile")+"",ee,te,le,_e,oe,ze,Ge=k("overview.addAction")+"",Ie,ne,re,Ne,Fe,we,je,xe=k("overview.logTime")+"",Ae,Ve,Ue,Se,He,Oe=n[1].length>0&&uc(n),Ke=n[2].length>0&&dc(n);return{c(){e=f("div"),t=f("h2"),i=H(l),o=w(),s=f("div"),c=f("div"),u=f("span"),u.textContent=`${k("overview.type")}`,d=f("span"),h=H(p),m=w(),g=f("div"),b=f("span"),b.textContent=`${k("overview.section")}`,v=f("span"),E=H(y),T=w(),N=f("div"),A=f("span"),A.textContent=`${k("overview.created")}`,I=f("span"),R=H(O),D=w(),B=f("div"),j=f("button"),U=ae("svg"),z=ae("path"),W=ae("path"),K=w(),F=H(Y),L=w(),M=f("button"),q=ae("svg"),X=ae("path"),Z=w(),ee=H(J),te=w(),le=f("button"),_e=ae("svg"),oe=ae("polygon"),ze=w(),Ie=H(Ge),ne=w(),re=f("button"),Ne=ae("svg"),Fe=ae("circle"),we=ae("polyline"),je=w(),Ae=H(xe),Ve=w(),Oe&&Oe.c(),Ue=w(),Ke&&Ke.c(),r(t,"class","svelte-3r30e3"),r(u,"class","meta-label svelte-3r30e3"),r(c,"class","meta-item svelte-3r30e3"),r(b,"class","meta-label svelte-3r30e3"),r(g,"class","meta-item svelte-3r30e3"),r(A,"class","meta-label svelte-3r30e3"),r(N,"class","meta-item svelte-3r30e3"),r(s,"class","meta-grid svelte-3r30e3"),r(z,"d","M12 20h9"),r(W,"d","M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"),r(U,"width","16"),r(U,"height","16"),r(U,"viewBox","0 0 24 24"),r(U,"fill","none"),r(U,"stroke","currentColor"),r(U,"stroke-width","2"),r(U,"stroke-linecap","round"),r(U,"stroke-linejoin","round"),r(j,"class","qa-btn svelte-3r30e3"),r(X,"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"),r(q,"width","16"),r(q,"height","16"),r(q,"viewBox","0 0 24 24"),r(q,"fill","none"),r(q,"stroke","currentColor"),r(q,"stroke-width","2"),r(q,"stroke-linecap","round"),r(q,"stroke-linejoin","round"),r(M,"class","qa-btn svelte-3r30e3"),r(oe,"points","13 2 3 14 12 14 11 22 21 10 12 10 13 2"),r(_e,"width","16"),r(_e,"height","16"),r(_e,"viewBox","0 0 24 24"),r(_e,"fill","none"),r(_e,"stroke","currentColor"),r(_e,"stroke-width","2"),r(_e,"stroke-linecap","round"),r(_e,"stroke-linejoin","round"),r(le,"class","qa-btn svelte-3r30e3"),r(Fe,"cx","12"),r(Fe,"cy","12"),r(Fe,"r","10"),r(we,"points","12 6 12 12 16 14"),r(Ne,"width","16"),r(Ne,"height","16"),r(Ne,"viewBox","0 0 24 24"),r(Ne,"fill","none"),r(Ne,"stroke","currentColor"),r(Ne,"stroke-width","2"),r(Ne,"stroke-linecap","round"),r(Ne,"stroke-linejoin","round"),r(re,"class","qa-btn svelte-3r30e3"),r(B,"class","quick-actions svelte-3r30e3"),r(e,"class","overview svelte-3r30e3")},m(Pe,ue){C(Pe,e,ue),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,u),a(c,d),a(d,h),a(s,m),a(s,g),a(g,b),a(g,v),a(v,E),a(s,T),a(s,N),a(N,A),a(N,I),a(I,R),a(e,D),a(e,B),a(B,j),a(j,U),a(U,z),a(U,W),a(j,K),a(j,F),a(B,L),a(B,M),a(M,q),a(q,X),a(M,Z),a(M,ee),a(B,te),a(B,le),a(le,_e),a(_e,oe),a(le,ze),a(le,Ie),a(B,ne),a(B,re),a(re,Ne),a(Ne,Fe),a(Ne,we),a(re,je),a(re,Ae),a(e,Ve),Oe&&Oe.m(e,null),a(e,Ue),Ke&&Ke.m(e,null),Se||(He=[P(j,"click",n[5]),P(M,"click",n[6]),P(le,"click",n[7]),P(re,"click",n[8])],Se=!0)},p(Pe,[ue]){ue&1&&l!==(l=Pe[0].title+"")&&Q(i,l),ue&17&&p!==(p=Pe[4](Pe[0].type)+"")&&Q(h,p),ue&1&&y!==(y=(Pe[0].section||"—")+"")&&Q(E,y),ue&9&&O!==(O=Pe[3](Pe[0].createdAt)+"")&&Q(R,O),Pe[1].length>0?Oe?Oe.p(Pe,ue):(Oe=uc(Pe),Oe.c(),Oe.m(e,Ue)):Oe&&(Oe.d(1),Oe=null),Pe[2].length>0?Ke?Ke.p(Pe,ue):(Ke=dc(Pe),Ke.c(),Ke.m(e,null)):Ke&&(Ke.d(1),Ke=null)},i:se,o:se,d(Pe){Pe&&S(e),Oe&&Oe.d(),Ke&&Ke.d(),Se=!1,Ce(He)}}}function Z2(n,e,t){let{selectedNode:l=null}=e,{notes:i=[]}=e,{worklog:o=[]}=e,{formatDate:s=y=>""}=e,{nodeKindLabel:c=y=>y||""}=e;const u=pn();function d(){u("createNote")}function p(){u("addFile")}function h(){u("createAction")}function m(){u("switchTab",{tab:"worklog"})}function g(y){u("openNote",{note:y})}const b=y=>g(y),v=(y,E)=>E.key==="Enter"&&g(y);return n.$$set=y=>{"selectedNode"in y&&t(0,l=y.selectedNode),"notes"in y&&t(1,i=y.notes),"worklog"in y&&t(2,o=y.worklog),"formatDate"in y&&t(3,s=y.formatDate),"nodeKindLabel"in y&&t(4,c=y.nodeKindLabel)},[l,i,o,s,c,d,p,h,m,g,b,v]}class Y2 extends ut{constructor(e){super(),ct(this,e,Z2,V2,at,{selectedNode:0,notes:1,worklog:2,formatDate:3,nodeKindLabel:4})}}function hc(n,e,t){const l=n.slice();return l[100]=e[t],l}function mc(n){let e,t=k("common.paste")+"",l,i,o=n[10].items.length+"",s,c,u;return{c(){e=f("button"),l=H(t),i=w(),s=H(o),r(e,"class","btn svelte-1r5kjfz")},m(d,p){C(d,e,p),a(e,l),a(e,i),a(e,s),c||(u=P(e,"click",n[36]),c=!0)},p(d,p){p[0]&1024&&o!==(o=d[10].items.length+"")&&Q(s,o)},d(d){d&&S(e),c=!1,u()}}}function X2(n){let e,t,l,i,o,s,c;const u=[x2,Q2],d=[];function p(b,v){return b[4].length>0?0:1}e=p(n),t=d[e]=u[e](n);const h=[ew,$2],m=[];function g(b,v){return b[5].length===0?0:1}return i=g(n),o=m[i]=h[i](n),{c(){t.c(),l=w(),o.c(),s=kt()},m(b,v){d[e].m(b,v),C(b,l,v),m[i].m(b,v),C(b,s,v),c=!0},p(b,v){let y=e;e=p(b),e===y?d[e].p(b,v):(yt(),ke(d[y],1,1,()=>{d[y]=null}),Et(),t=d[e],t?t.p(b,v):(t=d[e]=u[e](b),t.c()),ge(t,1),t.m(l.parentNode,l));let E=i;i=g(b),i===E?m[i].p(b,v):(yt(),ke(m[E],1,1,()=>{m[E]=null}),Et(),o=m[i],o?o.p(b,v):(o=m[i]=h[i](b),o.c()),ge(o,1),o.m(s.parentNode,s))},i(b){c||(ge(t),ge(o),c=!0)},o(b){ke(t),ke(o),c=!1},d(b){b&&(S(l),S(s)),d[e].d(b),m[i].d(b)}}}function J2(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("common.loading")}`,r(e,"class","empty-state")},m(l,i){C(l,e,i),a(e,t)},p:se,i:se,o:se,d(l){l&&S(e)}}}function Q2(n){let e,t;return e=new Xf({props:{crumbs:[{name:k("file.root")}]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function x2(n){let e,t,l,i,o,s,c,u=k("common.backLabel")+"",d,p,h,m;return e=new Xf({props:{crumbs:[{name:k("file.root")},...n[4]]}}),e.$on("navigate",n[59]),{c(){Qe(e.$$.fragment),t=w(),l=f("button"),i=ae("svg"),o=ae("line"),s=ae("polyline"),c=w(),d=H(u),r(o,"x1","19"),r(o,"y1","12"),r(o,"x2","5"),r(o,"y2","12"),r(s,"points","12 19 5 12 12 5"),r(i,"width","14"),r(i,"height","14"),r(i,"viewBox","0 0 24 24"),r(i,"fill","none"),r(i,"stroke","currentColor"),r(i,"stroke-width","2"),r(i,"stroke-linecap","round"),r(i,"stroke-linejoin","round"),r(l,"class","btn btn-sm back-btn svelte-1r5kjfz")},m(g,b){Ye(e,g,b),C(g,t,b),C(g,l,b),a(l,i),a(i,o),a(i,s),a(l,c),a(l,d),p=!0,h||(m=P(l,"click",n[25]),h=!0)},p(g,b){const v={};b[0]&16&&(v.crumbs=[{name:k("file.root")},...g[4]]),e.$set(v)},i(g){p||(ge(e.$$.fragment,g),p=!0)},o(g){ke(e.$$.fragment,g),p=!1},d(g){g&&(S(t),S(l)),Xe(e,g),h=!1,m()}}}function $2(n){let e,t=[],l=new Map,i,o=Te(n[5]);const s=c=>c[100].id;for(let c=0;c<o.length;c+=1){let u=hc(n,o,c),d=s(u);l.set(d,t[c]=gc(d,u))}return{c(){e=f("div");for(let c=0;c<t.length;c+=1)t[c].c();r(e,"class","file-list svelte-1r5kjfz")},m(c,u){C(c,e,u);for(let d=0;d<t.length;d+=1)t[d]&&t[d].m(e,null);i=!0},p(c,u){u[0]&150997026|u[1]&528350&&(o=Te(c[5]),yt(),t=Ff(t,u,s,1,c,o,l,e,Bf,gc,null,hc),Et())},i(c){if(!i){for(let u=0;u<o.length;u+=1)ge(t[u]);i=!0}},o(c){for(let u=0;u<t.length;u+=1)ke(t[u]);i=!1},d(c){c&&S(e);for(let u=0;u<t.length;u+=1)t[u].d()}}}function ew(n){let e,t,l,i,o=(n[4].length>0?k("file.noFiles"):k("file.noFilesCase"))+"",s,c,u,d,p,h,m,g,b,v;return{c(){e=f("div"),t=f("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"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>',l=w(),i=f("p"),s=H(o),c=w(),u=f("p"),u.textContent=`${k("file.hint")}`,d=w(),p=f("div"),h=f("button"),h.textContent=`${k("file.addFileSimple")}`,m=w(),g=f("button"),g.textContent=`${k("file.addFolderSimple")}`,r(t,"class","empty-icon"),r(u,"class","hint"),r(h,"class","btn btn-primary svelte-1r5kjfz"),r(g,"class","btn svelte-1r5kjfz"),r(p,"class","empty-actions"),r(e,"class","empty-state")},m(y,E){C(y,e,E),a(e,t),a(e,l),a(e,i),a(i,s),a(e,c),a(e,u),a(e,d),a(e,p),a(p,h),a(p,m),a(p,g),b||(v=[P(h,"click",n[29]),P(g,"click",n[30])],b=!0)},p(y,E){E[0]&16&&o!==(o=(y[4].length>0?k("file.noFiles"):k("file.noFilesCase"))+"")&&Q(s,o)},i:se,o:se,d(y){y&&S(e),b=!1,Ce(v)}}}function gc(n,e){let t,l,i;return l=new Hg({props:{item:e[100],selected:e[11].includes(e[100].id),onDragStart:e[40],onDragOver:e[41],onDrop:e[42]}}),l.$on("navigate",e[60]),l.$on("preview",e[61]),l.$on("openExternal",e[62]),l.$on("showInFolder",e[63]),l.$on("delete",e[64]),l.$on("rename",e[65]),l.$on("duplicate",e[66]),l.$on("cut",e[67]),l.$on("copy",e[68]),l.$on("selectOne",e[69]),l.$on("toggleSelect",e[70]),l.$on("rangeSelect",e[71]),{key:n,first:null,c(){t=kt(),Qe(l.$$.fragment),this.first=t},m(o,s){C(o,t,s),Ye(l,o,s),i=!0},p(o,s){e=o;const c={};s[0]&32&&(c.item=e[100]),s[0]&2080&&(c.selected=e[11].includes(e[100].id)),l.$set(c)},i(o){i||(ge(l.$$.fragment,o),i=!0)},o(o){ke(l.$$.fragment,o),i=!1},d(o){o&&S(t),Xe(l,o)}}}function _c(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("file.scanning")}`,r(e,"class","empty-state")},m(l,i){C(l,e,i),a(e,t)},d(l){l&&S(e)}}}function bc(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T=n[17]&&kc(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("rename.title")}`,i=w(),o=f("div"),s=f("label"),c=f("span"),c.textContent=`${k("common.newName")}`,u=w(),d=f("input"),p=w(),T&&T.c(),h=w(),m=f("div"),g=f("button"),g.textContent=`${k("common.rename")}`,b=w(),v=f("button"),v.textContent=`${k("common.cancel")}`,r(c,"class","label-text"),r(d,"type","text"),r(o,"class","form-group"),r(g,"class","btn btn-primary svelte-1r5kjfz"),r(v,"class","btn svelte-1r5kjfz"),r(m,"class","modal-actions"),r(t,"class","modal"),r(e,"class","modal-overlay"),r(e,"role","button"),r(e,"tabindex","0")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(t,i),a(t,o),a(o,s),a(s,c),a(s,u),a(s,d),Me(d,n[16]),a(t,p),T&&T.m(t,null),a(t,h),a(t,m),a(m,g),a(m,b),a(m,v),y||(E=[P(d,"input",n[72]),P(d,"keydown",n[45]),P(g,"click",n[43]),P(v,"click",n[44]),P(e,"click",xt(n[44])),P(e,"keydown",n[73])],y=!0)},p(N,A){A[0]&65536&&d.value!==N[16]&&Me(d,N[16]),N[17]?T?T.p(N,A):(T=kc(N),T.c(),T.m(t,h)):T&&(T.d(1),T=null)},d(N){N&&S(e),T&&T.d(),y=!1,Ce(E)}}}function kc(n){let e,t;return{c(){e=f("div"),t=H(n[17]),r(e,"class","rename-error svelte-1r5kjfz")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&131072&&Q(t,l[17])},d(l){l&&S(e)}}}function vc(n){let e,t;return e=new qd({props:{title:n[19],message:n[20],confirmText:n[22],danger:n[21]}}),e.$on("confirm",n[46]),e.$on("cancel",n[47]),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[0]&524288&&(o.title=l[19]),i[0]&1048576&&(o.message=l[20]),i[0]&4194304&&(o.confirmText=l[22]),i[0]&2097152&&(o.danger=l[21]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function wc(n){let e,t,l,i=k("file.importTitle")+"",o,s,c=(n[0]?n[0].title:"")+"",u,d,p,h,m,g,b,v=n[13].files+"",y,E,T,N,A,I=n[13].folders+"",O,R,D,B,j,U=(n[13].totalBytes/1024).toFixed(1)+"",z,W,K,Y,F,L,M,q,X,Z,J,ee,te=n[13].isDangerous&&yc(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),o=H(i),s=H(" «"),u=H(c),d=H("»"),p=w(),h=f("div"),m=f("div"),g=f("span"),g.textContent=`${k("file.importFiles")}`,b=f("span"),y=H(v),E=w(),T=f("div"),N=f("span"),N.textContent=`${k("file.importFolders")}`,A=f("span"),O=H(I),R=w(),D=f("div"),B=f("span"),B.textContent=`${k("file.importSize")}`,j=f("span"),z=H(U),W=H(" KB"),K=w(),te&&te.c(),Y=w(),F=f("div"),L=f("button"),L.textContent=`${k("file.importCopy")}`,M=w(),q=f("button"),q.textContent=`${k("file.importLink")}`,X=w(),Z=f("button"),Z.textContent=`${k("common.cancel")}`,r(m,"class","summary-row svelte-1r5kjfz"),r(T,"class","summary-row svelte-1r5kjfz"),r(D,"class","summary-row svelte-1r5kjfz"),r(h,"class","import-summary svelte-1r5kjfz"),r(L,"class","btn btn-primary svelte-1r5kjfz"),r(q,"class","btn svelte-1r5kjfz"),r(Z,"class","btn svelte-1r5kjfz"),r(F,"class","modal-actions"),r(t,"class","modal"),r(e,"class","modal-overlay"),r(e,"role","button"),r(e,"tabindex","0")},m(le,_e){C(le,e,_e),a(e,t),a(t,l),a(l,o),a(l,s),a(l,u),a(l,d),a(t,p),a(t,h),a(h,m),a(m,g),a(m,b),a(b,y),a(h,E),a(h,T),a(T,N),a(T,A),a(A,O),a(h,R),a(h,D),a(D,B),a(D,j),a(j,z),a(j,W),a(h,K),te&&te.m(h,null),a(t,Y),a(t,F),a(F,L),a(F,M),a(F,q),a(F,X),a(F,Z),J||(ee=[P(L,"click",n[74]),P(q,"click",n[75]),P(Z,"click",n[49]),P(e,"click",xt(n[49])),P(e,"keydown",n[76])],J=!0)},p(le,_e){_e[0]&1&&c!==(c=(le[0]?le[0].title:"")+"")&&Q(u,c),_e[0]&8192&&v!==(v=le[13].files+"")&&Q(y,v),_e[0]&8192&&I!==(I=le[13].folders+"")&&Q(O,I),_e[0]&8192&&U!==(U=(le[13].totalBytes/1024).toFixed(1)+"")&&Q(z,U),le[13].isDangerous?te?te.p(le,_e):(te=yc(le),te.c(),te.m(h,null)):te&&(te.d(1),te=null)},d(le){le&&S(e),te&&te.d(),J=!1,Ce(ee)}}}function yc(n){let e,t,l,i,o,s,c=n[13].dangerReason+"",u;return{c(){e=f("div"),t=ae("svg"),l=ae("path"),i=ae("line"),o=ae("line"),s=w(),u=H(c),r(l,"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"),r(i,"x1","12"),r(i,"y1","9"),r(i,"x2","12"),r(i,"y2","13"),r(o,"x1","12"),r(o,"y1","17"),r(o,"x2","12.01"),r(o,"y2","17"),r(t,"width","14"),r(t,"height","14"),r(t,"viewBox","0 0 24 24"),r(t,"fill","none"),r(t,"stroke","currentColor"),r(t,"stroke-width","2"),r(t,"stroke-linecap","round"),r(t,"stroke-linejoin","round"),r(e,"class","summary-warn svelte-1r5kjfz")},m(d,p){C(d,e,p),a(e,t),a(t,l),a(t,i),a(t,o),a(e,s),a(e,u)},p(d,p){p[0]&8192&&c!==(c=d[13].dangerReason+"")&&Q(u,c)},d(d){d&&S(e)}}}function Ec(n){let e,t;return e=new Pd({props:{item:n[6],content:n[7],loading:n[8],error:n[9]}}),e.$on("close",n[28]),e.$on("openExternal",n[77]),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[0]&64&&(o.item=l[6]),i[0]&128&&(o.content=l[7]),i[0]&256&&(o.loading=l[8]),i[0]&512&&(o.error=l[9]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function tw(n){let e,t,l,i=k("file.addFile")+"",o,s,c,u=k("file.addFolder")+"",d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B=n[10].items.length>0&&mc(n);const j=[J2,X2],U=[];function z(M,q){return M[2]?0:1}b=z(n),v=U[b]=j[b](n);let W=n[12]&&!n[14]&&_c(),K=n[15]&&bc(n),Y=n[18]&&vc(n),F=n[14]&&n[13]&&wc(n),L=n[6]&&Ec(n);return{c(){e=f("div"),t=f("div"),l=f("button"),o=H(i),s=w(),c=f("button"),d=H(u),p=w(),h=f("button"),h.textContent=`${k("file.newFile")}`,m=w(),B&&B.c(),g=w(),v.c(),y=w(),W&&W.c(),E=w(),K&&K.c(),T=w(),Y&&Y.c(),N=w(),F&&F.c(),A=w(),L&&L.c(),I=kt(),r(l,"class","btn btn-primary svelte-1r5kjfz"),l.disabled=n[12],r(c,"class","btn svelte-1r5kjfz"),c.disabled=n[12],r(h,"class","btn svelte-1r5kjfz"),r(t,"class","tab-toolbar svelte-1r5kjfz"),r(e,"class","files-tab svelte-1r5kjfz")},m(M,q){C(M,e,q),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(t,p),a(t,h),a(t,m),B&&B.m(t,null),a(e,g),U[b].m(e,null),a(e,y),W&&W.m(e,null),C(M,E,q),K&&K.m(M,q),C(M,T,q),Y&&Y.m(M,q),C(M,N,q),F&&F.m(M,q),C(M,A,q),L&&L.m(M,q),C(M,I,q),O=!0,R||(D=[P(l,"click",n[29]),P(c,"click",n[30]),P(h,"click",n[31])],R=!0)},p(M,q){(!O||q[0]&4096)&&(l.disabled=M[12]),(!O||q[0]&4096)&&(c.disabled=M[12]),M[10].items.length>0?B?B.p(M,q):(B=mc(M),B.c(),B.m(t,null)):B&&(B.d(1),B=null);let X=b;b=z(M),b===X?U[b].p(M,q):(yt(),ke(U[X],1,1,()=>{U[X]=null}),Et(),v=U[b],v?v.p(M,q):(v=U[b]=j[b](M),v.c()),ge(v,1),v.m(e,y)),M[12]&&!M[14]?W||(W=_c(),W.c(),W.m(e,null)):W&&(W.d(1),W=null),M[15]?K?K.p(M,q):(K=bc(M),K.c(),K.m(T.parentNode,T)):K&&(K.d(1),K=null),M[18]?Y?(Y.p(M,q),q[0]&262144&&ge(Y,1)):(Y=vc(M),Y.c(),ge(Y,1),Y.m(N.parentNode,N)):Y&&(yt(),ke(Y,1,1,()=>{Y=null}),Et()),M[14]&&M[13]?F?F.p(M,q):(F=wc(M),F.c(),F.m(A.parentNode,A)):F&&(F.d(1),F=null),M[6]?L?(L.p(M,q),q[0]&64&&ge(L,1)):(L=Ec(M),L.c(),ge(L,1),L.m(I.parentNode,I)):L&&(yt(),ke(L,1,1,()=>{L=null}),Et())},i(M){O||(ge(v),ge(Y),ge(L),O=!0)},o(M){ke(v),ke(Y),ke(L),O=!1},d(M){M&&(S(e),S(E),S(T),S(N),S(A),S(I)),B&&B.d(),U[b].d(),W&&W.d(),K&&K.d(M),Y&&Y.d(M),F&&F.d(M),L&&L.d(M),R=!1,Ce(D)}}}function nw(n,e,t){let{selectedNode:l=null}=e,{wailsCall:i=async()=>{}}=e;function o($){try{i("WriteDebugLog","[FilesTab] "+$)}catch{}}const s=pn();let c=!1,u=null,d=[],p=[],h=null,m="",g=!1,b="",v={items:[],mode:"copy"},y=[],E=[],T=!1,N=null,A=!1,I="",O="",R=!1,D="",B="",j="",U=!1,z="",W="",K=!1,Y=k("common.delete"),F=null,L=null;function M($){t(4,d=[]),t(3,u=null),t(11,y=[]),E=[],t(6,h=null),t(7,m=""),Z($)}let q=null;function X(){Ie()}function Z($){te($)}function J($){const he=p.find(tt=>tt.id===$);he&&ze(he)}function ee($){t(11,y=[$])}async function te($){t(2,c=!0);try{let he=await i("ListItems",$)||[];o("loadFolder nodeId="+$+" count="+he.length+" first="+(he[0]?JSON.stringify({id:he[0].id,name:he[0].name,type:he[0].type,fileId:he[0].fileId}):"none")),he.sort((tt,st)=>tt.type!==st.type?tt.type==="folder"?-1:1:(tt.name||"").localeCompare(st.name||"")),t(5,p=he)}catch(he){o("loadFolder ERROR nodeId="+$+" err="+String(he)),t(5,p=[])}t(2,c=!1)}async function le($){if(l){try{const he=await i("GetNodeDetail",$);he&&t(4,d=[...d,{id:$,name:he.title}])}catch{t(4,d=[...d,{id:$,name:"..."}])}t(3,u=$),await te($)}}function _e(){if(d.length<2)t(4,d=[]),t(3,u=null),l&&te(l.id);else{const $=d[d.length-2];t(4,d=d.slice(0,-1)),t(3,u=$.id),te($.id)}}function oe($){const he=d[$];t(4,d=d.slice(0,$+1)),t(3,u=he.id),te(he.id)}async function ze($){if(o("openPreview item="+JSON.stringify({id:$.id,name:$.name,type:$.type,fileId:$.fileId})),$&&$.fileId&&Li($)){o("isMarkdown=true fileId="+$.fileId);try{const he=await i("CheckFileAction",$.fileId);if(o("CheckFileAction result="+JSON.stringify(he)),he.action==="note"){s("openNote",{id:he.noteId,title:he.noteTitle});return}if(he.action==="external"){await i("OpenFile",$.fileId);return}}catch(he){o("CheckFileAction ERROR: "+String(he)),console.warn("CheckFileAction failed, falling back to preview:",he)}}else o("isMarkdown=false or no fileId, type="+$.type);t(6,h=$),t(7,m=""),t(9,b=""),t(8,g=!0);try{Dg($)?t(7,m=await i("GetFileBase64",$.fileId)||""):Pg($)?t(7,m=await i("ReadFileText",$.fileId)||""):$.fileId&&$.type!=="folder"&&(o("fallback text read for item="+$.name+" mime="+$.mime),t(7,m=await i("ReadFileText",$.fileId)||""))}catch(he){t(9,b=String(he))}t(8,g=!1)}function Ge(){t(6,h=null),t(7,m=""),t(9,b="")}async function Ie(){const $=await i("PickFile");if(!$)return;const he=u||l.id;await At(he,$)}async function ne(){const $=await i("PickDirectory");if(!$)return;const he=u||l.id;await At(he,$)}async function re(){const $=prompt(k("file.namePrompt"));if(!(!$||!$.trim()))try{const he=u||l.id;await i("CreateEmptyFile",he,$.trim()),await te(he),s("refreshParent",{nodeId:he})}catch(he){s("error",{message:String(he)})}}async function Ne($){try{await i("DuplicateNode",$);const he=u||l.id;await te(he),s("refreshParent",{nodeId:he})}catch(he){s("error",{message:String(he)})}}function Fe($){const he=p.find(tt=>tt.id===$);he&&it(he.id,he.name)}function we($){t(10,v={items:[$],mode:"cut"})}function je($){t(10,v={items:[$],mode:"copy"})}async function xe(){if(v.items.length===0)return;const $=u||l.id;try{if(v.mode==="copy")for(const he of v.items)await i("DuplicateNode",he);else for(const he of v.items)await i("MoveNode",he,$);t(10,v={items:[],mode:"copy"}),await te($)}catch(he){s("error",{message:String(he)})}}function Ae($){y.includes($)?t(11,y=y.filter(he=>he!==$)):t(11,y=[...y,$])}function Ve($){t(11,y=[$])}function Ue(){t(11,y=p.map($=>$.id))}function Se($){if(p.length===0)return;const he=y.length>0?y[y.length-1]:p[0].id,tt=p.findIndex(Xt=>Xt.id===he),st=p.findIndex(Xt=>Xt.id===$);if(tt===-1||st===-1)return;const Yt=Math.min(tt,st),Wt=Math.max(tt,st),vn=p.slice(Yt,Wt+1).map(Xt=>Xt.id),Bn=new Set(y);vn.forEach(Xt=>Bn.add(Xt)),t(11,y=[...Bn])}function He(){t(11,y=[])}function Oe($){return $.length>0?$:p.map(he=>he.id)}async function Ke(){const $=Oe(y),he=p.find(st=>st.id===$[0]);let tt;$.length===1&&(he==null?void 0:he.type)==="folder"?tt=k("delete.folder"):$.length===1?tt=k("delete.file"):tt=k("delete.files",{count:$.length}),pe({title:k("delete.confirmTitle"),message:k("delete.confirmMessage")+" "+tt+"?",confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{for(const Yt of $)try{await i("DeleteFileOrFolder",Yt)}catch(Wt){s("error",{message:String(Wt)})}t(11,y=[]);const st=u||l.id;await te(st)}})}function Pe(){const $=Oe(y);t(10,v={items:$,mode:"cut"}),t(11,y=[])}function ue(){const $=Oe(y);t(10,v={items:$,mode:"copy"}),t(11,y=[])}function be($,he){$.stopPropagation();const tt=y.includes(he)?y:[he];E=tt,$.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",tt.join(","))}function x($,he){const tt=p.find(st=>st.id===he);tt&&tt.type==="folder"&&($.preventDefault(),$.stopPropagation(),$.dataTransfer.dropEffect="move")}async function ye($,he){if($.preventDefault(),$.stopPropagation(),E.length!==0){for(const tt of E)try{await i("MoveNode",tt,he)}catch(st){s("error",{message:String(st)})}E=[],t(11,y=[]),await te(u||l.id)}}function me(){if(y.length===1){const $=p.find(he=>he.id===y[0]);$&&($.type==="folder"?le($.id):ze($))}}function Re(){if(y.length===1){const $=p.find(he=>he.id===y[0]);$&&$.fileId&&i("OpenFile",$.fileId)}}function ft(){if(y.length===1){const $=p.find(he=>he.id===y[0]);$&&it($.id,$.name)}}function it($,he){D=$,t(16,B=he),t(17,j=""),t(15,R=!0)}async function Ze(){const $=B.trim();if(!$){t(17,j=k("rename.emptyError"));return}try{await i("ValidateName",$)}catch{t(17,j=k("rename.invalidError"));return}t(15,R=!1);const he=D;D="";try{await i("RenameNode",he,$),l&&l.id===he&&t(0,l={...l,title:$}),s("refreshParent",{nodeId:u||l.id}),u&&await te(u)}catch(tt){s("error",{message:String(tt)})}}function dt(){t(15,R=!1),D="",t(16,B=""),t(17,j="")}function Je($){$.key==="Enter"?Ze():t(17,j="")}function pe($){t(19,z=$.title||k("common.confirm")),t(20,W=$.message||""),t(21,K=$.danger!==void 0?$.danger:!0),t(22,Y=$.confirmText||k("common.delete")),F=$.onConfirm||null,L=$.onCancel||null,t(18,U=!0)}function qe(){t(18,U=!1),F=null,L=null}function pt(){F&&F(),qe()}function vt(){L&&L(),qe()}async function At($,he){t(12,T=!0);try{const tt=await i("PreviewImport",he);t(13,N=tt),I=he,O=$,t(14,A=!0)}catch(tt){s("error",{message:String(tt)})}t(12,T=!1)}async function Zt($){try{const he=O||l.id;$==="copy"?await i("AddPathCopy",he,I):await i("AddPathLink",he,I),t(14,A=!1),t(13,N=null),t(4,d=[]),t(3,u=null),await te(he),s("refreshParent",{nodeId:he})}catch(he){s("error",{message:String(he)})}}function mt(){t(14,A=!1),t(13,N=null)}async function Mt({id:$,type:he}){const tt=k(he==="folder"?"delete.folder":"delete.file");pe({title:k("delete.confirmTitle"),message:k("delete.confirmMessage")+" "+tt+"?",confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await i("DeleteFileOrFolder",$);const st=u||l.id;await te(st)}catch(st){s("error",{message:String(st)})}}})}function It($){if($.ctrlKey||$.metaKey)$.key==="c"||$.key==="C"?($.preventDefault(),ue()):$.key==="x"||$.key==="X"?($.preventDefault(),Pe()):$.key==="v"||$.key==="V"?($.preventDefault(),xe()):$.key==="a"||$.key==="A"?($.preventDefault(),Ue()):$.key==="o"||$.key==="O"?($.preventDefault(),Re()):$.key==="Enter"&&($.preventDefault(),me());else if($.key==="Enter")$.preventDefault(),me();else if($.key==="Delete"){if(h){$.preventDefault(),Ge();return}if(y.length>0){$.preventDefault(),Ke();return}}else if($.key==="Escape"){if(h){Ge();return}if(y.length>0){He();return}}else $.key==="F2"&&($.preventDefault(),ft())}function jt(){t(4,d=[]),t(3,u=null),t(5,p=[]),t(11,y=[]),E=[],t(6,h=null),t(7,m=""),t(9,b=""),t(10,v={items:[],mode:"copy"}),t(12,T=!1),t(13,N=null),t(14,A=!1),t(15,R=!1),t(18,U=!1)}const an=$=>{const he=$.detail;he===0?(t(4,d=[]),t(3,u=null),l&&te(l.id)):oe(he-1)},cn=$=>le($.detail),Ut=$=>ze($.detail),Rn=$=>i("OpenFile",$.detail),Ct=$=>i("OpenFolder",$.detail),Lt=$=>Mt($.detail),gt=$=>Fe($.detail.id),bl=$=>Ne($.detail),bn=$=>we($.detail),kl=$=>je($.detail),en=$=>Ve($.detail),_t=$=>Ae($.detail),Ot=$=>Se($.detail);function tn(){B=this.value,t(16,B)}const un=$=>$.key==="Escape"&&dt(),Ht=()=>Zt("copy"),$t=()=>Zt("link"),kn=$=>$.key==="Escape"&&mt(),fn=$=>i("OpenFile",$.detail);return n.$$set=$=>{"selectedNode"in $&&t(0,l=$.selectedNode),"wailsCall"in $&&t(1,i=$.wailsCall)},n.$$.update=()=>{n.$$.dirty[0]&1|n.$$.dirty[1]&134217728&&l&&l.id&&l.id!==q&&(o("selectedNode changed: id="+l.id+" title="+l.title+" type="+l.type),t(58,q=l.id),M(l.id))},[l,i,c,u,d,p,h,m,g,b,v,y,T,N,A,R,B,j,U,z,W,K,Y,te,le,_e,oe,ze,Ge,Ie,ne,re,Ne,Fe,we,je,xe,Ae,Ve,Se,be,x,ye,Ze,dt,Je,pt,vt,Zt,mt,Mt,M,X,Z,J,ee,It,jt,q,an,cn,Ut,Rn,Ct,Lt,gt,bl,bn,kl,en,_t,Ot,tn,un,Ht,$t,kn,fn]}class lw extends ut{constructor(e){super(),ct(this,e,nw,tw,at,{selectedNode:0,wailsCall:1,resetToNode:51,addFile:52,loadFolder:53,openFileById:54,focusItem:55,handleFilesKeydown:56,resetState:57},null,[-1,-1,-1,-1])}get resetToNode(){return this.$$.ctx[51]}get addFile(){return this.$$.ctx[52]}get loadFolder(){return this.$$.ctx[53]}get openFileById(){return this.$$.ctx[54]}get focusItem(){return this.$$.ctx[55]}get handleFilesKeydown(){return this.$$.ctx[56]}get resetState(){return this.$$.ctx[57]}}const{Boolean:Gd}=Ls;function Tc(n,e,t){const l=n.slice();return l[463]=e[t],l}function Sc(n,e,t){const l=n.slice();return l[466]=e[t],l}function Cc(n,e,t){const l=n.slice();return l[469]=e[t],l}function Ac(n,e,t){const l=n.slice();return l[469]=e[t],l}function Nc(n,e,t){const l=n.slice();return l[486]=e[t],l}function Ic(n,e,t){const l=n.slice();return l[513]=e[t],l}function Rc(n,e,t){const l=n.slice();return l[486]=e[t],l}function Mc(n,e,t){const l=n.slice();return l[513]=e[t],l}function Lc(n,e,t){const l=n.slice();return l[520]=e[t],l}function Oc(n,e,t){const l=n.slice();return l[520]=e[t],l}function Dc(n,e,t){const l=n.slice();return l[489]=e[t],l[509]=e,l[510]=t,l}function Pc(n,e,t){const l=n.slice();return l[486]=e[t],l}function qc(n,e,t){const l=n.slice();return l[506]=e[t],l}function zc(n,e,t){const l=n.slice();return l[474]=e[t],l}function Bc(n,e,t){const l=n.slice();return l[499]=e[t],l}function Fc(n,e,t){const l=n.slice();return l[474]=e[t],l}function jc(n,e,t){const l=n.slice();return l[486]=e[t],l}function Uc(n,e,t){const l=n.slice();return l[483]=e[t],l}function Hc(n,e,t){const l=n.slice();return l[486]=e[t],l}function Wc(n,e,t){const l=n.slice();return l[489]=e[t],l[490]=e,l[491]=t,l}function Gc(n,e,t){const l=n.slice();return l[486]=e[t],l}function Kc(n,e,t){const l=n.slice();return l[480]=e[t],l}function Vc(n,e,t){const l=n.slice();return l[477]=e[t],l}function Zc(n,e,t){const l=n.slice();return l[474]=e[t],l}function Yc(n,e,t){const l=n.slice();return l[496]=e[t],l}function Xc(n,e,t){const l=n.slice();return l[527]=e[t],l}function iw(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M,q,X,Z,J,ee,te,le,_e,oe,ze,Ge,Ie,ne,re,Ne,Fe,we,je,xe=n[97]&&Jc(n),Ae=Te(n[0]),Ve=[];for(let pe=0;pe<Ae.length;pe+=1)Ve[pe]=$c(Xc(n,Ae,pe));const Ue=[aw,rw],Se=[];function He(pe,qe){return pe[14].length>0?0:1}I=He(n),O=Se[I]=Ue[I](n),B=new O0({props:{syncStatus:n[112],syncLoading:n[113],syncMessage:n[114],syncMessageKind:n[115],onSync:n[228],onOpenSettings:n[234]}}),M=new y2({props:{title:n[119],subtitle:n[118],wailsCall:de,typeLabel:n[196],onOpenSearchResult:n[223],$$slots:{actions:[fw]},$$scope:{ctx:n}}});let Oe=n[34]&&nu(n);const Ke=[vw,kw,bw,_w,gw,mw,hw,pw,dw],Pe=[];function ue(pe,qe){return qe[0]&2&&(Z=null),pe[37]?0:pe[2]?1:pe[1]==="inbox"?2:pe[1]==="trash"?3:pe[1]==="journal"?4:pe[1]==="today"?5:pe[1]==="activity"?6:(Z==null&&(Z=!!(pe[1]&&pe[1].startsWith("plugin:"))),Z?7:8)}J=ue(n,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]),ee=Pe[J]=Ke[J](n);let be=n[80]&&rf(n),x=n[84].visible&&uf(n),ye=n[51]&&hf(n),me=n[85]&&mf(n),Re=n[104]&&_f(n),ft=n[107]&&kf(n),it=n[70]&&Ef(n),Ze=n[99]&&Sf(n),dt=n[91]&&Cf(n),Je=n[13]&&Af(n);return{c(){e=f("div"),xe&&xe.c(),t=w(),l=f("aside"),i=f("div"),o=f("img"),c=w(),u=f("span"),u.textContent=`${k("nav.brand")}`,d=w(),p=f("nav"),h=f("div"),m=f("div"),m.textContent=`${k("nav.system")}`,g=w();for(let pe=0;pe<Ve.length;pe+=1)Ve[pe].c();b=w(),v=f("div"),y=f("div"),E=f("span"),E.textContent=`${k("nav.workspace")}`,T=w(),N=f("button"),N.textContent="+",A=w(),O.c(),R=w(),D=f("div"),Qe(B.$$.fragment),j=w(),U=f("div"),z=f("button"),z.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1uu9qhk"><circle cx="12" cy="12" r="3" class="svelte-1uu9qhk"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" class="svelte-1uu9qhk"></path></svg>',W=w(),K=f("span"),Y=H(n[33]),F=w(),L=f("main"),Qe(M.$$.fragment),q=w(),Oe&&Oe.c(),X=w(),ee.c(),te=w(),be&&be.c(),le=w(),x&&x.c(),_e=w(),ye&&ye.c(),oe=w(),me&&me.c(),ze=w(),Re&&Re.c(),Ge=w(),ft&&ft.c(),Ie=w(),it&&it.c(),ne=w(),Ze&&Ze.c(),re=w(),dt&&dt.c(),Ne=w(),Je&&Je.c(),r(o,"class","logo svelte-1uu9qhk"),Pl(o.src,s="/assets/app-icons/icon_32x32.png")||r(o,"src",s),r(o,"width","20"),r(o,"height","20"),r(o,"alt",""),r(u,"class","brand-name svelte-1uu9qhk"),r(i,"class","sidebar-brand svelte-1uu9qhk"),r(m,"class","nav-label svelte-1uu9qhk"),r(h,"class","nav-group svelte-1uu9qhk"),r(E,"class","svelte-1uu9qhk"),r(N,"class","nav-add-btn svelte-1uu9qhk"),r(N,"title",k("common.create")),r(y,"class","nav-label-row svelte-1uu9qhk"),r(v,"class","nav-group svelte-1uu9qhk"),r(p,"class","sidebar-nav svelte-1uu9qhk"),r(z,"class","sidebar-settings-btn svelte-1uu9qhk"),r(z,"title",k("common.settings")),r(K,"class","version svelte-1uu9qhk"),r(U,"class","sidebar-footer-row svelte-1uu9qhk"),r(D,"class","sidebar-footer svelte-1uu9qhk"),r(l,"class","sidebar svelte-1uu9qhk"),r(L,"class","main svelte-1uu9qhk"),r(e,"class","app svelte-1uu9qhk")},m(pe,qe){C(pe,e,qe),xe&&xe.m(e,null),a(e,t),a(e,l),a(l,i),a(i,o),a(i,c),a(i,u),a(l,d),a(l,p),a(p,h),a(h,m),a(h,g);for(let pt=0;pt<Ve.length;pt+=1)Ve[pt]&&Ve[pt].m(h,null);a(p,b),a(p,v),a(v,y),a(y,E),a(y,T),a(y,N),a(v,A),Se[I].m(v,null),a(l,R),a(l,D),Ye(B,D,null),a(D,j),a(D,U),a(U,z),a(U,W),a(U,K),a(K,Y),a(e,F),a(e,L),Ye(M,L,null),a(L,q),Oe&&Oe.m(L,null),a(L,X),Pe[J].m(L,null),a(L,te),be&&be.m(L,null),a(L,le),x&&x.m(L,null),a(L,_e),ye&&ye.m(L,null),a(L,oe),me&&me.m(L,null),a(L,ze),Re&&Re.m(L,null),a(L,Ge),ft&&ft.m(L,null),a(L,Ie),it&&it.m(L,null),a(L,ne),Ze&&Ze.m(L,null),a(L,re),dt&&dt.m(L,null),a(L,Ne),Je&&Je.m(L,null),Fe=!0,we||(je=[P(N,"click",n[133]),P(z,"click",n[235])],we=!0)},p(pe,qe){if(pe[97]?xe?xe.p(pe,qe):(xe=Jc(pe),xe.c(),xe.m(e,t)):xe&&(xe.d(1),xe=null),qe[0]&3|qe[1]&1073741824|qe[2]&8192|qe[4]&1){Ae=Te(pe[0]);let mt;for(mt=0;mt<Ae.length;mt+=1){const Mt=Xc(pe,Ae,mt);Ve[mt]?Ve[mt].p(Mt,qe):(Ve[mt]=$c(Mt),Ve[mt].c(),Ve[mt].m(h,null))}for(;mt<Ve.length;mt+=1)Ve[mt].d(1);Ve.length=Ae.length}let pt=I;I=He(pe),I===pt?Se[I].p(pe,qe):(yt(),ke(Se[pt],1,1,()=>{Se[pt]=null}),Et(),O=Se[I],O?O.p(pe,qe):(O=Se[I]=Ue[I](pe),O.c()),ge(O,1),O.m(v,null));const vt={};qe[3]&524288&&(vt.syncStatus=pe[112]),qe[3]&1048576&&(vt.syncLoading=pe[113]),qe[3]&2097152&&(vt.syncMessage=pe[114]),qe[3]&4194304&&(vt.syncMessageKind=pe[115]),B.$set(vt),(!Fe||qe[1]&4)&&Q(Y,pe[33]);const At={};qe[3]&67108864&&(At.title=pe[119]),qe[3]&33554432&&(At.subtitle=pe[118]),qe[0]&2|qe[2]&16480|qe[17]&8&&(At.$$scope={dirty:qe,ctx:pe}),M.$set(At),pe[34]?Oe?Oe.p(pe,qe):(Oe=nu(pe),Oe.c(),Oe.m(L,X)):Oe&&(Oe.d(1),Oe=null);let Zt=J;J=ue(pe,qe),J===Zt?Pe[J].p(pe,qe):(yt(),ke(Pe[Zt],1,1,()=>{Pe[Zt]=null}),Et(),ee=Pe[J],ee?ee.p(pe,qe):(ee=Pe[J]=Ke[J](pe),ee.c()),ge(ee,1),ee.m(L,te)),pe[80]?be?(be.p(pe,qe),qe[2]&262144&&ge(be,1)):(be=rf(pe),be.c(),ge(be,1),be.m(L,le)):be&&(yt(),ke(be,1,1,()=>{be=null}),Et()),pe[84].visible?x?(x.p(pe,qe),qe[2]&4194304&&ge(x,1)):(x=uf(pe),x.c(),ge(x,1),x.m(L,_e)):x&&(yt(),ke(x,1,1,()=>{x=null}),Et()),pe[51]?ye?ye.p(pe,qe):(ye=hf(pe),ye.c(),ye.m(L,oe)):ye&&(ye.d(1),ye=null),pe[85]?me?me.p(pe,qe):(me=mf(pe),me.c(),me.m(L,ze)):me&&(me.d(1),me=null),pe[104]?Re?Re.p(pe,qe):(Re=_f(pe),Re.c(),Re.m(L,Ge)):Re&&(Re.d(1),Re=null),pe[107]?ft?ft.p(pe,qe):(ft=kf(pe),ft.c(),ft.m(L,Ie)):ft&&(ft.d(1),ft=null),pe[70]?it?it.p(pe,qe):(it=Ef(pe),it.c(),it.m(L,ne)):it&&(it.d(1),it=null),pe[99]?Ze?(Ze.p(pe,qe),qe[3]&64&&ge(Ze,1)):(Ze=Sf(pe),Ze.c(),ge(Ze,1),Ze.m(L,re)):Ze&&(yt(),ke(Ze,1,1,()=>{Ze=null}),Et()),pe[91]?dt?(dt.p(pe,qe),qe[2]&536870912&&ge(dt,1)):(dt=Cf(pe),dt.c(),ge(dt,1),dt.m(L,Ne)):dt&&(yt(),ke(dt,1,1,()=>{dt=null}),Et()),pe[13]?Je?(Je.p(pe,qe),qe[0]&8192&&ge(Je,1)):(Je=Af(pe),Je.c(),ge(Je,1),Je.m(L,null)):Je&&(yt(),ke(Je,1,1,()=>{Je=null}),Et())},i(pe){Fe||(ge(O),ge(B.$$.fragment,pe),ge(M.$$.fragment,pe),ge(ee),ge(be),ge(x),ge(Ze),ge(dt),ge(Je),Fe=!0)},o(pe){ke(O),ke(B.$$.fragment,pe),ke(M.$$.fragment,pe),ke(ee),ke(be),ke(x),ke(Ze),ke(dt),ke(Je),Fe=!1},d(pe){pe&&S(e),xe&&xe.d(),et(Ve,pe),Se[I].d(),Xe(B),Xe(M),Oe&&Oe.d(),Pe[J].d(),be&&be.d(),x&&x.d(),ye&&ye.d(),me&&me.d(),Re&&Re.d(),ft&&ft.d(),it&&it.d(),Ze&&Ze.d(),dt&&dt.d(),Je&&Je.d(),we=!1,Ce(je)}}}function sw(n){var l;let e,t;return e=new vv({props:{vaultPath:((l=n[10])==null?void 0:l.vaultPath)||"",onComplete:n[230]}}),{c(){Qe(e.$$.fragment)},m(i,o){Ye(e,i,o),t=!0},p(i,o){var c;const s={};o[0]&1024&&(s.vaultPath=((c=i[10])==null?void 0:c.vaultPath)||""),e.$set(s)},i(i){t||(ge(e.$$.fragment,i),t=!0)},o(i){ke(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function ow(n){let e,t;return e=new _v({props:{onComplete:n[229]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function Jc(n){let e,t,l;return{c(){e=f("div"),t=f("div"),l=H(n[98]),r(t,"class","capture-drop-box svelte-1uu9qhk"),r(e,"class","capture-drop-overlay svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,t),a(t,l)},p(i,o){o[3]&32&&Q(l,i[98])},d(i){i&&S(e)}}}function Qc(n){let e,t;return{c(){e=f("span"),t=H(n[61]),r(e,"class","nav-badge svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[1]&1073741824&&Q(t,l[61])},d(l){l&&S(e)}}}function xc(n){let e,t;return{c(){e=f("span"),t=H(n[75]),r(e,"class","nav-badge svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[2]&8192&&Q(t,l[75])},d(l){l&&S(e)}}}function $c(n){let e,t=n[527].label+"",l,i,o,s,c,u,d,p=n[527].id==="journal"&&n[61]>0&&Qc(n),h=n[527].id==="trash"&&n[75]>0&&xc(n);function m(){return n[233](n[527])}return{c(){e=f("button"),l=H(t),i=w(),p&&p.c(),o=w(),h&&h.c(),s=w(),r(e,"class",c="nav-item "+(n[1]===n[527].id?"selected":"")+" svelte-1uu9qhk")},m(g,b){C(g,e,b),a(e,l),a(e,i),p&&p.m(e,null),a(e,o),h&&h.m(e,null),a(e,s),u||(d=P(e,"click",m),u=!0)},p(g,b){n=g,b[0]&1&&t!==(t=n[527].label+"")&&Q(l,t),n[527].id==="journal"&&n[61]>0?p?p.p(n,b):(p=Qc(n),p.c(),p.m(e,o)):p&&(p.d(1),p=null),n[527].id==="trash"&&n[75]>0?h?h.p(n,b):(h=xc(n),h.c(),h.m(e,s)):h&&(h.d(1),h=null),b[0]&3&&c!==(c="nav-item "+(n[1]===n[527].id?"selected":"")+" svelte-1uu9qhk")&&r(e,"class",c)},d(g){g&&S(e),p&&p.d(),h&&h.d(),u=!1,d()}}}function rw(n){let e;return{c(){e=f("div"),e.textContent=`${k("nav.noNodes")}`,r(e,"class","nav-empty svelte-1uu9qhk")},m(t,l){C(t,e,l)},p:se,i:se,o:se,d(t){t&&S(e)}}}function aw(n){var s;let e,t,l,i,o;return t=new zd({props:{nodes:n[14],expanded:n[90],selectedNodeId:((s=n[2])==null?void 0:s.id)||"",onSelect:n[125],onToggle:n[138],onContextMenu:n[136],onDrop:n[139]}}),{c(){e=f("div"),Qe(t.$$.fragment),r(e,"class","workspace-tree-area svelte-1uu9qhk"),r(e,"role","region"),r(e,"aria-label",k("nav.workspace")),ce(e,"drop-valid",n[95])},m(c,u){C(c,e,u),Ye(t,e,null),l=!0,i||(o=[P(e,"dragover",ji(n[141])),P(e,"dragleave",n[142]),P(e,"drop",n[140])],i=!0)},p(c,u){var p;const d={};u[0]&16384&&(d.nodes=c[14]),u[2]&268435456&&(d.expanded=c[90]),u[0]&4&&(d.selectedNodeId=((p=c[2])==null?void 0:p.id)||""),t.$set(d),(!l||u[3]&4)&&ce(e,"drop-valid",c[95])},i(c){l||(ge(t.$$.fragment,c),l=!0)},o(c){ke(t.$$.fragment,c),l=!1},d(c){c&&S(e),Xe(t),i=!1,Ce(o)}}}function cw(n){let e,t,l,i=Tt("emptyTrash",14)+"",o,s=k("trash.emptyTrash")+"",c,u,d,p,h,m=n[76].length>0&&eu(n);return{c(){m&&m.c(),e=w(),t=f("button"),l=new Ri(!1),o=w(),c=H(s),u=w(),d=f("button"),d.textContent=`${k("trash.openFolder")}`,l.a=o,r(t,"class","btn btn-sm btn-danger svelte-1uu9qhk"),r(d,"class","btn btn-sm svelte-1uu9qhk")},m(g,b){m&&m.m(g,b),C(g,e,b),C(g,t,b),l.m(i,t),a(t,o),a(t,c),C(g,u,b),C(g,d,b),p||(h=[P(t,"click",n[177]),P(d,"click",n[238])],p=!0)},p(g,b){g[76].length>0?m?m.p(g,b):(m=eu(g),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null)},d(g){g&&(S(e),S(t),S(u),S(d)),m&&m.d(g),p=!1,Ce(h)}}}function uw(n){let e,t=(n[67]?k("common.loading"):k("inbox.pasteClipboard"))+"",l,i,o,s,c,u=n[68]&&tu(n);return{c(){e=f("button"),l=H(t),i=w(),u&&u.c(),o=kt(),r(e,"class","btn btn-primary svelte-1uu9qhk"),e.disabled=n[67]},m(d,p){C(d,e,p),a(e,l),C(d,i,p),u&&u.m(d,p),C(d,o,p),s||(c=P(e,"click",n[198]),s=!0)},p(d,p){p[2]&32&&t!==(t=(d[67]?k("common.loading"):k("inbox.pasteClipboard"))+"")&&Q(l,t),p[2]&32&&(e.disabled=d[67]),d[68]?u?u.p(d,p):(u=tu(d),u.c(),u.m(o.parentNode,o)):u&&(u.d(1),u=null)},d(d){d&&(S(e),S(i),S(o)),u&&u.d(d),s=!1,c()}}}function eu(n){let e,t,l=Tt("restore",14)+"",i,o=k("trash.restore")+"",s,c,u=n[76].length+"",d,p,h,m,g,b=Tt("purge",14)+"",v,y=k("common.delete")+"",E,T,N=n[76].length+"",A,I,O,R;return{c(){e=f("button"),t=new Ri(!1),i=w(),s=H(o),c=H(" ("),d=H(u),p=H(")"),h=w(),m=f("button"),g=new Ri(!1),v=w(),E=H(y),T=H(" ("),A=H(N),I=H(")"),t.a=i,r(e,"class","btn btn-sm btn-primary svelte-1uu9qhk"),g.a=v,r(m,"class","btn btn-sm btn-danger svelte-1uu9qhk")},m(D,B){C(D,e,B),t.m(l,e),a(e,i),a(e,s),a(e,c),a(e,d),a(e,p),C(D,h,B),C(D,m,B),g.m(b,m),a(m,v),a(m,E),a(m,T),a(m,A),a(m,I),O||(R=[P(e,"click",n[236]),P(m,"click",n[237])],O=!0)},p(D,B){B[2]&16384&&u!==(u=D[76].length+"")&&Q(d,u),B[2]&16384&&N!==(N=D[76].length+"")&&Q(A,N)},d(D){D&&(S(e),S(h),S(m)),O=!1,Ce(R)}}}function tu(n){let e,t;return{c(){e=f("span"),t=H(n[68]),r(e,"class","inbox-capture-status svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[2]&64&&Q(t,l[68])},d(l){l&&S(e)}}}function fw(n){let e;function t(o,s){if(o[1]==="inbox")return uw;if(o[1]==="trash")return cw}let l=t(n),i=l&&l(n);return{c(){e=f("div"),i&&i.c(),r(e,"slot","actions"),r(e,"class","header-actions svelte-1uu9qhk")},m(o,s){C(o,e,s),i&&i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i&&i.d(1),i=l&&l(o),i&&(i.c(),i.m(e,null)))},d(o){o&&S(e),i&&i.d()}}}function nu(n){let e,t=n[120](n[34])+"",l,i,o,s,c;return{c(){e=f("div"),l=H(t),i=w(),o=f("button"),o.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-1uu9qhk"><line x1="18" y1="6" x2="6" y2="18" class="svelte-1uu9qhk"></line><line x1="6" y1="6" x2="18" y2="18" class="svelte-1uu9qhk"></line></svg>',r(o,"class","dismiss-btn svelte-1uu9qhk"),r(o,"aria-label","Dismiss"),r(e,"class","error-banner svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(u,d){C(u,e,d),a(e,l),a(e,i),a(e,o),s||(c=[P(o,"click",We(n[239])),P(e,"click",n[240]),P(e,"keydown",function(){pl(zn(n[241]))&&zn(n[241]).apply(this,arguments)})],s=!0)},p(u,d){n=u,d[1]&8&&t!==(t=n[120](n[34])+"")&&Q(l,t)},d(u){u&&S(e),s=!1,Ce(c)}}}function dw(n){let e,t,l;function i(c,u){if(c[89])return Ew;if(c[0].length>0)return yw;if(c[34])return ww}let o=i(n),s=o&&o(n);return{c(){e=f("div"),t=f("h2"),t.textContent=`${k("welcome.title")}`,l=w(),s&&s.c(),r(t,"class","svelte-1uu9qhk"),r(e,"class","welcome svelte-1uu9qhk")},m(c,u){C(c,e,u),a(e,t),a(e,l),s&&s.m(e,null)},p(c,u){o===(o=i(c))&&s?s.p(c,u):(s&&s.d(1),s=o&&o(c),s&&(s.c(),s.m(e,null)))},i:se,o:se,d(c){c&&S(e),s&&s.d()}}}function pw(n){let e,t;return e=new a2({props:{sectionId:n[1]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[0]&2&&(o.sectionId=l[1]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function hw(n){let e;function t(o,s){return o[17].length===0?Sw:Tw}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","activity-feed svelte-1uu9qhk")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:se,o:se,d(o){o&&S(e),i.d()}}}function mw(n){let e,t,l,i;const o=[Aw,Cw],s=[];function c(u,d){return u[16]?0:1}return e=c(n),t=s[e]=o[e](n),{c(){t.c(),l=kt()},m(u,d){s[e].m(u,d),C(u,l,d),i=!0},p(u,d){let p=e;e=c(u),e===p?s[e].p(u,d):(yt(),ke(s[p],1,1,()=>{s[p]=null}),Et(),t=s[e],t?t.p(u,d):(t=s[e]=o[e](u),t.c()),ge(t,1),t.m(l.parentNode,l))},i(u){i||(ge(t),i=!0)},o(u){ke(t),i=!1},d(u){u&&S(l),s[e].d(u)}}}function gw(n){let e,t,l,i=k("suggest.title")+"",o,s,c,u,d,p,h,m=n[61]>0&&su(n);function g(y,E){return y[28]==="suggestions"?Iw:Nw}let b=g(n),v=b(n);return{c(){e=f("div"),t=f("div"),l=f("button"),o=H(i),s=w(),m&&m.c(),c=w(),u=f("button"),u.textContent=`${k("journal.worklogTab")}`,d=w(),v.c(),r(l,"class","journal-tab svelte-1uu9qhk"),ce(l,"active",n[28]==="suggestions"),r(u,"class","journal-tab svelte-1uu9qhk"),ce(u,"active",n[28]==="worklog"),r(t,"class","journal-tabs svelte-1uu9qhk"),r(e,"class","journal-screen svelte-1uu9qhk")},m(y,E){C(y,e,E),a(e,t),a(t,l),a(l,o),a(l,s),m&&m.m(l,null),a(t,c),a(t,u),a(e,d),v.m(e,null),p||(h=[P(l,"click",n[313]),P(u,"click",n[314])],p=!0)},p(y,E){y[61]>0?m?m.p(y,E):(m=su(y),m.c(),m.m(l,null)):m&&(m.d(1),m=null),E[0]&268435456&&ce(l,"active",y[28]==="suggestions"),E[0]&268435456&&ce(u,"active",y[28]==="worklog"),b===(b=g(y))&&v?v.p(y,E):(v.d(1),v=b(y),v&&(v.c(),v.m(e,null)))},i:se,o:se,d(y){y&&S(e),m&&m.d(),v.d(),p=!1,Ce(h)}}}function _w(n){let e,t,l,i,o,s;function c(p,h){return!p[7]||(p[7].nodes||[]).length===0?Ww:Hw}let u=c(n),d=u(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("p"),o=H(n[78]),s=w(),d.c(),r(i,"class","svelte-1uu9qhk"),r(l,"class","svelte-1uu9qhk"),r(t,"class","trash-header svelte-1uu9qhk"),r(e,"class","trash-screen svelte-1uu9qhk")},m(p,h){C(p,e,h),a(e,t),a(t,l),a(l,i),a(i,o),a(e,s),d.m(e,null)},p(p,h){h[2]&65536&&Q(o,p[78]),u===(u=c(p))&&d?d.p(p,h):(d.d(1),d=u(p),d&&(d.c(),d.m(e,null)))},i:se,o:se,d(p){p&&S(e),d.d()}}}function bw(n){let e,t,l,i,o,s,c,u,d=n[3].length>0&&Ru(n);function p(g,b){return g[3].length===0?Yw:g[117]?Zw:Vw}let h=p(n),m=h(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("p"),i.textContent=`${k("inbox.subtitle")}`,o=w(),d&&d.c(),s=w(),m.c(),r(i,"class","svelte-1uu9qhk"),r(l,"class","svelte-1uu9qhk"),r(t,"class","inbox-header svelte-1uu9qhk"),r(e,"class","inbox-screen svelte-1uu9qhk"),r(e,"role","region"),r(e,"aria-label",k("nav.inbox")),ce(e,"drop-valid",n[96])},m(g,b){C(g,e,b),a(e,t),a(t,l),a(l,i),a(e,o),d&&d.m(e,null),a(e,s),m.m(e,null),c||(u=[P(e,"dragover",n[199]),P(e,"dragleave",n[200]),P(e,"drop",n[201])],c=!0)},p(g,b){g[3].length>0?d?d.p(g,b):(d=Ru(g),d.c(),d.m(e,s)):d&&(d.d(1),d=null),h===(h=p(g))&&m?m.p(g,b):(m.d(1),m=h(g),m&&(m.c(),m.m(e,null))),b[3]&8&&ce(e,"drop-valid",g[96])},i:se,o:se,d(g){g&&S(e),d&&d.d(),m.d(),c=!1,Ce(u)}}}function kw(n){let e,t,l,i,o,s,c=Te(n[122]),u=[];for(let m=0;m<c.length;m+=1)u[m]=Du(Yc(n,c,m));const d=[fy,uy,cy,ay,ry,oy,sy,iy],p=[];function h(m,g){return m[35]==="overview"?0:m[35]==="notes"?1:m[35]==="files"?2:m[35]==="inbox"?3:m[35]==="links"?4:m[35]==="actions"?5:m[35]==="worklog"?6:m[35]==="activity"?7:-1}return~(i=h(n))&&(o=p[i]=d[i](n)),{c(){e=f("div");for(let m=0;m<u.length;m+=1)u[m].c();t=w(),l=f("div"),o&&o.c(),r(e,"class","tabs svelte-1uu9qhk"),r(l,"class","tab-content svelte-1uu9qhk")},m(m,g){C(m,e,g);for(let b=0;b<u.length;b+=1)u[b]&&u[b].m(e,null);C(m,t,g),C(m,l,g),~i&&p[i].m(l,null),s=!0},p(m,g){if(g[1]&16|g[3]&1610612736){c=Te(m[122]);let v;for(v=0;v<c.length;v+=1){const y=Yc(m,c,v);u[v]?u[v].p(y,g):(u[v]=Du(y),u[v].c(),u[v].m(e,null))}for(;v<u.length;v+=1)u[v].d(1);u.length=c.length}let b=i;i=h(m),i===b?~i&&p[i].p(m,g):(o&&(yt(),ke(p[b],1,1,()=>{p[b]=null}),Et()),~i?(o=p[i],o?o.p(m,g):(o=p[i]=d[i](m),o.c()),ge(o,1),o.m(l,null)):o=null)},i(m){s||(ge(o),s=!0)},o(m){ke(o),s=!1},d(m){m&&(S(e),S(t),S(l)),et(u,m),~i&&p[i].d()}}}function vw(n){let e,t,l,i,o,s,c,u,d,p,h,m;function g(E,T){return E[47]===E[37].id?Ry:Iy}let b=g(n),v=b(n),y={content:n[37].content,viewMode:n[40],placeholder:k("note.placeholder")};return d=new M2({props:y}),n[245](d),d.$on("content-change",n[161]),d.$on("mode-change",n[162]),d.$on("save",n[153]),d.$on("insert-link",n[163]),d.$on("insert-internal-link",n[164]),d.$on("verstak-link",n[160]),{c(){e=f("div"),t=f("div"),v.c(),l=w(),i=f("div"),o=f("button"),o.textContent=`${k("common.save")}`,s=w(),c=f("button"),c.textContent=`${k("common.close")}`,u=w(),Qe(d.$$.fragment),r(o,"class","btn btn-primary svelte-1uu9qhk"),r(c,"class","btn svelte-1uu9qhk"),r(i,"class","note-editor-actions svelte-1uu9qhk"),r(t,"class","note-editor-header svelte-1uu9qhk"),r(e,"class","note-editor-wrapper svelte-1uu9qhk")},m(E,T){C(E,e,T),a(e,t),v.m(t,null),a(t,l),a(t,i),a(i,o),a(i,s),a(i,c),a(e,u),Ye(d,e,null),p=!0,h||(m=[P(o,"click",n[153]),P(c,"click",n[152])],h=!0)},p(E,T){b===(b=g(E))&&v?v.p(E,T):(v.d(1),v=b(E),v&&(v.c(),v.m(t,l)));const N={};T[1]&64&&(N.content=E[37].content),T[1]&512&&(N.viewMode=E[40]),d.$set(N)},i(E){p||(ge(d.$$.fragment,E),p=!0)},o(E){ke(d.$$.fragment,E),p=!1},d(E){E&&S(e),v.d(),n[245](null),Xe(d),h=!1,Ce(m)}}}function ww(n){let e,t=k("common.error")+"",l,i,o;return{c(){e=f("p"),l=H(t),i=w(),o=H(n[34]),r(e,"class","error-text svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,l),a(e,i),a(e,o)},p(s,c){c[1]&8&&Q(o,s[34])},d(s){s&&S(e)}}}function yw(n){let e,t,l;return{c(){e=f("p"),e.textContent=`${k("welcome.selectSection")}`,t=w(),l=f("p"),l.textContent=`${k("welcome.createCase")}`,r(e,"class","svelte-1uu9qhk"),r(l,"class","hint svelte-1uu9qhk")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},p:se,d(i){i&&(S(e),S(t),S(l))}}}function Ew(n){let e;return{c(){e=f("p"),e.textContent=`${k("common.loading")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Tw(n){let e,t=Te(n[17]),l=[];for(let i=0;i<t.length;i+=1)l[i]=iu(Nc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","activity-feed-events svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[0]&131072|o[6]&256|o[7]&32){t=Te(i[17]);let s;for(s=0;s<t.length;s+=1){const c=Nc(i,t,s);l[s]?l[s].p(c,o):(l[s]=iu(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Sw(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("activity.empty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function lu(n){let e,t=n[486].targetType+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","activity-feed-target svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&131072&&t!==(t=i[486].targetType+"")&&Q(l,t)},d(i){i&&S(e)}}}function iu(n){let e,t,l=ni(n[486].eventType)+"",i,o,s,c,u=n[486].title+"",d,p,h,m,g=n[194](n[486].eventType)+"",b,v,y,E,T=qn(n[486].createdAt)+"",N,A,I=rn(n[486].createdAt)+"",O,R,D,B,j=n[486].targetType&&lu(n);function U(){return n[351](n[486])}function z(...W){return n[352](n[486],...W)}return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),s=f("div"),c=f("span"),d=H(u),p=w(),h=f("div"),m=f("span"),b=H(g),v=w(),j&&j.c(),y=w(),E=f("span"),N=H(T),A=w(),O=H(I),R=w(),r(t,"class","activity-feed-icon svelte-1uu9qhk"),r(c,"class","activity-feed-title svelte-1uu9qhk"),r(m,"class","activity-feed-type svelte-1uu9qhk"),r(E,"class","activity-feed-time svelte-1uu9qhk"),r(h,"class","activity-feed-meta svelte-1uu9qhk"),r(s,"class","activity-feed-body svelte-1uu9qhk"),r(e,"class","activity-feed-event svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(W,K){C(W,e,K),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,d),a(s,p),a(s,h),a(h,m),a(m,b),a(h,v),j&&j.m(h,null),a(h,y),a(h,E),a(E,N),a(E,A),a(E,O),a(e,R),D||(B=[P(e,"click",U),P(e,"keydown",z)],D=!0)},p(W,K){n=W,K[0]&131072&&l!==(l=ni(n[486].eventType)+"")&&Q(i,l),K[0]&131072&&u!==(u=n[486].title+"")&&Q(d,u),K[0]&131072&&g!==(g=n[194](n[486].eventType)+"")&&Q(b,g),n[486].targetType?j?j.p(n,K):(j=lu(n),j.c(),j.m(h,y)):j&&(j.d(1),j=null),K[0]&131072&&T!==(T=qn(n[486].createdAt)+"")&&Q(N,T),K[0]&131072&&I!==(I=rn(n[486].createdAt)+"")&&Q(O,I)},d(W){W&&S(e),j&&j.d(),D=!1,Ce(B)}}}function Cw(n){let e,t,l,i;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("today.empty")}`,l=w(),i=f("p"),i.textContent=`${k("today.emptyHint")}`,r(t,"class","svelte-1uu9qhk"),r(i,"class","hint svelte-1uu9qhk"),r(e,"class","today-empty svelte-1uu9qhk")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:se,i:se,o:se,d(o){o&&S(e)}}}function Aw(n){let e,t;return e=new n2({props:{todayDashboard:n[16],suggestions:n[60],inProgressItems:n[62],todayCaptures:n[63],suggestionCount:n[60].length,formatTime:rn,eventLabel:n[194],eventIcon:ni,inboxMetaText:n[197],onOpenNodeById:n[342],onOpenActivityEvent:n[343],onOpenActivityTarget:n[344],onOpenSuggestionWorklog:n[345],onAcceptSuggestion:n[346],onDeleteSuggestion:n[347],onOpenNodeFolder:n[348],onOpenInboxArtifact:n[349],onOpenTrashNode:n[350],browserEvents:n[64],browserLoading:n[65],onBrowserAccept:n[181],onBrowserDismiss:n[182],onBrowserAttach:n[183],onBrowserRefresh:n[180]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[0]&65536&&(o.todayDashboard=l[16]),i[1]&536870912&&(o.suggestions=l[60]),i[2]&1&&(o.inProgressItems=l[62]),i[2]&2&&(o.todayCaptures=l[63]),i[1]&536870912&&(o.suggestionCount=l[60].length),i[2]&4&&(o.browserEvents=l[64]),i[2]&8&&(o.browserLoading=l[65]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function su(n){let e,t;return{c(){e=f("span"),t=H(n[61]),r(e,"class","tab-badge svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[1]&1073741824&&Q(t,l[61])},d(l){l&&S(e)}}}function Nw(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M,q,X,Z,J,ee,te,le,_e,oe,ze,Ge,Ie,ne,re,Ne,Fe,we,je,xe,Ae,Ve,Ue,Se=n[19]&&ou(n),He=n[27]&&fu(n);function Oe(me,Re){return me[26]?Mw:Rw}let Ke=Oe(n),Pe=Ke(n),ue=n[23]&&hu(n);function be(me,Re){return me[18].length===0?Ow:Lw}let x=be(n),ye=x(n);return{c(){Se&&Se.c(),e=w(),t=f("div"),l=f("div"),i=f("div"),i.textContent=`${k("journal.exportHeading")}`,o=w(),s=f("div"),c=f("button"),c.textContent=`${k("journal.exportCSV")}`,u=w(),d=f("button"),d.textContent=`${k("journal.exportMarkdown")}`,p=w(),h=f("button"),h.textContent="PDF",m=w(),He&&He.c(),g=w(),b=f("div"),v=f("div"),v.textContent=`${k("journal.filterHeading")}`,y=w(),E=f("div"),T=f("label"),N=f("span"),N.textContent=`${k("journal.dateFrom")}`,A=w(),I=f("input"),O=w(),R=f("label"),D=f("span"),D.textContent=`${k("journal.dateTo")}`,B=w(),j=f("input"),U=w(),z=f("label"),W=f("span"),W.textContent=`${k("journal.node")}`,K=w(),Y=f("div"),Pe.c(),F=w(),ue&&ue.c(),L=w(),M=f("label"),q=f("span"),q.textContent=`${k("journal.billable")}`,X=w(),Z=f("select"),J=f("option"),J.textContent=`${k("common.all")}`,ee=f("option"),ee.textContent=`${k("journal.billableYes")}`,te=f("option"),te.textContent=`${k("journal.billableNo")}`,le=w(),_e=f("label"),oe=f("span"),oe.textContent=`${k("journal.approx")}`,ze=w(),Ge=f("select"),Ie=f("option"),Ie.textContent=`${k("common.all")}`,ne=f("option"),ne.textContent=`${k("journal.approxExact")}`,re=f("option"),re.textContent=`${k("journal.approxEstimated")}`,Ne=w(),Fe=f("button"),Fe.textContent=`${k("journal.filter")}`,we=w(),je=f("button"),je.textContent=`${k("journal.reset")}`,xe=w(),ye.c(),Ae=kt(),r(i,"class","journal-export-heading svelte-1uu9qhk"),r(c,"class","btn btn-sm svelte-1uu9qhk"),r(d,"class","btn btn-sm svelte-1uu9qhk"),r(h,"class","btn btn-sm svelte-1uu9qhk"),r(s,"class","journal-export-row svelte-1uu9qhk"),r(l,"class","journal-export-section svelte-1uu9qhk"),r(v,"class","journal-filter-heading svelte-1uu9qhk"),r(N,"class","label-text svelte-1uu9qhk"),r(I,"type","date"),r(I,"class","svelte-1uu9qhk"),r(T,"class","svelte-1uu9qhk"),r(D,"class","label-text svelte-1uu9qhk"),r(j,"type","date"),r(j,"class","svelte-1uu9qhk"),r(R,"class","svelte-1uu9qhk"),r(W,"class","label-text svelte-1uu9qhk"),r(Y,"class","journal-node-picker svelte-1uu9qhk"),sn(Y,"position","relative"),r(z,"class","svelte-1uu9qhk"),r(q,"class","label-text svelte-1uu9qhk"),J.__value="all",Me(J,J.__value),r(J,"class","svelte-1uu9qhk"),ee.__value="yes",Me(ee,ee.__value),r(ee,"class","svelte-1uu9qhk"),te.__value="no",Me(te,te.__value),r(te,"class","svelte-1uu9qhk"),r(Z,"class","svelte-1uu9qhk"),n[24]===void 0&&hl(()=>n[334].call(Z)),r(M,"title",k("journal.billableHint")),r(M,"class","svelte-1uu9qhk"),r(oe,"class","label-text svelte-1uu9qhk"),Ie.__value="all",Me(Ie,Ie.__value),r(Ie,"class","svelte-1uu9qhk"),ne.__value="no",Me(ne,ne.__value),r(ne,"class","svelte-1uu9qhk"),re.__value="yes",Me(re,re.__value),r(re,"class","svelte-1uu9qhk"),r(Ge,"class","svelte-1uu9qhk"),n[25]===void 0&&hl(()=>n[335].call(Ge)),r(_e,"title",k("journal.approxHint")),r(_e,"class","svelte-1uu9qhk"),r(Fe,"class","btn btn-sm svelte-1uu9qhk"),r(je,"class","btn btn-sm svelte-1uu9qhk"),r(E,"class","journal-filters-row svelte-1uu9qhk"),r(b,"class","journal-filter-section svelte-1uu9qhk"),r(t,"class","journal-header svelte-1uu9qhk")},m(me,Re){Se&&Se.m(me,Re),C(me,e,Re),C(me,t,Re),a(t,l),a(l,i),a(l,o),a(l,s),a(s,c),a(s,u),a(s,d),a(s,p),a(s,h),a(s,m),He&&He.m(s,null),a(t,g),a(t,b),a(b,v),a(b,y),a(b,E),a(E,T),a(T,N),a(T,A),a(T,I),Me(I,n[20]),a(E,O),a(E,R),a(R,D),a(R,B),a(R,j),Me(j,n[21]),a(E,U),a(E,z),a(z,W),a(z,K),a(z,Y),Pe.m(Y,null),a(E,F),ue&&ue.m(E,null),a(E,L),a(E,M),a(M,q),a(M,X),a(M,Z),a(Z,J),a(Z,ee),a(Z,te),Yn(Z,n[24],!0),a(E,le),a(E,_e),a(_e,oe),a(_e,ze),a(_e,Ge),a(Ge,Ie),a(Ge,ne),a(Ge,re),Yn(Ge,n[25],!0),a(E,Ne),a(E,Fe),a(E,we),a(E,je),C(me,xe,Re),ye.m(me,Re),C(me,Ae,Re),Ve||(Ue=[P(c,"click",n[324]),P(d,"click",n[325]),P(h,"click",n[326]),P(I,"input",n[327]),P(j,"input",n[328]),P(Z,"change",n[334]),P(Ge,"change",n[335]),P(Fe,"click",n[186]),P(je,"click",n[193])],Ve=!0)},p(me,Re){me[19]?Se?Se.p(me,Re):(Se=ou(me),Se.c(),Se.m(e.parentNode,e)):Se&&(Se.d(1),Se=null),me[27]?He?He.p(me,Re):(He=fu(me),He.c(),He.m(s,null)):He&&(He.d(1),He=null),Re[0]&1048576&&Me(I,me[20]),Re[0]&2097152&&Me(j,me[21]),Ke===(Ke=Oe(me))&&Pe?Pe.p(me,Re):(Pe.d(1),Pe=Ke(me),Pe&&(Pe.c(),Pe.m(Y,null))),me[23]?ue?ue.p(me,Re):(ue=hu(me),ue.c(),ue.m(E,L)):ue&&(ue.d(1),ue=null),Re[0]&16777216&&Yn(Z,me[24]),Re[0]&33554432&&Yn(Ge,me[25]),x===(x=be(me))&&ye?ye.p(me,Re):(ye.d(1),ye=x(me),ye&&(ye.c(),ye.m(Ae.parentNode,Ae)))},d(me){me&&(S(e),S(t),S(xe),S(Ae)),Se&&Se.d(me),He&&He.d(),Pe.d(),ue&&ue.d(),ye.d(me),Ve=!1,Ce(Ue)}}}function Iw(n){let e;function t(o,s){return o[60].length===0?Uw:jw}let l=t(n),i=l(n);return{c(){i.c(),e=kt()},m(o,s){i.m(o,s),C(o,e,s)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){o&&S(e),i.d(o)}}}function ou(n){let e,t,l=k("journal.total")+"",i,o,s=Math.floor(n[19].totalMinutes/60)+"",c,u,d=n[19].totalMinutes%60+"",p,h,m=n[19].totalEntries+"",g,b,v=k("worklog.min")+"",y,E,T,N,A=n[19].byDay&&n[19].byDay.length>0&&ru(n),I=n[19].byNode&&n[19].byNode.length>0&&cu(n);return{c(){e=f("div"),t=f("div"),i=H(l),o=H(": "),c=H(s),u=H("ч "),p=H(d),h=H("м ("),g=H(m),b=w(),y=H(v),E=H(")"),T=w(),A&&A.c(),N=w(),I&&I.c(),r(t,"class","summary-total svelte-1uu9qhk"),r(e,"class","journal-summary svelte-1uu9qhk")},m(O,R){C(O,e,R),a(e,t),a(t,i),a(t,o),a(t,c),a(t,u),a(t,p),a(t,h),a(t,g),a(t,b),a(t,y),a(t,E),a(e,T),A&&A.m(e,null),a(e,N),I&&I.m(e,null)},p(O,R){R[0]&524288&&s!==(s=Math.floor(O[19].totalMinutes/60)+"")&&Q(c,s),R[0]&524288&&d!==(d=O[19].totalMinutes%60+"")&&Q(p,d),R[0]&524288&&m!==(m=O[19].totalEntries+"")&&Q(g,m),O[19].byDay&&O[19].byDay.length>0?A?A.p(O,R):(A=ru(O),A.c(),A.m(e,N)):A&&(A.d(1),A=null),O[19].byNode&&O[19].byNode.length>0?I?I.p(O,R):(I=cu(O),I.c(),I.m(e,null)):I&&(I.d(1),I=null)},d(O){O&&S(e),A&&A.d(),I&&I.d()}}}function ru(n){let e,t,l,i=Te(n[19].byDay),o=[];for(let s=0;s<i.length;s+=1)o[s]=au(Oc(n,i,s));return{c(){e=f("div"),t=f("div"),t.textContent=`${k("journal.byDay")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","summary-label svelte-1uu9qhk"),r(e,"class","summary-section svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[0]&524288){i=Te(s[19].byDay);let u;for(u=0;u<i.length;u+=1){const d=Oc(s,i,u);o[u]?o[u].p(d,c):(o[u]=au(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function au(n){let e,t,l=n[520].label+"",i,o,s=Math.floor(n[520].minutes/60)+"",c,u,d=n[520].minutes%60+"",p,h,m,g=n[520].count+"",b;return{c(){e=f("div"),t=f("span"),i=H(l),o=f("span"),c=H(s),u=H("ч "),p=H(d),h=H("м"),m=f("span"),b=H(g),r(t,"class","svelte-1uu9qhk"),r(o,"class","svelte-1uu9qhk"),r(m,"class","summary-count svelte-1uu9qhk"),r(e,"class","summary-row svelte-1uu9qhk")},m(v,y){C(v,e,y),a(e,t),a(t,i),a(e,o),a(o,c),a(o,u),a(o,p),a(o,h),a(e,m),a(m,b)},p(v,y){y[0]&524288&&l!==(l=v[520].label+"")&&Q(i,l),y[0]&524288&&s!==(s=Math.floor(v[520].minutes/60)+"")&&Q(c,s),y[0]&524288&&d!==(d=v[520].minutes%60+"")&&Q(p,d),y[0]&524288&&g!==(g=v[520].count+"")&&Q(b,g)},d(v){v&&S(e)}}}function cu(n){let e,t,l,i=Te(n[19].byNode),o=[];for(let s=0;s<i.length;s+=1)o[s]=uu(Lc(n,i,s));return{c(){e=f("div"),t=f("div"),t.textContent=`${k("journal.byNode")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","summary-label svelte-1uu9qhk"),r(e,"class","summary-section svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[0]&524288){i=Te(s[19].byNode);let u;for(u=0;u<i.length;u+=1){const d=Lc(s,i,u);o[u]?o[u].p(d,c):(o[u]=uu(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function uu(n){let e,t,l=n[520].label+"",i,o,s=Math.floor(n[520].minutes/60)+"",c,u,d=n[520].minutes%60+"",p,h,m,g=n[520].count+"",b;return{c(){e=f("div"),t=f("span"),i=H(l),o=f("span"),c=H(s),u=H("ч "),p=H(d),h=H("м"),m=f("span"),b=H(g),r(t,"class","svelte-1uu9qhk"),r(o,"class","svelte-1uu9qhk"),r(m,"class","summary-count svelte-1uu9qhk"),r(e,"class","summary-row svelte-1uu9qhk")},m(v,y){C(v,e,y),a(e,t),a(t,i),a(e,o),a(o,c),a(o,u),a(o,p),a(o,h),a(e,m),a(m,b)},p(v,y){y[0]&524288&&l!==(l=v[520].label+"")&&Q(i,l),y[0]&524288&&s!==(s=Math.floor(v[520].minutes/60)+"")&&Q(c,s),y[0]&524288&&d!==(d=v[520].minutes%60+"")&&Q(p,d),y[0]&524288&&g!==(g=v[520].count+"")&&Q(b,g)},d(v){v&&S(e)}}}function fu(n){let e,t;return{c(){e=f("span"),t=H(n[27]),r(e,"class","journal-status-msg svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&134217728&&Q(t,l[27])},d(l){l&&S(e)}}}function Rw(n){let e,t,l,i,o,s=n[31]&&du(n);return{c(){e=f("input"),t=w(),s&&s.c(),l=kt(),r(e,"type","text"),r(e,"placeholder",k("journal.nodeSearch")),r(e,"class","svelte-1uu9qhk")},m(c,u){C(c,e,u),Me(e,n[29]),C(c,t,u),s&&s.m(c,u),C(c,l,u),i||(o=[P(e,"input",n[330]),P(e,"input",n[190]),P(e,"blur",n[331])],i=!0)},p(c,u){u[0]&536870912&&e.value!==c[29]&&Me(e,c[29]),c[31]?s?s.p(c,u):(s=du(c),s.c(),s.m(l.parentNode,l)):s&&(s.d(1),s=null)},d(c){c&&(S(e),S(t),S(l)),s&&s.d(c),i=!1,Ce(o)}}}function Mw(n){let e,t,l,i,o,s;return{c(){e=f("button"),t=H(n[26]),l=w(),i=f("span"),i.textContent="✕",r(i,"class","journal-node-clear svelte-1uu9qhk"),r(e,"class","journal-selected-node svelte-1uu9qhk")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),o||(s=P(e,"click",n[329]),o=!0)},p(c,u){u[0]&67108864&&Q(t,c[26])},d(c){c&&S(e),o=!1,s()}}}function du(n){let e,t=Te(n[30]),l=[];for(let i=0;i<t.length;i+=1)l[i]=pu(Mc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","journal-search-dropdown svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[0]&1073741824|o[6]&32){t=Te(i[30]);let s;for(s=0;s<t.length;s+=1){const c=Mc(i,t,s);l[s]?l[s].p(c,o):(l[s]=pu(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function pu(n){let e,t,l=n[513].title+"",i,o,s,c=n[513].path+"",u,d,p,h;function m(){return n[332](n[513])}return{c(){e=f("button"),t=f("span"),i=H(l),o=w(),s=f("span"),u=H(c),d=w(),r(t,"class","journal-search-title svelte-1uu9qhk"),r(s,"class","journal-search-path svelte-1uu9qhk"),r(e,"class","journal-search-item svelte-1uu9qhk")},m(g,b){C(g,e,b),a(e,t),a(t,i),a(e,o),a(e,s),a(s,u),a(e,d),p||(h=P(e,"click",m),p=!0)},p(g,b){n=g,b[0]&1073741824&&l!==(l=n[513].title+"")&&Q(i,l),b[0]&1073741824&&c!==(c=n[513].path+"")&&Q(u,c)},d(g){g&&S(e),p=!1,h()}}}function hu(n){let e,t,l,i,o,s;return{c(){e=f("label"),t=f("input"),l=w(),i=f("span"),i.textContent=`${k("journal.includeChildren")}`,r(t,"type","checkbox"),r(t,"class","journal-include-chk svelte-1uu9qhk"),r(i,"class","svelte-1uu9qhk"),r(e,"class","checkbox-label svelte-1uu9qhk")},m(c,u){C(c,e,u),a(e,t),t.checked=n[22],a(e,l),a(e,i),o||(s=P(t,"change",n[333]),o=!0)},p(c,u){u[0]&4194304&&(t.checked=c[22])},d(c){c&&S(e),o=!1,s()}}}function Lw(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O=Te(n[18]),R=[];for(let D=0;D<O.length;D+=1)R[D]=wu(Ic(n,O,D));return{c(){e=f("div"),t=f("table"),l=f("thead"),i=f("tr"),o=f("th"),s=w(),c=f("th"),c.textContent=`${k("journal.title")}`,u=w(),d=f("th"),d.textContent=`${k("journal.node")}`,p=w(),h=f("th"),h.textContent=`${k("journal.path")}`,m=w(),g=f("th"),g.textContent=`${k("worklog.minutes")}`,b=w(),v=f("th"),v.textContent=`${k("journal.billable")}`,y=w(),E=f("th"),E.textContent=`${k("journal.approx")}`,T=w(),N=f("th"),N.textContent=`${k("common.date")}`,A=w(),I=f("tbody");for(let D=0;D<R.length;D+=1)R[D].c();r(o,"class","journal-toggle-col svelte-1uu9qhk"),r(c,"class","svelte-1uu9qhk"),r(d,"class","svelte-1uu9qhk"),r(h,"class","svelte-1uu9qhk"),r(g,"class","svelte-1uu9qhk"),r(v,"class","svelte-1uu9qhk"),r(E,"class","svelte-1uu9qhk"),r(N,"class","svelte-1uu9qhk"),r(i,"class","svelte-1uu9qhk"),r(l,"class","svelte-1uu9qhk"),r(I,"class","svelte-1uu9qhk"),r(t,"class","journal-table svelte-1uu9qhk"),r(e,"class","journal-table-wrap svelte-1uu9qhk")},m(D,B){C(D,e,B),a(e,t),a(t,l),a(l,i),a(i,o),a(i,s),a(i,c),a(i,u),a(i,d),a(i,p),a(i,h),a(i,m),a(i,g),a(i,b),a(i,v),a(i,y),a(i,E),a(i,T),a(i,N),a(t,A),a(t,I);for(let j=0;j<R.length;j+=1)R[j]&&R[j].m(I,null)},p(D,B){if(B[0]&262144|B[5]&9216|B[6]&260|B[7]&24){O=Te(D[18]);let j;for(j=0;j<O.length;j+=1){const U=Ic(D,O,j);R[j]?R[j].p(U,B):(R[j]=wu(U),R[j].c(),R[j].m(I,null))}for(;j<R.length;j+=1)R[j].d(1);R.length=O.length}},d(D){D&&S(e),et(R,D)}}}function Ow(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("journal.empty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function mu(n){let e;return{c(){e=H("✓")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function gu(n){let e;return{c(){e=H("~")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function _u(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y;function E(){return n[339](n[513])}function T(){return n[340](n[513])}let N=n[513].details&&bu(n);function A(D,B){return D[513].source==="manual"?Fw:D[513].source==="suggestion"&&D[513]._events&&D[513]._events.length>0?Bw:D[513].source==="suggestion"?zw:D[513].source==="unknown"||D[513].source==="imported"?qw:D[513]._hasEvents?Pw:Dw}let I=A(n),O=I(n),R=n[513]._events&&ku(n);return{c(){e=f("tr"),t=f("td"),l=f("div"),i=f("div"),o=f("button"),o.textContent=`${k("worklog.editEntry")}`,s=w(),c=f("button"),c.textContent=`${k("worklog.deleteEntry")}`,u=w(),N&&N.c(),d=w(),p=f("div"),h=f("span"),h.textContent=`${k("worklog.source")}`,m=w(),O.c(),g=w(),R&&R.c(),b=w(),r(o,"class","btn btn-sm svelte-1uu9qhk"),r(c,"class","btn btn-sm btn-danger svelte-1uu9qhk"),r(i,"class","journal-detail-actions svelte-1uu9qhk"),r(h,"class","journal-detail-label svelte-1uu9qhk"),r(p,"class","journal-detail-section svelte-1uu9qhk"),r(l,"class","journal-detail-body svelte-1uu9qhk"),r(t,"colspan","8"),r(t,"class","svelte-1uu9qhk"),r(e,"class","journal-row-detail svelte-1uu9qhk")},m(D,B){C(D,e,B),a(e,t),a(t,l),a(l,i),a(i,o),a(i,s),a(i,c),a(l,u),N&&N.m(l,null),a(l,d),a(l,p),a(p,h),a(p,m),O.m(p,null),a(l,g),R&&R.m(l,null),a(e,b),v||(y=[P(o,"click",We(E)),P(c,"click",We(T))],v=!0)},p(D,B){n=D,n[513].details?N?N.p(n,B):(N=bu(n),N.c(),N.m(l,d)):N&&(N.d(1),N=null),I!==(I=A(n))&&(O.d(1),O=I(n),O&&(O.c(),O.m(p,null))),n[513]._events?R?R.p(n,B):(R=ku(n),R.c(),R.m(l,null)):R&&(R.d(1),R=null)},d(D){D&&S(e),N&&N.d(),O.d(),R&&R.d(),v=!1,Ce(y)}}}function bu(n){let e,t,l,i,o=n[513].details+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${k("worklog.details")}`,l=w(),i=f("p"),s=H(o),r(t,"class","journal-detail-label svelte-1uu9qhk"),r(i,"class","svelte-1uu9qhk"),r(e,"class","journal-detail-section svelte-1uu9qhk")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&262144&&o!==(o=c[513].details+"")&&Q(s,o)},d(c){c&&S(e)}}}function Dw(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceUnknown")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Pw(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceSuggestion")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function qw(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceUnknown")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function zw(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceSuggestionNoEvents")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Bw(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceSuggestion")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Fw(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceManual")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function ku(n){let e,t,l,i=Te(n[513]._events),o=[];for(let s=0;s<i.length;s+=1)o[s]=vu(Rc(n,i,s));return{c(){e=f("div"),t=f("span"),t.textContent=`${k("journal.relatedEvents")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","journal-detail-label svelte-1uu9qhk"),r(e,"class","journal-detail-section svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[0]&262144|c[6]&256|c[7]&16){i=Te(s[513]._events);let u;for(u=0;u<i.length;u+=1){const d=Rc(s,i,u);o[u]?o[u].p(d,c):(o[u]=vu(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function vu(n){let e,t,l=rn(n[486].createdAt)+"",i,o,s,c=n[194](n[486].eventType)+"",u,d,p,h=n[486].title+"",m,g,b,v,y,E;function T(){return n[341](n[486])}return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),s=f("span"),u=H(c),d=w(),p=f("span"),m=H(h),g=w(),b=f("button"),b.textContent=`${k("common.open")}`,v=w(),r(t,"class","journal-event-time svelte-1uu9qhk"),r(s,"class","journal-event-type svelte-1uu9qhk"),r(p,"class","journal-event-title svelte-1uu9qhk"),r(b,"class","link-btn svelte-1uu9qhk"),r(e,"class","journal-event-row svelte-1uu9qhk")},m(N,A){C(N,e,A),a(e,t),a(t,i),a(e,o),a(e,s),a(s,u),a(e,d),a(e,p),a(p,m),a(e,g),a(e,b),a(e,v),y||(E=P(b,"click",T),y=!0)},p(N,A){n=N,A[0]&262144&&l!==(l=rn(n[486].createdAt)+"")&&Q(i,l),A[0]&262144&&c!==(c=n[194](n[486].eventType)+"")&&Q(u,c),A[0]&262144&&h!==(h=n[486].title+"")&&Q(m,h)},d(N){N&&S(e),y=!1,E()}}}function wu(n){let e,t,l,i=n[513]._expanded?"▾":"▸",o,s,c,u=n[513].summary+"",d,p,h,m,g=n[513].nodeTitle+"",b,v,y,E=n[513].nodePath+"",T,N,A,I=n[513].minutes+"",O,R,D,B,j,U,z,W=n[513].date+"",K,Y,F,L,M;function q(){return n[336](n[513])}let X=n[513].billable&&mu(),Z=n[513].approximate&&gu();function J(){return n[337](n[513])}function ee(...le){return n[338](n[513],...le)}let te=n[513]._expanded&&_u(n);return{c(){e=f("tr"),t=f("td"),l=f("span"),o=H(i),s=w(),c=f("td"),d=H(u),p=w(),h=f("td"),m=f("button"),b=H(g),v=w(),y=f("td"),T=H(E),N=w(),A=f("td"),O=H(I),R=w(),D=f("td"),X&&X.c(),B=w(),j=f("td"),Z&&Z.c(),U=w(),z=f("td"),K=H(W),Y=w(),te&&te.c(),F=kt(),r(l,"class","journal-toggle-icon svelte-1uu9qhk"),r(t,"class","journal-toggle-col svelte-1uu9qhk"),r(c,"class","journal-summary-cell svelte-1uu9qhk"),r(m,"class","link-btn svelte-1uu9qhk"),r(h,"class","svelte-1uu9qhk"),r(y,"class","journal-path-cell svelte-1uu9qhk"),r(A,"class","journal-min-cell svelte-1uu9qhk"),r(D,"class","journal-bool-cell svelte-1uu9qhk"),r(j,"class","journal-bool-cell svelte-1uu9qhk"),r(z,"class","journal-date-cell svelte-1uu9qhk"),r(e,"class","journal-row svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0"),ce(e,"expanded",n[513]._expanded)},m(le,_e){C(le,e,_e),a(e,t),a(t,l),a(l,o),a(e,s),a(e,c),a(c,d),a(e,p),a(e,h),a(h,m),a(m,b),a(e,v),a(e,y),a(y,T),a(e,N),a(e,A),a(A,O),a(e,R),a(e,D),X&&X.m(D,null),a(e,B),a(e,j),Z&&Z.m(j,null),a(e,U),a(e,z),a(z,K),C(le,Y,_e),te&&te.m(le,_e),C(le,F,_e),L||(M=[P(m,"click",We(q)),P(e,"click",J),P(e,"keydown",ee)],L=!0)},p(le,_e){n=le,_e[0]&262144&&i!==(i=n[513]._expanded?"▾":"▸")&&Q(o,i),_e[0]&262144&&u!==(u=n[513].summary+"")&&Q(d,u),_e[0]&262144&&g!==(g=n[513].nodeTitle+"")&&Q(b,g),_e[0]&262144&&E!==(E=n[513].nodePath+"")&&Q(T,E),_e[0]&262144&&I!==(I=n[513].minutes+"")&&Q(O,I),n[513].billable?X||(X=mu(),X.c(),X.m(D,null)):X&&(X.d(1),X=null),n[513].approximate?Z||(Z=gu(),Z.c(),Z.m(j,null)):Z&&(Z.d(1),Z=null),_e[0]&262144&&W!==(W=n[513].date+"")&&Q(K,W),_e[0]&262144&&ce(e,"expanded",n[513]._expanded),n[513]._expanded?te?te.p(n,_e):(te=_u(n),te.c(),te.m(F.parentNode,F)):te&&(te.d(1),te=null)},d(le){le&&(S(e),S(Y),S(F)),X&&X.d(),Z&&Z.d(),te&&te.d(le),L=!1,Ce(M)}}}function jw(n){let e,t=Te(n[60]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Au(Dc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","journal-suggestions svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[1]&536870912|o[4]&2097152|o[5]&1098907648|o[6]&256|o[7]&24){t=Te(i[60]);let s;for(s=0;s<t.length;s+=1){const c=Dc(i,t,s);l[s]?l[s].p(c,o):(l[s]=Au(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Uw(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("suggest.noSuggestions")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function yu(n){let e,t=n[489].events.length+"",l,i,o=k("suggest.detectedEvents")+"",s;return{c(){e=H("· "),l=H(t),i=w(),s=H(o)},m(c,u){C(c,e,u),C(c,l,u),C(c,i,u),C(c,s,u)},p(c,u){u[1]&536870912&&t!==(t=c[489].events.length+"")&&Q(l,t)},d(c){c&&(S(e),S(l),S(i),S(s))}}}function Eu(n){let e,t,l,i=Te(n[489].events),o=[];for(let s=0;s<i.length;s+=1)o[s]=Cu(Pc(n,i,s));return{c(){e=f("div"),t=f("div"),t.textContent=`${k("suggest.detectedEvents")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","suggestion-detail-title svelte-1uu9qhk"),r(e,"class","suggestion-detail svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[1]&536870912|c[4]&2097152|c[6]&256|c[7]&16){i=Te(s[489].events);let u;for(u=0;u<i.length;u+=1){const d=Pc(s,i,u);o[u]?o[u].p(d,c):(o[u]=Cu(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function Tu(n){let e,t=n[486].nodePath+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","suggestion-event-path svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[1]&536870912&&t!==(t=i[486].nodePath+"")&&Q(l,t)},d(i){i&&S(e)}}}function Su(n){let e,t,l;function i(){return n[323](n[486])}return{c(){e=f("button"),e.textContent=`${k("file.showInExplorer")}`,r(e,"class","link-btn svelte-1uu9qhk")},m(o,s){C(o,e,s),t||(l=P(e,"click",i),t=!0)},p(o,s){n=o},d(o){o&&S(e),t=!1,l()}}}function Cu(n){let e,t,l=rn(n[486].createdAt)+"",i,o,s,c,u=n[194](n[486].eventType)+"",d,p,h,m=n[486].title+"",g,b,v,y,E=n[486].targetType==="file"||n[486].eventType.startsWith("file_"),T,N,A,I=n[486].nodePath&&Tu(n);function O(){return n[322](n[486])}let R=E&&Su(n);return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),I&&I.c(),s=w(),c=f("span"),d=H(u),p=w(),h=f("span"),g=H(m),b=w(),v=f("button"),v.textContent=`${k("common.open")}`,y=w(),R&&R.c(),T=w(),r(t,"class","suggestion-event-time svelte-1uu9qhk"),r(c,"class","suggestion-event-type svelte-1uu9qhk"),r(h,"class","suggestion-event-title svelte-1uu9qhk"),r(v,"class","link-btn svelte-1uu9qhk"),r(e,"class","suggestion-detail-event svelte-1uu9qhk")},m(D,B){C(D,e,B),a(e,t),a(t,i),a(e,o),I&&I.m(e,null),a(e,s),a(e,c),a(c,d),a(e,p),a(e,h),a(h,g),a(e,b),a(e,v),a(e,y),R&&R.m(e,null),a(e,T),N||(A=P(v,"click",O),N=!0)},p(D,B){n=D,B[1]&536870912&&l!==(l=rn(n[486].createdAt)+"")&&Q(i,l),n[486].nodePath?I?I.p(n,B):(I=Tu(n),I.c(),I.m(e,s)):I&&(I.d(1),I=null),B[1]&536870912&&u!==(u=n[194](n[486].eventType)+"")&&Q(d,u),B[1]&536870912&&m!==(m=n[486].title+"")&&Q(g,m),B[1]&536870912&&(E=n[486].targetType==="file"||n[486].eventType.startsWith("file_")),E?R?R.p(n,B):(R=Su(n),R.c(),R.m(e,T)):R&&(R.d(1),R=null)},d(D){D&&S(e),I&&I.d(),R&&R.d(),N=!1,A()}}}function Au(n){let e,t,l,i,o=n[489].nodeTitle+"",s,c,u,d=n[489].summary+"",p,h,m,g=n[489].suggestedMin+"",b,v,y=k("worklog.min")+"",E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M,q,X,Z;function J(){return n[315](n[489])}let ee=n[489].events&&n[489].events.length>0&&yu(n);function te(...ne){return n[316](n[489],n[509],n[510],...ne)}function le(){return n[317](n[489])}function _e(){return n[318](n[489])}function oe(){return n[319](n[489])}function ze(){return n[320](n[489],n[509],n[510])}function Ge(...ne){return n[321](n[489],n[509],n[510],...ne)}let Ie=n[489]._expanded&&n[489].events&&n[489].events.length>0&&Eu(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),s=H(o),c=w(),u=f("span"),p=H(d),h=w(),m=f("span"),b=H(g),v=w(),E=H(y),ee&&ee.c(),T=w(),N=f("div"),A=f("span"),R=w(),D=f("input"),j=w(),U=f("span"),U.textContent=`${k("suggest.minutes")}`,z=w(),W=f("button"),W.textContent=`${k("suggest.edit")}`,K=w(),Y=f("button"),Y.textContent=`${k("suggest.apply")}`,F=w(),L=f("button"),L.textContent=`${k("common.delete")}`,M=w(),Ie&&Ie.c(),q=w(),r(i,"class","suggestion-node link-btn svelte-1uu9qhk"),r(u,"class","suggestion-summary svelte-1uu9qhk"),r(m,"class","suggestion-meta svelte-1uu9qhk"),r(l,"class","suggestion-info svelte-1uu9qhk"),r(A,"class","suggestion-confidence-dot svelte-1uu9qhk"),r(A,"title",I=k("suggest.confidence."+n[489].confidence)),r(A,"aria-label",O=k("suggest.confidence."+n[489].confidence)),ce(A,"low",n[489].confidence==="low"),ce(A,"medium",n[489].confidence==="medium"),ce(A,"high",n[489].confidence==="high"),r(D,"type","number"),r(D,"class","suggestion-min-input svelte-1uu9qhk"),D.value=B=n[489].suggestedMin,r(D,"min","1"),r(D,"max","480"),r(U,"class","suggestion-min-label svelte-1uu9qhk"),r(W,"class","btn btn-sm svelte-1uu9qhk"),r(Y,"class","btn btn-sm btn-primary svelte-1uu9qhk"),r(L,"class","btn btn-sm btn-danger svelte-1uu9qhk"),r(N,"class","suggestion-actions svelte-1uu9qhk"),r(t,"class","suggestion-main svelte-1uu9qhk"),r(t,"role","button"),r(t,"tabindex","0"),r(e,"class","suggestion-card svelte-1uu9qhk"),ce(e,"expanded",n[489]._expanded)},m(ne,re){C(ne,e,re),a(e,t),a(t,l),a(l,i),a(i,s),a(l,c),a(l,u),a(u,p),a(l,h),a(l,m),a(m,b),a(m,v),a(m,E),ee&&ee.m(m,null),a(t,T),a(t,N),a(N,A),a(N,R),a(N,D),a(N,j),a(N,U),a(N,z),a(N,W),a(N,K),a(N,Y),a(N,F),a(N,L),a(e,M),Ie&&Ie.m(e,null),a(e,q),X||(Z=[P(i,"click",We(J)),P(D,"change",We(te)),P(W,"click",We(le)),P(Y,"click",We(_e)),P(L,"click",We(oe)),P(t,"click",ze),P(t,"keydown",Ge)],X=!0)},p(ne,re){n=ne,re[1]&536870912&&o!==(o=n[489].nodeTitle+"")&&Q(s,o),re[1]&536870912&&d!==(d=n[489].summary+"")&&Q(p,d),re[1]&536870912&&g!==(g=n[489].suggestedMin+"")&&Q(b,g),n[489].events&&n[489].events.length>0?ee?ee.p(n,re):(ee=yu(n),ee.c(),ee.m(m,null)):ee&&(ee.d(1),ee=null),re[1]&536870912&&I!==(I=k("suggest.confidence."+n[489].confidence))&&r(A,"title",I),re[1]&536870912&&O!==(O=k("suggest.confidence."+n[489].confidence))&&r(A,"aria-label",O),re[1]&536870912&&ce(A,"low",n[489].confidence==="low"),re[1]&536870912&&ce(A,"medium",n[489].confidence==="medium"),re[1]&536870912&&ce(A,"high",n[489].confidence==="high"),re[1]&536870912&&B!==(B=n[489].suggestedMin)&&D.value!==B&&(D.value=B),n[489]._expanded&&n[489].events&&n[489].events.length>0?Ie?Ie.p(n,re):(Ie=Eu(n),Ie.c(),Ie.m(e,q)):Ie&&(Ie.d(1),Ie=null),re[1]&536870912&&ce(e,"expanded",n[489]._expanded)},d(ne){ne&&S(e),ee&&ee.d(),Ie&&Ie.d(),X=!1,Ce(Z)}}}function Hw(n){let e,t,l,i,o,s,c,u,d,p,h,m=n[8]&&Nu(n);function g(y,E){return y[77].length===0?Kw:Gw}let b=g(n),v=b(n);return{c(){e=f("div"),t=f("section"),l=f("div"),m&&m.c(),i=w(),o=f("div"),s=f("h3"),c=H(n[79]),u=w(),d=f("p"),p=H(n[78]),h=w(),v.c(),r(s,"class","svelte-1uu9qhk"),r(d,"class","svelte-1uu9qhk"),r(o,"class","svelte-1uu9qhk"),r(l,"class","trash-section-head svelte-1uu9qhk"),r(t,"class","trash-section svelte-1uu9qhk"),r(e,"class","trash-browser svelte-1uu9qhk")},m(y,E){C(y,e,E),a(e,t),a(t,l),m&&m.m(l,null),a(l,i),a(l,o),a(o,s),a(s,c),a(o,u),a(o,d),a(d,p),a(t,h),v.m(t,null)},p(y,E){y[8]?m?m.p(y,E):(m=Nu(y),m.c(),m.m(l,i)):m&&(m.d(1),m=null),E[2]&131072&&Q(c,y[79]),E[2]&65536&&Q(p,y[78]),b===(b=g(y))&&v?v.p(y,E):(v.d(1),v=b(y),v&&(v.c(),v.m(t,null)))},d(y){y&&S(e),m&&m.d(),v.d()}}}function Ww(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("trash.empty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Nu(n){let e,t=Tt("back")+"",l,i;return{c(){e=f("button"),r(e,"class","inbox-icon-btn svelte-1uu9qhk"),r(e,"title",k("common.backLabel")),r(e,"aria-label",k("common.backLabel"))},m(o,s){C(o,e,s),e.innerHTML=t,l||(i=P(e,"click",n[171]),l=!0)},p:se,d(o){o&&S(e),l=!1,i()}}}function Gw(n){let e,t=Te(n[77]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Iu(qc(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=kt()},m(i,o){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,o);C(i,e,o)},p(i,o){if(o[2]&49152|o[5]&4096e3){t=Te(i[77]);let s;for(s=0;s<t.length;s+=1){const c=qc(i,t,s);l[s]?l[s].p(c,o):(l[s]=Iu(c),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Kw(n){let e;return{c(){e=f("p"),e.textContent=`${k("common.empty")}`,r(e,"class","trash-empty-line svelte-1uu9qhk")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Iu(n){let e,t,l,i,o,s=Tt(n[506].type!=="file"&&n[506].type!=="note"?"folder":"open")+"",c,u,d,p,h=n[506].title+"",m,g,b,v=n[506].nodePath+"",y,E,T,N=qn(n[506].deletedAt)+"",A,I,O,R,D,B=Tt("restore")+"",j,U,z=Tt("purge")+"",W,K,Y;function F(){return n[306](n[506])}function L(){return n[307](n[506])}function M(...ee){return n[308](n[506],...ee)}function q(){return n[309](n[506])}function X(...ee){return n[310](n[506],...ee)}function Z(){return n[311](n[506])}function J(){return n[312](n[506])}return{c(){e=f("div"),t=f("input"),i=w(),o=f("span"),u=w(),d=f("button"),p=f("span"),m=H(h),g=w(),b=f("span"),y=H(v),E=w(),T=f("span"),A=H(N),O=w(),R=f("div"),D=f("button"),j=w(),U=f("button"),W=w(),r(t,"type","checkbox"),t.checked=l=n[76].includes(n[506].id),r(t,"class","svelte-1uu9qhk"),r(o,"class","trash-row-icon svelte-1uu9qhk"),r(o,"role","button"),r(o,"tabindex","0"),r(o,"title",c=n[506].type!=="file"?k("file.openFolder"):k("common.open")),r(p,"class","trash-row-title svelte-1uu9qhk"),r(b,"class","trash-row-meta svelte-1uu9qhk"),r(T,"class","trash-row-date svelte-1uu9qhk"),r(d,"class","trash-row-main svelte-1uu9qhk"),r(d,"title",I=n[506].type!=="file"?k("file.openFolder"):k("common.open")),r(D,"class","inbox-icon-btn inbox-icon-btn-primary svelte-1uu9qhk"),r(D,"title",k("trash.restore")),r(D,"aria-label",k("trash.restore")),r(U,"class","inbox-icon-btn inbox-icon-btn-danger svelte-1uu9qhk"),r(U,"title",k("common.delete")),r(U,"aria-label",k("common.delete")),r(R,"class","trash-row-actions svelte-1uu9qhk"),r(e,"class","trash-row svelte-1uu9qhk"),ce(e,"selected",n[76].includes(n[506].id)),ce(e,"folder",n[506].type!=="file"&&n[506].type!=="note")},m(ee,te){C(ee,e,te),a(e,t),a(e,i),a(e,o),o.innerHTML=s,a(e,u),a(e,d),a(d,p),a(p,m),a(d,g),a(d,b),a(b,y),a(d,E),a(d,T),a(T,A),a(e,O),a(e,R),a(R,D),D.innerHTML=B,a(R,j),a(R,U),U.innerHTML=z,a(e,W),K||(Y=[P(t,"change",F),P(o,"click",We(L)),P(o,"keydown",M),P(d,"click",We(q)),P(d,"keydown",X),P(D,"click",Z),P(U,"click",J)],K=!0)},p(ee,te){n=ee,te[2]&49152&&l!==(l=n[76].includes(n[506].id))&&(t.checked=l),te[2]&32768&&s!==(s=Tt(n[506].type!=="file"&&n[506].type!=="note"?"folder":"open")+"")&&(o.innerHTML=s),te[2]&32768&&c!==(c=n[506].type!=="file"?k("file.openFolder"):k("common.open"))&&r(o,"title",c),te[2]&32768&&h!==(h=n[506].title+"")&&Q(m,h),te[2]&32768&&v!==(v=n[506].nodePath+"")&&Q(y,v),te[2]&32768&&N!==(N=qn(n[506].deletedAt)+"")&&Q(A,N),te[2]&32768&&I!==(I=n[506].type!=="file"?k("file.openFolder"):k("common.open"))&&r(d,"title",I),te[2]&49152&&ce(e,"selected",n[76].includes(n[506].id)),te[2]&32768&&ce(e,"folder",n[506].type!=="file"&&n[506].type!=="note")},d(ee){ee&&S(e),K=!1,Ce(Y)}}}function Ru(n){let e,t,l,i,o,s,c,u,d,p=n[5]==="asc"?"↑":"↓",h,m,g,b,v,y,E,T,N,A;return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`${k("inbox.sortByDate")}`,i=w(),o=f("button"),o.textContent=`${k("inbox.sortByName")}`,s=w(),c=f("button"),c.textContent=`${k("inbox.sortByType")}`,u=w(),d=f("span"),h=H(p),m=w(),g=f("span"),b=w(),v=f("label"),y=f("input"),E=w(),T=f("span"),T.textContent=`${k("inbox.groupByContext")}`,r(l,"class","sort-btn svelte-1uu9qhk"),ce(l,"active",n[4]==="date"),r(o,"class","sort-btn svelte-1uu9qhk"),ce(o,"active",n[4]==="name"),r(c,"class","sort-btn svelte-1uu9qhk"),ce(c,"active",n[4]==="type"),r(d,"class","sort-dir svelte-1uu9qhk"),r(g,"class","inbox-controls-divider svelte-1uu9qhk"),r(y,"type","checkbox"),r(y,"class","svelte-1uu9qhk"),r(T,"class","svelte-1uu9qhk"),r(v,"class","checkbox-label-inline svelte-1uu9qhk"),r(t,"class","inbox-sort-row svelte-1uu9qhk"),r(e,"class","inbox-controls svelte-1uu9qhk")},m(I,O){C(I,e,O),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(t,u),a(t,d),a(d,h),a(t,m),a(t,g),a(t,b),a(t,v),a(v,y),y.checked=n[6],a(v,E),a(v,T),N||(A=[P(l,"click",n[288]),P(o,"click",n[289]),P(c,"click",n[290]),P(y,"change",n[291])],N=!0)},p(I,O){O[0]&16&&ce(l,"active",I[4]==="date"),O[0]&16&&ce(o,"active",I[4]==="name"),O[0]&16&&ce(c,"active",I[4]==="type"),O[0]&32&&p!==(p=I[5]==="asc"?"↑":"↓")&&Q(h,p),O[0]&64&&(y.checked=I[6])},d(I){I&&S(e),N=!1,Ce(A)}}}function Vw(n){let e,t=Te(n[9]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Mu(zc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","inbox-list svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[0]&512|o[4]&6291456|o[6]&6359040){t=Te(i[9]);let s;for(s=0;s<t.length;s+=1){const c=zc(i,t,s);l[s]?l[s].p(c,o):(l[s]=Mu(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Zw(n){let e,t=Te(n[117]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Ou(Bc(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=kt()},m(i,o){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,o);C(i,e,o)},p(i,o){if(o[3]&16777216|o[4]&6291456|o[6]&6359040){t=Te(i[117]);let s;for(s=0;s<t.length;s+=1){const c=Bc(i,t,s);l[s]?l[s].p(c,o):(l[s]=Ou(c),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Yw(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("inbox.empty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Xw(n){let e;return{c(){e=f("span"),r(e,"class","inbox-icon-slot svelte-1uu9qhk"),r(e,"aria-hidden","true")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Jw(n){let e,t=Tt("attach")+"",l,i;function o(){return n[299](n[474])}return{c(){e=f("button"),r(e,"class","inbox-icon-btn inbox-icon-btn-primary svelte-1uu9qhk"),r(e,"title",k("inbox.keepHere")),r(e,"aria-label",k("inbox.keepHere"))},m(s,c){C(s,e,c),e.innerHTML=t,l||(i=P(e,"click",We(o)),l=!0)},p(s,c){n=s},d(s){s&&S(e),l=!1,i()}}}function Qw(n){let e;return{c(){e=f("span"),r(e,"class","inbox-icon-slot svelte-1uu9qhk"),r(e,"aria-hidden","true")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function xw(n){let e,t=Tt("showInExplorer")+"",l,i;function o(){return n[302](n[474])}return{c(){e=f("button"),r(e,"class","inbox-icon-btn svelte-1uu9qhk"),r(e,"title",k("file.showInExplorer")),r(e,"aria-label",k("file.showInExplorer"))},m(s,c){C(s,e,c),e.innerHTML=t,l||(i=P(e,"click",We(o)),l=!0)},p(s,c){n=s},d(s){s&&S(e),l=!1,i()}}}function Mu(n){let e,t,l,i=n[474].title+"",o,s,c,u=n[197](n[474])+"",d,p,h,m,g,b=Tt("move")+"",v,y,E=Tt("open")+"",T,N,A,I,O=Tt("delete")+"",R,D,B;function j(Z,J){return Z[474].suggestedTargetNodeId?Jw:Xw}let U=j(n),z=U(n);function W(){return n[300](n[474])}function K(){return n[301](n[474])}function Y(Z,J){return J[0]&512&&(N=null),N==null&&(N=!!Xs(Z[474])),N?xw:Qw}let F=Y(n,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]),L=F(n);function M(){return n[303](n[474])}function q(){return n[304](n[474])}function X(...Z){return n[305](n[474],...Z)}return{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("span"),d=H(u),p=w(),h=f("div"),z.c(),m=w(),g=f("button"),v=w(),y=f("button"),T=w(),L.c(),A=w(),I=f("button"),R=w(),r(l,"class","inbox-item-title svelte-1uu9qhk"),r(c,"class","inbox-item-meta svelte-1uu9qhk"),r(t,"class","inbox-item-main svelte-1uu9qhk"),r(g,"class","inbox-icon-btn svelte-1uu9qhk"),r(g,"title",k("inbox.assign")),r(g,"aria-label",k("inbox.assign")),r(y,"class","inbox-icon-btn svelte-1uu9qhk"),r(y,"title",k("common.open")),r(y,"aria-label",k("common.open")),r(I,"class","inbox-icon-btn inbox-icon-btn-danger svelte-1uu9qhk"),r(I,"title",k("common.delete")),r(I,"aria-label",k("common.delete")),r(h,"class","inbox-item-actions svelte-1uu9qhk"),r(e,"class","inbox-item svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(Z,J){C(Z,e,J),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(e,p),a(e,h),z.m(h,null),a(h,m),a(h,g),g.innerHTML=b,a(h,v),a(h,y),y.innerHTML=E,a(h,T),L.m(h,null),a(h,A),a(h,I),I.innerHTML=O,a(e,R),D||(B=[P(g,"click",We(W)),P(y,"click",We(K)),P(I,"click",We(M)),P(e,"click",q),P(e,"keydown",X)],D=!0)},p(Z,J){n=Z,J[0]&512&&i!==(i=n[474].title+"")&&Q(o,i),J[0]&512&&u!==(u=n[197](n[474])+"")&&Q(d,u),U===(U=j(n))&&z?z.p(n,J):(z.d(1),z=U(n),z&&(z.c(),z.m(h,m))),F===(F=Y(n,J))&&L?L.p(n,J):(L.d(1),L=F(n),L&&(L.c(),L.m(h,A)))},d(Z){Z&&S(e),z.d(),L.d(),D=!1,Ce(B)}}}function $w(n){let e;return{c(){e=f("span"),r(e,"class","inbox-icon-slot svelte-1uu9qhk"),r(e,"aria-hidden","true")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function ey(n){let e,t=Tt("attach")+"",l,i;function o(){return n[292](n[474])}return{c(){e=f("button"),r(e,"class","inbox-icon-btn inbox-icon-btn-primary svelte-1uu9qhk"),r(e,"title",k("inbox.keepHere")),r(e,"aria-label",k("inbox.keepHere"))},m(s,c){C(s,e,c),e.innerHTML=t,l||(i=P(e,"click",We(o)),l=!0)},p(s,c){n=s},d(s){s&&S(e),l=!1,i()}}}function ty(n){let e;return{c(){e=f("span"),r(e,"class","inbox-icon-slot svelte-1uu9qhk"),r(e,"aria-hidden","true")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function ny(n){let e,t=Tt("showInExplorer")+"",l,i;function o(){return n[295](n[474])}return{c(){e=f("button"),r(e,"class","inbox-icon-btn svelte-1uu9qhk"),r(e,"title",k("file.showInExplorer")),r(e,"aria-label",k("file.showInExplorer"))},m(s,c){C(s,e,c),e.innerHTML=t,l||(i=P(e,"click",We(o)),l=!0)},p(s,c){n=s},d(s){s&&S(e),l=!1,i()}}}function Lu(n){let e,t,l,i=n[474].title+"",o,s,c,u=n[197](n[474])+"",d,p,h,m,g,b=Tt("move")+"",v,y,E=Tt("open")+"",T,N,A,I,O=Tt("delete")+"",R,D,B;function j(Z,J){return Z[474].suggestedTargetNodeId?ey:$w}let U=j(n),z=U(n);function W(){return n[293](n[474])}function K(){return n[294](n[474])}function Y(Z,J){return J[3]&16777216&&(N=null),N==null&&(N=!!Xs(Z[474])),N?ny:ty}let F=Y(n,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]),L=F(n);function M(){return n[296](n[474])}function q(){return n[297](n[474])}function X(...Z){return n[298](n[474],...Z)}return{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("span"),d=H(u),p=w(),h=f("div"),z.c(),m=w(),g=f("button"),v=w(),y=f("button"),T=w(),L.c(),A=w(),I=f("button"),R=w(),r(l,"class","inbox-item-title svelte-1uu9qhk"),r(c,"class","inbox-item-meta svelte-1uu9qhk"),r(t,"class","inbox-item-main svelte-1uu9qhk"),r(g,"class","inbox-icon-btn svelte-1uu9qhk"),r(g,"title",k("inbox.assign")),r(g,"aria-label",k("inbox.assign")),r(y,"class","inbox-icon-btn svelte-1uu9qhk"),r(y,"title",k("common.open")),r(y,"aria-label",k("common.open")),r(I,"class","inbox-icon-btn inbox-icon-btn-danger svelte-1uu9qhk"),r(I,"title",k("common.delete")),r(I,"aria-label",k("common.delete")),r(h,"class","inbox-item-actions svelte-1uu9qhk"),r(e,"class","inbox-item svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(Z,J){C(Z,e,J),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(e,p),a(e,h),z.m(h,null),a(h,m),a(h,g),g.innerHTML=b,a(h,v),a(h,y),y.innerHTML=E,a(h,T),L.m(h,null),a(h,A),a(h,I),I.innerHTML=O,a(e,R),D||(B=[P(g,"click",We(W)),P(y,"click",We(K)),P(I,"click",We(M)),P(e,"click",q),P(e,"keydown",X)],D=!0)},p(Z,J){n=Z,J[3]&16777216&&i!==(i=n[474].title+"")&&Q(o,i),J[3]&16777216&&u!==(u=n[197](n[474])+"")&&Q(d,u),U===(U=j(n))&&z?z.p(n,J):(z.d(1),z=U(n),z&&(z.c(),z.m(h,m))),F===(F=Y(n,J))&&L?L.p(n,J):(L.d(1),L=F(n),L&&(L.c(),L.m(h,A)))},d(Z){Z&&S(e),z.d(),L.d(),D=!1,Ce(B)}}}function Ou(n){let e,t,l=n[499].label+"",i,o,s,c=n[499].items.length+"",u,d,p,h,m=Te(n[499].items),g=[];for(let b=0;b<m.length;b+=1)g[b]=Lu(Fc(n,m,b));return{c(){e=f("div"),t=f("div"),i=H(l),o=w(),s=f("span"),u=H(c),d=w(),p=f("div");for(let b=0;b<g.length;b+=1)g[b].c();h=w(),r(s,"class","inbox-group-count svelte-1uu9qhk"),r(t,"class","inbox-group-header svelte-1uu9qhk"),r(p,"class","inbox-list svelte-1uu9qhk"),r(e,"class","inbox-group svelte-1uu9qhk")},m(b,v){C(b,e,v),a(e,t),a(t,i),a(t,o),a(t,s),a(s,u),a(e,d),a(e,p);for(let y=0;y<g.length;y+=1)g[y]&&g[y].m(p,null);a(e,h)},p(b,v){if(v[3]&16777216&&l!==(l=b[499].label+"")&&Q(i,l),v[3]&16777216&&c!==(c=b[499].items.length+"")&&Q(u,c),v[3]&16777216|v[4]&6291456|v[6]&6359040){m=Te(b[499].items);let y;for(y=0;y<m.length;y+=1){const E=Fc(b,m,y);g[y]?g[y].p(E,v):(g[y]=Lu(E),g[y].c(),g[y].m(p,null))}for(;y<g.length;y+=1)g[y].d(1);g.length=m.length}},d(b){b&&S(e),et(g,b)}}}function ly(n){let e;return{c(){e=f("span"),r(e,"class","tab-separator svelte-1uu9qhk"),r(e,"aria-hidden","true")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Du(n){let e,t,l,i,o=n[496].id==="activity"&&ly();function s(){return n[246](n[496])}return{c(){o&&o.c(),e=w(),t=f("button"),t.textContent=`${n[496].label}`,r(t,"class","tab svelte-1uu9qhk"),ce(t,"active",n[35]===n[496].id)},m(c,u){o&&o.m(c,u),C(c,e,u),C(c,t,u),l||(i=P(t,"click",s),l=!0)},p(c,u){n=c,u[1]&16|u[3]&536870912&&ce(t,"active",n[35]===n[496].id)},d(c){c&&(S(e),S(t)),o&&o.d(c),l=!1,i()}}}function iy(n){let e;function t(o,s){return o[32].length===0?py:dy}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","activity-tab svelte-1uu9qhk")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:se,o:se,d(o){o&&S(e),i.d()}}}function sy(n){let e,t,l,i,o=n[2]&&n[60].filter(n[232]).length>0,s,c,u,d=o&&Bu(n);function p(g,b){return g[50].length===0?my:hy}let h=p(n),m=h(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`+ ${k("worklog.addEntry")}`,i=w(),d&&d.c(),s=w(),m.c(),r(l,"class","btn btn-primary btn-sm svelte-1uu9qhk"),r(t,"class","worklog-toolbar svelte-1uu9qhk"),r(e,"class","worklog-tab svelte-1uu9qhk")},m(g,b){C(g,e,b),a(e,t),a(t,l),a(e,i),d&&d.m(e,null),a(e,s),m.m(e,null),c||(u=P(l,"click",n[271]),c=!0)},p(g,b){b[0]&4|b[1]&536870912&&(o=g[2]&&g[60].filter(g[232]).length>0),o?d?d.p(g,b):(d=Bu(g),d.c(),d.m(e,s)):d&&(d.d(1),d=null),h===(h=p(g))&&m?m.p(g,b):(m.d(1),m=h(g),m&&(m.c(),m.m(e,null)))},i:se,o:se,d(g){g&&S(e),d&&d.d(),m.d(),c=!1,u()}}}function oy(n){let e,t,l,i,o,s;function c(p,h){return p[49].length===0?yy:wy}let u=c(n),d=u(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`${k("action.addAction")}`,i=w(),d.c(),r(l,"class","btn btn-primary svelte-1uu9qhk"),r(t,"class","tab-toolbar svelte-1uu9qhk"),r(e,"class","actions-tab svelte-1uu9qhk")},m(p,h){C(p,e,h),a(e,t),a(t,l),a(e,i),d.m(e,null),o||(s=P(l,"click",n[215]),o=!0)},p(p,h){u===(u=c(p))&&d?d.p(p,h):(d.d(1),d=u(p),d&&(d.c(),d.m(e,null)))},i:se,o:se,d(p){p&&S(e),d.d(),o=!1,s()}}}function ry(n){let e,t;function l(c,u){return c[69].length===0?Ty:Ey}let i=l(n),o=i(n),s=n[74]&&lf(n);return{c(){e=f("div"),o.c(),t=w(),s&&s.c(),r(e,"class","links-tab svelte-1uu9qhk")},m(c,u){C(c,e,u),o.m(e,null),a(e,t),s&&s.m(e,null)},p(c,u){i===(i=l(c))&&o?o.p(c,u):(o.d(1),o=i(c),o&&(o.c(),o.m(e,t))),c[74]?s?s.p(c,u):(s=lf(c),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i:se,o:se,d(c){c&&S(e),o.d(),s&&s.d()}}}function ay(n){let e;function t(o,s){return o[66].length===0?Cy:Sy}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","inbox-tab svelte-1uu9qhk")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:se,o:se,d(o){o&&S(e),i.d()}}}function cy(n){let e,t,l={selectedNode:n[2],wailsCall:de};return e=new lw({props:l}),n[254](e),e.$on("openNote",n[255]),e.$on("refreshParent",n[256]),e.$on("error",n[257]),{c(){Qe(e.$$.fragment)},m(i,o){Ye(e,i,o),t=!0},p(i,o){const s={};o[0]&4&&(s.selectedNode=i[2]),e.$set(s)},i(i){t||(ge(e.$$.fragment,i),t=!0)},o(i){ke(e.$$.fragment,i),t=!1},d(i){n[254](null),Xe(e,i)}}}function uy(n){let e,t;return e=new K2({props:{notes:n[36],formatDate:qn}}),e.$on("submitCreateNote",n[250]),e.$on("openNote",n[251]),e.$on("startRename",n[252]),e.$on("deleteNote",n[253]),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[1]&32&&(o.notes=l[36]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function fy(n){let e,t;return e=new Y2({props:{selectedNode:n[2],notes:n[36],worklog:n[50],formatDate:qn,nodeKindLabel:n[195]}}),e.$on("createNote",n[247]),e.$on("addFile",n[248]),e.$on("createAction",n[215]),e.$on("openNote",n[249]),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[0]&4&&(o.selectedNode=l[2]),i[1]&32&&(o.notes=l[36]),i[1]&524288&&(o.worklog=l[50]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function dy(n){let e,t=Te(n[32]),l=[];for(let i=0;i<t.length;i+=1)l[i]=zu(jc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","activity-events svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[1]&2|o[6]&256|o[7]&32){t=Te(i[32]);let s;for(s=0;s<t.length;s+=1){const c=jc(i,t,s);l[s]?l[s].p(c,o):(l[s]=zu(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function py(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("activity.perCaseEmpty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Pu(n){let e,t=n[486].nodePath+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","activity-event-path svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[1]&2&&t!==(t=i[486].nodePath+"")&&Q(l,t)},d(i){i&&S(e)}}}function qu(n){let e,t=n[486].targetType+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","activity-event-target svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[1]&2&&t!==(t=i[486].targetType+"")&&Q(l,t)},d(i){i&&S(e)}}}function zu(n){let e,t,l=ni(n[486].eventType)+"",i,o,s,c=n[486].title+"",u,d,p,h,m=n[194](n[486].eventType)+"",g,b,v,y,E=rn(n[486].createdAt)+"",T,N,A,I,O=n[486].nodePath&&Pu(n),R=n[486].targetType&&qu(n);function D(){return n[286](n[486])}function B(...j){return n[287](n[486],...j)}return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),s=f("span"),u=H(c),d=w(),O&&O.c(),p=w(),h=f("span"),g=H(m),b=w(),R&&R.c(),v=w(),y=f("span"),T=H(E),N=w(),r(t,"class","activity-event-icon svelte-1uu9qhk"),r(s,"class","activity-event-title svelte-1uu9qhk"),r(h,"class","activity-event-type svelte-1uu9qhk"),r(y,"class","activity-event-time svelte-1uu9qhk"),r(e,"class","activity-event svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(j,U){C(j,e,U),a(e,t),a(t,i),a(e,o),a(e,s),a(s,u),a(e,d),O&&O.m(e,null),a(e,p),a(e,h),a(h,g),a(e,b),R&&R.m(e,null),a(e,v),a(e,y),a(y,T),a(e,N),A||(I=[P(e,"click",D),P(e,"keydown",B)],A=!0)},p(j,U){n=j,U[1]&2&&l!==(l=ni(n[486].eventType)+"")&&Q(i,l),U[1]&2&&c!==(c=n[486].title+"")&&Q(u,c),n[486].nodePath?O?O.p(n,U):(O=Pu(n),O.c(),O.m(e,p)):O&&(O.d(1),O=null),U[1]&2&&m!==(m=n[194](n[486].eventType)+"")&&Q(g,m),n[486].targetType?R?R.p(n,U):(R=qu(n),R.c(),R.m(e,v)):R&&(R.d(1),R=null),U[1]&2&&E!==(E=rn(n[486].createdAt)+"")&&Q(T,E)},d(j){j&&S(e),O&&O.d(),R&&R.d(),A=!1,Ce(I)}}}function Bu(n){let e,t,l,i=Te(n[60].filter(n[272])),o=[];for(let s=0;s<i.length;s+=1)o[s]=Gu(Wc(n,i,s));return{c(){e=f("div"),t=f("div"),t.textContent=`${k("worklog.suggestions")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","suggestions-title svelte-1uu9qhk"),r(e,"class","worklog-tab-suggestions svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[0]&4|c[1]&536870912|c[4]&2097152|c[5]&562036736|c[6]&256|c[7]&16){i=Te(s[60].filter(s[272]));let u;for(u=0;u<i.length;u+=1){const d=Wc(s,i,u);o[u]?o[u].p(d,c):(o[u]=Gu(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function Fu(n){let e,t=n[489].events.length+"",l,i,o=k("suggest.detectedEvents")+"",s;return{c(){e=H("· "),l=H(t),i=w(),s=H(o)},m(c,u){C(c,e,u),C(c,l,u),C(c,i,u),C(c,s,u)},p(c,u){u[0]&4|u[1]&536870912&&t!==(t=c[489].events.length+"")&&Q(l,t)},d(c){c&&(S(e),S(l),S(i),S(s))}}}function ju(n){let e,t,l,i=Te(n[489].events),o=[];for(let s=0;s<i.length;s+=1)o[s]=Wu(Gc(n,i,s));return{c(){e=f("div"),t=f("div"),t.textContent=`${k("suggest.detectedEvents")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","suggestion-detail-title svelte-1uu9qhk"),r(e,"class","suggestion-detail svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[0]&4|c[1]&536870912|c[4]&2097152|c[6]&256|c[7]&16){i=Te(s[489].events);let u;for(u=0;u<i.length;u+=1){const d=Gc(s,i,u);o[u]?o[u].p(d,c):(o[u]=Wu(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function Uu(n){let e,t=n[486].nodePath+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","suggestion-event-path svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&4|o[1]&536870912&&t!==(t=i[486].nodePath+"")&&Q(l,t)},d(i){i&&S(e)}}}function Hu(n){let e,t,l;function i(){return n[279](n[486])}return{c(){e=f("button"),e.textContent=`${k("file.showInExplorer")}`,r(e,"class","link-btn svelte-1uu9qhk")},m(o,s){C(o,e,s),t||(l=P(e,"click",i),t=!0)},p(o,s){n=o},d(o){o&&S(e),t=!1,l()}}}function Wu(n){let e,t,l=rn(n[486].createdAt)+"",i,o,s,c,u=n[194](n[486].eventType)+"",d,p,h,m=n[486].title+"",g,b,v,y,E=n[486].targetType==="file"||n[486].eventType.startsWith("file_"),T,N,A,I=n[486].nodePath&&Uu(n);function O(){return n[278](n[486])}let R=E&&Hu(n);return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),I&&I.c(),s=w(),c=f("span"),d=H(u),p=w(),h=f("span"),g=H(m),b=w(),v=f("button"),v.textContent=`${k("common.open")}`,y=w(),R&&R.c(),T=w(),r(t,"class","suggestion-event-time svelte-1uu9qhk"),r(c,"class","suggestion-event-type svelte-1uu9qhk"),r(h,"class","suggestion-event-title svelte-1uu9qhk"),r(v,"class","link-btn svelte-1uu9qhk"),r(e,"class","suggestion-detail-event svelte-1uu9qhk")},m(D,B){C(D,e,B),a(e,t),a(t,i),a(e,o),I&&I.m(e,null),a(e,s),a(e,c),a(c,d),a(e,p),a(e,h),a(h,g),a(e,b),a(e,v),a(e,y),R&&R.m(e,null),a(e,T),N||(A=P(v,"click",O),N=!0)},p(D,B){n=D,B[0]&4|B[1]&536870912&&l!==(l=rn(n[486].createdAt)+"")&&Q(i,l),n[486].nodePath?I?I.p(n,B):(I=Uu(n),I.c(),I.m(e,s)):I&&(I.d(1),I=null),B[0]&4|B[1]&536870912&&u!==(u=n[194](n[486].eventType)+"")&&Q(d,u),B[0]&4|B[1]&536870912&&m!==(m=n[486].title+"")&&Q(g,m),B[0]&4|B[1]&536870912&&(E=n[486].targetType==="file"||n[486].eventType.startsWith("file_")),E?R?R.p(n,B):(R=Hu(n),R.c(),R.m(e,T)):R&&(R.d(1),R=null)},d(D){D&&S(e),I&&I.d(),R&&R.d(),N=!1,A()}}}function Gu(n){let e,t,l,i,o=n[489].summary+"",s,c,u,d=n[489].suggestedMin+"",p,h,m=k("worklog.min")+"",g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z,W=n[489].events&&n[489].events.length>0&&Fu(n);function K(){return n[273](n[489])}function Y(){return n[274](n[489])}function F(){return n[275](n[489])}function L(){return n[276](n[489],n[490],n[491])}function M(...X){return n[277](n[489],n[490],n[491],...X)}let q=n[489]._expanded&&n[489].events&&n[489].events.length>0&&ju(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("span"),s=H(o),c=w(),u=f("span"),p=H(d),h=w(),g=H(m),W&&W.c(),b=w(),v=f("div"),y=f("span"),N=w(),A=f("button"),A.textContent=`${k("suggest.edit")}`,I=w(),O=f("button"),O.textContent=`${k("worklog.apply")}`,R=w(),D=f("button"),D.textContent=`${k("common.delete")}`,B=w(),q&&q.c(),j=w(),r(i,"class","suggestion-summary svelte-1uu9qhk"),r(u,"class","suggestion-meta svelte-1uu9qhk"),r(l,"class","suggestion-info svelte-1uu9qhk"),r(y,"class","suggestion-confidence-dot svelte-1uu9qhk"),r(y,"title",E=k("suggest.confidence."+n[489].confidence)),r(y,"aria-label",T=k("suggest.confidence."+n[489].confidence)),ce(y,"low",n[489].confidence==="low"),ce(y,"medium",n[489].confidence==="medium"),ce(y,"high",n[489].confidence==="high"),r(A,"class","btn btn-sm svelte-1uu9qhk"),r(O,"class","btn btn-sm btn-primary svelte-1uu9qhk"),r(D,"class","btn btn-sm btn-danger svelte-1uu9qhk"),r(v,"class","suggestion-actions svelte-1uu9qhk"),r(t,"class","suggestion-main svelte-1uu9qhk"),r(t,"role","button"),r(t,"tabindex","0"),r(e,"class","suggestion-card svelte-1uu9qhk"),ce(e,"expanded",n[489]._expanded)},m(X,Z){C(X,e,Z),a(e,t),a(t,l),a(l,i),a(i,s),a(l,c),a(l,u),a(u,p),a(u,h),a(u,g),W&&W.m(u,null),a(t,b),a(t,v),a(v,y),a(v,N),a(v,A),a(v,I),a(v,O),a(v,R),a(v,D),a(e,B),q&&q.m(e,null),a(e,j),U||(z=[P(A,"click",We(K)),P(O,"click",We(Y)),P(D,"click",We(F)),P(t,"click",L),P(t,"keydown",M)],U=!0)},p(X,Z){n=X,Z[0]&4|Z[1]&536870912&&o!==(o=n[489].summary+"")&&Q(s,o),Z[0]&4|Z[1]&536870912&&d!==(d=n[489].suggestedMin+"")&&Q(p,d),n[489].events&&n[489].events.length>0?W?W.p(n,Z):(W=Fu(n),W.c(),W.m(u,null)):W&&(W.d(1),W=null),Z[0]&4|Z[1]&536870912&&E!==(E=k("suggest.confidence."+n[489].confidence))&&r(y,"title",E),Z[0]&4|Z[1]&536870912&&T!==(T=k("suggest.confidence."+n[489].confidence))&&r(y,"aria-label",T),Z[0]&4|Z[1]&536870912&&ce(y,"low",n[489].confidence==="low"),Z[0]&4|Z[1]&536870912&&ce(y,"medium",n[489].confidence==="medium"),Z[0]&4|Z[1]&536870912&&ce(y,"high",n[489].confidence==="high"),n[489]._expanded&&n[489].events&&n[489].events.length>0?q?q.p(n,Z):(q=ju(n),q.c(),q.m(e,j)):q&&(q.d(1),q=null),Z[0]&4|Z[1]&536870912&&ce(e,"expanded",n[489]._expanded)},d(X){X&&S(e),W&&W.d(),q&&q.d(),U=!1,Ce(z)}}}function hy(n){let e,t=Te(n[50]),l=[];for(let i=0;i<t.length;i+=1)l[i]=$u(Uc(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=kt()},m(i,o){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,o);C(i,e,o)},p(i,o){if(o[1]&524288|o[4]&2097152|o[5]&9216|o[6]&264|o[7]&16){t=Te(i[50]);let s;for(s=0;s<t.length;s+=1){const c=Uc(i,t,s);l[s]?l[s].p(c,o):(l[s]=$u(c),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function my(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("worklog.empty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Ku(n){let e,t=n[483].nodePath+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","worklog-entry-path svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[1]&524288&&t!==(t=i[483].nodePath+"")&&Q(l,t)},d(i){i&&S(e)}}}function Vu(n){let e;return{c(){e=f("span"),e.textContent=`${k("journal.billableYes")}`,r(e,"class","wl-tag-billable svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Zu(n){let e;return{c(){e=f("span"),e.textContent=`${k("journal.approxEstimated")}`,r(e,"class","wl-tag-approx svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Yu(n){let e,t,l,i,o,s,c,u,d,p,h,m,g;function b(){return n[280](n[483])}function v(){return n[281](n[483])}let y=n[483].details&&Xu(n);function E(I,O){return I[483].source==="manual"?vy:I[483].source==="suggestion"&&I[483]._events&&I[483]._events.length>0?ky:I[483].source==="suggestion"?by:I[483].source==="unknown"||I[483].source==="imported"?_y:gy}let T=E(n),N=T(n),A=n[483].source==="suggestion"&&n[483]._events&&n[483]._events.length>0&&Ju(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`${k("worklog.editEntry")}`,i=w(),o=f("button"),o.textContent=`${k("worklog.deleteEntry")}`,s=w(),y&&y.c(),c=w(),u=f("div"),d=f("span"),d.textContent=`${k("worklog.source")}`,p=w(),N.c(),h=w(),A&&A.c(),r(l,"class","btn btn-sm svelte-1uu9qhk"),r(o,"class","btn btn-sm btn-danger svelte-1uu9qhk"),r(t,"class","worklog-entry-actions svelte-1uu9qhk"),r(d,"class","wl-detail-label svelte-1uu9qhk"),r(u,"class","wl-detail-section svelte-1uu9qhk"),r(e,"class","worklog-entry-detail svelte-1uu9qhk")},m(I,O){C(I,e,O),a(e,t),a(t,l),a(t,i),a(t,o),a(e,s),y&&y.m(e,null),a(e,c),a(e,u),a(u,d),a(u,p),N.m(u,null),a(e,h),A&&A.m(e,null),m||(g=[P(l,"click",We(b)),P(o,"click",We(v))],m=!0)},p(I,O){n=I,n[483].details?y?y.p(n,O):(y=Xu(n),y.c(),y.m(e,c)):y&&(y.d(1),y=null),T!==(T=E(n))&&(N.d(1),N=T(n),N&&(N.c(),N.m(u,null))),n[483].source==="suggestion"&&n[483]._events&&n[483]._events.length>0?A?A.p(n,O):(A=Ju(n),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},d(I){I&&S(e),y&&y.d(),N.d(),A&&A.d(),m=!1,Ce(g)}}}function Xu(n){let e,t,l,i,o=n[483].details+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${k("worklog.details")}`,l=w(),i=f("p"),s=H(o),r(t,"class","wl-detail-label svelte-1uu9qhk"),r(i,"class","svelte-1uu9qhk"),r(e,"class","wl-detail-section svelte-1uu9qhk")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[1]&524288&&o!==(o=c[483].details+"")&&Q(s,o)},d(c){c&&S(e)}}}function gy(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceUnknown")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function _y(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceUnknown")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function by(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceSuggestionNoEvents")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function ky(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceSuggestion")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function vy(n){let e;return{c(){e=f("p"),e.textContent=`${k("worklog.sourceManual")}`,r(e,"class","svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Ju(n){let e,t,l,i=Te(n[483]._events),o=[];for(let s=0;s<i.length;s+=1)o[s]=xu(Hc(n,i,s));return{c(){e=f("div"),t=f("span"),t.textContent=`${k("journal.relatedEvents")}`,l=w();for(let s=0;s<o.length;s+=1)o[s].c();r(t,"class","wl-detail-label svelte-1uu9qhk"),r(e,"class","wl-detail-section svelte-1uu9qhk")},m(s,c){C(s,e,c),a(e,t),a(e,l);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(e,null)},p(s,c){if(c[1]&524288|c[4]&2097152|c[6]&256|c[7]&16){i=Te(s[483]._events);let u;for(u=0;u<i.length;u+=1){const d=Hc(s,i,u);o[u]?o[u].p(d,c):(o[u]=xu(d),o[u].c(),o[u].m(e,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&S(e),et(o,s)}}}function Qu(n){let e,t,l;function i(){return n[283](n[486])}return{c(){e=f("button"),e.textContent=`${k("file.showInExplorer")}`,r(e,"class","link-btn svelte-1uu9qhk")},m(o,s){C(o,e,s),t||(l=P(e,"click",i),t=!0)},p(o,s){n=o},d(o){o&&S(e),t=!1,l()}}}function xu(n){let e,t,l=rn(n[486].createdAt)+"",i,o,s,c=n[194](n[486].eventType)+"",u,d,p,h=n[486].title+"",m,g,b,v,y=n[486].targetType==="file"||n[486].eventType.startsWith("file_"),E,T,N;function A(){return n[282](n[486])}let I=y&&Qu(n);return{c(){e=f("div"),t=f("span"),i=H(l),o=w(),s=f("span"),u=H(c),d=w(),p=f("span"),m=H(h),g=w(),b=f("button"),b.textContent=`${k("common.open")}`,v=w(),I&&I.c(),E=w(),r(t,"class","journal-event-time svelte-1uu9qhk"),r(s,"class","journal-event-type svelte-1uu9qhk"),r(p,"class","journal-event-title svelte-1uu9qhk"),r(b,"class","link-btn svelte-1uu9qhk"),r(e,"class","journal-event-row svelte-1uu9qhk")},m(O,R){C(O,e,R),a(e,t),a(t,i),a(e,o),a(e,s),a(s,u),a(e,d),a(e,p),a(p,m),a(e,g),a(e,b),a(e,v),I&&I.m(e,null),a(e,E),T||(N=P(b,"click",A),T=!0)},p(O,R){n=O,R[1]&524288&&l!==(l=rn(n[486].createdAt)+"")&&Q(i,l),R[1]&524288&&c!==(c=n[194](n[486].eventType)+"")&&Q(u,c),R[1]&524288&&h!==(h=n[486].title+"")&&Q(m,h),R[1]&524288&&(y=n[486].targetType==="file"||n[486].eventType.startsWith("file_")),y?I?I.p(n,R):(I=Qu(n),I.c(),I.m(e,E)):I&&(I.d(1),I=null)},d(O){O&&S(e),I&&I.d(),T=!1,N()}}}function $u(n){let e,t,l,i=n[483]._expanded?"▾":"▸",o,s,c,u=n[483].summary+"",d,p,h,m,g=n[483].minutes+"",b,v,y=k("worklog.min")+"",E,T,N,A,I,O=n[483].date+"",R,D,B,j,U,z=n[483].nodePath&&Ku(n),W=n[483].billable&&Vu(),K=n[483].approximate&&Zu(),Y=n[483]._expanded&&Yu(n);function F(){return n[284](n[483])}function L(...M){return n[285](n[483],...M)}return{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("span"),d=H(u),p=w(),z&&z.c(),h=w(),m=f("span"),b=H(g),v=w(),E=H(y),T=w(),W&&W.c(),N=w(),K&&K.c(),A=w(),I=f("span"),R=H(O),D=w(),Y&&Y.c(),B=w(),r(l,"class","worklog-toggle svelte-1uu9qhk"),r(c,"class","worklog-entry-summary svelte-1uu9qhk"),r(m,"class","worklog-entry-mins svelte-1uu9qhk"),r(I,"class","worklog-entry-date svelte-1uu9qhk"),r(t,"class","worklog-entry-head svelte-1uu9qhk"),r(e,"class","worklog-entry svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0"),ce(e,"expanded",n[483]._expanded)},m(M,q){C(M,e,q),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(t,p),z&&z.m(t,null),a(t,h),a(t,m),a(m,b),a(m,v),a(m,E),a(t,T),W&&W.m(t,null),a(t,N),K&&K.m(t,null),a(t,A),a(t,I),a(I,R),a(e,D),Y&&Y.m(e,null),a(e,B),j||(U=[P(e,"click",F),P(e,"keydown",L)],j=!0)},p(M,q){n=M,q[1]&524288&&i!==(i=n[483]._expanded?"▾":"▸")&&Q(o,i),q[1]&524288&&u!==(u=n[483].summary+"")&&Q(d,u),n[483].nodePath?z?z.p(n,q):(z=Ku(n),z.c(),z.m(t,h)):z&&(z.d(1),z=null),q[1]&524288&&g!==(g=n[483].minutes+"")&&Q(b,g),n[483].billable?W||(W=Vu(),W.c(),W.m(t,N)):W&&(W.d(1),W=null),n[483].approximate?K||(K=Zu(),K.c(),K.m(t,A)):K&&(K.d(1),K=null),q[1]&524288&&O!==(O=n[483].date+"")&&Q(R,O),n[483]._expanded?Y?Y.p(n,q):(Y=Yu(n),Y.c(),Y.m(e,B)):Y&&(Y.d(1),Y=null),q[1]&524288&&ce(e,"expanded",n[483]._expanded)},d(M){M&&S(e),z&&z.d(),W&&W.d(),K&&K.d(),Y&&Y.d(),j=!1,Ce(U)}}}function wy(n){let e,t=Te(n[49]),l=[];for(let i=0;i<t.length;i+=1)l[i]=ef(Kc(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=kt()},m(i,o){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,o);C(i,e,o)},p(i,o){if(o[1]&262144|o[7]&6){t=Te(i[49]);let s;for(s=0;s<t.length;s+=1){const c=Kc(i,t,s);l[s]?l[s].p(c,o):(l[s]=ef(c),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function yy(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("action.noActions")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function ef(n){let e,t,l,i=n[480].title+"",o,s,c,u=n[219](n[480].type)+"",d,p,h,m=n[480].data+"",g,b,v,y,E,T,N,A,I;function O(){return n[269](n[480])}function R(){return n[270](n[480])}return{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("span"),d=H(u),p=w(),h=f("span"),g=H(m),b=w(),v=f("div"),y=f("button"),y.textContent=`${k("action.run")}`,E=w(),T=f("button"),T.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-1uu9qhk"><polyline points="3 6 5 6 21 6" class="svelte-1uu9qhk"></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-1uu9qhk"></path></svg>',N=w(),r(l,"class","action-title svelte-1uu9qhk"),r(c,"class","action-type svelte-1uu9qhk"),r(h,"class","action-data svelte-1uu9qhk"),r(t,"class","action-info svelte-1uu9qhk"),r(y,"class","btn btn-sm svelte-1uu9qhk"),r(T,"class","btn btn-sm btn-danger svelte-1uu9qhk"),r(v,"class","action-btns svelte-1uu9qhk"),r(e,"class","action-card svelte-1uu9qhk")},m(D,B){C(D,e,B),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(t,p),a(t,h),a(h,g),a(e,b),a(e,v),a(v,y),a(v,E),a(v,T),a(e,N),A||(I=[P(y,"click",O),P(T,"click",R)],A=!0)},p(D,B){n=D,B[1]&262144&&i!==(i=n[480].title+"")&&Q(o,i),B[1]&262144&&u!==(u=n[219](n[480].type)+"")&&Q(d,u),B[1]&262144&&m!==(m=n[480].data+"")&&Q(g,m)},d(D){D&&S(e),A=!1,Ce(I)}}}function Ey(n){let e,t=Te(n[69]),l=[];for(let i=0;i<t.length;i+=1)l[i]=nf(Vc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","links-list svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[2]&128|o[6]&478150656){t=Te(i[69]);let s;for(s=0;s<t.length;s+=1){const c=Vc(i,t,s);l[s]?l[s].p(c,o):(l[s]=nf(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Ty(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("links.empty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function tf(n){let e,t=n[477].note+"",l;return{c(){e=f("span"),l=H(t),r(e,"class","link-note svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[2]&128&&t!==(t=i[477].note+"")&&Q(l,t)},d(i){i&&S(e)}}}function nf(n){let e,t,l,i=n[477].title+"",o,s,c,u=(n[477].hostname||n[477].url)+"",d,p,h,m,g=qn(n[477].createdAt)+"",b,v,y,E,T,N,A,I,O,R,D,B,j,U,z=n[477].note&&tf(n);function W(){return n[265](n[477])}function K(){return n[266](n[477])}function Y(){return n[267](n[477])}function F(){return n[268](n[477])}return{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("span"),d=H(u),h=w(),m=f("span"),b=H(g),v=w(),z&&z.c(),y=w(),E=f("div"),T=f("button"),T.textContent=`${k("common.open")}`,N=w(),A=f("button"),A.textContent=`${k("links.copyUrl")}`,I=w(),O=f("button"),O.textContent=`${k("common.rename")}`,R=w(),D=f("button"),D.textContent=`${k("common.delete")}`,B=w(),r(l,"class","link-title svelte-1uu9qhk"),r(c,"class","link-url svelte-1uu9qhk"),r(c,"title",p=n[477].url),r(m,"class","link-date svelte-1uu9qhk"),r(t,"class","link-main svelte-1uu9qhk"),r(T,"class","btn btn-sm btn-primary svelte-1uu9qhk"),r(A,"class","btn btn-sm svelte-1uu9qhk"),r(O,"class","btn btn-sm svelte-1uu9qhk"),r(D,"class","btn btn-sm btn-danger svelte-1uu9qhk"),r(E,"class","link-actions svelte-1uu9qhk"),r(e,"class","link-card svelte-1uu9qhk")},m(L,M){C(L,e,M),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(t,h),a(t,m),a(m,b),a(t,v),z&&z.m(t,null),a(e,y),a(e,E),a(E,T),a(E,N),a(E,A),a(E,I),a(E,O),a(E,R),a(E,D),a(e,B),j||(U=[P(T,"click",W),P(A,"click",K),P(O,"click",Y),P(D,"click",F)],j=!0)},p(L,M){n=L,M[2]&128&&i!==(i=n[477].title+"")&&Q(o,i),M[2]&128&&u!==(u=(n[477].hostname||n[477].url)+"")&&Q(d,u),M[2]&128&&p!==(p=n[477].url)&&r(c,"title",p),M[2]&128&&g!==(g=qn(n[477].createdAt)+"")&&Q(b,g),n[477].note?z?z.p(n,M):(z=tf(n),z.c(),z.m(t,null)):z&&(z.d(1),z=null)},d(L){L&&S(e),z&&z.d(),j=!1,Ce(U)}}}function lf(n){let e,t;return{c(){e=f("div"),t=H(n[74]),r(e,"class","link-status svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[2]&4096&&Q(t,l[74])},d(l){l&&S(e)}}}function Sy(n){let e,t=Te(n[66]),l=[];for(let i=0;i<t.length;i+=1)l[i]=sf(Zc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","inbox-list svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[2]&16|o[4]&6291456|o[6]&6359040){t=Te(i[66]);let s;for(s=0;s<t.length;s+=1){const c=Zc(i,t,s);l[s]?l[s].p(c,o):(l[s]=sf(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function Cy(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${k("inbox.localEmpty")}`,r(t,"class","svelte-1uu9qhk"),r(e,"class","empty-state svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p:se,d(l){l&&S(e)}}}function Ay(n){let e;return{c(){e=f("span"),r(e,"class","inbox-icon-slot svelte-1uu9qhk"),r(e,"aria-hidden","true")},m(t,l){C(t,e,l)},p:se,d(t){t&&S(e)}}}function Ny(n){let e,t=Tt("showInExplorer")+"",l,i;function o(){return n[261](n[474])}return{c(){e=f("button"),r(e,"class","inbox-icon-btn svelte-1uu9qhk"),r(e,"title",k("file.showInExplorer")),r(e,"aria-label",k("file.showInExplorer"))},m(s,c){C(s,e,c),e.innerHTML=t,l||(i=P(e,"click",We(o)),l=!0)},p(s,c){n=s},d(s){s&&S(e),l=!1,i()}}}function sf(n){let e,t,l,i=n[474].title+"",o,s,c,u=n[197](n[474])+"",d,p,h,m,g=Tt("attach")+"",b,v,y=Tt("move")+"",E,T,N=Tt("open")+"",A,I,O,R,D=Tt("delete")+"",B,j,U;function z(){return n[258](n[474])}function W(){return n[259](n[474])}function K(){return n[260](n[474])}function Y(Z,J){return J[2]&16&&(I=null),I==null&&(I=!!Xs(Z[474])),I?Ny:Ay}let F=Y(n,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]),L=F(n);function M(){return n[262](n[474])}function q(){return n[263](n[474])}function X(...Z){return n[264](n[474],...Z)}return{c(){e=f("div"),t=f("div"),l=f("span"),o=H(i),s=w(),c=f("span"),d=H(u),p=w(),h=f("div"),m=f("button"),b=w(),v=f("button"),E=w(),T=f("button"),A=w(),L.c(),O=w(),R=f("button"),B=w(),r(l,"class","inbox-item-title svelte-1uu9qhk"),r(c,"class","inbox-item-meta svelte-1uu9qhk"),r(t,"class","inbox-item-main svelte-1uu9qhk"),r(m,"class","inbox-icon-btn inbox-icon-btn-primary svelte-1uu9qhk"),r(m,"title",k("inbox.keepHere")),r(m,"aria-label",k("inbox.keepHere")),r(v,"class","inbox-icon-btn svelte-1uu9qhk"),r(v,"title",k("inbox.assign")),r(v,"aria-label",k("inbox.assign")),r(T,"class","inbox-icon-btn svelte-1uu9qhk"),r(T,"title",k("common.open")),r(T,"aria-label",k("common.open")),r(R,"class","inbox-icon-btn inbox-icon-btn-danger svelte-1uu9qhk"),r(R,"title",k("common.delete")),r(R,"aria-label",k("common.delete")),r(h,"class","inbox-item-actions svelte-1uu9qhk"),r(e,"class","inbox-item svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(Z,J){C(Z,e,J),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(e,p),a(e,h),a(h,m),m.innerHTML=g,a(h,b),a(h,v),v.innerHTML=y,a(h,E),a(h,T),T.innerHTML=N,a(h,A),L.m(h,null),a(h,O),a(h,R),R.innerHTML=D,a(e,B),j||(U=[P(m,"click",We(z)),P(v,"click",We(W)),P(T,"click",We(K)),P(R,"click",We(M)),P(e,"click",q),P(e,"keydown",X)],j=!0)},p(Z,J){n=Z,J[2]&16&&i!==(i=n[474].title+"")&&Q(o,i),J[2]&16&&u!==(u=n[197](n[474])+"")&&Q(d,u),F===(F=Y(n,J))&&L?L.p(n,J):(L.d(1),L=F(n),L&&(L.c(),L.m(h,O)))},d(Z){Z&&S(e),L.d(),j=!1,Ce(U)}}}function Iy(n){let e,t=n[37].title+"",l,i,o,s,c,u,d,p=n[37].dirty&&of();return{c(){e=f("span"),l=H(t),i=w(),o=f("button"),o.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1uu9qhk"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" class="svelte-1uu9qhk"></path></svg>',s=w(),p&&p.c(),c=kt(),r(e,"class","note-title svelte-1uu9qhk"),r(o,"class","btn btn-sm note-rename-btn svelte-1uu9qhk"),r(o,"title",k("common.rename"))},m(h,m){C(h,e,m),a(e,l),C(h,i,m),C(h,o,m),C(h,s,m),p&&p.m(h,m),C(h,c,m),u||(d=P(o,"click",n[244]),u=!0)},p(h,m){m[1]&64&&t!==(t=h[37].title+"")&&Q(l,t),h[37].dirty?p||(p=of(),p.c(),p.m(c.parentNode,c)):p&&(p.d(1),p=null)},d(h){h&&(S(e),S(i),S(o),S(s),S(c)),p&&p.d(h),u=!1,d()}}}function Ry(n){let e,t,l,i,o,s,c,u;return{c(){e=f("div"),t=f("input"),l=w(),i=f("button"),i.textContent=`${k("common.save")}`,o=w(),s=f("button"),s.textContent=`${k("common.cancel")}`,r(t,"type","text"),r(t,"class","note-rename-input svelte-1uu9qhk"),r(i,"class","btn btn-primary btn-sm svelte-1uu9qhk"),r(s,"class","btn btn-sm svelte-1uu9qhk"),r(e,"class","note-rename-inline svelte-1uu9qhk")},m(d,p){C(d,e,p),a(e,t),Me(t,n[48]),a(e,l),a(e,i),a(e,o),a(e,s),c||(u=[P(t,"input",n[242]),P(t,"keydown",n[243]),P(i,"click",n[159]),P(s,"click",n[158])],c=!0)},p(d,p){p[1]&131072&&t.value!==d[48]&&Me(t,d[48])},d(d){d&&S(e),c=!1,Ce(u)}}}function of(n){let e;return{c(){e=f("span"),e.textContent="●",r(e,"class","dirty-mark svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function rf(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U=k("common.create")+"",z,W,K,Y,F,L,M,q=n[82]&&af(n);h=new Gi({props:{kind:"folder",size:24}});let X=Te(n[15]),Z=[];for(let ee=0;ee<X.length;ee+=1)Z[ee]=cf(Ac(n,X,ee));const J=ee=>ke(Z[ee],1,1,()=>{Z[ee]=null});return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("nav.createNode")}`,i=w(),q&&q.c(),o=w(),s=f("div"),c=f("span"),c.textContent=`${k("template.select")}`,u=w(),d=f("div"),p=f("button"),Qe(h.$$.fragment),m=w(),g=f("div"),b=f("span"),b.textContent=`${k("template.optionNone")}`,v=w(),y=f("span"),y.textContent=`${k("template.none.desc")}`,E=w();for(let ee=0;ee<Z.length;ee+=1)Z[ee].c();T=w(),N=f("div"),A=f("label"),I=f("span"),I.textContent=`${k("common.name")}`,O=w(),R=f("input"),D=w(),B=f("div"),j=f("button"),z=H(U),K=w(),Y=f("button"),Y.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1uu9qhk"),r(c,"class","form-label svelte-1uu9qhk"),r(b,"class","template-card-title svelte-1uu9qhk"),r(y,"class","template-card-desc svelte-1uu9qhk"),r(g,"class","template-card-text svelte-1uu9qhk"),r(p,"class","template-card svelte-1uu9qhk"),ce(p,"selected",n[83]===null),r(d,"class","template-cards svelte-1uu9qhk"),r(d,"role","group"),r(d,"aria-label",k("template.select")),r(s,"class","form-group svelte-1uu9qhk"),r(I,"class","label-text svelte-1uu9qhk"),r(R,"type","text"),r(R,"placeholder",k("case.namePlaceholder")),r(R,"class","svelte-1uu9qhk"),r(A,"class","svelte-1uu9qhk"),r(N,"class","form-group svelte-1uu9qhk"),r(j,"class","btn btn-primary svelte-1uu9qhk"),j.disabled=W=!n[81].trim()||n[83]===void 0,r(Y,"class","btn svelte-1uu9qhk"),r(B,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal modal-create svelte-1uu9qhk"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(ee,te){C(ee,e,te),a(e,t),a(t,l),a(t,i),q&&q.m(t,null),a(t,o),a(t,s),a(s,c),a(s,u),a(s,d),a(d,p),Ye(h,p,null),a(p,m),a(p,g),a(g,b),a(g,v),a(g,y),a(d,E);for(let le=0;le<Z.length;le+=1)Z[le]&&Z[le].m(d,null);a(t,T),a(t,N),a(N,A),a(A,I),a(A,O),a(A,R),Me(R,n[81]),a(t,D),a(t,B),a(B,j),a(j,z),a(B,K),a(B,Y),F=!0,L||(M=[P(p,"click",n[353]),P(R,"input",n[355]),P(R,"keydown",n[356]),P(j,"click",n[135]),P(Y,"click",n[134]),P(e,"click",xt(n[134])),P(e,"keydown",zn(n[134]))],L=!0)},p(ee,te){if(ee[82]?q?q.p(ee,te):(q=af(ee),q.c(),q.m(t,o)):q&&(q.d(1),q=null),(!F||te[2]&2097152)&&ce(p,"selected",ee[83]===null),te[0]&32768|te[2]&2097152){X=Te(ee[15]);let le;for(le=0;le<X.length;le+=1){const _e=Ac(ee,X,le);Z[le]?(Z[le].p(_e,te),ge(Z[le],1)):(Z[le]=cf(_e),Z[le].c(),ge(Z[le],1),Z[le].m(d,null))}for(yt(),le=X.length;le<Z.length;le+=1)J(le);Et()}te[2]&524288&&R.value!==ee[81]&&Me(R,ee[81]),(!F||te[2]&2621440&&W!==(W=!ee[81].trim()||ee[83]===void 0))&&(j.disabled=W)},i(ee){if(!F){ge(h.$$.fragment,ee);for(let te=0;te<X.length;te+=1)ge(Z[te]);F=!0}},o(ee){ke(h.$$.fragment,ee),Z=Z.filter(Gd);for(let te=0;te<Z.length;te+=1)ke(Z[te]);F=!1},d(ee){ee&&S(e),q&&q.d(),Xe(h),et(Z,ee),L=!1,Ce(M)}}}function af(n){let e,t=k("nav.createInside")+"",l,i,o=n[82].title+"",s,c;return{c(){e=f("div"),l=H(t),i=H(" «"),s=H(o),c=H("»"),r(e,"class","create-context svelte-1uu9qhk")},m(u,d){C(u,e,d),a(e,l),a(e,i),a(e,s),a(e,c)},p(u,d){d[2]&1048576&&o!==(o=u[82].title+"")&&Q(s,o)},d(u){u&&S(e)}}}function cf(n){let e,t,l,i,o,s=k(n[469].title)+"",c,u,d,p=k(n[469].title+".desc")+"",h,m,g,b,v;t=new Gi({props:{kind:n[469].icon||"generic",size:24}});function y(){return n[354](n[469])}return{c(){var E;e=f("button"),Qe(t.$$.fragment),l=w(),i=f("div"),o=f("span"),c=H(s),u=w(),d=f("span"),h=H(p),m=w(),r(o,"class","template-card-title svelte-1uu9qhk"),r(d,"class","template-card-desc svelte-1uu9qhk"),r(i,"class","template-card-text svelte-1uu9qhk"),r(e,"class","template-card svelte-1uu9qhk"),ce(e,"selected",((E=n[83])==null?void 0:E.id)===n[469].id)},m(E,T){C(E,e,T),Ye(t,e,null),a(e,l),a(e,i),a(i,o),a(o,c),a(i,u),a(i,d),a(d,h),a(e,m),g=!0,b||(v=P(e,"click",y),b=!0)},p(E,T){var A;n=E;const N={};T[0]&32768&&(N.kind=n[469].icon||"generic"),t.$set(N),(!g||T[0]&32768)&&s!==(s=k(n[469].title)+"")&&Q(c,s),(!g||T[0]&32768)&&p!==(p=k(n[469].title+".desc")+"")&&Q(h,p),(!g||T[0]&32768|T[2]&2097152)&&ce(e,"selected",((A=n[83])==null?void 0:A.id)===n[469].id)},i(E){g||(ge(t.$$.fragment,E),g=!0)},o(E){ke(t.$$.fragment,E),g=!1},d(E){E&&S(e),Xe(t),b=!1,v()}}}function uf(n){let e,t,l=n[84].node&&["folder","project","client","document","recipe"].includes(n[84].node.type),i,o,s,c,u,d,p,h,m,g,b=l&&ff(n),v=n[84].node&&n[84].node.parent_id&&pf(n);return{c(){e=f("div"),t=f("div"),b&&b.c(),i=w(),v&&v.c(),o=w(),s=f("button"),s.textContent=`${k("common.rename")}`,c=w(),u=f("button"),u.textContent=`${k("common.delete")}`,d=w(),p=f("button"),p.textContent=`${k("file.showInExplorer")}`,r(s,"class","context-menu-item svelte-1uu9qhk"),r(u,"class","context-menu-item danger svelte-1uu9qhk"),r(p,"class","context-menu-item svelte-1uu9qhk"),r(t,"class","context-menu svelte-1uu9qhk"),sn(t,"left",n[84].x+"px"),sn(t,"top",n[84].y+"px"),r(e,"class","context-menu-backdrop svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(y,E){C(y,e,E),a(e,t),b&&b.m(t,null),a(t,i),v&&v.m(t,null),a(t,o),a(t,s),a(t,c),a(t,u),a(t,d),a(t,p),h=!0,m||(g=[P(s,"click",n[359]),P(u,"click",n[360]),P(p,"click",n[361]),P(e,"click",n[137]),P(e,"contextmenu",ji(n[137])),P(e,"keydown",zn(n[137]))],m=!0)},p(y,E){E[2]&4194304&&(l=y[84].node&&["folder","project","client","document","recipe"].includes(y[84].node.type)),l?b?(b.p(y,E),E[2]&4194304&&ge(b,1)):(b=ff(y),b.c(),ge(b,1),b.m(t,i)):b&&(yt(),ke(b,1,1,()=>{b=null}),Et()),y[84].node&&y[84].node.parent_id?v?v.p(y,E):(v=pf(y),v.c(),v.m(t,o)):v&&(v.d(1),v=null),(!h||E[2]&4194304)&&sn(t,"left",y[84].x+"px"),(!h||E[2]&4194304)&&sn(t,"top",y[84].y+"px")},i(y){h||(ge(b),h=!0)},o(y){ke(b),h=!1},d(y){y&&S(e),b&&b.d(),v&&v.d(),m=!1,Ce(g)}}}function ff(n){let e,t,l,i,o,s=Te(n[15].length>0?n[15]:[{id:"",title:"template.optionNone",icon:"folder"}]),c=[];for(let d=0;d<s.length;d+=1)c[d]=df(Cc(n,s,d));const u=d=>ke(c[d],1,1,()=>{c[d]=null});return{c(){e=f("div"),e.textContent=`${k("common.create")}`,t=w();for(let d=0;d<c.length;d+=1)c[d].c();l=w(),i=f("div"),r(e,"class","context-menu-section svelte-1uu9qhk"),r(i,"class","context-menu-divider svelte-1uu9qhk")},m(d,p){C(d,e,p),C(d,t,p);for(let h=0;h<c.length;h+=1)c[h]&&c[h].m(d,p);C(d,l,p),C(d,i,p),o=!0},p(d,p){if(p[0]&32768|p[4]&256){s=Te(d[15].length>0?d[15]:[{id:"",title:"template.optionNone",icon:"folder"}]);let h;for(h=0;h<s.length;h+=1){const m=Cc(d,s,h);c[h]?(c[h].p(m,p),ge(c[h],1)):(c[h]=df(m),c[h].c(),ge(c[h],1),c[h].m(l.parentNode,l))}for(yt(),h=s.length;h<c.length;h+=1)u(h);Et()}},i(d){if(!o){for(let p=0;p<s.length;p+=1)ge(c[p]);o=!0}},o(d){c=c.filter(Gd);for(let p=0;p<c.length;p+=1)ke(c[p]);o=!1},d(d){d&&(S(e),S(t),S(l),S(i)),et(c,d)}}}function df(n){let e,t,l,i,o=k(n[469].title)+"",s,c,u,d;t=new Gi({props:{kind:n[469].icon||"folder",size:16}});function p(){return n[357](n[469])}return{c(){e=f("button"),Qe(t.$$.fragment),l=w(),i=f("span"),s=H(o),r(i,"class","svelte-1uu9qhk"),r(e,"class","context-menu-item svelte-1uu9qhk")},m(h,m){C(h,e,m),Ye(t,e,null),a(e,l),a(e,i),a(i,s),c=!0,u||(d=P(e,"click",p),u=!0)},p(h,m){n=h;const g={};m[0]&32768&&(g.kind=n[469].icon||"folder"),t.$set(g),(!c||m[0]&32768)&&o!==(o=k(n[469].title)+"")&&Q(s,o)},i(h){c||(ge(t.$$.fragment,h),c=!0)},o(h){ke(t.$$.fragment,h),c=!1},d(h){h&&S(e),Xe(t),u=!1,d()}}}function pf(n){let e,t,l,i,o;return{c(){e=f("button"),e.textContent=`${k("nav.moveToRoot")}`,t=w(),l=f("div"),r(e,"class","context-menu-item svelte-1uu9qhk"),r(l,"class","context-menu-divider svelte-1uu9qhk")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),i||(o=P(e,"click",n[358]),i=!0)},p:se,d(s){s&&(S(e),S(t),S(l)),i=!1,o()}}}function hf(n){let e,t,l,i=(n[59]?k("worklog.acceptSuggestion"):n[58]?k("worklog.editEntry"):k("worklog.addEntry"))+"",o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M,q,X,Z,J,ee,te,le,_e,oe,ze=k("common.save")+"",Ge,Ie,ne,re,Ne,Fe;return{c(){e=f("div"),t=f("div"),l=f("h3"),o=H(i),s=w(),c=f("div"),u=f("label"),d=f("span"),d.textContent=`${k("worklog.date")}`,p=w(),h=f("input"),m=w(),g=f("div"),b=f("label"),v=f("span"),v.textContent=`${k("worklog.whatDone")}`,y=w(),E=f("input"),T=w(),N=f("div"),A=f("label"),I=f("span"),I.textContent=`${k("worklog.minutes")}`,O=w(),R=f("input"),D=w(),B=f("div"),j=f("label"),U=f("span"),U.textContent=`${k("worklog.details")}`,z=w(),W=f("textarea"),K=w(),Y=f("div"),F=f("label"),L=f("input"),M=w(),q=f("span"),q.textContent=`${k("journal.billableYes")}`,X=w(),Z=f("label"),J=f("input"),ee=w(),te=f("span"),te.textContent=`${k("journal.approxEstimated")}`,le=w(),_e=f("div"),oe=f("button"),Ge=H(ze),ne=w(),re=f("button"),re.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1uu9qhk"),r(d,"class","label-text svelte-1uu9qhk"),r(h,"type","date"),r(h,"class","svelte-1uu9qhk"),r(u,"class","svelte-1uu9qhk"),r(c,"class","form-group svelte-1uu9qhk"),r(v,"class","label-text svelte-1uu9qhk"),r(E,"type","text"),r(E,"placeholder",k("worklog.whatDone")),r(E,"class","svelte-1uu9qhk"),r(b,"class","svelte-1uu9qhk"),r(g,"class","form-group svelte-1uu9qhk"),r(I,"class","label-text svelte-1uu9qhk"),r(R,"type","number"),r(R,"min","1"),r(R,"class","svelte-1uu9qhk"),r(A,"class","svelte-1uu9qhk"),r(N,"class","form-group svelte-1uu9qhk"),r(U,"class","label-text svelte-1uu9qhk"),r(W,"class","svelte-1uu9qhk"),r(j,"class","svelte-1uu9qhk"),r(B,"class","form-group svelte-1uu9qhk"),r(L,"type","checkbox"),r(L,"class","svelte-1uu9qhk"),r(q,"class","svelte-1uu9qhk"),r(F,"class","checkbox-label-inline svelte-1uu9qhk"),r(J,"type","checkbox"),r(J,"class","svelte-1uu9qhk"),r(te,"class","svelte-1uu9qhk"),r(Z,"class","checkbox-label-inline svelte-1uu9qhk"),r(Y,"class","form-row svelte-1uu9qhk"),r(oe,"class","btn btn-primary svelte-1uu9qhk"),oe.disabled=Ie=!n[52].trim()||!n[53],r(re,"class","btn svelte-1uu9qhk"),r(_e,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal modal-worklog svelte-1uu9qhk"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(we,je){C(we,e,je),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,u),a(u,d),a(u,p),a(u,h),Me(h,n[54]),a(t,m),a(t,g),a(g,b),a(b,v),a(b,y),a(b,E),Me(E,n[52]),a(t,T),a(t,N),a(N,A),a(A,I),a(A,O),a(A,R),Me(R,n[53]),a(t,D),a(t,B),a(B,j),a(j,U),a(j,z),a(j,W),Me(W,n[55]),a(t,K),a(t,Y),a(Y,F),a(F,L),L.checked=n[56],a(F,M),a(F,q),a(Y,X),a(Y,Z),a(Z,J),J.checked=n[57],a(Z,ee),a(Z,te),a(t,le),a(t,_e),a(_e,oe),a(oe,Ge),a(_e,ne),a(_e,re),Ne||(Fe=[P(h,"input",n[362]),P(E,"input",n[363]),P(R,"input",n[364]),P(W,"input",n[365]),P(L,"change",n[366]),P(J,"change",n[367]),P(oe,"click",n[167]),P(re,"click",n[166]),P(e,"click",xt(n[166])),P(e,"keydown",zn(n[166]))],Ne=!0)},p(we,je){je[1]&402653184&&i!==(i=(we[59]?k("worklog.acceptSuggestion"):we[58]?k("worklog.editEntry"):k("worklog.addEntry"))+"")&&Q(o,i),je[1]&8388608&&Me(h,we[54]),je[1]&2097152&&E.value!==we[52]&&Me(E,we[52]),je[1]&4194304&&zl(R.value)!==we[53]&&Me(R,we[53]),je[1]&16777216&&Me(W,we[55]),je[1]&33554432&&(L.checked=we[56]),je[1]&67108864&&(J.checked=we[57]),je[1]&6291456&&Ie!==(Ie=!we[52].trim()||!we[53])&&(oe.disabled=Ie)},d(we){we&&S(e),Ne=!1,Ce(Fe)}}}function mf(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A=(n[87]==="open_url"?k("action.dataUrl"):n[87]==="open_folder"||n[87]==="open_file"?k("action.dataPath"):k("action.dataCommand"))+"",I,O,R,D,B,j,U,z,W,K,Y,F=Te(n[121]),L=[];for(let M=0;M<F.length;M+=1)L[M]=gf(Sc(n,F,M));return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("action.newAction")}`,i=w(),o=f("div"),s=f("label"),c=f("span"),c.textContent=`${k("common.name")}`,u=w(),d=f("input"),p=w(),h=f("div"),m=f("label"),g=f("span"),g.textContent=`${k("common.type")}`,b=w(),v=f("select");for(let M=0;M<L.length;M+=1)L[M].c();y=w(),E=f("div"),T=f("label"),N=f("span"),I=H(A),O=w(),R=f("input"),B=w(),j=f("div"),U=f("button"),U.textContent=`${k("common.create")}`,z=w(),W=f("button"),W.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1uu9qhk"),r(c,"class","label-text svelte-1uu9qhk"),r(d,"type","text"),r(d,"placeholder",k("action.namePlaceholder")),r(d,"class","svelte-1uu9qhk"),r(s,"class","svelte-1uu9qhk"),r(o,"class","form-group svelte-1uu9qhk"),r(g,"class","label-text svelte-1uu9qhk"),r(v,"class","svelte-1uu9qhk"),n[87]===void 0&&hl(()=>n[370].call(v)),r(m,"class","svelte-1uu9qhk"),r(h,"class","form-group svelte-1uu9qhk"),r(N,"class","label-text svelte-1uu9qhk"),r(R,"type","text"),r(R,"placeholder",D=n[87]==="open_url"?k("action.urlPlaceholder"):n[87]==="open_folder"||n[87]==="open_file"?k("action.pathPlaceholder"):k("action.commandPlaceholder")),r(R,"class","svelte-1uu9qhk"),r(T,"class","svelte-1uu9qhk"),r(E,"class","form-group svelte-1uu9qhk"),r(U,"class","btn btn-primary svelte-1uu9qhk"),r(W,"class","btn svelte-1uu9qhk"),r(j,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal svelte-1uu9qhk"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(M,q){C(M,e,q),a(e,t),a(t,l),a(t,i),a(t,o),a(o,s),a(s,c),a(s,u),a(s,d),Me(d,n[86]),a(t,p),a(t,h),a(h,m),a(m,g),a(m,b),a(m,v);for(let X=0;X<L.length;X+=1)L[X]&&L[X].m(v,null);Yn(v,n[87],!0),a(t,y),a(t,E),a(E,T),a(T,N),a(N,I),a(T,O),a(T,R),Me(R,n[88]),a(t,B),a(t,j),a(j,U),a(j,z),a(j,W),K||(Y=[P(d,"input",n[368]),P(d,"keydown",n[369]),P(v,"change",n[370]),P(R,"input",n[371]),P(R,"keydown",n[372]),P(U,"click",n[217]),P(W,"click",n[216]),P(e,"click",xt(n[216])),P(e,"keydown",zn(n[216]))],K=!0)},p(M,q){if(q[2]&16777216&&d.value!==M[86]&&Me(d,M[86]),q[3]&268435456){F=Te(M[121]);let X;for(X=0;X<F.length;X+=1){const Z=Sc(M,F,X);L[X]?L[X].p(Z,q):(L[X]=gf(Z),L[X].c(),L[X].m(v,null))}for(;X<L.length;X+=1)L[X].d(1);L.length=F.length}q[2]&33554432|q[3]&268435456&&Yn(v,M[87]),q[2]&33554432&&A!==(A=(M[87]==="open_url"?k("action.dataUrl"):M[87]==="open_folder"||M[87]==="open_file"?k("action.dataPath"):k("action.dataCommand"))+"")&&Q(I,A),q[2]&33554432|q[3]&268435456&&D!==(D=M[87]==="open_url"?k("action.urlPlaceholder"):M[87]==="open_folder"||M[87]==="open_file"?k("action.pathPlaceholder"):k("action.commandPlaceholder"))&&r(R,"placeholder",D),q[2]&67108864&&R.value!==M[88]&&Me(R,M[88])},d(M){M&&S(e),et(L,M),K=!1,Ce(Y)}}}function gf(n){let e,t=n[466].label+"",l;return{c(){e=f("option"),l=H(t),e.__value=n[466].id,Me(e,e.__value),r(e,"class","svelte-1uu9qhk")},m(i,o){C(i,e,o),a(e,l)},p:se,d(i){i&&S(e)}}}function _f(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T=n[106]&&bf(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("rename.title")}`,i=w(),o=f("div"),s=f("label"),c=f("span"),c.textContent=`${k("common.newName")}`,u=w(),d=f("input"),p=w(),T&&T.c(),h=w(),m=f("div"),g=f("button"),g.textContent=`${k("common.rename")}`,b=w(),v=f("button"),v.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1uu9qhk"),r(c,"class","label-text svelte-1uu9qhk"),r(d,"type","text"),r(d,"class","svelte-1uu9qhk"),r(s,"class","svelte-1uu9qhk"),r(o,"class","form-group svelte-1uu9qhk"),r(g,"class","btn btn-primary svelte-1uu9qhk"),r(v,"class","btn svelte-1uu9qhk"),r(m,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal svelte-1uu9qhk"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(t,i),a(t,o),a(o,s),a(s,c),a(s,u),a(s,d),Me(d,n[105]),a(t,p),T&&T.m(t,null),a(t,h),a(t,m),a(m,g),a(m,b),a(m,v),y||(E=[P(d,"input",n[373]),P(d,"keydown",n[128]),P(g,"click",n[126]),P(v,"click",n[127]),P(e,"click",xt(n[127])),P(e,"keydown",zn(n[127]))],y=!0)},p(N,A){A[3]&4096&&d.value!==N[105]&&Me(d,N[105]),N[106]?T?T.p(N,A):(T=bf(N),T.c(),T.m(t,h)):T&&(T.d(1),T=null)},d(N){N&&S(e),T&&T.d(),y=!1,Ce(E)}}}function bf(n){let e,t;return{c(){e=f("div"),t=H(n[106]),r(e,"class","rename-error svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[3]&8192&&Q(t,l[106])},d(l){l&&S(e)}}}function kf(n){let e,t,l,i,o,s=n[107].title+"",c,u,d,p,h,m,g,b,v,y,E,T,N,A,I=k("inbox.assign")+"",O,R,D,B,j,U,z=n[109].length>0&&vf(n),W=n[111]&&yf();return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("inbox.assignTitle")}`,i=w(),o=f("div"),c=H(s),u=w(),d=f("div"),p=f("label"),h=f("span"),h.textContent=`${k("inbox.assignTarget")}`,m=w(),g=f("input"),b=w(),v=f("div"),v.textContent=`${k("inbox.assignSearchHint")}`,y=w(),z&&z.c(),E=w(),W&&W.c(),T=w(),N=f("div"),A=f("button"),O=H(I),D=w(),B=f("button"),B.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1uu9qhk"),r(o,"class","create-context svelte-1uu9qhk"),r(h,"class","label-text svelte-1uu9qhk"),r(g,"type","text"),r(g,"placeholder",k("inbox.assignSearchPlaceholder")),r(g,"class","svelte-1uu9qhk"),r(v,"class","assign-hint svelte-1uu9qhk"),r(p,"class","svelte-1uu9qhk"),r(d,"class","form-group assign-search svelte-1uu9qhk"),r(A,"class","btn btn-primary svelte-1uu9qhk"),A.disabled=R=!n[110],r(B,"class","btn svelte-1uu9qhk"),r(N,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal svelte-1uu9qhk"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(K,Y){C(K,e,Y),a(e,t),a(t,l),a(t,i),a(t,o),a(o,c),a(t,u),a(t,d),a(d,p),a(p,h),a(p,m),a(p,g),Me(g,n[108]),a(p,b),a(p,v),a(d,y),z&&z.m(d,null),a(t,E),W&&W.m(t,null),a(t,T),a(t,N),a(N,A),a(A,O),a(N,D),a(N,B),j||(U=[P(g,"input",n[374]),P(g,"input",n[204]),P(g,"keydown",n[375]),P(A,"click",n[206]),P(B,"click",n[203]),P(e,"click",xt(n[203])),P(e,"keydown",zn(n[203]))],j=!0)},p(K,Y){Y[3]&16384&&s!==(s=K[107].title+"")&&Q(c,s),Y[3]&32768&&g.value!==K[108]&&Me(g,K[108]),K[109].length>0?z?z.p(K,Y):(z=vf(K),z.c(),z.m(d,null)):z&&(z.d(1),z=null),K[111]?W||(W=yf(),W.c(),W.m(t,T)):W&&(W.d(1),W=null),Y[3]&131072&&R!==(R=!K[110])&&(A.disabled=R)},d(K){K&&S(e),z&&z.d(),W&&W.d(),j=!1,Ce(U)}}}function vf(n){let e,t=Te(n[109]),l=[];for(let i=0;i<t.length;i+=1)l[i]=wf(Tc(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();r(e,"class","assign-search-results svelte-1uu9qhk")},m(i,o){C(i,e,o);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,o){if(o[3]&65536|o[6]&524800){t=Te(i[109]);let s;for(s=0;s<t.length;s+=1){const c=Tc(i,t,s);l[s]?l[s].p(c,o):(l[s]=wf(c),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&S(e),et(l,i)}}}function wf(n){let e,t,l=(n[463].path||n[463].title)+"",i,o,s,c=n[195](n[463].type)+"",u,d,p,h;function m(){return n[376](n[463])}return{c(){e=f("button"),t=f("span"),i=H(l),o=w(),s=f("span"),u=H(c),d=w(),r(t,"class","svelte-1uu9qhk"),r(s,"class","svelte-1uu9qhk"),r(e,"class","assign-search-result svelte-1uu9qhk")},m(g,b){C(g,e,b),a(e,t),a(t,i),a(e,o),a(e,s),a(s,u),a(e,d),p||(h=P(e,"click",m),p=!0)},p(g,b){n=g,b[3]&65536&&l!==(l=(n[463].path||n[463].title)+"")&&Q(i,l),b[3]&65536&&c!==(c=n[195](n[463].type)+"")&&Q(u,c)},d(g){g&&S(e),p=!1,h()}}}function yf(n){let e;return{c(){e=f("div"),e.textContent=`${k("common.loading")}`,r(e,"class","assign-status svelte-1uu9qhk")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Ef(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v,y,E,T,N,A,I,O,R,D,B,j=k("common.save")+"",U,z,W,K,Y,F,L=n[74]&&Tf(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("links.editTitle")}`,i=w(),o=f("div"),s=f("label"),c=f("span"),c.textContent=`${k("common.name")}`,u=w(),d=f("input"),p=w(),h=f("div"),m=f("label"),g=f("span"),g.textContent="URL",b=w(),v=f("input"),y=w(),E=f("div"),T=f("label"),N=f("span"),N.textContent=`${k("links.note")}`,A=w(),I=f("textarea"),O=w(),L&&L.c(),R=w(),D=f("div"),B=f("button"),U=H(j),W=w(),K=f("button"),K.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1uu9qhk"),r(c,"class","label-text svelte-1uu9qhk"),r(d,"type","text"),r(d,"class","svelte-1uu9qhk"),r(s,"class","svelte-1uu9qhk"),r(o,"class","form-group svelte-1uu9qhk"),r(g,"class","label-text svelte-1uu9qhk"),r(v,"type","url"),r(v,"class","svelte-1uu9qhk"),r(m,"class","svelte-1uu9qhk"),r(h,"class","form-group svelte-1uu9qhk"),r(N,"class","label-text svelte-1uu9qhk"),r(I,"class","svelte-1uu9qhk"),r(T,"class","svelte-1uu9qhk"),r(E,"class","form-group svelte-1uu9qhk"),r(B,"class","btn btn-primary svelte-1uu9qhk"),B.disabled=z=!n[72].trim(),r(K,"class","btn svelte-1uu9qhk"),r(D,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal svelte-1uu9qhk"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","button"),r(e,"tabindex","0")},m(M,q){C(M,e,q),a(e,t),a(t,l),a(t,i),a(t,o),a(o,s),a(s,c),a(s,u),a(s,d),Me(d,n[71]),a(t,p),a(t,h),a(h,m),a(m,g),a(m,b),a(m,v),Me(v,n[72]),a(t,y),a(t,E),a(E,T),a(T,N),a(T,A),a(T,I),Me(I,n[73]),a(t,O),L&&L.m(t,null),a(t,R),a(t,D),a(D,B),a(B,U),a(D,W),a(D,K),Y||(F=[P(d,"input",n[377]),P(v,"input",n[378]),P(I,"input",n[379]),P(B,"click",n[211]),P(K,"click",n[210]),P(e,"click",xt(n[210])),P(e,"keydown",zn(n[210]))],Y=!0)},p(M,q){q[2]&512&&d.value!==M[71]&&Me(d,M[71]),q[2]&1024&&v.value!==M[72]&&Me(v,M[72]),q[2]&2048&&Me(I,M[73]),M[74]?L?L.p(M,q):(L=Tf(M),L.c(),L.m(t,R)):L&&(L.d(1),L=null),q[2]&1024&&z!==(z=!M[72].trim())&&(B.disabled=z)},d(M){M&&S(e),L&&L.d(),Y=!1,Ce(F)}}}function Tf(n){let e,t;return{c(){e=f("div"),t=H(n[74]),r(e,"class","rename-error svelte-1uu9qhk")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[2]&4096&&Q(t,l[74])},d(l){l&&S(e)}}}function Sf(n){let e,t;return e=new qd({props:{title:n[100],message:n[101],confirmText:n[103],danger:n[102]}}),e.$on("confirm",n[130]),e.$on("cancel",n[131]),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[3]&128&&(o.title=l[100]),i[3]&256&&(o.message=l[101]),i[3]&1024&&(o.confirmText=l[103]),i[3]&512&&(o.danger=l[102]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function Cf(n){let e,t;return e=new Pd({props:{item:n[91],content:n[92],loading:n[93],error:n[94]}}),e.$on("close",n[129]),e.$on("openExternal",n[380]),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[2]&536870912&&(o.item=l[91]),i[2]&1073741824&&(o.content=l[92]),i[3]&1&&(o.loading=l[93]),i[3]&2&&(o.error=l[94]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function Af(n){let e,t;return e=new N0({props:{onClose:n[226],onSyncRefresh:n[224],onPluginToggle:n[227],initialSection:n[116]}}),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p(l,i){const o={};i[3]&8388608&&(o.initialSection=l[116]),e.$set(o)},i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function Nf(n){let e,t,l,i,o,s=k("link.label")+"",c,u,d,p,h,m=k("link.url")+"",g,b,v,y,E,T,N,A,I,O;return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("note.toolbar.link")}`,i=w(),o=f("label"),c=H(s),u=w(),d=f("input"),p=w(),h=f("label"),g=H(m),b=w(),v=f("input"),y=w(),E=f("div"),T=f("button"),T.textContent=`${k("link.insert")}`,N=w(),A=f("button"),A.textContent=`${k("common.cancel")}`,r(l,"class","svelte-1uu9qhk"),r(d,"type","text"),r(d,"placeholder","Example"),r(d,"class","svelte-1uu9qhk"),r(o,"class","svelte-1uu9qhk"),r(v,"type","text"),r(v,"placeholder",k("link.urlPlaceholder")),r(v,"class","svelte-1uu9qhk"),r(h,"class","svelte-1uu9qhk"),r(T,"type","button"),r(T,"class","btn btn-primary svelte-1uu9qhk"),r(A,"type","button"),r(A,"class","btn svelte-1uu9qhk"),r(E,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal-box svelte-1uu9qhk"),r(t,"role","document"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","dialog"),r(e,"aria-modal","true"),r(e,"aria-label",k("note.toolbar.link"))},m(R,D){C(R,e,D),a(e,t),a(t,l),a(t,i),a(t,o),a(o,c),a(o,u),a(o,d),Me(d,n[42]),a(t,p),a(t,h),a(h,g),a(h,b),a(h,v),Me(v,n[43]),a(t,y),a(t,E),a(E,T),a(E,N),a(E,A),I||(O=[P(d,"input",n[381]),P(d,"keydown",n[382]),P(v,"input",n[383]),P(v,"keydown",n[384]),P(T,"click",n[154]),P(A,"click",n[385]),P(e,"click",xt(n[386])),P(e,"keydown",n[387])],I=!0)},p(R,D){D[1]&2048&&d.value!==R[42]&&Me(d,R[42]),D[1]&4096&&v.value!==R[43]&&Me(v,R[43])},d(R){R&&S(e),I=!1,Ce(O)}}}function If(n){let e,t;return e=new j2({props:{visible:!0}}),e.$on("insert",n[155]),e.$on("close",n[156]),{c(){Qe(e.$$.fragment)},m(l,i){Ye(e,l,i),t=!0},p:se,i(l){t||(ge(e.$$.fragment,l),t=!0)},o(l){ke(e.$$.fragment,l),t=!1},d(l){Xe(e,l)}}}function Rf(n){let e,t,l,i,o,s,c,u,d,p,h,m,g,b,v;return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${k("note.rename")}`,i=w(),o=f("div"),s=f("label"),s.textContent=`${k("note.title")}`,c=w(),u=f("input"),d=w(),p=f("div"),h=f("button"),h.textContent=`${k("common.cancel")}`,m=w(),g=f("button"),g.textContent=`${k("common.save")}`,r(l,"class","svelte-1uu9qhk"),r(s,"for","rn-title"),r(s,"class","svelte-1uu9qhk"),r(u,"id","rn-title"),r(u,"type","text"),r(u,"class","svelte-1uu9qhk"),r(o,"class","form-group svelte-1uu9qhk"),r(h,"class","btn svelte-1uu9qhk"),r(g,"class","btn btn-primary svelte-1uu9qhk"),r(p,"class","modal-actions svelte-1uu9qhk"),r(t,"class","modal svelte-1uu9qhk"),sn(t,"width","380px"),r(e,"class","modal-overlay svelte-1uu9qhk"),r(e,"role","dialog"),r(e,"aria-modal","true"),r(e,"aria-label",k("note.rename"))},m(y,E){C(y,e,E),a(e,t),a(t,l),a(t,i),a(t,o),a(o,s),a(o,c),a(o,u),Me(u,n[48]),a(t,d),a(t,p),a(p,h),a(p,m),a(p,g),b||(v=[P(u,"input",n[388]),P(u,"keydown",n[389]),P(h,"click",n[158]),P(g,"click",n[159]),P(e,"click",xt(n[158])),P(e,"keydown",n[390])],b=!0)},p(y,E){E[1]&131072&&u.value!==y[48]&&Me(u,y[48])},d(y){y&&S(e),b=!1,Ce(v)}}}function Mf(n){let e,t;return{c(){e=f("div"),t=H(n[46]),r(e,"class","verstak-toast svelte-1uu9qhk"),r(e,"role","alert"),r(e,"aria-live","polite")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[1]&32768&&Q(t,l[46])},d(l){l&&S(e)}}}function My(n){var y;let e,t,l,i,o,s,c,u;const d=[ow,sw,iw],p=[];function h(E,T){return E[11]?0:E[12]?1:2}e=h(n),t=p[e]=d[e](n);let m=n[41]&&Nf(n),g=n[44]&&If(n),b=n[47]&&n[47]!==((y=n[37])==null?void 0:y.id)&&Rf(n),v=n[45]&&Mf(n);return{c(){t.c(),l=w(),m&&m.c(),i=w(),g&&g.c(),o=w(),b&&b.c(),s=w(),v&&v.c(),c=kt()},m(E,T){p[e].m(E,T),C(E,l,T),m&&m.m(E,T),C(E,i,T),g&&g.m(E,T),C(E,o,T),b&&b.m(E,T),C(E,s,T),v&&v.m(E,T),C(E,c,T),u=!0},p(E,T){var A;let N=e;e=h(E),e===N?p[e].p(E,T):(yt(),ke(p[N],1,1,()=>{p[N]=null}),Et(),t=p[e],t?t.p(E,T):(t=p[e]=d[e](E),t.c()),ge(t,1),t.m(l.parentNode,l)),E[41]?m?m.p(E,T):(m=Nf(E),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null),E[44]?g?(g.p(E,T),T[1]&8192&&ge(g,1)):(g=If(E),g.c(),ge(g,1),g.m(o.parentNode,o)):g&&(yt(),ke(g,1,1,()=>{g=null}),Et()),E[47]&&E[47]!==((A=E[37])==null?void 0:A.id)?b?b.p(E,T):(b=Rf(E),b.c(),b.m(s.parentNode,s)):b&&(b.d(1),b=null),E[45]?v?v.p(E,T):(v=Mf(E),v.c(),v.m(c.parentNode,c)):v&&(v.d(1),v=null)},i(E){u||(ge(t),ge(g),u=!0)},o(E){ke(t),ke(g),u=!1},d(E){E&&(S(l),S(i),S(o),S(s),S(c)),p[e].d(E),m&&m.d(E),g&&g.d(E),b&&b.d(E),v&&v.d(E)}}}function de(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails call error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function Ly(n,e,t){const l=[...n];return l.sort((i,o)=>{let s=0;if(e==="name")s=(i.title||"").localeCompare(o.title||"");else if(e==="type"){const c=i.captureKind||i.sourceKind||i.type||"",u=o.captureKind||o.sourceKind||o.type||"";s=c.localeCompare(u)}else s=(i.capturedAt||i.createdAt||"").localeCompare(o.capturedAt||o.createdAt||"");return t==="asc"?s:-s}),l}function Oy(n,e){return n.section===e.section&&n.nodeId===e.nodeId&&n.tab===e.tab&&n.trashFolderId===e.trashFolderId}function Ni(n){return!n||!(n instanceof Element)?!1:!!n.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')}function Ii(n,e,t){for(const l of n){if(l.id===e)return l.children=t,l.has_children=t.length>0,!0;if(l.children&&Ii(l.children,e,t))return!0}return!1}function Kd(n){return(n==null?void 0:n.sourceKind)||(n==null?void 0:n.captureKind)||(n==null?void 0:n.type)||""}function Xs(n){return Kd(n)!=="url"&&(n==null?void 0:n.type)!=="link"}function Dy(n,e){return{id:n.id,nodeId:n.id,fileId:e.id||e.fileId,name:e.name||n.title,type:"file",size:e.size||0,mime:e.mime||""}}function Vd(n,e,t){for(const l of n){if(l.id===e)return l.children=t,l.has_children=t.length>0,!0;if(l.children&&Vd(l.children,e,t))return!0}return!1}function Py(n,e){return e?n.filter(t=>ws(t)===e):n.filter(t=>!ws(t)||!n.some(l=>l.id===ws(t)))}function ws(n){return(n==null?void 0:n.parentId)||(n==null?void 0:n.parentID)||(n==null?void 0:n.parent_id)||""}function Ei(n){return n.eventIds&&n.eventIds.length?n.eventIds:n.events&&n.events.length?n.events.map(e=>e.id).filter(Boolean):[]}function Ti(n){try{de("WriteDebugLog",n)}catch{}}function ys(n){return n?n.map(e=>(e._expanded===void 0&&(e._expanded=!1),e)):[]}function rn(n){return n?new Date(n).toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"}):""}function ni(n){return n==="note_created"||n==="file_added"||n==="folder_added"||n==="node_created"?"+":n==="file_deleted"||n==="folder_deleted"?"×":n==="file_renamed"||n==="folder_renamed"||n==="note_updated"||n==="node_updated"?"~":n==="file_copied"?"⧉":n==="file_moved"?"→":"•"}function qn(n){if(!n)return"";try{return new Date(n).toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}catch{return n}}function Es(n){const e=String(n||"").trim();if(!e||/[\s]/.test(e)||e.includes("@"))return"";try{const t=new URL(e);return(t.protocol==="http:"||t.protocol==="https:")&&t.hostname?e:""}catch{try{const l=`https://${e}`,i=new URL(l);return i.hostname&&i.hostname.includes(".")?l:""}catch{return""}}}function qy(n){return{"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp"}[n]||"bin"}function zy(n){return new Promise((e,t)=>{const l=new FileReader;l.onload=()=>{const i=String(l.result||""),o=i.indexOf(",");e(o>=0?i.slice(o+1):i)},l.onerror=()=>t(l.error),l.readAsDataURL(n)})}function By(n){const e=String(n||"").split(/\r?\n/).map(t=>t.trim()).filter(Boolean);return e.length?{url:e[0],title:e[1]||""}:null}function Fy(n){return String(n||"").split(/\r?\n/).map(t=>t.trim()).filter(t=>t&&!t.startsWith("#"))[0]||""}function Lf(n){const e=Array.from((n==null?void 0:n.types)||[]);return e.includes("Files")||e.includes("text/uri-list")||e.includes("text/x-moz-url")||e.includes("text/plain")&&!e.includes("application/x-verstak-node")}function jy(n){return["case","client","project","folder","document","recipe"].includes(n.type)}function Uy(n){return n.targetType==="note"&&n.targetId?{nodeId:n.nodeId,tab:"notes",targetId:n.targetId}:n.targetType==="file"?{nodeId:n.nodeId,tab:"files",targetId:n.targetId,targetPath:n.targetPath}:n.targetType==="folder"?{nodeId:n.nodeId,tab:"files",targetPath:n.targetPath||n.targetId}:{nodeId:n.nodeId}}function zn(n){return e=>{Ni(e.target)||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n())}}function Hy(n,e,t){var jo;let l,i,o,s,c=null,u=!1,d=!1,p=!1,h=!1,m=[],g=[],b=[],v=null,y=[],E=0,T=!0,N=[],A=null,I="",O="",R=!1,D="",B="all",j="all",U="",z="",W="suggestions",K="",Y=[],F=!1,L=[],M="",q="";function X(_){return{"vault not open":k("error.vaultNotOpen")}[_]||_}let Z="",J=null,ee="overview",te=[],le=null,_e,oe,ze="edit",Ge=!1,Ie="",ne="",re=!1,Ne=!1,Fe="",we=null,je="",xe="",Ae=[],Ve=[],Ue=[],Se=!1,He="",Oe="",Ke="",Pe="",ue=!1,be=!1,x=null,ye=null,me=[],Re=0,ft=[],it=[],Ze=[],dt=!1,Je=[],pe=[],qe=!1,pt="",vt="date",At="desc",Zt=!1,mt=[],Mt=null,It="",jt="",an="",cn="",Ut=null,Rn=0,Ct=[],Lt="",gt=[],bl=[],bn="",kl="",en=[],_t=!1,Ot=!1,tn="",un=null,Ht=null,$t={visible:!1,x:0,y:0,node:null},kn=!1,fn="",$="open_url",he="",tt=[{id:"open_url",label:k("action.openUrl")},{id:"open_file",label:k("action.openFile")},{id:"open_folder",label:k("action.openFolder")},{id:"run_command",label:k("action.runCommand")},{id:"run_script",label:k("action.runScript")},{id:"open_terminal",label:k("action.openTerminal")},{id:"launch_app",label:k("action.launchApp")}],st=!0,Yt={},Wt=null,vn="",Bn=!1,Xt="",vl=!1,wn=!1,yn=!1,Fn="",dn=0,Mn=0,Gt=null,wl=!1,oi="",jl="",Ul=!1,ri=k("common.delete"),Jn=null,yl=null,jn=!1,Qn="",hn="",En="",Ee=null,V="",ie=[],ve=null,De=!1,$e,nt=null,St=!1,wt="",Dt="";const nn=[{id:"overview",label:k("tab.overview")},{id:"notes",label:k("tab.notes")},{id:"files",label:k("tab.files")},{id:"links",label:k("tab.links")},{id:"actions",label:k("tab.actions")},{id:"activity",label:k("tab.activity"),group:"service"},{id:"worklog",label:k("tab.worklog"),group:"service"},{id:"inbox",label:k("tab.inbox"),group:"service"}];let xn=null;function Pt(_){const G={};for(const Le of _){const Be=Le.captureContextLabel||k("inbox.noContext");G[Be]||(G[Be]=[]),G[Be].push(Le)}const fe=[];for(const[Le,Be]of Object.entries(G))fe.push({label:Le,items:Be});return fe.sort((Le,Be)=>Le.label.localeCompare(Be.label)),fe}function Zd(){return{section:Z||"",nodeId:(J==null?void 0:J.id)||"",tab:J?ee:"",trashFolderId:Z==="trash"?Lt:"",trashFolderStack:Z==="trash"?gt.map(_=>({id:_.id,title:_.title})):[]}}function El(){if(_t)return;const _=Zd(),G=en[en.length-1];(!G||!Oy(G,_))&&(en=[...en,_].slice(-80))}function Ki(){t(8,Lt=""),t(231,gt=[]),t(76,Ct=[])}function Js(){return wl?(Zi(),!0):h?(Fo(),!0):Wt?($s(),!0):Ee?(as(),!0):Mt?(cs(),!0):jn?(t(104,jn=!1),!0):Se?(po(),!0):kn?(qo(),!0):Ot?(no(),!0):$t.visible?($n(),!0):le?(fo(),!0):!1}async function Yd(_){var G;_t=!0;try{if(_.nodeId){const fe=await de("GetNodeDetail",_.nodeId);return fe?(await qt(fe),t(35,ee=_.tab||"overview"),ee==="files"&&((G=oe==null?void 0:oe.resetToNode)==null||G.call(oe,fe.id)),!0):!1}else if(_.section)return m.some(fe=>fe.id===_.section)?(await ci(_.section),_.section==="trash"&&(t(8,Lt=_.trashFolderId||""),t(231,gt=_.trashFolderStack||[]),t(76,Ct=[]),await tl()),!0):!1;return!1}catch{return!1}finally{_t=!1}}async function Qs(){if(!Js())for(;en.length>0;){const _=en[en.length-1];if(en=en.slice(0,-1),await Yd(_))return}}function ai(_){_.button!==3&&_.button!==4||Ni(_.target)||Js()&&_.button===3||(_.preventDefault(),_.stopPropagation(),_.button===3&&Qs())}function ln(_){var G;ee!==_&&(El(),t(35,ee=_),_==="files"&&J&&((G=oe==null?void 0:oe.resetToNode)==null||G.call(oe,J.id)))}li(async()=>{try{if(t(10,c=await de("GetStartupStatus")),u=!0,c.status==="first_run"){t(11,d=!0),t(89,st=!1);return}if(c.status==="recovery"){t(12,p=!0),t(89,st=!1);return}}catch(_){t(34,q=String(_))}try{t(33,M=await de("VerstakVersion")||"verstak-gui/v2"),t(0,m=await de("ListSystemViewsWithPlugins")||[]),t(14,g=await de("ListWorkspaceTree")||[]),t(15,b=await de("ListEnabledTemplates")||[])}catch(_){t(34,q=String(_)),t(0,m=[{id:"today",label:k("nav.today")},{id:"inbox",label:k("nav.inbox")},{id:"activity",label:k("nav.activity")}]),t(14,g=[]),t(15,b=[])}window.runtime&&window.runtime.EventsOn&&(window.runtime.EventsOn("files-dropped",Mp),xn=()=>window.runtime.EventsOff("files-dropped")),window.addEventListener("keydown",eo),window.addEventListener("paste",vo),window.addEventListener("dragenter",To),window.addEventListener("dragover",So),window.addEventListener("dragleave",Co),window.addEventListener("dragend",Rt),window.addEventListener("dragcancel",Rt),window.addEventListener("drop",No),window.addEventListener("mouseup",Rt),window.addEventListener("mouseleave",Rt),window.addEventListener("blur",Rt),document.addEventListener("visibilitychange",Ao),window.addEventListener("auxclick",ai),window.addEventListener("mouseup",ai),t(89,st=!1),fs(),$i()}),ii(()=>{xn&&xn(),window.removeEventListener("keydown",eo),window.removeEventListener("paste",vo),window.removeEventListener("dragenter",To),window.removeEventListener("dragover",So),window.removeEventListener("dragleave",Co),window.removeEventListener("dragend",Rt),window.removeEventListener("dragcancel",Rt),window.removeEventListener("drop",No),window.removeEventListener("mouseup",Rt),window.removeEventListener("mouseleave",Rt),window.removeEventListener("blur",Rt),document.removeEventListener("visibilitychange",Ao),window.removeEventListener("auxclick",ai),window.removeEventListener("mouseup",ai),wo()});async function ci(_){El(),t(1,Z=_),t(2,J=null),t(35,ee="overview"),t(36,te=[]),Ae=[],t(49,Ve=[]),t(50,Ue=[]),t(66,pe=[]),t(69,mt=[]),t(60,me=[]),t(3,Je=[]),t(7,Ut=null),Ki(),t(80,Ot=!1),t(34,q=""),t(16,v=null),t(62,ft=[]),t(63,it=[]),t(17,y=[]),E=0,T=!0,t(18,N=[]),t(19,A=null);try{_==="today"?(t(16,v=await de("ListTodayView")||{cases:[]}),t(60,me=await de("GetSuggestions")||[]),t(61,Re=me.length),t(62,ft=await de("ListTodayInProgress")||[]),t(63,it=await de("ListTodayCaptures")||[])):_==="inbox"?t(3,Je=await de("ListInboxNodes")||[]):_==="trash"?await tl():_==="journal"?await nl():_==="activity"&&(t(17,y=await de("ListActivityFeed",50,0)||[]),E=y.length,T=y.length===50)}catch(G){t(34,q=String(G)),t(16,v={cases:[]}),t(3,Je=[]),t(7,Ut=null),t(17,y=[])}}async function qt(_){El(),t(2,J=_),t(1,Z=""),t(35,ee="overview"),t(36,te=[]),Ae=[],t(49,Ve=[]),t(50,Ue=[]),t(60,me=[]),Ki(),t(37,le=null),t(80,Ot=!1),t(34,q=""),t(32,L=[]),await Vi(_.id)}async function Vi(_){try{t(36,te=await de("ListNotes",_)||[])}catch{}try{Ae=await de("ListFiles",_)||[]}catch{}try{t(49,Ve=await de("ListActions",_)||[])}catch{}try{t(50,Ue=ys(await de("ListWorklog",_)))}catch{}try{t(66,pe=await de("ListInboxNodesForTarget",_)||[])}catch{t(66,pe=[])}try{t(69,mt=await de("ListLinks",_)||[])}catch{t(69,mt=[])}try{t(60,me=await de("GetSuggestions")||[]),t(61,Re=me.length)}catch{t(60,me=[]),t(61,Re=0)}try{t(32,L=await de("ListActivityByNode",_,50,0)||[])}catch{}}function Xd(_,G){Qn=_,t(105,hn=G),t(106,En=""),t(104,jn=!0)}async function xs(){const _=hn.trim();if(!_){t(106,En=k("rename.emptyError"));return}try{await de("ValidateName",_)}catch{t(106,En=k("rename.invalidError"));return}t(104,jn=!1);const G=Qn;Qn="";try{await de("RenameNode",G,_),J&&J.id===G&&t(2,J={...J,title:_}),await el()}catch(fe){t(34,q=String(fe))}}function Jd(){t(104,jn=!1),Qn="",t(105,hn=""),t(106,En="")}function Qd(_){_.key==="Enter"?xs():t(106,En="")}function $s(){t(91,Wt=null),t(92,vn=""),t(94,Xt="")}function eo(_){if(_.key==="Escape"&&yn){_.preventDefault(),Rt();return}if(!Ni(_.target)){if(_.key==="Backspace"||_.altKey&&_.key==="ArrowLeft"){_.preventDefault(),Qs();return}if(ee==="files"&&oe)return oe.handleFilesKeydown(_)}}function Ln(_){t(100,oi=_.title||k("common.confirm")),t(101,jl=_.message||""),t(102,Ul=_.danger!==void 0?_.danger:!0),t(103,ri=_.confirmText||k("common.delete")),Jn=_.onConfirm||null,yl=_.onCancel||null,t(99,wl=!0)}function Zi(){t(99,wl=!1),Jn=null,yl=null}function xd(){Jn&&Jn(),Zi()}function $d(){yl&&yl(),Zi()}function to(_){t(82,un=$t.node),t(83,Ht=_),t(81,tn=""),t(80,Ot=!0),$n()}function ep(){t(82,un=null),t(83,Ht=void 0),t(81,tn=""),t(80,Ot=!0)}function no(){t(80,Ot=!1),t(81,tn=""),t(82,un=null),t(83,Ht=void 0)}async function lo(){if(!(!tn.trim()||Ht===void 0))try{const _=un?un.id:"",G=Ht?Ht.id:"",fe=await de("CreateNodeFromTemplate",_,tn.trim(),G);t(80,Ot=!1),t(81,tn="");const Le=fe?fe.id:null;if(t(82,un=null),t(83,Ht=void 0),_){t(90,Yt={...Yt,[_]:!0});const Be=await de("ListWorkspaceChildren",_)||[];Ii(g,_,Be),t(14,g=[...g])}else t(14,g=await de("ListWorkspaceTree")||g);if(Le){const Be=await de("GetNodeDetail",Le);Be&&(t(1,Z=""),qt(Be))}}catch(_){t(34,q=String(_))}}function tp(_,G){t(84,$t={visible:!0,x:_.clientX,y:_.clientY,node:G})}function $n(){t(84,$t={visible:!1,x:0,y:0,node:null})}async function np(_){const G=!Yt[_];if(t(90,Yt={...Yt,[_]:G}),!G)return;const fe=await de("ListWorkspaceChildren",_)||[];Ii(g,_,fe),t(14,g=[...g])}async function lp(_,G){if(!(!_||!G||_===G))try{const fe=await de("MoveNode",_,G);await el();const Le=await de("GetNodeDetail",_);Le&&(t(1,Z=""),qt(Le))}catch(fe){t(34,q=String(fe))}}async function ip(_){_.preventDefault(),_.stopPropagation();try{const G=_.dataTransfer.getData("text/plain");if(!G)return;const fe=await de("GetNodeDetail",G);if(!fe||!fe.parent_id)return;await de("MoveNode",G,""),await el();const Le=await de("GetNodeDetail",G);Le&&(t(1,Z=""),qt(Le))}catch(G){t(34,q=String(G))}}function sp(_){_.preventDefault(),_.dataTransfer.dropEffect="move",t(95,vl=!0)}function op(_){t(95,vl=!1)}function io(_){Xd(_.id,_.title),$n()}function so(_){$n(),Ln({title:k("delete.confirmTitle"),message:k("delete.confirmMessage")+" "+_.title+"?",confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteNode",_.id),await el(),await $i(),J&&J.id===_.id&&t(2,J=null)}catch(G){t(34,q=String(G))}}})}async function On(_){$n();const G=typeof _=="string"?_:_.id;try{await de("OpenFolder",G)}catch(fe){t(34,q=String(fe))}}async function mn(_){var fe,Le;const G=Kd(_);try{if(G==="url"||_.type==="link"){if(!_.url)throw new Error("url required");await de("OpenURL",_.url);return}if(G==="text"||_.type==="note"){const Be=await de("ReadNote",_.id);t(37,le={id:_.id,title:_.title,content:Be||"",dirty:!1});return}if(G==="folder"||_.type==="folder"){El(),t(1,Z=""),t(2,J=_),t(35,ee="files"),await Vi(_.id),(fe=oe==null?void 0:oe.resetToNode)==null||fe.call(oe,_.id);return}if(G==="file"||G==="image"||_.type==="file"){const bt=(await de("ListFiles",_.id)||[])[0];if(!bt)throw new Error("file record not found");const Kt=Dy(_,bt);Og(Kt)?(t(35,ee="files"),(Le=oe==null?void 0:oe.openFileById)==null||Le.call(oe,_.id)):await de("OpenFile",Kt.fileId);return}await Wl(_.id)}catch(Be){t(34,q=String(Be))}}async function oo(_){$n();try{await de("MoveNode",_.id,""),await el();const G=await de("GetNodeDetail",_.id);G&&(t(1,Z=""),qt(G))}catch(G){t(34,q=String(G))}}async function el(){const _=Object.keys(Yt).filter(fe=>Yt[fe]),G=await de("ListWorkspaceTree")||[];for(const fe of _){const Be=(await de("ListWorkspaceChildren",fe)||[]).map(bt=>({...bt}));Vd(G,fe,Be)}t(14,g=G)}async function ro(_){const G=await de("ListWorkspaceChildren",_)||[];Ii(g,_,G),t(14,g=[...g])}async function ao(_){if(!(!_.trim()||!J))try{const G=await de("CreateNote",J.id,_.trim());t(36,te=[...te,G&&G.id?G:{id:Date.now().toString(),title:_.trim(),createdAt:new Date().toISOString()}])}catch{const fe={id:Date.now().toString(),title:_.trim(),createdAt:new Date().toISOString()};t(36,te=[...te,fe])}}async function Un(_){if(le&&le.dirty){Ln({title:k("note.unsavedTitle"),message:k("note.unsavedMessage"),confirmText:k("note.unsavedClose"),danger:!1,onConfirm:async()=>{await co(_)}});return}await co(_)}async function co(_){try{const G=await de("ReadNote",_.id);t(37,le={id:_.id,title:_.title,content:G||"",dirty:!1})}catch{t(37,le={id:_.id,title:_.title,content:"# "+_.title+`
|
||
|
||
`,dirty:!1})}}function uo(_){Ln({title:k("common.delete"),message:k("note.deleteConfirm",{title:_.title})||`Удалить заметку «${_.title}»?`,confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteNote",_.id),t(36,te=te.filter(G=>G.id!==_.id)),le&&le.id===_.id&&t(37,le=null);try{await $i()}catch{}}catch(G){t(34,q=String(G))}}})}function fo(){if(le&&le.dirty){Ln({title:k("note.unsavedTitle"),message:k("note.unsavedMessage"),confirmText:k("note.unsavedClose"),danger:!1,onConfirm:()=>{t(37,le=null),t(40,ze="edit")}});return}t(37,le=null),t(40,ze="edit")}async function rp(){if(le)try{await de("SaveNote",le.id,le.content),t(37,le.dirty=!1,le)}catch{t(37,le.dirty=!1,le)}}function ap(){t(42,Ie=""),t(43,ne=""),t(41,Ge=!0)}function Yi(){if(!le){t(41,Ge=!1);return}const _=Ie.trim()||ne.trim()||"link",G=ne.trim()||"#",fe=`[${_}](${G})`;t(37,le.content=le.content+(le.content.endsWith(`
|
||
`)?"":`
|
||
`)+fe+`
|
||
`,le),t(37,le.dirty=!0,le),t(41,Ge=!1)}function cp(){t(44,re=!0)}function up(_){const G=_.detail.markdown;_e&&typeof _e.insertText=="function"&&_e.insertText(G),t(44,re=!1)}function fp(){t(44,re=!1)}function Xi(_,G){t(47,we=_),t(48,je=G),xe=G}function Hn(){t(47,we=null),t(48,je=""),xe=""}async function Ji(){if(!we||!je.trim()){Hn();return}if(je.trim()===xe){Hn();return}try{await de("RenameNote",we,je.trim()),t(36,te=te.map(_=>_.id===we?{..._,title:je.trim()}:_)),le&&le.id===we&&t(37,le.title=je.trim(),le),Hn()}catch(_){t(34,q=String(_)),Hn()}}async function dp(_){const{type:G,id:fe}=_.detail;if(fe)switch(G){case"case":await pp(fe);break;case"note":await hp(fe);break;case"file":await mp(fe);break;case"secret":Dn(k("note.internal.secretNotImplemented"));break;default:Dn(`verstak://${G}/${fe}`)}}async function pp(_){try{const G=await de("GetNodeDetail",_);if(!G){Dn(k("note.internal.caseNotFound"));return}await qt(G)}catch{Dn(k("note.internal.caseNotFound"))}}async function hp(_){try{const G=await de("GetNodeDetail",_);if(!G){Dn(k("note.internal.noteNotFound"));return}const fe=G.parent_id||G.parentId||"";if(fe){const Be=await de("GetNodeDetail",fe);Be&&await qt(Be)}ln("notes");const Le=te.find(Be=>Be.id===_);Le?await Un(Le):await Un({id:G.id,title:G.title})}catch{Dn(k("note.internal.noteNotFound"))}}async function mp(_){var G,fe;try{const Le=await de("GetNodeDetail",_);if(!Le){Dn(k("note.internal.fileNotFound"));return}const Be=Le.parent_id||Le.parentId||"";if(Be){const bt=await de("GetNodeDetail",Be);bt&&await qt(bt),ln("files"),(G=oe==null?void 0:oe.resetToNode)==null||G.call(oe,Be),(fe=oe==null?void 0:oe.openFileById)==null||fe.call(oe,_)}else Dn(k("note.internal.fileFound",{title:Le.title}))}catch{Dn(k("note.internal.fileNotFound"))}}function Dn(_){t(46,Fe=_),t(45,Ne=!0),setTimeout(()=>{t(45,Ne=!1)},3e3)}function gp(_){le&&(t(37,le.content=_.detail.content,le),t(37,le.dirty=!0,le))}function _p(_){t(40,ze=_.detail.mode)}function bp(){ap()}function kp(){cp()}function ui(_=null){t(58,x=_),t(59,ye=null),t(52,He=_?_.summary:""),t(53,Oe=_?String(_.minutes||""):""),t(54,Ke=_&&_.date||""),t(55,Pe=_&&_.details||""),t(56,ue=_?!!_.billable:!1),t(57,be=_?!!_.approximate:!1),t(51,Se=!0)}function po(){t(51,Se=!1),t(58,x=null),t(59,ye=null)}async function Qi(_=""){const G=_||(J?J.id:"");J&&J.id===G&&t(50,Ue=ys(await de("ListWorklog",J.id))||Ue),Z==="journal"&&await nl()}async function vp(){const _=parseInt(Oe,10);if(!(!He.trim()||isNaN(_)||_<=0)&&!(!ye&&!x&&!J)){try{if(ye){const G=JSON.stringify(Ei(ye));await de("AcceptSuggestionFull",ye.nodeId,He.trim(),Pe,Ke,_,be,ue,G),await fi()}else x?(await de("UpdateWorklogEntry",x.id,He.trim(),Pe,Ke,_,be,ue),await Qi(x.nodeId)):(await de("CreateWorklogFull",J.id,He.trim(),Pe,Ke,_,be,ue),await Qi(J.id))}catch(G){t(34,q=String(G));return}t(51,Se=!1),t(58,x=null),t(59,ye=null)}}function xi(_){Ln({title:k("worklog.deleteEntry"),message:k("worklog.deleteConfirm"),confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteWorklogEntry",_.id),await Qi(_.nodeId)}catch(G){t(34,q=String(G))}}})}async function fi(){t(60,me=await de("GetSuggestions")||[]),t(61,Re=me.length),J&&t(50,Ue=ys(await de("ListWorklog",J.id))),Z==="journal"&&await nl()}async function tl(){t(7,Ut=await de("ListTrash")||{nodes:[],entries:[],trashPath:"",count:0}),t(75,Rn=Ut.count||0);const _=Ut.nodes||[];t(76,Ct=Ct.filter(G=>_.some(fe=>fe.id===G))),Lt&&!_.some(G=>G.id===Lt)?Ki():gt.length>0&&(t(231,gt=gt.filter(G=>_.some(fe=>fe.id===G.id))),t(8,Lt=gt.length>0?gt[gt.length-1].id:""))}async function $i(){try{t(75,Rn=await de("TrashCount")||0)}catch{t(75,Rn=0)}}function wp(){return Lt&&(((Ut==null?void 0:Ut.nodes)||[]).find(_=>_.id===Lt)||gt[gt.length-1])||null}function Tl(_){El(),t(8,Lt=_.id);const G=gt.findIndex(fe=>fe.id===_.id);G>=0?t(231,gt=gt.slice(0,G+1)):t(231,gt=[...gt,{id:_.id,title:_.title}]),t(76,Ct=[])}function yp(){if(gt.length===0)return;El();const _=gt.slice(0,-1);t(231,gt=_),t(8,Lt=_.length>0?_[_.length-1].id:""),t(76,Ct=[])}async function Hl(_){t(91,Wt={name:_.title,type:"file",mime:"text/plain",size:0,fileId:_.id}),t(92,vn=""),t(94,Xt=""),t(93,Bn=!0);try{_.trashFsPath?t(92,vn=await de("ReadTrashFile",_.trashFsPath)||""):t(92,vn=await de("ReadTrashFileContent",_.id)||"");const G=(_.title||"").split(".").pop().toLowerCase();["png","jpg","jpeg","gif","webp","bmp","svg"].includes(G)&&t(92,vn="data:image/"+(G==="svg"?"svg+xml":G)+";base64,"+btoa(previewContent))}catch(G){t(94,Xt=String(G))}t(93,Bn=!1)}function ho(_){t(76,Ct=Ct.includes(_)?Ct.filter(G=>G!==_):[...Ct,_])}function es(_){return Ct.length>0?Ct:[_]}async function ts(_){try{await de("RestoreTrashNodesJSON",JSON.stringify(_)),await el(),await tl()}catch(G){t(34,q=String(G))}}async function ns(_){Ln({title:k("delete.confirmTitle"),message:k("delete.confirmMessage")+" "+_.length+"?",confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await de("PurgeTrashNodesJSON",JSON.stringify(_)),await tl()}catch(G){t(34,q=String(G))}}})}async function Ep(){Ln({title:k("delete.confirmTitle"),message:k("trash.empty")+"?",confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await de("EmptyTrash"),await tl()}catch(_){t(34,q=String(_))}}})}function di(_){t(59,ye=_),t(58,x=null),t(52,He=_.summary||""),t(53,Oe=String(_.suggestedMin||"")),t(54,Ke=""),t(55,Pe=""),t(56,ue=!1),t(57,be=!0),t(51,Se=!0)}async function pi(_){try{await de("DismissSuggestion",_.nodeId,JSON.stringify(Ei(_))),await fi()}catch(G){t(34,q=String(G))}}async function Tp(){t(65,dt=!0);try{const _=await de("ListBrowserEvents","pending",50,0);t(64,Ze=_||[])}catch(_){console.warn("[browser] load error:",_)}finally{t(65,dt=!1)}}async function Sp(_){await de("AcceptBrowserEvent",_.id,""),t(64,Ze=Ze.filter(G=>G.id!==_.id))}async function Cp(_){await de("DismissBrowserEvent",_.id),t(64,Ze=Ze.filter(G=>G.id!==_.id))}async function Ap(_){J&&J.id?(await de("AttachBrowserEventToNode",_.id,J.id),t(64,Ze=Ze.filter(G=>G.id!==_.id))):(await de("DismissBrowserEvent",_.id),t(64,Ze=Ze.filter(G=>G.id!==_.id)))}async function ls(_){try{const G=Ei(_),fe=JSON.stringify(G);Ti("acceptTodaySuggestion: nodeId="+_.nodeId+" eventIds="+fe+" events="+JSON.stringify((_.events||[]).map(Le=>({id:Le.id,type:Le.eventType,title:Le.title})))),await de("AcceptSuggestionWith",_.nodeId,_.summary,_.suggestedMin,"",fe),await fi()}catch(G){Ti("acceptTodaySuggestion error: "+G)}}async function mo(_){try{const G=Ei(_),fe=JSON.stringify(G);Ti("acceptJournalSuggestion: nodeId="+_.nodeId+" eventIds="+fe+" events="+JSON.stringify((_.events||[]).map(Le=>({id:Le.id,type:Le.eventType,title:Le.title})))),await de("AcceptSuggestionWith",_.nodeId,_.summary,_.suggestedMin,"",fe),await fi()}catch(G){Ti("acceptJournalSuggestion error: "+G)}}async function nl(){try{const[_,G,fe]=await Promise.all([de("ListWorklogReport",I,O,D,R,B,j),de("WorklogReportSummary",I,O,D,R,B,j),de("GetSuggestions")]);if(t(18,N=(_||[]).map(Le=>(Le._expanded===void 0&&(Le._expanded=!1),Le))),t(19,A=G||null),t(60,me=fe||[]),t(61,Re=me.length),D&&!U)if(_&&_.length>0&&_[0].nodePath)t(26,U=_[0].nodePath);else try{t(26,U=await de("GetNodeTitle",D))}catch{t(26,U="")}}catch{t(18,N=[]),t(19,A=null),t(60,me=[]),t(61,Re=0)}}async function hi(_){try{const G=await de("SaveWorklogReport",_,I,O,D,R,B,j);t(27,z=G),setTimeout(()=>t(27,z=""),4e3)}catch(G){if(String(G).includes("отменено"))return;t(27,z="Ошибка: "+String(G)),setTimeout(()=>t(27,z=""),6e3)}}let go;async function is(_){if(_._expanded=!_._expanded,t(18,N),_._expanded&&!_._events&&_._hasEvents===void 0)try{_._events=await de("GetWorklogEntryEvents",_.id)||[],_._hasEvents=_._events.length>0,t(18,N)}catch{_._events=[],_._hasEvents=!1,t(18,N)}}async function ss(_){if(_._expanded=!_._expanded,_._expanded&&_.source==="suggestion"&&!_._events&&_._hasEvents===void 0)try{_._events=await de("GetWorklogEntryEvents",_.id)||[],_._hasEvents=_._events.length>0}catch(G){G._events=[],G._hasEvents=!1}t(50,Ue)}async function Np(){const _=K.trim();if(!_||_.length<2){t(30,Y=[]),t(31,F=!1);return}try{t(30,Y=await de("SearchNodes",_)||[]),t(31,F=Y.length>0)}catch{t(30,Y=[]),t(31,F=!1)}}function Ip(){clearTimeout(go),go=setTimeout(Np,200)}function _o(_){t(23,D=_.id),t(26,U=_.path||_.title),t(22,R=!0),t(29,K=""),t(30,Y=[]),t(31,F=!1),nl()}function bo(){t(23,D=""),t(22,R=!1),t(26,U=""),t(29,K=""),t(30,Y=[]),t(31,F=!1),nl()}function Rp(){t(20,I=""),t(21,O=""),t(23,D=""),t(22,R=!1),t(24,B="all"),t(25,j="all"),t(26,U=""),t(29,K=""),t(30,Y=[]),t(31,F=!1),nl()}async function Mp(_){try{if(!_||_.length===0)return;await Wp(_,"drop")}finally{Rt()}}function Lp(_){return{note_created:k("event.noteCreated"),note_updated:k("event.noteUpdated"),note_deleted:k("event.noteDeleted"),file_added:k("event.fileAdded"),file_deleted:k("event.fileDeleted"),file_renamed:k("event.fileRenamed"),file_copied:k("event.fileCopied"),file_moved:k("event.fileMoved"),folder_added:k("event.folderAdded"),folder_deleted:k("event.folderDeleted"),folder_renamed:k("event.folderRenamed"),folder_moved:k("event.folderMoved"),node_created:k("event.caseCreated"),node_updated:k("event.caseUpdated"),node_deleted:k("event.nodeDeleted"),action_created:k("event.actionCreated"),action_done:k("event.actionDone"),worklog_added:k("event.worklogAdded")}[_]||_}function os(_){return{project:k("kind.project"),client:k("kind.client"),document:k("kind.document"),recipe:k("kind.recipe"),folder:k("kind.folder"),note:k("kind.note"),file:k("kind.file"),archive:k("kind.archive"),case:k("kind.case"),link:k("kind.link")}[_]||_||k("kind.case")}function Op(_){return _==="action"?k("kind.action"):os(_)}function Dp(_){return _?k("capture.kind."+_):""}function Pp(_){return _?k("capture.source."+_):""}function qp(_){const G=[];return _.captureKind&&G.push(Dp(_.captureKind)),_.captureSource&&G.push(Pp(_.captureSource)),_.captureContextLabel&&G.push(`${k("inbox.capturedIn")}: ${_.captureContextLabel}`),_.suggestedTargetLabel&&G.push(`${k("inbox.suggestedTarget")}: ${_.suggestedTargetLabel}`),G.push(qn(_.capturedAt||_.createdAt)),G.filter(Boolean).join(" · ")}function zp(_){!_||!_.id||(t(3,Je=[_,...Je.filter(G=>G.id!==_.id)]),J&&(_.captureContextNodeId===J.id||_.suggestedTargetNodeId===J.id)&&t(66,pe=[_,...pe.filter(G=>G.id!==_.id)]))}function Bp(){return J&&J.id?{contextType:"node",nodeId:J.id,suggestedTargetNodeId:J.id}:Z?{contextType:"section",section:Z}:{contextType:"global",section:"root"}}function ll(){return JSON.stringify(Bp())}function Fp(){return J&&J.id?k("capture.dropOverlayNode",{title:J.title}):k("capture.dropOverlayGlobal")}async function Sl(_=null){_&&zp(_),Z==="inbox"&&t(3,Je=await de("ListInboxNodes")||Je)}async function jp(_,G){const fe=String(_||"").trim();if(!fe)return null;const Le=Es(fe),Be=Le?await de("CaptureURLWithContext",Le,"",G,ll()):await de("CaptureTextWithContext",fe,G,ll());return await Sl(Be),Be}async function ko(_,G,fe){const Le=String(_||"").trim();if(!Le)return null;const Be=await de("CaptureURLWithContext",Le,G||"",fe,ll());return await Sl(Be),Be}async function Up(_,G){if(!_)return null;const fe=_.path||_.webkitRelativePath||"";if(fe){const bt=await de("CapturePathWithContext",fe,G,ll());return await Sl(bt),bt}const Le=await zy(_),Be=await de("CaptureFileDataWithContext",_.name||`clipboard.${qy(_.type)}`,Le,G,ll());return await Sl(Be),Be}async function rs(_,G){var Wn,Pn,Tn;if(!_)return!1;let fe=!1;const Le=Array.from(_.files||[]);for(const Sn of Le)await Up(Sn,G),fe=!0;const Be=(Wn=_.getData)==null?void 0:Wn.call(_,"text/x-moz-url");if(Be){const Sn=By(Be),Gl=Sn?Es(Sn.url):"";if(Gl)return await ko(Gl,Sn.title,G),!0}const bt=(Pn=_.getData)==null?void 0:Pn.call(_,"text/uri-list");if(bt){const Sn=Fy(bt),Gl=Es(Sn);if(Gl)return await ko(Gl,"",G),!0}const Kt=(Tn=_.getData)==null?void 0:Tn.call(_,"text/plain");return String(Kt||"").trim()&&(await jp(Kt,G),fe=!0),fe}async function Hp(){if(!qe){t(68,pt=""),t(67,qe=!0);try{const _=await de("CaptureClipboardTextWithContext",ll());await Sl(_),t(68,pt=k("inbox.captured"))}catch(_){t(34,q=String(_).includes("clipboard is empty")?k("inbox.clipboardEmpty"):k("inbox.clipboardUnavailable"))}finally{t(67,qe=!1)}}}async function Wp(_,G="drop"){if(!qe){t(67,qe=!0),t(68,pt="");try{for(const fe of _){const Le=await de("CapturePathWithContext",fe,G,ll());await Sl(Le)}t(68,pt=k("inbox.captured"))}catch(fe){t(34,q=String(fe))}finally{t(67,qe=!1),t(96,wn=!1)}}}async function vo(_){if(!(d||p)&&!Ni(_.target)&&_.clipboardData)try{await rs(_.clipboardData,"paste")&&(_.preventDefault(),t(68,pt=k("inbox.captured")))}catch(G){t(34,q=String(G))}}function wo(){Gt&&(clearTimeout(Gt),Gt=null)}function Rt(){dn=0,t(97,yn=!1),t(98,Fn=""),Mn=0,t(96,wn=!1),wo()}function yo(){Gt||(Gt=setTimeout(()=>{Gt=null,yn&&Date.now()-Mn>2e3?Rt():yn&&yo()},2500))}function Eo(_){return Lf(_)?(t(98,Fn=Fp()),t(97,yn=!0),Mn=Date.now(),yo(),!0):!1}function To(_){Eo(_.dataTransfer)&&(dn+=1)}function So(_){Eo(_.dataTransfer)&&(_.preventDefault(),_.dataTransfer.dropEffect="copy")}function Co(_){dn>0&&(dn-=1),(_.clientX<=0||_.clientY<=0||_.clientX>=window.innerWidth||_.clientY>=window.innerHeight||dn<=0)&&Rt()}function Ao(){document.hidden&&Rt()}async function No(_){if(Lf(_.dataTransfer)){_.preventDefault();try{await rs(_.dataTransfer,"drop")&&t(68,pt=k("inbox.captured"))}catch(G){t(34,q=String(G))}finally{Rt()}}}function Gp(_){_.preventDefault(),_.dataTransfer.dropEffect="copy",t(96,wn=!0)}function Kp(){t(96,wn=!1)}async function Vp(_){_.preventDefault(),_.stopPropagation();try{await rs(_.dataTransfer,"drop")&&t(68,pt=k("inbox.captured"))}catch(G){t(34,q=String(G))}finally{Rt()}}function mi(_){t(107,Ee=_),t(108,V=""),t(109,ie=[]),t(110,ve=null)}function as(){t(107,Ee=null),t(108,V=""),t(109,ie=[]),t(110,ve=null),t(111,De=!1)}async function Zp(){const _=V.trim();if(!_||_.length<2){t(109,ie=[]);return}t(111,De=!0);try{const G=await de("SearchNodes",_)||[];t(109,ie=G.filter(fe=>jy(fe)&&fe.id!==(Ee==null?void 0:Ee.id)))}catch{t(109,ie=[])}finally{t(111,De=!1)}}function Yp(_){t(108,V=_.target.value),t(110,ve=null),clearTimeout($e),$e=setTimeout(Zp,200)}function Io(_){t(110,ve=_),t(108,V=_.path||_.title),t(109,ie=[])}async function Ro(){if(!(!Ee||!ve))try{await Mo(Ee,ve.id),as()}catch(_){t(34,q=String(_))}}async function Mo(_,G){!_||!G||(await de("ResolveInboxNode",_.id,G),t(3,Je=Je.filter(fe=>fe.id!==_.id)),t(66,pe=pe.filter(fe=>fe.id!==_.id)),await el(),J&&await Vi(J.id))}async function gi(_){const G=(_==null?void 0:_.suggestedTargetNodeId)||(J==null?void 0:J.id)||"";if(G)try{await Mo(_,G)}catch(fe){t(34,q=String(fe))}}function _i(_){Ln({title:k("inbox.deleteTitle"),message:k("inbox.deleteConfirm",{title:_.title}),confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteInboxNode",_.id),t(3,Je=Je.filter(G=>G.id!==_.id)),t(66,pe=pe.filter(G=>G.id!==_.id))}catch(G){t(34,q=String(G))}}})}function Lo(_){t(70,Mt=_),t(71,It=_.title||""),t(72,jt=_.url||""),t(73,an=_.note||""),t(74,cn="")}function cs(){t(70,Mt=null),t(71,It=""),t(72,jt=""),t(73,an=""),t(74,cn="")}async function Xp(){if(!(!Mt||!jt.trim()))try{const _=await de("UpdateLink",Mt.id,It.trim(),jt.trim(),an);t(69,mt=mt.map(G=>G.id===_.id?_:G)),cs()}catch(_){t(74,cn=String(_))}}async function Oo(_){Ln({title:k("links.deleteTitle"),message:k("links.deleteConfirm",{title:_.title}),confirmText:k("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteLink",_.id),t(69,mt=mt.filter(G=>G.id!==_.id))}catch(G){t(34,q=String(G))}}})}async function Do(_){try{await de("OpenLink",_.id)}catch(G){t(34,q=String(G))}}async function Po(_){var G,fe;try{await((fe=(G=navigator.clipboard)==null?void 0:G.writeText)==null?void 0:fe.call(G,_.url)),t(74,cn=k("links.copied"))}catch{t(74,cn=k("links.copyUnavailable"))}}function Jp(){t(85,kn=!0),t(86,fn=""),t(87,$="open_url"),t(88,he="")}function qo(){t(85,kn=!1),t(86,fn=""),t(88,he="")}async function us(){if(!(!fn.trim()||!he.trim()||!J))try{const _=await de("CreateAction",J.id,$,fn.trim(),he.trim());_&&_.id&&t(49,Ve=[...Ve,_]),t(85,kn=!1),t(86,fn=""),t(88,he="")}catch(_){t(34,q=String(_))}}async function zo(_){try{await de("DeleteAction",_),t(49,Ve=Ve.filter(G=>G.id!==_))}catch(G){t(34,q=String(G))}}function Qp(_){const G=tt.find(fe=>fe.id===_);return G?G.label:_}async function Wl(_){try{const G=await de("GetNodeDetail",_);G&&qt(G)}catch(G){t(34,q=String(G))}}async function il(_){var Le,Be,bt,Kt,Wn;const G=Uy(_),fe=G.nodeId;if(fe)try{const Pn=await de("GetNodeDetail",fe);if(!Pn)return;if(qt(Pn),G.tab==="notes"){if(ln("notes"),G.targetId){try{t(36,te=await de("ListNotes",fe)||[])}catch{}const Tn=te.find(Sn=>Sn.id===G.targetId);Tn&&setTimeout(()=>Un(Tn),100)}}else if(G.tab==="files")if(ln("files"),G.targetId)try{const Tn=await de("GetNodeDetail",G.targetId);Tn&&Tn.parent_id?((Le=oe==null?void 0:oe.resetToNode)==null||Le.call(oe,Tn.parent_id),(Be=oe==null?void 0:oe.openFileById)==null||Be.call(oe,G.targetId)):(bt=oe==null?void 0:oe.resetToNode)==null||bt.call(oe,fe)}catch{(Kt=oe==null?void 0:oe.resetToNode)==null||Kt.call(oe,fe)}else(Wn=oe==null?void 0:oe.resetToNode)==null||Wn.call(oe,fe)}catch(Pn){t(34,q=String(Pn))}}async function Cl(_){return il(_)}async function xp(_){var G,fe,Le;if(!(!_||!_.nodeId))try{if(_.type==="link"){const bt=await de("GetNodeDetail",_.nodeId);bt&&(await qt(bt),ln("links"));return}if(_.type==="action"){const bt=await de("GetNodeDetail",_.nodeId);bt&&(await qt(bt),ln("actions"));return}const Be=await de("GetNodeDetail",_.nodeId);if(!Be)return;if(_.type==="note"){const bt=Be.parent_id||Be.parentId||"",Kt=bt?await de("GetNodeDetail",bt):null;if(Kt){await qt(Kt),ln("notes"),t(36,te=await de("ListNotes",Kt.id)||[]);const Wn=te.find(Pn=>Pn.id===Be.id);Wn&&await Un(Wn)}return}if(_.type==="file"){const bt=Be.parent_id||Be.parentId||"",Kt=bt?await de("GetNodeDetail",bt):null;Kt&&(await qt(Kt),ln("files"),(G=oe==null?void 0:oe.resetToNode)==null||G.call(oe,Kt.id),(fe=oe==null?void 0:oe.openFileById)==null||fe.call(oe,Be.id));return}if(_.type==="folder"){await qt(Be),ln("files"),(Le=oe==null?void 0:oe.resetToNode)==null||Le.call(oe,Be.id);return}await qt(Be)}catch(Be){t(34,q=String(Be))}}async function fs(){try{t(112,nt=await de("SyncStatus"))}catch{t(112,nt={configured:!1,serverUrl:"",deviceId:"",unpushedOps:0,lastSyncAt:"",syncInterval:0})}}let Bo="general";function ds(_){t(116,Bo=_||"general"),t(13,h=!0)}function Fo(){t(13,h=!1)}async function $p(){try{t(0,m=await de("ListSystemViewsWithPlugins")||[])}catch{}}function e1(_){const G=Array.isArray(_==null?void 0:_.conflicts)?_.conflicts:[],fe=Array.isArray(_==null?void 0:_.applyErrors)?_.applyErrors:[],Le=[];return G.length>0&&Le.push(k("sync.conflictsCount",{count:G.length})),fe.length>0&&Le.push(k("sync.applyErrorsCount",{count:fe.length})),Le.join(" · ")}async function t1(){t(113,St=!0),t(114,wt=""),t(115,Dt="");try{const _=await de("SyncNow");await fs(),t(114,wt=e1(_)),t(115,Dt=wt?"warning":"")}catch(_){console.error("sync error:",_),t(114,wt=`${k("sync.status.error")}: ${(_==null?void 0:_.message)||_}`),t(115,Dt="warning")}finally{t(113,St=!1)}}function n1(_){t(11,d=!1),t(10,c=_),t(89,st=!1),window.location.reload()}function l1(_){t(12,p=!1),t(10,c=_),t(89,st=!1),window.location.reload()}const i1=_=>_.nodeId===J.id,s1=_=>ci(_.id),o1=()=>ds("sync"),r1=()=>ds(),a1=()=>ts(Ct),c1=()=>ns(Ct),u1=()=>de("OpenTrashFolder"),f1=()=>t(34,q=""),d1=()=>t(34,q=""),p1=()=>t(34,q="");function h1(){je=this.value,t(48,je)}const m1=_=>{_.key==="Enter"&&Ji(),_.key==="Escape"&&Hn()},g1=()=>Xi(le.id,le.title);function _1(_){In[_?"unshift":"push"](()=>{_e=_,t(38,_e)})}const b1=_=>ln(_.id),k1=()=>{ln("notes")},v1=()=>{ln("files"),oe&&oe.addFile()},w1=_=>Un(_.detail.note),y1=_=>ao(_.detail.title),E1=_=>Un(_.detail.note),T1=_=>Xi(_.detail.noteId,_.detail.currentTitle),S1=_=>uo(_.detail.note);function C1(_){In[_?"unshift":"push"](()=>{oe=_,t(39,oe)})}const A1=_=>Un(_.detail),N1=_=>ro(_.detail.nodeId),I1=_=>t(34,q=_.detail.message),R1=_=>gi(_),M1=_=>mi(_),L1=_=>mn(_),O1=_=>On(_),D1=_=>_i(_),P1=_=>mn(_),q1=(_,G)=>G.key==="Enter"&&mn(_),z1=_=>Do(_),B1=_=>Po(_),F1=_=>Lo(_),j1=_=>Oo(_),U1=_=>de("RunAction",_.id),H1=_=>zo(_.id),W1=()=>ui(),G1=_=>_.nodeId===J.id,K1=_=>di(_),V1=_=>ls(_),Z1=_=>pi(_),Y1=(_,G,fe)=>t(60,G[fe]._expanded=!_._expanded,me,t(2,J)),X1=(_,G,fe,Le)=>Le.key==="Enter"&&t(60,G[fe]._expanded=!_._expanded,me,t(2,J)),J1=_=>il(_),Q1=_=>On(_.nodeId),x1=_=>ui(_),$1=_=>xi(_),eh=_=>il(_),th=_=>On(_.nodeId),nh=_=>ss(_),lh=(_,G)=>G.key==="Enter"&&ss(_),ih=_=>Cl(_),sh=(_,G)=>G.key==="Enter"&&Cl(_),oh=()=>{t(4,vt="date"),t(5,At=vt==="date"&&At==="desc"?"asc":"desc")},rh=()=>{t(4,vt="name"),t(5,At=vt==="name"&&At==="desc"?"asc":"desc")},ah=()=>{t(4,vt="type"),t(5,At=vt==="type"&&At==="desc"?"asc":"desc")};function ch(){Zt=this.checked,t(6,Zt)}const uh=_=>gi(_),fh=_=>mi(_),dh=_=>mn(_),ph=_=>On(_),hh=_=>_i(_),mh=_=>mn(_),gh=(_,G)=>G.key==="Enter"&&mn(_),_h=_=>gi(_),bh=_=>mi(_),kh=_=>mn(_),vh=_=>On(_),wh=_=>_i(_),yh=_=>mn(_),Eh=(_,G)=>G.key==="Enter"&&mn(_),Th=_=>ho(_.id),Sh=_=>_.type!=="file"?Tl(_):Hl(_),Ch=(_,G)=>G.key==="Enter"&&(_.type!=="file"?Tl(_):Hl(_)),Ah=_=>_.type!=="file"?Tl(_):Hl(_),Nh=(_,G)=>G.key==="Enter"&&(_.type!=="file"?Tl(_):Hl(_)),Ih=_=>ts(es(_.id)),Rh=_=>ns(es(_.id)),Mh=()=>t(28,W="suggestions"),Lh=()=>t(28,W="worklog"),Oh=_=>Wl(_.nodeId),Dh=(_,G,fe,Le)=>t(60,G[fe].suggestedMin=parseInt(Le.target.value),me),Ph=_=>di(_),qh=_=>mo(_),zh=_=>pi(_),Bh=(_,G,fe)=>t(60,G[fe]._expanded=!_._expanded,me),Fh=(_,G,fe,Le)=>Le.key==="Enter"&&t(60,G[fe]._expanded=!_._expanded,me),jh=_=>il(_),Uh=_=>On(_.nodeId),Hh=()=>hi("csv"),Wh=()=>hi("markdown"),Gh=()=>hi("pdf");function Kh(){I=this.value,t(20,I)}function Vh(){O=this.value,t(21,O)}const Zh=()=>{t(29,K=""),t(26,U=""),bo()};function Yh(){K=this.value,t(29,K)}const Xh=()=>setTimeout(()=>t(31,F=!1),200),Jh=_=>_o(_);function Qh(){R=this.checked,t(22,R)}function xh(){B=Ci(this),t(24,B)}function $h(){j=Ci(this),t(25,j)}const em=_=>Wl(_.nodeId),tm=_=>is(_),nm=(_,G)=>G.key==="Enter"&&is(_),lm=_=>ui(_),im=_=>xi(_),sm=_=>il(_),om=_=>Wl(_),rm=_=>Cl(_),am=_=>il(_),cm=_=>di(_),um=_=>ls(_),fm=_=>pi(_),dm=_=>On(_),pm=_=>mn(_),hm=_=>{ci("trash"),Tl({id:_,title:""}),tl()},mm=_=>Cl(_),gm=(_,G)=>G.key==="Enter"&&Cl(_),_m=()=>t(83,Ht=null),bm=_=>t(83,Ht=_);function km(){tn=this.value,t(81,tn)}const vm=_=>_.key==="Enter"&&lo(),wm=_=>to(_),ym=()=>oo($t.node),Em=()=>io($t.node),Tm=()=>so($t.node),Sm=()=>On($t.node);function Cm(){Ke=this.value,t(54,Ke)}function Am(){He=this.value,t(52,He)}function Nm(){Oe=zl(this.value),t(53,Oe)}function Im(){Pe=this.value,t(55,Pe)}function Rm(){ue=this.checked,t(56,ue)}function Mm(){be=this.checked,t(57,be)}function Lm(){fn=this.value,t(86,fn)}const Om=_=>_.key==="Enter"&&us();function Dm(){$=Ci(this),t(87,$),t(121,tt)}function Pm(){he=this.value,t(88,he)}const qm=_=>_.key==="Enter"&&us();function zm(){hn=this.value,t(105,hn)}function Bm(){V=this.value,t(108,V)}const Fm=_=>_.key==="Enter"&&ve&&Ro(),jm=_=>Io(_);function Um(){It=this.value,t(71,It)}function Hm(){jt=this.value,t(72,jt)}function Wm(){an=this.value,t(73,an)}const Gm=_=>de("OpenFile",_.detail);function Km(){Ie=this.value,t(42,Ie)}const Vm=_=>{_.key==="Enter"&&Yi(),_.key==="Escape"&&t(41,Ge=!1)};function Zm(){ne=this.value,t(43,ne)}const Ym=_=>{_.key==="Enter"&&Yi(),_.key==="Escape"&&t(41,Ge=!1)},Xm=()=>t(41,Ge=!1),Jm=()=>t(41,Ge=!1),Qm=_=>_.key==="Escape"&&t(41,Ge=!1);function xm(){je=this.value,t(48,je)}const $m=_=>{_.key==="Enter"&&Ji(),_.key==="Escape"&&Hn()},eg=_=>_.key==="Escape"&&Hn();return n.$$.update=()=>{var _;n.$$.dirty[0]&384&&t(77,bl=Py((Ut==null?void 0:Ut.nodes)||[],Lt)),n.$$.dirty[0]&7&&t(119,l=J?J.title:Z?((_=m.find(G=>G.id===Z))==null?void 0:_.label)||"":k("nav.selectPrompt")),n.$$.dirty[0]&4&&t(118,i=J?os(J.type):""),n.$$.dirty[0]&56&&t(9,o=Ly(Je,vt,At)),n.$$.dirty[0]&576&&t(117,s=Zt?Pt(o):null),n.$$.dirty[7]&16384&&t(78,bn=gt.length===0?k("nav.trash"):[k("nav.trash"),...gt.map(G=>G.title)].join(" / "))},t(79,kl=((jo=wp())==null?void 0:jo.title)||k("trash.deletedNodes")),[m,Z,J,Je,vt,At,Zt,Ut,Lt,o,c,d,p,h,g,b,v,y,N,A,I,O,R,D,B,j,U,z,W,K,Y,F,L,M,q,ee,te,le,_e,oe,ze,Ge,Ie,ne,re,Ne,Fe,we,je,Ve,Ue,Se,He,Oe,Ke,Pe,ue,be,x,ye,me,Re,ft,it,Ze,dt,pe,qe,pt,mt,Mt,It,jt,an,cn,Rn,Ct,bl,bn,kl,Ot,tn,un,Ht,$t,kn,fn,$,he,st,Yt,Wt,vn,Bn,Xt,vl,wn,yn,Fn,wl,oi,jl,Ul,ri,jn,hn,En,Ee,V,ie,ve,De,nt,St,wt,Dt,Bo,s,i,l,X,tt,nn,ln,ci,qt,xs,Jd,Qd,$s,xd,$d,to,ep,no,lo,tp,$n,np,lp,ip,sp,op,io,so,On,mn,oo,ro,ao,Un,uo,fo,rp,Yi,up,fp,Xi,Hn,Ji,dp,gp,_p,bp,kp,ui,po,vp,xi,tl,Tl,yp,Hl,ho,es,ts,ns,Ep,di,pi,Tp,Sp,Cp,Ap,ls,mo,nl,hi,is,ss,Ip,_o,bo,Rp,Lp,os,Op,qp,Hp,Gp,Kp,Vp,mi,as,Yp,Io,Ro,gi,_i,Lo,cs,Xp,Oo,Do,Po,Jp,qo,us,zo,Qp,Wl,il,Cl,xp,fs,ds,Fo,$p,t1,n1,l1,gt,i1,s1,o1,r1,a1,c1,u1,f1,d1,p1,h1,m1,g1,_1,b1,k1,v1,w1,y1,E1,T1,S1,C1,A1,N1,I1,R1,M1,L1,O1,D1,P1,q1,z1,B1,F1,j1,U1,H1,W1,G1,K1,V1,Z1,Y1,X1,J1,Q1,x1,$1,eh,th,nh,lh,ih,sh,oh,rh,ah,ch,uh,fh,dh,ph,hh,mh,gh,_h,bh,kh,vh,wh,yh,Eh,Th,Sh,Ch,Ah,Nh,Ih,Rh,Mh,Lh,Oh,Dh,Ph,qh,zh,Bh,Fh,jh,Uh,Hh,Wh,Gh,Kh,Vh,Zh,Yh,Xh,Jh,Qh,xh,$h,em,tm,nm,lm,im,sm,om,rm,am,cm,um,fm,dm,pm,hm,mm,gm,_m,bm,km,vm,wm,ym,Em,Tm,Sm,Cm,Am,Nm,Im,Rm,Mm,Lm,Om,Dm,Pm,qm,zm,Bm,Fm,jm,Um,Hm,Wm,Gm,Km,Vm,Zm,Ym,Xm,Jm,Qm,xm,$m,eg]}class Wy extends ut{constructor(e){super(),ct(this,e,Hy,My,at,{},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}}window.addEventListener("error",n=>{const e=n.error?String(n.error):n.message,t=n.error&&n.error.stack?n.error.stack:"";console.error("[Frontend Error]",e,t);try{window.go&&window.go.main&&window.go.main.App&&typeof window.go.main.App.FrontendLog=="function"&&window.go.main.App.FrontendLog("error",e,t)}catch{}});window.addEventListener("unhandledrejection",n=>{const e=n.reason,t=e instanceof Error?String(e):JSON.stringify(e),l=e instanceof Error&&e.stack?e.stack:"";console.error("[Unhandled Promise Rejection]",t,l);try{window.go&&window.go.main&&window.go.main.App&&typeof window.go.main.App.FrontendLog=="function"&&window.go.main.App.FrontendLog("error","Unhandled rejection: "+t,l)}catch{}});try{new Wy({target:document.getElementById("app")})}catch(n){console.error("[Fatal] App mount failed:",n);const e=document.getElementById("app");e&&(e.innerHTML='<div style="padding:24px;color:#ff6b6b;font-family:monospace;white-space:pre-wrap"><h2>Frontend Runtime Error</h2><p>'+String(n)+"</p>"+(n.stack?"<pre>"+n.stack+"</pre>":"")+"</div>")}
|