26 lines
64 KiB
26 lines
64 KiB
2 months ago
|
/**
|
||
|
* @license
|
||
|
* MIT License
|
||
|
*
|
||
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
||
|
*
|
||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
|
* of this software and associated documentation files (the "Software"), to deal
|
||
|
* in the Software without restriction, including without limitation the rights
|
||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
|
* copies of the Software, and to permit persons to whom the Software is
|
||
|
* furnished to do so, subject to the following conditions:
|
||
|
*
|
||
|
* The above copyright notice and this permission notice shall be included in all
|
||
|
* copies or substantial portions of the Software.
|
||
|
*
|
||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
|
* SOFTWARE.
|
||
|
*/
|
||
|
!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).Immutable={})}(this,(function(t){"use strict";var e="delete",r=5,n=1<<r,i=n-1,o={};function u(t){t&&(t.value=!0)}function s(){}function a(t){return void 0===t.size&&(t.size=t.__iterate(f)),t.size}function c(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?a(t)+e:e}function f(){return!0}function h(t,e,r){return(0===t&&!v(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function p(t,e){return l(t,e,0)}function _(t,e){return l(t,e,e)}function l(t,e,r){return void 0===t?r:v(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function v(t){return t<0||0===t&&1/t==-1/0}var y="@@__IMMUTABLE_ITERABLE__@@";function d(t){return Boolean(t&&t[y])}var g="@@__IMMUTABLE_KEYED__@@";function w(t){return Boolean(t&&t[g])}var m="@@__IMMUTABLE_INDEXED__@@";function z(t){return Boolean(t&&t[m])}function S(t){return w(t)||z(t)}var b=function(t){return d(t)?t:X(t)},I=function(t){function e(t){return w(t)?t:F(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),O=function(t){function e(t){return z(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),E=function(t){function e(t){return d(t)&&!S(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b);b.Keyed=I,b.Indexed=O,b.Set=E;var q="@@__IMMUTABLE_SEQ__@@";function j(t){return Boolean(t&&t[q])}var M="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[M])}function x(t){return d(t)||D(t)}var A="@@__IMMUTABLE_ORDERED__@@";function k(t){return Boolean(t&&t[A])}var R=0,U=1,T=2,B="function"==typeof Symbol&&Symbol.iterator,K="@@iterator",L=B||K,C=function(t){this.next=t};function P(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function W(){return{value:void 0,done:!0}}function N(t){return!!Array.isArray(t)||!!V(t)}function H(t){return t&&"function"==typeof t.next}function J(t){var e=V(t);return e&&e.call(t)}function V(t){var e=t&&(B&&t[B]||t[K]);if("function"==typeof e)return e}C.prototype.toString=function(){return"[Iterator]"},C.KEYS=R,C.VALUES=U,C.ENTRIES=T,C.prototype.inspect=C.prototype.toSource=function(){return this.toString()},C.prototype[L]=function(){return this};var Y=Object.prototype.hasOwnProperty;function Q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var X=function(t){function e(t){return null==t?nt():x(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=V(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=V(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new C((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return P(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(b),F=function(t){function e(t){return null==t?nt().toKeyedSeq():d(t)?w(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=funct
|