mnstr
Version:
Ultra fast large list rendering.
1 lines • 50.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).MNSTR=t()}(this,function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=t(function(e){function o(e,t,n,r){var i,o,s,l,t=t&&t.prototype instanceof u?t:u,t=Object.create(t.prototype),r=new c(r||[]);return t._invoke=(i=e,o=n,s=r,l=v,function(e,t){if(l===_)throw new Error("Generator is already running");if(l===g){if("throw"===e)throw t;return d()}for(s.method=e,s.arg=t;;){var n=s.delegate;if(n){n=function e(t,n){var r=t.iterator[n.method];if(r===p){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=p,e(t,n),"throw"===n.method))return x;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return x}r=a(r,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,x;r=r.arg;if(!r)return n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,x;{if(!r.done)return r;n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=p)}n.delegate=null;return x}(n,s);if(n){if(n===x)continue;return n}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(l===v)throw l=g,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);l=_;n=a(i,o,s);if("normal"===n.type){if(l=s.done?g:m,n.arg!==x)return{value:n.arg,done:s.done}}else"throw"===n.type&&(l=g,s.method="throw",s.arg=n.arg)}}),t}function a(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function u(){}function t(){}function n(){}function r(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function s(s){var t;this._invoke=function(n,r){function e(){return new Promise(function(e,t){!function t(e,n,r,i){e=a(s[e],s,n);if("throw"===e.type)i(e.arg);else{var o=e.arg;if((n=o.value)&&"object"==typeof n&&N.call(n,"__await"))return Promise.resolve(n.__await).then(function(e){t("next",e,r,i)},function(e){t("throw",e,r,i)});Promise.resolve(n).then(function(e){o.value=e,r(o)},i)}}(n,r,e,t)})}return t=t?t.then(e,e):e()}}function i(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function l(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function c(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(i,this),this.reset(!0)}function h(t){if(t){var n,e=t[C];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(N.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=p,e.done=!0,e}).next=e}return{next:d}}function d(){return{value:p,done:!0}}var f,p,v,m,_,g,x,y,E,N,b,C,w,k,S;f=function(){return this}()||Function("return this")(),E=Object.prototype,N=E.hasOwnProperty,b="function"==typeof Symbol?Symbol:{},C=b.iterator||"@@iterator",w=b.asyncIterator||"@@asyncIterator",k=b.toStringTag||"@@toStringTag",(S=f.regeneratorRuntime)?e.exports=S:((S=f.regeneratorRuntime=e.exports).wrap=o,v="suspendedStart",m="suspendedYield",_="executing",g="completed",x={},(b={})[C]=function(){return this},(f=(f=Object.getPrototypeOf)&&f(f(h([]))))&&f!==E&&N.call(f,C)&&(b=f),y=n.prototype=u.prototype=Object.create(b),(t.prototype=y.constructor=n).constructor=t,n[k]=t.displayName="GeneratorFunction",S.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===t||"GeneratorFunction"===(e.displayName||e.name))},S.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,n):(e.__proto__=n,k in e||(e[k]="GeneratorFunction")),e.prototype=Object.create(y),e},S.awrap=function(e){return{__await:e}},r(s.prototype),s.prototype[w]=function(){return this},S.AsyncIterator=s,S.async=function(e,t,n,r){var i=new s(o(e,t,n,r));return S.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},r(y),y[k]="Generator",y[C]=function(){return this},y.toString=function(){return"[object Generator]"},S.keys=function(n){var e,r=[];for(e in n)r.push(e);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},S.values=h,c.prototype={constructor:c,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=p,this.done=!1,this.delegate=null,this.method="next",this.arg=p,this.tryEntries.forEach(l),!e)for(var t in this)"t"===t.charAt(0)&&N.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=p)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return o.type="throw",o.arg=n,r.next=e,t&&(r.method="next",r.arg=p),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var s=N.call(i,"catchLoc"),l=N.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&N.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var o=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,x):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),x},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),l(n),x}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,r,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(n=i.completion).type&&(r=n.arg,l(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:h(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=p),x}})}),r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&0<=Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime"),o=i&&r.regeneratorRuntime;r.regeneratorRuntime=void 0;if(i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}for(var l,A,g=n,F=Math.ceil,j=Math.floor,B=function(e){return isNaN(e=+e)?0:(0<e?j:F)(e)},z=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},v=t(function(e){e=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),m=t(function(e){e=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)}),s=(m.version,function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}),_=function(r,i,e){if(s(r),void 0===i)return r;switch(e){case 1:return function(e){return r.call(i,e)};case 2:return function(e,t){return r.call(i,e,t)};case 3:return function(e,t,n){return r.call(i,e,t,n)}}return function(){return r.apply(i,arguments)}},a=function(e){return"object"==typeof e?null!==e:"function"==typeof e},f=function(e){if(a(e))return e;throw TypeError(e+" is not an object!")},i=function(e){try{return!!e()}catch(e){return!0}},d=!i(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),V=v.document,D=a(V)&&a(V.createElement),U=function(e){return D?V.createElement(e):{}},G=!d&&!i(function(){return 7!=Object.defineProperty(U("div"),"a",{get:function(){return 7}}).a}),W=Object.defineProperty,u={f:d?Object.defineProperty:function(e,t,n){if(f(e),t=function(e,t){if(!a(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!a(r=n.call(e))||"function"==typeof(n=e.valueOf)&&!a(r=n.call(e))||!t&&"function"==typeof(n=e.toString)&&!a(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}(t,!0),f(n),G)try{return W(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}},q=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},x=d?function(e,t,n){return u.f(e,t,q(1,n))}:function(e,t,n){return e[t]=n,e},X={}.hasOwnProperty,y=function(e,t){return X.call(e,t)},Y="prototype",E=function(e,t,n){var r,i,o,s=e&E.F,l=e&E.G,a=e&E.S,u=e&E.P,c=e&E.B,h=e&E.W,d=l?m:m[t]||(m[t]={}),f=d[Y],p=l?v:a?v[t]:(v[t]||{})[Y];for(r in n=l?t:n)(i=!s&&p&&void 0!==p[r])&&y(d,r)||(o=(i?p:n)[r],d[r]=l&&"function"!=typeof p[r]?n[r]:c&&i?_(o,v):h&&p[r]==o?function(r){function e(e,t,n){if(this instanceof r){switch(arguments.length){case 0:return new r;case 1:return new r(e);case 2:return new r(e,t)}return new r(e,t,n)}return r.apply(this,arguments)}return e[Y]=r[Y],e}(o):u&&"function"==typeof o?_(Function.call,o):o,u&&((d.virtual||(d.virtual={}))[r]=o,e&E.R)&&f&&!f[r]&&x(f,r,o))},N=(E.F=1,E.G=2,E.S=4,E.P=8,E.B=16,E.W=32,E.U=64,E.R=128,E),K=x,b={},J={}.toString,c=function(e){return J.call(e).slice(8,-1)},Q=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==c(e)?e.split(""):Object(e)},Z=function(e){return Q(z(e))},$=Math.min,ee=function(e){return 0<e?$(B(e),9007199254740991):0},te=Math.max,ne=Math.min,re=t(function(e){var t="__core-js_shared__",n=v[t]||(v[t]={});(e.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:m.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})}),ie=0,oe=Math.random(),se=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++ie+oe).toString(36))},le=re("keys"),o=function(e){return le[e]||(le[e]=se(e))},ae=(l=!1,function(e,t,n){var r,i=Z(e),o=ee(i.length),s=(e=o,(n=B(n=n))<0?te(n+e,0):ne(n,e));if(l&&t!=t){for(;s<o;)if((r=i[s++])!=r)return!0}else for(;s<o;s++)if((l||s in i)&&i[s]===t)return l||s||0;return!l&&-1}),ue=o("IE_PROTO"),ce="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),he=Object.keys||function(e){var t,n=ce,r=Z(e),i=0,o=[];for(t in r)t!=ue&&y(r,t)&&o.push(t);for(;n.length>i;)!y(r,t=n[i++])||~ae(o,t)||o.push(t);return o},de=d?Object.defineProperties:function(e,t){f(e);for(var n,r=he(t),i=r.length,o=0;o<i;)u.f(e,n=r[o++],t[n]);return e},r=v.document,fe=r&&r.documentElement,pe=o("IE_PROTO"),ve=function(){},me="prototype",_e=function(){var e=U("iframe"),t=ce.length;for(e.style.display="none",fe.appendChild(e),e.src="javascript:",(e=e.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),_e=e.F;t--;)delete _e[me][ce[t]];return _e()},ge=Object.create||function(e,t){var n;return null!==e?(ve[me]=f(e),n=new ve,ve[me]=null,n[pe]=e):n=_e(),void 0===t?n:de(n,t)},h=t(function(e){var t=re("wks"),n=v.Symbol,r="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:se)("Symbol."+e))}).store=t}),xe=u.f,ye=h("toStringTag"),Ee=function(e,t,n){e&&!y(e=n?e:e.prototype,ye)&&xe(e,ye,{configurable:!0,value:t})},Ne={},be=(x(Ne,h("iterator"),function(){return this}),function(e){return Object(z(e))}),Ce=o("IE_PROTO"),we=Object.prototype,ke=Object.getPrototypeOf||function(e){return e=be(e),y(e,Ce)?e[Ce]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?we:null},Se=h("iterator"),Te=(!([].keys&&"next"in[].keys())),Ie="values",Oe=function(){return this},n=function(e,t,n,r,i,o,s){function l(e){if(!Te&&e in d)return d[e];switch(e){case"keys":case Ie:return function(){return new n(this,e)}}return function(){return new n(this,e)}}h=t,(c=n).prototype=ge(Ne,{next:q(1,r)}),Ee(c,h+" Iterator");var a,u,r=t+" Iterator",c=i==Ie,h=!1,d=e.prototype,f=d[Se]||d["@@iterator"]||i&&d[i],p=f||l(i),v=i?c?l("entries"):p:void 0,m="Array"==t&&d.entries||f;if(m&&(m=ke(m.call(new e)))!==Object.prototype&&m.next&&Ee(m,r,!0),c&&f&&f.name!==Ie&&(h=!0,p=function(){return f.call(this)}),s&&(Te||h||!d[Se])&&x(d,Se,p),b[t]=p,b[r]=Oe,i)if(a={values:c?p:l(Ie),keys:o?p:l("keys"),entries:v},s)for(u in a)u in d||K(d,u,a[u]);else N(N.P+N.F*(Te||h),t,a);return a},Le=(A=!0,function(e,t){var n,e=String(z(e)),t=B(t),r=e.length;return t<0||r<=t?A?"":void 0:(n=e.charCodeAt(t))<55296||56319<n||t+1===r||(r=e.charCodeAt(t+1))<56320||57343<r?A?e.charAt(t):n:A?e.slice(t,t+2):r-56320+(n-55296<<10)+65536}),Me=(n(String,"String",function(e){this._t=String(e),this._i=0},function(){var e=this._t,t=this._i;return t>=e.length?{value:void 0,done:!0}:(e=Le(e,t),this._i+=e.length,{value:e,done:!1})}),function(e,t){return{value:t,done:!!e}}),Pe=(n(Array,"Array",function(e,t){this._t=Z(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Me(1)):Me(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),b.Arguments=b.Array,h("toStringTag")),He="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Re=0;Re<He.length;Re++){var Ae=He[Re],p=v[Ae],p=p&&p.prototype;p&&!p[Pe]&&x(p,Pe,Ae),b[Ae]=b.Array}function Fe(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=Object(e),ze))?t:Ve?c(e):"Object"==(t=c(e))&&"function"==typeof e.callee?"Arguments":t}function je(e,t){return void 0===(e=f(e).constructor)||null==(e=f(e)[Xe])?t:s(e)}function C(){var e,t=+this;k.hasOwnProperty(t)&&(e=k[t],delete k[t],e())}function Be(e){C.call(e.data)}var w,ze=h("toStringTag"),Ve="Arguments"==c(function(){return arguments}()),De=h("iterator"),Ue=Array.prototype,Ge=h("iterator"),We=m.getIteratorMethod=function(e){if(null!=e)return e[Ge]||e["@@iterator"]||b[Fe(e)]},qe=t(function(e){var h={},d={},e=e.exports=function(e,t,n,r,i){var o,s,l,a,i=i?function(){return e}:We(e),u=_(n,r,t?2:1),c=0;if("function"!=typeof i)throw TypeError(e+" is not iterable!");if(void 0===(n=i)||b.Array!==n&&Ue[De]!==n){for(l=i.call(e);!(s=l.next()).done;)if((a=function(t,e,n,r){try{return r?e(f(n)[0],n[1]):e(n)}catch(e){r=t.return;throw void 0!==r&&f(r.call(t)),e}}(l,u,s.value,t))===h||a===d)return a}else for(o=ee(e.length);c<o;c++)if((a=t?u(f(s=e[c])[0],s[1]):u(e[c]))===h||a===d)return a};e.BREAK=h,e.RETURN=d}),Xe=h("species"),Ye=v.process,r=v.setImmediate,o=v.clearImmediate,n=v.MessageChannel,Ke=v.Dispatch,Je=0,k={},Qe="onreadystatechange",n=(r&&o||(r=function(i){for(var o=[],e=1;e<arguments.length;)o.push(arguments[e++]);return k[++Je]=function(){var e="function"==typeof i?i:Function(i),t=o,n=void 0,r=void 0===n;switch(t.length){case 0:return void(r?e():e.call(n));case 1:return void(r?e(t[0]):e.call(n,t[0]));case 2:return void(r?e(t[0],t[1]):e.call(n,t[0],t[1]));case 3:return void(r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]));case 4:return void(r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3]))}e.apply(n,t)},w(Je),Je},o=function(e){delete k[e]},"process"==c(Ye)?w=function(e){Ye.nextTick(_(C,e,1))}:Ke&&Ke.now?w=function(e){Ke.now(_(C,e,1))}:n?(S=(n=new n).port2,n.port1.onmessage=Be,w=_(S.postMessage,S,1)):v.addEventListener&&"function"==typeof postMessage&&!v.importScripts?(w=function(e){v.postMessage(e+"","*")},v.addEventListener("message",Be,!1)):w=Qe in U("script")?function(e){fe.appendChild(U("script"))[Qe]=function(){fe.removeChild(this),C.call(e)}}:function(e){setTimeout(_(C,e,1),0)}),{set:r,clear:o}),Ze=n.set,S=v.MutationObserver||v.WebKitMutationObserver,$e=v.process,r=v.Promise,et="process"==c($e);function tt(e){var n,r;this.promise=new e(function(e,t){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=e,r=t}),this.resolve=s(n),this.reject=s(r)}function nt(e,t){return f(e),a(t)&&t.constructor===e?t:((0,(e=rt.f(e)).resolve)(t),e.promise)}var rt={f:function(e){return new tt(e)}},it=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},o=v.navigator,ot=o&&o.userAgent||"",o=h("species"),st=h("iterator"),lt=!1;try{var T=[7][st]();T.return=function(){lt=!0},Array.from(T,function(){throw 2})}catch(e){}var I,O,at,ut,ct,ht,dt=n.set,ft=(ut=et?function(){$e.nextTick(pt)}:!S||v.navigator&&v.navigator.standalone?r&&r.resolve?(at=r.resolve(void 0),function(){at.then(pt)}):function(){Ze.call(v,pt)}:(ct=!0,ht=document.createTextNode(""),new S(pt).observe(ht,{characterData:!0}),function(){ht.data=ct=!ct}),function(e){e={fn:e,next:void 0};O&&(O.next=e),I||(I=e,ut()),O=e});function pt(){var e,t;for(et&&(e=$e.domain)&&e.exit();I;){t=I.fn,I=I.next;try{t()}catch(e){throw I?ut():O=void 0,e}}O=void 0,e&&e.enter()}function vt(){}function mt(e,t,n){return Jt.defineProperty(e,t,n)}var _t,gt,xt,yt,Et,Nt,bt,Ct,wt,kt,St,Tt,It,Ot,Lt,Mt,L="Promise",Pt=v.TypeError,M=v.process,T=M&&M.versions,Ht=T&&T.v8||"",P=v[L],Rt="process"==Fe(M),At=gt=rt.f,n=!!function(){try{var e=P.resolve(1),t=(e.constructor={})[h("species")]=function(e){e(vt,vt)};return(Rt||"function"==typeof PromiseRejectionEvent)&&e.then(vt)instanceof t&&0!==Ht.indexOf("6.6")&&-1===ot.indexOf("Chrome/66")}catch(e){}}(),Ft=function(e){var t;return!(!a(e)||"function"!=typeof(t=e.then))&&t},jt=function(h,n){var r;h._n||(h._n=!0,r=h._c,ft(function(){for(var i,u=h._v,c=1==h._s,e=0,t=function(e){var t,n,r,i,o=c?e.ok:e.fail,s=e.resolve,l=e.reject,a=e.domain;try{o?(c||(2==h._h&&(i=h,dt.call(v,function(){var e;Rt?M.emit("rejectionHandled",i):(e=v.onrejectionhandled)&&e({promise:i,reason:i._v})})),h._h=1),!0===o?t=u:(a&&a.enter(),t=o(u),a&&(a.exit(),r=!0)),t===e.promise?l(Pt("Promise-chain cycle")):(n=Ft(t))?n.call(t,s,l):s(t)):l(u)}catch(e){a&&!r&&a.exit(),l(e)}};r.length>e;)t(r[e++]);h._c=[],h._n=!1,n&&!h._h&&(i=h,dt.call(v,function(){var e,t,n=i._v,r=Bt(i);if(r&&(e=it(function(){Rt?M.emit("unhandledRejection",n,i):(t=v.onunhandledrejection)?t({promise:i,reason:n}):(t=v.console)&&t.error&&t.error("Unhandled promise rejection",n)}),i._h=Rt||Bt(i)?2:1),i._a=void 0,r&&e.e)throw e.v}))}))},Bt=function(e){return 1!==e._h&&0===(e._a||e._c).length},H=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),jt(t,!0))},zt=function(e){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw Pt("Promise can't be resolved itself");(n=Ft(e))?ft(function(){var t={_w:r,_d:!1};try{n.call(e,_(zt,t,1),_(H,t,1))}catch(e){H.call(t,e)}}):(r._v=e,r._s=1,jt(r,!1))}catch(e){H.call({_w:r,_d:!1},e)}}},r=(n||(P=function(e){var t=this,n=L,r="_h";if(!(t instanceof P)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");s(e),_t.call(this);try{e(_(zt,this,1),_(H,this,1))}catch(e){H.call(this,e)}},(_t=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=function(e,t,n){for(var r in t)n&&e[r]?e[r]=t[r]:x(e,r,t[r]);return e}(P.prototype,{then:function(e,t){var n=At(je(this,P));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=Rt?M.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&jt(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),xt=function(){var e=new _t;this.promise=e,this.resolve=_(zt,e,1),this.reject=_(H,e,1)},rt.f=At=function(e){return e===P||e===yt?new xt:gt(e)}),N(N.G+N.W+N.F*!n,{Promise:P}),Ee(P,L),L),Vt=(r=("function"==typeof m[r]?m:v)[r],d&&r&&!r[o]&&u.f(r,o,{configurable:!0,get:function(){return this}}),yt=m[L],N(N.S+N.F*!n,L,{reject:function(e){var t=At(this);return(0,t.reject)(e),t.promise}}),N(N.S+!0*N.F,L,{resolve:function(e){return nt(this===yt?P:this,e)}}),N(N.S+N.F*!(n&&function(e,t){if(!t&&!lt)return!1;var n=!1;try{var r=[7],i=r[st]();i.next=function(){return{done:n=!0}},r[st]=function(){return i},e(r)}catch(e){}return n}(function(e){P.all(e).catch(vt)})),L,{all:function(e){var s=this,t=At(s),l=t.resolve,a=t.reject,n=it(function(){var r=[],i=0,o=1;qe(e,!1,function(e){var t=i++,n=!1;r.push(void 0),o++,s.resolve(e).then(function(e){n||(n=!0,r[t]=e,--o)||l(r)},a)}),--o||l(r)});return n.e&&a(n.v),t.promise},race:function(e){var t=this,n=At(t),r=n.reject,i=it(function(){qe(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}}),N(N.P+N.R,"Promise",{finally:function(t){var n=je(this,m.Promise||v.Promise),e="function"==typeof t;return this.then(e?function(e){return nt(n,t()).then(function(){return e})}:t,e?function(e){return nt(n,t()).then(function(){throw e})}:t)}}),N(N.S,"Promise",{try:function(e){var t=rt.f(this),e=it(e);return(e.e?t.reject:t.resolve)(e.v),t.promise}}),m.Promise),Dt=t(function(e){e.exports={default:Vt,__esModule:!0}}),T=(e(Dt),t(function(e,t){t.__esModule=!0;var n,a=(n=Dt)&&n.__esModule?n:{default:n};t.default=function(e){return function(){var l=e.apply(this,arguments);return new a.default(function(o,s){return function t(e,n){try{var r=l[e](n),i=r.value}catch(e){return void s(e)}if(!r.done)return a.default.resolve(i).then(function(e){t("next",e)},function(e){t("throw",e)});o(i)}("next")})}}})),R=e(T),Ut={f:Object.getOwnPropertySymbols},Gt={f:{}.propertyIsEnumerable},Wt=Object.assign,r=!Wt||i(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=Wt({},e)[n]||Object.keys(Wt({},t)).join("")!=r})?function(e,t){for(var n=be(e),r=arguments.length,i=1,o=Ut.f,s=Gt.f;i<r;)for(var l,a=Q(arguments[i++]),u=o?he(a).concat(o(a)):he(a),c=u.length,h=0;h<c;)l=u[h++],d&&!s.call(a,l)||(n[l]=a[l]);return n}:Wt,qt=(N(N.S+N.F,"Object",{assign:r}),m.Object.assign),Xt=t(function(e){e.exports={default:qt,__esModule:!0}}),o=(e(Xt),t(function(e,t){t.__esModule=!0;var n=(n=Xt)&&n.__esModule?n:{default:n};t.default=n.default||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}})),Yt=e(o),Kt=e(t(function(e,t){t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}})),Jt=(N(N.S+N.F*!d,"Object",{defineProperty:u.f}),m.Object),Qt=t(function(e){e.exports={default:mt,__esModule:!0}}),n=(e(Qt),t(function(e,t){t.__esModule=!0;var n,i=(n=Qt)&&n.__esModule?n:{default:n};function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}t.default=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}));function Zt(t){Kt(this,Zt),(this.context=this).parentNode=void 0,this.getData=void 0,this.getElementChildren=void 0,this.getCellRenderer=void 0,this.virtualEnvironment=!1,this.needUpdateVirtualDOM=void 0,this.renderOnInitialize=!0,this.initialScrollToElement=void 0,this.initialScrollToOptions=void 0,this.observeCellBounds=!1,this.rememberChildrenExpands=!0,this.thresholdRatio=.5,this.useTransform=!0,this.className="mnstr",this.didRenderFirstElement=void 0,this.didRenderLastElement=void 0,this.firstInBoundsElementChanged=void 0,this.lastInBoundsElementChanged=void 0,this._data=[],this._scrollNode=void 0,this._listNode=void 0,this._events={},this._lowestCellHeigh=Number.MAX_VALUE,this._averageCellHeight=1,this._currentMaxIndex=0,this._initialScrollToElement=void 0,this._cachedScrollToElement=void 0,this._cachedScrollToOptions=void 0,this._firstInBoundsElement=void 0,this._lastInBoundsElement=void 0,this._frameRequests={},this._cellsSorted=[],this._vElements=[],this._expandInformations=[],this._updatingCells=!1,t=t||{},Object.keys(t).forEach(function(e){"_"===e.charAt(0)&&delete t[e]}),Yt(this,t),this._initialScrollToElement=this.initialScrollToElement,this._cachedScrollToElement=this._initialScrollToElement,this._cachedScrollToOptions=this.initialScrollToOptions,this.renderOnInitialize&&this.render()}return e(n)(Zt,[{key:"destroy",value:function(){console.error("wheeee.")}},{key:"reset",value:(Mt=R(g.mark(function e(){return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._data=[],this._lowestCellHeight=Number.MAX_VALUE,this._averageCellHeight=1,this._currentMaxIndex=0,this._cachedScrollToElement=void 0,this._cachedScrollToOptions=void 0,this._frameRequests={},this._cellsSorted=[],this._expandInformations=[],this._vElements=[],this.virtualEnvironment)return e.next=13,this.updateVirtualDOM();e.next=15;break;case 13:e.next=16;break;case 15:for(;this._listNode.firstChild;)this._listNode.removeChild(this._listNode.firstChild);case 16:this.needUpdate(),this.setScrollPosition(0),this.rUpdateCells();case 19:case"end":return e.stop()}},e,this)})),function(){return Mt.apply(this,arguments)})},{key:"exportRestoreState",value:function(){var e=this.getCellsSorted()[0];return{scrollTop:this.getScrollPosition(),index:e?e.__index:0,position:e?this.getNodeTop(e):0,height:this.getNodeHeight(this._listNode)}}},{key:"render",value:function(e){var t=this;return this.needUpdate(),this.renderScrollNode(e),this.renderListNode(),this.initScrollListener(),this.rAF(R(g.mark(function e(){return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.updateCells(!0);case 2:t.renderListResizeObserver();case 3:case"end":return e.stop()}},e,t)})),"render"),this}},{key:"renderScrollNode",value:function(e){return this._scrollNode&&this._scrollNode.parentNode&&this._scrollNode.parentNode.removeChild(this._scrollNode),this._scrollNode=document.createElement("div"),this._scrollNode.classList.add(this.className),this._scrollNode.setAttribute("style","overflow-y: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; position: relative; will-change: transform;"),this.parentNode=e||this.parentNode||document.body,this.parentNode.appendChild(this._scrollNode),this._scrollNode}},{key:"renderListNode",value:function(){return this._listNode=document.createElement("ul"),this._listNode.classList.add(this.className+"-list"),this._listNode.setAttribute("style","position: relative; overflow: hidden; list-style-type: none; margin: 0; padding: 0;"),this._scrollNode.appendChild(this._listNode),this._listNode}},{key:"renderIFrame",value:function(e,t){var n=this,r=document.createElement("iframe");return r.setAttribute("style","position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; border: none; opacity: 0; pointer-events: none; touch-action: none; z-index: -1000;"),r.onload=function(e){e.target.contentWindow.onresize=t.bind(n)},e.appendChild(r),r}},{key:"renderListResizeObserver",value:function(){this._scrollNode.__frameNode=this.renderIFrame(this._scrollNode,this.onResizeScrollNode)}},{key:"renderCell",value:function(){var e=document.createElement("li"),t=(e.classList.add(this.className+"-cell"),e.setAttribute("style","position: absolute; width: 100%; top: 0; left: 0;"),e.__frameNode=this.observeCellBounds?this.renderIFrame(e,this.onResizeCell):void 0,document.createElement("div"));return t.classList.add(this.className+"-content"),t.setAttribute("style","width: 100%; margin: 0; border: 0;"),e.appendChild(t),e.__contentNode=t,this._listNode.appendChild(e),e}},{key:"updateVirtualDOM",value:function(){var t=this;return new Promise(function(e){t.needUpdateVirtualDOM.call(t.context,[].concat(t._vElements),function(){return e()})})}},{key:"addVirtualElement",value:function(e,t,n,r){this._vElements&&this._vElements.push(this.createVirtualElement(e,t,n,r))}},{key:"removeVirtualElementForCell",value:function(t){var e;return this._vElements&&-1<(e=this._vElements.findIndex(function(e){return e.element===t.__element}))?(this._vElements.splice(e,1),!0):void 0}},{key:"sortVirtualElements",value:function(){this._vElements&&this._vElements.sort(function(e,t){return e.index<t.index?-1:1})}},{key:"replaceVirtualElementForCell",value:function(e,t,n,r,i){this._vElements&&this._vElements.splice([].slice.call(this.getCells()).indexOf(t),1,this.createVirtualElement(e,n,r,i))}},{key:"createVirtualElement",value:function(e,t,n,r){return{element:e,index:t,isExpanded:n,level:r}}},{key:"syncVDOMToInternalState",value:(Lt=R(g.mark(function e(){var t,n,r,i,o,s,l,a,u=this;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this._vElements.slice(0).sort(function(e,t){return e.index-t.index})).length){e.next=6;break}return e.next=4,this.updateVirtualDOM();case 4:return this.updateCellsSorted(),e.abrupt("return");case 6:if(n=t[0].index,r=this.getCellsSorted().find(function(e){return e.__index===n})){e.next=10;break}return e.abrupt("return");case 10:return i=this.getNodeTop(r),e.next=13,this.updateVirtualDOM();case 13:for(o=this.getCells(),s=0;s<o.length;s++)l=o[s],a=this._vElements[s],l.__index=a.index,l.__element=a.element,l.__level=a.level,l.dataset.level=a.level;this.updateCellsSorted().reduce(function(e,t){return u.setNodeTop(t,e),u.setNodeHeight(t),e+u.getNodeHeight(t)},i);case 16:case"end":return e.stop()}},e,this)})),function(){return Lt.apply(this,arguments)})},{key:"getNodeHeight",value:function(e,t){return e?t||!e.__nodeHeight?this.setNodeHeight(e,t):e.__nodeHeight||0:0}},{key:"setNodeHeight",value:function(e,t,n,r){return n=Math.max(n,0),r&&(e.style.height=n+"px"),e.__nodeHeight=n||t?e.getBoundingClientRect().height:e.offsetHeight,e.__nodeHeight}},{key:"getNodeTop",value:function(e){return e&&e.__nodeTop||0}},{key:"setNodeTop",value:function(e,t){return t=Math.max(t,0),this.useTransform?e.style.transform="translateY("+t+"px)":e.style.top=t+"px",e.__nodeTop=t,e.__nodeTop}},{key:"getNodeBottom",value:function(e){return e?this.getNodeTop(e)+this.getNodeHeight(e):0}},{key:"getMinimumListNodeHeight",value:function(){var e=this.getNodeHeight(this._scrollNode,!0);return e+e*(2*this.thresholdRatio)}},{key:"updateListBounds",value:function(e){var t,n,r,i,o;this._cellsSorted&&this._cellsSorted.length&&(t=this._cellsSorted[this._cellsSorted.length-1],n=this.getNodeBottom(t),r=this.getNodeHeight(this._listNode),i=Math.floor(this._scrollNode.scrollHeight-this.getScrollPosition())-Math.ceil(this.getNodeHeight(this._scrollNode))<=1,o=t.__index===this._currentMaxIndex&&n-r!=0,e||i||o||!r)&&this.setNodeHeight(this._listNode,!1,n+(this._currentMaxIndex-t.__index)*this._averageCellHeight,!0)}},{key:"getTopRenderThreshold",value:function(){return-this.getNodeHeight(this._scrollNode)*this.thresholdRatio}},{key:"getBottomRenderThreshold",value:function(){var e=this.getNodeHeight(this._scrollNode);return e*this.thresholdRatio+e}},{key:"getCells",value:function(){return this._listNode?this._listNode.children:void 0}},{key:"getCellsSorted",value:function(){return this._cellsSorted||this.updateCellsSorted()}},{key:"updateCellsSorted",value:function(){var e=this.getCells();if(e)return this._cellsSorted=[].slice.call(e),this._cellsSorted.sort(function(e,t){return e.__index-t.__index}),this._cellsSorted}},{key:"addEventListener",value:function(e,t){return this._events[e]=this._events[e]||[],this._events[e].push(t),this}},{key:"removeEventListener",value:function(e,t){this._events[e]&&-1<(t=this._events[e].indexOf(t))&&this._events[e].splice(t,1)}},{key:"emitEvent",value:function(e){var t=this,n=this._events[e],r=[].slice.call(arguments,1);n&&0<n.length&&n.forEach(function(e){return e.apply(t,r)}),this[e]&&this[e].apply(this.context,r)}},{key:"emitElementEvents",value:function(e,t){0===t&&this.emitEvent("didRenderFirstElement",e,this),t===this._currentMaxIndex&&this.emitEvent("didRenderLastElement",e,this)}},{key:"getScrollPosition",value:function(){return this._scrollNode?this._scrollNode.scrollTop:void 0}},{key:"setScrollPosition",value:function(e){this._scrollNode&&(this._scrollNode.scrollTop=e)}},{key:"initScrollListener",value:function(){var t=this;this._scrollNode&&this._scrollNode.addEventListener("scroll",function(e){return t.rUpdateCells()})}},{key:"scrollToFirstElement",value:(Ot=R(g.mark(function e(){var t;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getElementAndLevelAtIndex(0),e.next=3,this.scrollToElement(t.element);case 3:case"end":return e.stop()}},e,this)})),function(){return Ot.apply(this,arguments)})},{key:"scrollToLastElement",value:(It=R(g.mark(function e(){var t;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getElementAndLevelAtIndex(this._currentMaxIndex),e.next=3,this.scrollToElement(t.element);case 3:case"end":return e.stop()}},e,this)})),function(){return It.apply(this,arguments)})},{key:"scrollToElement",value:(Tt=R(g.mark(function e(t,n){var r,i,o,s;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Yt({smooth:!1,nearest:!1,bottom:!1,force:!1,offset:0},n),i=this._cellsSorted.find(function(e){return e.__element===t})){e.next=5;break}return e.next=5,this.updateCells();case 5:if(i)return o=this.getNodeTop(i)>this.getScrollPosition()&&this.getNodeBottom(i)<this.getScrollPosition()+this.getNodeHeight(this._scrollNode),!r.force&&o||(o=r.bottom||r.nearest&&this.getNodeTop(i)>this.getScrollPosition()+this.getNodeHeight(this._scrollNode)/2,o=o?this.getNodeTop(i)-this.getNodeHeight(this._scrollNode)+this.getNodeHeight(i)+r.offset:this.getNodeTop(i)+r.offset,this.setScrollPosition(o)),delete this._cachedScrollToElement,delete this._cachedScrollToOptions,delete this._initialScrollToElement,e.abrupt("return");e.next=12;break;case 12:if((s=this.getIndexForElement(t))<0)return e.abrupt("return");e.next=15;break;case 15:if(this._cachedScrollToElement=t,this._cachedScrollToOptions=r,0===this._cellsSorted.length)return e.abrupt("return");e.next=19;break;case 19:this.setScrollPosition(s*this._averageCellHeight);case 20:case"end":return e.stop()}},e,this)})),function(e,t){return Tt.apply(this,arguments)})},{key:"scrollToCachedScrollElement",value:(St=R(g.mark(function e(){return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._cachedScrollToElement)return e.next=3,this.scrollToElement(this._cachedScrollToElement,this._cachedScrollToOptions);e.next=5;break;case 3:e.next=6;break;case 5:case 6:case"end":return e.stop()}},e,this)})),function(){return St.apply(this,arguments)})},{key:"needUpdate",value:function(){return this._data=this.getData?this.getData.call(this.context,this):[],this.updateCurrentMaxIndex(),this.invalidateExpandInformations(),this}},{key:"update",value:function(e,t){return this.needUpdate(),this.rUpdateCells(!0,e,t),this}},{key:"restoreState",value:(kt=R(g.mark(function e(t,n){return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.needUpdate(),this._scrollNode||(this.renderScrollNode(n||this.parentNode),this.renderListNode(),this.initScrollListener()),-1===this._currentMaxIndex)return e.abrupt("return");e.next=4;break;case 4:return e.next=6,this.addCell(t.index,t.position);case 6:e.sent&&(this.setNodeHeight(this._listNode,!1,t.height,!0),this.setScrollPosition(t.scrollTop)),delete this._initialScrollToElement,delete this._cachedScrollToElement,this.updateCellsAverages(),this.updateCells();case 12:case"end":return e.stop()}},e,this)})),function(e,t){return kt.apply(this,arguments)})},{key:"getElementAndLevelAtIndex",value:function(e){if(!this.canHasChildren())return this.createElementAndLevelInformation(this._data[e],0);for(var t=0,n=this._expandInformations.length-1;0<=n;n--){var r,i=this._expandInformations[n];if(i.active&&!(i.index>=e))if(t+=i.elementChildren.length,!(i.index+t<e))return r=e-(i.index+t-i.elementChildren.length)-1,this.createElementAndLevelInformation(i.elementChildren[r],i.level)}return this.createElementAndLevelInformation(this._data[e-t],0)}},{key:"createElementAndLevelInformation",value:function(e,t){return{element:e,level:t}}},{key:"updateCurrentMaxIndex",value:function(){var e=this._expandInformations.reduce(function(e,t){return e+(t.active?t.elementChildren.length:0)},0);this._currentMaxIndex=this._data.length-1+e}},{key:"canHasChildren",value:function(){return void 0!==this.getElementChildren}},{key:"getChildrenForElement",value:function(e){return this.canHasChildren()?this.getElementChildren.call(this.context,e,this):void 0}},{key:"getIndexForElement",value:function(n){var i=this,r=this._data.indexOf(n);return-1<r?this._expandInformations.reduce(function(e,t){return t.elementParent||i._data.indexOf(t.element)<r&&(e+=t.totalLength),e},r):this._expandInformations.reduce(function(e,t){var r;return-1<e||-1<(r=t.elementChildren.indexOf(n))&&(e=r+t.index+1+t.elementChildren.reduce(function(e,t,n){return r<=n||(n=i._expandInformations.find(function(e){return e.element===t}))&&(e+=n.totalLength),e},0)),e},-1)}},{key:"maintainCellCount",value:(wt=R(g.mark(function e(){var t,n,r,i,o,s,l,a,u;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=this.getScrollPosition(),t=n+this.getTopRenderThreshold(),n=n+this.getBottomRenderThreshold(),i=this.getCellsSorted(),r=i[0],i=i[i.length-1],o=this.getNodeBottom(i)-this.getNodeTop(r),s=this.getMinimumListNodeHeight(),u=o<s,l=!1,e.t0=!0,e.next=e.t0===(!r&&-1<this._currentMaxIndex)?13:e.t0===(i&&i.__index<this._currentMaxIndex&&(u||this.getNodeBottom(i)<n))?19:e.t0===(r&&0<r.__index&&(u||this.getNodeTop(r)>t))?23:e.t0===(r&&(r.__index<0||this.getNodeBottom(r)<t&&o-this.getNodeHeight(r)>s))?27:e.t0===(i&&(i.__index>this._currentMaxIndex||this.getNodeTop(i)>n&&o-this.getNodeHeight(i)>s))?31:35;break;case 13:return a=this._initialScrollToElement?this.getIndexForElement(this._initialScrollToElement):0,e.next=16,this.addCell(a,0);case 16:return(u=e.sent)&&(this.setNodeTop(u,this.getNodeHeight(u)*a),l=!0),e.abrupt("break",35);case 19:return e.next=21,this.addCell(i.__index+1,this.getNodeBottom(i));case 21:return l=!!e.sent,e.abrupt("break",35);case 23:return e.next=25,this.addCell(r.__index-1,this.getNodeTop(r),!0);case 25:return l=!!e.sent,e.abrupt("break",35);case 27:return e.next=29,this.removeCell(r);case 29:return l=!!e.sent,e.abrupt("break",35);case 31:return e.next=33,this.removeCell(i);case 33:return l=!!e.sent,e.abrupt("break",35);case 35:if(l){if(this.updateCellsSorted(),this.updateCellsAverages(),this.updateListBounds(),this._initialScrollToElement)return e.next=42,this.scrollToCachedScrollElement();e.next=42}else e.next=46;break;case 42:return e.next=44,this.updateCells();case 44:return e.next=46,this.maintainCellCount();case 46:case"end":return e.stop()}},e,this)})),function(){return wt.apply(this,arguments)})},{key:"addCell",value:(Ct=R(g.mark(function e(t,n){var r,i=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t<0||t>this._currentMaxIndex)return e.abrupt("return");e.next=2;break;case 2:if(this.virtualEnvironment)return e.next=5,this.updateCell(void 0,t);e.next=8;break;case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,this.updateCell(this.renderCell(),t);case 10:e.t0=e.sent;case 11:if(r=e.t0){e.next=14;break}return e.abrupt("return");case 14:return r.__frameNode=this.virtualEnvironment&&this.observeCellBounds?this.renderIFrame(r,this.onResizeCell):r.__frameNode,this.setNodeHeight(r),this.setNodeTop(r,n-(i?this.getNodeHeight(r):0)),e.abrupt("return",r);case 18:case"end":return e.stop()}},e,this)})),function(e,t){return Ct.apply(this,arguments)})},{key:"removeCell",value:(bt=R(g.mark(function e(t){var n;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.virtualEnvironment)return n=this.removeVirtualElementForCell(t),e.next=4,this.syncVDOMToInternalState();e.next=5;break;case 4:return e.abrupt("return",n);case 5:return this._listNode.removeChild(t),e.abrupt("return",!0);case 7:case"end":return e.stop()}},e,this)})),function(e){return bt.apply(this,arguments)})},{key:"rUpdateCells",value:function(e,t,n){this.rAF(this.updateCells,"updatecells",e,t,n)}},{key:"updateCells",value:(Nt=R(g.mark(function e(t,n,r){var i,o,s,l,a,u,c,h,d,f,p,v,m,_;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._updatingCells)return e.abrupt("return");e.next=2;break;case 2:this._updatingCells=!0,i=this.getScrollPosition(),o=i+this.getTopRenderThreshold(),s=i+this.getBottomRenderThreshold(),l=this.getCellsSorted().slice(0),c=!(u={}),(a=t)&&(u.index=0,u.pos=0,r?(h=this.findCellIndexDeviation(),m=h*this._averageCellHeight,u.index=Math.max(0,l&&l.length?l[0].__index+h:0),u.pos=Math.max(0,this.getNodeTop(l[0])+m),this.updateListBounds(!0),this.setScrollPosition(i+m)):this.setScrollPosition(0)),l&&l.length&&(this.getNodeTop(l[0])>s||this.getNodeBottom(l[l.length-1])<o)&&(t=!0,u.index=Math.min(Math.round(Math.max(o,0)/this._averageCellHeight),this._currentMaxIndex-l.length+1),u.pos=Math.max(0,u.index*this._averageCellHeight+this.getTopRenderThreshold())),h=0;case 13:if(h<l.length){if(d=l[0],f=l[l.length-1],p=l[h],t)return v=0===p.__index&&0<u.index?this.getNodeHeight(p):0,e.next=21,this.updateCell(p,u.index,n);e.next=29}else e.next=66;break;case 21:this.setNodeHeight(p),u.pos+=v?v-this.getNodeHeight(p):0,this.setNodeTop(p,u.pos),u.index+=1,u.pos+=this.getNodeHeight(p),c=!0,e.next=63;break;case 29:if(f.__index<this._currentMaxIndex&&this.getNodeBottom(p)<o&&this.getNodeBottom(f)<s)return e.next=32,this.updateCell(p,f.__index+1,n);e.next=38;break;case 32:this.setNodeHeight(p),this.setNodeTop(p,this.getNodeBottom(f)),l.push(l.shift()),c=!0,e.next=63;break;case 38:if(h===l.length-1&&0<d.__index&&this.getNodeTop(p)>s&&this.getNodeTop(d)>o)return e.next=41,this.updateCell(p,d.__index-1,n);e.next=63;break;case 41:this.setNodeHeight(p),this.setNodeTop(p,this.getNodeTop(d)-this.getNodeHeight(p)),l.unshift(l.pop()),c=!0,e.t0=!0,e.next=e.t0===(0===p.__index&&0<this.getNodeTop(p))?48:e.t0===(0===this.getNodeTop(p))?55:62;break;case 48:return m=this.getNodeTop(p),t=!0,u.index=p.__index,u.pos=0,this.setScrollPosition(i-m),h=-1,e.abrupt("break",63);case 55:return _=this._averageCellHeight*p.__index,t=!0,u.index=p.__index,u.pos=_,this.setScrollPosition(i+_),h=-1,e.abrupt("break",63);case 62:h--;case 63:h++,e.next=13;break;case 66:if(l&&l.length&&!c){e.next=72;break}return this.updateCellsSorted(),e.next=70,this.maintainCellCount();case 70:this.updateCellsAverages(),this.emitEvent("cellsUpdated",this.getCellsSorted(),this);case 72:this.updateListBounds(a),this.scrollToCachedScrollElement(),this.updateFirstAndLastCellInViewport(),this._updatingCells=!1;case 76:case"end":return e.stop()}},e,this)})),function(e,t,n){return Nt.apply(this,arguments)})},{key:"updateCell",value:(Et=R(g.mark(function e(t,n,r){var i,o,s,l,a;return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.getElementAndLevelAtIndex(n)){e.next=3;break}return e.abrupt("return");case 3:if(o=i.element,s=i.level,!o||t&&o===t.__element&&!r)return t&&o===t.__element&&(t.__index=n,t.__level=s,t.dataset.level=s),e.abrupt("return");e.next=8;break;case 8:l=this.canHasChildren()?this.getExpandInformationForElement(o):void 0,t&&this.disableNodeResizeObserving(t),this.virtualEnvironment?e.next=15:("string"==typeof(a=this.getCellRenderer?this.getCellRenderer.call(this.context,o,n,void 0!==l,this):"")||a instanceof String?t.__contentNode.innerHTML=a:(t.__contentNode.innerHTML="",t.__contentNode.appendChild(a)),e.next=19);break;case 15:return t?this.replaceVirtualElementForCell(o,t,n,void 0!==l,s):this.addVirtualElement(o,n,void 0!==l,s),e.next=18,this.updateVirtualDOM();case 18:t||(a=this.getCells(),t=a[a.length-1]);case 19:return this.observeCellBounds&&this.rAF(this.enableNodeResizeObserving,!1,t),l?t.classList.add("expanded"):t.classList.remove("expanded"),t.dataset.level=s,t.__element=o,t.__index=n,t.__level=s,this.emitElementEvents(o,n),e.abrupt("return",t);case 27:case"end":return e.stop()}},e,this)})),function(e,t,n){return Et.apply(this,arguments)})},{key:"findCellIndexDeviation",value:function(){for(var e=0;e<this._cellsSorted.length;e++){var t=this._cellsSorted[e],n=this.getIndexForElement(t.__element);if(-1!==n)return n===t.__index?0:n-t.__index}return 0}},{key:"updateCellsAverages",value:function(){var e=this.getCells(),t=0;this._lowestCellHeight=Number.MAX_VALUE;for(var n=0;n<e.length;n++){var r=this.getNodeHeight(e[n]);t+=r,this._lowestCellHeight=0===this._lowestCellHeight?r:Math.min(this._lowestCellHeight,r)}this._averageCellHeight=t/e.length}},{key:"cellBoundsUpdated",value:function(){this.rUpdateCells(!0,!1,!0)}},{key:"updateFirstAndLastCellInViewport",value:function(){for(var e,t=this.getScrollPosition(),n=this.getNodeHeight(this._scrollNode),r=this.getCellsSorted(),i=t+n,o=Math.max(1,Math.round(r.length/5)),s=-1,l=-1,a=0;a<r.length;a+=o){var u=r[a];if(this.getNodeTop(u)>t){s=Math.max(0,a-o);break}}if(-1<s){for(;;){var c=r[s];if(this.getNodeTop(c)>=t)break;s++}for(l=s;;){var h=r[l];if(!h||this.getNodeTop(h)+this.getNodeHeight(h)>=i){l--;break}l++}s<0||l<0||(n=r[s].__element,e=r[l].__element,n!==this._firstInBoundsElement&&(this._firstInBoundsElement=n,this.emitEvent("firstInBoundsElementChanged",this._firstInBoundsElement,this)),e!==this._lastInBoundsElement&&(this._lastInBoundsElement=e,this.emitEvent("lastInBoundsElementChanged",this._lastInBoundsElement,this)))}}},{key:"onResizeScrollNode",value:function(e){var t=this;this.disableAllCellsResizeObserving(),this.rAF(R(g.mark(function e(){return g.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.updateCells(!0,!1,!0);case 2:t.setNodeHeight(t._scrollNode),t.enableAllCellsResizeObserving();case 4:case"end":return e.stop()}},e,t)})),"resizelist")}},{key:"onResizeCell",value:function(e){this.cellBoundsUpdated()}},{key:"disableNodeResizeObserving",value:function(e){e.__frameNode&&e.__frameNode.contentWindow&&e.__frameNode.contentWindow.onresize&&(e.__frameNode.contentWindow.__onresize=e.__frameNode.contentWindow.onresize,e.__frameNode.contentWindow.onresize=void 0)}},{key:"enableNodeResizeObserving",value:function(e){this.observeCellBounds&&e.__frameNode&&e.__frameNode.contentWindow&&e.__frameNode.contentWindow.__onresize&&(e.__frameNode.contentWindow.onresize=e.__frameNode.contentWindow.__onresize,e.__frameNode.contentWindow.__onresize=void 0)}},{key:"disableAllCellsResizeObserving",value:function(){var t=this;this.observeCellBounds&&this.getCellsSorted().forEach(function(e){return t.disableNodeResizeObserving(e)})}},{key:"enableAllCellsResizeObserving",value:function(){var t=this;this.observeCellBounds&&this.getCellsSorted().forEach(function(e){return t.enableNodeResizeObserving(e)})}},{key:"isElementExpanded",value:function(e){return void 0!==this.getExpandInformationForElement(e)}},{key:"expandElement",value:function(e){this.addExpandInformationForElement(e),this.updateCells(!0,!1,!0)}},{key:"collapseElement",value:function(e){this.removeExpandInformationForElement(e),this.updateCells(!0,!1,!0)}},{key:"toggleExpandElement",value:function(e){this.isElementExpanded(e)?this.collapseElement(e):this.expandElement(e)}},{key:"getExpandInformationForElement",value:function(t){return this._expandInformations.find(function(e){return e.element===t})}},{key:"getExpandInformationForElementParent",value:function(t){return this._expandInformations.find(function(e){return-1<e.elementChildren.indexOf(t)})}},{key:"createExpandInformation",value:function(e){var t=this.getExpandInformationForElementParent(e);return{active:!0,element:e,elementIndex:(t?t.elementChildren:this._data).indexOf(e),elementChildren:this.getChildrenForElement(e),elementParent:t?t.element:void 0,index:this.getIndexForElement(e),level:t?t.level+1:1,totalLength:0}}},{key:"addExpandInformationForElement",value:function(e){e=this.createExpandInformation(e);if(this._expandInformations.push(e),this.invalidateExpandInformations(),this.rememberChildrenExpands)for(var t=this._expandInformations.indexOf(e)+1;t<this._expandInformations.length;t++){var n=this._expandInformations[t],r=this._expandInformations[t-1];r.active&&r.element===n.elementParent&&(n.active=!0)}this.invalidateExpandInformations()}},{key:"removeExpandInformationForElement",value:function(e){for(var t=this.getExpandInformationForElement(e),n=[t],r=this._expandInformations.indexOf(t)+1;r<this._expandInformations.length;r++){var i=this._expandInformations[r];if(i.level<=t.level)break;n.push(i)}for(var o=0;o<n.length;o++){var s=n[o];s!==t&&this.rememberChildrenExpands?s.active=!1:this.removeElementFromArray(this._expandInformations,s)}this.invalidateExpandInformations()}},{key:"invalidateExpandInformations",value:function(){this._expandInformations.sort(function(e,t){return e.index-t.index});for(var e=[],t=0;t<this._expandInformations.length;t++){for(var n=this._expandInformations[t],r=n.elementParent?this.getChildrenForElement(n.elementParent):this._data,i=!1,o=0;o<e.length;o++)i=e[o].element===n.elementParent||i;i||-1===r.indexOf(n.element)?(n.elementChildren=[],e.push(n)):n.elementChildren=this.getChildrenForElement(n.element)}for(var s=0;s<e.length;s++)this.removeElementFromArray(this._expandInformations,e[s]);this.calculateExpandInformationIndexes()}},{key:"calculateExpandInformationIndexes",value:function(){for(var e=[],t=void 0,n=0,r=0;r<this._expandInformations.length;r++){var i=this._expandInformations[r];if(i.active){t&&(i.level>t.level&&e.push(t),i.level<t.level)&&(e=e.slice(0,e.length-(t.level-i.level))),i.totalLength=i.elementChildren.length;for(var o=0;o<e.length;o++)e[o].totalLength+=i.totalLength;var s=0<e.length?e[e.length-1]:void 0,l=s?s.index:void 0,a=s?s.totalLength-i.totalLength:0,s=s?s.elementChildren.length:0,u=(e&&0<e.length?e[e.length-1].elementChildren:this._data).indexOf(i.element),a=a-s+u+(void 0!==l?l+1:0)+(1===i.level?n:0);i.elementIndex=u,i.index=a,n+=(t=i).elementChildren.length}}this.updateCurrentMaxIndex()}},{key:"rAF",value:function(e,t){var n=this,r=[].slice.call(arguments,2);this.virtualEnvironment?e.apply(this,r):t?(this._frameRequests[t]&&window.cancelAnimationFr