/ *
THIS IS A GENERATED / BUNDLED FILE BY ESBUILD
if you want to view the source , please visit the github repository of this plugin
* /
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:/ \u 002C| \u 060C| \u FE50| \u FE10| \u FE11| \u 2E41| \u 2E34| \u 2E32| \u FF0C/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 ] ]
# [ { { videoTitle } } ] ( { { videoURL } } )
{ { videoPlayer } } ` ,youtubeEmbedWidth:"560",youtubeEmbedHeight:"315",youtubeUsePrivacyEnhancedEmbed:!0,vimeoContentTypeSlug:"vimeo",vimeoNoteTitle:"Vimeo - {{ title }}",vimeoNote: ` [ [ ReadItLater ] ] [ [ Vimeo ] ]
# [ { { videoTitle } } ] ( { { videoURL } } )
{ { videoPlayer } }
{ { videoChapters } } ` ,vimeoEmbedWidth:"560",vimeoEmbedHeight:"315",bilibiliContentTypeSlug:"bilibili",bilibiliNoteTitle:"Bilibili - {{ title }}",bilibiliNote: ` [ [ ReadItLater ] ] [ [ Bilibili ] ]
# [ { { videoTitle } } ] ( { { videoURL } } )
{ { videoPlayer } } ` ,bilibiliEmbedWidth:"560",bilibiliEmbedHeight:"315",twitterContentTypeSlug:"xcom",twitterNoteTitle:"Tweet from {{ tweetAuthorName }} ({{ date }})",twitterNote: ` [ [ ReadItLater ] ] [ [ Tweet ] ]
# [ { { tweetAuthorName } } ] ( { { tweetURL } } )
{ { tweetContent } } ` ,parseableArticleContentType:"article",parseableArticleNoteTitle:"{{ title }}",parsableArticleNote: ` [ [ ReadItLater ] ] [ [ Article ] ]
# [ { { articleTitle } } ] ( { { articleURL } } )
{ { articleContent } } ` ,notParseableArticleContentType:"article",notParseableArticleNoteTitle:"Article {{ date }}",notParsableArticleNote: ` [ [ ReadItLater ] ] [ [ Article ] ]
[ { { articleURL } } ] ( { { articleURL } } ) ` ,textSnippetContentType:"textsnippet",textSnippetNoteTitle:"Note {{ date }}",textSnippetNote: ` [ [ ReadItLater ] ] [ [ Textsnippet ] ]
{ { content } } ` ,mastodonContentTypeSlug:"mastodon",mastodonNoteTitle:"Toot from {{ tootAuthorName }} ({{ date }})",mastodonNote: ` [ [ ReadItLater ] ] [ [ Toot ] ]
# [ { { tootAuthorName } } ] ( { { tootURL } } )
> { { 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 } } )
> { { tootContent } } ` ,stackExchangeContentType:"stackexchange",stackExchangeNoteTitle:"{{ title }}",stackExchangeNote: ` [ [ ReadItLater ] ] [ [ StackExchange ] ]
# [ { { questionTitle } } ] ( { { questionURL } } )
Author : [ { { authorName } } ] ( { { authorProfileURL } } )
{ { questionContent } }
* * *
{ { topAnswer } }
{ { answers } } ` ,stackExchangeAnswer: ` Answered by : [ { { authorName } } ] ( { { authorProfileURL } } )
{ { answerContent } } ` ,downloadStackExchangeAssets:!0,downloadStackExchangeAssetsInDir:!1,youtubeApiKey:"",tikTokContentTypeSlug:"tiktok",tikTokNoteTitle:"TikTok from {{ authorName }} ({{ date }})",tikTokNote: ` [ [ ReadItLater ] ] [ [ TikTok ] ]
{ { videoDescription } }
[ { { videoURL } } ] ( { { videoURL } } )
{ { 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 + ) ? / ) } t e s t ( e ) { r e t u r n t h i s . i s V a l i d U r l ( e ) & & t h i s . P A T T E R N . t e s t ( e ) } a s y n c p r e p a r e N o t e ( e ) { l e t a = n e w D a t e , n = a w a i t t h i s . p a r s e S c h e m a ( e , a ) , r = t h i s . t e m p l a t e E n g i n e . r e n d e r ( t h i s . p l u g i n . s e t t i n g s . v i m e o N o t e , n ) , s = t h i s . t e m p l a t e E n g i n e . r e n d e r ( t h i s . p l u g i n . s e t t i n g s . v i m e o N o t e T i t l e , { t i t l e : n . v i d e o T i t l e , d a t e : t h i s . g e t F o r m a t t e d D a t e F o r F i l e n a m e ( a ) } ) ; r e t u r n n e w H ( s , " m d " , r , t h i s . p l u g i n . s e t t i n g s . v i m e o C o n t e n t T y p e S l u g , a ) } a s y n c p a r s e S c h e m a ( e , a ) { v a r u , v , k , y , D , N ; l e t n = a w a i t ( 0 , B a . r e q u e s t ) ( { m e t h o d : " G E T " , u r l : e , h e a d e r s : { " u s e r - a g e n t " : " M o z i l l a / 5 . 0 ( W i n d o w s N T 1 0 . 0 ; W i n 6 4 ; x 6 4 ) A p p l e W e b K i t / 5 3 7 . 3 6 ( K H T M L , l i k e G e c k o ) C h r o m e / 1 0 8 . 0 . 0 . 0 S a f a r i / 5 3 7 . 3 6 " } } ) , s = n e w D O M P a r s e r ( ) . p a r s e F r o m S t r i n g ( n , " t e x t / h t m l " ) . q u e r y S e l e c t o r ( ' s c r i p t [ t y p e = " a p p l i c a t i o n / l d + j s o n " ] ' ) , l = J S O N . p a r s e ( s . t e x t C o n t e n t ) [ 0 ] , c = t h i s . P A T T E R N . e x e c ( e ) ; r e t u r n { d a t e : t h i s . g e t F o r m a t t e d D a t e F o r C o n t e n t ( a ) , v i d e o I d : c . l e n g t h = = = 3 ? c [ 2 ] : " " , v i d e o U R L : ( u = l = = n u l l ? v o i d 0 : l . u r l ) ! = n u l l ? u : " " , v i d e o T i t l e : ( v = l = = n u l l ? v o i d 0 : l . n a m e ) ! = n u l l ? v : " " , v i d e o P l a y e r : ` < i f r a m e w i d t h = " $ { t h i s . p l u g i n . s e t t i n g s . v i m e o E m b e d W i d t h } " h e i g h t = " $ { t h i s . p l u g i n . s e t t i n g s . v i m e o E m b e d H e i g h t } " s r c = " $ { l = = n u l l ? v o i d 0 : l . e m b e d U r l } " t i t l e = " V i m e o v i d e o p l a y e r " f r a m e b o r d e r = " 0 " a l l o w = " a c c e l e r o m e t e r ; a u t o p l a y ; c l i p b o a r d - w r i t e ; e n c r y p t e d - m e d i a ; g y r o s c o p e ; p i c t u r e - i n - p i c t u r e " a l l o w f u l l s c r e e n > < / i f r a m e > ` , c h a n n e l N a m e : ( y = ( k = l = = n u l l ? v o i d 0 : l . a u t h o r ) = = n u l l ? v o i d 0 : k . n a m e ) ! = n u l l ? y : " " , c h a n n e l U R L : ( N = ( D = l = = n u l l ? v o i d 0 : l . a u t h o r ) = = n u l l ? v o i d 0 : D . u r l ) ! = n u l l ? N : " " } } } , j a = _ i ; v a r $ a = r e q u i r e ( " o b s i d i a n " ) ; v a r D i = c l a s s e x t e n d s B { c o n s t r u c t o r ( ) { s u p e r ( . . . a r g u m e n t s ) ; _ ( t h i s , " P A T T E R N " , / ( b i l i b i l i . c o m ) \ / ( v i d e o ) ? \ / ( [ a - z 0 - 9 ] + ) ? / i ) } t e s t ( e ) { r e t u r n t h i s . i s V a l i d U r l ( e ) & & t h i s . P A T T E R N . t e s t ( e ) } a s y n c p r e p a r e N o t e ( e ) { l e t a = n e w D a t e , n = a w a i t t h i s . g e t N o t e D a t a ( e , a ) , r = t h i s . t e m p l a t e E n g i n e . r e n d e r ( t h i s . p l u g i n . s e t t i n g s . b i l i b i l i N o t e , n ) , s = t h i s . t e m p l a t e E n g i n e . r e n d e r ( t h i s . p l u g i n . s e t t i n g s . b i l i b i l i N o t e T i t l e , { t i t l e : n . v i d e o T i t l e , d a t e : t h i s . g e t F o r m a t t e d D a t e F o r F i l e n a m e ( a ) } ) ; r e t u r n n e w H ( s , " m d " , r , t h i s . p l u g i n . s e t t i n g s . b i l i b i l i C o n t e n t T y p e S l u g , a ) } a s y n c g e t N o t e D a t a ( e , a ) { v a r p , l ; l e t n = a w a i t ( 0 , $ a . r e q u e s t ) ( { m e t h o d : " G E T " , u r l : e , h e a d e r s : { " u s e r - a g e n t " : " M o z i l l a / 5 . 0 ( W i n d o w s N T 1 0 . 0 ; W i n 6 4 ; x 6 4 ) A p p l e W e b K i t / 5 3 7 . 3 6 ( K H T M L , l i k e G e c k o ) C h r o m e / 1 0 3 . 0 . 0 . 0 S a f a r i / 5 3 7 . 3 6 " } } ) , r = n e w D O M P a r s e r ( ) . p a r s e F r o m S t r i n g ( n , " t e x t / h t m l " ) , s = ( p = t h i s . P A T T E R N . e x e c ( e ) [ 3 ] ) ! = n u l l ? p : " " ; r e t u r n { d a t e : t h i s . g e t F o r m a t t e d D a t e F o r C o n t e n t ( a ) , v i d e o I d : s , v i d e o T i t l e : ( l = r . q u e r y S e l e c t o r ( " [ p r o p e r t y ~ = ' o g : t i t l e ' ] " ) . g e t A t t r i b u t e ( " c o n t e n t " ) ) ! = n u l l ? l : " " , v i d e o U R L : e , v i d e o P l a y e r : ` < i f r a m e w i d t h = " $ { t h i s . p l u g i n . s e t t i n g s . b i l i b i l i E m b e d W i d t h } " h e i g h t = " $ { t h i s . p l u g i n . s e t t i n g s . b i l i b i l i E m b e d H e i g h t } " s r c = " h t t p s : / / p l a y e r . b i l i b i l i . c o m / p l a y e r . h t m l ? a u t o p l a y = 0 & b v i d = $ { s } " s c r o l l i n g = " n o " b o r d e r = " 0 " f r a m e b o r d e r = " n o " f r a m e s p a c i n g = " 0 " a l l o w f u l l s c r e e n = " t r u e " > < / i f r a m e > ` } } } , W a = D i ; v a r Y t = r e q u i r e ( " o b s i d i a n " ) ; f u n c t i o n g r ( i ) { f o r ( v a r t = 1 ; t < a r g u m e n t s . l e n g t h ; t + + ) { v a r e = a r g u m e n t s [ t ] ; f o r ( v a r a i n e ) e . h a s O w n P r o p e r t y ( a ) & & ( i [ a ] = e [ a ] ) } r e t u r n i } f u n c t i o n P i ( i , t ) { r e t u r n A r r a y ( t + 1 ) . j o i n ( i ) } f u n c t i o n h r ( i ) { r e t u r n i . r e p l a c e ( / ^ \ n * / , " " ) } f u n c t i o n f r ( i ) { f o r ( v a r t = i . l e n g t h ; 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 `
` +i+ `
` }};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 `
` +i+ `
` +n+ `
` }else return `
` +Pi("#",a)+" "+i+ `
` }};oe.blockquote={filter:"blockquote",replacement:function(i){return i=i.replace(/^ \n +| \n + $ /g,""),i=i.replace(/^/gm,"> "), `
` +i+ `
` }};oe.list={filter:["ul","ol"],replacement:function(i,t){var e=t.parentNode;return e.nodeName==="LI"&&e.lastElementChild===t? `
` +i: `
` +i+ `
` }};oe.listItem={filter:"li",replacement:function(i,t,e){i=i.replace(/^ \n +/,"").replace(/ \n + $ /, `
` ).replace(/ \n /gm, `
` );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)? `
` :"")}};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 `
` +t.firstChild.textContent.replace(/ \n /g, `
` )+ `
` }};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 `
` +u+n+ `
` +r.replace(/ \n $ /,"")+ `
` +u+ `
` }};oe.horizontalRule={filter:"hr",replacement:function(i,t,e){return `
` +e.hr+ `
` }};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= `
` +this.references.join( `
` )+ `
` ,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 , " \ \
` :""},keepReplacement:function(e,a){return a.isBlock? `
` +a.outerHTML+ `
` :a.outerHTML},defaultReplacement:function(e,a){return a.isBlock? `
` +e+ `
` :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= `
` .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 `
` +a.fence+r+ `
` +e.firstChild.textContent+ `
` +a.fence+ `
` }})}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 `
` +i+(e? `
` +e:"")}};Ye.table={filter:function(i){return i.nodeName==="TABLE"&&!sn(i)},replacement:function(i){return i=i.replace( `
` , `
` ), `
` +i+ `
` }};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+ `
` }}),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+ `
` +c.replace(/ \n $ /,"")+ `
` +D+ `
` }}),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
* * *
` ,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
* * *
` ,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?`
> * $ { n } * ` :"";return ` $ { e }
! [ ] ( $ { 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(`
` ).map(e=> ` > $ { e } ` ).join( `
` ):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 } < / l i > ` ) . j o i n ( " " ) ; t h i s . s e t C o n t e n t ( B t ( ` < u l > $ { n } < / u l > ` ) ) ; l e t r = ! 1 ; n e w D t . S e t t i n g ( t h i s . c o n t e n t E l ) . s e t N a m e ( " D o n o t a s k a g a i n " ) . a d d T o g g l e ( s = > { s . s e t V a l u e ( ! 1 ) . o n C h a n g e ( ( ) = > r = ! 0 ) } ) , n e w D t . S e t t i n g ( t h i s . c o n t e n t E l ) . a d d B u t t o n ( s = > s . s e t B u t t o n T e x t ( " A p p e n d t o e x i s t i n g " ) . s e t C t a ( ) . o n C l i c k ( ( ) = > { t h i s . c l o s e ( ) , a ( " a p p e n d T o E x i s t i n g " , r ) } ) ) . a d d B u t t o n ( s = > s . s e t B u t t o n T e x t ( " N o t h i n g " ) . o n C l i c k ( ( ) = > { t h i s . c l o s e ( ) , a ( " n o t h i n g " , r ) } ) ) } } ; v a r J t = c l a s s { c o n s t r u c t o r ( t , e , a ) { t h i s . p a r s e r C r e a t o r = t ; t h i s . p l u g i n = e ; t h i s . r e p o s i t o r y = a } a s y n c c r e a t e N o t e ( t ) { l e t e = a w a i t t h i s . m a k e N o t e ( t ) ; t r y { a w a i t t h i s . r e p o s i t o r y . s a v e N o t e ( e ) } c a t c h ( a ) { a i n s t a n c e o f B e & & t h i s . h a n d l e F i l e E x i s t s E r r o r ( [ e ] ) } } a s y n c c r e a t e N o t e s F r o m B a t c h ( t ) { l e t e = c n ( t , t h i s . p l u g i n . s e t t i n g s . b a t c h P r o c e s s D e l i m i t e r ) , a = [ ] ; f o r ( l e t n o f e . e v e r y L i n e I s U R L ? e . u r l s : [ t ] ) { l e t r = a w a i t t h i s . m a k e N o t e ( n ) ; t r y { a w a i t t h i s . r e p o s i t o r y . s a v e N o t e ( r ) } c a t c h ( s ) { s i n s t a n c e o f B e & & a . p u s h ( r ) } } a . l e n g t h > 0 & & t h i s . h a n d l e F i l e E x i s t s E r r o r ( a ) } a s y n c i n s e r t C o n t e n t A t E d i t o r C u r s o r P o s i t i o n ( t , e ) { l e t a = a w a i t t h i s . m a k e N o t e ( t ) ; e . r e p l a c e R a n g e ( a . c o n t e n t , e . g e t C u r s o r ( ) ) } a s y n c m a k e N o t e ( t ) { r e t u r n a w a i t ( a w a i t t h i s . p a r s e r C r e a t o r . c r e a t e P a r s e r ( t ) ) . p r e p a r e N o t e ( t ) } o p e n N o t e ( t ) { i f ( t h i s . p l u g i n . s e t t i n g s . o p e n N e w N o t e | | t h i s . p l u g i n . s e t t i n g s . o p e n N e w N o t e I n N e w T a b ) t r y { l e t e = t h i s . r e p o s i t o r y . g e t F i l e B y P a t h ( t . f i l e P a t h ) ; t h i s . p l u g i n . a p p . w o r k s p a c e . g e t L e a f ( t h i s . p l u g i n . s e t t i n g s . o p e n N e w N o t e I n N e w T a b ? " t a b " : ! 1 ) . o p e n F i l e ( e ) } c a t c h ( e ) { c o n s o l e . e r r o r ( e ) , n e w C t . N o t i c e ( ` U n a b l e t o o p e n $ { t . g e t F u l l F i l e n a m e ( ) } ` ) } } a s y n c h a n d l e F i l e E x i s t s E r r o r ( t ) { s w i t c h ( t h i s . p l u g i n . s e t t i n g s . f i l e E x i s t s S t r a t e g y ) { c a s e " a s k " : n e w k t ( t h i s . p l u g i n . a p p , t , ( e , a ) = > { t h i s . h a n d l e F i l e A s k M o d a l R e s p o n s e ( e , a , t ) } ) . o p e n ( ) ; b r e a k ; c a s e " n o t h i n g " : t h i s . h a n d l e F i l e E x i s t s S t r a t e g y N o t h i n g ( t ) ; b r e a k ; c a s e " a p p e n d T o E x i s t i n g " : t h i s . h a n d l e F i l e E x i s t s S t r a t e g y A p p e n d ( t ) ; b r e a k } } a s y n c h a n d l e F i l e A s k M o d a l R e s p o n s e ( t , e , a ) { s w i t c h ( t ) { c a s e " n o t h i n g " : t h i s . h a n d l e F i l e E x i s t s S t r a t e g y N o t h i n g ( a ) ; b r e a k ; c a s e " a p p e n d T o E x i s t i n g " : t h i s . h a n d l e F i l e E x i s t s S t r a t e g y A p p e n d ( a ) ; b r e a k } e & & t h i s . p l u g i n . s a v e S e t t i n g ( " f i l e E x i s t s S t r a t e g y " , t ) , a . l e n g t h = = = 1 & & t h i s . o p e n N o t e ( a . s h i f t ( ) ) } a s y n c h a n d l e F i l e E x i s t s S t r a t e g y A p p e n d ( t ) { f o r ( l e t e o f t ) t r y { a w a i t t h i s . r e p o s i t o r y . a p p e n d T o E x i s t i n g N o t e ( e ) , n e w C t . N o t i c e ( ` $ { e . g e t F u l l F i l e n a m e ( ) } w a s u p d a t e d . ` ) } c a t c h ( a ) { c o n s o l e . e r r o r ( a ) , n e w C t . N o t i c e ( ` $ { e . g e t F u l l F i l e n a m e ( ) } w a s n o t u p d a t e d ! ` , 0 ) } } h a n d l e F i l e E x i s t s S t r a t e g y N o t h i n g ( t ) { f o r ( l e t e o f t ) n e w C t . N o t i c e ( ` $ { e . g e t F u l l F i l e n a m e ( ) } a l r e a d y e x i s t s . ` ) } } ; v a r Z t = c l a s s { c o n s t r u c t o r ( t ) { t h i s . n o t e S e r v i c e = t } a s y n c p r o c e s s C o n t e n t ( t ) { t h i s . n o t e S e r v i c e . c r e a t e N o t e ( t ) } a s y n c p r o c e s s C o n t e n t B a t c h ( t ) { t h i s . n o t e S e r v i c e . c r e a t e N o t e s F r o m B a t c h ( t ) } a s y n c i n s e r t C o n t e n t A t E d i t o r C u r s o r P o s i t i o n ( t , e ) { t h i s . n o t e S e r v i c e . i n s e r t C o n t e n t A t E d i t o r C u r s o r P o s i t i o n ( t , e ) } } ; v a r Q t = c l a s s e x t e n d s d t . P l u g i n { c o n s t r u c t o r ( ) { s u p e r ( . . . a r g u m e n t s ) ; _ ( t h i s , " a p i " ) ; _ ( t h i s , " s e t t i n g s " ) ; _ ( t h i s , " f i l e S y s t e m L i m i t s " ) ; _ ( t h i s , " n o t e S e r v i c e " ) ; _ ( t h i s , " p a r s e r C r e a t o r " ) ; _ ( t h i s , " t e m p l a t e E n g i n e " ) ; _ ( t h i s , " v a u l t R e p o s i t o r y " ) } g e t F i l e S y s t e m L i m i t s ( ) { r e t u r n t h i s . f i l e S y s t e m L i m i t s } g e t V a u l t R e p o s i t o r y ( ) { r e t u r n t h i s . v a u l t R e p o s i t o r y } a s y n c o n l o a d ( ) { a w a i t t h i s . l o a d S e t t i n g s ( ) , t h i s . f i l e S y s t e m L i m i t s = M a ( d t . P l a t f o r m , t h i s . s e t t i n g s ) , t h i s . t e m p l a t e E n g i n e = n e w A t , t h i s . p a r s e r C r e a t o r = n e w w t ( [ n e w z a ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w S t ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w j a ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w W a ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w l n ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w m n ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w y n ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w w n ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w N t ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w E t ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w p t ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) , n e w x n ( t h i s . a p p , t h i s , t h i s . t e m p l a t e E n g i n e ) ] ) , t h i s . v a u l t R e p o s i t o r y = n e w _ t ( t h i s , t h i s . t e m p l a t e E n g i n e ) , t h i s . n o t e S e r v i c e = n e w J t ( t h i s . p a r s e r C r e a t o r , t h i s , t h i s . v a u l t R e p o s i t o r y ) , t h i s . a p i = n e w Z t ( t h i s . n o t e S e r v i c e ) , ( 0 , d t . a d d I c o n ) ( " r e a d - i t - l a t e r " , n s ) , t h i s . a d d R i b b o n I c o n ( " r e a d - i t - l a t e r " , " R e a d I t L a t e r : C r e a t e f r o m c l i p b o a r d " , a s y n c ( ) = > { 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 >
< / s v g > ` ;
/ * ! B u n d l e d l i c e n s e i n f o r m a t i o n :
dompurify / dist / purify . js :
( * ! @ 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 * )
* /
/* nosourcemap */