js-sdsl.min.js 40 KB

1
  1. !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).sdsl={})}(this,function(t){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function l(r,i){var n,o,h,s={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(h=2&e[0]?o.return:e[0]?o.throw||((h=o.return)&&h.call(o),0):o.next)&&!(h=h.call(o,e[1])).done)return h;switch(o=0,(e=h?[2&e[0],h.value]:e)[0]){case 0:case 1:h=e;break;case 4:return s.label++,{value:e[1],done:!1};case 5:s.label++,o=e[1],e=[0];continue;case 7:e=s.ops.pop(),s.trys.pop();continue;default:if(!(h=0<(h=s.trys).length&&h[h.length-1])&&(6===e[0]||2===e[0])){s=0;continue}if(3===e[0]&&(!h||e[1]>h[0]&&e[1]<h[3])){s.label=e[1];break}if(6===e[0]&&s.label<h[1]){s.label=h[1],h=e;break}if(h&&s.label<h[2]){s.label=h[2],s.ops.push(e);break}h[2]&&s.ops.pop(),s.trys.pop();continue}e=i.call(r,s)}catch(t){e=[6,t],o=0}finally{n=h=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function c(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&i>=t.length?void 0:t)&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),h=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)h.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return h}function p(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||((i=i||Array.prototype.slice.call(e,0,n))[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}var o=(r.NORMAL=!1,r.REVERSE=!0,r);function r(t){this.iteratorType=t=void 0===t?r.NORMAL:t}var n=(h.prototype.size=function(){return this.length},h.prototype.empty=function(){return 0===this.length},h);function h(){this.length=0}var s,a=(e(u,s=n),u);function u(){return null!==s&&s.apply(this,arguments)||this}var d,y=(e(v,d=n),v.prototype.clear=function(){this.length=0,this.stack.length=0},v.prototype.push=function(t){this.stack.push(t),this.length+=1},v.prototype.pop=function(){this.stack.pop(),0<this.length&&--this.length},v.prototype.top=function(){return this.stack[this.length-1]},v);function v(t){void 0===t&&(t=[]);var e=d.call(this)||this;return e.stack=[],t.forEach(function(t){return e.push(t)}),e}var g,m=(e(E,g=a),E);function E(){return null!==g&&g.apply(this,arguments)||this}function b(t,e,r){if(t<e||r<t)throw new RangeError}var B,w=(e(k,B=o),Object.defineProperty(k.prototype,"pointer",{get:function(){return b(this.node,0,this.size()-1),this.getElementByPos(this.node)},set:function(t){b(this.node,0,this.size()-1),this.setElementByPos(this.node,t)},enumerable:!1,configurable:!0}),k.prototype.equals=function(t){return this.node===t.node},k);function k(t,e,r,i,n){n=B.call(this,n)||this;return n.node=t,n.size=e,n.getElementByPos=r,n.setElementByPos=i,n.iteratorType===o.NORMAL?(n.pre=function(){if(0===this.node)throw new RangeError("Deque iterator access denied!");return--this.node,this},n.next=function(){if(this.node===this.size())throw new RangeError("Deque Iterator access denied!");return this.node+=1,this}):(n.pre=function(){if(this.node===this.size()-1)throw new RangeError("Deque iterator access denied!");return this.node+=1,this},n.next=function(){if(-1===this.node)throw new RangeError("Deque iterator access denied!");return--this.node,this}),n}var x,P=(e(L,x=w),L.prototype.copy=function(){return new L(this.node,this.size,this.getElementByPos,this.setElementByPos,this.iteratorType)},L);function L(){return null!==x&&x.apply(this,arguments)||this}var R,N=(e(T,R=m),T.prototype.reAllocate=function(){for(var t=[],e=Math.max(this.bucketNum>>1,1),r=0;r<e;++r)t[r]=new Array(this.bucketSize);for(r=this.first;r<this.bucketNum;++r)t[t.length]=this.map[r];for(r=0;r<this.last;++r)t[t.length]=this.map[r];t[t.length]=p([],f(this.map[this.last]),!1),this.first=e,this.last=t.length-1;for(r=0;r<e;++r)t[t.length]=new Array(this.bucketSize);this.map=t,this.bucketNum=t.length},T.prototype.getElementIndex=function(t){var e=this.curFirst+t+1,r=e%this.bucketSize,t=r-1,e=this.first+(e-r)/this.bucketSize;return 0==r&&--e,e%=this.bucketNum,t<0&&(t+=this.bucketSize),{curNodeBucketIndex:e,curNodePointerIndex:t}},T.prototype.clear=function(){this.map=[[]],this.bucketNum=1,this.first=this.last=this.length=0,this.curFirst=this.curLast=this.bucketSize>>1},T.prototype.front=function(){return this.map[this.first][this.curFirst]},T.prototype.back=function(){return this.map[this.last][this.curLast]},T.prototype.begin=function(){return new P(0,this.size,this.getElementByPos,this.setElementByPos)},T.prototype.end=function(){return new P(this.length,this.size,this.getElementByPos,this.setElementByPos)},T.prototype.rBegin=function(){return new P(this.length-1,this.size,this.getElementByPos,this.setElementByPos,o.REVERSE)},T.prototype.rEnd=function(){return new P(-1,this.size,this.getElementByPos,this.setElementByPos,o.REVERSE)},T.prototype.pushBack=function(t){this.length&&(this.curLast<this.bucketSize-1?this.curLast+=1:(this.last<this.bucketNum-1?this.last+=1:this.last=0,this.curLast=0),this.last===this.first&&this.curLast===this.curFirst&&this.reAllocate()),this.length+=1,this.map[this.last][this.curLast]=t},T.prototype.popBack=function(){this.length&&(this.map[this.last][this.curLast]=void 0,1!==this.length&&(0<this.curLast?--this.curLast:(0<this.last?--this.last:this.last=this.bucketNum-1,this.curLast=this.bucketSize-1)),--this.length)},T.prototype.pushFront=function(t){this.length&&(0<this.curFirst?--this.curFirst:(0<this.first?--this.first:this.first=this.bucketNum-1,this.curFirst=this.bucketSize-1),this.first===this.last&&this.curFirst===this.curLast&&this.reAllocate()),this.length+=1,this.map[this.first][this.curFirst]=t},T.prototype.popFront=function(){this.length&&(this.map[this.first][this.curFirst]=void 0,1!==this.length&&(this.curFirst<this.bucketSize-1?this.curFirst+=1:(this.first<this.bucketNum-1?this.first+=1:this.first=0,this.curFirst=0)),--this.length)},T.prototype.forEach=function(t){for(var e=0;e<this.length;++e)t(this.getElementByPos(e),e)},T.prototype.getElementByPos=function(t){b(t,0,this.length-1);var e=this.getElementIndex(t),t=e.curNodeBucketIndex,e=e.curNodePointerIndex;return this.map[t][e]},T.prototype.setElementByPos=function(t,e){b(t,0,this.length-1);var r=this.getElementIndex(t),t=r.curNodeBucketIndex,r=r.curNodePointerIndex;this.map[t][r]=e},T.prototype.insert=function(t,e,r){if(void 0===r&&(r=1),b(t,0,this.length),0===t)for(;r--;)this.pushFront(e);else if(t===this.length)for(;r--;)this.pushBack(e);else{for(var i=[],n=t;n<this.length;++n)i.push(this.getElementByPos(n));this.cut(t-1);for(n=0;n<r;++n)this.pushBack(e);for(n=0;n<i.length;++n)this.pushBack(i[n])}},T.prototype.cut=function(t){var e,r;t<0?this.clear():(e=(r=this.getElementIndex(t)).curNodeBucketIndex,r=r.curNodePointerIndex,this.last=e,this.curLast=r,this.length=t+1)},T.prototype.eraseElementByPos=function(t){var e=this;if(b(t,0,this.length-1),0===t)this.popFront();else if(t===this.length-1)this.popBack();else{for(var r=[],i=t+1;i<this.length;++i)r.push(this.getElementByPos(i));this.cut(t),this.popBack(),r.forEach(function(t){return e.pushBack(t)})}},T.prototype.eraseElementByValue=function(t){if(this.length){for(var e=[],r=0;r<this.length;++r){var i=this.getElementByPos(r);i!==t&&e.push(i)}for(var n=e.length,r=0;r<n;++r)this.setElementByPos(r,e[r]);this.cut(n-1)}},T.prototype.eraseElementByIterator=function(t){var e=t.node;return this.eraseElementByPos(e),t=t.next()},T.prototype.find=function(t){for(var e=0;e<this.length;++e)if(this.getElementByPos(e)===t)return new P(e,this.size,this.getElementByPos,this.setElementByPos);return this.end()},T.prototype.reverse=function(){for(var t=0,e=this.length-1;t<e;){var r=this.getElementByPos(t);this.setElementByPos(t,this.getElementByPos(e)),this.setElementByPos(e,r),t+=1,--e}},T.prototype.unique=function(){if(!(this.length<=1)){for(var t=1,e=this.getElementByPos(0),r=1;r<this.length;++r){var i=this.getElementByPos(r);i!==e&&this.setElementByPos(t++,e=i)}for(;this.length>t;)this.popBack()}},T.prototype.sort=function(t){for(var e=[],r=0;r<this.length;++r)e.push(this.getElementByPos(r));e.sort(t);for(r=0;r<this.length;++r)this.setElementByPos(r,e[r])},T.prototype.shrinkToFit=function(){if(this.length){var e=[];this.forEach(function(t){return e.push(t)}),this.bucketNum=Math.max(Math.ceil(this.length/this.bucketSize),1),this.length=this.first=this.last=this.curFirst=this.curLast=0,this.map=[];for(var t=0;t<this.bucketNum;++t)this.map.push(new Array(this.bucketSize));for(t=0;t<e.length;++t)this.pushBack(e[t])}},T.prototype[Symbol.iterator]=function(){return function(){var e;return l(this,function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<this.length?[4,this.getElementByPos(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return++e,[3,1];case 4:return[2]}})}.bind(this)()},T);function T(t,e){void 0===t&&(t=[]),void 0===e&&(e=4096);var r,i=R.call(this)||this;if(i.first=0,i.curFirst=0,i.last=0,i.curLast=0,i.bucketNum=0,i.map=[],"size"in t)r="number"==typeof t.size?t.size:t.size();else{if(!("length"in t))throw new RangeError("Can't get container's size!");r=t.length}i.bucketSize=e,i.bucketNum=Math.max(Math.ceil(r/i.bucketSize),1);for(var n=0;n<i.bucketNum;++n)i.map.push(new Array(i.bucketSize));e=Math.ceil(r/i.bucketSize);return i.first=i.last=(i.bucketNum>>1)-(e>>1),i.curFirst=i.curLast=i.bucketSize-r%i.bucketSize>>1,t.forEach(function(t){return i.pushBack(t)}),i.size=i.size.bind(i),i.getElementByPos=i.getElementByPos.bind(i),i.setElementByPos=i.setElementByPos.bind(i),i}var z,S=(e(F,z=n),F.prototype.clear=function(){this.queue.clear(),this.length=0},F.prototype.push=function(t){this.queue.pushBack(t),this.length+=1},F.prototype.pop=function(){this.queue.popFront(),this.length&&--this.length},F.prototype.front=function(){return this.queue.front()},F);function F(t){void 0===t&&(t=[]);var e=z.call(this)||this;return e.queue=new N(t),e.length=e.queue.size(),e}var A,Q=(e(O,A=n),O.prototype.adjust=function(t){var e,r=t<<1|1,i=2+(t<<1);r<this.length&&0<this.cmp(this.priorityQueue[t],this.priorityQueue[r])&&(e=f([this.priorityQueue[r],this.priorityQueue[t]],2),this.priorityQueue[t]=e[0],this.priorityQueue[r]=e[1]),i<this.length&&0<this.cmp(this.priorityQueue[t],this.priorityQueue[i])&&(e=f([this.priorityQueue[i],this.priorityQueue[t]],2),this.priorityQueue[t]=e[0],this.priorityQueue[i]=e[1])},O.prototype.clear=function(){this.length=0,this.priorityQueue.length=0},O.prototype.push=function(t){if(this.priorityQueue.push(t),this.length+=1,1!==this.length)for(var e=this.length-1;0<e;){var r=e-1>>1;if(this.cmp(this.priorityQueue[r],t)<=0)break;this.adjust(r),e=r}},O.prototype.pop=function(){if(this.length){var t=this.priorityQueue[this.length-1];--this.length;for(var e=0;e<this.length;){var r=e<<1|1,i=2+(e<<1);if(r>=this.length)break;var n=r;if(i<this.length&&0<this.cmp(this.priorityQueue[r],this.priorityQueue[i])&&(n=i),0<=this.cmp(this.priorityQueue[n],t))break;this.priorityQueue[e]=this.priorityQueue[n],e=n}this.priorityQueue[e]=t,this.priorityQueue.pop()}},O.prototype.top=function(){return this.priorityQueue[0]},O);function O(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=function(t,e){return e<t?-1:t<e?1:0}),void 0===r&&(r=!0);var i=A.call(this)||this;i.cmp=e,Array.isArray(t)?i.priorityQueue=r?p([],f(t),!1):t:(i.priorityQueue=[],t.forEach(function(t){return i.priorityQueue.push(t)})),i.length=i.priorityQueue.length;for(var n=i.length-1>>1;0<=n;--n)for(var o=n,h=o<<1|1;h<i.length;){var s=h,a=s+1,u=s;if(a<i.length&&0<i.cmp(i.priorityQueue[s],i.priorityQueue[a])&&(u=a),i.cmp(i.priorityQueue[o],i.priorityQueue[u])<=0)break;a=f([i.priorityQueue[u],i.priorityQueue[o]],2),i.priorityQueue[o]=a[0],i.priorityQueue[u]=a[1],h=(o=u)<<1|1}return i}var I,K=(e(C,I=w),C.prototype.copy=function(){return new C(this.node,this.size,this.getElementByPos,this.setElementByPos,this.iteratorType)},C);function C(){return null!==I&&I.apply(this,arguments)||this}var D,q=(e(_,D=m),_.prototype.clear=function(){this.length=0,this.vector.length=0},_.prototype.begin=function(){return new K(0,this.size,this.getElementByPos,this.setElementByPos)},_.prototype.end=function(){return new K(this.length,this.size,this.getElementByPos,this.setElementByPos)},_.prototype.rBegin=function(){return new K(this.length-1,this.size,this.getElementByPos,this.setElementByPos,o.REVERSE)},_.prototype.rEnd=function(){return new K(-1,this.size,this.getElementByPos,this.setElementByPos,o.REVERSE)},_.prototype.front=function(){return this.vector[0]},_.prototype.back=function(){return this.vector[this.length-1]},_.prototype.forEach=function(t){for(var e=0;e<this.length;++e)t(this.vector[e],e)},_.prototype.getElementByPos=function(t){return b(t,0,this.length-1),this.vector[t]},_.prototype.eraseElementByPos=function(t){b(t,0,this.length-1),this.vector.splice(t,1),--this.length},_.prototype.eraseElementByValue=function(t){for(var e=0,r=0;r<this.length;++r)this.vector[r]!==t&&(this.vector[e++]=this.vector[r]);this.length=this.vector.length=e},_.prototype.eraseElementByIterator=function(t){var e=t.node;return t=t.next(),this.eraseElementByPos(e),t},_.prototype.pushBack=function(t){this.vector.push(t),this.length+=1},_.prototype.popBack=function(){this.length&&(this.vector.pop(),--this.length)},_.prototype.setElementByPos=function(t,e){b(t,0,this.length-1),this.vector[t]=e},_.prototype.insert=function(t,e,r){var i;void 0===r&&(r=1),b(t,0,this.length),(i=this.vector).splice.apply(i,p([t,0],f(new Array(r).fill(e)),!1)),this.length+=r},_.prototype.find=function(t){for(var e=0;e<this.length;++e)if(this.vector[e]===t)return new K(e,this.size,this.getElementByPos,this.getElementByPos);return this.end()},_.prototype.reverse=function(){this.vector.reverse()},_.prototype.unique=function(){for(var t=1,e=1;e<this.length;++e)this.vector[e]!==this.vector[e-1]&&(this.vector[t++]=this.vector[e]);this.length=this.vector.length=t},_.prototype.sort=function(t){this.vector.sort(t)},_.prototype[Symbol.iterator]=function(){return function(){return l(this,function(t){switch(t.label){case 0:return[5,c(this.vector)];case 1:return[2,t.sent()]}})}.bind(this)()},_);function _(t,e){void 0===t&&(t=[]),void 0===e&&(e=!0);var r=D.call(this)||this;return Array.isArray(t)?(r.vector=e?p([],f(t),!1):t,r.length=t.length):(r.vector=[],t.forEach(function(t){return r.pushBack(t)})),r.size=r.size.bind(r),r.getElementByPos=r.getElementByPos.bind(r),r.setElementByPos=r.setElementByPos.bind(r),r}var j,M=function(t){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=t},V=(e(U,j=o),Object.defineProperty(U.prototype,"pointer",{get:function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node.value},set:function(t){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");this.node.value=t},enumerable:!1,configurable:!0}),U.prototype.equals=function(t){return this.node===t.node},U.prototype.copy=function(){return new U(this.node,this.header,this.iteratorType)},U);function U(t,e,r){r=j.call(this,r)||this;return r.node=t,r.header=e,r.iteratorType===o.NORMAL?(r.pre=function(){if(this.node.pre===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre,this},r.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next,this}):(r.pre=function(){if(this.node.next===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next,this},r.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre,this}),r}var H,G=(e(J,H=m),J.prototype.clear=function(){this.length=0,this.head=this.tail=void 0,this.header.pre=this.header.next=void 0},J.prototype.begin=function(){return new V(this.head||this.header,this.header)},J.prototype.end=function(){return new V(this.header,this.header)},J.prototype.rBegin=function(){return new V(this.tail||this.header,this.header,o.REVERSE)},J.prototype.rEnd=function(){return new V(this.header,this.header,o.REVERSE)},J.prototype.front=function(){return this.head?this.head.value:void 0},J.prototype.back=function(){return this.tail?this.tail.value:void 0},J.prototype.forEach=function(t){if(this.length)for(var e=this.head,r=0;e!==this.header;)t(e.value,r++),e=e.next},J.prototype.getElementByPos=function(t){b(t,0,this.length-1);for(var e=this.head;t--;)e=e.next;return e.value},J.prototype.eraseElementByPos=function(t){if(b(t,0,this.length-1),0===t)this.popFront();else if(t===this.length-1)this.popBack();else{for(var e=this.head;t--;)e=e.next;var r=e.pre,i=e.next;(i.pre=r).next=i,--this.length}},J.prototype.eraseElementByValue=function(t){for(;this.head&&this.head.value===t;)this.popFront();for(;this.tail&&this.tail.value===t;)this.popBack();if(this.head)for(var e,r,i=this.head;i!==this.header;)i.value===t&&(e=i.pre,(r=i.next)&&(r.pre=e),e&&(e.next=r),--this.length),i=i.next},J.prototype.eraseElementByIterator=function(t){var e,r=t.node;if(r===this.header)throw new RangeError("Invalid iterator");return t=t.next(),this.head===r?this.popFront():this.tail===r?this.popBack():(e=r.pre,(r=r.next)&&(r.pre=e),e&&(e.next=r),--this.length),t},J.prototype.pushBack=function(t){this.length+=1;t=new M(t);this.tail?((this.tail.next=t).pre=this.tail,this.tail=t):(this.head=this.tail=t,this.header.next=this.head,this.head.pre=this.header),this.tail.next=this.header,this.header.pre=this.tail},J.prototype.popBack=function(){this.tail&&(--this.length,this.head===this.tail?(this.head=this.tail=void 0,this.header.next=void 0):(this.tail=this.tail.pre,this.tail&&(this.tail.next=void 0)),this.header.pre=this.tail,this.tail&&(this.tail.next=this.header))},J.prototype.setElementByPos=function(t,e){b(t,0,this.length-1);for(var r=this.head;t--;)r=r.next;r.value=e},J.prototype.insert=function(t,e,r){if(void 0===r&&(r=1),b(t,0,this.length),!(r<=0))if(0===t)for(;r--;)this.pushFront(e);else if(t===this.length)for(;r--;)this.pushBack(e);else{for(var i=this.head,n=1;n<t;++n)i=i.next;var o=i.next;for(this.length+=r;r--;)i.next=new M(e),i=(i.next.pre=i).next;(i.next=o)&&(o.pre=i)}},J.prototype.find=function(t){if(!this.head)return this.end();for(var e=this.head;e!==this.header;){if(e.value===t)return new V(e,this.header);e=e.next}return this.end()},J.prototype.reverse=function(){if(!(this.length<=1))for(var t=this.head,e=this.tail,r=0;r<<1<this.length;){var i=t.value;t.value=e.value,e.value=i,t=t.next,e=e.pre,r+=1}},J.prototype.unique=function(){if(!(this.length<=1))for(var t=this.head;t!==this.header;){for(var e=t;e.next&&e.value===e.next.value;)e=e.next,--this.length;t.next=e.next,t.next&&(t.next.pre=t),t=t.next}},J.prototype.sort=function(t){var e,r;this.length<=1||(e=[],this.forEach(function(t){return e.push(t)}),e.sort(t),r=this.head,e.forEach(function(t){r.value=t,r=r.next}))},J.prototype.pushFront=function(t){this.length+=1;t=new M(t);this.head?(t.next=this.head,this.head.pre=t,this.head=t):(this.head=this.tail=t,this.tail.next=this.header,this.header.pre=this.tail),this.header.next=this.head,this.head.pre=this.header},J.prototype.popFront=function(){this.head&&(--this.length,this.head===this.tail?(this.head=this.tail=void 0,this.header.pre=this.tail):(this.head=this.head.next,this.head&&(this.head.pre=this.header)),this.header.next=this.head)},J.prototype.merge=function(t){var r,i=this;this.head?(r=this.head,t.forEach(function(t){for(;r&&r!==i.header&&r.value<=t;)r=r.next;var e;r===i.header?(i.pushBack(t),r=i.tail):r===i.head?(i.pushFront(t),r=i.head):(i.length+=1,(e=r.pre).next=new M(t),((e.next.pre=e).next.next=r).pre=e.next)})):t.forEach(function(t){return i.pushBack(t)})},J.prototype[Symbol.iterator]=function(){return function(){var e;return l(this,function(t){switch(t.label){case 0:if(!this.head)return[2];e=this.head,t.label=1;case 1:return e===this.header?[3,3]:[4,e.value];case 2:return t.sent(),e=e.next,[3,1];case 3:return[2]}})}.bind(this)()},J);function J(t){void 0===t&&(t=[]);var e=H.call(this)||this;return e.header=new M,e.head=void 0,e.tail=void 0,t.forEach(function(t){return e.pushBack(t)}),e}var W=(X.prototype.pre=function(){var t=this;if(t.color===X.RED&&t.parent.parent===t)t=t.right;else if(t.left)for(t=t.left;t.right;)t=t.right;else{for(var e=t.parent;e.left===t;)e=(t=e).parent;t=e}return t},X.prototype.next=function(){var t=this;if(t.right)for(t=t.right;t.left;)t=t.left;else{for(var e=t.parent;e.right===t;)e=(t=e).parent;t.right!==e&&(t=e)}return t},X.prototype.rotateLeft=function(){var t=this.parent,e=this.right,r=e.left;return t.parent===this?t.parent=e:t.left===this?t.left=e:t.right=e,e.parent=t,(e.left=this).parent=e,(this.right=r)&&(r.parent=this),e},X.prototype.rotateRight=function(){var t=this.parent,e=this.left,r=e.right;return t.parent===this?t.parent=e:t.left===this?t.left=e:t.right=e,e.parent=t,(e.right=this).parent=e,(this.left=r)&&(r.parent=this),e},X.prototype.remove=function(){var t=this.parent;this===t.left?t.left=void 0:t.right=void 0},X.RED=!0,X.BLACK=!1,X);function X(t,e){this.color=!0,this.key=void 0,this.value=void 0,this.left=void 0,this.right=void 0,this.parent=void 0,this.key=t,this.value=e}var Y,Z=(e($,Y=a),$.prototype._lowerBound=function(t,e){for(var r;t;){var i=this.cmp(t.key,e);if(i<0)t=t.right;else{if(!(0<i))return t;t=(r=t).left}}return void 0===r?this.header:r},$.prototype._upperBound=function(t,e){for(var r;t;){var i=this.cmp(t.key,e);i<=0?t=t.right:0<i&&(t=(r=t).left)}return void 0===r?this.header:r},$.prototype._reverseLowerBound=function(t,e){for(var r;t;){var i=this.cmp(t.key,e);if(i<0)t=(r=t).right;else{if(!(0<i))return t;t=t.left}}return void 0===r?this.header:r},$.prototype._reverseUpperBound=function(t,e){for(var r;t;){var i=this.cmp(t.key,e);i<0?t=(r=t).right:0<=i&&(t=t.left)}return void 0===r?this.header:r},$.prototype.eraseNodeSelfBalance=function(t){for(;;){var e,r=t.parent;if(r===this.header)return;if(t.color===W.RED)return void(t.color=W.BLACK);if(t===r.left){if((e=r.right).color===W.RED)e.color=W.BLACK,r.color=W.RED,r===this.root?this.root=r.rotateLeft():r.rotateLeft();else if(e.color===W.BLACK){if(e.right&&e.right.color===W.RED)return e.color=r.color,r.color=W.BLACK,e.right.color=W.BLACK,void(r===this.root?this.root=r.rotateLeft():r.rotateLeft());e.left&&e.left.color===W.RED?(e.color=W.RED,e.left.color=W.BLACK,e.rotateRight()):(e.color=W.RED,t=r)}}else if((e=r.left).color===W.RED)e.color=W.BLACK,r.color=W.RED,r===this.root?this.root=r.rotateRight():r.rotateRight();else{if(e.left&&e.left.color===W.RED)return e.color=r.color,r.color=W.BLACK,e.left.color=W.BLACK,void(r===this.root?this.root=r.rotateRight():r.rotateRight());e.right&&e.right.color===W.RED?(e.color=W.RED,e.right.color=W.BLACK,e.rotateLeft()):(e.color=W.RED,t=r)}}},$.prototype.eraseNode=function(t){var e;if(1!==this.length){for(var r=t;r.left||r.right;){if(r.right)for(r=r.right;r.left;)r=r.left;else r.left&&(r=r.left);e=f([r.key,t.key],2),t.key=e[0],r.key=e[1],e=f([r.value,t.value],2),t.value=e[0],r.value=e[1],t=r}this.header.left===r?this.header.left=r.parent:this.header.right===r&&(this.header.right=r.parent),this.eraseNodeSelfBalance(r),r.remove(),--this.length,this.root.color=W.BLACK}else this.clear()},$.prototype.insertNodeSelfBalance=function(t){for(;;){var e=t.parent;if(e.color===W.BLACK)return;var r,i,n=e.parent;if(e===n.left){if((r=n.right)&&r.color===W.RED){if(r.color=e.color=W.BLACK,n===this.root)return;n.color=W.RED,t=n;continue}t===e.right?(t.color=W.BLACK,t.left&&(t.left.parent=e),t.right&&(t.right.parent=n),e.right=t.left,n.left=t.right,t.left=e,(t.right=n)===this.root?(this.root=t,this.header.parent=t):(i=n.parent).left===n?i.left=t:i.right=t,t.parent=n.parent,e.parent=t,n.parent=t):(e.color=W.BLACK,n===this.root?this.root=n.rotateRight():n.rotateRight()),n.color=W.RED}else{if((r=n.left)&&r.color===W.RED){if(r.color=e.color=W.BLACK,n===this.root)return;n.color=W.RED,t=n;continue}t===e.left?(t.color=W.BLACK,t.left&&(t.left.parent=n),t.right&&(t.right.parent=e),n.right=t.left,e.left=t.right,t.left=n,t.right=e,n===this.root?(this.root=t,this.header.parent=t):(i=n.parent).left===n?i.left=t:i.right=t,t.parent=n.parent,e.parent=t,n.parent=t):(e.color=W.BLACK,n===this.root?this.root=n.rotateLeft():n.rotateLeft()),n.color=W.RED}return}},$.prototype.findElementNode=function(t,e){for(;t;){var r=this.cmp(t.key,e);if(r<0)t=t.right;else{if(!(0<r))return t;t=t.left}}return t},$.prototype.set=function(t,e,r){if(void 0===this.root)return this.length+=1,this.root=new W(t,e),this.root.color=W.BLACK,this.root.parent=this.header,this.header.parent=this.root,this.header.left=this.root,void(this.header.right=this.root);var i,n=this.header.left,o=this.cmp(n.key,t);if(0!==o){if(0<o)n.left=new W(t,e),i=(n.left.parent=n).left,this.header.left=i;else{var h=this.header.right,o=this.cmp(h.key,t);if(0===o)return void(h.value=e);if(o<0)h.right=new W(t,e),i=(h.right.parent=h).right,this.header.right=i;else{if(void 0!==r){o=r.node;if(o!==this.header){h=this.cmp(o.key,t);if(0===h)return void(o.value=e);if(0<h){r=o.pre(),h=this.cmp(r.key,t);if(0===h)return void(r.value=e);h<0&&(i=new W(t,e),void 0===r.right?(r.right=i).parent=r:(o.left=i).parent=o)}}}if(void 0===i)for(i=this.root;;){var s=this.cmp(i.key,t);if(0<s){if(void 0===i.left){i.left=new W(t,e),i=(i.left.parent=i).left;break}i=i.left}else{if(!(s<0))return void(i.value=e);if(void 0===i.right){i.right=new W(t,e),i=(i.right.parent=i).right;break}i=i.right}}}}this.length+=1,this.insertNodeSelfBalance(i)}else n.value=e},$.prototype.clear=function(){this.length=0,this.root=void 0,this.header.parent=void 0,this.header.left=this.header.right=void 0},$.prototype.updateKeyByIterator=function(t,e){var r=t.node;if(r===this.header)throw new TypeError("Invalid iterator!");if(1===this.length)return r.key=e,!0;if(r===this.header.left)return 0<this.cmp(r.next().key,e)&&(r.key=e,!0);if(r===this.header.right)return this.cmp(r.pre().key,e)<0&&(r.key=e,!0);t=r.pre().key;if(0<=this.cmp(t,e))return!1;t=r.next().key;return!(this.cmp(t,e)<=0)&&(r.key=e,!0)},$.prototype.eraseElementByPos=function(e){var r=this;b(e,0,this.length-1);var i=0;this.inOrderTraversal(this.root,function(t){return e===i?(r.eraseNode(t),!0):(i+=1,!1)})},$.prototype.eraseElementByKey=function(t){!this.length||void 0!==(t=this.findElementNode(this.root,t))&&this.eraseNode(t)},$.prototype.eraseElementByIterator=function(t){var e=t.node;if(e===this.header)throw new RangeError("Invalid iterator");return void 0===e.right&&(t=t.next()),this.eraseNode(e),t},$.prototype.getHeight=function(){if(!this.length)return 0;function e(t){return t?Math.max(e(t.left),e(t.right))+1:0}return e(this.root)},$);function $(t){void 0===t&&(t=function(t,e){return t<e?-1:e<t?1:0});var r=Y.call(this)||this;return r.root=void 0,r.header=new W,r.inOrderTraversal=function(t,e){return void 0!==t&&(!!r.inOrderTraversal(t.left,e)||(!!e(t)||r.inOrderTraversal(t.right,e)))},r.cmp=t,r}var tt,w=(e(et,tt=o),et.prototype.equals=function(t){return this.node===t.node},et);function et(t,e,r){r=tt.call(this,r)||this;return r.node=t,r.header=e,r.iteratorType===o.NORMAL?(r.pre=function(){if(this.node===this.header.left)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre(),this},r.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next(),this}):(r.pre=function(){if(this.node===this.header.right)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next(),this},r.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre(),this}),r}var rt,it=(e(nt,rt=w),Object.defineProperty(nt.prototype,"pointer",{get:function(){if(this.node===this.header)throw new RangeError("OrderedSet iterator access denied!");return this.node.key},enumerable:!1,configurable:!0}),nt.prototype.copy=function(){return new nt(this.node,this.header,this.iteratorType)},nt);function nt(){return null!==rt&&rt.apply(this,arguments)||this}var ot,ht=(e(st,ot=Z),st.prototype.begin=function(){return new it(this.header.left||this.header,this.header)},st.prototype.end=function(){return new it(this.header,this.header)},st.prototype.rBegin=function(){return new it(this.header.right||this.header,this.header,o.REVERSE)},st.prototype.rEnd=function(){return new it(this.header,this.header,o.REVERSE)},st.prototype.front=function(){return this.header.left?this.header.left.key:void 0},st.prototype.back=function(){return this.header.right?this.header.right.key:void 0},st.prototype.forEach=function(t){var e,r,i=0;try{for(var n=c(this),o=n.next();!o.done;o=n.next())t(o.value,i++)}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},st.prototype.getElementByPos=function(t){var e,r,i;b(t,0,this.length-1);var n=0;try{for(var o=c(this),h=o.next();!h.done;h=o.next()){var s=h.value;n===t&&(i=s),n+=1}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return i},st.prototype.insert=function(t,e){this.set(t,void 0,e)},st.prototype.find=function(t){t=this.findElementNode(this.root,t);return void 0!==t?new it(t,this.header):this.end()},st.prototype.lowerBound=function(t){t=this._lowerBound(this.root,t);return new it(t,this.header)},st.prototype.upperBound=function(t){t=this._upperBound(this.root,t);return new it(t,this.header)},st.prototype.reverseLowerBound=function(t){t=this._reverseLowerBound(this.root,t);return new it(t,this.header)},st.prototype.reverseUpperBound=function(t){t=this._reverseUpperBound(this.root,t);return new it(t,this.header)},st.prototype.union=function(t){var e=this;t.forEach(function(t){return e.insert(t)})},st.prototype[Symbol.iterator]=function(){return this.iterationFunc(this.root)},st);function st(t,e){void 0===t&&(t=[]);var r=ot.call(this,e)||this;return r.iterationFunc=function(e){return l(this,function(t){switch(t.label){case 0:return void 0===e?[2]:[5,c(this.iterationFunc(e.left))];case 1:return t.sent(),[4,e.key];case 2:return t.sent(),[5,c(this.iterationFunc(e.right))];case 3:return t.sent(),[2]}})},t.forEach(function(t){return r.insert(t)}),r.iterationFunc=r.iterationFunc.bind(r),r}var at,ut=(e(lt,at=w),Object.defineProperty(lt.prototype,"pointer",{get:function(){var i=this;if(this.node===this.header)throw new RangeError("OrderedMap iterator access denied");return new Proxy([],{get:function(t,e){return"0"===e?i.node.key:"1"===e?i.node.value:void 0},set:function(t,e,r){if("1"!==e)throw new TypeError("props must be 1");return i.node.value=r,!0}})},enumerable:!1,configurable:!0}),lt.prototype.copy=function(){return new lt(this.node,this.header,this.iteratorType)},lt);function lt(){return null!==at&&at.apply(this,arguments)||this}var ct,ft=(e(pt,ct=Z),pt.prototype.begin=function(){return new ut(this.header.left||this.header,this.header)},pt.prototype.end=function(){return new ut(this.header,this.header)},pt.prototype.rBegin=function(){return new ut(this.header.right||this.header,this.header,o.REVERSE)},pt.prototype.rEnd=function(){return new ut(this.header,this.header,o.REVERSE)},pt.prototype.front=function(){if(this.length){var t=this.header.left;return[t.key,t.value]}},pt.prototype.back=function(){if(this.length){var t=this.header.right;return[t.key,t.value]}},pt.prototype.forEach=function(t){var e,r,i=0;try{for(var n=c(this),o=n.next();!o.done;o=n.next())t(o.value,i++)}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},pt.prototype.lowerBound=function(t){t=this._lowerBound(this.root,t);return new ut(t,this.header)},pt.prototype.upperBound=function(t){t=this._upperBound(this.root,t);return new ut(t,this.header)},pt.prototype.reverseLowerBound=function(t){t=this._reverseLowerBound(this.root,t);return new ut(t,this.header)},pt.prototype.reverseUpperBound=function(t){t=this._reverseUpperBound(this.root,t);return new ut(t,this.header)},pt.prototype.setElement=function(t,e,r){this.set(t,e,r)},pt.prototype.find=function(t){t=this.findElementNode(this.root,t);return void 0!==t?new ut(t,this.header):this.end()},pt.prototype.getElementByKey=function(t){t=this.findElementNode(this.root,t);return t?t.value:void 0},pt.prototype.getElementByPos=function(t){var e,r,i;b(t,0,this.length-1);var n=0;try{for(var o=c(this),h=o.next();!h.done;h=o.next()){var s=h.value;if(n===t){i=s;break}n+=1}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return i},pt.prototype.union=function(t){var r=this;t.forEach(function(t){var e=f(t,2),t=e[0],e=e[1];return r.setElement(t,e)})},pt.prototype[Symbol.iterator]=function(){return this.iterationFunc(this.root)},pt);function pt(t,e){void 0===t&&(t=[]);var r=ct.call(this,e)||this;return r.iterationFunc=function(e){return l(this,function(t){switch(t.label){case 0:return void 0===e?[2]:[5,c(this.iterationFunc(e.left))];case 1:return t.sent(),[4,[e.key,e.value]];case 2:return t.sent(),[5,c(this.iterationFunc(e.right))];case 3:return t.sent(),[2]}})},r.iterationFunc=r.iterationFunc.bind(r),t.forEach(function(t){var e=f(t,2),t=e[0],e=e[1];return r.setElement(t,e)}),r}var dt,yt=(e(vt,dt=n),vt.prototype.clear=function(){this.length=0,this.bucketNum=this.initBucketNum,this.hashTable=[]},vt.sigma=.75,vt.treeifyThreshold=8,vt.untreeifyThreshold=6,vt.minTreeifySize=64,vt.maxBucketNum=1<<30,vt);function vt(t,e){void 0===t&&(t=16),void 0===e&&(e=function(t){for(var e="string"!=typeof t?JSON.stringify(t):t,r=0,i=e.length,n=0;n<i;n++){r=(r<<5)-r+e.charCodeAt(n);r|=0}return r>>>0});var r=dt.call(this)||this;if(t<16||0!=(t&t-1))throw new RangeError("InitBucketNum range error");return r.bucketNum=r.initBucketNum=t,r.hashFunc=e,r}var gt,w=(e(mt,gt=yt),mt.prototype.reAllocate=function(){var o=this;if(!(this.bucketNum>=yt.maxBucketNum)){var h=[],s=this.bucketNum;this.bucketNum<<=1;for(var a=Object.keys(this.hashTable),t=a.length,u=this,e=0;e<t;++e)!function(t){var e=parseInt(a[t]),r=u.hashTable[e],t=r.size();if(0===t)return;if(1===t){t=r.front();return h[u.hashFunc(t)&u.bucketNum-1]=new q([t],!1)}var i=[],n=[];r.forEach(function(t){(0==(o.hashFunc(t)&s)?i:n).push(t)}),r instanceof ht?(i.length>yt.untreeifyThreshold?h[e]=new ht(i):i.length&&(h[e]=new q(i,!1)),n.length>yt.untreeifyThreshold?h[e+s]=new ht(n):n.length&&(h[e+s]=new q(n,!1))):(i.length>=yt.treeifyThreshold?h[e]=new ht(i):i.length&&(h[e]=new q(i,!1)),n.length>=yt.treeifyThreshold?h[e+s]=new ht(n):n.length&&(h[e+s]=new q(n,!1)))}(e);this.hashTable=h}},mt.prototype.forEach=function(e){for(var t=Object.values(this.hashTable),r=t.length,i=0,n=0;n<r;++n)t[n].forEach(function(t){return e(t,i++)})},mt.prototype.insert=function(t){var e=this.hashFunc(t)&this.bucketNum-1,r=this.hashTable[e];if(r){var i=r.size();if(r instanceof q){if(!r.find(t).equals(r.end()))return;if(r.pushBack(t),yt.treeifyThreshold<=i+1){if(this.bucketNum<=yt.minTreeifySize)return this.length+=1,void this.reAllocate();this.hashTable[e]=new ht(r)}this.length+=1}else{r.insert(t);r=r.size();this.length+=r-i}}else this.hashTable[e]=new q([t],!1),this.length+=1;this.length>this.bucketNum*yt.sigma&&this.reAllocate()},mt.prototype.eraseElementByKey=function(t){var e,r,i=this.hashFunc(t)&this.bucketNum-1,n=this.hashTable[i];!n||0!==(e=n.size())&&(n instanceof q?(n.eraseElementByValue(t),r=n.size(),this.length+=r-e):(n.eraseElementByKey(t),r=n.size(),this.length+=r-e,r<=yt.untreeifyThreshold&&(this.hashTable[i]=new q(n))))},mt.prototype.find=function(t){var e=this.hashFunc(t)&this.bucketNum-1,e=this.hashTable[e];return!!e&&!e.find(t).equals(e.end())},mt.prototype[Symbol.iterator]=function(){return function(){var e,r,i,n,o,h,s,a,u;return l(this,function(t){switch(t.label){case 0:e=Object.values(this.hashTable),r=e.length,i=0,t.label=1;case 1:if(!(i<r))return[3,10];n=e[i],t.label=2;case 2:t.trys.push([2,7,8,9]),a=void 0,o=c(n),h=o.next(),t.label=3;case 3:return h.done?[3,6]:[4,h.value];case 4:t.sent(),t.label=5;case 5:return h=o.next(),[3,3];case 6:return[3,9];case 7:return s=t.sent(),a={error:s},[3,9];case 8:try{h&&!h.done&&(u=o.return)&&u.call(o)}finally{if(a)throw a.error}return[7];case 9:return++i,[3,1];case 10:return[2]}})}.bind(this)()},mt);function mt(t,e,r){void 0===t&&(t=[]);var i=gt.call(this,e,r)||this;return i.hashTable=[],t.forEach(function(t){return i.insert(t)}),i}var Et,n=(e(bt,Et=yt),bt.prototype.reAllocate=function(){var o=this;if(!(this.bucketNum>=yt.maxBucketNum)){var h=[],s=this.bucketNum;this.bucketNum<<=1;for(var a=Object.keys(this.hashTable),t=a.length,u=this,e=0;e<t;++e)!function(t){var e=parseInt(a[t]),r=u.hashTable[e],t=r.size();if(0===t)return;if(1===t){t=r.front();return h[u.hashFunc(t[0])&u.bucketNum-1]=new q([t],!1)}var i=[],n=[];r.forEach(function(t){(0==(o.hashFunc(t[0])&s)?i:n).push(t)}),r instanceof ft?(i.length>yt.untreeifyThreshold?h[e]=new ft(i):i.length&&(h[e]=new q(i,!1)),n.length>yt.untreeifyThreshold?h[e+s]=new ft(n):n.length&&(h[e+s]=new q(n,!1))):(i.length>=yt.treeifyThreshold?h[e]=new ft(i):i.length&&(h[e]=new q(i,!1)),n.length>=yt.treeifyThreshold?h[e+s]=new ft(n):n.length&&(h[e+s]=new q(n,!1)))}(e);this.hashTable=h}},bt.prototype.forEach=function(e){for(var t=Object.values(this.hashTable),r=t.length,i=0,n=0;n<r;++n)t[n].forEach(function(t){return e(t,i++)})},bt.prototype.setElement=function(t,e){var r,i,n=this.hashFunc(t)&this.bucketNum-1,o=this.hashTable[n];if(o){var h=o.size();if(o instanceof q){try{for(var s=c(o),a=s.next();!a.done;a=s.next()){var u=a.value;if(u[0]===t)return void(u[1]=e)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}if(o.pushBack([t,e]),bt.treeifyThreshold<=h+1){if(this.bucketNum<=bt.minTreeifySize)return this.length+=1,void this.reAllocate();this.hashTable[n]=new ft(this.hashTable[n])}this.length+=1}else{o.setElement(t,e);o=o.size();this.length+=o-h}}else this.length+=1,this.hashTable[n]=new q([[t,e]],!1);this.length>this.bucketNum*bt.sigma&&this.reAllocate()},bt.prototype.getElementByKey=function(t){var e,r,i=this.hashFunc(t)&this.bucketNum-1,i=this.hashTable[i];if(i){if(i instanceof ft)return i.getElementByKey(t);try{for(var n=c(i),o=n.next();!o.done;o=n.next()){var h=o.value;if(h[0]===t)return h[1]}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}}},bt.prototype.eraseElementByKey=function(t){var e=this.hashFunc(t)&this.bucketNum-1,r=this.hashTable[e];if(r)if(r instanceof q){var i=0;try{for(var n=c(r),o=n.next();!o.done;o=n.next()){if(o.value[0]===t)return r.eraseElementByPos(i),void--this.length;i+=1}}catch(t){s={error:t}}finally{try{o&&!o.done&&(h=n.return)&&h.call(n)}finally{if(s)throw s.error}}}else{var h=r.size();r.eraseElementByKey(t);var s=r.size();this.length+=s-h,s<=yt.untreeifyThreshold&&(this.hashTable[e]=new q(r))}},bt.prototype.find=function(t){var e,r,i=this.hashFunc(t)&this.bucketNum-1,i=this.hashTable[i];if(!i)return!1;if(i instanceof ft)return!i.find(t).equals(i.end());try{for(var n=c(i),o=n.next();!o.done;o=n.next())if(o.value[0]===t)return!0}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return!1},bt.prototype[Symbol.iterator]=function(){return function(){var e,r,i,n,o,h,s,a,u;return l(this,function(t){switch(t.label){case 0:e=Object.values(this.hashTable),r=e.length,i=0,t.label=1;case 1:if(!(i<r))return[3,10];n=e[i],t.label=2;case 2:t.trys.push([2,7,8,9]),a=void 0,o=c(n),h=o.next(),t.label=3;case 3:return h.done?[3,6]:[4,h.value];case 4:t.sent(),t.label=5;case 5:return h=o.next(),[3,3];case 6:return[3,9];case 7:return s=t.sent(),a={error:s},[3,9];case 8:try{h&&!h.done&&(u=o.return)&&u.call(o)}finally{if(a)throw a.error}return[7];case 9:return++i,[3,1];case 10:return[2]}})}.bind(this)()},bt);function bt(t,e,r){void 0===t&&(t=[]);var i=Et.call(this,e,r)||this;return i.hashTable=[],t.forEach(function(t){return i.setElement(t[0],t[1])}),i}t.Container=a,t.ContainerIterator=o,t.Deque=N,t.DequeIterator=P,t.HashContainer=yt,t.HashMap=n,t.HashSet=w,t.LinkList=G,t.LinkListIterator=V,t.OrderedMap=ft,t.OrderedMapIterator=ut,t.OrderedSet=ht,t.OrderedSetIterator=it,t.PriorityQueue=Q,t.Queue=S,t.SequentialContainer=m,t.Stack=y,t.TreeContainer=Z,t.Vector=q,t.VectorIterator=K,Object.defineProperty(t,"__esModule",{value:!0})});