@dotcms/react 0.0.1-beta.25 → 0.0.1-beta.27

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/index.esm.js CHANGED
@@ -1,13 +1,11 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { s as styleInject, a as anObject$6, f as functionCall, h as hasOwnProperty_1, o as objectIsPrototypeOf, b as functionName, d as defineBuiltIn$6, c as fails$3, t as toString$4, e as functionUncurryThis, r as requireObjectCoercible$1, g as toIntegerOrInfinity$1, i as iteratorDefine, j as internalState, k as createIterResultObject$2, w as wellKnownSymbol$4, l as descriptors, m as classofRaw$1, n as aCallable$2, p as functionBindNative, q as makeBuiltInExports, u as objectDefineProperty, v as getMethod$2, x as iterators, y as getBuiltIn$1, z as isCallable$2, A as classof$3, B as inspectSource$1, C as createPropertyDescriptor$2, D as isNullOrUndefined$1, E as tryToString$1, F as toObject$1, G as lengthOfArrayLike$1, H as global$3, I as arraySlice$2, _ as _export, J as setToStringTag$2, K as iteratorCreateConstructor, L as isObject$1, M as objectCreate, N as objectAssign } from './es.json.stringify.esm.js';
2
+ import { s as styleInject } from './web.url-search-params.size.esm.js';
3
3
  import { useState, useEffect, createContext, useRef, useContext, createElement, forwardRef } from 'react';
4
4
  import { isInsideEditor, initEditor, updateNavigation, destroyEditor, postMessageToEditor, CLIENT_ACTIONS, DotCmsClient, NOTIFY_CLIENT, initInlineEditing } from '@dotcms/client';
5
5
  import { UVEEventType } from '@dotcms/types';
6
6
  import { createUVESubscription } from '@dotcms/uve';
7
7
  import { Editor } from '@tinymce/tinymce-react';
8
8
 
9
- var isPure = false;
10
-
11
9
  /**
12
10
  * Custom Hook to handle the DotCMS editor interaction with the page.
13
11
  *
@@ -479,2220 +477,6 @@ function DotcmsLayout(dotPageProps) {
479
477
  });
480
478
  }
481
479
 
482
- var anObject$5 = anObject$6;
483
-
484
- // `RegExp.prototype.flags` getter implementation
485
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
486
- var regexpFlags = function () {
487
- var that = anObject$5(this);
488
- var result = '';
489
- if (that.hasIndices) result += 'd';
490
- if (that.global) result += 'g';
491
- if (that.ignoreCase) result += 'i';
492
- if (that.multiline) result += 'm';
493
- if (that.dotAll) result += 's';
494
- if (that.unicode) result += 'u';
495
- if (that.unicodeSets) result += 'v';
496
- if (that.sticky) result += 'y';
497
- return result;
498
- };
499
-
500
- var call$5 = functionCall;
501
- var hasOwn$2 = hasOwnProperty_1;
502
- var isPrototypeOf$1 = objectIsPrototypeOf;
503
- var regExpFlags = regexpFlags;
504
-
505
- var RegExpPrototype$1 = RegExp.prototype;
506
-
507
- var regexpGetFlags = function (R) {
508
- var flags = R.flags;
509
- return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$1(RegExpPrototype$1, R)
510
- ? call$5(regExpFlags, R) : flags;
511
- };
512
-
513
- var PROPER_FUNCTION_NAME = functionName.PROPER;
514
- var defineBuiltIn$5 = defineBuiltIn$6;
515
- var anObject$4 = anObject$6;
516
- var $toString$2 = toString$4;
517
- var fails$2 = fails$3;
518
- var getRegExpFlags = regexpGetFlags;
519
-
520
- var TO_STRING = 'toString';
521
- var RegExpPrototype = RegExp.prototype;
522
- var nativeToString = RegExpPrototype[TO_STRING];
523
-
524
- var NOT_GENERIC = fails$2(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
525
- // FF44- RegExp#toString has a wrong name
526
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
527
-
528
- // `RegExp.prototype.toString` method
529
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
530
- if (NOT_GENERIC || INCORRECT_NAME) {
531
- defineBuiltIn$5(RegExpPrototype, TO_STRING, function toString() {
532
- var R = anObject$4(this);
533
- var pattern = $toString$2(R.source);
534
- var flags = $toString$2(getRegExpFlags(R));
535
- return '/' + pattern + '/' + flags;
536
- }, { unsafe: true });
537
- }
538
-
539
- var uncurryThis$9 = functionUncurryThis;
540
- var toIntegerOrInfinity = toIntegerOrInfinity$1;
541
- var toString$3 = toString$4;
542
- var requireObjectCoercible = requireObjectCoercible$1;
543
-
544
- var charAt$3 = uncurryThis$9(''.charAt);
545
- var charCodeAt$1 = uncurryThis$9(''.charCodeAt);
546
- var stringSlice$2 = uncurryThis$9(''.slice);
547
-
548
- var createMethod = function (CONVERT_TO_STRING) {
549
- return function ($this, pos) {
550
- var S = toString$3(requireObjectCoercible($this));
551
- var position = toIntegerOrInfinity(pos);
552
- var size = S.length;
553
- var first, second;
554
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
555
- first = charCodeAt$1(S, position);
556
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
557
- || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
558
- ? CONVERT_TO_STRING
559
- ? charAt$3(S, position)
560
- : first
561
- : CONVERT_TO_STRING
562
- ? stringSlice$2(S, position, position + 2)
563
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
564
- };
565
- };
566
-
567
- var stringMultibyte = {
568
- // `String.prototype.codePointAt` method
569
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
570
- codeAt: createMethod(false),
571
- // `String.prototype.at` method
572
- // https://github.com/mathiasbynens/String.prototype.at
573
- charAt: createMethod(true)
574
- };
575
-
576
- var charAt$2 = stringMultibyte.charAt;
577
- var toString$2 = toString$4;
578
- var InternalStateModule$2 = internalState;
579
- var defineIterator = iteratorDefine;
580
- var createIterResultObject$1 = createIterResultObject$2;
581
-
582
- var STRING_ITERATOR = 'String Iterator';
583
- var setInternalState$2 = InternalStateModule$2.set;
584
- var getInternalState = InternalStateModule$2.getterFor(STRING_ITERATOR);
585
-
586
- // `String.prototype[@@iterator]` method
587
- // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
588
- defineIterator(String, 'String', function (iterated) {
589
- setInternalState$2(this, {
590
- type: STRING_ITERATOR,
591
- string: toString$2(iterated),
592
- index: 0
593
- });
594
- // `%StringIteratorPrototype%.next` method
595
- // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
596
- }, function next() {
597
- var state = getInternalState(this);
598
- var string = state.string;
599
- var index = state.index;
600
- var point;
601
- if (index >= string.length) return createIterResultObject$1(undefined, true);
602
- point = charAt$2(string, index);
603
- state.index += point.length;
604
- return createIterResultObject$1(point, false);
605
- });
606
-
607
- var fails$1 = fails$3;
608
- var wellKnownSymbol$3 = wellKnownSymbol$4;
609
- var DESCRIPTORS$5 = descriptors;
610
- var IS_PURE = isPure;
611
-
612
- var ITERATOR$3 = wellKnownSymbol$3('iterator');
613
-
614
- var urlConstructorDetection = !fails$1(function () {
615
- // eslint-disable-next-line unicorn/relative-url-style -- required for testing
616
- var url = new URL('b?a=1&b=2&c=3', 'http://a');
617
- var params = url.searchParams;
618
- var params2 = new URLSearchParams('a=1&a=2&b=3');
619
- var result = '';
620
- url.pathname = 'c%20d';
621
- params.forEach(function (value, key) {
622
- params['delete']('b');
623
- result += key + value;
624
- });
625
- params2['delete']('a', 2);
626
- // `undefined` case is a Chromium 117 bug
627
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
628
- params2['delete']('b', undefined);
629
- return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b')))
630
- || (!params.size && (IS_PURE || !DESCRIPTORS$5))
631
- || !params.sort
632
- || url.href !== 'http://a/c%20d?a=1&c=3'
633
- || params.get('c') !== '3'
634
- || String(new URLSearchParams('?a=1')) !== 'a=1'
635
- || !params[ITERATOR$3]
636
- // throws in Edge
637
- || new URL('https://a@b').username !== 'a'
638
- || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
639
- // not punycoded in Edge
640
- || new URL('http://тест').host !== 'xn--e1aybc'
641
- // not escaped in Chrome 62-
642
- || new URL('http://a#б').hash !== '#%D0%B1'
643
- // fails in Chrome 66-
644
- || result !== 'a1c3'
645
- // throws in Safari
646
- || new URL('http://x', undefined).host !== 'x';
647
- });
648
-
649
- var classofRaw = classofRaw$1;
650
- var uncurryThis$8 = functionUncurryThis;
651
-
652
- var functionUncurryThisClause = function (fn) {
653
- // Nashorn bug:
654
- // https://github.com/zloirock/core-js/issues/1128
655
- // https://github.com/zloirock/core-js/issues/1130
656
- if (classofRaw(fn) === 'Function') return uncurryThis$8(fn);
657
- };
658
-
659
- var uncurryThis$7 = functionUncurryThisClause;
660
- var aCallable$1 = aCallable$2;
661
- var NATIVE_BIND = functionBindNative;
662
-
663
- var bind$3 = uncurryThis$7(uncurryThis$7.bind);
664
-
665
- // optional / simple context binding
666
- var functionBindContext = function (fn, that) {
667
- aCallable$1(fn);
668
- return that === undefined ? fn : NATIVE_BIND ? bind$3(fn, that) : function (/* ...args */) {
669
- return fn.apply(that, arguments);
670
- };
671
- };
672
-
673
- var makeBuiltIn = makeBuiltInExports;
674
- var defineProperty = objectDefineProperty;
675
-
676
- var defineBuiltInAccessor$3 = function (target, name, descriptor) {
677
- if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
678
- if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
679
- return defineProperty.f(target, name, descriptor);
680
- };
681
-
682
- var isPrototypeOf = objectIsPrototypeOf;
683
-
684
- var $TypeError$2 = TypeError;
685
-
686
- var anInstance$2 = function (it, Prototype) {
687
- if (isPrototypeOf(Prototype, it)) return it;
688
- throw new $TypeError$2('Incorrect invocation');
689
- };
690
-
691
- var call$4 = functionCall;
692
- var anObject$3 = anObject$6;
693
- var getMethod$1 = getMethod$2;
694
-
695
- var iteratorClose$1 = function (iterator, kind, value) {
696
- var innerResult, innerError;
697
- anObject$3(iterator);
698
- try {
699
- innerResult = getMethod$1(iterator, 'return');
700
- if (!innerResult) {
701
- if (kind === 'throw') throw value;
702
- return value;
703
- }
704
- innerResult = call$4(innerResult, iterator);
705
- } catch (error) {
706
- innerError = true;
707
- innerResult = error;
708
- }
709
- if (kind === 'throw') throw value;
710
- if (innerError) throw innerResult;
711
- anObject$3(innerResult);
712
- return value;
713
- };
714
-
715
- var anObject$2 = anObject$6;
716
- var iteratorClose = iteratorClose$1;
717
-
718
- // call something on iterator step with safe closing on error
719
- var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
720
- try {
721
- return ENTRIES ? fn(anObject$2(value)[0], value[1]) : fn(value);
722
- } catch (error) {
723
- iteratorClose(iterator, 'throw', error);
724
- }
725
- };
726
-
727
- var wellKnownSymbol$2 = wellKnownSymbol$4;
728
- var Iterators$1 = iterators;
729
-
730
- var ITERATOR$2 = wellKnownSymbol$2('iterator');
731
- var ArrayPrototype = Array.prototype;
732
-
733
- // check on default Array iterator
734
- var isArrayIteratorMethod$1 = function (it) {
735
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
736
- };
737
-
738
- var uncurryThis$6 = functionUncurryThis;
739
- var fails = fails$3;
740
- var isCallable$1 = isCallable$2;
741
- var classof$2 = classof$3;
742
- var getBuiltIn = getBuiltIn$1;
743
- var inspectSource = inspectSource$1;
744
-
745
- var noop = function () { /* empty */ };
746
- var construct = getBuiltIn('Reflect', 'construct');
747
- var constructorRegExp = /^\s*(?:class|function)\b/;
748
- var exec$2 = uncurryThis$6(constructorRegExp.exec);
749
- var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
750
-
751
- var isConstructorModern = function isConstructor(argument) {
752
- if (!isCallable$1(argument)) return false;
753
- try {
754
- construct(noop, [], argument);
755
- return true;
756
- } catch (error) {
757
- return false;
758
- }
759
- };
760
-
761
- var isConstructorLegacy = function isConstructor(argument) {
762
- if (!isCallable$1(argument)) return false;
763
- switch (classof$2(argument)) {
764
- case 'AsyncFunction':
765
- case 'GeneratorFunction':
766
- case 'AsyncGeneratorFunction': return false;
767
- }
768
- try {
769
- // we can't check .prototype since constructors produced by .bind haven't it
770
- // `Function#toString` throws on some built-it function in some legacy engines
771
- // (for example, `DOMQuad` and similar in FF41-)
772
- return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource(argument));
773
- } catch (error) {
774
- return true;
775
- }
776
- };
777
-
778
- isConstructorLegacy.sham = true;
779
-
780
- // `IsConstructor` abstract operation
781
- // https://tc39.es/ecma262/#sec-isconstructor
782
- var isConstructor$1 = !construct || fails(function () {
783
- var called;
784
- return isConstructorModern(isConstructorModern.call)
785
- || !isConstructorModern(Object)
786
- || !isConstructorModern(function () { called = true; })
787
- || called;
788
- }) ? isConstructorLegacy : isConstructorModern;
789
-
790
- var DESCRIPTORS$4 = descriptors;
791
- var definePropertyModule = objectDefineProperty;
792
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
793
-
794
- var createProperty$1 = function (object, key, value) {
795
- if (DESCRIPTORS$4) definePropertyModule.f(object, key, createPropertyDescriptor$1(0, value));
796
- else object[key] = value;
797
- };
798
-
799
- var classof$1 = classof$3;
800
- var getMethod = getMethod$2;
801
- var isNullOrUndefined = isNullOrUndefined$1;
802
- var Iterators = iterators;
803
- var wellKnownSymbol$1 = wellKnownSymbol$4;
804
-
805
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
806
-
807
- var getIteratorMethod$3 = function (it) {
808
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$1)
809
- || getMethod(it, '@@iterator')
810
- || Iterators[classof$1(it)];
811
- };
812
-
813
- var call$3 = functionCall;
814
- var aCallable = aCallable$2;
815
- var anObject$1 = anObject$6;
816
- var tryToString = tryToString$1;
817
- var getIteratorMethod$2 = getIteratorMethod$3;
818
-
819
- var $TypeError$1 = TypeError;
820
-
821
- var getIterator$2 = function (argument, usingIterator) {
822
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$2(argument) : usingIterator;
823
- if (aCallable(iteratorMethod)) return anObject$1(call$3(iteratorMethod, argument));
824
- throw new $TypeError$1(tryToString(argument) + ' is not iterable');
825
- };
826
-
827
- var bind$2 = functionBindContext;
828
- var call$2 = functionCall;
829
- var toObject = toObject$1;
830
- var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
831
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
832
- var isConstructor = isConstructor$1;
833
- var lengthOfArrayLike = lengthOfArrayLike$1;
834
- var createProperty = createProperty$1;
835
- var getIterator$1 = getIterator$2;
836
- var getIteratorMethod$1 = getIteratorMethod$3;
837
-
838
- var $Array = Array;
839
-
840
- // `Array.from` method implementation
841
- // https://tc39.es/ecma262/#sec-array.from
842
- var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
843
- var O = toObject(arrayLike);
844
- var IS_CONSTRUCTOR = isConstructor(this);
845
- var argumentsLength = arguments.length;
846
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
847
- var mapping = mapfn !== undefined;
848
- if (mapping) mapfn = bind$2(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
849
- var iteratorMethod = getIteratorMethod$1(O);
850
- var index = 0;
851
- var length, result, step, iterator, next, value;
852
- // if the target is not iterable or it's an array with the default iterator - use a simple case
853
- if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
854
- result = IS_CONSTRUCTOR ? new this() : [];
855
- iterator = getIterator$1(O, iteratorMethod);
856
- next = iterator.next;
857
- for (;!(step = call$2(next, iterator)).done; index++) {
858
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
859
- createProperty(result, index, value);
860
- }
861
- } else {
862
- length = lengthOfArrayLike(O);
863
- result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
864
- for (;length > index; index++) {
865
- value = mapping ? mapfn(O[index], index) : O[index];
866
- createProperty(result, index, value);
867
- }
868
- }
869
- result.length = index;
870
- return result;
871
- };
872
-
873
- // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
874
- var uncurryThis$5 = functionUncurryThis;
875
-
876
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
877
- var base = 36;
878
- var tMin = 1;
879
- var tMax = 26;
880
- var skew = 38;
881
- var damp = 700;
882
- var initialBias = 72;
883
- var initialN = 128; // 0x80
884
- var delimiter = '-'; // '\x2D'
885
- var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
886
- var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
887
- var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
888
- var baseMinusTMin = base - tMin;
889
-
890
- var $RangeError = RangeError;
891
- var exec$1 = uncurryThis$5(regexSeparators.exec);
892
- var floor$2 = Math.floor;
893
- var fromCharCode = String.fromCharCode;
894
- var charCodeAt = uncurryThis$5(''.charCodeAt);
895
- var join$2 = uncurryThis$5([].join);
896
- var push$3 = uncurryThis$5([].push);
897
- var replace$2 = uncurryThis$5(''.replace);
898
- var split$2 = uncurryThis$5(''.split);
899
- var toLowerCase$1 = uncurryThis$5(''.toLowerCase);
900
-
901
- /**
902
- * Creates an array containing the numeric code points of each Unicode
903
- * character in the string. While JavaScript uses UCS-2 internally,
904
- * this function will convert a pair of surrogate halves (each of which
905
- * UCS-2 exposes as separate characters) into a single code point,
906
- * matching UTF-16.
907
- */
908
- var ucs2decode = function (string) {
909
- var output = [];
910
- var counter = 0;
911
- var length = string.length;
912
- while (counter < length) {
913
- var value = charCodeAt(string, counter++);
914
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
915
- // It's a high surrogate, and there is a next character.
916
- var extra = charCodeAt(string, counter++);
917
- if ((extra & 0xFC00) === 0xDC00) { // Low surrogate.
918
- push$3(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
919
- } else {
920
- // It's an unmatched surrogate; only append this code unit, in case the
921
- // next code unit is the high surrogate of a surrogate pair.
922
- push$3(output, value);
923
- counter--;
924
- }
925
- } else {
926
- push$3(output, value);
927
- }
928
- }
929
- return output;
930
- };
931
-
932
- /**
933
- * Converts a digit/integer into a basic code point.
934
- */
935
- var digitToBasic = function (digit) {
936
- // 0..25 map to ASCII a..z or A..Z
937
- // 26..35 map to ASCII 0..9
938
- return digit + 22 + 75 * (digit < 26);
939
- };
940
-
941
- /**
942
- * Bias adaptation function as per section 3.4 of RFC 3492.
943
- * https://tools.ietf.org/html/rfc3492#section-3.4
944
- */
945
- var adapt = function (delta, numPoints, firstTime) {
946
- var k = 0;
947
- delta = firstTime ? floor$2(delta / damp) : delta >> 1;
948
- delta += floor$2(delta / numPoints);
949
- while (delta > baseMinusTMin * tMax >> 1) {
950
- delta = floor$2(delta / baseMinusTMin);
951
- k += base;
952
- }
953
- return floor$2(k + (baseMinusTMin + 1) * delta / (delta + skew));
954
- };
955
-
956
- /**
957
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
958
- * Punycode string of ASCII-only symbols.
959
- */
960
- var encode = function (input) {
961
- var output = [];
962
-
963
- // Convert the input in UCS-2 to an array of Unicode code points.
964
- input = ucs2decode(input);
965
-
966
- // Cache the length.
967
- var inputLength = input.length;
968
-
969
- // Initialize the state.
970
- var n = initialN;
971
- var delta = 0;
972
- var bias = initialBias;
973
- var i, currentValue;
974
-
975
- // Handle the basic code points.
976
- for (i = 0; i < input.length; i++) {
977
- currentValue = input[i];
978
- if (currentValue < 0x80) {
979
- push$3(output, fromCharCode(currentValue));
980
- }
981
- }
982
-
983
- var basicLength = output.length; // number of basic code points.
984
- var handledCPCount = basicLength; // number of code points that have been handled;
985
-
986
- // Finish the basic string with a delimiter unless it's empty.
987
- if (basicLength) {
988
- push$3(output, delimiter);
989
- }
990
-
991
- // Main encoding loop:
992
- while (handledCPCount < inputLength) {
993
- // All non-basic code points < n have been handled already. Find the next larger one:
994
- var m = maxInt;
995
- for (i = 0; i < input.length; i++) {
996
- currentValue = input[i];
997
- if (currentValue >= n && currentValue < m) {
998
- m = currentValue;
999
- }
1000
- }
1001
-
1002
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
1003
- var handledCPCountPlusOne = handledCPCount + 1;
1004
- if (m - n > floor$2((maxInt - delta) / handledCPCountPlusOne)) {
1005
- throw new $RangeError(OVERFLOW_ERROR);
1006
- }
1007
-
1008
- delta += (m - n) * handledCPCountPlusOne;
1009
- n = m;
1010
-
1011
- for (i = 0; i < input.length; i++) {
1012
- currentValue = input[i];
1013
- if (currentValue < n && ++delta > maxInt) {
1014
- throw new $RangeError(OVERFLOW_ERROR);
1015
- }
1016
- if (currentValue === n) {
1017
- // Represent delta as a generalized variable-length integer.
1018
- var q = delta;
1019
- var k = base;
1020
- while (true) {
1021
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
1022
- if (q < t) break;
1023
- var qMinusT = q - t;
1024
- var baseMinusT = base - t;
1025
- push$3(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
1026
- q = floor$2(qMinusT / baseMinusT);
1027
- k += base;
1028
- }
1029
-
1030
- push$3(output, fromCharCode(digitToBasic(q)));
1031
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
1032
- delta = 0;
1033
- handledCPCount++;
1034
- }
1035
- }
1036
-
1037
- delta++;
1038
- n++;
1039
- }
1040
- return join$2(output, '');
1041
- };
1042
-
1043
- var stringPunycodeToAscii = function (input) {
1044
- var encoded = [];
1045
- var labels = split$2(replace$2(toLowerCase$1(input), regexSeparators, '\u002E'), '.');
1046
- var i, label;
1047
- for (i = 0; i < labels.length; i++) {
1048
- label = labels[i];
1049
- push$3(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode(label) : label);
1050
- }
1051
- return join$2(encoded, '.');
1052
- };
1053
-
1054
- var $TypeError = TypeError;
1055
-
1056
- var validateArgumentsLength$4 = function (passed, required) {
1057
- if (passed < required) throw new $TypeError('Not enough arguments');
1058
- return passed;
1059
- };
1060
-
1061
- var global$2 = global$3;
1062
- var DESCRIPTORS$3 = descriptors;
1063
-
1064
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1065
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1066
-
1067
- // Avoid NodeJS experimental warning
1068
- var safeGetBuiltIn$1 = function (name) {
1069
- if (!DESCRIPTORS$3) return global$2[name];
1070
- var descriptor = getOwnPropertyDescriptor(global$2, name);
1071
- return descriptor && descriptor.value;
1072
- };
1073
-
1074
- var defineBuiltIn$4 = defineBuiltIn$6;
1075
-
1076
- var defineBuiltIns$1 = function (target, src, options) {
1077
- for (var key in src) defineBuiltIn$4(target, key, src[key], options);
1078
- return target;
1079
- };
1080
-
1081
- var arraySlice$1 = arraySlice$2;
1082
-
1083
- var floor$1 = Math.floor;
1084
-
1085
- var sort = function (array, comparefn) {
1086
- var length = array.length;
1087
-
1088
- if (length < 8) {
1089
- // insertion sort
1090
- var i = 1;
1091
- var element, j;
1092
-
1093
- while (i < length) {
1094
- j = i;
1095
- element = array[i];
1096
- while (j && comparefn(array[j - 1], element) > 0) {
1097
- array[j] = array[--j];
1098
- }
1099
- if (j !== i++) array[j] = element;
1100
- }
1101
- } else {
1102
- // merge sort
1103
- var middle = floor$1(length / 2);
1104
- var left = sort(arraySlice$1(array, 0, middle), comparefn);
1105
- var right = sort(arraySlice$1(array, middle), comparefn);
1106
- var llength = left.length;
1107
- var rlength = right.length;
1108
- var lindex = 0;
1109
- var rindex = 0;
1110
-
1111
- while (lindex < llength || rindex < rlength) {
1112
- array[lindex + rindex] = (lindex < llength && rindex < rlength)
1113
- ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
1114
- : lindex < llength ? left[lindex++] : right[rindex++];
1115
- }
1116
- }
1117
-
1118
- return array;
1119
- };
1120
-
1121
- var arraySort$1 = sort;
1122
-
1123
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
1124
-
1125
- var $$2 = _export;
1126
- var global$1 = global$3;
1127
- var safeGetBuiltIn = safeGetBuiltIn$1;
1128
- var call$1 = functionCall;
1129
- var uncurryThis$4 = functionUncurryThis;
1130
- var DESCRIPTORS$2 = descriptors;
1131
- var USE_NATIVE_URL$1 = urlConstructorDetection;
1132
- var defineBuiltIn$3 = defineBuiltIn$6;
1133
- var defineBuiltInAccessor$2 = defineBuiltInAccessor$3;
1134
- var defineBuiltIns = defineBuiltIns$1;
1135
- var setToStringTag$1 = setToStringTag$2;
1136
- var createIteratorConstructor = iteratorCreateConstructor;
1137
- var InternalStateModule$1 = internalState;
1138
- var anInstance$1 = anInstance$2;
1139
- var isCallable = isCallable$2;
1140
- var hasOwn$1 = hasOwnProperty_1;
1141
- var bind$1 = functionBindContext;
1142
- var classof = classof$3;
1143
- var anObject = anObject$6;
1144
- var isObject = isObject$1;
1145
- var $toString$1 = toString$4;
1146
- var create = objectCreate;
1147
- var createPropertyDescriptor = createPropertyDescriptor$2;
1148
- var getIterator = getIterator$2;
1149
- var getIteratorMethod = getIteratorMethod$3;
1150
- var createIterResultObject = createIterResultObject$2;
1151
- var validateArgumentsLength$3 = validateArgumentsLength$4;
1152
- var wellKnownSymbol = wellKnownSymbol$4;
1153
- var arraySort = arraySort$1;
1154
-
1155
- var ITERATOR = wellKnownSymbol('iterator');
1156
- var URL_SEARCH_PARAMS = 'URLSearchParams';
1157
- var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
1158
- var setInternalState$1 = InternalStateModule$1.set;
1159
- var getInternalParamsState = InternalStateModule$1.getterFor(URL_SEARCH_PARAMS);
1160
- var getInternalIteratorState = InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR);
1161
-
1162
- var nativeFetch = safeGetBuiltIn('fetch');
1163
- var NativeRequest = safeGetBuiltIn('Request');
1164
- var Headers = safeGetBuiltIn('Headers');
1165
- var RequestPrototype = NativeRequest && NativeRequest.prototype;
1166
- var HeadersPrototype = Headers && Headers.prototype;
1167
- var RegExp$1 = global$1.RegExp;
1168
- var TypeError$2 = global$1.TypeError;
1169
- var decodeURIComponent = global$1.decodeURIComponent;
1170
- var encodeURIComponent$1 = global$1.encodeURIComponent;
1171
- var charAt$1 = uncurryThis$4(''.charAt);
1172
- var join$1 = uncurryThis$4([].join);
1173
- var push$2 = uncurryThis$4([].push);
1174
- var replace$1 = uncurryThis$4(''.replace);
1175
- var shift$1 = uncurryThis$4([].shift);
1176
- var splice = uncurryThis$4([].splice);
1177
- var split$1 = uncurryThis$4(''.split);
1178
- var stringSlice$1 = uncurryThis$4(''.slice);
1179
-
1180
- var plus = /\+/g;
1181
- var sequences = Array(4);
1182
-
1183
- var percentSequence = function (bytes) {
1184
- return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp$1('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
1185
- };
1186
-
1187
- var percentDecode = function (sequence) {
1188
- try {
1189
- return decodeURIComponent(sequence);
1190
- } catch (error) {
1191
- return sequence;
1192
- }
1193
- };
1194
-
1195
- var deserialize = function (it) {
1196
- var result = replace$1(it, plus, ' ');
1197
- var bytes = 4;
1198
- try {
1199
- return decodeURIComponent(result);
1200
- } catch (error) {
1201
- while (bytes) {
1202
- result = replace$1(result, percentSequence(bytes--), percentDecode);
1203
- }
1204
- return result;
1205
- }
1206
- };
1207
-
1208
- var find = /[!'()~]|%20/g;
1209
-
1210
- var replacements = {
1211
- '!': '%21',
1212
- "'": '%27',
1213
- '(': '%28',
1214
- ')': '%29',
1215
- '~': '%7E',
1216
- '%20': '+'
1217
- };
1218
-
1219
- var replacer = function (match) {
1220
- return replacements[match];
1221
- };
1222
-
1223
- var serialize = function (it) {
1224
- return replace$1(encodeURIComponent$1(it), find, replacer);
1225
- };
1226
-
1227
- var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
1228
- setInternalState$1(this, {
1229
- type: URL_SEARCH_PARAMS_ITERATOR,
1230
- target: getInternalParamsState(params).entries,
1231
- index: 0,
1232
- kind: kind
1233
- });
1234
- }, URL_SEARCH_PARAMS, function next() {
1235
- var state = getInternalIteratorState(this);
1236
- var target = state.target;
1237
- var index = state.index++;
1238
- if (!target || index >= target.length) {
1239
- state.target = undefined;
1240
- return createIterResultObject(undefined, true);
1241
- }
1242
- var entry = target[index];
1243
- switch (state.kind) {
1244
- case 'keys': return createIterResultObject(entry.key, false);
1245
- case 'values': return createIterResultObject(entry.value, false);
1246
- } return createIterResultObject([entry.key, entry.value], false);
1247
- }, true);
1248
-
1249
- var URLSearchParamsState = function (init) {
1250
- this.entries = [];
1251
- this.url = null;
1252
-
1253
- if (init !== undefined) {
1254
- if (isObject(init)) this.parseObject(init);
1255
- else this.parseQuery(typeof init == 'string' ? charAt$1(init, 0) === '?' ? stringSlice$1(init, 1) : init : $toString$1(init));
1256
- }
1257
- };
1258
-
1259
- URLSearchParamsState.prototype = {
1260
- type: URL_SEARCH_PARAMS,
1261
- bindURL: function (url) {
1262
- this.url = url;
1263
- this.update();
1264
- },
1265
- parseObject: function (object) {
1266
- var entries = this.entries;
1267
- var iteratorMethod = getIteratorMethod(object);
1268
- var iterator, next, step, entryIterator, entryNext, first, second;
1269
-
1270
- if (iteratorMethod) {
1271
- iterator = getIterator(object, iteratorMethod);
1272
- next = iterator.next;
1273
- while (!(step = call$1(next, iterator)).done) {
1274
- entryIterator = getIterator(anObject(step.value));
1275
- entryNext = entryIterator.next;
1276
- if (
1277
- (first = call$1(entryNext, entryIterator)).done ||
1278
- (second = call$1(entryNext, entryIterator)).done ||
1279
- !call$1(entryNext, entryIterator).done
1280
- ) throw new TypeError$2('Expected sequence with length 2');
1281
- push$2(entries, { key: $toString$1(first.value), value: $toString$1(second.value) });
1282
- }
1283
- } else for (var key in object) if (hasOwn$1(object, key)) {
1284
- push$2(entries, { key: key, value: $toString$1(object[key]) });
1285
- }
1286
- },
1287
- parseQuery: function (query) {
1288
- if (query) {
1289
- var entries = this.entries;
1290
- var attributes = split$1(query, '&');
1291
- var index = 0;
1292
- var attribute, entry;
1293
- while (index < attributes.length) {
1294
- attribute = attributes[index++];
1295
- if (attribute.length) {
1296
- entry = split$1(attribute, '=');
1297
- push$2(entries, {
1298
- key: deserialize(shift$1(entry)),
1299
- value: deserialize(join$1(entry, '='))
1300
- });
1301
- }
1302
- }
1303
- }
1304
- },
1305
- serialize: function () {
1306
- var entries = this.entries;
1307
- var result = [];
1308
- var index = 0;
1309
- var entry;
1310
- while (index < entries.length) {
1311
- entry = entries[index++];
1312
- push$2(result, serialize(entry.key) + '=' + serialize(entry.value));
1313
- } return join$1(result, '&');
1314
- },
1315
- update: function () {
1316
- this.entries.length = 0;
1317
- this.parseQuery(this.url.query);
1318
- },
1319
- updateURL: function () {
1320
- if (this.url) this.url.update();
1321
- }
1322
- };
1323
-
1324
- // `URLSearchParams` constructor
1325
- // https://url.spec.whatwg.org/#interface-urlsearchparams
1326
- var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
1327
- anInstance$1(this, URLSearchParamsPrototype$3);
1328
- var init = arguments.length > 0 ? arguments[0] : undefined;
1329
- var state = setInternalState$1(this, new URLSearchParamsState(init));
1330
- if (!DESCRIPTORS$2) this.size = state.entries.length;
1331
- };
1332
-
1333
- var URLSearchParamsPrototype$3 = URLSearchParamsConstructor.prototype;
1334
-
1335
- defineBuiltIns(URLSearchParamsPrototype$3, {
1336
- // `URLSearchParams.prototype.append` method
1337
- // https://url.spec.whatwg.org/#dom-urlsearchparams-append
1338
- append: function append(name, value) {
1339
- var state = getInternalParamsState(this);
1340
- validateArgumentsLength$3(arguments.length, 2);
1341
- push$2(state.entries, { key: $toString$1(name), value: $toString$1(value) });
1342
- if (!DESCRIPTORS$2) this.length++;
1343
- state.updateURL();
1344
- },
1345
- // `URLSearchParams.prototype.delete` method
1346
- // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
1347
- 'delete': function (name /* , value */) {
1348
- var state = getInternalParamsState(this);
1349
- var length = validateArgumentsLength$3(arguments.length, 1);
1350
- var entries = state.entries;
1351
- var key = $toString$1(name);
1352
- var $value = length < 2 ? undefined : arguments[1];
1353
- var value = $value === undefined ? $value : $toString$1($value);
1354
- var index = 0;
1355
- while (index < entries.length) {
1356
- var entry = entries[index];
1357
- if (entry.key === key && (value === undefined || entry.value === value)) {
1358
- splice(entries, index, 1);
1359
- if (value !== undefined) break;
1360
- } else index++;
1361
- }
1362
- if (!DESCRIPTORS$2) this.size = entries.length;
1363
- state.updateURL();
1364
- },
1365
- // `URLSearchParams.prototype.get` method
1366
- // https://url.spec.whatwg.org/#dom-urlsearchparams-get
1367
- get: function get(name) {
1368
- var entries = getInternalParamsState(this).entries;
1369
- validateArgumentsLength$3(arguments.length, 1);
1370
- var key = $toString$1(name);
1371
- var index = 0;
1372
- for (; index < entries.length; index++) {
1373
- if (entries[index].key === key) return entries[index].value;
1374
- }
1375
- return null;
1376
- },
1377
- // `URLSearchParams.prototype.getAll` method
1378
- // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
1379
- getAll: function getAll(name) {
1380
- var entries = getInternalParamsState(this).entries;
1381
- validateArgumentsLength$3(arguments.length, 1);
1382
- var key = $toString$1(name);
1383
- var result = [];
1384
- var index = 0;
1385
- for (; index < entries.length; index++) {
1386
- if (entries[index].key === key) push$2(result, entries[index].value);
1387
- }
1388
- return result;
1389
- },
1390
- // `URLSearchParams.prototype.has` method
1391
- // https://url.spec.whatwg.org/#dom-urlsearchparams-has
1392
- has: function has(name /* , value */) {
1393
- var entries = getInternalParamsState(this).entries;
1394
- var length = validateArgumentsLength$3(arguments.length, 1);
1395
- var key = $toString$1(name);
1396
- var $value = length < 2 ? undefined : arguments[1];
1397
- var value = $value === undefined ? $value : $toString$1($value);
1398
- var index = 0;
1399
- while (index < entries.length) {
1400
- var entry = entries[index++];
1401
- if (entry.key === key && (value === undefined || entry.value === value)) return true;
1402
- }
1403
- return false;
1404
- },
1405
- // `URLSearchParams.prototype.set` method
1406
- // https://url.spec.whatwg.org/#dom-urlsearchparams-set
1407
- set: function set(name, value) {
1408
- var state = getInternalParamsState(this);
1409
- validateArgumentsLength$3(arguments.length, 1);
1410
- var entries = state.entries;
1411
- var found = false;
1412
- var key = $toString$1(name);
1413
- var val = $toString$1(value);
1414
- var index = 0;
1415
- var entry;
1416
- for (; index < entries.length; index++) {
1417
- entry = entries[index];
1418
- if (entry.key === key) {
1419
- if (found) splice(entries, index--, 1);
1420
- else {
1421
- found = true;
1422
- entry.value = val;
1423
- }
1424
- }
1425
- }
1426
- if (!found) push$2(entries, { key: key, value: val });
1427
- if (!DESCRIPTORS$2) this.size = entries.length;
1428
- state.updateURL();
1429
- },
1430
- // `URLSearchParams.prototype.sort` method
1431
- // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
1432
- sort: function sort() {
1433
- var state = getInternalParamsState(this);
1434
- arraySort(state.entries, function (a, b) {
1435
- return a.key > b.key ? 1 : -1;
1436
- });
1437
- state.updateURL();
1438
- },
1439
- // `URLSearchParams.prototype.forEach` method
1440
- forEach: function forEach(callback /* , thisArg */) {
1441
- var entries = getInternalParamsState(this).entries;
1442
- var boundFunction = bind$1(callback, arguments.length > 1 ? arguments[1] : undefined);
1443
- var index = 0;
1444
- var entry;
1445
- while (index < entries.length) {
1446
- entry = entries[index++];
1447
- boundFunction(entry.value, entry.key, this);
1448
- }
1449
- },
1450
- // `URLSearchParams.prototype.keys` method
1451
- keys: function keys() {
1452
- return new URLSearchParamsIterator(this, 'keys');
1453
- },
1454
- // `URLSearchParams.prototype.values` method
1455
- values: function values() {
1456
- return new URLSearchParamsIterator(this, 'values');
1457
- },
1458
- // `URLSearchParams.prototype.entries` method
1459
- entries: function entries() {
1460
- return new URLSearchParamsIterator(this, 'entries');
1461
- }
1462
- }, { enumerable: true });
1463
-
1464
- // `URLSearchParams.prototype[@@iterator]` method
1465
- defineBuiltIn$3(URLSearchParamsPrototype$3, ITERATOR, URLSearchParamsPrototype$3.entries, { name: 'entries' });
1466
-
1467
- // `URLSearchParams.prototype.toString` method
1468
- // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
1469
- defineBuiltIn$3(URLSearchParamsPrototype$3, 'toString', function toString() {
1470
- return getInternalParamsState(this).serialize();
1471
- }, { enumerable: true });
1472
-
1473
- // `URLSearchParams.prototype.size` getter
1474
- // https://github.com/whatwg/url/pull/734
1475
- if (DESCRIPTORS$2) defineBuiltInAccessor$2(URLSearchParamsPrototype$3, 'size', {
1476
- get: function size() {
1477
- return getInternalParamsState(this).entries.length;
1478
- },
1479
- configurable: true,
1480
- enumerable: true
1481
- });
1482
-
1483
- setToStringTag$1(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
1484
-
1485
- $$2({ global: true, constructor: true, forced: !USE_NATIVE_URL$1 }, {
1486
- URLSearchParams: URLSearchParamsConstructor
1487
- });
1488
-
1489
- // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`
1490
- if (!USE_NATIVE_URL$1 && isCallable(Headers)) {
1491
- var headersHas = uncurryThis$4(HeadersPrototype.has);
1492
- var headersSet = uncurryThis$4(HeadersPrototype.set);
1493
-
1494
- var wrapRequestOptions = function (init) {
1495
- if (isObject(init)) {
1496
- var body = init.body;
1497
- var headers;
1498
- if (classof(body) === URL_SEARCH_PARAMS) {
1499
- headers = init.headers ? new Headers(init.headers) : new Headers();
1500
- if (!headersHas(headers, 'content-type')) {
1501
- headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
1502
- }
1503
- return create(init, {
1504
- body: createPropertyDescriptor(0, $toString$1(body)),
1505
- headers: createPropertyDescriptor(0, headers)
1506
- });
1507
- }
1508
- } return init;
1509
- };
1510
-
1511
- if (isCallable(nativeFetch)) {
1512
- $$2({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
1513
- fetch: function fetch(input /* , init */) {
1514
- return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
1515
- }
1516
- });
1517
- }
1518
-
1519
- if (isCallable(NativeRequest)) {
1520
- var RequestConstructor = function Request(input /* , init */) {
1521
- anInstance$1(this, RequestPrototype);
1522
- return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
1523
- };
1524
-
1525
- RequestPrototype.constructor = RequestConstructor;
1526
- RequestConstructor.prototype = RequestPrototype;
1527
-
1528
- $$2({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
1529
- Request: RequestConstructor
1530
- });
1531
- }
1532
- }
1533
-
1534
- var web_urlSearchParams_constructor = {
1535
- URLSearchParams: URLSearchParamsConstructor,
1536
- getState: getInternalParamsState
1537
- };
1538
-
1539
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
1540
-
1541
- var $$1 = _export;
1542
- var DESCRIPTORS$1 = descriptors;
1543
- var USE_NATIVE_URL = urlConstructorDetection;
1544
- var global = global$3;
1545
- var bind = functionBindContext;
1546
- var uncurryThis$3 = functionUncurryThis;
1547
- var defineBuiltIn$2 = defineBuiltIn$6;
1548
- var defineBuiltInAccessor$1 = defineBuiltInAccessor$3;
1549
- var anInstance = anInstance$2;
1550
- var hasOwn = hasOwnProperty_1;
1551
- var assign = objectAssign;
1552
- var arrayFrom = arrayFrom$1;
1553
- var arraySlice = arraySlice$2;
1554
- var codeAt = stringMultibyte.codeAt;
1555
- var toASCII = stringPunycodeToAscii;
1556
- var $toString = toString$4;
1557
- var setToStringTag = setToStringTag$2;
1558
- var validateArgumentsLength$2 = validateArgumentsLength$4;
1559
- var URLSearchParamsModule = web_urlSearchParams_constructor;
1560
- var InternalStateModule = internalState;
1561
-
1562
- var setInternalState = InternalStateModule.set;
1563
- var getInternalURLState = InternalStateModule.getterFor('URL');
1564
- var URLSearchParams$1 = URLSearchParamsModule.URLSearchParams;
1565
- var getInternalSearchParamsState = URLSearchParamsModule.getState;
1566
-
1567
- var NativeURL = global.URL;
1568
- var TypeError$1 = global.TypeError;
1569
- var parseInt = global.parseInt;
1570
- var floor = Math.floor;
1571
- var pow = Math.pow;
1572
- var charAt = uncurryThis$3(''.charAt);
1573
- var exec = uncurryThis$3(/./.exec);
1574
- var join = uncurryThis$3([].join);
1575
- var numberToString = uncurryThis$3(1.0.toString);
1576
- var pop = uncurryThis$3([].pop);
1577
- var push$1 = uncurryThis$3([].push);
1578
- var replace = uncurryThis$3(''.replace);
1579
- var shift = uncurryThis$3([].shift);
1580
- var split = uncurryThis$3(''.split);
1581
- var stringSlice = uncurryThis$3(''.slice);
1582
- var toLowerCase = uncurryThis$3(''.toLowerCase);
1583
- var unshift = uncurryThis$3([].unshift);
1584
-
1585
- var INVALID_AUTHORITY = 'Invalid authority';
1586
- var INVALID_SCHEME = 'Invalid scheme';
1587
- var INVALID_HOST = 'Invalid host';
1588
- var INVALID_PORT = 'Invalid port';
1589
-
1590
- var ALPHA = /[a-z]/i;
1591
- // eslint-disable-next-line regexp/no-obscure-range -- safe
1592
- var ALPHANUMERIC = /[\d+-.a-z]/i;
1593
- var DIGIT = /\d/;
1594
- var HEX_START = /^0x/i;
1595
- var OCT = /^[0-7]+$/;
1596
- var DEC = /^\d+$/;
1597
- var HEX = /^[\da-f]+$/i;
1598
- /* eslint-disable regexp/no-control-character -- safe */
1599
- var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
1600
- var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
1601
- var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
1602
- var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
1603
- var TAB_AND_NEW_LINE = /[\t\n\r]/g;
1604
- /* eslint-enable regexp/no-control-character -- safe */
1605
- var EOF;
1606
-
1607
- // https://url.spec.whatwg.org/#ipv4-number-parser
1608
- var parseIPv4 = function (input) {
1609
- var parts = split(input, '.');
1610
- var partsLength, numbers, index, part, radix, number, ipv4;
1611
- if (parts.length && parts[parts.length - 1] === '') {
1612
- parts.length--;
1613
- }
1614
- partsLength = parts.length;
1615
- if (partsLength > 4) return input;
1616
- numbers = [];
1617
- for (index = 0; index < partsLength; index++) {
1618
- part = parts[index];
1619
- if (part === '') return input;
1620
- radix = 10;
1621
- if (part.length > 1 && charAt(part, 0) === '0') {
1622
- radix = exec(HEX_START, part) ? 16 : 8;
1623
- part = stringSlice(part, radix === 8 ? 1 : 2);
1624
- }
1625
- if (part === '') {
1626
- number = 0;
1627
- } else {
1628
- if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return input;
1629
- number = parseInt(part, radix);
1630
- }
1631
- push$1(numbers, number);
1632
- }
1633
- for (index = 0; index < partsLength; index++) {
1634
- number = numbers[index];
1635
- if (index === partsLength - 1) {
1636
- if (number >= pow(256, 5 - partsLength)) return null;
1637
- } else if (number > 255) return null;
1638
- }
1639
- ipv4 = pop(numbers);
1640
- for (index = 0; index < numbers.length; index++) {
1641
- ipv4 += numbers[index] * pow(256, 3 - index);
1642
- }
1643
- return ipv4;
1644
- };
1645
-
1646
- // https://url.spec.whatwg.org/#concept-ipv6-parser
1647
- // eslint-disable-next-line max-statements -- TODO
1648
- var parseIPv6 = function (input) {
1649
- var address = [0, 0, 0, 0, 0, 0, 0, 0];
1650
- var pieceIndex = 0;
1651
- var compress = null;
1652
- var pointer = 0;
1653
- var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
1654
-
1655
- var chr = function () {
1656
- return charAt(input, pointer);
1657
- };
1658
-
1659
- if (chr() === ':') {
1660
- if (charAt(input, 1) !== ':') return;
1661
- pointer += 2;
1662
- pieceIndex++;
1663
- compress = pieceIndex;
1664
- }
1665
- while (chr()) {
1666
- if (pieceIndex === 8) return;
1667
- if (chr() === ':') {
1668
- if (compress !== null) return;
1669
- pointer++;
1670
- pieceIndex++;
1671
- compress = pieceIndex;
1672
- continue;
1673
- }
1674
- value = length = 0;
1675
- while (length < 4 && exec(HEX, chr())) {
1676
- value = value * 16 + parseInt(chr(), 16);
1677
- pointer++;
1678
- length++;
1679
- }
1680
- if (chr() === '.') {
1681
- if (length === 0) return;
1682
- pointer -= length;
1683
- if (pieceIndex > 6) return;
1684
- numbersSeen = 0;
1685
- while (chr()) {
1686
- ipv4Piece = null;
1687
- if (numbersSeen > 0) {
1688
- if (chr() === '.' && numbersSeen < 4) pointer++;
1689
- else return;
1690
- }
1691
- if (!exec(DIGIT, chr())) return;
1692
- while (exec(DIGIT, chr())) {
1693
- number = parseInt(chr(), 10);
1694
- if (ipv4Piece === null) ipv4Piece = number;
1695
- else if (ipv4Piece === 0) return;
1696
- else ipv4Piece = ipv4Piece * 10 + number;
1697
- if (ipv4Piece > 255) return;
1698
- pointer++;
1699
- }
1700
- address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
1701
- numbersSeen++;
1702
- if (numbersSeen === 2 || numbersSeen === 4) pieceIndex++;
1703
- }
1704
- if (numbersSeen !== 4) return;
1705
- break;
1706
- } else if (chr() === ':') {
1707
- pointer++;
1708
- if (!chr()) return;
1709
- } else if (chr()) return;
1710
- address[pieceIndex++] = value;
1711
- }
1712
- if (compress !== null) {
1713
- swaps = pieceIndex - compress;
1714
- pieceIndex = 7;
1715
- while (pieceIndex !== 0 && swaps > 0) {
1716
- swap = address[pieceIndex];
1717
- address[pieceIndex--] = address[compress + swaps - 1];
1718
- address[compress + --swaps] = swap;
1719
- }
1720
- } else if (pieceIndex !== 8) return;
1721
- return address;
1722
- };
1723
-
1724
- var findLongestZeroSequence = function (ipv6) {
1725
- var maxIndex = null;
1726
- var maxLength = 1;
1727
- var currStart = null;
1728
- var currLength = 0;
1729
- var index = 0;
1730
- for (; index < 8; index++) {
1731
- if (ipv6[index] !== 0) {
1732
- if (currLength > maxLength) {
1733
- maxIndex = currStart;
1734
- maxLength = currLength;
1735
- }
1736
- currStart = null;
1737
- currLength = 0;
1738
- } else {
1739
- if (currStart === null) currStart = index;
1740
- ++currLength;
1741
- }
1742
- }
1743
- if (currLength > maxLength) {
1744
- maxIndex = currStart;
1745
- maxLength = currLength;
1746
- }
1747
- return maxIndex;
1748
- };
1749
-
1750
- // https://url.spec.whatwg.org/#host-serializing
1751
- var serializeHost = function (host) {
1752
- var result, index, compress, ignore0;
1753
- // ipv4
1754
- if (typeof host == 'number') {
1755
- result = [];
1756
- for (index = 0; index < 4; index++) {
1757
- unshift(result, host % 256);
1758
- host = floor(host / 256);
1759
- } return join(result, '.');
1760
- // ipv6
1761
- } else if (typeof host == 'object') {
1762
- result = '';
1763
- compress = findLongestZeroSequence(host);
1764
- for (index = 0; index < 8; index++) {
1765
- if (ignore0 && host[index] === 0) continue;
1766
- if (ignore0) ignore0 = false;
1767
- if (compress === index) {
1768
- result += index ? ':' : '::';
1769
- ignore0 = true;
1770
- } else {
1771
- result += numberToString(host[index], 16);
1772
- if (index < 7) result += ':';
1773
- }
1774
- }
1775
- return '[' + result + ']';
1776
- } return host;
1777
- };
1778
-
1779
- var C0ControlPercentEncodeSet = {};
1780
- var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
1781
- ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
1782
- });
1783
- var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
1784
- '#': 1, '?': 1, '{': 1, '}': 1
1785
- });
1786
- var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
1787
- '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
1788
- });
1789
-
1790
- var percentEncode = function (chr, set) {
1791
- var code = codeAt(chr, 0);
1792
- return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
1793
- };
1794
-
1795
- // https://url.spec.whatwg.org/#special-scheme
1796
- var specialSchemes = {
1797
- ftp: 21,
1798
- file: null,
1799
- http: 80,
1800
- https: 443,
1801
- ws: 80,
1802
- wss: 443
1803
- };
1804
-
1805
- // https://url.spec.whatwg.org/#windows-drive-letter
1806
- var isWindowsDriveLetter = function (string, normalized) {
1807
- var second;
1808
- return string.length === 2 && exec(ALPHA, charAt(string, 0))
1809
- && ((second = charAt(string, 1)) === ':' || (!normalized && second === '|'));
1810
- };
1811
-
1812
- // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter
1813
- var startsWithWindowsDriveLetter = function (string) {
1814
- var third;
1815
- return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (
1816
- string.length === 2 ||
1817
- ((third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#')
1818
- );
1819
- };
1820
-
1821
- // https://url.spec.whatwg.org/#single-dot-path-segment
1822
- var isSingleDot = function (segment) {
1823
- return segment === '.' || toLowerCase(segment) === '%2e';
1824
- };
1825
-
1826
- // https://url.spec.whatwg.org/#double-dot-path-segment
1827
- var isDoubleDot = function (segment) {
1828
- segment = toLowerCase(segment);
1829
- return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
1830
- };
1831
-
1832
- // States:
1833
- var SCHEME_START = {};
1834
- var SCHEME = {};
1835
- var NO_SCHEME = {};
1836
- var SPECIAL_RELATIVE_OR_AUTHORITY = {};
1837
- var PATH_OR_AUTHORITY = {};
1838
- var RELATIVE = {};
1839
- var RELATIVE_SLASH = {};
1840
- var SPECIAL_AUTHORITY_SLASHES = {};
1841
- var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
1842
- var AUTHORITY = {};
1843
- var HOST = {};
1844
- var HOSTNAME = {};
1845
- var PORT = {};
1846
- var FILE = {};
1847
- var FILE_SLASH = {};
1848
- var FILE_HOST = {};
1849
- var PATH_START = {};
1850
- var PATH = {};
1851
- var CANNOT_BE_A_BASE_URL_PATH = {};
1852
- var QUERY = {};
1853
- var FRAGMENT = {};
1854
-
1855
- var URLState = function (url, isBase, base) {
1856
- var urlString = $toString(url);
1857
- var baseState, failure, searchParams;
1858
- if (isBase) {
1859
- failure = this.parse(urlString);
1860
- if (failure) throw new TypeError$1(failure);
1861
- this.searchParams = null;
1862
- } else {
1863
- if (base !== undefined) baseState = new URLState(base, true);
1864
- failure = this.parse(urlString, null, baseState);
1865
- if (failure) throw new TypeError$1(failure);
1866
- searchParams = getInternalSearchParamsState(new URLSearchParams$1());
1867
- searchParams.bindURL(this);
1868
- this.searchParams = searchParams;
1869
- }
1870
- };
1871
-
1872
- URLState.prototype = {
1873
- type: 'URL',
1874
- // https://url.spec.whatwg.org/#url-parsing
1875
- // eslint-disable-next-line max-statements -- TODO
1876
- parse: function (input, stateOverride, base) {
1877
- var url = this;
1878
- var state = stateOverride || SCHEME_START;
1879
- var pointer = 0;
1880
- var buffer = '';
1881
- var seenAt = false;
1882
- var seenBracket = false;
1883
- var seenPasswordToken = false;
1884
- var codePoints, chr, bufferCodePoints, failure;
1885
-
1886
- input = $toString(input);
1887
-
1888
- if (!stateOverride) {
1889
- url.scheme = '';
1890
- url.username = '';
1891
- url.password = '';
1892
- url.host = null;
1893
- url.port = null;
1894
- url.path = [];
1895
- url.query = null;
1896
- url.fragment = null;
1897
- url.cannotBeABaseURL = false;
1898
- input = replace(input, LEADING_C0_CONTROL_OR_SPACE, '');
1899
- input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, '$1');
1900
- }
1901
-
1902
- input = replace(input, TAB_AND_NEW_LINE, '');
1903
-
1904
- codePoints = arrayFrom(input);
1905
-
1906
- while (pointer <= codePoints.length) {
1907
- chr = codePoints[pointer];
1908
- switch (state) {
1909
- case SCHEME_START:
1910
- if (chr && exec(ALPHA, chr)) {
1911
- buffer += toLowerCase(chr);
1912
- state = SCHEME;
1913
- } else if (!stateOverride) {
1914
- state = NO_SCHEME;
1915
- continue;
1916
- } else return INVALID_SCHEME;
1917
- break;
1918
-
1919
- case SCHEME:
1920
- if (chr && (exec(ALPHANUMERIC, chr) || chr === '+' || chr === '-' || chr === '.')) {
1921
- buffer += toLowerCase(chr);
1922
- } else if (chr === ':') {
1923
- if (stateOverride && (
1924
- (url.isSpecial() !== hasOwn(specialSchemes, buffer)) ||
1925
- (buffer === 'file' && (url.includesCredentials() || url.port !== null)) ||
1926
- (url.scheme === 'file' && !url.host)
1927
- )) return;
1928
- url.scheme = buffer;
1929
- if (stateOverride) {
1930
- if (url.isSpecial() && specialSchemes[url.scheme] === url.port) url.port = null;
1931
- return;
1932
- }
1933
- buffer = '';
1934
- if (url.scheme === 'file') {
1935
- state = FILE;
1936
- } else if (url.isSpecial() && base && base.scheme === url.scheme) {
1937
- state = SPECIAL_RELATIVE_OR_AUTHORITY;
1938
- } else if (url.isSpecial()) {
1939
- state = SPECIAL_AUTHORITY_SLASHES;
1940
- } else if (codePoints[pointer + 1] === '/') {
1941
- state = PATH_OR_AUTHORITY;
1942
- pointer++;
1943
- } else {
1944
- url.cannotBeABaseURL = true;
1945
- push$1(url.path, '');
1946
- state = CANNOT_BE_A_BASE_URL_PATH;
1947
- }
1948
- } else if (!stateOverride) {
1949
- buffer = '';
1950
- state = NO_SCHEME;
1951
- pointer = 0;
1952
- continue;
1953
- } else return INVALID_SCHEME;
1954
- break;
1955
-
1956
- case NO_SCHEME:
1957
- if (!base || (base.cannotBeABaseURL && chr !== '#')) return INVALID_SCHEME;
1958
- if (base.cannotBeABaseURL && chr === '#') {
1959
- url.scheme = base.scheme;
1960
- url.path = arraySlice(base.path);
1961
- url.query = base.query;
1962
- url.fragment = '';
1963
- url.cannotBeABaseURL = true;
1964
- state = FRAGMENT;
1965
- break;
1966
- }
1967
- state = base.scheme === 'file' ? FILE : RELATIVE;
1968
- continue;
1969
-
1970
- case SPECIAL_RELATIVE_OR_AUTHORITY:
1971
- if (chr === '/' && codePoints[pointer + 1] === '/') {
1972
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
1973
- pointer++;
1974
- } else {
1975
- state = RELATIVE;
1976
- continue;
1977
- } break;
1978
-
1979
- case PATH_OR_AUTHORITY:
1980
- if (chr === '/') {
1981
- state = AUTHORITY;
1982
- break;
1983
- } else {
1984
- state = PATH;
1985
- continue;
1986
- }
1987
-
1988
- case RELATIVE:
1989
- url.scheme = base.scheme;
1990
- if (chr === EOF) {
1991
- url.username = base.username;
1992
- url.password = base.password;
1993
- url.host = base.host;
1994
- url.port = base.port;
1995
- url.path = arraySlice(base.path);
1996
- url.query = base.query;
1997
- } else if (chr === '/' || (chr === '\\' && url.isSpecial())) {
1998
- state = RELATIVE_SLASH;
1999
- } else if (chr === '?') {
2000
- url.username = base.username;
2001
- url.password = base.password;
2002
- url.host = base.host;
2003
- url.port = base.port;
2004
- url.path = arraySlice(base.path);
2005
- url.query = '';
2006
- state = QUERY;
2007
- } else if (chr === '#') {
2008
- url.username = base.username;
2009
- url.password = base.password;
2010
- url.host = base.host;
2011
- url.port = base.port;
2012
- url.path = arraySlice(base.path);
2013
- url.query = base.query;
2014
- url.fragment = '';
2015
- state = FRAGMENT;
2016
- } else {
2017
- url.username = base.username;
2018
- url.password = base.password;
2019
- url.host = base.host;
2020
- url.port = base.port;
2021
- url.path = arraySlice(base.path);
2022
- url.path.length--;
2023
- state = PATH;
2024
- continue;
2025
- } break;
2026
-
2027
- case RELATIVE_SLASH:
2028
- if (url.isSpecial() && (chr === '/' || chr === '\\')) {
2029
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
2030
- } else if (chr === '/') {
2031
- state = AUTHORITY;
2032
- } else {
2033
- url.username = base.username;
2034
- url.password = base.password;
2035
- url.host = base.host;
2036
- url.port = base.port;
2037
- state = PATH;
2038
- continue;
2039
- } break;
2040
-
2041
- case SPECIAL_AUTHORITY_SLASHES:
2042
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
2043
- if (chr !== '/' || charAt(buffer, pointer + 1) !== '/') continue;
2044
- pointer++;
2045
- break;
2046
-
2047
- case SPECIAL_AUTHORITY_IGNORE_SLASHES:
2048
- if (chr !== '/' && chr !== '\\') {
2049
- state = AUTHORITY;
2050
- continue;
2051
- } break;
2052
-
2053
- case AUTHORITY:
2054
- if (chr === '@') {
2055
- if (seenAt) buffer = '%40' + buffer;
2056
- seenAt = true;
2057
- bufferCodePoints = arrayFrom(buffer);
2058
- for (var i = 0; i < bufferCodePoints.length; i++) {
2059
- var codePoint = bufferCodePoints[i];
2060
- if (codePoint === ':' && !seenPasswordToken) {
2061
- seenPasswordToken = true;
2062
- continue;
2063
- }
2064
- var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
2065
- if (seenPasswordToken) url.password += encodedCodePoints;
2066
- else url.username += encodedCodePoints;
2067
- }
2068
- buffer = '';
2069
- } else if (
2070
- chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
2071
- (chr === '\\' && url.isSpecial())
2072
- ) {
2073
- if (seenAt && buffer === '') return INVALID_AUTHORITY;
2074
- pointer -= arrayFrom(buffer).length + 1;
2075
- buffer = '';
2076
- state = HOST;
2077
- } else buffer += chr;
2078
- break;
2079
-
2080
- case HOST:
2081
- case HOSTNAME:
2082
- if (stateOverride && url.scheme === 'file') {
2083
- state = FILE_HOST;
2084
- continue;
2085
- } else if (chr === ':' && !seenBracket) {
2086
- if (buffer === '') return INVALID_HOST;
2087
- failure = url.parseHost(buffer);
2088
- if (failure) return failure;
2089
- buffer = '';
2090
- state = PORT;
2091
- if (stateOverride === HOSTNAME) return;
2092
- } else if (
2093
- chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
2094
- (chr === '\\' && url.isSpecial())
2095
- ) {
2096
- if (url.isSpecial() && buffer === '') return INVALID_HOST;
2097
- if (stateOverride && buffer === '' && (url.includesCredentials() || url.port !== null)) return;
2098
- failure = url.parseHost(buffer);
2099
- if (failure) return failure;
2100
- buffer = '';
2101
- state = PATH_START;
2102
- if (stateOverride) return;
2103
- continue;
2104
- } else {
2105
- if (chr === '[') seenBracket = true;
2106
- else if (chr === ']') seenBracket = false;
2107
- buffer += chr;
2108
- } break;
2109
-
2110
- case PORT:
2111
- if (exec(DIGIT, chr)) {
2112
- buffer += chr;
2113
- } else if (
2114
- chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
2115
- (chr === '\\' && url.isSpecial()) ||
2116
- stateOverride
2117
- ) {
2118
- if (buffer !== '') {
2119
- var port = parseInt(buffer, 10);
2120
- if (port > 0xFFFF) return INVALID_PORT;
2121
- url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port;
2122
- buffer = '';
2123
- }
2124
- if (stateOverride) return;
2125
- state = PATH_START;
2126
- continue;
2127
- } else return INVALID_PORT;
2128
- break;
2129
-
2130
- case FILE:
2131
- url.scheme = 'file';
2132
- if (chr === '/' || chr === '\\') state = FILE_SLASH;
2133
- else if (base && base.scheme === 'file') {
2134
- switch (chr) {
2135
- case EOF:
2136
- url.host = base.host;
2137
- url.path = arraySlice(base.path);
2138
- url.query = base.query;
2139
- break;
2140
- case '?':
2141
- url.host = base.host;
2142
- url.path = arraySlice(base.path);
2143
- url.query = '';
2144
- state = QUERY;
2145
- break;
2146
- case '#':
2147
- url.host = base.host;
2148
- url.path = arraySlice(base.path);
2149
- url.query = base.query;
2150
- url.fragment = '';
2151
- state = FRAGMENT;
2152
- break;
2153
- default:
2154
- if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
2155
- url.host = base.host;
2156
- url.path = arraySlice(base.path);
2157
- url.shortenPath();
2158
- }
2159
- state = PATH;
2160
- continue;
2161
- }
2162
- } else {
2163
- state = PATH;
2164
- continue;
2165
- } break;
2166
-
2167
- case FILE_SLASH:
2168
- if (chr === '/' || chr === '\\') {
2169
- state = FILE_HOST;
2170
- break;
2171
- }
2172
- if (base && base.scheme === 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
2173
- if (isWindowsDriveLetter(base.path[0], true)) push$1(url.path, base.path[0]);
2174
- else url.host = base.host;
2175
- }
2176
- state = PATH;
2177
- continue;
2178
-
2179
- case FILE_HOST:
2180
- if (chr === EOF || chr === '/' || chr === '\\' || chr === '?' || chr === '#') {
2181
- if (!stateOverride && isWindowsDriveLetter(buffer)) {
2182
- state = PATH;
2183
- } else if (buffer === '') {
2184
- url.host = '';
2185
- if (stateOverride) return;
2186
- state = PATH_START;
2187
- } else {
2188
- failure = url.parseHost(buffer);
2189
- if (failure) return failure;
2190
- if (url.host === 'localhost') url.host = '';
2191
- if (stateOverride) return;
2192
- buffer = '';
2193
- state = PATH_START;
2194
- } continue;
2195
- } else buffer += chr;
2196
- break;
2197
-
2198
- case PATH_START:
2199
- if (url.isSpecial()) {
2200
- state = PATH;
2201
- if (chr !== '/' && chr !== '\\') continue;
2202
- } else if (!stateOverride && chr === '?') {
2203
- url.query = '';
2204
- state = QUERY;
2205
- } else if (!stateOverride && chr === '#') {
2206
- url.fragment = '';
2207
- state = FRAGMENT;
2208
- } else if (chr !== EOF) {
2209
- state = PATH;
2210
- if (chr !== '/') continue;
2211
- } break;
2212
-
2213
- case PATH:
2214
- if (
2215
- chr === EOF || chr === '/' ||
2216
- (chr === '\\' && url.isSpecial()) ||
2217
- (!stateOverride && (chr === '?' || chr === '#'))
2218
- ) {
2219
- if (isDoubleDot(buffer)) {
2220
- url.shortenPath();
2221
- if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
2222
- push$1(url.path, '');
2223
- }
2224
- } else if (isSingleDot(buffer)) {
2225
- if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
2226
- push$1(url.path, '');
2227
- }
2228
- } else {
2229
- if (url.scheme === 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
2230
- if (url.host) url.host = '';
2231
- buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter
2232
- }
2233
- push$1(url.path, buffer);
2234
- }
2235
- buffer = '';
2236
- if (url.scheme === 'file' && (chr === EOF || chr === '?' || chr === '#')) {
2237
- while (url.path.length > 1 && url.path[0] === '') {
2238
- shift(url.path);
2239
- }
2240
- }
2241
- if (chr === '?') {
2242
- url.query = '';
2243
- state = QUERY;
2244
- } else if (chr === '#') {
2245
- url.fragment = '';
2246
- state = FRAGMENT;
2247
- }
2248
- } else {
2249
- buffer += percentEncode(chr, pathPercentEncodeSet);
2250
- } break;
2251
-
2252
- case CANNOT_BE_A_BASE_URL_PATH:
2253
- if (chr === '?') {
2254
- url.query = '';
2255
- state = QUERY;
2256
- } else if (chr === '#') {
2257
- url.fragment = '';
2258
- state = FRAGMENT;
2259
- } else if (chr !== EOF) {
2260
- url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
2261
- } break;
2262
-
2263
- case QUERY:
2264
- if (!stateOverride && chr === '#') {
2265
- url.fragment = '';
2266
- state = FRAGMENT;
2267
- } else if (chr !== EOF) {
2268
- if (chr === "'" && url.isSpecial()) url.query += '%27';
2269
- else if (chr === '#') url.query += '%23';
2270
- else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
2271
- } break;
2272
-
2273
- case FRAGMENT:
2274
- if (chr !== EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
2275
- break;
2276
- }
2277
-
2278
- pointer++;
2279
- }
2280
- },
2281
- // https://url.spec.whatwg.org/#host-parsing
2282
- parseHost: function (input) {
2283
- var result, codePoints, index;
2284
- if (charAt(input, 0) === '[') {
2285
- if (charAt(input, input.length - 1) !== ']') return INVALID_HOST;
2286
- result = parseIPv6(stringSlice(input, 1, -1));
2287
- if (!result) return INVALID_HOST;
2288
- this.host = result;
2289
- // opaque host
2290
- } else if (!this.isSpecial()) {
2291
- if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
2292
- result = '';
2293
- codePoints = arrayFrom(input);
2294
- for (index = 0; index < codePoints.length; index++) {
2295
- result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
2296
- }
2297
- this.host = result;
2298
- } else {
2299
- input = toASCII(input);
2300
- if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
2301
- result = parseIPv4(input);
2302
- if (result === null) return INVALID_HOST;
2303
- this.host = result;
2304
- }
2305
- },
2306
- // https://url.spec.whatwg.org/#cannot-have-a-username-password-port
2307
- cannotHaveUsernamePasswordPort: function () {
2308
- return !this.host || this.cannotBeABaseURL || this.scheme === 'file';
2309
- },
2310
- // https://url.spec.whatwg.org/#include-credentials
2311
- includesCredentials: function () {
2312
- return this.username !== '' || this.password !== '';
2313
- },
2314
- // https://url.spec.whatwg.org/#is-special
2315
- isSpecial: function () {
2316
- return hasOwn(specialSchemes, this.scheme);
2317
- },
2318
- // https://url.spec.whatwg.org/#shorten-a-urls-path
2319
- shortenPath: function () {
2320
- var path = this.path;
2321
- var pathSize = path.length;
2322
- if (pathSize && (this.scheme !== 'file' || pathSize !== 1 || !isWindowsDriveLetter(path[0], true))) {
2323
- path.length--;
2324
- }
2325
- },
2326
- // https://url.spec.whatwg.org/#concept-url-serializer
2327
- serialize: function () {
2328
- var url = this;
2329
- var scheme = url.scheme;
2330
- var username = url.username;
2331
- var password = url.password;
2332
- var host = url.host;
2333
- var port = url.port;
2334
- var path = url.path;
2335
- var query = url.query;
2336
- var fragment = url.fragment;
2337
- var output = scheme + ':';
2338
- if (host !== null) {
2339
- output += '//';
2340
- if (url.includesCredentials()) {
2341
- output += username + (password ? ':' + password : '') + '@';
2342
- }
2343
- output += serializeHost(host);
2344
- if (port !== null) output += ':' + port;
2345
- } else if (scheme === 'file') output += '//';
2346
- output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
2347
- if (query !== null) output += '?' + query;
2348
- if (fragment !== null) output += '#' + fragment;
2349
- return output;
2350
- },
2351
- // https://url.spec.whatwg.org/#dom-url-href
2352
- setHref: function (href) {
2353
- var failure = this.parse(href);
2354
- if (failure) throw new TypeError$1(failure);
2355
- this.searchParams.update();
2356
- },
2357
- // https://url.spec.whatwg.org/#dom-url-origin
2358
- getOrigin: function () {
2359
- var scheme = this.scheme;
2360
- var port = this.port;
2361
- if (scheme === 'blob') try {
2362
- return new URLConstructor(scheme.path[0]).origin;
2363
- } catch (error) {
2364
- return 'null';
2365
- }
2366
- if (scheme === 'file' || !this.isSpecial()) return 'null';
2367
- return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : '');
2368
- },
2369
- // https://url.spec.whatwg.org/#dom-url-protocol
2370
- getProtocol: function () {
2371
- return this.scheme + ':';
2372
- },
2373
- setProtocol: function (protocol) {
2374
- this.parse($toString(protocol) + ':', SCHEME_START);
2375
- },
2376
- // https://url.spec.whatwg.org/#dom-url-username
2377
- getUsername: function () {
2378
- return this.username;
2379
- },
2380
- setUsername: function (username) {
2381
- var codePoints = arrayFrom($toString(username));
2382
- if (this.cannotHaveUsernamePasswordPort()) return;
2383
- this.username = '';
2384
- for (var i = 0; i < codePoints.length; i++) {
2385
- this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
2386
- }
2387
- },
2388
- // https://url.spec.whatwg.org/#dom-url-password
2389
- getPassword: function () {
2390
- return this.password;
2391
- },
2392
- setPassword: function (password) {
2393
- var codePoints = arrayFrom($toString(password));
2394
- if (this.cannotHaveUsernamePasswordPort()) return;
2395
- this.password = '';
2396
- for (var i = 0; i < codePoints.length; i++) {
2397
- this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
2398
- }
2399
- },
2400
- // https://url.spec.whatwg.org/#dom-url-host
2401
- getHost: function () {
2402
- var host = this.host;
2403
- var port = this.port;
2404
- return host === null ? ''
2405
- : port === null ? serializeHost(host)
2406
- : serializeHost(host) + ':' + port;
2407
- },
2408
- setHost: function (host) {
2409
- if (this.cannotBeABaseURL) return;
2410
- this.parse(host, HOST);
2411
- },
2412
- // https://url.spec.whatwg.org/#dom-url-hostname
2413
- getHostname: function () {
2414
- var host = this.host;
2415
- return host === null ? '' : serializeHost(host);
2416
- },
2417
- setHostname: function (hostname) {
2418
- if (this.cannotBeABaseURL) return;
2419
- this.parse(hostname, HOSTNAME);
2420
- },
2421
- // https://url.spec.whatwg.org/#dom-url-port
2422
- getPort: function () {
2423
- var port = this.port;
2424
- return port === null ? '' : $toString(port);
2425
- },
2426
- setPort: function (port) {
2427
- if (this.cannotHaveUsernamePasswordPort()) return;
2428
- port = $toString(port);
2429
- if (port === '') this.port = null;
2430
- else this.parse(port, PORT);
2431
- },
2432
- // https://url.spec.whatwg.org/#dom-url-pathname
2433
- getPathname: function () {
2434
- var path = this.path;
2435
- return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
2436
- },
2437
- setPathname: function (pathname) {
2438
- if (this.cannotBeABaseURL) return;
2439
- this.path = [];
2440
- this.parse(pathname, PATH_START);
2441
- },
2442
- // https://url.spec.whatwg.org/#dom-url-search
2443
- getSearch: function () {
2444
- var query = this.query;
2445
- return query ? '?' + query : '';
2446
- },
2447
- setSearch: function (search) {
2448
- search = $toString(search);
2449
- if (search === '') {
2450
- this.query = null;
2451
- } else {
2452
- if (charAt(search, 0) === '?') search = stringSlice(search, 1);
2453
- this.query = '';
2454
- this.parse(search, QUERY);
2455
- }
2456
- this.searchParams.update();
2457
- },
2458
- // https://url.spec.whatwg.org/#dom-url-searchparams
2459
- getSearchParams: function () {
2460
- return this.searchParams.facade;
2461
- },
2462
- // https://url.spec.whatwg.org/#dom-url-hash
2463
- getHash: function () {
2464
- var fragment = this.fragment;
2465
- return fragment ? '#' + fragment : '';
2466
- },
2467
- setHash: function (hash) {
2468
- hash = $toString(hash);
2469
- if (hash === '') {
2470
- this.fragment = null;
2471
- return;
2472
- }
2473
- if (charAt(hash, 0) === '#') hash = stringSlice(hash, 1);
2474
- this.fragment = '';
2475
- this.parse(hash, FRAGMENT);
2476
- },
2477
- update: function () {
2478
- this.query = this.searchParams.serialize() || null;
2479
- }
2480
- };
2481
-
2482
- // `URL` constructor
2483
- // https://url.spec.whatwg.org/#url-class
2484
- var URLConstructor = function URL(url /* , base */) {
2485
- var that = anInstance(this, URLPrototype);
2486
- var base = validateArgumentsLength$2(arguments.length, 1) > 1 ? arguments[1] : undefined;
2487
- var state = setInternalState(that, new URLState(url, false, base));
2488
- if (!DESCRIPTORS$1) {
2489
- that.href = state.serialize();
2490
- that.origin = state.getOrigin();
2491
- that.protocol = state.getProtocol();
2492
- that.username = state.getUsername();
2493
- that.password = state.getPassword();
2494
- that.host = state.getHost();
2495
- that.hostname = state.getHostname();
2496
- that.port = state.getPort();
2497
- that.pathname = state.getPathname();
2498
- that.search = state.getSearch();
2499
- that.searchParams = state.getSearchParams();
2500
- that.hash = state.getHash();
2501
- }
2502
- };
2503
-
2504
- var URLPrototype = URLConstructor.prototype;
2505
-
2506
- var accessorDescriptor = function (getter, setter) {
2507
- return {
2508
- get: function () {
2509
- return getInternalURLState(this)[getter]();
2510
- },
2511
- set: setter && function (value) {
2512
- return getInternalURLState(this)[setter](value);
2513
- },
2514
- configurable: true,
2515
- enumerable: true
2516
- };
2517
- };
2518
-
2519
- if (DESCRIPTORS$1) {
2520
- // `URL.prototype.href` accessors pair
2521
- // https://url.spec.whatwg.org/#dom-url-href
2522
- defineBuiltInAccessor$1(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref'));
2523
- // `URL.prototype.origin` getter
2524
- // https://url.spec.whatwg.org/#dom-url-origin
2525
- defineBuiltInAccessor$1(URLPrototype, 'origin', accessorDescriptor('getOrigin'));
2526
- // `URL.prototype.protocol` accessors pair
2527
- // https://url.spec.whatwg.org/#dom-url-protocol
2528
- defineBuiltInAccessor$1(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol'));
2529
- // `URL.prototype.username` accessors pair
2530
- // https://url.spec.whatwg.org/#dom-url-username
2531
- defineBuiltInAccessor$1(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername'));
2532
- // `URL.prototype.password` accessors pair
2533
- // https://url.spec.whatwg.org/#dom-url-password
2534
- defineBuiltInAccessor$1(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword'));
2535
- // `URL.prototype.host` accessors pair
2536
- // https://url.spec.whatwg.org/#dom-url-host
2537
- defineBuiltInAccessor$1(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost'));
2538
- // `URL.prototype.hostname` accessors pair
2539
- // https://url.spec.whatwg.org/#dom-url-hostname
2540
- defineBuiltInAccessor$1(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname'));
2541
- // `URL.prototype.port` accessors pair
2542
- // https://url.spec.whatwg.org/#dom-url-port
2543
- defineBuiltInAccessor$1(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort'));
2544
- // `URL.prototype.pathname` accessors pair
2545
- // https://url.spec.whatwg.org/#dom-url-pathname
2546
- defineBuiltInAccessor$1(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname'));
2547
- // `URL.prototype.search` accessors pair
2548
- // https://url.spec.whatwg.org/#dom-url-search
2549
- defineBuiltInAccessor$1(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch'));
2550
- // `URL.prototype.searchParams` getter
2551
- // https://url.spec.whatwg.org/#dom-url-searchparams
2552
- defineBuiltInAccessor$1(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams'));
2553
- // `URL.prototype.hash` accessors pair
2554
- // https://url.spec.whatwg.org/#dom-url-hash
2555
- defineBuiltInAccessor$1(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash'));
2556
- }
2557
-
2558
- // `URL.prototype.toJSON` method
2559
- // https://url.spec.whatwg.org/#dom-url-tojson
2560
- defineBuiltIn$2(URLPrototype, 'toJSON', function toJSON() {
2561
- return getInternalURLState(this).serialize();
2562
- }, { enumerable: true });
2563
-
2564
- // `URL.prototype.toString` method
2565
- // https://url.spec.whatwg.org/#URL-stringification-behavior
2566
- defineBuiltIn$2(URLPrototype, 'toString', function toString() {
2567
- return getInternalURLState(this).serialize();
2568
- }, { enumerable: true });
2569
-
2570
- if (NativeURL) {
2571
- var nativeCreateObjectURL = NativeURL.createObjectURL;
2572
- var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
2573
- // `URL.createObjectURL` method
2574
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
2575
- if (nativeCreateObjectURL) defineBuiltIn$2(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));
2576
- // `URL.revokeObjectURL` method
2577
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
2578
- if (nativeRevokeObjectURL) defineBuiltIn$2(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));
2579
- }
2580
-
2581
- setToStringTag(URLConstructor, 'URL');
2582
-
2583
- $$1({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS$1 }, {
2584
- URL: URLConstructor
2585
- });
2586
-
2587
- var $ = _export;
2588
- var call = functionCall;
2589
-
2590
- // `URL.prototype.toJSON` method
2591
- // https://url.spec.whatwg.org/#dom-url-tojson
2592
- $({ target: 'URL', proto: true, enumerable: true }, {
2593
- toJSON: function toJSON() {
2594
- return call(URL.prototype.toString, this);
2595
- }
2596
- });
2597
-
2598
- var defineBuiltIn$1 = defineBuiltIn$6;
2599
- var uncurryThis$2 = functionUncurryThis;
2600
- var toString$1 = toString$4;
2601
- var validateArgumentsLength$1 = validateArgumentsLength$4;
2602
-
2603
- var $URLSearchParams$1 = URLSearchParams;
2604
- var URLSearchParamsPrototype$2 = $URLSearchParams$1.prototype;
2605
- var append = uncurryThis$2(URLSearchParamsPrototype$2.append);
2606
- var $delete = uncurryThis$2(URLSearchParamsPrototype$2['delete']);
2607
- var forEach$1 = uncurryThis$2(URLSearchParamsPrototype$2.forEach);
2608
- var push = uncurryThis$2([].push);
2609
- var params$1 = new $URLSearchParams$1('a=1&a=2&b=3');
2610
-
2611
- params$1['delete']('a', 1);
2612
- // `undefined` case is a Chromium 117 bug
2613
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
2614
- params$1['delete']('b', undefined);
2615
-
2616
- if (params$1 + '' !== 'a=2') {
2617
- defineBuiltIn$1(URLSearchParamsPrototype$2, 'delete', function (name /* , value */) {
2618
- var length = arguments.length;
2619
- var $value = length < 2 ? undefined : arguments[1];
2620
- if (length && $value === undefined) return $delete(this, name);
2621
- var entries = [];
2622
- forEach$1(this, function (v, k) { // also validates `this`
2623
- push(entries, { key: k, value: v });
2624
- });
2625
- validateArgumentsLength$1(length, 1);
2626
- var key = toString$1(name);
2627
- var value = toString$1($value);
2628
- var index = 0;
2629
- var dindex = 0;
2630
- var found = false;
2631
- var entriesLength = entries.length;
2632
- var entry;
2633
- while (index < entriesLength) {
2634
- entry = entries[index++];
2635
- if (found || entry.key === key) {
2636
- found = true;
2637
- $delete(this, entry.key);
2638
- } else dindex++;
2639
- }
2640
- while (dindex < entriesLength) {
2641
- entry = entries[dindex++];
2642
- if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
2643
- }
2644
- }, { enumerable: true, unsafe: true });
2645
- }
2646
-
2647
- var defineBuiltIn = defineBuiltIn$6;
2648
- var uncurryThis$1 = functionUncurryThis;
2649
- var toString = toString$4;
2650
- var validateArgumentsLength = validateArgumentsLength$4;
2651
-
2652
- var $URLSearchParams = URLSearchParams;
2653
- var URLSearchParamsPrototype$1 = $URLSearchParams.prototype;
2654
- var getAll = uncurryThis$1(URLSearchParamsPrototype$1.getAll);
2655
- var $has = uncurryThis$1(URLSearchParamsPrototype$1.has);
2656
- var params = new $URLSearchParams('a=1');
2657
-
2658
- // `undefined` case is a Chromium 117 bug
2659
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
2660
- if (params.has('a', 2) || !params.has('a', undefined)) {
2661
- defineBuiltIn(URLSearchParamsPrototype$1, 'has', function has(name /* , value */) {
2662
- var length = arguments.length;
2663
- var $value = length < 2 ? undefined : arguments[1];
2664
- if (length && $value === undefined) return $has(this, name);
2665
- var values = getAll(this, name); // also validates `this`
2666
- validateArgumentsLength(length, 1);
2667
- var value = toString($value);
2668
- var index = 0;
2669
- while (index < values.length) {
2670
- if (values[index++] === value) return true;
2671
- } return false;
2672
- }, { enumerable: true, unsafe: true });
2673
- }
2674
-
2675
- var DESCRIPTORS = descriptors;
2676
- var uncurryThis = functionUncurryThis;
2677
- var defineBuiltInAccessor = defineBuiltInAccessor$3;
2678
-
2679
- var URLSearchParamsPrototype = URLSearchParams.prototype;
2680
- var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
2681
-
2682
- // `URLSearchParams.prototype.size` getter
2683
- // https://github.com/whatwg/url/pull/734
2684
- if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
2685
- defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
2686
- get: function size() {
2687
- var count = 0;
2688
- forEach(this, function () { count++; });
2689
- return count;
2690
- },
2691
- configurable: true,
2692
- enumerable: true
2693
- });
2694
- }
2695
-
2696
480
  const DEFAULT_TINYMCE_CONFIG = {
2697
481
  inline: true,
2698
482
  menubar: false,