"),e},I0=n=>{var o;let e=Array.from(n.getElementsByTagName("ul")),t=Array.from(n.getElementsByTagName("ol")),i=e.concat(t);i.forEach(a=>{a.parentElement.tagName==="LI"&&a.parentElement.replaceWith(a),a.previousElementSibling&&a.previousElementSibling.tagName==="LI"&&a.previousElementSibling.appendChild(a)});for(let a of i){let s=a.parentElement;(s==null?void 0:s.tagName)==="DIV"&&((o=s==null?void 0:s.parentElement)==null?void 0:o.tagName)==="UL"&&Lu(s),((s==null?void 0:s.tagName)==="UL"||(s==null?void 0:s.tagName)==="OL")&&(s==null?void 0:s.childNodes.length)===1&&Lu(s)}let r=Array.from(n.getElementsByTagName("li"));for(let a of r){let s=a.firstElementChild;if(s&&s.tagName==="DIV"){let l=Array.from(s.childNodes);s.replaceWith(...l)}}return n},Mu=(n,{htmlContent:e})=>{let t=e.replace(/]*>/,"").replace(/(]*)\/>/,"$1>").replace(//g,""),i=new DOMParser().parseFromString(D0(t),"text/html").getElementsByTagName("en-note").item(0),r=Nr(n).turndown(C0(I0(i))),o=new RegExp("","g");return r=r.replace(o,""),r&&r!=="undefined"?{content:r}:{content:""}};var Rf=Jr(require("crypto"));var bt=require("obsidian");var $u=(n,e)=>({createdAt:F0(n),updatedAt:L0(n),sourceUrl:P0(n),location:M0(n),reminderTime:$0(n),reminderOrder:B0(n),reminderDoneTime:U0(n),notebookName:e});var F0=n=>!B.skipCreationTime&&n.created?(0,bt.moment)(n.created).format(B.dateFormat):"",L0=n=>!B.skipUpdateTime&&n.updated?(0,bt.moment)(n.updated).format(B.dateFormat):"",P0=n=>!B.skipSourceUrl&&n["note-attributes"]?n["note-attributes"]["source-url"]:"",M0=n=>!B.skipLocation&&n["note-attributes"]&&n["note-attributes"].longitude?`${n["note-attributes"].latitude},${n["note-attributes"].longitude}`:"",$0=n=>!B.skipReminderTime&&n["note-attributes"]&&n["note-attributes"]["reminder-time"]?(0,bt.moment)(n["note-attributes"]["reminder-time"]).format(B.dateFormat):"",B0=n=>!B.skipReminderOrder&&n["note-attributes"]&&n["note-attributes"]["reminder-order"]?n["note-attributes"]["reminder-order"]:"",U0=n=>!B.skipReminderDoneTime&&n["note-attributes"]&&n["note-attributes"]["reminder-done-time"]?(0,bt.moment)(n["note-attributes"]["reminder-done-time"]).format(B.dateFormat):"",Bu=n=>({tags:j0(n)}),j0=n=>{if(!B.skipTags&&n.tag){let e=Array.isArray(n.tag)?n.tag:[n.tag],t=B.nestedTags;return e.map(r=>{let o=r.toString().replace(/^#/,"");t&&(o=o.replace(new RegExp(Cn(t.separatorInEN),"g"),t.replaceSeparatorWith));let a=t&&t.replaceSpaceWith||"-";return o=o.replace(/ /g,a),`${B.useHashTags?"#":""}${o}`}).join(" ")}return""},Ha;try{Ha=window.require("btime")}catch(n){}var Or=(n,e)=>{let t=(0,bt.moment)(e.created).valueOf();t>0&&Ha&&Ha.btime(n,t);let r=(0,bt.moment)(e.updated).valueOf()/1e3;try{K.utimesSync(n,r,r)}catch(o){}},Uu=n=>n["resource-attributes"]&&n["resource-attributes"].timestamp?(0,bt.moment)(n["resource-attributes"].timestamp):(0,bt.moment)();var ju=(n,e,t)=>{let i=n.lastIndexOf(e);return i<0?n:n.substring(0,i)+t+n.substring(i+e.length)};var Ne={mdPath:"",resourcePath:""},Dr=249,Hu=(n,e)=>ja(n,e).replace(/\s/g,"_"),qu=(n,e)=>{if(n.length<=11)throw Error("FATAL: note folder directory path exceeds the OS limitation. Please pick a destination closer to the root folder.");return`${Wa()}${q.sep}${n}`.length{let r=ke.getInstance().getNoteIdNameMapByNoteTitle(Dn(n.title))[0]||{uniqueEnd:Tn(6)};if(e.length<=11)throw Error("FATAL: note folder directory path exceeds the OS limitation. Please pick a destination closer to the root folder.");return`${t.slice(0,Dr-11)}_${r.uniqueEnd}.md`},q0=(n,e,t)=>{let i=vu(n,e,t),r=`${n}${q.sep}${Dn(i)}`;return r.lengthq0(Ne.mdPath,n,"md");var W0=n=>{K.existsSync(n)&&(K.rmSync?K.rmSync(n,{recursive:!0,force:!0}):K.rmdirSync(n,{recursive:!0})),K.mkdirSync(n)},Yu=n=>{let e=`${q.sep}${B.resourcesDir}`;return B.haveGlobalResources?`..${e}`:B.haveEnexLevelResources?`.${e}`:`.${e}${q.sep}${Hu(Ne.mdPath,n)}.resources`},qa=n=>B.haveGlobalResources?q.resolve(Ne.resourcePath,"..","..",B.resourcesDir):B.haveEnexLevelResources?Ne.resourcePath:`${Ne.resourcePath}${q.sep}${Hu(Ne.mdPath,n)}.resources`,Cr=new Map,zu=n=>{let e=qa(n);Cr.has(e)||Cr.set(e,0);let t=Cr.get(e)||0;(B.haveEnexLevelResources||B.haveGlobalResources)&&t>=1||(W0(e),Cr.set(e,t+1))},Zu=n=>{let e=n.split("@@@"),t=e.pop();return t||(t=n),{notebookName:t,notebookFolderNames:e}},Gu=n=>{if(!(n instanceof Be))throw new Error("Evernote import currently only works on desktop");let{notebookName:e}=Zu(n.basename);return{fullpath:ju(n.fullpath,n.basename,e||n.basename),basename:e}},Vu=(n,e)=>{let{notebookFolderNames:t}=Zu(n.basename);return K.mkdirSync(q.join(e.outputDir,...t),{recursive:!0}),[e.outputDir,...t].join(e.pathSeparator)},Ku=(n,e)=>{let t=n.basename;Ju(t,e)},Xu=(n,e)=>{let t=n.basename;Ju(t,e)},Ju=(n,e)=>{let t=q.isAbsolute(e.outputDir)?e.outputDir:`${process.cwd()}${q.sep}${e.outputDir}`;Ne.mdPath=`${t}${q.sep}`,Ne.resourcePath=`${t}${q.sep}${e.resourcesDir}`,e.skipEnexFileNameFromOutputPath||(Ne.mdPath=`${Ne.mdPath}${n}`,Ne.resourcePath=`${t}${q.sep}${n}${q.sep}${e.resourcesDir}`),K.mkdirSync(Ne.mdPath,{recursive:!0}),!e.haveEnexLevelResources&&!e.haveGlobalResources&&K.mkdirSync(Ne.resourcePath,{recursive:!0}),console.log(`path ${Ne.mdPath} created`)},Wa=()=>Ne.mdPath;var Qu=n=>!!n.resource,ef=n=>n["note-attributes"]&&(n["note-attributes"]["source-application"]==="webclipper.evernote"||n["note-attributes"].source==="web.clip7");var Ya={};Oe(Ya,{CONTENT_PLACEHOLDER:()=>Y0,END_BLOCK:()=>Z0,START_BLOCK:()=>z0});var Y0="{content}",z0="{content-block}",Z0="{end-content-block}";var $t=({template:n,check:e,startBlockPlaceholder:t,endBlockPlaceholder:i,valuePlaceholder:r,value:o})=>{if(o&&e())return n.replace(new RegExp(`${t}`,"g"),"").replace(new RegExp(`${i}`,"g"),"").replace(new RegExp(`${r}`,"g"),o);let a=`${t}([\\d\\D])(?:.|(\r
+|\r|
+))*?(?=${i})${i}`;return n.replace(new RegExp(a,"g"),"")};var Bt=(n,e,t,i)=>({template:n,check:e,startBlockPlaceholder:t.START_BLOCK,endBlockPlaceholder:t.END_BLOCK,valuePlaceholder:t.CONTENT_PLACEHOLDER,value:i});var tf=(n,e,t)=>{let i=Bt(e,t,Ya,n.content);return $t(i)};var wi={};Oe(wi,{CONTENT_PLACEHOLDER:()=>G0,END_BLOCK:()=>K0,START_BLOCK:()=>V0});var G0="{tags}",V0="{tags-block}",K0="{end-tags-block}";var nf=(n,e,t)=>{let i=Bt(e,t,wi,n.tags);return $t(i)};var za={};Oe(za,{CONTENT_PLACEHOLDER:()=>X0,END_BLOCK:()=>Q0,START_BLOCK:()=>J0});var X0="{title}",J0="{title-block}",Q0="{end-title-block}";var rf=(n,e,t)=>{let i=Bt(e,t,za,n.title);return $t(i)};var pn={};Oe(pn,{CONTENT_PLACEHOLDER:()=>ey,END_BLOCK:()=>ny,START_BLOCK:()=>ty});var ey="{created-at}",ty="{created-at-block}",ny="{end-created-at-block}";var Te=(n,e,t)=>n.replace(new RegExp(`${e.CONTENT_PLACEHOLDER}`,"g"),t||"").replace(new RegExp(`${e.START_BLOCK}`,"g"),"").replace(new RegExp(`${e.END_BLOCK}`,"g"),"");var of=(n,e)=>Te(e,pn,n.createdAt);var un={};Oe(un,{CONTENT_PLACEHOLDER:()=>iy,END_BLOCK:()=>oy,START_BLOCK:()=>ry});var iy="{updated-at}",ry="{updated-at-block}",oy="{end-updated-at-block}";var af=(n,e)=>Te(e,un,n.updatedAt);var fn={};Oe(fn,{CONTENT_PLACEHOLDER:()=>ay,END_BLOCK:()=>ly,START_BLOCK:()=>sy});var ay="{source-url}",sy="{source-url-block}",ly="{end-source-url-block}";var sf=(n,e)=>Te(e,fn,n.sourceUrl);var dn={};Oe(dn,{CONTENT_PLACEHOLDER:()=>cy,END_BLOCK:()=>uy,START_BLOCK:()=>py});var cy="{location}",py="{location-block}",uy="{end-location-block}";var lf=(n,e)=>Te(e,dn,n.location);var mn={};Oe(mn,{CONTENT_PLACEHOLDER:()=>fy,END_BLOCK:()=>my,START_BLOCK:()=>dy});var fy="{notebook}",dy="{notebook-block}",my="{end-notebook-block}";var cf=(n,e)=>Te(e,mn,n.notebookName);var In={};Oe(In,{CONTENT_PLACEHOLDER:()=>hy,END_BLOCK:()=>yy,START_BLOCK:()=>gy});var hy="{reminder-time}",gy="{reminder-time-block}",yy="{end-reminder-time-block}";var pf=(n,e)=>Te(e,In,n.reminderTime);var Fn={};Oe(Fn,{CONTENT_PLACEHOLDER:()=>by,END_BLOCK:()=>wy,START_BLOCK:()=>xy});var by="{reminder-order}",xy="{reminder-order-block}",wy="{end-reminder-order-block}";var uf=(n,e)=>Te(e,Fn,n.reminderOrder);var Ln={};Oe(Ln,{CONTENT_PLACEHOLDER:()=>vy,END_BLOCK:()=>Ty,START_BLOCK:()=>Ey});var vy="{reminder-done-time}",Ey="{reminder-done-time-block}",Ty="{end-reminder-done-time-block}";var ff=(n,e)=>Te(e,Ln,n.reminderDoneTime);var vi={};Oe(vi,{CONTENT_PLACEHOLDER:()=>_y,END_BLOCK:()=>ky,START_BLOCK:()=>Ay});var _y="{tags-yaml-list}",Ay="{tags-yaml-list-block}",ky="{end-tags-yaml-list-block}";var df=(n,e,t)=>{let i;n.tags&&(i=`
+`+n.tags.split(" ").map(o=>` - ${o.replace(/^#/,"")}`).join(`
+`));let r=Bt(e,t,vi,i);return $t(r)};var Za="{metadata-block}",Ga="{end-metadata-block}";var mf=`\r?
+?`;var me=(n,e)=>n.replace(new RegExp(`${e.START_BLOCK}(?<=${e.START_BLOCK})(.*)(?=${e.END_BLOCK})${e.END_BLOCK}${mf}`,"g"),"");var hf=n=>me(n,pn);var gf=n=>me(n,un);var yf=n=>me(n,fn);var bf=n=>me(n,mn);var xf=n=>me(n,dn);var Ir={};Oe(Ir,{CONTENT_PLACEHOLDER:()=>Sy,END_BLOCK:()=>Oy,START_BLOCK:()=>Ry});var Sy="{link-to-original}",Ry="{link-to-original-block}",Oy="{end-link-to-original-block}";var wf=n=>me(n,Ir);var vf=n=>me(n,In);var Ef=n=>me(n,Ln);var Tf=n=>me(n,Fn);var _f=(n,e)=>{let t=e.currentTemplate;return t=rf(n,t,()=>n.title),t=nf(n,t,()=>!e.skipTags),t=df(n,t,()=>!e.skipTags),t=tf(n,t,()=>n.content),t=wf(t),t=!e.skipCreationTime&&n.createdAt?of(n,t):hf(t),t=!e.skipUpdateTime&&n.updatedAt?af(n,t):gf(t),t=!e.skipSourceUrl&&n.sourceUrl?sf(n,t):yf(t),t=!e.skipLocation&&n.location?lf(n,t):xf(t),t=e.isNotebookNameNeeded&&n.notebookName?cf(n,t):bf(t),t=!e.skipReminderTime&&n.reminderTime?pf(n,t):vf(t),t=!e.skipReminderOrder&&n.reminderOrder?uf(n,t):Tf(t),t=!e.skipReminderDoneTime&&n.reminderDoneTime?ff(n,t):Ef(t),t=t.replace(Za,"").replace(Ga,""),t};var Af=(n,e,t)=>{try{K.writeFileSync(n,e),Or(n,t)}catch(i){throw console.error("Cannot write file ",i),i}};var kf=(n,e)=>{let t=Wu(e);ke.getInstance().setCurrentNotePath(t),Af(t,n,e),console.log(`Note saved to ${t}`)};var Of=n=>{let e=new RegExp(`\\${q.sep}`,"g"),t=Yu(n).replace(e,B.pathSeparator||"/");return{absoluteResourceWorkDir:qa(n),relativeResourceWorkDir:t}},Cf=n=>{let e={},t=n.content,{absoluteResourceWorkDir:i,relativeResourceWorkDir:r}=Of(n);if(console.log(`relative resource work dir: ${r}`),console.log(`absolute resource work dir: ${i}`),zu(n),Array.isArray(n.resource))for(let o of n.resource)e={...e,...Sf(i,o)};else e={...e,...Sf(i,n.resource)};for(let o of Object.keys(e))t=Cy(t,e,o,r);return t},Cy=(n,e,t,i)=>{let r=`${i}${B.pathSeparator}${e[t].fileName.replace(/ /g," ")}`;console.log(`mediaReference src ${r} added`);let o,a=`]*)hash="${t}".([^>]*)>`,s=new RegExp(a,"g"),l=n.match(s),c=l&&l.length>0&&l[0].split("type=");if(c&&c.length>1&&c[1].startsWith('"image')){let p=l[0].match(/width="(\w+)"/),m=p?` width="${p[1]}"`:"",g=l[0].match(/height="(\w+)"/),b=g?` height="${g[1]}"`:"";o=n.replace(s,``)}else o=n.replace(s,`${e[t].fileName}`);return o},Sf=(n,e)=>{let t={},i=e.data.$text,r=Uu(e),a=wu(n,e).fileName,s=`${n}${q.sep}${a}`;console.log(e),console.log(i);let l=Buffer.from(i,"base64");K.writeFileSync(s,l);let c=r.valueOf()/1e3;try{K.utimesSync(s,c,c)}catch(p){}if(e.recognition&&a){let p=e.recognition.match(/[a-f0-9]{32}/);console.log(`resource ${a} added with hash ${p}`),t[p]={fileName:a,alreadyUsed:!1}}else{let p=Rf.default.createHash("md5");p.update(l);let m=p.digest("hex");t[m]={fileName:a,alreadyUsed:!1}}return t},Df=(n,e)=>{if(e.indexOf('src="data:')<0)return e;let{absoluteResourceWorkDir:t,relativeResourceWorkDir:i}=Of(n);return K.mkdirSync(t,{recursive:!0}),e.replace(/src="data:([^;,]*)(;base64)?,([^"]*)"/g,(r,o,a,s)=>{let l=Dy(o,a===";base64",s,t,n);return`src="${`${i}${B.pathSeparator}${l}`}"`})},Dy=(n,e,t,i,r)=>{let o="embedded",a=Iy(n)||".dat",s=xi(i,o),l=s<1?`${o}.${a}`:`${o}.${s}.${a}`,c=`${i}${q.sep}${l}`;return e||(t=decodeURIComponent(t)),K.writeFileSync(c,t,e?"base64":void 0),Or(c,r),console.log(`data url resource ${l} added`),l},Iy=n=>n.split("/").pop().split("+")[0];var If=(n,e)=>{let t=new Date;ke.getInstance().setCurrentNoteName(n.title),Array.isArray(n.content)&&(n.content=n.content.join(""));let r={title:n.title,content:n.content,htmlContent:n.content,originalContent:n.content};console.log(`Converting for note "${r.title}" started at ${t}...`);try{Qu(n)&&(r.htmlContent=Cf(n)),r.htmlContent=Df(n,r.htmlContent),r={...r,...Mu(B,r)},r={...r,...$u(n,e)},r={...r,...Bu(n)};let o=_f(r,B);kf(o,n)}catch(o){throw console.error(`Failed to convert note: ${r.title}`,o),o}finally{let o=new Date,a=(o.getTime()-t.getTime())/1e3;console.log(`Conversion for note "${r.title}" finished at ${o}. Took ${a} seconds`)}};var Pf=require("obsidian");var Ff=n=>n.taskstatus==="open"?Sr:Rr;var Fy="\u{1F53C}",Ly="\u{1F53D}",Py="\u{1F4C5}",My="\u23F3",Mf=(n,e)=>{let t=Ff(n),i=n.title?` ${n.title}`:"",r=B.obsidianTaskTag!==""?` ${B.obsidianTaskTag}`:"",o=n.duedate&&!isNaN(n.duedate.getTime())?` ${Py} ${Lf(n.duedate)}`:"",a=n.reminderdate?` ${My} ${Lf(n.reminderdate)}`:"",s=n.taskflag?` ${Fy}`:` ${Ly}`;return`${t}${r}${i}${o}${a}${s}`},Lf=n=>(0,Pf.moment)(n).format("YYYY-MM-DD").toString();var Ka=(n,e,t)=>{let i=K.readdirSync(n);return e=e||[],i.forEach(r=>{K.statSync(`${n}${q.sep}${r}`).isDirectory()?e=Ka(`${n}${q.sep}${r}`,e,t):(t&&q.extname(r)==`.${t}`||!t)&&e.push(q.join(n,"/",r))}),e};var $f=(n,e)=>{let i=ke.getInstance().getAllNoteIdNameMap(),r=Object.entries(i);if(r.length===0)return;console.log("About to update links...");let o=[];for(let a of e)Ka(a,o,"");for(let a of e){console.log(`Notebook: ${a}`);let l=K.readdirSync(a).filter(c=>q.extname(c).toLowerCase()===".md");console.log(`${l.length} files to check for links`);for(let c of l){let p=q.join(a,c),m=K.readFileSync(p,"utf8"),g=m;for(let[b,v]of r){let d=v.uniqueEnd,f=v.title;o.find(O=>O.includes(d))&&(f=qu(f,d));let h=v.notebookName,E=n.urlEncodeFileNamesAndLinks?encodeURI(f):f,T=E;h&&!a.endsWith(h)&&(T=`${h}/${E}`);let A=new RegExp(Cn(b),"g");g=g.replace(A,T)}m!==g&&(console.log(`File written: ${p}`),K.writeFileSync(p,g))}}console.log("Link update complete.")};var Bf=n=>hn(pn,n);var Uf=n=>hn(dn,n),jf=n=>hn(mn,n);var Hf=n=>hn(fn,n),qf=n=>hn(wi,n)||hn(vi,n);var Wf=n=>hn(un,n),hn=(n,e)=>e.includes(n.START_BLOCK)&&e.includes(n.CONTENT_PLACEHOLDER)&&e.includes(n.END_BLOCK);var Yf=`---
+`,$y=`{source-url-block}source: {source-url}{end-source-url-block}
+`,By=`{tags-yaml-list-block}
+tags: {tags-yaml-list}
+
+{end-tags-yaml-list-block}`,Uy=`{content-block}{content}{end-content-block}
+`,zf=Yf+By+$y+Yf+Uy;var nb=td.Platform.isDesktopApp?ed():null,Pr={enexSources:[],currentTemplate:"",outputDir:"./mdNotes",isMetadataNeeded:!1,isNotebookNameNeeded:!1,isZettelkastenNeeded:!1,useZettelIdAsFilename:!1,plainTextNotesOnly:!1,skipWebClips:!1,useHashTags:!0,nestedTags:{separatorInEN:"_",replaceSeparatorWith:"/",replaceSpaceWith:"-"},obsidianTaskTag:"",urlEncodeFileNamesAndLinks:!1,sanitizeResourceNameSpaces:!1,replacementChar:"_",pathSeparator:"/",resourcesDir:"_resources",turndownOptions:{headingStyle:"atx"}},ib="@@@",B={...Pr};function rb(n){return n==null?n:JSON.parse(JSON.stringify(n))}function nd(n,...e){for(let t of e)for(let i of Object.keys(t)){let r=t[i],o=n[i];!Array.isArray(r)&&typeof r=="object"&&!Array.isArray(o)&&typeof o=="object"?n[i]=nd({},o,r):n[i]=rb(r)}return n}var ob=n=>{B=nd({},Pr,n);let e=B.templateFile?K.readFileSync(B.templateFile,"utf-8"):zf;e=B.currentTemplate?B.currentTemplate:e,B.skipCreationTime=!Bf(e),B.skipLocation=!Uf(e),B.skipSourceUrl=!Hf(e),B.skipTags=!qf(e),B.skipUpdateTime=!Wf(e),B.isNotebookNameNeeded=jf(e),B.currentTemplate=e,console.log(`Current config is: ${JSON.stringify(B,null,4)}`),console.log(`Path separator:${q.sep}`)},ab=async(n,e,t)=>{if(!(e instanceof Be))throw new Error("Evernote import currently only works on desktop");let i=ke.getInstance();t.status("Processing "+e.name),console.log(`Getting stream from ${e}`);let r=e.createReadStream(),o={},a=i.getCurrentNotebookName();return new Promise((s,l)=>{let c=g=>(t.reportFailed(i.getCurrentNotebookFullpath(),g),l(g)),p=nb(r),m=null;p.on("tag:note-attributes",g=>{m=g}),p.on("tag:note",g=>{if(t.isCancelled()){r.close();return}if(n.skipWebClips&&ef(g))t.reportSkipped(g.title);else{t.status("Importing note "+g.title),m&&(g["note-attributes"]=m);try{If(g,a),t.reportNoteSuccess(a+"/"+g.title)}catch(v){return t.reportFailed(g.title||e,v),s()}}m=null;let b=i.getCurrentNotePath();if(b)for(let v of Object.keys(o)){let d=`${v}`,f=K.readFileSync(b,"utf8"),h=new Map([...o[v]].sort()),E=f.replace(d,[...h.values()].join(`
+`));K.writeFileSync(b,E)}}),p.on("tag:task",g=>{let b=Jp(g);o[b.taskgroupnotelevelid]||(o[b.taskgroupnotelevelid]=new Map),o[b.taskgroupnotelevelid].set(b.sortweight,Mf(b,a))}),p.on("end",s),p.on("error",c),r.on("error",c)})};async function id(n,e){ob(n);let t=[],i=n.outputDir;for(let r of n.enexSources){if(e.isCancelled())return;let o,a=ke.getInstance();r.basename.includes(ib)?(n.outputDir=Vu(r,n),o=Gu(r),Xu(o,n),a.setCurrentNotebookName(o.basename),a.setCurrentNotebookFullpath(o.fullpath)):(Ku(r,n),a.setCurrentNotebookName(r.basename),a.setCurrentNotebookFullpath(r.fullpath)),await ab(n,r,e),t.push(Wa()),n.outputDir=i}e.isCancelled()||await $f(n,t)}var Mr=class extends ue{init(){this.addFileChooserSetting("Evernote",["enex"],!0),this.addOutputLocationSetting("Evernote")}async import(e){let{files:t}=this;if(t.length===0){new Ti.Notice("Please pick at least one file to import.");return}let i=await this.getOutputFolder();if(!i){new Ti.Notice("Please select a location to export to.");return}let{app:r}=this,o=r.vault.adapter;if(!(o instanceof Ti.FileSystemAdapter))return;let a={...Pr,enexSources:t,outputDir:q.join(o.getBasePath(),i.path)};await id(a,e)}};var Se=require("obsidian");var $r=class extends ue{init(){this.addFileChooserSetting("HTML",["htm","html"],!0),this.addAttachmentSizeLimit(0),this.addMinimumImageSize(65),this.addOutputLocationSetting("HTML import")}addAttachmentSizeLimit(e){this.attachmentSizeLimit=e*10**6,new Se.Setting(this.modal.contentEl).setName("Attachment size limit (MB)").setDesc("Set 0 to disable.").addText(t=>t.then(({inputEl:i})=>{i.type="number",i.step="0.1"}).setValue(e.toString()).onChange(i=>{let r=["+","-"].includes(i)?0:Number(i);if(Number.isNaN(r)||r<0){t.setValue((this.attachmentSizeLimit/10**6).toString());return}this.attachmentSizeLimit=r*10**6}))}addMinimumImageSize(e){this.minimumImageSize=e,new Se.Setting(this.modal.contentEl).setName("Minimum image size (px)").setDesc("Set 0 to disable.").addText(t=>t.then(({inputEl:i})=>i.type="number").setValue(e.toString()).onChange(i=>{let r=["+","-"].includes(i)?0:Number(i);if(!Number.isInteger(r)||r<0){t.setValue(this.minimumImageSize.toString());return}this.minimumImageSize=r}))}async import(e){let{files:t}=this;if(t.length===0){new Se.Notice("Please pick at least one file to import.");return}let i=await this.getOutputFolder();if(!i){new Se.Notice("Please select a location to export to.");return}let r=new Map;e.reportProgress(0,t.length);for(let l=0;l{a=l});o.onCleanCache(async()=>{for(let[l,{file:c,tFile:p}]of r){if(e.isCancelled())break;try{let m=await this.app.vault.cachedRead(p),g=o.computeMetadataAsync?await o.computeMetadataAsync(Lo(m)):o.getFileCache(p);if(!g)continue;let b=[];if(g.links)for(let{link:v,position:d,displayText:f}of g.links){let{path:h,subpath:E}=(0,Se.parseLinktext)(v),T;if(ni){let O=new URL(encodeURI(h),l);O.hash="",O.search="",T=decodeURIComponent(O.href)}else T=oe(h.replace(/#/gu,"%23")).name;let A=r.get(T);if(A){let O=this.app.fileManager.generateMarkdownLink(A.tFile,p.path,E,f);b.push({from:d.start.offset,to:d.end.offset,text:O})}}b.sort((v,d)=>d.from-v.from);for(let v of b)m=m.substring(0,v.from)+v.text+m.substring(v.to);await this.vault.modify(p,m)}catch(m){e.reportFailed(c.fullpath,m)}}a()}),await s}async processFile(e,t,i){e.status("Processing "+i.name);try{let r=await i.readText(),o=dt(r);sb(o);let a=i instanceof Be?ni.pathToFileURL(i.filepath):void 0,s=new Map,l=new Map;for(let m of o.findAll("img, audio, video")){if(e.isCancelled())return;let g=m.getAttribute("src");if(g)try{let b=new URL(g.startsWith("//")?`https:${g}`:g,a),v=b.href,d=s.get(v);s.has(v)||(e.status("Downloading attachment for "+i.name),d=await this.downloadAttachment(t,m,b),s.set(v,d),d?(l.set(d.path,d),e.reportAttachmentSuccess(d.name)):e.reportSkipped(g)),d&&(m.setAttribute("src",d.path.replace(/ /g,"%20")),m instanceof HTMLImageElement||m.replaceWith(createEl("img",{attr:{src:d.path.replace(/ /g,"%20"),alt:m.getAttr("alt")}})))}catch(b){e.reportFailed(g,b)}}let c=(0,Se.htmlToMarkdown)(o),p=await this.saveAsMarkdownFile(t,i.basename,c);if(!Object.isEmpty(s)){let{metadataCache:m}=this.app,g;m.computeMetadataAsync?g=await m.computeMetadataAsync(Lo(c)):g=await new Promise(v=>{let d=m.getFileCache(p);if(d)return v(d);let f=m.on("changed",(h,E,T)=>{h===p&&(m.offref(f),v(T))})});let b=[];if(g.embeds){for(let{link:v,position:d}of g.embeds)if(l.has(v)){let f=this.app.fileManager.generateMarkdownLink(l.get(v),p.path);b.push({from:d.start.offset,to:d.end.offset,text:f})}}b.sort((v,d)=>d.from-v.from);for(let v of b)c=c.substring(0,v.from)+v.text+c.substring(v.to);await this.vault.modify(p,c)}return e.reportNoteSuccess(i.fullpath),p}catch(r){e.reportFailed(i.fullpath,r)}return null}async downloadAttachment(e,t,i){let r="",o="",a;switch(i.protocol){case"file:":let c=ni.fileURLToPath(i.href);({basename:r,extension:o}=oe(c)),a=Ki(await $e.readFile(c));break;case"https:":case"http:":let p=await cb(i),m=lb(i);r=m.basename,a=p.data,o=kr(p.mime)||m.extension;break;default:throw new Error(i.href)}if(!this.filterAttachmentSize(a)||t instanceof HTMLImageElement&&!await this.filterImageSize(a))return null;if(!o)if(t instanceof HTMLImageElement)o="png";else if(t instanceof HTMLAudioElement)o="mp3";else if(t instanceof HTMLVideoElement)o="mp4";else return null;let s=await this.createFolders((0,Se.normalizePath)(e.path+"/Attachments")),l=await this.vault.getAvailablePath(s.getParentPrefix()+r,o);return await this.vault.createBinary(l,a)}filterAttachmentSize(e){let{byteLength:t}=e;return!this.attachmentSizeLimit||t<=this.attachmentSizeLimit}async filterImageSize(e){if(!this.minimumImageSize)return!0;let t;try{t=await pb(e)}catch(o){return!0}let{height:i,width:r}=t;return r>=this.minimumImageSize&&i>=this.minimumImageSize}};function rd(n,e){let t=n.getAttribute(e);t!==null&&n.setAttribute(e,t.replace(/ /gu,"%20"))}function sb(n){n.findAll("a").forEach(e=>rd(e,"href")),n.findAll("audio, img, video").forEach(e=>rd(e,"src"))}function lb(n){return oe((0,Se.normalizePath)(decodeURIComponent(n.pathname)))}async function cb(n){var t,i;try{let r=await fetch(n,{mode:"cors",referrerPolicy:"no-referrer"});if(r.ok)return{data:await r.arrayBuffer(),mime:(t=r.headers.get("Content-Type"))!=null?t:""}}catch(r){}let e=await(0,Se.requestUrl)(n.href);return{data:e.arrayBuffer,mime:(i=e.headers["Content-Type"])!=null?i:""}}async function pb(n){let e=new Image,t=URL.createObjectURL(new Blob([n]));try{return await new Promise((i,r)=>{e.addEventListener("error",({error:o})=>r(o),{once:!0,passive:!0}),e.addEventListener("load",()=>i({height:e.naturalHeight,width:e.naturalWidth}),{once:!0,passive:!0}),e.src=t})}finally{URL.revokeObjectURL(t)}}var Mn=require("obsidian");var ub=/(#[^ ^#]*)/g,fb=/[\\:*?<>\"|!@#$%^&()+=\`\'~;,.]/g;function Qa(n){let e=n.replace(fb,"");return e=e.split(" ").join("-"),isNaN(e[0])||(e="_"+e),e}function es(n){return n.replace(ub,e=>"#"+Qa(e))}function od(n){return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()}var db=["zip"],mb=["json"],hb=["html","txt"],Br=class extends ue{constructor(){super(...arguments);this.importArchived=!1;this.importTrashed=!1}init(){this.addFileChooserSetting("Notes & attachments",[...db,...mb,...$n],!0),this.importArchivedSetting=new Mn.Setting(this.modal.contentEl).setName("Import archived notes").setDesc("If imported, files archived in Google Keep will be tagged as archived.").addToggle(t=>{t.setValue(this.importArchived),t.onChange(async i=>{this.importArchived=i})}),this.importTrashedSetting=new Mn.Setting(this.modal.contentEl).setName("Import deleted notes").setDesc("If imported, files deleted in Google Keep will be tagged as deleted. Deleted notes will only exist in your Google export if deleted recently.").addToggle(t=>{t.setValue(this.importTrashed),t.onChange(async i=>{this.importTrashed=i})}),this.addOutputLocationSetting("Google Keep")}async import(t){let{files:i}=this;if(i.length===0){new Mn.Notice("Please pick at least one file to import.");return}let r=await this.getOutputFolder();if(!r){new Mn.Notice("Please select a location to import your files to.");return}let o=`${r.path}/Assets`;for(let a of i){if(t.isCancelled())return;await this.handleFile(a,r,o,t)}}async handleFile(t,i,r,o){let{fullpath:a,name:s,extension:l}=t;o.status("Processing "+s);try{l==="zip"?await this.readZipEntries(t,i,r,o):l==="json"?await this.importKeepNote(t,i,o):$n.contains(l)?(o.status("Importing attachment "+s),await this.copyFile(t,r),o.reportAttachmentSuccess(a)):!(t instanceof gi)&&!hb.contains(l)&&o.reportSkipped(a)}catch(c){o.reportFailed(a,c)}}async readZipEntries(t,i,r,o){await yt(t,async(a,s)=>{for(let l of s){if(o.isCancelled())return;await this.handleFile(l,i,r,o)}})}async importKeepNote(t,i,r){let{fullpath:o,basename:a}=t;r.status("Importing note "+a);let s=await t.readText(),l=JSON.parse(s);if(!l||!l.userEditedTimestampUsec||!l.createdTimestampUsec){r.reportFailed(o,"Invalid Google Keep JSON");return}if(l.isArchived&&!this.importArchived){r.reportSkipped(o,"Archived note");return}if(l.isTrashed&&!this.importTrashed){r.reportSkipped(o,"Deleted note");return}await this.convertKeepJson(l,i,a),r.reportNoteSuccess(o)}async copyFile(t,i){let r=await this.createFolders(i),o=await t.read();await this.vault.createBinary(`${r.path}/${t.name}`,o)}async convertKeepJson(t,i,r){let o=[],a={};if(t.title){let c=t.title.split(`
+`).filter(p=>p!==r);c.length>0&&(a.aliases=c)}let s=[];if(t.color&&t.color!=="DEFAULT"){let c=t.color.toLowerCase();c=od(c),s.push(`Keep/Color/${c}`)}if(t.isPinned&&s.push("Keep/Pinned"),t.attachments&&s.push("Keep/Attachment"),t.isArchived&&s.push("Keep/Archived"),t.isTrashed&&s.push("Keep/Deleted"),t.labels)for(let c of t.labels)s.push(`Keep/Label/${c.name}`);if(s.length>0&&(a.tags=s.map(c=>Qa(c))),o.push(Xi(a)),t.textContent&&(o.push(`
+`),o.push(es(t.textContent))),t.listContent){let c=[];for(let p of t.listContent){if(!p.text)continue;let m=`- [${p.isChecked?"X":" "}] ${p.text}`;c.push(es(m))}o.push(`
+
+`),o.push(c.join(`
+`))}if(t.attachments){o.push(`
+
+`);for(let c of t.attachments)o.push(`![[${c.filePath}]]`)}let l=await this.saveAsMarkdownFile(i,r,o.join(""));await this.vault.append(l,"",{ctime:t.createdTimestampUsec/1e3,mtime:t.userEditedTimestampUsec/1e3})}};var wt=require("obsidian");var ts=require("obsidian");function ad({info:n,vault:e,targetFolderPath:t,parentsInSubfolders:i}){let r=e.getAllLoadedFiles(),o=new Set,a=new Set(r.map(s=>s.name));i&&yb(n),gb({info:n,pathDuplicateChecks:o,titleDuplicateChecks:a}),bb({info:n,loadedFiles:r,titleDuplicateChecks:a,targetFolderPath:t})}function gb({info:n,pathDuplicateChecks:e,titleDuplicateChecks:t}){for(let i of Object.values(n.idsToFileInfo)){let r=n.getPathForFile(i);if(e.has(`${r}${i.title}`)){let o=2;for(i.title=i.title+" "+o;e.has(`${r}${i.title}`);)o++,i.title=`${i.title.replace(/ \d+$/,"")} ${o}`}t.has(i.title+".md")&&(i.fullLinkPathNeeded=!0),e.add(`${r}${i.title}`),t.add(i.title+".md")}}function yb(n){let e=new Set(Object.values(n.idsToFileInfo).map(t=>t.parentIds).concat(Object.values(n.pathsToAttachmentInfo).map(t=>t.parentIds)).map(t=>t.length>0?t[t.length-1]:""));for(let t of Object.keys(n.idsToFileInfo))e.has(t)&&n.idsToFileInfo[t].parentIds.push(t)}function bb({info:n,loadedFiles:e,titleDuplicateChecks:t,targetFolderPath:i}){var l;let r=new Set(e.filter(c=>!c.path.endsWith(".md")).map(c=>c.path)),o=n.attachmentPath,a=/^\.\//.test(o),s=(l=o.match(/\.\/(.*)/))==null?void 0:l[1];for(let c of Object.values(n.pathsToAttachmentInfo)){t.has(c.nameWithExtension)&&(c.fullLinkPathNeeded=!0);let p="";if(a?p=(0,ts.normalizePath)(`${i}${n.getPathForFile(c)}${s!=null?s:""}`):p=(0,ts.normalizePath)(o+"/"),p.endsWith("/")||(p+="/"),r.has(p+c.nameWithExtension)){let m=2,{basename:g,extension:b}=oe(c.path);for(;r.has(`${p}${g} ${m}.${b}`);)m++;c.nameWithExtension=`${g} ${m}.${b}`}c.targetParentFolder=p,r.add(p+c.nameWithExtension),t.add(c.nameWithExtension)}}var Bn=require("obsidian");var sd=n=>n.replace(/-/g,"").replace(/[ -]?[a-z0-9]{32}(\.|$)/,"$1"),xt=n=>{var e;return(e=n.replace(/-/g,"").match(/([a-z0-9]{32})(\?|\.|$)/))==null?void 0:e[1]},ns=n=>{let{parent:e}=oe(n);return e.split("/").map(t=>xt(t)).filter(t=>t)};function is(n){return n.hour()===0&&n.minute()===0?n.format("YYYY-MM-DD"):n.format("YYYY-MM-DDTHH:mm")}function ld(n){return n.replace(/^(\.\.\/)+/,"")}function cd(n){let e=/#\d*?(?:[-_/a-z]|[^\x00-\x7F])/gi;if(!e.test(n))return n;let t=n.split(`
+`);for(let i=0;i tbody");if(s){let m=ud(n,s);bd(n,m,!1),Bb(s);for(let g of Array.from(s.rows)){let b=xb(g);b&&(b.title=="Tags"&&(b.title="tags",typeof b.content=="string"?b.content=b.content.replace(/ /g,"-"):b.content instanceof Array&&(b.content=b.content.map(v=>v.replace(/ /g,"-")))),a[b.title]=b.content)}}Rb(r,["strong","em","mark","del"]),kb(r),vb(r),Lb(r),_b(r),Fb(r),Ed(r),gd(r,"div.indented"),gd(r,"details"),Pb(r),yd(r,"ul"),yd(r,"ol"),Mb(r),$b(r),Ib(r),Nb(r);let l=(0,Bn.htmlToMarkdown)(r.innerHTML);n.singleLineBreaks&&(l=l.replace(/\n\n(?!>)/g,`
+`)),l=cd(l),l=wb(l);let c=(p=i.find("p[class*=page-description]"))==null?void 0:p.textContent;return c&&(l=c+`
+
+`+l),Xi(a)+l}var pd={checkbox:["checkbox"],date:["created_time","last_edited_time","date"],list:["file","multi_select","relation"],number:["number","auto_increment_id"],text:["email","person","phone_number","text","url","status","select","formula","rollup","last_edited_by","created_by"]};function xb(n){var a,s,l,c,p,m;let e=(a=n.className.match(/property-row-(.*)/))==null?void 0:a[1];if(!e)throw new Error("property type not found for: "+n);let t=(0,Bn.htmlToMarkdown)((s=n.cells[0].textContent)!=null?s:""),i=n.cells[1],r=Object.keys(pd).find(g=>pd[g].includes(e));if(!r)throw new Error("type not found for: "+i);let o="";switch(r){case"checkbox":o=i.innerHTML.includes("checkbox-on");break;case"number":if(o=Number(i.textContent),isNaN(o))return;break;case"date":Ed(i);let g=i.getElementsByTagName("time");if(g.length===0)o="";else if(g.length===1)o=is((0,Bn.moment)((l=g.item(0))==null?void 0:l.textContent));else{let d=[];for(let f=0;fc.includes(a));s&&a.endsWith(".html")?t.push({type:"relation",a:o,id:s}):l?t.push({type:"attachment",a:o,path:l}):s&&a.startsWith("#")&&((r=o.parentElement)!=null&&r.classList.contains("table_of_contents-item"))&&t.push({type:"toc-item",a:o,id:s})}return t}function wb(n){let e=/\[\[[^\]]*(\\\\)\|[^\]]*\]\]/,t=n.match(new RegExp(e,"g"));return t==null||t.forEach(i=>{n=n.replace(i,i.replace(/\\\\\|/g,"\\|"))}),n}function vb(n){Sb(n,"style"),wd(n,"span.notion-text-equation-token");let e=n.ownerDocument,t=n.findAll("figure.equation");for(let r of t){let o=r.find("annotation");if(!o)continue;let a=e.createElement("div");a.className="annotation",a.appendText(`$$${fd(o.textContent)}$$`),r.replaceWith(a)}let i=n.findAll("span.notion-text-equation-token");for(let r of i){let o=r.find("annotation");o&&r.replaceWith(`$${fd(o.textContent,!0)}$`)}}function fd(n,e=!1){var i;let t=new RegExp(/^(?:\s|\\\\|\\\s)*(.*?)[\s\\]*$/,"s");return(i=n==null?void 0:n.replace(t,"$1").replace(/[\r\n]+/g,e?" ":`
+`))!=null?i:""}function Eb(n){var t;let e=(t=n.match(/^[^\.\?\!\n]*[\.\?\!]?/))==null?void 0:t[0];return e!=null?e:""}function Tb(n){var e;return!!/callout|bookmark/.test((e=n.getAttribute("class"))!=null?e:"")}function _b(n){var t;let e=n.ownerDocument;for(let i of n.findAll("figure.callout")){let r=(t=i.lastElementChild)==null?void 0:t.childNodes;if(!r)continue;let o=e.createElement("blockquote");o.append(...Array.from(r)),Ab(o),i.replaceWith(o)}}function Ab(n){var o,a,s;let e=n.firstChild,t=(o=e==null?void 0:e.nodeName)!=null?o:"",i=n.ownerDocument.createElement("p"),r="";t=="#text"?r=(a=e==null?void 0:e.textContent)!=null?a:"":t=="P"?r=e.innerHTML:["EM","STRONG","DEL","MARK"].includes(t)?r=e.outerHTML:n.prepend(i),r=r.replace(/ /g,"<br>"),i.innerHTML=`[!important] ${r}`,(s=n.firstChild)==null||s.replaceWith(i)}function kb(n){var e,t,i;for(let r of n.findAll("a.bookmark.source")){let o=r.getAttribute("href"),a=(e=r.find("div.bookmark-title"))==null?void 0:e.textContent,s=Eb((i=(t=r.find("div.bookmark-description"))==null?void 0:t.textContent)!=null?i:""),l=`> [!info] ${a}
+> ${s}
+> [${o}](${o})
+`;r.nextElementSibling&&Tb(r.nextElementSibling)&&(l+=`
+`),r.replaceWith(l)}}function Nb(n){var e,t,i;for(let r of n.findAll("span[class=user]"))r.innerText=(e=r.textContent)!=null?e:"";for(let r of n.findAll("td div[class*=checkbox]")){let o=createSpan();o.setText(r.hasClass("checkbox-on")?"X":""),r.replaceWith(o)}for(let r of n.findAll("table span[class*=selected-value]"))((t=r.parentElement)==null?void 0:t.lastElementChild)!==r&&r.setText(r.textContent+", ");for(let r of n.findAll("a[href]"))if(!/^(https?:\/\/|www\.)/.test(r.href)){let o=createSpan();o.setText((i=r.textContent)!=null?i:""),r.replaceWith(o)}}function Sb(n,e){for(let t of n.findAll(e))t.remove()}function Rb(n,e){for(let t of e)Ob(n,t);for(let t of e)Cb(n,t);for(let t of e)wd(n,t);for(let t of e)Db(n,t)}function Ob(n,e){for(let t of n.findAll(e)){if(!t.parentElement||t.parentElement.tagName===e.toUpperCase())continue;let i=t.find(e);for(;i;)rs(i),i=t.find(e)}}function Cb(n,e){let t=n.findAll(e);if(!t)return;let i=new RegExp(`${e}>( *)<${e}>`,"g");for(let r of t){if(!r||!r.parentElement)continue;let o=r.parentElement,a=o==null?void 0:o.innerHTML;o.innerHTML=a==null?void 0:a.replace(i,"$1")}}function wd(n,e){let t=n.findAll(e);if(t)for(let i of t){let r=i.previousSibling;(r==null?void 0:r.nodeName)=="BR"&&(r==null||r.remove())}}function Db(n,e){let t=n.innerHTML,i=t.match(new RegExp(`<${e}>.*?${e}>`,"sg"));if(i){for(let r of i.filter(o=>o.includes(" ")))t=t.replace(r,r.split(" ").join(`${e}> <${e}>`));n.innerHTML=t}}function dd(n){var e;return Number((e=n==null?void 0:n.classList[1].slice(-1))!=null?e:-1)}function vd(n,e){let t=dd(n),i=dd(e);if(t>i&&e.childElementCount==1){let r=createEl("ul");r.append(n),e.append(r)}else if(t>i&&e.childElementCount==2){let r=e.lastElementChild;r==null||r.append(n)}else if(t==i){let r=e.parentElement;r==null||r.append(n)}else t)/g," ");for(let e of n.findAll("code"))for(let t of e.findAll("br"))t.replaceWith(`
+`)}function Lb(n){var e;for(let t of n.findAll("link"))t.innerText=(e=t.textContent)!=null?e:""}function Ed(n){var e,t;for(let i of n.findAll("time"))i.textContent=(t=(e=i.textContent)==null?void 0:e.replace(/@/g,""))!=null?t:""}var hd={"1.875em":"h1","1.5em":"h2","1.25em":"h3"};function Pb(n){var t;let e=n.findAll("summary");for(let i of e){let r=i.getAttribute("style");if(r){for(let o of Object.keys(hd))if(r.includes(o)){i.replaceWith(createEl(hd[o],{text:(t=i.textContent)!=null?t:""}));break}}}}function gd(n,e){let t=n.findAll(e);for(let i of t)rs(i)}function Mb(n){for(let e of n.findAll(".language-Mermaid"))e.removeClass("language-Mermaid"),e.addClass("language-mermaid")}function yd(n,e){for(let t of n.findAll(e)){let i=[],r=[],o=t;for(;o.tagName===e.toUpperCase();){i.push(o);for(let s=0;ss.remove())}}function $b(n){for(let e of n.findAll(".checkbox.checkbox-on"))e.replaceWith("[x] ");for(let e of n.findAll(".checkbox.checkbox-off"))e.replaceWith("[ ] ")}function Bb(n){var t;let e=n.findAll("a");if(e.length===0)return n;for(let i of e){let r=createSpan();r.setText((t=i.getAttribute("href"))!=null?t:""),i.replaceWith(r)}}function bd(n,e,t){var i,r,o;for(let a of e){let s=createSpan(),l="";switch(a.type){case"relation":let c=n.idsToFileInfo[a.id];if(c){let g=a.a.closest("table");l=`[[${c.fullLinkPathNeeded?`${n.getPathForFile(c)}${c.title}${g?"\\":""}|${c.title}`:c.title}]]`}else{console.warn("missing relation data for id: "+a.id);let{basename:g}=oe(decodeURI((i=a.a.getAttribute("href"))!=null?i:""));l=`[[${sd(g)}]]`}break;case"attachment":let p=n.pathsToAttachmentInfo[a.path];if(!p){console.warn("missing attachment data for: "+a.path);continue}l=`${t?"!":""}[[${p.fullLinkPathNeeded?p.targetParentFolder+p.nameWithExtension+"|"+p.nameWithExtension:p.nameWithExtension}]]`;break;case"toc-item":l=(r=a.a.textContent)!=null?r:"";let m=(o=l.endsWith("]"))!=null?o:!1;l=`[[#${l+(m?" ":"")}]]`}s.setText(l),a.a.replaceWith(s)}}var Ur=class{constructor(e,t){this.idsToFileInfo={};this.pathsToAttachmentInfo={};this.attachmentPath=e,this.singleLineBreaks=t}getPathForFile(e){let{idsToFileInfo:t}=this,i=e.path.split("/");return e.parentIds.map(r=>{var o,a,s;return(s=(o=t[r])==null?void 0:o.title)!=null?s:(a=i.find(l=>l.contains(r)))==null?void 0:a.replace(` ${r}`,"")}).filter(r=>r).map(r=>r.replace(/[\. ]+$/,"")).join("/")+"/"}};async function _d(n,e){var i,r;let{filepath:t}=e;if(e.extension==="html"){let o=await e.readText(),a=dt(o),l=a.find("body").children,c;for(let v=0;ve.setValue(this.parentsInSubfolders).onChange(t=>this.parentsInSubfolders=t)),new wt.Setting(this.modal.contentEl).setName("Single line breaks").setDesc("Separate Notion blocks with only one line break (default is 2).").addToggle(e=>e.setValue(this.singleLineBreaks).onChange(t=>{this.singleLineBreaks=t}))}async import(e){var g;let{vault:t,parentsInSubfolders:i,files:r}=this;if(r.length===0){new wt.Notice("Please pick at least one file to import.");return}let o=await this.getOutputFolder();if(!o){new wt.Notice("Please select a location to export to.");return}let a=o.path;a=(0,wt.normalizePath)(a),a!=null&&a.endsWith("/")||(a+="/");let s=new Ur((g=t.getConfig("attachmentFolderPath"))!=null?g:"",this.singleLineBreaks);e.status("Looking for files to import");let l=0;if(await os(e,r,async b=>{try{await _d(s,b),l=Object.keys(s.idsToFileInfo).length+Object.keys(s.pathsToAttachmentInfo).length,e.reportProgress(0,l)}catch(v){e.reportSkipped(b.fullpath)}}),e.isCancelled())return;e.status("Resolving links and de-duplicating files"),ad({vault:t,info:s,targetFolderPath:a,parentsInSubfolders:i});let c=new Set([a]),p=Object.values(s.idsToFileInfo).map(b=>a+s.getPathForFile(b)).concat(Object.values(s.pathsToAttachmentInfo).map(b=>b.targetParentFolder));for(let b of p)c.add(b);for(let b of c){if(e.isCancelled())return;await this.createFolders(b)}let m=0;e.status("Starting import"),await os(e,r,async b=>{m++,e.reportProgress(m,l);try{if(b.extension==="html"){let v=xt(b.name);if(!v)throw new Error("ids not found for "+b.filepath);let d=s.idsToFileInfo[v];if(!d)throw new Error("file info not found for "+b.filepath);e.status(`Importing note ${d.title}`);let f=await xd(s,b),h={};d.ctime&&(h.ctime=d.ctime.getTime(),h.mtime=d.ctime.getTime()),d.mtime&&(h.mtime=d.mtime.getTime());let E=`${a}${s.getPathForFile(d)}${d.title}.md`;await t.create(E,f,h),e.reportNoteSuccess(b.fullpath)}else{let v=s.pathsToAttachmentInfo[b.filepath];if(!v)throw new Error("attachment info not found for "+b.filepath);e.status(`Importing attachment ${b.name}`);let d=await b.read();await t.createBinary(`${v.targetParentFolder}${v.nameWithExtension}`,d),e.reportAttachmentSuccess(b.fullpath)}}catch(v){if(v.message==="page body was not found"){e.reportSkipped(b.fullpath,"page body was not found");return}e.reportFailed(b.fullpath,v)}})}};async function os(n,e,t){for(let i of e){if(n.isCancelled())return;try{await yt(i,async(r,o)=>{for(let a of o){if(n.isCancelled())return;if(a.extension==="md"&&xt(a.name))throw new wt.Notice("Notion Markdown export detected. Please export Notion data to HTML instead."),n.cancel(),new Error("Notion importer uses only HTML exports. Please use the correct format.");if(!(a.extension==="csv"&&xt(a.name))&&a.name!=="index.html")if(a.extension==="zip"&&a.parent==="")try{await os(n,[a],t)}catch(s){n.reportFailed(a.fullpath)}else await t(a)}})}catch(r){n.reportFailed(i.fullpath)}}}var xe=require("obsidian");var as="onenote-importer-refresh-token",Ad="66553851-08fa-44f2-8bb1-1436f121a73d",kd=["user.read","notes.read"],Hb=/<(object|iframe)([^>]*)\/>/g,Nd=/(<\/p>)\s*(
]*>)|\n \n/g,qb=5,Wb=new RegExp(/^data:[\w\d]+\/[\w\d]+;base64,/);function Yb(n){throw new Error("Didn't expect to get here")}function zb(n){if(n==null)throw new Error("response is nullish");if(typeof n!="object")throw new Error("response is not an object type");if("@odata.nextLink"in n){let e=n["@odata.nextLink"];if(typeof e!="string")throw new Error(`Link of unknown type: ${typeof e}`)}if(!("value"in n))throw new Error("Expected response to have a 'value' property");if(!Array.isArray(n.value))throw new Error("Expected response to have an error in 'value' property")}function Zb(n){return n instanceof HTMLElement}var Hr=class extends ue{constructor(){super(...arguments);this.importPreviouslyImported=!1;this.importIncompatibleAttachments=!1;this.selectedIds=[];this.notebooks=[];this.graphData={state:Tn(32),accessToken:""};this.attachmentDownloadPauseCounter=0;this.rememberMe=!1;this.lastSuccessfulFetchTime=performance.now()}async init(){this.addOutputLocationSetting("OneNote"),new xe.Setting(this.modal.contentEl).setName("Import incompatible attachments").setDesc("Imports incompatible attachments which cannot be embedded in Obsidian, such as .exe files.").addToggle(r=>r.setValue(!1).onChange(o=>this.importIncompatibleAttachments=o)),new xe.Setting(this.modal.contentEl).setName("Skip previously imported").setDesc("If enabled, notes imported previously by this plugin will be skipped.").addToggle(r=>r.setValue(!0).onChange(o=>this.importPreviouslyImported=!o));let t=!1;if(this.retrieveRefreshToken())try{await this.updateAccessToken(),t=!0}catch(r){}this.microsoftAccountSetting=new xe.Setting(this.modal.contentEl).setName("Sign in with your Microsoft account").setDesc("You need to sign in to import your OneNote data.").addButton(r=>r.setCta().setButtonText("Sign in").onClick(()=>{this.registerAuthCallback(this.authenticateUser.bind(this));let o=new URLSearchParams({client_id:Ad,scope:"offline_access "+kd.join(" "),response_type:"code",redirect_uri:qr,response_mode:"query",state:this.graphData.state});window.open(`https://login.microsoftonline.com/common/oauth2/v2.0/authorize?${o.toString()}`)})),this.microsoftAccountSetting.settingEl.toggle(!t);let i=new xe.Setting(this.modal.contentEl).setName("Remember me").setDesc("If checked, you will be automatically logged in for subsequent imports.").addToggle(r=>{r.onChange(o=>{this.rememberMe=o,o&&this.refreshToken?this.storeRefreshToken(this.refreshToken):this.clearStoredRefreshToken()})});i.settingEl.toggle(!t),this.switchUserSetting=new xe.Setting(this.modal.contentEl).addButton(r=>r.setCta().setButtonText("Switch user").onClick(()=>{this.microsoftAccountSetting.settingEl.show(),i.settingEl.show(),this.clearStoredRefreshToken(),this.switchUserSetting.settingEl.hide(),this.contentArea.empty()})),this.loadingArea=this.modal.contentEl.createDiv({text:"Loading notebooks..."}),this.loadingArea.hide(),this.contentArea=this.modal.contentEl.createDiv(),this.contentArea.hide(),t?(await this.setSwitchUser(),await this.showSectionPickerUI()):this.switchUserSetting.settingEl.hide()}async authenticateUser(t){try{if(t.state!==this.graphData.state)throw new Error(`An incorrect state was returned.
+Expected state: ${this.graphData.state}
+Returned state: ${t.state}`);await this.updateAccessToken(t.code),await this.setSwitchUser(),await this.showSectionPickerUI()}catch(i){console.error("An error occurred while we were trying to sign you in. Error details: ",i),this.modal.contentEl.createEl("div",{text:"An error occurred while trying to sign you in."}).createEl("details",{text:i}).createEl("summary",{text:"Click here to show error details"})}}async setSwitchUser(){let t=await this.fetchResource("https://graph.microsoft.com/v1.0/me","json");this.switchUserSetting.setDesc(`Signed in as ${t.displayName} (${t.mail}). If that's not the correct account, sign in again.`),this.switchUserSetting.settingEl.show(),this.microsoftAccountSetting.settingEl.hide()}async updateAccessToken(t){let i=new URLSearchParams({client_id:Ad,scope:"offline_access "+kd.join(" "),redirect_uri:qr});if(t)i.set("code",t),i.set("grant_type","authorization_code");else{let o=this.retrieveRefreshToken();if(!o)throw new Error("Missing token required for authentication. Please try logging in again.");i.set("refresh_token",o),i.set("grant_type","refresh_token")}let r=await(0,xe.requestUrl)({method:"POST",url:"https://login.microsoftonline.com/common/oauth2/v2.0/token",contentType:"application/x-www-form-urlencoded",body:i.toString()}).json;if(!r.access_token)throw new Error(`Unexpected data was returned instead of an access token. Error details: ${r}`);r.refresh_token&&this.storeRefreshToken(r.refresh_token),this.graphData.accessToken=r.access_token}storeRefreshToken(t){this.refreshToken=t,this.rememberMe&&localStorage.setItem(as,t)}retrieveRefreshToken(){return this.refreshToken?this.refreshToken:localStorage.getItem(as)}clearStoredRefreshToken(){localStorage.removeItem(as)}async showSectionPickerUI(){var o,a;this.loadingArea.show(),this.selectedIds=[];let t="https://graph.microsoft.com/v1.0/me/onenote/notebooks",i=new URLSearchParams({$expand:"sections($select=id,displayName),sectionGroups($expand=sections,sectionGroups)",$select:"id,displayName,lastModifiedDateTime",$orderby:"lastModifiedDateTime DESC"}),r=`${t}?${i.toString()}`;try{this.notebooks=(await this.fetchResource(r,"json-wrapped")).value,this.contentArea.empty(),this.contentArea.createEl("h4",{text:"Choose data to import"});for(let s of this.notebooks){if(((o=s.sectionGroups)==null?void 0:o.length)!==0)for(let c of s.sectionGroups)await this.fetchNestedSectionGroups(c);let l=this.contentArea.createDiv();new xe.Setting(l).setName(s.displayName).setDesc(`Last edited on: ${xe.moment.utc(s.lastModifiedDateTime).format("Do MMMM YYYY")}. Contains ${(a=s.sections)==null?void 0:a.length} sections.`).addButton(c=>c.setCta().setButtonText("Select all").onClick(()=>{l.querySelectorAll('input[type="checkbox"]:not(:checked)').forEach(p=>p.click())})),this.renderHierarchy(s,l)}}catch(s){this.showContentAreaErrorMessage()}this.loadingArea.hide(),this.contentArea.show()}async fetchNestedSectionGroups(t){if(t.sectionGroups=(await this.fetchResource(t.sectionGroupsUrl+"?$expand=sectionGroups($expand=sections),sections","json-wrapped")).value,t.sectionGroups)for(let i=0;i{if(l.checked)this.selectedIds.push(o.id);else{let c=this.selectedIds.findIndex(p=>p===o.id);c!==-1&&this.selectedIds.splice(c,1)}})}}}showContentAreaErrorMessage(){this.contentArea.empty(),this.contentArea.createEl("p",{text:"Microsoft OneNote has limited how fast notes can be imported. Please try again in 1 hour to continue importing."}),this.contentArea.show(),this.loadingArea.hide()}async import(t){var c;let i=new Set,r=await this.modal.plugin.loadData();r.importers.onenote||(r.importers.onenote={previouslyImportedIDs:[]});for(let p of r.importers.onenote.previouslyImportedIDs)i.add(p);if(!await this.getOutputFolder()){new xe.Notice("Please select a location to export to.");return}if(!this.graphData.accessToken){new xe.Notice("Please sign in to your Microsoft Account.");return}t.status("Starting OneNote import");let a=0,s=0,l=0;for(let p of this.selectedIds){let m=`https://graph.microsoft.com/v1.0/me/onenote/sections/${p}/pages`,g=new URLSearchParams({$select:"id,title,createdDateTime,lastModifiedDateTime,level,order,contentUrl",$orderby:"order",pagelevel:"true"}),b=`${m}?${g.toString()}`,v=null;try{v=(await this.fetchResource(b,"json-wrapped",t)).value}catch(d){console.error(`Failed to fetch pages for section ${p}, skipping to next section.`,d),t.status("Failed to fetch pages for a section, skipping to next section.");return}if(v){a+=v.length,this.insertPagesToSection(v,p),t.reportProgress(s,a);for(let d=0;d5||this.modal.abortController.signal.aborted){let E=this.modal.abortController.signal.aborted?h.message:"Microsoft OneNote returned too many consecutive errors.";t.status(E);for(let T=d+1;T","import was canceled (after too many pages failed to load)")}t.reportProgress(a,a);return}}t.reportProgress(++s,a)}}}}insertPagesToSection(t,i,r){if(!r){for(let o of this.notebooks)this.insertPagesToSection(t,i,o);return}if(r.sectionGroups){let o=r.sectionGroups;for(let a of o)this.insertPagesToSection(t,i,a)}if(r.sections){let o=r;for(let a of o.sections)a.id===i&&(a.pages=t)}}async processFile(t,i,r){var o,a;try{let s=this.convertFormat(i),l=await this.getOutputFolder(),c=this.getEntityPathNoParent(r.id,l.name),p;await this.vault.adapter.exists(c)?p=this.vault.getAbstractFileByPath(c):p=await this.vault.createFolder(c);let m=this.convertTags(dt(s.html)),g=await this.getAllAttachments(t,m.replace(Nd," ")),b=this.styledElementToHTML(g);b=this.convertInternalLinks(b),b=this.convertDrawings(b),b=this.removeExtraListItemParagraphs(b),this.escapeTextNodes(b);let v=(0,xe.htmlToMarkdown)(b).trim().replace(Nd," "),d=await this.saveAsMarkdownFile(p,r.title,v),f=r!=null&&r.lastModifiedDateTime?Date.parse(r.lastModifiedDateTime):null,h=r!=null&&r.createdDateTime?Date.parse(r.createdDateTime):null,E={ctime:(o=h!=null?h:f)!=null?o:Date.now(),mtime:(a=f!=null?f:h)!=null?a:Date.now()};await this.vault.append(d,"",E),t.reportNoteSuccess(r.title)}catch(s){t.reportFailed(r.title,s)}}escapeTextNodes(t){if(t.nodeType===Node.TEXT_NODE&&t.textContent)t.textContent=t.textContent.replace(/([<>])/g,"\\$1");else for(let i=0;ip.includes("Content-Type")).split(";")[0].split(":")[1].trim(),c=a.split(`
+`).slice(2).join(`
+`).trim();l==="text/html"?i.html=c:l==="application/inkml+xml"&&(i.inkml=c)}else throw new Error("The input string is incorrect and may be missing data. Inputted string: "+t);return i}convertTags(t){var r,o;let i=Array.from(t.querySelectorAll("[data-tag]"));for(let a of i)if((r=a.getAttribute("data-tag"))!=null&&r.contains("to-do")){let l=a.getAttribute("data-tag")==="to-do:completed"?"[x]":"[ ]";a.innerHTML=`- ${l} ${a.innerHTML}`}else{let s=(o=a.getAttribute("data-tag"))==null?void 0:o.split(",");s==null||s.forEach(l=>{a.innerHTML=a.innerHTML+` #${l.replace(":","-")} `})}return t.outerHTML}convertInternalLinks(t){let i=t.findAll("a");for(let r of i)if(r.href.startsWith("onenote:")){let o=r.href.indexOf("#")+1,a=r.href.indexOf("&",o);r.href=r.href.slice(o,a)}return t}getEntityPathNoParent(t,i){for(let r of this.notebooks){let o=this.getEntityPath(t,`${i}/${r.displayName}`,r);if(o)return o}return null}getEntityPath(t,i,r){let o=null;if("sectionGroups"in r&&r.sectionGroups){let a=this.searchSectionGroups(t,i,r.sectionGroups);a!==null&&(o=a)}if("sections"in r&&r.sections){let a=this.searchSectionGroups(t,i,r.sections);a!==null&&(o=a)}if("pages"in r&&r.pages){let a=this.searchPages(t,i,r);a!==null&&(o=a)}return o&&(o=this.sanitizeFilePath(o)),o}searchPages(t,i,r){var a;let o=null;for(let s=0;s=0;p--)if(r.pages[p].level===l.level-1){o+="/"+r.pages[p].title;break}}break}}return o}searchSectionGroups(t,i,r){let o=null;for(let a of r)if(a.id===t)o=`${i}/${a.displayName}`;else{let s=this.getEntityPath(t,`${i}/${a.displayName}`,a);if(s){o=s;break}}return o}sanitizeOCRText(t){return t=t.replace(/[^\w\d\s]/g,""),t=t.replace(/\s+/g," ").trim(),t.length>50&&(t=t.substring(0,50)+"..."),t}async getAllAttachments(t,i){var l,c,p,m;let r=dt(i.replace(Hb,"<$1$2>$1>")),o=r.findAll("object"),a=r.findAll("img"),s=r.findAll("iframe");for(let g of o){for(;g.firstChild;)(l=g.parentNode)==null||l.insertBefore(g.firstChild,g.nextSibling);let b=g.getAttribute("data-attachment").split("."),v=b[b.length-1];if(!(!$n.contains(v)&&!this.importIncompatibleAttachments)){let d=g.getAttribute("data-attachment"),f=g.getAttribute("data"),h=await this.fetchAttachment(t,d,f),E=document.createElement("p");E.innerText=`![[${h}]]`,(c=g.parentNode)==null||c.replaceChild(E,g)}}for(let g=0;g{t.status("Pausing attachment download to avoid rate limiting."),this.attachmentDownloadPauseCounter=0,setTimeout(o,3e3)}),this.attachmentDownloadPauseCounter++,t.status("Downloading attachment "+i);try{let o=await this.getAvailablePathForAttachment(i,[]),a=await this.fetchResource(r,"file",t);return await this.app.vault.createBinary(o,a),t.reportAttachmentSuccess(i),o}catch(o){t.reportFailed(i),console.error(o)}}styledElementToHTML(t){let i={"font-weight:bold":"b","font-style:italic":"i","text-decoration:underline":"u","text-decoration:line-through":"s","background-color":"mark"};t.findAll("cite").forEach(l=>l.innerHTML="> "+l.innerHTML+" ");let o=!1,a=document.createElement("pre");return t.querySelectorAll("*").forEach(l=>{let c=l.getAttribute("style")||"",p=Object.keys(i).find(m=>c.includes(m));if(c!=null&&c.contains("font-family:Consolas"))o?a.innerHTML=a.innerHTML.slice(0,-3)+l.innerHTML+"\n```":(o=!0,l.replaceWith(a),a.innerHTML="```\n"+l.innerHTML+"\n```");else if(l.nodeName==="BR"&&o)a.innerHTML=a.innerHTML.slice(0,-3)+"\n```";else if(l.nodeName==="TD"){l.removeAttribute("style");return}else if(p){let m=i[p],g=document.createElement(m);g.innerHTML=l.innerHTML,l.replaceWith(g)}}),t}convertDrawings(t){var o;let i=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT),r=!1;for(;i.nextNode();)((o=i.currentNode.nodeValue)==null?void 0:o.trim())==="InkNode is not supported"&&(r=!0);if(r){let a=document.createTextNode("> [!caution] This page contained a drawing which was not converted.");t.insertBefore(a,t.firstChild)}else for(let a=0;a p:first-child").forEach(i=>{Zb(i)&&i.style.marginBottom==="0pt"&&i.style.marginTop==="0pt"&&i.replaceWith(...Array.from(i.childNodes))}),t}async fetchResource(t,i,r,o=0){var l;if(o>=qb)throw new Error("Exceeded maximum retry attempts");let a=performance.now()-this.lastSuccessfulFetchTime,s=1e3*60*90;if(a>s&&this.modal.abortController.abort("stalled for >90 minutes"),this.modal.abortController.signal.aborted){let c=(l=this.modal.abortController.signal.reason)!=null?l:"no reason given";throw new Error(`The import was aborted (${c})`)}try{o>0&&console.log(`Retry attempt #${o} for ${t}`);let c=await fetch(t,{headers:{Authorization:`Bearer ${this.graphData.accessToken}`},signal:this.modal.abortController.signal});if(c.ok){let p;switch(i){case"text":p=await c.text();break;case"file":p=await c.arrayBuffer();break;case"json":p=await c.json();break;case"json-wrapped":p=await c.json(),zb(p),"@odata.nextLink"in p&&p.value.push(...(await this.fetchResource(p["@odata.nextLink"],"json-wrapped",r)).value);break;default:Yb(i)}return this.lastSuccessfulFetchTime=performance.now(),p}else{let p=null,m=await c.json();if(m.hasOwnProperty("error")&&(p=m.error),console.log("An error has occurred while fetching an resource:",p||m),(p==null?void 0:p.code)==="40001"||(p==null?void 0:p.code)==="InvalidAuthenticationToken"||c.status===401)return await this.updateAccessToken(),this.fetchResource(t,i,r,o+1);if((p==null?void 0:p.code)==="20166"||c.status===429){let b=c.headers.get("Retry-After"),v=b?+b*1:60;return console.log(`Rate limit exceeded, waiting for: ${v} seconds`),await this.pause(v,"OneNote API is rate-limiting us",r),this.fetchResource(t,i,r,o)}return this.fetchResource(t,i,r,o+1)}}catch(c){return console.error(`An internal error occurred while trying to fetch '${t}'. Error details: `,c),this.fetchResource(t,i,r,o+1)}}};var Ht=require("obsidian");var Sd=require("obsidian"),Gb=/[\?<>\\:\*\|"]/g,Vb=/[\x00-\x1f\x80-\x9f]/g,Kb=/^\.+$/,Xb=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Jb=/[\. ]+$/,Qb=/^\./,e1=/\[/g,t1=/\]/g;function Wr(n){return n.replace(Gb,"").replace(Vb,"").replace(Kb,"").replace(Xb,"").replace(Jb,"").replace(e1,"").replace(t1,"").replace(Qb,"")}function Yr(n,e){let t="MMMM Do, YYYY",i=(0,Sd.moment)(n,t);return i.format(t)!==n?n:i.isValid()?i.format(e):n}var zr=require("obsidian"),n1=["POMO","word-count","date","slider","encrypt","TaoOfRoam","orphans","count","character-count","comment-button","query","streak","attr-table","mentions","search","roam/render","calc"],i1=new RegExp(`\\{\\{(\\[\\[)?(${n1.join("|")})(\\]\\])?.*?\\}\\}(\\})?`,"g"),r1=/{{pdf:|{{\[\[pdf|{{\[\[audio|{{audio:|{{video:|{{\[\[video/,Rd=/https:\/\/firebasestorage(.*?)\?alt(.*?)\)/,o1=/https:\/\/firebasestorage(.*?)\?alt(.*?)/,a1=/(?<=\(\()\b(.*?)\b(?=\)\))/g,Zr=class extends ue{constructor(){super(...arguments);this.downloadAttachments=!1;this.fileDateYAML=!1;this.titleYAML=!1;this.newestTimestamp=0;this.oldestTimestamp=0}init(){this.addFileChooserSetting("Roam (.json)",["json"]),this.addOutputLocationSetting("Roam"),this.userDNPFormat=this.getUserDNPFormat(),new Ht.Setting(this.modal.contentEl).setName("Import settings").setHeading(),new Ht.Setting(this.modal.contentEl).setName("Download all attachments").setDesc("If enabled, all attachments uploaded to Roam will be downloaded to your attachments folder.").addToggle(t=>{t.setValue(this.downloadAttachments),t.onChange(async i=>{this.downloadAttachments=i})}),new Ht.Setting(this.modal.contentEl).setName("Add YAML created/update date").setDesc("If enabled, notes will have the create-time and edit-time from Roam added as properties.").addToggle(t=>{t.setValue(this.fileDateYAML),t.onChange(async i=>{this.fileDateYAML=i})}),new Ht.Setting(this.modal.contentEl).setName("Add YAML title").setDesc("If enabled, notes will have the full title added as a property (regardless of illegal file name characters).").addToggle(t=>{t.setValue(this.titleYAML),t.onChange(async i=>{this.titleYAML=i})})}async import(t){this.progress=t;let{files:i}=this;if(i.length===0){new Ht.Notice("Please pick at least one file to import.");return}let r=await this.getOutputFolder();if(!r){new Ht.Notice("Please select a location to export to.");return}for(let o of i){if(t.isCancelled())return;let a=ze(o.basename),s=`${r.path}/${a}`,l=`${r.path}/${a}/Attachments`;await this.createFolders(s),await this.createFolders(l);let c=await o.readText(),p=JSON.parse(c),[m,g]=this.preprocess(p),b=new Map;for(let h in p){let E=p[h],T=Yr(Wr(E.title),this.userDNPFormat).trim();if(T===""){t.reportFailed(E.uid,"Title is empty"),console.error("Cannot import data with an empty title",E);continue}let A=`${s}/${T}.md`,O=this.titleYAML?E.title:"",_=0,k=0;if(this.fileDateYAML){let D=E["create-time"],C=E["edit-time"];typeof D=="number"&&(_=D),typeof C=="number"&&(k=C)}let w=await this.jsonToMarkdown(s,l,E,"",!1,O,_,k);b.set(A,w)}for(let h of g.values()){let E=await this.roamMarkupScrubber(s,l,h.blockString,!0),T=await this.extractAndProcessBlockReferences(b,m,s,E),A=`${s}/${h.pageName}.md`,O=b.get(A);if(O){let _=O.split(`
+`),k=_.findIndex(w=>w.contains("* "+E));k!==-1&&(_[k]=_[k].replace(E,T)),b.set(A,_.join(`
+`))}}let{vault:v}=this,d=b.size,f=1;for(let[h,E]of b.entries()){if(t.isCancelled())return;try{let{parent:T}=oe(h);await this.createFolders(T);let A=v.getAbstractFileByPath(h);A?await v.modify(A,E):await v.create(h,E),t.reportNoteSuccess(h),t.reportProgress(f,d)}catch(T){console.error("Error saving Markdown to file:",h,T),t.reportFailed(h)}f++}}}getUserDNPFormat(){let t=this.app.internalPlugins.getPluginById("daily-notes").instance;return t?t.options.format||"YYYY-MM-DD":(console.log('Daily note plugin is not enabled. Roam import defaulting to "YYYY-MM-DD" format.'),"YYYY-MM-DD")}preprocess(t){let i=new Map,r=new Map,o=this.userDNPFormat;function a(s,l){if(l.uid){let c=new Date(s.uid);if(!isNaN(c.getTime())){let g=Yr(s.title,o);s.title=g}let p={pageName:Wr(s.title),blockString:l.string};/.*?(\(\(.*?\)\)).*?/g.test(l.string)&&r.set(l.uid,p),i.set(l.uid,p)}if(l.children)for(let c of l.children)a(s,c)}for(let s of t)if(s.children)for(let l of s.children)a(s,l);return[i,r]}async roamMarkupScrubber(t,i,r,o=!1){return r=r.replace(i1,""),r.substring(0,8)==":hiccup "&&r.includes(":hr")?"---":(r=r.replace(/\[\[(.*?)\]\]/g,(a,s)=>`[[${Yr(Wr(s),this.userDNPFormat)}]]`),r=r.replace(/\[\[(.*\/.*)\]\]/g,(a,s)=>`[[${t}/${s}|${s}]]`),r=r.replace(/\[.+?\]\((\(.+?\)\))\)/g,"$1"),r=r.replace(/\[(.+?)\]\(\[\[(.+?)\]\]\)/g,"[[$2|$1]]"),r=r.replace(/\[\[>\]\]/g,">"),r=r.replace(/{{TODO}}|{{\[\[TODO\]\]}}/g,"[ ]"),r=r.replace(/{{DONE}}|{{\[\[DONE\]\]}}/g,"[x]"),r=r.replace("::",":"),r=r.replace(/{{.*?\bvideo\b.*?(\bhttp.*?\byoutu.*?)}}/g,""),r=r.replace(/(https?:\/\/twitter\.com\/(?:#!\/)?\w+\/status\/\d+(?:\?[\w=&-]+)?)/g,""),r=r.replace(/\_\_(.+?)\_\_/g,"*$1*"),r=r.replace(/\^\^(.+?)\^\^/g,"==$1=="),r=r.replace(/{{\[{0,2}embed.*?(\(\(.*?\)\)).*?}}/g,"$1"),r=r.replace(/{{\[{0,2}embed.*?(\[\[.*?\]\]).*?}}/g,"$1"),this.downloadAttachments&&!o&&r.includes("firebasestorage")&&(r=await this.downloadFirebaseFile(r,i)),r)}async jsonToMarkdown(t,i,r,o="",a=!1,s,l,c){let p=[],m=[],g=r["edit-time"],b=r["create-time"];if(this.newestTimestampg?c:g,b!==void 0?l>10?this.oldestTimestamp=Math.min(l,b):this.oldestTimestamp=b:this.oldestTimestamp=l,"string"in r&&r.string){let v=r.heading?"#".repeat(r.heading)+" ":"",d=await this.roamMarkupScrubber(t,i,r.string);p.push(`${a?o+"* ":o}${v}${d}`)}if(r.children)for(let v of r.children)p.push(await this.jsonToMarkdown(t,i,v,o+" ",!0,"",this.oldestTimestamp,this.newestTimestamp));if((this.fileDateYAML||this.titleYAML)&&!a){let v=this.oldestTimestamp;if(m.push("---"),this.titleYAML&&m.push(`title: "${s}"`),this.fileDateYAML){let d="YYYY-MM-DD HH:mm:ss",f=this.newestTimestamp?(0,zr.moment)(this.newestTimestamp).format(d):(0,zr.moment)(new Date).format(d),h=v?(0,zr.moment)(v).format(d):f;m.push("created: "+h),m.push("updated: "+f)}m.push("---"),p.unshift(m.join(`
+`))}return p.join(`
+`)}async modifySourceBlockString(t,i,r,o){if(!i.blockString.endsWith("^"+o)){let a=`${r}/${i.pageName}.md`,s=t.get(a);if(s){let l=s.split(`
+`),c=l.findIndex(p=>p.contains("* "+i.blockString));if(c!==-1){let p=i.blockString+" ^"+o;l[c]=l[c].replace(i.blockString,p),i.blockString=i.blockString+" ^"+o}t.set(a,l.join(`
+`))}}}async extractAndProcessBlockReferences(t,i,r,o){let a=o.match(a1);if(!a)return o;let s=[];for(let p of a)try{let m=i.get(p);if(!m){s.push(p);continue}let g=m.blockString.replace(/\[\[|\]\]/g,""),b=`[[${r}/${m.pageName}#^${p}|${g}]]`;await this.modifySourceBlockString(t,m,r,p),s.push(b)}catch(m){s.push(p)}let l=0;return o.replace(/\(\(\b.*?\b\)\)/g,()=>s[l++])}async downloadFirebaseFile(t,i){let{progress:r,vault:o}=this,a="";try{let s,l;if(r1.test(t)?(s=t.match(/https:\/\/firebasestorage(.*?)\?alt(.*?)\}/),l=t.match(/{{.*https:\/\/firebasestorage.*?alt=media&.*?(?=\s|$)/)):Rd.test(t)?(s=t.match(Rd),l=t.match(/!\[.*https:\/\/firebasestorage.*?alt=media&.*?(?=\s|$)/)):(s=t.match(o1),l=t.match(/https:\/\/firebasestorage.*?alt=media&.*?(?=\s|$)/)),s&&l){let c="https://firebasestorage"+s[1],p=decodeURIComponent(c.split("/").last()||"");if(p){let d=p.split("/");d.length>1&&(d.splice(-1,1),this.createFolders(`${i}/${d.join("/")}`))}else{let d=Math.floor(Date.now()/1e3),f=c.slice(-5).match(/(.*?)\.(.+)/);if(!f)return r.reportSkipped(s[1],"Unexpected file extension"),t;p=`${d}.${f[2]}`}let m=`${i}/${p}`;if(o.getAbstractFileByPath(m))return r.reportSkipped(s[1],"File already exists"),t;a=s[0].slice(0,-1);let v=await(await fetch(a,{})).arrayBuffer();return await o.createBinary(m,v),r.reportAttachmentSuccess(a),t.replace(l[0],`![[${m}]]`)}}catch(s){console.error(s),r.reportFailed(a,s)}return t}};var qt=require("obsidian");var Od=/!\[\]\(assets\/([^)]*)\)/g,Gr=class extends ue{init(){qt.Platform.isMacOS||this.modal.contentEl.createEl("p",{text:"Due to platform limitations, only textpack and zip files can be imported from this device. Open your vault on a Mac to import textbundle files."});let e=qt.Platform.isMacOS?["textbundle","textpack","zip"]:["textpack","zip"];this.addFileChooserSetting("Textbundle",e,!0),this.addOutputLocationSetting("Textbundle")}async import(e){let{files:t}=this;if(t.length===0){new qt.Notice("Please pick at least one file to import.");return}let i=await this.getOutputFolder();if(!i){new qt.Notice("Please select a location to export to.");return}this.attachmentsFolderPath=await this.createFolders(`${i.path}/assets`);for(let r of t)if(r.extension==="textpack")await yt(r,async(o,a)=>{await this.process(e,r.name,a)});else if(r.extension==="zip")await yt(r,async(o,a)=>{let s=this.groupFilesByTextbundle(r.name,a);for(let l of s)await this.process(e,r.name,l)});else{let a=await new en(`${r.toString()}/`).list();await this.process(e,r.name,a)}}groupFilesByTextbundle(e,t){let i={},r=e+"/",o=".textbundle";for(let a of t){if(!a.fullpath.startsWith(r)){console.log("Skipping",a.fullpath);continue}let s=a.fullpath.slice(r.length);if(s.startsWith("._")||s.startsWith("__MACOSX")){console.log("Skipping",a.fullpath);continue}let l=s.indexOf(o);if(l===-1){console.log("Skipping",a.fullpath);continue}let c=s.slice(0,l)+".textbundle";if(s.slice(l+o.length+1).startsWith("._")){console.log("Skipping",a.fullpath);continue}c in i?i[c].push(a):i[c]=[a]}return Object.values(i)}async process(e,t,i){let r=i.find(o=>o.name==="info.json");if(r){let o=await r.readText(),a=JSON.parse(o);if(a.hasOwnProperty("type")&&a.type!=="net.daringfireball.markdown"){e.reportSkipped(t,"The textbundle does not contain markdown");return}}for(let o of i)if(!o.name.startsWith("._"))try{if(o.type==="file"&&(o.extension==="md"||o.extension==="markdown")){let a="parent"in o?o.parent:t;a=a.replace(/.textbundle$/,"");let s=await o.readText();s.match(Od)&&(s=s.replace(Od,`![[${this.attachmentsFolderPath.path}/$1]]`));let l=(0,qt.normalizePath)(a),c=await this.getOutputFolder();await this.saveAsMarkdownFile(c,l,s),e.reportNoteSuccess(a)}else if(o.type==="file"&&o.fullpath.contains("assets/"))await this.importAsset(e,o);else if(o.type==="folder"){let{basename:a}=oe(o.toString());if(a!=="assets")continue;let l=await new en(`${o.toString()}/`).list();for(let c of l)await this.importAsset(e,c)}else o.name!=="info.json"&&e.reportSkipped(o.name,"the file is not a media or markdown file.")}catch(a){e.reportFailed(o.name,a)}}async importAsset(e,t){if(t.type==="folder"){e.reportSkipped(t.name);return}let i=`${this.attachmentsFolderPath.path}/${t.name}`;this.vault.getAbstractFileByPath(i)&&e.reportSkipped(t.name,"the file already exists.");let o=await t.read();await this.vault.createBinary(i,o),e.reportAttachmentSuccess(t.name)}};var qr="obsidian://importer-auth/",$n=["png","webp","jpg","jpeg","gif","bmp","svg","mpg","m4a","webm","wav","ogv","3gp","mov","mp4","mkv","pdf"],Vr=class{constructor(e){this.notes=0;this.attachments=0;this.skipped=[];this.failed=[];this.maxFileNameLength=100;this.statusMessage="";this.cancelled=!1;this.el=e,e.empty(),this.statusEl=e.createDiv("importer-status"),this.progressBarEl=e.createDiv("importer-progress-bar",t=>{this.progressBarInnerEl=t.createDiv("importer-progress-bar-inner")}),e.createDiv("importer-stats-container",t=>{t.createDiv("importer-stat mod-imported",i=>{this.importedCountEl=i.createDiv({cls:"importer-stat-count",text:"0"}),i.createDiv({cls:"importer-stat-name",text:"imported"})}),t.createDiv("importer-stat mod-attachments",i=>{this.attachmentCountEl=i.createDiv({cls:"importer-stat-count",text:"0"}),i.createDiv({cls:"importer-stat-name",text:"attachments"})}),t.createDiv("importer-stat mod-remaining",i=>{this.remainingCountEl=i.createDiv({cls:"importer-stat-count",text:"0"}),i.createDiv({cls:"importer-stat-name",text:"remaining"})}),t.createDiv("importer-stat mod-skipped",i=>{this.skippedCountEl=i.createDiv({cls:"importer-stat-count",text:"0"}),i.createDiv({cls:"importer-stat-name",text:"skipped"})}),t.createDiv("importer-stat mod-failed",i=>{this.failedCountEl=i.createDiv({cls:"importer-stat-count",text:"0"}),i.createDiv({cls:"importer-stat-name",text:"failed"})})}),this.importLogEl=e.createDiv("importer-log"),this.importLogEl.hide()}status(e){this.statusMessage=e,this.statusEl.setText(e.trim()+"...")}reportNoteSuccess(e){this.notes++,this.importedCountEl.setText(this.notes.toString())}reportAttachmentSuccess(e){this.attachments++,this.attachmentCountEl.setText(this.attachments.toString())}reportSkipped(e,t){let{importLogEl:i}=this;this.skipped.push(e),this.skippedCountEl.setText(this.skipped.length.toString()),console.log("Import skipped",e,t),this.importLogEl.createDiv("list-item",r=>{r.createSpan({cls:"importer-error",text:"Skipped: "}),r.createSpan({text:`"${ii(e,this.maxFileNameLength)}"`+(t?` because ${ii(String(t),this.maxFileNameLength)}`:"")})}),i.scrollTop=i.scrollHeight,i.show()}reportFailed(e,t){let{importLogEl:i}=this;this.failed.push(e),this.failedCountEl.setText(this.failed.length.toString()),console.log("Import failed",e,t),this.importLogEl.createDiv("list-item",r=>{r.createSpan({cls:"importer-error",text:"Failed: "}),r.createSpan({text:`"${ii(e,this.maxFileNameLength)}"`+(t?` because ${ii(String(t),this.maxFileNameLength)}`:"")})}),i.scrollTop=i.scrollHeight,i.show()}reportProgress(e,t){t<=0||(console.log("Current progress:",(100*e/t).toFixed(1)+"%"),this.remainingCountEl.setText((t-e).toString()),this.importedCountEl.setText(e.toString()),this.progressBarInnerEl.style.width=(100*e/t).toFixed(1)+"%")}cancel(){this.cancelled=!0,this.progressBarEl.hide(),this.statusEl.hide()}hideStatus(){this.progressBarEl.hide(),this.statusEl.hide()}isCancelled(){return this.cancelled}},s1={importers:{onenote:{previouslyImportedIDs:[]}}},Kr=class extends Wt.Plugin{async onload(){this.importers={"apple-notes":{name:"Apple Notes",optionText:"Apple Notes",importer:Tr,helpPermalink:"import/apple-notes"},bear:{name:"Bear",optionText:"Bear (.bear2bk)",importer:_r,helpPermalink:"import/bear"},evernote:{name:"Evernote",optionText:"Evernote (.enex)",importer:Mr,helpPermalink:"import/evernote"},keep:{name:"Google Keep",optionText:"Google Keep (.zip/.json)",importer:Br,helpPermalink:"import/google-keep"},html:{name:"HTML files",optionText:"HTML (.html)",importer:$r,helpPermalink:"import/html"},onenote:{name:"Microsoft OneNote",optionText:"Microsoft OneNote",importer:Hr,helpPermalink:"import/onenote"},notion:{name:"Notion",optionText:"Notion (.zip)",importer:jr,helpPermalink:"import/notion",formatDescription:"Export your Notion workspace to HTML format."},"roam-json":{name:"Roam Research",optionText:"Roam Research (.json)",importer:Zr,helpPermalink:"import/roam",formatDescription:"Export your Roam Research workspace to JSON format."},textbundle:{name:"Textbundle files",optionText:"Textbundle (.textbundle, .textpack)",importer:Gr,helpPermalink:"import/textbundle"}},this.addRibbonIcon("lucide-import","Open Importer",()=>{new _i(this.app,this).open()}),this.addCommand({id:"open-modal",name:"Open importer",callback:()=>{new _i(this.app,this).open()}}),this.registerObsidianProtocolHandler("importer-auth",e=>{if(this.authCallback){this.authCallback(e),this.authCallback=void 0;return}new Wt.Notice("Unexpected auth event. Please restart the auth process.")})}onunload(){}async loadData(){return Object.assign({},s1,await super.loadData())}async saveData(e){await super.saveData(e)}registerAuthCallback(e){this.authCallback=e}},_i=class extends Wt.Modal{constructor(t,i){super(t);this.current=null;this.plugin=i,this.titleEl.setText("Import data into Obsidian"),this.modalEl.addClass("mod-importer"),this.abortController=new AbortController;let r=Object.keys(i.importers);r.length>0&&(this.selectedId=r[0],this.updateContent())}updateContent(){let{contentEl:t,selectedId:i}=this,r=this.plugin.importers,o=r[i];t.empty();let a=new DocumentFragment;if(a.createSpan({text:"The format to be imported."}),o.formatDescription&&(a.createEl("br"),a.createSpan({text:o.formatDescription})),a.createEl("br"),a.createEl("a",{text:`Learn more about importing from ${o.name}.`,href:`https://help.obsidian.md/${o.helpPermalink}`}),new Wt.Setting(t).setName("File format").setDesc(a).addDropdown(s=>{for(let l in r)r.hasOwnProperty(l)&&s.addOption(l,r[l].optionText);s.onChange(l=>{r.hasOwnProperty(l)&&(this.selectedId=l,this.updateContent())}),s.setValue(this.selectedId)}),i&&r.hasOwnProperty(i)){let s=this.importer=new o.importer(this.app,this);if(s.notAvailable)return;t.createDiv("modal-button-container",l=>{l.createEl("button",{cls:"mod-cta",text:"Import"},c=>{c.addEventListener("click",async()=>{this.current&&this.current.cancel(),t.empty();let p=t.createDiv(),m=this.current=new Vr(p),g=t.createDiv("modal-button-container"),b=g.createEl("button",{cls:"mod-danger",text:"Stop"},v=>{v.addEventListener("click",()=>{m.cancel(),b.detach()})});try{await s.import(m)}finally{this.current===m&&(this.current=null),g.createEl("button",{text:"Import more"},v=>{v.addEventListener("click",()=>this.updateContent())}),b.detach(),g.createEl("button",{cls:"mod-cta",text:"Done"},v=>{v.addEventListener("click",()=>this.close())}),m.hideStatus()}})})})}}onClose(){let{contentEl:t,current:i}=this;t.empty(),this.abortController.abort("import was canceled by user"),i&&i.cancel()}};
+/*! Bundled license information:
+
+sax/lib/sax.js:
+ (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
+*/
+
+/* nosourcemap */
\ No newline at end of file
diff --git a/.obsidian/plugins/obsidian-importer/manifest.json b/.obsidian/plugins/obsidian-importer/manifest.json
new file mode 100644
index 0000000..3e95056
--- /dev/null
+++ b/.obsidian/plugins/obsidian-importer/manifest.json
@@ -0,0 +1,10 @@
+{
+ "id": "obsidian-importer",
+ "name": "Importer",
+ "version": "1.6.22",
+ "minAppVersion": "0.15.0",
+ "description": "Import data from Notion, Evernote, Apple Notes, Microsoft OneNote, Google Keep, Bear, Roam, and HTML files.",
+ "author": "Obsidian",
+ "authorUrl": "https://obsidian.md",
+ "isDesktopOnly": false
+}
diff --git a/.obsidian/plugins/obsidian-importer/styles.css b/.obsidian/plugins/obsidian-importer/styles.css
new file mode 100644
index 0000000..6f9b809
--- /dev/null
+++ b/.obsidian/plugins/obsidian-importer/styles.css
@@ -0,0 +1,87 @@
+.modal.mod-importer {
+ max-height: var(--modal-height);
+ padding: var(--size-4-4) 0 0 0;
+ position: relative;
+ overflow: hidden;
+}
+.modal.mod-importer .modal-title {
+ padding: 0 var(--size-4-4);
+}
+.modal.mod-importer .modal-content {
+ overflow: auto;
+ padding: var(--size-4-4);
+ margin-bottom: calc(var(--input-height) + var(--size-4-8));
+ border-top: var(--border-width) solid var(--background-modifier-border);
+}
+.modal.mod-importer .modal-button-container {
+ margin: 0 0 0 calc(var(--size-4-4) * -1);
+ padding: var(--size-4-4);
+ gap: var(--size-4-2);
+ position: absolute;
+ bottom: 0;
+ background-color: var(--background-primary);
+ border-top: var(--border-width) solid var(--background-modifier-border);
+ width: 100%;
+}
+
+.importer-progress-bar {
+ width: 100%;
+ height: 8px;
+ background-color: var(--background-secondary);
+ overflow: hidden;
+ box-shadow: inset 0px 0px 0px 1px var(--background-modifier-border);
+ border-radius: var(--radius-s);
+}
+
+.importer-progress-bar-inner {
+ width: 0;
+ height: 100%;
+ background-color: var(--interactive-accent);
+}
+
+.importer-status {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding: var(--size-4-2) 0;
+}
+
+.importer-stats-container {
+ display: flex;
+ justify-content: space-evenly;
+ margin-top: var(--size-4-5);
+ margin-bottom: var(--size-4-5);
+}
+
+.importer-stat {
+ text-align: center;
+}
+
+.importer-stat-count {
+ font-size: var(--font-ui-large);
+}
+
+.importer-log {
+ overflow: auto;
+ flex-grow: 1;
+ font-family: var(--font-monospace);
+ font-size: var(--font-ui-smaller);
+ color: var(--text-muted);
+ border: 1px solid var(--background-modifier-border);
+ padding: var(--size-4-4);
+ background-color: var(--background-secondary);
+ border-radius: var(--radius-s);
+ max-height: 300px;
+ user-select: text;
+}
+
+.importer-log .list-item {
+ display: inline-block;
+ line-height: var(--line-height-normal);
+ white-space: pre;
+ margin: var(--size-2-1);
+}
+
+.importer-error {
+ color: var(--text-error);
+}
diff --git a/.obsidian/plugins/remember-cursor-position/cursor-positions.json b/.obsidian/plugins/remember-cursor-position/cursor-positions.json
index 958f0bf..7b88428 100644
--- a/.obsidian/plugins/remember-cursor-position/cursor-positions.json
+++ b/.obsidian/plugins/remember-cursor-position/cursor-positions.json
@@ -1 +1 @@
-{"月度/8月/8月.md":{"scroll":385.7604,"cursor":{"from":{"ch":5,"line":392},"to":{"ch":14,"line":392}}},"材料/服务器.md":{"scroll":30.1953,"cursor":{"from":{"ch":58,"line":43},"to":{"ch":58,"line":43}}},"月度/9月/9月.md":{"scroll":59.2834,"cursor":{"from":{"ch":43,"line":76},"to":{"ch":43,"line":76}}},"月度/7月/7月.md":{"scroll":138.3906,"cursor":{"from":{"ch":29,"line":147},"to":{"ch":29,"line":147}}},"月度/6月/6月.md":{"scroll":58.2917,"cursor":{"from":{"ch":72,"line":63},"to":{"ch":72,"line":63}}},"月度/5月/5月.md":{"scroll":93.1957,"cursor":{"from":{"ch":20,"line":105},"to":{"ch":20,"line":105}}},"月度/4月/4月.md":{"scroll":120.1806,"cursor":{"from":{"ch":20,"line":139},"to":{"ch":20,"line":139}}},"月度/3月/3月.md":{"scroll":32.7083,"cursor":{"from":{"ch":6,"line":39},"to":{"ch":6,"line":39}}},"月度/7月/7月工作总结及8月工作计划.md":{"scroll":0,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/6月/6月份晨午检bug修复.md":{"scroll":307.9981,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/7月/设备管理中心研发记录.md":{"scroll":110.1015,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/8月/CA身份认证app/CA身份认证app流程图.md":{"scroll":5.8654,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/9月/常见病/20250903常见病优化沟通.md":{"scroll":0.7205,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/9月/汇海/对接主机/2.0/不登录模式接口文档.md":{"scroll":0,"cursor":{"from":{"ch":61,"line":2},"to":{"ch":61,"line":2}}},"月度/9月/汇海/对接主机/2.0/登录算法和密钥.md":{"scroll":0.1746,"cursor":{"from":{"ch":0,"line":9},"to":{"ch":0,"line":9}}}}
\ No newline at end of file
+{"月度/8月/8月.md":{"scroll":385.7604,"cursor":{"from":{"ch":5,"line":392},"to":{"ch":14,"line":392}}},"材料/服务器.md":{"scroll":30.1953,"cursor":{"from":{"ch":58,"line":43},"to":{"ch":58,"line":43}}},"月度/9月/9月.md":{"scroll":193.938,"cursor":{"from":{"ch":0,"line":222},"to":{"ch":0,"line":222}}},"月度/7月/7月.md":{"scroll":138.3906,"cursor":{"from":{"ch":29,"line":147},"to":{"ch":29,"line":147}}},"月度/6月/6月.md":{"scroll":58.2917,"cursor":{"from":{"ch":72,"line":63},"to":{"ch":72,"line":63}}},"月度/5月/5月.md":{"scroll":93.1957,"cursor":{"from":{"ch":20,"line":105},"to":{"ch":20,"line":105}}},"月度/4月/4月.md":{"scroll":120.1806,"cursor":{"from":{"ch":20,"line":139},"to":{"ch":20,"line":139}}},"月度/3月/3月.md":{"scroll":32.7083,"cursor":{"from":{"ch":6,"line":39},"to":{"ch":6,"line":39}}},"月度/7月/7月工作总结及8月工作计划.md":{"scroll":0,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/6月/6月份晨午检bug修复.md":{"scroll":307.9981,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/7月/设备管理中心研发记录.md":{"scroll":110.1015,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/8月/CA身份认证app/CA身份认证app流程图.md":{"scroll":5.8654,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/9月/常见病/20250903常见病优化沟通.md":{"scroll":0.7205,"cursor":{"from":{"ch":0,"line":0},"to":{"ch":0,"line":0}}},"月度/9月/汇海/对接主机/2.0/不登录模式接口文档.md":{"scroll":0,"cursor":{"from":{"ch":61,"line":2},"to":{"ch":61,"line":2}}},"月度/9月/汇海/对接主机/2.0/登录算法和密钥.md":{"scroll":0.1746,"cursor":{"from":{"ch":0,"line":9},"to":{"ch":0,"line":9}}}}
\ No newline at end of file
diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json
index cb3edb0..7baad3b 100644
--- a/.obsidian/workspace.json
+++ b/.obsidian/workspace.json
@@ -11,10 +11,14 @@
"id": "c7bc73ee9f913d5a",
"type": "leaf",
"state": {
- "type": "empty",
- "state": {},
+ "type": "markdown",
+ "state": {
+ "file": "月度/9月/9月.md",
+ "mode": "source",
+ "source": false
+ },
"icon": "lucide-file",
- "title": "新标签页"
+ "title": "9月"
}
}
]
@@ -74,7 +78,7 @@
}
],
"direction": "horizontal",
- "width": 200
+ "width": 275.5
},
"right": {
"id": "05ec8585e34884ac",
@@ -90,12 +94,13 @@
"state": {
"type": "outline",
"state": {
+ "file": "月度/9月/9月.md",
"followCursor": false,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-list",
- "title": "大纲"
+ "title": "9月 的大纲"
}
},
{
@@ -156,12 +161,12 @@
"title": "标签"
}
}
- ],
- "currentTab": 1
+ ]
}
],
"direction": "horizontal",
- "width": 261.5
+ "width": 330.5,
+ "collapsed": true
},
"left-ribbon": {
"hiddenItems": {
@@ -175,11 +180,17 @@
"command-palette:打开命令面板": false,
"obsidian-excalidraw-plugin:新建绘图文件": false,
"univer:Univer": false,
- "obsidian-git:Open Git source control": false
+ "obsidian-git:Open Git source control": false,
+ "obsidian-importer:Open Importer": false
}
},
"active": "c7bc73ee9f913d5a",
"lastOpenFiles": [
+ "材料/配置/新建 文本文档.html",
+ "材料/配置/新建 文本文档.txt",
+ "材料/配置/自定义短横线.md",
+ "材料/配置/自定义短横线.html",
+ "月度/9月/9月.md",
"月度/9月/调查问卷.md",
"未命名.base",
"月度/9月/汇海/对接主机/2.0/主机登录模式API接口文档2.0 ~F552E.tmp",
@@ -188,7 +199,6 @@
"月度/9月/常见病/20250903常见病优化沟通.md",
"月度/7月/ca会议纪要.md",
"月度/9月/常见病/4.2025年全国学生常见病和影响因素监测与干预项目工作手册0903.docx",
- "月度/9月/9月.md",
"月度/封面.base",
"月度/9月/关于北体大-乌市体育调研工作会议.md",
"月度/9月/汇海/对接主机/2.0/主机登录模式API接口文档2.0 .docx",
@@ -196,9 +206,6 @@
"月度/9月/汇海/对接主机/2.0/主机登录模式API接口文档2.0 ~9BCC8.tmp",
"月度/9月/汇海/对接主机/2.0/登录算法和密钥.md",
"月度/9月/汇海/对接主机/2.0/主机登录模式API接口文档2.0 ~CFAF6.tmp",
- "月度/9月/汇海/对接主机/2.0/~$登录模式API接口文档2.0 .docx",
- "月度/9月/汇海/对接主机/2.0/华夏汇海体测系统接口V2.0 .docx",
- "月度/9月/汇海/对接主机/2.0/~$汇海体测系统接口V2.0 .docx",
"月度/9月/汇海/解析汇海设备请求.md",
"月度/9月/汇海/体质测试数据上传接口文档.md",
"月度/9月/汇海/华夏汇海技术对接交流会议纪要.md",
@@ -214,8 +221,6 @@
"月度/8月/CA身份认证app/CA身份认证app流程图.md",
"月度/7月/设备管理中心研发记录.md",
"月度/7月/华为服务器测试报告.md",
- "月度/7月/7月工作总结及8月工作计划.md",
- "月度/7月/7月份晨午检bug修复.md",
"图片/9月.png",
"月度/未命名.canvas",
"图片/8月.png",
diff --git a/月度/9月/9月.md b/月度/9月/9月.md
index e82a664..c0af540 100644
--- a/月度/9月/9月.md
+++ b/月度/9月/9月.md
@@ -218,5 +218,5 @@ MaterialApp(
石榴籽具体落实
- 家校协同:体测通过石榴籽平台,使老师,家长能用。班主任,体育教师,家长能注册(孩子暂时不考虑)。能够选择学校,选择班级。重点是家校通知(致家长一封信,学生餐单,视力检测通知,体测结果通知,布置打卡任务【每个层级看到的消息通知不一样】),一周开发出来。
[[家校通需求]]
-
+[家校通-功能需求说明书(手写版-v1.0)](https://doc.weixin.qq.com/doc/w3_AZcAuwb0ADQCNJJlyCrRBQB2dJudw?scode=ACcAjgdrAA03e12Xn4AZcAuwb0ADQ&version=5.0.0.8002&platform=win)
diff --git a/月度/9月/调查问卷.md b/月度/9月/调查问卷.md
deleted file mode 100644
index ee85c37..0000000
--- a/月度/9月/调查问卷.md
+++ /dev/null
@@ -1 +0,0 @@
-1.
\ No newline at end of file
diff --git a/材料/配置/新建 文本文档.html b/材料/配置/新建 文本文档.html
new file mode 100644
index 0000000..718d5f9
--- /dev/null
+++ b/材料/配置/新建 文本文档.html
@@ -0,0 +1,216 @@
+短横线 2025-09-14 19:00:57
+
+
+