!function(t){"object"==typeof module&&"object"==typeof module.exports?t(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib"],t)}(function(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=t("tslib"),e=(o.prototype.list=function(){for(var t=[];this.next();)t.push(this.current);return t},o.prototype.next=function(){return!1},o.prototype.peek=function(){return this.next()?this.current:void 0},o.prototype.map=function(e,n){null==n&&(n=function(t,r){return r});var i=this,u=new o,r=u.next;return u.next=function(){for(;i.next();){var t=function(){var t=o.from(e(i.current));if(t.next()){var r=u.next;return u.next=function(){return t.next()?(u.key=n(t.current,t.key),u.current=t.current,!0):(u.next=r,u.next())},u.key=n(t.current,t.key),u.current=t.current,{value:!0}}}();if("object"==typeof t)return t.value}return u.key=void 0,u.current=void 0,u.next=r,!1},u},o.prototype.filter=function(t){var r=this,e=new o,n=e.next;return e.next=function(){for(;r.next();)if(t(r.current,r.key))return e.key=r.key,e.current=r.current,!0;return e.key=void 0,e.current=void 0,e.next=n,!1},e},o.prototype.concat=function(r){var e=this,n=new o,i=n.next;return n.next=function(){if(e.next())return n.key=e.key,n.current=e.current,!0;var t=o.from(r);return n.next=function(){return t.next()?(n.key=t.key,n.current=t.current,!0):(n.key=void 0,n.current=void 0,n.next=i,!1)},n.next()},n},o.from=function(r){if(Array.isArray(r)){var e=new o,n=e.next;return e.next=function(){var t=0;return e.next=function(){return t<r.length?(e.key=t,e.current=r[t++],!0):(e.key=t,e.current=void 0,e.next=n,!1)},e.next()},e}if(r instanceof o)return r;var t=new o,i=t.next;return t.next=function(){return t.current=r,t.next=function(){return t.current=void 0,t.next=i,!1},!0},t},o.empty=new o,o);function o(){}r.Iterator=e;n.prototype.ensureMutable=function(){var t=this.array;return this.iterating&&(t=this.array=a.__spreadArrays(t),this.iterating=!1),t},n.prototype.iterate=function(){var i=this,u=new e,o=u.next;return u.next=function(){i.iterating?i.array=a.__spreadArrays(i.array):i.iterating=!0;var e=0,n=i.array;return u.next=function(){for(;e<n.length;){var t=n[e++],r=t.key;if(i.lookup[r]===t)return u.key=r,u.current=t.value,!0}return i.array===n&&(i.iterating=!1),u.key=void 0,u.current=void 0,u.next=o,!1},u.next()},u},n.prototype.assign=function(t,r){t=String(t);var e=this.lookup,n=e[t];if(void 0!==n){var i=n.index,u=n.value;return this.ensureMutable()[i]=e[t]={key:t,index:i,value:r},u}u=this.ensureMutable();u.push(e[t]={key:t,index:u.length,value:r})},n.prototype.remove=function(t){t=String(t);var r,e=this.lookup,n=e[t];return void 0!==n&&delete e[t]&&((r=n.index)!==(t=(e=this.ensureMutable()).length-1)&&(e[(n=e[t]).index=r]=n),e.length=t),!1},n.prototype.exists=function(t){return void 0!==this.lookup[String(t)]},n.prototype.find=function(t){t=this.lookup[String(t)];return void 0!==t?t.value:void 0},n.prototype.clear=function(){0<this.array.length&&(this.array=[],this.lookup={})},Object.defineProperty(n.prototype,"length",{get:function(){return this.array.length},enumerable:!0,configurable:!0}),t=n;function n(){this.iterating=!1,this.array=[],this.lookup={}}r.Dictionary=t;i.prototype.isArray=function(t){return Array.isArray(t)&&t.owner===this.lookup},i.prototype.read=function(t,r){t=this.lookup[String(t)];if(void 0!==t){if(!this.isArray(t))return t.item===r?t.result:void 0;for(var e=0,n=t;e<n.length;e++){var i=n[e];if(i.item===r)return i.result}}},i.prototype.write=function(t,r,e){t=String(t);var n=this.lookup,i=n[t];if(void 0!==i)if(this.isArray(i)){for(var u=0,o=i;u<o.length;u++){var a=o[u];if(a.item===r){var c=a.result;return a.result=e,c}}i.push({item:r,result:e})}else{if(i.item===r){c=i.result;return i.result=e,c}n[t]=i=[i,{item:r,result:e}],i.owner=n}else n[t]={item:r,result:e}},t=i;function i(){this.lookup={}}r.Stash=t});