@mapbox/mapbox-gl-style-spec 14.2.0-beta.1 → 14.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -8787,1177 +8787,6 @@
8787
8787
  return stringify(style, { indent: space });
8788
8788
  }
8789
8789
 
8790
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8791
-
8792
- function getDefaultExportFromCjs (x) {
8793
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
8794
- }
8795
-
8796
- var url = {};
8797
-
8798
- var punycode$1 = {exports: {}};
8799
-
8800
- /*! https://mths.be/punycode v1.3.2 by @mathias */
8801
- punycode$1.exports;
8802
-
8803
- (function (module, exports) {
8804
- (function (root) {
8805
- /** Detect free variables */
8806
- var freeExports = exports && !exports.nodeType && exports;
8807
- var freeModule = module && !module.nodeType && module;
8808
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
8809
- if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
8810
- root = freeGlobal;
8811
- }
8812
- /**
8813
- * The `punycode` object.
8814
- * @name punycode
8815
- * @type Object
8816
- */
8817
- var punycode,
8818
- /** Highest positive signed 32-bit float value */
8819
- maxInt = 2147483647,
8820
- // aka. 0x7FFFFFFF or 2^31-1
8821
- /** Bootstring parameters */
8822
- base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128,
8823
- // 0x80
8824
- delimiter = '-',
8825
- // '\x2D'
8826
- /** Regular expressions */
8827
- regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/,
8828
- // unprintable ASCII chars + non-ASCII chars
8829
- regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g,
8830
- // RFC 3490 separators
8831
- /** Error messages */
8832
- errors = {
8833
- 'overflow': 'Overflow: input needs wider integers to process',
8834
- 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
8835
- 'invalid-input': 'Invalid input'
8836
- },
8837
- /** Convenience shortcuts */
8838
- baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode,
8839
- /** Temporary variable */
8840
- key;
8841
- /*--------------------------------------------------------------------------*/
8842
- /**
8843
- * A generic error utility function.
8844
- * @private
8845
- * @param {String} type The error type.
8846
- * @returns {Error} Throws a `RangeError` with the applicable error message.
8847
- */
8848
- function error(type) {
8849
- throw RangeError(errors[type]);
8850
- }
8851
- /**
8852
- * A generic `Array#map` utility function.
8853
- * @private
8854
- * @param {Array} array The array to iterate over.
8855
- * @param {Function} callback The function that gets called for every array
8856
- * item.
8857
- * @returns {Array} A new array of values returned by the callback function.
8858
- */
8859
- function map(array, fn) {
8860
- var length = array.length;
8861
- var result = [];
8862
- while (length--) {
8863
- result[length] = fn(array[length]);
8864
- }
8865
- return result;
8866
- }
8867
- /**
8868
- * A simple `Array#map`-like wrapper to work with domain name strings or email
8869
- * addresses.
8870
- * @private
8871
- * @param {String} domain The domain name or email address.
8872
- * @param {Function} callback The function that gets called for every
8873
- * character.
8874
- * @returns {Array} A new string of characters returned by the callback
8875
- * function.
8876
- */
8877
- function mapDomain(string, fn) {
8878
- var parts = string.split('@');
8879
- var result = '';
8880
- if (parts.length > 1) {
8881
- // In email addresses, only the domain name should be punycoded. Leave
8882
- // the local part (i.e. everything up to `@`) intact.
8883
- result = parts[0] + '@';
8884
- string = parts[1];
8885
- }
8886
- // Avoid `split(regex)` for IE8 compatibility. See #17.
8887
- string = string.replace(regexSeparators, '.');
8888
- var labels = string.split('.');
8889
- var encoded = map(labels, fn).join('.');
8890
- return result + encoded;
8891
- }
8892
- /**
8893
- * Creates an array containing the numeric code points of each Unicode
8894
- * character in the string. While JavaScript uses UCS-2 internally,
8895
- * this function will convert a pair of surrogate halves (each of which
8896
- * UCS-2 exposes as separate characters) into a single code point,
8897
- * matching UTF-16.
8898
- * @see `punycode.ucs2.encode`
8899
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
8900
- * @memberOf punycode.ucs2
8901
- * @name decode
8902
- * @param {String} string The Unicode input string (UCS-2).
8903
- * @returns {Array} The new array of code points.
8904
- */
8905
- function ucs2decode(string) {
8906
- var output = [], counter = 0, length = string.length, value, extra;
8907
- while (counter < length) {
8908
- value = string.charCodeAt(counter++);
8909
- if (value >= 55296 && value <= 56319 && counter < length) {
8910
- // high surrogate, and there is a next character
8911
- extra = string.charCodeAt(counter++);
8912
- if ((extra & 64512) == 56320) {
8913
- // low surrogate
8914
- output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
8915
- } else {
8916
- // unmatched surrogate; only append this code unit, in case the next
8917
- // code unit is the high surrogate of a surrogate pair
8918
- output.push(value);
8919
- counter--;
8920
- }
8921
- } else {
8922
- output.push(value);
8923
- }
8924
- }
8925
- return output;
8926
- }
8927
- /**
8928
- * Creates a string based on an array of numeric code points.
8929
- * @see `punycode.ucs2.decode`
8930
- * @memberOf punycode.ucs2
8931
- * @name encode
8932
- * @param {Array} codePoints The array of numeric code points.
8933
- * @returns {String} The new Unicode string (UCS-2).
8934
- */
8935
- function ucs2encode(array) {
8936
- return map(array, function (value) {
8937
- var output = '';
8938
- if (value > 65535) {
8939
- value -= 65536;
8940
- output += stringFromCharCode(value >>> 10 & 1023 | 55296);
8941
- value = 56320 | value & 1023;
8942
- }
8943
- output += stringFromCharCode(value);
8944
- return output;
8945
- }).join('');
8946
- }
8947
- /**
8948
- * Converts a basic code point into a digit/integer.
8949
- * @see `digitToBasic()`
8950
- * @private
8951
- * @param {Number} codePoint The basic numeric code point value.
8952
- * @returns {Number} The numeric value of a basic code point (for use in
8953
- * representing integers) in the range `0` to `base - 1`, or `base` if
8954
- * the code point does not represent a value.
8955
- */
8956
- function basicToDigit(codePoint) {
8957
- if (codePoint - 48 < 10) {
8958
- return codePoint - 22;
8959
- }
8960
- if (codePoint - 65 < 26) {
8961
- return codePoint - 65;
8962
- }
8963
- if (codePoint - 97 < 26) {
8964
- return codePoint - 97;
8965
- }
8966
- return base;
8967
- }
8968
- /**
8969
- * Converts a digit/integer into a basic code point.
8970
- * @see `basicToDigit()`
8971
- * @private
8972
- * @param {Number} digit The numeric value of a basic code point.
8973
- * @returns {Number} The basic code point whose value (when used for
8974
- * representing integers) is `digit`, which needs to be in the range
8975
- * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
8976
- * used; else, the lowercase form is used. The behavior is undefined
8977
- * if `flag` is non-zero and `digit` has no uppercase form.
8978
- */
8979
- function digitToBasic(digit, flag) {
8980
- // 0..25 map to ASCII a..z or A..Z
8981
- // 26..35 map to ASCII 0..9
8982
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
8983
- }
8984
- /**
8985
- * Bias adaptation function as per section 3.4 of RFC 3492.
8986
- * http://tools.ietf.org/html/rfc3492#section-3.4
8987
- * @private
8988
- */
8989
- function adapt(delta, numPoints, firstTime) {
8990
- var k = 0;
8991
- delta = firstTime ? floor(delta / damp) : delta >> 1;
8992
- delta += floor(delta / numPoints);
8993
- for (; delta > baseMinusTMin * tMax >> 1; k += base) {
8994
- delta = floor(delta / baseMinusTMin);
8995
- }
8996
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
8997
- }
8998
- /**
8999
- * Converts a Punycode string of ASCII-only symbols to a string of Unicode
9000
- * symbols.
9001
- * @memberOf punycode
9002
- * @param {String} input The Punycode string of ASCII-only symbols.
9003
- * @returns {String} The resulting string of Unicode symbols.
9004
- */
9005
- function decode(input) {
9006
- // Don't use UCS-2
9007
- var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t,
9008
- /** Cached calculation results */
9009
- baseMinusT;
9010
- // Handle the basic code points: let `basic` be the number of input code
9011
- // points before the last delimiter, or `0` if there is none, then copy
9012
- // the first basic code points to the output.
9013
- basic = input.lastIndexOf(delimiter);
9014
- if (basic < 0) {
9015
- basic = 0;
9016
- }
9017
- for (j = 0; j < basic; ++j) {
9018
- // if it's not a basic code point
9019
- if (input.charCodeAt(j) >= 128) {
9020
- error('not-basic');
9021
- }
9022
- output.push(input.charCodeAt(j));
9023
- }
9024
- // Main decoding loop: start just after the last delimiter if any basic code
9025
- // points were copied; start at the beginning otherwise.
9026
- for (index = basic > 0 ? basic + 1 : 0; index < inputLength;) {
9027
- // `index` is the index of the next character to be consumed.
9028
- // Decode a generalized variable-length integer into `delta`,
9029
- // which gets added to `i`. The overflow checking is easier
9030
- // if we increase `i` as we go, then subtract off its starting
9031
- // value at the end to obtain `delta`.
9032
- for (oldi = i, w = 1, k = base;; k += base) {
9033
- if (index >= inputLength) {
9034
- error('invalid-input');
9035
- }
9036
- digit = basicToDigit(input.charCodeAt(index++));
9037
- if (digit >= base || digit > floor((maxInt - i) / w)) {
9038
- error('overflow');
9039
- }
9040
- i += digit * w;
9041
- t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
9042
- if (digit < t) {
9043
- break;
9044
- }
9045
- baseMinusT = base - t;
9046
- if (w > floor(maxInt / baseMinusT)) {
9047
- error('overflow');
9048
- }
9049
- w *= baseMinusT;
9050
- }
9051
- out = output.length + 1;
9052
- bias = adapt(i - oldi, out, oldi == 0);
9053
- // `i` was supposed to wrap around from `out` to `0`,
9054
- // incrementing `n` each time, so we'll fix that now:
9055
- if (floor(i / out) > maxInt - n) {
9056
- error('overflow');
9057
- }
9058
- n += floor(i / out);
9059
- i %= out;
9060
- // Insert `n` at position `i` of the output
9061
- output.splice(i++, 0, n);
9062
- }
9063
- return ucs2encode(output);
9064
- }
9065
- /**
9066
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
9067
- * Punycode string of ASCII-only symbols.
9068
- * @memberOf punycode
9069
- * @param {String} input The string of Unicode symbols.
9070
- * @returns {String} The resulting Punycode string of ASCII-only symbols.
9071
- */
9072
- function encode(input) {
9073
- var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [],
9074
- /** `inputLength` will hold the number of code points in `input`. */
9075
- inputLength,
9076
- /** Cached calculation results */
9077
- handledCPCountPlusOne, baseMinusT, qMinusT;
9078
- // Convert the input in UCS-2 to Unicode
9079
- input = ucs2decode(input);
9080
- // Cache the length
9081
- inputLength = input.length;
9082
- // Initialize the state
9083
- n = initialN;
9084
- delta = 0;
9085
- bias = initialBias;
9086
- // Handle the basic code points
9087
- for (j = 0; j < inputLength; ++j) {
9088
- currentValue = input[j];
9089
- if (currentValue < 128) {
9090
- output.push(stringFromCharCode(currentValue));
9091
- }
9092
- }
9093
- handledCPCount = basicLength = output.length;
9094
- // `handledCPCount` is the number of code points that have been handled;
9095
- // `basicLength` is the number of basic code points.
9096
- // Finish the basic string - if it is not empty - with a delimiter
9097
- if (basicLength) {
9098
- output.push(delimiter);
9099
- }
9100
- // Main encoding loop:
9101
- while (handledCPCount < inputLength) {
9102
- // All non-basic code points < n have been handled already. Find the next
9103
- // larger one:
9104
- for (m = maxInt, j = 0; j < inputLength; ++j) {
9105
- currentValue = input[j];
9106
- if (currentValue >= n && currentValue < m) {
9107
- m = currentValue;
9108
- }
9109
- }
9110
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
9111
- // but guard against overflow
9112
- handledCPCountPlusOne = handledCPCount + 1;
9113
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
9114
- error('overflow');
9115
- }
9116
- delta += (m - n) * handledCPCountPlusOne;
9117
- n = m;
9118
- for (j = 0; j < inputLength; ++j) {
9119
- currentValue = input[j];
9120
- if (currentValue < n && ++delta > maxInt) {
9121
- error('overflow');
9122
- }
9123
- if (currentValue == n) {
9124
- // Represent delta as a generalized variable-length integer
9125
- for (q = delta, k = base;; k += base) {
9126
- t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
9127
- if (q < t) {
9128
- break;
9129
- }
9130
- qMinusT = q - t;
9131
- baseMinusT = base - t;
9132
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
9133
- q = floor(qMinusT / baseMinusT);
9134
- }
9135
- output.push(stringFromCharCode(digitToBasic(q, 0)));
9136
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
9137
- delta = 0;
9138
- ++handledCPCount;
9139
- }
9140
- }
9141
- ++delta;
9142
- ++n;
9143
- }
9144
- return output.join('');
9145
- }
9146
- /**
9147
- * Converts a Punycode string representing a domain name or an email address
9148
- * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
9149
- * it doesn't matter if you call it on a string that has already been
9150
- * converted to Unicode.
9151
- * @memberOf punycode
9152
- * @param {String} input The Punycoded domain name or email address to
9153
- * convert to Unicode.
9154
- * @returns {String} The Unicode representation of the given Punycode
9155
- * string.
9156
- */
9157
- function toUnicode(input) {
9158
- return mapDomain(input, function (string) {
9159
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
9160
- });
9161
- }
9162
- /**
9163
- * Converts a Unicode string representing a domain name or an email address to
9164
- * Punycode. Only the non-ASCII parts of the domain name will be converted,
9165
- * i.e. it doesn't matter if you call it with a domain that's already in
9166
- * ASCII.
9167
- * @memberOf punycode
9168
- * @param {String} input The domain name or email address to convert, as a
9169
- * Unicode string.
9170
- * @returns {String} The Punycode representation of the given domain name or
9171
- * email address.
9172
- */
9173
- function toASCII(input) {
9174
- return mapDomain(input, function (string) {
9175
- return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
9176
- });
9177
- }
9178
- /*--------------------------------------------------------------------------*/
9179
- /** Define the public API */
9180
- punycode = {
9181
- /**
9182
- * A string representing the current Punycode.js version number.
9183
- * @memberOf punycode
9184
- * @type String
9185
- */
9186
- 'version': '1.3.2',
9187
- /**
9188
- * An object of methods to convert from JavaScript's internal character
9189
- * representation (UCS-2) to Unicode code points, and back.
9190
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
9191
- * @memberOf punycode
9192
- * @type Object
9193
- */
9194
- 'ucs2': {
9195
- 'decode': ucs2decode,
9196
- 'encode': ucs2encode
9197
- },
9198
- 'decode': decode,
9199
- 'encode': encode,
9200
- 'toASCII': toASCII,
9201
- 'toUnicode': toUnicode
9202
- };
9203
- /** Expose `punycode` */
9204
- // Some AMD build optimizers, like r.js, check for specific condition patterns
9205
- // like the following:
9206
- if (freeExports && freeModule) {
9207
- if (module.exports == freeExports) {
9208
- // in Node.js or RingoJS v0.8.0+
9209
- freeModule.exports = punycode;
9210
- } else {
9211
- // in Narwhal or RingoJS v0.7.0-
9212
- for (key in punycode) {
9213
- punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
9214
- }
9215
- }
9216
- } else {
9217
- // in Rhino or a web browser
9218
- root.punycode = punycode;
9219
- }
9220
- }(commonjsGlobal));
9221
- } (punycode$1, punycode$1.exports));
9222
-
9223
- var punycodeExports = punycode$1.exports;
9224
-
9225
- var util$1 = {
9226
- isString: function (arg) {
9227
- return typeof arg === 'string';
9228
- },
9229
- isObject: function (arg) {
9230
- return typeof arg === 'object' && arg !== null;
9231
- },
9232
- isNull: function (arg) {
9233
- return arg === null;
9234
- },
9235
- isNullOrUndefined: function (arg) {
9236
- return arg == null;
9237
- }
9238
- };
9239
-
9240
- var querystring$1 = {};
9241
-
9242
- // If obj.hasOwnProperty has been overridden, then calling
9243
- // obj.hasOwnProperty(prop) will break.
9244
- // See: https://github.com/joyent/node/issues/1707
9245
- function hasOwnProperty(obj, prop) {
9246
- return Object.prototype.hasOwnProperty.call(obj, prop);
9247
- }
9248
- var decode = function (qs, sep, eq, options) {
9249
- sep = sep || '&';
9250
- eq = eq || '=';
9251
- var obj = {};
9252
- if (typeof qs !== 'string' || qs.length === 0) {
9253
- return obj;
9254
- }
9255
- var regexp = /\+/g;
9256
- qs = qs.split(sep);
9257
- var maxKeys = 1000;
9258
- if (options && typeof options.maxKeys === 'number') {
9259
- maxKeys = options.maxKeys;
9260
- }
9261
- var len = qs.length;
9262
- // maxKeys <= 0 means that we should not limit keys count
9263
- if (maxKeys > 0 && len > maxKeys) {
9264
- len = maxKeys;
9265
- }
9266
- for (var i = 0; i < len; ++i) {
9267
- var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v;
9268
- if (idx >= 0) {
9269
- kstr = x.substr(0, idx);
9270
- vstr = x.substr(idx + 1);
9271
- } else {
9272
- kstr = x;
9273
- vstr = '';
9274
- }
9275
- k = decodeURIComponent(kstr);
9276
- v = decodeURIComponent(vstr);
9277
- if (!hasOwnProperty(obj, k)) {
9278
- obj[k] = v;
9279
- } else if (Array.isArray(obj[k])) {
9280
- obj[k].push(v);
9281
- } else {
9282
- obj[k] = [
9283
- obj[k],
9284
- v
9285
- ];
9286
- }
9287
- }
9288
- return obj;
9289
- };
9290
-
9291
- var stringifyPrimitive = function (v) {
9292
- switch (typeof v) {
9293
- case 'string':
9294
- return v;
9295
- case 'boolean':
9296
- return v ? 'true' : 'false';
9297
- case 'number':
9298
- return isFinite(v) ? v : '';
9299
- default:
9300
- return '';
9301
- }
9302
- };
9303
- var encode = function (obj, sep, eq, name) {
9304
- sep = sep || '&';
9305
- eq = eq || '=';
9306
- if (obj === null) {
9307
- obj = undefined;
9308
- }
9309
- if (typeof obj === 'object') {
9310
- return Object.keys(obj).map(function (k) {
9311
- var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
9312
- if (Array.isArray(obj[k])) {
9313
- return obj[k].map(function (v) {
9314
- return ks + encodeURIComponent(stringifyPrimitive(v));
9315
- }).join(sep);
9316
- } else {
9317
- return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
9318
- }
9319
- }).join(sep);
9320
- }
9321
- if (!name)
9322
- return '';
9323
- return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
9324
- };
9325
-
9326
- querystring$1.decode = querystring$1.parse = decode;
9327
- querystring$1.encode = querystring$1.stringify = encode;
9328
-
9329
- var punycode = punycodeExports;
9330
- var util = util$1;
9331
- url.parse = urlParse;
9332
- url.resolve = urlResolve;
9333
- url.resolveObject = urlResolveObject;
9334
- url.format = urlFormat;
9335
- url.Url = Url;
9336
- function Url() {
9337
- this.protocol = null;
9338
- this.slashes = null;
9339
- this.auth = null;
9340
- this.host = null;
9341
- this.port = null;
9342
- this.hostname = null;
9343
- this.hash = null;
9344
- this.search = null;
9345
- this.query = null;
9346
- this.pathname = null;
9347
- this.path = null;
9348
- this.href = null;
9349
- }
9350
- // Reference: RFC 3986, RFC 1808, RFC 2396
9351
- // define these here so at least they only have to be
9352
- // compiled once on the first module load.
9353
- var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/,
9354
- // Special case for a simple path URL
9355
- simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
9356
- // RFC 2396: characters reserved for delimiting URLs.
9357
- // We actually just auto-escape these.
9358
- delims = [
9359
- '<',
9360
- '>',
9361
- '"',
9362
- '`',
9363
- ' ',
9364
- '\r',
9365
- '\n',
9366
- '\t'
9367
- ],
9368
- // RFC 2396: characters not allowed for various reasons.
9369
- unwise = [
9370
- '{',
9371
- '}',
9372
- '|',
9373
- '\\',
9374
- '^',
9375
- '`'
9376
- ].concat(delims),
9377
- // Allowed by RFCs, but cause of XSS attacks. Always escape these.
9378
- autoEscape = ['\''].concat(unwise),
9379
- // Characters that are never ever allowed in a hostname.
9380
- // Note that any invalid chars are also handled, but these
9381
- // are the ones that are *expected* to be seen, so we fast-path
9382
- // them.
9383
- nonHostChars = [
9384
- '%',
9385
- '/',
9386
- '?',
9387
- ';',
9388
- '#'
9389
- ].concat(autoEscape), hostEndingChars = [
9390
- '/',
9391
- '?',
9392
- '#'
9393
- ], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
9394
- // protocols that can allow "unsafe" and "unwise" chars.
9395
- unsafeProtocol = {
9396
- 'javascript': true,
9397
- 'javascript:': true
9398
- },
9399
- // protocols that never have a hostname.
9400
- hostlessProtocol = {
9401
- 'javascript': true,
9402
- 'javascript:': true
9403
- },
9404
- // protocols that always contain a // bit.
9405
- slashedProtocol = {
9406
- 'http': true,
9407
- 'https': true,
9408
- 'ftp': true,
9409
- 'gopher': true,
9410
- 'file': true,
9411
- 'http:': true,
9412
- 'https:': true,
9413
- 'ftp:': true,
9414
- 'gopher:': true,
9415
- 'file:': true
9416
- }, querystring = querystring$1;
9417
- function urlParse(url, parseQueryString, slashesDenoteHost) {
9418
- if (url && util.isObject(url) && url instanceof Url)
9419
- return url;
9420
- var u = new Url();
9421
- u.parse(url, parseQueryString, slashesDenoteHost);
9422
- return u;
9423
- }
9424
- Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) {
9425
- if (!util.isString(url)) {
9426
- throw new TypeError('Parameter \'url\' must be a string, not ' + typeof url);
9427
- }
9428
- // Copy chrome, IE, opera backslash-handling behavior.
9429
- // Back slashes before the query string get converted to forward slashes
9430
- // See: https://code.google.com/p/chromium/issues/detail?id=25916
9431
- var queryIndex = url.indexOf('?'), splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#', uSplit = url.split(splitter), slashRegex = /\\/g;
9432
- uSplit[0] = uSplit[0].replace(slashRegex, '/');
9433
- url = uSplit.join(splitter);
9434
- var rest = url;
9435
- // trim before proceeding.
9436
- // This is to support parse stuff like " http://foo.com \n"
9437
- rest = rest.trim();
9438
- if (!slashesDenoteHost && url.split('#').length === 1) {
9439
- // Try fast path regexp
9440
- var simplePath = simplePathPattern.exec(rest);
9441
- if (simplePath) {
9442
- this.path = rest;
9443
- this.href = rest;
9444
- this.pathname = simplePath[1];
9445
- if (simplePath[2]) {
9446
- this.search = simplePath[2];
9447
- if (parseQueryString) {
9448
- this.query = querystring.parse(this.search.substr(1));
9449
- } else {
9450
- this.query = this.search.substr(1);
9451
- }
9452
- } else if (parseQueryString) {
9453
- this.search = '';
9454
- this.query = {};
9455
- }
9456
- return this;
9457
- }
9458
- }
9459
- var proto = protocolPattern.exec(rest);
9460
- if (proto) {
9461
- proto = proto[0];
9462
- var lowerProto = proto.toLowerCase();
9463
- this.protocol = lowerProto;
9464
- rest = rest.substr(proto.length);
9465
- }
9466
- // figure out if it's got a host
9467
- // user@server is *always* interpreted as a hostname, and url
9468
- // resolution will treat //foo/bar as host=foo,path=bar because that's
9469
- // how the browser resolves relative URLs.
9470
- if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
9471
- var slashes = rest.substr(0, 2) === '//';
9472
- if (slashes && !(proto && hostlessProtocol[proto])) {
9473
- rest = rest.substr(2);
9474
- this.slashes = true;
9475
- }
9476
- }
9477
- if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
9478
- // there's a hostname.
9479
- // the first instance of /, ?, ;, or # ends the host.
9480
- //
9481
- // If there is an @ in the hostname, then non-host chars *are* allowed
9482
- // to the left of the last @ sign, unless some host-ending character
9483
- // comes *before* the @-sign.
9484
- // URLs are obnoxious.
9485
- //
9486
- // ex:
9487
- // http://a@b@c/ => user:a@b host:c
9488
- // http://a@b?@c => user:a host:c path:/?@c
9489
- // v0.12 TODO(isaacs): This is not quite how Chrome does things.
9490
- // Review our test case against browsers more comprehensively.
9491
- // find the first instance of any hostEndingChars
9492
- var hostEnd = -1;
9493
- for (var i = 0; i < hostEndingChars.length; i++) {
9494
- var hec = rest.indexOf(hostEndingChars[i]);
9495
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
9496
- hostEnd = hec;
9497
- }
9498
- // at this point, either we have an explicit point where the
9499
- // auth portion cannot go past, or the last @ char is the decider.
9500
- var auth, atSign;
9501
- if (hostEnd === -1) {
9502
- // atSign can be anywhere.
9503
- atSign = rest.lastIndexOf('@');
9504
- } else {
9505
- // atSign must be in auth portion.
9506
- // http://a@b/c@d => host:b auth:a path:/c@d
9507
- atSign = rest.lastIndexOf('@', hostEnd);
9508
- }
9509
- // Now we have a portion which is definitely the auth.
9510
- // Pull that off.
9511
- if (atSign !== -1) {
9512
- auth = rest.slice(0, atSign);
9513
- rest = rest.slice(atSign + 1);
9514
- this.auth = decodeURIComponent(auth);
9515
- }
9516
- // the host is the remaining to the left of the first non-host char
9517
- hostEnd = -1;
9518
- for (var i = 0; i < nonHostChars.length; i++) {
9519
- var hec = rest.indexOf(nonHostChars[i]);
9520
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
9521
- hostEnd = hec;
9522
- }
9523
- // if we still have not hit it, then the entire thing is a host.
9524
- if (hostEnd === -1)
9525
- hostEnd = rest.length;
9526
- this.host = rest.slice(0, hostEnd);
9527
- rest = rest.slice(hostEnd);
9528
- // pull out port.
9529
- this.parseHost();
9530
- // we've indicated that there is a hostname,
9531
- // so even if it's empty, it has to be present.
9532
- this.hostname = this.hostname || '';
9533
- // if hostname begins with [ and ends with ]
9534
- // assume that it's an IPv6 address.
9535
- var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']';
9536
- // validate a little.
9537
- if (!ipv6Hostname) {
9538
- var hostparts = this.hostname.split(/\./);
9539
- for (var i = 0, l = hostparts.length; i < l; i++) {
9540
- var part = hostparts[i];
9541
- if (!part)
9542
- continue;
9543
- if (!part.match(hostnamePartPattern)) {
9544
- var newpart = '';
9545
- for (var j = 0, k = part.length; j < k; j++) {
9546
- if (part.charCodeAt(j) > 127) {
9547
- // we replace non-ASCII char with a temporary placeholder
9548
- // we need this to make sure size of hostname is not
9549
- // broken by replacing non-ASCII by nothing
9550
- newpart += 'x';
9551
- } else {
9552
- newpart += part[j];
9553
- }
9554
- }
9555
- // we test again with ASCII char only
9556
- if (!newpart.match(hostnamePartPattern)) {
9557
- var validParts = hostparts.slice(0, i);
9558
- var notHost = hostparts.slice(i + 1);
9559
- var bit = part.match(hostnamePartStart);
9560
- if (bit) {
9561
- validParts.push(bit[1]);
9562
- notHost.unshift(bit[2]);
9563
- }
9564
- if (notHost.length) {
9565
- rest = '/' + notHost.join('.') + rest;
9566
- }
9567
- this.hostname = validParts.join('.');
9568
- break;
9569
- }
9570
- }
9571
- }
9572
- }
9573
- if (this.hostname.length > hostnameMaxLen) {
9574
- this.hostname = '';
9575
- } else {
9576
- // hostnames are always lower case.
9577
- this.hostname = this.hostname.toLowerCase();
9578
- }
9579
- if (!ipv6Hostname) {
9580
- // IDNA Support: Returns a punycoded representation of "domain".
9581
- // It only converts parts of the domain name that
9582
- // have non-ASCII characters, i.e. it doesn't matter if
9583
- // you call it with a domain that already is ASCII-only.
9584
- this.hostname = punycode.toASCII(this.hostname);
9585
- }
9586
- var p = this.port ? ':' + this.port : '';
9587
- var h = this.hostname || '';
9588
- this.host = h + p;
9589
- this.href += this.host;
9590
- // strip [ and ] from the hostname
9591
- // the host field still retains them, though
9592
- if (ipv6Hostname) {
9593
- this.hostname = this.hostname.substr(1, this.hostname.length - 2);
9594
- if (rest[0] !== '/') {
9595
- rest = '/' + rest;
9596
- }
9597
- }
9598
- }
9599
- // now rest is set to the post-host stuff.
9600
- // chop off any delim chars.
9601
- if (!unsafeProtocol[lowerProto]) {
9602
- // First, make 100% sure that any "autoEscape" chars get
9603
- // escaped, even if encodeURIComponent doesn't think they
9604
- // need to be.
9605
- for (var i = 0, l = autoEscape.length; i < l; i++) {
9606
- var ae = autoEscape[i];
9607
- if (rest.indexOf(ae) === -1)
9608
- continue;
9609
- var esc = encodeURIComponent(ae);
9610
- if (esc === ae) {
9611
- esc = escape(ae);
9612
- }
9613
- rest = rest.split(ae).join(esc);
9614
- }
9615
- }
9616
- // chop off from the tail first.
9617
- var hash = rest.indexOf('#');
9618
- if (hash !== -1) {
9619
- // got a fragment string.
9620
- this.hash = rest.substr(hash);
9621
- rest = rest.slice(0, hash);
9622
- }
9623
- var qm = rest.indexOf('?');
9624
- if (qm !== -1) {
9625
- this.search = rest.substr(qm);
9626
- this.query = rest.substr(qm + 1);
9627
- if (parseQueryString) {
9628
- this.query = querystring.parse(this.query);
9629
- }
9630
- rest = rest.slice(0, qm);
9631
- } else if (parseQueryString) {
9632
- // no query string, but parseQueryString still requested
9633
- this.search = '';
9634
- this.query = {};
9635
- }
9636
- if (rest)
9637
- this.pathname = rest;
9638
- if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
9639
- this.pathname = '/';
9640
- }
9641
- //to support http.request
9642
- if (this.pathname || this.search) {
9643
- var p = this.pathname || '';
9644
- var s = this.search || '';
9645
- this.path = p + s;
9646
- }
9647
- // finally, reconstruct the href based on what has been validated.
9648
- this.href = this.format();
9649
- return this;
9650
- };
9651
- // format a parsed object into a url string
9652
- function urlFormat(obj) {
9653
- // ensure it's an object, and not a string url.
9654
- // If it's an obj, this is a no-op.
9655
- // this way, you can call url_format() on strings
9656
- // to clean up potentially wonky urls.
9657
- if (util.isString(obj))
9658
- obj = urlParse(obj);
9659
- if (!(obj instanceof Url))
9660
- return Url.prototype.format.call(obj);
9661
- return obj.format();
9662
- }
9663
- Url.prototype.format = function () {
9664
- var auth = this.auth || '';
9665
- if (auth) {
9666
- auth = encodeURIComponent(auth);
9667
- auth = auth.replace(/%3A/i, ':');
9668
- auth += '@';
9669
- }
9670
- var protocol = this.protocol || '', pathname = this.pathname || '', hash = this.hash || '', host = false, query = '';
9671
- if (this.host) {
9672
- host = auth + this.host;
9673
- } else if (this.hostname) {
9674
- host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']');
9675
- if (this.port) {
9676
- host += ':' + this.port;
9677
- }
9678
- }
9679
- if (this.query && util.isObject(this.query) && Object.keys(this.query).length) {
9680
- query = querystring.stringify(this.query);
9681
- }
9682
- var search = this.search || query && '?' + query || '';
9683
- if (protocol && protocol.substr(-1) !== ':')
9684
- protocol += ':';
9685
- // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
9686
- // unless they had them to begin with.
9687
- if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
9688
- host = '//' + (host || '');
9689
- if (pathname && pathname.charAt(0) !== '/')
9690
- pathname = '/' + pathname;
9691
- } else if (!host) {
9692
- host = '';
9693
- }
9694
- if (hash && hash.charAt(0) !== '#')
9695
- hash = '#' + hash;
9696
- if (search && search.charAt(0) !== '?')
9697
- search = '?' + search;
9698
- pathname = pathname.replace(/[?#]/g, function (match) {
9699
- return encodeURIComponent(match);
9700
- });
9701
- search = search.replace('#', '%23');
9702
- return protocol + host + pathname + search + hash;
9703
- };
9704
- function urlResolve(source, relative) {
9705
- return urlParse(source, false, true).resolve(relative);
9706
- }
9707
- Url.prototype.resolve = function (relative) {
9708
- return this.resolveObject(urlParse(relative, false, true)).format();
9709
- };
9710
- function urlResolveObject(source, relative) {
9711
- if (!source)
9712
- return relative;
9713
- return urlParse(source, false, true).resolveObject(relative);
9714
- }
9715
- Url.prototype.resolveObject = function (relative) {
9716
- if (util.isString(relative)) {
9717
- var rel = new Url();
9718
- rel.parse(relative, false, true);
9719
- relative = rel;
9720
- }
9721
- var result = new Url();
9722
- var tkeys = Object.keys(this);
9723
- for (var tk = 0; tk < tkeys.length; tk++) {
9724
- var tkey = tkeys[tk];
9725
- result[tkey] = this[tkey];
9726
- }
9727
- // hash is always overridden, no matter what.
9728
- // even href="" will remove it.
9729
- result.hash = relative.hash;
9730
- // if the relative url is empty, then there's nothing left to do here.
9731
- if (relative.href === '') {
9732
- result.href = result.format();
9733
- return result;
9734
- }
9735
- // hrefs like //foo/bar always cut to the protocol.
9736
- if (relative.slashes && !relative.protocol) {
9737
- // take everything except the protocol from relative
9738
- var rkeys = Object.keys(relative);
9739
- for (var rk = 0; rk < rkeys.length; rk++) {
9740
- var rkey = rkeys[rk];
9741
- if (rkey !== 'protocol')
9742
- result[rkey] = relative[rkey];
9743
- }
9744
- //urlParse appends trailing / to urls like http://www.example.com
9745
- if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {
9746
- result.path = result.pathname = '/';
9747
- }
9748
- result.href = result.format();
9749
- return result;
9750
- }
9751
- if (relative.protocol && relative.protocol !== result.protocol) {
9752
- // if it's a known url protocol, then changing
9753
- // the protocol does weird things
9754
- // first, if it's not file:, then we MUST have a host,
9755
- // and if there was a path
9756
- // to begin with, then we MUST have a path.
9757
- // if it is file:, then the host is dropped,
9758
- // because that's known to be hostless.
9759
- // anything else is assumed to be absolute.
9760
- if (!slashedProtocol[relative.protocol]) {
9761
- var keys = Object.keys(relative);
9762
- for (var v = 0; v < keys.length; v++) {
9763
- var k = keys[v];
9764
- result[k] = relative[k];
9765
- }
9766
- result.href = result.format();
9767
- return result;
9768
- }
9769
- result.protocol = relative.protocol;
9770
- if (!relative.host && !hostlessProtocol[relative.protocol]) {
9771
- var relPath = (relative.pathname || '').split('/');
9772
- while (relPath.length && !(relative.host = relPath.shift()));
9773
- if (!relative.host)
9774
- relative.host = '';
9775
- if (!relative.hostname)
9776
- relative.hostname = '';
9777
- if (relPath[0] !== '')
9778
- relPath.unshift('');
9779
- if (relPath.length < 2)
9780
- relPath.unshift('');
9781
- result.pathname = relPath.join('/');
9782
- } else {
9783
- result.pathname = relative.pathname;
9784
- }
9785
- result.search = relative.search;
9786
- result.query = relative.query;
9787
- result.host = relative.host || '';
9788
- result.auth = relative.auth;
9789
- result.hostname = relative.hostname || relative.host;
9790
- result.port = relative.port;
9791
- // to support http.request
9792
- if (result.pathname || result.search) {
9793
- var p = result.pathname || '';
9794
- var s = result.search || '';
9795
- result.path = p + s;
9796
- }
9797
- result.slashes = result.slashes || relative.slashes;
9798
- result.href = result.format();
9799
- return result;
9800
- }
9801
- var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/', isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/', mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split('/') || [], relPath = relative.pathname && relative.pathname.split('/') || [], psychotic = result.protocol && !slashedProtocol[result.protocol];
9802
- // if the url is a non-slashed url, then relative
9803
- // links like ../.. should be able
9804
- // to crawl up to the hostname, as well. This is strange.
9805
- // result.protocol has already been set by now.
9806
- // Later on, put the first path part into the host field.
9807
- if (psychotic) {
9808
- result.hostname = '';
9809
- result.port = null;
9810
- if (result.host) {
9811
- if (srcPath[0] === '')
9812
- srcPath[0] = result.host;
9813
- else
9814
- srcPath.unshift(result.host);
9815
- }
9816
- result.host = '';
9817
- if (relative.protocol) {
9818
- relative.hostname = null;
9819
- relative.port = null;
9820
- if (relative.host) {
9821
- if (relPath[0] === '')
9822
- relPath[0] = relative.host;
9823
- else
9824
- relPath.unshift(relative.host);
9825
- }
9826
- relative.host = null;
9827
- }
9828
- mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
9829
- }
9830
- if (isRelAbs) {
9831
- // it's absolute.
9832
- result.host = relative.host || relative.host === '' ? relative.host : result.host;
9833
- result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname;
9834
- result.search = relative.search;
9835
- result.query = relative.query;
9836
- srcPath = relPath; // fall through to the dot-handling below.
9837
- } else if (relPath.length) {
9838
- // it's relative
9839
- // throw away the existing file, and take the new path instead.
9840
- if (!srcPath)
9841
- srcPath = [];
9842
- srcPath.pop();
9843
- srcPath = srcPath.concat(relPath);
9844
- result.search = relative.search;
9845
- result.query = relative.query;
9846
- } else if (!util.isNullOrUndefined(relative.search)) {
9847
- // just pull out the search.
9848
- // like href='?foo'.
9849
- // Put this after the other two cases because it simplifies the booleans
9850
- if (psychotic) {
9851
- result.hostname = result.host = srcPath.shift();
9852
- //occationaly the auth can get stuck only in host
9853
- //this especially happens in cases like
9854
- //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
9855
- var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;
9856
- if (authInHost) {
9857
- result.auth = authInHost.shift();
9858
- result.host = result.hostname = authInHost.shift();
9859
- }
9860
- }
9861
- result.search = relative.search;
9862
- result.query = relative.query;
9863
- //to support http.request
9864
- if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
9865
- result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');
9866
- }
9867
- result.href = result.format();
9868
- return result;
9869
- }
9870
- if (!srcPath.length) {
9871
- // no path at all. easy.
9872
- // we've already handled the other stuff above.
9873
- result.pathname = null;
9874
- //to support http.request
9875
- if (result.search) {
9876
- result.path = '/' + result.search;
9877
- } else {
9878
- result.path = null;
9879
- }
9880
- result.href = result.format();
9881
- return result;
9882
- }
9883
- // if a url ENDs in . or .., then it must get a trailing slash.
9884
- // however, if it ends in anything else non-slashy,
9885
- // then it must NOT get a trailing slash.
9886
- var last = srcPath.slice(-1)[0];
9887
- var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === '';
9888
- // strip single dots, resolve double dots to parent dir
9889
- // if the path tries to go above the root, `up` ends up > 0
9890
- var up = 0;
9891
- for (var i = srcPath.length; i >= 0; i--) {
9892
- last = srcPath[i];
9893
- if (last === '.') {
9894
- srcPath.splice(i, 1);
9895
- } else if (last === '..') {
9896
- srcPath.splice(i, 1);
9897
- up++;
9898
- } else if (up) {
9899
- srcPath.splice(i, 1);
9900
- up--;
9901
- }
9902
- }
9903
- // if the path is allowed to go above the root, restore leading ..s
9904
- if (!mustEndAbs && !removeAllDots) {
9905
- for (; up--; up) {
9906
- srcPath.unshift('..');
9907
- }
9908
- }
9909
- if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
9910
- srcPath.unshift('');
9911
- }
9912
- if (hasTrailingSlash && srcPath.join('/').substr(-1) !== '/') {
9913
- srcPath.push('');
9914
- }
9915
- var isAbsolute = srcPath[0] === '' || srcPath[0] && srcPath[0].charAt(0) === '/';
9916
- // put the host back
9917
- if (psychotic) {
9918
- result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';
9919
- //occationaly the auth can get stuck only in host
9920
- //this especially happens in cases like
9921
- //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
9922
- var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;
9923
- if (authInHost) {
9924
- result.auth = authInHost.shift();
9925
- result.host = result.hostname = authInHost.shift();
9926
- }
9927
- }
9928
- mustEndAbs = mustEndAbs || result.host && srcPath.length;
9929
- if (mustEndAbs && !isAbsolute) {
9930
- srcPath.unshift('');
9931
- }
9932
- if (!srcPath.length) {
9933
- result.pathname = null;
9934
- result.path = null;
9935
- } else {
9936
- result.pathname = srcPath.join('/');
9937
- }
9938
- //to support request.http
9939
- if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
9940
- result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');
9941
- }
9942
- result.auth = relative.auth || result.auth;
9943
- result.slashes = result.slashes || relative.slashes;
9944
- result.href = result.format();
9945
- return result;
9946
- };
9947
- Url.prototype.parseHost = function () {
9948
- var host = this.host;
9949
- var port = portPattern.exec(host);
9950
- if (port) {
9951
- port = port[0];
9952
- if (port !== ':') {
9953
- this.port = port.substr(1);
9954
- }
9955
- host = host.substr(0, host.length - port.length);
9956
- }
9957
- if (host)
9958
- this.hostname = host;
9959
- };
9960
-
9961
8790
  //
9962
8791
  function getPropertyReference(propertyName) {
9963
8792
  for (let i = 0; i < v8.layout.length; i++) {
@@ -10115,7 +8944,7 @@
10115
8944
  });
10116
8945
  });
10117
8946
  function migrateFontstackURL(input) {
10118
- const inputParsed = url.parse(input);
8947
+ const inputParsed = new URL(input);
10119
8948
  const inputPathnameParts = inputParsed.pathname.split('/');
10120
8949
  if (inputParsed.protocol !== 'mapbox:') {
10121
8950
  return input;
@@ -10324,6 +9153,10 @@
10324
9153
  });
10325
9154
  }
10326
9155
 
9156
+ function getDefaultExportFromCjs (x) {
9157
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9158
+ }
9159
+
10327
9160
  var csscolorparser = {};
10328
9161
 
10329
9162
  var parseCSSColor_1;