"use strict";varN7=Object.defineProperty;varA7=(e,t,n)=>tine?N7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;varDe=(e,t,n)=>(A7(e,typeoft!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});constC=require("obsidian"),hS=require("@codemirror/language"),Vg=require("@codemirror/state"),Vl=require("@codemirror/view");functionF7(e,t){for(varn=0;n<t.length;n++){constr=t[n];if(typeofr!="string"&&!Array.isArray(r)){for(constainr)if(a!=="default"&&!(aine)){consto=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}returnObject.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}vardr=typeofglobalThis<"u"?globalThis:typeofwindow<"u"?window:typeofglobal<"u"?global:typeofself<"u"?self:{};functionqt(e){returne&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}varFN={exports:{}},fg={},ON={exports:{}},mn={},wx;functionO7(){if(wx)returnmn;wx=1;vare=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;functiony(K){returnK===null||typeofK!="object"?null:(K=g&&K[g]||K["@@iterator"],typeofK=="function"?K:null)}varw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,S={};functionI(K,ae,Se){this.props=K,this.context=ae,this.refs=S,this.updater=Se||w}I.prototype.isReactComponent={},I.prototype.setState=function(K,ae){if(typeofK!="object"&&typeofK!="function"&&K!=null)throwError("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,ae,"setState")},I.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};functionM(){}M.prototype=I.prototype;functionN(K,ae,Se){this.props=K,this.context=ae,this.refs=S,this.updater=Se||w}var_=N.prototype=newM;_.constructor=N,T(_,I.prototype),_.isPureReactComponent=!0;vark=Array.isArray,R=Object.prototype.hasOwnProperty,L={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};functionU(K,ae,Se){varje,Re={},Fe=null,Be=null;if(ae!=null)for(jeinae.ref!==void0&&(Be=ae.ref),ae.key!==void0&&(Fe=""+ae.key),ae)R.call(ae,je)&&!H.hasOwnProperty(je)&&(Re[je]=ae[je]);varQe=arguments.length-2;if(Qe===1)Re.children=Se;elseif(1<Qe){for(varZe=Array(Qe),st=0;st<Qe;st++)Ze[st]=arguments[st+2];Re.children=Ze}if(K&&K.defaultProps)for(jeinQe=K.defaultProps,Qe)Re[je]===void0&&(Re[je]=Qe[je]);return{$$typeof:e,type:K,key:Fe,ref:Be,props:Re,_owner:L.current}}functionz(K,ae){return{$$typeof:e,type:K.type,key:ae,ref:K.ref,props:K.props,_owner:K._owner}}function$(K){returntypeofK=="object"&&K!==null&&K.$$typeof===e}functionX(K){varae={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(Se){returnae[Se]})}varQ=/\/+/g;functionse(K,ae){returntypeofK=="object"&&K!==null&&K.key!=null?X(""+K.key):ae.toString(36)}functionue(K,ae,Se,je,Re){varFe=typeofK;(Fe==="undefined"||Fe==="boolean")&&(K=null);varBe=!1;if(K===null)Be=!0;elseswitch(Fe){case"string":case"number":Be=!0;break;case"object":switch(K.$$typeof){casee:caset:Be=!0}}if(Be)returnBe=K,Re=Re(Be),K=je===""?"."+se(Be,0):je,k(Re)?(Se="",K!=null&&(Se=K.replace(Q,"$&/")+"/"),ue(Re,ae,Se,"",function(st){returnst})):Re!=null&&($(Re)&&(Re=z(Re,Se+(!Re.key||Be&&Be.key===Re.key?"":(""+Re.key).replace(Q,"$&/")+"/")+K)),ae.push(Re)),1;if(Be=0,je=je===""?".":je+":",k(K))for(varQe=0;Qe<K.length;Qe++){Fe=K[Qe];varZe=je+se(Fe,Qe);Be+=ue(Fe,ae,Se,Ze,Re)}elseif(Ze=y(K),typeofZe=="function")for(K=Ze.call(K),Qe=0;!(Fe=K.next()).done;)Fe=Fe.value,Ze=je+se(Fe,Qe++),Be+=ue(Fe,ae,Se,Ze,Re);elseif(Fe==="object")throwae=String(K),Error("O
`),f[w].blockId=y.id}}});const p=Object.keys(f).map(y=>({line:f[y].content,blockId:f[y].blockId||"",index:parseInt(y)}));return e.path.includes("2024-04-07"),p}async function pR(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new C.Notice(E("File not found for the given thino path, is creating a new file")),n=await t.vault.create(e,'{"nodes": [], "edges": []}'),dt.setChangedByMemos(!0)),n}async function mR(e,t){var a;let n;try{n=await t.vault.read(e)}catch(o){console.error(o),n=await t.vault.cachedRead(e)}const r=(a=t.metadataCache.getFileCache(e))==null?void 0:a.frontmatterPosition;return r?n.slice(r.end.offset+1):n}function gR(e){const t=e.split(/\r?\n/),n=[];let r="",a=[],o=0;for(let i=0;i<t.length;i++){const l=t[i];l.startsWith("#")?(r&&n.push({header:r,content:a.join(`
`);t.push(n.slice(0,r)),n=n.slice(r+1)}return t.push(n),t}async function zR({content:e,isList:t,name:n}){const r=Le.getState().dailyNotesState.settings,a=C.moment(),o=ut.randomId(16),i=(r==null?void 0:r.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",l=n||`${a.format("YYYYMMDD")}-${o}`,c=`${i}/${l}.md`,f={id:o,content:e,deletedAt:"",path:c,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"MULTI"},p=ft.getState().app||window.app,{vault:g,fileManager:y}=p,w=g.getAbstractFileByPath(i);(!w||!(w instanceof C.TFolder))&&(new C.Notice(E("Folder not found for the given thino path, is creating a new folder")),await g.createFolder(i)),dt.setChangedByMemos(!0);let T;const S=p.vault.getFileByPath(c);return S?T=await g.create(`${i}/${a.format("YYYYMMDD")}-${o}.md`,e):T=await g.create(c,e),await y.processFrontMatter(T,I=>{I.id=o,I.createdAt=a.format("YYYY/MM/DD HH:mm:ss"),I.updatedAt=a.format("YYYY/MM/DD HH:mm:ss"),I.thinoType=t?"JOURNAL":"TASK-TODO"}),(!n||S)&&(r!=null&&r.SetFileNameAfterCreate)&&p.fileManager.promptForFileRename(T),f}async function VR({content:e,isList:t}){const n=Le.getState().dailyNotesState.settings,r=C.moment(),a=ut.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",i={id:a,content:e,deletedAt:"",path:o,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE"},l=ft.getState().app,{vault:c}=l;let f=c.getAbstractFileByPath(o);(!f||!(f instanceof C.TFile))&&(new C.Notice(E("File not found for the given thino path, is creating a new file")),f=await c.create(o,""));let p="";try{p=await c.read(f)||await c.cachedRead(f)}catch(M){console.error(M),new C.Notice(E("Failed to read current daily note, check if it exists."))}const g=p.indexOf(`#${r.format("YYYY-MM-DD")}`);let y=p.indexOf(`
${p.substring(y)}`}else I=`${p.substring(0,y)}${S}${p.substring(y)}`;return setTimeout(async()=>{dt.setChangedByMemos(!0),await c.modify(f,I)},200),i}async function Mx(e){const t=Le.getState().dailyNotesState.settings,n=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,a=(t==null?void 0:t.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",o={id:r,content:e.content,deletedAt:e.deletedAt||"",path:a,createdAt:n.format("YYYY/MM/DD HH:mm:ss"),updatedAt:n.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",hasId:"",linkId:"",pinned:e.pinned,visibility:"PUBLIC",rowStatus:e.rowStatus||"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",webId:e.id},i=ft.getState().app,{vault:l}=i;let c=l.getAbstractFileByPath(a);(!c||!(c instanceof C.TFile))&&(new C.Notice(E("File not found for the given thino path, is creating a new file")),c=await l.create(a,""));let f="";try{f=await l.read(c)||await l.cachedRead(c)}catch(I){console.error(I),new C.Notice(E("Failed to read current daily note, check if it exists."))}const p=f.indexOf(`#${n.format("YYYY-MM-DD")}`);let g=f.indexOf(`
${f.substring(g)}`}else S=`${f.substring(0,g)}${T}${f.substring(g)}`;return dt.setChangedByMemos(!0),await l.modify(c,S),o}async function WR({content:e,isList:t}){const n=Le.getState().dailyNotesState.settings,r=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultCanvasPath)||"basic.thino.canvas",a=C.moment(),o=ut.randomId(16),i={id:o,content:e,deletedAt:"",path:r,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"CANVAS"},l=ft.getState().app,{vault:c}=l,f=await pR(r,l);if(!f||!(f instanceof C.TFile)){new C.Notice(E("File not found for the given thino path, is creating a new file"));return}const p=await c.read(f),g=JSON.parse(p);if(g.nodes.find(I=>I.id===i.id))return;let w;g.nodes.length>0&&(w=[...g.nodes].reduce((I,M)=>{if(!I.createdAt)return M;const N=C.moment(I.createdAt,"YYYY/MM/DD HH:mm:ss"),_=C.moment(M.createdAt,"YYYY/MM/DD HH:mm:ss");return N.isAfter(_)?I:M}));const T=w?{x:w.x,y:w.y+100,width:w.width,height:w.height}:{x:0,y:0,width:200,height:100};g.nodes.push({...T,type:"text",id:o,text:e,deletedAt:"",createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),dt.setChangedByMemos(!0);const S=JSON.stringify(g,null,2);return await c.modify(f,S),i}async function gS(e,t,n){var se;const{vault:r}=Le.getState().dailyNotesState.app||window.app,a=Le.getState().dailyNotesState.app||window.app,o=Le.getState().dailyNotesState.settings,i=a.vault.getConfig("useTab")===void 0||window.app.vault.getConfig("useTab")===!0,l=i?1:a.vault.getConfig("tabSize"),c=(i?" ":" ").repeat(l),f=e.split(`
`+c:" "}${M?`[webId::${M}]`:""}`,k=Zu(),R=ub(p,k),L="fake"+ut.randomId(16);letH=!1;constU=a.plugins.getPlugin("templater-obsidian");letz;if(R?z=R:(U!=null&&U.templater&&(U!=null&&U.settings.trigger_on_file_creation)&&(be.setWaitingForTemplater({origin:e,date:p,isList:t,id:L,type:"local"}),H=!0),z=awaitut.createDailyNoteCheck(p)),!z){newC.Notice(E("Failed to create daily note, check if it exists."));return}if(R||awaitft.fechLocalDailyNotes(),U&&(U!=null&&U.templater)&&(U!=null&&U.settings.trigger_on_file_creation)&&H)returndt.setChangedByMemos(!0),{id:L,content:e,deletedAt:"",createdAt:p.format("YYYY/MM/DD HH:mm:ss"),updatedAt:p.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:z.path,hasId:"",linkId:"",webId:M,pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY"};let$="";try{$=awaitr.read(z)||awaitr.cachedRead(z)}catch(ue){console.error(ue),newC.Notice(E("Failed to read current daily note, check if it exists."))}constX=awaitoA(S,_,$);awaitr.modify(z,X.content);constQ=X.posNum===-1?iA(X.content).length-(_.split(`
`+T:" "}${p}`,k=Zu(),R=ub(I,k),L="fake"+ut.randomId(16);letH=!1;constU=n.plugins.getPlugin("templater-obsidian");letz;if(R?z=R:(U!=null&&U.templater&&(U!=null&&U.settings.trigger_on_file_creation)&&(be.setWaitingForTemplater({origin:e.content,date:I,isList:e.thinoType&&e.thinoType==="JOURNAL",id:L,type:"web"}),H=!0),z=awaitut.createDailyNoteCheck(I)),!z){newC.Notice(E("Failed to create daily note, check if it exists.")),newC.Notice(E("Your content has been copied to clipboard, and inserted into the editor. Please try it again")),awaitnavigator.clipboard.writeText(e.content);constue=n.workspace.getLeavesOfType("thino_view").first();n.workspace.trigger("send-to-thino",e.content,ue);return}if(R||awaitft.fechLocalDailyNotes(),U&&(U!=null&&U.templater)&&(U!=null&&U.settings.trigger_on_file_creation)&&H)returndt.setChangedByMemos(!0),{id:L,content:e.content,deletedAt:e.deletedAt??"",createdAt:I.format("YYYY/MM/DD HH:mm:ss"),updatedAt:I.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:z.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.webId||e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY"};let$="";try{$=awaitt.read(z)||awaitt.cachedRead(z)}catch(ue){console.error(ue),newC.Notice(E("Failed to read current daily note, check if it exists."))}constX=c==="end"?"":e.thinoType&&i&&l||a,Q=awaitoA(X,_,$);awaitt.modify(z,Q.content);constse=Q.posNum===-1?iA(Q.content).length-1:Q.posNum+1;returndt.setChangedByMemos(!0),{id:I.format("YYYYMMDDHHmm")+"00"+se,content:e.content,deletedAt:e.deletedAt??"",createdAt:I.format("YYYY/MM/DD HH:mm:ss"),updatedAt:I.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:z.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}asyncfunctionoA(e,t,n){constr=newRegExp(`(s*?)${awaitYR(e)}(s*?)`),a=UR(n),o=a.findIndex(f=>r.test(f)),i=(e==null?void0:e.trim())===""?!0:o===-1;i&&console.error("unable to find insert after line in file.");constl=a.slice(o+1).findIndex(f=>/(^#+|---|^\^[a-zA-Z0-9-]{2,}$)/.test(f)),c=l!==-1;if(c){letf;for(letp=l+o;p>o;p--)if(!/^[\s\n ]*$/.test(a[p])){f=p;break}returnf||(f=o),awaitNx(t,n,i?-1:f,c)}elsereturnawaitNx(t,n,a.length-1,c)}asyncfunctionNx(e,t,n,r){if(n<-1)thrownewError("Invalid position");if(n===-1)return{content:`${t}
`:"")+i}`,posNum:n}}constiA=e=>e.split(/\r?\n/);asyncfunction$R(e){constt=Le.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(ninstanceofC.TFile)){newC.Notice(E("File not found for the given thino path"));return}awaitt.vault.delete(n)}asyncfunctionZR(e){constt=Le.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(ninstanceofC.TFile)){newC.Notice(E("File not found for the given thino path"));return}consta=(awaitt.vault.read(n)).split(`
`),o=a.findIndex(c=>c.includes(e.id));if(o===-1){new C.Notice(E("Thino not found"));return}const i=a.findIndex((c,f)=>f>o&&c.trim()==="");i===-1?a.splice(o,a.length-o):a.splice(o,i-o);const l=a.join(`
`);if(!l){new C.Notice(E("Thino not found"));return}dt.setChangedByMemos(!0),await t.vault.modify(n,l)}async function qR(e){const t=Le.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new C.Notice(E("File not found for the given thino path"));return}const r=await t.vault.read(n),a=JSON.parse(r),o=a.nodes,i=o.findIndex(p=>p.id===e.id);if(i===-1){new C.Notice(E("Thino not found"));return}o.splice(i,1);const l=a.edges;l.filter(p=>p.fromNode===e.id||p.toNode===e.id).forEach(p=>{const g=l.findIndex(y=>y.id===p.id);g!==-1&&l.splice(g,1)}),dt.setChangedByMemos(!0);const f=JSON.stringify(a,null,2);await t.vault.modify(n,f)}async function GR(e){tA()||new C.Notice(E("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."),5e3);const{vault:t,metadataCache:n}=Le.getState().dailyNotesState.app,r=e.path,a=t.getAbstractFileByPath(r);if(!a){new C.Notice(E("Please check your daily note plugin OR periodic notes plugin settings"));return}const o=await t.read(a),i=o.split(`
`),l=n.getFileCache(a),c=(l==null?void 0:l.listItems)||[],f=parseInt(e.id.slice(14));let p=f;function g(S,I){const M=[];for(const N in I)I[N]===S&&M.push(parseInt(N),...g(parseInt(N),I));return M}const y=D2(c),w=c.find(S=>S.position.start.line===f),T=g(f,y);if(T.length>0){const S=T.map(I=>{const M=c.find(N=>N.position.start.line===I);return M?M.position.end.line:-1});p=Math.max(...S,w.position.end.line)}else p=w.position.end.line;if(!o){new C.Notice(E("Thino not found"));return}dt.setChangedByMemos(!0),i.splice(f,p-f+1),await t.modify(a,i.join(`
`);return await n.modify(r,I),dt.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:C.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?t.pinned:e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?a.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Ll(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=Le.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=await n.read(r),o=JSON.parse(a),i=o.nodes.find(f=>f.id===e.id);if(!i)return e;t.content&&(i.text=t.content),t.thinoType&&(i.thinoType=t.thinoType),t.rowStatus&&(i.rowStatus=t.rowStatus),t.visibility&&(i.visibility=t.visibility),t.pinned!==void 0&&(i.pinned=t.pinned),t.webId&&(i.webId=t.webId);const l=C.moment();t.deleted!==void 0&&(i.deletedAt=t.deleted?l.format("YYYY/MM/DD HH:mm:ss"):""),i.updatedAt=l.format("YYYY/MM/DD HH:mm:ss");const c=JSON.stringify(o,null,2);return await n.modify(r,c),dt.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:C.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?l.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Rl(e,t){var se;tA()||new C.Notice(E("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."));const{vault:n,metadataCache:r}=Le.getState().dailyNotesState.app,a=Le.getState().dailyNotesState.app,{settings:o}=Le.getState().dailyNotesState,i=e.id.toString().slice(0,14),l=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(C.moment(i,"YYYYMMDDHHmmss"))?C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):C.moment(i,"YYYYMMDDHHmmss"),c=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(l,"day"),f=e.path,p=n.getAbstractFileByPath(f)||n.getAbstractFileByPath(e.path);if(!p)return new C.Notice(E("Please check your daily note plugin OR periodic notes plugin settings")),e;const y=(await n.read(p)).split(`
`),w=r.getFileCache(p),T=(w==null?void 0:w.listItems)||[];if(T.length===0)return new C.Notice(E("Thino not found")),e;const S=parseInt(e.id.slice(14));let I=S;function M(ue,fe){const Z=[];for(const pe in fe)fe[pe]===ue&&Z.push(parseInt(pe),...M(parseInt(pe),fe));return Z}const N=D2(T),_=T.find(ue=>ue.position.start.line===S);if(!_)return new C.Notice(E("Thino not found")),e;const k=M(S,N);if(k.length>0){const ue=k.map(fe=>{const Z=T.find(pe=>pe.position.start.line===fe);return Z?Z.position.end.line:-1});I=Math.max(...ue,_.position.end.line)}else I=_.position.end.line;const R=y.slice(S,I+1);let L=R.join(`
`].join("");var Ce}function Ze(te){return te.flags!==void 0?te.flags:[te.global?"g":"",te.ignoreCase?"i":"",te.multiline?"m":"",te.unicode?"u":"",te.sticky?"y":""].join("")}function st(){for(var te=[].slice.call(arguments),me=te.length,Ce=0;Ce<me;Ce+=1)Q(te[Ce]);return o(function(Ye,He){for(var Ke,et=new Array(me),kt=0;kt<me;kt+=1){if(!(Ke=z(te[kt]._(Ye,He),Ke)).status)return Ke;et[kt]=Ke.value,He=Ke.index}return z(H(He,et),Ke)})}function xt(){var te=[].slice.call(arguments);if(te.length===0)throw new Error("seqMap needs at least one argument");var me=te.pop();return fe(me),st.apply(null,te).map(function(Ce){return me.apply(null,Ce)})}function tn(){var te=[].slice.call(arguments),me=te.length;if(me===0)return Tt("zero alternates");for(var Ce=0;Ce<me;Ce+=1)Q(te[Ce]);return o(function(Ye,He){for(var Ke,et=0;et<te.length;et+=1)if((Ke=z(te[et]._(Ye,He),Ke)).status)return Ke;return Ke})}function _e(te,me){return Xe(te,me).or(St([]))}function Xe(te,me){return Q(te),Q(me),xt(te,me.then(te).many(),function(Ce,Ye){return[Ce].concat(Ye)})}function tt(te){Z(te);var me="'"+te+"'";return o(function(Ce,Ye){var He=Ye+te.length,Ke=Ce.slice(Ye,He);return Ke===te?H(He,Ke):U(Ye,me)})}function ht(te,me){(function(He){if(!(He instanceof RegExp))throw new Error("not a regexp: "+He);for(var Ke=Ze(He),et=0;et<Ke.length;et++){var kt=Ke.charAt(et);if(kt!=="i"&&kt!=="m"&&kt!=="u"&&kt!=="s")throw new Error('unsupported regexp flag "'+kt+'": '+He)}})(te),arguments.length>=2?ue(me):me=0;var Ce=function(He){return RegExp("^(?:"+He.source+")",Ze(He))}(te),Ye=""+te;return o(function(He,Ke){var et=Ce.exec(He.slice(Ke));if(et){if(0<=me&&me<=et.length){var kt=et[0],Yt=et[me];return H(Ke+kt.length,Yt)}return U(Ke,"valid match group (0 to "+et.length+") in "+Ye)}return U(Ke,Ye)})}function St(te){return o(function(me,Ce){return H(Ce,te)})}function Tt(te){return o(function(me,Ce){return U(Ce,te)})}function Gt(te){if(k(te))return o(function(me,Ce){var Ye=te._(me,Ce);return Ye.index=Ce,Ye.value="",Ye});if(typeof te=="string")return Gt(tt(te));if(te instanceof RegExp)return Gt(ht(te));throw new Error("not a string, regexp, or parser: "+te)}function _t(te){return Q(te),o(function(me,Ce){var Ye=te._(me,Ce),He=me.slice(Ce,Ye.index);return Ye.status?U(Ce,'not "'+He+'"'):H(Ce,null)})}function Vt(te){return fe(te),o(function(me,Ce){var Ye=se(me,Ce);return Ce<me.length&&te(Ye)?H(Ce+1,Ye):U(Ce,"a character/byte matching "+te)})}function Xt(te,me){arguments.length<2&&(me=te,te=void 0);var Ce=o(function(Ye,He){return Ce._=me()._,Ce._(Ye,He)});return te?Ce.desc(te):Ce}function dn(){return Tt("fantasy-land/empty")}i.parse=function(te){if(typeof te!="string"&&!L(te))throw new Error(".parse must be called with a string or Buffer as its argument");var me,Ce=this.skip(Er)._(te,0);return me=Ce.status?{status:!0,value:Ce.value}:{status:!1,index:X(te,Ce.furthest),expected:Ce.expected},delete $[te],me},i.tryParse=function(te){var me=this.parse(te);if(me.status)return me.value;var Ce=Qe(te,me),Ye=new Error(Ce);throw Ye.type="ParsimmonError",Ye.result=me,Ye},i.assert=function(te,me){return this.chain(function(Ce){return te(Ce)?St(Ce):Tt(me)})},i.or=function(te){return tn(this,te)},i.trim=function(te){return this.wrap(te,te)},i.wrap=function(te,me){return xt(te,this,me,function(Ce,Ye){return Ye})},i.thru=function(te){return te(this)},i.then=function(te){return Q(te),st(this,te).map(function(me){return me[1]})},i.many=function(){var te=this;return o(function(me,Ce){for(var Ye=[],He=void 0;;){if(!(He=z(te._(me,Ce),He)).status)return z(H(Ce,Ye),He);if(Ce===He.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");Ce=He.index,Ye.push(He.value)}})},i.tieWith=function(te){return Z(te),this.map(function(me){if(function(He){if(!R(He))throw new Error("not an array: "+He)}(me),me.length){Z(me[0]);for(var Ce=me[0],Ye=1;Ye<me.length;Ye++)Z(me[Ye]),Ce+=te+me[Ye];return Ce}return""})},i.tie=function(){return this.tieWith("")},i.times=function(te,me){var Ce=this;return arguments.length<2&&(me=te),ue(te),
`),jr=tt(`\r
`),nr=tn(jr,ha,fr).desc("newline"),Lr=tn(nr,Er);o.all=kn,o.alt=tn,o.any=Zn,o.cr=fr,o.createLanguage=function(te){var me={};for(var Ce in te)({}).hasOwnProperty.call(te,Ce)&&function(Ye){me[Ye]=Xt(function(){return te[Ye](me)})}(Ce);return me},o.crlf=jr,o.custom=function(te){return o(te(H,U))},o.digit=pt,o.digits=Mt,o.empty=dn,o.end=Lr,o.eof=Er,o.fail=Tt,o.formatError=Qe,o.index=en,o.isParser=k,o.lazy=Xt,o.letter=Jt,o.letters=on,o.lf=ha,o.lookahead=Gt,o.makeFailure=U,o.makeSuccess=H,o.newline=nr,o.noneOf=function(te){return Vt(function(me){return te.indexOf(me)<0}).desc("none of '"+te+"'")},o.notFollowedBy=_t,o.of=St,o.oneOf=function(te){for(var me=te.split(""),Ce=0;Ce<me.length;Ce++)me[Ce]="'"+me[Ce]+"'";return Vt(function(Ye){return te.indexOf(Ye)>=0}).desc(me)},o.optWhitespace=ln,o.Parser=o,o.range=function(te,me){return Vt(function(Ce){return te<=Ce&&Ce<=me}).desc(te+"-"+me)},o.regex=ht,o.regexp=ht,o.sepBy=_e,o.sepBy1=Xe,o.seq=st,o.seqMap=xt,o.seqObj=function(){for(var te,me={},Ce=0,Ye=(te=arguments,Array.prototype.slice.call(te)),He=Ye.length,Ke=0;Ke<He;Ke+=1){var et=Ye[Ke];if(!k(et)){if(R(et)&&et.length===2&&typeof et[0]=="string"&&k(et[1])){var kt=et[0];if(Object.prototype.hasOwnProperty.call(me,kt))throw new Error("seqObj: duplicate key "+kt);me[kt]=!0,Ce++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(Ce===0)throw new Error("seqObj expects at least one named parser, found zero");return o(function(Yt,On){for(var vn,xr={},Jn=0;Jn<He;Jn+=1){var yr,ta;if(R(Ye[Jn])?(yr=Ye[Jn][0],ta=Ye[Jn][1]):(yr=null,ta=Ye[Jn]),!(vn=z(ta._(Yt,On),vn)).status)return vn;yr&&(xr[yr]=vn.value),On=vn.index}return z(H(On,xr),vn)})},o.string=tt,o.succeed=St,o.takeWhile=function(te){return fe(te),o(function(me,Ce){for(var Ye=Ce;Ye<me.length&&te(se(me,Ye));)Ye++;return H(Ye,me.slice(Ce,Ye))})},o.test=Vt,o.whitespace=vr,o["fantasy-land/empty"]=dn,o["fantasy-land/of"]=St,o.Binary={bitSeq:w,bitSeqObj:function(te){y();var me={},Ce=0,Ye=f(function(Ke){if(R(Ke)){var et=Ke;if(et.length!==2)throw new Error("["+et.join(", ")+"] should be length 2, got length "+et.length);if(Z(et[0]),ue(et[1]),Object.prototype.hasOwnProperty.call(me,et[0]))throw new Error("duplicate key in bitSeqObj: "+et[0]);return me[et[0]]=!0,Ce++,et}return ue(Ke),[null,Ke]},te);if(Ce<1)throw new Error("bitSeqObj expects at least one named pair, got ["+te.join(", ")+"]");var He=f(function(Ke){return Ke[0]},Ye);return w(f(function(Ke){return Ke[1]},Ye)).map(function(Ke){return c(function(et,kt){return kt[0]!==null&&(et[kt[0]]=kt[1]),et},{},f(function(et,kt){return[et,Ke[kt]]},He))})},byte:function(te){if(y(),ue(te),te>255)throw new Error("Value specified to byte constructor ("+te+"=0x"+te.toString(16)+") is larger in value than a single byte.");var me=(te>15?"0x":"0x0")+te.toString(16);return o(function(Ce,Ye){var He=se(Ce,Ye);return He===te?H(Ye+1,He):U(Ye,me)})},buffer:function(te){return T("buffer",te).map(function(me){return Buffer.from(me)})},encodedString:function(te,me){return T("string",me).map(function(Ce){return Ce.toString(te)})},uintBE:I,uint8BE:I(1),uint16BE:I(2),uint32BE:I(4),uintLE:M,uint8LE:M(1),uint16LE:M(2),uint32LE:M(4),intBE:N,int8BE:N(1),int16BE:N(2),int32BE:N(4),intLE:_,int8LE:_(1),int16LE:_(2),int32LE:_(4),floatBE:T("floatBE",4).map(function(te){return te.readFloatBE(0)}),floatLE:T("floatLE",4).map(function(te){return te.readFloatLE(0)}),doubleBE:T("doubleBE",8).map(function(te){return te.readDoubleBE(0)}),doubleLE:T("doubleLE",8).map(function(te){return te.readDoubleLE(0)})},n.exports=o}])})})(he);var j2=()=>/(?:[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F
${o}`,posNum:n}}function xH(e,t,n){var a;const r=t.workspace.getLeavesOfType("markdown");for(const o of r){const i=o.view;if(((a=i==null?void 0:i.file)==null?void 0:a.path)===e){t.workspace.revealLeaf(o);try{return o.view.setEphemeralState({line:n}),!0}catch(l){return console.error(l),!1}}}return!1}const R2=async e=>{var o;const t=ft.getState().app,n=t.workspace.getLeavesOfType("markdown");for(const i of n){const l=i.view;if(((o=l==null?void 0:l.file)==null?void 0:o.path)===e){t.workspace.revealLeaf(i);return}}const r=t.metadataCache.getFirstLinkpathDest("",e);if(!r){new C.Notice(E("File not found for the given thino path"));return}await t.workspace.getLeaf(!0).openFile(r)},_2=async(e,t)=>{const{app:n}=ft.getState(),r=parseInt(e.slice(14));if(xH(t,n,r))return;const a=n.metadataCache.getFirstLinkpathDest("",t);if(!C.Platform.isMobile)await n.workspace.getLeaf(!0).openFile(a,{eState:{line:r}});else{let o=n.workspace.activeLeaf;o===null&&(o=n.workspace.getLeaf(!0)),await o.openFile(a,{eState:{line:r}})}},B2=async(e,t)=>{var f,p,g;const n=ft.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new C.Notice(E("File not found for the given thino path"));return}let a="";try{a=await n.vault.read(r)}catch(y){console.error(y),a=await n.vault.cachedRead(r)}const i=a.split(/\r?\n/).findIndex(y=>y.contains(e)),l=n.workspace.getLeavesOfType("markdown");for(const y of l){const w=y.view;if(((f=w==null?void 0:w.file)==null?void 0:f.path)===r.path){n.workspace.revealLeaf(y);try{(p=y.view.editor)==null||p.setCursor({line:i,ch:1});return}catch(T){console.error(T)}}}const c=n.workspace.getLeaf(!0);await c.openFile(r,{eState:{line:i}});try{(g=c.view.editor)==null||g.setCursor({line:i,ch:1})}catch(y){console.error(y)}},H2=async(e,t)=>{var l;const n=ft.getState().app,r=(c,f)=>{var g;const p=(g=Array.from(c.nodes.values()))==null?void 0:g.find(y=>y.id===f);return p?(c.selectOnly(p),c.zoomToSelection(),!0):!1},a=n.workspace.getLeavesOfType("canvas");for(const c of a){const f=c.view;if(((l=f==null?void 0:f.file)==null?void 0:l.path)===t&&(n.workspace.revealLeaf(c),r(f.canvas,e)))return}const o=n.metadataCache.getFirstLinkpathDest("",t);if(!o){new C.Notice(E("File not found for the given thino path"));return}const i=n.workspace.getLeaf(!0);await i.openFile(o),setTimeout(()=>{var c;r((c=i.view)==null?void 0:c.canvas,e)},10)};class CH{constructor(){De(this,"initialized",!1)}getState(){return Le.getState().memoState}async fetchAllMemos(){const t=ft.getState().settings;ut.checkDailyInMulti(t);const n=await Ko.getMyMemos(t.EnabledLocationList.map(o=>o.value)),r=[...n.memos],a=[...n.commentMemos];return Le.dispatch({type:"SET_MEMOS",payload:{memos:r}}),Le.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:a}}),this.initialized||(this.initialized=!0,dt.setLoaded(!0)),r}async updateTypeMemos(t){const n=await Ko.updateSpecificTypeMemo(t),r=this.getState().memos.filter(a=>a.sourceType!==t);Le.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);Le.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await Ko.getMyDeletedMemos();return t.sort((n,r)=>ut.getTimeStampByDate(r.deletedAt)-ut.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){Le.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){Le.dispatch({type:"INSERT_COMMENT_MEMO",payload:{memo:{...t}}})}getMemoById(t){for(const n of this.getState().memos)if(n.id===t)return n;return null}getCommentMemoById(t){for(const n of this.getState().commentMemos)if(n.id===t)return n;return null}getMemoByWebId(t){for(const n of this.getState().memos)if(n.webId===t||n.id===t)return n;return null}async finishWaitingForTemplaterThinos(){const t=this.getState().preparingUpdateMemo;if(t.length!==0)for(const n of t){const r=this.getMemoById(n.id),a=n.type==="local"?await gS(n.origin,n.isList,n.date):await kx(r);await this.replaceOldThinoWithNewThino(n.id,a),Le.dispatch({type:"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO",payload:{id:n.id}})}}async replaceOldThinoWithNewThi
Checkthedocumentationorcreateissueifyouthinkit's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues`))},vY=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],b0=function(t){return fY(t).map(function(n){return vY.includes(n)?"\\".concat(n):n}).join("")},yY=function(e){bb(t,e);function t(){return Ov(this,t),wb(this,vp(t).apply(this,arguments))}return yb(t,[{key:"componentDidMount",value:function(){var r=this.props.boundariesElement;if(typeof r=="string"){var a=document.querySelector(r);if(!a)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=a}else if(r instanceof HTMLElement)this.containerElem=r;else throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");if(!this.containerElem||!this.containerElem.contains(this.ref))throw new Error("RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.")}},{key:"componentDidUpdate",value:function(){var r,a,o=this.props.top||0,i=this.props.left||0,l=[],c=[],f=0,p=0,g=this.containerElem.getBoundingClientRect(),y=this.ref.getBoundingClientRect(),w=this.props.textareaRef.getBoundingClientRect(),T=window.getComputedStyle(this.ref),S=parseInt(T.getPropertyValue("margin-top"),10),I=parseInt(T.getPropertyValue("margin-bottom"),10),M=parseInt(T.getPropertyValue("margin-left"),10),N=parseInt(T.getPropertyValue("margin-right"),10),_=S+I+w.top+o+y.height,k=M+N+w.left+i+y.width;k>g.right&&w.left+i>y.width?(p=i-y.width,l.push(Hc.X.LEFT),c.push(Hc.X.RIGHT)):(p=i,l.push(Hc.X.RIGHT),c.push(Hc.X.LEFT)),_>g.bottom&&w.top+o>y.height?(f=o-y.height,l.push(Hc.Y.TOP),c.push(Hc.Y.BOTTOM)):(f=o,l.push(Hc.Y.BOTTOM),c.push(Hc.Y.TOP)),this.props.renderToBody&&(f+=w.top,p+=w.left),this.ref.style.top="".concat(f,"px"),this.ref.style.left="".concat(p,"px"),(r=this.ref.classList).remove.apply(r,c),(a=this.ref.classList).add.apply(a,l)}},{key:"render",value:function(){var r=this,a=this.props,o=a.style,i=a.className,l=a.innerRef,c=a.children,f=a.renderToBody,p=document.body,g=ne.createElement("div",{ref:function(w){r.ref=w,l(w)},className:"rta__autocomplete ".concat(i||""),style:o},c);return f&&p!==null?z2.createPortal(g,p):g}}]),t}(ne.Component),p6=function(e){bb(t,e);function t(n){var r;Ov(this,t),r=wb(this,vp(t).call(this,n)),r.state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},r.escListenerInit=function(){r.escListener||(r.escListener=lf.add(Ci.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(lf.remove(r.escListener),r.escListener=null)},r.getSelectionPosition=function(){return r.textareaRef?{selectionStart:r.textareaRef.selectionStart,selectionEnd:r.textareaRef.selectionEnd}:null},r.getSelectedText=function(){if(!r.textareaRef)return null;var c=r.textareaRef,f=c.selectionStart,p=c.selectionEnd;return f===p?null:r.state.value.substr(f,p-f)},r.setCaretPosition=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r.textareaRef&&(r.textareaRef.focus(),r.textareaRef.setSelectionRange(c,c))},r.getCaretPosition=function(){if(!r.textareaRef)return 0;var c=r.textareaRef.selectionEnd;return c},r._handleCaretChange=function(c){var f=function(){var y=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?y:0};if(c.type==="keydown"){var p=c.keyCode||c.which;switch(p){case Ci.UP:case Ci.DOWN:r._isAutocompleteOpen()||f();break;case Ci.LEFT:case Ci.RIGHT:f();break}return}f()},r._onSelect=function(c){var f=r.state,p=f.selectionEnd,g=f.currentTrigger,y=f.value,w=r.props.onItemSelected;if(g){var T=r._getTextToReplace(g);if(!T){r._closeAutocomplete();return}var S=T(c);if(!S){r._closeAutocomplete();return}w&&w({currentTrigger:g,item:c});var I=function($,X,Q){switch($){case"start":return Q;case"next":case"end":return Q+X.length;default:if(!Number.isInteger($))throw new Error('RTA:caretPositionshouldbe"start","next","end"ornumber.');return$}},M=y.slice(0,p),N=b0(g),_=M.length-M.lastIndexOf(g),k=M.search(newRegExp("(?!".concat(N,")$")
`));if(y===null)return null;if(typeof y=="string")return{text:y,caretPosition:pC};if(!y.text&&typeof y.text!="string")throw new Error('Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(c,`"
`));if(!y.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(c,`"
`));return y}if(typeof g!="string")throw new Error(`Outputitemshouldbestring
`);return{text:"".concat(c).concat(g).concat(c),caretPosition:pC}}},r._getCurrentTriggerSettings=function(){var c=r.state.currentTrigger;return c?r.props.trigger[c]:null},r._getValuesFromProvider=function(){var c=r.state,f=c.currentTrigger,p=c.actualToken,g=r._getCurrentTriggerSettings();if(!(!f||!g)){var y=g.dataProvider,w=g.component;if(typeof y!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var T=y(p);T instanceof Promise||(T=Promise.resolve(T)),T.then(function(S){if(!Array.isArray(S))throw new Error("Trigger provider has to provide an array!");if(typeof w!="function")throw new Error("Component should be defined!");if(f===r.state.currentTrigger){if(!S.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:S,component:w})}}).catch(function(S){return mC(S.message)})}},r._getSuggestions=function(){var c=r.state,f=c.currentTrigger,p=c.data;return!f||!p||p&&!p.length?null:p},r._createRegExp=function(){var c=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(c).sort(function(f,p){return f<p?1:f>p?-1:0}).map(function(f){return b0(f)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(c).sort(function(f,p){return f<p?1:f>p?-1:0}).map(function(f){return b0(f)}).join("|"),")$"))},r._closeAutocomplete=function(){var c=r.state.currentTrigger;r.escListenerDestroy(),r.setState({data:null,dataLoading:!1,currentTrigger:null},function(){c&&r._onItemHighlightedHandler(null)})},r._cleanUpProps=function(){var c=sY({},r.props),f=["loadingComponent","boundariesElement","containerStyle","minChar","scrollToItem","ref","innerRef","onChange","onCaretPositionChange","className","value","trigger","listStyle","itemStyle","containerStyle","loaderStyle","className","containerClassName","listClassName","itemClassName","loaderClassName","dropdownStyle","dropdownClassName","movePopupAsYouType","textAreaComponent","renderToBody","onItemSelected","onItemHighlighted"];for(var p in c)f.includes(p)&&delete c[p];return c},r._changeHandler=function(c){var f=r.props,p=f.trigger,g=f.onChange,y=f.minChar,w=f.onCaretPositionChange,T=f.movePopupAsYouType,S=r.state,I=S.top,M=S.left,N=c;N||(N=new oY("change",{bubbles:!0}),r.textareaRef.dispatchEvent(N));var _=N.target||r.textareaRef,k=_.selectionEnd,R=_.value;if(r.lastValueBubbledEvent=R,g&&N&&(N.persist&&N.persist(),g(new Proxy(N,{get:function(K,ae,Se){return ae==="target"?_:Reflect.get(K,ae,Se)}}))),w){var L=r.getCaretPosition();w(L)}r.setState({value:R});var H=function(){var K=nY(_,k),ae=K.top,Se=K.left;r.setState({top:ae-r.textareaRef.scrollTop||0,left:Se})},U=function(K){r.lastTrigger=k-K,r._closeAutocomplete(),H()};if(k<=r.lastTrigger){var z=R.slice(0,k),$=r.tokenRegExp.exec(z);U($?$[0].length:0)}var X=R.slice(r.lastTrigger,k),Q=r.tokenRegExp.exec(X),se=Q&&Q[0],ue=Q&&Q[1]||null,fe=ue?ue.length-1:0,Z=r.tokenRegExpEnding.exec(X);if(Z?U(Z[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!se||se.length<=y+fe)&&(r.state.currentTrigger&&!p[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(ue&&p[ue].afterWhitespace&&!/\s/.test(R[k-se.length-1])&&R[k-se.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&p[r.state.currentTrigger].allowWhitespace){if(Q=new RegExp("".concat(b0(r.state.currentTrigger),".*$")).exec(R.slice(0,k)),se=Q&&Q[0],!se){r._closeAutocomplete();return}ue=Object.keys(p).find(function(de){return de.slice(0,fe+1)===se.slice(0,fe+1)})||null}var pe=se.slice(1);if(ue){(T||I===null&&M===null||r.state.currentTrigger!==ue)&&H(),r.escListenerInit();var ie=r._getTextToReplace(ue);r.setState({selectionEnd:k,currentTrigger:ue,textToReplace:ie,actualToken:pe},function(){try{r._getValuesFromProvider()}catch(de){mC(de.message)}})}},r._selectHandler=function(c){var f=r.props,p=f.onCaretPositionChange,g=f.onSelect;if(p){var y=r.getCaretPosition();p(y)}g&&(c.persist(),g(c))},r._shouldStayOpen=function(c){var f=c.relatedTarget;return f===null&&(f=document.activeElement),!!(r.dropdownRef&&f instanceof Node&&r.dropd
`,L.current,t.path,a||e.view)}pe(),setTimeout(async()=>{await Q()},JN)},[R,L,l,M]);const Q=async()=>{R.current&&(await Exe(R.current),await HE(R.current),xxe(M).then(pe=>{pe&&setTimeout(()=>{Ib(R.current,{pixelRatio:window.devicePixelRatio*2}).then(ie=>{k(ie),f(!0)}).catch(()=>{})},600)}))},se=()=>{n()},ue=P.useCallback(pe=>{w(pe)},[y]),fe=async()=>{const{vault:pe}=Le.getState().dailyNotesState.app,ie=R.current.querySelector(".memo-shortcut-img");if(!ie)return;const de=ie==null?void 0:ie.getAttribute("src").split("base64,")[1],K=Z4(de,"image/png");let ae;K.arrayBuffer().then(async Se=>{const je="png",Re=Zu();for(const Fe in Re)if(Re[Fe]instanceof C.TFile){ae=Re[Fe];break}if(ae!==void 0){const Fe=await pe.getAvailablePathForAttachments(`PastedImage${C.moment().format("YYYYMMDDHHmmss")}`,je,ae);await pe.createBinary(Fe,Se),new C.Notice(E("Save image successfully"))}})},Z=async()=>{ue(!0);const pe=R.current.querySelector(".memo-shortcut-img");if(!pe)return;const ie=pe==null?void 0:pe.getAttribute("src").split("base64,")[1],de=Z4(ie,"image/png");if(!de){new C.Notice(E("Copy to clipboard failed"));return}const K=new ClipboardItem({"image/png":de});window.navigator.clipboard.write([K]).then(()=>{setTimeout(()=>{ue(!1)},500)}),new C.Notice(E("Copy to clipboard successfully"))};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:ar("dialog-header-container"),children:[v.jsxs("p",{className:"title-text",children:[v.jsx("span",{className:"icon-text",children:"🥰"}),E("Share Memo Image")]}),v.jsxs("div",{className:"btn-group",children:[C.Platform.isMobile&&v.jsx("button",{ref:I,className:"btn download-btn",onClick:fe}),v.jsx("button",{ref:T,className:"btn copy-btn",onClick:Z}),v.jsx("button",{ref:S,className:"btn close-btn",onClick:se})]})]}),v.jsxs("div",{className:ar("dialog-content-container",M),children:[v.jsx("div",{className:`tip-words-container${_?"finish":"loading"}`,children:v.jsx("p",{className:"tip-text",children:E(_?"↗Click the button to save":"Image is generating...")})}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Default sharing style")}),v.jsx("div",{className:"setting-item-description",children:E("Set the default style for sharing thino, 'Modern' by default.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsxs("select",{className:"dropdown",defaultValue:M,onChange:async pe=>{pe.currentTarget.value!==M&&(f(!1),k(""),N(pe.currentTarget.value),(o||window.app).saveLocalStorage("memoShareDialogStyle",pe.currentTarget.value),await Q())},children:[v.jsx("option",{value:"modern",children:E("Modern")}),v.jsx("option",{value:"clean",children:E("Clean")}),v.jsx("option",{value:"minimal",children:E("Minimal")}),v.jsx("option",{value:"gradient",children:E("Gradient")})]})})]}),v.jsxs("div",{className:ar("memo-container",M),ref:R,children:[v.jsx(ts,{when:_!=="",children:v.jsx("img",{className:"memo-shortcut-img",onClick:Z,src:_})}),v.jsxs("div",{className:"memo-background",children:[v.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}}),v.jsx("span",{className:"background-container"}),v.jsxs("div",{className:"thino-user-header",children:[v.jsx("div",{className:"thino-user-icon",ref:pe=>{if(i!=null&&i.MomentsIcon){pe==null||pe.empty();return}i!=null&&i.MomentsIcon||pe&&C.setIcon(pe,"Memos")},style:{backgroundImage:`url("${H}")`}}),v.jsxs("div",{className:"thino-user-info",children:[v.jsx("div",{className:"thino-user-name",children:i==null?void 0:i.UserName}),(i==null?void 0:i.MomentsQuote)&&v.jsx("div",{className:"thino-user-quote",children:i==null?void 0:i.MomentsQuote})]})]}),v.jsx("div",{ref:L,className:"memo-content-text",style:{minHeight:i.MinHeightForShare||"200px"}}),v.jsx("div",{className:"thino-time-footer",children:l.createdAt}),v.jsxs("div",{className:"watermark-container",children:[v.jsxs("span",{className:"normal-text footer-start",children:[v.jsx("div",{className:"property-social-icons"}),v.jsx("spa
`,i.current,a.path,r);const _=(R=i.current)==null?void 0:R.querySelectorAll(".internal-link");_==null||_.forEach(L=>{const H=L,U=H.getAttribute("data-href");if(!U)return;t.metadataCache.getFirstLinkpathDest(U,a.path)||L.classList.add("is-unresolved"),H.addEventListener("mouseover",$=>{$.stopPropagation(),t.workspace.trigger("hover-link",{event:$,source:"thino",hoverParent:r.containerEl,targetEl:H,linktext:U,sourcePath:H.href})})})}N()},[a.content,l]);const T=async()=>{switch(p.sourceType){case"DAILY":await _2(p.id,p.path);break;case"CANVAS":await H2(p.id,p.path);break;case"MULTI":await R2(p.path);break;case"FILE":await B2(p.id,p.path);break}},S=async()=>{if(g)try{if(n.DeleteThinoDirectly)await be.deleteMemoById(p.id);else{const N=await be.hideMemoById(p.id);N&&be.editMemo(N)}}catch(N){new C.Notice(N.message)}else y()},I=async()=>{try{const N=await be.unarchiveMemo(p);N&&be.editMemo(N),o(p.id),new C.Notice(E("RESTORE SUCCEED"))}catch(N){new C.Notice(N.message)}},M=()=>{g&&y(!1)};return v.jsxs("div",{ref:l,className:`memo-wrapper${"memos-"+p.id}`,onMouseLeave:M,children:[v.jsxs("div",{className:"memo-top-wrapper",children:[v.jsxs("span",{className:"time-text",children:[E("ARCHIVED AT")," ",p.updatedAt]}),v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{ref:N=>{N&&C.setIcon(N,"more-horizontal")},className:"btn more-action-btn"}),v.jsx("div",{className:"more-action-btns-wrapper",children:v.jsxs("div",{className:"more-action-btns-container",children:[v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:w.restore,className:"more-action-item-icon"}),v.jsx("span",{className:"btn restore-btn",onClick:I,children:E("RESTORE")})]}),v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:w.source,className:"more-action-item-icon"}),v.jsx("span",{className:"btn",onClick:T,children:E("SOURCE")})]}),v.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[v.jsx("span",{ref:w.delete,className:"more-action-item-icon"}),v.jsx("span",{className:`btndelete-btn${g?"final-confirm":""}`,onClick:S,children:E(g?"CONFIRM!":"DELETE")})]})]})})]})]}),v.jsx("div",{ref:i,className:"memo-content-text"})]})},Lu=e=>{var n;const t=new Map;for(const r of e){const a=r.path;t.has(a)||t.set(a,[]),(n=t.get(a))==null||n.push(r)}return Array.from(t).map(([r,a])=>({path:r,thinos:a}))},kxe=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:i,filter:l}=t,c=sn.getQueryById(l);return!!(r||a&&a.from<a.to||o||i||c)||c||n?e.filter(p=>{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),c){const y=JSON.parse(c.querystring);Array.isArray(y)&&(g=Bp(p,y))}if(r){const y=new Set;for(const w of Array.from(p.content.match($r)||[])){const S=w.replace($r,"$1").trim().split("/");let I="";for(const M of S)I+=M,y.add(I),I+="/"}for(const w of Array.from(p.content.match(ua)||[])){const S=w.replace(ua,"$1").trim().split("/");let I="";for(const M of S)I+=M,y.add(I),I+="/"}for(const w of Array.from(p.content.match(Wa)||[])){const S=w.replace(Wa,"$2").trim().split("/");let I="";for(const M of S)I+=M,y.add(I),I+="/"}y.has(r)||(g=!1)}return a&&a.from<a.to&&(ut.getTimeStampByDate(p.createdAt)<a.from||ut.getTimeStampByDate(p.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match($r)!==null||p.content.match(Wa)!==null||p.content.match(ua)!==null)||o==="LINKED"&&p.content.match(Cf)===null||o==="IMAGED"&&p.content.match(Mf)===null||o==="CONNECTED"&&p.content.match(nd)===null)&&(g=!1),i&&!p.content.toLowerCase().includes(i.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},Nxe=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=P.useContext(Lt),r=am(),[a,o]=P.useState([]),i=ne.useRef(null),l=ne.useRef(null);P.useEffect(()=>{l.current&&C.setIcon(l.current,"more-horizontal")},[l]),P.useEffect(()=>{const T=kxe({memos:n.filter(S=>S.rowStatus==="ARCHIVED"&&S.deletedAt===""),query:e,HideDoneTasks:!1});o(T),r.setFinish()},[n,i.current,e]);const c=P.useCallback(T=>{o(S=>S.filter(I=
`),Ie!==null&&A.push(T(""+Ie)),null;case"input":A.push(Q("input")),ct=$t=it=Ie=null;for(Ue in J)if(n.call(J,Ue)&&(Ft=J[Ue],Ft!=null))switch(Ue){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":ct=Ft;break;case"defaultValue":it=Ft;break;case"checked":$t=Ft;break;case"value":Ie=Ft;break;default:L(A,oe,Ue,Ft)}return $t!==null?L(A,oe,"checked",$t):ct!==null&&L(A,oe,"checked",ct),Ie!==null?L(A,oe,"value",Ie):it!==null&&L(A,oe,"value",it),A.push("/>"),null;case"menuitem":A.push(Q("menuitem"));for(var Ga in J)if(n.call(J,Ga)&&(Ie=J[Ga],Ie!=null))switch(Ga){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:L(A,oe,Ga,Ie)}return A.push(">"),null;case"title":A.push(Q("title")),Ie=null;for(Pn in J)if(n.call(J,Pn)&&(Ue=J[Pn],Ue!=null))switch(Pn){case"children":Ie=Ue;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:L(A,oe,Pn,Ue)}return A.push(">"),Ie;case"listing":case"pre":A.push(Q(Y)),Ue=Ie=null;for(ct in J)if(n.call(J,ct)&&(it=J[ct],it!=null))switch(ct){case"children":Ie=it;break;case"dangerouslySetInnerHTML":Ue=it;break;default:L(A,oe,ct,it)}if(A.push(">"),Ue!=null){if(Ie!=null)throw Error(t(60));if(typeof Ue!="object"||!("__html"in Ue))throw Error(t(61));J=Ue.__html,J!=null&&(typeof J=="string"&&0<J.length&&J[0]===`
`),Ie;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":A.push(Q(Y));for(var ja in J)if(n.call(J,ja)&&(Ie=J[ja],Ie!=null))switch(ja){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,Y));default:L(A,oe,ja,Ie)}return A.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return z(A,J,Y,oe);case"html":return Ne.insertionMode===0&&A.push("<!DOCTYPE html>"),z(A,J,Y,oe);default:if(Y.indexOf("-")===-1&&typeof J.is!="string")return z(A,J,Y,oe);A.push(Q(Y)),Ue=Ie=null;for(Ft in J)if(n.call(J,Ft)&&(it=J[Ft],it!=null))switch(Ft){case"children":Ie=it;break;case"dangerouslySetInnerHTML":Ue=it;break;case"style":R(A,oe,it);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:i(Ft)&&typeof it!="function"&&typeof it!="symbol"&&A.push(" ",Ft,'="',T(it),'"')}return A.push(">"),H(A,Ue,Ie),Ie}}function ue(A,Y,J){if(A.push('<!--$?--><template id="'),J===null)throw Error(t(395));return A.push(J),A.push('"></template>')}function fe(A,Y,J,oe){switch(J.insertionMode){case 0:case 1:return A.push('<div hidden id="'),A.push(Y.segmentPrefix),Y=oe.toString(16),A.push(Y),A.push('">');case 2:return A.push('<svg aria-hidden="true" style="display:none" id="'),A.push(Y.segmentPrefix),Y=oe.toString(16),A.push(Y),A.push('">');case 3:return A.push('<math aria-hidden="true" style="display:none" id="'),A.push(Y.segmentPrefix),Y=oe.toString(16),A.push(Y),A.push('">');case 4:return A.push('<table hidden id="'),A.push(Y.segmentPrefix),Y=oe.toString(16),A.push(Y),A.push('">');case 5:return A.push('<table hidden><tbody id="'),A.push(Y.segmentPrefix),Y=oe.toString(16),A.push(Y),A.push('">');case 6:return A.push('<table hidden><tr id="'),A.push(Y.segmentPrefix),Y=oe.toString(16),A.push(Y),A.push('">');case 7:return A.push('<table hidden><colgroup id="'),A.push(Y.segmentPrefix),Y=oe.toString(16),A.push(Y),A.push('">');default:throw Error(t(397))}}function Z(A,Y){switch(Y.insertionMode){case 0:case 1:return A.push("</div>");case 2:return A.push("</svg>");case 3:return A.push("</math>");case 4:return A.push("</table>");case 5:return A.push("</tbody></table>");case 6:return A.push("</tr></table>");case 7:return A.push("</colgroup></table>");default:throw Error(t(397))}}var pe=/[<\u2028\u2029]/g;function ie(A){return JSON.stringify(A).replace(pe,function(Y){switch(Y){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function de(A,Y){return Y=Y===void 0?"":Y,{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:Y+"P:",segmentPrefix:Y+"S:",boundaryPrefix:Y+"B:",idPrefix:Y,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:A}}function K(A,Y,J,oe){return J.generateStaticMarkup?(A.push(T(Y)),!1):(Y===""?A=oe:(oe&&A.push("<!-- -->"),A.push(T(Y)),A=!0),A)}var ae=Object.assign,Se=Symbol.for("react.element"),je=Symbol.for("react.portal"),Re=Symbol.for("react.fragment"),Fe=Symbol.for("react.strict_mode"),Be=Symbol.for("react.profiler"),Qe=Symbol.for("react.provider"),Ze=Symbol.for("react.context"),st=Symbol.for("react.forward_ref"),xt=Symbol.for("react.suspense"),tn=Symbol.for("react.suspense_list"),_e=Symbol.for("react.memo"),Xe=Symbol.for("react.lazy"),tt=Symbol.for("react.scope"),ht=Symbol.for("react.debug_trace_mode"),St=Symbol.for("react.legacy_hidden"),Tt=Symbol.for("react.default_value"),Gt=Symbol.iterator;function _t(A){if(A==null)return null;if(typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case Re:return"Fragment";case je:return"Portal";case Be:return"Profiler";case Fe:return"StrictMode";case xt:return"Suspense";ca
`),Xt=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,dn=new Map;function en(F){var B=dn.get(F);if(B===void 0){if(!Xt.test(F))throw Error(t(65,F));B=f("<"+F),dn.set(F,B)}return B}var Zn=f("<!DOCTYPE html>");function kn(F,B,q,re,Ae){switch(B){case"select":F.push(en("select"));var Ee=null,Ve=null;for(Rt in q)if(g.call(q,Rt)){var at=q[Rt];if(at!=null)switch(Rt){case"children":Ee=at;break;case"dangerouslySetInnerHTML":Ve=at;break;case"defaultValue":case"value":break;default:Xe(F,re,Rt,at)}}return F.push(tt),St(F,Ve,Ee),Ee;case"option":Ve=Ae.selectedValue,F.push(en("option"));var It=at=null,Kt=null,Rt=null;for(Ee in q)if(g.call(q,Ee)){var Hn=q[Ee];if(Hn!=null)switch(Ee){case"children":at=Hn;break;case"selected":Kt=Hn;break;case"dangerouslySetInnerHTML":Rt=Hn;break;case"value":It=Hn;default:Xe(F,re,Ee,Hn)}}if(Ve!=null)if(q=It!==null?""+It:Tt(at),$(Ve)){for(re=0;re<Ve.length;re++)if(""+Ve[re]===q){F.push(Gt);break}}else""+Ve===q&&F.push(Gt);else Kt&&F.push(Gt);return F.push(tt),St(F,Rt,at),at;case"textarea":F.push(en("textarea")),Rt=Ve=Ee=null;for(at in q)if(g.call(q,at)&&(It=q[at],It!=null))switch(at){case"children":Rt=It;break;case"value":Ee=It;break;case"defaultValue":Ve=It;break;case"dangerouslySetInnerHTML":throw Error(t(91));default:Xe(F,re,at,It)}if(Ee===null&&Ve!==null&&(Ee=Ve),F.push(tt),Rt!=null){if(Ee!=null)throw Error(t(92));if($(Rt)&&1<Rt.length)throw Error(t(93));Ee=""+Rt}return typeof Ee=="string"&&Ee[0]===`
`&&F.push(Vt),Ee!==null&&F.push(c(H(""+Ee))),null;case"input":F.push(en("input")),It=Rt=at=Ee=null;for(Ve in q)if(g.call(q,Ve)&&(Kt=q[Ve],Kt!=null))switch(Ve){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":It=Kt;break;case"defaultValue":at=Kt;break;case"checked":Rt=Kt;break;case"value":Ee=Kt;break;default:Xe(F,re,Ve,Kt)}return Rt!==null?Xe(F,re,"checked",Rt):It!==null&&Xe(F,re,"checked",It),Ee!==null?Xe(F,re,"value",Ee):at!==null&&Xe(F,re,"value",at),F.push(ht),null;case"menuitem":F.push(en("menuitem"));for(var oa in q)if(g.call(q,oa)&&(Ee=q[oa],Ee!=null))switch(oa){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:Xe(F,re,oa,Ee)}return F.push(tt),null;case"title":F.push(en("title")),Ee=null;for(Hn in q)if(g.call(q,Hn)&&(Ve=q[Hn],Ve!=null))switch(Hn){case"children":Ee=Ve;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:Xe(F,re,Hn,Ve)}return F.push(tt),Ee;case"listing":case"pre":F.push(en(B)),Ve=Ee=null;for(It in q)if(g.call(q,It)&&(at=q[It],at!=null))switch(It){case"children":Ee=at;break;case"dangerouslySetInnerHTML":Ve=at;break;default:Xe(F,re,It,at)}if(F.push(tt),Ve!=null){if(Ee!=null)throw Error(t(60));if(typeof Ve!="object"||!("__html"in Ve))throw Error(t(61));q=Ve.__html,q!=null&&(typeof q=="string"&&0<q.length&&q[0]===`
`&&F.push(Vt),Ee;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":F.push(en(B));for(var Ka in q)if(g.call(q,Ka)&&(Ee=q[Ka],Ee!=null))switch(Ka){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,B));default:Xe(F,re,Ka,Ee)}return F.push(ht),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return _t(F,q,B,re);case"html":return Ae.insertionMode===0&&F.push(Zn),_t(F,q,B,re);default:if(B.indexOf("-")===-1&&typeof q.is!="string")return _t(F,q,B,re);F.push(en(B)),Ve=Ee=null;for(Kt in q)if(g.call(q,Kt)&&(at=q[Kt],at!=null))switch(Kt){case"children":Ee=at;break;case"dangerouslySetInnerHTML":Ve=at;break;case"style":Ze(F,re,at);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:S(Kt)&&typeof at!="function"&&typeof at!="symbol"&&F.push(st,c(Kt),xt,c(H(at)),tn)}return F.push(tt),St(F,Ve,Ee),Ee}}var Er=f("</"),pt=f(">"),Mt=f('<template id="'),Jt=f('"></template>'),on=f("<!--$-->"),ln=f('<!--$?--><template id="'),vr=f('"></template>'),fr=f("<!--$!-->"),ha=f("<!--/$-->"),jr=f("<template"),nr=f('"'),Lr=f(' data-dgst="');f(' data-msg="'),f(' data-stck="');var te=f("></template>");function me(F,B,q){if(a(F,ln),q===null)throw Error(t(395));return a(F,q),o(F,vr)}var Ce=f('<div hidden id="'),Ye=f('">'),He=f("</div>"),Ke=f('<svg aria-hidden="true" style="display:none" id="'),et=f('">'),kt=f("</svg>"),Yt=f('<math aria-hidden="true" style="display:none" id="'),On=f('">'),vn=f("</math>"),xr=f('<table hidden id="'),Jn=f('">'),yr=f("</table>"),ta=f('<table hidden><tbody id="'),Pi=f('">'),Nn=f("</tbody></table>"),Aa=f('<table hidden><tr id="'),Fa=f('">'),Zr=f("</tr></table>"),fo=f('<table hidden><colgroup id="'),Oa=f('">'),ru=f("</colgroup></table>");function si(F,B,q,re){switch(q.insertionMode){case 0:case 1:return a(F,Ce),a(F,B.segmentPrefix),a(F,c(re.toString(16))),o(F,Ye);case 2:return a(F,Ke),a(F,B.segmentPrefix),a(F,c(re.toString(16))),o(F,et);case 3:return a(F,Yt),a(F,B.segmentPrefix),a(F,c(re.toString(16))),o(F,On);case 4:return a(F,xr),a(F,B.segmentPrefix),a(F,c(re.toString(16))),o(F,Jn);case 5:return a(F,ta),a(F,B.segmentPrefix),a(F,c(re.toString(16))),o(F,Pi);case 6:return a(F,Aa),a(F,B.segmentPrefix),a(F,c(re.toString(16))),o(F,Fa);case 7:return a(F,fo),a(F,B.segmentPrefix),a(F,c(re.toString(16))),o(F,Oa);default:throw Error(t(397))}}function li(F,B){switch(B.insertionMode){case 0:case 1:return o(F,He);case 2:return o(F,kt);case 3:return o(F,vn);case 4:return o(F,yr);case 5:return o(F,Nn);case 6:return o(F,Zr);case 7:return o(F,ru);default:throw Error(t(397))}}var Xu=f('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),au=f('$RS("'),us=f('","'),ji=f('")<\/script>'),cs=f('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),ou=f('$RC("'),ds=f('","'),ec=f('")<\/script>'),An=f('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),na=f('$RX("'),Zs=f('"'),qs=f(")<\/script>"),ui=f(","),iu=/[<\u2028\u2029]/g;function Fo(F){return JSON.stringify(F).replace(iu,function(B){switch(B){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no
`,o.current,t.path,I);const N=(_=o.current)==null?void 0:_.querySelectorAll(".internal-link");N==null||N.forEach(k=>{const R=k,L=R.getAttribute("data-href");if(!L)return;r.app.metadataCache.getFirstLinkpathDest(L,t.path)||k.classList.add("is-unresolved"),R.addEventListener("mouseover",U=>{U.stopPropagation(),r.app.workspace.trigger("hover-link",{event:U,source:"thino",hoverParent:I.containerEl,targetEl:R,linktext:L,sourcePath:R.href})})})}M()},[t.content,i]);const y=async()=>{if(f)try{await be.deleteMemoById(a.id),n(a.id)}catch(I){new C.Notice(I.message)}else p()},w=async()=>{switch(a.sourceType){case"DAILY":await _2(a.id,a.path);break;case"CANVAS":await H2(a.id,a.path);break;case"MULTI":await R2(a.path);break;case"FILE":await B2(a.id,a.path);break}},T=async()=>{try{const I=await be.restoreMemoById(a.id),M=r.app,N=M==null?void 0:M.loadLocalStorage("tokenForSync");I&&I.webId&&N&&r.settings.startSync&&await Zg(I.webId),I&&be.editMemo(I),n(a.id),new C.Notice(E("RESTORE SUCCEED"))}catch(I){new C.Notice(I.message)}},S=()=>{f&&p(!1)};return v.jsxs("div",{ref:i,className:`memo-wrapper${"memos-"+a.id}`,onMouseLeave:S,children:[v.jsxs("div",{className:"memo-top-wrapper",children:[v.jsxs("span",{className:"time-text",children:[E("DELETE AT")," ",a.deletedAtStr]}),v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{ref:I=>{I&&C.setIcon(I,"more-horizontal")},className:"btn more-action-btn"}),v.jsx("div",{className:"more-action-btns-wrapper",children:v.jsxs("div",{className:"more-action-btns-container",children:[v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:g.restore,className:"more-action-item-icon"}),v.jsx("span",{className:"btn restore-btn",onClick:T,children:E("RESTORE")})]}),v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:g.source,className:"more-action-item-icon"}),v.jsx("span",{className:"btn",onClick:w,children:E("SOURCE")})]}),v.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[v.jsx("span",{ref:g.delete,className:"more-action-item-icon"}),v.jsx("span",{className:`btndelete-btn${f?"final-confirm":""}`,onClick:y,children:E(f?"CONFIRM!":"DELETE")})]})]})})]})]}),v.jsx("div",{ref:o,className:"memo-content-text",onContextMenu:I=>{I.preventDefault(),I.stopPropagation()}})]})},uCe=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:i,filter:l}=t,c=sn.getQueryById(l);return!!(r||a&&a.from<a.to||o||i||c)||c||n?e.filter(p=>{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),c){const y=JSON.parse(c.querystring);Array.isArray(y)&&(g=Bp(p,y))}if(r){const y=new Set;for(const w of Array.from(p.content.match($r)||[])){const S=w.replace($r,"$1").trim().split("/");let I="";for(const M of S)I+=M,y.add(I),I+="/"}for(const w of Array.from(p.content.match(ua)||[])){const S=w.replace(ua,"$1").trim().split("/");let I="";for(const M of S)I+=M,y.add(I),I+="/"}for(const w of Array.from(p.content.match(Wa)||[])){const S=w.replace(Wa,"$2").trim().split("/");let I="";for(const M of S)I+=M,y.add(I),I+="/"}y.has(r)||(g=!1)}return a&&a.from<a.to&&(ut.getTimeStampByDate(p.createdAt)<a.from||ut.getTimeStampByDate(p.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match($r)!==null||p.content.match(Wa)!==null||p.content.match(ua)!==null)||o==="LINKED"&&p.content.match(Cf)===null||o==="IMAGED"&&p.content.match(Mf)===null||o==="CONNECTED"&&p.content.match(nd)===null)&&(g=!1),i&&!p.content.toLowerCase().includes(i.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},cCe=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=P.useContext(Lt),r=am(),[a,o]=P.useState([]),i=ne.useRef(null),l=ne.useRef(null);P.useEffect(()=>{l.current&&C.setIcon(l.current,"more-horizontal")},[l]),P.useEffect(()=>{const w=uCe({memos:n.filter(T=>T.deletedAt!==""&&T.deletedAt),query:e,HideDoneTasks:!1});o(w),r.setFinish()},[n,i.current,e]);const c=P.useCallback(w=>{o(T=>T.filter(S=>S.id!==w))},[]),f=P.useCallback(()=>{dt.setShowSiderbarInMobileView(!0)}
`:""}${t==null?void0:t.AppendViaServer}`);constN=awaitbe.createThino({content:w,isList:f,type:M});N&&(be.pushMemo(N),ot.clearQuery()),a.statusCode=200,a.setHeader("Content-Type","application/json"),a.end(JSON.stringify({status:"success",thino:N,link:`obsidian://thino?openId=${N.id}`}))});break}case"/search":{if(r.method!=="GET"){a.statusCode=404,a.end();break}consti=o.query,{keyword:l}=i,c=be.getThinoViaKeyword(l);a.statusCode=200,a.setHeader("Content-Type","application/json");constf=JSON.stringify({status:"success",thinos:c});a.end(f);break}case"/list":{if(r.method!=="GET"){a.statusCode=404,a.end();break}const{count:i}=o.query,l=be.getState().memos.slice(0,parseInt(i));a.statusCode=200,a.setHeader("Content-Type","application/json"),a.end(JSON.stringify({status:"success",thinos:l}));break}case"/info":{if(r.method!=="GET"){a.statusCode=404,a.end();break}const{getSettings:i}=o.query;if(!i){a.statusCode=404,a.end();break}constl=ft.getState().settings;a.statusCode=200,a.setHeader("Content-Type","application/json");constc=JSON.stringify({status:"success",infoSettings:l});a.end(c);break}default:a.statusCode=404,a.end();break}}}catch(o){console.error(o),a.statusCode=500,a.end({status:"error",message:o.message})}});return{listen(r,a){try{n.listen({port:parseInt(a),host:r})}catch(o){console.error(o),newC.Notice(E("Thino - Failed to start HTTP server, please check the port is available."))}newC.Notice(`${E("Thino - Started HTTP server on port")}${a}`)},close(){n.close(),newC.Notice(E("Thino - Terminated HTTP server"))}}}const{clipboard:mr}=C.Platform.isDesktop?require("electron"):"";class$Me{constructor(){De(this,"eventListeners");this.eventListeners={}}on(t,n){this.eventListeners[t]=this.eventListeners[t]||[],this.eventListeners[t].push(n)}once(t,n){n.$emitOnce=!0,this.on(t,n)}removeListener(t,n){if(this.eventListeners[t]){constr=this.eventListeners[t].findIndex(a=>a===n);r>=0&&this.eventListeners[t].splice(r,1)}}removeAllListeners(t){this.eventListeners[t]&&(this.eventListeners[t].length=0)}emit(t,...n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r.call(this,...n),r.$emitOnce&&this.removeListener(t,r)})}}constip=new$Me;letkg=null,SN=mr==null?void0:mr.readText(),DN=mr==null?void0:mr.readImage();mr&&(mr.on=(e,t)=>(ip.on(e,t),mr),mr.once=(e,t)=>(ip.once(e,t),mr),mr.off=(e,t)=>(t?ip.removeListener(e,t):ip.removeAllListeners(e),mr),mr.startWatching=()=>(kg||(kg=setInterval(()=>{ZMe(SN,SN=mr==null?void0:mr.readText())&&ip.emit("text-changed"),qMe(DN,DN=mr==null?void0:mr.readImage())&&ip.emit("image-changed")},500)),mr),mr.stopWatching=()=>(kg&&clearInterval(kg),kg=null,mr));functionZMe(e,t){returnt&&e!==t}functionqMe(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}varkN;constQD=(kN=require("electron"))==null?void0:kN.remote;varNN,AN;constTN=(AN=(NN=require("electron"))==null?void0:NN.remote)==null?void0:AN.screen;classGMe{constructor(t,n){De(this,"isRegisted");De(this,"leaf");De(this,"clipboard");De(this,"isScreenTop",!1);De(this,"currentSplitWindow");De(this,"intervalNum");De(this,"allowsCopy",!1);De(this,"plugin");De(this,"actionEl",null);this.app=t,this.plugin=n,this.isRegisted=!1,this.leaf=null,this.clipboard=mr}asynconload(){C.Platform.isDesktop&&(this.initGlobalCopyEvents(),awaitthis.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on("quit",()=>{QD.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:"init-global-copy-events",name:E("Global copy"),callback:()=>{this.allowsCopy=!this.allowsCopy,!this.allowsCopy&&this.clipboard.stopWatching(),this.allowsCopy&&this.clipboard.startWatching(),this.leaf&&this.allowsCopy&&(this.actionEl=this.leaf.view.addAction("clipboard-x","Stop global copying",()=>{vart;this.allowsCopy=!1,this.clipboard.stopWatching(),(t=this.actionEl)==null||t.remove()}))}})}onunload(){this.isRegisted&&(QD.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally),this.clipboard.off("text-changed"),this.cli
\`\`\``),newC.Notice(E("Debug info copied to clipboard"))}catch(t){console.error(t)}}classI3eextendsC.Plugin{constructor(){super(...arguments);De(this,"settings");De(this,"settingTab");De(this,"triggerBySelf",!1);De(this,"updatedID","");De(this,"debounceTimer",0);De(this,"apiHttpServer",null);De(this,"captureService",null);De(this,"loaded",!1);De(this,"MarkdownEditor")}asynconload(){this.MarkdownEditor=T3e(this.app),awaitthis.loadSettings(),CCe(),this.registerRibbon(),awaitthis.verify();try{awaitthis.checkVersionAndShowChangeLog()}catch(n){console.error(n)}this.settingTab=newHCe(this.app,this),this.addSettingTab(this.settingTab),this.initApp(),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerLinkOpen(),this.registerCodeBlocks(),this.registerEditorContextMenu(),this.registerEditorSuggest(newICe(this.app,this)),this.registerEditorExtension([LMe]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(lo,n=>newgf(n,this))}asyncloadSettings(){this.settings=Object.assign({},Ei,awaitthis.loadData()),ft.setSettings(this.settings)}asyncsaveSettings(){awaitthis.saveData(this.settings),ft.setSettings(this.settings)}onunload(){varr;this.app.workspace.detachLeavesOfType(lo),be.clearMemos(),Le.dispatch({type:"CLEAR_MEMOS",payload:null}),Le.dispatch({type:"CLEAR_FILES",payload:null}),Le.dispatch({type:"CLEAR_VIEW",payload:null});constn=document.body.find(".dialog-wrapper");n&&((r=n.parentElement)==null||r.detach()),this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null),this.captureService&&this.captureService.onunload(),newC.Notice(E("Close Memos Successfully"))}initEditor(){this.register(ww(C.MetadataCache.prototype,{getFileCache:n=>function(r){return!(r!=null&&r.path)&&!r?null:n.call(this,r)}}))}initApp(){ft.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler("thino",asyncn=>{vari,l,c;if(!n)return;if(n.openSettings&&(this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||"obsidian-memos")),n.userid)try{constf=n.userid;BMe(f,this.app),HMe(C.moment().add(30,"days").valueOf(),this.app),dt.setRefresh(!0)}catch(f){console.error(f),newC.Notice(E("Failed to verify"))}if(n.token)try{constf=n.token;(i=this.app)==null||i.saveLocalStorage("tokenForSync",f),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||"obsidian-memos"),this.settingTab.display()},200),newC.Notice(E("Saved sync token successfully"))}catch(f){console.error(f),newC.Notice(E("Failed to save"))}if(n.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??"obsidian-memos");constf=awaitZO();awaitnavigator.clipboard.writeText(f),newC.Notice(E("Copied app id successfully"))}constr=(l=ft.getState())==null?void0:l.verifyState,a=!C.Platform.isDesktop&&await((c=window.Capacitor)==null?void0:c.Plugins.Device.getId()),o=C.Platform.isDesktop?awaitcr():a.identifier||a.uuid;if(!(!r||(r==null?void0:r.appId)!==o)){if(n.content){constf=n.type,p=decodeURI(n.content)!==n.content?decodeURI(n.content):n.content,g=n.task,y=awaitbe.createThino({content:p,type:f,isList:!!g});if(!y)return;be.pushMemo(y),ot.clearQuery()}n.openId&&awaitbe.openThinoByID(n.openId)}})}initGlobalManifest(){dt.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null)}asyncstopEnableList(){varo,i;constn=(o=ft.getState())==null?void0:o.verifyState,r=!C.Platform.isDesktop&&await((i=window.Capacitor)==null?void0:i.Plugins.Device.getId()),a=C.Platform.isDesktop?awaitcr():r.identifier||r.uuid;if(!n||(n==null?void0:n.appId)!==a){this.settings.EnabledLocationList=[{value:"DAILY",target:"ProcessEntriesBelow",insert:"InsertAfter"}],this.settingTab.debounceApplySettingsUpdate();return}}asyncinitServer(){varo,i;if(C.Platform.isMobile||!this.settings.EnabledHttpApi)return;constn=(o=ft.getState())==null?void0:o.verifyState,r=!C.Platform.isDesktop&&await((i=window.Capacitor)==null?v
`);try{await MN(this.app,this.settings,async(l,c)=>{i=l+i+c;const f=await be.createThino({content:i,type:this.settings.MemoSaveLocation||"DAILY",isList:!0});be.pushMemo(f)})}catch(l){console.error("Configuration failed:",l);return}})})})))}registerCommands(){K0.forEach(n=>{this.addCommand({id:n.id,name:n.name,callback:()=>this.openMemos(n.location,n.cb),hotkeys:[]})}),["Modern","Clean","Minimal","Gradient"].forEach(n=>{this.addCommand({id:`share-thino-via-${n.toLowerCase()}`,name:E("Share thino")+`[${E(n)}]`,editorCallback:(r,a)=>{const o=r.getSelection();if(o.length===0)return;const i={id:`temp-${Date.now()}`,content:o,createdAt:C.moment().format("YYYY-MM-DD HH:mm:ss"),updatedAt:C.moment().format("YYYY-MM-DD HH:mm:ss"),deletedAt:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",thinoType:"JOURNAL",hasId:"",linkId:"",resourceList:[],creatorName:"thino",sourceType:"DAILY",path:a.file.path};of(i,n.toLowerCase(),a)}})}),this.addCommand({id:"focus-mode",name:"Focus mode",callback:()=>{const n=document.body.hasClass("thino-focus");document.body.toggleClass("thino-focus",!n)}}),this.addCommand({id:"hide-side-bar",name:E("Toggle sidebar visibility"),callback:()=>{const n=dt.getState().isMobileView,r=document.body.hasClass("thino-hide-side-bar");document.body.toggleClass("thino-hide-side-bar",n?!1:!r)}}),this.addCommand({id:"hide-tags",name:E("Toggle tags visibility"),callback:()=>{const n=document.body.hasClass("thino-hide-tags");document.body.toggleClass("thino-hide-tags",!n)}}),this.addCommand({id:"hide-query-list",name:E("Toggle query list visibility"),callback:()=>{const n=document.body.hasClass("thino-hide-query-list");document.body.toggleClass("thino-hide-query-list",!n)}}),this.addCommand({id:"insert-task",name:E("Insert task"),checkCallback:n=>{const r=this.app.plugins.getPlugin("obsidian-tasks-plugin"),a=this.app.workspace.getLeavesOfType("thino_view").first();if(r&&a)return n||this.app.plugins.plugins["obsidian-tasks-plugin"].apiV1.createTaskLineModal().then(i=>{var c;const l=this.app.workspace.activeEditor;l&&((c=l.editor)==null||c.insertText(i))}),!0}}),this.addCommand({id:"show-thino-editor",name:E("Show thino editor"),checkCallback:n=>{if(be.initialized&&ft.initialized){if(!n){if(!ft.getState().view){new C.Notice(E("Please open thino first"));return}new q6(this.app).open()}return!0}}}),this.addCommand({id:"lock-thino",name:E("Lock thino"),checkCallback:n=>{if(this.app.workspace.getActiveViewOfType(gf)&&this.settings.needVerify)return n||dt.setLocked(!0),!0}}),this.addCommand({id:"copy-debug-info",name:E("Copy debug info"),callback:async()=>{await XE(this)}}),this.addCommand({id:"insert-editor",name:E("Insert editor"),checkCallback:n=>{const r=this.app.workspace.getActiveViewOfType(C.MarkdownView);if(r&&r.getViewType()==="markdown")return n||r.editor.replaceSelection("\n```thino\n{\neditor:false\n}\n```\n"),!0}}),this.addCommand({id:"toggle-minimal-thino",name:E("Toggle minimal mode"),callback:()=>{const n=document.body.hasClass("minimal-thino");document.body.toggleClass("minimal-thino",!n)}}),this.addCommand({id:"focus-on-thino-editor",name:E("Focus on thino editor"),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:"reinit-thino-sync",name:E("ReSync web thinos to local"),callback:()=>{Pxe(this.app)}}),this.addCommand({id:"init-thino-sync",name:E("Sync local thinos to web"),callback:async()=>{var r;if(!((r=this.app)==null?void 0:r.loadLocalStorage("tokenForSync"))){new C.Notice(E("Please input token first"));return}if(!this.settings.startSync){new C.Notice(E("Please enable sync first"));return}try{await be.initSync()}catch(a){console.error(a),new C.Notice(E("Init Failed"))}}}),this.addCommand({id:"show-daily-thino",name:E("Show daily thino"),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:"focus-on-search-bar",name:E("Focus on search bar"),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:"show-thino-in-popover",name:E("Show-thino in popover(Hover editor)"),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){await this.stopEnableList(),await t