!n.includes(e)).join(" ").length/i.join(" ").length:0},_checkByline:function(e,t){if(this._articleByline)return!1;if(void 0!==e.getAttribute)var n=e.getAttribute("rel"),i=e.getAttribute("itemprop");return!!(("author"===n||i&&-1!==i.indexOf("author")||this.REGEXPS.byline.test(t))&&this._isValidByline(e.textContent))&&(this._articleByline=e.textContent.trim(),!0)},_getNodeAncestors:function(e,t){t=t||0;for(var n=0,i=[];e.parentNode&&(i.push(e.parentNode),!t||++n!==t);)e=e.parentNode;return i},_grabArticle:function(e){this.log("**** grabArticle ****");var t=this._doc,n=null!==e;if(!(e=e||this._doc.body))return this.log("No body found in document. Abort."),null;for(var i=e.innerHTML;;){this.log("Starting grabArticle loop");var r,o=this._flagIsActive(this.FLAG_STRIP_UNLIKELYS),a=[],s=this._doc.documentElement;let F=!0;for(;s;){"HTML"===s.tagName&&(this._articleLang=s.getAttribute("lang"));var l=s.className+" "+s.id;if(!this._isProbablyVisible(s)){this.log("Removing hidden node - "+l),s=this._removeAndGetNext(s);continue}if(this._checkByline(s,l)){s=this._removeAndGetNext(s);continue}if(F&&this._headerDuplicatesTitle(s)){this.log("Removing header: ",s.textContent.trim(),this._articleTitle.trim()),F=!1,s=this._removeAndGetNext(s);continue}if(o){if(this.REGEXPS.unlikelyCandidates.test(l)&&!this.REGEXPS.okMaybeItsACandidate.test(l)&&!this._hasAncestorTag(s,"table")&&!this._hasAncestorTag(s,"code")&&"BODY"!==s.tagName&&"A"!==s.tagName){this.log("Removing unlikely candidate - "+l),s=this._removeAndGetNext(s);continue}if(this.UNLIKELY_ROLES.includes(s.getAttribute("role"))){this.log("Removing content with role "+s.getAttribute("role")+" - "+l),s=this._removeAndGetNext(s);continue}}if(("DIV"===s.tagName||"SECTION"===s.tagName||"HEADER"===s.tagName||"H1"===s.tagName||"H2"===s.tagName||"H3"===s.tagName||"H4"===s.tagName||"H5"===s.tagName||"H6"===s.tagName)&&this._isElementWithoutContent(s)){s=this._removeAndGetNext(s);continue}if(-1!==this.DEFAULT_TAGS_TO_SCORE.indexOf(s.tagName)&&a.push(s),"DIV"===s.tagName){for(var c=null,u=s.firstChild;u;){var h=u.nextSibling;if(this._isPhrasingContent(u))null!==c?c.appendChild(u):this._isWhitespace(u)||(c=t.createElement("p"),s.replaceChild(c,u),c.appendChild(u));else if(null!==c){for(;c.lastChild&&this._isWhitespace(c.lastChild);)c.removeChild(c.lastChild);c=null}u=h}if(this._hasSingleTagInsideElement(s,"P")&&.25>this._getLinkDensity(s)){var d=s.children[0];s.parentNode.replaceChild(d,s),s=d,a.push(s)}else this._hasChildBlockElement(s)||(s=this._setNodeTag(s,"P"),a.push(s))}s=this._getNextNode(s)}var f=[];this._forEachNode(a,function(e){if(e.parentNode&&void 0!==e.parentNode.tagName){var t,n=this._getInnerText(e);if(!(n.length<25)){var i=this._getNodeAncestors(e,5);0!==i.length&&(t=1+n.split(",").length+Math.min(Math.floor(n.length/100),3),this._forEachNode(i,function(e,n){if(e.tagName&&e.parentNode&&void 0!==e.parentNode.tagName){if(void 0===e.readability&&(this._initializeNode(e),f.push(e)),0===n)var i=1;else i=1===n?2:3*n;e.readability.contentScore+=t/i}}))}}});for(var g=[],m=0,p=f.length;mb.readability.contentScore){g.splice(_,0,y),g.length>this._nbTopCandidates&&g.pop();break}}}var E=g[0]||null,N=!1;if(null===E||"BODY"===E.tagName){for(E=t.createElement("DIV"),N=!0;e.firstChild;)this.log("Moving child out:",e.firstChild),E.appendChild(e.firstChild);e.appendChild(E),this._initializeNode(E)}else if(E){for(var A=[],T=1;T=.75&&A.push(this._getNodeAncestors(g[T]));if(A.length>=3)for(r=E.parentNode;"BODY"!==r.tagName;){for(var C=0,S=0;S=3){E=r;break}r=r.parentNode}E.readability||this._initializeNode(E),r=E.parentNode;for(var x=E.readability.contentScore,w=x/3;"BODY"!==r.tagName;){if(!r.readability){r=r.parentNode;continue}var L=r.readability.contentScore;if(Lx){E=r;break}x=r.readability.contentScore,r=r.parentNode}for(r=E.parentNode;"BODY"!=r.tagName&&1==r.children.length;)r=(E=r).parentNode;E.readability||this._initializeNode(E)}var P=t.createElement("DIV");n&&(P.id="readability-content");for(var O=Math.max(10,.2*E.readability.contentScore),I=(r=E.parentNode).children,R=0,D=I.length;R=O)k=!0;else if("P"===M.nodeName){var H=this._getLinkDensity(M),j=this._getInnerText(M),$=j.length;$>80&&H<.25?k=!0:$<80&&$>0&&0===H&&-1!==j.search(/\.( |$)/)&&(k=!0)}}k&&(this.log("Appending node:",M),-1===this.ALTER_TO_DIV_EXCEPTIONS.indexOf(M.nodeName)&&(this.log("Altering sibling:",M,"to div."),M=this._setNodeTag(M,"DIV")),P.appendChild(M),I=r.children,R-=1,D-=1)}if(this._debug&&this.log("Article content pre-prep: "+P.innerHTML),this._prepArticle(P),this._debug&&this.log("Article content post-prep: "+P.innerHTML),N)E.id="readability-page-1",E.className="page";else{var U=t.createElement("DIV");for(U.id="readability-page-1",U.className="page";P.firstChild;)U.appendChild(P.firstChild);P.appendChild(U)}this._debug&&this.log("Article content after paging: "+P.innerHTML);var G=!0,V=this._getInnerText(P,!0).length;if(V0&&e.length<100},_unescapeHtmlEntities:function(e){if(!e)return e;var t=this.HTML_ESCAPE_MAP;return e.replace(/&(quot|amp|apos|lt|gt);/g,function(e,n){return t[n]}).replace(/(?:x([0-9a-z]{1,4})|([0-9]{1,4}));/gi,function(e,t,n){return String.fromCharCode(parseInt(t||n,t?16:10))})},_getJSONLD:function(e){var t,n=this._getAllNodesWithTag(e,["script"]);return this._forEachNode(n,function(e){if(!t&&"application/ld+json"===e.getAttribute("type"))try{var n=e.textContent.replace(/^\s*\s*$/g,""),i=JSON.parse(n);if(!i["@context"]||!i["@context"].match(/^https?\:\/\/schema\.org$/)||(!i["@type"]&&Array.isArray(i["@graph"])&&(i=i["@graph"].find(function(e){return(e["@type"]||"").match(this.REGEXPS.jsonLdArticleTypes)})),!i||!i["@type"]||!i["@type"].match(this.REGEXPS.jsonLdArticleTypes)))return;if(t={},"string"==typeof i.name&&"string"==typeof i.headline&&i.name!==i.headline){var r=this._getArticleTitle(),o=this._textSimilarity(i.name,r)>.75;this._textSimilarity(i.headline,r)>.75&&!o?t.title=i.headline:t.title=i.name}else"string"==typeof i.name?t.title=i.name.trim():"string"==typeof i.headline&&(t.title=i.headline.trim());i.author&&("string"==typeof i.author.name?t.byline=i.author.name.trim():Array.isArray(i.author)&&i.author[0]&&"string"==typeof i.author[0].name&&(t.byline=i.author.filter(function(e){return e&&"string"==typeof e.name}).map(function(e){return e.name.trim()}).join(", "))),"string"==typeof i.description&&(t.excerpt=i.description.trim()),i.publisher&&"string"==typeof i.publisher.name&&(t.siteName=i.publisher.name.trim());return}catch(e){this.log(e.message)}}),t||{}},_getArticleMetadata:function(e){var t={},n={},i=this._doc.getElementsByTagName("meta"),r=/\s*(dc|dcterm|og|twitter)\s*:\s*(author|creator|description|title|site_name)\s*/gi,o=/^\s*(?:(dc|dcterm|og|twitter|weibo:(article|webpage))\s*[\.:]\s*)?(author|creator|description|title|site_name)\s*$/i;return this._forEachNode(i,function(e){var t=e.getAttribute("name"),i=e.getAttribute("property"),a=e.getAttribute("content");if(a){var s=null,l=null;i&&(s=i.match(r))&&(n[l=s[0].toLowerCase().replace(/\s/g,"")]=a.trim()),!s&&t&&o.test(t)&&(l=t,a&&(n[l=l.toLowerCase().replace(/\s/g,"").replace(/\./g,":")]=a.trim()))}}),t.title=e.title||n["dc:title"]||n["dcterm:title"]||n["og:title"]||n["weibo:article:title"]||n["weibo:webpage:title"]||n.title||n["twitter:title"],t.title||(t.title=this._getArticleTitle()),t.byline=e.byline||n["dc:creator"]||n["dcterm:creator"]||n.author,t.excerpt=e.excerpt||n["dc:description"]||n["dcterm:description"]||n["og:description"]||n["weibo:article:description"]||n["weibo:webpage:description"]||n.description||n["twitter:description"],t.siteName=e.siteName||n["og:site_name"],t.title=this._unescapeHtmlEntities(t.title),t.byline=this._unescapeHtmlEntities(t.byline),t.excerpt=this._unescapeHtmlEntities(t.excerpt),t.siteName=this._unescapeHtmlEntities(t.siteName),t},_isSingleImage:function(e){return"IMG"===e.tagName||1===e.children.length&&""===e.textContent.trim()&&this._isSingleImage(e.children[0])},_unwrapNoscriptImages:function(e){var t=Array.from(e.getElementsByTagName("img"));this._forEachNode(t,function(e){for(var t=0;t0)||!(r>n));){if(e.parentNode.tagName===t&&(!i||i(e.parentNode)))return!0;e=e.parentNode,r++}return!1},_getRowAndColumnCount:function(e){for(var t=0,n=0,i=e.getElementsByTagName("tr"),r=0;r0){i._readabilityDataTable=!0;continue}if(["col","colgroup","tfoot","thead","th"].some(function(e){return!!i.getElementsByTagName(e)[0]})){this.log("Data table because found data-y descendant"),i._readabilityDataTable=!0;continue}if(i.getElementsByTagName("table")[0]){i._readabilityDataTable=!1;continue}var o=this._getRowAndColumnCount(i);if(o.rows>=10||o.columns>4){i._readabilityDataTable=!0;continue}i._readabilityDataTable=o.rows*o.columns>10}},_fixLazyImages:function(e){this._forEachNode(this._getAllNodesWithTag(e,["img","picture","figure"]),function(e){if(e.src&&this.REGEXPS.b64DataUrl.test(e.src)){if("image/svg+xml"===this.REGEXPS.b64DataUrl.exec(e.src)[1])return;for(var t=!1,n=0;ni+=this._getInnerText(e,!0).length),i/n},_cleanConditionally:function(e,t){this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)&&this._removeNodes(this._getAllNodesWithTag(e,[t]),function(e){var n=function(e){return e._readabilityDataTable},i="ul"===t||"ol"===t;if(!i){var r=0,o=this._getAllNodesWithTag(e,["ul","ol"]);this._forEachNode(o,e=>r+=this._getInnerText(e).length),i=r/this._getInnerText(e).length>.9}if("table"===t&&n(e)||this._hasAncestorTag(e,"table",-1,n)||this._hasAncestorTag(e,"code"))return!1;var a=this._getClassWeight(e);if(this.log("Cleaning Conditionally",e),a+0<0)return!0;if(10>this._getCharCount(e,",")){for(var s=e.getElementsByTagName("p").length,l=e.getElementsByTagName("img").length,c=e.getElementsByTagName("li").length-100,u=e.getElementsByTagName("input").length,h=this._getTextDensity(e,["h1","h2","h3","h4","h5","h6"]),d=0,f=this._getAllNodesWithTag(e,["object","embed","iframe"]),g=0;g1&&s/l<.5&&!this._hasAncestorTag(e,"figure")||!i&&c>s||u>Math.floor(s/3)||!i&&h<.9&&y<25&&(0===l||l>2)&&!this._hasAncestorTag(e,"figure")||!i&&a<25&&p>.2||a>=25&&p>.5||1===d&&y<75||d>1}return!1})},_cleanMatchedNodes:function(e,t){for(var n=this._getNextNode(e,!0),i=this._getNextNode(e);i&&i!=n;)i=t.call(this,i,i.className+" "+i.id)?this._removeAndGetNext(i):this._getNextNode(i)},_cleanHeaders:function(e){let t=this._getAllNodesWithTag(e,["h1","h2"]);this._removeNodes(t,function(e){let t=0>this._getClassWeight(e);return t&&this.log("Removing header with low class weight:",e),t})},_headerDuplicatesTitle:function(e){if("H1"!=e.tagName&&"H2"!=e.tagName)return!1;var t=this._getInnerText(e,!1);return this.log("Evaluating similarity of header:",t,this._articleTitle),this._textSimilarity(this._articleTitle,t)>.75},_flagIsActive:function(e){return(this._flags&e)>0},_removeFlag:function(e){this._flags=this._flags&~e},_isProbablyVisible:function(e){return(!e.style||"none"!=e.style.display)&&!e.hasAttribute("hidden")&&(!e.hasAttribute("aria-hidden")||"true"!=e.getAttribute("aria-hidden")||e.className&&e.className.indexOf&&-1!==e.className.indexOf("fallback-image"))},parse:function(){if(this._maxElemsToParse>0){var e=this._doc.getElementsByTagName("*").length;if(e>this._maxElemsToParse)throw Error("Aborting parsing document; "+e+" elements found")}this._unwrapNoscriptImages(this._doc);var t=this._disableJSONLD?{}:this._getJSONLD(this._doc);this._removeScripts(this._doc),this._prepDocument();var n=this._getArticleMetadata(t);this._articleTitle=n.title;var i=this._grabArticle();if(!i)return null;if(this.log("Grabbed: "+i.innerHTML),this._postProcessContent(i),!n.excerpt){var r=i.getElementsByTagName("p");r.length>0&&(n.excerpt=r[0].textContent.trim())}var o=i.textContent;return{title:this._articleTitle,byline:n.byline||this._articleByline,dir:this._articleDir,lang:this._articleLang,content:this._serializer(i),textContent:o,length:o.length,excerpt:n.excerpt,siteName:n.siteName||this._articleSiteName}}},e.exports=t},396:function(e,t,n){e.exports={Readability:n(238),isProbablyReaderable:n(804)}},44:function(e,t,n){"use strict";var i,r,o,a;n.r(t),n.d(t,{stringify:()=>T,SelectorType:()=>i,AttributeAction:()=>r,IgnoreCaseMode:()=>s,isTraversal:()=>d,parse:()=>v}),(o=i||(i={})).Attribute="attribute",o.Pseudo="pseudo",o.PseudoElement="pseudo-element",o.Tag="tag",o.Universal="universal",o.Adjacent="adjacent",o.Child="child",o.Descendant="descendant",o.Parent="parent",o.Sibling="sibling",o.ColumnCombinator="column-combinator";let s={Unknown:null,QuirksMode:"quirks",IgnoreCase:!0,CaseSensitive:!1};(a=r||(r={})).Any="any",a.Element="element",a.End="end",a.Equals="equals",a.Exists="exists",a.Hyphen="hyphen",a.Not="not",a.Start="start";let l=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,c=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,u=new Map([[126,r.Element],[94,r.Start],[36,r.End],[42,r.Any],[33,r.Not],[124,r.Hyphen]]),h=new Set(["has","not","matches","is","where","host","host-context"]);function d(e){switch(e.type){case i.Adjacent:case i.Child:case i.Descendant:case i.Parent:case i.Sibling:case i.ColumnCombinator:return!0;default:return!1}}let f=new Set(["contains","icontains"]);function g(e,t,n){let i=parseInt(t,16)-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)}function m(e){return e.replace(c,g)}function p(e){return 39===e||34===e}function y(e){return 32===e||9===e||10===e||12===e||13===e}function v(e){let t=[],n=function e(t,n,o){let a=[];function s(e){let t=n.slice(o+e).match(l);if(!t)throw Error(`Expected name, found ${n.slice(o)}`);let[i]=t;return o+=e+i.length,m(i)}function c(e){for(o+=e;o0&&o0&&d(a[a.length-1]))throw Error("Did not expect successive traversals.")}function b(e){if(a.length>0&&a[a.length-1].type===i.Descendant){a[a.length-1].type=e;return}_(),a.push({type:e})}function E(e,t){a.push({type:i.Attribute,name:e,action:t,value:s(1),namespace:null,ignoreCase:"quirks"})}function N(){if(a.length&&a[a.length-1].type===i.Descendant&&a.pop(),0===a.length)throw Error("Empty sub-selector");t.push(a)}if(c(0),n.length===o)return o;e:for(;oe.charCodeAt(0))),N=new Set(b.map(e=>e.charCodeAt(0))),A=new Set([...b,"~","^","$","*","+","!","|",":","[","]"," ","."].map(e=>e.charCodeAt(0)));function T(e){return e.map(e=>e.map(C).join("")).join(", ")}function C(e,t,n){switch(e.type){case i.Child:return 0===t?"> ":" > ";case i.Parent:return 0===t?"< ":" < ";case i.Sibling:return 0===t?"~ ":" ~ ";case i.Adjacent:return 0===t?"+ ":" + ";case i.Descendant:return" ";case i.ColumnCombinator:return 0===t?"|| ":" || ";case i.Universal:return"*"===e.namespace&&t+10?i+e.slice(n):e}},900:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=function e(t,n){return i(this,void 0,void 0,function*(){var c,u,h,d,f,g;let{root:m,filter:p}=n;if(!m&&p&&!p(t))return null;let y=yield function(e,t){try{var n,i;if(e instanceof HTMLCanvasElement&&(null==t?void 0:t.images))return(0,r.createImage)(e.toDataURL(),null==t?void 0:t.fetchOptions);if(!(null==t?void 0:t.images)&&e instanceof HTMLImageElement||!(null==t?void 0:t.styles)&&(e instanceof HTMLButtonElement||e instanceof HTMLFormElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)||e.nodeType===Node.COMMENT_NODE||(n=e)&&n.tagName&&s.includes(n.tagName.toLowerCase()))return null;if(e.nodeType!==Node.TEXT_NODE&&!l(e)){let{display:t,width:n,height:r}=window.getComputedStyle(e);if("none"===t||"0px"===n&&"0px"===r)return null;if((i=e)&&i.tagName&&!a.includes(i.tagName.toLowerCase())&&i.tagName.includes("-")){let n=t.includes("inline"),i=document.createElement(n?"span":"div");for(let t of e.attributes)i.setAttribute(t.name,t.value);return i}}return e.cloneNode(!1)}catch(e){return console.error("Failed to clone element",e),null}}(t,n);return y?(y=yield function(t,n,r){return i(this,void 0,void 0,function*(){let o=t.childNodes;return 0===o.length||(yield function(t,n,r){return i(this,void 0,void 0,function*(){for(let i of n){let n=yield e(i,Object.assign(Object.assign({},r),{root:!1}));n&&t.appendChild(n)}})}(n,o,r)),n})}(t,y,n),c=t,u=y,h=n,u instanceof Element&&(h.styles&&(function(e,t,n){var i,r;let{getElementStyles:o}=n,a=o&&o(e);if(!a)return;t.style.cssText=a.cssText,"body"===e.tagName.toLowerCase()&&(i=getComputedStyle(e),(r=t.style).font=i.font,r.fontFamily=i.fontFamily,r.fontFeatureSettings=i.fontFeatureSettings,r.fontKerning=i.fontKerning,r.fontSize=i.fontSize,r.fontStretch=i.fontStretch,r.fontStyle=i.fontStyle,r.fontVariant=i.fontVariant,r.fontVariantCaps=i.fontVariantCaps,r.fontVariantEastAsian=i.fontVariantEastAsian,r.fontVariantLigatures=i.fontVariantLigatures,r.fontVariantNumeric=i.fontVariantNumeric,r.fontVariationSettings=i.fontVariationSettings,r.fontWeight=i.fontWeight);let s=t.getAttribute("style");s&&t.setAttribute("style",s.replace(/(:?[:;])(:? +)/gm,(e,t)=>t))}(c,u,h),function(e,t,n){let{getPseudoElementStyles:i}=n,r=!1,a=document.createElement("style"),s=`pseudo--${(0,o.uid)()}`;for(let t of[":before",":after"]){let n=i&&i(e,t)||getComputedStyle(e,t);if(!n.cssText)continue;let o=`.${s}:${t} {
${n.cssText}
}`;a.appendChild(document.createTextNode(o)),r=!0}r&&(t.className=s,t.appendChild(a))}(c,u,h)),function(e){let t=window.location.href;for(let n of["href","src"]){let i=e.getAttribute(n),r=(null==i?void 0:i.startsWith("http"))?void 0:i;if(r){let i=new URL(r,t).href;e.setAttribute(n,i)}}}(u),d=c,f=u,(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&f.setAttribute("value",d.value),(g=u)instanceof SVGElement&&(g.setAttribute("xmlns","http://www.w3.org/2000/svg"),["width","height"].forEach(function(e){let t=g.getAttribute(e);!t||g.style.getPropertyValue(e)||g.style.setProperty(e,t)}))),u):null})},t.isSVGElement=l;let r=n(113),o=n(132),a=["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"].map(e=>e.toLowerCase()),s=["script"].map(e=>e.toLowerCase());function l(e){return!!e&&!!e.tagName&&a.includes(e.tagName.toLowerCase())}},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tokenize=function(e){var t,g;return t=function(e){for(;h();)switch(f(c)){case 0:r(function(e){for(;!f(i(u,l));)h();return d(e,l)}(l-1),e);break;case 2:var t;r(d(l-1,function e(t){for(;h();)switch(c){case t:return l;case 34:case 39:34!==t&&39!==t&&e(c);break;case 40:41===t&&e(t);break;case 92:h()}return l}(91===(t=c)?t+2:40===t?t+1:t)).trim(),e);break;default:r(n(c),e)}return e}((g=e,o=a=1,s=(u=g).length,l=0,[])),u="",t};let n=String.fromCharCode;function i(e,t){return 0|e.charCodeAt(t)}function r(e,t){return t.push(e),e}let o=1,a=1,s=0,l=0,c=0,u="";function h(){return c=le&&(0,l.canvasToBlob)(e))},t.toCanvas=function(e,t){return t.raster=!0,f(e,t)},t.toPixelData=function(e,t){return(t=t||{}).raster=!0,f(e,t).then(function(t){var n;return null==(n=null==t?void 0:t.getContext("2d"))?void 0:n.getImageData(0,0,(0,l.width)(e),(0,l.height)(e)).data})},t.toPng=function(e,t){return t.raster=!0,f(e,t).then(function(e){return null==e?void 0:e.toDataURL()})},t.toSvg=d,t.getInlinedNode=h;let r=n(900),o=n(113),a=n(536),s=n(307),l=n(132),c=n(707),u={inlineOptions:{}};function h(e,t){return i(this,void 0,void 0,function*(){let{fonts:n,images:i,stylesheets:o,inlineImages:l}=t.inlineOptions||{};o&&(yield(0,c.inlineStylesheets)(t.fetchOptions));let u=getComputedStyle(document.documentElement),h=o?yield(0,c.cacheStylesheets)(u):void 0,d=yield(0,r.cloneNode)(e,{styles:t.styles,filter:t.filter,root:!0,vector:!t.raster,fetchOptions:t.fetchOptions,getElementStyles:null==h?void 0:h.get,getPseudoElementStyles:null==h?void 0:h.getPseudo,images:i});if(!(!d||d instanceof Text)){var f,m;return n&&(d=yield(f=d,m=t.fetchOptions,(0,a.resolveAll)(m).then(function(e){let t=document.createElement("style");return f.appendChild(t),t.appendChild(document.createTextNode(e)),f}))),l&&(yield(0,s.inlineAllImages)(d,t.fetchOptions)),function(e){for(let t of e.querySelectorAll("*"))if(!(!(t instanceof HTMLElement)||(0,r.isSVGElement)(t))){for(let e of Array.from(t.attributes))!("class"===e.name&&t.className.includes("pseudo--"))&&(g.includes(e.name)||t.removeAttribute(e.name));t instanceof HTMLAnchorElement&&(t.href=t.href.startsWith("http")?t.href:document.location.origin+t.href)}}(d),d}})}function d(e,t){return i(this,void 0,void 0,function*(){t.inlineOptions=Object.assign({fonts:!0,images:!0,stylesheets:!0},t.inlineOptions);let n=yield h(e,t);if(n){var i,r,o,a,s;return o=(i=n,(r=t).backgroundColor&&(i.style.backgroundColor=r.backgroundColor),r.width&&(i.style.width=r.width+"px"),r.height&&(i.style.height=r.height+"px"),n=i),a=t.width||(0,l.width)(e),s=t.height||(0,l.height)(e),o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),"data:image/svg+xml;charset=utf-8,"+('"}})}function f(e,t){return d(e,t=Object.assign(Object.assign({},u),t)).then(e=>e?(0,o.createImage)(e,t.fetchOptions):null).then((0,l.delay)(0)).then(function(n){let i="number"!=typeof t.scale?1:t.scale,r=function(e,t,n){let i=document.createElement("canvas");if(i.width=(n.width||(0,l.width)(e))*t,i.height=(n.height||(0,l.height)(e))*t,n.backgroundColor){let e=i.getContext("2d");if(!e)return null;e.fillStyle=n.backgroundColor,e.fillRect(0,0,i.width,i.height)}return i}(e,i,t),o=null==r?void 0:r.getContext("2d");return o?(o.imageSmoothingEnabled=!1,n&&(o.scale(i,i),o.drawImage(n,0,0)),r):null})}let g=["src","href","title","style","srcset","sizes","width","height","target","rel"]},113:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};function i(e,t){if(!e.startsWith("http"))return e;if((null==t?void 0:t.noCache)&&(e+=(/\?/.test(e)?"&":"?")+Date.now()),(null==t?void 0:t.bypassCors)&&(null==t?void 0:t.corsHost)){if(e.startsWith(t.corsHost))return e;e=`${t.corsHost}/${e}`}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchResource=function(e,t){return n(this,void 0,void 0,function*(){if(!e)return null;let n=yield fetch(i(e,t));if(!n.ok)return"";let r=yield n.blob(),o=new FileReader;return o.readAsDataURL(r),new Promise(e=>{o.addEventListener("loadend",()=>{"string"==typeof o.result&&e(o.result)})})})},t.createImage=function(e,t){return"data:,"===e?Promise.resolve(null):new Promise(function(n,r){let o=new Image;o.crossOrigin=(null==t?void 0:t.crossOrigin)||null,o.onload=function(){n(o)},o.onerror=r,o.src=i(e,t)})},t.reloadImage=function(e,t){return t.corsHost&&e.currentSrc.startsWith(t.corsHost)?Promise.resolve(null):(t.noCache=!0,new Promise(function(n,r){e.crossOrigin=t.crossOrigin||null,e.onload=function(){n(e)},e.onerror=t=>{console.error("Failed to load image",e.currentSrc),r(t)},e.src=i(e.currentSrc,t)}))},t.constructUrl=i},536:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveAll=function(e){return i(this,void 0,void 0,function*(){let t=a(function(e){let t=[];for(let n of e)try{let e=a(Array.from(n.cssRules));e.length>3&&t.push(e[0])}catch(e){e instanceof Error&&console.log("Error while reading CSS rules from "+n.href,e.toString())}return t}(document.styleSheets)).map(o),n=[];for(let i of t)n.push((yield i.resolve(e)));return n.join("\n")})};let r=n(812);function o(e){return{resolve:function(t){let n=(e.parentStyleSheet||{}).href||void 0;return(0,r.inlineAll)(e.cssText,t,n)},src:function(){return e.style.getPropertyValue("src")}}}function a(e){return e.filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).filter(function(e){return(0,r.shouldProcess)(e.style.getPropertyValue("src"))})}},307:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.inlineAllImages=function(e,t){return i(this,void 0,void 0,function*(){let n=e.querySelectorAll("img"),s=[];for(let e=0;et(e),e.onerror=e=>i(e),e.src=n,e.removeAttribute("srcset")}):null})}(o,t))}let l=e.querySelectorAll('[style*="background-image:"],[style*="background:"]');for(let e=0;econsole.error(e))})};let r=n(113),o=n(812),a=n(132)},769:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.clipPage=function(e,t,n){return i(this,void 0,void 0,function*(){let{body:i,head:r}=yield _(e,n,t);if(!i||!r)return null;let o=y(r,i).documentElement.outerHTML;return`
${o}`})},t.clipArticle=function(e,t){return i(this,void 0,void 0,function*(){let{body:n,head:i}=yield _(e,t);if(!n||!i)return null;let o=y(i,n),a=new r.Readability(o);a.PRESENTATIONAL_ATTRIBUTES=["align","background","bgcolor","border","cellpadding","cellspacing","frame","hspace","rules","valign","vspace"];let s=a.parse();return`${(null==i?void 0:i.outerHTML)||""}${(null==s?void 0:s.content)||""}`})},t.cleanup=v,t.clipScreenshot=function(e){return i(this,arguments,void 0,function*(e,t="jpeg",n){let i=e||document.body,r="jpeg"===t?s.toJpeg:"png"===t?s.toPng:s.toBlob,o=yield r(i,{quality:1,backgroundColor:"white",width:document.body.scrollWidth,height:document.body.scrollHeight,fetchOptions:b(n),inlineOptions:{fonts:!0,images:!0,stylesheets:!0},styles:!0});return"jpeg"===t||"png"===t?`
`:o})},t.enterNodeSelectionMode=function(e,t){let n;return setTimeout(()=>{e.body.addEventListener("click",p),e.body.addEventListener("mouseout",m),e.body.addEventListener("mouseover",g)},0),n=`.${l} {
border: 1px solid green;
background-color: rgb(0,0,0,0.05);
cursor: pointer;
}
.${c} {
border: 2px solid green;
cursor: pointer;
}
.${u} {
position: fixed;
bottom: 0px;
right: 0px;
z-index: ${Number.MAX_VALUE};
}`,(0,o.injectCss)(n,"nn-clipper-styles"),new Promise((e,n)=>{var r,o;let l;r=()=>i(this,void 0,void 0,function*(){v();let n=document.querySelectorAll(`.${c}`),i=document.createElement("div");for(let e of n){e.classList.remove(c);let n=yield(0,s.getInlinedNode)(e,{raster:!1,fetchOptions:b(t),inlineOptions:Object.assign(Object.assign({},d),{images:null==t?void 0:t.images,inlineImages:null==t?void 0:t.inlineImages})});n&&i.appendChild(n)}e(null==i?void 0:i.outerHTML)}),o=()=>n("Cancelled."),(l=document.createElement("div")).classList.add(u),setTimeout(()=>{document.body.appendChild(l)},0),(0,a.app)({init:{isClipping:!1},view:({isClipping:e})=>(0,a.h)("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"5px",boxShadow:"0px 0px 10px 0px #00000038"}},[(0,a.h)("p",{style:{marginBottom:"0px",fontSize:"18px"}},[(0,a.text)("Notesnook Web Clipper")]),(0,a.h)("p",{style:{margin:"0px",marginBottom:"5px",fontStyle:"italic"}},[e?(0,a.text)("Clipping selected elements. Please wait..."):(0,a.text)("Click on any element to select it.")]),(0,a.h)("div",{style:{display:"flex",alignItems:"center"}},[(0,a.h)("button",{onclick:e=>[Object.assign(Object.assign({},e),{isClipping:!0}),e=>{null==r||r(),e({isClipping:!1})}],style:{marginRight:"5px"},disabled:e},[e?(0,a.text)("Clipping..."):(0,a.text)("Clip")]),(0,a.h)("button",{onclick:e=>(v(),null==o||o(),e),disabled:e},[(0,a.text)("Cancel")])])]),node:l})})};let r=n(396),o=n(132),a=n(673),s=n(399),l="nn-node-selection--hover",c="nn-node-selection--selected",u="nn-node-selection-container",h=[c,u],d={fonts:!1,images:!1,stylesheets:!0};function f(e){for(let t of h)if(e.classList.contains(t)||e.closest(`.${t}`))return!1;return!0}let g=e=>{let t=e.target;!t.classList.contains(l)&&f(t)&&t.classList.add(l)},m=e=>{let t=e.target;t.classList.contains(l)&&t.classList.remove(l)},p=e=>{e.preventDefault();let t=e.target;t.classList.contains(c)?t.classList.remove(c):f(t)&&t.classList.add(c)};function y(e,t){let n=document.implementation.createHTMLDocument();return n.documentElement.replaceChildren(e,t),n}function v(){setTimeout(()=>{var e;document.querySelectorAll(`.${c}`).forEach(e=>{e instanceof HTMLElement&&e.classList.remove(c)}),document.querySelectorAll(`.${u}`).forEach(e=>e.remove()),(e=document).body.removeEventListener("mouseout",m),e.body.removeEventListener("mouseover",g),document.body.removeEventListener("click",p)},0)}function _(e,t){return i(this,arguments,void 0,function*(e,t,n=!1){let i=yield(0,s.getInlinedNode)(e.body,{raster:!0,fetchOptions:b(t),inlineOptions:{fonts:!1,inlineImages:null==t?void 0:t.inlineImages,images:null==t?void 0:t.images,stylesheets:null==t?void 0:t.styles},styles:null==t?void 0:t.styles,filter:e=>{var t;let i,r,o,a,s,l,c,u,h,d,f,g,m,p,y,v;return!n||(((t=e).nodeType===Node.TEXT_NODE||!t.getBoundingClientRect)&&t.parentElement&&(t=t.parentElement),(i={isInViewport:!1,isPartiallyInViewport:!1,isInsideViewport:!1,isAroundViewport:!1,isOnEdge:!1,isOnTopEdge:!1,isOnRightEdge:!1,isOnBottomEdge:!1,isOnLeftEdge:!1},r=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,a=window.innerWidth||document.documentElement.clientWidth,s=r.left>=0&&r.left+r.width<=a,l=r.top>=0&&r.top+r.height<=o,i.isInsideViewport=s&&l,c=r.left<0&&r.left+r.width>a,u=r.top<0&&r.top+r.height>o,i.isAroundViewport=c&&u,h=r.top<0&&r.top+r.height>0,d=r.lefta,f=r.left<0&&r.left+r.width>0,g=r.topo,m=l||u||h||g,p=s||c||f||d,i.isOnTopEdge=h&&p,i.isOnRightEdge=d&&m,i.isOnBottomEdge=g&&p,i.isOnLeftEdge=f&&m,i.isOnEdge=i.isOnLeftEdge||i.isOnRightEdge||i.isOnTopEdge||i.isOnBottomEdge,y=s||c||i.isOnLeftEdge||i.isOnRightEdge,v=l||u||i.isOnTopEdge||i.isOnBottomEdge,i.isInViewport=y&&v,i.isPartiallyInViewport=i.isInViewport&&i.isOnEdge,i).isInViewport)}});if(!i)return{};let r=e.createElement("head"),o=e.createElement("title");return o.innerText=e.title,r.appendChild(o),{body:i,head:r}})}function b(e){return(null==e?void 0:e.corsProxy)?{bypassCors:!0,corsHost:e.corsProxy,crossOrigin:"anonymous",noCache:!0}:void 0}},812:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.shouldProcess=s,t.inlineAll=function(e,t,n){return i(this,void 0,void 0,function*(){if(!s(e))return e;let a=l(e),c=e;for(let e of a)c=yield function(e,t,n,a){return i(this,void 0,void 0,function*(){var i;t=a?(0,o.resolveUrl)(t,a):t;let s=yield(0,r.fetchResource)(t,n);return e.replace((i=t,RegExp("(url\\(['\"]?)("+(0,o.escape)(i)+")(['\"]?\\))","g")),"$1"+s+"$3")})}(c,e,t,n);return c})},t.readUrls=l;let r=n(113),o=n(132),a=/url\(['"]?([^'"]+?)['"]?\)/g;function s(e){return -1!==e.search(a)}function l(e){let t,n=[];for(;null!==(t=a.exec(e));)n.push(t[1]);return n.filter(function(e){return!(0,o.isDataUrl)(e)})}},707:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.inlineStylesheets=function(e){return i(this,void 0,void 0,function*(){for(let t of document.styleSheets)if(yield d(t,e))continue;yield function(e){return i(this,void 0,void 0,function*(){for(let t of document.styleSheets){let n=[];if(!(yield d(t,e))){for(let i=0;i(e.type===s.SelectorType.Pseudo||e.type===s.SelectorType.PseudoElement)&&("after"===e.name||"before"===e.name));e<=-1||t.push({selector:(0,s.stringify)([n.slice(0,e)]),pseudoElement:(0,s.stringify)([n.slice(e)])})}return t}(u.selectorText))if(e&&e.selector.trim())for(let t of(0,l.safeQuerySelectorAll)(document,e.selector)){if(!(t instanceof HTMLElement)&&!(t instanceof SVGElement))continue;let n=r.get(t)||[];r.set(t,n),n.push({rule:u.style,href:f(a),pseudoElement:e.pseudoElement})}}for(let e of(0,l.safeQuerySelectorAll)(document,u.selectorText)){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))continue;let t=u.selectorText.split(","),n=i.get(e)||[];for(let r of(i.set(e,n),t))try{let e=(0,o.calculate)(r)[0];n.push({specificity:e.specificityArray,rule:u.style,href:f(a)});break}catch(e){console.error(e,a&&f(a))}}}else u instanceof CSSMediaRule&&window.matchMedia(u.conditionText).matches?e(u.cssRules,n,i,r,a):u instanceof CSSSupportsRule&&CSS.supports(u.conditionText)&&e(u.cssRules,n,i,r,a)}(i.cssRules,e,t,n,r)}return{getPseudo(t,i){var r;let o=null==(r=n.get(t))?void 0:r.filter(e=>e.pseudoElement.includes(i));if(o&&o.length)return h(t,o,e)},get(n){let i=t.get(n);if(!i)return;let r=i.sort((e,t)=>(0,o.compare)(e.specificity,t.specificity));return r.push({rule:n.style,specificity:[0,0,0,0],href:null}),h(n,r,e)}}})};let r=n(113),o=n(48),a=n(762),s=n(44),l=n(132),c=["animation","background","border","border-block-end","border-block-start","border-bottom","border-color","border-image","border-inline-end","border-inline-start","border-left","border-radius","border-right","border-style","border-top","border-width","column-rule","columns","contain-intrinsic-size","flex","flex-flow","font","gap","grid","grid-area","grid-column","grid-row","grid-template","grid-gap","list-style","margin","mask","offset","outline","overflow","padding","place-content","place-items","place-self","scroll-margin","scroll-padding","text-decoration","text-emphasis","transition"];function u(e,t){return i(this,void 0,void 0,function*(){try{let n=document.createElement("style"),i=yield fetch((0,r.constructUrl)(e,t));if(!i.ok)return!1;return n.innerText=yield i.text(),n.setAttribute("href",e),n}catch(t){console.error("Failed to inline stylesheet",e,t)}})}function h(e,t,n){var i,r,o,s,l,u,h;let d,f,g=((d=new CSSStyleSheet).insertRule(".dummy{}"),d.cssRules[0].style),m=(i=e,Object.defineProperty({},"style",{get:()=>(f||(f=getComputedStyle(i)),f)})),p=["display"];for(let e of t)for(let t of[...e.rule,...c]){let i=e.rule.getPropertyValue(t);p.includes(t)&&(i=m.style.getPropertyValue(t)),i.trim()&&(r=g,o=t,s=i,l=e=>m.style.getPropertyValue(e)||n.getPropertyValue(e),u=t=>(console.log("resolving url",t,e.href),t.startsWith("data:")||!e.href)?t:(console.log("resolving url",t,e.href.href),t.startsWith("/"))?new URL(`${e.href.origin}${t}`).href:new URL(`${e.href.href}${t}`).href,h=e.rule.getPropertyPriority(t),s=function(e,t){let n=(0,a.tokenize)(e),i=[];for(let e=0;ee.trim()).includes("print")})}function f(e){if(!e)return null;e.startsWith("/")&&(e=`${document.location.origin}${e}`);let t=new URL(e),n=t.pathname.split("/").slice(0,-1).join("/");return new URL(`${t.origin}${n}/`)}},132:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.injectCss=function(e,t){let n=document.getElementById(t),i=document.getElementsByTagName("head")[0];n&&i.removeChild(n);let r=document.createElement("style");r.type="text/css",r.id=t,r.appendChild(document.createTextNode(e)),i.insertBefore(r,function(){for(let e of document.querySelectorAll("style"))if(e.innerHTML.includes("#root"))return e;return null}())},t.escape=function(e){return e.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")},t.parseExtension=o,t.mimeType=function(e){return r[o(e).toLowerCase()]||""},t.dataAsUrl=function(e,t){return"data:"+t+";base64,"+e},t.isDataUrl=function(e){return -1!==e.search(/^(data:)/)},t.canvasToBlob=function(e){return e.toBlob?new Promise(function(t){e.toBlob(t)}):Promise.resolve(function(e){let t=atob(e.toDataURL().split(",")[1]),n=t.length,i=new Uint8Array(n);for(let e=0;eE,h:()=>b,memo:()=>v,text:()=>_});var i={},r=[],o=e=>e,a=r.map,s=Array.isArray,l="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:setTimeout,c=e=>{var t="";if("string"==typeof e)return e;if(s(e))for(var n,i=0;i{for(var n in{...e,...t})if("function"==typeof(s(e[n])?e[n][0]:e[n]))t[n]=e[n];else if(e[n]!==t[n])return!0},h=e=>null==e?e:e.key,d=(e,t,n,i,r,o)=>{if("style"===t)for(var a in{...n,...i})n=null==i||null==i[a]?"":i[a],"-"===a[0]?e[t].setProperty(a,n):e[t][a]=n;else"o"===t[0]&&"n"===t[1]?((e.events||(e.events={}))[t=t.slice(2)]=i)?n||e.addEventListener(t,r):e.removeEventListener(t,r):!o&&"list"!==t&&"form"!==t&&t in e?e[t]=null==i?"":i:null==i||!1===i?e.removeAttribute(t):e.setAttribute(t,i)},f=(e,t,n)=>{var i=e.props,r=3===e.type?document.createTextNode(e.tag):(n=n||"svg"===e.tag)?document.createElementNS("http://www.w3.org/2000/svg",e.tag,i.is&&i):document.createElement(e.tag,i.is&&i);for(var o in i)d(r,o,null,i[o],t,n);for(var a=0;a{if(n===i);else if(null!=n&&3===n.type&&3===i.type)n.tag!==i.tag&&(t.nodeValue=i.tag);else if(null==n||n.tag!==i.tag)t=e.insertBefore(f(i=m(i),r,o),t),null!=n&&e.removeChild(n.node);else{var a,s,l,c,u=n.props,p=i.props,y=n.children,v=i.children,_=0,b=0,E=y.length-1,N=v.length-1;for(var A in o=o||"svg"===i.tag,{...u,...p})("value"===A||"selected"===A||"checked"===A?t[A]:u[A])!==p[A]&&d(t,A,u[A],p[A],r,o);for(;b<=N&&_<=E&&null!=(l=h(y[_]))&&l===h(v[b]);)g(t,y[_].node,y[_],v[b]=m(v[b++],y[_++]),r,o);for(;b<=N&&_<=E&&null!=(l=h(y[E]))&&l===h(v[N]);)g(t,y[E].node,y[E],v[N]=m(v[N--],y[E--]),r,o);if(_>E)for(;b<=N;)t.insertBefore(f(v[b]=m(v[b++]),r,o),(s=y[_])&&s.node);else if(b>N)for(;_<=E;)t.removeChild(y[_++].node);else{for(var T={},C={},A=_;A<=E;A++)null!=(l=y[A].key)&&(T[l]=y[A]);for(;b<=N;){if(l=h(s=y[_]),c=h(v[b]=m(v[b],s)),C[l]||null!=c&&c===h(y[_+1])){null==l&&t.removeChild(s.node),_++;continue}null==c||1===n.type?(null==l&&(g(t,s&&s.node,s,v[b],r,o),b++),_++):(l===c?(g(t,s.node,s,v[b],r,o),C[c]=!0,_++):null!=(a=T[c])?(g(t,t.insertBefore(a.node,s&&s.node),a,v[b],r,o),C[c]=!0):g(t,s&&s.node,null,v[b],r,o),b++)}for(;_<=E;)null==h(s=y[_++])&&t.removeChild(s.node);for(var A in T)null==C[A]&&t.removeChild(T[A].node)}}return i.node=t},m=(e,t)=>!0!==e&&!1!==e&&e?"function"==typeof e.tag?((!t||null==t.memo||((e,t)=>{for(var n in e)if(e[n]!==t[n])return!0;for(var n in t)if(e[n]!==t[n])return!0})(t.memo,e.memo))&&((t=e.tag(e.memo)).memo=e.memo),t):e:_(""),p=e=>3===e.nodeType?_(e.nodeValue,e):y(e.nodeName.toLowerCase(),i,a.call(e.childNodes,p),1,e),y=(e,{key:t,...n},i,r,o)=>({tag:e,props:n,key:t,children:i,type:r,node:o}),v=(e,t)=>({tag:e,memo:t}),_=(e,t)=>y(e,i,r,3,t),b=(e,{class:t,...n},o=r)=>y(e,{...n,...t?{class:c(t)}:i},s(o)?o:[o]),E=({node:e,view:t,subscriptions:n,dispatch:a=o,init:c=i})=>{var h,d,f=e&&p(e),m=[],y=e=>{h!==e&&(null==(h=e)&&(a=n=v=o),n&&(m=((e,t=r,n)=>{for(var i,o,a=[],s=0;se=g(e.parentNode,e,f,f=t(h),_,d=!1),_=function(e){a(this.events[e.type],e)};return(a=a((e,t)=>"function"==typeof e?a(e(h,t)):s(e)?"function"==typeof e[0]?a(e[0],e[1]):e.slice(1).map(e=>e&&!0!==e&&(e[0]||e)(a,e[1]),y(e[0])):y(e)))(c),a}},48:function(e,t,n){"use strict";n.r(t),n.d(t,{calculate:()=>i,compare:()=>o});var i=function(e){var t,n,i,o,a=[];for(i=0,o=(t=e.split(",")).length;i0&&a.push(r(n));return a},r=function(e){var t,n,i=e,r={a:0,b:0,c:0},o=[];return n=function(t,n){var a,s,l,c,u,h;if(t.test(i))for(s=0,l=(a=i.match(t)).length;s~\.\[:\)]+)/g,"a"),n(/(\.[^\s\+>~\.\[:\)]+)/g,"b"),n(/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,"c"),n(/(:(?!not|global|local)[\w-]+\([^\)]*\))/gi,"b"),n(/(:(?!not|global|local)[^\s\+>~\.\[:]+)/g,"b"),i=(i=(i=(i=(i=(i=i.replace(/[\*\s\+>~]/g," ")).replace(/[#\.]/g," ")).replace(/:not/g," ")).replace(/:local/g," ")).replace(/:global/g," ")).replace(/[\(\)]/g," "),n(/([^\s\+>~\.\[:]+)/g,"c"),o.sort(function(e,t){return e.index-t.index}),{selector:e,specificity:"0,"+r.a.toString()+","+r.b.toString()+","+r.c.toString(),specificityArray:[0,r.a,r.b,r.c],parts:o}},o=function(e,t){var n,i,o;if("string"==typeof e)if(-1!==e.indexOf(","))throw"Invalid CSS selector";else n=r(e).specificityArray;else if(Array.isArray(e))if(4!==e.filter(function(e){return"number"==typeof e}).length)throw"Invalid specificity array";else n=e;else throw"Invalid CSS selector or specificity array";if("string"==typeof t)if(-1!==t.indexOf(","))throw"Invalid CSS selector";else i=r(t).specificityArray;else if(Array.isArray(t))if(4!==t.filter(function(e){return"number"==typeof e}).length)throw"Invalid specificity array";else i=t;else throw"Invalid CSS selector or specificity array";for(o=0;o<4;o+=1)if(n[o]i[o])return 1;return 0}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});let e=n(769);global.Clipper={clipArticle:e.clipArticle,clipPage:e.clipPage}})(),module.exports=i})();