varIn=Object.create;varlt=Object.defineProperty;varMn=Object.getOwnPropertyDescriptor;varOn=Object.getOwnPropertyNames;varFn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;varjn=(i,t,e)=>tini?lt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;varWe=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Hn=(i,t)=>{for(vareint)lt(i,e,{get:t[e],enumerable:!0})},pa=(i,t,e,a)=>{if(t&&typeoft=="object"||typeoft=="function")for(letnofOn(t))!Un.call(i,n)&&n!==e&<(i,n,{get:()=>t[n],enumerable:!(a=Mn(t,n))||a.enumerable});returni};varSt=(i,t,e)=>(e=i!=null?In(Fn(i)):{},pa(t||!i||!i.__esModule?lt(e,"default",{value:i,enumerable:!0}):e,i)),zn=i=>pa(lt({},"__esModule",{value:!0}),i);varL=(i,t,e)=>jn(i,typeoft!="symbol"?t+"":t,e);varNa=We(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.toSeconds=K.end=K.parse=K.pattern=void0;varYe="\\d+",ui="".concat(Ye,"(?:[\\.,]").concat(Ye,")?"),Kn="(".concat(Ye,"Y)?(").concat(Ye,"M)?(").concat(Ye,"W)?(").concat(Ye,"D)?"),Jn="T(".concat(ui,"H)?(").concat(ui,"M)?(").concat(ui,"S)?"),Zn="P(?:".concat(Kn,"(?:").concat(Jn,")?)"),Qn=["years","months","weeks","days","hours","minutes","seconds"],wa=Object.freeze({years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0});K.pattern=newRegExp(Zn);varer=function(i){vart=i.replace(/,/g,".").match(K.pattern);if(!t)thrownewRangeError("invalid duration: ".concat(i));vare=t.slice(1);if(e.filter(function(a){returna!=null}).length===0)thrownewRangeError("invalid duration: ".concat(i));if(e.filter(function(a){return/\./.test(a||"")}).length>1)thrownewRangeError("only the smallest unit can be fractional");returne.reduce(function(a,n,r){returna[Qn[r]]=parseFloat(n||"0")||0,a},{})};K.parse=er;vartr=function(i,t){t===void0&&(t=newDate);vare=Object.assign({},wa,i),a=t.getTime(),n=newDate(a);n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+e.days);varr=e.hours*3600*1e3,s=e.minutes*60*1e3;returnn.setMilliseconds(n.getMilliseconds()+e.seconds*1e3+r+s),n.setDate(n.getDate()+e.weeks*7),n};K.end=tr;varir=function(i,t){t===void0&&(t=newDate);vare=Object.assign({},wa,i),a=t.getTime(),n=newDate(a),r=(0,K.end)(e,n),s=t.getTimezoneOffset(),p=r.getTimezoneOffset(),l=(s-p)*60,c=(r.getTime()-n.getTime())/1e3;returnc+l};K.toSeconds=ir;K.default={end:K.end,toSeconds:K.toSeconds,pattern:K.pattern,parse:K.parse}});varSi=We((Ai,_i)=>{(function(i,t){typeofAi=="object"&&typeof_i!="undefined"?_i.exports=t():typeofdefine=="function"&&define.amd?define(t):(i=typeofglobalThis!="undefined"?globalThis:i||self,i.DOMPurify=t())})(Ai,function(){"use strict";functioni(h){"@babel/helpers - typeof";returni=typeofSymbol=="function"&&typeofSymbol.iterator=="symbol"?function(f){returntypeoff}:function(f){returnf&&typeofSymbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeoff},i(h)}functiont(h,f){returnt=Object.setPrototypeOf||function(_,U){return_.__proto__=U,_},t(h,f)}functione(){if(typeofReflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeofProxy=="function")return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}functiona(h,f,N){returne()?a=Reflect.construct:a=function(U,re,ne){varme=[null];me.push.apply(me,re);varAe=Function.bind.apply(U,me),nt=newAe;returnne&&t(nt,ne.prototype),nt},a.apply(null,arguments)}functionn(h){returnr(h)||s(h)||p(h)||c()}functionr(h){if(Array.isArray(h))returnl(h)}functions(h){if(typeofSymbol!="undefined"&&h[Symbol.iterator]!=null||h["@@iterator"]!=null)returnArray.from(h)}functionp(h,f){if(h){if(typeofh=="string")returnl(h,f);varN=Object.prototype.toString.call(h).slice(8,-1);if(N==="Object"&&h.constructor&&(N=h.constructor.name),N==="Map"||N==="Set")returnArray.from(h);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))returnl(h,f)}}functionl(h,f){(f==null||f>h.length)&&(f=h.length);for(varN=0,_=newArray(f);N<f;N++)_[N]=h[N];return_}functionc(){throwne
`+B),je&&(B=ee(B,Wt," "),B=ee(B,Gt," "),B=ee(B,qt," ")),le&&wt?le.createHTML(B):B},f.setConfig=function(y){ni(y),Zt=!0},f.clearConfig=function(){$e=null,Zt=!1},f.isValidAttribute=function(y,o,m){$e||ni({});var g=G(y),R=G(o);return ra(g,R,m)},f.addHook=function(y,o){typeof o=="function"&&(de[y]=de[y]||[],V(de[y],o))},f.removeHook=function(y){if(de[y])return w(de[y])},f.removeHooks=function(y){de[y]&&(de[y]=[])},f.removeAllHooks=function(){de={}},f}var mn=Ui();return mn})});var Di=We((po,Wa)=>{Wa.exports=window.DOMPurify||(window.DOMPurify=Si().default||Si())});var Ya=We((vo,Ri)=>{function qa(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(){}}qa.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";"}}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]]
{{videoPlayer}}`,youtubeEmbedWidth:"560",youtubeEmbedHeight:"315",youtubeUsePrivacyEnhancedEmbed:!0,vimeoContentTypeSlug:"vimeo",vimeoNoteTitle:"Vimeo - {{ title }}",vimeoNote:`[[ReadItLater]][[Vimeo]]
{{videoPlayer}}`,vimeoEmbedWidth:"560",vimeoEmbedHeight:"315",bilibiliContentTypeSlug:"bilibili",bilibiliNoteTitle:"Bilibili - {{ title }}",bilibiliNote:`[[ReadItLater]][[Bilibili]]
{{videoPlayer}}`,bilibiliEmbedWidth:"560",bilibiliEmbedHeight:"315",twitterContentTypeSlug:"xcom",twitterNoteTitle:"Tweet from {{ tweetAuthorName }} ({{ date }})",twitterNote:`[[ReadItLater]][[Tweet]]
{{articleContent}}`,notParseableArticleContentType:"article",notParseableArticleNoteTitle:"Article {{ date }}",notParsableArticleNote:`[[ReadItLater]][[Article]]
[{{articleURL}}]({{articleURL}})`,textSnippetContentType:"textsnippet",textSnippetNoteTitle:"Note {{ date }}",textSnippetNote:`[[ReadItLater]][[Textsnippet]]
{{answerContent}}`,downloadStackExchangeAssets:!0,downloadStackExchangeAssetsInDir:!1,youtubeApiKey:"",tikTokContentTypeSlug:"tiktok",tikTokNoteTitle:"TikTok from {{ authorName }} ({{ date }})",tikTokNote:`[[ReadItLater]][[TikTok]]
{{videoPlayer}}`,tikTokEmbedWidth:"325",tikTokEmbedHeight:"760",extendShareMenu:!0,filesystemLimitPath:null,filesystemLimitFileName:null};var v=require("obsidian");var Lt=class extends v.PluginSettingTab{constructor(e,a){super(e,a);L(this,"plugin");this.plugin=a}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:"General"}),new v.Setting(e).setName("Inbox directory").setDesc("Enter valid directory name. For nested directory use this format: Directory A/Directory B. If no directory is entered, new note will be created in vault root.").addText(n=>n.setPlaceholder("Defaults to vault root directory").setValue(typeof this.plugin.settings.inboxDir=="undefined"?d.inboxDir:this.plugin.settings.inboxDir).onChange(async r=>{this.plugin.settings.inboxDir=r,await this.plugin.saveSettings()})),new v.Setting(e).setName("Assets directory").setDesc("Enter valid directory name. For nested directory use this format: Directory A/Directory B. If no directory is entered, new note will be created in Vault root.").addText(n=>n.setPlaceholder("Defaults to vault root directory").setValue(typeof this.plugin.settings.assetsDir=="undefined"?d.inboxDir+"/assets":this.plugin.settings.assetsDir).onChange(async r=>{this.plugin.settings.assetsDir=r,await this.plugin.saveSettings()})),new v.Setting(e).setName("Open new note in current workspace").setDesc("If enabled, new note will open in current workspace").addToggle(n=>n.setValue(this.plugin.settings.openNewNote||d.openNewNote).onChange(async r=>{this.plugin.settings.openNewNote=r,r===!0&&(this.plugin.settings.openNewNoteInNewTab=!1),await this.plugin.saveSettings(),this.display()})),new v.Setting(e).setName("Open new note in new tab").setDesc("If enabled, new note will open in new tab").addToggle(n=>n.setValue(this.plugin.settings.openNewNoteInNewTab||d.openNewNoteInNewTab).onChange(async r=>{this.plugin.settings.openNewNoteInNewTab=r,r===!0&&(this.plugin.settings.openNewNote=!1),await this.plugin.saveSettings(),this.display()})),new v.Setting(e).setName("Batch process URLs").setDesc("If enabled, a list of URLs will processed in sequence. Delimiter can be set in setting bellow.").addToggle(n=>{var r;return n.setValue((r=this.plugin.settings.batchProcess)!=null?r:d.batchProcess).onChange(async s=>{this.plugin.settings.batchProcess=s,await this.plugin.saveSettings()})}),new v.Setting(e).setName("Batch note creation delimiter").setDesc("Delimiter for batch list of notes").addDropdown(n=>{ya().forEach(r=>n.addOption(r.option,r.label)),n.setValue(this.plugin.settings.batchProcessDelimiter||d.batchProcessDelimiter),n.onChange(async r=>{this.plugin.settings.batchProcessDelimiter=r,await this.plugin.saveSettings()})}),new v.Setting(e).setName("Date format string").setDesc("Format of the %date% variable. NOTE: do not use symbols forbidden in file names.").addText(n=>n.setPlaceholder(`Defaultsto${d.dateTitleFmt}`).setValue(typeof this.plugin.settings.dateTitleFmt=="undefined"?d.dateTitleFmt:this.plugin.settings.dateTitleFmt).onChange(async r=>{this.plugin.settings.dateTitleFmt=r,await this.plugin.saveSettings()})),new v.Setting(e).setName("Date format string in content").setDesc("Format of the %date% variable for content").addText(n=>n.setPlaceholder(`Defaultsto${d.dateContentFmt}`).setValue(typeof this.plugin.settings.dateContentFmt=="undefined"?d.dateContentFmt:this.plugin.settings.dateContentFmt).onChange(async r=>{this.plugin.settings.dateContentFmt=r,await this.plugin.saveSettings()})),new v.Setting(e).setName("Extend share menu").setDesc("If enabled, share menu will be extended with shortcut to create note directly from it. Requires plugin reload or Obsidian restart to apply change.").addToggle(n=>n.setValue(Object.prototype.hasOwnProperty.call(this.plugin.settings,"extendShareMenu")?this.plugin.settings.extendShareMenu:d.extendShareMenu).onChange(async r=>{this.plugin.settings.extendShareMenu=r,await this.plugin.saveSettings()})),e.createEl("h2",{text:"YouTube"}),new v.Setting(e).setName("Youtube content type slug").setDesc(this.createTemplateVariableReferenceDiv()).addText(n=>n.set
`:e}};this.options=ar({},t,i),this.rules=new Ma(this.options)}Mt.prototype={turndown:function(i){if(!Sr(i))throw new TypeError(i+" is not a string, or an element/document/fragment node.");if(i==="")return"";var t=Oa.call(this,new fr(i,this.options));return Ar.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 Er.reduce(function(t,e){return t.replace(e[0],e[1])},i)}};function Oa(i){var t=this;return Nr.call(i.childNodes,function(e,a){a=new xr(a,t.options);var n="";return a.nodeType===3?n=a.isCode?a.nodeValue:t.escape(a.nodeValue):a.nodeType===1&&(n=_r.call(t,a)),Fa(e,n)},"")}function Ar(i){var t=this;return this.rules.forEach(function(e){typeof e.append=="function"&&(i=Fa(i,e.append(t.options)))}),i.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function _r(i){var t=this.rules.forNode(i),e=Oa.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 Fa(i,t){var e=rr(i),a=nr(t),n=Math.max(i.length-e.length,t.length-a.length),r=`