You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
181 KiB

3 years ago
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
1 month ago
var Kn=Object.create;var bt=Object.defineProperty;var Jn=Object.getOwnPropertyDescriptor;var Zn=Object.getOwnPropertyNames;var Qn=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty;var tr=(i,t,e)=>t in i?bt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var at=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),ir=(i,t)=>{for(var e in t)bt(i,e,{get:t[e],enumerable:!0})},Na=(i,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Zn(t))!er.call(i,n)&&n!==e&&bt(i,n,{get:()=>t[n],enumerable:!(a=Jn(t,n))||a.enumerable});return i};var zt=(i,t,e)=>(e=i!=null?Kn(Qn(i)):{},Na(t||!i||!i.__esModule?bt(e,"default",{value:i,enumerable:!0}):e,i)),ar=i=>Na(bt({},"__esModule",{value:!0}),i);var _=(i,t,e)=>tr(i,typeof t!="symbol"?t+"":t,e);var Ua=at(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.toSeconds=ae.end=ae.parse=ae.pattern=void 0;var rt="\\d+",Ai="".concat(rt,"(?:[\\.,]").concat(rt,")?"),rr="(".concat(rt,"Y)?(").concat(rt,"M)?(").concat(rt,"W)?(").concat(rt,"D)?"),sr="T(".concat(Ai,"H)?(").concat(Ai,"M)?(").concat(Ai,"S)?"),or="P(?:".concat(rr,"(?:").concat(sr,")?)"),lr=["years","months","weeks","days","hours","minutes","seconds"],Fa=Object.freeze({years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0});ae.pattern=new RegExp(or);var pr=function(i){var t=i.replace(/,/g,".").match(ae.pattern);if(!t)throw new RangeError("invalid duration: ".concat(i));var e=t.slice(1);if(e.filter(function(a){return a!=null}).length===0)throw new RangeError("invalid duration: ".concat(i));if(e.filter(function(a){return/\./.test(a||"")}).length>1)throw new RangeError("only the smallest unit can be fractional");return e.reduce(function(a,n,r){return a[lr[r]]=parseFloat(n||"0")||0,a},{})};ae.parse=pr;var cr=function(i,t){t===void 0&&(t=new Date);var e=Object.assign({},Fa,i),a=t.getTime(),n=new Date(a);n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+e.days);var r=e.hours*3600*1e3,s=e.minutes*60*1e3;return n.setMilliseconds(n.getMilliseconds()+e.seconds*1e3+r+s),n.setDate(n.getDate()+e.weeks*7),n};ae.end=cr;var mr=function(i,t){t===void 0&&(t=new Date);var e=Object.assign({},Fa,i),a=t.getTime(),n=new Date(a),r=(0,ae.end)(e,n),s=t.getTimezoneOffset(),p=r.getTimezoneOffset(),l=(s-p)*60,c=(r.getTime()-n.getTime())/1e3;return c+l};ae.toSeconds=mr;ae.default={end:ae.end,toSeconds:ae.toSeconds,pattern:ae.pattern,parse:ae.parse}});var Vi=at((Fi,Ui)=>{(function(i,t){typeof Fi=="object"&&typeof Ui!="undefined"?Ui.exports=t():typeof define=="function"&&define.amd?define(t):(i=typeof globalThis!="undefined"?globalThis:i||self,i.DOMPurify=t())})(Fi,function(){"use strict";function i(h){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},i(h)}function t(h,b){return t=Object.setPrototypeOf||function(C,Y){return C.__proto__=Y,C},t(h,b)}function e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}function a(h,b,A){return e()?a=Reflect.construct:a=function(Y,Te,he){var Re=[null];Re.push.apply(Re,Te);var je=Function.bind.apply(Y,Re),gt=new je;return he&&t(gt,he.prototype),gt},a.apply(null,arguments)}function n(h){return r(h)||s(h)||p(h)||c()}function r(h){if(Array.isArray(h))return l(h)}function s(h){if(typeof Symbol!="undefined"&&h[Symbol.iterator]!=null||h["@@iterator"]!=null)return Array.from(h)}function p(h,b){if(h){if(typeof h=="string")return l(h,b);var A=Object.prototype.toString.call(h).slice(8,-1);if(A==="Object"&&h.constructor&&(A=h.constructor.name),A==="Map"||A==="Set")return Array.from(h);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return l(h,b)}}function l(h,b){(b==null||b>h.length)&&(b=h.length);for(var A=0,C=new Array(b);A<b;A++)C[A]=h[A];return C}func
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u=Object.hasOwnProperty,v=Object.setPrototypeOf,k=Object.isFrozen,y=Object.getPrototypeOf,D=Object.getOwnPropertyDescriptor,N=Object.freeze,S=Object.seal,j=Object.create,U=typeof Reflect!="undefined"&&Reflect,z=U.apply,x=U.construct;z||(z=function(b,A,C){return b.apply(A,C)}),N||(N=function(b){return b}),S||(S=function(b){return b}),x||(x=function(b,A){return a(b,n(A))});var X=G(Array.prototype.forEach),E=G(Array.prototype.pop),I=G(Array.prototype.push),J=G(String.prototype.toLowerCase),ne=G(String.prototype.toString),le=G(String.prototype.match),V=G(String.prototype.replace),Ee=G(String.prototype.indexOf),Ie=G(String.prototype.trim),M=G(RegExp.prototype.test),O=Ae(TypeError);function G(h){return function(b){for(var A=arguments.length,C=new Array(A>1?A-1:0),Y=1;Y<A;Y++)C[Y-1]=arguments[Y];return z(h,b,C)}}function Ae(h){return function(){for(var b=arguments.length,A=new Array(b),C=0;C<b;C++)A[C]=arguments[C];return x(h,A)}}function w(h,b,A){var C;A=(C=A)!==null&&C!==void 0?C:J,v&&v(h,null);for(var Y=b.length;Y--;){var Te=b[Y];if(typeof Te=="string"){var he=A(Te);he!==Te&&(k(b)||(b[Y]=he),Te=he)}h[Te]=!0}return h}function re(h){var b=j(null),A;for(A in h)z(u,h,[A])===!0&&(b[A]=h[A]);return b}function L(h,b){for(;h!==null;){var A=D(h,b);if(A){if(A.get)return G(A.get);if(typeof A.value=="function")return G(A.value)}h=y(h)}function C(Y){return console.warn("fallback value for",Y),null}return C}var me=N(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fe=N(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ve=N(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ce=N(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ge=N(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),be=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xe=N(["#text"]),ue=N(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","colo
`+K),Je&&(K=V(K,ri," "),K=V(K,si," "),K=V(K,oi," ")),ke&&Ot?ke.createHTML(K):K},b.setConfig=function(T){bi(T),ui=!0},b.clearConfig=function(){it=null,ui=!1},b.isValidAttribute=function(T,o,m){it||bi({});var g=ee(T),P=ee(o);return xa(g,P,m)},b.addHook=function(T,o){typeof o=="function"&&(Pe[T]=Pe[T]||[],I(Pe[T],o))},b.removeHook=function(T){if(Pe[T])return E(Pe[T])},b.removeHooks=function(T){Pe[T]&&(Pe[T]=[])},b.removeAllHooks=function(){Pe={}},b}var _n=Zi();return _n})});var Hi=at((xo,pn)=>{pn.exports=window.DOMPurify||(window.DOMPurify=Vi().default||Vi())});var dn=at((Vo,$i)=>{function un(i,t){if(t&&t.documentElement)i=t,t=arguments[2];else if(!i||!i.documentElement)throw new Error("First argument to Readability constructor should be a document object.");if(t=t||{},this._doc=i,this._docJSDOMParser=this._doc.firstChild.__JSDOMParser__,this._articleTitle=null,this._articleByline=null,this._articleDir=null,this._articleSiteName=null,this._attempts=[],this._debug=!!t.debug,this._maxElemsToParse=t.maxElemsToParse||this.DEFAULT_MAX_ELEMS_TO_PARSE,this._nbTopCandidates=t.nbTopCandidates||this.DEFAULT_N_TOP_CANDIDATES,this._charThreshold=t.charThreshold||this.DEFAULT_CHAR_THRESHOLD,this._classesToPreserve=this.CLASSES_TO_PRESERVE.concat(t.classesToPreserve||[]),this._keepClasses=!!t.keepClasses,this._serializer=t.serializer||function(e){return e.innerHTML},this._disableJSONLD=!!t.disableJSONLD,this._allowedVideoRegex=t.allowedVideoRegex||this.REGEXPS.videos,this._flags=this.FLAG_STRIP_UNLIKELYS|this.FLAG_WEIGHT_CLASSES|this.FLAG_CLEAN_CONDITIONALLY,this._debug){let e=function(a){if(a.nodeType==a.TEXT_NODE)return`${a.nodeName} ("${a.textContent}")`;let n=Array.from(a.attributes||[],function(r){return`${r.name}="${r.value}"`}).join(" ");return`<${a.localName} ${n}>`};this.log=function(){if(typeof console!="undefined"){let n=Array.from(arguments,r=>r&&r.nodeType==this.ELEMENT_NODE?e(r):r);n.unshift("Reader: (Readability)"),console.log.apply(console,n)}else if(typeof dump!="undefined"){var a=Array.prototype.map.call(arguments,function(n){return n&&n.nodeName?e(n):n}).join(" ");dump("Reader: (Readability) "+a+`
`)}}}else this.log=function(){}}un.prototype={FLAG_STRIP_UNLIKELYS:1,FLAG_WEIGHT_CLASSES:2,FLAG_CLEAN_CONDITIONALLY:4,ELEMENT_NODE:1,TEXT_NODE:3,DEFAULT_MAX_ELEMS_TO_PARSE:0,DEFAULT_N_TOP_CANDIDATES:5,DEFAULT_TAGS_TO_SCORE:"section,h2,h3,h4,h5,h6,p,td,pre".toUpperCase().split(","),DEFAULT_CHAR_THRESHOLD:500,REGEXPS:{unlikelyCandidates:/-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,okMaybeItsACandidate:/and|article|body|column|content|main|shadow/i,positive:/article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,negative:/-ad-|hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|gdpr|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i,extraneous:/print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i,byline:/byline|author|dateline|writtenby|p-author/i,replaceFonts:/<(\/?)font[^>]*>/gi,normalize:/\s{2,}/g,videos:/\/\/(www\.)?((dailymotion|youtube|youtube-nocookie|player\.vimeo|v\.qq)\.com|(archive|upload\.wikimedia)\.org|player\.twitch\.tv)/i,shareElements:/(\b|_)(share|sharedaddy)(\b|_)/i,nextLink:/(next|weiter|continue|>([^\|]|$)|»([^\|]|$))/i,prevLink:/(prev|earl|old|new|<|«)/i,tokenize:/\W+/g,whitespace:/^\s*$/,hasContent:/\S$/,hashUrl:/^#.+/,srcsetUrl:/(\S+)(\s+[\d.]+[xw])?(\s*(?:,|$))/g,b64DataUrl:/^data:\s*([^\s;,]+)\s*;\s*base64\s*,/i,commas:/\u002C|\u060C|\uFE50|\uFE10|\uFE11|\u2E41|\u2E34|\u2E32|\uFF0C/g,jsonLdArticleTypes:/^Article|AdvertiserContentArticle|NewsArticle|AnalysisNewsArticle|AskPublicNewsArticle|BackgroundNewsArticle|OpinionNewsArticle|ReportageNewsArticle|ReviewNewsArticle|Report|SatiricalArticle|ScholarlyArticle|MedicalScholarlyArticle|SocialMediaPosting|BlogPosting|LiveBlogPosting|DiscussionForumPosting|TechArticle|APIReference$/},UNLIKELY_ROLES:["menu","menubar","complementary","navigation","alert","alertdialog","dialog"],DIV_TO_P_ELEMS:new Set(["BLOCKQUOTE","DL","DIV","IMG","OL","P","PRE","TABLE","UL"]),ALTER_TO_DIV_EXCEPTIONS:["DIV","ARTICLE","SECTION","P"],PRESENTATIONAL_ATTRIBUTES:["align","background","bgcolor","border","cellpadding","cellspacing","frame","hspace","rules","style","valign","vspace"],DEPRECATED_SIZE_ATTRIBUTE_ELEMS:["TABLE","TH","TD","HR","PRE"],PHRASING_ELEMS:["ABBR","AUDIO","B","BDO","BR","BUTTON","CITE","CODE","DATA","DATALIST","DFN","EM","EMBED","I","IMG","INPUT","KBD","LABEL","MARK","MATH","METER","NOSCRIPT","OBJECT","OUTPUT","PROGRESS","Q","RUBY","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRONG","SUB","SUP","TEXTAREA","TIME","VAR","WBR"],CLASSES_TO_PRESERVE:["page"],HTML_ESCAPE_MAP:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"},_postProcessContent:function(i){this._fixRelativeUris(i),this._simplifyNestedElements(i),this._keepClasses||this._cleanClasses(i)},_removeNodes:function(i,t){if(this._docJSDOMParser&&i._isLiveNodeList)throw new Error("Do not pass live node lists to _removeNodes");for(var e=i.length-1;e>=0;e--){var a=i[e],n=a.parentNode;n&&(!t||t.call(this,a,e,i))&&n.removeChild(a)}},_replaceNodeTags:function(i,t){if(this._docJSDOMParser&&i._isLiveNodeList)throw new Error("Do not pass live node lists to _replaceNodeTags");for(let e of i)this._setNodeTag(e,t)},_forEachNode:function(i,t){Array.prototype.forEach.call(i,t,this)},_findNode:function(i,t){return Array.prototype.find.call(i,t,this)},_someNode:function(i,t){return Array.prototype.some.call(i,t,this)},_everyNode:function(i,t){return Array.prototype.every.call(i,t,this)},_concatNodeLists:function(){var i=Array.prototype.slice,t=i.call(arguments),e=t.map(function(a){return i.call(a)});return Array.prototype.concat.apply([],e)},_getAllNodesWithTag:function(i,t){return i.querySelectorAll?i.querySelectorAll(t.join(",")):[].concat.apply([],t.map(function(e){var a=i.getElementsByTagName(e);return Array.isArray(a)?a:Array.from(a)}))},_cleanClasses:function(i){v
`;case"comma":return",";case"period":return".";case"semicolon":return";"}}function Sa(){return[{label:"Ask",option:"ask"},{label:"Nothing",option:"nothing"},{label:"Append to the existing note",option:"appendToExisting"}]}var d={inboxDir:"ReadItLater Inbox",assetsDir:"ReadItLater Inbox/assets",openNewNote:!1,batchProcess:!1,batchProcessDelimiter:"newLine",openNewNoteInNewTab:!1,youtubeContentTypeSlug:"youtube",youtubeNoteTitle:"Youtube - {{ title }}",youtubeNote:`[[ReadItLater]] [[Youtube]]
2 months ago
# [{{ videoTitle }}]({{ videoURL }})
3 years ago
2 months ago
{{ videoPlayer }}`,youtubeEmbedWidth:"560",youtubeEmbedHeight:"315",youtubeUsePrivacyEnhancedEmbed:!0,vimeoContentTypeSlug:"vimeo",vimeoNoteTitle:"Vimeo - {{ title }}",vimeoNote:`[[ReadItLater]] [[Vimeo]]
3 years ago
2 months ago
# [{{ videoTitle }}]({{ videoURL }})
3 years ago
1 month ago
{{ videoPlayer }}
{{ videoChapters }}`,vimeoEmbedWidth:"560",vimeoEmbedHeight:"315",bilibiliContentTypeSlug:"bilibili",bilibiliNoteTitle:"Bilibili - {{ title }}",bilibiliNote:`[[ReadItLater]] [[Bilibili]]
3 years ago
2 months ago
# [{{ videoTitle }}]({{ videoURL }})
3 years ago
2 months ago
{{ videoPlayer }}`,bilibiliEmbedWidth:"560",bilibiliEmbedHeight:"315",twitterContentTypeSlug:"xcom",twitterNoteTitle:"Tweet from {{ tweetAuthorName }} ({{ date }})",twitterNote:`[[ReadItLater]] [[Tweet]]
3 years ago
2 months ago
# [{{ tweetAuthorName }}]({{ tweetURL }})
3 years ago
2 months ago
{{ tweetContent }}`,parseableArticleContentType:"article",parseableArticleNoteTitle:"{{ title }}",parsableArticleNote:`[[ReadItLater]] [[Article]]
3 years ago
2 months ago
# [{{ articleTitle }}]({{ articleURL }})
3 years ago
2 months ago
{{ articleContent }}`,notParseableArticleContentType:"article",notParseableArticleNoteTitle:"Article {{ date }}",notParsableArticleNote:`[[ReadItLater]] [[Article]]
3 years ago
2 months ago
[{{ articleURL }}]({{ articleURL }})`,textSnippetContentType:"textsnippet",textSnippetNoteTitle:"Note {{ date }}",textSnippetNote:`[[ReadItLater]] [[Textsnippet]]
3 years ago
2 months ago
{{ content }}`,mastodonContentTypeSlug:"mastodon",mastodonNoteTitle:"Toot from {{ tootAuthorName }} ({{ date }})",mastodonNote:`[[ReadItLater]] [[Toot]]
3 years ago
2 months ago
# [{{ tootAuthorName }}]({{ tootURL }})
3 years ago
2 months ago
> {{ tootContent }}`,downloadImages:!0,downloadImagesInArticleDir:!1,dateTitleFmt:"YYYY-MM-DD HH-mm-ss",dateContentFmt:"YYYY-MM-DD",downloadMastodonMediaAttachments:!0,downloadMastodonMediaAttachmentsInDir:!1,saveMastodonReplies:!1,mastodonReply:`[{{ tootAuthorName }}]({{ tootURL }})
3 years ago
2 months ago
> {{ tootContent }}`,stackExchangeContentType:"stackexchange",stackExchangeNoteTitle:"{{ title }}",stackExchangeNote:`[[ReadItLater]] [[StackExchange]]
3 years ago
2 months ago
# [{{ questionTitle }}]({{ questionURL }})
3 years ago
2 months ago
Author: [{{ authorName }}]({{ authorProfileURL }})
3 years ago
2 months ago
{{ questionContent }}
3 years ago
***
3 years ago
2 months ago
{{ topAnswer }}
3 years ago
2 months ago
{{ answers }}`,stackExchangeAnswer:`Answered by: [{{ authorName }}]({{ authorProfileURL }})
3 years ago
2 months ago
{{ answerContent }}`,downloadStackExchangeAssets:!0,downloadStackExchangeAssetsInDir:!1,youtubeApiKey:"",tikTokContentTypeSlug:"tiktok",tikTokNoteTitle:"TikTok from {{ authorName }} ({{ date }})",tikTokNote:`[[ReadItLater]] [[TikTok]]
2 years ago
2 months ago
{{ videoDescription }}
2 years ago
2 months ago
[{{ videoURL }}]({{ videoURL }})
2 years ago
1 month ago
{{ videoPlayer }}`,tikTokEmbedWidth:"325",tikTokEmbedHeight:"760",extendShareMenu:!0,filesystemLimitPath:null,filesystemLimitFileName:null,youtubeChannelContentTypeSlug:"youtube-channel",youtubeChannelNoteTitle:"{{ title }}",youtubeChannelNote:`[[ReadItLater]] [[YoutubeChannel]]
# [{{ channelTitle }}]({{ channelURL }})
![{{ channelTitle }}|300]({{ channelAvatar }})
[Videos]({{ channelVideosURL }})
{{ channelSubscribersCount|numberLexify }} subscribers`,fileExistsStrategy:"ask"};var f=require("obsidian");var La=require("obsidian");var Da={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":[
`)}getVideoChapters(e){let a=/^((?:\d{1,2}:)?(?:\d{1,2}):(?:\d{1,2}))\s+(.+)$/gm,n=[],r;for(;(r=a.exec(e))!==null;){let s=r[1].trim(),p=r[2].trim(),l=s.split(":"),c=0,u,v;l.length===3?[c,u,v]=l.map(Number):[u,v]=l.map(Number);let k=c*3600+u*60+v;n.push({timestamp:s,title:p,seconds:k})}return n}getEmbedPlayer(e){let a=this.plugin.settings.youtubeUsePrivacyEnhancedEmbed?"youtube-nocookie.com":"youtube.com";return`<iframe width="${this.plugin.settings.youtubeEmbedWidth}" height="${this.plugin.settings.youtubeEmbedHeight}" src="https://www.${a}/embed/${e}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`}},za=Si;var Ba=require("obsidian");var _i=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(vimeo.com)\/(\d+)?/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await this.parseSchema(e,a),r=this.templateEngine.render(this.plugin.settings.vimeoNote,n),s=this.templateEngine.render(this.plugin.settings.vimeoNoteTitle,{title:n.videoTitle,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.vimeoContentTypeSlug,a)}async parseSchema(e,a){var u,v,k,y,D,N;let n=await(0,Ba.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"}}),s=new DOMParser().parseFromString(n,"text/html").querySelector('script[type="application/ld+json"]'),l=JSON.parse(s.textContent)[0],c=this.PATTERN.exec(e);return{date:this.getFormattedDateForContent(a),videoId:c.length===3?c[2]:"",videoURL:(u=l==null?void 0:l.url)!=null?u:"",videoTitle:(v=l==null?void 0:l.name)!=null?v:"",videoPlayer:`<iframe width="${this.plugin.settings.vimeoEmbedWidth}" height="${this.plugin.settings.vimeoEmbedHeight}" src="${l==null?void 0:l.embedUrl}" title="Vimeo video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`,channelName:(y=(k=l==null?void 0:l.author)==null?void 0:k.name)!=null?y:"",channelURL:(N=(D=l==null?void 0:l.author)==null?void 0:D.url)!=null?N:""}}},ja=_i;var $a=require("obsidian");var Di=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(bilibili.com)\/(video)?\/([a-z0-9]+)?/i)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await this.getNoteData(e,a),r=this.templateEngine.render(this.plugin.settings.bilibiliNote,n),s=this.templateEngine.render(this.plugin.settings.bilibiliNoteTitle,{title:n.videoTitle,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.bilibiliContentTypeSlug,a)}async getNoteData(e,a){var p,l;let n=await(0,$a.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"}}),r=new DOMParser().parseFromString(n,"text/html"),s=(p=this.PATTERN.exec(e)[3])!=null?p:"";return{date:this.getFormattedDateForContent(a),videoId:s,videoTitle:(l=r.querySelector("[property~='og:title']").getAttribute("content"))!=null?l:"",videoURL:e,videoPlayer:`<iframe width="${this.plugin.settings.bilibiliEmbedWidth}" height="${this.plugin.settings.bilibiliEmbedHeight}" src="https://player.bilibili.com/player.html?autoplay=0&bvid=${s}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`}}},Wa=Di;var Yt=require("obsidian");function gr(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var a in e)e.hasOwnProperty(a)&&(i[a]=e[a])}return i}function Pi(i,t){return Array(t+1).join(i)}function hr(i){return i.replace(/^\n*/,"")}function fr(i){for(var t=i.length;t>0&&i[t-1]===`
`;)t--;return i.substring(0,t)}var vr=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Li(i){return Ii(i,vr)}var Ya=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Xa(i){return Ii(i,Ya)}function br(i){return Ja(i,Ya)}var Ka=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function xr(i){return Ii(i,Ka)}function yr(i){return Ja(i,Ka)}function Ii(i,t){return t.indexOf(i.nodeName)>=0}function Ja(i,t){return i.getElementsByTagName&&t.some(function(e){return i.getElementsByTagName(e).length})}var oe={};oe.paragraph={filter:"p",replacement:function(i){return`
3 years ago
2 months ago
`+i+`
3 years ago
1 month ago
`}};oe.lineBreak={filter:"br",replacement:function(i,t,e){return e.br+`
`}};oe.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(i,t,e){var a=Number(t.nodeName.charAt(1));if(e.headingStyle==="setext"&&a<3){var n=Pi(a===1?"=":"-",i.length);return`
3 years ago
2 months ago
`+i+`
`+n+`
3 years ago
`}else return`
3 years ago
1 month ago
`+Pi("#",a)+" "+i+`
3 years ago
1 month ago
`}};oe.blockquote={filter:"blockquote",replacement:function(i){return i=i.replace(/^\n+|\n+$/g,""),i=i.replace(/^/gm,"> "),`
3 years ago
2 months ago
`+i+`
3 years ago
1 month ago
`}};oe.list={filter:["ul","ol"],replacement:function(i,t){var e=t.parentNode;return e.nodeName==="LI"&&e.lastElementChild===t?`
2 months ago
`+i:`
3 years ago
2 months ago
`+i+`
3 years ago
1 month ago
`}};oe.listItem={filter:"li",replacement:function(i,t,e){i=i.replace(/^\n+/,"").replace(/\n+$/,`
`).replace(/\n/gm,`
2 months ago
`);var a=e.bulletListMarker+" ",n=t.parentNode;if(n.nodeName==="OL"){var r=n.getAttribute("start"),s=Array.prototype.indexOf.call(n.children,t);a=(r?Number(r)+s:s+1)+". "}return a+i+(t.nextSibling&&!/\n$/.test(i)?`
1 month ago
`:"")}};oe.indentedCodeBlock={filter:function(i,t){return t.codeBlockStyle==="indented"&&i.nodeName==="PRE"&&i.firstChild&&i.firstChild.nodeName==="CODE"},replacement:function(i,t,e){return`
3 years ago
2 months ago
`+t.firstChild.textContent.replace(/\n/g,`
`)+`
3 years ago
1 month ago
`}};oe.fencedCodeBlock={filter:function(i,t){return t.codeBlockStyle==="fenced"&&i.nodeName==="PRE"&&i.firstChild&&i.firstChild.nodeName==="CODE"},replacement:function(i,t,e){for(var a=t.firstChild.getAttribute("class")||"",n=(a.match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,s=e.fence.charAt(0),p=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(r);)c[0].length>=p&&(p=c[0].length+1);var u=Pi(s,p);return`
3 years ago
2 months ago
`+u+n+`
`+r.replace(/\n$/,"")+`
`+u+`
3 years ago
1 month ago
`}};oe.horizontalRule={filter:"hr",replacement:function(i,t,e){return`
3 years ago
2 months ago
`+e.hr+`
3 years ago
1 month ago
`}};oe.inlineLink={filter:function(i,t){return t.linkStyle==="inlined"&&i.nodeName==="A"&&i.getAttribute("href")},replacement:function(i,t){var e=t.getAttribute("href");e&&(e=e.replace(/([()])/g,"\\$1"));var a=Gt(t.getAttribute("title"));return a&&(a=' "'+a.replace(/"/g,'\\"')+'"'),"["+i+"]("+e+a+")"}};oe.referenceLink={filter:function(i,t){return t.linkStyle==="referenced"&&i.nodeName==="A"&&i.getAttribute("href")},replacement:function(i,t,e){var a=t.getAttribute("href"),n=Gt(t.getAttribute("title"));n&&(n=' "'+n+'"');var r,s;switch(e.linkReferenceStyle){case"collapsed":r="["+i+"][]",s="["+i+"]: "+a+n;break;case"shortcut":r="["+i+"]",s="["+i+"]: "+a+n;break;default:var p=this.references.length+1;r="["+i+"]["+p+"]",s="["+p+"]: "+a+n}return this.references.push(s),r},references:[],append:function(i){var t="";return this.references.length&&(t=`
3 years ago
`+this.references.join(`
`)+`
3 years ago
1 month ago
`,this.references=[]),t}};oe.emphasis={filter:["em","i"],replacement:function(i,t,e){return i.trim()?e.emDelimiter+i+e.emDelimiter:""}};oe.strong={filter:["strong","b"],replacement:function(i,t,e){return i.trim()?e.strongDelimiter+i+e.strongDelimiter:""}};oe.code={filter:function(i){var t=i.previousSibling||i.nextSibling,e=i.parentNode.nodeName==="PRE"&&!t;return i.nodeName==="CODE"&&!e},replacement:function(i){if(!i)return"";i=i.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(i)?" ":"",e="`",a=i.match(/`+/gm)||[];a.indexOf(e)!==-1;)e=e+"`";return e+t+i+t+e}};oe.image={filter:"img",replacement:function(i,t){var e=Gt(t.getAttribute("alt")),a=t.getAttribute("src")||"",n=Gt(t.getAttribute("title")),r=n?' "'+n+'"':"";return a?"!["+e+"]("+a+r+")":""}};function Gt(i){return i?i.replace(/(\n+\s*)+/g,`
`):""}function Za(i){this.options=i,this._keep=[],this._remove=[],this.blankRule={replacement:i.blankReplacement},this.keepReplacement=i.keepReplacement,this.defaultRule={replacement:i.defaultReplacement},this.array=[];for(var t in i.rules)this.array.push(i.rules[t])}Za.prototype={add:function(i,t){this.array.unshift(t)},keep:function(i){this._keep.unshift({filter:i,replacement:this.keepReplacement})},remove:function(i){this._remove.unshift({filter:i,replacement:function(){return""}})},forNode:function(i){if(i.isBlank)return this.blankRule;var t;return(t=ki(this.array,i,this.options))||(t=ki(this._keep,i,this.options))||(t=ki(this._remove,i,this.options))?t:this.defaultRule},forEach:function(i){for(var t=0;t<this.array.length;t++)i(this.array[t],t)}};function ki(i,t,e){for(var a=0;a<i.length;a++){var n=i[a];if(Tr(n,t,e))return n}}function Tr(i,t,e){var a=i.filter;if(typeof a=="string"){if(a===t.nodeName.toLowerCase())return!0}else if(Array.isArray(a)){if(a.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof a=="function"){if(a.call(i,t,e))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function wr(i){var t=i.element,e=i.isBlock,a=i.isVoid,n=i.isPre||function(v){return v.nodeName==="PRE"};if(!(!t.firstChild||n(t))){for(var r=null,s=!1,p=null,l=Ga(p,t,n);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!r||/ $/.test(r.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=Ci(l);continue}l.data=c,r=l}else if(l.nodeType===1)e(l)||l.nodeName==="BR"?(r&&(r.data=r.data.replace(/ $/,"")),r=null,s=!1):a(l)||n(l)?(r=null,s=!0):r&&(s=!1);else{l=Ci(l);continue}var u=Ga(p,l,n);p=l,l=u}r&&(r.data=r.data.replace(/ $/,""),r.data||Ci(r))}}function Ci(i){var t=i.nextSibling||i.parentNode;return i.parentNode.removeChild(i),t}function Ga(i,t,e){return i&&i.parentNode===t||e(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var Mi=typeof window!="undefined"?window:{};function Nr(){var i=Mi.DOMParser,t=!1;try{new i().parseFromString("","text/html")&&(t=!0)}catch(e){}return t}function Er(){var i=function(){};return Ar()?i.prototype.parseFromString=function(t){var e=new window.ActiveXObject("htmlfile");return e.designMode="on",e.open(),e.write(t),e.close(),e}:i.prototype.parseFromString=function(t){var e=document.implementation.createHTMLDocument("");return e.open(),e.write(t),e.close(),e},i}function Ar(){var i=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){Mi.ActiveXObject&&(i=!0)}return i}var Sr=Nr()?Mi.DOMParser:Er();function _r(i,t){var e;if(typeof i=="string"){var a=Dr().parseFromString('<x-turndown id="turndown-root">'+i+"</x-turndown>","text/html");e=a.getElementById("turndown-root")}else e=i.cloneNode(!0);return wr({element:e,isBlock:Li,isVoid:Xa,isPre:t.preformattedCode?kr:null}),e}var Ri;function Dr(){return Ri=Ri||new Sr,Ri}function kr(i){return i.nodeName==="PRE"||i.nodeName==="CODE"}function Cr(i,t){return i.isBlock=Li(i),i.isCode=i.nodeName==="CODE"||i.parentNode.isCode,i.isBlank=Rr(i),i.flankingWhitespace=Pr(i,t),i}function Rr(i){return!Xa(i)&&!xr(i)&&/^\s*$/i.test(i.textContent)&&!br(i)&&!yr(i)}function Pr(i,t){if(i.isBlock||t.preformattedCode&&i.isCode)return{leading:"",trailing:""};var e=Lr(i.textContent);return e.leadingAscii&&qa("left",i,t)&&(e.leading=e.leadingNonAscii),e.trailingAscii&&qa("right",i,t)&&(e.trailing=e.trailingNonAscii),{leading:e.leading,trailing:e.trailing}}function Lr(i){var t=i.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function qa(i,t,e){var a,n,r;return i==="left"?(a=t.previousSibling,n=/ $/):(a=t.nextSibling,n=/^ /),a&&(a.nodeType===3?r=n.test(a.nodeValue):e.preformattedCode&&a.nodeName==="CODE"?r=!1:a.nodeType===1&&!Li(a)&&(r=n.test(a.textContent))),r}var Ir=Array.prototype.reduce,Mr=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\
3 years ago
2 months ago
`:""},keepReplacement:function(e,a){return a.isBlock?`
3 years ago
2 months ago
`+a.outerHTML+`
3 years ago
2 months ago
`:a.outerHTML},defaultReplacement:function(e,a){return a.isBlock?`
3 years ago
2 months ago
`+e+`
3 years ago
1 month ago
`:e}};this.options=gr({},t,i),this.rules=new Za(this.options)}qt.prototype={turndown:function(i){if(!Ur(i))throw new TypeError(i+" is not a string, or an element/document/fragment node.");if(i==="")return"";var t=Qa.call(this,new _r(i,this.options));return Or.call(this,t)},use:function(i){if(Array.isArray(i))for(var t=0;t<i.length;t++)this.use(i[t]);else if(typeof i=="function")i(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(i,t){return this.rules.add(i,t),this},keep:function(i){return this.rules.keep(i),this},remove:function(i){return this.rules.remove(i),this},escape:function(i){return Mr.reduce(function(t,e){return t.replace(e[0],e[1])},i)}};function Qa(i){var t=this;return Ir.call(i.childNodes,function(e,a){a=new Cr(a,t.options);var n="";return a.nodeType===3?n=a.isCode?a.nodeValue:t.escape(a.nodeValue):a.nodeType===1&&(n=Fr.call(t,a)),en(e,n)},"")}function Or(i){var t=this;return this.rules.forEach(function(e){typeof e.append=="function"&&(i=en(i,e.append(t.options)))}),i.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Fr(i){var t=this.rules.forNode(i),e=Qa.call(this,i),a=i.flankingWhitespace;return(a.leading||a.trailing)&&(e=e.trim()),a.leading+t.replacement(e,i,this.options)+a.trailing}function en(i,t){var e=fr(i),a=hr(t),n=Math.max(i.length-e.length,t.length-a.length),r=`
3 years ago
1 month ago
`.substring(0,n);return e+r+a}function Ur(i){return i!=null&&(typeof i=="string"||i.nodeType&&(i.nodeType===1||i.nodeType===9||i.nodeType===11))}var tn=qt;var an=/highlight-(?:text|source)-([a-z0-9]+)/;function Vr(i){i.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return t.nodeName==="DIV"&&an.test(t.className)&&e&&e.nodeName==="PRE"},replacement:function(t,e,a){var n=e.className||"",r=(n.match(an)||[null,""])[1];return`
3 years ago
2 months ago
`+a.fence+r+`
`+e.firstChild.textContent+`
`+a.fence+`
3 years ago
1 month ago
`}})}function Hr(i){i.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~"+t+"~"}})}var zr=Array.prototype.indexOf,Ye={};Ye.tableCell={filter:["th","td"],replacement:function(i,t){return nn(i,t)+rn(t,"")}};Ye.tableRow={filter:"tr",replacement:function(i,t){var e="",a={left:":--",right:"--:",center:":-:"};if(Br(t))for(var n=0;n<t.childNodes.length;n++){var r="---",s=(t.childNodes[n].getAttribute("align")||"").toLowerCase();s&&(r=a[s]||r),e+=nn(r,t.childNodes[n])+rn(t.childNodes[n],r)}return`
2 months ago
`+i+(e?`
1 month ago
`+e:"")}};Ye.table={filter:function(i){return i.nodeName==="TABLE"&&!sn(i)},replacement:function(i){return i=i.replace(`
3 years ago
`,`
`),`
3 years ago
2 months ago
`+i+`
3 years ago
1 month ago
`}};Ye.tableSection={filter:["thead","tbody","tfoot"],replacement:function(i){return i}};Ye.captionSection={filter:"caption",replacement:function(i,t){return t.parentNode.nodeName==="TABLE"&&t.parentNode.childNodes[0]===t?i:""}};function Br(i){var t=i.parentNode,e=t;return(t.nodeName==="THEAD"||t.nodeName==="TFOOT"||t.nodeName==="TBODY")&&(e=t.parentNode),e.nodeName==="TABLE"&&e.rows[0]===i}function nn(i,t){var e=zr.call(t.parentNode.childNodes,t),a=" ";return e===0&&(a="| "),i=i.replace(/\r\n/g,`
`).replace(/\n/g," "),i=i.replace(/\|/g,"\\|"),a+i+" |"}function rn(i,t){var e=i.getAttribute("colspan")||1;return e<=1?"":(" "+t+" |").repeat(e-1)}function sn(i){for(var t=i.parentNode;t;){if(t.nodeName==="TABLE")return!0;t=t.parentNode}return!1}function jr(i){i.keep(function(e){return e.nodeName==="TABLE"&&sn(e)});for(var t in Ye)i.addRule(t,Ye[t])}function $r(i){i.addRule("taskListItems",{filter:function(t){return t.type==="checkbox"&&t.parentNode.nodeName==="LI"},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function on(i){i.use([Vr,Hr,jr,$r])}async function Ue(i){let t=on,e=new tn({headingStyle:"atx",hr:"---",bulletListMarker:"-",codeBlockStyle:"fenced",emDelimiter:"*"});return e.use(t),e.addRule("torchlightCodeBlock",{filter:n=>n.nodeName==="PRE"&&n.firstChild.nodeName==="CODE"&&n.firstChild.firstChild.nodeName==="P",replacement:function(n,r,s){return r.querySelectorAll("p").forEach(p=>{p.innerHTML=p.innerHTML+`
`}),`
`+s.fence+r.firstChild.getAttribute("data-lang")+`
`+r.firstChild.textContent+`
`+s.fence+`
1 month ago
`}}),e.addRule("fencedCodeLangBlock",{filter:n=>n.nodeName=="PRE"&&(!n.firstChild||n.firstChild.nodeName!="CODE")&&!n.querySelector("img"),replacement:function(n,r,s){var N;r.innerHTML=r.innerHTML.replaceAll("<br-keep></br-keep>","<br>");let p=(N=r.id)==null?void 0:N.match(/code-lang-(.+)/),l=(p==null?void 0:p.length)>0?p[1]:"",c=r.textContent,u=s.fence.charAt(0),v=3,k=new RegExp("^"+u+"{3,}","gm"),y;for(;y=k.exec(c);)y[0].length>=v&&(v=y[0].length+1);let D=Array(v+1).join(u);return`
`+D+l+`
2 months ago
`+c.replace(/\n$/,"")+`
1 month ago
`+D+`
1 month ago
`}}),e.turndown(i)}var Oi=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(https:\/\/(twitter|x).com\/([a-zA-Z0-9_]+\/)([a-zA-Z0-9_]+\/[a-zA-Z0-9_]+))/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=new URL(e);n.hostname==="x.com"&&(n.hostname="twitter.com");let r=await this.getTweetNoteData(n,a),s=this.templateEngine.render(this.plugin.settings.twitterNote,r),p=this.templateEngine.render(this.plugin.settings.twitterNoteTitle,{tweetAuthorName:r.tweetAuthorName,date:this.getFormattedDateForFilename(a)});return new H(p,"md",s,this.plugin.settings.twitterContentTypeSlug,a)}async getTweetNoteData(e,a){let n=JSON.parse(await(0,Yt.request)({method:"GET",contentType:"application/json",url:`https://publish.twitter.com/oembed?url=${e.href}`})),r=await Ue(n.html);return{date:this.getFormattedDateForContent(a),tweetAuthorName:n.author_name,tweetURL:n.url,tweetContent:r,tweetPublishDate:this.getPublishedDateFromDOM(n.html)}}getPublishedDateFromDOM(e){let n=new DOMParser().parseFromString(e,"text/html").querySelector("blockquote > a"),r=(0,Yt.moment)(n.textContent);return r.isValid()?r.format(this.plugin.settings.dateContentFmt):""}},ln=Oi;var Xt=require("obsidian"),Bi=zt(Hi());var ze=require("obsidian");var ot="http:",lt="https:";function zi(i){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let a=0;a<i;a++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}function cn(i,t){let e=i.trim().split(Aa(t)).filter(n=>n.trim().length>0),a=e.reduce((n,r)=>n&&Le(r,[ot,lt]),!0);return{urls:e,everyLineIsURL:a}}var Gr=/!\[(?<anchor>.*?)\]\((?<link>.+?)\)/g,qr=5,Yr=1e3;async function Xe(i,t,e,a){return await Xr(e,Gr,Kr(i,t,a))}async function Xr(i,t,e){try{if(typeof e=="function"){let a=[];return String.prototype.replace.call(i,t,function(n,r,s){return a.push(e(n,r,s)),""}),Promise.all(a).then(function(n){return String.prototype.replace.call(i,t,function(){return n.shift()})})}else return Promise.resolve(String.prototype.replace.call(i,t,e))}catch(a){return console.error(),Promise.reject(a)}}function Kr(i,t,e){return async function(n,r,s){if(!Le(s,[ot,lt]))return n;let p=new URL(s);await i.getVaultRepository().createDirectory(e);try{let{fileContent:l,fileExtension:c}=await Zr(p),u=0;for(;u<qr;)try{let{fileName:v,needWrite:k}=await Jr(i.app.vault.adapter,i.getFileSystemLimits(),e,t,c);if(k&&v!==""){await i.app.vault.createBinary(v,l);let y=v.replace(/\s/g,"%20");return`![${r}](${y})`}else return n}catch(v){console.warn(v),u++}return n}catch(l){return console.warn(l),n}}}async function Jr(i,t,e,a,n){if(n==="")return{fileName:"",needWrite:!1};let r=!1,s="",p=0;for(;s===""&&p<Yr;){let l;i instanceof ze.CapacitorAdapter||i instanceof ze.FileSystemAdapter?l=yt(e,`${a}-${zi(10)}.${n}`,i,t):l=`${e}/${a}-${zi(10)}.${n}`,await i.exists((0,ze.normalizePath)(l),!1)||(s=l,r=!0),p++}return{fileName:s,needWrite:r}}async function Zr(i){var e;let t=await(0,ze.requestUrl)({url:i.href,method:"get"});return{fileContent:t.arrayBuffer,fileExtension:(e=Oa(t.headers["content-type"]||""))!=null?e:""}}var ji=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(https:\/\/|http:\/\/)(stackoverflow\.com|serverfault\.com|superuser\.com|askubuntu\.com|stackapps\.com|.*\.stackexchange\.com)\/(q|a|questions)\/(\d+)/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await(0,Xt.request)({method:"GET",url:e}),r=new DOMParser().parseFromString(n,"text/html"),s=await this.parseDocument(r),p=this.templateEngine.render(this.plugin.settings.stackExchangeNoteTitle,{title:s.title,date:this.getFormattedDateForFilename(a)}),l;this.plugin.settings.downloadStackExchangeAssetsInDir?(l=this.templateEngine.render(this.plugin.settings.assetsDir,{date:"",fileName:"",contentType:""}),l=`${l}/${pe(p)}`):l=this.templateEngine.render(this.plugin.settings.assetsDir,{date:this.getFormattedDateForFilename(a),fileName:pe(p),contentType:this.plugin.settings.stackExchangeContentType});let c=this.templateEngine.render(this.plugin.settings.stac
3 years ago
***
3 years ago
1 month ago
`,this.templateEngine.render(this.plugin.settings.stackExchangeAnswer,{date:this.getFormattedDateForContent(a),answerContent:e.answers[s].content,authorName:e.answers[s].author.name,authorProfileURL:e.answers[s].author.profile}));return{date:this.getFormattedDateForContent(a),questionTitle:e.title,questionURL:e.url,questionContent:e.content,authorName:e.author.name,authorProfileURL:e.author.profile,topAnswer:n,answers:r.trim(),extra:{question:e}}}async parseDocument(e){var s,p,l,c,u,v,k,y,D,N,S,j,U,z,x,X;let a;try{a=new URL((l=(s=e.querySelector('link[rel="canonical"]'))==null?void 0:s.getAttribute("href"))!=null?l:(p=e.querySelector('meta[property="og:url"]'))==null?void 0:p.getAttribute("content"))}catch(E){a=null}let n=e.querySelector('#question [itemprop="author"]'),r=[];for(let E of e.querySelectorAll(".answer")){let I=E.querySelector('[itemprop="author"]');r.push({content:await Ue(Bi.sanitize((c=E.querySelector('[itemprop="text"]'))!=null?c:"")),author:{name:(v=(u=I==null?void 0:I.querySelector('[itemprop="name"]'))==null?void 0:u.textContent)!=null?v:"",profile:I instanceof Element&&a instanceof URL?String.prototype.concat(a.origin,(y=(k=I.querySelector("a"))==null?void 0:k.getAttribute("href"))!=null?y:""):""}})}return{title:(N=(D=e.querySelector('#question-header [itemprop="name"]'))==null?void 0:D.textContent)!=null?N:"",content:await Ue(Bi.sanitize((S=e.querySelector('#question [itemprop="text"]'))!=null?S:"")),url:(j=a==null?void 0:a.href)!=null?j:"",topAnswer:r.slice(0,1).shift(),answers:r.slice(1),author:{name:(z=(U=n==null?void 0:n.querySelector('[itemprop="name"]'))==null?void 0:U.textContent)!=null?z:"",profile:n instanceof Element&&a instanceof URL?String.prototype.concat(a.origin,(X=(x=n.querySelector("a"))==null?void 0:x.getAttribute("href"))!=null?X:""):""}}}},mn=ji;var Ke=require("obsidian"),Kt=zt(vn()),bn=zt(Hi());var Gi=class extends B{test(t){return this.isValidUrl(t)}async prepareNote(t){let e=new URL(t),a=await this.getDocument(e);return this.makeNote(a,e)}async makeNote(t,e){(0,Kt.isProbablyReaderable)(t)||new Ke.Notice("@mozilla/readability considers this document to unlikely be readerable.");let a=new Date,n=this.extractPreviewUrl(t),r=new Kt.Readability(t).parse();if(r===null||!Object.prototype.hasOwnProperty.call(r,"content"))return this.notParsableArticle(e.href,n,a);let s=await Ue(r.content);return this.parsableArticle({date:this.getFormattedDateForContent(a),articleTitle:r.title||"No title",articleURL:e.href,articleReadingTime:this.getEstimatedReadingTime(r),articleContent:s,siteName:r.siteName||"",author:r.byline||"",previewURL:n||"",publishedTime:r.publishedTime!==null?this.getFormattedDateForContent(r.publishedTime):"",readabilityArticle:r},a)}async getDocument(t){var l,c,u,v,k;let e=await(0,Ke.request)({method:"GET",url:t.href,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}}),a=new DOMParser().parseFromString(e,"text/html"),n=a.getElementsByTagName("base"),r=null;n.length>0&&(r=n.item(0).getAttribute("href"),Array.from(n).forEach(y=>{y.remove()}));let s=a.createElement("base");s.setAttribute("href",Ia(r!=null?r:t.href,t.origin)),a.head.append(s);let p=bn.sanitize(a.body.innerHTML);return a.body.innerHTML=p,(l=a.body.querySelectorAll("pre br"))==null||l.forEach(y=>{y.outerHTML="<br-keep></br-keep>"}),(c=a.body.querySelectorAll("h1, h2, h3, h4, h5, h6"))==null||c.forEach(y=>{y.className=""}),(u=a.body.querySelectorAll("[class*=highlight-text],[class*=highlight-source]"))==null||u.forEach(y=>{var N;let D=(N=y.className.match(/highlight-(?:text|source)-([a-z0-9]+)/))==null?void 0:N[1];y.firstElementChild.nodeName=="PRE"&&(y.removeAttribute("data-snippet-clipboard-copy-content"),y.firstElementChild.id=`code-lang-${D}`)}),(v=a.body.querySelectorAll("[class*=language-]"))==null||v.forEach(y=>{var N;let D=(N=y.className.match(/language-([a-z0-9]+)/))==null?void 0:N[1];y.id=`code-lang-${D}`}),(k=a.body.querySelectorAll(".codehilite > pre"))==null||k.forEach(y=>{y.firstChild.nodeName!=="CODE"&&!y.classNa
***
1 month ago
`,c)}return{date:this.getFormattedDateForContent(r),tootAuthorName:t.account.display_name,tootURL:t.url,tootContent:s,extra:{status:t,replies:e}}}async loadStatus(t,e){return JSON.parse(await(0,ct.request)({method:"GET",contentType:"application/json",url:`https://${t}${Yi.STATUS}/${e}`}))}async loadReplies(t,e){let a=String.prototype.concat.call("https://",t,String.prototype.replace.call(Yi.CONTEXT,"%id%",e));return JSON.parse(await(0,ct.request)({method:"GET",contentType:"application/json",url:a})).descendants}async parseStatus(t,e,a){let n=await Ue(t.content),r=this.plugin.settings.downloadMastodonMediaAttachments&&ct.Platform.isDesktop?await Xe(this.plugin,e,this.prepareMedia(t.media_attachments),a):this.prepareMedia(t.media_attachments);return n.concat(r)}prepareMedia(t){return t.reduce((e,{url:a,description:n})=>{let r=n?`
2 months ago
> *${n}*`:"";return`${e}
1 month ago
![](${a})${r}`},"")}async testIsMastodon(t){if(!t)return!1;let e=new URL(t).hostname;try{let a=JSON.parse(await(0,ct.request)({method:"GET",contentType:"application/json",url:`https://${e}${Yi.INSTANCE}`}));return(a==null?void 0:a.domain)===e}catch(a){return!1}}},yn=Xi;var Tn=require("obsidian");var Ki=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/(tiktok.com)\/(\S+)\/(video)\/(\d+)/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=await this.parseHtml(e,a),r=this.templateEngine.render(this.plugin.settings.tikTokNote,n),s=this.templateEngine.render(this.plugin.settings.tikTokNoteTitle,{authorName:n.authorName,date:this.getFormattedDateForFilename(a)});return new H(s,"md",r,this.plugin.settings.tikTokContentTypeSlug,a)}async parseHtml(e,a){var p,l,c,u;let n=await(0,Tn.request)({method:"GET",url:e,headers:{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"}}),r=new DOMParser().parseFromString(n,"text/html"),s=this.PATTERN.exec(e);return{date:this.getFormattedDateForContent(a),videoId:s[4],videoURL:(l=(p=r.querySelector('meta[property="og:url"]'))==null?void 0:p.getAttribute("content"))!=null?l:e,videoDescription:(u=(c=r.querySelector('meta[property="og:description"]'))==null?void 0:c.getAttribute("content"))!=null?u:"",videoPlayer:`<iframe width="${this.plugin.settings.tikTokEmbedWidth}" height="${this.plugin.settings.tikTokEmbedHeight}" src="https://www.tiktok.com/embed/v2/${s[4]}"></iframe>`,authorName:s[2],authorURL:`https://www.tiktok.com/${s[2]}`}}},wn=Ki;var wt=class{constructor(t){_(this,"parsers");this.parsers=t}async createParser(t){for(let e of this.parsers)if(await e.test(t))return e}};var Nt=class extends pt{constructor(){super(...arguments);_(this,"PATTERN",/^https?:\/\/(?:www\.)?github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)\/?$/)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new URL(e),n=await this.getDocument(a),r=n.querySelector("article.markdown-body");return r.querySelectorAll('[aria-label^="Permalink:"]').forEach(s=>s.remove()),n.querySelector("body").innerHTML=r.outerHTML,this.makeNote(n,a)}};var Et=class extends pt{constructor(){super(...arguments);_(this,"PATTERN",/^(?:https?:\/\/)?(?:[a-z]{2,3}(?:-[a-z]{2,3})?)(?:\.m)?\.wikipedia\.org\/wiki\/([^\/]+)$/i)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new URL(e),n=await this.getDocument(a);return n.querySelectorAll(".reference .cite-bracket").forEach(r=>{r.remove()}),n.querySelectorAll(".reference a").forEach(r=>{r.textContent="\xA0"+r.textContent}),n.querySelectorAll(".mw-cite-backlink").forEach(r=>{r.remove()}),n.querySelectorAll(".infobox caption").forEach(r=>{let s=n.createElement("p");s.innerHTML=r.innerHTML,r.parentElement.insertBefore(s,r),r.remove()}),n.querySelectorAll(".wikitable caption").forEach(r=>{let s=n.createElement("p");s.innerHTML=r.innerHTML,r.parentElement.insertBefore(s,r),r.remove()}),this.makeNote(n,a)}};function En(i){return i<1e3?String(i):i<1e6?`${Nn(Number(i/1e3),1)}K`:i<1e9?`${Nn(Number(i/1e6),1)}M`:String(i)}function Nn(i,t){return i.toFixed(t).replace(/\.0+$/,"")}var mt=["string","number","bigint","symbol"],as=/{{(.*?)}}/g,At=class{constructor(){_(this,"modifiers");this.modifiers={blockquote:t=>this.validateFilterValueType(t,"blockquote",mt)?t.split(`
2 months ago
`).map(e=>`> ${e}`).join(`
1 month ago
`):t,capitalize:t=>{if(!this.validateFilterValueType(t,"capitalize",mt))return t;let e=String(t);return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},join:(t,e=",")=>this.validateFilterValueType(t,"join",["array"])?t.join(e):t,numberLexify:t=>En(t),lower:t=>{if(!this.validateFilterValueType(t,"lower",mt))return t;String(t).toLowerCase()},map:(t,e)=>{if(!this.validateFilterValueType(t,"map",["array"]))return t;try{return t.map(e)}catch(a){return console.warn("Error in map modifier:",a),t}},replace:(t,e,a="")=>this.validateFilterValueType(t,"replace",mt)?t.replaceAll(e,a):t,striptags:(t,e="")=>{if(!this.validateFilterValueType(t,"striptags",mt))return t;let a=new RegExp(`<(?!/?(${e.replace(/[<>]/g,"").split(",").join("|")})s*/?)[^>]+>`,"gi");return t.replace(a,"")},upper:t=>{if(!this.validateFilterValueType(t,"upper",mt))return t;String(t).toUpperCase()}}}render(t,e){try{let a=this.processLoops(t,e);return a=this.processVariables(a,e),a=this.processSimplePattern(a,e),a}catch(a){return console.error("Error rendering template:",a),t}}processSimplePattern(t,e){let a=/%(\w+(?:\.\w+)*)%/g;return t.replace(a,(n,r)=>{try{let s=this.resolveValue(r,e);return s===void 0?(console.warn(`Unable to resolve ${r}`),n):String(s)}catch(s){return console.warn(`Error processing simple pattern "${n}":`,s),n}})}processVariables(t,e){return t.replace(as,(a,n)=>{try{let[r,...s]=n.split("|").map(v=>v.trim()),l=/(['"])((?:[^\\]|\\.)*?)\1/.exec(r),c;if(l!==null?c=l[2]:c=this.resolveValue(r,e),c===void 0)return console.warn(`Unable to resolve ${r}`),a;let u=c;for(let v of s)u=this.applyModifier(u,v);return String(u)}catch(r){return console.warn(`Error processing variable "${a}":`,r),a}})}processLoops(t,e){let a=/{%\s*for\s+(\w+)\s+in\s+(\w+(?:\.\w+)*)\s*%}([\s\S]*?){%\s*endfor\s*%}/g;return t.replace(a,(n,r,s,p)=>{try{let l=this.resolveValue(s,e);return Array.isArray(l)?l.map(c=>{let u={...e,[r]:c};return this.render(p,u)}).join(""):(console.warn(`Value at "${s}" is not an array`),"")}catch(l){return console.warn(`Error processing loop "${n}":`,l),""}})}resolveValue(t,e){let a=t.trim().split("."),n=e;for(let r of a){if(n==null)return;n=n[r]}return n}addModifier(t,e){if(typeof e!="function")throw new Error("Modifier must be a function");this.modifiers[t]=e}parseModifier(t){let e=t.match(/(\w+)(?:\((.*?)\))?/);if(!e)return{name:t,args:[]};let[,a,n]=e,r=n?this.parseArguments(n):[];return{name:a,args:r}}parseArguments(t){let e=[],a="",n=!1,r="",s=!1,p=0,l=!1,c=()=>{(a.trim()||n)&&e.push(this.evaluateArgument(a.trim())),a=""};for(let u=0;u<t.length;u++){let v=t[u];if(l){a+=v,l=!1;continue}switch(v){case"\\":l=!0;break;case'"':case"'":s||(n&&v===r?n=!1:n||(n=!0,r=v)),a+=v;break;case"(":p++,a+=v;break;case")":p--,a+=v;break;case"=":t[u+1]===">"?(s=!0,a+="=>",u++):a+=v;break;case",":!n&&!s&&p===0?c():a+=v;break;default:a+=v}}return(a||n)&&c(),e}evaluateArgument(t){try{if(t.includes("=>")){let e=Function(`return ${t}`)();return typeof e=="function"?e:t}if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if(t==="")return"";if(!isNaN(Number(t)))return Number(t);if(t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch(e){return t}return t}catch(e){return console.warn("Error evaluating argument:",t,e),t}}applyModifier(t,e){try{let{name:a,args:n}=this.parseModifier(e);return this.modifiers[a]?this.modifiers[a](t,...n):(console.warn(`Modifier "${a}" not found`),t)}catch(a){return console.warn(`Error applying modifier "${e}":`,a),t}}validateFilterValueType(t,e,a){let n=typeof t;return a.includes(n)?!0:a.includes("array")?Array.isArray(t):(console.warn(`Filter ${e} supports following types ${a.join(", ")}, but ${n} was provided.`),!1)}};var Ji=require("obsidian");var St=class extends B{constructor(){super(...arguments);_(this,"PATTERN",/^(https?:\/\/(?:(?:www|m)\.)?youtube\.com\/(?:channel\/(UC[\w-]{22})|c\/([^\s\/]+)|@([\w-]+)))(?:\/.*)?$/u)}test(e){return this.isValidUrl(e)&&this.PATTERN.test(e)}async prepareNote(e){let a=new Date,n=this.plugin.settings.youtubeApiKey===""?await this.parseSchema(e,a):awai
${t.content}`)}};var Ct=require("obsidian");var Dt=require("obsidian");var kt=class extends Dt.Modal{constructor(t,e,a){super(t),this.setTitle("Duplicate notes detected");let n=e.map(s=>`<li>${s.fileName}</li>`).join("");this.setContent(Bt(`<ul>${n}</ul>`));let r=!1;new Dt.Setting(this.contentEl).setName("Do not ask again").addToggle(s=>{s.setValue(!1).onChange(()=>r=!0)}),new Dt.Setting(this.contentEl).addButton(s=>s.setButtonText("Append to existing").setCta().onClick(()=>{this.close(),a("appendToExisting",r)})).addButton(s=>s.setButtonText("Nothing").onClick(()=>{this.close(),a("nothing",r)}))}};var Jt=class{constructor(t,e,a){this.parserCreator=t;this.plugin=e;this.repository=a}async createNote(t){let e=await this.makeNote(t);try{await this.repository.saveNote(e)}catch(a){a instanceof Be&&this.handleFileExistsError([e])}}async createNotesFromBatch(t){let e=cn(t,this.plugin.settings.batchProcessDelimiter),a=[];for(let n of e.everyLineIsURL?e.urls:[t]){let r=await this.makeNote(n);try{await this.repository.saveNote(r)}catch(s){s instanceof Be&&a.push(r)}}a.length>0&&this.handleFileExistsError(a)}async insertContentAtEditorCursorPosition(t,e){let a=await this.makeNote(t);e.replaceRange(a.content,e.getCursor())}async makeNote(t){return await(await this.parserCreator.createParser(t)).prepareNote(t)}openNote(t){if(this.plugin.settings.openNewNote||this.plugin.settings.openNewNoteInNewTab)try{let e=this.repository.getFileByPath(t.filePath);this.plugin.app.workspace.getLeaf(this.plugin.settings.openNewNoteInNewTab?"tab":!1).openFile(e)}catch(e){console.error(e),new Ct.Notice(`Unable to open ${t.getFullFilename()}`)}}async handleFileExistsError(t){switch(this.plugin.settings.fileExistsStrategy){case"ask":new kt(this.plugin.app,t,(e,a)=>{this.handleFileAskModalResponse(e,a,t)}).open();break;case"nothing":this.handleFileExistsStrategyNothing(t);break;case"appendToExisting":this.handleFileExistsStrategyAppend(t);break}}async handleFileAskModalResponse(t,e,a){switch(t){case"nothing":this.handleFileExistsStrategyNothing(a);break;case"appendToExisting":this.handleFileExistsStrategyAppend(a);break}e&&this.plugin.saveSetting("fileExistsStrategy",t),a.length===1&&this.openNote(a.shift())}async handleFileExistsStrategyAppend(t){for(let e of t)try{await this.repository.appendToExistingNote(e),new Ct.Notice(`${e.getFullFilename()} was updated.`)}catch(a){console.error(a),new Ct.Notice(`${e.getFullFilename()} was not updated!`,0)}}handleFileExistsStrategyNothing(t){for(let e of t)new Ct.Notice(`${e.getFullFilename()} already exists.`)}};var Zt=class{constructor(t){this.noteService=t}async processContent(t){this.noteService.createNote(t)}async processContentBatch(t){this.noteService.createNotesFromBatch(t)}async insertContentAtEditorCursorPosition(t,e){this.noteService.insertContentAtEditorCursorPosition(t,e)}};var Qt=class extends dt.Plugin{constructor(){super(...arguments);_(this,"api");_(this,"settings");_(this,"fileSystemLimits");_(this,"noteService");_(this,"parserCreator");_(this,"templateEngine");_(this,"vaultRepository")}getFileSystemLimits(){return this.fileSystemLimits}getVaultRepository(){return this.vaultRepository}async onload(){await this.loadSettings(),this.fileSystemLimits=Ma(dt.Platform,this.settings),this.templateEngine=new At,this.parserCreator=new wt([new za(this.app,this,this.templateEngine),new St(this.app,this,this.templateEngine),new ja(this.app,this,this.templateEngine),new Wa(this.app,this,this.templateEngine),new ln(this.app,this,this.templateEngine),new mn(this.app,this,this.templateEngine),new yn(this.app,this,this.templateEngine),new wn(this.app,this,this.templateEngine),new Nt(this.app,this,this.templateEngine),new Et(this.app,this,this.templateEngine),new pt(this.app,this,this.templateEngine),new xn(this.app,this,this.templateEngine)]),this.vaultRepository=new _t(this,this.templateEngine),this.noteService=new Jt(this.parserCreator,this,this.vaultRepository),this.api=new Zt(this.noteService),(0,dt.addIcon)("read-it-later",ns),this.addRibbonIcon("read-it-later","ReadItLater: Create from clipboard",async()=>{a
<svg fill="currentColor" stroke="currentColor" version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<g>
<path d="m365.9,144.9c-12.3,0-24.2,1.8-35.4,5.2v-114.7h-96.9l7.3-35.4h-150.2l6.8,35.4h-97.5v454.6h330.5v-102.1c11.2,3.4 23.1,5.2 35.4,5.2 68.8-0.1 124.1-56.4 124.1-124.1 0-67.8-55.3-124.1-124.1-124.1zm-150.1-124l-10.4,50h-79.2l-9.4-50h99zm93.8,448.2h-288.7v-412.8h80.7l6.8,35.4h113.6l7.3-35.4h80.3v102.2c-27.3,14-48.8,37.9-59.7,66.7h-200.9v20.8h195c-1.4,7.4-2.2,15.1-2.2,22.9 0,13.4 2.2,26.4 6.2,38.6h-199v20.9h208.1c12,21.8 30.3,39.7 52.5,51.1v89.6zm56.3-98c-57.3,0-103.2-46.9-103.2-103.2s46.9-103.2 103.2-103.2c57.3,0 103.2,46.9 103.2,103.2s-45.8,103.2-103.2,103.2z"/>
<polygon points="426.4,223.1 346.1,303.4 313.8,271.1 299.2,285.7 346.1,332.6 441,237.7 "/>
<rect width="233.5" x="49" y="143.9" height="20.9"/>
<rect width="233.5" x="49" y="388.9" height="20.9"/>
</g>
</svg>`;
/*! Bundled license information:
dompurify/dist/purify.js:
6 months ago
(*! @license DOMPurify 2.5.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.6/LICENSE *)
*/
2 months ago
/* nosourcemap */