1// modules are defined as an array 2// [ module function, map of requires ] 3// 4// map of requires is short require name -> numeric require 5// 6// anything defined in a previous bundle is accessed via the 7// orig method which is the require for previous bundles 8parcelRequire = (function (modules, cache, entry, globalName) { 9 // Save the require from previous bundle to this closure if any 10 var previousRequire = typeof parcelRequire === 'function' && parcelRequire; 11 var nodeRequire = typeof require === 'function' && require; 12 13 function newRequire(name, jumped) { 14 if (!cache[name]) { 15 if (!modules[name]) { 16 // if we cannot find the module within our internal map or 17 // cache jump to the current global require ie. the last bundle 18 // that was added to the page. 19 var currentRequire = typeof parcelRequire === 'function' && parcelRequire; 20 if (!jumped && currentRequire) { 21 return currentRequire(name, true); 22 } 23 24 // If there are other bundles on this page the require from the 25 // previous one is saved to 'previousRequire'. Repeat this as 26 // many times as there are bundles until the module is found or 27 // we exhaust the require chain. 28 if (previousRequire) { 29 return previousRequire(name, true); 30 } 31 32 // Try the node require function if it exists. 33 if (nodeRequire && typeof name === 'string') { 34 return nodeRequire(name); 35 } 36 37 var err = new Error('Cannot find module \'' + name + '\''); 38 err.code = 'MODULE_NOT_FOUND'; 39 throw err; 40 } 41 42 localRequire.resolve = resolve; 43 localRequire.cache = {}; 44 45 var module = cache[name] = new newRequire.Module(name); 46 47 modules[name][0].call(module.exports, localRequire, module, module.exports, this); 48 } 49 50 return cache[name].exports; 51 52 function localRequire(x){ 53 return newRequire(localRequire.resolve(x)); 54 } 55 56 function resolve(x){ 57 return modules[name][1][x] || x; 58 } 59 } 60 61 function Module(moduleName) { 62 this.id = moduleName; 63 this.bundle = newRequire; 64 this.exports = {}; 65 } 66 67 newRequire.isParcelRequire = true; 68 newRequire.Module = Module; 69 newRequire.modules = modules; 70 newRequire.cache = cache; 71 newRequire.parent = previousRequire; 72 newRequire.register = function (id, exports) { 73 modules[id] = [function (require, module) { 74 module.exports = exports; 75 }, {}]; 76 }; 77 78 var error; 79 for (var i = 0; i < entry.length; i++) { 80 try { 81 newRequire(entry[i]); 82 } catch (e) { 83 // Save first error but execute all entries 84 if (!error) { 85 error = e; 86 } 87 } 88 } 89 90 if (entry.length) { 91 // Expose entry point to Node, AMD or browser globals 92 // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js 93 var mainExports = newRequire(entry[entry.length - 1]); 94 95 // CommonJS 96 if (typeof exports === "object" && typeof module !== "undefined") { 97 module.exports = mainExports; 98 99 // RequireJS 100 } else if (typeof define === "function" && define.amd) { 101 define(function () { 102 return mainExports; 103 }); 104 105 // <script> 106 } else if (globalName) { 107 this[globalName] = mainExports; 108 } 109 } 110 111 // Override the current require with this new one 112 parcelRequire = newRequire; 113 114 if (error) { 115 // throw error from earlier, _after updating parcelRequire_ 116 throw error; 117 } 118 119 return newRequire; 120})({"J6GP":[function(require,module,exports) { 121// Copyright Joyent, Inc. and other Node contributors. 122// 123// Permission is hereby granted, free of charge, to any person obtaining a 124// copy of this software and associated documentation files (the 125// "Software"), to deal in the Software without restriction, including 126// without limitation the rights to use, copy, modify, merge, publish, 127// distribute, sublicense, and/or sell copies of the Software, and to permit 128// persons to whom the Software is furnished to do so, subject to the 129// following conditions: 130// 131// The above copyright notice and this permission notice shall be included 132// in all copies or substantial portions of the Software. 133// 134// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 135// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 136// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 137// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 138// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 139// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 140// USE OR OTHER DEALINGS IN THE SOFTWARE. 141'use strict'; // If obj.hasOwnProperty has been overridden, then calling 142// obj.hasOwnProperty(prop) will break. 143// See: https://github.com/joyent/node/issues/1707 144 145function hasOwnProperty(obj, prop) { 146 return Object.prototype.hasOwnProperty.call(obj, prop); 147} 148 149module.exports = function (qs, sep, eq, options) { 150 sep = sep || '&'; 151 eq = eq || '='; 152 var obj = {}; 153 154 if (typeof qs !== 'string' || qs.length === 0) { 155 return obj; 156 } 157 158 var regexp = /\+/g; 159 qs = qs.split(sep); 160 var maxKeys = 1000; 161 162 if (options && typeof options.maxKeys === 'number') { 163 maxKeys = options.maxKeys; 164 } 165 166 var len = qs.length; // maxKeys <= 0 means that we should not limit keys count 167 168 if (maxKeys > 0 && len > maxKeys) { 169 len = maxKeys; 170 } 171 172 for (var i = 0; i < len; ++i) { 173 var x = qs[i].replace(regexp, '%20'), 174 idx = x.indexOf(eq), 175 kstr, 176 vstr, 177 k, 178 v; 179 180 if (idx >= 0) { 181 kstr = x.substr(0, idx); 182 vstr = x.substr(idx + 1); 183 } else { 184 kstr = x; 185 vstr = ''; 186 } 187 188 k = decodeURIComponent(kstr); 189 v = decodeURIComponent(vstr); 190 191 if (!hasOwnProperty(obj, k)) { 192 obj[k] = v; 193 } else if (isArray(obj[k])) { 194 obj[k].push(v); 195 } else { 196 obj[k] = [obj[k], v]; 197 } 198 } 199 200 return obj; 201}; 202 203var isArray = Array.isArray || function (xs) { 204 return Object.prototype.toString.call(xs) === '[object Array]'; 205}; 206},{}],"bvhO":[function(require,module,exports) { 207// Copyright Joyent, Inc. and other Node contributors. 208// 209// Permission is hereby granted, free of charge, to any person obtaining a 210// copy of this software and associated documentation files (the 211// "Software"), to deal in the Software without restriction, including 212// without limitation the rights to use, copy, modify, merge, publish, 213// distribute, sublicense, and/or sell copies of the Software, and to permit 214// persons to whom the Software is furnished to do so, subject to the 215// following conditions: 216// 217// The above copyright notice and this permission notice shall be included 218// in all copies or substantial portions of the Software. 219// 220// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 221// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 222// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 223// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 224// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 225// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 226// USE OR OTHER DEALINGS IN THE SOFTWARE. 227'use strict'; 228 229var stringifyPrimitive = function (v) { 230 switch (typeof v) { 231 case 'string': 232 return v; 233 234 case 'boolean': 235 return v ? 'true' : 'false'; 236 237 case 'number': 238 return isFinite(v) ? v : ''; 239 240 default: 241 return ''; 242 } 243}; 244 245module.exports = function (obj, sep, eq, name) { 246 sep = sep || '&'; 247 eq = eq || '='; 248 249 if (obj === null) { 250 obj = undefined; 251 } 252 253 if (typeof obj === 'object') { 254 return map(objectKeys(obj), function (k) { 255 var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; 256 257 if (isArray(obj[k])) { 258 return map(obj[k], function (v) { 259 return ks + encodeURIComponent(stringifyPrimitive(v)); 260 }).join(sep); 261 } else { 262 return ks + encodeURIComponent(stringifyPrimitive(obj[k])); 263 } 264 }).join(sep); 265 } 266 267 if (!name) return ''; 268 return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); 269}; 270 271var isArray = Array.isArray || function (xs) { 272 return Object.prototype.toString.call(xs) === '[object Array]'; 273}; 274 275function map(xs, f) { 276 if (xs.map) return xs.map(f); 277 var res = []; 278 279 for (var i = 0; i < xs.length; i++) { 280 res.push(f(xs[i], i)); 281 } 282 283 return res; 284} 285 286var objectKeys = Object.keys || function (obj) { 287 var res = []; 288 289 for (var key in obj) { 290 if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); 291 } 292 293 return res; 294}; 295},{}],"fk5h":[function(require,module,exports) { 296'use strict'; 297 298exports.decode = exports.parse = require('./decode'); 299exports.encode = exports.stringify = require('./encode'); 300},{"./decode":"J6GP","./encode":"bvhO"}],"FIMm":[function(require,module,exports) { 301var global = arguments[3]; 302var define;
vendor: 14,672 bytes, lines 302-836
302 303/*! https://mths.be/punycode v1.4.1 by @mathias */ 304;(function(root) { 305 306 /** Detect free variables */ 307 var freeExports = typeof exports == 'object' && exports && 308 !exports.nodeType && exports; 309 var freeModule = typeof module == 'object' && module && 310 !module.nodeType && module; 311 var freeGlobal = typeof global == 'object' && global; 312 if ( 313 freeGlobal.global === freeGlobal || 314 freeGlobal.window === freeGlobal || 315 freeGlobal.self === freeGlobal 316 ) { 317 root = freeGlobal; 318 } 319 320 /** 321 * The `punycode` object. 322 * @name punycode 323 * @type Object 324 */ 325 var punycode, 326 327 /** Highest positive signed 32-bit float value */ 328 maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 329 330 /** Bootstring parameters */ 331 base = 36, 332 tMin = 1, 333 tMax = 26, 334 skew = 38, 335 damp = 700, 336 initialBias = 72, 337 initialN = 128, // 0x80 338 delimiter = '-', // '\x2D' 339 340 /** Regular expressions */ 341 regexPunycode = /^xn--/, 342 regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars 343 regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators 344 345 /** Error messages */ 346 errors = { 347 'overflow': 'Overflow: input needs wider integers to process', 348 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 349 'invalid-input': 'Invalid input' 350 }, 351 352 /** Convenience shortcuts */ 353 baseMinusTMin = base - tMin, 354 floor = Math.floor, 355 stringFromCharCode = String.fromCharCode, 356 357 /** Temporary variable */ 358 key; 359 360 /*--------------------------------------------------------------------------*/ 361 362 /** 363 * A generic error utility function. 364 * @private 365 * @param {String} type The error type. 366 * @returns {Error} Throws a `RangeError` with the applicable error message. 367 */ 368 function error(type) { 369 throw new RangeError(errors[type]); 370 } 371 372 /** 373 * A generic `Array#map` utility function. 374 * @private 375 * @param {Array} array The array to iterate over. 376 * @param {Function} callback The function that gets called for every array 377 * item. 378 * @returns {Array} A new array of values returned by the callback function. 379 */ 380 function map(array, fn) { 381 var length = array.length; 382 var result = []; 383 while (length--) { 384 result[length] = fn(array[length]); 385 } 386 return result; 387 } 388 389 /** 390 * A simple `Array#map`-like wrapper to work with domain name strings or email 391 * addresses. 392 * @private 393 * @param {String} domain The domain name or email address. 394 * @param {Function} callback The function that gets called for every 395 * character. 396 * @returns {Array} A new string of characters returned by the callback 397 * function. 398 */ 399 function mapDomain(string, fn) { 400 var parts = string.split('@'); 401 var result = ''; 402 if (parts.length > 1) { 403 // In email addresses, only the domain name should be punycoded. Leave 404 // the local part (i.e. everything up to `@`) intact. 405 result = parts[0] + '@'; 406 string = parts[1]; 407 } 408 // Avoid `split(regex)` for IE8 compatibility. See #17. 409 string = string.replace(regexSeparators, '\x2E'); 410 var labels = string.split('.'); 411 var encoded = map(labels, fn).join('.'); 412 return result + encoded; 413 } 414 415 /** 416 * Creates an array containing the numeric code points of each Unicode 417 * character in the string. While JavaScript uses UCS-2 internally, 418 * this function will convert a pair of surrogate halves (each of which 419 * UCS-2 exposes as separate characters) into a single code point, 420 * matching UTF-16. 421 * @see `punycode.ucs2.encode` 422 * @see <https://mathiasbynens.be/notes/javascript-encoding> 423 * @memberOf punycode.ucs2 424 * @name decode 425 * @param {String} string The Unicode input string (UCS-2). 426 * @returns {Array} The new array of code points. 427 */ 428 function ucs2decode(string) { 429 var output = [], 430 counter = 0, 431 length = string.length, 432 value, 433 extra; 434 while (counter < length) { 435 value = string.charCodeAt(counter++); 436 if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 437 // high surrogate, and there is a next character 438 extra = string.charCodeAt(counter++); 439 if ((extra & 0xFC00) == 0xDC00) { // low surrogate 440 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); 441 } else { 442 // unmatched surrogate; only append this code unit, in case the next 443 // code unit is the high surrogate of a surrogate pair 444 output.push(value); 445 counter--; 446 } 447 } else { 448 output.push(value); 449 } 450 } 451 return output; 452 } 453 454 /** 455 * Creates a string based on an array of numeric code points. 456 * @see `punycode.ucs2.decode` 457 * @memberOf punycode.ucs2 458 * @name encode 459 * @param {Array} codePoints The array of numeric code points. 460 * @returns {String} The new Unicode string (UCS-2). 461 */ 462 function ucs2encode(array) { 463 return map(array, function(value) { 464 var output = ''; 465 if (value > 0xFFFF) { 466 value -= 0x10000; 467 output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); 468 value = 0xDC00 | value & 0x3FF; 469 } 470 output += stringFromCharCode(value); 471 return output; 472 }).join(''); 473 } 474 475 /** 476 * Converts a basic code point into a digit/integer. 477 * @see `digitToBasic()` 478 * @private 479 * @param {Number} codePoint The basic numeric code point value. 480 * @returns {Number} The numeric value of a basic code point (for use in 481 * representing integers) in the range `0` to `base - 1`, or `base` if 482 * the code point does not represent a value. 483 */ 484 function basicToDigit(codePoint) { 485 if (codePoint - 48 < 10) { 486 return codePoint - 22; 487 } 488 if (codePoint - 65 < 26) { 489 return codePoint - 65; 490 } 491 if (codePoint - 97 < 26) { 492 return codePoint - 97; 493 } 494 return base; 495 } 496 497 /** 498 * Converts a digit/integer into a basic code point. 499 * @see `basicToDigit()` 500 * @private 501 * @param {Number} digit The numeric value of a basic code point. 502 * @returns {Number} The basic code point whose value (when used for 503 * representing integers) is `digit`, which needs to be in the range 504 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is 505 * used; else, the lowercase form is used. The behavior is undefined 506 * if `flag` is non-zero and `digit` has no uppercase form. 507 */ 508 function digitToBasic(digit, flag) { 509 // 0..25 map to ASCII a..z or A..Z 510 // 26..35 map to ASCII 0..9 511 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); 512 } 513 514 /** 515 * Bias adaptation function as per section 3.4 of RFC 3492. 516 * https://tools.ietf.org/html/rfc3492#section-3.4 517 * @private 518 */ 519 function adapt(delta, numPoints, firstTime) { 520 var k = 0; 521 delta = firstTime ? floor(delta / damp) : delta >> 1; 522 delta += floor(delta / numPoints); 523 for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { 524 delta = floor(delta / baseMinusTMin); 525 } 526 return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); 527 } 528 529 /** 530 * Converts a Punycode string of ASCII-only symbols to a string of Unicode 531 * symbols. 532 * @memberOf punycode 533 * @param {String} input The Punycode string of ASCII-only symbols. 534 * @returns {String} The resulting string of Unicode symbols. 535 */ 536 function decode(input) { 537 // Don't use UCS-2 538 var output = [], 539 inputLength = input.length, 540 out, 541 i = 0, 542 n = initialN, 543 bias = initialBias, 544 basic, 545 j, 546 index, 547 oldi, 548 w, 549 k, 550 digit, 551 t, 552 /** Cached calculation results */ 553 baseMinusT; 554 555 // Handle the basic code points: let `basic` be the number of input code 556 // points before the last delimiter, or `0` if there is none, then copy 557 // the first basic code points to the output. 558 559 basic = input.lastIndexOf(delimiter); 560 if (basic < 0) { 561 basic = 0; 562 } 563 564 for (j = 0; j < basic; ++j) { 565 // if it's not a basic code point 566 if (input.charCodeAt(j) >= 0x80) { 567 error('not-basic'); 568 } 569 output.push(input.charCodeAt(j)); 570 } 571 572 // Main decoding loop: start just after the last delimiter if any basic code 573 // points were copied; start at the beginning otherwise. 574 575 for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { 576 577 // `index` is the index of the next character to be consumed. 578 // Decode a generalized variable-length integer into `delta`, 579 // which gets added to `i`. The overflow checking is easier 580 // if we increase `i` as we go, then subtract off its starting 581 // value at the end to obtain `delta`. 582 for (oldi = i, w = 1, k = base; /* no condition */; k += base) { 583 584 if (index >= inputLength) { 585 error('invalid-input'); 586 } 587 588 digit = basicToDigit(input.charCodeAt(index++)); 589 590 if (digit >= base || digit > floor((maxInt - i) / w)) { 591 error('overflow'); 592 } 593 594 i += digit * w; 595 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 596 597 if (digit < t) { 598 break; 599 } 600 601 baseMinusT = base - t; 602 if (w > floor(maxInt / baseMinusT)) { 603 error('overflow'); 604 } 605 606 w *= baseMinusT; 607 608 } 609 610 out = output.length + 1; 611 bias = adapt(i - oldi, out, oldi == 0); 612 613 // `i` was supposed to wrap around from `out` to `0`, 614 // incrementing `n` each time, so we'll fix that now: 615 if (floor(i / out) > maxInt - n) { 616 error('overflow'); 617 } 618 619 n += floor(i / out); 620 i %= out; 621 622 // Insert `n` at position `i` of the output 623 output.splice(i++, 0, n); 624 625 } 626 627 return ucs2encode(output); 628 } 629 630 /** 631 * Converts a string of Unicode symbols (e.g. a domain name label) to a 632 * Punycode string of ASCII-only symbols. 633 * @memberOf punycode 634 * @param {String} input The string of Unicode symbols. 635 * @returns {String} The resulting Punycode string of ASCII-only symbols. 636 */ 637 function encode(input) { 638 var n, 639 delta, 640 handledCPCount, 641 basicLength, 642 bias, 643 j, 644 m, 645 q, 646 k, 647 t, 648 currentValue, 649 output = [], 650 /** `inputLength` will hold the number of code points in `input`. */ 651 inputLength, 652 /** Cached calculation results */ 653 handledCPCountPlusOne, 654 baseMinusT, 655 qMinusT; 656 657 // Convert the input in UCS-2 to Unicode 658 input = ucs2decode(input); 659 660 // Cache the length 661 inputLength = input.length; 662 663 // Initialize the state 664 n = initialN; 665 delta = 0; 666 bias = initialBias; 667 668 // Handle the basic code points 669 for (j = 0; j < inputLength; ++j) { 670 currentValue = input[j]; 671 if (currentValue < 0x80) { 672 output.push(stringFromCharCode(currentValue)); 673 } 674 } 675 676 handledCPCount = basicLength = output.length; 677 678 // `handledCPCount` is the number of code points that have been handled; 679 // `basicLength` is the number of basic code points. 680 681 // Finish the basic string - if it is not empty - with a delimiter 682 if (basicLength) { 683 output.push(delimiter); 684 } 685 686 // Main encoding loop: 687 while (handledCPCount < inputLength) { 688 689 // All non-basic code points < n have been handled already. Find the next 690 // larger one: 691 for (m = maxInt, j = 0; j < inputLength; ++j) { 692 currentValue = input[j]; 693 if (currentValue >= n && currentValue < m) { 694 m = currentValue; 695 } 696 } 697 698 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, 699 // but guard against overflow 700 handledCPCountPlusOne = handledCPCount + 1; 701 if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { 702 error('overflow'); 703 } 704 705 delta += (m - n) * handledCPCountPlusOne; 706 n = m; 707 708 for (j = 0; j < inputLength; ++j) { 709 currentValue = input[j]; 710 711 if (currentValue < n && ++delta > maxInt) { 712 error('overflow'); 713 } 714 715 if (currentValue == n) { 716 // Represent delta as a generalized variable-length integer 717 for (q = delta, k = base; /* no condition */; k += base) { 718 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 719 if (q < t) { 720 break; 721 } 722 qMinusT = q - t; 723 baseMinusT = base - t; 724 output.push( 725 stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) 726 ); 727 q = floor(qMinusT / baseMinusT); 728 } 729 730 output.push(stringFromCharCode(digitToBasic(q, 0))); 731 bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); 732 delta = 0; 733 ++handledCPCount; 734 } 735 } 736 737 ++delta; 738 ++n; 739 740 } 741 return output.join(''); 742 } 743 744 /** 745 * Converts a Punycode string representing a domain name or an email address 746 * to Unicode. Only the Punycoded parts of the input will be converted, i.e. 747 * it doesn't matter if you call it on a string that has already been 748 * converted to Unicode. 749 * @memberOf punycode 750 * @param {String} input The Punycoded domain name or email address to 751 * convert to Unicode. 752 * @returns {String} The Unicode representation of the given Punycode 753 * string. 754 */ 755 function toUnicode(input) { 756 return mapDomain(input, function(string) { 757 return regexPunycode.test(string) 758 ? decode(string.slice(4).toLowerCase()) 759 : string; 760 }); 761 } 762 763 /** 764 * Converts a Unicode string representing a domain name or an email address to 765 * Punycode. Only the non-ASCII parts of the domain name will be converted, 766 * i.e. it doesn't matter if you call it with a domain that's already in 767 * ASCII. 768 * @memberOf punycode 769 * @param {String} input The domain name or email address to convert, as a 770 * Unicode string. 771 * @returns {String} The Punycode representation of the given domain name or 772 * email address. 773 */ 774 function toASCII(input) { 775 return mapDomain(input, function(string) { 776 return regexNonASCII.test(string) 777 ? 'xn--' + encode(string) 778 : string; 779 }); 780 } 781 782 /*--------------------------------------------------------------------------*/ 783 784 /** Define the public API */ 785 punycode = { 786 /** 787 * A string representing the current Punycode.js version number. 788 * @memberOf punycode 789 * @type String 790 */ 791 'version': '1.4.1', 792 /** 793 * An object of methods to convert from JavaScript's internal character 794 * representation (UCS-2) to Unicode code points, and back. 795 * @see <https://mathiasbynens.be/notes/javascript-encoding> 796 * @memberOf punycode 797 * @type Object 798 */ 799 'ucs2': { 800 'decode': ucs2decode, 801 'encode': ucs2encode 802 }, 803 'decode': decode, 804 'encode': encode, 805 'toASCII': toASCII, 806 'toUnicode': toUnicode 807 }; 808 809 /** Expose `punycode` */ 810 // Some AMD build optimizers, like r.js, check for specific condition patterns 811 // like the following: 812 if ( 813 typeof define == 'function' && 814 typeof define.amd == 'object' && 815 define.amd 816 ) { 817 define('punycode', function() { 818 return punycode; 819 }); 820 } else if (freeExports && freeModule) { 821 if (module.exports == freeExports) { 822 // in Node.js, io.js, or RingoJS v0.8.0+ 823 freeModule.exports = punycode; 824 } else { 825 // in Narwhal or RingoJS v0.7.0- 826 for (key in punycode) { 827 punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); 828 } 829 } 830 } else { 831 // in Rhino or a web browser 832 root.punycode = punycode; 833 } 834 835}(this)); 836
837},{}],"YsIc":[function(require,module,exports) { 838'use strict'; 839 840module.exports = { 841 isString: function(arg) { 842 return typeof(arg) === 'string'; 843 }, 844 isObject: function(arg) { 845 return typeof(arg) === 'object' && arg !== null; 846 }, 847 isNull: function(arg) { 848 return arg === null; 849 }, 850 isNullOrUndefined: function(arg) { 851 return arg == null; 852 } 853}; 854 855},{}],"Mej7":[function(require,module,exports)
vendor: 23,324 bytes, lines 855-1589
855{ 856// Copyright Joyent, Inc. and other Node contributors. 857// 858// Permission is hereby granted, free of charge, to any person obtaining a 859// copy of this software and associated documentation files (the 860// "Software"), to deal in the Software without restriction, including 861// without limitation the rights to use, copy, modify, merge, publish, 862// distribute, sublicense, and/or sell copies of the Software, and to permit 863// persons to whom the Software is furnished to do so, subject to the 864// following conditions: 865// 866// The above copyright notice and this permission notice shall be included 867// in all copies or substantial portions of the Software. 868// 869// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 870// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 871// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 872// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 873// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 874// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 875// USE OR OTHER DEALINGS IN THE SOFTWARE. 876 877'use strict'; 878 879var punycode = require('punycode'); 880var util = require('./util'); 881 882exports.parse = urlParse; 883exports.resolve = urlResolve; 884exports.resolveObject = urlResolveObject; 885exports.format = urlFormat; 886 887exports.Url = Url; 888 889function Url() { 890 this.protocol = null; 891 this.slashes = null; 892 this.auth = null; 893 this.host = null; 894 this.port = null; 895 this.hostname = null; 896 this.hash = null; 897 this.search = null; 898 this.query = null; 899 this.pathname = null; 900 this.path = null; 901 this.href = null; 902} 903 904// Reference: RFC 3986, RFC 1808, RFC 2396 905 906// define these here so at least they only have to be 907// compiled once on the first module load. 908var protocolPattern = /^([a-z0-9.+-]+:)/i, 909 portPattern = /:[0-9]*$/, 910 911 // Special case for a simple path URL 912 simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, 913 914 // RFC 2396: characters reserved for delimiting URLs. 915 // We actually just auto-escape these. 916 delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], 917 918 // RFC 2396: characters not allowed for various reasons. 919 unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), 920 921 // Allowed by RFCs, but cause of XSS attacks. Always escape these. 922 autoEscape = ['\''].concat(unwise), 923 // Characters that are never ever allowed in a hostname. 924 // Note that any invalid chars are also handled, but these 925 // are the ones that are *expected* to be seen, so we fast-path 926 // them. 927 nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), 928 hostEndingChars = ['/', '?', '#'], 929 hostnameMaxLen = 255, 930 hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, 931 hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, 932 // protocols that can allow "unsafe" and "unwise" chars. 933 unsafeProtocol = { 934 'javascript': true, 935 'javascript:': true 936 }, 937 // protocols that never have a hostname. 938 hostlessProtocol = { 939 'javascript': true, 940 'javascript:': true 941 }, 942 // protocols that always contain a // bit. 943 slashedProtocol = { 944 'http': true, 945 'https': true, 946 'ftp': true, 947 'gopher': true, 948 'file': true, 949 'http:': true, 950 'https:': true, 951 'ftp:': true, 952 'gopher:': true, 953 'file:': true 954 }, 955 querystring = require('querystring'); 956 957function urlParse(url, parseQueryString, slashesDenoteHost) { 958 if (url && util.isObject(url) && url instanceof Url) return url; 959 960 var u = new Url; 961 u.parse(url, parseQueryString, slashesDenoteHost); 962 return u; 963} 964 965Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { 966 if (!util.isString(url)) { 967 throw new TypeError("Parameter 'url' must be a string, not " + typeof url); 968 } 969 970 // Copy chrome, IE, opera backslash-handling behavior. 971 // Back slashes before the query string get converted to forward slashes 972 // See: https://code.google.com/p/chromium/issues/detail?id=25916 973 var queryIndex = url.indexOf('?'), 974 splitter = 975 (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', 976 uSplit = url.split(splitter), 977 slashRegex = /\\/g; 978 uSplit[0] = uSplit[0].replace(slashRegex, '/'); 979 url = uSplit.join(splitter); 980 981 var rest = url; 982 983 // trim before proceeding. 984 // This is to support parse stuff like " http://foo.com \n" 985 rest = rest.trim(); 986 987 if (!slashesDenoteHost && url.split('#').length === 1) { 988 // Try fast path regexp 989 var simplePath = simplePathPattern.exec(rest); 990 if (simplePath) { 991 this.path = rest; 992 this.href = rest; 993 this.pathname = simplePath[1]; 994 if (simplePath[2]) { 995 this.search = simplePath[2]; 996 if (parseQueryString) { 997 this.query = querystring.parse(this.search.substr(1)); 998 } else { 999 this.query = this.search.substr(1); 1000 } 1001 } else if (parseQueryString) { 1002 this.search = ''; 1003 this.query = {}; 1004 } 1005 return this; 1006 } 1007 } 1008 1009 var proto = protocolPattern.exec(rest); 1010 if (proto) { 1011 proto = proto[0]; 1012 var lowerProto = proto.toLowerCase(); 1013 this.protocol = lowerProto; 1014 rest = rest.substr(proto.length); 1015 } 1016 1017 // figure out if it's got a host 1018 // user@server is *always* interpreted as a hostname, and url 1019 // resolution will treat //foo/bar as host=foo,path=bar because that's 1020 // how the browser resolves relative URLs. 1021 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { 1022 var slashes = rest.substr(0, 2) === '//'; 1023 if (slashes && !(proto && hostlessProtocol[proto])) { 1024 rest = rest.substr(2); 1025 this.slashes = true; 1026 } 1027 } 1028 1029 if (!hostlessProtocol[proto] && 1030 (slashes || (proto && !slashedProtocol[proto]))) { 1031 1032 // there's a hostname. 1033 // the first instance of /, ?, ;, or # ends the host. 1034 // 1035 // If there is an @ in the hostname, then non-host chars *are* allowed 1036 // to the left of the last @ sign, unless some host-ending character 1037 // comes *before* the @-sign. 1038 // URLs are obnoxious. 1039 // 1040 // ex: 1041 // http://a@b@c/ => user:a@b host:c 1042 // http://a@b?@c => user:a host:c path:/?@c 1043 1044 // v0.12 TODO(isaacs): This is not quite how Chrome does things. 1045 // Review our test case against browsers more comprehensively. 1046 1047 // find the first instance of any hostEndingChars 1048 var hostEnd = -1; 1049 for (var i = 0; i < hostEndingChars.length; i++) { 1050 var hec = rest.indexOf(hostEndingChars[i]); 1051 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) 1052 hostEnd = hec; 1053 } 1054 1055 // at this point, either we have an explicit point where the 1056 // auth portion cannot go past, or the last @ char is the decider. 1057 var auth, atSign; 1058 if (hostEnd === -1) { 1059 // atSign can be anywhere. 1060 atSign = rest.lastIndexOf('@'); 1061 } else { 1062 // atSign must be in auth portion. 1063 // http://a@b/c@d => host:b auth:a path:/c@d 1064 atSign = rest.lastIndexOf('@', hostEnd); 1065 } 1066 1067 // Now we have a portion which is definitely the auth. 1068 // Pull that off. 1069 if (atSign !== -1) { 1070 auth = rest.slice(0, atSign); 1071 rest = rest.slice(atSign + 1); 1072 this.auth = decodeURIComponent(auth); 1073 } 1074 1075 // the host is the remaining to the left of the first non-host char 1076 hostEnd = -1; 1077 for (var i = 0; i < nonHostChars.length; i++) { 1078 var hec = rest.indexOf(nonHostChars[i]); 1079 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) 1080 hostEnd = hec; 1081 } 1082 // if we still have not hit it, then the entire thing is a host. 1083 if (hostEnd === -1) 1084 hostEnd = rest.length; 1085 1086 this.host = rest.slice(0, hostEnd); 1087 rest = rest.slice(hostEnd); 1088 1089 // pull out port. 1090 this.parseHost(); 1091 1092 // we've indicated that there is a hostname, 1093 // so even if it's empty, it has to be present. 1094 this.hostname = this.hostname || ''; 1095 1096 // if hostname begins with [ and ends with ] 1097 // assume that it's an IPv6 address. 1098 var ipv6Hostname = this.hostname[0] === '[' && 1099 this.hostname[this.hostname.length - 1] === ']'; 1100 1101 // validate a little. 1102 if (!ipv6Hostname) { 1103 var hostparts = this.hostname.split(/\./); 1104 for (var i = 0, l = hostparts.length; i < l; i++) { 1105 var part = hostparts[i]; 1106 if (!part) continue; 1107 if (!part.match(hostnamePartPattern)) { 1108 var newpart = ''; 1109 for (var j = 0, k = part.length; j < k; j++) { 1110 if (part.charCodeAt(j) > 127) { 1111 // we replace non-ASCII char with a temporary placeholder 1112 // we need this to make sure size of hostname is not 1113 // broken by replacing non-ASCII by nothing 1114 newpart += 'x'; 1115 } else { 1116 newpart += part[j]; 1117 } 1118 } 1119 // we test again with ASCII char only 1120 if (!newpart.match(hostnamePartPattern)) { 1121 var validParts = hostparts.slice(0, i); 1122 var notHost = hostparts.slice(i + 1); 1123 var bit = part.match(hostnamePartStart); 1124 if (bit) { 1125 validParts.push(bit[1]); 1126 notHost.unshift(bit[2]); 1127 } 1128 if (notHost.length) { 1129 rest = '/' + notHost.join('.') + rest; 1130 } 1131 this.hostname = validParts.join('.'); 1132 break; 1133 } 1134 } 1135 } 1136 } 1137 1138 if (this.hostname.length > hostnameMaxLen) { 1139 this.hostname = ''; 1140 } else { 1141 // hostnames are always lower case. 1142 this.hostname = this.hostname.toLowerCase(); 1143 } 1144 1145 if (!ipv6Hostname) { 1146 // IDNA Support: Returns a punycoded representation of "domain". 1147 // It only converts parts of the domain name that 1148 // have non-ASCII characters, i.e. it doesn't matter if 1149 // you call it with a domain that already is ASCII-only. 1150 this.hostname = punycode.toASCII(this.hostname); 1151 } 1152 1153 var p = this.port ? ':' + this.port : ''; 1154 var h = this.hostname || ''; 1155 this.host = h + p; 1156 this.href += this.host; 1157 1158 // strip [ and ] from the hostname 1159 // the host field still retains them, though 1160 if (ipv6Hostname) { 1161 this.hostname = this.hostname.substr(1, this.hostname.length - 2); 1162 if (rest[0] !== '/') { 1163 rest = '/' + rest; 1164 } 1165 } 1166 } 1167 1168 // now rest is set to the post-host stuff. 1169 // chop off any delim chars. 1170 if (!unsafeProtocol[lowerProto]) { 1171 1172 // First, make 100% sure that any "autoEscape" chars get 1173 // escaped, even if encodeURIComponent doesn't think they 1174 // need to be. 1175 for (var i = 0, l = autoEscape.length; i < l; i++) { 1176 var ae = autoEscape[i]; 1177 if (rest.indexOf(ae) === -1) 1178 continue; 1179 var esc = encodeURIComponent(ae); 1180 if (esc === ae) { 1181 esc = escape(ae); 1182 } 1183 rest = rest.split(ae).join(esc); 1184 } 1185 } 1186 1187 1188 // chop off from the tail first. 1189 var hash = rest.indexOf('#'); 1190 if (hash !== -1) { 1191 // got a fragment string. 1192 this.hash = rest.substr(hash); 1193 rest = rest.slice(0, hash); 1194 } 1195 var qm = rest.indexOf('?'); 1196 if (qm !== -1) { 1197 this.search = rest.substr(qm); 1198 this.query = rest.substr(qm + 1); 1199 if (parseQueryString) { 1200 this.query = querystring.parse(this.query); 1201 } 1202 rest = rest.slice(0, qm); 1203 } else if (parseQueryString) { 1204 // no query string, but parseQueryString still requested 1205 this.search = ''; 1206 this.query = {}; 1207 } 1208 if (rest) this.pathname = rest; 1209 if (slashedProtocol[lowerProto] && 1210 this.hostname && !this.pathname) { 1211 this.pathname = '/'; 1212 } 1213 1214 //to support http.request 1215 if (this.pathname || this.search) { 1216 var p = this.pathname || ''; 1217 var s = this.search || ''; 1218 this.path = p + s; 1219 } 1220 1221 // finally, reconstruct the href based on what has been validated. 1222 this.href = this.format(); 1223 return this; 1224}; 1225 1226// format a parsed object into a url string 1227function urlFormat(obj) { 1228 // ensure it's an object, and not a string url. 1229 // If it's an obj, this is a no-op. 1230 // this way, you can call url_format() on strings 1231 // to clean up potentially wonky urls. 1232 if (util.isString(obj)) obj = urlParse(obj); 1233 if (!(obj instanceof Url)) return Url.prototype.format.call(obj); 1234 return obj.format(); 1235} 1236 1237Url.prototype.format = function() { 1238 var auth = this.auth || ''; 1239 if (auth) { 1240 auth = encodeURIComponent(auth); 1241 auth = auth.replace(/%3A/i, ':'); 1242 auth += '@'; 1243 } 1244 1245 var protocol = this.protocol || '', 1246 pathname = this.pathname || '', 1247 hash = this.hash || '', 1248 host = false, 1249 query = ''; 1250 1251 if (this.host) { 1252 host = auth + this.host; 1253 } else if (this.hostname) { 1254 host = auth + (this.hostname.indexOf(':') === -1 ? 1255 this.hostname : 1256 '[' + this.hostname + ']'); 1257 if (this.port) { 1258 host += ':' + this.port; 1259 } 1260 } 1261 1262 if (this.query && 1263 util.isObject(this.query) && 1264 Object.keys(this.query).length) { 1265 query = querystring.stringify(this.query); 1266 } 1267 1268 var search = this.search || (query && ('?' + query)) || ''; 1269 1270 if (protocol && protocol.substr(-1) !== ':') protocol += ':'; 1271 1272 // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. 1273 // unless they had them to begin with. 1274 if (this.slashes || 1275 (!protocol || slashedProtocol[protocol]) && host !== false) { 1276 host = '//' + (host || ''); 1277 if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; 1278 } else if (!host) { 1279 host = ''; 1280 } 1281 1282 if (hash && hash.charAt(0) !== '#') hash = '#' + hash; 1283 if (search && search.charAt(0) !== '?') search = '?' + search; 1284 1285 pathname = pathname.replace(/[?#]/g, function(match) { 1286 return encodeURIComponent(match); 1287 }); 1288 search = search.replace('#', '%23'); 1289 1290 return protocol + host + pathname + search + hash; 1291}; 1292 1293function urlResolve(source, relative) { 1294 return urlParse(source, false, true).resolve(relative); 1295} 1296 1297Url.prototype.resolve = function(relative) { 1298 return this.resolveObject(urlParse(relative, false, true)).format(); 1299}; 1300 1301function urlResolveObject(source, relative) { 1302 if (!source) return relative; 1303 return urlParse(source, false, true).resolveObject(relative); 1304} 1305 1306Url.prototype.resolveObject = function(relative) { 1307 if (util.isString(relative)) { 1308 var rel = new Url(); 1309 rel.parse(relative, false, true); 1310 relative = rel; 1311 } 1312 1313 var result = new Url(); 1314 var tkeys = Object.keys(this); 1315 for (var tk = 0; tk < tkeys.length; tk++) { 1316 var tkey = tkeys[tk]; 1317 result[tkey] = this[tkey]; 1318 } 1319 1320 // hash is always overridden, no matter what. 1321 // even href="" will remove it. 1322 result.hash = relative.hash; 1323 1324 // if the relative url is empty, then there's nothing left to do here. 1325 if (relative.href === '') { 1326 result.href = result.format(); 1327 return result; 1328 } 1329 1330 // hrefs like //foo/bar always cut to the protocol. 1331 if (relative.slashes && !relative.protocol) { 1332 // take everything except the protocol from relative 1333 var rkeys = Object.keys(relative); 1334 for (var rk = 0; rk < rkeys.length; rk++) { 1335 var rkey = rkeys[rk]; 1336 if (rkey !== 'protocol') 1337 result[rkey] = relative[rkey]; 1338 } 1339 1340 //urlParse appends trailing / to urls like http://www.example.com 1341 if (slashedProtocol[result.protocol] && 1342 result.hostname && !result.pathname) { 1343 result.path = result.pathname = '/'; 1344 } 1345 1346 result.href = result.format(); 1347 return result; 1348 } 1349 1350 if (relative.protocol && relative.protocol !== result.protocol) { 1351 // if it's a known url protocol, then changing 1352 // the protocol does weird things 1353 // first, if it's not file:, then we MUST have a host, 1354 // and if there was a path 1355 // to begin with, then we MUST have a path. 1356 // if it is file:, then the host is dropped, 1357 // because that's known to be hostless. 1358 // anything else is assumed to be absolute. 1359 if (!slashedProtocol[relative.protocol]) { 1360 var keys = Object.keys(relative); 1361 for (var v = 0; v < keys.length; v++) { 1362 var k = keys[v]; 1363 result[k] = relative[k]; 1364 } 1365 result.href = result.format(); 1366 return result; 1367 } 1368 1369 result.protocol = relative.protocol; 1370 if (!relative.host && !hostlessProtocol[relative.protocol]) { 1371 var relPath = (relative.pathname || '').split('/'); 1372 while (relPath.length && !(relative.host = relPath.shift())); 1373 if (!relative.host) relative.host = ''; 1374 if (!relative.hostname) relative.hostname = ''; 1375 if (relPath[0] !== '') relPath.unshift(''); 1376 if (relPath.length < 2) relPath.unshift(''); 1377 result.pathname = relPath.join('/'); 1378 } else { 1379 result.pathname = relative.pathname; 1380 } 1381 result.search = relative.search; 1382 result.query = relative.query; 1383 result.host = relative.host || ''; 1384 result.auth = relative.auth; 1385 result.hostname = relative.hostname || relative.host; 1386 result.port = relative.port; 1387 // to support http.request 1388 if (result.pathname || result.search) { 1389 var p = result.pathname || ''; 1390 var s = result.search || ''; 1391 result.path = p + s; 1392 } 1393 result.slashes = result.slashes || relative.slashes; 1394 result.href = result.format(); 1395 return result; 1396 } 1397 1398 var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), 1399 isRelAbs = ( 1400 relative.host || 1401 relative.pathname && relative.pathname.charAt(0) === '/' 1402 ), 1403 mustEndAbs = (isRelAbs || isSourceAbs || 1404 (result.host && relative.pathname)), 1405 removeAllDots = mustEndAbs, 1406 srcPath = result.pathname && result.pathname.split('/') || [], 1407 relPath = relative.pathname && relative.pathname.split('/') || [], 1408 psychotic = result.protocol && !slashedProtocol[result.protocol]; 1409 1410 // if the url is a non-slashed url, then relative 1411 // links like ../.. should be able 1412 // to crawl up to the hostname, as well. This is strange. 1413 // result.protocol has already been set by now. 1414 // Later on, put the first path part into the host field. 1415 if (psychotic) { 1416 result.hostname = ''; 1417 result.port = null; 1418 if (result.host) { 1419 if (srcPath[0] === '') srcPath[0] = result.host; 1420 else srcPath.unshift(result.host); 1421 } 1422 result.host = ''; 1423 if (relative.protocol) { 1424 relative.hostname = null; 1425 relative.port = null; 1426 if (relative.host) { 1427 if (relPath[0] === '') relPath[0] = relative.host; 1428 else relPath.unshift(relative.host); 1429 } 1430 relative.host = null; 1431 } 1432 mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); 1433 } 1434 1435 if (isRelAbs) { 1436 // it's absolute. 1437 result.host = (relative.host || relative.host === '') ? 1438 relative.host : result.host; 1439 result.hostname = (relative.hostname || relative.hostname === '') ? 1440 relative.hostname : result.hostname; 1441 result.search = relative.search; 1442 result.query = relative.query; 1443 srcPath = relPath; 1444 // fall through to the dot-handling below. 1445 } else if (relPath.length) { 1446 // it's relative 1447 // throw away the existing file, and take the new path instead. 1448 if (!srcPath) srcPath = []; 1449 srcPath.pop(); 1450 srcPath = srcPath.concat(relPath); 1451 result.search = relative.search; 1452 result.query = relative.query; 1453 } else if (!util.isNullOrUndefined(relative.search)) { 1454 // just pull out the search. 1455 // like href='?foo'. 1456 // Put this after the other two cases because it simplifies the booleans 1457 if (psychotic) { 1458 result.hostname = result.host = srcPath.shift(); 1459 //occationaly the auth can get stuck only in host 1460 //this especially happens in cases like 1461 //url.resolveObject('mailto:local1@domain1', 'local2@domain2') 1462 var authInHost = result.host && result.host.indexOf('@') > 0 ? 1463 result.host.split('@') : false; 1464 if (authInHost) { 1465 result.auth = authInHost.shift(); 1466 result.host = result.hostname = authInHost.shift(); 1467 } 1468 } 1469 result.search = relative.search; 1470 result.query = relative.query; 1471 //to support http.request 1472 if (!util.isNull(result.pathname) || !util.isNull(result.search)) { 1473 result.path = (result.pathname ? result.pathname : '') + 1474 (result.search ? result.search : ''); 1475 } 1476 result.href = result.format(); 1477 return result; 1478 } 1479 1480 if (!srcPath.length) { 1481 // no path at all. easy. 1482 // we've already handled the other stuff above. 1483 result.pathname = null; 1484 //to support http.request 1485 if (result.search) { 1486 result.path = '/' + result.search; 1487 } else { 1488 result.path = null; 1489 } 1490 result.href = result.format(); 1491 return result; 1492 } 1493 1494 // if a url ENDs in . or .., then it must get a trailing slash. 1495 // however, if it ends in anything else non-slashy, 1496 // then it must NOT get a trailing slash. 1497 var last = srcPath.slice(-1)[0]; 1498 var hasTrailingSlash = ( 1499 (result.host || relative.host || srcPath.length > 1) && 1500 (last === '.' || last === '..') || last === ''); 1501 1502 // strip single dots, resolve double dots to parent dir 1503 // if the path tries to go above the root, `up` ends up > 0 1504 var up = 0; 1505 for (var i = srcPath.length; i >= 0; i--) { 1506 last = srcPath[i]; 1507 if (last === '.') { 1508 srcPath.splice(i, 1); 1509 } else if (last === '..') { 1510 srcPath.splice(i, 1); 1511 up++; 1512 } else if (up) { 1513 srcPath.splice(i, 1); 1514 up--; 1515 } 1516 } 1517 1518 // if the path is allowed to go above the root, restore leading ..s 1519 if (!mustEndAbs && !removeAllDots) { 1520 for (; up--; up) { 1521 srcPath.unshift('..'); 1522 } 1523 } 1524 1525 if (mustEndAbs && srcPath[0] !== '' && 1526 (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { 1527 srcPath.unshift(''); 1528 } 1529 1530 if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { 1531 srcPath.push(''); 1532 } 1533 1534 var isAbsolute = srcPath[0] === '' || 1535 (srcPath[0] && srcPath[0].charAt(0) === '/'); 1536 1537 // put the host back 1538 if (psychotic) { 1539 result.hostname = result.host = isAbsolute ? '' : 1540 srcPath.length ? srcPath.shift() : ''; 1541 //occationaly the auth can get stuck only in host 1542 //this especially happens in cases like 1543 //url.resolveObject('mailto:local1@domain1', 'local2@domain2') 1544 var authInHost = result.host && result.host.indexOf('@') > 0 ? 1545 result.host.split('@') : false; 1546 if (authInHost) { 1547 result.auth = authInHost.shift(); 1548 result.host = result.hostname = authInHost.shift(); 1549 } 1550 } 1551 1552 mustEndAbs = mustEndAbs || (result.host && srcPath.length); 1553 1554 if (mustEndAbs && !isAbsolute) { 1555 srcPath.unshift(''); 1556 } 1557 1558 if (!srcPath.length) { 1559 result.pathname = null; 1560 result.path = null; 1561 } else { 1562 result.pathname = srcPath.join('/'); 1563 } 1564 1565 //to support request.http 1566 if (!util.isNull(result.pathname) || !util.isNull(result.search)) { 1567 result.path = (result.pathname ? result.pathname : '') + 1568 (result.search ? result.search : ''); 1569 } 1570 result.auth = relative.auth || result.auth; 1571 result.slashes = result.slashes || relative.slashes; 1572 result.href = result.format(); 1573 return result; 1574}; 1575 1576Url.prototype.parseHost = function() { 1577 var host = this.host; 1578 var port = portPattern.exec(host); 1579 if (port) { 1580 port = port[0]; 1581 if (port !== ':') { 1582 this.port = port.substr(1); 1583 } 1584 host = host.substr(0, host.length - port.length); 1585 } 1586 if (host) this.hostname = host; 1587}; 1588 1589},{"
1589punycode":"FIMm","./util":"YsIc","querystring":"fk5h"}],"L8tj":[function(require,module,exports) { 1590function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } 1591 1592function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 1593 1594function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } 1595 1596var querystring = require("querystring"); 1597 1598var url = require("url"); 1599 1600parsedUrl = url.parse(location.href); 1601params = querystring.parse(parsedUrl.query); 1602 1603if (params.card_id) { 1604 var cardIDs = params.card_id; 1605 var cardIDsArr = cardIDs.split(","); 1606 1607 var _iterator = _createForOfIteratorHelper(cardIDsArr), 1608 _step; 1609 1610 try { 1611 for (_iterator.s(); !(_step = _iterator.n()).done;) { 1612 var id = _step.value; 1613 1614 var _target = document.querySelector("[name=".concat(id, "]")); 1615 1616 _target.classList.add("flashy"); 1617 } 1618 } catch (err) { 1619 _iterator.e(err); 1620 } finally { 1621 _iterator.f(); 1622 } 1623} else if (params.hashtags) { 1624 var hashTags = params.hashtags; 1625 var hashTagsArr = hashTags.split(","); 1626 1627 var _iterator2 = _createForOfIteratorHelper(hashTagsArr), 1628 _step2; 1629 1630 try { 1631 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { 1632 var cl = _step2.value; 1633 dcl = "div." + cl; 1634 var targets = document.querySelectorAll(dcl); 1635 1636 var _iterator3 = _createForOfIteratorHelper(targets), 1637 _step3; 1638 1639 try { 1640 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { 1641 target = _step3.value; 1642 target.classList.add("flashy"); 1643 var tp = target.querySelector("." + cl); 1644 tp.classList.add("flatag"); 1645 } 1646 } catch (err) { 1647 _iterator3.e(err); 1648 } finally { 1649 _iterator3.f(); 1650 } 1651 } 1652 } catch (err) { 1653 _iterator2.e(err); 1654 } finally { 1655 _iterator2.f(); 1656 } 1657} else { 1658 return; 1659} 1660},{"querystring":"fk5h","url":"Mej7"}]},{},["L8tj"], null) 1661//# sourceMappingURL=/cards.197f7b1a.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.