import{v as ke,x as Ye,y as Me,r as f,w as X,k as Ne,z as c,A as v,B as l,C as s,D as T,E as m,F as o,H as ee,J as le,K,G as H,Y as Je,Z as mt,L as q,e as zt,g as ye,h as Te,n as $t,j as Nt,i as it,f as je,l as Aa,q as Ba,aq as he,V as rt,I as pt,T as qa,t as Qe,m as ge,S as ea,o as Pa,p as Vt,R as Z,X as Rt,W as ta,aG as aa,a1 as la,aH as Ea,_ as oa,$ as na,a as Ha,a3 as Ua,a4 as Wa,a0 as Qa,aI as lt,U as Oa,a2 as Ka,aJ as ot}from"./index.91710347.js";import{k as Lt,B as ce,o as We,q as Q,r as N,v as te,w as ut,C as St,t as Ge,a as sa,c as ia,T as ja,_ as Ve,ax as ra,I as Ga,W as Xa,ay as ua,ai as Ja,an as Ya,l as da,x as Za,s as De,D as el,a0 as ca,G as tl,m as al,n as ll,y as Xe,z as Tt,A as Mt,M as st,P as Ut,F as ol,U as Wt,R as Qt,az as It,aA as Ot,aB as Kt,S as Ue,aC as ne,a5 as fa,a6 as ae,Z as va,Y as ga,$ as nl,a4 as ha,aD as jt,H as Gt,aE as ma,J as sl,K as il,L as rl,X as pa,V as ul,a1 as dl,p as cl,a2 as fl,Q as vl}from"./QTable.5a47bc39.js";import{b as gt,a as gl,c as hl,d as ml,e as pl,Q as _e}from"./QBtn.941b3ca0.js";/**
 * @license lucide-vue-next v0.406.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xt=Lt("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-vue-next v0.406.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ht=Lt("FlagIcon",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
 * @license lucide-vue-next v0.406.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jt=Lt("MinusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}]]),bl={__name:"MarkMenu",props:{records:{type:Array,required:!0}},setup(i){const p=ke();Ye();const{t:k}=Me(),u=f(!1),d=f(!1),_=f(!1),S=i;X(()=>S.records,R=>{C()}),Ne(()=>{C()});const C=()=>{if(S.records.length==1){const R=S.records[0];let g=typeof R=="string"?ce(R):R;g!=null&&(d.value=g.unread!=null?g.unread:!1,u.value=g.flagged!=null?g.flagged:!1,_.value=g.locked!=null?g.locked:!1)}else u.value=!1,_.value=!1,d.value=!1};function b(){u.value=!u.value;for(const R of S.records){const g=typeof R=="string"?R:R.id;p.saveMetadata(g,"flagged",u.value,!0)}}function L(){d.value=!d.value;for(const R of S.records){const g=typeof R=="string"?R:R.id;p.saveMetadata(g,"unread",d.value,!0)}}function x(){_.value=!_.value;for(const R of S.records){const g=typeof R=="string"?R:R.id;p.saveMetadata(g,"locked",_.value,!0)}}return(R,g)=>(c(),v(ut,{anchor:"top right",self:"top left","auto-close":"",class:ee(o(te)("DTContextMenu DTContextMenuLight","DTContextMenu"))},{default:l(()=>[s(We,{dense:""},{default:l(()=>[s(Q,{clickable:"",onClick:b},{default:l(()=>[u.value?(c(),v(N,{key:0},{default:l(()=>[T(m(o(k)("actionUnflagged")),1)]),_:1})):(c(),v(N,{key:1},{default:l(()=>[T(m(o(k)("actionFlagged")),1)]),_:1}))]),_:1}),s(Q,{clickable:"",onClick:L},{default:l(()=>[d.value?(c(),v(N,{key:0},{default:l(()=>[T(m(o(k)("actionRead")),1)]),_:1})):(c(),v(N,{key:R.markKey},{default:l(()=>[T(m(o(k)("actionUnread")),1)]),_:1}))]),_:1}),(c(),v(Q,{clickable:"",onClick:x,key:R.markKey},{default:l(()=>[_.value?(c(),v(N,{key:0},{default:l(()=>[T(m(o(k)("actionUnlocked")),1)]),_:1})):(c(),v(N,{key:1},{default:l(()=>[T(m(o(k)("actionLocked")),1)]),_:1}))]),_:1}))]),_:1})]),_:1},8,["class"]))}},_l=["fill"],yl=q("rect",{width:"20",height:"10",x:"2",y:"7",rx:"5"},null,-1),wl=[yl],Dl=["fill"],kl=q("rect",{width:"20",height:"10",x:"2",y:"7",rx:"5"},null,-1),Cl=[kl],xl={__name:"LabelMenu",setup(i){const p=Ye(),k=ke(),{t:u}=Me(),{selectedRecords:d}=le(k),_=f([]);Ne(()=>{_.value=new Array,d.value.forEach(C=>{let b=ce(C),L=b.label!=null?b.label:0;_.value.includes(L)||_.value.push(L)})});function S(C){d.value.forEach(b=>{k.saveMetadata(b,"label",C,!0)})}return(C,b)=>(c(),v(ut,{anchor:"top right",self:"top left","auto-close":"",class:ee(o(te)("DTContextMenu DTContextMenuLight","DTContextMenu"))},{default:l(()=>[s(We,{dense:""},{default:l(()=>[s(Q,{clickable:"",onClick:b[0]||(b[0]=L=>S(0))},{default:l(()=>[s(N,{side:""},{default:l(()=>[(c(),K("svg",{"data-v-a764920c":"",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:C.white,stroke:"#0000004d","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-rectangle-horizontal-icon"},wl,8,_l))]),_:1}),s(N,null,{default:l(()=>[T(m(o(u)("none")),1)]),_:1}),_.value.includes(0)?(c(),v(N,{key:0,side:""},{default:l(()=>[_.value.length==1?(c(),v(o(St),{key:0,size:"20",color:o(p).iconColor},null,8,["color"])):(c(),v(o(Jt),{key:1,size:"20",color:o(p).iconColor},null,8,["color"]))]),_:1})):H("",!0)]),_:1}),s(Ge),(c(!0),K(Je,null,mt(o(k).database.labels,(L,x)=>(c(),v(Q,{key:L.value,clickable:"",onClick:R=>S(x+1)},{default:l(()=>[s(N,{side:""},{default:l(()=>[(c(),K("svg",{"data-v-a764920c":"",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:L.color,stroke:"#0000004d","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-rectangle-horizontal-icon"},Cl,8,Dl))]),_:2},1024),s(N,null,{default:l(()=>[T(m(L.description),1)]),_:2},1024),_.value.includes(x+1)?(c(),v(N,{key:0,side:""},{default:l(()=>[_.value.length==1?(c(),v(o(St),{key:0,size:"20",color:o(p).iconColor},null,8,["color"])):(c(),v(o(Jt),{key:1,size:"20",color:o(p).iconColor},null,8,["color"]))]),_:1})):H("",!0)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["class"]))}};var Rl=zt({name:"QSplitter",props:{...sa,modelValue:{type:Number,required:!0},reverse:Boolean,unit:{type:String,default:"%",validator:i=>["%","px"].includes(i)},limits:{type:Array,validator:i=>i.length!==2||typeof i[0]!="number"||typeof i[1]!="number"?!1:i[0]>=0&&i[0]<=i[1]},emitImmediately:Boolean,horizontal:Boolean,disable:Boolean,beforeClass:[Array,String,Object],afterClass:[Array,String,Object],separatorClass:[Array,String,Object],separatorStyle:[Array,String,Object]},emits:["update:modelValue"],setup(i,{slots:p,emit:k}){const{proxy:{$q:u}}=Nt(),d=ia(i,u),_=f(null),S={before:f(null),after:f(null)},C=ye(()=>`q-splitter no-wrap ${i.horizontal===!0?"q-splitter--horizontal column":"q-splitter--vertical row"} q-splitter--${i.disable===!0?"disabled":"workable"}`+(d.value===!0?" q-splitter--dark":"")),b=ye(()=>i.horizontal===!0?"height":"width"),L=ye(()=>i.reverse!==!0?"before":"after"),x=ye(()=>i.limits!==void 0?i.limits:i.unit==="%"?[10,90]:[50,1/0]);function R(B){return(i.unit==="%"?B:Math.round(B))+i.unit}const g=ye(()=>({[L.value]:{[b.value]:R(i.modelValue)}}));let se,U,A,J,Y;function z(B){if(B.isFirst===!0){const $=_.value.getBoundingClientRect()[b.value];se=i.horizontal===!0?"up":"left",U=i.unit==="%"?100:$,A=Math.min(U,x.value[1],Math.max(x.value[0],i.modelValue)),J=(i.reverse!==!0?1:-1)*(i.horizontal===!0?1:u.lang.rtl===!0?-1:1)*(i.unit==="%"?$===0?0:100/$:1),_.value.classList.add("q-splitter--active");return}if(B.isFinal===!0){Y!==i.modelValue&&k("update:modelValue",Y),_.value.classList.remove("q-splitter--active");return}const j=A+J*(B.direction===se?-1:1)*B.distance[i.horizontal===!0?"y":"x"];Y=Math.min(U,x.value[1],Math.max(x.value[0],j)),S[L.value].value.style[b.value]=R(Y),i.emitImmediately===!0&&i.modelValue!==Y&&k("update:modelValue",Y)}const ie=ye(()=>[[ja,z,void 0,{[i.horizontal===!0?"vertical":"horizontal"]:!0,prevent:!0,stop:!0,mouse:!0,mouseAllDir:!0}]]);function re(B,j){B<j[0]?k("update:modelValue",j[0]):B>j[1]&&k("update:modelValue",j[1])}return X(()=>i.modelValue,B=>{re(B,x.value)}),X(()=>i.limits,()=>{$t(()=>{re(i.modelValue,x.value)})}),()=>{const B=[Te("div",{ref:S.before,class:["q-splitter__panel q-splitter__before"+(i.reverse===!0?" col":""),i.beforeClass],style:g.value.before},gt(p.before)),Te("div",{class:["q-splitter__separator",i.separatorClass],style:i.separatorStyle,"aria-disabled":i.disable===!0?"true":void 0},[gl("div",{class:"q-splitter__separator-area absolute-full"},gt(p.separator),"sep",i.disable!==!0,()=>ie.value)]),Te("div",{ref:S.after,class:["q-splitter__panel q-splitter__after"+(i.reverse===!0?"":" col"),i.afterClass],style:g.value.after},gt(p.after))];return Te("div",{class:C.value,ref:_},hl(p.default,B))}}}),Sl=zt({name:"QPage",props:{padding:Boolean,styleFn:Function},setup(i,{slots:p}){const{proxy:{$q:k}}=Nt(),u=it(Aa,je);if(u===je)return console.error("QPage needs to be a deep child of QLayout"),je;if(it(Ba,je)===je)return console.error("QPage needs to be child of QPageContainer"),je;const _=ye(()=>{const C=(u.header.space===!0?u.header.size:0)+(u.footer.space===!0?u.footer.size:0);if(typeof i.styleFn=="function"){const b=u.isContainer.value===!0?u.containerHeight.value:k.screen.height;return i.styleFn(C,b)}return{minHeight:u.isContainer.value===!0?u.containerHeight.value-C+"px":k.screen.height===0?C!==0?`calc(100vh - ${C}px)`:"100vh":k.screen.height-C+"px"}}),S=ye(()=>`q-page${i.padding===!0?" q-layout-padding":""}`);return()=>Te("main",{class:S.value,style:_.value},gt(p.default))}});function Yt(i){var p=!1;switch(i){case"aac":case"m4a":p=!0;break;case"webm":he.is.safari||(p=!0);break;case"aiff":case"aif":case"ogg":case"ogv":console.log(he.userAgent),!he.is.safari&&!he.is.chrome&&!he.is.opera&&(p=!0);break;case"mp3":case"mp4":case"m4v":case"mov":p=!0;break;case"mpg":case"mpeg":he.is.safari&&(p=!0);break}return p}const Tl={class:"absolute-center"},Ml={__name:"NoSelection",props:{height:{type:Number,required:!0},width:{type:Number,required:!0},recordID:String},setup(i){return Me(),(p,k)=>(c(),K("div",Tl,[q("p",{class:ee(o(te)("dt-text-light","dt-text-dark"))},m(p.$t("noSelection")),3)]))}};var xt=Ve(Ml,[["__scopeId","data-v-39593886"]]);const Il={class:"absolute-center"},zl={__name:"MultiSelection",props:{height:{type:Number,required:!0},width:{type:Number,required:!0},recordID:String},setup(i){Me();const p=ke();le(p);const k=it("editorData");return(u,d)=>(c(),K("div",Il,[q("p",{class:ee(o(te)("dt-text-light","dt-text-dark"))},m(o(k).selectionCount)+" "+m(u.$t("selectedItems")),3)]))}};var $l=Ve(zl,[["__scopeId","data-v-89ab4c86"]]);const Nl=["height","src"],Vl={__name:"DefaultViewer",props:{height:{type:Number,required:!0},width:{type:Number,required:!0},recordID:String},setup(i){ke(),f(null);const p=i,k=it("editorData");X(()=>p.recordID,C=>{S()}),X(()=>p.height,C=>{u()}),Ne(()=>{S(),u()});const u=()=>{_.value=p.height-6},d=f(""),_=f(100),S=()=>{k.recordID!=null?d.value=ra(k.recordID):d.value=""};return(C,b)=>(c(),K("div",{class:"dt-default-viewer",name:"DTDefault",style:rt("height:"+i.height+"px;")},[q("iframe",{height:_.value,id:"sandboxed",src:d.value,class:"DTFrame",frameborder:"0",width:"100%",allowfullscreen:"",target:"_parent",sandbox:"allow-scripts allow-same-origin",onerror:"loadError"},null,8,Nl)],4))}};var He=Ve(Vl,[["__scopeId","data-v-13200b86"]]);const Ll={__name:"ImageView",props:{height:{type:Number,required:!0},width:{type:Number,required:!0},recordID:String},setup(i){const p=ke();le(p),Me(),pt();const k=f(null),u=f("height 300px; max-width: 100% ;"),d=i;X(()=>d.recordID,C=>{S()}),X(()=>d.height,C=>{_()}),Ne(()=>{S(),_()});const _=()=>{u.value="height:"+d.height+"px; max-width: 100% ;"},S=()=>{var C="";d.recordID!=null&&(C=ra(d.recordID)),k.value=C};return(C,b)=>(c(),v(Xa,{style:rt(u.value)},{default:l(()=>[s(Ga,{src:k.value,"spinner-color":"white",style:{"max-width":"100%"}},null,8,["src"])]),_:1},8,["style"]))}};const Fl={class:"absolute-center"},Al={class:"dt-download-container"},Bl={__name:"UnsupportedView",props:{height:{type:Number,required:!0},width:{type:Number,required:!0},recordID:String},setup(i){const p=ke(),{t:k}=Me(),u=i,d=()=>{p.downloadRecord(u.recordID)};return(_,S)=>(c(),K("div",Fl,[q("p",{class:ee(o(te)("dt-text-light","dt-text-dark"))},m(o(k)("formatNotSupported")),3),q("div",Al,[o(ua)(u.recordID)?(c(),v(ml,{key:0,class:"dt-download",color:"light-blue",label:o(k)("downloadToView"),"no-caps":"",flat:"",onClick:d},null,8,["label"])):H("",!0)])]))}};var nt=Ve(Bl,[["__scopeId","data-v-4ed8b1a6"]]),ql=zt({name:"QInnerLoading",props:{...sa,...Ja,showing:Boolean,color:String,size:{type:[String,Number],default:"42px"},label:String,labelClass:String,labelStyle:[String,Array,Object]},setup(i,{slots:p}){const k=Nt(),u=ia(i,k.proxy.$q),{transitionProps:d,transitionStyle:_}=Ya(i),S=ye(()=>"q-inner-loading q--avoid-card-border absolute-full column flex-center"+(u.value===!0?" q-inner-loading--dark":"")),C=ye(()=>"q-inner-loading__label"+(i.labelClass!==void 0?` ${i.labelClass}`:""));function b(){const x=[Te(pl,{size:i.size,color:i.color})];return i.label!==void 0&&x.push(Te("div",{class:C.value,style:i.labelStyle},[i.label])),x}function L(){return i.showing===!0?Te("div",{class:S.value,style:_.value},p.default!==void 0?p.default():b()):null}return()=>Te(qa,d.value,L)}});const Pl={__name:"MainTableMenu",props:{editColumns:{type:Boolean,default:!1}},emits:["action-clicked"],setup(i,{emit:p}){const k=ke(),u=Ye(),d=da();pt();const{t:_}=Me(),S=f(""),C=f(""),{isSupported:b,copy:L,copied:x}=Za({source:C}),R=p;Qe({columnEdit:!1,row:null});const g=it("tableData");f(null);const se=f(!1),U=f(!1),A=f(!0),J=h=>{R("action-clicked",h)};function Y(h){J("hideMenu")}Ne(()=>{G(),re(),j()});const z=()=>{u.settings.rightDrawerOpen=!0},ie=()=>{for(const h of g.targetRows){const w=typeof h=="string"?h:h.id;tl(w)}},re=()=>{se.value=!1,A.value=g.targetRows.length==1;for(const w of g.targetRows){var h=null;typeof w=="string"?h=ce(w):h=w,h!=null&&h.url!=null&&(h.type=="DTnx"||h.type=="html")&&(se.value=!0)}},B=()=>{var h=null;for(const F of g.targetRows){var w=null;typeof F=="string"?w=ce(F):w=F,w!=null&&w.url!=null&&(w.type=="DTnx"||w.type=="html")&&(h=window.open(w.url,"_blank"))}h!=null&&h.focus()},j=()=>{U.value=!1,A.value=g.targetRows.length==1;for(const w of g.targetRows){var h=null;typeof w=="string"?h=ce(w):h=w,h!=null&&h.url!=null&&h.url!=""&&window.location.protocol=="https:"&&(U.value=!0)}},$=()=>{if(g.targetRows.length==1){const w=g.targetRows.at(0);var h=null;typeof w=="string"?h=ce(w):h=w,h!=null&&h.url!=null&&(C.value=h.url,L())}},I=()=>{S.value!=""&&(C.value=S.value,L())},G=()=>{var h="",w=1;for(const F of g.targetRows){const Oe=typeof F=="string"?F:F.id;h=h+"x-devonthink-item://"+Oe,w<g.targetRows.length&&(h=h+`
`),w++}S.value=h},ue=()=>{for(const h of g.targetRows){const w=typeof h=="string"?h:h.id;k.downloadRecord(w)}},P=()=>{u.showFileUpload=!0},Le=h=>{const w=d.columnData.columns[h-1];d.columnData.visibleColumns.includes(w.name)?(d.columnData.visibleColumns=d.columnData.visibleColumns.filter(F=>F!=w.name),w.visible=!1):(d.columnData.visibleColumns.push(w.name),w.visible=!0),d.saveColumns()};return(h,w)=>(c(),v(ut,{"context-menu":"","touch-position":"",class:ee(o(te)("DTContextMenu DTContextMenuLight","DTContextMenu")),onHide:Y},{default:l(()=>[i.editColumns?(c(),v(We,{key:0,dense:""},{default:l(()=>[(c(!0),K(Je,null,mt(o(d).allAvailableColumns,F=>ge((c(),v(Q,{key:F.key,clickable:"",onClick:Oe=>Le(F.key)},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)(F.label)),1)]),_:2},1024),s(N,{side:""},{default:l(()=>[o(d).columnData.visibleColumns.includes(F.name)?(c(),v(o(St),{key:0,size:"20",color:o(u).iconColor},null,8,["color"])):H("",!0)]),_:2},1024)]),_:2},1032,["onClick"])),[[De]])),128))]),_:1})):(c(),v(We,{key:1,dense:""},{default:l(()=>[s(Q,{clickable:"",disable:!o(g).canAdd},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)("newTitle")),1)]),_:1}),s(N,{side:""},{default:l(()=>[s(_e,{name:"icon-icons8-forward",class:"DTMenuIcon"})]),_:1}),s(el)]),_:1},8,["disable"]),s(Ge),ge((c(),v(Q,{clickable:"",onClick:z},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)("actionInfo")),1)]),_:1})]),_:1})),[[De]]),s(Ge),se.value?ge((c(),v(Q,{key:0,clickable:"",onClick:w[0]||(w[0]=F=>B())},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)("launchUrl")),1)]),_:1})]),_:1})),[[De]]):H("",!0),U.value&&A.value?ge((c(),v(Q,{key:1,disable:!o(b),clickable:"",onClick:w[1]||(w[1]=F=>$())},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)("copyUrl")),1)]),_:1})]),_:1},8,["disable"])),[[De]]):H("",!0),ge((c(),v(Q,{clickable:"",onClick:w[2]||(w[2]=F=>I()),disable:!o(b)},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)("copyItemLink")),1)]),_:1})]),_:1},8,["disable"])),[[De]]),s(Ge),s(Q,{clickable:"",disable:!o(g).canChange},{default:l(()=>[s(N,null,{default:l(()=>[T(m(h.$t("actionMark")),1)]),_:1}),s(N,{side:""},{default:l(()=>[s(_e,{name:"icon-icons8-forward",class:"DTMenuIcon"})]),_:1}),s(bl,{records:o(g).targetRows},null,8,["records"])]),_:1},8,["disable"]),s(Q,{clickable:"",disable:!o(g).canChange},{default:l(()=>[s(N,null,{default:l(()=>[T(m(h.$t("actionRating")),1)]),_:1}),s(N,{side:""},{default:l(()=>[s(_e,{name:"icon-icons8-forward",class:"DTMenuIcon"})]),_:1}),s(ut,{anchor:"top right",self:"top left","auto-close":""},{default:l(()=>[s(We,{dense:""},{default:l(()=>[o(g).canChange?(c(),v(Q,{key:0},{default:l(()=>[s(N,null,{default:l(()=>[(c(),v(ca,{class:"DTRating",size:"1.5rem",key:h.ratingKey,disable:!o(g).canChange,modelValue:h.rating,"onUpdate:modelValue":w[3]||(w[3]=F=>h.rating=F),color:"grey-4","color-selected":"grey-9",max:5,icon:"star"},null,8,["disable","modelValue"]))]),_:1})]),_:1})):H("",!0)]),_:1})]),_:1})]),_:1},8,["disable"]),s(Q,{clickable:"",disable:!o(g).canChange},{default:l(()=>[s(N,null,{default:l(()=>[T(m(h.$t("actionLabel")),1)]),_:1}),s(N,{side:""},{default:l(()=>[s(_e,{name:"icon-icons8-forward",class:"DTMenuIcon"})]),_:1}),s(xl)]),_:1},8,["disable"]),s(Ge),ge((c(),v(Q,{disable:!o(g).canAdd,clickable:"",onClick:P},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)("uploadFile")),1)]),_:1})]),_:1},8,["disable"])),[[De]]),ge((c(),v(Q,{disable:!o(g).canDownloadFile,clickable:"",onClick:ue},{default:l(()=>[s(N,null,{default:l(()=>[T(m(o(_)("actionDownload")),1)]),_:1})]),_:1},8,["disable"])),[[De]]),s(Ge),ge((c(),v(Q,{disable:!o(g).canDelete,clickable:"",onClick:w[4]||(w[4]=F=>ie(F))},{default:l(()=>[s(N,{label:""},{default:l(()=>[T(m(o(_)("actionMoveTrash")),1)]),_:1})]),_:1},8,["disable"])),[[De]])]),_:1}))]),_:1},8,["class"]))}};var ba=Ve(Pl,[["__scopeId","data-v-976404fc"]]);const El=i=>(oa("data-v-15b9df91"),i=i(),na(),i),Hl={class:"table-header row",id:"dt-table-header"},Ul=El(()=>q("div",{class:"dt-spacer__back"},null,-1)),Wl={class:"row table-header-item"},Ql={class:"table-title"},Ol={class:"row dt-menu-text-align"},Kl={key:0,class:"dt-row-group"},jl=["onUpdate:modelValue","onKeyup","onFocus","onBlur","id"],Gl={key:1,class:"dt-row-group dt-primary-text"},Xl={class:"truncate dt-name-col"},Jl={key:0},Yl={class:"truncate dt-url-col"},Zt=33,Zl={__name:"MainTableView",props:{height:{type:Number,required:!0},width:{type:Number,required:!0}},emits:["selection-changed"],setup(i,{emit:p}){ea(e=>({bda4bce0:Dt.value,b0f4813c:kt.value,"4cc0fecc":e.primaryColor,"0dfbe84c":e.secondaryColor,"8de3129c":o(U).tableDragHighlight,"2e6368a0":B.height,"6992ecd5":o(U).backgroundColor,"8cc23f62":o(U).secondaryColor}));const k=Ye(),u=ke(),d=da(),_=al(),S=ll(),{columnData:C}=le(d),{rowData:b,updateTitle:L}=le(d),{selectedGroup:x,refreshTable:R}=le(u),{selectedRecords:g,lastSelected:se}=le(u),{dtTheme:U}=le(k),{t:A}=Me();pt();const J=f(!1),Y=f("height: 200px;");f("10px"),f(!1);const z=f("icon-icons8-sortup"),ie=p,re=f(!1),B=i;X(()=>B.height,()=>{j()});const j=()=>{document.getElementById("dt-table-header");var e=48.5;let t=B.height-e;Y.value="height: "+t+"px;"};X(x,()=>{$()}),X(R,()=>{R.value!=""&&R.value==x.value&&d.refreshTableRowData(),u.refreshTable=""});const $=()=>{x.value!=null?(u.clearSelectedRecords(),ie("selection-changed"),d.updateRowData(),oe.canChange=Xe(x.value),oe.canAdd=Tt(x.value),oe.canDelete=Mt(x.value),oe.canDownloadFile=ua(x.value),Ie(),Ct(),Le(),J.value=!1,ue.value=!1,re.value=Xe(x.value)):re.value=!1};X(L,()=>{L.value&&(Ie(),Le(),L.value=!1)});const I=f(!0),G=f([]),ue=f(!1),P=f([14,10]),Le=()=>{var e="";if(G.value=[],I.value=!0,x.value==null||x.value=="")return;let t=new Array;var a=null;do{e==""?e=x.value:e=a.parentID,a=ce(e);let n=h(a);t.push(n)}while(!st(e)&&!Ut(e)&&!ol(e)&&!Wt(e)&&!Qt(e));I.value=t.length<=1,G.value=t},h=e=>{let t={};return e!=null?(t.iconName=It(e),t.displayName=w(e),t.id=e.id):x.value=="inboxes-root"?(t.iconName="web-container-icon-inbox",t.displayName=A("inboxes")):x.value=="tags-root"?(t.iconName="web-container-icon-tag",t.displayName=A("tags")):x.value=="trash-root"&&(t.iconName="web-container-icon-trash",t.displayName=A("trash")),t.iconColor=Ot(e),t.iconStyle=Kt(e),t},w=e=>{var t=e.displayName==null?e.title:e.displayName;return(Wt(e.id)||Ut(e.id)||Qt(e.id))&&(t=e.location),t},F=()=>{ue.value=!1},Oe=e=>{var t="regularMenu-title";return e==0&&(t="mainMenu-title"),t},dt=e=>{if(e!=x.value){var t=jt(e);t?_.expandNode=e:S.expandNode=e,J.value=!0,u.setSelectedGroup(e),Gt(e),ue.value=!1}},W=Qe({iconName:"",iconColor:"",iconStyle:"",displayName:"",showBackBtn:!1}),Ie=()=>{let e=u.recordWithID(x.value);e!=null?(W.iconName=It(e),W.displayName=w(e)):x.value=="inboxes-root"?(W.iconName="web-container-icon-inbox",W.displayName=A("inboxes")):x.value=="tags-root"?(W.iconName="web-container-icon-tag",W.displayName=A("tags")):x.value=="trash-root"?(W.iconName="web-container-icon-trash",W.displayName=A("trash")):(W.iconName="",W.displayName=""),W.iconColor=Ot(e),W.iconStyle=Kt(e)};Ne(()=>{j(),Ie(),za(),d.loadColumns()}),Pa(()=>{$a()});const Fe=f(!0),Ae=f(!0),oe=Qe({canAdd:!1,canChange:!1,canDelete:!1,canDownloadFile:!1,targetRows:[]});Vt("tableData",oe);const me=(e,t)=>{e.preventDefault(),Ze(t)},Ze=e=>{Ae.value=e==null,Ae.value?oe.targetRows=[]:(ma(e.id)?(oe.targetRows=[],g.value.forEach(t=>{const a=ce(t);oe.targetRows.push(a)})):(oe.targetRows=[e],u.addSelectedRecords(e.id,!0),ie("selection-changed")),oe.canAdd=Tt(e.id),oe.canChange=Xe(e.id),oe.canDelete=Mt(e.id)),Fe.value=!1};function Ke(e){Fe.value=!0,Ae.value&&Ct(),Ae.value=!0}const pe=(e,t)=>t+e,et=e=>"ROW"+e,Be=f(0),y=e=>g.value.has(e.id)?"background-color: "+U.value.tableSelectionColor:"",D=(e,t,a)=>{if((he.is.mac||he.is.ios)&&e.metaKey||(he.is.win||he.is.linux)&&e.ctrlKey)u.addSelectedRecords(t.row.id,!1),ie("selection-changed"),e.preventDefault();else if(e.shiftKey)e.preventDefault();else if(e.preventDefault(),u.selectedRecords.has(t.row.id))u.selectedRecords.size==1&&Xe(t.row.id)&&setTimeout(function(){Be.value==1&&M(a)&&we(a)&&(fe.value=t.row.id,Ce.value=a,$t(()=>{var n=pe(t.row.id,a),O=document.getElementById(n);O.focus()})),Be.value=0},500);else{u.addSelectedRecords(t.row.id,!0),ie("selection-changed"),Be.value=0;return}Be.value+=1},E=e=>{Be.value=0,r(e.row)},r=e=>{if(tt(e)){var t=jt(e.id);t?_.expandNode=x.value:S.expandNode=x.value,J.value=!0,u.setSelectedGroup(e.id),Gt(e.id)}},M=e=>C.value.editableColumns.includes(e)&&!st(x.value),we=e=>e=="title"||e=="url",tt=e=>e.type=="DTgr"||e.type=="DTsg"||e.type=="feed"||e.isInbox!=null&&e.isInbox,fe=f(null),Ce=f(""),de=f(),ct=(e,t)=>{fe.value=e.id,Ce.value=t,de.value=e.title},xe=(e,t)=>{fe.value==e.id&&de.value!=e.title&&u.saveMetadata(fe.value,"title",e.title,!0),fe.value=null,de.value=null,Ce.value=""},at=(e,t)=>{xe(e)},ft=(e,t)=>{e.title=de.value,xe(e)},qe=(e,t)=>{u.saveMetadata(t.id,"rating",t.rating,!0),b.value.sortBy=="rating"&&setTimeout(function(){d.updateRowSorting()},50)},bt=e=>{if(e.label==null||e.label==0)return"background-color: black;";{const t=u.database.labels[e.label-1];return"background-color: "+t.color+";"}},Re=e=>{if(e.label==0)return"black";{const t=u.database.labels[e.label-1];return Ea(t.color)}},_t=e=>e.label==0?"--":u.database.labels[e.label-1].description,_a=f(null);f(null);const ya=f(!1),Ft=f({rowsPerPage:0});f([]),ye(()=>ya.value===!0?"shadow-8 no-outline":null);const At=e=>b.value.rows.findIndex(a=>a.id==e),wa=()=>se.value!=""?se.value:g.value.size>0?[...g.value][0]:"",Da=e=>{if(b.value.rows.length==0||fe!="")return;const t=wa();if(e.key=="ArrowDown"){if(t!=""){var a=At(t)+1;if(a<b.value.rows.length){const O=b.value.rows[a];e.shiftKey?u.extendSelectedRecords(O.id):u.addSelectedRecords(O.id,!0),ie("selection-changed")}}}else if(e.key=="ArrowUp"){if(t!=""){var a=At(t)-1;if(a>=0&&b.value.rows.length>0){const ve=b.value.rows[a];e.shiftKey?u.extendSelectedRecords(ve.id):u.addSelectedRecords(ve.id,!0),ie("selection-changed")}}}else if(e.key=="Enter"&&fe.value==null){let n=ka();n!=null&&r(n)}else e.key=="ArrowLeft"&&e.altKey&&fe.value==null&&navigateBack()},ka=()=>{var e=null;if(g.value.size==1){let a=g.value.values().next().value;e=ce(a)}return e},Ca=e=>Xe(e.id)&&!st(x.value),xa=(e,t)=>{e.dataTransfer.dropEffect="none",e.dataTransfer.effectAllowed="all",e.dataTransfer.setData("recordID",t.id);let a=Array.from(u.selectedRecords);a.includes(t.id)||a.push(t.id),u.dragDropData.dragRecords=a},yt=f(!1),Ra=(e,t)=>{var a=x.value;let n=ce(t.id);if(n.type=="DTgr"&&(a=n.id),u.dragDropData.dragRecords!=null&&u.dragDropData.dragRecords.length>0)e.preventDefault(),e.altKey&&!e.metaKey?sl(u.dragDropData.dragRecords,a):e.altKey&&e.metaKey?il(u.dragDropData.dragRecords,a):rl(u.dragDropData.dragRecords,a);else if(e.dataTransfer.files.length>0){e.preventDefault();let O=e.dataTransfer.files;for(let ve=0;ve<O.length;ve++){let Fa=O[ve];u.importFile(Fa,a,null)}}yt.value=!0},be=f(""),Bt=(e,t)=>{t==null&&e.preventDefault();let a=e.target,n=!0;if(a!=null){let O=qt(a,3);if(O!=null){let ve=ce(O);ve!=null&&ve.type=="DTgr"&&(be.value!=""&&be.value!=ve.id&&vt(be.value),be.value=ve.id,Ma(ve.id),n=!1)}}n&&be.value!=""&&(vt(be.value),be.value=""),u.dragDropData.dragRecords!=null&&u.dragDropData.dragRecords.length>0?e.altKey&&!e.metaKey?e.dataTransfer.dropEffect="copy":e.dataTransfer.dropEffect="move":e.dataTransfer.files.length>0&&(e.dataTransfer.dropEffect="copy")},Sa=e=>{be.value!=""&&(vt("highlightID.value"),be.value="",u.dragDropData.dragRecords=[])},Ta=e=>{if(be.value!=""&&(vt("highlightID.value"),be.value=""),!yt.value&&e.dataTransfer.files.length>0){e.preventDefault();var t=x.value;if(t==""&&(t=u.database.globalInbox),t!=""){let a=e.dataTransfer.files;for(let n=0;n<a.length;n++){let O=a[n];u.importFile(O,t,null)}}}yt.value=!1,u.dragDropData.dragRecords=[]},qt=(e,t)=>{if(e!=null){if(e.classList.contains("DTDragMarker")){if(e.id!=null&&e.id.length>3&&e.id.startsWith("ROW"))return e.id.substr(3)}else if(t>0&&e.parentElement!=null)return qt(e.parentElement,t-1)}return null},Ma=e=>{let t=et(e),a=document.getElementById(t);a!=null&&(a.classList.contains("tableDropzone")||a.classList.add("tableDropzone"))},vt=e=>{if(e!=null){let t=et(e),a=document.getElementById(t);a!=null&&a.classList.remove("tableDropzone")}};f("title");const Ia=e=>{},Pe=e=>{wt.value?wt.value=!1:b.value.sortBy!=e?(d.rowData.sortBy=e,d.updateRowData(),z.value="icon-icons8-sortup"):(d.toggleSortType(),z.value=z.value=="icon-icons8-sortup"?"icon-icons8-sortdown":"icon-icons8-sortup")};f(null);const V={pageX:void 0,curCol:void 0,nxtCol:void 0,curColWidth:void 0,offsetWidth:void 0,nxtColWidth:void 0,padding:void 0,colName:""},wt=f(!1),Dt=f("250px"),kt=f("250px"),za=()=>{Va(),document.addEventListener("mousemove",function(e){Na(e)}),document.addEventListener("mouseup",function(e){Et(e)}),Ct()},$a=()=>{document.removeEventListener("mousemove",e=>Se(e)),document.removeEventListener("mouseup",e=>Et(e))},ze=e=>{e.target.style.borderRight="2px solid #c0c0c0"},$e=e=>{e.target.style.borderRight=""},Se=(e,t)=>{t.stopPropagation(),t.preventDefault(),V.colName=e,V.curCol=t.target.parentElement,V.nxtCol=V.curCol.nextElementSibling,V.pageX=t.pageX;const a=Ht(V.curCol);V.padding=a,V.offsetWidth=V.curCol.offsetWidth,V.curColWidth=V.offsetWidth-a,V.nxtCol&&(V.nxtColWidth=V.nxtCol.offsetWidth-a)},Na=e=>{if(V.curCol){const a=e.pageX-V.pageX;if(a!=0){var t=V.offsetWidth+a;if(V.colName=="title"||V.colName=="url"){let n=Ee.value.get(V.colName);if(t<n)return;if(V.colName=="title"){let O=t-(V.padding+Zt);Dt.value=O+"px"}else{let O=t-V.padding;kt.value=O+"px"}}V.curCol.style.width=t+"px"}}},Ee=f(new Map),Va=()=>{Ee.value.set("title",250),Ee.value.set("modified",175),Ee.value.set("flagged",50),Ee.value.set("size",175),Ee.value.set("rating",175),Ee.value.set("url",250)},Ct=()=>{setTimeout(()=>{let e=Pt("dt-title-header",Zt);if(Dt.value=e+"px",d.columnData.visibleColumns.includes("url")){let t=Pt("dt-url-header",0);kt.value=t+"px"}},1e3)},Pt=(e,t)=>{let a=document.getElementById(e),n=Ht(a);return a.offsetWidth-(n+t)},Et=e=>{V.curCol&&(wt.value=!0,La(),e.stopPropagation(),e.preventDefault())},La=()=>{V.pageX=void 0,V.curCol=void 0,V.nxtCol=void 0,V.curColWidth=void 0,V.offsetWidth=void 0,V.nxtColWidth=void 0,V.padding=void 0,V.colName=""},Ht=e=>{const t=window.getComputedStyle(e,null),a=t.getPropertyValue("padding-left"),n=t.getPropertyValue("padding-right");return parseInt(a,10)+parseInt(n,10)};return(e,t)=>(c(),K(Je,null,[s(ha,{ref_key:"tableRef",ref:_a,"table-style":Y.value,columns:o(C).columns,rows:o(b).rows,"visible-columns":o(C).visibleColumns,"row-key":"id",bordered:"false","hide-no-data":"","hide-bottom":"","virtual-scroll":"","virtual-scroll-item-size":48,"virtual-scroll-sticky-size-start":36,onVirtualScroll:Ia,pagination:Ft.value,"onUpdate:pagination":t[25]||(t[25]=a=>Ft.value=a),loading:J.value,"rows-per-page-options":[0],dark:o(la).isActive,class:"DTDragMarker dt-sticky-header-table",onDragover:t[26]||(t[26]=a=>Bt(a,null)),onDragend:t[27]||(t[27]=a=>Sa()),onDrop:Ta,onKeydown:Da},{top:l(()=>[q("div",Hl,[Ul,q("div",Wl,[W.iconName.length>0?(c(),v(Ue,{key:0,name:W.iconName,class:"dt-header-icon"},null,8,["name"])):H("",!0),q("p",Ql,m(W.displayName),1),I.value?H("",!0):(c(),v(o(Xt),{key:1,size:"22"})),I.value?H("",!0):(c(),v(ut,{key:2,modelValue:ue.value,"onUpdate:modelValue":t[0]||(t[0]=a=>ue.value=a),anchor:"top left",self:"top left",offset:P.value,class:ee(o(te)("DTContextMenu DTContextMenuLight","DTContextMenu")),onHide:F},{default:l(()=>[(c(!0),K(Je,null,mt(G.value,(a,n)=>(c(),v(We,{dense:"",key:a.id,style:{"min-width":"100px"}},{default:l(()=>[ge((c(),v(Q,{clickable:"",onClick:O=>dt(a.id)},{default:l(()=>[s(N,null,{default:l(()=>[q("div",Ol,[s(Ue,{name:a.iconName,class:"dt-header-icon"},null,8,["name"]),q("div",{class:ee(Oe(n))},m(a.displayName),3),n==0?(c(),v(o(Xt),{key:0,size:"22"})):H("",!0)])]),_:2},1024)]),_:2},1032,["onClick"])),[[De]])]),_:2},1024))),128))]),_:1},8,["modelValue","offset","class"]))])])]),loading:l(()=>[s(ql,{showing:"",color:"primary"})]),"header-cell-title":l(a=>[s(ne,{props:a,id:"dt-title-header",onContextmenu:t[2]||(t[2]=Z(n=>me(n,null),["prevent"])),onClick:t[3]||(t[3]=n=>Pe("title"))},{default:l(()=>[T(m(o(A)("name"))+" ",1),o(b).sortBy=="title"?(c(),v(_e,{key:0,name:z.value,class:ee(o(te)("dt-sort-icon table-icon-light","dt-sort-icon  table-icon-dark")),size:"12px"},null,8,["name","class"])):H("",!0),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[1]||(t[1]=n=>Se("title",n))},null,32)]),_:2},1032,["props"])]),"header-cell-modified":l(a=>[s(ne,{props:a,onContextmenu:t[5]||(t[5]=Z(n=>me(n,null),["prevent"])),onClick:t[6]||(t[6]=n=>Pe("timestamp"))},{default:l(()=>[T(m(o(A)("modified"))+" ",1),o(b).sortBy=="timestamp"?(c(),v(_e,{key:0,name:z.value,class:ee(o(te)("dt-sort-icon table-icon-light","dt-sort-icon  table-icon-dark")),size:"12px"},null,8,["name","class"])):H("",!0),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[4]||(t[4]=n=>Se("modified",n))},null,32)]),_:2},1032,["props"])]),"header-cell-kind":l(a=>[s(ne,{props:a,onContextmenu:t[8]||(t[8]=Z(n=>me(n,null),["prevent"])),onClick:t[9]||(t[9]=n=>Pe("kind"))},{default:l(()=>[T(m(o(A)("kind"))+" ",1),o(b).sortBy=="kind"?(c(),v(_e,{key:0,name:z.value,class:ee(o(te)("dt-sort-icon table-icon-light","dt-sort-icon  table-icon-dark")),size:"12px"},null,8,["name","class"])):H("",!0),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[7]||(t[7]=n=>Se("kind",n))},null,32)]),_:2},1032,["props"])]),"header-cell-flagged":l(a=>[s(ne,{props:a,onContextmenu:t[11]||(t[11]=Z(n=>me(n,null),["prevent"]))},{default:l(()=>[s(o(ht),{size:"1em"}),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[10]||(t[10]=n=>Se("flagged",n))},null,32)]),_:2},1032,["props"])]),"header-cell-label":l(a=>[s(ne,{props:a,onContextmenu:t[13]||(t[13]=Z(n=>me(n,null),["prevent"])),onClick:t[14]||(t[14]=n=>Pe("label"))},{default:l(()=>[T(m(o(A)("label"))+" ",1),o(b).sortBy=="label"?(c(),v(_e,{key:0,name:z.value,class:ee(o(te)("dt-sort-icon table-icon-light","dt-sort-icon  table-icon-dark")),size:"12px"},null,8,["name","class"])):H("",!0),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[12]||(t[12]=n=>Se("label",n))},null,32)]),_:2},1032,["props"])]),"header-cell-rating":l(a=>[s(ne,{props:a,onContextmenu:t[16]||(t[16]=Z(n=>me(n,null),["prevent"])),onClick:t[17]||(t[17]=n=>Pe("rating"))},{default:l(()=>[T(m(o(A)("rating"))+" ",1),o(b).sortBy=="rating"?(c(),v(_e,{key:0,name:z.value,class:ee(o(te)("dt-sort-icon table-icon-light","dt-sort-icon  table-icon-dark")),size:"12px"},null,8,["name","class"])):H("",!0),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[15]||(t[15]=n=>Se("rating",n))},null,32)]),_:2},1032,["props"])]),"header-cell-size":l(a=>[s(ne,{props:a,onContextmenu:t[19]||(t[19]=Z(n=>me(n,null),["prevent"])),onClick:t[20]||(t[20]=n=>Pe("size"))},{default:l(()=>[T(m(o(A)("size"))+" ",1),o(b).sortBy=="size"?(c(),v(_e,{key:0,name:z.value,class:ee(o(te)("dt-sort-icon table-icon-light","dt-sort-icon  table-icon-dark")),size:"12px"},null,8,["name","class"])):H("",!0),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[18]||(t[18]=n=>Se("size",n))},null,32)]),_:2},1032,["props"])]),"header-cell-url":l(a=>[s(ne,{props:a,id:"dt-url-header",onContextmenu:t[22]||(t[22]=Z(n=>me(n,null),["prevent"])),onClick:t[23]||(t[23]=n=>Pe("url"))},{default:l(()=>[T(m(o(A)("url"))+" ",1),o(b).sortBy=="url"?(c(),v(_e,{key:0,name:z.value,class:ee(o(te)("dt-sort-icon table-icon-light","dt-sort-icon  table-icon-dark")),size:"12px"},null,8,["name","class"])):H("",!0),q("div",{class:"dt-table-col-resize",onMouseover:ze,onMouseout:$e,onMousedown:t[21]||(t[21]=n=>Se("url",n))},null,32)]),_:2},1032,["props"])]),body:l(a=>[s(fa,{style:rt(y(a.row)),onContextmenu:Z(n=>me(n,a.row),["prevent"]),class:"DTDragMarker DTListItem",draggable:Ca(a.row),props:"props",onDragstart:n=>xa(n,a.row),onDrop:Z(n=>Ra(n,a.row),["prevent"]),onDragenter:t[24]||(t[24]=Z(()=>{},["prevent"])),onDragover:Z(n=>Bt(n,a.row),["prevent"]),id:et(a.row.id)},{default:l(()=>[s(ae,{key:"title",props:a,onClick:n=>D(n,a,"title"),onDblclick:n=>E(a)},{default:l(()=>[Ce.value=="title"&&fe.value==a.row.id?(c(),K("div",Kl,[s(Ue,{name:a.row.icon,class:"dt-table-icon"},null,8,["name"]),Ce.value=="title"&&fe.value==a.row.id?ge((c(),K("input",{key:0,"onUpdate:modelValue":n=>a.row.title=n,onKeyup:[Rt(n=>at(a.row,"title"),["enter"]),Rt(n=>ft(a.row,"title"),["esc"])],onFocus:n=>ct(a.row,"title"),onBlur:n=>xe(a.row,"title"),class:"dt-tablecol-text-edit",id:pe(a.row.id,"title")},null,40,jl)),[[ta,a.row.title]]):H("",!0)])):(c(),K("div",Gl,[s(Ue,{name:a.row.icon,class:"dt-table-icon"},null,8,["name"]),q("div",Xl,m(a.row.displayName==null?a.row.title:a.row.displayName),1)]))]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"modified",props:a,class:"dt-secondary-text",onClick:n=>D(n,a,"modified"),onDblclick:n=>E(a)},{default:l(()=>[T(m(o(va)(a.row.timestamp)),1)]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"kind",props:a,class:"dt-secondary-text",onClick:n=>D(n,a,"kind"),onDblclick:n=>E(a)},{default:l(()=>[T(m(e.$t(o(ga)(a.row))),1)]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"flagged",props:a},{default:l(()=>[a.row.flagged!=null&&a.row.flagged?(c(),v(o(ht),{key:0,size:"1em"})):H("",!0)]),_:2},1032,["props"]),s(ae,{key:"label",props:a,onClick:n=>D(n,a,"label"),onDblclick:n=>E(a)},{default:l(()=>[a.row.label==="undefined"||a.row.label==0?(c(),K("div",Jl)):(c(),v(nl,{key:1,style:rt(bt(a.row)),dense:"","text-color":Re(a.row)},{default:l(()=>[T(m(_t(a.row)),1)]),_:2},1032,["style","text-color"]))]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"rating",props:a,onClick:n=>D(n,a,"rating"),onDblclick:n=>E(a)},{default:l(()=>[s(ca,{modelValue:a.row.rating,"onUpdate:modelValue":[n=>a.row.rating=n,n=>qe(a.rowIndex,a.row)],max:5,class:"dt-rating",color:"grey-7",size:"1.0rem",readonly:!re.value},null,8,["modelValue","onUpdate:modelValue","readonly"])]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"size",props:a,class:"dt-secondary-text",onClick:n=>D(n,a,"size"),onDblclick:n=>E(a)},{default:l(()=>[T(m(o(aa)(a.row)),1)]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"url",props:a,class:"dt-secondary-text",onClick:n=>D(n,a,"url"),onDblclick:n=>E(a)},{default:l(()=>[q("div",Yl,m(a.row.url),1)]),_:2},1032,["props","onClick","onDblclick"])]),_:2},1032,["style","onContextmenu","draggable","onDragstart","onDrop","onDragover","id"])]),_:1},8,["table-style","columns","rows","visible-columns","pagination","loading","dark"]),Fe.value?H("",!0):(c(),v(ba,{key:0,onActionClicked:Ke,editColumns:Ae.value},null,8,["editColumns"]))],64))}};var eo=Ve(Zl,[["__scopeId","data-v-15b9df91"]]);const to=i=>(oa("data-v-1fa572fe"),i=i(),na(),i),ao={class:"search-results-header"},lo={class:"table-title dt-secondary-text dt-left-margin"},oo=to(()=>q("div",{class:"search-results-spacer"},null,-1)),no={class:"table-title dt-secondary-text dt-right-margin"},so=["onUpdate:modelValue","onKeyup","onFocus","onBlur","id"],io={key:1,class:"dt-row-group dt-primary-text"},ro={class:"truncate dtsearch-name-col"},uo={__name:"SearchTableView",props:{height:{type:Number,required:!0},width:{type:Number,required:!0}},emits:["selection-changed"],setup(i,{emit:p}){ea(y=>({d7b2efe2:o(b).primaryColor,"05ab5f46":o(b).secondaryColor,"7e95d53e":J.height,d11502f2:o(b).backgroundColor}));const k=Ye(),u=ke(),d=pa(),{columnData:_}=le(d),{searchRowData:S,searchString:C}=le(d),{dtTheme:b}=le(k),{selectedGroup:L,selectedRecords:x}=le(u),{t:R}=Me();pt();const g=f(!1),se=f("height: 200px;"),U=p,A=f(null),J=i,Y=f({rowsPerPage:0}),z=Qe({requested:new Date,started:new Date});X(C,(y,D)=>{d.lastSearchText!=d.searchString&&(d.searchRowData.currentID="",d.searchRowData.rows=new Array,d.searchRowData.recordMap=new Map,z.requested=new Date,setTimeout(function(){let E=z.requested.getTime(),r=z.started.getTime();E>r&&ue({index:0,from:0,to:30,direction:"increase",ref:null})},50))},{immediate:!0}),X(L,(y,D)=>{I(),d.searchRowData.rows=new Array,d.searchRowData.recordMap=new Map,ie()});const ie=()=>{z.requested=new Date,setTimeout(function(){let y=z.requested.getTime(),D=z.started.getTime();y>D&&ue({index:0,from:0,to:30,direction:"increase",ref:null})},50)},re=(y,D)=>D+y,B=f(""),j=f([]),$=f({name:R("allDatabases"),id:"allDbs",icon:"web-container-icon-database"}),I=()=>{var y=new Array,D={};D.name=R("allDatabases"),D.id="allDbs",D.icon="web-container-icon-database";var E=D;if(y.push(D),L.value!="none"&&!st(L.value)){let we=ul(L.value);if(we!=null){var r={};r.name=we.title,r.id="database",r.recordID=we.id,r.icon="web-container-icon-database",y.push(r),$.value.id=="database"&&(E=r)}if(we.id!=L.value&&!st(L.value)){let tt=ce(L.value);var M={};M.name=tt.title,M.id="group",M.recordID=tt.id,M.icon="web-container-icon-group",y.push(M),$.value.id=="group"&&(E=M)}$.value=E}j.value=y},G=y=>{y.id!=$.value.id&&($.value=y,d.searchRowData.currentID="",d.searchRowData.rows=new Array,d.searchRowData.recordMap=new Map)},ue=y=>{const{index:D,from:E,to:r,direction:M,ref:we}=y,fe=(r>=E?r:E)+10,Ce=d.serverAvailbleRows;var de=0,ct=30;if(z.started=z.requested,fe>S.value.rows.length&&(de=S.value.rows.length),Ce!=-1){if(de!=0&&de>=Ce)return;de>0&&S.value.rows.length==0&&(ct+=de,de=0)}if(!g.value&&(Ce==-1||fe>S.value.rows.length)){g.value=!0,d.searchRowData.isSearching=!0;let xe="/search?q="+C.value+"*&start="+de+"&num="+ct+"&format=JSON";$.value.id=="database"?xe=xe+"&database="+$.value.recordID:$.value.id=="group"&&(xe=xe+"&group="+$.value.recordID),Ha.get(xe).then(at=>{const ft=at.data;var qe=ft.items,bt=ft.statistics;d.searchRowData.isSearching=!1,qe.sort((Re,_t)=>_t.relevance-Re.relevance),qe.forEach(Re=>{Re.icon=It(Re)}),C.value==""?clearSearch():(de==0?(d.searchRowData.rows=qe,d.searchRowData.recordMap=new Map(qe.map(Re=>[Re.id,Re]))):d.appendSearchRows(qe),d.searchRowData.stats=bt,d.lastSearchText=C.value),g.value=!1,P(),we!=null&&(de==0?we.refresh(0):we.refresh())}).catch(at=>{g.value=!1,console.log("Catch error"),console.log(at),d.searchRowData.isSearching=!1})}},P=()=>{if(S.value.stats!=null){const y=S.value.stats.count;y==0?B.value=R("noRecords"):B.value=" "+y+" "+R("itemsFound")}else B.value=""},Le=f(0),h=f(null),w=y=>h.value==y.id?"background-color: "+b.value.tableSelectionColor:"",F=(y,D,E)=>{h.value!=D.row.id?(Le.value=1,h.value=D.row.id):Le.value+=1,S.value.restoreSelectedRows||(d.searchRowData.selectedRows=new Set(x.value),d.searchRowData.restoreSelectedRows=!0),u.selectedRecords.has(D.row.id)?E=="title"&&(W.value=D.row.id,Ie.value=E,$t(()=>{var r=re(D.row.id,E),M=document.getElementById(r);M.focus()})):(u.addSelectedRecords(D.row.id,!0),U("selection-changed"))};X(()=>J.height,()=>{dt()}),Ne(()=>{dt(),I(),Oe()});const Oe=()=>{d.columnData.columns.forEach(y=>{y.label=R(y.label)})},dt=()=>{let D=J.height-36.5;se.value="height: "+D+"px;"},W=f(null),Ie=f(""),Fe=f(),Ae=(y,D)=>{W.value=y.id,Ie.value=D,Fe.value=y.title},oe=(y,D)=>{W.value==y.id&&Fe.value!=y.title&&u.saveMetadata(W.value,"title",y.title,!0),W.value=null,Fe.value=null,Ie.value=""},me=(y,D)=>{oe(y)},Ze=f(!0),Ke=f(!0),pe=Qe({canAdd:!1,canChange:!1,canDelete:!1,targetRows:[]});Vt("tableData",pe);const et=(y,D)=>{y.preventDefault(),Ke.value=D==null,Ke.value?pe.targetRows=[]:(ma(D.id)?(pe.targetRows=[],x.value.forEach(E=>{const r=ce(E);pe.targetRows.push(r)})):(pe.targetRows=[D],u.addSelectedRecords(D.id,!0),U("selection-changed")),pe.canAdd=Tt(D.id),pe.canChange=Xe(D.id),pe.canDelete=Mt(D.id)),Ze.value=!1};function Be(y){Ze.value=!0,Ke.value=!0}return(y,D)=>{const E=Ua("Check");return c(),K(Je,null,[s(ha,{ref_key:"searchRef",ref:A,"table-style":se.value,columns:o(_).columns,rows:o(S).rows,"visible-columns":o(_).visibleColumns,"row-key":"id",bordered:"false","hide-no-data":"","hide-bottom":"","virtual-scroll":"","virtual-scroll-item-size":48,"virtual-scroll-sticky-size-start":36.5,"rows-per-page-options":[0],onVirtualScroll:ue,pagination:Y.value,"onUpdate:pagination":D[2]||(D[2]=r=>Y.value=r),loading:g.value,dark:o(la).isActive,class:"DTDragMarker dt-search-header-table"},{top:l(()=>[q("div",ao,[q("p",lo,m(o(R)("searchIn")),1),s(Ue,{name:$.value.icon,class:"dt-search-hdr-icon"},null,8,["name"]),s(dl,{class:"dt-primary-header",flat:"",dense:"","no-icon-animation":"","no-caps":"",label:$.value.name},{default:l(()=>[s(We,null,{default:l(()=>[(c(!0),K(Je,null,mt(j.value,r=>ge((c(),v(Q,{key:r.id,clickable:"",onClick:M=>G(r)},{default:l(()=>[s(N,{side:""},{default:l(()=>[s(Ue,{name:r.icon},null,8,["name"])]),_:2},1024),s(N,null,{default:l(()=>[s(cl,null,{default:l(()=>[T(m(r.name),1)]),_:2},1024)]),_:2},1024),s(N,{side:""},{default:l(()=>[$.value!=null&&$.value.id==r.id?(c(),v(E,{key:0,size:"18",color:o(k).iconColor},null,8,["color"])):H("",!0)]),_:2},1024)]),_:2},1032,["onClick"])),[[De]])),128))]),_:1})]),_:1},8,["label"]),oo,q("p",no,m(B.value),1)])]),"header-cell-relevance":l(r=>[s(ne,{props:r},{default:l(()=>[T(m(o(R)("score")),1)]),_:2},1032,["props"])]),"header-cell-title":l(r=>[s(ne,{props:r},{default:l(()=>[T(m(o(R)("name")),1)]),_:2},1032,["props"])]),"header-cell-modified":l(r=>[s(ne,{props:r},{default:l(()=>[T(m(o(R)("modified")),1)]),_:2},1032,["props"])]),"header-cell-kind":l(r=>[s(ne,{props:r},{default:l(()=>[T(m(o(R)("kind")),1)]),_:2},1032,["props"])]),"header-cell-flagged":l(r=>[s(ne,{props:r},{default:l(()=>[s(o(ht),{size:"1em"})]),_:2},1032,["props"])]),"header-cell-size":l(r=>[s(ne,{props:r},{default:l(()=>[T(m(o(R)("size")),1)]),_:2},1032,["props"])]),"header-cell-url":l(r=>[s(ne,{props:r},{default:l(()=>[T(m(o(R)("url")),1)]),_:2},1032,["props"])]),body:l(r=>[s(fa,{style:rt(w(r.row)),onContextmenu:Z(M=>et(M,r.row),["prevent"]),class:"DTDragMarker DTListItem",draggable:"true",props:"props",onDragstart:M=>y.startDrag(M,r.row),onDrop:Z(M=>y.onDrop(M,r.row),["prevent"]),onDragenter:D[0]||(D[0]=Z(()=>{},["prevent"])),onDragover:D[1]||(D[1]=Z(()=>{},["prevent"]))},{default:l(()=>[s(ae,{key:"relevance",props:r},{default:l(()=>[s(fl,{class:"dt-relevance",id:"DTRelevance",value:r.row.relevance.toFixed(2),color:o(Wa)(r.row.relevance)},null,8,["value","color"])]),_:2},1032,["props"]),s(ae,{key:"title",props:r,onClick:M=>F(M,r,"title")},{default:l(()=>[Ie.value=="title"&&W.value==r.row.id?ge((c(),K("input",{key:0,"onUpdate:modelValue":M=>r.row.title=M,onKeyup:Rt(M=>me(r.row,"title"),["enter"]),onFocus:M=>Ae(r.row,"title"),onBlur:M=>oe(r.row,"title"),class:"dt-searchcol-text-edit",id:re(r.row.id,"title")},null,40,so)),[[ta,r.row.title]]):(c(),K("div",io,[s(Ue,{name:r.row.icon,class:"dt-table-icon"},null,8,["name"]),q("div",ro,m(r.row.displayName==null?r.row.title:r.row.displayName),1)]))]),_:2},1032,["props","onClick"]),s(ae,{key:"modified",props:r,class:"dt-secondary-text",onClick:M=>F(M,r,"modified"),onDblclick:M=>y.onRowDblClick(r)},{default:l(()=>[T(m(o(va)(r.row.timestamp)),1)]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"kind",props:r,class:"dt-secondary-text",onClick:M=>F(M,r,"kind"),onDblclick:M=>y.onRowDblClick(r)},{default:l(()=>[T(m(y.$t(o(ga)(r.row))),1)]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"label",props:r,onClick:M=>F(M,r,"label"),onDblclick:M=>y.onRowDblClick(r)},{default:l(()=>[T(m(r.row.label),1)]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"flagged",props:r},{default:l(()=>[r.row.flagged!=null&&r.row.flagged?(c(),v(o(ht),{key:0,size:"1em"})):H("",!0)]),_:2},1032,["props"]),s(ae,{key:"size",props:r,class:"dt-secondary-text",onClick:M=>F(M,r,"size"),onDblclick:M=>y.onRowDblClick(r)},{default:l(()=>[T(m(o(aa)(r.row)),1)]),_:2},1032,["props","onClick","onDblclick"]),s(ae,{key:"url",props:r,class:"dt-secondary-text",onClick:M=>F(M,r,"url"),onDblclick:M=>y.onRowDblClick(r)},{default:l(()=>[T(m(r.row.url),1)]),_:2},1032,["props","onClick","onDblclick"])]),_:2},1032,["style","onContextmenu","onDragstart","onDrop"])]),_:1},8,["table-style","columns","rows","visible-columns","pagination","loading","dark"]),Ze.value?H("",!0):(c(),v(ba,{key:0,onActionClicked:Be,"edit-columns":Ke.value},null,8,["edit-columns"]))],64)}}};var co=Ve(uo,[["__scopeId","data-v-1fa572fe"]]);const fo={__name:"MainPage",setup(i){const p=Ye(),k=ke(),u=pa(),{seeAlsoData:d}=le(k);le(k);const{unableToLoadPreview:_}=le(k),{selectedRecords:S}=le(k),C=f(50),b=Qa(xt),L=lt(()=>ot(()=>import("./RichTextViewer.6b61faad.js"),["assets/RichTextViewer.6b61faad.js","assets/RichTextViewer.06b7535c.css","assets/index.91710347.js","assets/index.ea33f2b2.css","assets/QBtn.941b3ca0.js","assets/QToolbarTitle.b6051a03.js","assets/QTable.5a47bc39.js","assets/QTable.b04ac4ec.css","assets/rectangle-horizontal.19014239.js"])),x=lt(()=>ot(()=>import("./CodeEditor.57f147ce.js"),["assets/CodeEditor.57f147ce.js","assets/index.91710347.js","assets/index.ea33f2b2.css","assets/QTable.5a47bc39.js","assets/QTable.b04ac4ec.css","assets/QBtn.941b3ca0.js"])),R=lt(()=>ot(()=>import("./MessageView.29105837.js"),["assets/MessageView.29105837.js","assets/MessageView.82152ceb.css","assets/QTable.5a47bc39.js","assets/QTable.b04ac4ec.css","assets/index.91710347.js","assets/index.ea33f2b2.css","assets/QBtn.941b3ca0.js"])),g=lt(()=>ot(()=>import("./MarkdownEditor.86427309.js"),["assets/MarkdownEditor.86427309.js","assets/QBtn.941b3ca0.js","assets/index.91710347.js","assets/index.ea33f2b2.css","assets/QToolbarTitle.b6051a03.js","assets/QTable.5a47bc39.js","assets/QTable.b04ac4ec.css","assets/CodeEditor.57f147ce.js"])),se=lt(()=>ot(()=>import("./PDFViewer.2199d46e.js"),["assets/PDFViewer.2199d46e.js","assets/index.91710347.js","assets/index.ea33f2b2.css","assets/QTable.5a47bc39.js","assets/QTable.b04ac4ec.css","assets/QBtn.941b3ca0.js"]));X(()=>d.value.selectedSeeAlso,()=>{A(!0)}),X(S,()=>{A(!1)}),X(_,$=>{$&&(A(!1),k.unableToLoadPreview=!1)});const U=Qe({selectionCount:0,recordID:""});Vt("editorData",U);const A=$=>{if(_.value){p.previewMessage="previewError",b.value=R;return}if($&&d.value.selectedSeeAlso!="")b.value=J(d.value.selectedSeeAlso),U.recordID=d.value.selectedSeeAlso;else if(U.selectionCount=S.value.size,U.selectionCount==0)b.value=xt;else if(U.selectionCount>1)b.value=$l;else{var I=Array.from(S.value);const G=I[0];b.value=J(G),U.recordID=G}},J=$=>{const I=ce($);var G=!1,ue=!1;if(I.pending!=null&&(G=I.pending),I.missing!=null&&(ue=I.missing),ue)return p.previewMessage="fileNotAvailable",R;G&&console.log("latest version is not yet available");let P=xt;switch(I.type){case"DTgr":case"DTsg":case"feed":case"pict":!he.is.safari&&(I.extension=="tif"||I.extension=="tiff")?P=nt:P=Ll;break;case"DTnx":P=He;break;case"pdf ":he.is.safari?P=He:P=se;break;case"rtf ":case"rtfd":case"scpt":case"wbar":case"tabl":P=He;break;case"ctxt":case"txt ":case"xml ":case"plis":case"apsc":P=x;break;case"DTft":case"html":I.editableNote?P=L:P=He;break;case"quti":Yt(I.extension)?P=He:P=nt;break;case"****":p.filetypes.notSupportedExts.indexOf(I.extension)>-1?P=nt:p.filetypes.markdownExts.indexOf(I.extension)>-1?P=g:p.filetypes.mediaExts.indexOf(I.extension)>-1?Yt(I.extension)?P=He:P=nt:p.filetypes.mindmaps.indexOf(I.extension)>-1?P=nt:P=He;break}return P},Y=$=>{B()},z=Qe({height:0,width:0,tableHeight:100,editorHeight:100,pageHeight:200}),ie=$=>{re()},re=()=>{p.windowInnerHeight=window.innerHeight,z.width=document.getElementById("mainsplitter").offsetWidth;let $=Oa();$!=z.pageHeight&&(z.pageHeight=$,B())},B=()=>{let $=z.pageHeight/100*C.value;z.tableHeight=j($,1);let I=z.pageHeight/100*(100-C.value);z.editorHeight=j(I,1)-1},j=($,I)=>Number(Math.floor(parseFloat($+"e"+I))+"e-"+I);return Ne(()=>{re()}),($,I)=>(c(),v(Sl,{class:ee(o(te)("page-light, flex","page-dark, flex")),id:"mainPageContainer"},{default:l(()=>[s(Rl,{modelValue:C.value,"onUpdate:modelValue":[I[2]||(I[2]=G=>C.value=G),Y],"emit-immediately":!0,id:"mainsplitter",class:"full-width","before-class":o(te)("DTSplitBefore","DTSplitBefore  dt-split-dark"),"after-class":"DTSplitAfter",horizontal:""},{before:l(()=>[o(u).showSearchResults?(c(),v(co,{key:1,width:z.width,height:z.tableHeight,onSelectionChanged:I[1]||(I[1]=G=>A(!1))},null,8,["width","height"])):(c(),v(eo,{key:0,width:z.width,height:z.tableHeight,onSelectionChanged:I[0]||(I[0]=G=>A(!1))},null,8,["width","height"]))]),after:l(()=>[(c(),v(Ka(b.value),{width:z.width,height:z.editorHeight,recordID:U.recordID},null,8,["width","height","recordID"]))]),_:1},8,["modelValue","before-class"]),s(vl,{onResize:ie})]),_:1},8,["class"]))}};var vo=Ve(fo,[["__scopeId","data-v-2bfd9d3d"]]),po=Object.freeze(Object.defineProperty({__proto__:null,default:vo},Symbol.toStringTag,{value:"Module"}));export{He as D,po as M,Rl as Q};
