You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mercury-parser/dist/mercury.web.js

10 lines
270 KiB
JavaScript

var Mercury=function(){"use strict";function e(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function t(e){return e&&e.__esModule?e.default:e}function n(e,t){return t={exports:{}},e(t,t.exports),t.exports}function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(It===setTimeout)return setTimeout(e,0);if((It===r||!It)&&setTimeout)return It=setTimeout,setTimeout(e,0);try{return It(e,0)}catch(t){try{return It.call(null,e,0)}catch(t){return It.call(this,e,0)}}}function a(e){if(Ut===clearTimeout)return clearTimeout(e);if((Ut===i||!Ut)&&clearTimeout)return Ut=clearTimeout,clearTimeout(e);try{return Ut(e)}catch(t){try{return Ut.call(null,e)}catch(t){return Ut.call(this,e)}}}function s(){Bt&&$t&&(Bt=!1,$t.length?zt=$t.concat(zt):Gt=-1,zt.length&&u())}function u(){if(!Bt){var e=o(s);Bt=!0;for(var t=zt.length;t;){for($t=zt,zt=[];++Gt<t;)$t&&$t[Gt].run();Gt=-1,t=zt.length}$t=null,Bt=!1,a(e)}}function l(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];zt.push(new c(e,t)),1!==zt.length||Bt||o(u)}function c(e,t){this.fun=e,this.array=t}function f(){}function h(e){throw new Error("process.binding is not supported")}function d(){return"/"}function p(e){throw new Error("process.chdir is not supported")}function m(){return 0}function v(e){var t=.001*hn.call(fn),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],r-=e[1],r<0&&(n--,r+=1e9)),[n,r]}function g(){var e=new Date,t=e-dn;return t/1e3}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function b(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function w(e,t,n){if(e&&ms.isObject(e)&&e instanceof b)return e;var r=new b;return r.parse(e,t,n),r}function _(e){return ms.isString(e)&&(e=w(e)),e instanceof b?e.format():b.prototype.format.call(e)}function x(e,t){return w(e,!1,!0).resolve(t)}function k(e,t){return e?w(e,!1,!0).resolveObject(t):t}function S(e,t){var n,r=C(e);return t&&$s.test(r)?T(e):null!==(n=r.match(zs))?{method:n[1],url:n[2],version:{major:parseInt(n[3],10),minor:parseInt(n[4],10)},headers:T(e)}:null!==(n=r.match(Bs))?{version:{major:parseInt(n[1],10),minor:parseInt(n[2],10)},statusCode:parseInt(n[3],10),statusMessage:n[4],headers:T(e)}:T(e)}function T(e){var t,n,r,i={},o=Us(e),a=o();for($s.test(a)&&(a=o());a;)" "!==a[0]&&"\t"!==a[0]?(n&&O(n,r,i),t=a.indexOf(":"),n=a.substr(0,t),r=a.substr(t+1).trim(),a=o()):(r+=" "+a.trim(),a=o());return n&&O(n,r,i),i}function j(e){return e&&e._header&&(e=e._header),e&&"function"==typeof e.toString?e.toString().trim():""}function C(e){return e.slice(0,e.indexOf("\r\n"))}function O(e,t,n){switch(e=e.toLowerCase()){case"set-cookie":void 0!==n[e]?n[e].push(t):n[e]=[t];break;case"content-type":case"content-length":case"user-agent":case"referer":case"host":case"authorization":case"proxy-authorization":case"if-modified-since":case"if-unmodified-since":case"from":case"location":case"max-forwards":case"retry-after":case"etag":case"last-modified":case"server":case"age":case"expires":void 0===n[e]&&(n[e]=t);break;default:"string"==typeof n[e]?n[e]+=", "+t:n[e]=t}}function D(e,t){if("function"!=typeof t)throw new Error("Bad callback given: "+t);if(!e)throw new Error("No options given");var n=e.onResponse;if(e="string"==typeof e?{uri:e}:JSON.parse(JSON.stringify(e)),e.onResponse=n,e.verbose&&(D.log=N()),e.url&&(e.uri=e.url,delete e.url),!e.uri&&""!==e.uri)throw new Error("options.uri is a required argument");if("string"!=typeof e.uri)throw new Error("options.uri must be a string");for(var r=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],i=0;i<r.length;i++)if(e[r[i]])throw new Error("options."+r[i]+" is not supported");if(e.callback=t,e.method=e.method||"GET",e.headers=e.headers||{},e.body=e.body||null,e.timeout=e.timeout||D.DEFAULT_TIMEOUT,e.headers.host)throw new Err
"number"==typeof __g&&(__g=t)}),xn=n(function(e){var t=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=t)}),kn=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},Sn=kn,Tn=function(e,t,n){if(Sn(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},jn=function(e){return"object"==typeof e?null!==e:"function"==typeof e},Cn=jn,On=function(e){if(!Cn(e))throw TypeError(e+" is not an object!");return e},Dn=function(e){try{return!!e()}catch(e){return!0}},En=!Dn(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),Mn=jn,Nn=_n.document,An=Mn(Nn)&&Mn(Nn.createElement),Rn=function(e){return An?Nn.createElement(e):{}},Ln=!En&&!Dn(function(){return 7!=Object.defineProperty(Rn("div"),"a",{get:function(){return 7}}).a}),Pn=jn,Yn=function(e,t){if(!Pn(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!Pn(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!Pn(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!Pn(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Fn=On,qn=Ln,Hn=Yn,Wn=Object.defineProperty,In=En?Object.defineProperty:function(e,t,n){if(Fn(e),t=Hn(t,!0),Fn(n),qn)try{return Wn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e},Un={f:In},$n=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},zn=Un,Bn=$n,Gn=En?function(e,t,n){return zn.f(e,t,Bn(1,n))}:function(e,t,n){return e[t]=n,e},Vn=_n,Zn=xn,Jn=Tn,Xn=Gn,Kn="prototype",Qn=function(e,t,n){var r,i,o,a=e&Qn.F,s=e&Qn.G,u=e&Qn.S,l=e&Qn.P,c=e&Qn.B,f=e&Qn.W,h=s?Zn:Zn[t]||(Zn[t]={}),d=h[Kn],p=s?Vn:u?Vn[t]:(Vn[t]||{})[Kn];s&&(n=t);for(r in n)i=!a&&p&&void 0!==p[r],i&&r in h||(o=i?p[r]:n[r],h[r]=s&&"function"!=typeof p[r]?n[r]:c&&i?Jn(o,Vn):f&&p[r]==o?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[Kn]=e[Kn],t}(o):l&&"function"==typeof o?Jn(Function.call,o):o,l&&((h.virtual||(h.virtual={}))[r]=o,e&Qn.R&&d&&!d[r]&&Xn(d,r,o)))};Qn.F=1,Qn.G=2,Qn.S=4,Qn.P=8,Qn.B=16,Qn.W=32,Qn.U=64,Qn.R=128;var er=Qn,tr={}.hasOwnProperty,nr=function(e,t){return tr.call(e,t)},rr={}.toString,ir=function(e){return rr.call(e).slice(8,-1)},or=ir,ar=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==or(e)?e.split(""):Object(e)},sr=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},ur=ar,lr=sr,cr=function(e){return ur(lr(e))},fr=Math.ceil,hr=Math.floor,dr=function(e){return isNaN(e=+e)?0:(e>0?hr:fr)(e)},pr=dr,mr=Math.min,vr=function(e){return e>0?mr(pr(e),9007199254740991):0},gr=dr,yr=Math.max,br=Math.min,wr=function(e,t){return e=gr(e),e<0?yr(e+t,0):br(e,t)},_r=cr,xr=vr,kr=wr,Sr=function(e){return function(t,n,r){var i,o=_r(t),a=xr(o.length),s=kr(r,a);if(e&&n!=n){for(;a>s;)if(i=o[s++],i!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},Tr=_n,jr="__core-js_shared__",Cr=Tr[jr]||(Tr[jr]={}),Or=function(e){return Cr[e]||(Cr[e]={})},Dr=0,Er=Math.random(),Mr=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++Dr+Er).toString(36))},Nr=Or("keys"),Ar=Mr,Rr=function(e){return Nr[e]||(Nr[e]=Ar(e))},Lr=nr,Pr=cr,Yr=Sr(!1),Fr=Rr("IE_PROTO"),qr=function(e,t){var n,r=Pr(e),i=0,o=[];for(n in r)n!=Fr&&Lr(r,n)&&o.push(n);for(;t.length>i;)Lr(r,n=t[i++])&&(~Yr(o,n)||o.push(n));return o},Hr="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Wr=qr,Ir=Hr,Ur=Object.keys||function(e){return Wr(e,Ir)},$r=Object.getOwnPropertySymbols,zr={f:$r},Br={}.propertyIsEnumerable,Gr={f:Br},Vr=sr,Zr=function(e){return Object(Vr(e))},Jr=Ur,Xr=zr,Kr=Gr,Qr=Zr,ei=ar,ti=Object.assign,ni=!ti||Dn(function(){var e={},t={},n=Symbol(),r="abcdefghijklmno
l=g&&g.display,null==l&&(l=Le.get(e,"display")),c=pe.css(e,"display"),"none"===c&&(l?c=l:(v([e],!0),l=e.style.display||l,c=pe.css(e,"display"),v([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===pe.css(e,"float")&&(u||(h.done(function(){p.display=l}),null==l&&(c=p.display,l="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",h.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(g?"hidden"in g&&(m=g.hidden):g=Le.access(e,"fxshow",{display:l}),o&&(g.hidden=!m),m&&v([e],!0),h.done(function(){m||v([e]),Le.remove(e,"fxshow");for(r in d)pe.style(e,r,d[r])})),u=W(m?g[r]:0,r,h),r in g||(g[r]=u.start,m&&(u.end=u.start,u.start=0))}}function U(e,t){var n,r,i,o,a;for(n in e)if(r=pe.camelCase(n),i=t[r],o=e[n],pe.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=pe.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function $(e,t,n){var r,i,o=0,a=$.prefilters.length,s=pe.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=dt||q(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;a<u;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),o<1&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:pe.extend({},t),opts:pe.extend(!0,{specialEasing:{},easing:pe.easing._default},n),originalProperties:t,originalOptions:n,startTime:dt||q(),duration:n.duration,tweens:[],createTween:function(t,n){var r=pe.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(U(c,l.opts.specialEasing);o<a;o++)if(r=$.prefilters[o].call(l,e,c,l.opts))return pe.isFunction(r.stop)&&(pe._queueHooks(l.elem,l.opts.queue).stop=pe.proxy(r.stop,r)),r;return pe.map(c,W,l),pe.isFunction(l.opts.start)&&l.opts.start.call(e,l),pe.fx.timer(pe.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function z(e){var t=e.match(Ee)||[];return t.join(" ")}function B(e){return e.getAttribute&&e.getAttribute("class")||""}function G(e,t,n,r){var i;if(pe.isArray(t))pe.each(t,function(t,i){n||jt.test(e)?r(e,i):G(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==pe.type(t))r(e,t);else for(i in t)G(e+"["+i+"]",t[i],n,r)}function V(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(Ee)||[];if(pe.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Z(e,t,n,r){function i(s){var u;return o[s]=!0,pe.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||a||o[l]?a?!(u=l):void 0:(t.dataTypes.unshift(l),i(l),!1)}),u}var o={},a=e===Ft;return i(t.dataTypes[0])||!o["*"]&&i("*")}function J(e,t){var n,r,i=pe.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&pe.extend(!0,e,r),e}function X(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function K(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(a=l[u+" "+o]||l["* "+o],!a)for(i in l)if(s=i.split(" "),s[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){a===!0?a=l[i]:l[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No
return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(t){var n=[["notify","progress",pe.Callbacks("memory"),pe.Callbacks("memory"),2],["resolve","done",pe.Callbacks("once memory"),pe.Callbacks("once memory"),0,"resolved"],["reject","fail",pe.Callbacks("once memory"),pe.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return pe.Deferred(function(t){pe.each(n,function(n,r){var i=pe.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var l=this,c=arguments,f=function(){var e,f;if(!(t<a)){if(e=r.apply(l,c),e===n.promise())throw new TypeError("Thenable self-resolution");f=e&&("object"==typeof e||"function"==typeof e)&&e.then,pe.isFunction(f)?i?f.call(e,o(a,n,s,i),o(a,n,u,i)):(a++,f.call(e,o(a,n,s,i),o(a,n,u,i),o(a,n,s,n.notifyWith))):(r!==s&&(l=void 0,c=[e]),(i||n.resolveWith)(l,c))}},h=i?f:function(){try{f()}catch(e){pe.Deferred.exceptionHook&&pe.Deferred.exceptionHook(e,h.stackTrace),t+1>=a&&(r!==u&&(l=void 0,c=[e]),n.rejectWith(l,c))}};t?h():(pe.Deferred.getStackHook&&(h.stackTrace=pe.Deferred.getStackHook()),e.setTimeout(h))}}var a=0;return pe.Deferred(function(e){n[0][3].add(o(0,e,pe.isFunction(i)?i:s,e.notifyWith)),n[1][3].add(o(0,e,pe.isFunction(t)?t:s)),n[2][3].add(o(0,e,pe.isFunction(r)?r:u))}).promise()},promise:function(e){return null!=e?pe.extend(e,i):i}},o={};return pe.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[0][2].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=re.call(arguments),o=pe.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?re.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(l(e,o.done(a(n)).resolve,o.reject),"pending"===o.state()||pe.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)l(i[n],a(n),o.reject);return o.promise()}});var Me=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;pe.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Me.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},pe.readyException=function(t){e.setTimeout(function(){throw t})};var Ne=pe.Deferred();pe.fn.ready=function(e){return Ne.then(e).catch(function(e){pe.readyException(e)}),this},pe.extend({isReady:!1,readyWait:1,holdReady:function(e){e?pe.readyWait++:pe.ready(!0)},ready:function(e){(e===!0?--pe.readyWait:pe.isReady)||(pe.isReady=!0,e!==!0&&--pe.readyWait>0||Ne.resolveWith(te,[pe]))}}),pe.ready.then=Ne.then,"complete"===te.readyState||"loading"!==te.readyState&&!te.documentElement.doScroll?e.setTimeout(pe.ready):(te.addEventListener("DOMContentLoaded",c),e.addEventListener("load",c));var Ae=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===pe.type(n)){i=!0;for(s in n)Ae(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,pe.isFunction(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(pe(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},Re=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};f.uid=1,f.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Re(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[pe.camelCase(t)]=n;else for(r in t)i[pe.camelCase(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[thi
t.result===!1&&t.preventDefault());return t.type=d,i||t.isDefaultPrevented()||f._default&&f._default.apply(h.pop(),n)!==!1||!Re(r)||l&&pe.isFunction(r[d])&&!pe.isWindow(r)&&(s=r[l],s&&(r[l]=null),pe.event.triggered=d,r[d](),pe.event.triggered=void 0,s&&(r[l]=s)),t.result}},simulate:function(e,t,n){var r=pe.extend(new pe.Event,n,{type:e,isSimulated:!0});pe.event.trigger(r,null,t)}}),pe.fn.extend({trigger:function(e,t){return this.each(function(){pe.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return pe.event.trigger(e,t,n,!0)}}),pe.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),he.focusin="onfocusin"in e,he.focusin||pe.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){pe.event.simulate(t,e.target,pe.event.fix(e))};pe.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Le.access(r,t);i||r.addEventListener(e,n,!0),Le.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Le.access(r,t)-1;i?Le.access(r,t,i):(r.removeEventListener(e,n,!0),Le.remove(r,t))}}});var kt=e.location,St=pe.now(),Tt=/\?/;pe.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var jt=/\[\]$/,Ct=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,Dt=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){var n=pe.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)G(n,e[n],t,i);return r.join("&")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&Dt.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!ze.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}}):{name:t.name,value:n.replace(Ct,"\r\n")}}).get()}});var Et=/%20/g,Mt=/#.*$/,Nt=/([?&])_=[^&]*/,At=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lt=/^(?:GET|HEAD)$/,Pt=/^\/\//,Yt={},Ft={},qt="*/".concat("*"),Ht=te.createElement("a");Ht.href=kt.href,pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kt.href,type:"GET",isLocal:Rt.test(kt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?J(J(e,pe.ajaxSettings),t):J(pe.ajaxSettings,e)},ajaxPrefilter:V(Yt),ajaxTransport:V(Ft),ajax:function(t,n){function r(t,n,r,s){var l,h,d,w,_,x=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",k.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(w=X(p,k,r)),w=K(p,w,k,l),l?(p.ifModified&&(_=k.getResponseHeader("Last-Modified"),_&&(pe.lastModified[o]=_),_=k.getResponseHeader("etag"),_&&(pe.etag[o]=_)),204===t||"HEAD"===p.type?x="nocontent":304===t?x="notmodified":(x=w.state,h=w.data,d=w.error,l=!d)):(d=x,!t&&x||(x="error",t<0&&(t=0))),k.status=t,k.statusText=(n||x)+"",l?g.resolveWith(m,[h,x,k]):g.rejectWith(m,[k,x,d]),k.statusCode(b),b=vo
}}),Yf=t(Pf),Ff=new RegExp("https?://","i"),qf=new RegExp(".(png|gif|jpe?g)","i"),Hf=["script","style","form"].join(","),Wf={create:function(e,t,n){var r=this;return ls(wn.mark(function i(){var o,a;return wn.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(o=void 0,!t){i.next=6;break}a={statusMessage:"OK",statusCode:200,headers:{"content-type":"text/html","content-length":500}},o={body:t,response:a},i.next=9;break;case 6:return i.next=8,su(e,n);case 8:o=i.sent;case 9:if(!o.error){i.next=12;break}return o.failed=!0,i.abrupt("return",o);case 12:return i.abrupt("return",r.generateDoc(o));case 13:case"end":return i.stop()}},i,r)}))()},generateDoc:function(e){var t=e.body,n=e.response,r=n.headers["content-type"];if(!r.includes("html")&&!r.includes("text"))throw new Error("Content does not appear to be text.");var i=qs.load(t,{normalizeWhitespace:!0});if(0===i.root().children().length)throw new Error("No children, likely a bad parse.");return i=W(i),i=Be(i),i=Ze(i)}},If=er,Uf=xn,$f=Dn,zf=function(e,t){var n=(Uf.Object||{})[e]||Object[e],r={};r[e]=t(n),If(If.S+If.F*$f(function(){n(1)}),"Object",r)},Bf=Zr,Gf=Ur;zf("keys",function(){return function(e){return Gf(Bf(e))}});var Vf=xn.Object.keys,Zf=n(function(e){e.exports={default:Vf,__esModule:!0}}),Jf=t(Zf),Xf=function(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})},Kf={domain:"blogspot.com",content:{selectors:[".post-content noscript"],clean:[],transforms:{noscript:"div"}},author:{selectors:[".post-author-name"]},title:{selectors:[".post h2.title"]},date_published:{selectors:["span.publishdate"]}},Qf={domain:"nymag.com",content:{selectors:["div.article-content","section.body","article.article"],clean:[".ad",".single-related-story"],transforms:{h1:"h2",noscript:function(e,t){var n=t.browser?t(e.text()):e.children();return 1===n.length&&void 0!==n.get(0)&&"img"===n.get(0).tagName.toLowerCase()?"figure":null}}},title:{selectors:["h1.lede-feature-title","h1.headline-primary","h1"]},author:{selectors:[".by-authors",".lede-feature-author"]},dek:{selectors:[".lede-feature-teaser"]},date_published:{selectors:[["time.article-timestamp[datetime]","datetime"],"time.article-timestamp"]}},eh={domain:"wikipedia.org",content:{selectors:["#mw-content-text"],defaultCleaner:!1,transforms:{".infobox img":function(e){var t=e.parents(".infobox");0===t.children("img").length&&t.prepend(e)},".infobox caption":"figcaption",".infobox":"figure"},clean:[".mw-editsection","figure tr, figure td, figure tbody","#toc",".navbox"]},author:"Wikipedia Contributors",title:{selectors:["h2.title"]},date_published:{selectors:["#footer-info-lastmod"]}},th={domain:"twitter.com",content:{transforms:{".permalink[role=main]":function(e,t){var n=e.find(".tweet"),r=t('<div id="TWEETS_GO_HERE"></div>');r.append(n),e.replaceWith(r)},s:"span"},selectors:[".permalink[role=main]"],defaultCleaner:!1,clean:[".stream-item-footer","button",".tweet-details-fixer"]},author:{selectors:[".tweet.permalink-tweet .username"]},date_published:{selectors:[[".permalink-tweet ._timestamp[data-time-ms]","data-time-ms"]]}},nh={domain:"www.nytimes.com",title:{selectors:[".g-headline","h1.headline"]},author:{selectors:[['meta[name="author"]',"value"],".g-byline",".byline"]},content:{selectors:["div.g-blocks","article#story"],transforms:{"img.g-lazy":function(e){var t=e.attr("src"),n=640;t=t.replace("{{size}}",n),e.attr("src",t)}},clean:[".ad","header#story-header",".story-body-1 .lede.video",".visually-hidden","#newsletter-promo",".promo",".comments-button",".hidden",".comments"]},date_published:null,lead_image_url:null,dek:null,next_page_url:null,excerpt:null},rh={domain:"www.theatlantic.com",title:{selectors:["h1.hed"]},author:{selectors:["article#article .article-cover-extra .metadata .byline a"]},content:{selectors:[".article-body"],transforms:[],clean:[]},date_published:{selectors:[['time[itemProp="datePublished"]',"datetime"]]},lead_image_url:null,dek:null,next_page_url:null,excerpt:null},ih={domain:"www.newyorker.com",title:{selectors:["h1.title"]},author:{selectors:[".contributors"]},content:{selectors:["div#articleBody","di
for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ai]&&0===e._a[si]&&0===e._a[ui]&&0===e._a[li]&&(e._nextDay=!0,e._a[ai]=0),e._d=(e._useUTC?_e:we).apply(null,o),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ai]=24)}}function ft(e){var t,n,r,i,o,a,s,u;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)o=1,a=4,n=ut(t.GG,e._a[ri],Se(wt(),1,4).year),r=ut(t.W,1),i=ut(t.E,1),(i<1||i>7)&&(u=!0);else{o=e._locale._week.dow,a=e._locale._week.doy;var l=Se(wt(),o,a);n=ut(t.gg,e._a[ri],l.year),r=ut(t.w,l.week),null!=t.d?(i=t.d,(i<0||i>6)&&(u=!0)):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(u=!0)):i=o}r<1||r>Te(n,o,a)?p(e)._overflowWeeks=!0:null!=u?p(e)._overflowWeekday=!0:(s=ke(n,r,i,o,a),e._a[ri]=s.year,e._dayOfYear=s.dayOfYear)}function ht(e){if(e._f===n.ISO_8601)return void at(e);e._a=[],p(e).empty=!0;var t,r,i,o,a,s=""+e._i,u=s.length,l=0;for(i=K(e._f,e._locale).match(Rr)||[],t=0;t<i.length;t++)o=i[t],r=(s.match(ee(o,e))||[])[0],r&&(a=s.substr(0,s.indexOf(r)),a.length>0&&p(e).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),l+=r.length),Yr[o]?(r?p(e).empty=!1:p(e).unusedTokens.push(o),oe(o,r,e)):e._strict&&!r&&p(e).unusedTokens.push(o);p(e).charsLeftOver=u-l,s.length>0&&p(e).unusedInput.push(s),e._a[ai]<=12&&p(e).bigHour===!0&&e._a[ai]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[ai]=dt(e._locale,e._a[ai],e._meridiem),ct(e),ot(e)}function dt(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(r=e.isPM(n),r&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function pt(e){var t,n,r,i,o;if(0===e._f.length)return p(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)o=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],ht(t),m(t)&&(o+=p(t).charsLeftOver,o+=10*p(t).unusedTokens.length,p(t).score=o,(null==r||o<r)&&(r=o,n=t));f(e,n||t)}function mt(e){if(!e._d){var t=q(e._i);e._a=l([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ct(e)}}function vt(e){var t=new b(ot(gt(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function gt(e){var t=e._i,n=e._f;return e._locale=e._locale||rt(e._l),null===t||void 0===n&&""===t?v({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new b(ot(t)):(u(t)?e._d=t:i(n)?pt(e):n?ht(e):yt(e),m(e)||(e._d=null),e))}function yt(e){var t=e._i;void 0===t?e._d=new Date(n.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?st(e):i(t)?(e._a=l(t.slice(0),function(e){return parseInt(e,10)}),ct(e)):"object"==typeof t?mt(e):s(t)?e._d=new Date(t):n.createFromInputFallback(e)}function bt(e,t,n,r,s){var u={};return n!==!0&&n!==!1||(r=n,n=void 0),(o(e)&&a(e)||i(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=s,u._l=n,u._i=e,u._f=t,u._strict=r,vt(u)}function wt(e,t,n,r){return bt(e,t,n,r,!1)}function _t(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return wt();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}function xt(){var e=[].slice.call(arguments,0);return _t("isBefore",e)}function kt(){var e=[].slice.call(arguments,0);return _t("isAfter",e)}function St(e){var t=q(e),n=t.year||0,r=t.quarter||0,i=t.month||0,o=t.week||0,a=t.day||0,s=t.hour||0,u=t.minute||0,l=t.second||0,c=t.millisecond||0;this._milliseconds=+c+1e3*l+6e4*u+1e3*s*60*60,this._days=+a+7*o,this._months=+i+3*r+12*n,this._data={},this._locale=rt(),this._bubble()}function Tt(e){return e instanceof St}function jt(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Ct(e,t){V(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+G(~~(e/60),2)+t+G(~~e%60,2)})}function Ot(e,t){var n=(t||"").match(e);if(null===n)return null;var r=n[n.length-1]||[],i=(r+"").match(Wi)||["-",0,0],o=+(60*i[1])+x(i[2]);return 0===o?0:"+"===i[0]?o:-o}function Dt(e,t){var r,i;return t._isUTC?(r=t.clone(),i=(w(e)||u(e)?e.valueOf():wt(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),n.updateOffset(r,!1),r):wt(e).local()}function Et(e){return 15*-Math.round(e._d.getTimezoneOf
if(!z[s])return e;var u=Zn[s];switch(s){case F:case q:return new u(+e);case W:case $:return new u(e);case U:return o=u(e.source,C.exec(e)),o.lastIndex=e.lastIndex,o}var c=Kn(e);if(t){var h=!r;r||(r=l()),i||(i=l());for(var p=r.length;p--;)if(r[p]==e)return i[p];o=c?u(e.length):{}}else o=c?d(e):or({},e);return c&&(Rn.call(e,"index")&&(o.index=e.index),Rn.call(e,"input")&&(o.input=e.input)),t?(r.push(e),i.push(o),(c?Je:ur)(e,function(e,a){o[a]=g(e,t,n,r,i)}),h&&(f(r),f(i)),o):o}function _(e,t){return Ee(e)?Hn(e):{}}function Z(e,t,n){if("function"!=typeof e)return Xt;if("undefined"==typeof t||!("prototype"in e))return e;var r=e.__bindData__;if("undefined"==typeof r&&(Jn.funcNames&&(r=!e.name),r=r||!Jn.funcDecomp,!r)){var i=Nn.call(e);Jn.funcNames||(r=!O.test(i)),r||(r=N.test(i),Xn(e,r))}if(r===!1||r!==!0&&1&r[1])return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return Rt(e,t)}function X(e){function t(){var e=u?a:this;if(i){var p=d(i);Ln.apply(p,arguments)}if((o||c)&&(p||(p=d(arguments)),o&&Ln.apply(p,o),c&&p.length<s))return r|=16,X([n,f?r:r&-4,p,null,a,s]);if(p||(p=arguments),l&&(n=e[h]),this instanceof t){e=_(n.prototype);var m=n.apply(e,p);return Ee(m)?m:e}return n.apply(e,p)}var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=1&r,l=2&r,c=4&r,f=8&r,h=n;return Xn(t,e),t}function K(e,t){var i=-1,o=ue(),a=e?e.length:0,u=a>=w&&o===n,l=[];if(u){var c=s(t);c?(o=r,t=c):u=!1}for(;++i<a;){var f=e[i];o(t,f)<0&&l.push(f)}return u&&h(t),l}function Q(e,t,n,r){for(var i=(r||0)-1,o=e?e.length:0,a=[];++i<o;){var s=e[i];if(s&&"object"==typeof s&&"number"==typeof s.length&&(Kn(s)||he(s))){t||(s=Q(s,t,n));var u=-1,l=s.length,c=a.length;for(a.length+=l;++u<l;)a[c++]=s[u]}else n||a.push(s)}return a}function ee(e,t,n,r,i,o){if(n){var a=n(e,t);if("undefined"!=typeof a)return!!a}if(e===t)return 0!==e||1/e==1/t;var s=typeof e,u=typeof t;if(!(e!==e||e&&V[s]||t&&V[u]))return!1;if(null==e||null==t)return e===t;var c=Cn.call(e),h=Cn.call(t);if(c==P&&(c=I),h==P&&(h=I),c!=h)return!1;switch(c){case F:case q:return+e==+t;case W:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case U:case $:return e==xn(t)}var d=c==Y;if(!d){var p=Rn.call(e,"__wrapped__"),m=Rn.call(t,"__wrapped__");if(p||m)return ee(p?e.__wrapped__:e,m?t.__wrapped__:t,n,r,i,o);if(c!=I)return!1;var v=e.constructor,g=t.constructor;if(v!=g&&!(De(v)&&v instanceof v&&De(g)&&g instanceof g)&&"constructor"in e&&"constructor"in t)return!1}var y=!i;i||(i=l()),o||(o=l());for(var b=i.length;b--;)if(i[b]==e)return o[b]==t;var w=0;if(a=!0,i.push(e),o.push(t),d){if(b=e.length,w=t.length,a=w==b,a||r)for(;w--;){var _=b,x=t[w];if(r)for(;_--&&!(a=ee(e[_],x,n,r,i,o)););else if(!(a=ee(e[w],x,n,r,i,o)))break}}else sr(t,function(t,s,u){if(Rn.call(u,s))return w++,a=Rn.call(e,s)&&ee(e[s],t,n,r,i,o)}),a&&!r&&sr(e,function(e,t,n){if(Rn.call(n,t))return a=--w>-1});return i.pop(),o.pop(),y&&(f(i),f(o)),a}function ne(e,t,n,r,i){(Kn(t)?Je:ur)(t,function(t,o){var a,s,u=t,l=e[o];if(t&&((s=Kn(t))||lr(t))){for(var c=r.length;c--;)if(a=r[c]==t){l=i[c];break}if(!a){var f;n&&(u=n(l,t),(f="undefined"!=typeof u)&&(l=u)),f||(l=s?Kn(l)?l:[]:lr(l)?l:{}),r.push(t),i.push(l),f||ne(l,t,n,r,i)}}else n&&(u=n(l,t),"undefined"==typeof u&&(u=t)),"undefined"!=typeof u&&(l=u);e[o]=l})}function re(e,t){return e+Mn(Vn()*(t-e+1))}function ie(e,t,i){var o=-1,a=ue(),u=e?e.length:0,c=[],d=!t&&u>=w&&a===n,p=i||d?l():c;if(d){var m=s(p);a=r,p=m}for(;++o<u;){var v=e[o],g=i?i(v,o,e):v;(t?!o||p[p.length-1]!==g:a(p,g)<0)&&((i||d)&&p.push(g),c.push(v))}return d?(f(p.array),h(p)):i&&f(p),c}function oe(e){return function(n,r,i){var o={};r=t.createCallback(r,i,3);var a=-1,s=n?n.length:0;if("number"==typeof s)for(;++a<s;){var u=n[a];e(o,u,r(u,a,n),n)}else ur(n,function(t,n,i){e(o,t,r(t,n,i),i)});return o}}function ae(e,t,n,r,i,o){var a=1&t,s=2&t,u=4&t,l=16&t,c=32&t;if(!s&&!De(e))throw new kn;l&&!n.length&&(t&=-17,l=n=!1),c&&!r.length&&(t&=-33,c=r=!1);var f=e&&e.__bindData__;if(f&&f!==!0)return f=d
return null}},ld=["og:image","twitter:image","image_src"],cd=["link[rel=image_src]"],fd=["upload","wp-content","large","photo","wp-image"],hd=new RegExp(fd.join("|"),"i"),dd=["spacer","sprite","blank","throbber","gradient","tile","bg","background","icon","social","header","hdr","advert","spinner","loader","loading","default","rating","share","facebook","twitter","theme","promo","ads","wp-includes"],pd=new RegExp(dd.join("|"),"i"),md=/\.gif(\?.*)?$/i,vd=/\.jpe?g(\?.*)?$/i,gd={extract:function(e){var t=e.$,n=e.content,r=e.metaCache,i=e.html,o=void 0;t.browser||0!==t("head").length||t("*").first().prepend(i);var a=Pe(t,ld,r,!1);if(a&&(o=Ke(a)))return o;var s=t(n),u=t("img",s).toArray(),l={};u.forEach(function(e,n){var r=t(e),i=r.attr("src");if(i){var o=ft(i);o+=ht(r),o+=dt(r),o+=pt(r),o+=mt(r),o+=vt(u,n),l[i]=o}});var c=wu(l).reduce(function(e,t){return l[t]>e[1]?[t,l[t]]:e},[null,0]),f=$l(c,2),h=f[0],d=f[1];if(d>0&&(o=Ke(h)))return o;var p=!0,m=!1,v=void 0;try{for(var g,y=Il(cd);!(p=(g=y.next()).done);p=!0){var b=g.value,w=t(b).first(),_=w.attr("src");if(_&&(o=Ke(_)))return o;var x=w.attr("href");if(x&&(o=Ke(x)))return o;var k=w.attr("value");if(k&&(o=Ke(k)))return o}}catch(e){m=!0,v=e}finally{try{!p&&y.return&&y.return()}finally{if(m)throw v}}return null}},yd=n(function(e,t){(function(){var n,r,i,o,a,s,u,l,c,f,h,d,p,m,v;i=Math.floor,f=Math.min,r=function(e,t){return e<t?-1:e>t?1:0},c=function(e,t,n,o,a){var s;if(null==n&&(n=0),null==a&&(a=r),n<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);n<o;)s=i((n+o)/2),a(t,e[s])<0?o=s:n=s+1;return[].splice.apply(e,[n,n-n].concat(t)),t},s=function(e,t,n){return null==n&&(n=r),e.push(t),m(e,0,e.length-1,n)},a=function(e,t){var n,i;return null==t&&(t=r),n=e.pop(),e.length?(i=e[0],e[0]=n,v(e,0,t)):i=n,i},l=function(e,t,n){var i;return null==n&&(n=r),i=e[0],e[0]=t,v(e,0,n),i},u=function(e,t,n){var i;return null==n&&(n=r),e.length&&n(e[0],t)<0&&(i=[e[0],t],t=i[0],e[0]=i[1],v(e,0,n)),t},o=function(e,t){var n,o,a,s,u,l;for(null==t&&(t=r),s=function(){l=[];for(var t=0,n=i(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)l.push(t);return l}.apply(this).reverse(),u=[],o=0,a=s.length;o<a;o++)n=s[o],u.push(v(e,n,t));return u},p=function(e,t,n){var i;if(null==n&&(n=r),i=e.indexOf(t),i!==-1)return m(e,0,i,n),v(e,i,n)},h=function(e,t,n){var i,a,s,l,c;if(null==n&&(n=r),a=e.slice(0,t),!a.length)return a;for(o(a,n),c=e.slice(t),s=0,l=c.length;s<l;s++)i=c[s],u(a,i,n);return a.sort(n).reverse()},d=function(e,t,n){var i,s,u,l,h,d,p,m,v,g;if(null==n&&(n=r),10*t<=e.length){if(l=e.slice(0,t).sort(n),!l.length)return l;for(u=l[l.length-1],m=e.slice(t),h=0,p=m.length;h<p;h++)i=m[h],n(i,u)<0&&(c(l,i,0,null,n),l.pop(),u=l[l.length-1]);return l}for(o(e,n),g=[],s=d=0,v=f(t,e.length);0<=v?d<v:d>v;s=0<=v?++d:--d)g.push(a(e,n));return g},m=function(e,t,n,i){var o,a,s;for(null==i&&(i=r),o=e[n];n>t&&(s=n-1>>1,a=e[s],i(o,a)<0);)e[n]=a,n=s;return e[n]=o},v=function(e,t,n){var i,o,a,s,u;for(null==n&&(n=r),o=e.length,u=t,a=e[t],i=2*t+1;i<o;)s=i+1,s<o&&!(n(e[i],e[s])<0)&&(i=s),e[t]=e[i],t=i,i=2*t+1;return e[t]=a,m(e,u,t,n)},n=function(){function e(e){this.cmp=null!=e?e:r,this.nodes=[]}return e.push=s,e.pop=a,e.replace=l,e.pushpop=u,e.heapify=o,e.updateItem=p,e.nlargest=h,e.nsmallest=d,e.prototype.push=function(e){return s(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return u(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return o(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return p(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return t=new e,t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.p