[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 var JoomlaMediaManager = (function () { 2 'use strict'; 3 4 function _defineProperties(target, props) { 5 for (var i = 0; i < props.length; i++) { 6 var descriptor = props[i]; 7 descriptor.enumerable = descriptor.enumerable || false; 8 descriptor.configurable = true; 9 if ("value" in descriptor) descriptor.writable = true; 10 Object.defineProperty(target, descriptor.key, descriptor); 11 } 12 } 13 14 function _createClass(Constructor, protoProps, staticProps) { 15 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 16 if (staticProps) _defineProperties(Constructor, staticProps); 17 Object.defineProperty(Constructor, "prototype", { 18 writable: false 19 }); 20 return Constructor; 21 } 22 23 function _unsupportedIterableToArray(o, minLen) { 24 if (!o) return; 25 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 26 var n = Object.prototype.toString.call(o).slice(8, -1); 27 if (n === "Object" && o.constructor) n = o.constructor.name; 28 if (n === "Map" || n === "Set") return Array.from(o); 29 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 30 } 31 32 function _arrayLikeToArray(arr, len) { 33 if (len == null || len > arr.length) len = arr.length; 34 35 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 36 37 return arr2; 38 } 39 40 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 41 var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; 42 if (it) return (it = it.call(o)).next.bind(it); 43 44 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 45 if (it) o = it; 46 var i = 0; 47 return function () { 48 if (i >= o.length) return { 49 done: true 50 }; 51 return { 52 done: false, 53 value: o[i++] 54 }; 55 }; 56 } 57 58 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 59 } 60 61 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 62 63 var check = function (it) { 64 return it && it.Math == Math && it; 65 }; 66 67 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 68 var global$1e = 69 // eslint-disable-next-line es/no-global-this -- safe 70 check(typeof globalThis == 'object' && globalThis) || 71 check(typeof window == 'object' && window) || 72 // eslint-disable-next-line no-restricted-globals -- safe 73 check(typeof self == 'object' && self) || 74 check(typeof commonjsGlobal == 'object' && commonjsGlobal) || 75 // eslint-disable-next-line no-new-func -- fallback 76 (function () { return this; })() || Function('return this')(); 77 78 var objectGetOwnPropertyDescriptor = {}; 79 80 var fails$I = function (exec) { 81 try { 82 return !!exec(); 83 } catch (error) { 84 return true; 85 } 86 }; 87 88 var fails$H = fails$I; 89 90 // Detect IE8's incomplete defineProperty implementation 91 var descriptors = !fails$H(function () { 92 // eslint-disable-next-line es/no-object-defineproperty -- required for testing 93 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; 94 }); 95 96 var call$q = Function.prototype.call; 97 98 var functionCall = call$q.bind ? call$q.bind(call$q) : function () { 99 return call$q.apply(call$q, arguments); 100 }; 101 102 var objectPropertyIsEnumerable = {}; 103 104 var $propertyIsEnumerable$1 = {}.propertyIsEnumerable; 105 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe 106 var getOwnPropertyDescriptor$6 = Object.getOwnPropertyDescriptor; 107 108 // Nashorn ~ JDK8 bug 109 var NASHORN_BUG = getOwnPropertyDescriptor$6 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1); 110 111 // `Object.prototype.propertyIsEnumerable` method implementation 112 // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable 113 objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) { 114 var descriptor = getOwnPropertyDescriptor$6(this, V); 115 return !!descriptor && descriptor.enumerable; 116 } : $propertyIsEnumerable$1; 117 118 var createPropertyDescriptor$8 = function (bitmap, value) { 119 return { 120 enumerable: !(bitmap & 1), 121 configurable: !(bitmap & 2), 122 writable: !(bitmap & 4), 123 value: value 124 }; 125 }; 126 127 var FunctionPrototype$3 = Function.prototype; 128 var bind$c = FunctionPrototype$3.bind; 129 var call$p = FunctionPrototype$3.call; 130 var callBind = bind$c && bind$c.bind(call$p); 131 132 var functionUncurryThis = bind$c ? function (fn) { 133 return fn && callBind(call$p, fn); 134 } : function (fn) { 135 return fn && function () { 136 return call$p.apply(fn, arguments); 137 }; 138 }; 139 140 var uncurryThis$N = functionUncurryThis; 141 142 var toString$i = uncurryThis$N({}.toString); 143 var stringSlice$a = uncurryThis$N(''.slice); 144 145 var classofRaw$1 = function (it) { 146 return stringSlice$a(toString$i(it), 8, -1); 147 }; 148 149 var global$1d = global$1e; 150 var uncurryThis$M = functionUncurryThis; 151 var fails$G = fails$I; 152 var classof$e = classofRaw$1; 153 154 var Object$5 = global$1d.Object; 155 var split$3 = uncurryThis$M(''.split); 156 157 // fallback for non-array-like ES3 and non-enumerable old V8 strings 158 var indexedObject = fails$G(function () { 159 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 160 // eslint-disable-next-line no-prototype-builtins -- safe 161 return !Object$5('z').propertyIsEnumerable(0); 162 }) ? function (it) { 163 return classof$e(it) == 'String' ? split$3(it, '') : Object$5(it); 164 } : Object$5; 165 166 var global$1c = global$1e; 167 168 var TypeError$n = global$1c.TypeError; 169 170 // `RequireObjectCoercible` abstract operation 171 // https://tc39.es/ecma262/#sec-requireobjectcoercible 172 var requireObjectCoercible$d = function (it) { 173 if (it == undefined) throw TypeError$n("Can't call method on " + it); 174 return it; 175 }; 176 177 // toObject with fallback for non-array-like ES3 strings 178 var IndexedObject$4 = indexedObject; 179 var requireObjectCoercible$c = requireObjectCoercible$d; 180 181 var toIndexedObject$a = function (it) { 182 return IndexedObject$4(requireObjectCoercible$c(it)); 183 }; 184 185 // `IsCallable` abstract operation 186 // https://tc39.es/ecma262/#sec-iscallable 187 var isCallable$q = function (argument) { 188 return typeof argument == 'function'; 189 }; 190 191 var isCallable$p = isCallable$q; 192 193 var isObject$s = function (it) { 194 return typeof it == 'object' ? it !== null : isCallable$p(it); 195 }; 196 197 var global$1b = global$1e; 198 var isCallable$o = isCallable$q; 199 200 var aFunction = function (argument) { 201 return isCallable$o(argument) ? argument : undefined; 202 }; 203 204 var getBuiltIn$a = function (namespace, method) { 205 return arguments.length < 2 ? aFunction(global$1b[namespace]) : global$1b[namespace] && global$1b[namespace][method]; 206 }; 207 208 var uncurryThis$L = functionUncurryThis; 209 210 var objectIsPrototypeOf = uncurryThis$L({}.isPrototypeOf); 211 212 var getBuiltIn$9 = getBuiltIn$a; 213 214 var engineUserAgent = getBuiltIn$9('navigator', 'userAgent') || ''; 215 216 var global$1a = global$1e; 217 var userAgent$5 = engineUserAgent; 218 219 var process$3 = global$1a.process; 220 var Deno = global$1a.Deno; 221 var versions = process$3 && process$3.versions || Deno && Deno.version; 222 var v8 = versions && versions.v8; 223 var match, version$1; 224 225 if (v8) { 226 match = v8.split('.'); 227 // in old Chrome, versions of V8 isn't V8 = Chrome / 10 228 // but their correct versions are not interesting for us 229 version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); 230 } 231 232 // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` 233 // so check `userAgent` even if `.v8` exists, but 0 234 if (!version$1 && userAgent$5) { 235 match = userAgent$5.match(/Edge\/(\d+)/); 236 if (!match || match[1] >= 74) { 237 match = userAgent$5.match(/Chrome\/(\d+)/); 238 if (match) version$1 = +match[1]; 239 } 240 } 241 242 var engineV8Version = version$1; 243 244 /* eslint-disable es/no-symbol -- required for testing */ 245 246 var V8_VERSION$3 = engineV8Version; 247 var fails$F = fails$I; 248 249 // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing 250 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$F(function () { 251 var symbol = Symbol(); 252 // Chrome 38 Symbol has incorrect toString conversion 253 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances 254 return !String(symbol) || !(Object(symbol) instanceof Symbol) || 255 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances 256 !Symbol.sham && V8_VERSION$3 && V8_VERSION$3 < 41; 257 }); 258 259 /* eslint-disable es/no-symbol -- required for testing */ 260 261 var NATIVE_SYMBOL$3 = nativeSymbol; 262 263 var useSymbolAsUid = NATIVE_SYMBOL$3 264 && !Symbol.sham 265 && typeof Symbol.iterator == 'symbol'; 266 267 var global$19 = global$1e; 268 var getBuiltIn$8 = getBuiltIn$a; 269 var isCallable$n = isCallable$q; 270 var isPrototypeOf$8 = objectIsPrototypeOf; 271 var USE_SYMBOL_AS_UID$1 = useSymbolAsUid; 272 273 var Object$4 = global$19.Object; 274 275 var isSymbol$6 = USE_SYMBOL_AS_UID$1 ? function (it) { 276 return typeof it == 'symbol'; 277 } : function (it) { 278 var $Symbol = getBuiltIn$8('Symbol'); 279 return isCallable$n($Symbol) && isPrototypeOf$8($Symbol.prototype, Object$4(it)); 280 }; 281 282 var global$18 = global$1e; 283 284 var String$6 = global$18.String; 285 286 var tryToString$5 = function (argument) { 287 try { 288 return String$6(argument); 289 } catch (error) { 290 return 'Object'; 291 } 292 }; 293 294 var global$17 = global$1e; 295 var isCallable$m = isCallable$q; 296 var tryToString$4 = tryToString$5; 297 298 var TypeError$m = global$17.TypeError; 299 300 // `Assert: IsCallable(argument) is true` 301 var aCallable$8 = function (argument) { 302 if (isCallable$m(argument)) return argument; 303 throw TypeError$m(tryToString$4(argument) + ' is not a function'); 304 }; 305 306 var aCallable$7 = aCallable$8; 307 308 // `GetMethod` abstract operation 309 // https://tc39.es/ecma262/#sec-getmethod 310 var getMethod$7 = function (V, P) { 311 var func = V[P]; 312 return func == null ? undefined : aCallable$7(func); 313 }; 314 315 var global$16 = global$1e; 316 var call$o = functionCall; 317 var isCallable$l = isCallable$q; 318 var isObject$r = isObject$s; 319 320 var TypeError$l = global$16.TypeError; 321 322 // `OrdinaryToPrimitive` abstract operation 323 // https://tc39.es/ecma262/#sec-ordinarytoprimitive 324 var ordinaryToPrimitive$1 = function (input, pref) { 325 var fn, val; 326 if (pref === 'string' && isCallable$l(fn = input.toString) && !isObject$r(val = call$o(fn, input))) return val; 327 if (isCallable$l(fn = input.valueOf) && !isObject$r(val = call$o(fn, input))) return val; 328 if (pref !== 'string' && isCallable$l(fn = input.toString) && !isObject$r(val = call$o(fn, input))) return val; 329 throw TypeError$l("Can't convert object to primitive value"); 330 }; 331 332 var shared$5 = {exports: {}}; 333 334 var isPure = false; 335 336 var global$15 = global$1e; 337 338 // eslint-disable-next-line es/no-object-defineproperty -- safe 339 var defineProperty$b = Object.defineProperty; 340 341 var setGlobal$3 = function (key, value) { 342 try { 343 defineProperty$b(global$15, key, { value: value, configurable: true, writable: true }); 344 } catch (error) { 345 global$15[key] = value; 346 } return value; 347 }; 348 349 var global$14 = global$1e; 350 var setGlobal$2 = setGlobal$3; 351 352 var SHARED = '__core-js_shared__'; 353 var store$4 = global$14[SHARED] || setGlobal$2(SHARED, {}); 354 355 var sharedStore = store$4; 356 357 var store$3 = sharedStore; 358 359 (shared$5.exports = function (key, value) { 360 return store$3[key] || (store$3[key] = value !== undefined ? value : {}); 361 })('versions', []).push({ 362 version: '3.20.1', 363 mode: 'global', 364 copyright: '© 2021 Denis Pushkarev (zloirock.ru)' 365 }); 366 367 var global$13 = global$1e; 368 var requireObjectCoercible$b = requireObjectCoercible$d; 369 370 var Object$3 = global$13.Object; 371 372 // `ToObject` abstract operation 373 // https://tc39.es/ecma262/#sec-toobject 374 var toObject$g = function (argument) { 375 return Object$3(requireObjectCoercible$b(argument)); 376 }; 377 378 var uncurryThis$K = functionUncurryThis; 379 var toObject$f = toObject$g; 380 381 var hasOwnProperty$1 = uncurryThis$K({}.hasOwnProperty); 382 383 // `HasOwnProperty` abstract operation 384 // https://tc39.es/ecma262/#sec-hasownproperty 385 var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { 386 return hasOwnProperty$1(toObject$f(it), key); 387 }; 388 389 var uncurryThis$J = functionUncurryThis; 390 391 var id$2 = 0; 392 var postfix = Math.random(); 393 var toString$h = uncurryThis$J(1.0.toString); 394 395 var uid$7 = function (key) { 396 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$h(++id$2 + postfix, 36); 397 }; 398 399 var global$12 = global$1e; 400 var shared$4 = shared$5.exports; 401 var hasOwn$l = hasOwnProperty_1; 402 var uid$6 = uid$7; 403 var NATIVE_SYMBOL$2 = nativeSymbol; 404 var USE_SYMBOL_AS_UID = useSymbolAsUid; 405 406 var WellKnownSymbolsStore$1 = shared$4('wks'); 407 var Symbol$1 = global$12.Symbol; 408 var symbolFor = Symbol$1 && Symbol$1['for']; 409 var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$6; 410 411 var wellKnownSymbol$s = function (name) { 412 if (!hasOwn$l(WellKnownSymbolsStore$1, name) || !(NATIVE_SYMBOL$2 || typeof WellKnownSymbolsStore$1[name] == 'string')) { 413 var description = 'Symbol.' + name; 414 if (NATIVE_SYMBOL$2 && hasOwn$l(Symbol$1, name)) { 415 WellKnownSymbolsStore$1[name] = Symbol$1[name]; 416 } else if (USE_SYMBOL_AS_UID && symbolFor) { 417 WellKnownSymbolsStore$1[name] = symbolFor(description); 418 } else { 419 WellKnownSymbolsStore$1[name] = createWellKnownSymbol(description); 420 } 421 } return WellKnownSymbolsStore$1[name]; 422 }; 423 424 var global$11 = global$1e; 425 var call$n = functionCall; 426 var isObject$q = isObject$s; 427 var isSymbol$5 = isSymbol$6; 428 var getMethod$6 = getMethod$7; 429 var ordinaryToPrimitive = ordinaryToPrimitive$1; 430 var wellKnownSymbol$r = wellKnownSymbol$s; 431 432 var TypeError$k = global$11.TypeError; 433 var TO_PRIMITIVE$1 = wellKnownSymbol$r('toPrimitive'); 434 435 // `ToPrimitive` abstract operation 436 // https://tc39.es/ecma262/#sec-toprimitive 437 var toPrimitive$2 = function (input, pref) { 438 if (!isObject$q(input) || isSymbol$5(input)) return input; 439 var exoticToPrim = getMethod$6(input, TO_PRIMITIVE$1); 440 var result; 441 if (exoticToPrim) { 442 if (pref === undefined) pref = 'default'; 443 result = call$n(exoticToPrim, input, pref); 444 if (!isObject$q(result) || isSymbol$5(result)) return result; 445 throw TypeError$k("Can't convert object to primitive value"); 446 } 447 if (pref === undefined) pref = 'number'; 448 return ordinaryToPrimitive(input, pref); 449 }; 450 451 var toPrimitive$1 = toPrimitive$2; 452 var isSymbol$4 = isSymbol$6; 453 454 // `ToPropertyKey` abstract operation 455 // https://tc39.es/ecma262/#sec-topropertykey 456 var toPropertyKey$5 = function (argument) { 457 var key = toPrimitive$1(argument, 'string'); 458 return isSymbol$4(key) ? key : key + ''; 459 }; 460 461 var global$10 = global$1e; 462 var isObject$p = isObject$s; 463 464 var document$3 = global$10.document; 465 // typeof document.createElement is 'object' in old IE 466 var EXISTS$1 = isObject$p(document$3) && isObject$p(document$3.createElement); 467 468 var documentCreateElement$2 = function (it) { 469 return EXISTS$1 ? document$3.createElement(it) : {}; 470 }; 471 472 var DESCRIPTORS$h = descriptors; 473 var fails$E = fails$I; 474 var createElement$1 = documentCreateElement$2; 475 476 // Thank's IE8 for his funny defineProperty 477 var ie8DomDefine = !DESCRIPTORS$h && !fails$E(function () { 478 // eslint-disable-next-line es/no-object-defineproperty -- required for testing 479 return Object.defineProperty(createElement$1('div'), 'a', { 480 get: function () { return 7; } 481 }).a != 7; 482 }); 483 484 var DESCRIPTORS$g = descriptors; 485 var call$m = functionCall; 486 var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable; 487 var createPropertyDescriptor$7 = createPropertyDescriptor$8; 488 var toIndexedObject$9 = toIndexedObject$a; 489 var toPropertyKey$4 = toPropertyKey$5; 490 var hasOwn$k = hasOwnProperty_1; 491 var IE8_DOM_DEFINE$1 = ie8DomDefine; 492 493 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe 494 var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; 495 496 // `Object.getOwnPropertyDescriptor` method 497 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor 498 objectGetOwnPropertyDescriptor.f = DESCRIPTORS$g ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) { 499 O = toIndexedObject$9(O); 500 P = toPropertyKey$4(P); 501 if (IE8_DOM_DEFINE$1) try { 502 return $getOwnPropertyDescriptor$1(O, P); 503 } catch (error) { /* empty */ } 504 if (hasOwn$k(O, P)) return createPropertyDescriptor$7(!call$m(propertyIsEnumerableModule$2.f, O, P), O[P]); 505 }; 506 507 var objectDefineProperty = {}; 508 509 var global$$ = global$1e; 510 var isObject$o = isObject$s; 511 512 var String$5 = global$$.String; 513 var TypeError$j = global$$.TypeError; 514 515 // `Assert: Type(argument) is Object` 516 var anObject$p = function (argument) { 517 if (isObject$o(argument)) return argument; 518 throw TypeError$j(String$5(argument) + ' is not an object'); 519 }; 520 521 var global$_ = global$1e; 522 var DESCRIPTORS$f = descriptors; 523 var IE8_DOM_DEFINE = ie8DomDefine; 524 var anObject$o = anObject$p; 525 var toPropertyKey$3 = toPropertyKey$5; 526 527 var TypeError$i = global$_.TypeError; 528 // eslint-disable-next-line es/no-object-defineproperty -- safe 529 var $defineProperty$1 = Object.defineProperty; 530 531 // `Object.defineProperty` method 532 // https://tc39.es/ecma262/#sec-object.defineproperty 533 objectDefineProperty.f = DESCRIPTORS$f ? $defineProperty$1 : function defineProperty(O, P, Attributes) { 534 anObject$o(O); 535 P = toPropertyKey$3(P); 536 anObject$o(Attributes); 537 if (IE8_DOM_DEFINE) try { 538 return $defineProperty$1(O, P, Attributes); 539 } catch (error) { /* empty */ } 540 if ('get' in Attributes || 'set' in Attributes) throw TypeError$i('Accessors not supported'); 541 if ('value' in Attributes) O[P] = Attributes.value; 542 return O; 543 }; 544 545 var DESCRIPTORS$e = descriptors; 546 var definePropertyModule$8 = objectDefineProperty; 547 var createPropertyDescriptor$6 = createPropertyDescriptor$8; 548 549 var createNonEnumerableProperty$a = DESCRIPTORS$e ? function (object, key, value) { 550 return definePropertyModule$8.f(object, key, createPropertyDescriptor$6(1, value)); 551 } : function (object, key, value) { 552 object[key] = value; 553 return object; 554 }; 555 556 var redefine$e = {exports: {}}; 557 558 var uncurryThis$I = functionUncurryThis; 559 var isCallable$k = isCallable$q; 560 var store$2 = sharedStore; 561 562 var functionToString$1 = uncurryThis$I(Function.toString); 563 564 // this helper broken in `[email protected]`, so we can't use `shared` helper 565 if (!isCallable$k(store$2.inspectSource)) { 566 store$2.inspectSource = function (it) { 567 return functionToString$1(it); 568 }; 569 } 570 571 var inspectSource$4 = store$2.inspectSource; 572 573 var global$Z = global$1e; 574 var isCallable$j = isCallable$q; 575 var inspectSource$3 = inspectSource$4; 576 577 var WeakMap$2 = global$Z.WeakMap; 578 579 var nativeWeakMap = isCallable$j(WeakMap$2) && /native code/.test(inspectSource$3(WeakMap$2)); 580 581 var shared$3 = shared$5.exports; 582 var uid$5 = uid$7; 583 584 var keys$2 = shared$3('keys'); 585 586 var sharedKey$4 = function (key) { 587 return keys$2[key] || (keys$2[key] = uid$5(key)); 588 }; 589 590 var hiddenKeys$6 = {}; 591 592 var NATIVE_WEAK_MAP$1 = nativeWeakMap; 593 var global$Y = global$1e; 594 var uncurryThis$H = functionUncurryThis; 595 var isObject$n = isObject$s; 596 var createNonEnumerableProperty$9 = createNonEnumerableProperty$a; 597 var hasOwn$j = hasOwnProperty_1; 598 var shared$2 = sharedStore; 599 var sharedKey$3 = sharedKey$4; 600 var hiddenKeys$5 = hiddenKeys$6; 601 602 var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; 603 var TypeError$h = global$Y.TypeError; 604 var WeakMap$1 = global$Y.WeakMap; 605 var set$5, get$4, has$2; 606 607 var enforce = function (it) { 608 return has$2(it) ? get$4(it) : set$5(it, {}); 609 }; 610 611 var getterFor = function (TYPE) { 612 return function (it) { 613 var state; 614 if (!isObject$n(it) || (state = get$4(it)).type !== TYPE) { 615 throw TypeError$h('Incompatible receiver, ' + TYPE + ' required'); 616 } return state; 617 }; 618 }; 619 620 if (NATIVE_WEAK_MAP$1 || shared$2.state) { 621 var store$1 = shared$2.state || (shared$2.state = new WeakMap$1()); 622 var wmget = uncurryThis$H(store$1.get); 623 var wmhas = uncurryThis$H(store$1.has); 624 var wmset = uncurryThis$H(store$1.set); 625 set$5 = function (it, metadata) { 626 if (wmhas(store$1, it)) throw new TypeError$h(OBJECT_ALREADY_INITIALIZED); 627 metadata.facade = it; 628 wmset(store$1, it, metadata); 629 return metadata; 630 }; 631 get$4 = function (it) { 632 return wmget(store$1, it) || {}; 633 }; 634 has$2 = function (it) { 635 return wmhas(store$1, it); 636 }; 637 } else { 638 var STATE = sharedKey$3('state'); 639 hiddenKeys$5[STATE] = true; 640 set$5 = function (it, metadata) { 641 if (hasOwn$j(it, STATE)) throw new TypeError$h(OBJECT_ALREADY_INITIALIZED); 642 metadata.facade = it; 643 createNonEnumerableProperty$9(it, STATE, metadata); 644 return metadata; 645 }; 646 get$4 = function (it) { 647 return hasOwn$j(it, STATE) ? it[STATE] : {}; 648 }; 649 has$2 = function (it) { 650 return hasOwn$j(it, STATE); 651 }; 652 } 653 654 var internalState = { 655 set: set$5, 656 get: get$4, 657 has: has$2, 658 enforce: enforce, 659 getterFor: getterFor 660 }; 661 662 var DESCRIPTORS$d = descriptors; 663 var hasOwn$i = hasOwnProperty_1; 664 665 var FunctionPrototype$2 = Function.prototype; 666 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe 667 var getDescriptor = DESCRIPTORS$d && Object.getOwnPropertyDescriptor; 668 669 var EXISTS = hasOwn$i(FunctionPrototype$2, 'name'); 670 // additional protection from minified / mangled / dropped function names 671 var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; 672 var CONFIGURABLE = EXISTS && (!DESCRIPTORS$d || (DESCRIPTORS$d && getDescriptor(FunctionPrototype$2, 'name').configurable)); 673 674 var functionName = { 675 EXISTS: EXISTS, 676 PROPER: PROPER, 677 CONFIGURABLE: CONFIGURABLE 678 }; 679 680 var global$X = global$1e; 681 var isCallable$i = isCallable$q; 682 var hasOwn$h = hasOwnProperty_1; 683 var createNonEnumerableProperty$8 = createNonEnumerableProperty$a; 684 var setGlobal$1 = setGlobal$3; 685 var inspectSource$2 = inspectSource$4; 686 var InternalStateModule$a = internalState; 687 var CONFIGURABLE_FUNCTION_NAME$2 = functionName.CONFIGURABLE; 688 689 var getInternalState$7 = InternalStateModule$a.get; 690 var enforceInternalState$1 = InternalStateModule$a.enforce; 691 var TEMPLATE = String(String).split('String'); 692 693 (redefine$e.exports = function (O, key, value, options) { 694 var unsafe = options ? !!options.unsafe : false; 695 var simple = options ? !!options.enumerable : false; 696 var noTargetGet = options ? !!options.noTargetGet : false; 697 var name = options && options.name !== undefined ? options.name : key; 698 var state; 699 if (isCallable$i(value)) { 700 if (String(name).slice(0, 7) === 'Symbol(') { 701 name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']'; 702 } 703 if (!hasOwn$h(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$2 && value.name !== name)) { 704 createNonEnumerableProperty$8(value, 'name', name); 705 } 706 state = enforceInternalState$1(value); 707 if (!state.source) { 708 state.source = TEMPLATE.join(typeof name == 'string' ? name : ''); 709 } 710 } 711 if (O === global$X) { 712 if (simple) O[key] = value; 713 else setGlobal$1(key, value); 714 return; 715 } else if (!unsafe) { 716 delete O[key]; 717 } else if (!noTargetGet && O[key]) { 718 simple = true; 719 } 720 if (simple) O[key] = value; 721 else createNonEnumerableProperty$8(O, key, value); 722 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative 723 })(Function.prototype, 'toString', function toString() { 724 return isCallable$i(this) && getInternalState$7(this).source || inspectSource$2(this); 725 }); 726 727 var objectGetOwnPropertyNames = {}; 728 729 var ceil = Math.ceil; 730 var floor$8 = Math.floor; 731 732 // `ToIntegerOrInfinity` abstract operation 733 // https://tc39.es/ecma262/#sec-tointegerorinfinity 734 var toIntegerOrInfinity$c = function (argument) { 735 var number = +argument; 736 // eslint-disable-next-line no-self-compare -- safe 737 return number !== number || number === 0 ? 0 : (number > 0 ? floor$8 : ceil)(number); 738 }; 739 740 var toIntegerOrInfinity$b = toIntegerOrInfinity$c; 741 742 var max$4 = Math.max; 743 var min$8 = Math.min; 744 745 // Helper for a popular repeating case of the spec: 746 // Let integer be ? ToInteger(index). 747 // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). 748 var toAbsoluteIndex$7 = function (index, length) { 749 var integer = toIntegerOrInfinity$b(index); 750 return integer < 0 ? max$4(integer + length, 0) : min$8(integer, length); 751 }; 752 753 var toIntegerOrInfinity$a = toIntegerOrInfinity$c; 754 755 var min$7 = Math.min; 756 757 // `ToLength` abstract operation 758 // https://tc39.es/ecma262/#sec-tolength 759 var toLength$a = function (argument) { 760 return argument > 0 ? min$7(toIntegerOrInfinity$a(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 761 }; 762 763 var toLength$9 = toLength$a; 764 765 // `LengthOfArrayLike` abstract operation 766 // https://tc39.es/ecma262/#sec-lengthofarraylike 767 var lengthOfArrayLike$h = function (obj) { 768 return toLength$9(obj.length); 769 }; 770 771 var toIndexedObject$8 = toIndexedObject$a; 772 var toAbsoluteIndex$6 = toAbsoluteIndex$7; 773 var lengthOfArrayLike$g = lengthOfArrayLike$h; 774 775 // `Array.prototype.{ indexOf, includes }` methods implementation 776 var createMethod$4 = function (IS_INCLUDES) { 777 return function ($this, el, fromIndex) { 778 var O = toIndexedObject$8($this); 779 var length = lengthOfArrayLike$g(O); 780 var index = toAbsoluteIndex$6(fromIndex, length); 781 var value; 782 // Array#includes uses SameValueZero equality algorithm 783 // eslint-disable-next-line no-self-compare -- NaN check 784 if (IS_INCLUDES && el != el) while (length > index) { 785 value = O[index++]; 786 // eslint-disable-next-line no-self-compare -- NaN check 787 if (value != value) return true; 788 // Array#indexOf ignores holes, Array#includes - not 789 } else for (;length > index; index++) { 790 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; 791 } return !IS_INCLUDES && -1; 792 }; 793 }; 794 795 var arrayIncludes = { 796 // `Array.prototype.includes` method 797 // https://tc39.es/ecma262/#sec-array.prototype.includes 798 includes: createMethod$4(true), 799 // `Array.prototype.indexOf` method 800 // https://tc39.es/ecma262/#sec-array.prototype.indexof 801 indexOf: createMethod$4(false) 802 }; 803 804 var uncurryThis$G = functionUncurryThis; 805 var hasOwn$g = hasOwnProperty_1; 806 var toIndexedObject$7 = toIndexedObject$a; 807 var indexOf$1 = arrayIncludes.indexOf; 808 var hiddenKeys$4 = hiddenKeys$6; 809 810 var push$8 = uncurryThis$G([].push); 811 812 var objectKeysInternal = function (object, names) { 813 var O = toIndexedObject$7(object); 814 var i = 0; 815 var result = []; 816 var key; 817 for (key in O) !hasOwn$g(hiddenKeys$4, key) && hasOwn$g(O, key) && push$8(result, key); 818 // Don't enum bug & hidden keys 819 while (names.length > i) if (hasOwn$g(O, key = names[i++])) { 820 ~indexOf$1(result, key) || push$8(result, key); 821 } 822 return result; 823 }; 824 825 // IE8- don't enum bug keys 826 var enumBugKeys$3 = [ 827 'constructor', 828 'hasOwnProperty', 829 'isPrototypeOf', 830 'propertyIsEnumerable', 831 'toLocaleString', 832 'toString', 833 'valueOf' 834 ]; 835 836 var internalObjectKeys$1 = objectKeysInternal; 837 var enumBugKeys$2 = enumBugKeys$3; 838 839 var hiddenKeys$3 = enumBugKeys$2.concat('length', 'prototype'); 840 841 // `Object.getOwnPropertyNames` method 842 // https://tc39.es/ecma262/#sec-object.getownpropertynames 843 // eslint-disable-next-line es/no-object-getownpropertynames -- safe 844 objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { 845 return internalObjectKeys$1(O, hiddenKeys$3); 846 }; 847 848 var objectGetOwnPropertySymbols = {}; 849 850 // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe 851 objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; 852 853 var getBuiltIn$7 = getBuiltIn$a; 854 var uncurryThis$F = functionUncurryThis; 855 var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames; 856 var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols; 857 var anObject$n = anObject$p; 858 859 var concat$2 = uncurryThis$F([].concat); 860 861 // all object keys, includes non-enumerable and symbols 862 var ownKeys$3 = getBuiltIn$7('Reflect', 'ownKeys') || function ownKeys(it) { 863 var keys = getOwnPropertyNamesModule$2.f(anObject$n(it)); 864 var getOwnPropertySymbols = getOwnPropertySymbolsModule$2.f; 865 return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys; 866 }; 867 868 var hasOwn$f = hasOwnProperty_1; 869 var ownKeys$2 = ownKeys$3; 870 var getOwnPropertyDescriptorModule$4 = objectGetOwnPropertyDescriptor; 871 var definePropertyModule$7 = objectDefineProperty; 872 873 var copyConstructorProperties$2 = function (target, source, exceptions) { 874 var keys = ownKeys$2(source); 875 var defineProperty = definePropertyModule$7.f; 876 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$4.f; 877 for (var i = 0; i < keys.length; i++) { 878 var key = keys[i]; 879 if (!hasOwn$f(target, key) && !(exceptions && hasOwn$f(exceptions, key))) { 880 defineProperty(target, key, getOwnPropertyDescriptor(source, key)); 881 } 882 } 883 }; 884 885 var fails$D = fails$I; 886 var isCallable$h = isCallable$q; 887 888 var replacement = /#|\.prototype\./; 889 890 var isForced$4 = function (feature, detection) { 891 var value = data[normalize(feature)]; 892 return value == POLYFILL ? true 893 : value == NATIVE ? false 894 : isCallable$h(detection) ? fails$D(detection) 895 : !!detection; 896 }; 897 898 var normalize = isForced$4.normalize = function (string) { 899 return String(string).replace(replacement, '.').toLowerCase(); 900 }; 901 902 var data = isForced$4.data = {}; 903 var NATIVE = isForced$4.NATIVE = 'N'; 904 var POLYFILL = isForced$4.POLYFILL = 'P'; 905 906 var isForced_1 = isForced$4; 907 908 var global$W = global$1e; 909 var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f; 910 var createNonEnumerableProperty$7 = createNonEnumerableProperty$a; 911 var redefine$d = redefine$e.exports; 912 var setGlobal = setGlobal$3; 913 var copyConstructorProperties$1 = copyConstructorProperties$2; 914 var isForced$3 = isForced_1; 915 916 /* 917 options.target - name of the target object 918 options.global - target is the global object 919 options.stat - export as static methods of target 920 options.proto - export as prototype methods of target 921 options.real - real prototype method for the `pure` version 922 options.forced - export even if the native feature is available 923 options.bind - bind methods to the target, required for the `pure` version 924 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version 925 options.unsafe - use the simple assignment of property instead of delete + defineProperty 926 options.sham - add a flag to not completely full polyfills 927 options.enumerable - export as enumerable property 928 options.noTargetGet - prevent calling a getter on target 929 options.name - the .name of the function if it does not match the key 930 */ 931 var _export = function (options, source) { 932 var TARGET = options.target; 933 var GLOBAL = options.global; 934 var STATIC = options.stat; 935 var FORCED, target, key, targetProperty, sourceProperty, descriptor; 936 if (GLOBAL) { 937 target = global$W; 938 } else if (STATIC) { 939 target = global$W[TARGET] || setGlobal(TARGET, {}); 940 } else { 941 target = (global$W[TARGET] || {}).prototype; 942 } 943 if (target) for (key in source) { 944 sourceProperty = source[key]; 945 if (options.noTargetGet) { 946 descriptor = getOwnPropertyDescriptor$5(target, key); 947 targetProperty = descriptor && descriptor.value; 948 } else targetProperty = target[key]; 949 FORCED = isForced$3(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); 950 // contained in target 951 if (!FORCED && targetProperty !== undefined) { 952 if (typeof sourceProperty == typeof targetProperty) continue; 953 copyConstructorProperties$1(sourceProperty, targetProperty); 954 } 955 // add a flag to not completely full polyfills 956 if (options.sham || (targetProperty && targetProperty.sham)) { 957 createNonEnumerableProperty$7(sourceProperty, 'sham', true); 958 } 959 // extend global 960 redefine$d(target, key, sourceProperty, options); 961 } 962 }; 963 964 var wellKnownSymbol$q = wellKnownSymbol$s; 965 966 var TO_STRING_TAG$4 = wellKnownSymbol$q('toStringTag'); 967 var test$1 = {}; 968 969 test$1[TO_STRING_TAG$4] = 'z'; 970 971 var toStringTagSupport = String(test$1) === '[object z]'; 972 973 var global$V = global$1e; 974 var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport; 975 var isCallable$g = isCallable$q; 976 var classofRaw = classofRaw$1; 977 var wellKnownSymbol$p = wellKnownSymbol$s; 978 979 var TO_STRING_TAG$3 = wellKnownSymbol$p('toStringTag'); 980 var Object$2 = global$V.Object; 981 982 // ES3 wrong here 983 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; 984 985 // fallback for IE11 Script Access Denied error 986 var tryGet = function (it, key) { 987 try { 988 return it[key]; 989 } catch (error) { /* empty */ } 990 }; 991 992 // getting tag from ES6+ `Object.prototype.toString` 993 var classof$d = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) { 994 var O, tag, result; 995 return it === undefined ? 'Undefined' : it === null ? 'Null' 996 // @@toStringTag case 997 : typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$3)) == 'string' ? tag 998 // builtinTag case 999 : CORRECT_ARGUMENTS ? classofRaw(O) 1000 // ES3 arguments fallback 1001 : (result = classofRaw(O)) == 'Object' && isCallable$g(O.callee) ? 'Arguments' : result; 1002 }; 1003 1004 var global$U = global$1e; 1005 var classof$c = classof$d; 1006 1007 var String$4 = global$U.String; 1008 1009 var toString$g = function (argument) { 1010 if (classof$c(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); 1011 return String$4(argument); 1012 }; 1013 1014 var anObject$m = anObject$p; 1015 1016 // `RegExp.prototype.flags` getter implementation 1017 // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags 1018 var regexpFlags$1 = function () { 1019 var that = anObject$m(this); 1020 var result = ''; 1021 if (that.global) result += 'g'; 1022 if (that.ignoreCase) result += 'i'; 1023 if (that.multiline) result += 'm'; 1024 if (that.dotAll) result += 's'; 1025 if (that.unicode) result += 'u'; 1026 if (that.sticky) result += 'y'; 1027 return result; 1028 }; 1029 1030 var fails$C = fails$I; 1031 var global$T = global$1e; 1032 1033 // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError 1034 var $RegExp$2 = global$T.RegExp; 1035 1036 var UNSUPPORTED_Y$2 = fails$C(function () { 1037 var re = $RegExp$2('a', 'y'); 1038 re.lastIndex = 2; 1039 return re.exec('abcd') != null; 1040 }); 1041 1042 // UC Browser bug 1043 // https://github.com/zloirock/core-js/issues/1008 1044 var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$C(function () { 1045 return !$RegExp$2('a', 'y').sticky; 1046 }); 1047 1048 var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$C(function () { 1049 // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 1050 var re = $RegExp$2('^r', 'gy'); 1051 re.lastIndex = 2; 1052 return re.exec('str') != null; 1053 }); 1054 1055 var regexpStickyHelpers = { 1056 BROKEN_CARET: BROKEN_CARET, 1057 MISSED_STICKY: MISSED_STICKY, 1058 UNSUPPORTED_Y: UNSUPPORTED_Y$2 1059 }; 1060 1061 var internalObjectKeys = objectKeysInternal; 1062 var enumBugKeys$1 = enumBugKeys$3; 1063 1064 // `Object.keys` method 1065 // https://tc39.es/ecma262/#sec-object.keys 1066 // eslint-disable-next-line es/no-object-keys -- safe 1067 var objectKeys$3 = Object.keys || function keys(O) { 1068 return internalObjectKeys(O, enumBugKeys$1); 1069 }; 1070 1071 var DESCRIPTORS$c = descriptors; 1072 var definePropertyModule$6 = objectDefineProperty; 1073 var anObject$l = anObject$p; 1074 var toIndexedObject$6 = toIndexedObject$a; 1075 var objectKeys$2 = objectKeys$3; 1076 1077 // `Object.defineProperties` method 1078 // https://tc39.es/ecma262/#sec-object.defineproperties 1079 // eslint-disable-next-line es/no-object-defineproperties -- safe 1080 var objectDefineProperties = DESCRIPTORS$c ? Object.defineProperties : function defineProperties(O, Properties) { 1081 anObject$l(O); 1082 var props = toIndexedObject$6(Properties); 1083 var keys = objectKeys$2(Properties); 1084 var length = keys.length; 1085 var index = 0; 1086 var key; 1087 while (length > index) definePropertyModule$6.f(O, key = keys[index++], props[key]); 1088 return O; 1089 }; 1090 1091 var getBuiltIn$6 = getBuiltIn$a; 1092 1093 var html$2 = getBuiltIn$6('document', 'documentElement'); 1094 1095 /* global ActiveXObject -- old IE, WSH */ 1096 1097 var anObject$k = anObject$p; 1098 var defineProperties$1 = objectDefineProperties; 1099 var enumBugKeys = enumBugKeys$3; 1100 var hiddenKeys$2 = hiddenKeys$6; 1101 var html$1 = html$2; 1102 var documentCreateElement$1 = documentCreateElement$2; 1103 var sharedKey$2 = sharedKey$4; 1104 1105 var GT = '>'; 1106 var LT = '<'; 1107 var PROTOTYPE$2 = 'prototype'; 1108 var SCRIPT = 'script'; 1109 var IE_PROTO$1 = sharedKey$2('IE_PROTO'); 1110 1111 var EmptyConstructor = function () { /* empty */ }; 1112 1113 var scriptTag = function (content) { 1114 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; 1115 }; 1116 1117 // Create object with fake `null` prototype: use ActiveX Object with cleared prototype 1118 var NullProtoObjectViaActiveX = function (activeXDocument) { 1119 activeXDocument.write(scriptTag('')); 1120 activeXDocument.close(); 1121 var temp = activeXDocument.parentWindow.Object; 1122 activeXDocument = null; // avoid memory leak 1123 return temp; 1124 }; 1125 1126 // Create object with fake `null` prototype: use iframe Object with cleared prototype 1127 var NullProtoObjectViaIFrame = function () { 1128 // Thrash, waste and sodomy: IE GC bug 1129 var iframe = documentCreateElement$1('iframe'); 1130 var JS = 'java' + SCRIPT + ':'; 1131 var iframeDocument; 1132 iframe.style.display = 'none'; 1133 html$1.appendChild(iframe); 1134 // https://github.com/zloirock/core-js/issues/475 1135 iframe.src = String(JS); 1136 iframeDocument = iframe.contentWindow.document; 1137 iframeDocument.open(); 1138 iframeDocument.write(scriptTag('document.F=Object')); 1139 iframeDocument.close(); 1140 return iframeDocument.F; 1141 }; 1142 1143 // Check for document.domain and active x support 1144 // No need to use active x approach when document.domain is not set 1145 // see https://github.com/es-shims/es5-shim/issues/150 1146 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 1147 // avoid IE GC bug 1148 var activeXDocument; 1149 var NullProtoObject = function () { 1150 try { 1151 activeXDocument = new ActiveXObject('htmlfile'); 1152 } catch (error) { /* ignore */ } 1153 NullProtoObject = typeof document != 'undefined' 1154 ? document.domain && activeXDocument 1155 ? NullProtoObjectViaActiveX(activeXDocument) // old IE 1156 : NullProtoObjectViaIFrame() 1157 : NullProtoObjectViaActiveX(activeXDocument); // WSH 1158 var length = enumBugKeys.length; 1159 while (length--) delete NullProtoObject[PROTOTYPE$2][enumBugKeys[length]]; 1160 return NullProtoObject(); 1161 }; 1162 1163 hiddenKeys$2[IE_PROTO$1] = true; 1164 1165 // `Object.create` method 1166 // https://tc39.es/ecma262/#sec-object.create 1167 var objectCreate = Object.create || function create(O, Properties) { 1168 var result; 1169 if (O !== null) { 1170 EmptyConstructor[PROTOTYPE$2] = anObject$k(O); 1171 result = new EmptyConstructor(); 1172 EmptyConstructor[PROTOTYPE$2] = null; 1173 // add "__proto__" for Object.getPrototypeOf polyfill 1174 result[IE_PROTO$1] = O; 1175 } else result = NullProtoObject(); 1176 return Properties === undefined ? result : defineProperties$1(result, Properties); 1177 }; 1178 1179 var fails$B = fails$I; 1180 var global$S = global$1e; 1181 1182 // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError 1183 var $RegExp$1 = global$S.RegExp; 1184 1185 var regexpUnsupportedDotAll = fails$B(function () { 1186 var re = $RegExp$1('.', 's'); 1187 return !(re.dotAll && re.exec('\n') && re.flags === 's'); 1188 }); 1189 1190 var fails$A = fails$I; 1191 var global$R = global$1e; 1192 1193 // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError 1194 var $RegExp = global$R.RegExp; 1195 1196 var regexpUnsupportedNcg = fails$A(function () { 1197 var re = $RegExp('(?<a>b)', 'g'); 1198 return re.exec('b').groups.a !== 'b' || 1199 'b'.replace(re, '$<a>c') !== 'bc'; 1200 }); 1201 1202 /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ 1203 /* eslint-disable regexp/no-useless-quantifier -- testing */ 1204 var call$l = functionCall; 1205 var uncurryThis$E = functionUncurryThis; 1206 var toString$f = toString$g; 1207 var regexpFlags = regexpFlags$1; 1208 var stickyHelpers$1 = regexpStickyHelpers; 1209 var shared$1 = shared$5.exports; 1210 var create$5 = objectCreate; 1211 var getInternalState$6 = internalState.get; 1212 var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll; 1213 var UNSUPPORTED_NCG = regexpUnsupportedNcg; 1214 1215 var nativeReplace = shared$1('native-string-replace', String.prototype.replace); 1216 var nativeExec = RegExp.prototype.exec; 1217 var patchedExec = nativeExec; 1218 var charAt$7 = uncurryThis$E(''.charAt); 1219 var indexOf = uncurryThis$E(''.indexOf); 1220 var replace$8 = uncurryThis$E(''.replace); 1221 var stringSlice$9 = uncurryThis$E(''.slice); 1222 1223 var UPDATES_LAST_INDEX_WRONG = (function () { 1224 var re1 = /a/; 1225 var re2 = /b*/g; 1226 call$l(nativeExec, re1, 'a'); 1227 call$l(nativeExec, re2, 'a'); 1228 return re1.lastIndex !== 0 || re2.lastIndex !== 0; 1229 })(); 1230 1231 var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET; 1232 1233 // nonparticipating capturing group, copied from es5-shim's String#split patch. 1234 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; 1235 1236 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; 1237 1238 if (PATCH) { 1239 patchedExec = function exec(string) { 1240 var re = this; 1241 var state = getInternalState$6(re); 1242 var str = toString$f(string); 1243 var raw = state.raw; 1244 var result, reCopy, lastIndex, match, i, object, group; 1245 1246 if (raw) { 1247 raw.lastIndex = re.lastIndex; 1248 result = call$l(patchedExec, raw, str); 1249 re.lastIndex = raw.lastIndex; 1250 return result; 1251 } 1252 1253 var groups = state.groups; 1254 var sticky = UNSUPPORTED_Y$1 && re.sticky; 1255 var flags = call$l(regexpFlags, re); 1256 var source = re.source; 1257 var charsAdded = 0; 1258 var strCopy = str; 1259 1260 if (sticky) { 1261 flags = replace$8(flags, 'y', ''); 1262 if (indexOf(flags, 'g') === -1) { 1263 flags += 'g'; 1264 } 1265 1266 strCopy = stringSlice$9(str, re.lastIndex); 1267 // Support anchored sticky behavior. 1268 if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$7(str, re.lastIndex - 1) !== '\n')) { 1269 source = '(?: ' + source + ')'; 1270 strCopy = ' ' + strCopy; 1271 charsAdded++; 1272 } 1273 // ^(? + rx + ) is needed, in combination with some str slicing, to 1274 // simulate the 'y' flag. 1275 reCopy = new RegExp('^(?:' + source + ')', flags); 1276 } 1277 1278 if (NPCG_INCLUDED) { 1279 reCopy = new RegExp('^' + source + '$(?!\\s)', flags); 1280 } 1281 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; 1282 1283 match = call$l(nativeExec, sticky ? reCopy : re, strCopy); 1284 1285 if (sticky) { 1286 if (match) { 1287 match.input = stringSlice$9(match.input, charsAdded); 1288 match[0] = stringSlice$9(match[0], charsAdded); 1289 match.index = re.lastIndex; 1290 re.lastIndex += match[0].length; 1291 } else re.lastIndex = 0; 1292 } else if (UPDATES_LAST_INDEX_WRONG && match) { 1293 re.lastIndex = re.global ? match.index + match[0].length : lastIndex; 1294 } 1295 if (NPCG_INCLUDED && match && match.length > 1) { 1296 // Fix browsers whose `exec` methods don't consistently return `undefined` 1297 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ 1298 call$l(nativeReplace, match[0], reCopy, function () { 1299 for (i = 1; i < arguments.length - 2; i++) { 1300 if (arguments[i] === undefined) match[i] = undefined; 1301 } 1302 }); 1303 } 1304 1305 if (match && groups) { 1306 match.groups = object = create$5(null); 1307 for (i = 0; i < groups.length; i++) { 1308 group = groups[i]; 1309 object[group[0]] = match[group[1]]; 1310 } 1311 } 1312 1313 return match; 1314 }; 1315 } 1316 1317 var regexpExec$3 = patchedExec; 1318 1319 var $$G = _export; 1320 var exec$5 = regexpExec$3; 1321 1322 // `RegExp.prototype.exec` method 1323 // https://tc39.es/ecma262/#sec-regexp.prototype.exec 1324 $$G({ target: 'RegExp', proto: true, forced: /./.exec !== exec$5 }, { 1325 exec: exec$5 1326 }); 1327 1328 var FunctionPrototype$1 = Function.prototype; 1329 var apply$8 = FunctionPrototype$1.apply; 1330 var bind$b = FunctionPrototype$1.bind; 1331 var call$k = FunctionPrototype$1.call; 1332 1333 // eslint-disable-next-line es/no-reflect -- safe 1334 var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$b ? call$k.bind(apply$8) : function () { 1335 return call$k.apply(apply$8, arguments); 1336 }); 1337 1338 // TODO: Remove from `core-js@4` since it's moved to entry points 1339 1340 var uncurryThis$D = functionUncurryThis; 1341 var redefine$c = redefine$e.exports; 1342 var regexpExec$2 = regexpExec$3; 1343 var fails$z = fails$I; 1344 var wellKnownSymbol$o = wellKnownSymbol$s; 1345 var createNonEnumerableProperty$6 = createNonEnumerableProperty$a; 1346 1347 var SPECIES$6 = wellKnownSymbol$o('species'); 1348 var RegExpPrototype$1 = RegExp.prototype; 1349 1350 var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) { 1351 var SYMBOL = wellKnownSymbol$o(KEY); 1352 1353 var DELEGATES_TO_SYMBOL = !fails$z(function () { 1354 // String methods call symbol-named RegEp methods 1355 var O = {}; 1356 O[SYMBOL] = function () { return 7; }; 1357 return ''[KEY](O) != 7; 1358 }); 1359 1360 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$z(function () { 1361 // Symbol-named RegExp methods call .exec 1362 var execCalled = false; 1363 var re = /a/; 1364 1365 if (KEY === 'split') { 1366 // We can't use real regex here since it causes deoptimization 1367 // and serious performance degradation in V8 1368 // https://github.com/zloirock/core-js/issues/306 1369 re = {}; 1370 // RegExp[@@split] doesn't call the regex's exec method, but first creates 1371 // a new one. We need to return the patched regex when creating the new one. 1372 re.constructor = {}; 1373 re.constructor[SPECIES$6] = function () { return re; }; 1374 re.flags = ''; 1375 re[SYMBOL] = /./[SYMBOL]; 1376 } 1377 1378 re.exec = function () { execCalled = true; return null; }; 1379 1380 re[SYMBOL](''); 1381 return !execCalled; 1382 }); 1383 1384 if ( 1385 !DELEGATES_TO_SYMBOL || 1386 !DELEGATES_TO_EXEC || 1387 FORCED 1388 ) { 1389 var uncurriedNativeRegExpMethod = uncurryThis$D(/./[SYMBOL]); 1390 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { 1391 var uncurriedNativeMethod = uncurryThis$D(nativeMethod); 1392 var $exec = regexp.exec; 1393 if ($exec === regexpExec$2 || $exec === RegExpPrototype$1.exec) { 1394 if (DELEGATES_TO_SYMBOL && !forceStringMethod) { 1395 // The native String method already delegates to @@method (this 1396 // polyfilled function), leasing to infinite recursion. 1397 // We avoid it by directly calling the native @@method method. 1398 return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) }; 1399 } 1400 return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) }; 1401 } 1402 return { done: false }; 1403 }); 1404 1405 redefine$c(String.prototype, KEY, methods[0]); 1406 redefine$c(RegExpPrototype$1, SYMBOL, methods[1]); 1407 } 1408 1409 if (SHAM) createNonEnumerableProperty$6(RegExpPrototype$1[SYMBOL], 'sham', true); 1410 }; 1411 1412 var isObject$m = isObject$s; 1413 var classof$b = classofRaw$1; 1414 var wellKnownSymbol$n = wellKnownSymbol$s; 1415 1416 var MATCH$1 = wellKnownSymbol$n('match'); 1417 1418 // `IsRegExp` abstract operation 1419 // https://tc39.es/ecma262/#sec-isregexp 1420 var isRegexp = function (it) { 1421 var isRegExp; 1422 return isObject$m(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$b(it) == 'RegExp'); 1423 }; 1424 1425 var uncurryThis$C = functionUncurryThis; 1426 var fails$y = fails$I; 1427 var isCallable$f = isCallable$q; 1428 var classof$a = classof$d; 1429 var getBuiltIn$5 = getBuiltIn$a; 1430 var inspectSource$1 = inspectSource$4; 1431 1432 var noop = function () { /* empty */ }; 1433 var empty = []; 1434 var construct = getBuiltIn$5('Reflect', 'construct'); 1435 var constructorRegExp = /^\s*(?:class|function)\b/; 1436 var exec$4 = uncurryThis$C(constructorRegExp.exec); 1437 var INCORRECT_TO_STRING = !constructorRegExp.exec(noop); 1438 1439 var isConstructorModern = function isConstructor(argument) { 1440 if (!isCallable$f(argument)) return false; 1441 try { 1442 construct(noop, empty, argument); 1443 return true; 1444 } catch (error) { 1445 return false; 1446 } 1447 }; 1448 1449 var isConstructorLegacy = function isConstructor(argument) { 1450 if (!isCallable$f(argument)) return false; 1451 switch (classof$a(argument)) { 1452 case 'AsyncFunction': 1453 case 'GeneratorFunction': 1454 case 'AsyncGeneratorFunction': return false; 1455 } 1456 try { 1457 // we can't check .prototype since constructors produced by .bind haven't it 1458 // `Function#toString` throws on some built-it function in some legacy engines 1459 // (for example, `DOMQuad` and similar in FF41-) 1460 return INCORRECT_TO_STRING || !!exec$4(constructorRegExp, inspectSource$1(argument)); 1461 } catch (error) { 1462 return true; 1463 } 1464 }; 1465 1466 isConstructorLegacy.sham = true; 1467 1468 // `IsConstructor` abstract operation 1469 // https://tc39.es/ecma262/#sec-isconstructor 1470 var isConstructor$4 = !construct || fails$y(function () { 1471 var called; 1472 return isConstructorModern(isConstructorModern.call) 1473 || !isConstructorModern(Object) 1474 || !isConstructorModern(function () { called = true; }) 1475 || called; 1476 }) ? isConstructorLegacy : isConstructorModern; 1477 1478 var global$Q = global$1e; 1479 var isConstructor$3 = isConstructor$4; 1480 var tryToString$3 = tryToString$5; 1481 1482 var TypeError$g = global$Q.TypeError; 1483 1484 // `Assert: IsConstructor(argument) is true` 1485 var aConstructor$2 = function (argument) { 1486 if (isConstructor$3(argument)) return argument; 1487 throw TypeError$g(tryToString$3(argument) + ' is not a constructor'); 1488 }; 1489 1490 var anObject$j = anObject$p; 1491 var aConstructor$1 = aConstructor$2; 1492 var wellKnownSymbol$m = wellKnownSymbol$s; 1493 1494 var SPECIES$5 = wellKnownSymbol$m('species'); 1495 1496 // `SpeciesConstructor` abstract operation 1497 // https://tc39.es/ecma262/#sec-speciesconstructor 1498 var speciesConstructor$3 = function (O, defaultConstructor) { 1499 var C = anObject$j(O).constructor; 1500 var S; 1501 return C === undefined || (S = anObject$j(C)[SPECIES$5]) == undefined ? defaultConstructor : aConstructor$1(S); 1502 }; 1503 1504 var uncurryThis$B = functionUncurryThis; 1505 var toIntegerOrInfinity$9 = toIntegerOrInfinity$c; 1506 var toString$e = toString$g; 1507 var requireObjectCoercible$a = requireObjectCoercible$d; 1508 1509 var charAt$6 = uncurryThis$B(''.charAt); 1510 var charCodeAt$3 = uncurryThis$B(''.charCodeAt); 1511 var stringSlice$8 = uncurryThis$B(''.slice); 1512 1513 var createMethod$3 = function (CONVERT_TO_STRING) { 1514 return function ($this, pos) { 1515 var S = toString$e(requireObjectCoercible$a($this)); 1516 var position = toIntegerOrInfinity$9(pos); 1517 var size = S.length; 1518 var first, second; 1519 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; 1520 first = charCodeAt$3(S, position); 1521 return first < 0xD800 || first > 0xDBFF || position + 1 === size 1522 || (second = charCodeAt$3(S, position + 1)) < 0xDC00 || second > 0xDFFF 1523 ? CONVERT_TO_STRING 1524 ? charAt$6(S, position) 1525 : first 1526 : CONVERT_TO_STRING 1527 ? stringSlice$8(S, position, position + 2) 1528 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; 1529 }; 1530 }; 1531 1532 var stringMultibyte = { 1533 // `String.prototype.codePointAt` method 1534 // https://tc39.es/ecma262/#sec-string.prototype.codepointat 1535 codeAt: createMethod$3(false), 1536 // `String.prototype.at` method 1537 // https://github.com/mathiasbynens/String.prototype.at 1538 charAt: createMethod$3(true) 1539 }; 1540 1541 var charAt$5 = stringMultibyte.charAt; 1542 1543 // `AdvanceStringIndex` abstract operation 1544 // https://tc39.es/ecma262/#sec-advancestringindex 1545 var advanceStringIndex$3 = function (S, index, unicode) { 1546 return index + (unicode ? charAt$5(S, index).length : 1); 1547 }; 1548 1549 var toPropertyKey$2 = toPropertyKey$5; 1550 var definePropertyModule$5 = objectDefineProperty; 1551 var createPropertyDescriptor$5 = createPropertyDescriptor$8; 1552 1553 var createProperty$5 = function (object, key, value) { 1554 var propertyKey = toPropertyKey$2(key); 1555 if (propertyKey in object) definePropertyModule$5.f(object, propertyKey, createPropertyDescriptor$5(0, value)); 1556 else object[propertyKey] = value; 1557 }; 1558 1559 var global$P = global$1e; 1560 var toAbsoluteIndex$5 = toAbsoluteIndex$7; 1561 var lengthOfArrayLike$f = lengthOfArrayLike$h; 1562 var createProperty$4 = createProperty$5; 1563 1564 var Array$8 = global$P.Array; 1565 var max$3 = Math.max; 1566 1567 var arraySliceSimple = function (O, start, end) { 1568 var length = lengthOfArrayLike$f(O); 1569 var k = toAbsoluteIndex$5(start, length); 1570 var fin = toAbsoluteIndex$5(end === undefined ? length : end, length); 1571 var result = Array$8(max$3(fin - k, 0)); 1572 for (var n = 0; k < fin; k++, n++) createProperty$4(result, n, O[k]); 1573 result.length = n; 1574 return result; 1575 }; 1576 1577 var global$O = global$1e; 1578 var call$j = functionCall; 1579 var anObject$i = anObject$p; 1580 var isCallable$e = isCallable$q; 1581 var classof$9 = classofRaw$1; 1582 var regexpExec$1 = regexpExec$3; 1583 1584 var TypeError$f = global$O.TypeError; 1585 1586 // `RegExpExec` abstract operation 1587 // https://tc39.es/ecma262/#sec-regexpexec 1588 var regexpExecAbstract = function (R, S) { 1589 var exec = R.exec; 1590 if (isCallable$e(exec)) { 1591 var result = call$j(exec, R, S); 1592 if (result !== null) anObject$i(result); 1593 return result; 1594 } 1595 if (classof$9(R) === 'RegExp') return call$j(regexpExec$1, R, S); 1596 throw TypeError$f('RegExp#exec called on incompatible receiver'); 1597 }; 1598 1599 var apply$7 = functionApply; 1600 var call$i = functionCall; 1601 var uncurryThis$A = functionUncurryThis; 1602 var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic; 1603 var isRegExp$1 = isRegexp; 1604 var anObject$h = anObject$p; 1605 var requireObjectCoercible$9 = requireObjectCoercible$d; 1606 var speciesConstructor$2 = speciesConstructor$3; 1607 var advanceStringIndex$2 = advanceStringIndex$3; 1608 var toLength$8 = toLength$a; 1609 var toString$d = toString$g; 1610 var getMethod$5 = getMethod$7; 1611 var arraySlice$a = arraySliceSimple; 1612 var callRegExpExec = regexpExecAbstract; 1613 var regexpExec = regexpExec$3; 1614 var stickyHelpers = regexpStickyHelpers; 1615 var fails$x = fails$I; 1616 1617 var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; 1618 var MAX_UINT32 = 0xFFFFFFFF; 1619 var min$6 = Math.min; 1620 var $push = [].push; 1621 var exec$3 = uncurryThis$A(/./.exec); 1622 var push$7 = uncurryThis$A($push); 1623 var stringSlice$7 = uncurryThis$A(''.slice); 1624 1625 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec 1626 // Weex JS has frozen built-in prototypes, so use try / catch wrapper 1627 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$x(function () { 1628 // eslint-disable-next-line regexp/no-empty-group -- required for testing 1629 var re = /(?:)/; 1630 var originalExec = re.exec; 1631 re.exec = function () { return originalExec.apply(this, arguments); }; 1632 var result = 'ab'.split(re); 1633 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; 1634 }); 1635 1636 // @@split logic 1637 fixRegExpWellKnownSymbolLogic$3('split', function (SPLIT, nativeSplit, maybeCallNative) { 1638 var internalSplit; 1639 if ( 1640 'abbc'.split(/(b)*/)[1] == 'c' || 1641 // eslint-disable-next-line regexp/no-empty-group -- required for testing 1642 'test'.split(/(?:)/, -1).length != 4 || 1643 'ab'.split(/(?:ab)*/).length != 2 || 1644 '.'.split(/(.?)(.?)/).length != 4 || 1645 // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing 1646 '.'.split(/()()/).length > 1 || 1647 ''.split(/.?/).length 1648 ) { 1649 // based on es5-shim implementation, need to rework it 1650 internalSplit = function (separator, limit) { 1651 var string = toString$d(requireObjectCoercible$9(this)); 1652 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; 1653 if (lim === 0) return []; 1654 if (separator === undefined) return [string]; 1655 // If `separator` is not a regex, use native split 1656 if (!isRegExp$1(separator)) { 1657 return call$i(nativeSplit, string, separator, lim); 1658 } 1659 var output = []; 1660 var flags = (separator.ignoreCase ? 'i' : '') + 1661 (separator.multiline ? 'm' : '') + 1662 (separator.unicode ? 'u' : '') + 1663 (separator.sticky ? 'y' : ''); 1664 var lastLastIndex = 0; 1665 // Make `global` and avoid `lastIndex` issues by working with a copy 1666 var separatorCopy = new RegExp(separator.source, flags + 'g'); 1667 var match, lastIndex, lastLength; 1668 while (match = call$i(regexpExec, separatorCopy, string)) { 1669 lastIndex = separatorCopy.lastIndex; 1670 if (lastIndex > lastLastIndex) { 1671 push$7(output, stringSlice$7(string, lastLastIndex, match.index)); 1672 if (match.length > 1 && match.index < string.length) apply$7($push, output, arraySlice$a(match, 1)); 1673 lastLength = match[0].length; 1674 lastLastIndex = lastIndex; 1675 if (output.length >= lim) break; 1676 } 1677 if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop 1678 } 1679 if (lastLastIndex === string.length) { 1680 if (lastLength || !exec$3(separatorCopy, '')) push$7(output, ''); 1681 } else push$7(output, stringSlice$7(string, lastLastIndex)); 1682 return output.length > lim ? arraySlice$a(output, 0, lim) : output; 1683 }; 1684 // Chakra, V8 1685 } else if ('0'.split(undefined, 0).length) { 1686 internalSplit = function (separator, limit) { 1687 return separator === undefined && limit === 0 ? [] : call$i(nativeSplit, this, separator, limit); 1688 }; 1689 } else internalSplit = nativeSplit; 1690 1691 return [ 1692 // `String.prototype.split` method 1693 // https://tc39.es/ecma262/#sec-string.prototype.split 1694 function split(separator, limit) { 1695 var O = requireObjectCoercible$9(this); 1696 var splitter = separator == undefined ? undefined : getMethod$5(separator, SPLIT); 1697 return splitter 1698 ? call$i(splitter, separator, O, limit) 1699 : call$i(internalSplit, toString$d(O), separator, limit); 1700 }, 1701 // `RegExp.prototype[@@split]` method 1702 // https://tc39.es/ecma262/#sec-regexp.prototype-@@split 1703 // 1704 // NOTE: This cannot be properly polyfilled in engines that don't support 1705 // the 'y' flag. 1706 function (string, limit) { 1707 var rx = anObject$h(this); 1708 var S = toString$d(string); 1709 var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); 1710 1711 if (res.done) return res.value; 1712 1713 var C = speciesConstructor$2(rx, RegExp); 1714 1715 var unicodeMatching = rx.unicode; 1716 var flags = (rx.ignoreCase ? 'i' : '') + 1717 (rx.multiline ? 'm' : '') + 1718 (rx.unicode ? 'u' : '') + 1719 (UNSUPPORTED_Y ? 'g' : 'y'); 1720 1721 // ^(? + rx + ) is needed, in combination with some S slicing, to 1722 // simulate the 'y' flag. 1723 var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags); 1724 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; 1725 if (lim === 0) return []; 1726 if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; 1727 var p = 0; 1728 var q = 0; 1729 var A = []; 1730 while (q < S.length) { 1731 splitter.lastIndex = UNSUPPORTED_Y ? 0 : q; 1732 var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice$7(S, q) : S); 1733 var e; 1734 if ( 1735 z === null || 1736 (e = min$6(toLength$8(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p 1737 ) { 1738 q = advanceStringIndex$2(S, q, unicodeMatching); 1739 } else { 1740 push$7(A, stringSlice$7(S, p, q)); 1741 if (A.length === lim) return A; 1742 for (var i = 1; i <= z.length - 1; i++) { 1743 push$7(A, z[i]); 1744 if (A.length === lim) return A; 1745 } 1746 q = p = e; 1747 } 1748 } 1749 push$7(A, stringSlice$7(S, p)); 1750 return A; 1751 } 1752 ]; 1753 }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); 1754 1755 var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport; 1756 var classof$8 = classof$d; 1757 1758 // `Object.prototype.toString` method implementation 1759 // https://tc39.es/ecma262/#sec-object.prototype.tostring 1760 var objectToString$1 = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() { 1761 return '[object ' + classof$8(this) + ']'; 1762 }; 1763 1764 var TO_STRING_TAG_SUPPORT = toStringTagSupport; 1765 var redefine$b = redefine$e.exports; 1766 var toString$c = objectToString$1; 1767 1768 // `Object.prototype.toString` method 1769 // https://tc39.es/ecma262/#sec-object.prototype.tostring 1770 if (!TO_STRING_TAG_SUPPORT) { 1771 redefine$b(Object.prototype, 'toString', toString$c, { unsafe: true }); 1772 } 1773 1774 // iterable DOM collections 1775 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods 1776 var domIterables = { 1777 CSSRuleList: 0, 1778 CSSStyleDeclaration: 0, 1779 CSSValueList: 0, 1780 ClientRectList: 0, 1781 DOMRectList: 0, 1782 DOMStringList: 0, 1783 DOMTokenList: 1, 1784 DataTransferItemList: 0, 1785 FileList: 0, 1786 HTMLAllCollection: 0, 1787 HTMLCollection: 0, 1788 HTMLFormElement: 0, 1789 HTMLSelectElement: 0, 1790 MediaList: 0, 1791 MimeTypeArray: 0, 1792 NamedNodeMap: 0, 1793 NodeList: 1, 1794 PaintRequestList: 0, 1795 Plugin: 0, 1796 PluginArray: 0, 1797 SVGLengthList: 0, 1798 SVGNumberList: 0, 1799 SVGPathSegList: 0, 1800 SVGPointList: 0, 1801 SVGStringList: 0, 1802 SVGTransformList: 0, 1803 SourceBufferList: 0, 1804 StyleSheetList: 0, 1805 TextTrackCueList: 0, 1806 TextTrackList: 0, 1807 TouchList: 0 1808 }; 1809 1810 // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` 1811 var documentCreateElement = documentCreateElement$2; 1812 1813 var classList = documentCreateElement('span').classList; 1814 var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype; 1815 1816 var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2; 1817 1818 var uncurryThis$z = functionUncurryThis; 1819 var aCallable$6 = aCallable$8; 1820 1821 var bind$a = uncurryThis$z(uncurryThis$z.bind); 1822 1823 // optional / simple context binding 1824 var functionBindContext = function (fn, that) { 1825 aCallable$6(fn); 1826 return that === undefined ? fn : bind$a ? bind$a(fn, that) : function (/* ...args */) { 1827 return fn.apply(that, arguments); 1828 }; 1829 }; 1830 1831 var classof$7 = classofRaw$1; 1832 1833 // `IsArray` abstract operation 1834 // https://tc39.es/ecma262/#sec-isarray 1835 // eslint-disable-next-line es/no-array-isarray -- safe 1836 var isArray$5 = Array.isArray || function isArray(argument) { 1837 return classof$7(argument) == 'Array'; 1838 }; 1839 1840 var global$N = global$1e; 1841 var isArray$4 = isArray$5; 1842 var isConstructor$2 = isConstructor$4; 1843 var isObject$l = isObject$s; 1844 var wellKnownSymbol$l = wellKnownSymbol$s; 1845 1846 var SPECIES$4 = wellKnownSymbol$l('species'); 1847 var Array$7 = global$N.Array; 1848 1849 // a part of `ArraySpeciesCreate` abstract operation 1850 // https://tc39.es/ecma262/#sec-arrayspeciescreate 1851 var arraySpeciesConstructor$1 = function (originalArray) { 1852 var C; 1853 if (isArray$4(originalArray)) { 1854 C = originalArray.constructor; 1855 // cross-realm fallback 1856 if (isConstructor$2(C) && (C === Array$7 || isArray$4(C.prototype))) C = undefined; 1857 else if (isObject$l(C)) { 1858 C = C[SPECIES$4]; 1859 if (C === null) C = undefined; 1860 } 1861 } return C === undefined ? Array$7 : C; 1862 }; 1863 1864 var arraySpeciesConstructor = arraySpeciesConstructor$1; 1865 1866 // `ArraySpeciesCreate` abstract operation 1867 // https://tc39.es/ecma262/#sec-arrayspeciescreate 1868 var arraySpeciesCreate$3 = function (originalArray, length) { 1869 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); 1870 }; 1871 1872 var bind$9 = functionBindContext; 1873 var uncurryThis$y = functionUncurryThis; 1874 var IndexedObject$3 = indexedObject; 1875 var toObject$e = toObject$g; 1876 var lengthOfArrayLike$e = lengthOfArrayLike$h; 1877 var arraySpeciesCreate$2 = arraySpeciesCreate$3; 1878 1879 var push$6 = uncurryThis$y([].push); 1880 1881 // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation 1882 var createMethod$2 = function (TYPE) { 1883 var IS_MAP = TYPE == 1; 1884 var IS_FILTER = TYPE == 2; 1885 var IS_SOME = TYPE == 3; 1886 var IS_EVERY = TYPE == 4; 1887 var IS_FIND_INDEX = TYPE == 6; 1888 var IS_FILTER_REJECT = TYPE == 7; 1889 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; 1890 return function ($this, callbackfn, that, specificCreate) { 1891 var O = toObject$e($this); 1892 var self = IndexedObject$3(O); 1893 var boundFunction = bind$9(callbackfn, that); 1894 var length = lengthOfArrayLike$e(self); 1895 var index = 0; 1896 var create = specificCreate || arraySpeciesCreate$2; 1897 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; 1898 var value, result; 1899 for (;length > index; index++) if (NO_HOLES || index in self) { 1900 value = self[index]; 1901 result = boundFunction(value, index, O); 1902 if (TYPE) { 1903 if (IS_MAP) target[index] = result; // map 1904 else if (result) switch (TYPE) { 1905 case 3: return true; // some 1906 case 5: return value; // find 1907 case 6: return index; // findIndex 1908 case 2: push$6(target, value); // filter 1909 } else switch (TYPE) { 1910 case 4: return false; // every 1911 case 7: push$6(target, value); // filterReject 1912 } 1913 } 1914 } 1915 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; 1916 }; 1917 }; 1918 1919 var arrayIteration = { 1920 // `Array.prototype.forEach` method 1921 // https://tc39.es/ecma262/#sec-array.prototype.foreach 1922 forEach: createMethod$2(0), 1923 // `Array.prototype.map` method 1924 // https://tc39.es/ecma262/#sec-array.prototype.map 1925 map: createMethod$2(1), 1926 // `Array.prototype.filter` method 1927 // https://tc39.es/ecma262/#sec-array.prototype.filter 1928 filter: createMethod$2(2), 1929 // `Array.prototype.some` method 1930 // https://tc39.es/ecma262/#sec-array.prototype.some 1931 some: createMethod$2(3), 1932 // `Array.prototype.every` method 1933 // https://tc39.es/ecma262/#sec-array.prototype.every 1934 every: createMethod$2(4), 1935 // `Array.prototype.find` method 1936 // https://tc39.es/ecma262/#sec-array.prototype.find 1937 find: createMethod$2(5), 1938 // `Array.prototype.findIndex` method 1939 // https://tc39.es/ecma262/#sec-array.prototype.findIndex 1940 findIndex: createMethod$2(6), 1941 // `Array.prototype.filterReject` method 1942 // https://github.com/tc39/proposal-array-filtering 1943 filterReject: createMethod$2(7) 1944 }; 1945 1946 var fails$w = fails$I; 1947 1948 var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) { 1949 var method = [][METHOD_NAME]; 1950 return !!method && fails$w(function () { 1951 // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing 1952 method.call(null, argument || function () { throw 1; }, 1); 1953 }); 1954 }; 1955 1956 var $forEach$2 = arrayIteration.forEach; 1957 var arrayMethodIsStrict$3 = arrayMethodIsStrict$4; 1958 1959 var STRICT_METHOD$3 = arrayMethodIsStrict$3('forEach'); 1960 1961 // `Array.prototype.forEach` method implementation 1962 // https://tc39.es/ecma262/#sec-array.prototype.foreach 1963 var arrayForEach = !STRICT_METHOD$3 ? function forEach(callbackfn /* , thisArg */) { 1964 return $forEach$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 1965 // eslint-disable-next-line es/no-array-prototype-foreach -- safe 1966 } : [].forEach; 1967 1968 var global$M = global$1e; 1969 var DOMIterables$1 = domIterables; 1970 var DOMTokenListPrototype$1 = domTokenListPrototype; 1971 var forEach$1 = arrayForEach; 1972 var createNonEnumerableProperty$5 = createNonEnumerableProperty$a; 1973 1974 var handlePrototype$1 = function (CollectionPrototype) { 1975 // some Chrome versions have non-configurable methods on DOMTokenList 1976 if (CollectionPrototype && CollectionPrototype.forEach !== forEach$1) try { 1977 createNonEnumerableProperty$5(CollectionPrototype, 'forEach', forEach$1); 1978 } catch (error) { 1979 CollectionPrototype.forEach = forEach$1; 1980 } 1981 }; 1982 1983 for (var COLLECTION_NAME$1 in DOMIterables$1) { 1984 if (DOMIterables$1[COLLECTION_NAME$1]) { 1985 handlePrototype$1(global$M[COLLECTION_NAME$1] && global$M[COLLECTION_NAME$1].prototype); 1986 } 1987 } 1988 1989 handlePrototype$1(DOMTokenListPrototype$1); 1990 1991 // a string of all valid unicode whitespaces 1992 var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + 1993 '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; 1994 1995 var uncurryThis$x = functionUncurryThis; 1996 var requireObjectCoercible$8 = requireObjectCoercible$d; 1997 var toString$b = toString$g; 1998 var whitespaces$1 = whitespaces$2; 1999 2000 var replace$7 = uncurryThis$x(''.replace); 2001 var whitespace = '[' + whitespaces$1 + ']'; 2002 var ltrim = RegExp('^' + whitespace + whitespace + '*'); 2003 var rtrim = RegExp(whitespace + whitespace + '*$'); 2004 2005 // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation 2006 var createMethod$1 = function (TYPE) { 2007 return function ($this) { 2008 var string = toString$b(requireObjectCoercible$8($this)); 2009 if (TYPE & 1) string = replace$7(string, ltrim, ''); 2010 if (TYPE & 2) string = replace$7(string, rtrim, ''); 2011 return string; 2012 }; 2013 }; 2014 2015 var stringTrim = { 2016 // `String.prototype.{ trimLeft, trimStart }` methods 2017 // https://tc39.es/ecma262/#sec-string.prototype.trimstart 2018 start: createMethod$1(1), 2019 // `String.prototype.{ trimRight, trimEnd }` methods 2020 // https://tc39.es/ecma262/#sec-string.prototype.trimend 2021 end: createMethod$1(2), 2022 // `String.prototype.trim` method 2023 // https://tc39.es/ecma262/#sec-string.prototype.trim 2024 trim: createMethod$1(3) 2025 }; 2026 2027 var PROPER_FUNCTION_NAME$3 = functionName.PROPER; 2028 var fails$v = fails$I; 2029 var whitespaces = whitespaces$2; 2030 2031 var non = '\u200B\u0085\u180E'; 2032 2033 // check that a method works with the correct list 2034 // of whitespaces and has a correct name 2035 var stringTrimForced = function (METHOD_NAME) { 2036 return fails$v(function () { 2037 return !!whitespaces[METHOD_NAME]() 2038 || non[METHOD_NAME]() !== non 2039 || (PROPER_FUNCTION_NAME$3 && whitespaces[METHOD_NAME].name !== METHOD_NAME); 2040 }); 2041 }; 2042 2043 var $$F = _export; 2044 var $trim = stringTrim.trim; 2045 var forcedStringTrimMethod = stringTrimForced; 2046 2047 // `String.prototype.trim` method 2048 // https://tc39.es/ecma262/#sec-string.prototype.trim 2049 $$F({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { 2050 trim: function trim() { 2051 return $trim(this); 2052 } 2053 }); 2054 2055 var uncurryThis$w = functionUncurryThis; 2056 var PROPER_FUNCTION_NAME$2 = functionName.PROPER; 2057 var redefine$a = redefine$e.exports; 2058 var anObject$g = anObject$p; 2059 var isPrototypeOf$7 = objectIsPrototypeOf; 2060 var $toString$3 = toString$g; 2061 var fails$u = fails$I; 2062 var regExpFlags = regexpFlags$1; 2063 2064 var TO_STRING = 'toString'; 2065 var RegExpPrototype = RegExp.prototype; 2066 var n$ToString = RegExpPrototype[TO_STRING]; 2067 var getFlags = uncurryThis$w(regExpFlags); 2068 2069 var NOT_GENERIC = fails$u(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); 2070 // FF44- RegExp#toString has a wrong name 2071 var INCORRECT_NAME = PROPER_FUNCTION_NAME$2 && n$ToString.name != TO_STRING; 2072 2073 // `RegExp.prototype.toString` method 2074 // https://tc39.es/ecma262/#sec-regexp.prototype.tostring 2075 if (NOT_GENERIC || INCORRECT_NAME) { 2076 redefine$a(RegExp.prototype, TO_STRING, function toString() { 2077 var R = anObject$g(this); 2078 var p = $toString$3(R.source); 2079 var rf = R.flags; 2080 var f = $toString$3(rf === undefined && isPrototypeOf$7(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf); 2081 return '/' + p + '/' + f; 2082 }, { unsafe: true }); 2083 } 2084 2085 var $$E = _export; 2086 var global$L = global$1e; 2087 var getBuiltIn$4 = getBuiltIn$a; 2088 var apply$6 = functionApply; 2089 var uncurryThis$v = functionUncurryThis; 2090 var fails$t = fails$I; 2091 2092 var Array$6 = global$L.Array; 2093 var $stringify$1 = getBuiltIn$4('JSON', 'stringify'); 2094 var exec$2 = uncurryThis$v(/./.exec); 2095 var charAt$4 = uncurryThis$v(''.charAt); 2096 var charCodeAt$2 = uncurryThis$v(''.charCodeAt); 2097 var replace$6 = uncurryThis$v(''.replace); 2098 var numberToString$1 = uncurryThis$v(1.0.toString); 2099 2100 var tester = /[\uD800-\uDFFF]/g; 2101 var low = /^[\uD800-\uDBFF]$/; 2102 var hi = /^[\uDC00-\uDFFF]$/; 2103 2104 var fix = function (match, offset, string) { 2105 var prev = charAt$4(string, offset - 1); 2106 var next = charAt$4(string, offset + 1); 2107 if ((exec$2(low, match) && !exec$2(hi, next)) || (exec$2(hi, match) && !exec$2(low, prev))) { 2108 return '\\u' + numberToString$1(charCodeAt$2(match, 0), 16); 2109 } return match; 2110 }; 2111 2112 var FORCED$8 = fails$t(function () { 2113 return $stringify$1('\uDF06\uD834') !== '"\\udf06\\ud834"' 2114 || $stringify$1('\uDEAD') !== '"\\udead"'; 2115 }); 2116 2117 if ($stringify$1) { 2118 // `JSON.stringify` method 2119 // https://tc39.es/ecma262/#sec-json.stringify 2120 // https://github.com/tc39/proposal-well-formed-stringify 2121 $$E({ target: 'JSON', stat: true, forced: FORCED$8 }, { 2122 // eslint-disable-next-line no-unused-vars -- required for `.length` 2123 stringify: function stringify(it, replacer, space) { 2124 for (var i = 0, l = arguments.length, args = Array$6(l); i < l; i++) args[i] = arguments[i]; 2125 var result = apply$6($stringify$1, null, args); 2126 return typeof result == 'string' ? replace$6(result, tester, fix) : result; 2127 } 2128 }); 2129 } 2130 2131 var fails$s = fails$I; 2132 var wellKnownSymbol$k = wellKnownSymbol$s; 2133 var V8_VERSION$2 = engineV8Version; 2134 2135 var SPECIES$3 = wellKnownSymbol$k('species'); 2136 2137 var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) { 2138 // We can't use this feature detection in V8 since it causes 2139 // deoptimization and serious performance degradation 2140 // https://github.com/zloirock/core-js/issues/677 2141 return V8_VERSION$2 >= 51 || !fails$s(function () { 2142 var array = []; 2143 var constructor = array.constructor = {}; 2144 constructor[SPECIES$3] = function () { 2145 return { foo: 1 }; 2146 }; 2147 return array[METHOD_NAME](Boolean).foo !== 1; 2148 }); 2149 }; 2150 2151 var $$D = _export; 2152 var global$K = global$1e; 2153 var fails$r = fails$I; 2154 var isArray$3 = isArray$5; 2155 var isObject$k = isObject$s; 2156 var toObject$d = toObject$g; 2157 var lengthOfArrayLike$d = lengthOfArrayLike$h; 2158 var createProperty$3 = createProperty$5; 2159 var arraySpeciesCreate$1 = arraySpeciesCreate$3; 2160 var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5; 2161 var wellKnownSymbol$j = wellKnownSymbol$s; 2162 var V8_VERSION$1 = engineV8Version; 2163 2164 var IS_CONCAT_SPREADABLE = wellKnownSymbol$j('isConcatSpreadable'); 2165 var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF; 2166 var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; 2167 var TypeError$e = global$K.TypeError; 2168 2169 // We can't use this feature detection in V8 since it causes 2170 // deoptimization and serious performance degradation 2171 // https://github.com/zloirock/core-js/issues/679 2172 var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION$1 >= 51 || !fails$r(function () { 2173 var array = []; 2174 array[IS_CONCAT_SPREADABLE] = false; 2175 return array.concat()[0] !== array; 2176 }); 2177 2178 var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$4('concat'); 2179 2180 var isConcatSpreadable = function (O) { 2181 if (!isObject$k(O)) return false; 2182 var spreadable = O[IS_CONCAT_SPREADABLE]; 2183 return spreadable !== undefined ? !!spreadable : isArray$3(O); 2184 }; 2185 2186 var FORCED$7 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; 2187 2188 // `Array.prototype.concat` method 2189 // https://tc39.es/ecma262/#sec-array.prototype.concat 2190 // with adding support of @@isConcatSpreadable and @@species 2191 $$D({ target: 'Array', proto: true, forced: FORCED$7 }, { 2192 // eslint-disable-next-line no-unused-vars -- required for `.length` 2193 concat: function concat(arg) { 2194 var O = toObject$d(this); 2195 var A = arraySpeciesCreate$1(O, 0); 2196 var n = 0; 2197 var i, k, length, len, E; 2198 for (i = -1, length = arguments.length; i < length; i++) { 2199 E = i === -1 ? O : arguments[i]; 2200 if (isConcatSpreadable(E)) { 2201 len = lengthOfArrayLike$d(E); 2202 if (n + len > MAX_SAFE_INTEGER$1) throw TypeError$e(MAXIMUM_ALLOWED_INDEX_EXCEEDED); 2203 for (k = 0; k < len; k++, n++) if (k in E) createProperty$3(A, n, E[k]); 2204 } else { 2205 if (n >= MAX_SAFE_INTEGER$1) throw TypeError$e(MAXIMUM_ALLOWED_INDEX_EXCEEDED); 2206 createProperty$3(A, n++, E); 2207 } 2208 } 2209 A.length = n; 2210 return A; 2211 } 2212 }); 2213 2214 var wellKnownSymbol$i = wellKnownSymbol$s; 2215 var create$4 = objectCreate; 2216 var definePropertyModule$4 = objectDefineProperty; 2217 2218 var UNSCOPABLES = wellKnownSymbol$i('unscopables'); 2219 var ArrayPrototype$1 = Array.prototype; 2220 2221 // Array.prototype[@@unscopables] 2222 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables 2223 if (ArrayPrototype$1[UNSCOPABLES] == undefined) { 2224 definePropertyModule$4.f(ArrayPrototype$1, UNSCOPABLES, { 2225 configurable: true, 2226 value: create$4(null) 2227 }); 2228 } 2229 2230 // add a key to Array.prototype[@@unscopables] 2231 var addToUnscopables$4 = function (key) { 2232 ArrayPrototype$1[UNSCOPABLES][key] = true; 2233 }; 2234 2235 var iterators = {}; 2236 2237 var fails$q = fails$I; 2238 2239 var correctPrototypeGetter = !fails$q(function () { 2240 function F() { /* empty */ } 2241 F.prototype.constructor = null; 2242 // eslint-disable-next-line es/no-object-getprototypeof -- required for testing 2243 return Object.getPrototypeOf(new F()) !== F.prototype; 2244 }); 2245 2246 var global$J = global$1e; 2247 var hasOwn$e = hasOwnProperty_1; 2248 var isCallable$d = isCallable$q; 2249 var toObject$c = toObject$g; 2250 var sharedKey$1 = sharedKey$4; 2251 var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter; 2252 2253 var IE_PROTO = sharedKey$1('IE_PROTO'); 2254 var Object$1 = global$J.Object; 2255 var ObjectPrototype$3 = Object$1.prototype; 2256 2257 // `Object.getPrototypeOf` method 2258 // https://tc39.es/ecma262/#sec-object.getprototypeof 2259 var objectGetPrototypeOf$1 = CORRECT_PROTOTYPE_GETTER$1 ? Object$1.getPrototypeOf : function (O) { 2260 var object = toObject$c(O); 2261 if (hasOwn$e(object, IE_PROTO)) return object[IE_PROTO]; 2262 var constructor = object.constructor; 2263 if (isCallable$d(constructor) && object instanceof constructor) { 2264 return constructor.prototype; 2265 } return object instanceof Object$1 ? ObjectPrototype$3 : null; 2266 }; 2267 2268 var fails$p = fails$I; 2269 var isCallable$c = isCallable$q; 2270 var getPrototypeOf$5 = objectGetPrototypeOf$1; 2271 var redefine$9 = redefine$e.exports; 2272 var wellKnownSymbol$h = wellKnownSymbol$s; 2273 2274 var ITERATOR$8 = wellKnownSymbol$h('iterator'); 2275 var BUGGY_SAFARI_ITERATORS$1 = false; 2276 2277 // `%IteratorPrototype%` object 2278 // https://tc39.es/ecma262/#sec-%iteratorprototype%-object 2279 var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator; 2280 2281 /* eslint-disable es/no-array-prototype-keys -- safe */ 2282 if ([].keys) { 2283 arrayIterator = [].keys(); 2284 // Safari 8 has buggy iterators w/o `next` 2285 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true; 2286 else { 2287 PrototypeOfArrayIteratorPrototype = getPrototypeOf$5(getPrototypeOf$5(arrayIterator)); 2288 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype; 2289 } 2290 } 2291 2292 var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$p(function () { 2293 var test = {}; 2294 // FF44- legacy iterators case 2295 return IteratorPrototype$2[ITERATOR$8].call(test) !== test; 2296 }); 2297 2298 if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {}; 2299 2300 // `%IteratorPrototype%[@@iterator]()` method 2301 // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator 2302 if (!isCallable$c(IteratorPrototype$2[ITERATOR$8])) { 2303 redefine$9(IteratorPrototype$2, ITERATOR$8, function () { 2304 return this; 2305 }); 2306 } 2307 2308 var iteratorsCore = { 2309 IteratorPrototype: IteratorPrototype$2, 2310 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1 2311 }; 2312 2313 var defineProperty$a = objectDefineProperty.f; 2314 var hasOwn$d = hasOwnProperty_1; 2315 var wellKnownSymbol$g = wellKnownSymbol$s; 2316 2317 var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag'); 2318 2319 var setToStringTag$9 = function (target, TAG, STATIC) { 2320 if (target && !STATIC) target = target.prototype; 2321 if (target && !hasOwn$d(target, TO_STRING_TAG$2)) { 2322 defineProperty$a(target, TO_STRING_TAG$2, { configurable: true, value: TAG }); 2323 } 2324 }; 2325 2326 var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; 2327 var create$3 = objectCreate; 2328 var createPropertyDescriptor$4 = createPropertyDescriptor$8; 2329 var setToStringTag$8 = setToStringTag$9; 2330 var Iterators$4 = iterators; 2331 2332 var returnThis$1 = function () { return this; }; 2333 2334 var createIteratorConstructor$2 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { 2335 var TO_STRING_TAG = NAME + ' Iterator'; 2336 IteratorConstructor.prototype = create$3(IteratorPrototype$1, { next: createPropertyDescriptor$4(+!ENUMERABLE_NEXT, next) }); 2337 setToStringTag$8(IteratorConstructor, TO_STRING_TAG, false); 2338 Iterators$4[TO_STRING_TAG] = returnThis$1; 2339 return IteratorConstructor; 2340 }; 2341 2342 var global$I = global$1e; 2343 var isCallable$b = isCallable$q; 2344 2345 var String$3 = global$I.String; 2346 var TypeError$d = global$I.TypeError; 2347 2348 var aPossiblePrototype$1 = function (argument) { 2349 if (typeof argument == 'object' || isCallable$b(argument)) return argument; 2350 throw TypeError$d("Can't set " + String$3(argument) + ' as a prototype'); 2351 }; 2352 2353 /* eslint-disable no-proto -- safe */ 2354 2355 var uncurryThis$u = functionUncurryThis; 2356 var anObject$f = anObject$p; 2357 var aPossiblePrototype = aPossiblePrototype$1; 2358 2359 // `Object.setPrototypeOf` method 2360 // https://tc39.es/ecma262/#sec-object.setprototypeof 2361 // Works with __proto__ only. Old v8 can't work with null proto objects. 2362 // eslint-disable-next-line es/no-object-setprototypeof -- safe 2363 var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { 2364 var CORRECT_SETTER = false; 2365 var test = {}; 2366 var setter; 2367 try { 2368 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe 2369 setter = uncurryThis$u(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set); 2370 setter(test, []); 2371 CORRECT_SETTER = test instanceof Array; 2372 } catch (error) { /* empty */ } 2373 return function setPrototypeOf(O, proto) { 2374 anObject$f(O); 2375 aPossiblePrototype(proto); 2376 if (CORRECT_SETTER) setter(O, proto); 2377 else O.__proto__ = proto; 2378 return O; 2379 }; 2380 }() : undefined); 2381 2382 var $$C = _export; 2383 var call$h = functionCall; 2384 var FunctionName$1 = functionName; 2385 var isCallable$a = isCallable$q; 2386 var createIteratorConstructor$1 = createIteratorConstructor$2; 2387 var getPrototypeOf$4 = objectGetPrototypeOf$1; 2388 var setPrototypeOf$5 = objectSetPrototypeOf; 2389 var setToStringTag$7 = setToStringTag$9; 2390 var createNonEnumerableProperty$4 = createNonEnumerableProperty$a; 2391 var redefine$8 = redefine$e.exports; 2392 var wellKnownSymbol$f = wellKnownSymbol$s; 2393 var Iterators$3 = iterators; 2394 var IteratorsCore = iteratorsCore; 2395 2396 var PROPER_FUNCTION_NAME$1 = FunctionName$1.PROPER; 2397 var CONFIGURABLE_FUNCTION_NAME$1 = FunctionName$1.CONFIGURABLE; 2398 var IteratorPrototype = IteratorsCore.IteratorPrototype; 2399 var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; 2400 var ITERATOR$7 = wellKnownSymbol$f('iterator'); 2401 var KEYS = 'keys'; 2402 var VALUES = 'values'; 2403 var ENTRIES = 'entries'; 2404 2405 var returnThis = function () { return this; }; 2406 2407 var defineIterator$3 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { 2408 createIteratorConstructor$1(IteratorConstructor, NAME, next); 2409 2410 var getIterationMethod = function (KIND) { 2411 if (KIND === DEFAULT && defaultIterator) return defaultIterator; 2412 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; 2413 switch (KIND) { 2414 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; 2415 case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; 2416 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; 2417 } return function () { return new IteratorConstructor(this); }; 2418 }; 2419 2420 var TO_STRING_TAG = NAME + ' Iterator'; 2421 var INCORRECT_VALUES_NAME = false; 2422 var IterablePrototype = Iterable.prototype; 2423 var nativeIterator = IterablePrototype[ITERATOR$7] 2424 || IterablePrototype['@@iterator'] 2425 || DEFAULT && IterablePrototype[DEFAULT]; 2426 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); 2427 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; 2428 var CurrentIteratorPrototype, methods, KEY; 2429 2430 // fix native 2431 if (anyNativeIterator) { 2432 CurrentIteratorPrototype = getPrototypeOf$4(anyNativeIterator.call(new Iterable())); 2433 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { 2434 if (getPrototypeOf$4(CurrentIteratorPrototype) !== IteratorPrototype) { 2435 if (setPrototypeOf$5) { 2436 setPrototypeOf$5(CurrentIteratorPrototype, IteratorPrototype); 2437 } else if (!isCallable$a(CurrentIteratorPrototype[ITERATOR$7])) { 2438 redefine$8(CurrentIteratorPrototype, ITERATOR$7, returnThis); 2439 } 2440 } 2441 // Set @@toStringTag to native iterators 2442 setToStringTag$7(CurrentIteratorPrototype, TO_STRING_TAG, true); 2443 } 2444 } 2445 2446 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF 2447 if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { 2448 if (CONFIGURABLE_FUNCTION_NAME$1) { 2449 createNonEnumerableProperty$4(IterablePrototype, 'name', VALUES); 2450 } else { 2451 INCORRECT_VALUES_NAME = true; 2452 defaultIterator = function values() { return call$h(nativeIterator, this); }; 2453 } 2454 } 2455 2456 // export additional methods 2457 if (DEFAULT) { 2458 methods = { 2459 values: getIterationMethod(VALUES), 2460 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), 2461 entries: getIterationMethod(ENTRIES) 2462 }; 2463 if (FORCED) for (KEY in methods) { 2464 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { 2465 redefine$8(IterablePrototype, KEY, methods[KEY]); 2466 } 2467 } else $$C({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); 2468 } 2469 2470 // define iterator 2471 if (IterablePrototype[ITERATOR$7] !== defaultIterator) { 2472 redefine$8(IterablePrototype, ITERATOR$7, defaultIterator, { name: DEFAULT }); 2473 } 2474 Iterators$3[NAME] = defaultIterator; 2475 2476 return methods; 2477 }; 2478 2479 var toIndexedObject$5 = toIndexedObject$a; 2480 var addToUnscopables$3 = addToUnscopables$4; 2481 var Iterators$2 = iterators; 2482 var InternalStateModule$9 = internalState; 2483 var defineProperty$9 = objectDefineProperty.f; 2484 var defineIterator$2 = defineIterator$3; 2485 var DESCRIPTORS$b = descriptors; 2486 2487 var ARRAY_ITERATOR = 'Array Iterator'; 2488 var setInternalState$9 = InternalStateModule$9.set; 2489 var getInternalState$5 = InternalStateModule$9.getterFor(ARRAY_ITERATOR); 2490 2491 // `Array.prototype.entries` method 2492 // https://tc39.es/ecma262/#sec-array.prototype.entries 2493 // `Array.prototype.keys` method 2494 // https://tc39.es/ecma262/#sec-array.prototype.keys 2495 // `Array.prototype.values` method 2496 // https://tc39.es/ecma262/#sec-array.prototype.values 2497 // `Array.prototype[@@iterator]` method 2498 // https://tc39.es/ecma262/#sec-array.prototype-@@iterator 2499 // `CreateArrayIterator` internal method 2500 // https://tc39.es/ecma262/#sec-createarrayiterator 2501 var es_array_iterator = defineIterator$2(Array, 'Array', function (iterated, kind) { 2502 setInternalState$9(this, { 2503 type: ARRAY_ITERATOR, 2504 target: toIndexedObject$5(iterated), // target 2505 index: 0, // next index 2506 kind: kind // kind 2507 }); 2508 // `%ArrayIteratorPrototype%.next` method 2509 // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next 2510 }, function () { 2511 var state = getInternalState$5(this); 2512 var target = state.target; 2513 var kind = state.kind; 2514 var index = state.index++; 2515 if (!target || index >= target.length) { 2516 state.target = undefined; 2517 return { value: undefined, done: true }; 2518 } 2519 if (kind == 'keys') return { value: index, done: false }; 2520 if (kind == 'values') return { value: target[index], done: false }; 2521 return { value: [index, target[index]], done: false }; 2522 }, 'values'); 2523 2524 // argumentsList[@@iterator] is %ArrayProto_values% 2525 // https://tc39.es/ecma262/#sec-createunmappedargumentsobject 2526 // https://tc39.es/ecma262/#sec-createmappedargumentsobject 2527 var values = Iterators$2.Arguments = Iterators$2.Array; 2528 2529 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables 2530 addToUnscopables$3('keys'); 2531 addToUnscopables$3('values'); 2532 addToUnscopables$3('entries'); 2533 2534 // V8 ~ Chrome 45- bug 2535 if (DESCRIPTORS$b && values.name !== 'values') try { 2536 defineProperty$9(values, 'name', { value: 'values' }); 2537 } catch (error) { /* empty */ } 2538 2539 var global$H = global$1e; 2540 var DOMIterables = domIterables; 2541 var DOMTokenListPrototype = domTokenListPrototype; 2542 var ArrayIteratorMethods = es_array_iterator; 2543 var createNonEnumerableProperty$3 = createNonEnumerableProperty$a; 2544 var wellKnownSymbol$e = wellKnownSymbol$s; 2545 2546 var ITERATOR$6 = wellKnownSymbol$e('iterator'); 2547 var TO_STRING_TAG$1 = wellKnownSymbol$e('toStringTag'); 2548 var ArrayValues = ArrayIteratorMethods.values; 2549 2550 var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { 2551 if (CollectionPrototype) { 2552 // some Chrome versions have non-configurable methods on DOMTokenList 2553 if (CollectionPrototype[ITERATOR$6] !== ArrayValues) try { 2554 createNonEnumerableProperty$3(CollectionPrototype, ITERATOR$6, ArrayValues); 2555 } catch (error) { 2556 CollectionPrototype[ITERATOR$6] = ArrayValues; 2557 } 2558 if (!CollectionPrototype[TO_STRING_TAG$1]) { 2559 createNonEnumerableProperty$3(CollectionPrototype, TO_STRING_TAG$1, COLLECTION_NAME); 2560 } 2561 if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { 2562 // some Chrome versions have non-configurable methods on DOMTokenList 2563 if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { 2564 createNonEnumerableProperty$3(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); 2565 } catch (error) { 2566 CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; 2567 } 2568 } 2569 } 2570 }; 2571 2572 for (var COLLECTION_NAME in DOMIterables) { 2573 handlePrototype(global$H[COLLECTION_NAME] && global$H[COLLECTION_NAME].prototype, COLLECTION_NAME); 2574 } 2575 2576 handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); 2577 2578 // TODO: Remove from `core-js@4` since it's moved to entry points 2579 2580 var $$B = _export; 2581 var global$G = global$1e; 2582 var call$g = functionCall; 2583 var uncurryThis$t = functionUncurryThis; 2584 var isCallable$9 = isCallable$q; 2585 var isObject$j = isObject$s; 2586 2587 var DELEGATES_TO_EXEC = function () { 2588 var execCalled = false; 2589 var re = /[ac]/; 2590 re.exec = function () { 2591 execCalled = true; 2592 return /./.exec.apply(this, arguments); 2593 }; 2594 return re.test('abc') === true && execCalled; 2595 }(); 2596 2597 var Error$1 = global$G.Error; 2598 var un$Test = uncurryThis$t(/./.test); 2599 2600 // `RegExp.prototype.test` method 2601 // https://tc39.es/ecma262/#sec-regexp.prototype.test 2602 $$B({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { 2603 test: function (str) { 2604 var exec = this.exec; 2605 if (!isCallable$9(exec)) return un$Test(this, str); 2606 var result = call$g(exec, this, str); 2607 if (result !== null && !isObject$j(result)) { 2608 throw new Error$1('RegExp exec method returned something other than an Object or null'); 2609 } 2610 return !!result; 2611 } 2612 }); 2613 2614 var global$F = global$1e; 2615 var isRegExp = isRegexp; 2616 2617 var TypeError$c = global$F.TypeError; 2618 2619 var notARegexp = function (it) { 2620 if (isRegExp(it)) { 2621 throw TypeError$c("The method doesn't accept regular expressions"); 2622 } return it; 2623 }; 2624 2625 var wellKnownSymbol$d = wellKnownSymbol$s; 2626 2627 var MATCH = wellKnownSymbol$d('match'); 2628 2629 var correctIsRegexpLogic = function (METHOD_NAME) { 2630 var regexp = /./; 2631 try { 2632 '/./'[METHOD_NAME](regexp); 2633 } catch (error1) { 2634 try { 2635 regexp[MATCH] = false; 2636 return '/./'[METHOD_NAME](regexp); 2637 } catch (error2) { /* empty */ } 2638 } return false; 2639 }; 2640 2641 var $$A = _export; 2642 var uncurryThis$s = functionUncurryThis; 2643 var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f; 2644 var toLength$7 = toLength$a; 2645 var toString$a = toString$g; 2646 var notARegExp$2 = notARegexp; 2647 var requireObjectCoercible$7 = requireObjectCoercible$d; 2648 var correctIsRegExpLogic$2 = correctIsRegexpLogic; 2649 2650 // eslint-disable-next-line es/no-string-prototype-startswith -- safe 2651 var un$StartsWith = uncurryThis$s(''.startsWith); 2652 var stringSlice$6 = uncurryThis$s(''.slice); 2653 var min$5 = Math.min; 2654 2655 var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$2('startsWith'); 2656 // https://github.com/zloirock/core-js/pull/702 2657 var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () { 2658 var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'startsWith'); 2659 return descriptor && !descriptor.writable; 2660 }(); 2661 2662 // `String.prototype.startsWith` method 2663 // https://tc39.es/ecma262/#sec-string.prototype.startswith 2664 $$A({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, { 2665 startsWith: function startsWith(searchString /* , position = 0 */) { 2666 var that = toString$a(requireObjectCoercible$7(this)); 2667 notARegExp$2(searchString); 2668 var index = toLength$7(min$5(arguments.length > 1 ? arguments[1] : undefined, that.length)); 2669 var search = toString$a(searchString); 2670 return un$StartsWith 2671 ? un$StartsWith(that, search, index) 2672 : stringSlice$6(that, index, index + search.length) === search; 2673 } 2674 }); 2675 2676 var DESCRIPTORS$a = descriptors; 2677 var uncurryThis$r = functionUncurryThis; 2678 var call$f = functionCall; 2679 var fails$o = fails$I; 2680 var objectKeys$1 = objectKeys$3; 2681 var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols; 2682 var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable; 2683 var toObject$b = toObject$g; 2684 var IndexedObject$2 = indexedObject; 2685 2686 // eslint-disable-next-line es/no-object-assign -- safe 2687 var $assign = Object.assign; 2688 // eslint-disable-next-line es/no-object-defineproperty -- required for testing 2689 var defineProperty$8 = Object.defineProperty; 2690 var concat$1 = uncurryThis$r([].concat); 2691 2692 // `Object.assign` method 2693 // https://tc39.es/ecma262/#sec-object.assign 2694 var objectAssign = !$assign || fails$o(function () { 2695 // should have correct order of operations (Edge bug) 2696 if (DESCRIPTORS$a && $assign({ b: 1 }, $assign(defineProperty$8({}, 'a', { 2697 enumerable: true, 2698 get: function () { 2699 defineProperty$8(this, 'b', { 2700 value: 3, 2701 enumerable: false 2702 }); 2703 } 2704 }), { b: 2 })).b !== 1) return true; 2705 // should work with symbols and should have deterministic property order (V8 bug) 2706 var A = {}; 2707 var B = {}; 2708 // eslint-disable-next-line es/no-symbol -- safe 2709 var symbol = Symbol(); 2710 var alphabet = 'abcdefghijklmnopqrst'; 2711 A[symbol] = 7; 2712 alphabet.split('').forEach(function (chr) { B[chr] = chr; }); 2713 return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet; 2714 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` 2715 var T = toObject$b(target); 2716 var argumentsLength = arguments.length; 2717 var index = 1; 2718 var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f; 2719 var propertyIsEnumerable = propertyIsEnumerableModule$1.f; 2720 while (argumentsLength > index) { 2721 var S = IndexedObject$2(arguments[index++]); 2722 var keys = getOwnPropertySymbols ? concat$1(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S); 2723 var length = keys.length; 2724 var j = 0; 2725 var key; 2726 while (length > j) { 2727 key = keys[j++]; 2728 if (!DESCRIPTORS$a || call$f(propertyIsEnumerable, S, key)) T[key] = S[key]; 2729 } 2730 } return T; 2731 } : $assign; 2732 2733 var $$z = _export; 2734 var assign$1 = objectAssign; 2735 2736 // `Object.assign` method 2737 // https://tc39.es/ecma262/#sec-object.assign 2738 // eslint-disable-next-line es/no-object-assign -- required for testing 2739 $$z({ target: 'Object', stat: true, forced: Object.assign !== assign$1 }, { 2740 assign: assign$1 2741 }); 2742 2743 var $$y = _export; 2744 var global$E = global$1e; 2745 var toAbsoluteIndex$4 = toAbsoluteIndex$7; 2746 var toIntegerOrInfinity$8 = toIntegerOrInfinity$c; 2747 var lengthOfArrayLike$c = lengthOfArrayLike$h; 2748 var toObject$a = toObject$g; 2749 var arraySpeciesCreate = arraySpeciesCreate$3; 2750 var createProperty$2 = createProperty$5; 2751 var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5; 2752 2753 var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('splice'); 2754 2755 var TypeError$b = global$E.TypeError; 2756 var max$2 = Math.max; 2757 var min$4 = Math.min; 2758 var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; 2759 var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; 2760 2761 // `Array.prototype.splice` method 2762 // https://tc39.es/ecma262/#sec-array.prototype.splice 2763 // with adding support of @@species 2764 $$y({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { 2765 splice: function splice(start, deleteCount /* , ...items */) { 2766 var O = toObject$a(this); 2767 var len = lengthOfArrayLike$c(O); 2768 var actualStart = toAbsoluteIndex$4(start, len); 2769 var argumentsLength = arguments.length; 2770 var insertCount, actualDeleteCount, A, k, from, to; 2771 if (argumentsLength === 0) { 2772 insertCount = actualDeleteCount = 0; 2773 } else if (argumentsLength === 1) { 2774 insertCount = 0; 2775 actualDeleteCount = len - actualStart; 2776 } else { 2777 insertCount = argumentsLength - 2; 2778 actualDeleteCount = min$4(max$2(toIntegerOrInfinity$8(deleteCount), 0), len - actualStart); 2779 } 2780 if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { 2781 throw TypeError$b(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); 2782 } 2783 A = arraySpeciesCreate(O, actualDeleteCount); 2784 for (k = 0; k < actualDeleteCount; k++) { 2785 from = actualStart + k; 2786 if (from in O) createProperty$2(A, k, O[from]); 2787 } 2788 A.length = actualDeleteCount; 2789 if (insertCount < actualDeleteCount) { 2790 for (k = actualStart; k < len - actualDeleteCount; k++) { 2791 from = k + actualDeleteCount; 2792 to = k + insertCount; 2793 if (from in O) O[to] = O[from]; 2794 else delete O[to]; 2795 } 2796 for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; 2797 } else if (insertCount > actualDeleteCount) { 2798 for (k = len - actualDeleteCount; k > actualStart; k--) { 2799 from = k + actualDeleteCount - 1; 2800 to = k + insertCount - 1; 2801 if (from in O) O[to] = O[from]; 2802 else delete O[to]; 2803 } 2804 } 2805 for (k = 0; k < insertCount; k++) { 2806 O[k + actualStart] = arguments[k + 2]; 2807 } 2808 O.length = len - actualDeleteCount + insertCount; 2809 return A; 2810 } 2811 }); 2812 2813 var uncurryThis$q = functionUncurryThis; 2814 2815 var arraySlice$9 = uncurryThis$q([].slice); 2816 2817 var $$x = _export; 2818 var global$D = global$1e; 2819 var isArray$2 = isArray$5; 2820 var isConstructor$1 = isConstructor$4; 2821 var isObject$i = isObject$s; 2822 var toAbsoluteIndex$3 = toAbsoluteIndex$7; 2823 var lengthOfArrayLike$b = lengthOfArrayLike$h; 2824 var toIndexedObject$4 = toIndexedObject$a; 2825 var createProperty$1 = createProperty$5; 2826 var wellKnownSymbol$c = wellKnownSymbol$s; 2827 var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5; 2828 var un$Slice = arraySlice$9; 2829 2830 var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('slice'); 2831 2832 var SPECIES$2 = wellKnownSymbol$c('species'); 2833 var Array$5 = global$D.Array; 2834 var max$1 = Math.max; 2835 2836 // `Array.prototype.slice` method 2837 // https://tc39.es/ecma262/#sec-array.prototype.slice 2838 // fallback for not array-like ES3 strings and DOM objects 2839 $$x({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { 2840 slice: function slice(start, end) { 2841 var O = toIndexedObject$4(this); 2842 var length = lengthOfArrayLike$b(O); 2843 var k = toAbsoluteIndex$3(start, length); 2844 var fin = toAbsoluteIndex$3(end === undefined ? length : end, length); 2845 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible 2846 var Constructor, result, n; 2847 if (isArray$2(O)) { 2848 Constructor = O.constructor; 2849 // cross-realm fallback 2850 if (isConstructor$1(Constructor) && (Constructor === Array$5 || isArray$2(Constructor.prototype))) { 2851 Constructor = undefined; 2852 } else if (isObject$i(Constructor)) { 2853 Constructor = Constructor[SPECIES$2]; 2854 if (Constructor === null) Constructor = undefined; 2855 } 2856 if (Constructor === Array$5 || Constructor === undefined) { 2857 return un$Slice(O, k, fin); 2858 } 2859 } 2860 result = new (Constructor === undefined ? Array$5 : Constructor)(max$1(fin - k, 0)); 2861 for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]); 2862 result.length = n; 2863 return result; 2864 } 2865 }); 2866 2867 var uncurryThis$p = functionUncurryThis; 2868 var toObject$9 = toObject$g; 2869 2870 var floor$7 = Math.floor; 2871 var charAt$3 = uncurryThis$p(''.charAt); 2872 var replace$5 = uncurryThis$p(''.replace); 2873 var stringSlice$5 = uncurryThis$p(''.slice); 2874 var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; 2875 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; 2876 2877 // `GetSubstitution` abstract operation 2878 // https://tc39.es/ecma262/#sec-getsubstitution 2879 var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) { 2880 var tailPos = position + matched.length; 2881 var m = captures.length; 2882 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; 2883 if (namedCaptures !== undefined) { 2884 namedCaptures = toObject$9(namedCaptures); 2885 symbols = SUBSTITUTION_SYMBOLS; 2886 } 2887 return replace$5(replacement, symbols, function (match, ch) { 2888 var capture; 2889 switch (charAt$3(ch, 0)) { 2890 case '$': return '$'; 2891 case '&': return matched; 2892 case '`': return stringSlice$5(str, 0, position); 2893 case "'": return stringSlice$5(str, tailPos); 2894 case '<': 2895 capture = namedCaptures[stringSlice$5(ch, 1, -1)]; 2896 break; 2897 default: // \d\d? 2898 var n = +ch; 2899 if (n === 0) return match; 2900 if (n > m) { 2901 var f = floor$7(n / 10); 2902 if (f === 0) return match; 2903 if (f <= m) return captures[f - 1] === undefined ? charAt$3(ch, 1) : captures[f - 1] + charAt$3(ch, 1); 2904 return match; 2905 } 2906 capture = captures[n - 1]; 2907 } 2908 return capture === undefined ? '' : capture; 2909 }); 2910 }; 2911 2912 var apply$5 = functionApply; 2913 var call$e = functionCall; 2914 var uncurryThis$o = functionUncurryThis; 2915 var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic; 2916 var fails$n = fails$I; 2917 var anObject$e = anObject$p; 2918 var isCallable$8 = isCallable$q; 2919 var toIntegerOrInfinity$7 = toIntegerOrInfinity$c; 2920 var toLength$6 = toLength$a; 2921 var toString$9 = toString$g; 2922 var requireObjectCoercible$6 = requireObjectCoercible$d; 2923 var advanceStringIndex$1 = advanceStringIndex$3; 2924 var getMethod$4 = getMethod$7; 2925 var getSubstitution = getSubstitution$1; 2926 var regExpExec$3 = regexpExecAbstract; 2927 var wellKnownSymbol$b = wellKnownSymbol$s; 2928 2929 var REPLACE = wellKnownSymbol$b('replace'); 2930 var max = Math.max; 2931 var min$3 = Math.min; 2932 var concat = uncurryThis$o([].concat); 2933 var push$5 = uncurryThis$o([].push); 2934 var stringIndexOf$1 = uncurryThis$o(''.indexOf); 2935 var stringSlice$4 = uncurryThis$o(''.slice); 2936 2937 var maybeToString = function (it) { 2938 return it === undefined ? it : String(it); 2939 }; 2940 2941 // IE <= 11 replaces $0 with the whole match, as if it was $& 2942 // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 2943 var REPLACE_KEEPS_$0 = (function () { 2944 // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing 2945 return 'a'.replace(/./, '$0') === '$0'; 2946 })(); 2947 2948 // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string 2949 var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { 2950 if (/./[REPLACE]) { 2951 return /./[REPLACE]('a', '$0') === ''; 2952 } 2953 return false; 2954 })(); 2955 2956 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$n(function () { 2957 var re = /./; 2958 re.exec = function () { 2959 var result = []; 2960 result.groups = { a: '7' }; 2961 return result; 2962 }; 2963 // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive 2964 return ''.replace(re, '$<a>') !== '7'; 2965 }); 2966 2967 // @@replace logic 2968 fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCallNative) { 2969 var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; 2970 2971 return [ 2972 // `String.prototype.replace` method 2973 // https://tc39.es/ecma262/#sec-string.prototype.replace 2974 function replace(searchValue, replaceValue) { 2975 var O = requireObjectCoercible$6(this); 2976 var replacer = searchValue == undefined ? undefined : getMethod$4(searchValue, REPLACE); 2977 return replacer 2978 ? call$e(replacer, searchValue, O, replaceValue) 2979 : call$e(nativeReplace, toString$9(O), searchValue, replaceValue); 2980 }, 2981 // `RegExp.prototype[@@replace]` method 2982 // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace 2983 function (string, replaceValue) { 2984 var rx = anObject$e(this); 2985 var S = toString$9(string); 2986 2987 if ( 2988 typeof replaceValue == 'string' && 2989 stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 && 2990 stringIndexOf$1(replaceValue, '$<') === -1 2991 ) { 2992 var res = maybeCallNative(nativeReplace, rx, S, replaceValue); 2993 if (res.done) return res.value; 2994 } 2995 2996 var functionalReplace = isCallable$8(replaceValue); 2997 if (!functionalReplace) replaceValue = toString$9(replaceValue); 2998 2999 var global = rx.global; 3000 if (global) { 3001 var fullUnicode = rx.unicode; 3002 rx.lastIndex = 0; 3003 } 3004 var results = []; 3005 while (true) { 3006 var result = regExpExec$3(rx, S); 3007 if (result === null) break; 3008 3009 push$5(results, result); 3010 if (!global) break; 3011 3012 var matchStr = toString$9(result[0]); 3013 if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$6(rx.lastIndex), fullUnicode); 3014 } 3015 3016 var accumulatedResult = ''; 3017 var nextSourcePosition = 0; 3018 for (var i = 0; i < results.length; i++) { 3019 result = results[i]; 3020 3021 var matched = toString$9(result[0]); 3022 var position = max(min$3(toIntegerOrInfinity$7(result.index), S.length), 0); 3023 var captures = []; 3024 // NOTE: This is equivalent to 3025 // captures = result.slice(1).map(maybeToString) 3026 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in 3027 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and 3028 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. 3029 for (var j = 1; j < result.length; j++) push$5(captures, maybeToString(result[j])); 3030 var namedCaptures = result.groups; 3031 if (functionalReplace) { 3032 var replacerArgs = concat([matched], captures, position, S); 3033 if (namedCaptures !== undefined) push$5(replacerArgs, namedCaptures); 3034 var replacement = toString$9(apply$5(replaceValue, undefined, replacerArgs)); 3035 } else { 3036 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); 3037 } 3038 if (position >= nextSourcePosition) { 3039 accumulatedResult += stringSlice$4(S, nextSourcePosition, position) + replacement; 3040 nextSourcePosition = position + matched.length; 3041 } 3042 } 3043 return accumulatedResult + stringSlice$4(S, nextSourcePosition); 3044 } 3045 ]; 3046 }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); 3047 3048 // `SameValue` abstract operation 3049 // https://tc39.es/ecma262/#sec-samevalue 3050 // eslint-disable-next-line es/no-object-is -- safe 3051 var sameValue$1 = Object.is || function is(x, y) { 3052 // eslint-disable-next-line no-self-compare -- NaN check 3053 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; 3054 }; 3055 3056 var $$w = _export; 3057 var is = sameValue$1; 3058 3059 // `Object.is` method 3060 // https://tc39.es/ecma262/#sec-object.is 3061 $$w({ target: 'Object', stat: true }, { 3062 is: is 3063 }); 3064 3065 var $$v = _export; 3066 var global$C = global$1e; 3067 3068 // `globalThis` object 3069 // https://tc39.es/ecma262/#sec-globalthis 3070 $$v({ global: true }, { 3071 globalThis: global$C 3072 }); 3073 3074 var internalMetadata = {exports: {}}; 3075 3076 var objectGetOwnPropertyNamesExternal = {}; 3077 3078 /* eslint-disable es/no-object-getownpropertynames -- safe */ 3079 3080 var classof$6 = classofRaw$1; 3081 var toIndexedObject$3 = toIndexedObject$a; 3082 var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; 3083 var arraySlice$8 = arraySliceSimple; 3084 3085 var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames 3086 ? Object.getOwnPropertyNames(window) : []; 3087 3088 var getWindowNames = function (it) { 3089 try { 3090 return $getOwnPropertyNames$1(it); 3091 } catch (error) { 3092 return arraySlice$8(windowNames); 3093 } 3094 }; 3095 3096 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window 3097 objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) { 3098 return windowNames && classof$6(it) == 'Window' 3099 ? getWindowNames(it) 3100 : $getOwnPropertyNames$1(toIndexedObject$3(it)); 3101 }; 3102 3103 // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it 3104 var fails$m = fails$I; 3105 3106 var arrayBufferNonExtensible = fails$m(function () { 3107 if (typeof ArrayBuffer == 'function') { 3108 var buffer = new ArrayBuffer(8); 3109 // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe 3110 if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 }); 3111 } 3112 }); 3113 3114 var fails$l = fails$I; 3115 var isObject$h = isObject$s; 3116 var classof$5 = classofRaw$1; 3117 var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible; 3118 3119 // eslint-disable-next-line es/no-object-isextensible -- safe 3120 var $isExtensible$1 = Object.isExtensible; 3121 var FAILS_ON_PRIMITIVES$3 = fails$l(function () { $isExtensible$1(1); }); 3122 3123 // `Object.isExtensible` method 3124 // https://tc39.es/ecma262/#sec-object.isextensible 3125 var objectIsExtensible = (FAILS_ON_PRIMITIVES$3 || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) { 3126 if (!isObject$h(it)) return false; 3127 if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$5(it) == 'ArrayBuffer') return false; 3128 return $isExtensible$1 ? $isExtensible$1(it) : true; 3129 } : $isExtensible$1; 3130 3131 var fails$k = fails$I; 3132 3133 var freezing = !fails$k(function () { 3134 // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing 3135 return Object.isExtensible(Object.preventExtensions({})); 3136 }); 3137 3138 var $$u = _export; 3139 var uncurryThis$n = functionUncurryThis; 3140 var hiddenKeys$1 = hiddenKeys$6; 3141 var isObject$g = isObject$s; 3142 var hasOwn$c = hasOwnProperty_1; 3143 var defineProperty$7 = objectDefineProperty.f; 3144 var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames; 3145 var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal; 3146 var isExtensible$1 = objectIsExtensible; 3147 var uid$4 = uid$7; 3148 var FREEZING$1 = freezing; 3149 3150 var REQUIRED = false; 3151 var METADATA = uid$4('meta'); 3152 var id$1 = 0; 3153 3154 var setMetadata = function (it) { 3155 defineProperty$7(it, METADATA, { value: { 3156 objectID: 'O' + id$1++, // object ID 3157 weakData: {} // weak collections IDs 3158 } }); 3159 }; 3160 3161 var fastKey$1 = function (it, create) { 3162 // return a primitive with prefix 3163 if (!isObject$g(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; 3164 if (!hasOwn$c(it, METADATA)) { 3165 // can't set metadata to uncaught frozen object 3166 if (!isExtensible$1(it)) return 'F'; 3167 // not necessary to add metadata 3168 if (!create) return 'E'; 3169 // add missing metadata 3170 setMetadata(it); 3171 // return object ID 3172 } return it[METADATA].objectID; 3173 }; 3174 3175 var getWeakData$1 = function (it, create) { 3176 if (!hasOwn$c(it, METADATA)) { 3177 // can't set metadata to uncaught frozen object 3178 if (!isExtensible$1(it)) return true; 3179 // not necessary to add metadata 3180 if (!create) return false; 3181 // add missing metadata 3182 setMetadata(it); 3183 // return the store of weak collections IDs 3184 } return it[METADATA].weakData; 3185 }; 3186 3187 // add metadata on freeze-family methods calling 3188 var onFreeze$1 = function (it) { 3189 if (FREEZING$1 && REQUIRED && isExtensible$1(it) && !hasOwn$c(it, METADATA)) setMetadata(it); 3190 return it; 3191 }; 3192 3193 var enable = function () { 3194 meta.enable = function () { /* empty */ }; 3195 REQUIRED = true; 3196 var getOwnPropertyNames = getOwnPropertyNamesModule$1.f; 3197 var splice = uncurryThis$n([].splice); 3198 var test = {}; 3199 test[METADATA] = 1; 3200 3201 // prevent exposing of metadata key 3202 if (getOwnPropertyNames(test).length) { 3203 getOwnPropertyNamesModule$1.f = function (it) { 3204 var result = getOwnPropertyNames(it); 3205 for (var i = 0, length = result.length; i < length; i++) { 3206 if (result[i] === METADATA) { 3207 splice(result, i, 1); 3208 break; 3209 } 3210 } return result; 3211 }; 3212 3213 $$u({ target: 'Object', stat: true, forced: true }, { 3214 getOwnPropertyNames: getOwnPropertyNamesExternalModule.f 3215 }); 3216 } 3217 }; 3218 3219 var meta = internalMetadata.exports = { 3220 enable: enable, 3221 fastKey: fastKey$1, 3222 getWeakData: getWeakData$1, 3223 onFreeze: onFreeze$1 3224 }; 3225 3226 hiddenKeys$1[METADATA] = true; 3227 3228 var wellKnownSymbol$a = wellKnownSymbol$s; 3229 var Iterators$1 = iterators; 3230 3231 var ITERATOR$5 = wellKnownSymbol$a('iterator'); 3232 var ArrayPrototype = Array.prototype; 3233 3234 // check on default Array iterator 3235 var isArrayIteratorMethod$3 = function (it) { 3236 return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$5] === it); 3237 }; 3238 3239 var classof$4 = classof$d; 3240 var getMethod$3 = getMethod$7; 3241 var Iterators = iterators; 3242 var wellKnownSymbol$9 = wellKnownSymbol$s; 3243 3244 var ITERATOR$4 = wellKnownSymbol$9('iterator'); 3245 3246 var getIteratorMethod$5 = function (it) { 3247 if (it != undefined) return getMethod$3(it, ITERATOR$4) 3248 || getMethod$3(it, '@@iterator') 3249 || Iterators[classof$4(it)]; 3250 }; 3251 3252 var global$B = global$1e; 3253 var call$d = functionCall; 3254 var aCallable$5 = aCallable$8; 3255 var anObject$d = anObject$p; 3256 var tryToString$2 = tryToString$5; 3257 var getIteratorMethod$4 = getIteratorMethod$5; 3258 3259 var TypeError$a = global$B.TypeError; 3260 3261 var getIterator$4 = function (argument, usingIterator) { 3262 var iteratorMethod = arguments.length < 2 ? getIteratorMethod$4(argument) : usingIterator; 3263 if (aCallable$5(iteratorMethod)) return anObject$d(call$d(iteratorMethod, argument)); 3264 throw TypeError$a(tryToString$2(argument) + ' is not iterable'); 3265 }; 3266 3267 var call$c = functionCall; 3268 var anObject$c = anObject$p; 3269 var getMethod$2 = getMethod$7; 3270 3271 var iteratorClose$2 = function (iterator, kind, value) { 3272 var innerResult, innerError; 3273 anObject$c(iterator); 3274 try { 3275 innerResult = getMethod$2(iterator, 'return'); 3276 if (!innerResult) { 3277 if (kind === 'throw') throw value; 3278 return value; 3279 } 3280 innerResult = call$c(innerResult, iterator); 3281 } catch (error) { 3282 innerError = true; 3283 innerResult = error; 3284 } 3285 if (kind === 'throw') throw value; 3286 if (innerError) throw innerResult; 3287 anObject$c(innerResult); 3288 return value; 3289 }; 3290 3291 var global$A = global$1e; 3292 var bind$8 = functionBindContext; 3293 var call$b = functionCall; 3294 var anObject$b = anObject$p; 3295 var tryToString$1 = tryToString$5; 3296 var isArrayIteratorMethod$2 = isArrayIteratorMethod$3; 3297 var lengthOfArrayLike$a = lengthOfArrayLike$h; 3298 var isPrototypeOf$6 = objectIsPrototypeOf; 3299 var getIterator$3 = getIterator$4; 3300 var getIteratorMethod$3 = getIteratorMethod$5; 3301 var iteratorClose$1 = iteratorClose$2; 3302 3303 var TypeError$9 = global$A.TypeError; 3304 3305 var Result = function (stopped, result) { 3306 this.stopped = stopped; 3307 this.result = result; 3308 }; 3309 3310 var ResultPrototype = Result.prototype; 3311 3312 var iterate$4 = function (iterable, unboundFunction, options) { 3313 var that = options && options.that; 3314 var AS_ENTRIES = !!(options && options.AS_ENTRIES); 3315 var IS_ITERATOR = !!(options && options.IS_ITERATOR); 3316 var INTERRUPTED = !!(options && options.INTERRUPTED); 3317 var fn = bind$8(unboundFunction, that); 3318 var iterator, iterFn, index, length, result, next, step; 3319 3320 var stop = function (condition) { 3321 if (iterator) iteratorClose$1(iterator, 'normal', condition); 3322 return new Result(true, condition); 3323 }; 3324 3325 var callFn = function (value) { 3326 if (AS_ENTRIES) { 3327 anObject$b(value); 3328 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); 3329 } return INTERRUPTED ? fn(value, stop) : fn(value); 3330 }; 3331 3332 if (IS_ITERATOR) { 3333 iterator = iterable; 3334 } else { 3335 iterFn = getIteratorMethod$3(iterable); 3336 if (!iterFn) throw TypeError$9(tryToString$1(iterable) + ' is not iterable'); 3337 // optimisation for array iterators 3338 if (isArrayIteratorMethod$2(iterFn)) { 3339 for (index = 0, length = lengthOfArrayLike$a(iterable); length > index; index++) { 3340 result = callFn(iterable[index]); 3341 if (result && isPrototypeOf$6(ResultPrototype, result)) return result; 3342 } return new Result(false); 3343 } 3344 iterator = getIterator$3(iterable, iterFn); 3345 } 3346 3347 next = iterator.next; 3348 while (!(step = call$b(next, iterator)).done) { 3349 try { 3350 result = callFn(step.value); 3351 } catch (error) { 3352 iteratorClose$1(iterator, 'throw', error); 3353 } 3354 if (typeof result == 'object' && result && isPrototypeOf$6(ResultPrototype, result)) return result; 3355 } return new Result(false); 3356 }; 3357 3358 var global$z = global$1e; 3359 var isPrototypeOf$5 = objectIsPrototypeOf; 3360 3361 var TypeError$8 = global$z.TypeError; 3362 3363 var anInstance$8 = function (it, Prototype) { 3364 if (isPrototypeOf$5(Prototype, it)) return it; 3365 throw TypeError$8('Incorrect invocation'); 3366 }; 3367 3368 var wellKnownSymbol$8 = wellKnownSymbol$s; 3369 3370 var ITERATOR$3 = wellKnownSymbol$8('iterator'); 3371 var SAFE_CLOSING = false; 3372 3373 try { 3374 var called = 0; 3375 var iteratorWithReturn = { 3376 next: function () { 3377 return { done: !!called++ }; 3378 }, 3379 'return': function () { 3380 SAFE_CLOSING = true; 3381 } 3382 }; 3383 iteratorWithReturn[ITERATOR$3] = function () { 3384 return this; 3385 }; 3386 // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing 3387 Array.from(iteratorWithReturn, function () { throw 2; }); 3388 } catch (error) { /* empty */ } 3389 3390 var checkCorrectnessOfIteration$4 = function (exec, SKIP_CLOSING) { 3391 if (!SKIP_CLOSING && !SAFE_CLOSING) return false; 3392 var ITERATION_SUPPORT = false; 3393 try { 3394 var object = {}; 3395 object[ITERATOR$3] = function () { 3396 return { 3397 next: function () { 3398 return { done: ITERATION_SUPPORT = true }; 3399 } 3400 }; 3401 }; 3402 exec(object); 3403 } catch (error) { /* empty */ } 3404 return ITERATION_SUPPORT; 3405 }; 3406 3407 var isCallable$7 = isCallable$q; 3408 var isObject$f = isObject$s; 3409 var setPrototypeOf$4 = objectSetPrototypeOf; 3410 3411 // makes subclassing work correct for wrapped built-ins 3412 var inheritIfRequired$3 = function ($this, dummy, Wrapper) { 3413 var NewTarget, NewTargetPrototype; 3414 if ( 3415 // it can work only with native `setPrototypeOf` 3416 setPrototypeOf$4 && 3417 // we haven't completely correct pre-ES6 way for getting `new.target`, so use this 3418 isCallable$7(NewTarget = dummy.constructor) && 3419 NewTarget !== Wrapper && 3420 isObject$f(NewTargetPrototype = NewTarget.prototype) && 3421 NewTargetPrototype !== Wrapper.prototype 3422 ) setPrototypeOf$4($this, NewTargetPrototype); 3423 return $this; 3424 }; 3425 3426 var $$t = _export; 3427 var global$y = global$1e; 3428 var uncurryThis$m = functionUncurryThis; 3429 var isForced$2 = isForced_1; 3430 var redefine$7 = redefine$e.exports; 3431 var InternalMetadataModule$1 = internalMetadata.exports; 3432 var iterate$3 = iterate$4; 3433 var anInstance$7 = anInstance$8; 3434 var isCallable$6 = isCallable$q; 3435 var isObject$e = isObject$s; 3436 var fails$j = fails$I; 3437 var checkCorrectnessOfIteration$3 = checkCorrectnessOfIteration$4; 3438 var setToStringTag$6 = setToStringTag$9; 3439 var inheritIfRequired$2 = inheritIfRequired$3; 3440 3441 var collection$3 = function (CONSTRUCTOR_NAME, wrapper, common) { 3442 var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; 3443 var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; 3444 var ADDER = IS_MAP ? 'set' : 'add'; 3445 var NativeConstructor = global$y[CONSTRUCTOR_NAME]; 3446 var NativePrototype = NativeConstructor && NativeConstructor.prototype; 3447 var Constructor = NativeConstructor; 3448 var exported = {}; 3449 3450 var fixMethod = function (KEY) { 3451 var uncurriedNativeMethod = uncurryThis$m(NativePrototype[KEY]); 3452 redefine$7(NativePrototype, KEY, 3453 KEY == 'add' ? function add(value) { 3454 uncurriedNativeMethod(this, value === 0 ? 0 : value); 3455 return this; 3456 } : KEY == 'delete' ? function (key) { 3457 return IS_WEAK && !isObject$e(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); 3458 } : KEY == 'get' ? function get(key) { 3459 return IS_WEAK && !isObject$e(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); 3460 } : KEY == 'has' ? function has(key) { 3461 return IS_WEAK && !isObject$e(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); 3462 } : function set(key, value) { 3463 uncurriedNativeMethod(this, key === 0 ? 0 : key, value); 3464 return this; 3465 } 3466 ); 3467 }; 3468 3469 var REPLACE = isForced$2( 3470 CONSTRUCTOR_NAME, 3471 !isCallable$6(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$j(function () { 3472 new NativeConstructor().entries().next(); 3473 })) 3474 ); 3475 3476 if (REPLACE) { 3477 // create collection constructor 3478 Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); 3479 InternalMetadataModule$1.enable(); 3480 } else if (isForced$2(CONSTRUCTOR_NAME, true)) { 3481 var instance = new Constructor(); 3482 // early implementations not supports chaining 3483 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; 3484 // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false 3485 var THROWS_ON_PRIMITIVES = fails$j(function () { instance.has(1); }); 3486 // most early implementations doesn't supports iterables, most modern - not close it correctly 3487 // eslint-disable-next-line no-new -- required for testing 3488 var ACCEPT_ITERABLES = checkCorrectnessOfIteration$3(function (iterable) { new NativeConstructor(iterable); }); 3489 // for early implementations -0 and +0 not the same 3490 var BUGGY_ZERO = !IS_WEAK && fails$j(function () { 3491 // V8 ~ Chromium 42- fails only with 5+ elements 3492 var $instance = new NativeConstructor(); 3493 var index = 5; 3494 while (index--) $instance[ADDER](index, index); 3495 return !$instance.has(-0); 3496 }); 3497 3498 if (!ACCEPT_ITERABLES) { 3499 Constructor = wrapper(function (dummy, iterable) { 3500 anInstance$7(dummy, NativePrototype); 3501 var that = inheritIfRequired$2(new NativeConstructor(), dummy, Constructor); 3502 if (iterable != undefined) iterate$3(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); 3503 return that; 3504 }); 3505 Constructor.prototype = NativePrototype; 3506 NativePrototype.constructor = Constructor; 3507 } 3508 3509 if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { 3510 fixMethod('delete'); 3511 fixMethod('has'); 3512 IS_MAP && fixMethod('get'); 3513 } 3514 3515 if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); 3516 3517 // weak collections should not contains .clear method 3518 if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; 3519 } 3520 3521 exported[CONSTRUCTOR_NAME] = Constructor; 3522 $$t({ global: true, forced: Constructor != NativeConstructor }, exported); 3523 3524 setToStringTag$6(Constructor, CONSTRUCTOR_NAME); 3525 3526 if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); 3527 3528 return Constructor; 3529 }; 3530 3531 var redefine$6 = redefine$e.exports; 3532 3533 var redefineAll$6 = function (target, src, options) { 3534 for (var key in src) redefine$6(target, key, src[key], options); 3535 return target; 3536 }; 3537 3538 var getBuiltIn$3 = getBuiltIn$a; 3539 var definePropertyModule$3 = objectDefineProperty; 3540 var wellKnownSymbol$7 = wellKnownSymbol$s; 3541 var DESCRIPTORS$9 = descriptors; 3542 3543 var SPECIES$1 = wellKnownSymbol$7('species'); 3544 3545 var setSpecies$3 = function (CONSTRUCTOR_NAME) { 3546 var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME); 3547 var defineProperty = definePropertyModule$3.f; 3548 3549 if (DESCRIPTORS$9 && Constructor && !Constructor[SPECIES$1]) { 3550 defineProperty(Constructor, SPECIES$1, { 3551 configurable: true, 3552 get: function () { return this; } 3553 }); 3554 } 3555 }; 3556 3557 var defineProperty$6 = objectDefineProperty.f; 3558 var create$2 = objectCreate; 3559 var redefineAll$5 = redefineAll$6; 3560 var bind$7 = functionBindContext; 3561 var anInstance$6 = anInstance$8; 3562 var iterate$2 = iterate$4; 3563 var defineIterator$1 = defineIterator$3; 3564 var setSpecies$2 = setSpecies$3; 3565 var DESCRIPTORS$8 = descriptors; 3566 var fastKey = internalMetadata.exports.fastKey; 3567 var InternalStateModule$8 = internalState; 3568 3569 var setInternalState$8 = InternalStateModule$8.set; 3570 var internalStateGetterFor$1 = InternalStateModule$8.getterFor; 3571 3572 var collectionStrong$2 = { 3573 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { 3574 var Constructor = wrapper(function (that, iterable) { 3575 anInstance$6(that, Prototype); 3576 setInternalState$8(that, { 3577 type: CONSTRUCTOR_NAME, 3578 index: create$2(null), 3579 first: undefined, 3580 last: undefined, 3581 size: 0 3582 }); 3583 if (!DESCRIPTORS$8) that.size = 0; 3584 if (iterable != undefined) iterate$2(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); 3585 }); 3586 3587 var Prototype = Constructor.prototype; 3588 3589 var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME); 3590 3591 var define = function (that, key, value) { 3592 var state = getInternalState(that); 3593 var entry = getEntry(that, key); 3594 var previous, index; 3595 // change existing entry 3596 if (entry) { 3597 entry.value = value; 3598 // create new entry 3599 } else { 3600 state.last = entry = { 3601 index: index = fastKey(key, true), 3602 key: key, 3603 value: value, 3604 previous: previous = state.last, 3605 next: undefined, 3606 removed: false 3607 }; 3608 if (!state.first) state.first = entry; 3609 if (previous) previous.next = entry; 3610 if (DESCRIPTORS$8) state.size++; 3611 else that.size++; 3612 // add to index 3613 if (index !== 'F') state.index[index] = entry; 3614 } return that; 3615 }; 3616 3617 var getEntry = function (that, key) { 3618 var state = getInternalState(that); 3619 // fast case 3620 var index = fastKey(key); 3621 var entry; 3622 if (index !== 'F') return state.index[index]; 3623 // frozen object case 3624 for (entry = state.first; entry; entry = entry.next) { 3625 if (entry.key == key) return entry; 3626 } 3627 }; 3628 3629 redefineAll$5(Prototype, { 3630 // `{ Map, Set }.prototype.clear()` methods 3631 // https://tc39.es/ecma262/#sec-map.prototype.clear 3632 // https://tc39.es/ecma262/#sec-set.prototype.clear 3633 clear: function clear() { 3634 var that = this; 3635 var state = getInternalState(that); 3636 var data = state.index; 3637 var entry = state.first; 3638 while (entry) { 3639 entry.removed = true; 3640 if (entry.previous) entry.previous = entry.previous.next = undefined; 3641 delete data[entry.index]; 3642 entry = entry.next; 3643 } 3644 state.first = state.last = undefined; 3645 if (DESCRIPTORS$8) state.size = 0; 3646 else that.size = 0; 3647 }, 3648 // `{ Map, Set }.prototype.delete(key)` methods 3649 // https://tc39.es/ecma262/#sec-map.prototype.delete 3650 // https://tc39.es/ecma262/#sec-set.prototype.delete 3651 'delete': function (key) { 3652 var that = this; 3653 var state = getInternalState(that); 3654 var entry = getEntry(that, key); 3655 if (entry) { 3656 var next = entry.next; 3657 var prev = entry.previous; 3658 delete state.index[entry.index]; 3659 entry.removed = true; 3660 if (prev) prev.next = next; 3661 if (next) next.previous = prev; 3662 if (state.first == entry) state.first = next; 3663 if (state.last == entry) state.last = prev; 3664 if (DESCRIPTORS$8) state.size--; 3665 else that.size--; 3666 } return !!entry; 3667 }, 3668 // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods 3669 // https://tc39.es/ecma262/#sec-map.prototype.foreach 3670 // https://tc39.es/ecma262/#sec-set.prototype.foreach 3671 forEach: function forEach(callbackfn /* , that = undefined */) { 3672 var state = getInternalState(this); 3673 var boundFunction = bind$7(callbackfn, arguments.length > 1 ? arguments[1] : undefined); 3674 var entry; 3675 while (entry = entry ? entry.next : state.first) { 3676 boundFunction(entry.value, entry.key, this); 3677 // revert to the last existing entry 3678 while (entry && entry.removed) entry = entry.previous; 3679 } 3680 }, 3681 // `{ Map, Set}.prototype.has(key)` methods 3682 // https://tc39.es/ecma262/#sec-map.prototype.has 3683 // https://tc39.es/ecma262/#sec-set.prototype.has 3684 has: function has(key) { 3685 return !!getEntry(this, key); 3686 } 3687 }); 3688 3689 redefineAll$5(Prototype, IS_MAP ? { 3690 // `Map.prototype.get(key)` method 3691 // https://tc39.es/ecma262/#sec-map.prototype.get 3692 get: function get(key) { 3693 var entry = getEntry(this, key); 3694 return entry && entry.value; 3695 }, 3696 // `Map.prototype.set(key, value)` method 3697 // https://tc39.es/ecma262/#sec-map.prototype.set 3698 set: function set(key, value) { 3699 return define(this, key === 0 ? 0 : key, value); 3700 } 3701 } : { 3702 // `Set.prototype.add(value)` method 3703 // https://tc39.es/ecma262/#sec-set.prototype.add 3704 add: function add(value) { 3705 return define(this, value = value === 0 ? 0 : value, value); 3706 } 3707 }); 3708 if (DESCRIPTORS$8) defineProperty$6(Prototype, 'size', { 3709 get: function () { 3710 return getInternalState(this).size; 3711 } 3712 }); 3713 return Constructor; 3714 }, 3715 setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { 3716 var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; 3717 var getInternalCollectionState = internalStateGetterFor$1(CONSTRUCTOR_NAME); 3718 var getInternalIteratorState = internalStateGetterFor$1(ITERATOR_NAME); 3719 // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods 3720 // https://tc39.es/ecma262/#sec-map.prototype.entries 3721 // https://tc39.es/ecma262/#sec-map.prototype.keys 3722 // https://tc39.es/ecma262/#sec-map.prototype.values 3723 // https://tc39.es/ecma262/#sec-map.prototype-@@iterator 3724 // https://tc39.es/ecma262/#sec-set.prototype.entries 3725 // https://tc39.es/ecma262/#sec-set.prototype.keys 3726 // https://tc39.es/ecma262/#sec-set.prototype.values 3727 // https://tc39.es/ecma262/#sec-set.prototype-@@iterator 3728 defineIterator$1(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { 3729 setInternalState$8(this, { 3730 type: ITERATOR_NAME, 3731 target: iterated, 3732 state: getInternalCollectionState(iterated), 3733 kind: kind, 3734 last: undefined 3735 }); 3736 }, function () { 3737 var state = getInternalIteratorState(this); 3738 var kind = state.kind; 3739 var entry = state.last; 3740 // revert to the last existing entry 3741 while (entry && entry.removed) entry = entry.previous; 3742 // get next entry 3743 if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { 3744 // or finish the iteration 3745 state.target = undefined; 3746 return { value: undefined, done: true }; 3747 } 3748 // return step by kind 3749 if (kind == 'keys') return { value: entry.key, done: false }; 3750 if (kind == 'values') return { value: entry.value, done: false }; 3751 return { value: [entry.key, entry.value], done: false }; 3752 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); 3753 3754 // `{ Map, Set }.prototype[@@species]` accessors 3755 // https://tc39.es/ecma262/#sec-get-map-@@species 3756 // https://tc39.es/ecma262/#sec-get-set-@@species 3757 setSpecies$2(CONSTRUCTOR_NAME); 3758 } 3759 }; 3760 3761 var collection$2 = collection$3; 3762 var collectionStrong$1 = collectionStrong$2; 3763 3764 // `Set` constructor 3765 // https://tc39.es/ecma262/#sec-set-objects 3766 collection$2('Set', function (init) { 3767 return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; 3768 }, collectionStrong$1); 3769 3770 var charAt$2 = stringMultibyte.charAt; 3771 var toString$8 = toString$g; 3772 var InternalStateModule$7 = internalState; 3773 var defineIterator = defineIterator$3; 3774 3775 var STRING_ITERATOR = 'String Iterator'; 3776 var setInternalState$7 = InternalStateModule$7.set; 3777 var getInternalState$4 = InternalStateModule$7.getterFor(STRING_ITERATOR); 3778 3779 // `String.prototype[@@iterator]` method 3780 // https://tc39.es/ecma262/#sec-string.prototype-@@iterator 3781 defineIterator(String, 'String', function (iterated) { 3782 setInternalState$7(this, { 3783 type: STRING_ITERATOR, 3784 string: toString$8(iterated), 3785 index: 0 3786 }); 3787 // `%StringIteratorPrototype%.next` method 3788 // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next 3789 }, function next() { 3790 var state = getInternalState$4(this); 3791 var string = state.string; 3792 var index = state.index; 3793 var point; 3794 if (index >= string.length) return { value: undefined, done: true }; 3795 point = charAt$2(string, index); 3796 state.index += point.length; 3797 return { value: point, done: false }; 3798 }); 3799 3800 var uncurryThis$l = functionUncurryThis; 3801 var redefineAll$4 = redefineAll$6; 3802 var getWeakData = internalMetadata.exports.getWeakData; 3803 var anObject$a = anObject$p; 3804 var isObject$d = isObject$s; 3805 var anInstance$5 = anInstance$8; 3806 var iterate$1 = iterate$4; 3807 var ArrayIterationModule = arrayIteration; 3808 var hasOwn$b = hasOwnProperty_1; 3809 var InternalStateModule$6 = internalState; 3810 3811 var setInternalState$6 = InternalStateModule$6.set; 3812 var internalStateGetterFor = InternalStateModule$6.getterFor; 3813 var find$1 = ArrayIterationModule.find; 3814 var findIndex = ArrayIterationModule.findIndex; 3815 var splice$1 = uncurryThis$l([].splice); 3816 var id = 0; 3817 3818 // fallback for uncaught frozen keys 3819 var uncaughtFrozenStore = function (store) { 3820 return store.frozen || (store.frozen = new UncaughtFrozenStore()); 3821 }; 3822 3823 var UncaughtFrozenStore = function () { 3824 this.entries = []; 3825 }; 3826 3827 var findUncaughtFrozen = function (store, key) { 3828 return find$1(store.entries, function (it) { 3829 return it[0] === key; 3830 }); 3831 }; 3832 3833 UncaughtFrozenStore.prototype = { 3834 get: function (key) { 3835 var entry = findUncaughtFrozen(this, key); 3836 if (entry) return entry[1]; 3837 }, 3838 has: function (key) { 3839 return !!findUncaughtFrozen(this, key); 3840 }, 3841 set: function (key, value) { 3842 var entry = findUncaughtFrozen(this, key); 3843 if (entry) entry[1] = value; 3844 else this.entries.push([key, value]); 3845 }, 3846 'delete': function (key) { 3847 var index = findIndex(this.entries, function (it) { 3848 return it[0] === key; 3849 }); 3850 if (~index) splice$1(this.entries, index, 1); 3851 return !!~index; 3852 } 3853 }; 3854 3855 var collectionWeak$1 = { 3856 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { 3857 var Constructor = wrapper(function (that, iterable) { 3858 anInstance$5(that, Prototype); 3859 setInternalState$6(that, { 3860 type: CONSTRUCTOR_NAME, 3861 id: id++, 3862 frozen: undefined 3863 }); 3864 if (iterable != undefined) iterate$1(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); 3865 }); 3866 3867 var Prototype = Constructor.prototype; 3868 3869 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); 3870 3871 var define = function (that, key, value) { 3872 var state = getInternalState(that); 3873 var data = getWeakData(anObject$a(key), true); 3874 if (data === true) uncaughtFrozenStore(state).set(key, value); 3875 else data[state.id] = value; 3876 return that; 3877 }; 3878 3879 redefineAll$4(Prototype, { 3880 // `{ WeakMap, WeakSet }.prototype.delete(key)` methods 3881 // https://tc39.es/ecma262/#sec-weakmap.prototype.delete 3882 // https://tc39.es/ecma262/#sec-weakset.prototype.delete 3883 'delete': function (key) { 3884 var state = getInternalState(this); 3885 if (!isObject$d(key)) return false; 3886 var data = getWeakData(key); 3887 if (data === true) return uncaughtFrozenStore(state)['delete'](key); 3888 return data && hasOwn$b(data, state.id) && delete data[state.id]; 3889 }, 3890 // `{ WeakMap, WeakSet }.prototype.has(key)` methods 3891 // https://tc39.es/ecma262/#sec-weakmap.prototype.has 3892 // https://tc39.es/ecma262/#sec-weakset.prototype.has 3893 has: function has(key) { 3894 var state = getInternalState(this); 3895 if (!isObject$d(key)) return false; 3896 var data = getWeakData(key); 3897 if (data === true) return uncaughtFrozenStore(state).has(key); 3898 return data && hasOwn$b(data, state.id); 3899 } 3900 }); 3901 3902 redefineAll$4(Prototype, IS_MAP ? { 3903 // `WeakMap.prototype.get(key)` method 3904 // https://tc39.es/ecma262/#sec-weakmap.prototype.get 3905 get: function get(key) { 3906 var state = getInternalState(this); 3907 if (isObject$d(key)) { 3908 var data = getWeakData(key); 3909 if (data === true) return uncaughtFrozenStore(state).get(key); 3910 return data ? data[state.id] : undefined; 3911 } 3912 }, 3913 // `WeakMap.prototype.set(key, value)` method 3914 // https://tc39.es/ecma262/#sec-weakmap.prototype.set 3915 set: function set(key, value) { 3916 return define(this, key, value); 3917 } 3918 } : { 3919 // `WeakSet.prototype.add(value)` method 3920 // https://tc39.es/ecma262/#sec-weakset.prototype.add 3921 add: function add(value) { 3922 return define(this, value, true); 3923 } 3924 }); 3925 3926 return Constructor; 3927 } 3928 }; 3929 3930 var global$x = global$1e; 3931 var uncurryThis$k = functionUncurryThis; 3932 var redefineAll$3 = redefineAll$6; 3933 var InternalMetadataModule = internalMetadata.exports; 3934 var collection$1 = collection$3; 3935 var collectionWeak = collectionWeak$1; 3936 var isObject$c = isObject$s; 3937 var isExtensible = objectIsExtensible; 3938 var enforceInternalState = internalState.enforce; 3939 var NATIVE_WEAK_MAP = nativeWeakMap; 3940 3941 var IS_IE11 = !global$x.ActiveXObject && 'ActiveXObject' in global$x; 3942 var InternalWeakMap; 3943 3944 var wrapper = function (init) { 3945 return function WeakMap() { 3946 return init(this, arguments.length ? arguments[0] : undefined); 3947 }; 3948 }; 3949 3950 // `WeakMap` constructor 3951 // https://tc39.es/ecma262/#sec-weakmap-constructor 3952 var $WeakMap = collection$1('WeakMap', wrapper, collectionWeak); 3953 3954 // IE11 WeakMap frozen keys fix 3955 // We can't use feature detection because it crash some old IE builds 3956 // https://github.com/zloirock/core-js/issues/485 3957 if (NATIVE_WEAK_MAP && IS_IE11) { 3958 InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); 3959 InternalMetadataModule.enable(); 3960 var WeakMapPrototype = $WeakMap.prototype; 3961 var nativeDelete = uncurryThis$k(WeakMapPrototype['delete']); 3962 var nativeHas = uncurryThis$k(WeakMapPrototype.has); 3963 var nativeGet = uncurryThis$k(WeakMapPrototype.get); 3964 var nativeSet = uncurryThis$k(WeakMapPrototype.set); 3965 redefineAll$3(WeakMapPrototype, { 3966 'delete': function (key) { 3967 if (isObject$c(key) && !isExtensible(key)) { 3968 var state = enforceInternalState(this); 3969 if (!state.frozen) state.frozen = new InternalWeakMap(); 3970 return nativeDelete(this, key) || state.frozen['delete'](key); 3971 } return nativeDelete(this, key); 3972 }, 3973 has: function has(key) { 3974 if (isObject$c(key) && !isExtensible(key)) { 3975 var state = enforceInternalState(this); 3976 if (!state.frozen) state.frozen = new InternalWeakMap(); 3977 return nativeHas(this, key) || state.frozen.has(key); 3978 } return nativeHas(this, key); 3979 }, 3980 get: function get(key) { 3981 if (isObject$c(key) && !isExtensible(key)) { 3982 var state = enforceInternalState(this); 3983 if (!state.frozen) state.frozen = new InternalWeakMap(); 3984 return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key); 3985 } return nativeGet(this, key); 3986 }, 3987 set: function set(key, value) { 3988 if (isObject$c(key) && !isExtensible(key)) { 3989 var state = enforceInternalState(this); 3990 if (!state.frozen) state.frozen = new InternalWeakMap(); 3991 nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value); 3992 } else nativeSet(this, key, value); 3993 return this; 3994 } 3995 }); 3996 } 3997 3998 var wellKnownSymbolWrapped = {}; 3999 4000 var wellKnownSymbol$6 = wellKnownSymbol$s; 4001 4002 wellKnownSymbolWrapped.f = wellKnownSymbol$6; 4003 4004 var global$w = global$1e; 4005 4006 var path$1 = global$w; 4007 4008 var path = path$1; 4009 var hasOwn$a = hasOwnProperty_1; 4010 var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped; 4011 var defineProperty$5 = objectDefineProperty.f; 4012 4013 var defineWellKnownSymbol$2 = function (NAME) { 4014 var Symbol = path.Symbol || (path.Symbol = {}); 4015 if (!hasOwn$a(Symbol, NAME)) defineProperty$5(Symbol, NAME, { 4016 value: wrappedWellKnownSymbolModule$1.f(NAME) 4017 }); 4018 }; 4019 4020 var $$s = _export; 4021 var global$v = global$1e; 4022 var getBuiltIn$2 = getBuiltIn$a; 4023 var apply$4 = functionApply; 4024 var call$a = functionCall; 4025 var uncurryThis$j = functionUncurryThis; 4026 var DESCRIPTORS$7 = descriptors; 4027 var NATIVE_SYMBOL$1 = nativeSymbol; 4028 var fails$i = fails$I; 4029 var hasOwn$9 = hasOwnProperty_1; 4030 var isArray$1 = isArray$5; 4031 var isCallable$5 = isCallable$q; 4032 var isObject$b = isObject$s; 4033 var isPrototypeOf$4 = objectIsPrototypeOf; 4034 var isSymbol$3 = isSymbol$6; 4035 var anObject$9 = anObject$p; 4036 var toObject$8 = toObject$g; 4037 var toIndexedObject$2 = toIndexedObject$a; 4038 var toPropertyKey$1 = toPropertyKey$5; 4039 var $toString$2 = toString$g; 4040 var createPropertyDescriptor$3 = createPropertyDescriptor$8; 4041 var nativeObjectCreate = objectCreate; 4042 var objectKeys = objectKeys$3; 4043 var getOwnPropertyNamesModule = objectGetOwnPropertyNames; 4044 var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal; 4045 var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols; 4046 var getOwnPropertyDescriptorModule$3 = objectGetOwnPropertyDescriptor; 4047 var definePropertyModule$2 = objectDefineProperty; 4048 var propertyIsEnumerableModule = objectPropertyIsEnumerable; 4049 var arraySlice$7 = arraySlice$9; 4050 var redefine$5 = redefine$e.exports; 4051 var shared = shared$5.exports; 4052 var sharedKey = sharedKey$4; 4053 var hiddenKeys = hiddenKeys$6; 4054 var uid$3 = uid$7; 4055 var wellKnownSymbol$5 = wellKnownSymbol$s; 4056 var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped; 4057 var defineWellKnownSymbol$1 = defineWellKnownSymbol$2; 4058 var setToStringTag$5 = setToStringTag$9; 4059 var InternalStateModule$5 = internalState; 4060 var $forEach$1 = arrayIteration.forEach; 4061 4062 var HIDDEN = sharedKey('hidden'); 4063 var SYMBOL = 'Symbol'; 4064 var PROTOTYPE$1 = 'prototype'; 4065 var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive'); 4066 4067 var setInternalState$5 = InternalStateModule$5.set; 4068 var getInternalState$3 = InternalStateModule$5.getterFor(SYMBOL); 4069 4070 var ObjectPrototype$2 = Object[PROTOTYPE$1]; 4071 var $Symbol = global$v.Symbol; 4072 var SymbolPrototype$1 = $Symbol && $Symbol[PROTOTYPE$1]; 4073 var TypeError$7 = global$v.TypeError; 4074 var QObject = global$v.QObject; 4075 var $stringify = getBuiltIn$2('JSON', 'stringify'); 4076 var nativeGetOwnPropertyDescriptor$1 = getOwnPropertyDescriptorModule$3.f; 4077 var nativeDefineProperty$1 = definePropertyModule$2.f; 4078 var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; 4079 var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; 4080 var push$4 = uncurryThis$j([].push); 4081 4082 var AllSymbols = shared('symbols'); 4083 var ObjectPrototypeSymbols = shared('op-symbols'); 4084 var StringToSymbolRegistry = shared('string-to-symbol-registry'); 4085 var SymbolToStringRegistry = shared('symbol-to-string-registry'); 4086 var WellKnownSymbolsStore = shared('wks'); 4087 4088 // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 4089 var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild; 4090 4091 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 4092 var setSymbolDescriptor = DESCRIPTORS$7 && fails$i(function () { 4093 return nativeObjectCreate(nativeDefineProperty$1({}, 'a', { 4094 get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; } 4095 })).a != 7; 4096 }) ? function (O, P, Attributes) { 4097 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$2, P); 4098 if (ObjectPrototypeDescriptor) delete ObjectPrototype$2[P]; 4099 nativeDefineProperty$1(O, P, Attributes); 4100 if (ObjectPrototypeDescriptor && O !== ObjectPrototype$2) { 4101 nativeDefineProperty$1(ObjectPrototype$2, P, ObjectPrototypeDescriptor); 4102 } 4103 } : nativeDefineProperty$1; 4104 4105 var wrap = function (tag, description) { 4106 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype$1); 4107 setInternalState$5(symbol, { 4108 type: SYMBOL, 4109 tag: tag, 4110 description: description 4111 }); 4112 if (!DESCRIPTORS$7) symbol.description = description; 4113 return symbol; 4114 }; 4115 4116 var $defineProperty = function defineProperty(O, P, Attributes) { 4117 if (O === ObjectPrototype$2) $defineProperty(ObjectPrototypeSymbols, P, Attributes); 4118 anObject$9(O); 4119 var key = toPropertyKey$1(P); 4120 anObject$9(Attributes); 4121 if (hasOwn$9(AllSymbols, key)) { 4122 if (!Attributes.enumerable) { 4123 if (!hasOwn$9(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor$3(1, {})); 4124 O[HIDDEN][key] = true; 4125 } else { 4126 if (hasOwn$9(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; 4127 Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor$3(0, false) }); 4128 } return setSymbolDescriptor(O, key, Attributes); 4129 } return nativeDefineProperty$1(O, key, Attributes); 4130 }; 4131 4132 var $defineProperties = function defineProperties(O, Properties) { 4133 anObject$9(O); 4134 var properties = toIndexedObject$2(Properties); 4135 var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); 4136 $forEach$1(keys, function (key) { 4137 if (!DESCRIPTORS$7 || call$a($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]); 4138 }); 4139 return O; 4140 }; 4141 4142 var $create = function create(O, Properties) { 4143 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); 4144 }; 4145 4146 var $propertyIsEnumerable = function propertyIsEnumerable(V) { 4147 var P = toPropertyKey$1(V); 4148 var enumerable = call$a(nativePropertyIsEnumerable, this, P); 4149 if (this === ObjectPrototype$2 && hasOwn$9(AllSymbols, P) && !hasOwn$9(ObjectPrototypeSymbols, P)) return false; 4150 return enumerable || !hasOwn$9(this, P) || !hasOwn$9(AllSymbols, P) || hasOwn$9(this, HIDDEN) && this[HIDDEN][P] 4151 ? enumerable : true; 4152 }; 4153 4154 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { 4155 var it = toIndexedObject$2(O); 4156 var key = toPropertyKey$1(P); 4157 if (it === ObjectPrototype$2 && hasOwn$9(AllSymbols, key) && !hasOwn$9(ObjectPrototypeSymbols, key)) return; 4158 var descriptor = nativeGetOwnPropertyDescriptor$1(it, key); 4159 if (descriptor && hasOwn$9(AllSymbols, key) && !(hasOwn$9(it, HIDDEN) && it[HIDDEN][key])) { 4160 descriptor.enumerable = true; 4161 } 4162 return descriptor; 4163 }; 4164 4165 var $getOwnPropertyNames = function getOwnPropertyNames(O) { 4166 var names = nativeGetOwnPropertyNames(toIndexedObject$2(O)); 4167 var result = []; 4168 $forEach$1(names, function (key) { 4169 if (!hasOwn$9(AllSymbols, key) && !hasOwn$9(hiddenKeys, key)) push$4(result, key); 4170 }); 4171 return result; 4172 }; 4173 4174 var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { 4175 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$2; 4176 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$2(O)); 4177 var result = []; 4178 $forEach$1(names, function (key) { 4179 if (hasOwn$9(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$9(ObjectPrototype$2, key))) { 4180 push$4(result, AllSymbols[key]); 4181 } 4182 }); 4183 return result; 4184 }; 4185 4186 // `Symbol` constructor 4187 // https://tc39.es/ecma262/#sec-symbol-constructor 4188 if (!NATIVE_SYMBOL$1) { 4189 $Symbol = function Symbol() { 4190 if (isPrototypeOf$4(SymbolPrototype$1, this)) throw TypeError$7('Symbol is not a constructor'); 4191 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString$2(arguments[0]); 4192 var tag = uid$3(description); 4193 var setter = function (value) { 4194 if (this === ObjectPrototype$2) call$a(setter, ObjectPrototypeSymbols, value); 4195 if (hasOwn$9(this, HIDDEN) && hasOwn$9(this[HIDDEN], tag)) this[HIDDEN][tag] = false; 4196 setSymbolDescriptor(this, tag, createPropertyDescriptor$3(1, value)); 4197 }; 4198 if (DESCRIPTORS$7 && USE_SETTER) setSymbolDescriptor(ObjectPrototype$2, tag, { configurable: true, set: setter }); 4199 return wrap(tag, description); 4200 }; 4201 4202 SymbolPrototype$1 = $Symbol[PROTOTYPE$1]; 4203 4204 redefine$5(SymbolPrototype$1, 'toString', function toString() { 4205 return getInternalState$3(this).tag; 4206 }); 4207 4208 redefine$5($Symbol, 'withoutSetter', function (description) { 4209 return wrap(uid$3(description), description); 4210 }); 4211 4212 propertyIsEnumerableModule.f = $propertyIsEnumerable; 4213 definePropertyModule$2.f = $defineProperty; 4214 getOwnPropertyDescriptorModule$3.f = $getOwnPropertyDescriptor; 4215 getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; 4216 getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; 4217 4218 wrappedWellKnownSymbolModule.f = function (name) { 4219 return wrap(wellKnownSymbol$5(name), name); 4220 }; 4221 4222 if (DESCRIPTORS$7) { 4223 // https://github.com/tc39/proposal-Symbol-description 4224 nativeDefineProperty$1(SymbolPrototype$1, 'description', { 4225 configurable: true, 4226 get: function description() { 4227 return getInternalState$3(this).description; 4228 } 4229 }); 4230 { 4231 redefine$5(ObjectPrototype$2, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); 4232 } 4233 } 4234 } 4235 4236 $$s({ global: true, wrap: true, forced: !NATIVE_SYMBOL$1, sham: !NATIVE_SYMBOL$1 }, { 4237 Symbol: $Symbol 4238 }); 4239 4240 $forEach$1(objectKeys(WellKnownSymbolsStore), function (name) { 4241 defineWellKnownSymbol$1(name); 4242 }); 4243 4244 $$s({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL$1 }, { 4245 // `Symbol.for` method 4246 // https://tc39.es/ecma262/#sec-symbol.for 4247 'for': function (key) { 4248 var string = $toString$2(key); 4249 if (hasOwn$9(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; 4250 var symbol = $Symbol(string); 4251 StringToSymbolRegistry[string] = symbol; 4252 SymbolToStringRegistry[symbol] = string; 4253 return symbol; 4254 }, 4255 // `Symbol.keyFor` method 4256 // https://tc39.es/ecma262/#sec-symbol.keyfor 4257 keyFor: function keyFor(sym) { 4258 if (!isSymbol$3(sym)) throw TypeError$7(sym + ' is not a symbol'); 4259 if (hasOwn$9(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; 4260 }, 4261 useSetter: function () { USE_SETTER = true; }, 4262 useSimple: function () { USE_SETTER = false; } 4263 }); 4264 4265 $$s({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$1, sham: !DESCRIPTORS$7 }, { 4266 // `Object.create` method 4267 // https://tc39.es/ecma262/#sec-object.create 4268 create: $create, 4269 // `Object.defineProperty` method 4270 // https://tc39.es/ecma262/#sec-object.defineproperty 4271 defineProperty: $defineProperty, 4272 // `Object.defineProperties` method 4273 // https://tc39.es/ecma262/#sec-object.defineproperties 4274 defineProperties: $defineProperties, 4275 // `Object.getOwnPropertyDescriptor` method 4276 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors 4277 getOwnPropertyDescriptor: $getOwnPropertyDescriptor 4278 }); 4279 4280 $$s({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$1 }, { 4281 // `Object.getOwnPropertyNames` method 4282 // https://tc39.es/ecma262/#sec-object.getownpropertynames 4283 getOwnPropertyNames: $getOwnPropertyNames, 4284 // `Object.getOwnPropertySymbols` method 4285 // https://tc39.es/ecma262/#sec-object.getownpropertysymbols 4286 getOwnPropertySymbols: $getOwnPropertySymbols 4287 }); 4288 4289 // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives 4290 // https://bugs.chromium.org/p/v8/issues/detail?id=3443 4291 $$s({ target: 'Object', stat: true, forced: fails$i(function () { getOwnPropertySymbolsModule.f(1); }) }, { 4292 getOwnPropertySymbols: function getOwnPropertySymbols(it) { 4293 return getOwnPropertySymbolsModule.f(toObject$8(it)); 4294 } 4295 }); 4296 4297 // `JSON.stringify` method behavior with symbols 4298 // https://tc39.es/ecma262/#sec-json.stringify 4299 if ($stringify) { 4300 var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL$1 || fails$i(function () { 4301 var symbol = $Symbol(); 4302 // MS Edge converts symbol values to JSON as {} 4303 return $stringify([symbol]) != '[null]' 4304 // WebKit converts symbol values to JSON as null 4305 || $stringify({ a: symbol }) != '{}' 4306 // V8 throws on boxed symbols 4307 || $stringify(Object(symbol)) != '{}'; 4308 }); 4309 4310 $$s({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, { 4311 // eslint-disable-next-line no-unused-vars -- required for `.length` 4312 stringify: function stringify(it, replacer, space) { 4313 var args = arraySlice$7(arguments); 4314 var $replacer = replacer; 4315 if (!isObject$b(replacer) && it === undefined || isSymbol$3(it)) return; // IE8 returns string on undefined 4316 if (!isArray$1(replacer)) replacer = function (key, value) { 4317 if (isCallable$5($replacer)) value = call$a($replacer, this, key, value); 4318 if (!isSymbol$3(value)) return value; 4319 }; 4320 args[1] = replacer; 4321 return apply$4($stringify, null, args); 4322 } 4323 }); 4324 } 4325 4326 // `Symbol.prototype[@@toPrimitive]` method 4327 // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive 4328 if (!SymbolPrototype$1[TO_PRIMITIVE]) { 4329 var valueOf = SymbolPrototype$1.valueOf; 4330 // eslint-disable-next-line no-unused-vars -- required for .length 4331 redefine$5(SymbolPrototype$1, TO_PRIMITIVE, function (hint) { 4332 // TODO: improve hint logic 4333 return call$a(valueOf, this); 4334 }); 4335 } 4336 // `Symbol.prototype[@@toStringTag]` property 4337 // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag 4338 setToStringTag$5($Symbol, SYMBOL); 4339 4340 hiddenKeys[HIDDEN] = true; 4341 4342 var $$r = _export; 4343 var DESCRIPTORS$6 = descriptors; 4344 var global$u = global$1e; 4345 var uncurryThis$i = functionUncurryThis; 4346 var hasOwn$8 = hasOwnProperty_1; 4347 var isCallable$4 = isCallable$q; 4348 var isPrototypeOf$3 = objectIsPrototypeOf; 4349 var toString$7 = toString$g; 4350 var defineProperty$4 = objectDefineProperty.f; 4351 var copyConstructorProperties = copyConstructorProperties$2; 4352 4353 var NativeSymbol = global$u.Symbol; 4354 var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; 4355 4356 if (DESCRIPTORS$6 && isCallable$4(NativeSymbol) && (!('description' in SymbolPrototype) || 4357 // Safari 12 bug 4358 NativeSymbol().description !== undefined 4359 )) { 4360 var EmptyStringDescriptionStore = {}; 4361 // wrap Symbol constructor for correct work with undefined description 4362 var SymbolWrapper = function Symbol() { 4363 var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$7(arguments[0]); 4364 var result = isPrototypeOf$3(SymbolPrototype, this) 4365 ? new NativeSymbol(description) 4366 // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' 4367 : description === undefined ? NativeSymbol() : NativeSymbol(description); 4368 if (description === '') EmptyStringDescriptionStore[result] = true; 4369 return result; 4370 }; 4371 4372 copyConstructorProperties(SymbolWrapper, NativeSymbol); 4373 SymbolWrapper.prototype = SymbolPrototype; 4374 SymbolPrototype.constructor = SymbolWrapper; 4375 4376 var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)'; 4377 var symbolToString = uncurryThis$i(SymbolPrototype.toString); 4378 var symbolValueOf = uncurryThis$i(SymbolPrototype.valueOf); 4379 var regexp = /^Symbol\((.*)\)[^)]+$/; 4380 var replace$4 = uncurryThis$i(''.replace); 4381 var stringSlice$3 = uncurryThis$i(''.slice); 4382 4383 defineProperty$4(SymbolPrototype, 'description', { 4384 configurable: true, 4385 get: function description() { 4386 var symbol = symbolValueOf(this); 4387 var string = symbolToString(symbol); 4388 if (hasOwn$8(EmptyStringDescriptionStore, symbol)) return ''; 4389 var desc = NATIVE_SYMBOL ? stringSlice$3(string, 7, -1) : replace$4(string, regexp, '$1'); 4390 return desc === '' ? undefined : desc; 4391 } 4392 }); 4393 4394 $$r({ global: true, forced: true }, { 4395 Symbol: SymbolWrapper 4396 }); 4397 } 4398 4399 var $$q = _export; 4400 var $includes$1 = arrayIncludes.includes; 4401 var addToUnscopables$2 = addToUnscopables$4; 4402 4403 // `Array.prototype.includes` method 4404 // https://tc39.es/ecma262/#sec-array.prototype.includes 4405 $$q({ target: 'Array', proto: true }, { 4406 includes: function includes(el /* , fromIndex = 0 */) { 4407 return $includes$1(this, el, arguments.length > 1 ? arguments[1] : undefined); 4408 } 4409 }); 4410 4411 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables 4412 addToUnscopables$2('includes'); 4413 4414 var collection = collection$3; 4415 var collectionStrong = collectionStrong$2; 4416 4417 // `Map` constructor 4418 // https://tc39.es/ecma262/#sec-map-objects 4419 collection('Map', function (init) { 4420 return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; 4421 }, collectionStrong); 4422 4423 var $$p = _export; 4424 var $filter$1 = arrayIteration.filter; 4425 var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5; 4426 4427 var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('filter'); 4428 4429 // `Array.prototype.filter` method 4430 // https://tc39.es/ecma262/#sec-array.prototype.filter 4431 // with adding support of @@species 4432 $$p({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { 4433 filter: function filter(callbackfn /* , thisArg */) { 4434 return $filter$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 4435 } 4436 }); 4437 4438 var $$o = _export; 4439 var $map$1 = arrayIteration.map; 4440 var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5; 4441 4442 var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); 4443 4444 // `Array.prototype.map` method 4445 // https://tc39.es/ecma262/#sec-array.prototype.map 4446 // with adding support of @@species 4447 $$o({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { 4448 map: function map(callbackfn /* , thisArg */) { 4449 return $map$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 4450 } 4451 }); 4452 4453 var $$n = _export; 4454 var fails$h = fails$I; 4455 var getOwnPropertyNames$3 = objectGetOwnPropertyNamesExternal.f; 4456 4457 // eslint-disable-next-line es/no-object-getownpropertynames -- required for testing 4458 var FAILS_ON_PRIMITIVES$2 = fails$h(function () { return !Object.getOwnPropertyNames(1); }); 4459 4460 // `Object.getOwnPropertyNames` method 4461 // https://tc39.es/ecma262/#sec-object.getownpropertynames 4462 $$n({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, { 4463 getOwnPropertyNames: getOwnPropertyNames$3 4464 }); 4465 4466 var hasOwn$7 = hasOwnProperty_1; 4467 4468 var isDataDescriptor$2 = function (descriptor) { 4469 return descriptor !== undefined && (hasOwn$7(descriptor, 'value') || hasOwn$7(descriptor, 'writable')); 4470 }; 4471 4472 var $$m = _export; 4473 var call$9 = functionCall; 4474 var isObject$a = isObject$s; 4475 var anObject$8 = anObject$p; 4476 var isDataDescriptor$1 = isDataDescriptor$2; 4477 var getOwnPropertyDescriptorModule$2 = objectGetOwnPropertyDescriptor; 4478 var getPrototypeOf$3 = objectGetPrototypeOf$1; 4479 4480 // `Reflect.get` method 4481 // https://tc39.es/ecma262/#sec-reflect.get 4482 function get$3(target, propertyKey /* , receiver */) { 4483 var receiver = arguments.length < 3 ? target : arguments[2]; 4484 var descriptor, prototype; 4485 if (anObject$8(target) === receiver) return target[propertyKey]; 4486 descriptor = getOwnPropertyDescriptorModule$2.f(target, propertyKey); 4487 if (descriptor) return isDataDescriptor$1(descriptor) 4488 ? descriptor.value 4489 : descriptor.get === undefined ? undefined : call$9(descriptor.get, receiver); 4490 if (isObject$a(prototype = getPrototypeOf$3(target))) return get$3(prototype, propertyKey, receiver); 4491 } 4492 4493 $$m({ target: 'Reflect', stat: true }, { 4494 get: get$3 4495 }); 4496 4497 var $$l = _export; 4498 var global$t = global$1e; 4499 var setToStringTag$4 = setToStringTag$9; 4500 4501 $$l({ global: true }, { Reflect: {} }); 4502 4503 // Reflect[@@toStringTag] property 4504 // https://tc39.es/ecma262/#sec-reflect-@@tostringtag 4505 setToStringTag$4(global$t.Reflect, 'Reflect', true); 4506 4507 var uncurryThis$h = functionUncurryThis; 4508 4509 // `thisNumberValue` abstract operation 4510 // https://tc39.es/ecma262/#sec-thisnumbervalue 4511 var thisNumberValue$2 = uncurryThis$h(1.0.valueOf); 4512 4513 var DESCRIPTORS$5 = descriptors; 4514 var global$s = global$1e; 4515 var uncurryThis$g = functionUncurryThis; 4516 var isForced$1 = isForced_1; 4517 var redefine$4 = redefine$e.exports; 4518 var hasOwn$6 = hasOwnProperty_1; 4519 var inheritIfRequired$1 = inheritIfRequired$3; 4520 var isPrototypeOf$2 = objectIsPrototypeOf; 4521 var isSymbol$2 = isSymbol$6; 4522 var toPrimitive = toPrimitive$2; 4523 var fails$g = fails$I; 4524 var getOwnPropertyNames$2 = objectGetOwnPropertyNames.f; 4525 var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f; 4526 var defineProperty$3 = objectDefineProperty.f; 4527 var thisNumberValue$1 = thisNumberValue$2; 4528 var trim = stringTrim.trim; 4529 4530 var NUMBER = 'Number'; 4531 var NativeNumber = global$s[NUMBER]; 4532 var NumberPrototype = NativeNumber.prototype; 4533 var TypeError$6 = global$s.TypeError; 4534 var arraySlice$6 = uncurryThis$g(''.slice); 4535 var charCodeAt$1 = uncurryThis$g(''.charCodeAt); 4536 4537 // `ToNumeric` abstract operation 4538 // https://tc39.es/ecma262/#sec-tonumeric 4539 var toNumeric = function (value) { 4540 var primValue = toPrimitive(value, 'number'); 4541 return typeof primValue == 'bigint' ? primValue : toNumber$1(primValue); 4542 }; 4543 4544 // `ToNumber` abstract operation 4545 // https://tc39.es/ecma262/#sec-tonumber 4546 var toNumber$1 = function (argument) { 4547 var it = toPrimitive(argument, 'number'); 4548 var first, third, radix, maxCode, digits, length, index, code; 4549 if (isSymbol$2(it)) throw TypeError$6('Cannot convert a Symbol value to a number'); 4550 if (typeof it == 'string' && it.length > 2) { 4551 it = trim(it); 4552 first = charCodeAt$1(it, 0); 4553 if (first === 43 || first === 45) { 4554 third = charCodeAt$1(it, 2); 4555 if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix 4556 } else if (first === 48) { 4557 switch (charCodeAt$1(it, 1)) { 4558 case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i 4559 case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i 4560 default: return +it; 4561 } 4562 digits = arraySlice$6(it, 2); 4563 length = digits.length; 4564 for (index = 0; index < length; index++) { 4565 code = charCodeAt$1(digits, index); 4566 // parseInt parses a string to a first unavailable symbol 4567 // but ToNumber should return NaN if a string contains unavailable symbols 4568 if (code < 48 || code > maxCode) return NaN; 4569 } return parseInt(digits, radix); 4570 } 4571 } return +it; 4572 }; 4573 4574 // `Number` constructor 4575 // https://tc39.es/ecma262/#sec-number-constructor 4576 if (isForced$1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { 4577 var NumberWrapper = function Number(value) { 4578 var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); 4579 var dummy = this; 4580 // check on 1..constructor(foo) case 4581 return isPrototypeOf$2(NumberPrototype, dummy) && fails$g(function () { thisNumberValue$1(dummy); }) 4582 ? inheritIfRequired$1(Object(n), dummy, NumberWrapper) : n; 4583 }; 4584 for (var keys$1 = DESCRIPTORS$5 ? getOwnPropertyNames$2(NativeNumber) : ( 4585 // ES3: 4586 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + 4587 // ES2015 (in case, if modules with ES2015 Number statics required before): 4588 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + 4589 // ESNext 4590 'fromString,range' 4591 ).split(','), j$1 = 0, key$1; keys$1.length > j$1; j$1++) { 4592 if (hasOwn$6(NativeNumber, key$1 = keys$1[j$1]) && !hasOwn$6(NumberWrapper, key$1)) { 4593 defineProperty$3(NumberWrapper, key$1, getOwnPropertyDescriptor$3(NativeNumber, key$1)); 4594 } 4595 } 4596 NumberWrapper.prototype = NumberPrototype; 4597 NumberPrototype.constructor = NumberWrapper; 4598 redefine$4(global$s, NUMBER, NumberWrapper); 4599 } 4600 4601 var $$k = _export; 4602 var call$8 = functionCall; 4603 var anObject$7 = anObject$p; 4604 var isObject$9 = isObject$s; 4605 var isDataDescriptor = isDataDescriptor$2; 4606 var fails$f = fails$I; 4607 var definePropertyModule$1 = objectDefineProperty; 4608 var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor; 4609 var getPrototypeOf$2 = objectGetPrototypeOf$1; 4610 var createPropertyDescriptor$2 = createPropertyDescriptor$8; 4611 4612 // `Reflect.set` method 4613 // https://tc39.es/ecma262/#sec-reflect.set 4614 function set$4(target, propertyKey, V /* , receiver */) { 4615 var receiver = arguments.length < 4 ? target : arguments[3]; 4616 var ownDescriptor = getOwnPropertyDescriptorModule$1.f(anObject$7(target), propertyKey); 4617 var existingDescriptor, prototype, setter; 4618 if (!ownDescriptor) { 4619 if (isObject$9(prototype = getPrototypeOf$2(target))) { 4620 return set$4(prototype, propertyKey, V, receiver); 4621 } 4622 ownDescriptor = createPropertyDescriptor$2(0); 4623 } 4624 if (isDataDescriptor(ownDescriptor)) { 4625 if (ownDescriptor.writable === false || !isObject$9(receiver)) return false; 4626 if (existingDescriptor = getOwnPropertyDescriptorModule$1.f(receiver, propertyKey)) { 4627 if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; 4628 existingDescriptor.value = V; 4629 definePropertyModule$1.f(receiver, propertyKey, existingDescriptor); 4630 } else definePropertyModule$1.f(receiver, propertyKey, createPropertyDescriptor$2(0, V)); 4631 } else { 4632 setter = ownDescriptor.set; 4633 if (setter === undefined) return false; 4634 call$8(setter, receiver, V); 4635 } return true; 4636 } 4637 4638 // MS Edge 17-18 Reflect.set allows setting the property to object 4639 // with non-writable property on the prototype 4640 var MS_EDGE_BUG = fails$f(function () { 4641 var Constructor = function () { /* empty */ }; 4642 var object = definePropertyModule$1.f(new Constructor(), 'a', { configurable: true }); 4643 // eslint-disable-next-line es/no-reflect -- required for testing 4644 return Reflect.set(Constructor.prototype, 'a', 1, object) !== false; 4645 }); 4646 4647 $$k({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, { 4648 set: set$4 4649 }); 4650 4651 var $$j = _export; 4652 var anObject$6 = anObject$p; 4653 var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; 4654 4655 // `Reflect.deleteProperty` method 4656 // https://tc39.es/ecma262/#sec-reflect.deleteproperty 4657 $$j({ target: 'Reflect', stat: true }, { 4658 deleteProperty: function deleteProperty(target, propertyKey) { 4659 var descriptor = getOwnPropertyDescriptor$2(anObject$6(target), propertyKey); 4660 return descriptor && !descriptor.configurable ? false : delete target[propertyKey]; 4661 } 4662 }); 4663 4664 var $$i = _export; 4665 4666 // `Reflect.has` method 4667 // https://tc39.es/ecma262/#sec-reflect.has 4668 $$i({ target: 'Reflect', stat: true }, { 4669 has: function has(target, propertyKey) { 4670 return propertyKey in target; 4671 } 4672 }); 4673 4674 var $$h = _export; 4675 var ownKeys$1 = ownKeys$3; 4676 4677 // `Reflect.ownKeys` method 4678 // https://tc39.es/ecma262/#sec-reflect.ownkeys 4679 $$h({ target: 'Reflect', stat: true }, { 4680 ownKeys: ownKeys$1 4681 }); 4682 4683 var $$g = _export; 4684 var anObject$5 = anObject$p; 4685 var objectGetPrototypeOf = objectGetPrototypeOf$1; 4686 var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; 4687 4688 // `Reflect.getPrototypeOf` method 4689 // https://tc39.es/ecma262/#sec-reflect.getprototypeof 4690 $$g({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, { 4691 getPrototypeOf: function getPrototypeOf(target) { 4692 return objectGetPrototypeOf(anObject$5(target)); 4693 } 4694 }); 4695 4696 var defineWellKnownSymbol = defineWellKnownSymbol$2; 4697 4698 // `Symbol.iterator` well-known symbol 4699 // https://tc39.es/ecma262/#sec-symbol.iterator 4700 defineWellKnownSymbol('iterator'); 4701 4702 var $$f = _export; 4703 var $isExtensible = objectIsExtensible; 4704 4705 // `Object.isExtensible` method 4706 // https://tc39.es/ecma262/#sec-object.isextensible 4707 // eslint-disable-next-line es/no-object-isextensible -- safe 4708 $$f({ target: 'Object', stat: true, forced: Object.isExtensible !== $isExtensible }, { 4709 isExtensible: $isExtensible 4710 }); 4711 4712 var global$r = global$1e; 4713 4714 var nativePromiseConstructor = global$r.Promise; 4715 4716 var userAgent$4 = engineUserAgent; 4717 4718 var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4); 4719 4720 var classof$3 = classofRaw$1; 4721 var global$q = global$1e; 4722 4723 var engineIsNode = classof$3(global$q.process) == 'process'; 4724 4725 var global$p = global$1e; 4726 var apply$3 = functionApply; 4727 var bind$6 = functionBindContext; 4728 var isCallable$3 = isCallable$q; 4729 var hasOwn$5 = hasOwnProperty_1; 4730 var fails$e = fails$I; 4731 var html = html$2; 4732 var arraySlice$5 = arraySlice$9; 4733 var createElement = documentCreateElement$2; 4734 var IS_IOS$1 = engineIsIos; 4735 var IS_NODE$2 = engineIsNode; 4736 4737 var set$3 = global$p.setImmediate; 4738 var clear$1 = global$p.clearImmediate; 4739 var process$2 = global$p.process; 4740 var Dispatch = global$p.Dispatch; 4741 var Function$1 = global$p.Function; 4742 var MessageChannel = global$p.MessageChannel; 4743 var String$2 = global$p.String; 4744 var counter = 0; 4745 var queue$2 = {}; 4746 var ONREADYSTATECHANGE = 'onreadystatechange'; 4747 var location, defer, channel, port; 4748 4749 try { 4750 // Deno throws a ReferenceError on `location` access without `--location` flag 4751 location = global$p.location; 4752 } catch (error) { /* empty */ } 4753 4754 var run = function (id) { 4755 if (hasOwn$5(queue$2, id)) { 4756 var fn = queue$2[id]; 4757 delete queue$2[id]; 4758 fn(); 4759 } 4760 }; 4761 4762 var runner = function (id) { 4763 return function () { 4764 run(id); 4765 }; 4766 }; 4767 4768 var listener = function (event) { 4769 run(event.data); 4770 }; 4771 4772 var post = function (id) { 4773 // old engines have not location.origin 4774 global$p.postMessage(String$2(id), location.protocol + '//' + location.host); 4775 }; 4776 4777 // Node.js 0.9+ & IE10+ has setImmediate, otherwise: 4778 if (!set$3 || !clear$1) { 4779 set$3 = function setImmediate(fn) { 4780 var args = arraySlice$5(arguments, 1); 4781 queue$2[++counter] = function () { 4782 apply$3(isCallable$3(fn) ? fn : Function$1(fn), undefined, args); 4783 }; 4784 defer(counter); 4785 return counter; 4786 }; 4787 clear$1 = function clearImmediate(id) { 4788 delete queue$2[id]; 4789 }; 4790 // Node.js 0.8- 4791 if (IS_NODE$2) { 4792 defer = function (id) { 4793 process$2.nextTick(runner(id)); 4794 }; 4795 // Sphere (JS game engine) Dispatch API 4796 } else if (Dispatch && Dispatch.now) { 4797 defer = function (id) { 4798 Dispatch.now(runner(id)); 4799 }; 4800 // Browsers with MessageChannel, includes WebWorkers 4801 // except iOS - https://github.com/zloirock/core-js/issues/624 4802 } else if (MessageChannel && !IS_IOS$1) { 4803 channel = new MessageChannel(); 4804 port = channel.port2; 4805 channel.port1.onmessage = listener; 4806 defer = bind$6(port.postMessage, port); 4807 // Browsers with postMessage, skip WebWorkers 4808 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' 4809 } else if ( 4810 global$p.addEventListener && 4811 isCallable$3(global$p.postMessage) && 4812 !global$p.importScripts && 4813 location && location.protocol !== 'file:' && 4814 !fails$e(post) 4815 ) { 4816 defer = post; 4817 global$p.addEventListener('message', listener, false); 4818 // IE8- 4819 } else if (ONREADYSTATECHANGE in createElement('script')) { 4820 defer = function (id) { 4821 html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { 4822 html.removeChild(this); 4823 run(id); 4824 }; 4825 }; 4826 // Rest old browsers 4827 } else { 4828 defer = function (id) { 4829 setTimeout(runner(id), 0); 4830 }; 4831 } 4832 } 4833 4834 var task$1 = { 4835 set: set$3, 4836 clear: clear$1 4837 }; 4838 4839 var userAgent$3 = engineUserAgent; 4840 var global$o = global$1e; 4841 4842 var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$3) && global$o.Pebble !== undefined; 4843 4844 var userAgent$2 = engineUserAgent; 4845 4846 var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent$2); 4847 4848 var global$n = global$1e; 4849 var bind$5 = functionBindContext; 4850 var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; 4851 var macrotask = task$1.set; 4852 var IS_IOS = engineIsIos; 4853 var IS_IOS_PEBBLE = engineIsIosPebble; 4854 var IS_WEBOS_WEBKIT = engineIsWebosWebkit; 4855 var IS_NODE$1 = engineIsNode; 4856 4857 var MutationObserver = global$n.MutationObserver || global$n.WebKitMutationObserver; 4858 var document$2 = global$n.document; 4859 var process$1 = global$n.process; 4860 var Promise$1 = global$n.Promise; 4861 // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` 4862 var queueMicrotaskDescriptor = getOwnPropertyDescriptor$1(global$n, 'queueMicrotask'); 4863 var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; 4864 4865 var flush, head, last, notify$1, toggle, node, promise, then; 4866 4867 // modern engines have queueMicrotask method 4868 if (!queueMicrotask) { 4869 flush = function () { 4870 var parent, fn; 4871 if (IS_NODE$1 && (parent = process$1.domain)) parent.exit(); 4872 while (head) { 4873 fn = head.fn; 4874 head = head.next; 4875 try { 4876 fn(); 4877 } catch (error) { 4878 if (head) notify$1(); 4879 else last = undefined; 4880 throw error; 4881 } 4882 } last = undefined; 4883 if (parent) parent.enter(); 4884 }; 4885 4886 // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 4887 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898 4888 if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) { 4889 toggle = true; 4890 node = document$2.createTextNode(''); 4891 new MutationObserver(flush).observe(node, { characterData: true }); 4892 notify$1 = function () { 4893 node.data = toggle = !toggle; 4894 }; 4895 // environments with maybe non-completely correct, but existent Promise 4896 } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) { 4897 // Promise.resolve without an argument throws an error in LG WebOS 2 4898 promise = Promise$1.resolve(undefined); 4899 // workaround of WebKit ~ iOS Safari 10.1 bug 4900 promise.constructor = Promise$1; 4901 then = bind$5(promise.then, promise); 4902 notify$1 = function () { 4903 then(flush); 4904 }; 4905 // Node.js without promises 4906 } else if (IS_NODE$1) { 4907 notify$1 = function () { 4908 process$1.nextTick(flush); 4909 }; 4910 // for other environments - macrotask based on: 4911 // - setImmediate 4912 // - MessageChannel 4913 // - window.postMessag 4914 // - onreadystatechange 4915 // - setTimeout 4916 } else { 4917 // strange IE + webpack dev server bug - use .bind(global) 4918 macrotask = bind$5(macrotask, global$n); 4919 notify$1 = function () { 4920 macrotask(flush); 4921 }; 4922 } 4923 } 4924 4925 var microtask$1 = queueMicrotask || function (fn) { 4926 var task = { fn: fn, next: undefined }; 4927 if (last) last.next = task; 4928 if (!head) { 4929 head = task; 4930 notify$1(); 4931 } last = task; 4932 }; 4933 4934 var newPromiseCapability$2 = {}; 4935 4936 var aCallable$4 = aCallable$8; 4937 4938 var PromiseCapability = function (C) { 4939 var resolve, reject; 4940 this.promise = new C(function ($$resolve, $$reject) { 4941 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); 4942 resolve = $$resolve; 4943 reject = $$reject; 4944 }); 4945 this.resolve = aCallable$4(resolve); 4946 this.reject = aCallable$4(reject); 4947 }; 4948 4949 // `NewPromiseCapability` abstract operation 4950 // https://tc39.es/ecma262/#sec-newpromisecapability 4951 newPromiseCapability$2.f = function (C) { 4952 return new PromiseCapability(C); 4953 }; 4954 4955 var anObject$4 = anObject$p; 4956 var isObject$8 = isObject$s; 4957 var newPromiseCapability$1 = newPromiseCapability$2; 4958 4959 var promiseResolve$1 = function (C, x) { 4960 anObject$4(C); 4961 if (isObject$8(x) && x.constructor === C) return x; 4962 var promiseCapability = newPromiseCapability$1.f(C); 4963 var resolve = promiseCapability.resolve; 4964 resolve(x); 4965 return promiseCapability.promise; 4966 }; 4967 4968 var global$m = global$1e; 4969 4970 var hostReportErrors$1 = function (a, b) { 4971 var console = global$m.console; 4972 if (console && console.error) { 4973 arguments.length == 1 ? console.error(a) : console.error(a, b); 4974 } 4975 }; 4976 4977 var perform$1 = function (exec) { 4978 try { 4979 return { error: false, value: exec() }; 4980 } catch (error) { 4981 return { error: true, value: error }; 4982 } 4983 }; 4984 4985 var Queue$1 = function () { 4986 this.head = null; 4987 this.tail = null; 4988 }; 4989 4990 Queue$1.prototype = { 4991 add: function (item) { 4992 var entry = { item: item, next: null }; 4993 if (this.head) this.tail.next = entry; 4994 else this.head = entry; 4995 this.tail = entry; 4996 }, 4997 get: function () { 4998 var entry = this.head; 4999 if (entry) { 5000 this.head = entry.next; 5001 if (this.tail === entry) this.tail = null; 5002 return entry.item; 5003 } 5004 } 5005 }; 5006 5007 var queue$1 = Queue$1; 5008 5009 var engineIsBrowser = typeof window == 'object'; 5010 5011 var $$e = _export; 5012 var global$l = global$1e; 5013 var getBuiltIn$1 = getBuiltIn$a; 5014 var call$7 = functionCall; 5015 var NativePromise = nativePromiseConstructor; 5016 var redefine$3 = redefine$e.exports; 5017 var redefineAll$2 = redefineAll$6; 5018 var setPrototypeOf$3 = objectSetPrototypeOf; 5019 var setToStringTag$3 = setToStringTag$9; 5020 var setSpecies$1 = setSpecies$3; 5021 var aCallable$3 = aCallable$8; 5022 var isCallable$2 = isCallable$q; 5023 var isObject$7 = isObject$s; 5024 var anInstance$4 = anInstance$8; 5025 var inspectSource = inspectSource$4; 5026 var iterate = iterate$4; 5027 var checkCorrectnessOfIteration$2 = checkCorrectnessOfIteration$4; 5028 var speciesConstructor$1 = speciesConstructor$3; 5029 var task = task$1.set; 5030 var microtask = microtask$1; 5031 var promiseResolve = promiseResolve$1; 5032 var hostReportErrors = hostReportErrors$1; 5033 var newPromiseCapabilityModule = newPromiseCapability$2; 5034 var perform = perform$1; 5035 var Queue = queue$1; 5036 var InternalStateModule$4 = internalState; 5037 var isForced = isForced_1; 5038 var wellKnownSymbol$4 = wellKnownSymbol$s; 5039 var IS_BROWSER = engineIsBrowser; 5040 var IS_NODE = engineIsNode; 5041 var V8_VERSION = engineV8Version; 5042 5043 var SPECIES = wellKnownSymbol$4('species'); 5044 var PROMISE = 'Promise'; 5045 5046 var getInternalState$2 = InternalStateModule$4.getterFor(PROMISE); 5047 var setInternalState$4 = InternalStateModule$4.set; 5048 var getInternalPromiseState = InternalStateModule$4.getterFor(PROMISE); 5049 var NativePromisePrototype = NativePromise && NativePromise.prototype; 5050 var PromiseConstructor = NativePromise; 5051 var PromisePrototype = NativePromisePrototype; 5052 var TypeError$5 = global$l.TypeError; 5053 var document$1 = global$l.document; 5054 var process = global$l.process; 5055 var newPromiseCapability = newPromiseCapabilityModule.f; 5056 var newGenericPromiseCapability = newPromiseCapability; 5057 5058 var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$l.dispatchEvent); 5059 var NATIVE_REJECTION_EVENT = isCallable$2(global$l.PromiseRejectionEvent); 5060 var UNHANDLED_REJECTION = 'unhandledrejection'; 5061 var REJECTION_HANDLED = 'rejectionhandled'; 5062 var PENDING = 0; 5063 var FULFILLED = 1; 5064 var REJECTED = 2; 5065 var HANDLED = 1; 5066 var UNHANDLED = 2; 5067 var SUBCLASSING = false; 5068 5069 var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; 5070 5071 var FORCED$6 = isForced(PROMISE, function () { 5072 var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor); 5073 var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor); 5074 // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables 5075 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 5076 // We can't detect it synchronously, so just check versions 5077 if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; 5078 // We can't use @@species feature detection in V8 since it causes 5079 // deoptimization and performance degradation 5080 // https://github.com/zloirock/core-js/issues/679 5081 if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false; 5082 // Detect correctness of subclassing with @@species support 5083 var promise = new PromiseConstructor(function (resolve) { resolve(1); }); 5084 var FakePromise = function (exec) { 5085 exec(function () { /* empty */ }, function () { /* empty */ }); 5086 }; 5087 var constructor = promise.constructor = {}; 5088 constructor[SPECIES] = FakePromise; 5089 SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise; 5090 if (!SUBCLASSING) return true; 5091 // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test 5092 return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT; 5093 }); 5094 5095 var INCORRECT_ITERATION$1 = FORCED$6 || !checkCorrectnessOfIteration$2(function (iterable) { 5096 PromiseConstructor.all(iterable)['catch'](function () { /* empty */ }); 5097 }); 5098 5099 // helpers 5100 var isThenable = function (it) { 5101 var then; 5102 return isObject$7(it) && isCallable$2(then = it.then) ? then : false; 5103 }; 5104 5105 var callReaction = function (reaction, state) { 5106 var value = state.value; 5107 var ok = state.state == FULFILLED; 5108 var handler = ok ? reaction.ok : reaction.fail; 5109 var resolve = reaction.resolve; 5110 var reject = reaction.reject; 5111 var domain = reaction.domain; 5112 var result, then, exited; 5113 try { 5114 if (handler) { 5115 if (!ok) { 5116 if (state.rejection === UNHANDLED) onHandleUnhandled(state); 5117 state.rejection = HANDLED; 5118 } 5119 if (handler === true) result = value; 5120 else { 5121 if (domain) domain.enter(); 5122 result = handler(value); // can throw 5123 if (domain) { 5124 domain.exit(); 5125 exited = true; 5126 } 5127 } 5128 if (result === reaction.promise) { 5129 reject(TypeError$5('Promise-chain cycle')); 5130 } else if (then = isThenable(result)) { 5131 call$7(then, result, resolve, reject); 5132 } else resolve(result); 5133 } else reject(value); 5134 } catch (error) { 5135 if (domain && !exited) domain.exit(); 5136 reject(error); 5137 } 5138 }; 5139 5140 var notify = function (state, isReject) { 5141 if (state.notified) return; 5142 state.notified = true; 5143 microtask(function () { 5144 var reactions = state.reactions; 5145 var reaction; 5146 while (reaction = reactions.get()) { 5147 callReaction(reaction, state); 5148 } 5149 state.notified = false; 5150 if (isReject && !state.rejection) onUnhandled(state); 5151 }); 5152 }; 5153 5154 var dispatchEvent = function (name, promise, reason) { 5155 var event, handler; 5156 if (DISPATCH_EVENT) { 5157 event = document$1.createEvent('Event'); 5158 event.promise = promise; 5159 event.reason = reason; 5160 event.initEvent(name, false, true); 5161 global$l.dispatchEvent(event); 5162 } else event = { promise: promise, reason: reason }; 5163 if (!NATIVE_REJECTION_EVENT && (handler = global$l['on' + name])) handler(event); 5164 else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); 5165 }; 5166 5167 var onUnhandled = function (state) { 5168 call$7(task, global$l, function () { 5169 var promise = state.facade; 5170 var value = state.value; 5171 var IS_UNHANDLED = isUnhandled(state); 5172 var result; 5173 if (IS_UNHANDLED) { 5174 result = perform(function () { 5175 if (IS_NODE) { 5176 process.emit('unhandledRejection', value, promise); 5177 } else dispatchEvent(UNHANDLED_REJECTION, promise, value); 5178 }); 5179 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should 5180 state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; 5181 if (result.error) throw result.value; 5182 } 5183 }); 5184 }; 5185 5186 var isUnhandled = function (state) { 5187 return state.rejection !== HANDLED && !state.parent; 5188 }; 5189 5190 var onHandleUnhandled = function (state) { 5191 call$7(task, global$l, function () { 5192 var promise = state.facade; 5193 if (IS_NODE) { 5194 process.emit('rejectionHandled', promise); 5195 } else dispatchEvent(REJECTION_HANDLED, promise, state.value); 5196 }); 5197 }; 5198 5199 var bind$4 = function (fn, state, unwrap) { 5200 return function (value) { 5201 fn(state, value, unwrap); 5202 }; 5203 }; 5204 5205 var internalReject = function (state, value, unwrap) { 5206 if (state.done) return; 5207 state.done = true; 5208 if (unwrap) state = unwrap; 5209 state.value = value; 5210 state.state = REJECTED; 5211 notify(state, true); 5212 }; 5213 5214 var internalResolve = function (state, value, unwrap) { 5215 if (state.done) return; 5216 state.done = true; 5217 if (unwrap) state = unwrap; 5218 try { 5219 if (state.facade === value) throw TypeError$5("Promise can't be resolved itself"); 5220 var then = isThenable(value); 5221 if (then) { 5222 microtask(function () { 5223 var wrapper = { done: false }; 5224 try { 5225 call$7(then, value, 5226 bind$4(internalResolve, wrapper, state), 5227 bind$4(internalReject, wrapper, state) 5228 ); 5229 } catch (error) { 5230 internalReject(wrapper, error, state); 5231 } 5232 }); 5233 } else { 5234 state.value = value; 5235 state.state = FULFILLED; 5236 notify(state, false); 5237 } 5238 } catch (error) { 5239 internalReject({ done: false }, error, state); 5240 } 5241 }; 5242 5243 // constructor polyfill 5244 if (FORCED$6) { 5245 // 25.4.3.1 Promise(executor) 5246 PromiseConstructor = function Promise(executor) { 5247 anInstance$4(this, PromisePrototype); 5248 aCallable$3(executor); 5249 call$7(Internal, this); 5250 var state = getInternalState$2(this); 5251 try { 5252 executor(bind$4(internalResolve, state), bind$4(internalReject, state)); 5253 } catch (error) { 5254 internalReject(state, error); 5255 } 5256 }; 5257 PromisePrototype = PromiseConstructor.prototype; 5258 // eslint-disable-next-line no-unused-vars -- required for `.length` 5259 Internal = function Promise(executor) { 5260 setInternalState$4(this, { 5261 type: PROMISE, 5262 done: false, 5263 notified: false, 5264 parent: false, 5265 reactions: new Queue(), 5266 rejection: false, 5267 state: PENDING, 5268 value: undefined 5269 }); 5270 }; 5271 Internal.prototype = redefineAll$2(PromisePrototype, { 5272 // `Promise.prototype.then` method 5273 // https://tc39.es/ecma262/#sec-promise.prototype.then 5274 then: function then(onFulfilled, onRejected) { 5275 var state = getInternalPromiseState(this); 5276 var reaction = newPromiseCapability(speciesConstructor$1(this, PromiseConstructor)); 5277 state.parent = true; 5278 reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true; 5279 reaction.fail = isCallable$2(onRejected) && onRejected; 5280 reaction.domain = IS_NODE ? process.domain : undefined; 5281 if (state.state == PENDING) state.reactions.add(reaction); 5282 else microtask(function () { 5283 callReaction(reaction, state); 5284 }); 5285 return reaction.promise; 5286 }, 5287 // `Promise.prototype.catch` method 5288 // https://tc39.es/ecma262/#sec-promise.prototype.catch 5289 'catch': function (onRejected) { 5290 return this.then(undefined, onRejected); 5291 } 5292 }); 5293 OwnPromiseCapability = function () { 5294 var promise = new Internal(); 5295 var state = getInternalState$2(promise); 5296 this.promise = promise; 5297 this.resolve = bind$4(internalResolve, state); 5298 this.reject = bind$4(internalReject, state); 5299 }; 5300 newPromiseCapabilityModule.f = newPromiseCapability = function (C) { 5301 return C === PromiseConstructor || C === PromiseWrapper 5302 ? new OwnPromiseCapability(C) 5303 : newGenericPromiseCapability(C); 5304 }; 5305 5306 if (isCallable$2(NativePromise) && NativePromisePrototype !== Object.prototype) { 5307 nativeThen = NativePromisePrototype.then; 5308 5309 if (!SUBCLASSING) { 5310 // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs 5311 redefine$3(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { 5312 var that = this; 5313 return new PromiseConstructor(function (resolve, reject) { 5314 call$7(nativeThen, that, resolve, reject); 5315 }).then(onFulfilled, onRejected); 5316 // https://github.com/zloirock/core-js/issues/640 5317 }, { unsafe: true }); 5318 5319 // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` 5320 redefine$3(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true }); 5321 } 5322 5323 // make `.constructor === Promise` work for native promise-based APIs 5324 try { 5325 delete NativePromisePrototype.constructor; 5326 } catch (error) { /* empty */ } 5327 5328 // make `instanceof Promise` work for native promise-based APIs 5329 if (setPrototypeOf$3) { 5330 setPrototypeOf$3(NativePromisePrototype, PromisePrototype); 5331 } 5332 } 5333 } 5334 5335 $$e({ global: true, wrap: true, forced: FORCED$6 }, { 5336 Promise: PromiseConstructor 5337 }); 5338 5339 setToStringTag$3(PromiseConstructor, PROMISE, false); 5340 setSpecies$1(PROMISE); 5341 5342 PromiseWrapper = getBuiltIn$1(PROMISE); 5343 5344 // statics 5345 $$e({ target: PROMISE, stat: true, forced: FORCED$6 }, { 5346 // `Promise.reject` method 5347 // https://tc39.es/ecma262/#sec-promise.reject 5348 reject: function reject(r) { 5349 var capability = newPromiseCapability(this); 5350 call$7(capability.reject, undefined, r); 5351 return capability.promise; 5352 } 5353 }); 5354 5355 $$e({ target: PROMISE, stat: true, forced: FORCED$6 }, { 5356 // `Promise.resolve` method 5357 // https://tc39.es/ecma262/#sec-promise.resolve 5358 resolve: function resolve(x) { 5359 return promiseResolve(this, x); 5360 } 5361 }); 5362 5363 $$e({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, { 5364 // `Promise.all` method 5365 // https://tc39.es/ecma262/#sec-promise.all 5366 all: function all(iterable) { 5367 var C = this; 5368 var capability = newPromiseCapability(C); 5369 var resolve = capability.resolve; 5370 var reject = capability.reject; 5371 var result = perform(function () { 5372 var $promiseResolve = aCallable$3(C.resolve); 5373 var values = []; 5374 var counter = 0; 5375 var remaining = 1; 5376 iterate(iterable, function (promise) { 5377 var index = counter++; 5378 var alreadyCalled = false; 5379 remaining++; 5380 call$7($promiseResolve, C, promise).then(function (value) { 5381 if (alreadyCalled) return; 5382 alreadyCalled = true; 5383 values[index] = value; 5384 --remaining || resolve(values); 5385 }, reject); 5386 }); 5387 --remaining || resolve(values); 5388 }); 5389 if (result.error) reject(result.value); 5390 return capability.promise; 5391 }, 5392 // `Promise.race` method 5393 // https://tc39.es/ecma262/#sec-promise.race 5394 race: function race(iterable) { 5395 var C = this; 5396 var capability = newPromiseCapability(C); 5397 var reject = capability.reject; 5398 var result = perform(function () { 5399 var $promiseResolve = aCallable$3(C.resolve); 5400 iterate(iterable, function (promise) { 5401 call$7($promiseResolve, C, promise).then(capability.resolve, reject); 5402 }); 5403 }); 5404 if (result.error) reject(result.value); 5405 return capability.promise; 5406 } 5407 }); 5408 5409 var $$d = _export; 5410 var uncurryThis$f = functionUncurryThis; 5411 var notARegExp$1 = notARegexp; 5412 var requireObjectCoercible$5 = requireObjectCoercible$d; 5413 var toString$6 = toString$g; 5414 var correctIsRegExpLogic$1 = correctIsRegexpLogic; 5415 5416 var stringIndexOf = uncurryThis$f(''.indexOf); 5417 5418 // `String.prototype.includes` method 5419 // https://tc39.es/ecma262/#sec-string.prototype.includes 5420 $$d({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, { 5421 includes: function includes(searchString /* , position = 0 */) { 5422 return !!~stringIndexOf( 5423 toString$6(requireObjectCoercible$5(this)), 5424 toString$6(notARegExp$1(searchString)), 5425 arguments.length > 1 ? arguments[1] : undefined 5426 ); 5427 } 5428 }); 5429 5430 var $$c = _export; 5431 var toObject$7 = toObject$g; 5432 var nativeKeys = objectKeys$3; 5433 var fails$d = fails$I; 5434 5435 var FAILS_ON_PRIMITIVES$1 = fails$d(function () { nativeKeys(1); }); 5436 5437 // `Object.keys` method 5438 // https://tc39.es/ecma262/#sec-object.keys 5439 $$c({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, { 5440 keys: function keys(it) { 5441 return nativeKeys(toObject$7(it)); 5442 } 5443 }); 5444 5445 var call$6 = functionCall; 5446 var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic; 5447 var anObject$3 = anObject$p; 5448 var toLength$5 = toLength$a; 5449 var toString$5 = toString$g; 5450 var requireObjectCoercible$4 = requireObjectCoercible$d; 5451 var getMethod$1 = getMethod$7; 5452 var advanceStringIndex = advanceStringIndex$3; 5453 var regExpExec$2 = regexpExecAbstract; 5454 5455 // @@match logic 5456 fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCallNative) { 5457 return [ 5458 // `String.prototype.match` method 5459 // https://tc39.es/ecma262/#sec-string.prototype.match 5460 function match(regexp) { 5461 var O = requireObjectCoercible$4(this); 5462 var matcher = regexp == undefined ? undefined : getMethod$1(regexp, MATCH); 5463 return matcher ? call$6(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$5(O)); 5464 }, 5465 // `RegExp.prototype[@@match]` method 5466 // https://tc39.es/ecma262/#sec-regexp.prototype-@@match 5467 function (string) { 5468 var rx = anObject$3(this); 5469 var S = toString$5(string); 5470 var res = maybeCallNative(nativeMatch, rx, S); 5471 5472 if (res.done) return res.value; 5473 5474 if (!rx.global) return regExpExec$2(rx, S); 5475 5476 var fullUnicode = rx.unicode; 5477 rx.lastIndex = 0; 5478 var A = []; 5479 var n = 0; 5480 var result; 5481 while ((result = regExpExec$2(rx, S)) !== null) { 5482 var matchStr = toString$5(result[0]); 5483 A[n] = matchStr; 5484 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$5(rx.lastIndex), fullUnicode); 5485 n++; 5486 } 5487 return n === 0 ? null : A; 5488 } 5489 ]; 5490 }); 5491 5492 var $$b = _export; 5493 var $findIndex$1 = arrayIteration.findIndex; 5494 var addToUnscopables$1 = addToUnscopables$4; 5495 5496 var FIND_INDEX = 'findIndex'; 5497 var SKIPS_HOLES$1 = true; 5498 5499 // Shouldn't skip holes 5500 if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES$1 = false; }); 5501 5502 // `Array.prototype.findIndex` method 5503 // https://tc39.es/ecma262/#sec-array.prototype.findindex 5504 $$b({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { 5505 findIndex: function findIndex(callbackfn /* , that = undefined */) { 5506 return $findIndex$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 5507 } 5508 }); 5509 5510 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables 5511 addToUnscopables$1(FIND_INDEX); 5512 5513 var uncurryThis$e = functionUncurryThis; 5514 var requireObjectCoercible$3 = requireObjectCoercible$d; 5515 var toString$4 = toString$g; 5516 5517 var quot = /"/g; 5518 var replace$3 = uncurryThis$e(''.replace); 5519 5520 // `CreateHTML` abstract operation 5521 // https://tc39.es/ecma262/#sec-createhtml 5522 var createHtml = function (string, tag, attribute, value) { 5523 var S = toString$4(requireObjectCoercible$3(string)); 5524 var p1 = '<' + tag; 5525 if (attribute !== '') p1 += ' ' + attribute + '="' + replace$3(toString$4(value), quot, '"') + '"'; 5526 return p1 + '>' + S + '</' + tag + '>'; 5527 }; 5528 5529 var fails$c = fails$I; 5530 5531 // check the existence of a method, lowercase 5532 // of a tag and escaping quotes in arguments 5533 var stringHtmlForced = function (METHOD_NAME) { 5534 return fails$c(function () { 5535 var test = ''[METHOD_NAME]('"'); 5536 return test !== test.toLowerCase() || test.split('"').length > 3; 5537 }); 5538 }; 5539 5540 var $$a = _export; 5541 var createHTML = createHtml; 5542 var forcedStringHTMLMethod = stringHtmlForced; 5543 5544 // `String.prototype.anchor` method 5545 // https://tc39.es/ecma262/#sec-string.prototype.anchor 5546 $$a({ target: 'String', proto: true, forced: forcedStringHTMLMethod('anchor') }, { 5547 anchor: function anchor(name) { 5548 return createHTML(this, 'a', 'name', name); 5549 } 5550 }); 5551 5552 var anObject$2 = anObject$p; 5553 var iteratorClose = iteratorClose$2; 5554 5555 // call something on iterator step with safe closing on error 5556 var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) { 5557 try { 5558 return ENTRIES ? fn(anObject$2(value)[0], value[1]) : fn(value); 5559 } catch (error) { 5560 iteratorClose(iterator, 'throw', error); 5561 } 5562 }; 5563 5564 var global$k = global$1e; 5565 var bind$3 = functionBindContext; 5566 var call$5 = functionCall; 5567 var toObject$6 = toObject$g; 5568 var callWithSafeIterationClosing = callWithSafeIterationClosing$1; 5569 var isArrayIteratorMethod$1 = isArrayIteratorMethod$3; 5570 var isConstructor = isConstructor$4; 5571 var lengthOfArrayLike$9 = lengthOfArrayLike$h; 5572 var createProperty = createProperty$5; 5573 var getIterator$2 = getIterator$4; 5574 var getIteratorMethod$2 = getIteratorMethod$5; 5575 5576 var Array$4 = global$k.Array; 5577 5578 // `Array.from` method implementation 5579 // https://tc39.es/ecma262/#sec-array.from 5580 var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { 5581 var O = toObject$6(arrayLike); 5582 var IS_CONSTRUCTOR = isConstructor(this); 5583 var argumentsLength = arguments.length; 5584 var mapfn = argumentsLength > 1 ? arguments[1] : undefined; 5585 var mapping = mapfn !== undefined; 5586 if (mapping) mapfn = bind$3(mapfn, argumentsLength > 2 ? arguments[2] : undefined); 5587 var iteratorMethod = getIteratorMethod$2(O); 5588 var index = 0; 5589 var length, result, step, iterator, next, value; 5590 // if the target is not iterable or it's an array with the default iterator - use a simple case 5591 if (iteratorMethod && !(this == Array$4 && isArrayIteratorMethod$1(iteratorMethod))) { 5592 iterator = getIterator$2(O, iteratorMethod); 5593 next = iterator.next; 5594 result = IS_CONSTRUCTOR ? new this() : []; 5595 for (;!(step = call$5(next, iterator)).done; index++) { 5596 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; 5597 createProperty(result, index, value); 5598 } 5599 } else { 5600 length = lengthOfArrayLike$9(O); 5601 result = IS_CONSTRUCTOR ? new this(length) : Array$4(length); 5602 for (;length > index; index++) { 5603 value = mapping ? mapfn(O[index], index) : O[index]; 5604 createProperty(result, index, value); 5605 } 5606 } 5607 result.length = index; 5608 return result; 5609 }; 5610 5611 var $$9 = _export; 5612 var from = arrayFrom$1; 5613 var checkCorrectnessOfIteration$1 = checkCorrectnessOfIteration$4; 5614 5615 var INCORRECT_ITERATION = !checkCorrectnessOfIteration$1(function (iterable) { 5616 // eslint-disable-next-line es/no-array-from -- required for testing 5617 Array.from(iterable); 5618 }); 5619 5620 // `Array.from` method 5621 // https://tc39.es/ecma262/#sec-array.from 5622 $$9({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { 5623 from: from 5624 }); 5625 5626 var DESCRIPTORS$4 = descriptors; 5627 var FUNCTION_NAME_EXISTS = functionName.EXISTS; 5628 var uncurryThis$d = functionUncurryThis; 5629 var defineProperty$2 = objectDefineProperty.f; 5630 5631 var FunctionPrototype = Function.prototype; 5632 var functionToString = uncurryThis$d(FunctionPrototype.toString); 5633 var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/; 5634 var regExpExec$1 = uncurryThis$d(nameRE.exec); 5635 var NAME$1 = 'name'; 5636 5637 // Function instances `.name` property 5638 // https://tc39.es/ecma262/#sec-function-instances-name 5639 if (DESCRIPTORS$4 && !FUNCTION_NAME_EXISTS) { 5640 defineProperty$2(FunctionPrototype, NAME$1, { 5641 configurable: true, 5642 get: function () { 5643 try { 5644 return regExpExec$1(nameRE, functionToString(this))[1]; 5645 } catch (error) { 5646 return ''; 5647 } 5648 } 5649 }); 5650 } 5651 5652 var arraySlice$4 = arraySliceSimple; 5653 5654 var floor$6 = Math.floor; 5655 5656 var mergeSort = function (array, comparefn) { 5657 var length = array.length; 5658 var middle = floor$6(length / 2); 5659 return length < 8 ? insertionSort(array, comparefn) : merge( 5660 array, 5661 mergeSort(arraySlice$4(array, 0, middle), comparefn), 5662 mergeSort(arraySlice$4(array, middle), comparefn), 5663 comparefn 5664 ); 5665 }; 5666 5667 var insertionSort = function (array, comparefn) { 5668 var length = array.length; 5669 var i = 1; 5670 var element, j; 5671 5672 while (i < length) { 5673 j = i; 5674 element = array[i]; 5675 while (j && comparefn(array[j - 1], element) > 0) { 5676 array[j] = array[--j]; 5677 } 5678 if (j !== i++) array[j] = element; 5679 } return array; 5680 }; 5681 5682 var merge = function (array, left, right, comparefn) { 5683 var llength = left.length; 5684 var rlength = right.length; 5685 var lindex = 0; 5686 var rindex = 0; 5687 5688 while (lindex < llength || rindex < rlength) { 5689 array[lindex + rindex] = (lindex < llength && rindex < rlength) 5690 ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] 5691 : lindex < llength ? left[lindex++] : right[rindex++]; 5692 } return array; 5693 }; 5694 5695 var arraySort$1 = mergeSort; 5696 5697 var userAgent$1 = engineUserAgent; 5698 5699 var firefox = userAgent$1.match(/firefox\/(\d+)/i); 5700 5701 var engineFfVersion = !!firefox && +firefox[1]; 5702 5703 var UA = engineUserAgent; 5704 5705 var engineIsIeOrEdge = /MSIE|Trident/.test(UA); 5706 5707 var userAgent = engineUserAgent; 5708 5709 var webkit = userAgent.match(/AppleWebKit\/(\d+)\./); 5710 5711 var engineWebkitVersion = !!webkit && +webkit[1]; 5712 5713 var $$8 = _export; 5714 var uncurryThis$c = functionUncurryThis; 5715 var aCallable$2 = aCallable$8; 5716 var toObject$5 = toObject$g; 5717 var lengthOfArrayLike$8 = lengthOfArrayLike$h; 5718 var toString$3 = toString$g; 5719 var fails$b = fails$I; 5720 var internalSort$1 = arraySort$1; 5721 var arrayMethodIsStrict$2 = arrayMethodIsStrict$4; 5722 var FF$1 = engineFfVersion; 5723 var IE_OR_EDGE$1 = engineIsIeOrEdge; 5724 var V8$1 = engineV8Version; 5725 var WEBKIT$1 = engineWebkitVersion; 5726 5727 var test = []; 5728 var un$Sort$1 = uncurryThis$c(test.sort); 5729 var push$3 = uncurryThis$c(test.push); 5730 5731 // IE8- 5732 var FAILS_ON_UNDEFINED = fails$b(function () { 5733 test.sort(undefined); 5734 }); 5735 // V8 bug 5736 var FAILS_ON_NULL = fails$b(function () { 5737 test.sort(null); 5738 }); 5739 // Old WebKit 5740 var STRICT_METHOD$2 = arrayMethodIsStrict$2('sort'); 5741 5742 var STABLE_SORT$1 = !fails$b(function () { 5743 // feature detection can be too slow, so check engines versions 5744 if (V8$1) return V8$1 < 70; 5745 if (FF$1 && FF$1 > 3) return; 5746 if (IE_OR_EDGE$1) return true; 5747 if (WEBKIT$1) return WEBKIT$1 < 603; 5748 5749 var result = ''; 5750 var code, chr, value, index; 5751 5752 // generate an array with more 512 elements (Chakra and old V8 fails only in this case) 5753 for (code = 65; code < 76; code++) { 5754 chr = String.fromCharCode(code); 5755 5756 switch (code) { 5757 case 66: case 69: case 70: case 72: value = 3; break; 5758 case 68: case 71: value = 4; break; 5759 default: value = 2; 5760 } 5761 5762 for (index = 0; index < 47; index++) { 5763 test.push({ k: chr + index, v: value }); 5764 } 5765 } 5766 5767 test.sort(function (a, b) { return b.v - a.v; }); 5768 5769 for (index = 0; index < test.length; index++) { 5770 chr = test[index].k.charAt(0); 5771 if (result.charAt(result.length - 1) !== chr) result += chr; 5772 } 5773 5774 return result !== 'DGBEFHACIJK'; 5775 }); 5776 5777 var FORCED$5 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$2 || !STABLE_SORT$1; 5778 5779 var getSortCompare$1 = function (comparefn) { 5780 return function (x, y) { 5781 if (y === undefined) return -1; 5782 if (x === undefined) return 1; 5783 if (comparefn !== undefined) return +comparefn(x, y) || 0; 5784 return toString$3(x) > toString$3(y) ? 1 : -1; 5785 }; 5786 }; 5787 5788 // `Array.prototype.sort` method 5789 // https://tc39.es/ecma262/#sec-array.prototype.sort 5790 $$8({ target: 'Array', proto: true, forced: FORCED$5 }, { 5791 sort: function sort(comparefn) { 5792 if (comparefn !== undefined) aCallable$2(comparefn); 5793 5794 var array = toObject$5(this); 5795 5796 if (STABLE_SORT$1) return comparefn === undefined ? un$Sort$1(array) : un$Sort$1(array, comparefn); 5797 5798 var items = []; 5799 var arrayLength = lengthOfArrayLike$8(array); 5800 var itemsLength, index; 5801 5802 for (index = 0; index < arrayLength; index++) { 5803 if (index in array) push$3(items, array[index]); 5804 } 5805 5806 internalSort$1(items, getSortCompare$1(comparefn)); 5807 5808 itemsLength = items.length; 5809 index = 0; 5810 5811 while (index < itemsLength) array[index] = items[index++]; 5812 while (index < arrayLength) delete array[index++]; 5813 5814 return array; 5815 } 5816 }); 5817 5818 var $$7 = _export; 5819 var uncurryThis$b = functionUncurryThis; 5820 var IndexedObject$1 = indexedObject; 5821 var toIndexedObject$1 = toIndexedObject$a; 5822 var arrayMethodIsStrict$1 = arrayMethodIsStrict$4; 5823 5824 var un$Join = uncurryThis$b([].join); 5825 5826 var ES3_STRINGS = IndexedObject$1 != Object; 5827 var STRICT_METHOD$1 = arrayMethodIsStrict$1('join', ','); 5828 5829 // `Array.prototype.join` method 5830 // https://tc39.es/ecma262/#sec-array.prototype.join 5831 $$7({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, { 5832 join: function join(separator) { 5833 return un$Join(toIndexedObject$1(this), separator === undefined ? ',' : separator); 5834 } 5835 }); 5836 5837 var call$4 = functionCall; 5838 var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic; 5839 var anObject$1 = anObject$p; 5840 var requireObjectCoercible$2 = requireObjectCoercible$d; 5841 var sameValue = sameValue$1; 5842 var toString$2 = toString$g; 5843 var getMethod = getMethod$7; 5844 var regExpExec = regexpExecAbstract; 5845 5846 // @@search logic 5847 fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) { 5848 return [ 5849 // `String.prototype.search` method 5850 // https://tc39.es/ecma262/#sec-string.prototype.search 5851 function search(regexp) { 5852 var O = requireObjectCoercible$2(this); 5853 var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH); 5854 return searcher ? call$4(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$2(O)); 5855 }, 5856 // `RegExp.prototype[@@search]` method 5857 // https://tc39.es/ecma262/#sec-regexp.prototype-@@search 5858 function (string) { 5859 var rx = anObject$1(this); 5860 var S = toString$2(string); 5861 var res = maybeCallNative(nativeSearch, rx, S); 5862 5863 if (res.done) return res.value; 5864 5865 var previousLastIndex = rx.lastIndex; 5866 if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; 5867 var result = regExpExec(rx, S); 5868 if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; 5869 return result === null ? -1 : result.index; 5870 } 5871 ]; 5872 }); 5873 5874 var global$j = global$1e; 5875 var toIntegerOrInfinity$6 = toIntegerOrInfinity$c; 5876 var toString$1 = toString$g; 5877 var requireObjectCoercible$1 = requireObjectCoercible$d; 5878 5879 var RangeError$8 = global$j.RangeError; 5880 5881 // `String.prototype.repeat` method implementation 5882 // https://tc39.es/ecma262/#sec-string.prototype.repeat 5883 var stringRepeat = function repeat(count) { 5884 var str = toString$1(requireObjectCoercible$1(this)); 5885 var result = ''; 5886 var n = toIntegerOrInfinity$6(count); 5887 if (n < 0 || n == Infinity) throw RangeError$8('Wrong number of repetitions'); 5888 for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; 5889 return result; 5890 }; 5891 5892 var $$6 = _export; 5893 var global$i = global$1e; 5894 var uncurryThis$a = functionUncurryThis; 5895 var toIntegerOrInfinity$5 = toIntegerOrInfinity$c; 5896 var thisNumberValue = thisNumberValue$2; 5897 var $repeat = stringRepeat; 5898 var fails$a = fails$I; 5899 5900 var RangeError$7 = global$i.RangeError; 5901 var String$1 = global$i.String; 5902 var floor$5 = Math.floor; 5903 var repeat = uncurryThis$a($repeat); 5904 var stringSlice$2 = uncurryThis$a(''.slice); 5905 var un$ToFixed = uncurryThis$a(1.0.toFixed); 5906 5907 var pow$2 = function (x, n, acc) { 5908 return n === 0 ? acc : n % 2 === 1 ? pow$2(x, n - 1, acc * x) : pow$2(x * x, n / 2, acc); 5909 }; 5910 5911 var log$1 = function (x) { 5912 var n = 0; 5913 var x2 = x; 5914 while (x2 >= 4096) { 5915 n += 12; 5916 x2 /= 4096; 5917 } 5918 while (x2 >= 2) { 5919 n += 1; 5920 x2 /= 2; 5921 } return n; 5922 }; 5923 5924 var multiply = function (data, n, c) { 5925 var index = -1; 5926 var c2 = c; 5927 while (++index < 6) { 5928 c2 += n * data[index]; 5929 data[index] = c2 % 1e7; 5930 c2 = floor$5(c2 / 1e7); 5931 } 5932 }; 5933 5934 var divide = function (data, n) { 5935 var index = 6; 5936 var c = 0; 5937 while (--index >= 0) { 5938 c += data[index]; 5939 data[index] = floor$5(c / n); 5940 c = (c % n) * 1e7; 5941 } 5942 }; 5943 5944 var dataToString = function (data) { 5945 var index = 6; 5946 var s = ''; 5947 while (--index >= 0) { 5948 if (s !== '' || index === 0 || data[index] !== 0) { 5949 var t = String$1(data[index]); 5950 s = s === '' ? t : s + repeat('0', 7 - t.length) + t; 5951 } 5952 } return s; 5953 }; 5954 5955 var FORCED$4 = fails$a(function () { 5956 return un$ToFixed(0.00008, 3) !== '0.000' || 5957 un$ToFixed(0.9, 0) !== '1' || 5958 un$ToFixed(1.255, 2) !== '1.25' || 5959 un$ToFixed(1000000000000000128.0, 0) !== '1000000000000000128'; 5960 }) || !fails$a(function () { 5961 // V8 ~ Android 4.3- 5962 un$ToFixed({}); 5963 }); 5964 5965 // `Number.prototype.toFixed` method 5966 // https://tc39.es/ecma262/#sec-number.prototype.tofixed 5967 $$6({ target: 'Number', proto: true, forced: FORCED$4 }, { 5968 toFixed: function toFixed(fractionDigits) { 5969 var number = thisNumberValue(this); 5970 var fractDigits = toIntegerOrInfinity$5(fractionDigits); 5971 var data = [0, 0, 0, 0, 0, 0]; 5972 var sign = ''; 5973 var result = '0'; 5974 var e, z, j, k; 5975 5976 // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation 5977 if (fractDigits < 0 || fractDigits > 20) throw RangeError$7('Incorrect fraction digits'); 5978 // eslint-disable-next-line no-self-compare -- NaN check 5979 if (number != number) return 'NaN'; 5980 if (number <= -1e21 || number >= 1e21) return String$1(number); 5981 if (number < 0) { 5982 sign = '-'; 5983 number = -number; 5984 } 5985 if (number > 1e-21) { 5986 e = log$1(number * pow$2(2, 69, 1)) - 69; 5987 z = e < 0 ? number * pow$2(2, -e, 1) : number / pow$2(2, e, 1); 5988 z *= 0x10000000000000; 5989 e = 52 - e; 5990 if (e > 0) { 5991 multiply(data, 0, z); 5992 j = fractDigits; 5993 while (j >= 7) { 5994 multiply(data, 1e7, 0); 5995 j -= 7; 5996 } 5997 multiply(data, pow$2(10, j, 1), 0); 5998 j = e - 1; 5999 while (j >= 23) { 6000 divide(data, 1 << 23); 6001 j -= 23; 6002 } 6003 divide(data, 1 << j); 6004 multiply(data, 1, 1); 6005 divide(data, 2); 6006 result = dataToString(data); 6007 } else { 6008 multiply(data, 0, z); 6009 multiply(data, 1 << -e, 0); 6010 result = dataToString(data) + repeat('0', fractDigits); 6011 } 6012 } 6013 if (fractDigits > 0) { 6014 k = result.length; 6015 result = sign + (k <= fractDigits 6016 ? '0.' + repeat('0', fractDigits - k) + result 6017 : stringSlice$2(result, 0, k - fractDigits) + '.' + stringSlice$2(result, k - fractDigits)); 6018 } else { 6019 result = sign + result; 6020 } return result; 6021 } 6022 }); 6023 6024 var $$5 = _export; 6025 var uncurryThis$9 = functionUncurryThis; 6026 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; 6027 var toLength$4 = toLength$a; 6028 var toString = toString$g; 6029 var notARegExp = notARegexp; 6030 var requireObjectCoercible = requireObjectCoercible$d; 6031 var correctIsRegExpLogic = correctIsRegexpLogic; 6032 6033 // eslint-disable-next-line es/no-string-prototype-endswith -- safe 6034 var un$EndsWith = uncurryThis$9(''.endsWith); 6035 var slice = uncurryThis$9(''.slice); 6036 var min$2 = Math.min; 6037 6038 var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); 6039 // https://github.com/zloirock/core-js/pull/702 6040 var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () { 6041 var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith'); 6042 return descriptor && !descriptor.writable; 6043 }(); 6044 6045 // `String.prototype.endsWith` method 6046 // https://tc39.es/ecma262/#sec-string.prototype.endswith 6047 $$5({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { 6048 endsWith: function endsWith(searchString /* , endPosition = @length */) { 6049 var that = toString(requireObjectCoercible(this)); 6050 notARegExp(searchString); 6051 var endPosition = arguments.length > 1 ? arguments[1] : undefined; 6052 var len = that.length; 6053 var end = endPosition === undefined ? len : min$2(toLength$4(endPosition), len); 6054 var search = toString(searchString); 6055 return un$EndsWith 6056 ? un$EndsWith(that, search, end) 6057 : slice(that, end - search.length, end) === search; 6058 } 6059 }); 6060 6061 var $$4 = _export; 6062 var $find$1 = arrayIteration.find; 6063 var addToUnscopables = addToUnscopables$4; 6064 6065 var FIND = 'find'; 6066 var SKIPS_HOLES = true; 6067 6068 // Shouldn't skip holes 6069 if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); 6070 6071 // `Array.prototype.find` method 6072 // https://tc39.es/ecma262/#sec-array.prototype.find 6073 $$4({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { 6074 find: function find(callbackfn /* , that = undefined */) { 6075 return $find$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 6076 } 6077 }); 6078 6079 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables 6080 addToUnscopables(FIND); 6081 6082 var $$3 = _export; 6083 var FREEZING = freezing; 6084 var fails$9 = fails$I; 6085 var isObject$6 = isObject$s; 6086 var onFreeze = internalMetadata.exports.onFreeze; 6087 6088 // eslint-disable-next-line es/no-object-freeze -- safe 6089 var $freeze = Object.freeze; 6090 var FAILS_ON_PRIMITIVES = fails$9(function () { $freeze(1); }); 6091 6092 // `Object.freeze` method 6093 // https://tc39.es/ecma262/#sec-object.freeze 6094 $$3({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, { 6095 freeze: function freeze(it) { 6096 return $freeze && isObject$6(it) ? $freeze(onFreeze(it)) : it; 6097 } 6098 }); 6099 6100 var fails$8 = fails$I; 6101 var wellKnownSymbol$3 = wellKnownSymbol$s; 6102 var IS_PURE = isPure; 6103 6104 var ITERATOR$2 = wellKnownSymbol$3('iterator'); 6105 6106 var nativeUrl = !fails$8(function () { 6107 var url = new URL('b?a=1&b=2&c=3', 'http://a'); 6108 var searchParams = url.searchParams; 6109 var result = ''; 6110 url.pathname = 'c%20d'; 6111 searchParams.forEach(function (value, key) { 6112 searchParams['delete']('b'); 6113 result += key + value; 6114 }); 6115 return (IS_PURE && !url.toJSON) 6116 || !searchParams.sort 6117 || url.href !== 'http://a/c%20d?a=1&c=3' 6118 || searchParams.get('c') !== '3' 6119 || String(new URLSearchParams('?a=1')) !== 'a=1' 6120 || !searchParams[ITERATOR$2] 6121 // throws in Edge 6122 || new URL('https://a@b').username !== 'a' 6123 || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' 6124 // not punycoded in Edge 6125 || new URL('http://тест').host !== 'xn--e1aybc' 6126 // not escaped in Chrome 62- 6127 || new URL('http://a#б').hash !== '#%D0%B1' 6128 // fails in Chrome 66- 6129 || result !== 'a1c3' 6130 // throws in Safari 6131 || new URL('http://x', undefined).host !== 'x'; 6132 }); 6133 6134 // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js 6135 var global$h = global$1e; 6136 var uncurryThis$8 = functionUncurryThis; 6137 6138 var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 6139 var base = 36; 6140 var tMin = 1; 6141 var tMax = 26; 6142 var skew = 38; 6143 var damp = 700; 6144 var initialBias = 72; 6145 var initialN = 128; // 0x80 6146 var delimiter = '-'; // '\x2D' 6147 var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars 6148 var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators 6149 var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; 6150 var baseMinusTMin = base - tMin; 6151 6152 var RangeError$6 = global$h.RangeError; 6153 var exec$1 = uncurryThis$8(regexSeparators.exec); 6154 var floor$4 = Math.floor; 6155 var fromCharCode = String.fromCharCode; 6156 var charCodeAt = uncurryThis$8(''.charCodeAt); 6157 var join$3 = uncurryThis$8([].join); 6158 var push$2 = uncurryThis$8([].push); 6159 var replace$2 = uncurryThis$8(''.replace); 6160 var split$2 = uncurryThis$8(''.split); 6161 var toLowerCase$1 = uncurryThis$8(''.toLowerCase); 6162 6163 /** 6164 * Creates an array containing the numeric code points of each Unicode 6165 * character in the string. While JavaScript uses UCS-2 internally, 6166 * this function will convert a pair of surrogate halves (each of which 6167 * UCS-2 exposes as separate characters) into a single code point, 6168 * matching UTF-16. 6169 */ 6170 var ucs2decode = function (string) { 6171 var output = []; 6172 var counter = 0; 6173 var length = string.length; 6174 while (counter < length) { 6175 var value = charCodeAt(string, counter++); 6176 if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 6177 // It's a high surrogate, and there is a next character. 6178 var extra = charCodeAt(string, counter++); 6179 if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. 6180 push$2(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); 6181 } else { 6182 // It's an unmatched surrogate; only append this code unit, in case the 6183 // next code unit is the high surrogate of a surrogate pair. 6184 push$2(output, value); 6185 counter--; 6186 } 6187 } else { 6188 push$2(output, value); 6189 } 6190 } 6191 return output; 6192 }; 6193 6194 /** 6195 * Converts a digit/integer into a basic code point. 6196 */ 6197 var digitToBasic = function (digit) { 6198 // 0..25 map to ASCII a..z or A..Z 6199 // 26..35 map to ASCII 0..9 6200 return digit + 22 + 75 * (digit < 26); 6201 }; 6202 6203 /** 6204 * Bias adaptation function as per section 3.4 of RFC 3492. 6205 * https://tools.ietf.org/html/rfc3492#section-3.4 6206 */ 6207 var adapt = function (delta, numPoints, firstTime) { 6208 var k = 0; 6209 delta = firstTime ? floor$4(delta / damp) : delta >> 1; 6210 delta += floor$4(delta / numPoints); 6211 while (delta > baseMinusTMin * tMax >> 1) { 6212 delta = floor$4(delta / baseMinusTMin); 6213 k += base; 6214 } 6215 return floor$4(k + (baseMinusTMin + 1) * delta / (delta + skew)); 6216 }; 6217 6218 /** 6219 * Converts a string of Unicode symbols (e.g. a domain name label) to a 6220 * Punycode string of ASCII-only symbols. 6221 */ 6222 var encode = function (input) { 6223 var output = []; 6224 6225 // Convert the input in UCS-2 to an array of Unicode code points. 6226 input = ucs2decode(input); 6227 6228 // Cache the length. 6229 var inputLength = input.length; 6230 6231 // Initialize the state. 6232 var n = initialN; 6233 var delta = 0; 6234 var bias = initialBias; 6235 var i, currentValue; 6236 6237 // Handle the basic code points. 6238 for (i = 0; i < input.length; i++) { 6239 currentValue = input[i]; 6240 if (currentValue < 0x80) { 6241 push$2(output, fromCharCode(currentValue)); 6242 } 6243 } 6244 6245 var basicLength = output.length; // number of basic code points. 6246 var handledCPCount = basicLength; // number of code points that have been handled; 6247 6248 // Finish the basic string with a delimiter unless it's empty. 6249 if (basicLength) { 6250 push$2(output, delimiter); 6251 } 6252 6253 // Main encoding loop: 6254 while (handledCPCount < inputLength) { 6255 // All non-basic code points < n have been handled already. Find the next larger one: 6256 var m = maxInt; 6257 for (i = 0; i < input.length; i++) { 6258 currentValue = input[i]; 6259 if (currentValue >= n && currentValue < m) { 6260 m = currentValue; 6261 } 6262 } 6263 6264 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow. 6265 var handledCPCountPlusOne = handledCPCount + 1; 6266 if (m - n > floor$4((maxInt - delta) / handledCPCountPlusOne)) { 6267 throw RangeError$6(OVERFLOW_ERROR); 6268 } 6269 6270 delta += (m - n) * handledCPCountPlusOne; 6271 n = m; 6272 6273 for (i = 0; i < input.length; i++) { 6274 currentValue = input[i]; 6275 if (currentValue < n && ++delta > maxInt) { 6276 throw RangeError$6(OVERFLOW_ERROR); 6277 } 6278 if (currentValue == n) { 6279 // Represent delta as a generalized variable-length integer. 6280 var q = delta; 6281 var k = base; 6282 while (true) { 6283 var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 6284 if (q < t) break; 6285 var qMinusT = q - t; 6286 var baseMinusT = base - t; 6287 push$2(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT))); 6288 q = floor$4(qMinusT / baseMinusT); 6289 k += base; 6290 } 6291 6292 push$2(output, fromCharCode(digitToBasic(q))); 6293 bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); 6294 delta = 0; 6295 handledCPCount++; 6296 } 6297 } 6298 6299 delta++; 6300 n++; 6301 } 6302 return join$3(output, ''); 6303 }; 6304 6305 var stringPunycodeToAscii = function (input) { 6306 var encoded = []; 6307 var labels = split$2(replace$2(toLowerCase$1(input), regexSeparators, '\u002E'), '.'); 6308 var i, label; 6309 for (i = 0; i < labels.length; i++) { 6310 label = labels[i]; 6311 push$2(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode(label) : label); 6312 } 6313 return join$3(encoded, '.'); 6314 }; 6315 6316 // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` 6317 6318 var $$2 = _export; 6319 var global$g = global$1e; 6320 var getBuiltIn = getBuiltIn$a; 6321 var call$3 = functionCall; 6322 var uncurryThis$7 = functionUncurryThis; 6323 var USE_NATIVE_URL$1 = nativeUrl; 6324 var redefine$2 = redefine$e.exports; 6325 var redefineAll$1 = redefineAll$6; 6326 var setToStringTag$2 = setToStringTag$9; 6327 var createIteratorConstructor = createIteratorConstructor$2; 6328 var InternalStateModule$3 = internalState; 6329 var anInstance$3 = anInstance$8; 6330 var isCallable$1 = isCallable$q; 6331 var hasOwn$4 = hasOwnProperty_1; 6332 var bind$2 = functionBindContext; 6333 var classof$2 = classof$d; 6334 var anObject = anObject$p; 6335 var isObject$5 = isObject$s; 6336 var $toString$1 = toString$g; 6337 var create$1 = objectCreate; 6338 var createPropertyDescriptor$1 = createPropertyDescriptor$8; 6339 var getIterator$1 = getIterator$4; 6340 var getIteratorMethod$1 = getIteratorMethod$5; 6341 var wellKnownSymbol$2 = wellKnownSymbol$s; 6342 var arraySort = arraySort$1; 6343 6344 var ITERATOR$1 = wellKnownSymbol$2('iterator'); 6345 var URL_SEARCH_PARAMS = 'URLSearchParams'; 6346 var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; 6347 var setInternalState$3 = InternalStateModule$3.set; 6348 var getInternalParamsState = InternalStateModule$3.getterFor(URL_SEARCH_PARAMS); 6349 var getInternalIteratorState = InternalStateModule$3.getterFor(URL_SEARCH_PARAMS_ITERATOR); 6350 6351 var n$Fetch = getBuiltIn('fetch'); 6352 var N$Request = getBuiltIn('Request'); 6353 var Headers = getBuiltIn('Headers'); 6354 var RequestPrototype = N$Request && N$Request.prototype; 6355 var HeadersPrototype = Headers && Headers.prototype; 6356 var RegExp$1 = global$g.RegExp; 6357 var TypeError$4 = global$g.TypeError; 6358 var decodeURIComponent = global$g.decodeURIComponent; 6359 var encodeURIComponent$1 = global$g.encodeURIComponent; 6360 var charAt$1 = uncurryThis$7(''.charAt); 6361 var join$2 = uncurryThis$7([].join); 6362 var push$1 = uncurryThis$7([].push); 6363 var replace$1 = uncurryThis$7(''.replace); 6364 var shift$1 = uncurryThis$7([].shift); 6365 var splice = uncurryThis$7([].splice); 6366 var split$1 = uncurryThis$7(''.split); 6367 var stringSlice$1 = uncurryThis$7(''.slice); 6368 6369 var plus = /\+/g; 6370 var sequences = Array(4); 6371 6372 var percentSequence = function (bytes) { 6373 return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp$1('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); 6374 }; 6375 6376 var percentDecode = function (sequence) { 6377 try { 6378 return decodeURIComponent(sequence); 6379 } catch (error) { 6380 return sequence; 6381 } 6382 }; 6383 6384 var deserialize = function (it) { 6385 var result = replace$1(it, plus, ' '); 6386 var bytes = 4; 6387 try { 6388 return decodeURIComponent(result); 6389 } catch (error) { 6390 while (bytes) { 6391 result = replace$1(result, percentSequence(bytes--), percentDecode); 6392 } 6393 return result; 6394 } 6395 }; 6396 6397 var find = /[!'()~]|%20/g; 6398 6399 var replacements = { 6400 '!': '%21', 6401 "'": '%27', 6402 '(': '%28', 6403 ')': '%29', 6404 '~': '%7E', 6405 '%20': '+' 6406 }; 6407 6408 var replacer$1 = function (match) { 6409 return replacements[match]; 6410 }; 6411 6412 var serialize = function (it) { 6413 return replace$1(encodeURIComponent$1(it), find, replacer$1); 6414 }; 6415 6416 var validateArgumentsLength = function (passed, required) { 6417 if (passed < required) throw TypeError$4('Not enough arguments'); 6418 }; 6419 6420 var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { 6421 setInternalState$3(this, { 6422 type: URL_SEARCH_PARAMS_ITERATOR, 6423 iterator: getIterator$1(getInternalParamsState(params).entries), 6424 kind: kind 6425 }); 6426 }, 'Iterator', function next() { 6427 var state = getInternalIteratorState(this); 6428 var kind = state.kind; 6429 var step = state.iterator.next(); 6430 var entry = step.value; 6431 if (!step.done) { 6432 step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value]; 6433 } return step; 6434 }, true); 6435 6436 var URLSearchParamsState = function (init) { 6437 this.entries = []; 6438 this.url = null; 6439 6440 if (init !== undefined) { 6441 if (isObject$5(init)) this.parseObject(init); 6442 else this.parseQuery(typeof init == 'string' ? charAt$1(init, 0) === '?' ? stringSlice$1(init, 1) : init : $toString$1(init)); 6443 } 6444 }; 6445 6446 URLSearchParamsState.prototype = { 6447 type: URL_SEARCH_PARAMS, 6448 bindURL: function (url) { 6449 this.url = url; 6450 this.update(); 6451 }, 6452 parseObject: function (object) { 6453 var iteratorMethod = getIteratorMethod$1(object); 6454 var iterator, next, step, entryIterator, entryNext, first, second; 6455 6456 if (iteratorMethod) { 6457 iterator = getIterator$1(object, iteratorMethod); 6458 next = iterator.next; 6459 while (!(step = call$3(next, iterator)).done) { 6460 entryIterator = getIterator$1(anObject(step.value)); 6461 entryNext = entryIterator.next; 6462 if ( 6463 (first = call$3(entryNext, entryIterator)).done || 6464 (second = call$3(entryNext, entryIterator)).done || 6465 !call$3(entryNext, entryIterator).done 6466 ) throw TypeError$4('Expected sequence with length 2'); 6467 push$1(this.entries, { key: $toString$1(first.value), value: $toString$1(second.value) }); 6468 } 6469 } else for (var key in object) if (hasOwn$4(object, key)) { 6470 push$1(this.entries, { key: key, value: $toString$1(object[key]) }); 6471 } 6472 }, 6473 parseQuery: function (query) { 6474 if (query) { 6475 var attributes = split$1(query, '&'); 6476 var index = 0; 6477 var attribute, entry; 6478 while (index < attributes.length) { 6479 attribute = attributes[index++]; 6480 if (attribute.length) { 6481 entry = split$1(attribute, '='); 6482 push$1(this.entries, { 6483 key: deserialize(shift$1(entry)), 6484 value: deserialize(join$2(entry, '=')) 6485 }); 6486 } 6487 } 6488 } 6489 }, 6490 serialize: function () { 6491 var entries = this.entries; 6492 var result = []; 6493 var index = 0; 6494 var entry; 6495 while (index < entries.length) { 6496 entry = entries[index++]; 6497 push$1(result, serialize(entry.key) + '=' + serialize(entry.value)); 6498 } return join$2(result, '&'); 6499 }, 6500 update: function () { 6501 this.entries.length = 0; 6502 this.parseQuery(this.url.query); 6503 }, 6504 updateURL: function () { 6505 if (this.url) this.url.update(); 6506 } 6507 }; 6508 6509 // `URLSearchParams` constructor 6510 // https://url.spec.whatwg.org/#interface-urlsearchparams 6511 var URLSearchParamsConstructor = function URLSearchParams(/* init */) { 6512 anInstance$3(this, URLSearchParamsPrototype); 6513 var init = arguments.length > 0 ? arguments[0] : undefined; 6514 setInternalState$3(this, new URLSearchParamsState(init)); 6515 }; 6516 6517 var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; 6518 6519 redefineAll$1(URLSearchParamsPrototype, { 6520 // `URLSearchParams.prototype.append` method 6521 // https://url.spec.whatwg.org/#dom-urlsearchparams-append 6522 append: function append(name, value) { 6523 validateArgumentsLength(arguments.length, 2); 6524 var state = getInternalParamsState(this); 6525 push$1(state.entries, { key: $toString$1(name), value: $toString$1(value) }); 6526 state.updateURL(); 6527 }, 6528 // `URLSearchParams.prototype.delete` method 6529 // https://url.spec.whatwg.org/#dom-urlsearchparams-delete 6530 'delete': function (name) { 6531 validateArgumentsLength(arguments.length, 1); 6532 var state = getInternalParamsState(this); 6533 var entries = state.entries; 6534 var key = $toString$1(name); 6535 var index = 0; 6536 while (index < entries.length) { 6537 if (entries[index].key === key) splice(entries, index, 1); 6538 else index++; 6539 } 6540 state.updateURL(); 6541 }, 6542 // `URLSearchParams.prototype.get` method 6543 // https://url.spec.whatwg.org/#dom-urlsearchparams-get 6544 get: function get(name) { 6545 validateArgumentsLength(arguments.length, 1); 6546 var entries = getInternalParamsState(this).entries; 6547 var key = $toString$1(name); 6548 var index = 0; 6549 for (; index < entries.length; index++) { 6550 if (entries[index].key === key) return entries[index].value; 6551 } 6552 return null; 6553 }, 6554 // `URLSearchParams.prototype.getAll` method 6555 // https://url.spec.whatwg.org/#dom-urlsearchparams-getall 6556 getAll: function getAll(name) { 6557 validateArgumentsLength(arguments.length, 1); 6558 var entries = getInternalParamsState(this).entries; 6559 var key = $toString$1(name); 6560 var result = []; 6561 var index = 0; 6562 for (; index < entries.length; index++) { 6563 if (entries[index].key === key) push$1(result, entries[index].value); 6564 } 6565 return result; 6566 }, 6567 // `URLSearchParams.prototype.has` method 6568 // https://url.spec.whatwg.org/#dom-urlsearchparams-has 6569 has: function has(name) { 6570 validateArgumentsLength(arguments.length, 1); 6571 var entries = getInternalParamsState(this).entries; 6572 var key = $toString$1(name); 6573 var index = 0; 6574 while (index < entries.length) { 6575 if (entries[index++].key === key) return true; 6576 } 6577 return false; 6578 }, 6579 // `URLSearchParams.prototype.set` method 6580 // https://url.spec.whatwg.org/#dom-urlsearchparams-set 6581 set: function set(name, value) { 6582 validateArgumentsLength(arguments.length, 1); 6583 var state = getInternalParamsState(this); 6584 var entries = state.entries; 6585 var found = false; 6586 var key = $toString$1(name); 6587 var val = $toString$1(value); 6588 var index = 0; 6589 var entry; 6590 for (; index < entries.length; index++) { 6591 entry = entries[index]; 6592 if (entry.key === key) { 6593 if (found) splice(entries, index--, 1); 6594 else { 6595 found = true; 6596 entry.value = val; 6597 } 6598 } 6599 } 6600 if (!found) push$1(entries, { key: key, value: val }); 6601 state.updateURL(); 6602 }, 6603 // `URLSearchParams.prototype.sort` method 6604 // https://url.spec.whatwg.org/#dom-urlsearchparams-sort 6605 sort: function sort() { 6606 var state = getInternalParamsState(this); 6607 arraySort(state.entries, function (a, b) { 6608 return a.key > b.key ? 1 : -1; 6609 }); 6610 state.updateURL(); 6611 }, 6612 // `URLSearchParams.prototype.forEach` method 6613 forEach: function forEach(callback /* , thisArg */) { 6614 var entries = getInternalParamsState(this).entries; 6615 var boundFunction = bind$2(callback, arguments.length > 1 ? arguments[1] : undefined); 6616 var index = 0; 6617 var entry; 6618 while (index < entries.length) { 6619 entry = entries[index++]; 6620 boundFunction(entry.value, entry.key, this); 6621 } 6622 }, 6623 // `URLSearchParams.prototype.keys` method 6624 keys: function keys() { 6625 return new URLSearchParamsIterator(this, 'keys'); 6626 }, 6627 // `URLSearchParams.prototype.values` method 6628 values: function values() { 6629 return new URLSearchParamsIterator(this, 'values'); 6630 }, 6631 // `URLSearchParams.prototype.entries` method 6632 entries: function entries() { 6633 return new URLSearchParamsIterator(this, 'entries'); 6634 } 6635 }, { enumerable: true }); 6636 6637 // `URLSearchParams.prototype[@@iterator]` method 6638 redefine$2(URLSearchParamsPrototype, ITERATOR$1, URLSearchParamsPrototype.entries, { name: 'entries' }); 6639 6640 // `URLSearchParams.prototype.toString` method 6641 // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior 6642 redefine$2(URLSearchParamsPrototype, 'toString', function toString() { 6643 return getInternalParamsState(this).serialize(); 6644 }, { enumerable: true }); 6645 6646 setToStringTag$2(URLSearchParamsConstructor, URL_SEARCH_PARAMS); 6647 6648 $$2({ global: true, forced: !USE_NATIVE_URL$1 }, { 6649 URLSearchParams: URLSearchParamsConstructor 6650 }); 6651 6652 // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams` 6653 if (!USE_NATIVE_URL$1 && isCallable$1(Headers)) { 6654 var headersHas = uncurryThis$7(HeadersPrototype.has); 6655 var headersSet = uncurryThis$7(HeadersPrototype.set); 6656 6657 var wrapRequestOptions = function (init) { 6658 if (isObject$5(init)) { 6659 var body = init.body; 6660 var headers; 6661 if (classof$2(body) === URL_SEARCH_PARAMS) { 6662 headers = init.headers ? new Headers(init.headers) : new Headers(); 6663 if (!headersHas(headers, 'content-type')) { 6664 headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); 6665 } 6666 return create$1(init, { 6667 body: createPropertyDescriptor$1(0, $toString$1(body)), 6668 headers: createPropertyDescriptor$1(0, headers) 6669 }); 6670 } 6671 } return init; 6672 }; 6673 6674 if (isCallable$1(n$Fetch)) { 6675 $$2({ global: true, enumerable: true, forced: true }, { 6676 fetch: function fetch(input /* , init */) { 6677 return n$Fetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); 6678 } 6679 }); 6680 } 6681 6682 if (isCallable$1(N$Request)) { 6683 var RequestConstructor = function Request(input /* , init */) { 6684 anInstance$3(this, RequestPrototype); 6685 return new N$Request(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); 6686 }; 6687 6688 RequestPrototype.constructor = RequestConstructor; 6689 RequestConstructor.prototype = RequestPrototype; 6690 6691 $$2({ global: true, forced: true }, { 6692 Request: RequestConstructor 6693 }); 6694 } 6695 } 6696 6697 var web_urlSearchParams = { 6698 URLSearchParams: URLSearchParamsConstructor, 6699 getState: getInternalParamsState 6700 }; 6701 6702 // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` 6703 6704 var $$1 = _export; 6705 var DESCRIPTORS$3 = descriptors; 6706 var USE_NATIVE_URL = nativeUrl; 6707 var global$f = global$1e; 6708 var bind$1 = functionBindContext; 6709 var uncurryThis$6 = functionUncurryThis; 6710 var defineProperties = objectDefineProperties; 6711 var redefine$1 = redefine$e.exports; 6712 var anInstance$2 = anInstance$8; 6713 var hasOwn$3 = hasOwnProperty_1; 6714 var assign = objectAssign; 6715 var arrayFrom = arrayFrom$1; 6716 var arraySlice$3 = arraySliceSimple; 6717 var codeAt = stringMultibyte.codeAt; 6718 var toASCII = stringPunycodeToAscii; 6719 var $toString = toString$g; 6720 var setToStringTag$1 = setToStringTag$9; 6721 var URLSearchParamsModule = web_urlSearchParams; 6722 var InternalStateModule$2 = internalState; 6723 6724 var setInternalState$2 = InternalStateModule$2.set; 6725 var getInternalURLState = InternalStateModule$2.getterFor('URL'); 6726 var URLSearchParams$1 = URLSearchParamsModule.URLSearchParams; 6727 var getInternalSearchParamsState = URLSearchParamsModule.getState; 6728 6729 var NativeURL = global$f.URL; 6730 var TypeError$3 = global$f.TypeError; 6731 var parseInt$1 = global$f.parseInt; 6732 var floor$3 = Math.floor; 6733 var pow$1 = Math.pow; 6734 var charAt = uncurryThis$6(''.charAt); 6735 var exec = uncurryThis$6(/./.exec); 6736 var join$1 = uncurryThis$6([].join); 6737 var numberToString = uncurryThis$6(1.0.toString); 6738 var pop = uncurryThis$6([].pop); 6739 var push = uncurryThis$6([].push); 6740 var replace = uncurryThis$6(''.replace); 6741 var shift = uncurryThis$6([].shift); 6742 var split = uncurryThis$6(''.split); 6743 var stringSlice = uncurryThis$6(''.slice); 6744 var toLowerCase = uncurryThis$6(''.toLowerCase); 6745 var unshift = uncurryThis$6([].unshift); 6746 6747 var INVALID_AUTHORITY = 'Invalid authority'; 6748 var INVALID_SCHEME = 'Invalid scheme'; 6749 var INVALID_HOST = 'Invalid host'; 6750 var INVALID_PORT = 'Invalid port'; 6751 6752 var ALPHA = /[a-z]/i; 6753 // eslint-disable-next-line regexp/no-obscure-range -- safe 6754 var ALPHANUMERIC = /[\d+-.a-z]/i; 6755 var DIGIT = /\d/; 6756 var HEX_START = /^0x/i; 6757 var OCT = /^[0-7]+$/; 6758 var DEC = /^\d+$/; 6759 var HEX = /^[\da-f]+$/i; 6760 /* eslint-disable regexp/no-control-character -- safe */ 6761 var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/; 6762 var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/; 6763 var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g; 6764 var TAB_AND_NEW_LINE = /[\t\n\r]/g; 6765 /* eslint-enable regexp/no-control-character -- safe */ 6766 var EOF; 6767 6768 // https://url.spec.whatwg.org/#ipv4-number-parser 6769 var parseIPv4 = function (input) { 6770 var parts = split(input, '.'); 6771 var partsLength, numbers, index, part, radix, number, ipv4; 6772 if (parts.length && parts[parts.length - 1] == '') { 6773 parts.length--; 6774 } 6775 partsLength = parts.length; 6776 if (partsLength > 4) return input; 6777 numbers = []; 6778 for (index = 0; index < partsLength; index++) { 6779 part = parts[index]; 6780 if (part == '') return input; 6781 radix = 10; 6782 if (part.length > 1 && charAt(part, 0) == '0') { 6783 radix = exec(HEX_START, part) ? 16 : 8; 6784 part = stringSlice(part, radix == 8 ? 1 : 2); 6785 } 6786 if (part === '') { 6787 number = 0; 6788 } else { 6789 if (!exec(radix == 10 ? DEC : radix == 8 ? OCT : HEX, part)) return input; 6790 number = parseInt$1(part, radix); 6791 } 6792 push(numbers, number); 6793 } 6794 for (index = 0; index < partsLength; index++) { 6795 number = numbers[index]; 6796 if (index == partsLength - 1) { 6797 if (number >= pow$1(256, 5 - partsLength)) return null; 6798 } else if (number > 255) return null; 6799 } 6800 ipv4 = pop(numbers); 6801 for (index = 0; index < numbers.length; index++) { 6802 ipv4 += numbers[index] * pow$1(256, 3 - index); 6803 } 6804 return ipv4; 6805 }; 6806 6807 // https://url.spec.whatwg.org/#concept-ipv6-parser 6808 // eslint-disable-next-line max-statements -- TODO 6809 var parseIPv6 = function (input) { 6810 var address = [0, 0, 0, 0, 0, 0, 0, 0]; 6811 var pieceIndex = 0; 6812 var compress = null; 6813 var pointer = 0; 6814 var value, length, numbersSeen, ipv4Piece, number, swaps, swap; 6815 6816 var chr = function () { 6817 return charAt(input, pointer); 6818 }; 6819 6820 if (chr() == ':') { 6821 if (charAt(input, 1) != ':') return; 6822 pointer += 2; 6823 pieceIndex++; 6824 compress = pieceIndex; 6825 } 6826 while (chr()) { 6827 if (pieceIndex == 8) return; 6828 if (chr() == ':') { 6829 if (compress !== null) return; 6830 pointer++; 6831 pieceIndex++; 6832 compress = pieceIndex; 6833 continue; 6834 } 6835 value = length = 0; 6836 while (length < 4 && exec(HEX, chr())) { 6837 value = value * 16 + parseInt$1(chr(), 16); 6838 pointer++; 6839 length++; 6840 } 6841 if (chr() == '.') { 6842 if (length == 0) return; 6843 pointer -= length; 6844 if (pieceIndex > 6) return; 6845 numbersSeen = 0; 6846 while (chr()) { 6847 ipv4Piece = null; 6848 if (numbersSeen > 0) { 6849 if (chr() == '.' && numbersSeen < 4) pointer++; 6850 else return; 6851 } 6852 if (!exec(DIGIT, chr())) return; 6853 while (exec(DIGIT, chr())) { 6854 number = parseInt$1(chr(), 10); 6855 if (ipv4Piece === null) ipv4Piece = number; 6856 else if (ipv4Piece == 0) return; 6857 else ipv4Piece = ipv4Piece * 10 + number; 6858 if (ipv4Piece > 255) return; 6859 pointer++; 6860 } 6861 address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; 6862 numbersSeen++; 6863 if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; 6864 } 6865 if (numbersSeen != 4) return; 6866 break; 6867 } else if (chr() == ':') { 6868 pointer++; 6869 if (!chr()) return; 6870 } else if (chr()) return; 6871 address[pieceIndex++] = value; 6872 } 6873 if (compress !== null) { 6874 swaps = pieceIndex - compress; 6875 pieceIndex = 7; 6876 while (pieceIndex != 0 && swaps > 0) { 6877 swap = address[pieceIndex]; 6878 address[pieceIndex--] = address[compress + swaps - 1]; 6879 address[compress + --swaps] = swap; 6880 } 6881 } else if (pieceIndex != 8) return; 6882 return address; 6883 }; 6884 6885 var findLongestZeroSequence = function (ipv6) { 6886 var maxIndex = null; 6887 var maxLength = 1; 6888 var currStart = null; 6889 var currLength = 0; 6890 var index = 0; 6891 for (; index < 8; index++) { 6892 if (ipv6[index] !== 0) { 6893 if (currLength > maxLength) { 6894 maxIndex = currStart; 6895 maxLength = currLength; 6896 } 6897 currStart = null; 6898 currLength = 0; 6899 } else { 6900 if (currStart === null) currStart = index; 6901 ++currLength; 6902 } 6903 } 6904 if (currLength > maxLength) { 6905 maxIndex = currStart; 6906 maxLength = currLength; 6907 } 6908 return maxIndex; 6909 }; 6910 6911 // https://url.spec.whatwg.org/#host-serializing 6912 var serializeHost = function (host) { 6913 var result, index, compress, ignore0; 6914 // ipv4 6915 if (typeof host == 'number') { 6916 result = []; 6917 for (index = 0; index < 4; index++) { 6918 unshift(result, host % 256); 6919 host = floor$3(host / 256); 6920 } return join$1(result, '.'); 6921 // ipv6 6922 } else if (typeof host == 'object') { 6923 result = ''; 6924 compress = findLongestZeroSequence(host); 6925 for (index = 0; index < 8; index++) { 6926 if (ignore0 && host[index] === 0) continue; 6927 if (ignore0) ignore0 = false; 6928 if (compress === index) { 6929 result += index ? ':' : '::'; 6930 ignore0 = true; 6931 } else { 6932 result += numberToString(host[index], 16); 6933 if (index < 7) result += ':'; 6934 } 6935 } 6936 return '[' + result + ']'; 6937 } return host; 6938 }; 6939 6940 var C0ControlPercentEncodeSet = {}; 6941 var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { 6942 ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 6943 }); 6944 var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { 6945 '#': 1, '?': 1, '{': 1, '}': 1 6946 }); 6947 var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { 6948 '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1 6949 }); 6950 6951 var percentEncode = function (chr, set) { 6952 var code = codeAt(chr, 0); 6953 return code > 0x20 && code < 0x7F && !hasOwn$3(set, chr) ? chr : encodeURIComponent(chr); 6954 }; 6955 6956 // https://url.spec.whatwg.org/#special-scheme 6957 var specialSchemes = { 6958 ftp: 21, 6959 file: null, 6960 http: 80, 6961 https: 443, 6962 ws: 80, 6963 wss: 443 6964 }; 6965 6966 // https://url.spec.whatwg.org/#windows-drive-letter 6967 var isWindowsDriveLetter = function (string, normalized) { 6968 var second; 6969 return string.length == 2 && exec(ALPHA, charAt(string, 0)) 6970 && ((second = charAt(string, 1)) == ':' || (!normalized && second == '|')); 6971 }; 6972 6973 // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter 6974 var startsWithWindowsDriveLetter = function (string) { 6975 var third; 6976 return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && ( 6977 string.length == 2 || 6978 ((third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#') 6979 ); 6980 }; 6981 6982 // https://url.spec.whatwg.org/#single-dot-path-segment 6983 var isSingleDot = function (segment) { 6984 return segment === '.' || toLowerCase(segment) === '%2e'; 6985 }; 6986 6987 // https://url.spec.whatwg.org/#double-dot-path-segment 6988 var isDoubleDot = function (segment) { 6989 segment = toLowerCase(segment); 6990 return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; 6991 }; 6992 6993 // States: 6994 var SCHEME_START = {}; 6995 var SCHEME = {}; 6996 var NO_SCHEME = {}; 6997 var SPECIAL_RELATIVE_OR_AUTHORITY = {}; 6998 var PATH_OR_AUTHORITY = {}; 6999 var RELATIVE = {}; 7000 var RELATIVE_SLASH = {}; 7001 var SPECIAL_AUTHORITY_SLASHES = {}; 7002 var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; 7003 var AUTHORITY = {}; 7004 var HOST = {}; 7005 var HOSTNAME = {}; 7006 var PORT = {}; 7007 var FILE = {}; 7008 var FILE_SLASH = {}; 7009 var FILE_HOST = {}; 7010 var PATH_START = {}; 7011 var PATH = {}; 7012 var CANNOT_BE_A_BASE_URL_PATH = {}; 7013 var QUERY = {}; 7014 var FRAGMENT = {}; 7015 7016 var URLState = function (url, isBase, base) { 7017 var urlString = $toString(url); 7018 var baseState, failure, searchParams; 7019 if (isBase) { 7020 failure = this.parse(urlString); 7021 if (failure) throw TypeError$3(failure); 7022 this.searchParams = null; 7023 } else { 7024 if (base !== undefined) baseState = new URLState(base, true); 7025 failure = this.parse(urlString, null, baseState); 7026 if (failure) throw TypeError$3(failure); 7027 searchParams = getInternalSearchParamsState(new URLSearchParams$1()); 7028 searchParams.bindURL(this); 7029 this.searchParams = searchParams; 7030 } 7031 }; 7032 7033 URLState.prototype = { 7034 type: 'URL', 7035 // https://url.spec.whatwg.org/#url-parsing 7036 // eslint-disable-next-line max-statements -- TODO 7037 parse: function (input, stateOverride, base) { 7038 var url = this; 7039 var state = stateOverride || SCHEME_START; 7040 var pointer = 0; 7041 var buffer = ''; 7042 var seenAt = false; 7043 var seenBracket = false; 7044 var seenPasswordToken = false; 7045 var codePoints, chr, bufferCodePoints, failure; 7046 7047 input = $toString(input); 7048 7049 if (!stateOverride) { 7050 url.scheme = ''; 7051 url.username = ''; 7052 url.password = ''; 7053 url.host = null; 7054 url.port = null; 7055 url.path = []; 7056 url.query = null; 7057 url.fragment = null; 7058 url.cannotBeABaseURL = false; 7059 input = replace(input, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); 7060 } 7061 7062 input = replace(input, TAB_AND_NEW_LINE, ''); 7063 7064 codePoints = arrayFrom(input); 7065 7066 while (pointer <= codePoints.length) { 7067 chr = codePoints[pointer]; 7068 switch (state) { 7069 case SCHEME_START: 7070 if (chr && exec(ALPHA, chr)) { 7071 buffer += toLowerCase(chr); 7072 state = SCHEME; 7073 } else if (!stateOverride) { 7074 state = NO_SCHEME; 7075 continue; 7076 } else return INVALID_SCHEME; 7077 break; 7078 7079 case SCHEME: 7080 if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) { 7081 buffer += toLowerCase(chr); 7082 } else if (chr == ':') { 7083 if (stateOverride && ( 7084 (url.isSpecial() != hasOwn$3(specialSchemes, buffer)) || 7085 (buffer == 'file' && (url.includesCredentials() || url.port !== null)) || 7086 (url.scheme == 'file' && !url.host) 7087 )) return; 7088 url.scheme = buffer; 7089 if (stateOverride) { 7090 if (url.isSpecial() && specialSchemes[url.scheme] == url.port) url.port = null; 7091 return; 7092 } 7093 buffer = ''; 7094 if (url.scheme == 'file') { 7095 state = FILE; 7096 } else if (url.isSpecial() && base && base.scheme == url.scheme) { 7097 state = SPECIAL_RELATIVE_OR_AUTHORITY; 7098 } else if (url.isSpecial()) { 7099 state = SPECIAL_AUTHORITY_SLASHES; 7100 } else if (codePoints[pointer + 1] == '/') { 7101 state = PATH_OR_AUTHORITY; 7102 pointer++; 7103 } else { 7104 url.cannotBeABaseURL = true; 7105 push(url.path, ''); 7106 state = CANNOT_BE_A_BASE_URL_PATH; 7107 } 7108 } else if (!stateOverride) { 7109 buffer = ''; 7110 state = NO_SCHEME; 7111 pointer = 0; 7112 continue; 7113 } else return INVALID_SCHEME; 7114 break; 7115 7116 case NO_SCHEME: 7117 if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME; 7118 if (base.cannotBeABaseURL && chr == '#') { 7119 url.scheme = base.scheme; 7120 url.path = arraySlice$3(base.path); 7121 url.query = base.query; 7122 url.fragment = ''; 7123 url.cannotBeABaseURL = true; 7124 state = FRAGMENT; 7125 break; 7126 } 7127 state = base.scheme == 'file' ? FILE : RELATIVE; 7128 continue; 7129 7130 case SPECIAL_RELATIVE_OR_AUTHORITY: 7131 if (chr == '/' && codePoints[pointer + 1] == '/') { 7132 state = SPECIAL_AUTHORITY_IGNORE_SLASHES; 7133 pointer++; 7134 } else { 7135 state = RELATIVE; 7136 continue; 7137 } break; 7138 7139 case PATH_OR_AUTHORITY: 7140 if (chr == '/') { 7141 state = AUTHORITY; 7142 break; 7143 } else { 7144 state = PATH; 7145 continue; 7146 } 7147 7148 case RELATIVE: 7149 url.scheme = base.scheme; 7150 if (chr == EOF) { 7151 url.username = base.username; 7152 url.password = base.password; 7153 url.host = base.host; 7154 url.port = base.port; 7155 url.path = arraySlice$3(base.path); 7156 url.query = base.query; 7157 } else if (chr == '/' || (chr == '\\' && url.isSpecial())) { 7158 state = RELATIVE_SLASH; 7159 } else if (chr == '?') { 7160 url.username = base.username; 7161 url.password = base.password; 7162 url.host = base.host; 7163 url.port = base.port; 7164 url.path = arraySlice$3(base.path); 7165 url.query = ''; 7166 state = QUERY; 7167 } else if (chr == '#') { 7168 url.username = base.username; 7169 url.password = base.password; 7170 url.host = base.host; 7171 url.port = base.port; 7172 url.path = arraySlice$3(base.path); 7173 url.query = base.query; 7174 url.fragment = ''; 7175 state = FRAGMENT; 7176 } else { 7177 url.username = base.username; 7178 url.password = base.password; 7179 url.host = base.host; 7180 url.port = base.port; 7181 url.path = arraySlice$3(base.path); 7182 url.path.length--; 7183 state = PATH; 7184 continue; 7185 } break; 7186 7187 case RELATIVE_SLASH: 7188 if (url.isSpecial() && (chr == '/' || chr == '\\')) { 7189 state = SPECIAL_AUTHORITY_IGNORE_SLASHES; 7190 } else if (chr == '/') { 7191 state = AUTHORITY; 7192 } else { 7193 url.username = base.username; 7194 url.password = base.password; 7195 url.host = base.host; 7196 url.port = base.port; 7197 state = PATH; 7198 continue; 7199 } break; 7200 7201 case SPECIAL_AUTHORITY_SLASHES: 7202 state = SPECIAL_AUTHORITY_IGNORE_SLASHES; 7203 if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue; 7204 pointer++; 7205 break; 7206 7207 case SPECIAL_AUTHORITY_IGNORE_SLASHES: 7208 if (chr != '/' && chr != '\\') { 7209 state = AUTHORITY; 7210 continue; 7211 } break; 7212 7213 case AUTHORITY: 7214 if (chr == '@') { 7215 if (seenAt) buffer = '%40' + buffer; 7216 seenAt = true; 7217 bufferCodePoints = arrayFrom(buffer); 7218 for (var i = 0; i < bufferCodePoints.length; i++) { 7219 var codePoint = bufferCodePoints[i]; 7220 if (codePoint == ':' && !seenPasswordToken) { 7221 seenPasswordToken = true; 7222 continue; 7223 } 7224 var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); 7225 if (seenPasswordToken) url.password += encodedCodePoints; 7226 else url.username += encodedCodePoints; 7227 } 7228 buffer = ''; 7229 } else if ( 7230 chr == EOF || chr == '/' || chr == '?' || chr == '#' || 7231 (chr == '\\' && url.isSpecial()) 7232 ) { 7233 if (seenAt && buffer == '') return INVALID_AUTHORITY; 7234 pointer -= arrayFrom(buffer).length + 1; 7235 buffer = ''; 7236 state = HOST; 7237 } else buffer += chr; 7238 break; 7239 7240 case HOST: 7241 case HOSTNAME: 7242 if (stateOverride && url.scheme == 'file') { 7243 state = FILE_HOST; 7244 continue; 7245 } else if (chr == ':' && !seenBracket) { 7246 if (buffer == '') return INVALID_HOST; 7247 failure = url.parseHost(buffer); 7248 if (failure) return failure; 7249 buffer = ''; 7250 state = PORT; 7251 if (stateOverride == HOSTNAME) return; 7252 } else if ( 7253 chr == EOF || chr == '/' || chr == '?' || chr == '#' || 7254 (chr == '\\' && url.isSpecial()) 7255 ) { 7256 if (url.isSpecial() && buffer == '') return INVALID_HOST; 7257 if (stateOverride && buffer == '' && (url.includesCredentials() || url.port !== null)) return; 7258 failure = url.parseHost(buffer); 7259 if (failure) return failure; 7260 buffer = ''; 7261 state = PATH_START; 7262 if (stateOverride) return; 7263 continue; 7264 } else { 7265 if (chr == '[') seenBracket = true; 7266 else if (chr == ']') seenBracket = false; 7267 buffer += chr; 7268 } break; 7269 7270 case PORT: 7271 if (exec(DIGIT, chr)) { 7272 buffer += chr; 7273 } else if ( 7274 chr == EOF || chr == '/' || chr == '?' || chr == '#' || 7275 (chr == '\\' && url.isSpecial()) || 7276 stateOverride 7277 ) { 7278 if (buffer != '') { 7279 var port = parseInt$1(buffer, 10); 7280 if (port > 0xFFFF) return INVALID_PORT; 7281 url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port; 7282 buffer = ''; 7283 } 7284 if (stateOverride) return; 7285 state = PATH_START; 7286 continue; 7287 } else return INVALID_PORT; 7288 break; 7289 7290 case FILE: 7291 url.scheme = 'file'; 7292 if (chr == '/' || chr == '\\') state = FILE_SLASH; 7293 else if (base && base.scheme == 'file') { 7294 if (chr == EOF) { 7295 url.host = base.host; 7296 url.path = arraySlice$3(base.path); 7297 url.query = base.query; 7298 } else if (chr == '?') { 7299 url.host = base.host; 7300 url.path = arraySlice$3(base.path); 7301 url.query = ''; 7302 state = QUERY; 7303 } else if (chr == '#') { 7304 url.host = base.host; 7305 url.path = arraySlice$3(base.path); 7306 url.query = base.query; 7307 url.fragment = ''; 7308 state = FRAGMENT; 7309 } else { 7310 if (!startsWithWindowsDriveLetter(join$1(arraySlice$3(codePoints, pointer), ''))) { 7311 url.host = base.host; 7312 url.path = arraySlice$3(base.path); 7313 url.shortenPath(); 7314 } 7315 state = PATH; 7316 continue; 7317 } 7318 } else { 7319 state = PATH; 7320 continue; 7321 } break; 7322 7323 case FILE_SLASH: 7324 if (chr == '/' || chr == '\\') { 7325 state = FILE_HOST; 7326 break; 7327 } 7328 if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join$1(arraySlice$3(codePoints, pointer), ''))) { 7329 if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]); 7330 else url.host = base.host; 7331 } 7332 state = PATH; 7333 continue; 7334 7335 case FILE_HOST: 7336 if (chr == EOF || chr == '/' || chr == '\\' || chr == '?' || chr == '#') { 7337 if (!stateOverride && isWindowsDriveLetter(buffer)) { 7338 state = PATH; 7339 } else if (buffer == '') { 7340 url.host = ''; 7341 if (stateOverride) return; 7342 state = PATH_START; 7343 } else { 7344 failure = url.parseHost(buffer); 7345 if (failure) return failure; 7346 if (url.host == 'localhost') url.host = ''; 7347 if (stateOverride) return; 7348 buffer = ''; 7349 state = PATH_START; 7350 } continue; 7351 } else buffer += chr; 7352 break; 7353 7354 case PATH_START: 7355 if (url.isSpecial()) { 7356 state = PATH; 7357 if (chr != '/' && chr != '\\') continue; 7358 } else if (!stateOverride && chr == '?') { 7359 url.query = ''; 7360 state = QUERY; 7361 } else if (!stateOverride && chr == '#') { 7362 url.fragment = ''; 7363 state = FRAGMENT; 7364 } else if (chr != EOF) { 7365 state = PATH; 7366 if (chr != '/') continue; 7367 } break; 7368 7369 case PATH: 7370 if ( 7371 chr == EOF || chr == '/' || 7372 (chr == '\\' && url.isSpecial()) || 7373 (!stateOverride && (chr == '?' || chr == '#')) 7374 ) { 7375 if (isDoubleDot(buffer)) { 7376 url.shortenPath(); 7377 if (chr != '/' && !(chr == '\\' && url.isSpecial())) { 7378 push(url.path, ''); 7379 } 7380 } else if (isSingleDot(buffer)) { 7381 if (chr != '/' && !(chr == '\\' && url.isSpecial())) { 7382 push(url.path, ''); 7383 } 7384 } else { 7385 if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { 7386 if (url.host) url.host = ''; 7387 buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter 7388 } 7389 push(url.path, buffer); 7390 } 7391 buffer = ''; 7392 if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) { 7393 while (url.path.length > 1 && url.path[0] === '') { 7394 shift(url.path); 7395 } 7396 } 7397 if (chr == '?') { 7398 url.query = ''; 7399 state = QUERY; 7400 } else if (chr == '#') { 7401 url.fragment = ''; 7402 state = FRAGMENT; 7403 } 7404 } else { 7405 buffer += percentEncode(chr, pathPercentEncodeSet); 7406 } break; 7407 7408 case CANNOT_BE_A_BASE_URL_PATH: 7409 if (chr == '?') { 7410 url.query = ''; 7411 state = QUERY; 7412 } else if (chr == '#') { 7413 url.fragment = ''; 7414 state = FRAGMENT; 7415 } else if (chr != EOF) { 7416 url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet); 7417 } break; 7418 7419 case QUERY: 7420 if (!stateOverride && chr == '#') { 7421 url.fragment = ''; 7422 state = FRAGMENT; 7423 } else if (chr != EOF) { 7424 if (chr == "'" && url.isSpecial()) url.query += '%27'; 7425 else if (chr == '#') url.query += '%23'; 7426 else url.query += percentEncode(chr, C0ControlPercentEncodeSet); 7427 } break; 7428 7429 case FRAGMENT: 7430 if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet); 7431 break; 7432 } 7433 7434 pointer++; 7435 } 7436 }, 7437 // https://url.spec.whatwg.org/#host-parsing 7438 parseHost: function (input) { 7439 var result, codePoints, index; 7440 if (charAt(input, 0) == '[') { 7441 if (charAt(input, input.length - 1) != ']') return INVALID_HOST; 7442 result = parseIPv6(stringSlice(input, 1, -1)); 7443 if (!result) return INVALID_HOST; 7444 this.host = result; 7445 // opaque host 7446 } else if (!this.isSpecial()) { 7447 if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST; 7448 result = ''; 7449 codePoints = arrayFrom(input); 7450 for (index = 0; index < codePoints.length; index++) { 7451 result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); 7452 } 7453 this.host = result; 7454 } else { 7455 input = toASCII(input); 7456 if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST; 7457 result = parseIPv4(input); 7458 if (result === null) return INVALID_HOST; 7459 this.host = result; 7460 } 7461 }, 7462 // https://url.spec.whatwg.org/#cannot-have-a-username-password-port 7463 cannotHaveUsernamePasswordPort: function () { 7464 return !this.host || this.cannotBeABaseURL || this.scheme == 'file'; 7465 }, 7466 // https://url.spec.whatwg.org/#include-credentials 7467 includesCredentials: function () { 7468 return this.username != '' || this.password != ''; 7469 }, 7470 // https://url.spec.whatwg.org/#is-special 7471 isSpecial: function () { 7472 return hasOwn$3(specialSchemes, this.scheme); 7473 }, 7474 // https://url.spec.whatwg.org/#shorten-a-urls-path 7475 shortenPath: function () { 7476 var path = this.path; 7477 var pathSize = path.length; 7478 if (pathSize && (this.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { 7479 path.length--; 7480 } 7481 }, 7482 // https://url.spec.whatwg.org/#concept-url-serializer 7483 serialize: function () { 7484 var url = this; 7485 var scheme = url.scheme; 7486 var username = url.username; 7487 var password = url.password; 7488 var host = url.host; 7489 var port = url.port; 7490 var path = url.path; 7491 var query = url.query; 7492 var fragment = url.fragment; 7493 var output = scheme + ':'; 7494 if (host !== null) { 7495 output += '//'; 7496 if (url.includesCredentials()) { 7497 output += username + (password ? ':' + password : '') + '@'; 7498 } 7499 output += serializeHost(host); 7500 if (port !== null) output += ':' + port; 7501 } else if (scheme == 'file') output += '//'; 7502 output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join$1(path, '/') : ''; 7503 if (query !== null) output += '?' + query; 7504 if (fragment !== null) output += '#' + fragment; 7505 return output; 7506 }, 7507 // https://url.spec.whatwg.org/#dom-url-href 7508 setHref: function (href) { 7509 var failure = this.parse(href); 7510 if (failure) throw TypeError$3(failure); 7511 this.searchParams.update(); 7512 }, 7513 // https://url.spec.whatwg.org/#dom-url-origin 7514 getOrigin: function () { 7515 var scheme = this.scheme; 7516 var port = this.port; 7517 if (scheme == 'blob') try { 7518 return new URLConstructor(scheme.path[0]).origin; 7519 } catch (error) { 7520 return 'null'; 7521 } 7522 if (scheme == 'file' || !this.isSpecial()) return 'null'; 7523 return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : ''); 7524 }, 7525 // https://url.spec.whatwg.org/#dom-url-protocol 7526 getProtocol: function () { 7527 return this.scheme + ':'; 7528 }, 7529 setProtocol: function (protocol) { 7530 this.parse($toString(protocol) + ':', SCHEME_START); 7531 }, 7532 // https://url.spec.whatwg.org/#dom-url-username 7533 getUsername: function () { 7534 return this.username; 7535 }, 7536 setUsername: function (username) { 7537 var codePoints = arrayFrom($toString(username)); 7538 if (this.cannotHaveUsernamePasswordPort()) return; 7539 this.username = ''; 7540 for (var i = 0; i < codePoints.length; i++) { 7541 this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); 7542 } 7543 }, 7544 // https://url.spec.whatwg.org/#dom-url-password 7545 getPassword: function () { 7546 return this.password; 7547 }, 7548 setPassword: function (password) { 7549 var codePoints = arrayFrom($toString(password)); 7550 if (this.cannotHaveUsernamePasswordPort()) return; 7551 this.password = ''; 7552 for (var i = 0; i < codePoints.length; i++) { 7553 this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); 7554 } 7555 }, 7556 // https://url.spec.whatwg.org/#dom-url-host 7557 getHost: function () { 7558 var host = this.host; 7559 var port = this.port; 7560 return host === null ? '' 7561 : port === null ? serializeHost(host) 7562 : serializeHost(host) + ':' + port; 7563 }, 7564 setHost: function (host) { 7565 if (this.cannotBeABaseURL) return; 7566 this.parse(host, HOST); 7567 }, 7568 // https://url.spec.whatwg.org/#dom-url-hostname 7569 getHostname: function () { 7570 var host = this.host; 7571 return host === null ? '' : serializeHost(host); 7572 }, 7573 setHostname: function (hostname) { 7574 if (this.cannotBeABaseURL) return; 7575 this.parse(hostname, HOSTNAME); 7576 }, 7577 // https://url.spec.whatwg.org/#dom-url-port 7578 getPort: function () { 7579 var port = this.port; 7580 return port === null ? '' : $toString(port); 7581 }, 7582 setPort: function (port) { 7583 if (this.cannotHaveUsernamePasswordPort()) return; 7584 port = $toString(port); 7585 if (port == '') this.port = null; 7586 else this.parse(port, PORT); 7587 }, 7588 // https://url.spec.whatwg.org/#dom-url-pathname 7589 getPathname: function () { 7590 var path = this.path; 7591 return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join$1(path, '/') : ''; 7592 }, 7593 setPathname: function (pathname) { 7594 if (this.cannotBeABaseURL) return; 7595 this.path = []; 7596 this.parse(pathname, PATH_START); 7597 }, 7598 // https://url.spec.whatwg.org/#dom-url-search 7599 getSearch: function () { 7600 var query = this.query; 7601 return query ? '?' + query : ''; 7602 }, 7603 setSearch: function (search) { 7604 search = $toString(search); 7605 if (search == '') { 7606 this.query = null; 7607 } else { 7608 if ('?' == charAt(search, 0)) search = stringSlice(search, 1); 7609 this.query = ''; 7610 this.parse(search, QUERY); 7611 } 7612 this.searchParams.update(); 7613 }, 7614 // https://url.spec.whatwg.org/#dom-url-searchparams 7615 getSearchParams: function () { 7616 return this.searchParams.facade; 7617 }, 7618 // https://url.spec.whatwg.org/#dom-url-hash 7619 getHash: function () { 7620 var fragment = this.fragment; 7621 return fragment ? '#' + fragment : ''; 7622 }, 7623 setHash: function (hash) { 7624 hash = $toString(hash); 7625 if (hash == '') { 7626 this.fragment = null; 7627 return; 7628 } 7629 if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1); 7630 this.fragment = ''; 7631 this.parse(hash, FRAGMENT); 7632 }, 7633 update: function () { 7634 this.query = this.searchParams.serialize() || null; 7635 } 7636 }; 7637 7638 // `URL` constructor 7639 // https://url.spec.whatwg.org/#url-class 7640 var URLConstructor = function URL(url /* , base */) { 7641 var that = anInstance$2(this, URLPrototype); 7642 var base = arguments.length > 1 ? arguments[1] : undefined; 7643 var state = setInternalState$2(that, new URLState(url, false, base)); 7644 if (!DESCRIPTORS$3) { 7645 that.href = state.serialize(); 7646 that.origin = state.getOrigin(); 7647 that.protocol = state.getProtocol(); 7648 that.username = state.getUsername(); 7649 that.password = state.getPassword(); 7650 that.host = state.getHost(); 7651 that.hostname = state.getHostname(); 7652 that.port = state.getPort(); 7653 that.pathname = state.getPathname(); 7654 that.search = state.getSearch(); 7655 that.searchParams = state.getSearchParams(); 7656 that.hash = state.getHash(); 7657 } 7658 }; 7659 7660 var URLPrototype = URLConstructor.prototype; 7661 7662 var accessorDescriptor = function (getter, setter) { 7663 return { 7664 get: function () { 7665 return getInternalURLState(this)[getter](); 7666 }, 7667 set: setter && function (value) { 7668 return getInternalURLState(this)[setter](value); 7669 }, 7670 configurable: true, 7671 enumerable: true 7672 }; 7673 }; 7674 7675 if (DESCRIPTORS$3) { 7676 defineProperties(URLPrototype, { 7677 // `URL.prototype.href` accessors pair 7678 // https://url.spec.whatwg.org/#dom-url-href 7679 href: accessorDescriptor('serialize', 'setHref'), 7680 // `URL.prototype.origin` getter 7681 // https://url.spec.whatwg.org/#dom-url-origin 7682 origin: accessorDescriptor('getOrigin'), 7683 // `URL.prototype.protocol` accessors pair 7684 // https://url.spec.whatwg.org/#dom-url-protocol 7685 protocol: accessorDescriptor('getProtocol', 'setProtocol'), 7686 // `URL.prototype.username` accessors pair 7687 // https://url.spec.whatwg.org/#dom-url-username 7688 username: accessorDescriptor('getUsername', 'setUsername'), 7689 // `URL.prototype.password` accessors pair 7690 // https://url.spec.whatwg.org/#dom-url-password 7691 password: accessorDescriptor('getPassword', 'setPassword'), 7692 // `URL.prototype.host` accessors pair 7693 // https://url.spec.whatwg.org/#dom-url-host 7694 host: accessorDescriptor('getHost', 'setHost'), 7695 // `URL.prototype.hostname` accessors pair 7696 // https://url.spec.whatwg.org/#dom-url-hostname 7697 hostname: accessorDescriptor('getHostname', 'setHostname'), 7698 // `URL.prototype.port` accessors pair 7699 // https://url.spec.whatwg.org/#dom-url-port 7700 port: accessorDescriptor('getPort', 'setPort'), 7701 // `URL.prototype.pathname` accessors pair 7702 // https://url.spec.whatwg.org/#dom-url-pathname 7703 pathname: accessorDescriptor('getPathname', 'setPathname'), 7704 // `URL.prototype.search` accessors pair 7705 // https://url.spec.whatwg.org/#dom-url-search 7706 search: accessorDescriptor('getSearch', 'setSearch'), 7707 // `URL.prototype.searchParams` getter 7708 // https://url.spec.whatwg.org/#dom-url-searchparams 7709 searchParams: accessorDescriptor('getSearchParams'), 7710 // `URL.prototype.hash` accessors pair 7711 // https://url.spec.whatwg.org/#dom-url-hash 7712 hash: accessorDescriptor('getHash', 'setHash') 7713 }); 7714 } 7715 7716 // `URL.prototype.toJSON` method 7717 // https://url.spec.whatwg.org/#dom-url-tojson 7718 redefine$1(URLPrototype, 'toJSON', function toJSON() { 7719 return getInternalURLState(this).serialize(); 7720 }, { enumerable: true }); 7721 7722 // `URL.prototype.toString` method 7723 // https://url.spec.whatwg.org/#URL-stringification-behavior 7724 redefine$1(URLPrototype, 'toString', function toString() { 7725 return getInternalURLState(this).serialize(); 7726 }, { enumerable: true }); 7727 7728 if (NativeURL) { 7729 var nativeCreateObjectURL = NativeURL.createObjectURL; 7730 var nativeRevokeObjectURL = NativeURL.revokeObjectURL; 7731 // `URL.createObjectURL` method 7732 // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL 7733 if (nativeCreateObjectURL) redefine$1(URLConstructor, 'createObjectURL', bind$1(nativeCreateObjectURL, NativeURL)); 7734 // `URL.revokeObjectURL` method 7735 // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL 7736 if (nativeRevokeObjectURL) redefine$1(URLConstructor, 'revokeObjectURL', bind$1(nativeRevokeObjectURL, NativeURL)); 7737 } 7738 7739 setToStringTag$1(URLConstructor, 'URL'); 7740 7741 $$1({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS$3 }, { 7742 URL: URLConstructor 7743 }); 7744 7745 var typedArrayConstructor = {exports: {}}; 7746 7747 // eslint-disable-next-line es/no-typed-arrays -- safe 7748 var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; 7749 7750 var NATIVE_ARRAY_BUFFER$1 = arrayBufferNative; 7751 var DESCRIPTORS$2 = descriptors; 7752 var global$e = global$1e; 7753 var isCallable = isCallable$q; 7754 var isObject$4 = isObject$s; 7755 var hasOwn$2 = hasOwnProperty_1; 7756 var classof$1 = classof$d; 7757 var tryToString = tryToString$5; 7758 var createNonEnumerableProperty$2 = createNonEnumerableProperty$a; 7759 var redefine = redefine$e.exports; 7760 var defineProperty$1 = objectDefineProperty.f; 7761 var isPrototypeOf$1 = objectIsPrototypeOf; 7762 var getPrototypeOf$1 = objectGetPrototypeOf$1; 7763 var setPrototypeOf$2 = objectSetPrototypeOf; 7764 var wellKnownSymbol$1 = wellKnownSymbol$s; 7765 var uid$2 = uid$7; 7766 7767 var Int8Array$3 = global$e.Int8Array; 7768 var Int8ArrayPrototype = Int8Array$3 && Int8Array$3.prototype; 7769 var Uint8ClampedArray = global$e.Uint8ClampedArray; 7770 var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; 7771 var TypedArray$1 = Int8Array$3 && getPrototypeOf$1(Int8Array$3); 7772 var TypedArrayPrototype$2 = Int8ArrayPrototype && getPrototypeOf$1(Int8ArrayPrototype); 7773 var ObjectPrototype$1 = Object.prototype; 7774 var TypeError$2 = global$e.TypeError; 7775 7776 var TO_STRING_TAG = wellKnownSymbol$1('toStringTag'); 7777 var TYPED_ARRAY_TAG$1 = uid$2('TYPED_ARRAY_TAG'); 7778 var TYPED_ARRAY_CONSTRUCTOR$2 = uid$2('TYPED_ARRAY_CONSTRUCTOR'); 7779 // Fixing native typed arrays in Opera Presto crashes the browser, see #595 7780 var NATIVE_ARRAY_BUFFER_VIEWS$2 = NATIVE_ARRAY_BUFFER$1 && !!setPrototypeOf$2 && classof$1(global$e.opera) !== 'Opera'; 7781 var TYPED_ARRAY_TAG_REQUIRED = false; 7782 var NAME, Constructor, Prototype; 7783 7784 var TypedArrayConstructorsList = { 7785 Int8Array: 1, 7786 Uint8Array: 1, 7787 Uint8ClampedArray: 1, 7788 Int16Array: 2, 7789 Uint16Array: 2, 7790 Int32Array: 4, 7791 Uint32Array: 4, 7792 Float32Array: 4, 7793 Float64Array: 8 7794 }; 7795 7796 var BigIntArrayConstructorsList = { 7797 BigInt64Array: 8, 7798 BigUint64Array: 8 7799 }; 7800 7801 var isView = function isView(it) { 7802 if (!isObject$4(it)) return false; 7803 var klass = classof$1(it); 7804 return klass === 'DataView' 7805 || hasOwn$2(TypedArrayConstructorsList, klass) 7806 || hasOwn$2(BigIntArrayConstructorsList, klass); 7807 }; 7808 7809 var isTypedArray$1 = function (it) { 7810 if (!isObject$4(it)) return false; 7811 var klass = classof$1(it); 7812 return hasOwn$2(TypedArrayConstructorsList, klass) 7813 || hasOwn$2(BigIntArrayConstructorsList, klass); 7814 }; 7815 7816 var aTypedArray$n = function (it) { 7817 if (isTypedArray$1(it)) return it; 7818 throw TypeError$2('Target is not a typed array'); 7819 }; 7820 7821 var aTypedArrayConstructor$3 = function (C) { 7822 if (isCallable(C) && (!setPrototypeOf$2 || isPrototypeOf$1(TypedArray$1, C))) return C; 7823 throw TypeError$2(tryToString(C) + ' is not a typed array constructor'); 7824 }; 7825 7826 var exportTypedArrayMethod$o = function (KEY, property, forced, options) { 7827 if (!DESCRIPTORS$2) return; 7828 if (forced) for (var ARRAY in TypedArrayConstructorsList) { 7829 var TypedArrayConstructor = global$e[ARRAY]; 7830 if (TypedArrayConstructor && hasOwn$2(TypedArrayConstructor.prototype, KEY)) try { 7831 delete TypedArrayConstructor.prototype[KEY]; 7832 } catch (error) { /* empty */ } 7833 } 7834 if (!TypedArrayPrototype$2[KEY] || forced) { 7835 redefine(TypedArrayPrototype$2, KEY, forced ? property 7836 : NATIVE_ARRAY_BUFFER_VIEWS$2 && Int8ArrayPrototype[KEY] || property, options); 7837 } 7838 }; 7839 7840 var exportTypedArrayStaticMethod = function (KEY, property, forced) { 7841 var ARRAY, TypedArrayConstructor; 7842 if (!DESCRIPTORS$2) return; 7843 if (setPrototypeOf$2) { 7844 if (forced) for (ARRAY in TypedArrayConstructorsList) { 7845 TypedArrayConstructor = global$e[ARRAY]; 7846 if (TypedArrayConstructor && hasOwn$2(TypedArrayConstructor, KEY)) try { 7847 delete TypedArrayConstructor[KEY]; 7848 } catch (error) { /* empty */ } 7849 } 7850 if (!TypedArray$1[KEY] || forced) { 7851 // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable 7852 try { 7853 return redefine(TypedArray$1, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS$2 && TypedArray$1[KEY] || property); 7854 } catch (error) { /* empty */ } 7855 } else return; 7856 } 7857 for (ARRAY in TypedArrayConstructorsList) { 7858 TypedArrayConstructor = global$e[ARRAY]; 7859 if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { 7860 redefine(TypedArrayConstructor, KEY, property); 7861 } 7862 } 7863 }; 7864 7865 for (NAME in TypedArrayConstructorsList) { 7866 Constructor = global$e[NAME]; 7867 Prototype = Constructor && Constructor.prototype; 7868 if (Prototype) createNonEnumerableProperty$2(Prototype, TYPED_ARRAY_CONSTRUCTOR$2, Constructor); 7869 else NATIVE_ARRAY_BUFFER_VIEWS$2 = false; 7870 } 7871 7872 for (NAME in BigIntArrayConstructorsList) { 7873 Constructor = global$e[NAME]; 7874 Prototype = Constructor && Constructor.prototype; 7875 if (Prototype) createNonEnumerableProperty$2(Prototype, TYPED_ARRAY_CONSTRUCTOR$2, Constructor); 7876 } 7877 7878 // WebKit bug - typed arrays constructors prototype is Object.prototype 7879 if (!NATIVE_ARRAY_BUFFER_VIEWS$2 || !isCallable(TypedArray$1) || TypedArray$1 === Function.prototype) { 7880 // eslint-disable-next-line no-shadow -- safe 7881 TypedArray$1 = function TypedArray() { 7882 throw TypeError$2('Incorrect invocation'); 7883 }; 7884 if (NATIVE_ARRAY_BUFFER_VIEWS$2) for (NAME in TypedArrayConstructorsList) { 7885 if (global$e[NAME]) setPrototypeOf$2(global$e[NAME], TypedArray$1); 7886 } 7887 } 7888 7889 if (!NATIVE_ARRAY_BUFFER_VIEWS$2 || !TypedArrayPrototype$2 || TypedArrayPrototype$2 === ObjectPrototype$1) { 7890 TypedArrayPrototype$2 = TypedArray$1.prototype; 7891 if (NATIVE_ARRAY_BUFFER_VIEWS$2) for (NAME in TypedArrayConstructorsList) { 7892 if (global$e[NAME]) setPrototypeOf$2(global$e[NAME].prototype, TypedArrayPrototype$2); 7893 } 7894 } 7895 7896 // WebKit bug - one more object in Uint8ClampedArray prototype chain 7897 if (NATIVE_ARRAY_BUFFER_VIEWS$2 && getPrototypeOf$1(Uint8ClampedArrayPrototype) !== TypedArrayPrototype$2) { 7898 setPrototypeOf$2(Uint8ClampedArrayPrototype, TypedArrayPrototype$2); 7899 } 7900 7901 if (DESCRIPTORS$2 && !hasOwn$2(TypedArrayPrototype$2, TO_STRING_TAG)) { 7902 TYPED_ARRAY_TAG_REQUIRED = true; 7903 defineProperty$1(TypedArrayPrototype$2, TO_STRING_TAG, { get: function () { 7904 return isObject$4(this) ? this[TYPED_ARRAY_TAG$1] : undefined; 7905 } }); 7906 for (NAME in TypedArrayConstructorsList) if (global$e[NAME]) { 7907 createNonEnumerableProperty$2(global$e[NAME], TYPED_ARRAY_TAG$1, NAME); 7908 } 7909 } 7910 7911 var arrayBufferViewCore = { 7912 NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS$2, 7913 TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR$2, 7914 TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG$1, 7915 aTypedArray: aTypedArray$n, 7916 aTypedArrayConstructor: aTypedArrayConstructor$3, 7917 exportTypedArrayMethod: exportTypedArrayMethod$o, 7918 exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, 7919 isView: isView, 7920 isTypedArray: isTypedArray$1, 7921 TypedArray: TypedArray$1, 7922 TypedArrayPrototype: TypedArrayPrototype$2 7923 }; 7924 7925 /* eslint-disable no-new -- required for testing */ 7926 7927 var global$d = global$1e; 7928 var fails$7 = fails$I; 7929 var checkCorrectnessOfIteration = checkCorrectnessOfIteration$4; 7930 var NATIVE_ARRAY_BUFFER_VIEWS$1 = arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; 7931 7932 var ArrayBuffer$2 = global$d.ArrayBuffer; 7933 var Int8Array$2 = global$d.Int8Array; 7934 7935 var typedArrayConstructorsRequireWrappers = !NATIVE_ARRAY_BUFFER_VIEWS$1 || !fails$7(function () { 7936 Int8Array$2(1); 7937 }) || !fails$7(function () { 7938 new Int8Array$2(-1); 7939 }) || !checkCorrectnessOfIteration(function (iterable) { 7940 new Int8Array$2(); 7941 new Int8Array$2(null); 7942 new Int8Array$2(1.5); 7943 new Int8Array$2(iterable); 7944 }, true) || fails$7(function () { 7945 // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill 7946 return new Int8Array$2(new ArrayBuffer$2(2), 1, undefined).length !== 1; 7947 }); 7948 7949 var global$c = global$1e; 7950 var toIntegerOrInfinity$4 = toIntegerOrInfinity$c; 7951 var toLength$3 = toLength$a; 7952 7953 var RangeError$5 = global$c.RangeError; 7954 7955 // `ToIndex` abstract operation 7956 // https://tc39.es/ecma262/#sec-toindex 7957 var toIndex$2 = function (it) { 7958 if (it === undefined) return 0; 7959 var number = toIntegerOrInfinity$4(it); 7960 var length = toLength$3(number); 7961 if (number !== length) throw RangeError$5('Wrong length or index'); 7962 return length; 7963 }; 7964 7965 // IEEE754 conversions based on https://github.com/feross/ieee754 7966 var global$b = global$1e; 7967 7968 var Array$3 = global$b.Array; 7969 var abs = Math.abs; 7970 var pow = Math.pow; 7971 var floor$2 = Math.floor; 7972 var log = Math.log; 7973 var LN2 = Math.LN2; 7974 7975 var pack = function (number, mantissaLength, bytes) { 7976 var buffer = Array$3(bytes); 7977 var exponentLength = bytes * 8 - mantissaLength - 1; 7978 var eMax = (1 << exponentLength) - 1; 7979 var eBias = eMax >> 1; 7980 var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; 7981 var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; 7982 var index = 0; 7983 var exponent, mantissa, c; 7984 number = abs(number); 7985 // eslint-disable-next-line no-self-compare -- NaN check 7986 if (number != number || number === Infinity) { 7987 // eslint-disable-next-line no-self-compare -- NaN check 7988 mantissa = number != number ? 1 : 0; 7989 exponent = eMax; 7990 } else { 7991 exponent = floor$2(log(number) / LN2); 7992 c = pow(2, -exponent); 7993 if (number * c < 1) { 7994 exponent--; 7995 c *= 2; 7996 } 7997 if (exponent + eBias >= 1) { 7998 number += rt / c; 7999 } else { 8000 number += rt * pow(2, 1 - eBias); 8001 } 8002 if (number * c >= 2) { 8003 exponent++; 8004 c /= 2; 8005 } 8006 if (exponent + eBias >= eMax) { 8007 mantissa = 0; 8008 exponent = eMax; 8009 } else if (exponent + eBias >= 1) { 8010 mantissa = (number * c - 1) * pow(2, mantissaLength); 8011 exponent = exponent + eBias; 8012 } else { 8013 mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); 8014 exponent = 0; 8015 } 8016 } 8017 while (mantissaLength >= 8) { 8018 buffer[index++] = mantissa & 255; 8019 mantissa /= 256; 8020 mantissaLength -= 8; 8021 } 8022 exponent = exponent << mantissaLength | mantissa; 8023 exponentLength += mantissaLength; 8024 while (exponentLength > 0) { 8025 buffer[index++] = exponent & 255; 8026 exponent /= 256; 8027 exponentLength -= 8; 8028 } 8029 buffer[--index] |= sign * 128; 8030 return buffer; 8031 }; 8032 8033 var unpack = function (buffer, mantissaLength) { 8034 var bytes = buffer.length; 8035 var exponentLength = bytes * 8 - mantissaLength - 1; 8036 var eMax = (1 << exponentLength) - 1; 8037 var eBias = eMax >> 1; 8038 var nBits = exponentLength - 7; 8039 var index = bytes - 1; 8040 var sign = buffer[index--]; 8041 var exponent = sign & 127; 8042 var mantissa; 8043 sign >>= 7; 8044 while (nBits > 0) { 8045 exponent = exponent * 256 + buffer[index--]; 8046 nBits -= 8; 8047 } 8048 mantissa = exponent & (1 << -nBits) - 1; 8049 exponent >>= -nBits; 8050 nBits += mantissaLength; 8051 while (nBits > 0) { 8052 mantissa = mantissa * 256 + buffer[index--]; 8053 nBits -= 8; 8054 } 8055 if (exponent === 0) { 8056 exponent = 1 - eBias; 8057 } else if (exponent === eMax) { 8058 return mantissa ? NaN : sign ? -Infinity : Infinity; 8059 } else { 8060 mantissa = mantissa + pow(2, mantissaLength); 8061 exponent = exponent - eBias; 8062 } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); 8063 }; 8064 8065 var ieee754 = { 8066 pack: pack, 8067 unpack: unpack 8068 }; 8069 8070 var toObject$4 = toObject$g; 8071 var toAbsoluteIndex$2 = toAbsoluteIndex$7; 8072 var lengthOfArrayLike$7 = lengthOfArrayLike$h; 8073 8074 // `Array.prototype.fill` method implementation 8075 // https://tc39.es/ecma262/#sec-array.prototype.fill 8076 var arrayFill$1 = function fill(value /* , start = 0, end = @length */) { 8077 var O = toObject$4(this); 8078 var length = lengthOfArrayLike$7(O); 8079 var argumentsLength = arguments.length; 8080 var index = toAbsoluteIndex$2(argumentsLength > 1 ? arguments[1] : undefined, length); 8081 var end = argumentsLength > 2 ? arguments[2] : undefined; 8082 var endPos = end === undefined ? length : toAbsoluteIndex$2(end, length); 8083 while (endPos > index) O[index++] = value; 8084 return O; 8085 }; 8086 8087 var global$a = global$1e; 8088 var uncurryThis$5 = functionUncurryThis; 8089 var DESCRIPTORS$1 = descriptors; 8090 var NATIVE_ARRAY_BUFFER = arrayBufferNative; 8091 var FunctionName = functionName; 8092 var createNonEnumerableProperty$1 = createNonEnumerableProperty$a; 8093 var redefineAll = redefineAll$6; 8094 var fails$6 = fails$I; 8095 var anInstance$1 = anInstance$8; 8096 var toIntegerOrInfinity$3 = toIntegerOrInfinity$c; 8097 var toLength$2 = toLength$a; 8098 var toIndex$1 = toIndex$2; 8099 var IEEE754 = ieee754; 8100 var getPrototypeOf = objectGetPrototypeOf$1; 8101 var setPrototypeOf$1 = objectSetPrototypeOf; 8102 var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; 8103 var defineProperty = objectDefineProperty.f; 8104 var arrayFill = arrayFill$1; 8105 var arraySlice$2 = arraySliceSimple; 8106 var setToStringTag = setToStringTag$9; 8107 var InternalStateModule$1 = internalState; 8108 8109 var PROPER_FUNCTION_NAME = FunctionName.PROPER; 8110 var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; 8111 var getInternalState$1 = InternalStateModule$1.get; 8112 var setInternalState$1 = InternalStateModule$1.set; 8113 var ARRAY_BUFFER = 'ArrayBuffer'; 8114 var DATA_VIEW = 'DataView'; 8115 var PROTOTYPE = 'prototype'; 8116 var WRONG_LENGTH$1 = 'Wrong length'; 8117 var WRONG_INDEX = 'Wrong index'; 8118 var NativeArrayBuffer = global$a[ARRAY_BUFFER]; 8119 var $ArrayBuffer = NativeArrayBuffer; 8120 var ArrayBufferPrototype$1 = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; 8121 var $DataView = global$a[DATA_VIEW]; 8122 var DataViewPrototype = $DataView && $DataView[PROTOTYPE]; 8123 var ObjectPrototype = Object.prototype; 8124 var Array$2 = global$a.Array; 8125 var RangeError$4 = global$a.RangeError; 8126 var fill = uncurryThis$5(arrayFill); 8127 var reverse = uncurryThis$5([].reverse); 8128 8129 var packIEEE754 = IEEE754.pack; 8130 var unpackIEEE754 = IEEE754.unpack; 8131 8132 var packInt8 = function (number) { 8133 return [number & 0xFF]; 8134 }; 8135 8136 var packInt16 = function (number) { 8137 return [number & 0xFF, number >> 8 & 0xFF]; 8138 }; 8139 8140 var packInt32 = function (number) { 8141 return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; 8142 }; 8143 8144 var unpackInt32 = function (buffer) { 8145 return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; 8146 }; 8147 8148 var packFloat32 = function (number) { 8149 return packIEEE754(number, 23, 4); 8150 }; 8151 8152 var packFloat64 = function (number) { 8153 return packIEEE754(number, 52, 8); 8154 }; 8155 8156 var addGetter$1 = function (Constructor, key) { 8157 defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState$1(this)[key]; } }); 8158 }; 8159 8160 var get$2 = function (view, count, index, isLittleEndian) { 8161 var intIndex = toIndex$1(index); 8162 var store = getInternalState$1(view); 8163 if (intIndex + count > store.byteLength) throw RangeError$4(WRONG_INDEX); 8164 var bytes = getInternalState$1(store.buffer).bytes; 8165 var start = intIndex + store.byteOffset; 8166 var pack = arraySlice$2(bytes, start, start + count); 8167 return isLittleEndian ? pack : reverse(pack); 8168 }; 8169 8170 var set$2 = function (view, count, index, conversion, value, isLittleEndian) { 8171 var intIndex = toIndex$1(index); 8172 var store = getInternalState$1(view); 8173 if (intIndex + count > store.byteLength) throw RangeError$4(WRONG_INDEX); 8174 var bytes = getInternalState$1(store.buffer).bytes; 8175 var start = intIndex + store.byteOffset; 8176 var pack = conversion(+value); 8177 for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; 8178 }; 8179 8180 if (!NATIVE_ARRAY_BUFFER) { 8181 $ArrayBuffer = function ArrayBuffer(length) { 8182 anInstance$1(this, ArrayBufferPrototype$1); 8183 var byteLength = toIndex$1(length); 8184 setInternalState$1(this, { 8185 bytes: fill(Array$2(byteLength), 0), 8186 byteLength: byteLength 8187 }); 8188 if (!DESCRIPTORS$1) this.byteLength = byteLength; 8189 }; 8190 8191 ArrayBufferPrototype$1 = $ArrayBuffer[PROTOTYPE]; 8192 8193 $DataView = function DataView(buffer, byteOffset, byteLength) { 8194 anInstance$1(this, DataViewPrototype); 8195 anInstance$1(buffer, ArrayBufferPrototype$1); 8196 var bufferLength = getInternalState$1(buffer).byteLength; 8197 var offset = toIntegerOrInfinity$3(byteOffset); 8198 if (offset < 0 || offset > bufferLength) throw RangeError$4('Wrong offset'); 8199 byteLength = byteLength === undefined ? bufferLength - offset : toLength$2(byteLength); 8200 if (offset + byteLength > bufferLength) throw RangeError$4(WRONG_LENGTH$1); 8201 setInternalState$1(this, { 8202 buffer: buffer, 8203 byteLength: byteLength, 8204 byteOffset: offset 8205 }); 8206 if (!DESCRIPTORS$1) { 8207 this.buffer = buffer; 8208 this.byteLength = byteLength; 8209 this.byteOffset = offset; 8210 } 8211 }; 8212 8213 DataViewPrototype = $DataView[PROTOTYPE]; 8214 8215 if (DESCRIPTORS$1) { 8216 addGetter$1($ArrayBuffer, 'byteLength'); 8217 addGetter$1($DataView, 'buffer'); 8218 addGetter$1($DataView, 'byteLength'); 8219 addGetter$1($DataView, 'byteOffset'); 8220 } 8221 8222 redefineAll(DataViewPrototype, { 8223 getInt8: function getInt8(byteOffset) { 8224 return get$2(this, 1, byteOffset)[0] << 24 >> 24; 8225 }, 8226 getUint8: function getUint8(byteOffset) { 8227 return get$2(this, 1, byteOffset)[0]; 8228 }, 8229 getInt16: function getInt16(byteOffset /* , littleEndian */) { 8230 var bytes = get$2(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); 8231 return (bytes[1] << 8 | bytes[0]) << 16 >> 16; 8232 }, 8233 getUint16: function getUint16(byteOffset /* , littleEndian */) { 8234 var bytes = get$2(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); 8235 return bytes[1] << 8 | bytes[0]; 8236 }, 8237 getInt32: function getInt32(byteOffset /* , littleEndian */) { 8238 return unpackInt32(get$2(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); 8239 }, 8240 getUint32: function getUint32(byteOffset /* , littleEndian */) { 8241 return unpackInt32(get$2(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; 8242 }, 8243 getFloat32: function getFloat32(byteOffset /* , littleEndian */) { 8244 return unpackIEEE754(get$2(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); 8245 }, 8246 getFloat64: function getFloat64(byteOffset /* , littleEndian */) { 8247 return unpackIEEE754(get$2(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); 8248 }, 8249 setInt8: function setInt8(byteOffset, value) { 8250 set$2(this, 1, byteOffset, packInt8, value); 8251 }, 8252 setUint8: function setUint8(byteOffset, value) { 8253 set$2(this, 1, byteOffset, packInt8, value); 8254 }, 8255 setInt16: function setInt16(byteOffset, value /* , littleEndian */) { 8256 set$2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); 8257 }, 8258 setUint16: function setUint16(byteOffset, value /* , littleEndian */) { 8259 set$2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); 8260 }, 8261 setInt32: function setInt32(byteOffset, value /* , littleEndian */) { 8262 set$2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); 8263 }, 8264 setUint32: function setUint32(byteOffset, value /* , littleEndian */) { 8265 set$2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); 8266 }, 8267 setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { 8268 set$2(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); 8269 }, 8270 setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { 8271 set$2(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); 8272 } 8273 }); 8274 } else { 8275 var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER; 8276 /* eslint-disable no-new -- required for testing */ 8277 if (!fails$6(function () { 8278 NativeArrayBuffer(1); 8279 }) || !fails$6(function () { 8280 new NativeArrayBuffer(-1); 8281 }) || fails$6(function () { 8282 new NativeArrayBuffer(); 8283 new NativeArrayBuffer(1.5); 8284 new NativeArrayBuffer(NaN); 8285 return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; 8286 })) { 8287 /* eslint-enable no-new -- required for testing */ 8288 $ArrayBuffer = function ArrayBuffer(length) { 8289 anInstance$1(this, ArrayBufferPrototype$1); 8290 return new NativeArrayBuffer(toIndex$1(length)); 8291 }; 8292 8293 $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype$1; 8294 8295 for (var keys = getOwnPropertyNames$1(NativeArrayBuffer), j = 0, key; keys.length > j;) { 8296 if (!((key = keys[j++]) in $ArrayBuffer)) { 8297 createNonEnumerableProperty$1($ArrayBuffer, key, NativeArrayBuffer[key]); 8298 } 8299 } 8300 8301 ArrayBufferPrototype$1.constructor = $ArrayBuffer; 8302 } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { 8303 createNonEnumerableProperty$1(NativeArrayBuffer, 'name', ARRAY_BUFFER); 8304 } 8305 8306 // WebKit bug - the same parent prototype for typed arrays and data view 8307 if (setPrototypeOf$1 && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) { 8308 setPrototypeOf$1(DataViewPrototype, ObjectPrototype); 8309 } 8310 8311 // iOS Safari 7.x bug 8312 var testView = new $DataView(new $ArrayBuffer(2)); 8313 var $setInt8 = uncurryThis$5(DataViewPrototype.setInt8); 8314 testView.setInt8(0, 2147483648); 8315 testView.setInt8(1, 2147483649); 8316 if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll(DataViewPrototype, { 8317 setInt8: function setInt8(byteOffset, value) { 8318 $setInt8(this, byteOffset, value << 24 >> 24); 8319 }, 8320 setUint8: function setUint8(byteOffset, value) { 8321 $setInt8(this, byteOffset, value << 24 >> 24); 8322 } 8323 }, { unsafe: true }); 8324 } 8325 8326 setToStringTag($ArrayBuffer, ARRAY_BUFFER); 8327 setToStringTag($DataView, DATA_VIEW); 8328 8329 var arrayBuffer = { 8330 ArrayBuffer: $ArrayBuffer, 8331 DataView: $DataView 8332 }; 8333 8334 var isObject$3 = isObject$s; 8335 8336 var floor$1 = Math.floor; 8337 8338 // `IsIntegralNumber` abstract operation 8339 // https://tc39.es/ecma262/#sec-isintegralnumber 8340 // eslint-disable-next-line es/no-number-isinteger -- safe 8341 var isIntegralNumber$1 = Number.isInteger || function isInteger(it) { 8342 return !isObject$3(it) && isFinite(it) && floor$1(it) === it; 8343 }; 8344 8345 var global$9 = global$1e; 8346 var toIntegerOrInfinity$2 = toIntegerOrInfinity$c; 8347 8348 var RangeError$3 = global$9.RangeError; 8349 8350 var toPositiveInteger$1 = function (it) { 8351 var result = toIntegerOrInfinity$2(it); 8352 if (result < 0) throw RangeError$3("The argument can't be less than 0"); 8353 return result; 8354 }; 8355 8356 var global$8 = global$1e; 8357 var toPositiveInteger = toPositiveInteger$1; 8358 8359 var RangeError$2 = global$8.RangeError; 8360 8361 var toOffset$2 = function (it, BYTES) { 8362 var offset = toPositiveInteger(it); 8363 if (offset % BYTES) throw RangeError$2('Wrong offset'); 8364 return offset; 8365 }; 8366 8367 var bind = functionBindContext; 8368 var call$2 = functionCall; 8369 var aConstructor = aConstructor$2; 8370 var toObject$3 = toObject$g; 8371 var lengthOfArrayLike$6 = lengthOfArrayLike$h; 8372 var getIterator = getIterator$4; 8373 var getIteratorMethod = getIteratorMethod$5; 8374 var isArrayIteratorMethod = isArrayIteratorMethod$3; 8375 var aTypedArrayConstructor$2 = arrayBufferViewCore.aTypedArrayConstructor; 8376 8377 var typedArrayFrom$1 = function from(source /* , mapfn, thisArg */) { 8378 var C = aConstructor(this); 8379 var O = toObject$3(source); 8380 var argumentsLength = arguments.length; 8381 var mapfn = argumentsLength > 1 ? arguments[1] : undefined; 8382 var mapping = mapfn !== undefined; 8383 var iteratorMethod = getIteratorMethod(O); 8384 var i, length, result, step, iterator, next; 8385 if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { 8386 iterator = getIterator(O, iteratorMethod); 8387 next = iterator.next; 8388 O = []; 8389 while (!(step = call$2(next, iterator)).done) { 8390 O.push(step.value); 8391 } 8392 } 8393 if (mapping && argumentsLength > 2) { 8394 mapfn = bind(mapfn, arguments[2]); 8395 } 8396 length = lengthOfArrayLike$6(O); 8397 result = new (aTypedArrayConstructor$2(C))(length); 8398 for (i = 0; length > i; i++) { 8399 result[i] = mapping ? mapfn(O[i], i) : O[i]; 8400 } 8401 return result; 8402 }; 8403 8404 var $ = _export; 8405 var global$7 = global$1e; 8406 var call$1 = functionCall; 8407 var DESCRIPTORS = descriptors; 8408 var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = typedArrayConstructorsRequireWrappers; 8409 var ArrayBufferViewCore$o = arrayBufferViewCore; 8410 var ArrayBufferModule = arrayBuffer; 8411 var anInstance = anInstance$8; 8412 var createPropertyDescriptor = createPropertyDescriptor$8; 8413 var createNonEnumerableProperty = createNonEnumerableProperty$a; 8414 var isIntegralNumber = isIntegralNumber$1; 8415 var toLength$1 = toLength$a; 8416 var toIndex = toIndex$2; 8417 var toOffset$1 = toOffset$2; 8418 var toPropertyKey = toPropertyKey$5; 8419 var hasOwn$1 = hasOwnProperty_1; 8420 var classof = classof$d; 8421 var isObject$2 = isObject$s; 8422 var isSymbol$1 = isSymbol$6; 8423 var create = objectCreate; 8424 var isPrototypeOf = objectIsPrototypeOf; 8425 var setPrototypeOf = objectSetPrototypeOf; 8426 var getOwnPropertyNames = objectGetOwnPropertyNames.f; 8427 var typedArrayFrom = typedArrayFrom$1; 8428 var forEach = arrayIteration.forEach; 8429 var setSpecies = setSpecies$3; 8430 var definePropertyModule = objectDefineProperty; 8431 var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor; 8432 var InternalStateModule = internalState; 8433 var inheritIfRequired = inheritIfRequired$3; 8434 8435 var getInternalState = InternalStateModule.get; 8436 var setInternalState = InternalStateModule.set; 8437 var nativeDefineProperty = definePropertyModule.f; 8438 var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; 8439 var round = Math.round; 8440 var RangeError$1 = global$7.RangeError; 8441 var ArrayBuffer$1 = ArrayBufferModule.ArrayBuffer; 8442 var ArrayBufferPrototype = ArrayBuffer$1.prototype; 8443 var DataView$1 = ArrayBufferModule.DataView; 8444 var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore$o.NATIVE_ARRAY_BUFFER_VIEWS; 8445 var TYPED_ARRAY_CONSTRUCTOR$1 = ArrayBufferViewCore$o.TYPED_ARRAY_CONSTRUCTOR; 8446 var TYPED_ARRAY_TAG = ArrayBufferViewCore$o.TYPED_ARRAY_TAG; 8447 var TypedArray = ArrayBufferViewCore$o.TypedArray; 8448 var TypedArrayPrototype$1 = ArrayBufferViewCore$o.TypedArrayPrototype; 8449 var aTypedArrayConstructor$1 = ArrayBufferViewCore$o.aTypedArrayConstructor; 8450 var isTypedArray = ArrayBufferViewCore$o.isTypedArray; 8451 var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; 8452 var WRONG_LENGTH = 'Wrong length'; 8453 8454 var fromList = function (C, list) { 8455 aTypedArrayConstructor$1(C); 8456 var index = 0; 8457 var length = list.length; 8458 var result = new C(length); 8459 while (length > index) result[index] = list[index++]; 8460 return result; 8461 }; 8462 8463 var addGetter = function (it, key) { 8464 nativeDefineProperty(it, key, { get: function () { 8465 return getInternalState(this)[key]; 8466 } }); 8467 }; 8468 8469 var isArrayBuffer = function (it) { 8470 var klass; 8471 return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; 8472 }; 8473 8474 var isTypedArrayIndex = function (target, key) { 8475 return isTypedArray(target) 8476 && !isSymbol$1(key) 8477 && key in target 8478 && isIntegralNumber(+key) 8479 && key >= 0; 8480 }; 8481 8482 var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { 8483 key = toPropertyKey(key); 8484 return isTypedArrayIndex(target, key) 8485 ? createPropertyDescriptor(2, target[key]) 8486 : nativeGetOwnPropertyDescriptor(target, key); 8487 }; 8488 8489 var wrappedDefineProperty = function defineProperty(target, key, descriptor) { 8490 key = toPropertyKey(key); 8491 if (isTypedArrayIndex(target, key) 8492 && isObject$2(descriptor) 8493 && hasOwn$1(descriptor, 'value') 8494 && !hasOwn$1(descriptor, 'get') 8495 && !hasOwn$1(descriptor, 'set') 8496 // TODO: add validation descriptor w/o calling accessors 8497 && !descriptor.configurable 8498 && (!hasOwn$1(descriptor, 'writable') || descriptor.writable) 8499 && (!hasOwn$1(descriptor, 'enumerable') || descriptor.enumerable) 8500 ) { 8501 target[key] = descriptor.value; 8502 return target; 8503 } return nativeDefineProperty(target, key, descriptor); 8504 }; 8505 8506 if (DESCRIPTORS) { 8507 if (!NATIVE_ARRAY_BUFFER_VIEWS) { 8508 getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; 8509 definePropertyModule.f = wrappedDefineProperty; 8510 addGetter(TypedArrayPrototype$1, 'buffer'); 8511 addGetter(TypedArrayPrototype$1, 'byteOffset'); 8512 addGetter(TypedArrayPrototype$1, 'byteLength'); 8513 addGetter(TypedArrayPrototype$1, 'length'); 8514 } 8515 8516 $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { 8517 getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, 8518 defineProperty: wrappedDefineProperty 8519 }); 8520 8521 typedArrayConstructor.exports = function (TYPE, wrapper, CLAMPED) { 8522 var BYTES = TYPE.match(/\d+$/)[0] / 8; 8523 var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; 8524 var GETTER = 'get' + TYPE; 8525 var SETTER = 'set' + TYPE; 8526 var NativeTypedArrayConstructor = global$7[CONSTRUCTOR_NAME]; 8527 var TypedArrayConstructor = NativeTypedArrayConstructor; 8528 var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; 8529 var exported = {}; 8530 8531 var getter = function (that, index) { 8532 var data = getInternalState(that); 8533 return data.view[GETTER](index * BYTES + data.byteOffset, true); 8534 }; 8535 8536 var setter = function (that, index, value) { 8537 var data = getInternalState(that); 8538 if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; 8539 data.view[SETTER](index * BYTES + data.byteOffset, value, true); 8540 }; 8541 8542 var addElement = function (that, index) { 8543 nativeDefineProperty(that, index, { 8544 get: function () { 8545 return getter(this, index); 8546 }, 8547 set: function (value) { 8548 return setter(this, index, value); 8549 }, 8550 enumerable: true 8551 }); 8552 }; 8553 8554 if (!NATIVE_ARRAY_BUFFER_VIEWS) { 8555 TypedArrayConstructor = wrapper(function (that, data, offset, $length) { 8556 anInstance(that, TypedArrayConstructorPrototype); 8557 var index = 0; 8558 var byteOffset = 0; 8559 var buffer, byteLength, length; 8560 if (!isObject$2(data)) { 8561 length = toIndex(data); 8562 byteLength = length * BYTES; 8563 buffer = new ArrayBuffer$1(byteLength); 8564 } else if (isArrayBuffer(data)) { 8565 buffer = data; 8566 byteOffset = toOffset$1(offset, BYTES); 8567 var $len = data.byteLength; 8568 if ($length === undefined) { 8569 if ($len % BYTES) throw RangeError$1(WRONG_LENGTH); 8570 byteLength = $len - byteOffset; 8571 if (byteLength < 0) throw RangeError$1(WRONG_LENGTH); 8572 } else { 8573 byteLength = toLength$1($length) * BYTES; 8574 if (byteLength + byteOffset > $len) throw RangeError$1(WRONG_LENGTH); 8575 } 8576 length = byteLength / BYTES; 8577 } else if (isTypedArray(data)) { 8578 return fromList(TypedArrayConstructor, data); 8579 } else { 8580 return call$1(typedArrayFrom, TypedArrayConstructor, data); 8581 } 8582 setInternalState(that, { 8583 buffer: buffer, 8584 byteOffset: byteOffset, 8585 byteLength: byteLength, 8586 length: length, 8587 view: new DataView$1(buffer) 8588 }); 8589 while (index < length) addElement(that, index++); 8590 }); 8591 8592 if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); 8593 TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype$1); 8594 } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { 8595 TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { 8596 anInstance(dummy, TypedArrayConstructorPrototype); 8597 return inheritIfRequired(function () { 8598 if (!isObject$2(data)) return new NativeTypedArrayConstructor(toIndex(data)); 8599 if (isArrayBuffer(data)) return $length !== undefined 8600 ? new NativeTypedArrayConstructor(data, toOffset$1(typedArrayOffset, BYTES), $length) 8601 : typedArrayOffset !== undefined 8602 ? new NativeTypedArrayConstructor(data, toOffset$1(typedArrayOffset, BYTES)) 8603 : new NativeTypedArrayConstructor(data); 8604 if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); 8605 return call$1(typedArrayFrom, TypedArrayConstructor, data); 8606 }(), dummy, TypedArrayConstructor); 8607 }); 8608 8609 if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); 8610 forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { 8611 if (!(key in TypedArrayConstructor)) { 8612 createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); 8613 } 8614 }); 8615 TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; 8616 } 8617 8618 if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { 8619 createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); 8620 } 8621 8622 createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR$1, TypedArrayConstructor); 8623 8624 if (TYPED_ARRAY_TAG) { 8625 createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); 8626 } 8627 8628 exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; 8629 8630 $({ 8631 global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS 8632 }, exported); 8633 8634 if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { 8635 createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); 8636 } 8637 8638 if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { 8639 createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); 8640 } 8641 8642 setSpecies(CONSTRUCTOR_NAME); 8643 }; 8644 } else typedArrayConstructor.exports = function () { /* empty */ }; 8645 8646 var createTypedArrayConstructor = typedArrayConstructor.exports; 8647 8648 // `Uint8Array` constructor 8649 // https://tc39.es/ecma262/#sec-typedarray-objects 8650 createTypedArrayConstructor('Uint8', function (init) { 8651 return function Uint8Array(data, byteOffset, length) { 8652 return init(this, data, byteOffset, length); 8653 }; 8654 }); 8655 8656 var ArrayBufferViewCore$n = arrayBufferViewCore; 8657 var lengthOfArrayLike$5 = lengthOfArrayLike$h; 8658 var toIntegerOrInfinity$1 = toIntegerOrInfinity$c; 8659 8660 var aTypedArray$m = ArrayBufferViewCore$n.aTypedArray; 8661 var exportTypedArrayMethod$n = ArrayBufferViewCore$n.exportTypedArrayMethod; 8662 8663 // `%TypedArray%.prototype.at` method 8664 // https://github.com/tc39/proposal-relative-indexing-method 8665 exportTypedArrayMethod$n('at', function at(index) { 8666 var O = aTypedArray$m(this); 8667 var len = lengthOfArrayLike$5(O); 8668 var relativeIndex = toIntegerOrInfinity$1(index); 8669 var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; 8670 return (k < 0 || k >= len) ? undefined : O[k]; 8671 }); 8672 8673 var toObject$2 = toObject$g; 8674 var toAbsoluteIndex$1 = toAbsoluteIndex$7; 8675 var lengthOfArrayLike$4 = lengthOfArrayLike$h; 8676 8677 var min$1 = Math.min; 8678 8679 // `Array.prototype.copyWithin` method implementation 8680 // https://tc39.es/ecma262/#sec-array.prototype.copywithin 8681 // eslint-disable-next-line es/no-array-prototype-copywithin -- safe 8682 var arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { 8683 var O = toObject$2(this); 8684 var len = lengthOfArrayLike$4(O); 8685 var to = toAbsoluteIndex$1(target, len); 8686 var from = toAbsoluteIndex$1(start, len); 8687 var end = arguments.length > 2 ? arguments[2] : undefined; 8688 var count = min$1((end === undefined ? len : toAbsoluteIndex$1(end, len)) - from, len - to); 8689 var inc = 1; 8690 if (from < to && to < from + count) { 8691 inc = -1; 8692 from += count - 1; 8693 to += count - 1; 8694 } 8695 while (count-- > 0) { 8696 if (from in O) O[to] = O[from]; 8697 else delete O[to]; 8698 to += inc; 8699 from += inc; 8700 } return O; 8701 }; 8702 8703 var uncurryThis$4 = functionUncurryThis; 8704 var ArrayBufferViewCore$m = arrayBufferViewCore; 8705 var $ArrayCopyWithin = arrayCopyWithin; 8706 8707 var u$ArrayCopyWithin = uncurryThis$4($ArrayCopyWithin); 8708 var aTypedArray$l = ArrayBufferViewCore$m.aTypedArray; 8709 var exportTypedArrayMethod$m = ArrayBufferViewCore$m.exportTypedArrayMethod; 8710 8711 // `%TypedArray%.prototype.copyWithin` method 8712 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin 8713 exportTypedArrayMethod$m('copyWithin', function copyWithin(target, start /* , end */) { 8714 return u$ArrayCopyWithin(aTypedArray$l(this), target, start, arguments.length > 2 ? arguments[2] : undefined); 8715 }); 8716 8717 var ArrayBufferViewCore$l = arrayBufferViewCore; 8718 var $every = arrayIteration.every; 8719 8720 var aTypedArray$k = ArrayBufferViewCore$l.aTypedArray; 8721 var exportTypedArrayMethod$l = ArrayBufferViewCore$l.exportTypedArrayMethod; 8722 8723 // `%TypedArray%.prototype.every` method 8724 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.every 8725 exportTypedArrayMethod$l('every', function every(callbackfn /* , thisArg */) { 8726 return $every(aTypedArray$k(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 8727 }); 8728 8729 var ArrayBufferViewCore$k = arrayBufferViewCore; 8730 var call = functionCall; 8731 var $fill = arrayFill$1; 8732 8733 var aTypedArray$j = ArrayBufferViewCore$k.aTypedArray; 8734 var exportTypedArrayMethod$k = ArrayBufferViewCore$k.exportTypedArrayMethod; 8735 8736 // `%TypedArray%.prototype.fill` method 8737 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill 8738 exportTypedArrayMethod$k('fill', function fill(value /* , start, end */) { 8739 var length = arguments.length; 8740 return call( 8741 $fill, 8742 aTypedArray$j(this), 8743 value, 8744 length > 1 ? arguments[1] : undefined, 8745 length > 2 ? arguments[2] : undefined 8746 ); 8747 }); 8748 8749 var lengthOfArrayLike$3 = lengthOfArrayLike$h; 8750 8751 var arrayFromConstructorAndList$1 = function (Constructor, list) { 8752 var index = 0; 8753 var length = lengthOfArrayLike$3(list); 8754 var result = new Constructor(length); 8755 while (length > index) result[index] = list[index++]; 8756 return result; 8757 }; 8758 8759 var ArrayBufferViewCore$j = arrayBufferViewCore; 8760 var speciesConstructor = speciesConstructor$3; 8761 8762 var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore$j.TYPED_ARRAY_CONSTRUCTOR; 8763 var aTypedArrayConstructor = ArrayBufferViewCore$j.aTypedArrayConstructor; 8764 8765 // a part of `TypedArraySpeciesCreate` abstract operation 8766 // https://tc39.es/ecma262/#typedarray-species-create 8767 var typedArraySpeciesConstructor$4 = function (originalArray) { 8768 return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR])); 8769 }; 8770 8771 var arrayFromConstructorAndList = arrayFromConstructorAndList$1; 8772 var typedArraySpeciesConstructor$3 = typedArraySpeciesConstructor$4; 8773 8774 var typedArrayFromSpeciesAndList = function (instance, list) { 8775 return arrayFromConstructorAndList(typedArraySpeciesConstructor$3(instance), list); 8776 }; 8777 8778 var ArrayBufferViewCore$i = arrayBufferViewCore; 8779 var $filter = arrayIteration.filter; 8780 var fromSpeciesAndList = typedArrayFromSpeciesAndList; 8781 8782 var aTypedArray$i = ArrayBufferViewCore$i.aTypedArray; 8783 var exportTypedArrayMethod$j = ArrayBufferViewCore$i.exportTypedArrayMethod; 8784 8785 // `%TypedArray%.prototype.filter` method 8786 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter 8787 exportTypedArrayMethod$j('filter', function filter(callbackfn /* , thisArg */) { 8788 var list = $filter(aTypedArray$i(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 8789 return fromSpeciesAndList(this, list); 8790 }); 8791 8792 var ArrayBufferViewCore$h = arrayBufferViewCore; 8793 var $find = arrayIteration.find; 8794 8795 var aTypedArray$h = ArrayBufferViewCore$h.aTypedArray; 8796 var exportTypedArrayMethod$i = ArrayBufferViewCore$h.exportTypedArrayMethod; 8797 8798 // `%TypedArray%.prototype.find` method 8799 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.find 8800 exportTypedArrayMethod$i('find', function find(predicate /* , thisArg */) { 8801 return $find(aTypedArray$h(this), predicate, arguments.length > 1 ? arguments[1] : undefined); 8802 }); 8803 8804 var ArrayBufferViewCore$g = arrayBufferViewCore; 8805 var $findIndex = arrayIteration.findIndex; 8806 8807 var aTypedArray$g = ArrayBufferViewCore$g.aTypedArray; 8808 var exportTypedArrayMethod$h = ArrayBufferViewCore$g.exportTypedArrayMethod; 8809 8810 // `%TypedArray%.prototype.findIndex` method 8811 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex 8812 exportTypedArrayMethod$h('findIndex', function findIndex(predicate /* , thisArg */) { 8813 return $findIndex(aTypedArray$g(this), predicate, arguments.length > 1 ? arguments[1] : undefined); 8814 }); 8815 8816 var ArrayBufferViewCore$f = arrayBufferViewCore; 8817 var $forEach = arrayIteration.forEach; 8818 8819 var aTypedArray$f = ArrayBufferViewCore$f.aTypedArray; 8820 var exportTypedArrayMethod$g = ArrayBufferViewCore$f.exportTypedArrayMethod; 8821 8822 // `%TypedArray%.prototype.forEach` method 8823 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach 8824 exportTypedArrayMethod$g('forEach', function forEach(callbackfn /* , thisArg */) { 8825 $forEach(aTypedArray$f(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 8826 }); 8827 8828 var ArrayBufferViewCore$e = arrayBufferViewCore; 8829 var $includes = arrayIncludes.includes; 8830 8831 var aTypedArray$e = ArrayBufferViewCore$e.aTypedArray; 8832 var exportTypedArrayMethod$f = ArrayBufferViewCore$e.exportTypedArrayMethod; 8833 8834 // `%TypedArray%.prototype.includes` method 8835 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes 8836 exportTypedArrayMethod$f('includes', function includes(searchElement /* , fromIndex */) { 8837 return $includes(aTypedArray$e(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); 8838 }); 8839 8840 var ArrayBufferViewCore$d = arrayBufferViewCore; 8841 var $indexOf = arrayIncludes.indexOf; 8842 8843 var aTypedArray$d = ArrayBufferViewCore$d.aTypedArray; 8844 var exportTypedArrayMethod$e = ArrayBufferViewCore$d.exportTypedArrayMethod; 8845 8846 // `%TypedArray%.prototype.indexOf` method 8847 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof 8848 exportTypedArrayMethod$e('indexOf', function indexOf(searchElement /* , fromIndex */) { 8849 return $indexOf(aTypedArray$d(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); 8850 }); 8851 8852 var global$6 = global$1e; 8853 var fails$5 = fails$I; 8854 var uncurryThis$3 = functionUncurryThis; 8855 var ArrayBufferViewCore$c = arrayBufferViewCore; 8856 var ArrayIterators = es_array_iterator; 8857 var wellKnownSymbol = wellKnownSymbol$s; 8858 8859 var ITERATOR = wellKnownSymbol('iterator'); 8860 var Uint8Array$2 = global$6.Uint8Array; 8861 var arrayValues = uncurryThis$3(ArrayIterators.values); 8862 var arrayKeys = uncurryThis$3(ArrayIterators.keys); 8863 var arrayEntries = uncurryThis$3(ArrayIterators.entries); 8864 var aTypedArray$c = ArrayBufferViewCore$c.aTypedArray; 8865 var exportTypedArrayMethod$d = ArrayBufferViewCore$c.exportTypedArrayMethod; 8866 var TypedArrayPrototype = Uint8Array$2 && Uint8Array$2.prototype; 8867 8868 var GENERIC = !fails$5(function () { 8869 TypedArrayPrototype[ITERATOR].call([1]); 8870 }); 8871 8872 var ITERATOR_IS_VALUES = !!TypedArrayPrototype 8873 && TypedArrayPrototype.values 8874 && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values 8875 && TypedArrayPrototype.values.name === 'values'; 8876 8877 var typedArrayValues = function values() { 8878 return arrayValues(aTypedArray$c(this)); 8879 }; 8880 8881 // `%TypedArray%.prototype.entries` method 8882 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries 8883 exportTypedArrayMethod$d('entries', function entries() { 8884 return arrayEntries(aTypedArray$c(this)); 8885 }, GENERIC); 8886 // `%TypedArray%.prototype.keys` method 8887 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys 8888 exportTypedArrayMethod$d('keys', function keys() { 8889 return arrayKeys(aTypedArray$c(this)); 8890 }, GENERIC); 8891 // `%TypedArray%.prototype.values` method 8892 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values 8893 exportTypedArrayMethod$d('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); 8894 // `%TypedArray%.prototype[@@iterator]` method 8895 // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator 8896 exportTypedArrayMethod$d(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); 8897 8898 var ArrayBufferViewCore$b = arrayBufferViewCore; 8899 var uncurryThis$2 = functionUncurryThis; 8900 8901 var aTypedArray$b = ArrayBufferViewCore$b.aTypedArray; 8902 var exportTypedArrayMethod$c = ArrayBufferViewCore$b.exportTypedArrayMethod; 8903 var $join = uncurryThis$2([].join); 8904 8905 // `%TypedArray%.prototype.join` method 8906 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join 8907 exportTypedArrayMethod$c('join', function join(separator) { 8908 return $join(aTypedArray$b(this), separator); 8909 }); 8910 8911 /* eslint-disable es/no-array-prototype-lastindexof -- safe */ 8912 var apply$2 = functionApply; 8913 var toIndexedObject = toIndexedObject$a; 8914 var toIntegerOrInfinity = toIntegerOrInfinity$c; 8915 var lengthOfArrayLike$2 = lengthOfArrayLike$h; 8916 var arrayMethodIsStrict = arrayMethodIsStrict$4; 8917 8918 var min = Math.min; 8919 var $lastIndexOf$1 = [].lastIndexOf; 8920 var NEGATIVE_ZERO = !!$lastIndexOf$1 && 1 / [1].lastIndexOf(1, -0) < 0; 8921 var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); 8922 var FORCED$3 = NEGATIVE_ZERO || !STRICT_METHOD; 8923 8924 // `Array.prototype.lastIndexOf` method implementation 8925 // https://tc39.es/ecma262/#sec-array.prototype.lastindexof 8926 var arrayLastIndexOf = FORCED$3 ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { 8927 // convert -0 to +0 8928 if (NEGATIVE_ZERO) return apply$2($lastIndexOf$1, this, arguments) || 0; 8929 var O = toIndexedObject(this); 8930 var length = lengthOfArrayLike$2(O); 8931 var index = length - 1; 8932 if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1])); 8933 if (index < 0) index = length + index; 8934 for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; 8935 return -1; 8936 } : $lastIndexOf$1; 8937 8938 var ArrayBufferViewCore$a = arrayBufferViewCore; 8939 var apply$1 = functionApply; 8940 var $lastIndexOf = arrayLastIndexOf; 8941 8942 var aTypedArray$a = ArrayBufferViewCore$a.aTypedArray; 8943 var exportTypedArrayMethod$b = ArrayBufferViewCore$a.exportTypedArrayMethod; 8944 8945 // `%TypedArray%.prototype.lastIndexOf` method 8946 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof 8947 exportTypedArrayMethod$b('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { 8948 var length = arguments.length; 8949 return apply$1($lastIndexOf, aTypedArray$a(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]); 8950 }); 8951 8952 var ArrayBufferViewCore$9 = arrayBufferViewCore; 8953 var $map = arrayIteration.map; 8954 var typedArraySpeciesConstructor$2 = typedArraySpeciesConstructor$4; 8955 8956 var aTypedArray$9 = ArrayBufferViewCore$9.aTypedArray; 8957 var exportTypedArrayMethod$a = ArrayBufferViewCore$9.exportTypedArrayMethod; 8958 8959 // `%TypedArray%.prototype.map` method 8960 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.map 8961 exportTypedArrayMethod$a('map', function map(mapfn /* , thisArg */) { 8962 return $map(aTypedArray$9(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { 8963 return new (typedArraySpeciesConstructor$2(O))(length); 8964 }); 8965 }); 8966 8967 var global$5 = global$1e; 8968 var aCallable$1 = aCallable$8; 8969 var toObject$1 = toObject$g; 8970 var IndexedObject = indexedObject; 8971 var lengthOfArrayLike$1 = lengthOfArrayLike$h; 8972 8973 var TypeError$1 = global$5.TypeError; 8974 8975 // `Array.prototype.{ reduce, reduceRight }` methods implementation 8976 var createMethod = function (IS_RIGHT) { 8977 return function (that, callbackfn, argumentsLength, memo) { 8978 aCallable$1(callbackfn); 8979 var O = toObject$1(that); 8980 var self = IndexedObject(O); 8981 var length = lengthOfArrayLike$1(O); 8982 var index = IS_RIGHT ? length - 1 : 0; 8983 var i = IS_RIGHT ? -1 : 1; 8984 if (argumentsLength < 2) while (true) { 8985 if (index in self) { 8986 memo = self[index]; 8987 index += i; 8988 break; 8989 } 8990 index += i; 8991 if (IS_RIGHT ? index < 0 : length <= index) { 8992 throw TypeError$1('Reduce of empty array with no initial value'); 8993 } 8994 } 8995 for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { 8996 memo = callbackfn(memo, self[index], index, O); 8997 } 8998 return memo; 8999 }; 9000 }; 9001 9002 var arrayReduce = { 9003 // `Array.prototype.reduce` method 9004 // https://tc39.es/ecma262/#sec-array.prototype.reduce 9005 left: createMethod(false), 9006 // `Array.prototype.reduceRight` method 9007 // https://tc39.es/ecma262/#sec-array.prototype.reduceright 9008 right: createMethod(true) 9009 }; 9010 9011 var ArrayBufferViewCore$8 = arrayBufferViewCore; 9012 var $reduce = arrayReduce.left; 9013 9014 var aTypedArray$8 = ArrayBufferViewCore$8.aTypedArray; 9015 var exportTypedArrayMethod$9 = ArrayBufferViewCore$8.exportTypedArrayMethod; 9016 9017 // `%TypedArray%.prototype.reduce` method 9018 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce 9019 exportTypedArrayMethod$9('reduce', function reduce(callbackfn /* , initialValue */) { 9020 var length = arguments.length; 9021 return $reduce(aTypedArray$8(this), callbackfn, length, length > 1 ? arguments[1] : undefined); 9022 }); 9023 9024 var ArrayBufferViewCore$7 = arrayBufferViewCore; 9025 var $reduceRight = arrayReduce.right; 9026 9027 var aTypedArray$7 = ArrayBufferViewCore$7.aTypedArray; 9028 var exportTypedArrayMethod$8 = ArrayBufferViewCore$7.exportTypedArrayMethod; 9029 9030 // `%TypedArray%.prototype.reduceRicht` method 9031 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright 9032 exportTypedArrayMethod$8('reduceRight', function reduceRight(callbackfn /* , initialValue */) { 9033 var length = arguments.length; 9034 return $reduceRight(aTypedArray$7(this), callbackfn, length, length > 1 ? arguments[1] : undefined); 9035 }); 9036 9037 var ArrayBufferViewCore$6 = arrayBufferViewCore; 9038 9039 var aTypedArray$6 = ArrayBufferViewCore$6.aTypedArray; 9040 var exportTypedArrayMethod$7 = ArrayBufferViewCore$6.exportTypedArrayMethod; 9041 var floor = Math.floor; 9042 9043 // `%TypedArray%.prototype.reverse` method 9044 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse 9045 exportTypedArrayMethod$7('reverse', function reverse() { 9046 var that = this; 9047 var length = aTypedArray$6(that).length; 9048 var middle = floor(length / 2); 9049 var index = 0; 9050 var value; 9051 while (index < middle) { 9052 value = that[index]; 9053 that[index++] = that[--length]; 9054 that[length] = value; 9055 } return that; 9056 }); 9057 9058 var global$4 = global$1e; 9059 var ArrayBufferViewCore$5 = arrayBufferViewCore; 9060 var lengthOfArrayLike = lengthOfArrayLike$h; 9061 var toOffset = toOffset$2; 9062 var toObject = toObject$g; 9063 var fails$4 = fails$I; 9064 9065 var RangeError = global$4.RangeError; 9066 var aTypedArray$5 = ArrayBufferViewCore$5.aTypedArray; 9067 var exportTypedArrayMethod$6 = ArrayBufferViewCore$5.exportTypedArrayMethod; 9068 9069 var FORCED$2 = fails$4(function () { 9070 // eslint-disable-next-line es/no-typed-arrays -- required for testing 9071 new Int8Array(1).set({}); 9072 }); 9073 9074 // `%TypedArray%.prototype.set` method 9075 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set 9076 exportTypedArrayMethod$6('set', function set(arrayLike /* , offset */) { 9077 aTypedArray$5(this); 9078 var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); 9079 var length = this.length; 9080 var src = toObject(arrayLike); 9081 var len = lengthOfArrayLike(src); 9082 var index = 0; 9083 if (len + offset > length) throw RangeError('Wrong length'); 9084 while (index < len) this[offset + index] = src[index++]; 9085 }, FORCED$2); 9086 9087 var ArrayBufferViewCore$4 = arrayBufferViewCore; 9088 var typedArraySpeciesConstructor$1 = typedArraySpeciesConstructor$4; 9089 var fails$3 = fails$I; 9090 var arraySlice$1 = arraySlice$9; 9091 9092 var aTypedArray$4 = ArrayBufferViewCore$4.aTypedArray; 9093 var exportTypedArrayMethod$5 = ArrayBufferViewCore$4.exportTypedArrayMethod; 9094 9095 var FORCED$1 = fails$3(function () { 9096 // eslint-disable-next-line es/no-typed-arrays -- required for testing 9097 new Int8Array(1).slice(); 9098 }); 9099 9100 // `%TypedArray%.prototype.slice` method 9101 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice 9102 exportTypedArrayMethod$5('slice', function slice(start, end) { 9103 var list = arraySlice$1(aTypedArray$4(this), start, end); 9104 var C = typedArraySpeciesConstructor$1(this); 9105 var index = 0; 9106 var length = list.length; 9107 var result = new C(length); 9108 while (length > index) result[index] = list[index++]; 9109 return result; 9110 }, FORCED$1); 9111 9112 var ArrayBufferViewCore$3 = arrayBufferViewCore; 9113 var $some = arrayIteration.some; 9114 9115 var aTypedArray$3 = ArrayBufferViewCore$3.aTypedArray; 9116 var exportTypedArrayMethod$4 = ArrayBufferViewCore$3.exportTypedArrayMethod; 9117 9118 // `%TypedArray%.prototype.some` method 9119 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.some 9120 exportTypedArrayMethod$4('some', function some(callbackfn /* , thisArg */) { 9121 return $some(aTypedArray$3(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 9122 }); 9123 9124 var global$3 = global$1e; 9125 var uncurryThis$1 = functionUncurryThis; 9126 var fails$2 = fails$I; 9127 var aCallable = aCallable$8; 9128 var internalSort = arraySort$1; 9129 var ArrayBufferViewCore$2 = arrayBufferViewCore; 9130 var FF = engineFfVersion; 9131 var IE_OR_EDGE = engineIsIeOrEdge; 9132 var V8 = engineV8Version; 9133 var WEBKIT = engineWebkitVersion; 9134 9135 var Array$1 = global$3.Array; 9136 var aTypedArray$2 = ArrayBufferViewCore$2.aTypedArray; 9137 var exportTypedArrayMethod$3 = ArrayBufferViewCore$2.exportTypedArrayMethod; 9138 var Uint16Array = global$3.Uint16Array; 9139 var un$Sort = Uint16Array && uncurryThis$1(Uint16Array.prototype.sort); 9140 9141 // WebKit 9142 var ACCEPT_INCORRECT_ARGUMENTS = !!un$Sort && !(fails$2(function () { 9143 un$Sort(new Uint16Array(2), null); 9144 }) && fails$2(function () { 9145 un$Sort(new Uint16Array(2), {}); 9146 })); 9147 9148 var STABLE_SORT = !!un$Sort && !fails$2(function () { 9149 // feature detection can be too slow, so check engines versions 9150 if (V8) return V8 < 74; 9151 if (FF) return FF < 67; 9152 if (IE_OR_EDGE) return true; 9153 if (WEBKIT) return WEBKIT < 602; 9154 9155 var array = new Uint16Array(516); 9156 var expected = Array$1(516); 9157 var index, mod; 9158 9159 for (index = 0; index < 516; index++) { 9160 mod = index % 4; 9161 array[index] = 515 - index; 9162 expected[index] = index - 2 * mod + 3; 9163 } 9164 9165 un$Sort(array, function (a, b) { 9166 return (a / 4 | 0) - (b / 4 | 0); 9167 }); 9168 9169 for (index = 0; index < 516; index++) { 9170 if (array[index] !== expected[index]) return true; 9171 } 9172 }); 9173 9174 var getSortCompare = function (comparefn) { 9175 return function (x, y) { 9176 if (comparefn !== undefined) return +comparefn(x, y) || 0; 9177 // eslint-disable-next-line no-self-compare -- NaN check 9178 if (y !== y) return -1; 9179 // eslint-disable-next-line no-self-compare -- NaN check 9180 if (x !== x) return 1; 9181 if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1; 9182 return x > y; 9183 }; 9184 }; 9185 9186 // `%TypedArray%.prototype.sort` method 9187 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort 9188 exportTypedArrayMethod$3('sort', function sort(comparefn) { 9189 if (comparefn !== undefined) aCallable(comparefn); 9190 if (STABLE_SORT) return un$Sort(this, comparefn); 9191 9192 return internalSort(aTypedArray$2(this), getSortCompare(comparefn)); 9193 }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); 9194 9195 var ArrayBufferViewCore$1 = arrayBufferViewCore; 9196 var toLength = toLength$a; 9197 var toAbsoluteIndex = toAbsoluteIndex$7; 9198 var typedArraySpeciesConstructor = typedArraySpeciesConstructor$4; 9199 9200 var aTypedArray$1 = ArrayBufferViewCore$1.aTypedArray; 9201 var exportTypedArrayMethod$2 = ArrayBufferViewCore$1.exportTypedArrayMethod; 9202 9203 // `%TypedArray%.prototype.subarray` method 9204 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray 9205 exportTypedArrayMethod$2('subarray', function subarray(begin, end) { 9206 var O = aTypedArray$1(this); 9207 var length = O.length; 9208 var beginIndex = toAbsoluteIndex(begin, length); 9209 var C = typedArraySpeciesConstructor(O); 9210 return new C( 9211 O.buffer, 9212 O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, 9213 toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) 9214 ); 9215 }); 9216 9217 var global$2 = global$1e; 9218 var apply = functionApply; 9219 var ArrayBufferViewCore = arrayBufferViewCore; 9220 var fails$1 = fails$I; 9221 var arraySlice = arraySlice$9; 9222 9223 var Int8Array$1 = global$2.Int8Array; 9224 var aTypedArray = ArrayBufferViewCore.aTypedArray; 9225 var exportTypedArrayMethod$1 = ArrayBufferViewCore.exportTypedArrayMethod; 9226 var $toLocaleString = [].toLocaleString; 9227 9228 // iOS Safari 6.x fails here 9229 var TO_LOCALE_STRING_BUG = !!Int8Array$1 && fails$1(function () { 9230 $toLocaleString.call(new Int8Array$1(1)); 9231 }); 9232 9233 var FORCED = fails$1(function () { 9234 return [1, 2].toLocaleString() != new Int8Array$1([1, 2]).toLocaleString(); 9235 }) || !fails$1(function () { 9236 Int8Array$1.prototype.toLocaleString.call([1, 2]); 9237 }); 9238 9239 // `%TypedArray%.prototype.toLocaleString` method 9240 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring 9241 exportTypedArrayMethod$1('toLocaleString', function toLocaleString() { 9242 return apply( 9243 $toLocaleString, 9244 TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this), 9245 arraySlice(arguments) 9246 ); 9247 }, FORCED); 9248 9249 var exportTypedArrayMethod = arrayBufferViewCore.exportTypedArrayMethod; 9250 var fails = fails$I; 9251 var global$1 = global$1e; 9252 var uncurryThis = functionUncurryThis; 9253 9254 var Uint8Array$1 = global$1.Uint8Array; 9255 var Uint8ArrayPrototype = Uint8Array$1 && Uint8Array$1.prototype || {}; 9256 var arrayToString = [].toString; 9257 var join = uncurryThis([].join); 9258 9259 if (fails(function () { arrayToString.call({}); })) { 9260 arrayToString = function toString() { 9261 return join(this); 9262 }; 9263 } 9264 9265 var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; 9266 9267 // `%TypedArray%.prototype.toString` method 9268 // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring 9269 exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); 9270 9271 var mediaManager = {}; 9272 9273 var _mutations; 9274 9275 function makeMap(str, expectsLowerCase) { 9276 var map = Object.create(null); 9277 var list = str.split(','); 9278 9279 for (var _i = 0; _i < list.length; _i++) { 9280 map[list[_i]] = true; 9281 } 9282 9283 return expectsLowerCase ? function (val) { 9284 return !!map[val.toLowerCase()]; 9285 } : function (val) { 9286 return !!map[val]; 9287 }; 9288 } 9289 /** 9290 * On the client we only need to offer special cases for boolean attributes that 9291 * have different names from their corresponding dom properties: 9292 * - itemscope -> N/A 9293 * - allowfullscreen -> allowFullscreen 9294 * - formnovalidate -> formNoValidate 9295 * - ismap -> isMap 9296 * - nomodule -> noModule 9297 * - novalidate -> noValidate 9298 * - readonly -> readOnly 9299 */ 9300 9301 9302 var specialBooleanAttrs = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly"; 9303 var isSpecialBooleanAttr = /*#__PURE__*/makeMap(specialBooleanAttrs); 9304 /** 9305 * Boolean attributes should be included if the value is truthy or ''. 9306 * e.g. `<select multiple>` compiles to `{ multiple: '' }` 9307 */ 9308 9309 function includeBooleanAttr(value) { 9310 return !!value || value === ''; 9311 } 9312 9313 function normalizeStyle(value) { 9314 if (isArray(value)) { 9315 var res = {}; 9316 9317 for (var _i2 = 0; _i2 < value.length; _i2++) { 9318 var item = value[_i2]; 9319 var normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); 9320 9321 if (normalized) { 9322 for (var key in normalized) { 9323 res[key] = normalized[key]; 9324 } 9325 } 9326 } 9327 9328 return res; 9329 } else if (isString(value)) { 9330 return value; 9331 } else if (isObject$1(value)) { 9332 return value; 9333 } 9334 } 9335 9336 var listDelimiterRE = /;(?![^(]*\))/g; 9337 var propertyDelimiterRE = /:(.+)/; 9338 9339 function parseStringStyle(cssText) { 9340 var ret = {}; 9341 cssText.split(listDelimiterRE).forEach(function (item) { 9342 if (item) { 9343 var tmp = item.split(propertyDelimiterRE); 9344 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); 9345 } 9346 }); 9347 return ret; 9348 } 9349 9350 function normalizeClass(value) { 9351 var res = ''; 9352 9353 if (isString(value)) { 9354 res = value; 9355 } else if (isArray(value)) { 9356 for (var _i3 = 0; _i3 < value.length; _i3++) { 9357 var normalized = normalizeClass(value[_i3]); 9358 9359 if (normalized) { 9360 res += normalized + ' '; 9361 } 9362 } 9363 } else if (isObject$1(value)) { 9364 for (var name in value) { 9365 if (value[name]) { 9366 res += name + ' '; 9367 } 9368 } 9369 } 9370 9371 return res.trim(); 9372 } 9373 /** 9374 * For converting {{ interpolation }} values to displayed strings. 9375 * @private 9376 */ 9377 9378 9379 var toDisplayString = function toDisplayString(val) { 9380 return val == null ? '' : isArray(val) || isObject$1(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); 9381 }; 9382 9383 var replacer = function replacer(_key, val) { 9384 // can't use isRef here since @vue/shared has no deps 9385 if (val && val.__v_isRef) { 9386 return replacer(_key, val.value); 9387 } else if (isMap(val)) { 9388 var _ref6; 9389 9390 return _ref6 = {}, _ref6["Map(" + val.size + ")"] = [].concat(val.entries()).reduce(function (entries, _ref) { 9391 var key = _ref[0], 9392 val = _ref[1]; 9393 entries[key + " =>"] = val; 9394 return entries; 9395 }, {}), _ref6; 9396 } else if (isSet(val)) { 9397 var _ref7; 9398 9399 return _ref7 = {}, _ref7["Set(" + val.size + ")"] = [].concat(val.values()), _ref7; 9400 } else if (isObject$1(val) && !isArray(val) && !isPlainObject(val)) { 9401 return String(val); 9402 } 9403 9404 return val; 9405 }; 9406 9407 var EMPTY_OBJ = {}; 9408 var EMPTY_ARR = []; 9409 9410 var NOOP = function NOOP() {}; 9411 /** 9412 * Always return false. 9413 */ 9414 9415 9416 var NO = function NO() { 9417 return false; 9418 }; 9419 9420 var onRE = /^on[^a-z]/; 9421 9422 var isOn = function isOn(key) { 9423 return onRE.test(key); 9424 }; 9425 9426 var isModelListener = function isModelListener(key) { 9427 return key.startsWith('onUpdate:'); 9428 }; 9429 9430 var extend = Object.assign; 9431 9432 var remove = function remove(arr, el) { 9433 var i = arr.indexOf(el); 9434 9435 if (i > -1) { 9436 arr.splice(i, 1); 9437 } 9438 }; 9439 9440 var hasOwnProperty = Object.prototype.hasOwnProperty; 9441 9442 var hasOwn = function hasOwn(val, key) { 9443 return hasOwnProperty.call(val, key); 9444 }; 9445 9446 var isArray = Array.isArray; 9447 9448 var isMap = function isMap(val) { 9449 return toTypeString(val) === '[object Map]'; 9450 }; 9451 9452 var isSet = function isSet(val) { 9453 return toTypeString(val) === '[object Set]'; 9454 }; 9455 9456 var isFunction = function isFunction(val) { 9457 return typeof val === 'function'; 9458 }; 9459 9460 var isString = function isString(val) { 9461 return typeof val === 'string'; 9462 }; 9463 9464 var isSymbol = function isSymbol(val) { 9465 return typeof val === 'symbol'; 9466 }; 9467 9468 var isObject$1 = function isObject$1(val) { 9469 return val !== null && typeof val === 'object'; 9470 }; 9471 9472 var isPromise$1 = function isPromise$1(val) { 9473 return isObject$1(val) && isFunction(val.then) && isFunction(val.catch); 9474 }; 9475 9476 var objectToString = Object.prototype.toString; 9477 9478 var toTypeString = function toTypeString(value) { 9479 return objectToString.call(value); 9480 }; 9481 9482 var toRawType = function toRawType(value) { 9483 // extract "RawType" from strings like "[object RawType]" 9484 return toTypeString(value).slice(8, -1); 9485 }; 9486 9487 var isPlainObject = function isPlainObject(val) { 9488 return toTypeString(val) === '[object Object]'; 9489 }; 9490 9491 var isIntegerKey = function isIntegerKey(key) { 9492 return isString(key) && key !== 'NaN' && key[0] !== '-' && '' + parseInt(key, 10) === key; 9493 }; 9494 9495 var isReservedProp = /*#__PURE__*/makeMap( // the leading comma is intentional so empty string "" is also included 9496 ',key,ref,ref_for,ref_key,' + 'onVnodeBeforeMount,onVnodeMounted,' + 'onVnodeBeforeUpdate,onVnodeUpdated,' + 'onVnodeBeforeUnmount,onVnodeUnmounted'); 9497 9498 var cacheStringFunction = function cacheStringFunction(fn) { 9499 var cache = Object.create(null); 9500 return function (str) { 9501 var hit = cache[str]; 9502 return hit || (cache[str] = fn(str)); 9503 }; 9504 }; 9505 9506 var camelizeRE = /-(\w)/g; 9507 /** 9508 * @private 9509 */ 9510 9511 var camelize = cacheStringFunction(function (str) { 9512 return str.replace(camelizeRE, function (_, c) { 9513 return c ? c.toUpperCase() : ''; 9514 }); 9515 }); 9516 var hyphenateRE = /\B([A-Z])/g; 9517 /** 9518 * @private 9519 */ 9520 9521 var hyphenate = cacheStringFunction(function (str) { 9522 return str.replace(hyphenateRE, '-$1').toLowerCase(); 9523 }); 9524 /** 9525 * @private 9526 */ 9527 9528 var capitalize = cacheStringFunction(function (str) { 9529 return str.charAt(0).toUpperCase() + str.slice(1); 9530 }); 9531 /** 9532 * @private 9533 */ 9534 9535 var toHandlerKey = cacheStringFunction(function (str) { 9536 return str ? "on" + capitalize(str) : ""; 9537 }); // compare whether a value has changed, accounting for NaN. 9538 9539 var hasChanged = function hasChanged(value, oldValue) { 9540 return !Object.is(value, oldValue); 9541 }; 9542 9543 var invokeArrayFns = function invokeArrayFns(fns, arg) { 9544 for (var _i4 = 0; _i4 < fns.length; _i4++) { 9545 fns[_i4](arg); 9546 } 9547 }; 9548 9549 var def = function def(obj, key, value) { 9550 Object.defineProperty(obj, key, { 9551 configurable: true, 9552 enumerable: false, 9553 value: value 9554 }); 9555 }; 9556 9557 var toNumber = function toNumber(val) { 9558 var n = parseFloat(val); 9559 return isNaN(n) ? val : n; 9560 }; 9561 9562 var _globalThis; 9563 9564 var getGlobalThis = function getGlobalThis() { 9565 return _globalThis || (_globalThis = typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : {}); 9566 }; 9567 9568 var activeEffectScope; 9569 var effectScopeStack = []; 9570 9571 var EffectScope = /*#__PURE__*/function () { 9572 function EffectScope(detached) { 9573 if (detached === void 0) { 9574 detached = false; 9575 } 9576 9577 this.active = true; 9578 this.effects = []; 9579 this.cleanups = []; 9580 9581 if (!detached && activeEffectScope) { 9582 this.parent = activeEffectScope; 9583 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1; 9584 } 9585 } 9586 9587 var _proto = EffectScope.prototype; 9588 9589 _proto.run = function run(fn) { 9590 if (this.active) { 9591 try { 9592 this.on(); 9593 return fn(); 9594 } finally { 9595 this.off(); 9596 } 9597 } 9598 }; 9599 9600 _proto.on = function on() { 9601 if (this.active) { 9602 effectScopeStack.push(this); 9603 activeEffectScope = this; 9604 } 9605 }; 9606 9607 _proto.off = function off() { 9608 if (this.active) { 9609 effectScopeStack.pop(); 9610 activeEffectScope = effectScopeStack[effectScopeStack.length - 1]; 9611 } 9612 }; 9613 9614 _proto.stop = function stop(fromParent) { 9615 if (this.active) { 9616 this.effects.forEach(function (e) { 9617 return e.stop(); 9618 }); 9619 this.cleanups.forEach(function (cleanup) { 9620 return cleanup(); 9621 }); 9622 9623 if (this.scopes) { 9624 this.scopes.forEach(function (e) { 9625 return e.stop(true); 9626 }); 9627 } // nested scope, dereference from parent to avoid memory leaks 9628 9629 9630 if (this.parent && !fromParent) { 9631 // optimized O(1) removal 9632 var last = this.parent.scopes.pop(); 9633 9634 if (last && last !== this) { 9635 this.parent.scopes[this.index] = last; 9636 last.index = this.index; 9637 } 9638 } 9639 9640 this.active = false; 9641 } 9642 }; 9643 9644 return EffectScope; 9645 }(); 9646 9647 function recordEffectScope(effect, scope) { 9648 scope = scope || activeEffectScope; 9649 9650 if (scope && scope.active) { 9651 scope.effects.push(effect); 9652 } 9653 } 9654 9655 var createDep = function createDep(effects) { 9656 var dep = new Set(effects); 9657 dep.w = 0; 9658 dep.n = 0; 9659 return dep; 9660 }; 9661 9662 var wasTracked = function wasTracked(dep) { 9663 return (dep.w & trackOpBit) > 0; 9664 }; 9665 9666 var newTracked = function newTracked(dep) { 9667 return (dep.n & trackOpBit) > 0; 9668 }; 9669 9670 var initDepMarkers = function initDepMarkers(_ref) { 9671 var deps = _ref.deps; 9672 9673 if (deps.length) { 9674 for (var _i5 = 0; _i5 < deps.length; _i5++) { 9675 deps[_i5].w |= trackOpBit; // set was tracked 9676 } 9677 } 9678 }; 9679 9680 var finalizeDepMarkers = function finalizeDepMarkers(effect) { 9681 var deps = effect.deps; 9682 9683 if (deps.length) { 9684 var ptr = 0; 9685 9686 for (var _i6 = 0; _i6 < deps.length; _i6++) { 9687 var dep = deps[_i6]; 9688 9689 if (wasTracked(dep) && !newTracked(dep)) { 9690 dep.delete(effect); 9691 } else { 9692 deps[ptr++] = dep; 9693 } // clear bits 9694 9695 9696 dep.w &= ~trackOpBit; 9697 dep.n &= ~trackOpBit; 9698 } 9699 9700 deps.length = ptr; 9701 } 9702 }; 9703 9704 var targetMap = new WeakMap(); // The number of effects currently being tracked recursively. 9705 9706 var effectTrackDepth = 0; 9707 var trackOpBit = 1; 9708 /** 9709 * The bitwise track markers support at most 30 levels of recursion. 9710 * This value is chosen to enable modern JS engines to use a SMI on all platforms. 9711 * When recursion depth is greater, fall back to using a full cleanup. 9712 */ 9713 9714 var maxMarkerBits = 30; 9715 var effectStack = []; 9716 var activeEffect; 9717 var ITERATE_KEY = Symbol(''); 9718 var MAP_KEY_ITERATE_KEY = Symbol(''); 9719 9720 var ReactiveEffect = /*#__PURE__*/function () { 9721 function ReactiveEffect(fn, scheduler, scope) { 9722 if (scheduler === void 0) { 9723 scheduler = null; 9724 } 9725 9726 this.fn = fn; 9727 this.scheduler = scheduler; 9728 this.active = true; 9729 this.deps = []; 9730 recordEffectScope(this, scope); 9731 } 9732 9733 var _proto2 = ReactiveEffect.prototype; 9734 9735 _proto2.run = function run() { 9736 if (!this.active) { 9737 return this.fn(); 9738 } 9739 9740 if (!effectStack.includes(this)) { 9741 try { 9742 effectStack.push(activeEffect = this); 9743 enableTracking(); 9744 trackOpBit = 1 << ++effectTrackDepth; 9745 9746 if (effectTrackDepth <= maxMarkerBits) { 9747 initDepMarkers(this); 9748 } else { 9749 cleanupEffect(this); 9750 } 9751 9752 return this.fn(); 9753 } finally { 9754 if (effectTrackDepth <= maxMarkerBits) { 9755 finalizeDepMarkers(this); 9756 } 9757 9758 trackOpBit = 1 << --effectTrackDepth; 9759 resetTracking(); 9760 effectStack.pop(); 9761 var _n = effectStack.length; 9762 activeEffect = _n > 0 ? effectStack[_n - 1] : undefined; 9763 } 9764 } 9765 }; 9766 9767 _proto2.stop = function stop() { 9768 if (this.active) { 9769 cleanupEffect(this); 9770 9771 if (this.onStop) { 9772 this.onStop(); 9773 } 9774 9775 this.active = false; 9776 } 9777 }; 9778 9779 return ReactiveEffect; 9780 }(); 9781 9782 function cleanupEffect(effect) { 9783 var deps = effect.deps; 9784 9785 if (deps.length) { 9786 for (var _i7 = 0; _i7 < deps.length; _i7++) { 9787 deps[_i7].delete(effect); 9788 } 9789 9790 deps.length = 0; 9791 } 9792 } 9793 9794 var shouldTrack = true; 9795 var trackStack = []; 9796 9797 function pauseTracking() { 9798 trackStack.push(shouldTrack); 9799 shouldTrack = false; 9800 } 9801 9802 function enableTracking() { 9803 trackStack.push(shouldTrack); 9804 shouldTrack = true; 9805 } 9806 9807 function resetTracking() { 9808 var last = trackStack.pop(); 9809 shouldTrack = last === undefined ? true : last; 9810 } 9811 9812 function track(target, type, key) { 9813 if (!isTracking()) { 9814 return; 9815 } 9816 9817 var depsMap = targetMap.get(target); 9818 9819 if (!depsMap) { 9820 targetMap.set(target, depsMap = new Map()); 9821 } 9822 9823 var dep = depsMap.get(key); 9824 9825 if (!dep) { 9826 depsMap.set(key, dep = createDep()); 9827 } 9828 9829 trackEffects(dep); 9830 } 9831 9832 function isTracking() { 9833 return shouldTrack && activeEffect !== undefined; 9834 } 9835 9836 function trackEffects(dep, debuggerEventExtraInfo) { 9837 var shouldTrack = false; 9838 9839 if (effectTrackDepth <= maxMarkerBits) { 9840 if (!newTracked(dep)) { 9841 dep.n |= trackOpBit; // set newly tracked 9842 9843 shouldTrack = !wasTracked(dep); 9844 } 9845 } else { 9846 // Full cleanup mode. 9847 shouldTrack = !dep.has(activeEffect); 9848 } 9849 9850 if (shouldTrack) { 9851 dep.add(activeEffect); 9852 activeEffect.deps.push(dep); 9853 } 9854 } 9855 9856 function trigger$1(target, type, key, newValue, oldValue, oldTarget) { 9857 var depsMap = targetMap.get(target); 9858 9859 if (!depsMap) { 9860 // never been tracked 9861 return; 9862 } 9863 9864 var deps = []; 9865 9866 if (type === "clear" 9867 /* CLEAR */ 9868 ) { 9869 // collection being cleared 9870 // trigger all effects for target 9871 deps = [].concat(depsMap.values()); 9872 } else if (key === 'length' && isArray(target)) { 9873 depsMap.forEach(function (dep, key) { 9874 if (key === 'length' || key >= newValue) { 9875 deps.push(dep); 9876 } 9877 }); 9878 } else { 9879 // schedule runs for SET | ADD | DELETE 9880 if (key !== void 0) { 9881 deps.push(depsMap.get(key)); 9882 } // also run for iteration key on ADD | DELETE | Map.SET 9883 9884 9885 switch (type) { 9886 case "add" 9887 /* ADD */ 9888 : 9889 if (!isArray(target)) { 9890 deps.push(depsMap.get(ITERATE_KEY)); 9891 9892 if (isMap(target)) { 9893 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 9894 } 9895 } else if (isIntegerKey(key)) { 9896 // new index added to array -> length changes 9897 deps.push(depsMap.get('length')); 9898 } 9899 9900 break; 9901 9902 case "delete" 9903 /* DELETE */ 9904 : 9905 if (!isArray(target)) { 9906 deps.push(depsMap.get(ITERATE_KEY)); 9907 9908 if (isMap(target)) { 9909 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 9910 } 9911 } 9912 9913 break; 9914 9915 case "set" 9916 /* SET */ 9917 : 9918 if (isMap(target)) { 9919 deps.push(depsMap.get(ITERATE_KEY)); 9920 } 9921 9922 break; 9923 } 9924 } 9925 9926 if (deps.length === 1) { 9927 if (deps[0]) { 9928 { 9929 triggerEffects(deps[0]); 9930 } 9931 } 9932 } else { 9933 var effects = []; 9934 9935 for (var _iterator = _createForOfIteratorHelperLoose(deps), _step; !(_step = _iterator()).done;) { 9936 var dep = _step.value; 9937 9938 if (dep) { 9939 effects.push.apply(effects, dep); 9940 } 9941 } 9942 9943 { 9944 triggerEffects(createDep(effects)); 9945 } 9946 } 9947 } 9948 9949 function triggerEffects(dep, debuggerEventExtraInfo) { 9950 // spread into array for stabilization 9951 for (var _iterator2 = _createForOfIteratorHelperLoose(isArray(dep) ? dep : [].concat(dep)), _step2; !(_step2 = _iterator2()).done;) { 9952 var effect = _step2.value; 9953 9954 if (effect !== activeEffect || effect.allowRecurse) { 9955 if (effect.scheduler) { 9956 effect.scheduler(); 9957 } else { 9958 effect.run(); 9959 } 9960 } 9961 } 9962 } 9963 9964 var isNonTrackableKeys = /*#__PURE__*/makeMap("__proto__,__v_isRef,__isVue"); 9965 var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(function (key) { 9966 return Symbol[key]; 9967 }).filter(isSymbol)); 9968 var get = /*#__PURE__*/createGetter(); 9969 var shallowGet = /*#__PURE__*/createGetter(false, true); 9970 var readonlyGet = /*#__PURE__*/createGetter(true); 9971 var arrayInstrumentations = /*#__PURE__*/createArrayInstrumentations(); 9972 9973 function createArrayInstrumentations() { 9974 var instrumentations = {}; 9975 ['includes', 'indexOf', 'lastIndexOf'].forEach(function (key) { 9976 instrumentations[key] = function () { 9977 var arr = toRaw(this); 9978 9979 for (var _i8 = 0, l = this.length; _i8 < l; _i8++) { 9980 track(arr, "get" 9981 /* GET */ 9982 , _i8 + ''); 9983 } // we run the method using the original args first (which may be reactive) 9984 9985 9986 for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { 9987 args[_key3] = arguments[_key3]; 9988 } 9989 9990 var res = arr[key].apply(arr, args); 9991 9992 if (res === -1 || res === false) { 9993 // if that didn't work, run it again using raw values. 9994 return arr[key].apply(arr, args.map(toRaw)); 9995 } else { 9996 return res; 9997 } 9998 }; 9999 }); 10000 ['push', 'pop', 'shift', 'unshift', 'splice'].forEach(function (key) { 10001 instrumentations[key] = function () { 10002 pauseTracking(); 10003 10004 for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) { 10005 args[_key4] = arguments[_key4]; 10006 } 10007 10008 var res = toRaw(this)[key].apply(this, args); 10009 resetTracking(); 10010 return res; 10011 }; 10012 }); 10013 return instrumentations; 10014 } 10015 10016 function createGetter(isReadonly, shallow) { 10017 if (isReadonly === void 0) { 10018 isReadonly = false; 10019 } 10020 10021 if (shallow === void 0) { 10022 shallow = false; 10023 } 10024 10025 return function get(target, key, receiver) { 10026 if (key === "__v_isReactive" 10027 /* IS_REACTIVE */ 10028 ) { 10029 return !isReadonly; 10030 } else if (key === "__v_isReadonly" 10031 /* IS_READONLY */ 10032 ) { 10033 return isReadonly; 10034 } else if (key === "__v_raw" 10035 /* RAW */ 10036 && receiver === (isReadonly ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { 10037 return target; 10038 } 10039 10040 var targetIsArray = isArray(target); 10041 10042 if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) { 10043 return Reflect.get(arrayInstrumentations, key, receiver); 10044 } 10045 10046 var res = Reflect.get(target, key, receiver); 10047 10048 if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { 10049 return res; 10050 } 10051 10052 if (!isReadonly) { 10053 track(target, "get" 10054 /* GET */ 10055 , key); 10056 } 10057 10058 if (shallow) { 10059 return res; 10060 } 10061 10062 if (isRef(res)) { 10063 // ref unwrapping - does not apply for Array + integer key. 10064 var shouldUnwrap = !targetIsArray || !isIntegerKey(key); 10065 return shouldUnwrap ? res.value : res; 10066 } 10067 10068 if (isObject$1(res)) { 10069 // Convert returned value into a proxy as well. we do the isObject check 10070 // here to avoid invalid value warning. Also need to lazy access readonly 10071 // and reactive here to avoid circular dependency. 10072 return isReadonly ? readonly(res) : reactive(res); 10073 } 10074 10075 return res; 10076 }; 10077 } 10078 10079 var set = /*#__PURE__*/createSetter(); 10080 var shallowSet = /*#__PURE__*/createSetter(true); 10081 10082 function createSetter(shallow) { 10083 if (shallow === void 0) { 10084 shallow = false; 10085 } 10086 10087 return function set(target, key, value, receiver) { 10088 var oldValue = target[key]; 10089 10090 if (!shallow && !isReadonly(value)) { 10091 value = toRaw(value); 10092 oldValue = toRaw(oldValue); 10093 10094 if (!isArray(target) && isRef(oldValue) && !isRef(value)) { 10095 oldValue.value = value; 10096 return true; 10097 } 10098 } 10099 10100 var hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); 10101 var result = Reflect.set(target, key, value, receiver); // don't trigger if target is something up in the prototype chain of original 10102 10103 if (target === toRaw(receiver)) { 10104 if (!hadKey) { 10105 trigger$1(target, "add" 10106 /* ADD */ 10107 , key, value); 10108 } else if (hasChanged(value, oldValue)) { 10109 trigger$1(target, "set" 10110 /* SET */ 10111 , key, value); 10112 } 10113 } 10114 10115 return result; 10116 }; 10117 } 10118 10119 function deleteProperty(target, key) { 10120 var hadKey = hasOwn(target, key); 10121 target[key]; 10122 var result = Reflect.deleteProperty(target, key); 10123 10124 if (result && hadKey) { 10125 trigger$1(target, "delete" 10126 /* DELETE */ 10127 , key, undefined); 10128 } 10129 10130 return result; 10131 } 10132 10133 function has(target, key) { 10134 var result = Reflect.has(target, key); 10135 10136 if (!isSymbol(key) || !builtInSymbols.has(key)) { 10137 track(target, "has" 10138 /* HAS */ 10139 , key); 10140 } 10141 10142 return result; 10143 } 10144 10145 function ownKeys(target) { 10146 track(target, "iterate" 10147 /* ITERATE */ 10148 , isArray(target) ? 'length' : ITERATE_KEY); 10149 return Reflect.ownKeys(target); 10150 } 10151 10152 var mutableHandlers = { 10153 get: get, 10154 set: set, 10155 deleteProperty: deleteProperty, 10156 has: has, 10157 ownKeys: ownKeys 10158 }; 10159 var readonlyHandlers = { 10160 get: readonlyGet, 10161 set: function set(target, key) { 10162 return true; 10163 }, 10164 deleteProperty: function deleteProperty(target, key) { 10165 return true; 10166 } 10167 }; 10168 var shallowReactiveHandlers = /*#__PURE__*/extend({}, mutableHandlers, { 10169 get: shallowGet, 10170 set: shallowSet 10171 }); // Props handlers are special in the sense that it should not unwrap top-level 10172 10173 var toShallow = function toShallow(value) { 10174 return value; 10175 }; 10176 10177 var getProto = function getProto(v) { 10178 return Reflect.getPrototypeOf(v); 10179 }; 10180 10181 function get$1(target, key, isReadonly, isShallow) { 10182 if (isReadonly === void 0) { 10183 isReadonly = false; 10184 } 10185 10186 if (isShallow === void 0) { 10187 isShallow = false; 10188 } // #1772: readonly(reactive(Map)) should return readonly + reactive version 10189 // of the value 10190 10191 10192 target = target["__v_raw" 10193 /* RAW */ 10194 ]; 10195 var rawTarget = toRaw(target); 10196 var rawKey = toRaw(key); 10197 10198 if (key !== rawKey) { 10199 !isReadonly && track(rawTarget, "get" 10200 /* GET */ 10201 , key); 10202 } 10203 10204 !isReadonly && track(rawTarget, "get" 10205 /* GET */ 10206 , rawKey); 10207 10208 var _getProto = getProto(rawTarget), 10209 has = _getProto.has; 10210 10211 var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; 10212 10213 if (has.call(rawTarget, key)) { 10214 return wrap(target.get(key)); 10215 } else if (has.call(rawTarget, rawKey)) { 10216 return wrap(target.get(rawKey)); 10217 } else if (target !== rawTarget) { 10218 // #3602 readonly(reactive(Map)) 10219 // ensure that the nested reactive `Map` can do tracking for itself 10220 target.get(key); 10221 } 10222 } 10223 10224 function has$1(key, isReadonly) { 10225 if (isReadonly === void 0) { 10226 isReadonly = false; 10227 } 10228 10229 var target = this["__v_raw" 10230 /* RAW */ 10231 ]; 10232 var rawTarget = toRaw(target); 10233 var rawKey = toRaw(key); 10234 10235 if (key !== rawKey) { 10236 !isReadonly && track(rawTarget, "has" 10237 /* HAS */ 10238 , key); 10239 } 10240 10241 !isReadonly && track(rawTarget, "has" 10242 /* HAS */ 10243 , rawKey); 10244 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); 10245 } 10246 10247 function size(target, isReadonly) { 10248 if (isReadonly === void 0) { 10249 isReadonly = false; 10250 } 10251 10252 target = target["__v_raw" 10253 /* RAW */ 10254 ]; 10255 !isReadonly && track(toRaw(target), "iterate" 10256 /* ITERATE */ 10257 , ITERATE_KEY); 10258 return Reflect.get(target, 'size', target); 10259 } 10260 10261 function add(value) { 10262 value = toRaw(value); 10263 var target = toRaw(this); 10264 var proto = getProto(target); 10265 var hadKey = proto.has.call(target, value); 10266 10267 if (!hadKey) { 10268 target.add(value); 10269 trigger$1(target, "add" 10270 /* ADD */ 10271 , value, value); 10272 } 10273 10274 return this; 10275 } 10276 10277 function set$1(key, value) { 10278 value = toRaw(value); 10279 var target = toRaw(this); 10280 10281 var _getProto2 = getProto(target), 10282 has = _getProto2.has, 10283 get = _getProto2.get; 10284 10285 var hadKey = has.call(target, key); 10286 10287 if (!hadKey) { 10288 key = toRaw(key); 10289 hadKey = has.call(target, key); 10290 } 10291 10292 var oldValue = get.call(target, key); 10293 target.set(key, value); 10294 10295 if (!hadKey) { 10296 trigger$1(target, "add" 10297 /* ADD */ 10298 , key, value); 10299 } else if (hasChanged(value, oldValue)) { 10300 trigger$1(target, "set" 10301 /* SET */ 10302 , key, value); 10303 } 10304 10305 return this; 10306 } 10307 10308 function deleteEntry(key) { 10309 var target = toRaw(this); 10310 10311 var _getProto3 = getProto(target), 10312 has = _getProto3.has, 10313 get = _getProto3.get; 10314 10315 var hadKey = has.call(target, key); 10316 10317 if (!hadKey) { 10318 key = toRaw(key); 10319 hadKey = has.call(target, key); 10320 } 10321 10322 get ? get.call(target, key) : undefined; // forward the operation before queueing reactions 10323 10324 var result = target.delete(key); 10325 10326 if (hadKey) { 10327 trigger$1(target, "delete" 10328 /* DELETE */ 10329 , key, undefined); 10330 } 10331 10332 return result; 10333 } 10334 10335 function clear() { 10336 var target = toRaw(this); 10337 var hadItems = target.size !== 0; 10338 var result = target.clear(); 10339 10340 if (hadItems) { 10341 trigger$1(target, "clear" 10342 /* CLEAR */ 10343 , undefined, undefined); 10344 } 10345 10346 return result; 10347 } 10348 10349 function createForEach(isReadonly, isShallow) { 10350 return function forEach(callback, thisArg) { 10351 var observed = this; 10352 var target = observed["__v_raw" 10353 /* RAW */ 10354 ]; 10355 var rawTarget = toRaw(target); 10356 var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; 10357 !isReadonly && track(rawTarget, "iterate" 10358 /* ITERATE */ 10359 , ITERATE_KEY); 10360 return target.forEach(function (value, key) { 10361 // important: make sure the callback is 10362 // 1. invoked with the reactive map as `this` and 3rd arg 10363 // 2. the value received should be a corresponding reactive/readonly. 10364 return callback.call(thisArg, wrap(value), wrap(key), observed); 10365 }); 10366 }; 10367 } 10368 10369 function createIterableMethod(method, isReadonly, isShallow) { 10370 return function () { 10371 var _ref11; 10372 10373 var target = this["__v_raw" 10374 /* RAW */ 10375 ]; 10376 var rawTarget = toRaw(target); 10377 var targetIsMap = isMap(rawTarget); 10378 var isPair = method === 'entries' || method === Symbol.iterator && targetIsMap; 10379 var isKeyOnly = method === 'keys' && targetIsMap; 10380 var innerIterator = target[method].apply(target, arguments); 10381 var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; 10382 !isReadonly && track(rawTarget, "iterate" 10383 /* ITERATE */ 10384 , isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); // return a wrapped iterator which returns observed versions of the 10385 // values emitted from the real iterator 10386 10387 return _ref11 = { 10388 // iterator protocol 10389 next: function next() { 10390 var _innerIterator$next = innerIterator.next(), 10391 value = _innerIterator$next.value, 10392 done = _innerIterator$next.done; 10393 10394 return done ? { 10395 value: value, 10396 done: done 10397 } : { 10398 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), 10399 done: done 10400 }; 10401 } 10402 }, _ref11[Symbol.iterator] = function () { 10403 return this; 10404 }, _ref11; 10405 }; 10406 } 10407 10408 function createReadonlyMethod(type) { 10409 return function () { 10410 return type === "delete" 10411 /* DELETE */ 10412 ? false : this; 10413 }; 10414 } 10415 10416 function createInstrumentations() { 10417 var mutableInstrumentations = { 10418 get: function get(key) { 10419 return get$1(this, key); 10420 }, 10421 10422 get size() { 10423 return size(this); 10424 }, 10425 10426 has: has$1, 10427 add: add, 10428 set: set$1, 10429 delete: deleteEntry, 10430 clear: clear, 10431 forEach: createForEach(false, false) 10432 }; 10433 var shallowInstrumentations = { 10434 get: function get(key) { 10435 return get$1(this, key, false, true); 10436 }, 10437 10438 get size() { 10439 return size(this); 10440 }, 10441 10442 has: has$1, 10443 add: add, 10444 set: set$1, 10445 delete: deleteEntry, 10446 clear: clear, 10447 forEach: createForEach(false, true) 10448 }; 10449 var readonlyInstrumentations = { 10450 get: function get(key) { 10451 return get$1(this, key, true); 10452 }, 10453 10454 get size() { 10455 return size(this, true); 10456 }, 10457 10458 has: function has(key) { 10459 return has$1.call(this, key, true); 10460 }, 10461 add: createReadonlyMethod("add" 10462 /* ADD */ 10463 ), 10464 set: createReadonlyMethod("set" 10465 /* SET */ 10466 ), 10467 delete: createReadonlyMethod("delete" 10468 /* DELETE */ 10469 ), 10470 clear: createReadonlyMethod("clear" 10471 /* CLEAR */ 10472 ), 10473 forEach: createForEach(true, false) 10474 }; 10475 var shallowReadonlyInstrumentations = { 10476 get: function get(key) { 10477 return get$1(this, key, true, true); 10478 }, 10479 10480 get size() { 10481 return size(this, true); 10482 }, 10483 10484 has: function has(key) { 10485 return has$1.call(this, key, true); 10486 }, 10487 add: createReadonlyMethod("add" 10488 /* ADD */ 10489 ), 10490 set: createReadonlyMethod("set" 10491 /* SET */ 10492 ), 10493 delete: createReadonlyMethod("delete" 10494 /* DELETE */ 10495 ), 10496 clear: createReadonlyMethod("clear" 10497 /* CLEAR */ 10498 ), 10499 forEach: createForEach(true, true) 10500 }; 10501 var iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator]; 10502 iteratorMethods.forEach(function (method) { 10503 mutableInstrumentations[method] = createIterableMethod(method, false, false); 10504 readonlyInstrumentations[method] = createIterableMethod(method, true, false); 10505 shallowInstrumentations[method] = createIterableMethod(method, false, true); 10506 shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true); 10507 }); 10508 return [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations]; 10509 } 10510 10511 var _createInstrumentatio = /* #__PURE__*/createInstrumentations(), 10512 mutableInstrumentations = _createInstrumentatio[0], 10513 readonlyInstrumentations = _createInstrumentatio[1], 10514 shallowInstrumentations = _createInstrumentatio[2], 10515 shallowReadonlyInstrumentations = _createInstrumentatio[3]; 10516 10517 function createInstrumentationGetter(isReadonly, shallow) { 10518 var instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; 10519 return function (target, key, receiver) { 10520 if (key === "__v_isReactive" 10521 /* IS_REACTIVE */ 10522 ) { 10523 return !isReadonly; 10524 } else if (key === "__v_isReadonly" 10525 /* IS_READONLY */ 10526 ) { 10527 return isReadonly; 10528 } else if (key === "__v_raw" 10529 /* RAW */ 10530 ) { 10531 return target; 10532 } 10533 10534 return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); 10535 }; 10536 } 10537 10538 var mutableCollectionHandlers = { 10539 get: /*#__PURE__*/createInstrumentationGetter(false, false) 10540 }; 10541 var shallowCollectionHandlers = { 10542 get: /*#__PURE__*/createInstrumentationGetter(false, true) 10543 }; 10544 var readonlyCollectionHandlers = { 10545 get: /*#__PURE__*/createInstrumentationGetter(true, false) 10546 }; 10547 var reactiveMap = new WeakMap(); 10548 var shallowReactiveMap = new WeakMap(); 10549 var readonlyMap = new WeakMap(); 10550 var shallowReadonlyMap = new WeakMap(); 10551 10552 function targetTypeMap(rawType) { 10553 switch (rawType) { 10554 case 'Object': 10555 case 'Array': 10556 return 1 10557 /* COMMON */ 10558 ; 10559 10560 case 'Map': 10561 case 'Set': 10562 case 'WeakMap': 10563 case 'WeakSet': 10564 return 2 10565 /* COLLECTION */ 10566 ; 10567 10568 default: 10569 return 0 10570 /* INVALID */ 10571 ; 10572 } 10573 } 10574 10575 function getTargetType(value) { 10576 return value["__v_skip" 10577 /* SKIP */ 10578 ] || !Object.isExtensible(value) ? 0 10579 /* INVALID */ 10580 : targetTypeMap(toRawType(value)); 10581 } 10582 10583 function reactive(target) { 10584 // if trying to observe a readonly proxy, return the readonly version. 10585 if (target && target["__v_isReadonly" 10586 /* IS_READONLY */ 10587 ]) { 10588 return target; 10589 } 10590 10591 return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); 10592 } 10593 /** 10594 * Return a shallowly-reactive copy of the original object, where only the root 10595 * level properties are reactive. It also does not auto-unwrap refs (even at the 10596 * root level). 10597 */ 10598 10599 10600 function shallowReactive(target) { 10601 return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); 10602 } 10603 /** 10604 * Creates a readonly copy of the original object. Note the returned copy is not 10605 * made reactive, but `readonly` can be called on an already reactive object. 10606 */ 10607 10608 10609 function readonly(target) { 10610 return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); 10611 } 10612 10613 function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) { 10614 if (!isObject$1(target)) { 10615 return target; 10616 } // target is already a Proxy, return it. 10617 // exception: calling readonly() on a reactive object 10618 10619 10620 if (target["__v_raw" 10621 /* RAW */ 10622 ] && !(isReadonly && target["__v_isReactive" 10623 /* IS_REACTIVE */ 10624 ])) { 10625 return target; 10626 } // target already has corresponding Proxy 10627 10628 10629 var existingProxy = proxyMap.get(target); 10630 10631 if (existingProxy) { 10632 return existingProxy; 10633 } // only a whitelist of value types can be observed. 10634 10635 10636 var targetType = getTargetType(target); 10637 10638 if (targetType === 0 10639 /* INVALID */ 10640 ) { 10641 return target; 10642 } 10643 10644 var proxy = new Proxy(target, targetType === 2 10645 /* COLLECTION */ 10646 ? collectionHandlers : baseHandlers); 10647 proxyMap.set(target, proxy); 10648 return proxy; 10649 } 10650 10651 function isReactive(value) { 10652 if (isReadonly(value)) { 10653 return isReactive(value["__v_raw" 10654 /* RAW */ 10655 ]); 10656 } 10657 10658 return !!(value && value["__v_isReactive" 10659 /* IS_REACTIVE */ 10660 ]); 10661 } 10662 10663 function isReadonly(value) { 10664 return !!(value && value["__v_isReadonly" 10665 /* IS_READONLY */ 10666 ]); 10667 } 10668 10669 function isProxy(value) { 10670 return isReactive(value) || isReadonly(value); 10671 } 10672 10673 function toRaw(observed) { 10674 var raw = observed && observed["__v_raw" 10675 /* RAW */ 10676 ]; 10677 return raw ? toRaw(raw) : observed; 10678 } 10679 10680 function markRaw(value) { 10681 def(value, "__v_skip" 10682 /* SKIP */ 10683 , true); 10684 return value; 10685 } 10686 10687 var toReactive = function toReactive(value) { 10688 return isObject$1(value) ? reactive(value) : value; 10689 }; 10690 10691 var toReadonly = function toReadonly(value) { 10692 return isObject$1(value) ? readonly(value) : value; 10693 }; 10694 10695 function trackRefValue(ref) { 10696 if (isTracking()) { 10697 ref = toRaw(ref); 10698 10699 if (!ref.dep) { 10700 ref.dep = createDep(); 10701 } 10702 10703 { 10704 trackEffects(ref.dep); 10705 } 10706 } 10707 } 10708 10709 function triggerRefValue(ref, newVal) { 10710 ref = toRaw(ref); 10711 10712 if (ref.dep) { 10713 { 10714 triggerEffects(ref.dep); 10715 } 10716 } 10717 } 10718 10719 function isRef(r) { 10720 return Boolean(r && r.__v_isRef === true); 10721 } 10722 10723 function unref(ref) { 10724 return isRef(ref) ? ref.value : ref; 10725 } 10726 10727 var shallowUnwrapHandlers = { 10728 get: function get(target, key, receiver) { 10729 return unref(Reflect.get(target, key, receiver)); 10730 }, 10731 set: function set(target, key, value, receiver) { 10732 var oldValue = target[key]; 10733 10734 if (isRef(oldValue) && !isRef(value)) { 10735 oldValue.value = value; 10736 return true; 10737 } else { 10738 return Reflect.set(target, key, value, receiver); 10739 } 10740 } 10741 }; 10742 10743 function proxyRefs(objectWithRefs) { 10744 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); 10745 } 10746 10747 var ComputedRefImpl = /*#__PURE__*/function () { 10748 function ComputedRefImpl(getter, _setter, isReadonly) { 10749 var _this = this; 10750 10751 this._setter = _setter; 10752 this.dep = undefined; 10753 this._dirty = true; 10754 this.__v_isRef = true; 10755 this.effect = new ReactiveEffect(getter, function () { 10756 if (!_this._dirty) { 10757 _this._dirty = true; 10758 triggerRefValue(_this); 10759 } 10760 }); 10761 this["__v_isReadonly" 10762 /* IS_READONLY */ 10763 ] = isReadonly; 10764 } 10765 10766 _createClass(ComputedRefImpl, [{ 10767 key: "value", 10768 get: function get() { 10769 // the computed ref may get wrapped by other proxies e.g. readonly() #3376 10770 var self = toRaw(this); 10771 trackRefValue(self); 10772 10773 if (self._dirty) { 10774 self._dirty = false; 10775 self._value = self.effect.run(); 10776 } 10777 10778 return self._value; 10779 }, 10780 set: function set(newValue) { 10781 this._setter(newValue); 10782 } 10783 }]); 10784 10785 return ComputedRefImpl; 10786 }(); 10787 10788 function computed(getterOrOptions, debugOptions) { 10789 var getter; 10790 var setter; 10791 var onlyGetter = isFunction(getterOrOptions); 10792 10793 if (onlyGetter) { 10794 getter = getterOrOptions; 10795 setter = NOOP; 10796 } else { 10797 getter = getterOrOptions.get; 10798 setter = getterOrOptions.set; 10799 } 10800 10801 var cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter); 10802 return cRef; 10803 } 10804 10805 Promise.resolve(); 10806 var devtools; 10807 var buffer = []; 10808 var devtoolsNotInstalled = false; 10809 10810 function emit(event) { 10811 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 10812 args[_key - 1] = arguments[_key]; 10813 } 10814 10815 if (devtools) { 10816 var _devtools; 10817 10818 (_devtools = devtools).emit.apply(_devtools, [event].concat(args)); 10819 } else if (!devtoolsNotInstalled) { 10820 buffer.push({ 10821 event: event, 10822 args: args 10823 }); 10824 } 10825 } 10826 10827 function setDevtoolsHook(hook, target) { 10828 var _a, _b; 10829 10830 devtools = hook; 10831 10832 if (devtools) { 10833 devtools.enabled = true; 10834 buffer.forEach(function (_ref) { 10835 var _devtools2; 10836 10837 var event = _ref.event, 10838 args = _ref.args; 10839 return (_devtools2 = devtools).emit.apply(_devtools2, [event].concat(args)); 10840 }); 10841 buffer = []; 10842 } else if ( // handle late devtools injection - only do this if we are in an actual 10843 // browser environment to avoid the timer handle stalling test runner exit 10844 // (#4815) 10845 // eslint-disable-next-line no-restricted-globals 10846 typeof window !== 'undefined' && // some envs mock window but not fully 10847 window.HTMLElement && // also exclude jsdom 10848 !((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) { 10849 var replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; 10850 replay.push(function (newHook) { 10851 setDevtoolsHook(newHook, target); 10852 }); // clear buffer after 3s - the user probably doesn't have devtools installed 10853 // at all, and keeping the buffer will cause memory leaks (#4738) 10854 10855 setTimeout(function () { 10856 if (!devtools) { 10857 target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; 10858 devtoolsNotInstalled = true; 10859 buffer = []; 10860 } 10861 }, 3000); 10862 } else { 10863 // non-browser env, assume not installed 10864 devtoolsNotInstalled = true; 10865 buffer = []; 10866 } 10867 } 10868 10869 function devtoolsInitApp(app, version) { 10870 emit("app:init" 10871 /* APP_INIT */ 10872 , app, version, { 10873 Fragment: Fragment, 10874 Text: Text, 10875 Comment: Comment, 10876 Static: Static 10877 }); 10878 } 10879 10880 function devtoolsUnmountApp(app) { 10881 emit("app:unmount" 10882 /* APP_UNMOUNT */ 10883 , app); 10884 } 10885 10886 var devtoolsComponentAdded = /*#__PURE__*/createDevtoolsComponentHook("component:added" 10887 /* COMPONENT_ADDED */ 10888 ); 10889 var devtoolsComponentUpdated = /*#__PURE__*/createDevtoolsComponentHook("component:updated" 10890 /* COMPONENT_UPDATED */ 10891 ); 10892 var devtoolsComponentRemoved = /*#__PURE__*/createDevtoolsComponentHook("component:removed" 10893 /* COMPONENT_REMOVED */ 10894 ); 10895 10896 function createDevtoolsComponentHook(hook) { 10897 return function (component) { 10898 emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component); 10899 }; 10900 } 10901 10902 function devtoolsComponentEmit(component, event, params) { 10903 emit("component:emit" 10904 /* COMPONENT_EMIT */ 10905 , component.appContext.app, component, event, params); 10906 } 10907 10908 function emit$1(instance, event) { 10909 var props = instance.vnode.props || EMPTY_OBJ; 10910 10911 for (var _len2 = arguments.length, rawArgs = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { 10912 rawArgs[_key2 - 2] = arguments[_key2]; 10913 } 10914 10915 var args = rawArgs; 10916 var isModelListener = event.startsWith('update:'); // for v-model update:xxx events, apply modifiers on args 10917 10918 var modelArg = isModelListener && event.slice(7); 10919 10920 if (modelArg && modelArg in props) { 10921 var modifiersKey = (modelArg === 'modelValue' ? 'model' : modelArg) + "Modifiers"; 10922 10923 var _ref12 = props[modifiersKey] || EMPTY_OBJ, 10924 number = _ref12.number, 10925 trim = _ref12.trim; 10926 10927 if (trim) { 10928 args = rawArgs.map(function (a) { 10929 return a.trim(); 10930 }); 10931 } else if (number) { 10932 args = rawArgs.map(toNumber); 10933 } 10934 } 10935 10936 if (__VUE_PROD_DEVTOOLS__) { 10937 devtoolsComponentEmit(instance, event, args); 10938 } 10939 10940 var handlerName; 10941 var handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) 10942 props[handlerName = toHandlerKey(camelize(event))]; // for v-model update:xxx events, also trigger kebab-case equivalent 10943 // for props passed via kebab-case 10944 10945 if (!handler && isModelListener) { 10946 handler = props[handlerName = toHandlerKey(hyphenate(event))]; 10947 } 10948 10949 if (handler) { 10950 callWithAsyncErrorHandling(handler, instance, 6 10951 /* COMPONENT_EVENT_HANDLER */ 10952 , args); 10953 } 10954 10955 var onceHandler = props[handlerName + "Once"]; 10956 10957 if (onceHandler) { 10958 if (!instance.emitted) { 10959 instance.emitted = {}; 10960 } else if (instance.emitted[handlerName]) { 10961 return; 10962 } 10963 10964 instance.emitted[handlerName] = true; 10965 callWithAsyncErrorHandling(onceHandler, instance, 6 10966 /* COMPONENT_EVENT_HANDLER */ 10967 , args); 10968 } 10969 } 10970 10971 function normalizeEmitsOptions(comp, appContext, asMixin) { 10972 if (asMixin === void 0) { 10973 asMixin = false; 10974 } 10975 10976 var cache = appContext.emitsCache; 10977 var cached = cache.get(comp); 10978 10979 if (cached !== undefined) { 10980 return cached; 10981 } 10982 10983 var raw = comp.emits; 10984 var normalized = {}; // apply mixin/extends props 10985 10986 var hasExtends = false; 10987 10988 if (__VUE_OPTIONS_API__ && !isFunction(comp)) { 10989 var extendEmits = function extendEmits(raw) { 10990 var normalizedFromExtend = normalizeEmitsOptions(raw, appContext, true); 10991 10992 if (normalizedFromExtend) { 10993 hasExtends = true; 10994 extend(normalized, normalizedFromExtend); 10995 } 10996 }; 10997 10998 if (!asMixin && appContext.mixins.length) { 10999 appContext.mixins.forEach(extendEmits); 11000 } 11001 11002 if (comp.extends) { 11003 extendEmits(comp.extends); 11004 } 11005 11006 if (comp.mixins) { 11007 comp.mixins.forEach(extendEmits); 11008 } 11009 } 11010 11011 if (!raw && !hasExtends) { 11012 cache.set(comp, null); 11013 return null; 11014 } 11015 11016 if (isArray(raw)) { 11017 raw.forEach(function (key) { 11018 return normalized[key] = null; 11019 }); 11020 } else { 11021 extend(normalized, raw); 11022 } 11023 11024 cache.set(comp, normalized); 11025 return normalized; 11026 } // Check if an incoming prop key is a declared emit event listener. 11027 // e.g. With `emits: { click: null }`, props named `onClick` and `onclick` are 11028 // both considered matched listeners. 11029 11030 11031 function isEmitListener(options, key) { 11032 if (!options || !isOn(key)) { 11033 return false; 11034 } 11035 11036 key = key.slice(2).replace(/Once$/, ''); 11037 return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); 11038 } 11039 /** 11040 * mark the current rendering instance for asset resolution (e.g. 11041 * resolveComponent, resolveDirective) during render 11042 */ 11043 11044 11045 var currentRenderingInstance = null; 11046 var currentScopeId = null; 11047 /** 11048 * Note: rendering calls maybe nested. The function returns the parent rendering 11049 * instance if present, which should be restored after the render is done: 11050 * 11051 * ```js 11052 * const prev = setCurrentRenderingInstance(i) 11053 * // ...render 11054 * setCurrentRenderingInstance(prev) 11055 * ``` 11056 */ 11057 11058 function setCurrentRenderingInstance(instance) { 11059 var prev = currentRenderingInstance; 11060 currentRenderingInstance = instance; 11061 currentScopeId = instance && instance.type.__scopeId || null; 11062 return prev; 11063 } 11064 /** 11065 * Wrap a slot function to memoize current rendering instance 11066 * @private compiler helper 11067 */ 11068 11069 11070 function withCtx(fn, ctx, isNonScopedSlot // false only 11071 ) { 11072 if (ctx === void 0) { 11073 ctx = currentRenderingInstance; 11074 } 11075 11076 if (!ctx) return fn; // already normalized 11077 11078 if (fn._n) { 11079 return fn; 11080 } 11081 11082 var renderFnWithContext = function renderFnWithContext() { 11083 // If a user calls a compiled slot inside a template expression (#1745), it 11084 // can mess up block tracking, so by default we disable block tracking and 11085 // force bail out when invoking a compiled slot (indicated by the ._d flag). 11086 // This isn't necessary if rendering a compiled `<slot>`, so we flip the 11087 // ._d flag off when invoking the wrapped fn inside `renderSlot`. 11088 if (renderFnWithContext._d) { 11089 setBlockTracking(-1); 11090 } 11091 11092 var prevInstance = setCurrentRenderingInstance(ctx); 11093 var res = fn.apply(void 0, arguments); 11094 setCurrentRenderingInstance(prevInstance); 11095 11096 if (renderFnWithContext._d) { 11097 setBlockTracking(1); 11098 } 11099 11100 if (__VUE_PROD_DEVTOOLS__) { 11101 devtoolsComponentUpdated(ctx); 11102 } 11103 11104 return res; 11105 }; // mark normalized to avoid duplicated wrapping 11106 11107 11108 renderFnWithContext._n = true; // mark this as compiled by default 11109 // this is used in vnode.ts -> normalizeChildren() to set the slot 11110 // rendering flag. 11111 11112 renderFnWithContext._c = true; // disable block tracking by default 11113 11114 renderFnWithContext._d = true; 11115 return renderFnWithContext; 11116 } 11117 11118 function markAttrsAccessed() {} 11119 11120 function renderComponentRoot(instance) { 11121 var Component = instance.type, 11122 vnode = instance.vnode, 11123 proxy = instance.proxy, 11124 withProxy = instance.withProxy, 11125 props = instance.props, 11126 _instance$propsOption = instance.propsOptions, 11127 propsOptions = _instance$propsOption[0], 11128 slots = instance.slots, 11129 attrs = instance.attrs, 11130 emit = instance.emit, 11131 render = instance.render, 11132 renderCache = instance.renderCache, 11133 data = instance.data, 11134 setupState = instance.setupState, 11135 ctx = instance.ctx, 11136 inheritAttrs = instance.inheritAttrs; 11137 var result; 11138 var fallthroughAttrs; 11139 var prev = setCurrentRenderingInstance(instance); 11140 11141 try { 11142 if (vnode.shapeFlag & 4 11143 /* STATEFUL_COMPONENT */ 11144 ) { 11145 // withProxy is a proxy with a different `has` trap only for 11146 // runtime-compiled render functions using `with` block. 11147 var proxyToUse = withProxy || proxy; 11148 result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx)); 11149 fallthroughAttrs = attrs; 11150 } else { 11151 // functional 11152 var _render = Component; // in dev, mark attrs accessed if optional props (attrs === props) 11153 11154 if ("production" !== 'production' && attrs === props) ; 11155 result = normalizeVNode(_render.length > 1 ? _render(props, "production" !== 'production' ? { 11156 get attrs() { 11157 markAttrsAccessed(); 11158 return attrs; 11159 }, 11160 11161 slots: slots, 11162 emit: emit 11163 } : { 11164 attrs: attrs, 11165 slots: slots, 11166 emit: emit 11167 }) : _render(props, null 11168 /* we know it doesn't need it */ 11169 )); 11170 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); 11171 } 11172 } catch (err) { 11173 blockStack.length = 0; 11174 handleError(err, instance, 1 11175 /* RENDER_FUNCTION */ 11176 ); 11177 result = createVNode(Comment); 11178 } // attr merging 11179 // in dev mode, comments are preserved, and it's possible for a template 11180 // to have comments along side the root element which makes it a fragment 11181 11182 11183 var root = result; 11184 11185 if (fallthroughAttrs && inheritAttrs !== false) { 11186 var keys = Object.keys(fallthroughAttrs); 11187 var _root = root, 11188 shapeFlag = _root.shapeFlag; 11189 11190 if (keys.length) { 11191 if (shapeFlag & (1 11192 /* ELEMENT */ 11193 | 6 11194 /* COMPONENT */ 11195 )) { 11196 if (propsOptions && keys.some(isModelListener)) { 11197 // If a v-model listener (onUpdate:xxx) has a corresponding declared 11198 // prop, it indicates this component expects to handle v-model and 11199 // it should not fallthrough. 11200 // related: #1543, #1643, #1989 11201 fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions); 11202 } 11203 11204 root = cloneVNode(root, fallthroughAttrs); 11205 } 11206 } 11207 } // inherit directives 11208 11209 11210 if (vnode.dirs) { 11211 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; 11212 } // inherit transition data 11213 11214 11215 if (vnode.transition) { 11216 root.transition = vnode.transition; 11217 } 11218 11219 { 11220 result = root; 11221 } 11222 setCurrentRenderingInstance(prev); 11223 return result; 11224 } 11225 11226 var getFunctionalFallthrough = function getFunctionalFallthrough(attrs) { 11227 var res; 11228 11229 for (var key in attrs) { 11230 if (key === 'class' || key === 'style' || isOn(key)) { 11231 (res || (res = {}))[key] = attrs[key]; 11232 } 11233 } 11234 11235 return res; 11236 }; 11237 11238 var filterModelListeners = function filterModelListeners(attrs, props) { 11239 var res = {}; 11240 11241 for (var key in attrs) { 11242 if (!isModelListener(key) || !(key.slice(9) in props)) { 11243 res[key] = attrs[key]; 11244 } 11245 } 11246 11247 return res; 11248 }; 11249 11250 function shouldUpdateComponent(prevVNode, nextVNode, optimized) { 11251 var prevProps = prevVNode.props, 11252 prevChildren = prevVNode.children, 11253 component = prevVNode.component; 11254 var nextProps = nextVNode.props, 11255 nextChildren = nextVNode.children, 11256 patchFlag = nextVNode.patchFlag; 11257 var emits = component.emitsOptions; // Parent component's render function was hot-updated. Since this may have 11258 11259 if (nextVNode.dirs || nextVNode.transition) { 11260 return true; 11261 } 11262 11263 if (optimized && patchFlag >= 0) { 11264 if (patchFlag & 1024 11265 /* DYNAMIC_SLOTS */ 11266 ) { 11267 // slot content that references values that might have changed, 11268 // e.g. in a v-for 11269 return true; 11270 } 11271 11272 if (patchFlag & 16 11273 /* FULL_PROPS */ 11274 ) { 11275 if (!prevProps) { 11276 return !!nextProps; 11277 } // presence of this flag indicates props are always non-null 11278 11279 11280 return hasPropsChanged(prevProps, nextProps, emits); 11281 } else if (patchFlag & 8 11282 /* PROPS */ 11283 ) { 11284 var dynamicProps = nextVNode.dynamicProps; 11285 11286 for (var _i9 = 0; _i9 < dynamicProps.length; _i9++) { 11287 var key = dynamicProps[_i9]; 11288 11289 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { 11290 return true; 11291 } 11292 } 11293 } 11294 } else { 11295 // this path is only taken by manually written render functions 11296 // so presence of any children leads to a forced update 11297 if (prevChildren || nextChildren) { 11298 if (!nextChildren || !nextChildren.$stable) { 11299 return true; 11300 } 11301 } 11302 11303 if (prevProps === nextProps) { 11304 return false; 11305 } 11306 11307 if (!prevProps) { 11308 return !!nextProps; 11309 } 11310 11311 if (!nextProps) { 11312 return true; 11313 } 11314 11315 return hasPropsChanged(prevProps, nextProps, emits); 11316 } 11317 11318 return false; 11319 } 11320 11321 function hasPropsChanged(prevProps, nextProps, emitsOptions) { 11322 var nextKeys = Object.keys(nextProps); 11323 11324 if (nextKeys.length !== Object.keys(prevProps).length) { 11325 return true; 11326 } 11327 11328 for (var _i10 = 0; _i10 < nextKeys.length; _i10++) { 11329 var key = nextKeys[_i10]; 11330 11331 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { 11332 return true; 11333 } 11334 } 11335 11336 return false; 11337 } 11338 11339 function updateHOCHostEl(_ref2, el // HostNode 11340 ) { 11341 var vnode = _ref2.vnode, 11342 parent = _ref2.parent; 11343 11344 while (parent && parent.subTree === vnode) { 11345 (vnode = parent.vnode).el = el; 11346 parent = parent.parent; 11347 } 11348 } 11349 11350 var isSuspense = function isSuspense(type) { 11351 return type.__isSuspense; 11352 }; // Suspense exposes a component-like API, and is treated like a component 11353 11354 11355 function queueEffectWithSuspense(fn, suspense) { 11356 if (suspense && suspense.pendingBranch) { 11357 if (isArray(fn)) { 11358 var _suspense$effects; 11359 11360 (_suspense$effects = suspense.effects).push.apply(_suspense$effects, fn); 11361 } else { 11362 suspense.effects.push(fn); 11363 } 11364 } else { 11365 queuePostFlushCb(fn); 11366 } 11367 } 11368 11369 function provide(key, value) { 11370 if (!currentInstance) ;else { 11371 var provides = currentInstance.provides; // by default an instance inherits its parent's provides object 11372 // but when it needs to provide values of its own, it creates its 11373 // own provides object using parent provides object as prototype. 11374 // this way in `inject` we can simply look up injections from direct 11375 // parent and let the prototype chain do the work. 11376 11377 var parentProvides = currentInstance.parent && currentInstance.parent.provides; 11378 11379 if (parentProvides === provides) { 11380 provides = currentInstance.provides = Object.create(parentProvides); 11381 } // TS doesn't allow symbol as index type 11382 11383 11384 provides[key] = value; 11385 } 11386 } 11387 11388 function inject(key, defaultValue, treatDefaultAsFactory) { 11389 if (treatDefaultAsFactory === void 0) { 11390 treatDefaultAsFactory = false; 11391 } // fallback to `currentRenderingInstance` so that this can be called in 11392 // a functional component 11393 11394 11395 var instance = currentInstance || currentRenderingInstance; 11396 11397 if (instance) { 11398 // #2400 11399 // to support `app.use` plugins, 11400 // fallback to appContext's `provides` if the intance is at root 11401 var provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides; 11402 11403 if (provides && key in provides) { 11404 // TS doesn't allow symbol as index type 11405 return provides[key]; 11406 } else if (arguments.length > 1) { 11407 return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue; 11408 } else ; 11409 } 11410 } 11411 11412 function useTransitionState() { 11413 var state = { 11414 isMounted: false, 11415 isLeaving: false, 11416 isUnmounting: false, 11417 leavingVNodes: new Map() 11418 }; 11419 onMounted(function () { 11420 state.isMounted = true; 11421 }); 11422 onBeforeUnmount(function () { 11423 state.isUnmounting = true; 11424 }); 11425 return state; 11426 } 11427 11428 var TransitionHookValidator = [Function, Array]; 11429 var BaseTransitionImpl = { 11430 name: "BaseTransition", 11431 props: { 11432 mode: String, 11433 appear: Boolean, 11434 persisted: Boolean, 11435 // enter 11436 onBeforeEnter: TransitionHookValidator, 11437 onEnter: TransitionHookValidator, 11438 onAfterEnter: TransitionHookValidator, 11439 onEnterCancelled: TransitionHookValidator, 11440 // leave 11441 onBeforeLeave: TransitionHookValidator, 11442 onLeave: TransitionHookValidator, 11443 onAfterLeave: TransitionHookValidator, 11444 onLeaveCancelled: TransitionHookValidator, 11445 // appear 11446 onBeforeAppear: TransitionHookValidator, 11447 onAppear: TransitionHookValidator, 11448 onAfterAppear: TransitionHookValidator, 11449 onAppearCancelled: TransitionHookValidator 11450 }, 11451 setup: function setup(props, _ref4) { 11452 var slots = _ref4.slots; 11453 var instance = getCurrentInstance(); 11454 var state = useTransitionState(); 11455 var prevTransitionKey; 11456 return function () { 11457 var children = slots.default && getTransitionRawChildren(slots.default(), true); 11458 11459 if (!children || !children.length) { 11460 return; 11461 } // warn multiple elements 11462 // props for a bit better perf 11463 11464 11465 var rawProps = toRaw(props); 11466 var mode = rawProps.mode; // check mode 11467 11468 var child = children[0]; 11469 11470 if (state.isLeaving) { 11471 return emptyPlaceholder(child); 11472 } // in the case of <transition><keep-alive/></transition>, we need to 11473 // compare the type of the kept-alive children. 11474 11475 11476 var innerChild = getKeepAliveChild(child); 11477 11478 if (!innerChild) { 11479 return emptyPlaceholder(child); 11480 } 11481 11482 var enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance); 11483 setTransitionHooks(innerChild, enterHooks); 11484 var oldChild = instance.subTree; 11485 var oldInnerChild = oldChild && getKeepAliveChild(oldChild); 11486 var transitionKeyChanged = false; 11487 var getTransitionKey = innerChild.type.getTransitionKey; 11488 11489 if (getTransitionKey) { 11490 var key = getTransitionKey(); 11491 11492 if (prevTransitionKey === undefined) { 11493 prevTransitionKey = key; 11494 } else if (key !== prevTransitionKey) { 11495 prevTransitionKey = key; 11496 transitionKeyChanged = true; 11497 } 11498 } // handle mode 11499 11500 11501 if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) { 11502 var leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance); // update old tree's hooks in case of dynamic transition 11503 11504 setTransitionHooks(oldInnerChild, leavingHooks); // switching between different views 11505 11506 if (mode === 'out-in') { 11507 state.isLeaving = true; // return placeholder node and queue update when leave finishes 11508 11509 leavingHooks.afterLeave = function () { 11510 state.isLeaving = false; 11511 instance.update(); 11512 }; 11513 11514 return emptyPlaceholder(child); 11515 } else if (mode === 'in-out' && innerChild.type !== Comment) { 11516 leavingHooks.delayLeave = function (el, earlyRemove, delayedLeave) { 11517 var leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild); 11518 leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; // early removal callback 11519 11520 el._leaveCb = function () { 11521 earlyRemove(); 11522 el._leaveCb = undefined; 11523 delete enterHooks.delayedLeave; 11524 }; 11525 11526 enterHooks.delayedLeave = delayedLeave; 11527 }; 11528 } 11529 } 11530 11531 return child; 11532 }; 11533 } 11534 }; // export the public type for h/tsx inference 11535 // also to avoid inline import() in generated d.ts files 11536 11537 var BaseTransition = BaseTransitionImpl; 11538 11539 function getLeavingNodesForType(state, vnode) { 11540 var leavingVNodes = state.leavingVNodes; 11541 var leavingVNodesCache = leavingVNodes.get(vnode.type); 11542 11543 if (!leavingVNodesCache) { 11544 leavingVNodesCache = Object.create(null); 11545 leavingVNodes.set(vnode.type, leavingVNodesCache); 11546 } 11547 11548 return leavingVNodesCache; 11549 } // The transition hooks are attached to the vnode as vnode.transition 11550 // and will be called at appropriate timing in the renderer. 11551 11552 11553 function resolveTransitionHooks(vnode, props, state, instance) { 11554 var appear = props.appear, 11555 mode = props.mode, 11556 _props$persisted = props.persisted, 11557 persisted = _props$persisted === void 0 ? false : _props$persisted, 11558 onBeforeEnter = props.onBeforeEnter, 11559 onEnter = props.onEnter, 11560 onAfterEnter = props.onAfterEnter, 11561 onEnterCancelled = props.onEnterCancelled, 11562 onBeforeLeave = props.onBeforeLeave, 11563 onLeave = props.onLeave, 11564 onAfterLeave = props.onAfterLeave, 11565 onLeaveCancelled = props.onLeaveCancelled, 11566 onBeforeAppear = props.onBeforeAppear, 11567 onAppear = props.onAppear, 11568 onAfterAppear = props.onAfterAppear, 11569 onAppearCancelled = props.onAppearCancelled; 11570 var key = String(vnode.key); 11571 var leavingVNodesCache = getLeavingNodesForType(state, vnode); 11572 11573 var callHook = function callHook(hook, args) { 11574 hook && callWithAsyncErrorHandling(hook, instance, 9 11575 /* TRANSITION_HOOK */ 11576 , args); 11577 }; 11578 11579 var hooks = { 11580 mode: mode, 11581 persisted: persisted, 11582 beforeEnter: function beforeEnter(el) { 11583 var hook = onBeforeEnter; 11584 11585 if (!state.isMounted) { 11586 if (appear) { 11587 hook = onBeforeAppear || onBeforeEnter; 11588 } else { 11589 return; 11590 } 11591 } // for same element (v-show) 11592 11593 11594 if (el._leaveCb) { 11595 el._leaveCb(true 11596 /* cancelled */ 11597 ); 11598 } // for toggled element with same key (v-if) 11599 11600 11601 var leavingVNode = leavingVNodesCache[key]; 11602 11603 if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) { 11604 // force early removal (not cancelled) 11605 leavingVNode.el._leaveCb(); 11606 } 11607 11608 callHook(hook, [el]); 11609 }, 11610 enter: function enter(el) { 11611 var hook = onEnter; 11612 var afterHook = onAfterEnter; 11613 var cancelHook = onEnterCancelled; 11614 11615 if (!state.isMounted) { 11616 if (appear) { 11617 hook = onAppear || onEnter; 11618 afterHook = onAfterAppear || onAfterEnter; 11619 cancelHook = onAppearCancelled || onEnterCancelled; 11620 } else { 11621 return; 11622 } 11623 } 11624 11625 var called = false; 11626 11627 var done = el._enterCb = function (cancelled) { 11628 if (called) return; 11629 called = true; 11630 11631 if (cancelled) { 11632 callHook(cancelHook, [el]); 11633 } else { 11634 callHook(afterHook, [el]); 11635 } 11636 11637 if (hooks.delayedLeave) { 11638 hooks.delayedLeave(); 11639 } 11640 11641 el._enterCb = undefined; 11642 }; 11643 11644 if (hook) { 11645 hook(el, done); 11646 11647 if (hook.length <= 1) { 11648 done(); 11649 } 11650 } else { 11651 done(); 11652 } 11653 }, 11654 leave: function leave(el, remove) { 11655 var key = String(vnode.key); 11656 11657 if (el._enterCb) { 11658 el._enterCb(true 11659 /* cancelled */ 11660 ); 11661 } 11662 11663 if (state.isUnmounting) { 11664 return remove(); 11665 } 11666 11667 callHook(onBeforeLeave, [el]); 11668 var called = false; 11669 11670 var done = el._leaveCb = function (cancelled) { 11671 if (called) return; 11672 called = true; 11673 remove(); 11674 11675 if (cancelled) { 11676 callHook(onLeaveCancelled, [el]); 11677 } else { 11678 callHook(onAfterLeave, [el]); 11679 } 11680 11681 el._leaveCb = undefined; 11682 11683 if (leavingVNodesCache[key] === vnode) { 11684 delete leavingVNodesCache[key]; 11685 } 11686 }; 11687 11688 leavingVNodesCache[key] = vnode; 11689 11690 if (onLeave) { 11691 onLeave(el, done); 11692 11693 if (onLeave.length <= 1) { 11694 done(); 11695 } 11696 } else { 11697 done(); 11698 } 11699 }, 11700 clone: function clone(vnode) { 11701 return resolveTransitionHooks(vnode, props, state, instance); 11702 } 11703 }; 11704 return hooks; 11705 } // the placeholder really only handles one special case: KeepAlive 11706 // in the case of a KeepAlive in a leave phase we need to return a KeepAlive 11707 // placeholder with empty content to avoid the KeepAlive instance from being 11708 // unmounted. 11709 11710 11711 function emptyPlaceholder(vnode) { 11712 if (isKeepAlive(vnode)) { 11713 vnode = cloneVNode(vnode); 11714 vnode.children = null; 11715 return vnode; 11716 } 11717 } 11718 11719 function getKeepAliveChild(vnode) { 11720 return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : undefined : vnode; 11721 } 11722 11723 function setTransitionHooks(vnode, hooks) { 11724 if (vnode.shapeFlag & 6 11725 /* COMPONENT */ 11726 && vnode.component) { 11727 setTransitionHooks(vnode.component.subTree, hooks); 11728 } else if (vnode.shapeFlag & 128 11729 /* SUSPENSE */ 11730 ) { 11731 vnode.ssContent.transition = hooks.clone(vnode.ssContent); 11732 vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); 11733 } else { 11734 vnode.transition = hooks; 11735 } 11736 } 11737 11738 function getTransitionRawChildren(children, keepComment) { 11739 if (keepComment === void 0) { 11740 keepComment = false; 11741 } 11742 11743 var ret = []; 11744 var keyedFragmentCount = 0; 11745 11746 for (var _i11 = 0; _i11 < children.length; _i11++) { 11747 var child = children[_i11]; // handle fragment children case, e.g. v-for 11748 11749 if (child.type === Fragment) { 11750 if (child.patchFlag & 128 11751 /* KEYED_FRAGMENT */ 11752 ) keyedFragmentCount++; 11753 ret = ret.concat(getTransitionRawChildren(child.children, keepComment)); 11754 } // comment placeholders should be skipped, e.g. v-if 11755 else if (keepComment || child.type !== Comment) { 11756 ret.push(child); 11757 } 11758 } // #1126 if a transition children list contains multiple sub fragments, these 11759 // fragments will be merged into a flat children array. Since each v-for 11760 // fragment may contain different static bindings inside, we need to de-op 11761 // these children to force full diffs to ensure correct behavior. 11762 11763 11764 if (keyedFragmentCount > 1) { 11765 for (var _i12 = 0; _i12 < ret.length; _i12++) { 11766 ret[_i12].patchFlag = -2 11767 /* BAIL */ 11768 ; 11769 } 11770 } 11771 11772 return ret; 11773 } // implementation, close to no-op 11774 11775 11776 var isAsyncWrapper = function isAsyncWrapper(i) { 11777 return !!i.type.__asyncLoader; 11778 }; 11779 11780 var isKeepAlive = function isKeepAlive(vnode) { 11781 return vnode.type.__isKeepAlive; 11782 }; 11783 11784 function onActivated(hook, target) { 11785 registerKeepAliveHook(hook, "a" 11786 /* ACTIVATED */ 11787 , target); 11788 } 11789 11790 function onDeactivated(hook, target) { 11791 registerKeepAliveHook(hook, "da" 11792 /* DEACTIVATED */ 11793 , target); 11794 } 11795 11796 function registerKeepAliveHook(hook, type, target) { 11797 if (target === void 0) { 11798 target = currentInstance; 11799 } // cache the deactivate branch check wrapper for injected hooks so the same 11800 // hook can be properly deduped by the scheduler. "__wdc" stands for "with 11801 // deactivation check". 11802 11803 11804 var wrappedHook = hook.__wdc || (hook.__wdc = function () { 11805 // only fire the hook if the target instance is NOT in a deactivated branch. 11806 var current = target; 11807 11808 while (current) { 11809 if (current.isDeactivated) { 11810 return; 11811 } 11812 11813 current = current.parent; 11814 } 11815 11816 return hook(); 11817 }); 11818 11819 injectHook(type, wrappedHook, target); // In addition to registering it on the target instance, we walk up the parent 11820 // chain and register it on all ancestor instances that are keep-alive roots. 11821 // This avoids the need to walk the entire component tree when invoking these 11822 // hooks, and more importantly, avoids the need to track child components in 11823 // arrays. 11824 11825 if (target) { 11826 var current = target.parent; 11827 11828 while (current && current.parent) { 11829 if (isKeepAlive(current.parent.vnode)) { 11830 injectToKeepAliveRoot(wrappedHook, type, target, current); 11831 } 11832 11833 current = current.parent; 11834 } 11835 } 11836 } 11837 11838 function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { 11839 // injectHook wraps the original for error handling, so make sure to remove 11840 // the wrapped version. 11841 var injected = injectHook(type, hook, keepAliveRoot, true 11842 /* prepend */ 11843 ); 11844 onUnmounted(function () { 11845 remove(keepAliveRoot[type], injected); 11846 }, target); 11847 } 11848 11849 function injectHook(type, hook, target, prepend) { 11850 if (target === void 0) { 11851 target = currentInstance; 11852 } 11853 11854 if (prepend === void 0) { 11855 prepend = false; 11856 } 11857 11858 if (target) { 11859 var hooks = target[type] || (target[type] = []); // cache the error handling wrapper for injected hooks so the same hook 11860 // can be properly deduped by the scheduler. "__weh" stands for "with error 11861 // handling". 11862 11863 var wrappedHook = hook.__weh || (hook.__weh = function () { 11864 if (target.isUnmounted) { 11865 return; 11866 } // disable tracking inside all lifecycle hooks 11867 // since they can potentially be called inside effects. 11868 11869 11870 pauseTracking(); // Set currentInstance during hook invocation. 11871 // This assumes the hook does not synchronously trigger other hooks, which 11872 // can only be false when the user does something really funky. 11873 11874 setCurrentInstance(target); 11875 11876 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 11877 args[_key3] = arguments[_key3]; 11878 } 11879 11880 var res = callWithAsyncErrorHandling(hook, target, type, args); 11881 unsetCurrentInstance(); 11882 resetTracking(); 11883 return res; 11884 }); 11885 11886 if (prepend) { 11887 hooks.unshift(wrappedHook); 11888 } else { 11889 hooks.push(wrappedHook); 11890 } 11891 11892 return wrappedHook; 11893 } 11894 } 11895 11896 var createHook = function createHook(lifecycle) { 11897 return function (hook, target) { 11898 if (target === void 0) { 11899 target = currentInstance; 11900 } 11901 11902 return (// post-create lifecycle registrations are noops during SSR (except for serverPrefetch) 11903 (!isInSSRComponentSetup || lifecycle === "sp" 11904 /* SERVER_PREFETCH */ 11905 ) && injectHook(lifecycle, hook, target) 11906 ); 11907 }; 11908 }; 11909 11910 var onBeforeMount = createHook("bm" 11911 /* BEFORE_MOUNT */ 11912 ); 11913 var onMounted = createHook("m" 11914 /* MOUNTED */ 11915 ); 11916 var onBeforeUpdate = createHook("bu" 11917 /* BEFORE_UPDATE */ 11918 ); 11919 var onUpdated = createHook("u" 11920 /* UPDATED */ 11921 ); 11922 var onBeforeUnmount = createHook("bum" 11923 /* BEFORE_UNMOUNT */ 11924 ); 11925 var onUnmounted = createHook("um" 11926 /* UNMOUNTED */ 11927 ); 11928 var onServerPrefetch = createHook("sp" 11929 /* SERVER_PREFETCH */ 11930 ); 11931 var onRenderTriggered = createHook("rtg" 11932 /* RENDER_TRIGGERED */ 11933 ); 11934 var onRenderTracked = createHook("rtc" 11935 /* RENDER_TRACKED */ 11936 ); 11937 11938 function onErrorCaptured(hook, target) { 11939 if (target === void 0) { 11940 target = currentInstance; 11941 } 11942 11943 injectHook("ec" 11944 /* ERROR_CAPTURED */ 11945 , hook, target); 11946 } 11947 11948 var shouldCacheAccess = true; 11949 11950 function applyOptions(instance) { 11951 var options = resolveMergedOptions(instance); 11952 var publicThis = instance.proxy; 11953 var ctx = instance.ctx; // do not cache property access on public proxy during state initialization 11954 11955 shouldCacheAccess = false; // call beforeCreate first before accessing other options since 11956 // the hook may mutate resolved options (#2791) 11957 11958 if (options.beforeCreate) { 11959 callHook$1(options.beforeCreate, instance, "bc" 11960 /* BEFORE_CREATE */ 11961 ); 11962 } 11963 11964 var dataOptions = options.data, 11965 computedOptions = options.computed, 11966 methods = options.methods, 11967 watchOptions = options.watch, 11968 provideOptions = options.provide, 11969 injectOptions = options.inject, 11970 created = options.created, 11971 beforeMount = options.beforeMount, 11972 mounted = options.mounted, 11973 beforeUpdate = options.beforeUpdate, 11974 updated = options.updated, 11975 activated = options.activated, 11976 deactivated = options.deactivated; 11977 options.beforeDestroy; 11978 var beforeUnmount = options.beforeUnmount; 11979 options.destroyed; 11980 var unmounted = options.unmounted, 11981 render = options.render, 11982 renderTracked = options.renderTracked, 11983 renderTriggered = options.renderTriggered, 11984 errorCaptured = options.errorCaptured, 11985 serverPrefetch = options.serverPrefetch, 11986 expose = options.expose, 11987 inheritAttrs = options.inheritAttrs, 11988 components = options.components, 11989 directives = options.directives; 11990 options.filters; 11991 var checkDuplicateProperties = null; // - props (already done outside of this function) 11992 // - inject 11993 // - methods 11994 // - data (deferred since it relies on `this` access) 11995 // - computed 11996 // - watch (deferred since it relies on `this` access) 11997 11998 if (injectOptions) { 11999 resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef); 12000 } 12001 12002 if (methods) { 12003 for (var key in methods) { 12004 var methodHandler = methods[key]; 12005 12006 if (isFunction(methodHandler)) { 12007 // In dev mode, we use the `createRenderContext` function to define 12008 // methods to the proxy target, and those are read-only but 12009 // reconfigurable, so it needs to be redefined here 12010 { 12011 ctx[key] = methodHandler.bind(publicThis); 12012 } 12013 } 12014 } 12015 } 12016 12017 if (dataOptions) { 12018 var data = dataOptions.call(publicThis, publicThis); 12019 if (!isObject$1(data)) ;else { 12020 instance.data = reactive(data); 12021 } 12022 } // state initialization complete at this point - start caching access 12023 12024 12025 shouldCacheAccess = true; 12026 12027 if (computedOptions) { 12028 var _loop = function _loop(_key6) { 12029 var opt = computedOptions[_key6]; 12030 var get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; 12031 var set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP; 12032 var c = computed({ 12033 get: get, 12034 set: set 12035 }); 12036 Object.defineProperty(ctx, _key6, { 12037 enumerable: true, 12038 configurable: true, 12039 get: function get() { 12040 return c.value; 12041 }, 12042 set: function set(v) { 12043 return c.value = v; 12044 } 12045 }); 12046 }; 12047 12048 for (var _key6 in computedOptions) { 12049 _loop(_key6); 12050 } 12051 } 12052 12053 if (watchOptions) { 12054 for (var _key7 in watchOptions) { 12055 createWatcher(watchOptions[_key7], ctx, publicThis, _key7); 12056 } 12057 } 12058 12059 if (provideOptions) { 12060 var provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; 12061 Reflect.ownKeys(provides).forEach(function (key) { 12062 provide(key, provides[key]); 12063 }); 12064 } 12065 12066 if (created) { 12067 callHook$1(created, instance, "c" 12068 /* CREATED */ 12069 ); 12070 } 12071 12072 function registerLifecycleHook(register, hook) { 12073 if (isArray(hook)) { 12074 hook.forEach(function (_hook) { 12075 return register(_hook.bind(publicThis)); 12076 }); 12077 } else if (hook) { 12078 register(hook.bind(publicThis)); 12079 } 12080 } 12081 12082 registerLifecycleHook(onBeforeMount, beforeMount); 12083 registerLifecycleHook(onMounted, mounted); 12084 registerLifecycleHook(onBeforeUpdate, beforeUpdate); 12085 registerLifecycleHook(onUpdated, updated); 12086 registerLifecycleHook(onActivated, activated); 12087 registerLifecycleHook(onDeactivated, deactivated); 12088 registerLifecycleHook(onErrorCaptured, errorCaptured); 12089 registerLifecycleHook(onRenderTracked, renderTracked); 12090 registerLifecycleHook(onRenderTriggered, renderTriggered); 12091 registerLifecycleHook(onBeforeUnmount, beforeUnmount); 12092 registerLifecycleHook(onUnmounted, unmounted); 12093 registerLifecycleHook(onServerPrefetch, serverPrefetch); 12094 12095 if (isArray(expose)) { 12096 if (expose.length) { 12097 var exposed = instance.exposed || (instance.exposed = {}); 12098 expose.forEach(function (key) { 12099 Object.defineProperty(exposed, key, { 12100 get: function get() { 12101 return publicThis[key]; 12102 }, 12103 set: function set(val) { 12104 return publicThis[key] = val; 12105 } 12106 }); 12107 }); 12108 } else if (!instance.exposed) { 12109 instance.exposed = {}; 12110 } 12111 } // options that are handled when creating the instance but also need to be 12112 // applied from mixins 12113 12114 12115 if (render && instance.render === NOOP) { 12116 instance.render = render; 12117 } 12118 12119 if (inheritAttrs != null) { 12120 instance.inheritAttrs = inheritAttrs; 12121 } // asset options. 12122 12123 12124 if (components) instance.components = components; 12125 if (directives) instance.directives = directives; 12126 } 12127 12128 function resolveInjections(injectOptions, ctx, checkDuplicateProperties, unwrapRef) { 12129 if (unwrapRef === void 0) { 12130 unwrapRef = false; 12131 } 12132 12133 if (isArray(injectOptions)) { 12134 injectOptions = normalizeInject(injectOptions); 12135 } 12136 12137 var _loop2 = function _loop2(key) { 12138 var opt = injectOptions[key]; 12139 var injected = void 0; 12140 12141 if (isObject$1(opt)) { 12142 if ('default' in opt) { 12143 injected = inject(opt.from || key, opt.default, true 12144 /* treat default function as factory */ 12145 ); 12146 } else { 12147 injected = inject(opt.from || key); 12148 } 12149 } else { 12150 injected = inject(opt); 12151 } 12152 12153 if (isRef(injected)) { 12154 // TODO remove the check in 3.3 12155 if (unwrapRef) { 12156 Object.defineProperty(ctx, key, { 12157 enumerable: true, 12158 configurable: true, 12159 get: function get() { 12160 return injected.value; 12161 }, 12162 set: function set(v) { 12163 return injected.value = v; 12164 } 12165 }); 12166 } else { 12167 ctx[key] = injected; 12168 } 12169 } else { 12170 ctx[key] = injected; 12171 } 12172 }; 12173 12174 for (var key in injectOptions) { 12175 _loop2(key); 12176 } 12177 } 12178 12179 function callHook$1(hook, instance, type) { 12180 callWithAsyncErrorHandling(isArray(hook) ? hook.map(function (h) { 12181 return h.bind(instance.proxy); 12182 }) : hook.bind(instance.proxy), instance, type); 12183 } 12184 12185 function createWatcher(raw, ctx, publicThis, key) { 12186 var getter = key.includes('.') ? createPathGetter(publicThis, key) : function () { 12187 return publicThis[key]; 12188 }; 12189 12190 if (isString(raw)) { 12191 var handler = ctx[raw]; 12192 12193 if (isFunction(handler)) { 12194 watch(getter, handler); 12195 } 12196 } else if (isFunction(raw)) { 12197 watch(getter, raw.bind(publicThis)); 12198 } else if (isObject$1(raw)) { 12199 if (isArray(raw)) { 12200 raw.forEach(function (r) { 12201 return createWatcher(r, ctx, publicThis, key); 12202 }); 12203 } else { 12204 var _handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; 12205 12206 if (isFunction(_handler)) { 12207 watch(getter, _handler, raw); 12208 } 12209 } 12210 } else ; 12211 } 12212 /** 12213 * Resolve merged options and cache it on the component. 12214 * This is done only once per-component since the merging does not involve 12215 * instances. 12216 */ 12217 12218 12219 function resolveMergedOptions(instance) { 12220 var base = instance.type; 12221 var mixins = base.mixins, 12222 extendsOptions = base.extends; 12223 var _instance$appContext = instance.appContext, 12224 globalMixins = _instance$appContext.mixins, 12225 cache = _instance$appContext.optionsCache, 12226 optionMergeStrategies = _instance$appContext.config.optionMergeStrategies; 12227 var cached = cache.get(base); 12228 var resolved; 12229 12230 if (cached) { 12231 resolved = cached; 12232 } else if (!globalMixins.length && !mixins && !extendsOptions) { 12233 { 12234 resolved = base; 12235 } 12236 } else { 12237 resolved = {}; 12238 12239 if (globalMixins.length) { 12240 globalMixins.forEach(function (m) { 12241 return mergeOptions(resolved, m, optionMergeStrategies, true); 12242 }); 12243 } 12244 12245 mergeOptions(resolved, base, optionMergeStrategies); 12246 } 12247 12248 cache.set(base, resolved); 12249 return resolved; 12250 } 12251 12252 function mergeOptions(to, from, strats, asMixin) { 12253 if (asMixin === void 0) { 12254 asMixin = false; 12255 } 12256 12257 var mixins = from.mixins, 12258 extendsOptions = from.extends; 12259 12260 if (extendsOptions) { 12261 mergeOptions(to, extendsOptions, strats, true); 12262 } 12263 12264 if (mixins) { 12265 mixins.forEach(function (m) { 12266 return mergeOptions(to, m, strats, true); 12267 }); 12268 } 12269 12270 for (var key in from) { 12271 if (asMixin && key === 'expose') ;else { 12272 var strat = internalOptionMergeStrats[key] || strats && strats[key]; 12273 to[key] = strat ? strat(to[key], from[key]) : from[key]; 12274 } 12275 } 12276 12277 return to; 12278 } 12279 12280 var internalOptionMergeStrats = { 12281 data: mergeDataFn, 12282 props: mergeObjectOptions, 12283 emits: mergeObjectOptions, 12284 // objects 12285 methods: mergeObjectOptions, 12286 computed: mergeObjectOptions, 12287 // lifecycle 12288 beforeCreate: mergeAsArray, 12289 created: mergeAsArray, 12290 beforeMount: mergeAsArray, 12291 mounted: mergeAsArray, 12292 beforeUpdate: mergeAsArray, 12293 updated: mergeAsArray, 12294 beforeDestroy: mergeAsArray, 12295 beforeUnmount: mergeAsArray, 12296 destroyed: mergeAsArray, 12297 unmounted: mergeAsArray, 12298 activated: mergeAsArray, 12299 deactivated: mergeAsArray, 12300 errorCaptured: mergeAsArray, 12301 serverPrefetch: mergeAsArray, 12302 // assets 12303 components: mergeObjectOptions, 12304 directives: mergeObjectOptions, 12305 // watch 12306 watch: mergeWatchOptions, 12307 // provide / inject 12308 provide: mergeDataFn, 12309 inject: mergeInject 12310 }; 12311 12312 function mergeDataFn(to, from) { 12313 if (!from) { 12314 return to; 12315 } 12316 12317 if (!to) { 12318 return from; 12319 } 12320 12321 return function mergedDataFn() { 12322 return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from); 12323 }; 12324 } 12325 12326 function mergeInject(to, from) { 12327 return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); 12328 } 12329 12330 function normalizeInject(raw) { 12331 if (isArray(raw)) { 12332 var res = {}; 12333 12334 for (var _i13 = 0; _i13 < raw.length; _i13++) { 12335 res[raw[_i13]] = raw[_i13]; 12336 } 12337 12338 return res; 12339 } 12340 12341 return raw; 12342 } 12343 12344 function mergeAsArray(to, from) { 12345 return to ? [].concat(new Set([].concat(to, from))) : from; 12346 } 12347 12348 function mergeObjectOptions(to, from) { 12349 return to ? extend(extend(Object.create(null), to), from) : from; 12350 } 12351 12352 function mergeWatchOptions(to, from) { 12353 if (!to) return from; 12354 if (!from) return to; 12355 var merged = extend(Object.create(null), to); 12356 12357 for (var key in from) { 12358 merged[key] = mergeAsArray(to[key], from[key]); 12359 } 12360 12361 return merged; 12362 } 12363 12364 function initProps(instance, rawProps, isStateful, // result of bitwise flag comparison 12365 isSSR) { 12366 if (isSSR === void 0) { 12367 isSSR = false; 12368 } 12369 12370 var props = {}; 12371 var attrs = {}; 12372 def(attrs, InternalObjectKey, 1); 12373 instance.propsDefaults = Object.create(null); 12374 setFullProps(instance, rawProps, props, attrs); // ensure all declared prop keys are present 12375 12376 for (var key in instance.propsOptions[0]) { 12377 if (!(key in props)) { 12378 props[key] = undefined; 12379 } 12380 } // validation 12381 12382 12383 if (isStateful) { 12384 // stateful 12385 instance.props = isSSR ? props : shallowReactive(props); 12386 } else { 12387 if (!instance.type.props) { 12388 // functional w/ optional props, props === attrs 12389 instance.props = attrs; 12390 } else { 12391 // functional w/ declared props 12392 instance.props = props; 12393 } 12394 } 12395 12396 instance.attrs = attrs; 12397 } 12398 12399 function updateProps(instance, rawProps, rawPrevProps, optimized) { 12400 var props = instance.props, 12401 attrs = instance.attrs, 12402 patchFlag = instance.vnode.patchFlag; 12403 var rawCurrentProps = toRaw(props); 12404 var _instance$propsOption2 = instance.propsOptions, 12405 options = _instance$propsOption2[0]; 12406 var hasAttrsChanged = false; 12407 12408 if ( // always force full diff in dev 12409 // - #1942 if hmr is enabled with sfc component 12410 // - vite#872 non-sfc component used by sfc component 12411 (optimized || patchFlag > 0) && !(patchFlag & 16 12412 /* FULL_PROPS */ 12413 )) { 12414 if (patchFlag & 8 12415 /* PROPS */ 12416 ) { 12417 // Compiler-generated props & no keys change, just set the updated 12418 // the props. 12419 var propsToUpdate = instance.vnode.dynamicProps; 12420 12421 for (var _i14 = 0; _i14 < propsToUpdate.length; _i14++) { 12422 var key = propsToUpdate[_i14]; // PROPS flag guarantees rawProps to be non-null 12423 12424 var value = rawProps[key]; 12425 12426 if (options) { 12427 // attr / props separation was done on init and will be consistent 12428 // in this code path, so just check if attrs have it. 12429 if (hasOwn(attrs, key)) { 12430 if (value !== attrs[key]) { 12431 attrs[key] = value; 12432 hasAttrsChanged = true; 12433 } 12434 } else { 12435 var camelizedKey = camelize(key); 12436 props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false 12437 /* isAbsent */ 12438 ); 12439 } 12440 } else { 12441 if (value !== attrs[key]) { 12442 attrs[key] = value; 12443 hasAttrsChanged = true; 12444 } 12445 } 12446 } 12447 } 12448 } else { 12449 // full props update. 12450 if (setFullProps(instance, rawProps, props, attrs)) { 12451 hasAttrsChanged = true; 12452 } // in case of dynamic props, check if we need to delete keys from 12453 // the props object 12454 12455 12456 var kebabKey; 12457 12458 for (var _key8 in rawCurrentProps) { 12459 if (!rawProps || // for camelCase 12460 !hasOwn(rawProps, _key8) && ( // it's possible the original props was passed in as kebab-case 12461 // and converted to camelCase (#955) 12462 (kebabKey = hyphenate(_key8)) === _key8 || !hasOwn(rawProps, kebabKey))) { 12463 if (options) { 12464 if (rawPrevProps && ( // for camelCase 12465 rawPrevProps[_key8] !== undefined || // for kebab-case 12466 rawPrevProps[kebabKey] !== undefined)) { 12467 props[_key8] = resolvePropValue(options, rawCurrentProps, _key8, undefined, instance, true 12468 /* isAbsent */ 12469 ); 12470 } 12471 } else { 12472 delete props[_key8]; 12473 } 12474 } 12475 } // in the case of functional component w/o props declaration, props and 12476 // attrs point to the same object so it should already have been updated. 12477 12478 12479 if (attrs !== rawCurrentProps) { 12480 for (var _key9 in attrs) { 12481 if (!rawProps || !hasOwn(rawProps, _key9)) { 12482 delete attrs[_key9]; 12483 hasAttrsChanged = true; 12484 } 12485 } 12486 } 12487 } // trigger updates for $attrs in case it's used in component slots 12488 12489 12490 if (hasAttrsChanged) { 12491 trigger$1(instance, "set" 12492 /* SET */ 12493 , '$attrs'); 12494 } 12495 } 12496 12497 function setFullProps(instance, rawProps, props, attrs) { 12498 var _instance$propsOption3 = instance.propsOptions, 12499 options = _instance$propsOption3[0], 12500 needCastKeys = _instance$propsOption3[1]; 12501 var hasAttrsChanged = false; 12502 var rawCastValues; 12503 12504 if (rawProps) { 12505 for (var key in rawProps) { 12506 // key, ref are reserved and never passed down 12507 if (isReservedProp(key)) { 12508 continue; 12509 } 12510 12511 var value = rawProps[key]; // prop option names are camelized during normalization, so to support 12512 // kebab -> camel conversion here we need to camelize the key. 12513 12514 var camelKey = void 0; 12515 12516 if (options && hasOwn(options, camelKey = camelize(key))) { 12517 if (!needCastKeys || !needCastKeys.includes(camelKey)) { 12518 props[camelKey] = value; 12519 } else { 12520 (rawCastValues || (rawCastValues = {}))[camelKey] = value; 12521 } 12522 } else if (!isEmitListener(instance.emitsOptions, key)) { 12523 if (!(key in attrs) || value !== attrs[key]) { 12524 attrs[key] = value; 12525 hasAttrsChanged = true; 12526 } 12527 } 12528 } 12529 } 12530 12531 if (needCastKeys) { 12532 var rawCurrentProps = toRaw(props); 12533 var castValues = rawCastValues || EMPTY_OBJ; 12534 12535 for (var _i15 = 0; _i15 < needCastKeys.length; _i15++) { 12536 var _key10 = needCastKeys[_i15]; 12537 props[_key10] = resolvePropValue(options, rawCurrentProps, _key10, castValues[_key10], instance, !hasOwn(castValues, _key10)); 12538 } 12539 } 12540 12541 return hasAttrsChanged; 12542 } 12543 12544 function resolvePropValue(options, props, key, value, instance, isAbsent) { 12545 var opt = options[key]; 12546 12547 if (opt != null) { 12548 var hasDefault = hasOwn(opt, 'default'); // default values 12549 12550 if (hasDefault && value === undefined) { 12551 var defaultValue = opt.default; 12552 12553 if (opt.type !== Function && isFunction(defaultValue)) { 12554 var propsDefaults = instance.propsDefaults; 12555 12556 if (key in propsDefaults) { 12557 value = propsDefaults[key]; 12558 } else { 12559 setCurrentInstance(instance); 12560 value = propsDefaults[key] = defaultValue.call(null, props); 12561 unsetCurrentInstance(); 12562 } 12563 } else { 12564 value = defaultValue; 12565 } 12566 } // boolean casting 12567 12568 12569 if (opt[0 12570 /* shouldCast */ 12571 ]) { 12572 if (isAbsent && !hasDefault) { 12573 value = false; 12574 } else if (opt[1 12575 /* shouldCastTrue */ 12576 ] && (value === '' || value === hyphenate(key))) { 12577 value = true; 12578 } 12579 } 12580 } 12581 12582 return value; 12583 } 12584 12585 function normalizePropsOptions(comp, appContext, asMixin) { 12586 if (asMixin === void 0) { 12587 asMixin = false; 12588 } 12589 12590 var cache = appContext.propsCache; 12591 var cached = cache.get(comp); 12592 12593 if (cached) { 12594 return cached; 12595 } 12596 12597 var raw = comp.props; 12598 var normalized = {}; 12599 var needCastKeys = []; // apply mixin/extends props 12600 12601 var hasExtends = false; 12602 12603 if (__VUE_OPTIONS_API__ && !isFunction(comp)) { 12604 var extendProps = function extendProps(raw) { 12605 hasExtends = true; 12606 12607 var _normalizePropsOption = normalizePropsOptions(raw, appContext, true), 12608 props = _normalizePropsOption[0], 12609 keys = _normalizePropsOption[1]; 12610 12611 extend(normalized, props); 12612 if (keys) needCastKeys.push.apply(needCastKeys, keys); 12613 }; 12614 12615 if (!asMixin && appContext.mixins.length) { 12616 appContext.mixins.forEach(extendProps); 12617 } 12618 12619 if (comp.extends) { 12620 extendProps(comp.extends); 12621 } 12622 12623 if (comp.mixins) { 12624 comp.mixins.forEach(extendProps); 12625 } 12626 } 12627 12628 if (!raw && !hasExtends) { 12629 cache.set(comp, EMPTY_ARR); 12630 return EMPTY_ARR; 12631 } 12632 12633 if (isArray(raw)) { 12634 for (var _i16 = 0; _i16 < raw.length; _i16++) { 12635 var normalizedKey = camelize(raw[_i16]); 12636 12637 if (validatePropName(normalizedKey)) { 12638 normalized[normalizedKey] = EMPTY_OBJ; 12639 } 12640 } 12641 } else if (raw) { 12642 for (var key in raw) { 12643 var _normalizedKey = camelize(key); 12644 12645 if (validatePropName(_normalizedKey)) { 12646 var opt = raw[key]; 12647 var prop = normalized[_normalizedKey] = isArray(opt) || isFunction(opt) ? { 12648 type: opt 12649 } : opt; 12650 12651 if (prop) { 12652 var booleanIndex = getTypeIndex(Boolean, prop.type); 12653 var stringIndex = getTypeIndex(String, prop.type); 12654 prop[0 12655 /* shouldCast */ 12656 ] = booleanIndex > -1; 12657 prop[1 12658 /* shouldCastTrue */ 12659 ] = stringIndex < 0 || booleanIndex < stringIndex; // if the prop needs boolean casting or default value 12660 12661 if (booleanIndex > -1 || hasOwn(prop, 'default')) { 12662 needCastKeys.push(_normalizedKey); 12663 } 12664 } 12665 } 12666 } 12667 } 12668 12669 var res = [normalized, needCastKeys]; 12670 cache.set(comp, res); 12671 return res; 12672 } 12673 12674 function validatePropName(key) { 12675 if (key[0] !== '$') { 12676 return true; 12677 } 12678 12679 return false; 12680 } // use function string name to check type constructors 12681 // so that it works across vms / iframes. 12682 12683 12684 function getType(ctor) { 12685 var match = ctor && ctor.toString().match(/^\s*function (\w+)/); 12686 return match ? match[1] : ctor === null ? 'null' : ''; 12687 } 12688 12689 function isSameType(a, b) { 12690 return getType(a) === getType(b); 12691 } 12692 12693 function getTypeIndex(type, expectedTypes) { 12694 if (isArray(expectedTypes)) { 12695 return expectedTypes.findIndex(function (t) { 12696 return isSameType(t, type); 12697 }); 12698 } else if (isFunction(expectedTypes)) { 12699 return isSameType(expectedTypes, type) ? 0 : -1; 12700 } 12701 12702 return -1; 12703 } 12704 12705 var isInternalKey = function isInternalKey(key) { 12706 return key[0] === '_' || key === '$stable'; 12707 }; 12708 12709 var normalizeSlotValue = function normalizeSlotValue(value) { 12710 return isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; 12711 }; 12712 12713 var normalizeSlot = function normalizeSlot(key, rawSlot, ctx) { 12714 var normalized = withCtx(function () { 12715 return normalizeSlotValue(rawSlot.apply(void 0, arguments)); 12716 }, ctx); 12717 normalized._c = false; 12718 return normalized; 12719 }; 12720 12721 var normalizeObjectSlots = function normalizeObjectSlots(rawSlots, slots, instance) { 12722 var ctx = rawSlots._ctx; 12723 12724 for (var key in rawSlots) { 12725 if (isInternalKey(key)) continue; 12726 var value = rawSlots[key]; 12727 12728 if (isFunction(value)) { 12729 slots[key] = normalizeSlot(key, value, ctx); 12730 } else if (value != null) { 12731 (function () { 12732 var normalized = normalizeSlotValue(value); 12733 12734 slots[key] = function () { 12735 return normalized; 12736 }; 12737 })(); 12738 } 12739 } 12740 }; 12741 12742 var normalizeVNodeSlots = function normalizeVNodeSlots(instance, children) { 12743 var normalized = normalizeSlotValue(children); 12744 12745 instance.slots.default = function () { 12746 return normalized; 12747 }; 12748 }; 12749 12750 var initSlots = function initSlots(instance, children) { 12751 if (instance.vnode.shapeFlag & 32 12752 /* SLOTS_CHILDREN */ 12753 ) { 12754 var type = children._; 12755 12756 if (type) { 12757 // users can get the shallow readonly version of the slots object through `this.$slots`, 12758 // we should avoid the proxy object polluting the slots of the internal instance 12759 instance.slots = toRaw(children); // make compiler marker non-enumerable 12760 12761 def(children, '_', type); 12762 } else { 12763 normalizeObjectSlots(children, instance.slots = {}); 12764 } 12765 } else { 12766 instance.slots = {}; 12767 12768 if (children) { 12769 normalizeVNodeSlots(instance, children); 12770 } 12771 } 12772 12773 def(instance.slots, InternalObjectKey, 1); 12774 }; 12775 12776 var updateSlots = function updateSlots(instance, children, optimized) { 12777 var vnode = instance.vnode, 12778 slots = instance.slots; 12779 var needDeletionCheck = true; 12780 var deletionComparisonTarget = EMPTY_OBJ; 12781 12782 if (vnode.shapeFlag & 32 12783 /* SLOTS_CHILDREN */ 12784 ) { 12785 var type = children._; 12786 12787 if (type) { 12788 // compiled slots. 12789 if (optimized && type === 1 12790 /* STABLE */ 12791 ) { 12792 // compiled AND stable. 12793 // no need to update, and skip stale slots removal. 12794 needDeletionCheck = false; 12795 } else { 12796 // compiled but dynamic (v-if/v-for on slots) - update slots, but skip 12797 // normalization. 12798 extend(slots, children); // #2893 12799 // when rendering the optimized slots by manually written render function, 12800 // we need to delete the `slots._` flag if necessary to make subsequent updates reliable, 12801 // i.e. let the `renderSlot` create the bailed Fragment 12802 12803 if (!optimized && type === 1 12804 /* STABLE */ 12805 ) { 12806 delete slots._; 12807 } 12808 } 12809 } else { 12810 needDeletionCheck = !children.$stable; 12811 normalizeObjectSlots(children, slots); 12812 } 12813 12814 deletionComparisonTarget = children; 12815 } else if (children) { 12816 // non slot object children (direct value) passed to a component 12817 normalizeVNodeSlots(instance, children); 12818 deletionComparisonTarget = { 12819 default: 1 12820 }; 12821 } // delete stale slots 12822 12823 12824 if (needDeletionCheck) { 12825 for (var key in slots) { 12826 if (!isInternalKey(key) && !(key in deletionComparisonTarget)) { 12827 delete slots[key]; 12828 } 12829 } 12830 } 12831 }; 12832 /** 12833 * Adds directives to a VNode. 12834 */ 12835 12836 12837 function withDirectives(vnode, directives) { 12838 var internalInstance = currentRenderingInstance; 12839 12840 if (internalInstance === null) { 12841 return vnode; 12842 } 12843 12844 var instance = internalInstance.proxy; 12845 var bindings = vnode.dirs || (vnode.dirs = []); 12846 12847 for (var _i17 = 0; _i17 < directives.length; _i17++) { 12848 var _directives$_i = directives[_i17], 12849 dir = _directives$_i[0], 12850 value = _directives$_i[1], 12851 arg = _directives$_i[2], 12852 _directives$_i$ = _directives$_i[3], 12853 modifiers = _directives$_i$ === void 0 ? EMPTY_OBJ : _directives$_i$; 12854 12855 if (isFunction(dir)) { 12856 dir = { 12857 mounted: dir, 12858 updated: dir 12859 }; 12860 } 12861 12862 if (dir.deep) { 12863 traverse(value); 12864 } 12865 12866 bindings.push({ 12867 dir: dir, 12868 instance: instance, 12869 value: value, 12870 oldValue: void 0, 12871 arg: arg, 12872 modifiers: modifiers 12873 }); 12874 } 12875 12876 return vnode; 12877 } 12878 12879 function invokeDirectiveHook(vnode, prevVNode, instance, name) { 12880 var bindings = vnode.dirs; 12881 var oldBindings = prevVNode && prevVNode.dirs; 12882 12883 for (var _i18 = 0; _i18 < bindings.length; _i18++) { 12884 var binding = bindings[_i18]; 12885 12886 if (oldBindings) { 12887 binding.oldValue = oldBindings[_i18].value; 12888 } 12889 12890 var hook = binding.dir[name]; 12891 12892 if (hook) { 12893 // disable tracking inside all lifecycle hooks 12894 // since they can potentially be called inside effects. 12895 pauseTracking(); 12896 callWithAsyncErrorHandling(hook, instance, 8 12897 /* DIRECTIVE_HOOK */ 12898 , [vnode.el, binding, vnode, prevVNode]); 12899 resetTracking(); 12900 } 12901 } 12902 } 12903 12904 function createAppContext() { 12905 return { 12906 app: null, 12907 config: { 12908 isNativeTag: NO, 12909 performance: false, 12910 globalProperties: {}, 12911 optionMergeStrategies: {}, 12912 errorHandler: undefined, 12913 warnHandler: undefined, 12914 compilerOptions: {} 12915 }, 12916 mixins: [], 12917 components: {}, 12918 directives: {}, 12919 provides: Object.create(null), 12920 optionsCache: new WeakMap(), 12921 propsCache: new WeakMap(), 12922 emitsCache: new WeakMap() 12923 }; 12924 } 12925 12926 var uid = 0; 12927 12928 function createAppAPI(render, hydrate) { 12929 return function createApp(rootComponent, rootProps) { 12930 if (rootProps === void 0) { 12931 rootProps = null; 12932 } 12933 12934 if (rootProps != null && !isObject$1(rootProps)) { 12935 rootProps = null; 12936 } 12937 12938 var context = createAppContext(); 12939 var installedPlugins = new Set(); 12940 var isMounted = false; 12941 var app = context.app = { 12942 _uid: uid++, 12943 _component: rootComponent, 12944 _props: rootProps, 12945 _container: null, 12946 _context: context, 12947 _instance: null, 12948 version: version, 12949 12950 get config() { 12951 return context.config; 12952 }, 12953 12954 set config(v) {}, 12955 12956 use: function use(plugin) { 12957 for (var _len5 = arguments.length, options = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { 12958 options[_key5 - 1] = arguments[_key5]; 12959 } 12960 12961 if (installedPlugins.has(plugin)) ;else if (plugin && isFunction(plugin.install)) { 12962 installedPlugins.add(plugin); 12963 plugin.install.apply(plugin, [app].concat(options)); 12964 } else if (isFunction(plugin)) { 12965 installedPlugins.add(plugin); 12966 plugin.apply(void 0, [app].concat(options)); 12967 } else ; 12968 return app; 12969 }, 12970 mixin: function mixin(_mixin) { 12971 if (__VUE_OPTIONS_API__) { 12972 if (!context.mixins.includes(_mixin)) { 12973 context.mixins.push(_mixin); 12974 } 12975 } 12976 12977 return app; 12978 }, 12979 component: function component(name, _component) { 12980 if (!_component) { 12981 return context.components[name]; 12982 } 12983 12984 context.components[name] = _component; 12985 return app; 12986 }, 12987 directive: function directive(name, _directive) { 12988 if (!_directive) { 12989 return context.directives[name]; 12990 } 12991 12992 context.directives[name] = _directive; 12993 return app; 12994 }, 12995 mount: function mount(rootContainer, isHydrate, isSVG) { 12996 if (!isMounted) { 12997 var vnode = createVNode(rootComponent, rootProps); // store app context on the root VNode. 12998 // this will be set on the root instance on initial mount. 12999 13000 vnode.appContext = context; // HMR root reload 13001 13002 if (isHydrate && hydrate) { 13003 hydrate(vnode, rootContainer); 13004 } else { 13005 render(vnode, rootContainer, isSVG); 13006 } 13007 13008 isMounted = true; 13009 app._container = rootContainer; 13010 rootContainer.__vue_app__ = app; 13011 13012 if (__VUE_PROD_DEVTOOLS__) { 13013 app._instance = vnode.component; 13014 devtoolsInitApp(app, version); 13015 } 13016 13017 return getExposeProxy(vnode.component) || vnode.component.proxy; 13018 } 13019 }, 13020 unmount: function unmount() { 13021 if (isMounted) { 13022 render(null, app._container); 13023 13024 if (__VUE_PROD_DEVTOOLS__) { 13025 app._instance = null; 13026 devtoolsUnmountApp(app); 13027 } 13028 13029 delete app._container.__vue_app__; 13030 } 13031 }, 13032 provide: function provide(key, value) { 13033 // https://github.com/Microsoft/TypeScript/issues/24587 13034 context.provides[key] = value; 13035 return app; 13036 } 13037 }; 13038 return app; 13039 }; 13040 } 13041 /** 13042 * Function for handling a template ref 13043 */ 13044 13045 13046 function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount) { 13047 if (isUnmount === void 0) { 13048 isUnmount = false; 13049 } 13050 13051 if (isArray(rawRef)) { 13052 rawRef.forEach(function (r, i) { 13053 return setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount); 13054 }); 13055 return; 13056 } 13057 13058 if (isAsyncWrapper(vnode) && !isUnmount) { 13059 // when mounting async components, nothing needs to be done, 13060 // because the template ref is forwarded to inner component 13061 return; 13062 } 13063 13064 var refValue = vnode.shapeFlag & 4 13065 /* STATEFUL_COMPONENT */ 13066 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el; 13067 var value = isUnmount ? null : refValue; 13068 var owner = rawRef.i, 13069 ref = rawRef.r; 13070 var oldRef = oldRawRef && oldRawRef.r; 13071 var refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; 13072 var setupState = owner.setupState; // dynamic ref changed. unset old ref 13073 13074 if (oldRef != null && oldRef !== ref) { 13075 if (isString(oldRef)) { 13076 refs[oldRef] = null; 13077 13078 if (hasOwn(setupState, oldRef)) { 13079 setupState[oldRef] = null; 13080 } 13081 } else if (isRef(oldRef)) { 13082 oldRef.value = null; 13083 } 13084 } 13085 13086 if (isFunction(ref)) { 13087 callWithErrorHandling(ref, owner, 12 13088 /* FUNCTION_REF */ 13089 , [value, refs]); 13090 } else { 13091 var _isString = isString(ref); 13092 13093 var _isRef = isRef(ref); 13094 13095 if (_isString || _isRef) { 13096 var doSet = function doSet() { 13097 if (rawRef.f) { 13098 var existing = _isString ? refs[ref] : ref.value; 13099 13100 if (isUnmount) { 13101 isArray(existing) && remove(existing, refValue); 13102 } else { 13103 if (!isArray(existing)) { 13104 if (_isString) { 13105 refs[ref] = [refValue]; 13106 } else { 13107 ref.value = [refValue]; 13108 if (rawRef.k) refs[rawRef.k] = ref.value; 13109 } 13110 } else if (!existing.includes(refValue)) { 13111 existing.push(refValue); 13112 } 13113 } 13114 } else if (_isString) { 13115 refs[ref] = value; 13116 13117 if (hasOwn(setupState, ref)) { 13118 setupState[ref] = value; 13119 } 13120 } else if (isRef(ref)) { 13121 ref.value = value; 13122 if (rawRef.k) refs[rawRef.k] = value; 13123 } else ; 13124 }; 13125 13126 if (value) { 13127 doSet.id = -1; 13128 queuePostRenderEffect(doSet, parentSuspense); 13129 } else { 13130 doSet(); 13131 } 13132 } 13133 } 13134 } 13135 /** 13136 * This is only called in esm-bundler builds. 13137 * It is called when a renderer is created, in `baseCreateRenderer` so that 13138 * importing runtime-core is side-effects free. 13139 * 13140 * istanbul-ignore-next 13141 */ 13142 13143 13144 function initFeatureFlags() { 13145 if (typeof __VUE_OPTIONS_API__ !== 'boolean') { 13146 getGlobalThis().__VUE_OPTIONS_API__ = true; 13147 } 13148 13149 if (typeof __VUE_PROD_DEVTOOLS__ !== 'boolean') { 13150 getGlobalThis().__VUE_PROD_DEVTOOLS__ = false; 13151 } 13152 } 13153 13154 var queuePostRenderEffect = queueEffectWithSuspense; 13155 /** 13156 * The createRenderer function accepts two generic arguments: 13157 * HostNode and HostElement, corresponding to Node and Element types in the 13158 * host environment. For example, for runtime-dom, HostNode would be the DOM 13159 * `Node` interface and HostElement would be the DOM `Element` interface. 13160 * 13161 * Custom renderers can pass in the platform specific types like this: 13162 * 13163 * ``` js 13164 * const { render, createApp } = createRenderer<Node, Element>({ 13165 * patchProp, 13166 * ...nodeOps 13167 * }) 13168 * ``` 13169 */ 13170 13171 function createRenderer(options) { 13172 return baseCreateRenderer(options); 13173 } // Separate API for creating hydration-enabled renderer. 13174 13175 13176 function baseCreateRenderer(options, createHydrationFns) { 13177 // compile-time feature flags check 13178 { 13179 initFeatureFlags(); 13180 } 13181 var target = getGlobalThis(); 13182 target.__VUE__ = true; 13183 13184 if (__VUE_PROD_DEVTOOLS__) { 13185 setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); 13186 } 13187 13188 var hostInsert = options.insert, 13189 hostRemove = options.remove, 13190 hostPatchProp = options.patchProp, 13191 hostCreateElement = options.createElement, 13192 hostCreateText = options.createText, 13193 hostCreateComment = options.createComment, 13194 hostSetText = options.setText, 13195 hostSetElementText = options.setElementText, 13196 hostParentNode = options.parentNode, 13197 hostNextSibling = options.nextSibling, 13198 _options$setScopeId = options.setScopeId, 13199 hostSetScopeId = _options$setScopeId === void 0 ? NOOP : _options$setScopeId, 13200 hostCloneNode = options.cloneNode, 13201 hostInsertStaticContent = options.insertStaticContent; // Note: functions inside this closure should use `const xxx = () => {}` 13202 // style in order to prevent being inlined by minifiers. 13203 13204 var patch = function patch(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 13205 if (anchor === void 0) { 13206 anchor = null; 13207 } 13208 13209 if (parentComponent === void 0) { 13210 parentComponent = null; 13211 } 13212 13213 if (parentSuspense === void 0) { 13214 parentSuspense = null; 13215 } 13216 13217 if (isSVG === void 0) { 13218 isSVG = false; 13219 } 13220 13221 if (slotScopeIds === void 0) { 13222 slotScopeIds = null; 13223 } 13224 13225 if (optimized === void 0) { 13226 optimized = !!n2.dynamicChildren; 13227 } 13228 13229 if (n1 === n2) { 13230 return; 13231 } // patching & not same type, unmount old tree 13232 13233 13234 if (n1 && !isSameVNodeType(n1, n2)) { 13235 anchor = getNextHostNode(n1); 13236 unmount(n1, parentComponent, parentSuspense, true); 13237 n1 = null; 13238 } 13239 13240 if (n2.patchFlag === -2 13241 /* BAIL */ 13242 ) { 13243 optimized = false; 13244 n2.dynamicChildren = null; 13245 } 13246 13247 var type = n2.type, 13248 ref = n2.ref, 13249 shapeFlag = n2.shapeFlag; 13250 13251 switch (type) { 13252 case Text: 13253 processText(n1, n2, container, anchor); 13254 break; 13255 13256 case Comment: 13257 processCommentNode(n1, n2, container, anchor); 13258 break; 13259 13260 case Static: 13261 if (n1 == null) { 13262 mountStaticNode(n2, container, anchor, isSVG); 13263 } 13264 13265 break; 13266 13267 case Fragment: 13268 processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13269 break; 13270 13271 default: 13272 if (shapeFlag & 1 13273 /* ELEMENT */ 13274 ) { 13275 processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13276 } else if (shapeFlag & 6 13277 /* COMPONENT */ 13278 ) { 13279 processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13280 } else if (shapeFlag & 64 13281 /* TELEPORT */ 13282 ) { 13283 type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals); 13284 } else if (shapeFlag & 128 13285 /* SUSPENSE */ 13286 ) { 13287 type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals); 13288 } else ; 13289 13290 } // set ref 13291 13292 13293 if (ref != null && parentComponent) { 13294 setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); 13295 } 13296 }; 13297 13298 var processText = function processText(n1, n2, container, anchor) { 13299 if (n1 == null) { 13300 hostInsert(n2.el = hostCreateText(n2.children), container, anchor); 13301 } else { 13302 var el = n2.el = n1.el; 13303 13304 if (n2.children !== n1.children) { 13305 hostSetText(el, n2.children); 13306 } 13307 } 13308 }; 13309 13310 var processCommentNode = function processCommentNode(n1, n2, container, anchor) { 13311 if (n1 == null) { 13312 hostInsert(n2.el = hostCreateComment(n2.children || ''), container, anchor); 13313 } else { 13314 // there's no support for dynamic comments 13315 n2.el = n1.el; 13316 } 13317 }; 13318 13319 var mountStaticNode = function mountStaticNode(n2, container, anchor, isSVG) { 13320 var _hostInsertStaticCont = hostInsertStaticContent(n2.children, container, anchor, isSVG); 13321 13322 n2.el = _hostInsertStaticCont[0]; 13323 n2.anchor = _hostInsertStaticCont[1]; 13324 }; 13325 13326 var moveStaticNode = function moveStaticNode(_ref8, container, nextSibling) { 13327 var el = _ref8.el, 13328 anchor = _ref8.anchor; 13329 var next; 13330 13331 while (el && el !== anchor) { 13332 next = hostNextSibling(el); 13333 hostInsert(el, container, nextSibling); 13334 el = next; 13335 } 13336 13337 hostInsert(anchor, container, nextSibling); 13338 }; 13339 13340 var removeStaticNode = function removeStaticNode(_ref9) { 13341 var el = _ref9.el, 13342 anchor = _ref9.anchor; 13343 var next; 13344 13345 while (el && el !== anchor) { 13346 next = hostNextSibling(el); 13347 hostRemove(el); 13348 el = next; 13349 } 13350 13351 hostRemove(anchor); 13352 }; 13353 13354 var processElement = function processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 13355 isSVG = isSVG || n2.type === 'svg'; 13356 13357 if (n1 == null) { 13358 mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13359 } else { 13360 patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13361 } 13362 }; 13363 13364 var mountElement = function mountElement(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 13365 var el; 13366 var vnodeHook; 13367 var type = vnode.type, 13368 props = vnode.props, 13369 shapeFlag = vnode.shapeFlag, 13370 transition = vnode.transition, 13371 patchFlag = vnode.patchFlag, 13372 dirs = vnode.dirs; 13373 13374 if (vnode.el && hostCloneNode !== undefined && patchFlag === -1 13375 /* HOISTED */ 13376 ) { 13377 // If a vnode has non-null el, it means it's being reused. 13378 // Only static vnodes can be reused, so its mounted DOM nodes should be 13379 // exactly the same, and we can simply do a clone here. 13380 // only do this in production since cloned trees cannot be HMR updated. 13381 el = vnode.el = hostCloneNode(vnode.el); 13382 } else { 13383 el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props); // mount children first, since some props may rely on child content 13384 // being already rendered, e.g. `<select value>` 13385 13386 if (shapeFlag & 8 13387 /* TEXT_CHILDREN */ 13388 ) { 13389 hostSetElementText(el, vnode.children); 13390 } else if (shapeFlag & 16 13391 /* ARRAY_CHILDREN */ 13392 ) { 13393 mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized); 13394 } 13395 13396 if (dirs) { 13397 invokeDirectiveHook(vnode, null, parentComponent, 'created'); 13398 } // props 13399 13400 13401 if (props) { 13402 for (var key in props) { 13403 if (key !== 'value' && !isReservedProp(key)) { 13404 hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); 13405 } 13406 } 13407 /** 13408 * Special case for setting value on DOM elements: 13409 * - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024) 13410 * - it needs to be forced (#1471) 13411 * #2353 proposes adding another renderer option to configure this, but 13412 * the properties affects are so finite it is worth special casing it 13413 * here to reduce the complexity. (Special casing it also should not 13414 * affect non-DOM renderers) 13415 */ 13416 13417 13418 if ('value' in props) { 13419 hostPatchProp(el, 'value', null, props.value); 13420 } 13421 13422 if (vnodeHook = props.onVnodeBeforeMount) { 13423 invokeVNodeHook(vnodeHook, parentComponent, vnode); 13424 } 13425 } // scopeId 13426 13427 13428 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); 13429 } 13430 13431 if (__VUE_PROD_DEVTOOLS__) { 13432 Object.defineProperty(el, '__vnode', { 13433 value: vnode, 13434 enumerable: false 13435 }); 13436 Object.defineProperty(el, '__vueParentComponent', { 13437 value: parentComponent, 13438 enumerable: false 13439 }); 13440 } 13441 13442 if (dirs) { 13443 invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount'); 13444 } // #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved 13445 // #1689 For inside suspense + suspense resolved case, just call it 13446 13447 13448 var needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; 13449 13450 if (needCallTransitionHooks) { 13451 transition.beforeEnter(el); 13452 } 13453 13454 hostInsert(el, container, anchor); 13455 13456 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { 13457 queuePostRenderEffect(function () { 13458 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 13459 needCallTransitionHooks && transition.enter(el); 13460 dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted'); 13461 }, parentSuspense); 13462 } 13463 }; 13464 13465 var setScopeId = function setScopeId(el, vnode, scopeId, slotScopeIds, parentComponent) { 13466 if (scopeId) { 13467 hostSetScopeId(el, scopeId); 13468 } 13469 13470 if (slotScopeIds) { 13471 for (var _i19 = 0; _i19 < slotScopeIds.length; _i19++) { 13472 hostSetScopeId(el, slotScopeIds[_i19]); 13473 } 13474 } 13475 13476 if (parentComponent) { 13477 var subTree = parentComponent.subTree; 13478 13479 if (vnode === subTree) { 13480 var parentVNode = parentComponent.vnode; 13481 setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent); 13482 } 13483 } 13484 }; 13485 13486 var mountChildren = function mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start) { 13487 if (start === void 0) { 13488 start = 0; 13489 } 13490 13491 for (var _i20 = start; _i20 < children.length; _i20++) { 13492 var child = children[_i20] = optimized ? cloneIfMounted(children[_i20]) : normalizeVNode(children[_i20]); 13493 patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13494 } 13495 }; 13496 13497 var patchElement = function patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 13498 var el = n2.el = n1.el; 13499 var patchFlag = n2.patchFlag, 13500 dynamicChildren = n2.dynamicChildren, 13501 dirs = n2.dirs; // #1426 take the old vnode's patch flag into account since user may clone a 13502 // compiler-generated vnode, which de-opts to FULL_PROPS 13503 13504 patchFlag |= n1.patchFlag & 16 13505 /* FULL_PROPS */ 13506 ; 13507 var oldProps = n1.props || EMPTY_OBJ; 13508 var newProps = n2.props || EMPTY_OBJ; 13509 var vnodeHook; // disable recurse in beforeUpdate hooks 13510 13511 parentComponent && toggleRecurse(parentComponent, false); 13512 13513 if (vnodeHook = newProps.onVnodeBeforeUpdate) { 13514 invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 13515 } 13516 13517 if (dirs) { 13518 invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate'); 13519 } 13520 13521 parentComponent && toggleRecurse(parentComponent, true); 13522 var areChildrenSVG = isSVG && n2.type !== 'foreignObject'; 13523 13524 if (dynamicChildren) { 13525 patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds); 13526 } else if (!optimized) { 13527 // full diff 13528 patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false); 13529 } 13530 13531 if (patchFlag > 0) { 13532 // the presence of a patchFlag means this element's render code was 13533 // generated by the compiler and can take the fast path. 13534 // in this path old node and new node are guaranteed to have the same shape 13535 // (i.e. at the exact same position in the source template) 13536 if (patchFlag & 16 13537 /* FULL_PROPS */ 13538 ) { 13539 // element props contain dynamic keys, full diff needed 13540 patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG); 13541 } else { 13542 // class 13543 // this flag is matched when the element has dynamic class bindings. 13544 if (patchFlag & 2 13545 /* CLASS */ 13546 ) { 13547 if (oldProps.class !== newProps.class) { 13548 hostPatchProp(el, 'class', null, newProps.class, isSVG); 13549 } 13550 } // style 13551 // this flag is matched when the element has dynamic style bindings 13552 13553 13554 if (patchFlag & 4 13555 /* STYLE */ 13556 ) { 13557 hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG); 13558 } // props 13559 // This flag is matched when the element has dynamic prop/attr bindings 13560 // other than class and style. The keys of dynamic prop/attrs are saved for 13561 // faster iteration. 13562 // Note dynamic keys like :[foo]="bar" will cause this optimization to 13563 // bail out and go through a full diff because we need to unset the old key 13564 13565 13566 if (patchFlag & 8 13567 /* PROPS */ 13568 ) { 13569 // if the flag is present then dynamicProps must be non-null 13570 var propsToUpdate = n2.dynamicProps; 13571 13572 for (var _i21 = 0; _i21 < propsToUpdate.length; _i21++) { 13573 var key = propsToUpdate[_i21]; 13574 var prev = oldProps[key]; 13575 var next = newProps[key]; // #1471 force patch value 13576 13577 if (next !== prev || key === 'value') { 13578 hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren); 13579 } 13580 } 13581 } 13582 } // text 13583 // This flag is matched when the element has only dynamic text children. 13584 13585 13586 if (patchFlag & 1 13587 /* TEXT */ 13588 ) { 13589 if (n1.children !== n2.children) { 13590 hostSetElementText(el, n2.children); 13591 } 13592 } 13593 } else if (!optimized && dynamicChildren == null) { 13594 // unoptimized, full diff 13595 patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG); 13596 } 13597 13598 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { 13599 queuePostRenderEffect(function () { 13600 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 13601 dirs && invokeDirectiveHook(n2, n1, parentComponent, 'updated'); 13602 }, parentSuspense); 13603 } 13604 }; // The fast path for blocks. 13605 13606 13607 var patchBlockChildren = function patchBlockChildren(oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) { 13608 for (var _i22 = 0; _i22 < newChildren.length; _i22++) { 13609 var oldVNode = oldChildren[_i22]; 13610 var newVNode = newChildren[_i22]; // Determine the container (parent element) for the patch. 13611 13612 var container = // oldVNode may be an errored async setup() component inside Suspense 13613 // which will not have a mounted element 13614 oldVNode.el && ( // - In the case of a Fragment, we need to provide the actual parent 13615 // of the Fragment itself so it can move its children. 13616 oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement 13617 // which also requires the correct parent container 13618 !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. 13619 oldVNode.shapeFlag & (6 13620 /* COMPONENT */ 13621 | 64 13622 /* TELEPORT */ 13623 )) ? hostParentNode(oldVNode.el) : // In other cases, the parent container is not actually used so we 13624 // just pass the block element here to avoid a DOM parentNode call. 13625 fallbackContainer; 13626 patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true); 13627 } 13628 }; 13629 13630 var patchProps = function patchProps(el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) { 13631 if (oldProps !== newProps) { 13632 for (var key in newProps) { 13633 // empty string is not valid prop 13634 if (isReservedProp(key)) continue; 13635 var next = newProps[key]; 13636 var prev = oldProps[key]; // defer patching value 13637 13638 if (next !== prev && key !== 'value') { 13639 hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); 13640 } 13641 } 13642 13643 if (oldProps !== EMPTY_OBJ) { 13644 for (var _key11 in oldProps) { 13645 if (!isReservedProp(_key11) && !(_key11 in newProps)) { 13646 hostPatchProp(el, _key11, oldProps[_key11], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); 13647 } 13648 } 13649 } 13650 13651 if ('value' in newProps) { 13652 hostPatchProp(el, 'value', oldProps.value, newProps.value); 13653 } 13654 } 13655 }; 13656 13657 var processFragment = function processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 13658 var fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(''); 13659 var fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(''); 13660 var patchFlag = n2.patchFlag, 13661 dynamicChildren = n2.dynamicChildren, 13662 fragmentSlotScopeIds = n2.slotScopeIds; 13663 13664 if (fragmentSlotScopeIds) { 13665 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 13666 } 13667 13668 if (n1 == null) { 13669 hostInsert(fragmentStartAnchor, container, anchor); 13670 hostInsert(fragmentEndAnchor, container, anchor); // a fragment can only have array children 13671 // since they are either generated by the compiler, or implicitly created 13672 // from arrays. 13673 13674 mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13675 } else { 13676 if (patchFlag > 0 && patchFlag & 64 13677 /* STABLE_FRAGMENT */ 13678 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result 13679 // of renderSlot() with no valid children 13680 n1.dynamicChildren) { 13681 // a stable fragment (template root or <template v-for>) doesn't need to 13682 // patch children order, but it may contain dynamicChildren. 13683 patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds); 13684 13685 if ( // #2080 if the stable fragment has a key, it's a <template v-for> that may 13686 // get moved around. Make sure all root level vnodes inherit el. 13687 // #2134 or if it's a component root, it may also get moved around 13688 // as the component is being moved. 13689 n2.key != null || parentComponent && n2 === parentComponent.subTree) { 13690 traverseStaticChildren(n1, n2, true 13691 /* shallow */ 13692 ); 13693 } 13694 } else { 13695 // keyed / unkeyed, or manual fragments. 13696 // for keyed & unkeyed, since they are compiler generated from v-for, 13697 // each child is guaranteed to be a block so the fragment will never 13698 // have dynamicChildren. 13699 patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13700 } 13701 } 13702 }; 13703 13704 var processComponent = function processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 13705 n2.slotScopeIds = slotScopeIds; 13706 13707 if (n1 == null) { 13708 if (n2.shapeFlag & 512 13709 /* COMPONENT_KEPT_ALIVE */ 13710 ) { 13711 parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized); 13712 } else { 13713 mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized); 13714 } 13715 } else { 13716 updateComponent(n1, n2, optimized); 13717 } 13718 }; 13719 13720 var mountComponent = function mountComponent(initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) { 13721 var instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense); 13722 13723 if (isKeepAlive(initialVNode)) { 13724 instance.ctx.renderer = internals; 13725 } // resolve props and slots for setup context 13726 13727 13728 { 13729 setupComponent(instance); 13730 } // setup() is async. This component relies on async logic to be resolved 13731 // before proceeding 13732 13733 if (instance.asyncDep) { 13734 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect); // Give it a placeholder if this is not hydration 13735 // TODO handle self-defined fallback 13736 13737 if (!initialVNode.el) { 13738 var placeholder = instance.subTree = createVNode(Comment); 13739 processCommentNode(null, placeholder, container, anchor); 13740 } 13741 13742 return; 13743 } 13744 13745 setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized); 13746 }; 13747 13748 var updateComponent = function updateComponent(n1, n2, optimized) { 13749 var instance = n2.component = n1.component; 13750 13751 if (shouldUpdateComponent(n1, n2, optimized)) { 13752 if (instance.asyncDep && !instance.asyncResolved) { 13753 updateComponentPreRender(instance, n2, optimized); 13754 return; 13755 } else { 13756 // normal update 13757 instance.next = n2; // in case the child component is also queued, remove it to avoid 13758 // double updating the same child component in the same flush. 13759 13760 invalidateJob(instance.update); // instance.update is the reactive effect. 13761 13762 instance.update(); 13763 } 13764 } else { 13765 // no update needed. just copy over properties 13766 n2.component = n1.component; 13767 n2.el = n1.el; 13768 instance.vnode = n2; 13769 } 13770 }; 13771 13772 var setupRenderEffect = function setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) { 13773 var componentUpdateFn = function componentUpdateFn() { 13774 if (!instance.isMounted) { 13775 var vnodeHook; 13776 var _initialVNode = initialVNode, 13777 el = _initialVNode.el, 13778 props = _initialVNode.props; 13779 var bm = instance.bm, 13780 m = instance.m, 13781 parent = instance.parent; 13782 var isAsyncWrapperVNode = isAsyncWrapper(initialVNode); 13783 toggleRecurse(instance, false); // beforeMount hook 13784 13785 if (bm) { 13786 invokeArrayFns(bm); 13787 } // onVnodeBeforeMount 13788 13789 13790 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { 13791 invokeVNodeHook(vnodeHook, parent, initialVNode); 13792 } 13793 13794 toggleRecurse(instance, true); 13795 13796 if (el && hydrateNode) { 13797 // vnode has adopted host node - perform hydration instead of mount. 13798 var hydrateSubTree = function hydrateSubTree() { 13799 instance.subTree = renderComponentRoot(instance); 13800 hydrateNode(el, instance.subTree, instance, parentSuspense, null); 13801 }; 13802 13803 if (isAsyncWrapperVNode) { 13804 initialVNode.type.__asyncLoader().then( // note: we are moving the render call into an async callback, 13805 // which means it won't track dependencies - but it's ok because 13806 // a server-rendered async wrapper is already in resolved state 13807 // and it will never need to change. 13808 function () { 13809 return !instance.isUnmounted && hydrateSubTree(); 13810 }); 13811 } else { 13812 hydrateSubTree(); 13813 } 13814 } else { 13815 var subTree = instance.subTree = renderComponentRoot(instance); 13816 patch(null, subTree, container, anchor, instance, parentSuspense, isSVG); 13817 initialVNode.el = subTree.el; 13818 } // mounted hook 13819 13820 13821 if (m) { 13822 queuePostRenderEffect(m, parentSuspense); 13823 } // onVnodeMounted 13824 13825 13826 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { 13827 var scopedInitialVNode = initialVNode; 13828 queuePostRenderEffect(function () { 13829 return invokeVNodeHook(vnodeHook, parent, scopedInitialVNode); 13830 }, parentSuspense); 13831 } // activated hook for keep-alive roots. 13832 // #1742 activated hook must be accessed after first render 13833 // since the hook may be injected by a child keep-alive 13834 13835 13836 if (initialVNode.shapeFlag & 256 13837 /* COMPONENT_SHOULD_KEEP_ALIVE */ 13838 ) { 13839 instance.a && queuePostRenderEffect(instance.a, parentSuspense); 13840 } 13841 13842 instance.isMounted = true; 13843 13844 if (__VUE_PROD_DEVTOOLS__) { 13845 devtoolsComponentAdded(instance); 13846 } // #2458: deference mount-only object parameters to prevent memleaks 13847 13848 13849 initialVNode = container = anchor = null; 13850 } else { 13851 // updateComponent 13852 // This is triggered by mutation of component's own state (next: null) 13853 // OR parent calling processComponent (next: VNode) 13854 var next = instance.next, 13855 bu = instance.bu, 13856 _u = instance.u, 13857 _parent = instance.parent, 13858 vnode = instance.vnode; 13859 var originNext = next; 13860 13861 var _vnodeHook; 13862 13863 toggleRecurse(instance, false); 13864 13865 if (next) { 13866 next.el = vnode.el; 13867 updateComponentPreRender(instance, next, optimized); 13868 } else { 13869 next = vnode; 13870 } // beforeUpdate hook 13871 13872 13873 if (bu) { 13874 invokeArrayFns(bu); 13875 } // onVnodeBeforeUpdate 13876 13877 13878 if (_vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { 13879 invokeVNodeHook(_vnodeHook, _parent, next, vnode); 13880 } 13881 13882 toggleRecurse(instance, true); // render 13883 13884 var nextTree = renderComponentRoot(instance); 13885 var prevTree = instance.subTree; 13886 instance.subTree = nextTree; 13887 patch(prevTree, nextTree, // parent may have changed if it's in a teleport 13888 hostParentNode(prevTree.el), // anchor may have changed if it's in a fragment 13889 getNextHostNode(prevTree), instance, parentSuspense, isSVG); 13890 next.el = nextTree.el; 13891 13892 if (originNext === null) { 13893 // self-triggered update. In case of HOC, update parent component 13894 // vnode el. HOC is indicated by parent instance's subTree pointing 13895 // to child component's vnode 13896 updateHOCHostEl(instance, nextTree.el); 13897 } // updated hook 13898 13899 13900 if (_u) { 13901 queuePostRenderEffect(_u, parentSuspense); 13902 } // onVnodeUpdated 13903 13904 13905 if (_vnodeHook = next.props && next.props.onVnodeUpdated) { 13906 queuePostRenderEffect(function () { 13907 return invokeVNodeHook(_vnodeHook, _parent, next, vnode); 13908 }, parentSuspense); 13909 } 13910 13911 if (__VUE_PROD_DEVTOOLS__) { 13912 devtoolsComponentUpdated(instance); 13913 } 13914 } 13915 }; // create reactive effect for rendering 13916 13917 13918 var effect = instance.effect = new ReactiveEffect(componentUpdateFn, function () { 13919 return queueJob(instance.update); 13920 }, instance.scope // track it in component's effect scope 13921 ); 13922 var update = instance.update = effect.run.bind(effect); 13923 update.id = instance.uid; // allowRecurse 13924 // #1801, #2043 component render effects should allow recursive updates 13925 13926 toggleRecurse(instance, true); 13927 update(); 13928 }; 13929 13930 var updateComponentPreRender = function updateComponentPreRender(instance, nextVNode, optimized) { 13931 nextVNode.component = instance; 13932 var prevProps = instance.vnode.props; 13933 instance.vnode = nextVNode; 13934 instance.next = null; 13935 updateProps(instance, nextVNode.props, prevProps, optimized); 13936 updateSlots(instance, nextVNode.children, optimized); 13937 pauseTracking(); // props update may have triggered pre-flush watchers. 13938 // flush them before the render update. 13939 13940 flushPreFlushCbs(undefined, instance.update); 13941 resetTracking(); 13942 }; 13943 13944 var patchChildren = function patchChildren(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 13945 if (optimized === void 0) { 13946 optimized = false; 13947 } 13948 13949 var c1 = n1 && n1.children; 13950 var prevShapeFlag = n1 ? n1.shapeFlag : 0; 13951 var c2 = n2.children; 13952 var patchFlag = n2.patchFlag, 13953 shapeFlag = n2.shapeFlag; // fast path 13954 13955 if (patchFlag > 0) { 13956 if (patchFlag & 128 13957 /* KEYED_FRAGMENT */ 13958 ) { 13959 // this could be either fully-keyed or mixed (some keyed some not) 13960 // presence of patchFlag means children are guaranteed to be arrays 13961 patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13962 return; 13963 } else if (patchFlag & 256 13964 /* UNKEYED_FRAGMENT */ 13965 ) { 13966 // unkeyed 13967 patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13968 return; 13969 } 13970 } // children has 3 possibilities: text, array or no children. 13971 13972 13973 if (shapeFlag & 8 13974 /* TEXT_CHILDREN */ 13975 ) { 13976 // text children fast path 13977 if (prevShapeFlag & 16 13978 /* ARRAY_CHILDREN */ 13979 ) { 13980 unmountChildren(c1, parentComponent, parentSuspense); 13981 } 13982 13983 if (c2 !== c1) { 13984 hostSetElementText(container, c2); 13985 } 13986 } else { 13987 if (prevShapeFlag & 16 13988 /* ARRAY_CHILDREN */ 13989 ) { 13990 // prev children was array 13991 if (shapeFlag & 16 13992 /* ARRAY_CHILDREN */ 13993 ) { 13994 // two arrays, cannot assume anything, do full diff 13995 patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 13996 } else { 13997 // no new children, just unmount old 13998 unmountChildren(c1, parentComponent, parentSuspense, true); 13999 } 14000 } else { 14001 // prev children was text OR null 14002 // new children is array OR null 14003 if (prevShapeFlag & 8 14004 /* TEXT_CHILDREN */ 14005 ) { 14006 hostSetElementText(container, ''); 14007 } // mount new if array 14008 14009 14010 if (shapeFlag & 16 14011 /* ARRAY_CHILDREN */ 14012 ) { 14013 mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 14014 } 14015 } 14016 } 14017 }; 14018 14019 var patchUnkeyedChildren = function patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 14020 c1 = c1 || EMPTY_ARR; 14021 c2 = c2 || EMPTY_ARR; 14022 var oldLength = c1.length; 14023 var newLength = c2.length; 14024 var commonLength = Math.min(oldLength, newLength); 14025 var i; 14026 14027 for (i = 0; i < commonLength; i++) { 14028 var nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 14029 patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 14030 } 14031 14032 if (oldLength > newLength) { 14033 // remove old 14034 unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength); 14035 } else { 14036 // mount new 14037 mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength); 14038 } 14039 }; // can be all-keyed or mixed 14040 14041 14042 var patchKeyedChildren = function patchKeyedChildren(c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) { 14043 var i = 0; 14044 var l2 = c2.length; 14045 var e1 = c1.length - 1; // prev ending index 14046 14047 var e2 = l2 - 1; // next ending index 14048 // 1. sync from start 14049 // (a b) c 14050 // (a b) d e 14051 14052 while (i <= e1 && i <= e2) { 14053 var n1 = c1[i]; 14054 var n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 14055 14056 if (isSameVNodeType(n1, n2)) { 14057 patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 14058 } else { 14059 break; 14060 } 14061 14062 i++; 14063 } // 2. sync from end 14064 // a (b c) 14065 // d e (b c) 14066 14067 14068 while (i <= e1 && i <= e2) { 14069 var _n2 = c1[e1]; 14070 14071 var _n3 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); 14072 14073 if (isSameVNodeType(_n2, _n3)) { 14074 patch(_n2, _n3, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 14075 } else { 14076 break; 14077 } 14078 14079 e1--; 14080 e2--; 14081 } // 3. common sequence + mount 14082 // (a b) 14083 // (a b) c 14084 // i = 2, e1 = 1, e2 = 2 14085 // (a b) 14086 // c (a b) 14087 // i = 0, e1 = -1, e2 = 0 14088 14089 14090 if (i > e1) { 14091 if (i <= e2) { 14092 var nextPos = e2 + 1; 14093 var anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; 14094 14095 while (i <= e2) { 14096 patch(null, c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 14097 i++; 14098 } 14099 } 14100 } // 4. common sequence + unmount 14101 // (a b) c 14102 // (a b) 14103 // i = 2, e1 = 2, e2 = 1 14104 // a (b c) 14105 // (b c) 14106 // i = 0, e1 = 0, e2 = -1 14107 else if (i > e2) { 14108 while (i <= e1) { 14109 unmount(c1[i], parentComponent, parentSuspense, true); 14110 i++; 14111 } 14112 } // 5. unknown sequence 14113 // [i ... e1 + 1]: a b [c d e] f g 14114 // [i ... e2 + 1]: a b [e d c h] f g 14115 // i = 2, e1 = 4, e2 = 5 14116 else { 14117 var s1 = i; // prev starting index 14118 14119 var s2 = i; // next starting index 14120 // 5.1 build key:index map for newChildren 14121 14122 var keyToNewIndexMap = new Map(); 14123 14124 for (i = s2; i <= e2; i++) { 14125 var nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 14126 14127 if (nextChild.key != null) { 14128 keyToNewIndexMap.set(nextChild.key, i); 14129 } 14130 } // 5.2 loop through old children left to be patched and try to patch 14131 // matching nodes & remove nodes that are no longer present 14132 14133 14134 var j; 14135 var patched = 0; 14136 var toBePatched = e2 - s2 + 1; 14137 var moved = false; // used to track whether any node has moved 14138 14139 var maxNewIndexSoFar = 0; // works as Map<newIndex, oldIndex> 14140 // Note that oldIndex is offset by +1 14141 // and oldIndex = 0 is a special value indicating the new node has 14142 // no corresponding old node. 14143 // used for determining longest stable subsequence 14144 14145 var newIndexToOldIndexMap = new Array(toBePatched); 14146 14147 for (i = 0; i < toBePatched; i++) { 14148 newIndexToOldIndexMap[i] = 0; 14149 } 14150 14151 for (i = s1; i <= e1; i++) { 14152 var prevChild = c1[i]; 14153 14154 if (patched >= toBePatched) { 14155 // all new children have been patched so this can only be a removal 14156 unmount(prevChild, parentComponent, parentSuspense, true); 14157 continue; 14158 } 14159 14160 var newIndex = void 0; 14161 14162 if (prevChild.key != null) { 14163 newIndex = keyToNewIndexMap.get(prevChild.key); 14164 } else { 14165 // key-less node, try to locate a key-less node of the same type 14166 for (j = s2; j <= e2; j++) { 14167 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { 14168 newIndex = j; 14169 break; 14170 } 14171 } 14172 } 14173 14174 if (newIndex === undefined) { 14175 unmount(prevChild, parentComponent, parentSuspense, true); 14176 } else { 14177 newIndexToOldIndexMap[newIndex - s2] = i + 1; 14178 14179 if (newIndex >= maxNewIndexSoFar) { 14180 maxNewIndexSoFar = newIndex; 14181 } else { 14182 moved = true; 14183 } 14184 14185 patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 14186 patched++; 14187 } 14188 } // 5.3 move and mount 14189 // generate longest stable subsequence only when nodes have moved 14190 14191 14192 var increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; 14193 j = increasingNewIndexSequence.length - 1; // looping backwards so that we can use last patched node as anchor 14194 14195 for (i = toBePatched - 1; i >= 0; i--) { 14196 var nextIndex = s2 + i; 14197 var _nextChild = c2[nextIndex]; 14198 14199 var _anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; 14200 14201 if (newIndexToOldIndexMap[i] === 0) { 14202 // mount new 14203 patch(null, _nextChild, container, _anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 14204 } else if (moved) { 14205 // move if: 14206 // There is no stable subsequence (e.g. a reverse) 14207 // OR current node is not among the stable sequence 14208 if (j < 0 || i !== increasingNewIndexSequence[j]) { 14209 move(_nextChild, container, _anchor, 2 14210 /* REORDER */ 14211 ); 14212 } else { 14213 j--; 14214 } 14215 } 14216 } 14217 } 14218 }; 14219 14220 var move = function move(vnode, container, anchor, moveType, parentSuspense) { 14221 if (parentSuspense === void 0) { 14222 parentSuspense = null; 14223 } 14224 14225 var el = vnode.el, 14226 type = vnode.type, 14227 transition = vnode.transition, 14228 children = vnode.children, 14229 shapeFlag = vnode.shapeFlag; 14230 14231 if (shapeFlag & 6 14232 /* COMPONENT */ 14233 ) { 14234 move(vnode.component.subTree, container, anchor, moveType); 14235 return; 14236 } 14237 14238 if (shapeFlag & 128 14239 /* SUSPENSE */ 14240 ) { 14241 vnode.suspense.move(container, anchor, moveType); 14242 return; 14243 } 14244 14245 if (shapeFlag & 64 14246 /* TELEPORT */ 14247 ) { 14248 type.move(vnode, container, anchor, internals); 14249 return; 14250 } 14251 14252 if (type === Fragment) { 14253 hostInsert(el, container, anchor); 14254 14255 for (var _i23 = 0; _i23 < children.length; _i23++) { 14256 move(children[_i23], container, anchor, moveType); 14257 } 14258 14259 hostInsert(vnode.anchor, container, anchor); 14260 return; 14261 } 14262 14263 if (type === Static) { 14264 moveStaticNode(vnode, container, anchor); 14265 return; 14266 } // single nodes 14267 14268 14269 var needTransition = moveType !== 2 14270 /* REORDER */ 14271 && shapeFlag & 1 14272 /* ELEMENT */ 14273 && transition; 14274 14275 if (needTransition) { 14276 if (moveType === 0 14277 /* ENTER */ 14278 ) { 14279 transition.beforeEnter(el); 14280 hostInsert(el, container, anchor); 14281 queuePostRenderEffect(function () { 14282 return transition.enter(el); 14283 }, parentSuspense); 14284 } else { 14285 var leave = transition.leave, 14286 delayLeave = transition.delayLeave, 14287 afterLeave = transition.afterLeave; 14288 14289 var _remove = function _remove() { 14290 return hostInsert(el, container, anchor); 14291 }; 14292 14293 var performLeave = function performLeave() { 14294 leave(el, function () { 14295 _remove(); 14296 14297 afterLeave && afterLeave(); 14298 }); 14299 }; 14300 14301 if (delayLeave) { 14302 delayLeave(el, _remove, performLeave); 14303 } else { 14304 performLeave(); 14305 } 14306 } 14307 } else { 14308 hostInsert(el, container, anchor); 14309 } 14310 }; 14311 14312 var unmount = function unmount(vnode, parentComponent, parentSuspense, doRemove, optimized) { 14313 if (doRemove === void 0) { 14314 doRemove = false; 14315 } 14316 14317 if (optimized === void 0) { 14318 optimized = false; 14319 } 14320 14321 var type = vnode.type, 14322 props = vnode.props, 14323 ref = vnode.ref, 14324 children = vnode.children, 14325 dynamicChildren = vnode.dynamicChildren, 14326 shapeFlag = vnode.shapeFlag, 14327 patchFlag = vnode.patchFlag, 14328 dirs = vnode.dirs; // unset ref 14329 14330 if (ref != null) { 14331 setRef(ref, null, parentSuspense, vnode, true); 14332 } 14333 14334 if (shapeFlag & 256 14335 /* COMPONENT_SHOULD_KEEP_ALIVE */ 14336 ) { 14337 parentComponent.ctx.deactivate(vnode); 14338 return; 14339 } 14340 14341 var shouldInvokeDirs = shapeFlag & 1 14342 /* ELEMENT */ 14343 && dirs; 14344 var shouldInvokeVnodeHook = !isAsyncWrapper(vnode); 14345 var vnodeHook; 14346 14347 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { 14348 invokeVNodeHook(vnodeHook, parentComponent, vnode); 14349 } 14350 14351 if (shapeFlag & 6 14352 /* COMPONENT */ 14353 ) { 14354 unmountComponent(vnode.component, parentSuspense, doRemove); 14355 } else { 14356 if (shapeFlag & 128 14357 /* SUSPENSE */ 14358 ) { 14359 vnode.suspense.unmount(parentSuspense, doRemove); 14360 return; 14361 } 14362 14363 if (shouldInvokeDirs) { 14364 invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount'); 14365 } 14366 14367 if (shapeFlag & 64 14368 /* TELEPORT */ 14369 ) { 14370 vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove); 14371 } else if (dynamicChildren && ( // #1153: fast path should not be taken for non-stable (v-for) fragments 14372 type !== Fragment || patchFlag > 0 && patchFlag & 64 14373 /* STABLE_FRAGMENT */ 14374 )) { 14375 // fast path for block nodes: only need to unmount dynamic children. 14376 unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true); 14377 } else if (type === Fragment && patchFlag & (128 14378 /* KEYED_FRAGMENT */ 14379 | 256 14380 /* UNKEYED_FRAGMENT */ 14381 ) || !optimized && shapeFlag & 16 14382 /* ARRAY_CHILDREN */ 14383 ) { 14384 unmountChildren(children, parentComponent, parentSuspense); 14385 } 14386 14387 if (doRemove) { 14388 remove(vnode); 14389 } 14390 } 14391 14392 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { 14393 queuePostRenderEffect(function () { 14394 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 14395 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, 'unmounted'); 14396 }, parentSuspense); 14397 } 14398 }; 14399 14400 var remove = function remove(vnode) { 14401 var type = vnode.type, 14402 el = vnode.el, 14403 anchor = vnode.anchor, 14404 transition = vnode.transition; 14405 14406 if (type === Fragment) { 14407 removeFragment(el, anchor); 14408 return; 14409 } 14410 14411 if (type === Static) { 14412 removeStaticNode(vnode); 14413 return; 14414 } 14415 14416 var performRemove = function performRemove() { 14417 hostRemove(el); 14418 14419 if (transition && !transition.persisted && transition.afterLeave) { 14420 transition.afterLeave(); 14421 } 14422 }; 14423 14424 if (vnode.shapeFlag & 1 14425 /* ELEMENT */ 14426 && transition && !transition.persisted) { 14427 var leave = transition.leave, 14428 delayLeave = transition.delayLeave; 14429 14430 var performLeave = function performLeave() { 14431 return leave(el, performRemove); 14432 }; 14433 14434 if (delayLeave) { 14435 delayLeave(vnode.el, performRemove, performLeave); 14436 } else { 14437 performLeave(); 14438 } 14439 } else { 14440 performRemove(); 14441 } 14442 }; 14443 14444 var removeFragment = function removeFragment(cur, end) { 14445 // For fragments, directly remove all contained DOM nodes. 14446 // (fragment child nodes cannot have transition) 14447 var next; 14448 14449 while (cur !== end) { 14450 next = hostNextSibling(cur); 14451 hostRemove(cur); 14452 cur = next; 14453 } 14454 14455 hostRemove(end); 14456 }; 14457 14458 var unmountComponent = function unmountComponent(instance, parentSuspense, doRemove) { 14459 var bum = instance.bum, 14460 scope = instance.scope, 14461 update = instance.update, 14462 subTree = instance.subTree, 14463 um = instance.um; // beforeUnmount hook 14464 14465 if (bum) { 14466 invokeArrayFns(bum); 14467 } // stop effects in component scope 14468 14469 14470 scope.stop(); // update may be null if a component is unmounted before its async 14471 // setup has resolved. 14472 14473 if (update) { 14474 // so that scheduler will no longer invoke it 14475 update.active = false; 14476 unmount(subTree, instance, parentSuspense, doRemove); 14477 } // unmounted hook 14478 14479 14480 if (um) { 14481 queuePostRenderEffect(um, parentSuspense); 14482 } 14483 14484 queuePostRenderEffect(function () { 14485 instance.isUnmounted = true; 14486 }, parentSuspense); // A component with async dep inside a pending suspense is unmounted before 14487 // its async dep resolves. This should remove the dep from the suspense, and 14488 // cause the suspense to resolve immediately if that was the last dep. 14489 14490 if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { 14491 parentSuspense.deps--; 14492 14493 if (parentSuspense.deps === 0) { 14494 parentSuspense.resolve(); 14495 } 14496 } 14497 14498 if (__VUE_PROD_DEVTOOLS__) { 14499 devtoolsComponentRemoved(instance); 14500 } 14501 }; 14502 14503 var unmountChildren = function unmountChildren(children, parentComponent, parentSuspense, doRemove, optimized, start) { 14504 if (doRemove === void 0) { 14505 doRemove = false; 14506 } 14507 14508 if (optimized === void 0) { 14509 optimized = false; 14510 } 14511 14512 if (start === void 0) { 14513 start = 0; 14514 } 14515 14516 for (var _i24 = start; _i24 < children.length; _i24++) { 14517 unmount(children[_i24], parentComponent, parentSuspense, doRemove, optimized); 14518 } 14519 }; 14520 14521 var getNextHostNode = function getNextHostNode(vnode) { 14522 if (vnode.shapeFlag & 6 14523 /* COMPONENT */ 14524 ) { 14525 return getNextHostNode(vnode.component.subTree); 14526 } 14527 14528 if (vnode.shapeFlag & 128 14529 /* SUSPENSE */ 14530 ) { 14531 return vnode.suspense.next(); 14532 } 14533 14534 return hostNextSibling(vnode.anchor || vnode.el); 14535 }; 14536 14537 var render = function render(vnode, container, isSVG) { 14538 if (vnode == null) { 14539 if (container._vnode) { 14540 unmount(container._vnode, null, null, true); 14541 } 14542 } else { 14543 patch(container._vnode || null, vnode, container, null, null, null, isSVG); 14544 } 14545 14546 flushPostFlushCbs(); 14547 container._vnode = vnode; 14548 }; 14549 14550 var internals = { 14551 p: patch, 14552 um: unmount, 14553 m: move, 14554 r: remove, 14555 mt: mountComponent, 14556 mc: mountChildren, 14557 pc: patchChildren, 14558 pbc: patchBlockChildren, 14559 n: getNextHostNode, 14560 o: options 14561 }; 14562 var hydrate; 14563 var hydrateNode; 14564 14565 if (createHydrationFns) { 14566 var _createHydrationFns = createHydrationFns(internals); 14567 14568 hydrate = _createHydrationFns[0]; 14569 hydrateNode = _createHydrationFns[1]; 14570 } 14571 14572 return { 14573 render: render, 14574 hydrate: hydrate, 14575 createApp: createAppAPI(render, hydrate) 14576 }; 14577 } 14578 14579 function toggleRecurse(_ref10, allowed) { 14580 var effect = _ref10.effect, 14581 update = _ref10.update; 14582 effect.allowRecurse = update.allowRecurse = allowed; 14583 } 14584 /** 14585 * #1156 14586 * When a component is HMR-enabled, we need to make sure that all static nodes 14587 * inside a block also inherit the DOM element from the previous tree so that 14588 * HMR updates (which are full updates) can retrieve the element for patching. 14589 * 14590 * #2080 14591 * Inside keyed `template` fragment static children, if a fragment is moved, 14592 * the children will always be moved. Therefore, in order to ensure correct move 14593 * position, el should be inherited from previous nodes. 14594 */ 14595 14596 14597 function traverseStaticChildren(n1, n2, shallow) { 14598 if (shallow === void 0) { 14599 shallow = false; 14600 } 14601 14602 var ch1 = n1.children; 14603 var ch2 = n2.children; 14604 14605 if (isArray(ch1) && isArray(ch2)) { 14606 for (var _i25 = 0; _i25 < ch1.length; _i25++) { 14607 // this is only called in the optimized path so array children are 14608 // guaranteed to be vnodes 14609 var c1 = ch1[_i25]; 14610 var c2 = ch2[_i25]; 14611 14612 if (c2.shapeFlag & 1 14613 /* ELEMENT */ 14614 && !c2.dynamicChildren) { 14615 if (c2.patchFlag <= 0 || c2.patchFlag === 32 14616 /* HYDRATE_EVENTS */ 14617 ) { 14618 c2 = ch2[_i25] = cloneIfMounted(ch2[_i25]); 14619 c2.el = c1.el; 14620 } 14621 14622 if (!shallow) traverseStaticChildren(c1, c2); 14623 } // also inherit for comment nodes, but not placeholders (e.g. v-if which 14624 14625 } 14626 } 14627 } // https://en.wikipedia.org/wiki/Longest_increasing_subsequence 14628 14629 14630 function getSequence(arr) { 14631 var p = arr.slice(); 14632 var result = [0]; 14633 var i, j, u, v, c; 14634 var len = arr.length; 14635 14636 for (i = 0; i < len; i++) { 14637 var arrI = arr[i]; 14638 14639 if (arrI !== 0) { 14640 j = result[result.length - 1]; 14641 14642 if (arr[j] < arrI) { 14643 p[i] = j; 14644 result.push(i); 14645 continue; 14646 } 14647 14648 u = 0; 14649 v = result.length - 1; 14650 14651 while (u < v) { 14652 c = u + v >> 1; 14653 14654 if (arr[result[c]] < arrI) { 14655 u = c + 1; 14656 } else { 14657 v = c; 14658 } 14659 } 14660 14661 if (arrI < arr[result[u]]) { 14662 if (u > 0) { 14663 p[i] = result[u - 1]; 14664 } 14665 14666 result[u] = i; 14667 } 14668 } 14669 } 14670 14671 u = result.length; 14672 v = result[u - 1]; 14673 14674 while (u-- > 0) { 14675 result[u] = v; 14676 v = p[v]; 14677 } 14678 14679 return result; 14680 } 14681 14682 var isTeleport = function isTeleport(type) { 14683 return type.__isTeleport; 14684 }; 14685 14686 var COMPONENTS = 'components'; 14687 /** 14688 * @private 14689 */ 14690 14691 function resolveComponent(name, maybeSelfReference) { 14692 return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; 14693 } 14694 14695 var NULL_DYNAMIC_COMPONENT = Symbol(); 14696 14697 function resolveAsset(type, name, warnMissing, maybeSelfReference) { 14698 if (maybeSelfReference === void 0) { 14699 maybeSelfReference = false; 14700 } 14701 14702 var instance = currentRenderingInstance || currentInstance; 14703 14704 if (instance) { 14705 var Component = instance.type; // explicit self name has highest priority 14706 14707 if (type === COMPONENTS) { 14708 var selfName = getComponentName(Component); 14709 14710 if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { 14711 return Component; 14712 } 14713 } 14714 14715 var res = // local registration 14716 // check instance[type] first which is resolved for options API 14717 resolve(instance[type] || Component[type], name) || // global registration 14718 resolve(instance.appContext[type], name); 14719 14720 if (!res && maybeSelfReference) { 14721 // fallback to implicit self-reference 14722 return Component; 14723 } 14724 14725 return res; 14726 } 14727 } 14728 14729 function resolve(registry, name) { 14730 return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); 14731 } 14732 14733 var Fragment = Symbol(undefined); 14734 var Text = Symbol(undefined); 14735 var Comment = Symbol(undefined); 14736 var Static = Symbol(undefined); // Since v-if and v-for are the two possible ways node structure can dynamically 14737 // change, once we consider v-if branches and each v-for fragment a block, we 14738 // can divide a template into nested blocks, and within each block the node 14739 // structure would be stable. This allows us to skip most children diffing 14740 // and only worry about the dynamic nodes (indicated by patch flags). 14741 14742 var blockStack = []; 14743 var currentBlock = null; 14744 /** 14745 * Open a block. 14746 * This must be called before `createBlock`. It cannot be part of `createBlock` 14747 * because the children of the block are evaluated before `createBlock` itself 14748 * is called. The generated code typically looks like this: 14749 * 14750 * ```js 14751 * function render() { 14752 * return (openBlock(),createBlock('div', null, [...])) 14753 * } 14754 * ``` 14755 * disableTracking is true when creating a v-for fragment block, since a v-for 14756 * fragment always diffs its children. 14757 * 14758 * @private 14759 */ 14760 14761 function openBlock(disableTracking) { 14762 if (disableTracking === void 0) { 14763 disableTracking = false; 14764 } 14765 14766 blockStack.push(currentBlock = disableTracking ? null : []); 14767 } 14768 14769 function closeBlock() { 14770 blockStack.pop(); 14771 currentBlock = blockStack[blockStack.length - 1] || null; 14772 } // Whether we should be tracking dynamic child nodes inside a block. 14773 // Only tracks when this value is > 0 14774 // We are not using a simple boolean because this value may need to be 14775 // incremented/decremented by nested usage of v-once (see below) 14776 14777 14778 var isBlockTreeEnabled = 1; 14779 /** 14780 * Block tracking sometimes needs to be disabled, for example during the 14781 * creation of a tree that needs to be cached by v-once. The compiler generates 14782 * code like this: 14783 * 14784 * ``` js 14785 * _cache[1] || ( 14786 * setBlockTracking(-1), 14787 * _cache[1] = createVNode(...), 14788 * setBlockTracking(1), 14789 * _cache[1] 14790 * ) 14791 * ``` 14792 * 14793 * @private 14794 */ 14795 14796 function setBlockTracking(value) { 14797 isBlockTreeEnabled += value; 14798 } 14799 14800 function setupBlock(vnode) { 14801 // save current block children on the block vnode 14802 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; // close block 14803 14804 closeBlock(); // a block is always going to be patched, so track it as a child of its 14805 // parent block 14806 14807 if (isBlockTreeEnabled > 0 && currentBlock) { 14808 currentBlock.push(vnode); 14809 } 14810 14811 return vnode; 14812 } 14813 /** 14814 * @private 14815 */ 14816 14817 14818 function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { 14819 return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true 14820 /* isBlock */ 14821 )); 14822 } 14823 /** 14824 * Create a block root vnode. Takes the same exact arguments as `createVNode`. 14825 * A block root keeps track of dynamic nodes within the block in the 14826 * `dynamicChildren` array. 14827 * 14828 * @private 14829 */ 14830 14831 14832 function createBlock(type, props, children, patchFlag, dynamicProps) { 14833 return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true 14834 /* isBlock: prevent a block from tracking itself */ 14835 )); 14836 } 14837 14838 function isVNode(value) { 14839 return value ? value.__v_isVNode === true : false; 14840 } 14841 14842 function isSameVNodeType(n1, n2) { 14843 return n1.type === n2.type && n1.key === n2.key; 14844 } 14845 14846 var InternalObjectKey = "__vInternal"; 14847 14848 var normalizeKey = function normalizeKey(_ref14) { 14849 var key = _ref14.key; 14850 return key != null ? key : null; 14851 }; 14852 14853 var normalizeRef = function normalizeRef(_ref15) { 14854 var ref = _ref15.ref, 14855 ref_key = _ref15.ref_key, 14856 ref_for = _ref15.ref_for; 14857 return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { 14858 i: currentRenderingInstance, 14859 r: ref, 14860 k: ref_key, 14861 f: !!ref_for 14862 } : ref : null; 14863 }; 14864 14865 function createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag 14866 /* ELEMENT */ 14867 , isBlockNode, needFullChildrenNormalization) { 14868 if (props === void 0) { 14869 props = null; 14870 } 14871 14872 if (children === void 0) { 14873 children = null; 14874 } 14875 14876 if (patchFlag === void 0) { 14877 patchFlag = 0; 14878 } 14879 14880 if (dynamicProps === void 0) { 14881 dynamicProps = null; 14882 } 14883 14884 if (shapeFlag === void 0) { 14885 shapeFlag = type === Fragment ? 0 : 1; 14886 } 14887 14888 if (isBlockNode === void 0) { 14889 isBlockNode = false; 14890 } 14891 14892 if (needFullChildrenNormalization === void 0) { 14893 needFullChildrenNormalization = false; 14894 } 14895 14896 var vnode = { 14897 __v_isVNode: true, 14898 __v_skip: true, 14899 type: type, 14900 props: props, 14901 key: props && normalizeKey(props), 14902 ref: props && normalizeRef(props), 14903 scopeId: currentScopeId, 14904 slotScopeIds: null, 14905 children: children, 14906 component: null, 14907 suspense: null, 14908 ssContent: null, 14909 ssFallback: null, 14910 dirs: null, 14911 transition: null, 14912 el: null, 14913 anchor: null, 14914 target: null, 14915 targetAnchor: null, 14916 staticCount: 0, 14917 shapeFlag: shapeFlag, 14918 patchFlag: patchFlag, 14919 dynamicProps: dynamicProps, 14920 dynamicChildren: null, 14921 appContext: null 14922 }; 14923 14924 if (needFullChildrenNormalization) { 14925 normalizeChildren(vnode, children); // normalize suspense children 14926 14927 if (shapeFlag & 128 14928 /* SUSPENSE */ 14929 ) { 14930 type.normalize(vnode); 14931 } 14932 } else if (children) { 14933 // compiled element vnode - if children is passed, only possible types are 14934 // string or Array. 14935 vnode.shapeFlag |= isString(children) ? 8 14936 /* TEXT_CHILDREN */ 14937 : 16 14938 /* ARRAY_CHILDREN */ 14939 ; 14940 } // validate key 14941 14942 14943 if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself 14944 !isBlockNode && // has current parent block 14945 currentBlock && ( // presence of a patch flag indicates this node needs patching on updates. 14946 // component nodes also should always be patched, because even if the 14947 // component doesn't need to update, it needs to persist the instance on to 14948 // the next vnode so that it can be properly unmounted later. 14949 vnode.patchFlag > 0 || shapeFlag & 6 14950 /* COMPONENT */ 14951 ) && // the EVENTS flag is only for hydration and if it is the only flag, the 14952 // vnode should not be considered dynamic due to handler caching. 14953 vnode.patchFlag !== 32 14954 /* HYDRATE_EVENTS */ 14955 ) { 14956 currentBlock.push(vnode); 14957 } 14958 14959 return vnode; 14960 } 14961 14962 var createVNode = _createVNode; 14963 14964 function _createVNode(type, props, children, patchFlag, dynamicProps, isBlockNode) { 14965 if (props === void 0) { 14966 props = null; 14967 } 14968 14969 if (children === void 0) { 14970 children = null; 14971 } 14972 14973 if (patchFlag === void 0) { 14974 patchFlag = 0; 14975 } 14976 14977 if (dynamicProps === void 0) { 14978 dynamicProps = null; 14979 } 14980 14981 if (isBlockNode === void 0) { 14982 isBlockNode = false; 14983 } 14984 14985 if (!type || type === NULL_DYNAMIC_COMPONENT) { 14986 type = Comment; 14987 } 14988 14989 if (isVNode(type)) { 14990 // createVNode receiving an existing vnode. This happens in cases like 14991 // <component :is="vnode"/> 14992 // #2078 make sure to merge refs during the clone instead of overwriting it 14993 var cloned = cloneVNode(type, props, true 14994 /* mergeRef: true */ 14995 ); 14996 14997 if (children) { 14998 normalizeChildren(cloned, children); 14999 } 15000 15001 return cloned; 15002 } // class component normalization. 15003 15004 15005 if (isClassComponent(type)) { 15006 type = type.__vccOpts; 15007 } // class & style normalization. 15008 15009 15010 if (props) { 15011 // for reactive or proxy objects, we need to clone it to enable mutation. 15012 props = guardReactiveProps(props); 15013 var _props = props, 15014 klass = _props.class, 15015 style = _props.style; 15016 15017 if (klass && !isString(klass)) { 15018 props.class = normalizeClass(klass); 15019 } 15020 15021 if (isObject$1(style)) { 15022 // reactive state objects need to be cloned since they are likely to be 15023 // mutated 15024 if (isProxy(style) && !isArray(style)) { 15025 style = extend({}, style); 15026 } 15027 15028 props.style = normalizeStyle(style); 15029 } 15030 } // encode the vnode type information into a bitmap 15031 15032 15033 var shapeFlag = isString(type) ? 1 15034 /* ELEMENT */ 15035 : isSuspense(type) ? 128 15036 /* SUSPENSE */ 15037 : isTeleport(type) ? 64 15038 /* TELEPORT */ 15039 : isObject$1(type) ? 4 15040 /* STATEFUL_COMPONENT */ 15041 : isFunction(type) ? 2 15042 /* FUNCTIONAL_COMPONENT */ 15043 : 0; 15044 return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true); 15045 } 15046 15047 function guardReactiveProps(props) { 15048 if (!props) return null; 15049 return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props; 15050 } 15051 15052 function cloneVNode(vnode, extraProps, mergeRef) { 15053 if (mergeRef === void 0) { 15054 mergeRef = false; 15055 } // This is intentionally NOT using spread or extend to avoid the runtime 15056 // key enumeration cost. 15057 15058 15059 var props = vnode.props, 15060 ref = vnode.ref, 15061 patchFlag = vnode.patchFlag, 15062 children = vnode.children; 15063 var mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; 15064 var cloned = { 15065 __v_isVNode: true, 15066 __v_skip: true, 15067 type: vnode.type, 15068 props: mergedProps, 15069 key: mergedProps && normalizeKey(mergedProps), 15070 ref: extraProps && extraProps.ref ? // #2078 in the case of <component :is="vnode" ref="extra"/> 15071 // if the vnode itself already has a ref, cloneVNode will need to merge 15072 // the refs so the single vnode can be set on multiple refs 15073 mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref, 15074 scopeId: vnode.scopeId, 15075 slotScopeIds: vnode.slotScopeIds, 15076 children: children, 15077 target: vnode.target, 15078 targetAnchor: vnode.targetAnchor, 15079 staticCount: vnode.staticCount, 15080 shapeFlag: vnode.shapeFlag, 15081 // if the vnode is cloned with extra props, we can no longer assume its 15082 // existing patch flag to be reliable and need to add the FULL_PROPS flag. 15083 // note: perserve flag for fragments since they use the flag for children 15084 // fast paths only. 15085 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 // hoisted node 15086 ? 16 15087 /* FULL_PROPS */ 15088 : patchFlag | 16 15089 /* FULL_PROPS */ 15090 : patchFlag, 15091 dynamicProps: vnode.dynamicProps, 15092 dynamicChildren: vnode.dynamicChildren, 15093 appContext: vnode.appContext, 15094 dirs: vnode.dirs, 15095 transition: vnode.transition, 15096 // These should technically only be non-null on mounted VNodes. However, 15097 // they *should* be copied for kept-alive vnodes. So we just always copy 15098 // them since them being non-null during a mount doesn't affect the logic as 15099 // they will simply be overwritten. 15100 component: vnode.component, 15101 suspense: vnode.suspense, 15102 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), 15103 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), 15104 el: vnode.el, 15105 anchor: vnode.anchor 15106 }; 15107 return cloned; 15108 } 15109 /** 15110 * @private 15111 */ 15112 15113 15114 function createTextVNode(text, flag) { 15115 if (text === void 0) { 15116 text = ' '; 15117 } 15118 15119 if (flag === void 0) { 15120 flag = 0; 15121 } 15122 15123 return createVNode(Text, null, text, flag); 15124 } 15125 /** 15126 * @private 15127 */ 15128 15129 15130 function createCommentVNode(text, // when used as the v-else branch, the comment node must be created as a 15131 // block to ensure correct updates. 15132 asBlock) { 15133 if (text === void 0) { 15134 text = ''; 15135 } 15136 15137 if (asBlock === void 0) { 15138 asBlock = false; 15139 } 15140 15141 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); 15142 } 15143 15144 function normalizeVNode(child) { 15145 if (child == null || typeof child === 'boolean') { 15146 // empty placeholder 15147 return createVNode(Comment); 15148 } else if (isArray(child)) { 15149 // fragment 15150 return createVNode(Fragment, null, // #3666, avoid reference pollution when reusing vnode 15151 child.slice()); 15152 } else if (typeof child === 'object') { 15153 // already vnode, this should be the most common since compiled templates 15154 // always produce all-vnode children arrays 15155 return cloneIfMounted(child); 15156 } else { 15157 // strings and numbers 15158 return createVNode(Text, null, String(child)); 15159 } 15160 } // optimized normalization for template-compiled render fns 15161 15162 15163 function cloneIfMounted(child) { 15164 return child.el === null || child.memo ? child : cloneVNode(child); 15165 } 15166 15167 function normalizeChildren(vnode, children) { 15168 var type = 0; 15169 var shapeFlag = vnode.shapeFlag; 15170 15171 if (children == null) { 15172 children = null; 15173 } else if (isArray(children)) { 15174 type = 16 15175 /* ARRAY_CHILDREN */ 15176 ; 15177 } else if (typeof children === 'object') { 15178 if (shapeFlag & (1 15179 /* ELEMENT */ 15180 | 64 15181 /* TELEPORT */ 15182 )) { 15183 // Normalize slot to plain children for plain element and Teleport 15184 var slot = children.default; 15185 15186 if (slot) { 15187 // _c marker is added by withCtx() indicating this is a compiled slot 15188 slot._c && (slot._d = false); 15189 normalizeChildren(vnode, slot()); 15190 slot._c && (slot._d = true); 15191 } 15192 15193 return; 15194 } else { 15195 type = 32 15196 /* SLOTS_CHILDREN */ 15197 ; 15198 var slotFlag = children._; 15199 15200 if (!slotFlag && !(InternalObjectKey in children)) { 15201 children._ctx = currentRenderingInstance; 15202 } else if (slotFlag === 3 15203 /* FORWARDED */ 15204 && currentRenderingInstance) { 15205 // a child component receives forwarded slots from the parent. 15206 // its slot type is determined by its parent's slot type. 15207 if (currentRenderingInstance.slots._ === 1 15208 /* STABLE */ 15209 ) { 15210 children._ = 1 15211 /* STABLE */ 15212 ; 15213 } else { 15214 children._ = 2 15215 /* DYNAMIC */ 15216 ; 15217 vnode.patchFlag |= 1024 15218 /* DYNAMIC_SLOTS */ 15219 ; 15220 } 15221 } 15222 } 15223 } else if (isFunction(children)) { 15224 children = { 15225 default: children, 15226 _ctx: currentRenderingInstance 15227 }; 15228 type = 32 15229 /* SLOTS_CHILDREN */ 15230 ; 15231 } else { 15232 children = String(children); // force teleport children to array so it can be moved around 15233 15234 if (shapeFlag & 64 15235 /* TELEPORT */ 15236 ) { 15237 type = 16 15238 /* ARRAY_CHILDREN */ 15239 ; 15240 children = [createTextVNode(children)]; 15241 } else { 15242 type = 8 15243 /* TEXT_CHILDREN */ 15244 ; 15245 } 15246 } 15247 15248 vnode.children = children; 15249 vnode.shapeFlag |= type; 15250 } 15251 15252 function mergeProps() { 15253 var ret = {}; 15254 15255 for (var _i26 = 0; _i26 < arguments.length; _i26++) { 15256 var toMerge = _i26 < 0 || arguments.length <= _i26 ? undefined : arguments[_i26]; 15257 15258 for (var key in toMerge) { 15259 if (key === 'class') { 15260 if (ret.class !== toMerge.class) { 15261 ret.class = normalizeClass([ret.class, toMerge.class]); 15262 } 15263 } else if (key === 'style') { 15264 ret.style = normalizeStyle([ret.style, toMerge.style]); 15265 } else if (isOn(key)) { 15266 var existing = ret[key]; 15267 var incoming = toMerge[key]; 15268 15269 if (existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { 15270 ret[key] = existing ? [].concat(existing, incoming) : incoming; 15271 } 15272 } else if (key !== '') { 15273 ret[key] = toMerge[key]; 15274 } 15275 } 15276 } 15277 15278 return ret; 15279 } 15280 15281 function invokeVNodeHook(hook, instance, vnode, prevVNode) { 15282 if (prevVNode === void 0) { 15283 prevVNode = null; 15284 } 15285 15286 callWithAsyncErrorHandling(hook, instance, 7 15287 /* VNODE_HOOK */ 15288 , [vnode, prevVNode]); 15289 } 15290 /** 15291 * Actual implementation 15292 */ 15293 15294 15295 function renderList(source, renderItem, cache, index) { 15296 var ret; 15297 var cached = cache && cache[index]; 15298 15299 if (isArray(source) || isString(source)) { 15300 ret = new Array(source.length); 15301 15302 for (var _i27 = 0, l = source.length; _i27 < l; _i27++) { 15303 ret[_i27] = renderItem(source[_i27], _i27, undefined, cached && cached[_i27]); 15304 } 15305 } else if (typeof source === 'number') { 15306 ret = new Array(source); 15307 15308 for (var _i28 = 0; _i28 < source; _i28++) { 15309 ret[_i28] = renderItem(_i28 + 1, _i28, undefined, cached && cached[_i28]); 15310 } 15311 } else if (isObject$1(source)) { 15312 if (source[Symbol.iterator]) { 15313 ret = Array.from(source, function (item, i) { 15314 return renderItem(item, i, undefined, cached && cached[i]); 15315 }); 15316 } else { 15317 var keys = Object.keys(source); 15318 ret = new Array(keys.length); 15319 15320 for (var _i29 = 0, _l = keys.length; _i29 < _l; _i29++) { 15321 var key = keys[_i29]; 15322 ret[_i29] = renderItem(source[key], key, _i29, cached && cached[_i29]); 15323 } 15324 } 15325 } else { 15326 ret = []; 15327 } 15328 15329 if (cache) { 15330 cache[index] = ret; 15331 } 15332 15333 return ret; 15334 } 15335 /** 15336 * Compiler runtime helper for rendering `<slot/>` 15337 * @private 15338 */ 15339 15340 15341 function renderSlot(slots, name, props, // this is not a user-facing function, so the fallback is always generated by 15342 // the compiler and guaranteed to be a function returning an array 15343 fallback, noSlotted) { 15344 if (props === void 0) { 15345 props = {}; 15346 } 15347 15348 if (currentRenderingInstance.isCE) { 15349 return createVNode('slot', name === 'default' ? null : { 15350 name: name 15351 }, fallback && fallback()); 15352 } 15353 15354 var slot = slots[name]; // invocation interfering with template-based block tracking, but in 15355 // `renderSlot` we can be sure that it's template-based so we can force 15356 // enable it. 15357 15358 if (slot && slot._c) { 15359 slot._d = false; 15360 } 15361 15362 openBlock(); 15363 var validSlotContent = slot && ensureValidVNode(slot(props)); 15364 var rendered = createBlock(Fragment, { 15365 key: props.key || "_" + name 15366 }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 15367 /* STABLE */ 15368 ? 64 15369 /* STABLE_FRAGMENT */ 15370 : -2 15371 /* BAIL */ 15372 ); 15373 15374 if (!noSlotted && rendered.scopeId) { 15375 rendered.slotScopeIds = [rendered.scopeId + '-s']; 15376 } 15377 15378 if (slot && slot._c) { 15379 slot._d = true; 15380 } 15381 15382 return rendered; 15383 } 15384 15385 function ensureValidVNode(vnodes) { 15386 return vnodes.some(function (child) { 15387 if (!isVNode(child)) return true; 15388 if (child.type === Comment) return false; 15389 if (child.type === Fragment && !ensureValidVNode(child.children)) return false; 15390 return true; 15391 }) ? vnodes : null; 15392 } 15393 /** 15394 * #2437 In Vue 3, functional components do not have a public instance proxy but 15395 * they exist in the internal parent chain. For code that relies on traversing 15396 * public $parent chains, skip functional ones and go to the parent instead. 15397 */ 15398 15399 15400 var getPublicInstance = function getPublicInstance(i) { 15401 if (!i) return null; 15402 if (isStatefulComponent(i)) return getExposeProxy(i) || i.proxy; 15403 return getPublicInstance(i.parent); 15404 }; 15405 15406 var publicPropertiesMap = extend(Object.create(null), { 15407 $: function $(i) { 15408 return i; 15409 }, 15410 $el: function $el(i) { 15411 return i.vnode.el; 15412 }, 15413 $data: function $data(i) { 15414 return i.data; 15415 }, 15416 $props: function $props(i) { 15417 return i.props; 15418 }, 15419 $attrs: function $attrs(i) { 15420 return i.attrs; 15421 }, 15422 $slots: function $slots(i) { 15423 return i.slots; 15424 }, 15425 $refs: function $refs(i) { 15426 return i.refs; 15427 }, 15428 $parent: function $parent(i) { 15429 return getPublicInstance(i.parent); 15430 }, 15431 $root: function $root(i) { 15432 return getPublicInstance(i.root); 15433 }, 15434 $emit: function $emit(i) { 15435 return i.emit; 15436 }, 15437 $options: function $options(i) { 15438 return __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type; 15439 }, 15440 $forceUpdate: function $forceUpdate(i) { 15441 return function () { 15442 return queueJob(i.update); 15443 }; 15444 }, 15445 $nextTick: function $nextTick(i) { 15446 return nextTick.bind(i.proxy); 15447 }, 15448 $watch: function $watch(i) { 15449 return __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP; 15450 } 15451 }); 15452 var PublicInstanceProxyHandlers = { 15453 get: function get(_ref16, key) { 15454 var instance = _ref16._; 15455 var ctx = instance.ctx, 15456 setupState = instance.setupState, 15457 data = instance.data, 15458 props = instance.props, 15459 accessCache = instance.accessCache, 15460 type = instance.type, 15461 appContext = instance.appContext; // for internal formatters to know that this is a Vue instance 15462 // This getter gets called for every property access on the render context 15463 // during render and is a major hotspot. The most expensive part of this 15464 // is the multiple hasOwn() calls. It's much faster to do a simple property 15465 // access on a plain object, so we use an accessCache object (with null 15466 // prototype) to memoize what access type a key corresponds to. 15467 15468 var normalizedProps; 15469 15470 if (key[0] !== '$') { 15471 var _n4 = accessCache[key]; 15472 15473 if (_n4 !== undefined) { 15474 switch (_n4) { 15475 case 1 15476 /* SETUP */ 15477 : 15478 return setupState[key]; 15479 15480 case 2 15481 /* DATA */ 15482 : 15483 return data[key]; 15484 15485 case 4 15486 /* CONTEXT */ 15487 : 15488 return ctx[key]; 15489 15490 case 3 15491 /* PROPS */ 15492 : 15493 return props[key]; 15494 // default: just fallthrough 15495 } 15496 } else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { 15497 accessCache[key] = 1 15498 /* SETUP */ 15499 ; 15500 return setupState[key]; 15501 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { 15502 accessCache[key] = 2 15503 /* DATA */ 15504 ; 15505 return data[key]; 15506 } else if ( // only cache other properties when instance has declared (thus stable) 15507 // props 15508 (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)) { 15509 accessCache[key] = 3 15510 /* PROPS */ 15511 ; 15512 return props[key]; 15513 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 15514 accessCache[key] = 4 15515 /* CONTEXT */ 15516 ; 15517 return ctx[key]; 15518 } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) { 15519 accessCache[key] = 0 15520 /* OTHER */ 15521 ; 15522 } 15523 } 15524 15525 var publicGetter = publicPropertiesMap[key]; 15526 var cssModule, globalProperties; // public $xxx properties 15527 15528 if (publicGetter) { 15529 if (key === '$attrs') { 15530 track(instance, "get" 15531 /* GET */ 15532 , key); 15533 } 15534 15535 return publicGetter(instance); 15536 } else if ( // css module (injected by vue-loader) 15537 (cssModule = type.__cssModules) && (cssModule = cssModule[key])) { 15538 return cssModule; 15539 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 15540 // user may set custom properties to `this` that start with `$` 15541 accessCache[key] = 4 15542 /* CONTEXT */ 15543 ; 15544 return ctx[key]; 15545 } else if ( // global properties 15546 globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) { 15547 { 15548 return globalProperties[key]; 15549 } 15550 } else ; 15551 }, 15552 set: function set(_ref17, key, value) { 15553 var instance = _ref17._; 15554 var data = instance.data, 15555 setupState = instance.setupState, 15556 ctx = instance.ctx; 15557 15558 if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { 15559 setupState[key] = value; 15560 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { 15561 data[key] = value; 15562 } else if (hasOwn(instance.props, key)) { 15563 return false; 15564 } 15565 15566 if (key[0] === '$' && key.slice(1) in instance) { 15567 return false; 15568 } else { 15569 { 15570 ctx[key] = value; 15571 } 15572 } 15573 15574 return true; 15575 }, 15576 has: function has(_ref18, key) { 15577 var _ref18$_ = _ref18._, 15578 data = _ref18$_.data, 15579 setupState = _ref18$_.setupState, 15580 accessCache = _ref18$_.accessCache, 15581 ctx = _ref18$_.ctx, 15582 appContext = _ref18$_.appContext, 15583 propsOptions = _ref18$_.propsOptions; 15584 var normalizedProps; 15585 return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || setupState !== EMPTY_OBJ && hasOwn(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key); 15586 } 15587 }; 15588 var emptyAppContext = createAppContext(); 15589 var uid$1 = 0; 15590 15591 function createComponentInstance(vnode, parent, suspense) { 15592 var type = vnode.type; // inherit parent app context - or - if root, adopt from root vnode 15593 15594 var appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; 15595 var instance = { 15596 uid: uid$1++, 15597 vnode: vnode, 15598 type: type, 15599 parent: parent, 15600 appContext: appContext, 15601 root: null, 15602 next: null, 15603 subTree: null, 15604 effect: null, 15605 update: null, 15606 scope: new EffectScope(true 15607 /* detached */ 15608 ), 15609 render: null, 15610 proxy: null, 15611 exposed: null, 15612 exposeProxy: null, 15613 withProxy: null, 15614 provides: parent ? parent.provides : Object.create(appContext.provides), 15615 accessCache: null, 15616 renderCache: [], 15617 // local resovled assets 15618 components: null, 15619 directives: null, 15620 // resolved props and emits options 15621 propsOptions: normalizePropsOptions(type, appContext), 15622 emitsOptions: normalizeEmitsOptions(type, appContext), 15623 // emit 15624 emit: null, 15625 emitted: null, 15626 // props default value 15627 propsDefaults: EMPTY_OBJ, 15628 // inheritAttrs 15629 inheritAttrs: type.inheritAttrs, 15630 // state 15631 ctx: EMPTY_OBJ, 15632 data: EMPTY_OBJ, 15633 props: EMPTY_OBJ, 15634 attrs: EMPTY_OBJ, 15635 slots: EMPTY_OBJ, 15636 refs: EMPTY_OBJ, 15637 setupState: EMPTY_OBJ, 15638 setupContext: null, 15639 // suspense related 15640 suspense: suspense, 15641 suspenseId: suspense ? suspense.pendingId : 0, 15642 asyncDep: null, 15643 asyncResolved: false, 15644 // lifecycle hooks 15645 // not using enums here because it results in computed properties 15646 isMounted: false, 15647 isUnmounted: false, 15648 isDeactivated: false, 15649 bc: null, 15650 c: null, 15651 bm: null, 15652 m: null, 15653 bu: null, 15654 u: null, 15655 um: null, 15656 bum: null, 15657 da: null, 15658 a: null, 15659 rtg: null, 15660 rtc: null, 15661 ec: null, 15662 sp: null 15663 }; 15664 { 15665 instance.ctx = { 15666 _: instance 15667 }; 15668 } 15669 instance.root = parent ? parent.root : instance; 15670 instance.emit = emit$1.bind(null, instance); // apply custom element special handling 15671 15672 if (vnode.ce) { 15673 vnode.ce(instance); 15674 } 15675 15676 return instance; 15677 } 15678 15679 var currentInstance = null; 15680 15681 var getCurrentInstance = function getCurrentInstance() { 15682 return currentInstance || currentRenderingInstance; 15683 }; 15684 15685 var setCurrentInstance = function setCurrentInstance(instance) { 15686 currentInstance = instance; 15687 instance.scope.on(); 15688 }; 15689 15690 var unsetCurrentInstance = function unsetCurrentInstance() { 15691 currentInstance && currentInstance.scope.off(); 15692 currentInstance = null; 15693 }; 15694 15695 function isStatefulComponent(instance) { 15696 return instance.vnode.shapeFlag & 4 15697 /* STATEFUL_COMPONENT */ 15698 ; 15699 } 15700 15701 var isInSSRComponentSetup = false; 15702 15703 function setupComponent(instance, isSSR) { 15704 if (isSSR === void 0) { 15705 isSSR = false; 15706 } 15707 15708 isInSSRComponentSetup = isSSR; 15709 var _instance$vnode = instance.vnode, 15710 props = _instance$vnode.props, 15711 children = _instance$vnode.children; 15712 var isStateful = isStatefulComponent(instance); 15713 initProps(instance, props, isStateful, isSSR); 15714 initSlots(instance, children); 15715 var setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : undefined; 15716 isInSSRComponentSetup = false; 15717 return setupResult; 15718 } 15719 15720 function setupStatefulComponent(instance, isSSR) { 15721 var Component = instance.type; 15722 instance.accessCache = Object.create(null); // 1. create public instance / render proxy 15723 // also mark it raw so it's never observed 15724 15725 instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers)); 15726 var setup = Component.setup; 15727 15728 if (setup) { 15729 var setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; 15730 setCurrentInstance(instance); 15731 pauseTracking(); 15732 var setupResult = callWithErrorHandling(setup, instance, 0 15733 /* SETUP_FUNCTION */ 15734 , [instance.props, setupContext]); 15735 resetTracking(); 15736 unsetCurrentInstance(); 15737 15738 if (isPromise$1(setupResult)) { 15739 setupResult.then(unsetCurrentInstance, unsetCurrentInstance); 15740 15741 if (isSSR) { 15742 // return the promise so server-renderer can wait on it 15743 return setupResult.then(function (resolvedResult) { 15744 handleSetupResult(instance, resolvedResult, isSSR); 15745 }).catch(function (e) { 15746 handleError(e, instance, 0 15747 /* SETUP_FUNCTION */ 15748 ); 15749 }); 15750 } else { 15751 // async setup returned Promise. 15752 // bail here and wait for re-entry. 15753 instance.asyncDep = setupResult; 15754 } 15755 } else { 15756 handleSetupResult(instance, setupResult, isSSR); 15757 } 15758 } else { 15759 finishComponentSetup(instance, isSSR); 15760 } 15761 } 15762 15763 function handleSetupResult(instance, setupResult, isSSR) { 15764 if (isFunction(setupResult)) { 15765 // setup returned an inline render function 15766 if (instance.type.__ssrInlineRender) { 15767 // when the function's name is `ssrRender` (compiled by SFC inline mode), 15768 // set it as ssrRender instead. 15769 instance.ssrRender = setupResult; 15770 } else { 15771 instance.render = setupResult; 15772 } 15773 } else if (isObject$1(setupResult)) { 15774 // assuming a render function compiled from template is present. 15775 if (__VUE_PROD_DEVTOOLS__) { 15776 instance.devtoolsRawSetupState = setupResult; 15777 } 15778 15779 instance.setupState = proxyRefs(setupResult); 15780 } else ; 15781 15782 finishComponentSetup(instance, isSSR); 15783 } 15784 15785 var compile; 15786 15787 function finishComponentSetup(instance, isSSR, skipOptions) { 15788 var Component = instance.type; // template / render function normalization 15789 // could be already set when returned from setup() 15790 15791 if (!instance.render) { 15792 // only do on-the-fly compile if not in SSR - SSR on-the-fly compliation 15793 // is done by server-renderer 15794 if (!isSSR && compile && !Component.render) { 15795 var template = Component.template; 15796 15797 if (template) { 15798 var _instance$appContext$ = instance.appContext.config, 15799 isCustomElement = _instance$appContext$.isCustomElement, 15800 compilerOptions = _instance$appContext$.compilerOptions; 15801 var delimiters = Component.delimiters, 15802 componentCompilerOptions = Component.compilerOptions; 15803 var finalCompilerOptions = extend(extend({ 15804 isCustomElement: isCustomElement, 15805 delimiters: delimiters 15806 }, compilerOptions), componentCompilerOptions); 15807 Component.render = compile(template, finalCompilerOptions); 15808 } 15809 } 15810 15811 instance.render = Component.render || NOOP; // for runtime-compiled render functions using `with` blocks, the render 15812 } // support for 2.x options 15813 15814 15815 if (__VUE_OPTIONS_API__ && !false) { 15816 setCurrentInstance(instance); 15817 pauseTracking(); 15818 applyOptions(instance); 15819 resetTracking(); 15820 unsetCurrentInstance(); 15821 } // warn missing template/render 15822 15823 } 15824 15825 function createAttrsProxy(instance) { 15826 return new Proxy(instance.attrs, { 15827 get: function get(target, key) { 15828 track(instance, "get" 15829 /* GET */ 15830 , '$attrs'); 15831 return target[key]; 15832 } 15833 }); 15834 } 15835 15836 function createSetupContext(instance) { 15837 var expose = function expose(exposed) { 15838 instance.exposed = exposed || {}; 15839 }; 15840 15841 var attrs; 15842 { 15843 return { 15844 get attrs() { 15845 return attrs || (attrs = createAttrsProxy(instance)); 15846 }, 15847 15848 slots: instance.slots, 15849 emit: instance.emit, 15850 expose: expose 15851 }; 15852 } 15853 } 15854 15855 function getExposeProxy(instance) { 15856 if (instance.exposed) { 15857 return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { 15858 get: function get(target, key) { 15859 if (key in target) { 15860 return target[key]; 15861 } else if (key in publicPropertiesMap) { 15862 return publicPropertiesMap[key](instance); 15863 } 15864 } 15865 })); 15866 } 15867 } 15868 15869 function getComponentName(Component) { 15870 return isFunction(Component) ? Component.displayName || Component.name : Component.name; 15871 } 15872 15873 function isClassComponent(value) { 15874 return isFunction(value) && '__vccOpts' in value; 15875 } 15876 15877 function callWithErrorHandling(fn, instance, type, args) { 15878 var res; 15879 15880 try { 15881 res = args ? fn.apply(void 0, args) : fn(); 15882 } catch (err) { 15883 handleError(err, instance, type); 15884 } 15885 15886 return res; 15887 } 15888 15889 function callWithAsyncErrorHandling(fn, instance, type, args) { 15890 if (isFunction(fn)) { 15891 var res = callWithErrorHandling(fn, instance, type, args); 15892 15893 if (res && isPromise$1(res)) { 15894 res.catch(function (err) { 15895 handleError(err, instance, type); 15896 }); 15897 } 15898 15899 return res; 15900 } 15901 15902 var values = []; 15903 15904 for (var _i30 = 0; _i30 < fn.length; _i30++) { 15905 values.push(callWithAsyncErrorHandling(fn[_i30], instance, type, args)); 15906 } 15907 15908 return values; 15909 } 15910 15911 function handleError(err, instance, type, throwInDev) { 15912 instance ? instance.vnode : null; 15913 15914 if (instance) { 15915 var cur = instance.parent; // the exposed instance is the render proxy to keep it consistent with 2.x 15916 15917 var exposedInstance = instance.proxy; // in production the hook receives only the error code 15918 15919 var errorInfo = type; 15920 15921 while (cur) { 15922 var errorCapturedHooks = cur.ec; 15923 15924 if (errorCapturedHooks) { 15925 for (var _i31 = 0; _i31 < errorCapturedHooks.length; _i31++) { 15926 if (errorCapturedHooks[_i31](err, exposedInstance, errorInfo) === false) { 15927 return; 15928 } 15929 } 15930 } 15931 15932 cur = cur.parent; 15933 } // app-level handling 15934 15935 15936 var appErrorHandler = instance.appContext.config.errorHandler; 15937 15938 if (appErrorHandler) { 15939 callWithErrorHandling(appErrorHandler, null, 10 15940 /* APP_ERROR_HANDLER */ 15941 , [err, exposedInstance, errorInfo]); 15942 return; 15943 } 15944 } 15945 15946 logError(err); 15947 } 15948 15949 function logError(err, type, contextVNode, throwInDev) { 15950 { 15951 // recover in prod to reduce the impact on end-user 15952 console.error(err); 15953 } 15954 } 15955 15956 var isFlushing = false; 15957 var isFlushPending = false; 15958 var queue = []; 15959 var flushIndex = 0; 15960 var pendingPreFlushCbs = []; 15961 var activePreFlushCbs = null; 15962 var preFlushIndex = 0; 15963 var pendingPostFlushCbs = []; 15964 var activePostFlushCbs = null; 15965 var postFlushIndex = 0; 15966 var resolvedPromise = Promise.resolve(); 15967 var currentFlushPromise = null; 15968 var currentPreFlushParentJob = null; 15969 15970 function nextTick(fn) { 15971 var p = currentFlushPromise || resolvedPromise; 15972 return fn ? p.then(this ? fn.bind(this) : fn) : p; 15973 } // #2768 15974 // Use binary-search to find a suitable position in the queue, 15975 // so that the queue maintains the increasing order of job's id, 15976 // which can prevent the job from being skipped and also can avoid repeated patching. 15977 15978 15979 function findInsertionIndex(id) { 15980 // the start index should be `flushIndex + 1` 15981 var start = flushIndex + 1; 15982 var end = queue.length; 15983 15984 while (start < end) { 15985 var middle = start + end >>> 1; 15986 var middleJobId = getId(queue[middle]); 15987 middleJobId < id ? start = middle + 1 : end = middle; 15988 } 15989 15990 return start; 15991 } 15992 15993 function queueJob(job) { 15994 // the dedupe search uses the startIndex argument of Array.includes() 15995 // by default the search index includes the current job that is being run 15996 // so it cannot recursively trigger itself again. 15997 // if the job is a watch() callback, the search will start with a +1 index to 15998 // allow it recursively trigger itself - it is the user's responsibility to 15999 // ensure it doesn't end up in an infinite loop. 16000 if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) { 16001 if (job.id == null) { 16002 queue.push(job); 16003 } else { 16004 queue.splice(findInsertionIndex(job.id), 0, job); 16005 } 16006 16007 queueFlush(); 16008 } 16009 } 16010 16011 function queueFlush() { 16012 if (!isFlushing && !isFlushPending) { 16013 isFlushPending = true; 16014 currentFlushPromise = resolvedPromise.then(flushJobs); 16015 } 16016 } 16017 16018 function invalidateJob(job) { 16019 var i = queue.indexOf(job); 16020 16021 if (i > flushIndex) { 16022 queue.splice(i, 1); 16023 } 16024 } 16025 16026 function queueCb(cb, activeQueue, pendingQueue, index) { 16027 if (!isArray(cb)) { 16028 if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) { 16029 pendingQueue.push(cb); 16030 } 16031 } else { 16032 // if cb is an array, it is a component lifecycle hook which can only be 16033 // triggered by a job, which is already deduped in the main queue, so 16034 // we can skip duplicate check here to improve perf 16035 pendingQueue.push.apply(pendingQueue, cb); 16036 } 16037 16038 queueFlush(); 16039 } 16040 16041 function queuePreFlushCb(cb) { 16042 queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex); 16043 } 16044 16045 function queuePostFlushCb(cb) { 16046 queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex); 16047 } 16048 16049 function flushPreFlushCbs(seen, parentJob) { 16050 if (parentJob === void 0) { 16051 parentJob = null; 16052 } 16053 16054 if (pendingPreFlushCbs.length) { 16055 currentPreFlushParentJob = parentJob; 16056 activePreFlushCbs = [].concat(new Set(pendingPreFlushCbs)); 16057 pendingPreFlushCbs.length = 0; 16058 16059 for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) { 16060 activePreFlushCbs[preFlushIndex](); 16061 } 16062 16063 activePreFlushCbs = null; 16064 preFlushIndex = 0; 16065 currentPreFlushParentJob = null; // recursively flush until it drains 16066 16067 flushPreFlushCbs(seen, parentJob); 16068 } 16069 } 16070 16071 function flushPostFlushCbs(seen) { 16072 if (pendingPostFlushCbs.length) { 16073 var deduped = [].concat(new Set(pendingPostFlushCbs)); 16074 pendingPostFlushCbs.length = 0; // #1947 already has active queue, nested flushPostFlushCbs call 16075 16076 if (activePostFlushCbs) { 16077 var _activePostFlushCbs; 16078 16079 (_activePostFlushCbs = activePostFlushCbs).push.apply(_activePostFlushCbs, deduped); 16080 16081 return; 16082 } 16083 16084 activePostFlushCbs = deduped; 16085 activePostFlushCbs.sort(function (a, b) { 16086 return getId(a) - getId(b); 16087 }); 16088 16089 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { 16090 activePostFlushCbs[postFlushIndex](); 16091 } 16092 16093 activePostFlushCbs = null; 16094 postFlushIndex = 0; 16095 } 16096 } 16097 16098 var getId = function getId(job) { 16099 return job.id == null ? Infinity : job.id; 16100 }; 16101 16102 function flushJobs(seen) { 16103 isFlushPending = false; 16104 isFlushing = true; 16105 flushPreFlushCbs(seen); // Sort queue before flush. 16106 // This ensures that: 16107 // 1. Components are updated from parent to child. (because parent is always 16108 // created before the child so its render effect will have smaller 16109 // priority number) 16110 // 2. If a component is unmounted during a parent component's update, 16111 // its update can be skipped. 16112 16113 queue.sort(function (a, b) { 16114 return getId(a) - getId(b); 16115 }); // conditional usage of checkRecursiveUpdate must be determined out of 16116 // try ... catch block since Rollup by default de-optimizes treeshaking 16117 // inside try-catch. This can leave all warning code unshaked. Although 16118 // they would get eventually shaken by a minifier like terser, some minifiers 16119 // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610) 16120 16121 var check = NOOP; 16122 16123 try { 16124 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { 16125 var job = queue[flushIndex]; 16126 16127 if (job && job.active !== false) { 16128 if ("production" !== 'production' && check(job)) ; // console.log(`running:`, job.id) 16129 16130 callWithErrorHandling(job, null, 14 16131 /* SCHEDULER */ 16132 ); 16133 } 16134 } 16135 } finally { 16136 flushIndex = 0; 16137 queue.length = 0; 16138 flushPostFlushCbs(); 16139 isFlushing = false; 16140 currentFlushPromise = null; // some postFlushCb queued jobs! 16141 // keep flushing until it drains. 16142 16143 if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) { 16144 flushJobs(seen); 16145 } 16146 } 16147 } 16148 16149 var INITIAL_WATCHER_VALUE = {}; // implementation 16150 16151 function watch(source, cb, options) { 16152 return doWatch(source, cb, options); 16153 } 16154 16155 function doWatch(source, cb, _temp) { 16156 var _ref13 = _temp === void 0 ? EMPTY_OBJ : _temp, 16157 immediate = _ref13.immediate, 16158 deep = _ref13.deep, 16159 flush = _ref13.flush; 16160 _ref13.onTrack; 16161 _ref13.onTrigger; 16162 16163 var instance = currentInstance; 16164 var getter; 16165 var forceTrigger = false; 16166 var isMultiSource = false; 16167 16168 if (isRef(source)) { 16169 getter = function getter() { 16170 return source.value; 16171 }; 16172 16173 forceTrigger = !!source._shallow; 16174 } else if (isReactive(source)) { 16175 getter = function getter() { 16176 return source; 16177 }; 16178 16179 deep = true; 16180 } else if (isArray(source)) { 16181 isMultiSource = true; 16182 forceTrigger = source.some(isReactive); 16183 16184 getter = function getter() { 16185 return source.map(function (s) { 16186 if (isRef(s)) { 16187 return s.value; 16188 } else if (isReactive(s)) { 16189 return traverse(s); 16190 } else if (isFunction(s)) { 16191 return callWithErrorHandling(s, instance, 2 16192 /* WATCH_GETTER */ 16193 ); 16194 } else ; 16195 }); 16196 }; 16197 } else if (isFunction(source)) { 16198 if (cb) { 16199 // getter with cb 16200 getter = function getter() { 16201 return callWithErrorHandling(source, instance, 2 16202 /* WATCH_GETTER */ 16203 ); 16204 }; 16205 } else { 16206 // no cb -> simple effect 16207 getter = function getter() { 16208 if (instance && instance.isUnmounted) { 16209 return; 16210 } 16211 16212 if (cleanup) { 16213 cleanup(); 16214 } 16215 16216 return callWithAsyncErrorHandling(source, instance, 3 16217 /* WATCH_CALLBACK */ 16218 , [onInvalidate]); 16219 }; 16220 } 16221 } else { 16222 getter = NOOP; 16223 } 16224 16225 if (cb && deep) { 16226 var baseGetter = getter; 16227 16228 getter = function getter() { 16229 return traverse(baseGetter()); 16230 }; 16231 } 16232 16233 var cleanup; 16234 16235 var onInvalidate = function onInvalidate(fn) { 16236 cleanup = effect.onStop = function () { 16237 callWithErrorHandling(fn, instance, 4 16238 /* WATCH_CLEANUP */ 16239 ); 16240 }; 16241 }; // in SSR there is no need to setup an actual effect, and it should be noop 16242 // unless it's eager 16243 16244 16245 if (isInSSRComponentSetup) { 16246 // we will also not call the invalidate callback (+ runner is not set up) 16247 onInvalidate = NOOP; 16248 16249 if (!cb) { 16250 getter(); 16251 } else if (immediate) { 16252 callWithAsyncErrorHandling(cb, instance, 3 16253 /* WATCH_CALLBACK */ 16254 , [getter(), isMultiSource ? [] : undefined, onInvalidate]); 16255 } 16256 16257 return NOOP; 16258 } 16259 16260 var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE; 16261 16262 var job = function job() { 16263 if (!effect.active) { 16264 return; 16265 } 16266 16267 if (cb) { 16268 // watch(source, cb) 16269 var newValue = effect.run(); 16270 16271 if (deep || forceTrigger || (isMultiSource ? newValue.some(function (v, i) { 16272 return hasChanged(v, oldValue[i]); 16273 }) : hasChanged(newValue, oldValue)) || false) { 16274 // cleanup before running cb again 16275 if (cleanup) { 16276 cleanup(); 16277 } 16278 16279 callWithAsyncErrorHandling(cb, instance, 3 16280 /* WATCH_CALLBACK */ 16281 , [newValue, // pass undefined as the old value when it's changed for the first time 16282 oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue, onInvalidate]); 16283 oldValue = newValue; 16284 } 16285 } else { 16286 // watchEffect 16287 effect.run(); 16288 } 16289 }; // important: mark the job as a watcher callback so that scheduler knows 16290 // it is allowed to self-trigger (#1727) 16291 16292 16293 job.allowRecurse = !!cb; 16294 var scheduler; 16295 16296 if (flush === 'sync') { 16297 scheduler = job; // the scheduler function gets called directly 16298 } else if (flush === 'post') { 16299 scheduler = function scheduler() { 16300 return queuePostRenderEffect(job, instance && instance.suspense); 16301 }; 16302 } else { 16303 // default: 'pre' 16304 scheduler = function scheduler() { 16305 if (!instance || instance.isMounted) { 16306 queuePreFlushCb(job); 16307 } else { 16308 // with 'pre' option, the first call must happen before 16309 // the component is mounted so it is called synchronously. 16310 job(); 16311 } 16312 }; 16313 } 16314 16315 var effect = new ReactiveEffect(getter, scheduler); 16316 16317 if (cb) { 16318 if (immediate) { 16319 job(); 16320 } else { 16321 oldValue = effect.run(); 16322 } 16323 } else if (flush === 'post') { 16324 queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense); 16325 } else { 16326 effect.run(); 16327 } 16328 16329 return function () { 16330 effect.stop(); 16331 16332 if (instance && instance.scope) { 16333 remove(instance.scope.effects, effect); 16334 } 16335 }; 16336 } // this.$watch 16337 16338 16339 function instanceWatch(source, value, options) { 16340 var publicThis = this.proxy; 16341 var getter = isString(source) ? source.includes('.') ? createPathGetter(publicThis, source) : function () { 16342 return publicThis[source]; 16343 } : source.bind(publicThis, publicThis); 16344 var cb; 16345 16346 if (isFunction(value)) { 16347 cb = value; 16348 } else { 16349 cb = value.handler; 16350 options = value; 16351 } 16352 16353 var cur = currentInstance; 16354 setCurrentInstance(this); 16355 var res = doWatch(getter, cb.bind(publicThis), options); 16356 16357 if (cur) { 16358 setCurrentInstance(cur); 16359 } else { 16360 unsetCurrentInstance(); 16361 } 16362 16363 return res; 16364 } 16365 16366 function createPathGetter(ctx, path) { 16367 var segments = path.split('.'); 16368 return function () { 16369 var cur = ctx; 16370 16371 for (var _i32 = 0; _i32 < segments.length && cur; _i32++) { 16372 cur = cur[segments[_i32]]; 16373 } 16374 16375 return cur; 16376 }; 16377 } 16378 16379 function traverse(value, seen) { 16380 if (!isObject$1(value) || value["__v_skip" 16381 /* SKIP */ 16382 ]) { 16383 return value; 16384 } 16385 16386 seen = seen || new Set(); 16387 16388 if (seen.has(value)) { 16389 return value; 16390 } 16391 16392 seen.add(value); 16393 16394 if (isRef(value)) { 16395 traverse(value.value, seen); 16396 } else if (isArray(value)) { 16397 for (var _i33 = 0; _i33 < value.length; _i33++) { 16398 traverse(value[_i33], seen); 16399 } 16400 } else if (isSet(value) || isMap(value)) { 16401 value.forEach(function (v) { 16402 traverse(v, seen); 16403 }); 16404 } else if (isPlainObject(value)) { 16405 for (var key in value) { 16406 traverse(value[key], seen); 16407 } 16408 } 16409 16410 return value; 16411 } // dev only 16412 16413 16414 function h(type, propsOrChildren, children) { 16415 var l = arguments.length; 16416 16417 if (l === 2) { 16418 if (isObject$1(propsOrChildren) && !isArray(propsOrChildren)) { 16419 // single vnode without props 16420 if (isVNode(propsOrChildren)) { 16421 return createVNode(type, null, [propsOrChildren]); 16422 } // props without children 16423 16424 16425 return createVNode(type, propsOrChildren); 16426 } else { 16427 // omit props 16428 return createVNode(type, null, propsOrChildren); 16429 } 16430 } else { 16431 if (l > 3) { 16432 children = Array.prototype.slice.call(arguments, 2); 16433 } else if (l === 3 && isVNode(children)) { 16434 children = [children]; 16435 } 16436 16437 return createVNode(type, propsOrChildren, children); 16438 } 16439 } 16440 16441 var version = "3.2.26"; 16442 var svgNS = 'http://www.w3.org/2000/svg'; 16443 var doc = typeof document !== 'undefined' ? document : null; 16444 var staticTemplateCache = new Map(); 16445 var nodeOps = { 16446 insert: function insert(child, parent, anchor) { 16447 parent.insertBefore(child, anchor || null); 16448 }, 16449 remove: function remove(child) { 16450 var parent = child.parentNode; 16451 16452 if (parent) { 16453 parent.removeChild(child); 16454 } 16455 }, 16456 createElement: function createElement(tag, isSVG, is, props) { 16457 var el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { 16458 is: is 16459 } : undefined); 16460 16461 if (tag === 'select' && props && props.multiple != null) { 16462 el.setAttribute('multiple', props.multiple); 16463 } 16464 16465 return el; 16466 }, 16467 createText: function createText(text) { 16468 return doc.createTextNode(text); 16469 }, 16470 createComment: function createComment(text) { 16471 return doc.createComment(text); 16472 }, 16473 setText: function setText(node, text) { 16474 node.nodeValue = text; 16475 }, 16476 setElementText: function setElementText(el, text) { 16477 el.textContent = text; 16478 }, 16479 parentNode: function parentNode(node) { 16480 return node.parentNode; 16481 }, 16482 nextSibling: function nextSibling(node) { 16483 return node.nextSibling; 16484 }, 16485 querySelector: function querySelector(selector) { 16486 return doc.querySelector(selector); 16487 }, 16488 setScopeId: function setScopeId(el, id) { 16489 el.setAttribute(id, ''); 16490 }, 16491 cloneNode: function cloneNode(el) { 16492 var cloned = el.cloneNode(true); // #3072 16493 // - in `patchDOMProp`, we store the actual value in the `el._value` property. 16494 // - normally, elements using `:value` bindings will not be hoisted, but if 16495 // the bound value is a constant, e.g. `:value="true"` - they do get 16496 // hoisted. 16497 // - in production, hoisted nodes are cloned when subsequent inserts, but 16498 // cloneNode() does not copy the custom property we attached. 16499 // - This may need to account for other custom DOM properties we attach to 16500 // elements in addition to `_value` in the future. 16501 16502 if ("_value" in el) { 16503 cloned._value = el._value; 16504 } 16505 16506 return cloned; 16507 }, 16508 // __UNSAFE__ 16509 // Reason: innerHTML. 16510 // Static content here can only come from compiled templates. 16511 // As long as the user only uses trusted templates, this is safe. 16512 insertStaticContent: function insertStaticContent(content, parent, anchor, isSVG) { 16513 // <parent> before | first ... last | anchor </parent> 16514 var before = anchor ? anchor.previousSibling : parent.lastChild; 16515 var template = staticTemplateCache.get(content); 16516 16517 if (!template) { 16518 var _t = doc.createElement('template'); 16519 16520 _t.innerHTML = isSVG ? "<svg>" + content + "</svg>" : content; 16521 template = _t.content; 16522 16523 if (isSVG) { 16524 // remove outer svg wrapper 16525 var wrapper = template.firstChild; 16526 16527 while (wrapper.firstChild) { 16528 template.appendChild(wrapper.firstChild); 16529 } 16530 16531 template.removeChild(wrapper); 16532 } 16533 16534 staticTemplateCache.set(content, template); 16535 } 16536 16537 parent.insertBefore(template.cloneNode(true), anchor); 16538 return [// first 16539 before ? before.nextSibling : parent.firstChild, // last 16540 anchor ? anchor.previousSibling : parent.lastChild]; 16541 } 16542 }; // compiler should normalize class + :class bindings on the same element 16543 // into a single binding ['staticClass', dynamic] 16544 16545 function patchClass(el, value, isSVG) { 16546 // directly setting className should be faster than setAttribute in theory 16547 // if this is an element during a transition, take the temporary transition 16548 // classes into account. 16549 var transitionClasses = el._vtc; 16550 16551 if (transitionClasses) { 16552 value = (value ? [value].concat(transitionClasses) : [].concat(transitionClasses)).join(' '); 16553 } 16554 16555 if (value == null) { 16556 el.removeAttribute('class'); 16557 } else if (isSVG) { 16558 el.setAttribute('class', value); 16559 } else { 16560 el.className = value; 16561 } 16562 } 16563 16564 function patchStyle(el, prev, next) { 16565 var style = el.style; 16566 var isCssString = isString(next); 16567 16568 if (next && !isCssString) { 16569 for (var key in next) { 16570 setStyle(style, key, next[key]); 16571 } 16572 16573 if (prev && !isString(prev)) { 16574 for (var _key12 in prev) { 16575 if (next[_key12] == null) { 16576 setStyle(style, _key12, ''); 16577 } 16578 } 16579 } 16580 } else { 16581 var currentDisplay = style.display; 16582 16583 if (isCssString) { 16584 if (prev !== next) { 16585 style.cssText = next; 16586 } 16587 } else if (prev) { 16588 el.removeAttribute('style'); 16589 } // indicates that the `display` of the element is controlled by `v-show`, 16590 // so we always keep the current `display` value regardless of the `style` 16591 // value, thus handing over control to `v-show`. 16592 16593 16594 if ('_vod' in el) { 16595 style.display = currentDisplay; 16596 } 16597 } 16598 } 16599 16600 var importantRE = /\s*!important$/; 16601 16602 function setStyle(style, name, val) { 16603 if (isArray(val)) { 16604 val.forEach(function (v) { 16605 return setStyle(style, name, v); 16606 }); 16607 } else { 16608 if (name.startsWith('--')) { 16609 // custom property definition 16610 style.setProperty(name, val); 16611 } else { 16612 var prefixed = autoPrefix(style, name); 16613 16614 if (importantRE.test(val)) { 16615 // !important 16616 style.setProperty(hyphenate(prefixed), val.replace(importantRE, ''), 'important'); 16617 } else { 16618 style[prefixed] = val; 16619 } 16620 } 16621 } 16622 } 16623 16624 var prefixes = ['Webkit', 'Moz', 'ms']; 16625 var prefixCache = {}; 16626 16627 function autoPrefix(style, rawName) { 16628 var cached = prefixCache[rawName]; 16629 16630 if (cached) { 16631 return cached; 16632 } 16633 16634 var name = camelize(rawName); 16635 16636 if (name !== 'filter' && name in style) { 16637 return prefixCache[rawName] = name; 16638 } 16639 16640 name = capitalize(name); 16641 16642 for (var _i34 = 0; _i34 < prefixes.length; _i34++) { 16643 var prefixed = prefixes[_i34] + name; 16644 16645 if (prefixed in style) { 16646 return prefixCache[rawName] = prefixed; 16647 } 16648 } 16649 16650 return rawName; 16651 } 16652 16653 var xlinkNS = 'http://www.w3.org/1999/xlink'; 16654 16655 function patchAttr(el, key, value, isSVG, instance) { 16656 if (isSVG && key.startsWith('xlink:')) { 16657 if (value == null) { 16658 el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); 16659 } else { 16660 el.setAttributeNS(xlinkNS, key, value); 16661 } 16662 } else { 16663 // note we are only checking boolean attributes that don't have a 16664 // corresponding dom prop of the same name here. 16665 var isBoolean = isSpecialBooleanAttr(key); 16666 16667 if (value == null || isBoolean && !includeBooleanAttr(value)) { 16668 el.removeAttribute(key); 16669 } else { 16670 el.setAttribute(key, isBoolean ? '' : value); 16671 } 16672 } 16673 } // __UNSAFE__ 16674 // functions. The user is responsible for using them with only trusted content. 16675 16676 16677 function patchDOMProp(el, key, value, // the following args are passed only due to potential innerHTML/textContent 16678 // overriding existing VNodes, in which case the old tree must be properly 16679 // unmounted. 16680 prevChildren, parentComponent, parentSuspense, unmountChildren) { 16681 if (key === 'innerHTML' || key === 'textContent') { 16682 if (prevChildren) { 16683 unmountChildren(prevChildren, parentComponent, parentSuspense); 16684 } 16685 16686 el[key] = value == null ? '' : value; 16687 return; 16688 } 16689 16690 if (key === 'value' && el.tagName !== 'PROGRESS' && // custom elements may use _value internally 16691 !el.tagName.includes('-')) { 16692 // store value as _value as well since 16693 // non-string values will be stringified. 16694 el._value = value; 16695 var newValue = value == null ? '' : value; 16696 16697 if (el.value !== newValue || // #4956: always set for OPTION elements because its value falls back to 16698 // textContent if no value attribute is present. And setting .value for 16699 // OPTION has no side effect 16700 el.tagName === 'OPTION') { 16701 el.value = newValue; 16702 } 16703 16704 if (value == null) { 16705 el.removeAttribute(key); 16706 } 16707 16708 return; 16709 } 16710 16711 if (value === '' || value == null) { 16712 var type = typeof el[key]; 16713 16714 if (type === 'boolean') { 16715 // e.g. <select multiple> compiles to { multiple: '' } 16716 el[key] = includeBooleanAttr(value); 16717 return; 16718 } else if (value == null && type === 'string') { 16719 // e.g. <div :id="null"> 16720 el[key] = ''; 16721 el.removeAttribute(key); 16722 return; 16723 } else if (type === 'number') { 16724 // e.g. <img :width="null"> 16725 // the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error 16726 try { 16727 el[key] = 0; 16728 } catch (_a) {} 16729 16730 el.removeAttribute(key); 16731 return; 16732 } 16733 } // some properties perform value validation and throw 16734 16735 16736 try { 16737 el[key] = value; 16738 } catch (e) {} 16739 } // Async edge case fix requires storing an event listener's attach timestamp. 16740 16741 16742 var _getNow = Date.now; 16743 var skipTimestampCheck = false; 16744 16745 if (typeof window !== 'undefined') { 16746 // Determine what event timestamp the browser is using. Annoyingly, the 16747 // timestamp can either be hi-res (relative to page load) or low-res 16748 // (relative to UNIX epoch), so in order to compare time we have to use the 16749 // same timestamp type when saving the flush timestamp. 16750 if (_getNow() > document.createEvent('Event').timeStamp) { 16751 // if the low-res timestamp which is bigger than the event timestamp 16752 // (which is evaluated AFTER) it means the event is using a hi-res timestamp, 16753 // and we need to use the hi-res version for event listeners as well. 16754 _getNow = function _getNow() { 16755 return performance.now(); 16756 }; 16757 } // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation 16758 // and does not fire microtasks in between event propagation, so safe to exclude. 16759 16760 16761 var ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i); 16762 skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53); 16763 } // To avoid the overhead of repeatedly calling performance.now(), we cache 16764 // and use the same timestamp for all event listeners attached in the same tick. 16765 16766 16767 var cachedNow = 0; 16768 var p = Promise.resolve(); 16769 16770 var reset = function reset() { 16771 cachedNow = 0; 16772 }; 16773 16774 var getNow = function getNow() { 16775 return cachedNow || (p.then(reset), cachedNow = _getNow()); 16776 }; 16777 16778 function addEventListener(el, event, handler, options) { 16779 el.addEventListener(event, handler, options); 16780 } 16781 16782 function removeEventListener(el, event, handler, options) { 16783 el.removeEventListener(event, handler, options); 16784 } 16785 16786 function patchEvent(el, rawName, prevValue, nextValue, instance) { 16787 if (instance === void 0) { 16788 instance = null; 16789 } // vei = vue event invokers 16790 16791 16792 var invokers = el._vei || (el._vei = {}); 16793 var existingInvoker = invokers[rawName]; 16794 16795 if (nextValue && existingInvoker) { 16796 // patch 16797 existingInvoker.value = nextValue; 16798 } else { 16799 var _parseName = parseName(rawName), 16800 name = _parseName[0], 16801 _options2 = _parseName[1]; 16802 16803 if (nextValue) { 16804 // add 16805 var invoker = invokers[rawName] = createInvoker(nextValue, instance); 16806 addEventListener(el, name, invoker, _options2); 16807 } else if (existingInvoker) { 16808 // remove 16809 removeEventListener(el, name, existingInvoker, _options2); 16810 invokers[rawName] = undefined; 16811 } 16812 } 16813 } 16814 16815 var optionsModifierRE = /(?:Once|Passive|Capture)$/; 16816 16817 function parseName(name) { 16818 var options; 16819 16820 if (optionsModifierRE.test(name)) { 16821 options = {}; 16822 var m; 16823 16824 while (m = name.match(optionsModifierRE)) { 16825 name = name.slice(0, name.length - m[0].length); 16826 options[m[0].toLowerCase()] = true; 16827 } 16828 } 16829 16830 return [hyphenate(name.slice(2)), options]; 16831 } 16832 16833 function createInvoker(initialValue, instance) { 16834 var invoker = function invoker(e) { 16835 // async edge case #6566: inner click event triggers patch, event handler 16836 // attached to outer element during patch, and triggered again. This 16837 // happens because browsers fire microtask ticks between event propagation. 16838 // the solution is simple: we save the timestamp when a handler is attached, 16839 // and the handler would only fire if the event passed to it was fired 16840 // AFTER it was attached. 16841 var timeStamp = e.timeStamp || _getNow(); 16842 16843 if (skipTimestampCheck || timeStamp >= invoker.attached - 1) { 16844 callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 16845 /* NATIVE_EVENT_HANDLER */ 16846 , [e]); 16847 } 16848 }; 16849 16850 invoker.value = initialValue; 16851 invoker.attached = getNow(); 16852 return invoker; 16853 } 16854 16855 function patchStopImmediatePropagation(e, value) { 16856 if (isArray(value)) { 16857 var originalStop = e.stopImmediatePropagation; 16858 16859 e.stopImmediatePropagation = function () { 16860 originalStop.call(e); 16861 e._stopped = true; 16862 }; 16863 16864 return value.map(function (fn) { 16865 return function (e) { 16866 return !e._stopped && fn(e); 16867 }; 16868 }); 16869 } else { 16870 return value; 16871 } 16872 } 16873 16874 var nativeOnRE = /^on[a-z]/; 16875 16876 var patchProp = function patchProp(el, key, prevValue, nextValue, isSVG, prevChildren, parentComponent, parentSuspense, unmountChildren) { 16877 if (isSVG === void 0) { 16878 isSVG = false; 16879 } 16880 16881 if (key === 'class') { 16882 patchClass(el, nextValue, isSVG); 16883 } else if (key === 'style') { 16884 patchStyle(el, prevValue, nextValue); 16885 } else if (isOn(key)) { 16886 // ignore v-model listeners 16887 if (!isModelListener(key)) { 16888 patchEvent(el, key, prevValue, nextValue, parentComponent); 16889 } 16890 } else if (key[0] === '.' ? (key = key.slice(1), true) : key[0] === '^' ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { 16891 patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren); 16892 } else { 16893 // special case for <input v-model type="checkbox"> with 16894 // :true-value & :false-value 16895 // store value as dom properties since non-string values will be 16896 // stringified. 16897 if (key === 'true-value') { 16898 el._trueValue = nextValue; 16899 } else if (key === 'false-value') { 16900 el._falseValue = nextValue; 16901 } 16902 16903 patchAttr(el, key, nextValue, isSVG); 16904 } 16905 }; 16906 16907 function shouldSetAsProp(el, key, value, isSVG) { 16908 if (isSVG) { 16909 // most keys must be set as attribute on svg elements to work 16910 // ...except innerHTML & textContent 16911 if (key === 'innerHTML' || key === 'textContent') { 16912 return true; 16913 } // or native onclick with function values 16914 16915 16916 if (key in el && nativeOnRE.test(key) && isFunction(value)) { 16917 return true; 16918 } 16919 16920 return false; 16921 } // spellcheck and draggable are numerated attrs, however their 16922 // corresponding DOM properties are actually booleans - this leads to 16923 // setting it with a string "false" value leading it to be coerced to 16924 // `true`, so we need to always treat them as attributes. 16925 // Note that `contentEditable` doesn't have this problem: its DOM 16926 // property is also enumerated string values. 16927 16928 16929 if (key === 'spellcheck' || key === 'draggable') { 16930 return false; 16931 } // #1787, #2840 form property on form elements is readonly and must be set as 16932 // attribute. 16933 16934 16935 if (key === 'form') { 16936 return false; 16937 } // #1526 <input list> must be set as attribute 16938 16939 16940 if (key === 'list' && el.tagName === 'INPUT') { 16941 return false; 16942 } // #2766 <textarea type> must be set as attribute 16943 16944 16945 if (key === 'type' && el.tagName === 'TEXTAREA') { 16946 return false; 16947 } // native onclick with string value, must be set as attribute 16948 16949 16950 if (nativeOnRE.test(key) && isString(value)) { 16951 return false; 16952 } 16953 16954 return key in el; 16955 } 16956 16957 var TRANSITION = 'transition'; 16958 var ANIMATION = 'animation'; // DOM Transition is a higher-order-component based on the platform-agnostic 16959 // base Transition component, with DOM-specific logic. 16960 16961 var Transition = function Transition(props, _ref) { 16962 var slots = _ref.slots; 16963 return h(BaseTransition, resolveTransitionProps(props), slots); 16964 }; 16965 16966 Transition.displayName = 'Transition'; 16967 var DOMTransitionPropsValidators = { 16968 name: String, 16969 type: String, 16970 css: { 16971 type: Boolean, 16972 default: true 16973 }, 16974 duration: [String, Number, Object], 16975 enterFromClass: String, 16976 enterActiveClass: String, 16977 enterToClass: String, 16978 appearFromClass: String, 16979 appearActiveClass: String, 16980 appearToClass: String, 16981 leaveFromClass: String, 16982 leaveActiveClass: String, 16983 leaveToClass: String 16984 }; 16985 Transition.props = /*#__PURE__*/extend({}, BaseTransition.props, DOMTransitionPropsValidators); 16986 /** 16987 * #3227 Incoming hooks may be merged into arrays when wrapping Transition 16988 * with custom HOCs. 16989 */ 16990 16991 var callHook = function callHook(hook, args) { 16992 if (args === void 0) { 16993 args = []; 16994 } 16995 16996 if (isArray(hook)) { 16997 hook.forEach(function (h) { 16998 return h.apply(void 0, args); 16999 }); 17000 } else if (hook) { 17001 hook.apply(void 0, args); 17002 } 17003 }; 17004 /** 17005 * Check if a hook expects a callback (2nd arg), which means the user 17006 * intends to explicitly control the end of the transition. 17007 */ 17008 17009 17010 var hasExplicitCallback = function hasExplicitCallback(hook) { 17011 return hook ? isArray(hook) ? hook.some(function (h) { 17012 return h.length > 1; 17013 }) : hook.length > 1 : false; 17014 }; 17015 17016 function resolveTransitionProps(rawProps) { 17017 var baseProps = {}; 17018 17019 for (var key in rawProps) { 17020 if (!(key in DOMTransitionPropsValidators)) { 17021 baseProps[key] = rawProps[key]; 17022 } 17023 } 17024 17025 if (rawProps.css === false) { 17026 return baseProps; 17027 } 17028 17029 var _rawProps$name = rawProps.name, 17030 name = _rawProps$name === void 0 ? 'v' : _rawProps$name, 17031 type = rawProps.type, 17032 duration = rawProps.duration, 17033 _rawProps$enterFromCl = rawProps.enterFromClass, 17034 enterFromClass = _rawProps$enterFromCl === void 0 ? name + "-enter-from" : _rawProps$enterFromCl, 17035 _rawProps$enterActive = rawProps.enterActiveClass, 17036 enterActiveClass = _rawProps$enterActive === void 0 ? name + "-enter-active" : _rawProps$enterActive, 17037 _rawProps$enterToClas = rawProps.enterToClass, 17038 enterToClass = _rawProps$enterToClas === void 0 ? name + "-enter-to" : _rawProps$enterToClas, 17039 _rawProps$appearFromC = rawProps.appearFromClass, 17040 appearFromClass = _rawProps$appearFromC === void 0 ? enterFromClass : _rawProps$appearFromC, 17041 _rawProps$appearActiv = rawProps.appearActiveClass, 17042 appearActiveClass = _rawProps$appearActiv === void 0 ? enterActiveClass : _rawProps$appearActiv, 17043 _rawProps$appearToCla = rawProps.appearToClass, 17044 appearToClass = _rawProps$appearToCla === void 0 ? enterToClass : _rawProps$appearToCla, 17045 _rawProps$leaveFromCl = rawProps.leaveFromClass, 17046 leaveFromClass = _rawProps$leaveFromCl === void 0 ? name + "-leave-from" : _rawProps$leaveFromCl, 17047 _rawProps$leaveActive = rawProps.leaveActiveClass, 17048 leaveActiveClass = _rawProps$leaveActive === void 0 ? name + "-leave-active" : _rawProps$leaveActive, 17049 _rawProps$leaveToClas = rawProps.leaveToClass, 17050 leaveToClass = _rawProps$leaveToClas === void 0 ? name + "-leave-to" : _rawProps$leaveToClas; 17051 var durations = normalizeDuration(duration); 17052 var enterDuration = durations && durations[0]; 17053 var leaveDuration = durations && durations[1]; 17054 17055 var _onBeforeEnter = baseProps.onBeforeEnter, 17056 onEnter = baseProps.onEnter, 17057 _onEnterCancelled = baseProps.onEnterCancelled, 17058 _onLeave = baseProps.onLeave, 17059 _onLeaveCancelled = baseProps.onLeaveCancelled, 17060 _baseProps$onBeforeAp = baseProps.onBeforeAppear, 17061 _onBeforeAppear = _baseProps$onBeforeAp === void 0 ? _onBeforeEnter : _baseProps$onBeforeAp, 17062 _baseProps$onAppear = baseProps.onAppear, 17063 onAppear = _baseProps$onAppear === void 0 ? onEnter : _baseProps$onAppear, 17064 _baseProps$onAppearCa = baseProps.onAppearCancelled, 17065 _onAppearCancelled = _baseProps$onAppearCa === void 0 ? _onEnterCancelled : _baseProps$onAppearCa; 17066 17067 var finishEnter = function finishEnter(el, isAppear, done) { 17068 removeTransitionClass(el, isAppear ? appearToClass : enterToClass); 17069 removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); 17070 done && done(); 17071 }; 17072 17073 var finishLeave = function finishLeave(el, done) { 17074 removeTransitionClass(el, leaveToClass); 17075 removeTransitionClass(el, leaveActiveClass); 17076 done && done(); 17077 }; 17078 17079 var makeEnterHook = function makeEnterHook(isAppear) { 17080 return function (el, done) { 17081 var hook = isAppear ? onAppear : onEnter; 17082 17083 var resolve = function resolve() { 17084 return finishEnter(el, isAppear, done); 17085 }; 17086 17087 callHook(hook, [el, resolve]); 17088 nextFrame(function () { 17089 removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); 17090 addTransitionClass(el, isAppear ? appearToClass : enterToClass); 17091 17092 if (!hasExplicitCallback(hook)) { 17093 whenTransitionEnds(el, type, enterDuration, resolve); 17094 } 17095 }); 17096 }; 17097 }; 17098 17099 return extend(baseProps, { 17100 onBeforeEnter: function onBeforeEnter(el) { 17101 callHook(_onBeforeEnter, [el]); 17102 addTransitionClass(el, enterFromClass); 17103 addTransitionClass(el, enterActiveClass); 17104 }, 17105 onBeforeAppear: function onBeforeAppear(el) { 17106 callHook(_onBeforeAppear, [el]); 17107 addTransitionClass(el, appearFromClass); 17108 addTransitionClass(el, appearActiveClass); 17109 }, 17110 onEnter: makeEnterHook(false), 17111 onAppear: makeEnterHook(true), 17112 onLeave: function onLeave(el, done) { 17113 var resolve = function resolve() { 17114 return finishLeave(el, done); 17115 }; 17116 17117 addTransitionClass(el, leaveFromClass); // force reflow so *-leave-from classes immediately take effect (#2593) 17118 17119 forceReflow(); 17120 addTransitionClass(el, leaveActiveClass); 17121 nextFrame(function () { 17122 removeTransitionClass(el, leaveFromClass); 17123 addTransitionClass(el, leaveToClass); 17124 17125 if (!hasExplicitCallback(_onLeave)) { 17126 whenTransitionEnds(el, type, leaveDuration, resolve); 17127 } 17128 }); 17129 callHook(_onLeave, [el, resolve]); 17130 }, 17131 onEnterCancelled: function onEnterCancelled(el) { 17132 finishEnter(el, false); 17133 callHook(_onEnterCancelled, [el]); 17134 }, 17135 onAppearCancelled: function onAppearCancelled(el) { 17136 finishEnter(el, true); 17137 callHook(_onAppearCancelled, [el]); 17138 }, 17139 onLeaveCancelled: function onLeaveCancelled(el) { 17140 finishLeave(el); 17141 callHook(_onLeaveCancelled, [el]); 17142 } 17143 }); 17144 } 17145 17146 function normalizeDuration(duration) { 17147 if (duration == null) { 17148 return null; 17149 } else if (isObject$1(duration)) { 17150 return [NumberOf(duration.enter), NumberOf(duration.leave)]; 17151 } else { 17152 var _n5 = NumberOf(duration); 17153 17154 return [_n5, _n5]; 17155 } 17156 } 17157 17158 function NumberOf(val) { 17159 var res = toNumber(val); 17160 return res; 17161 } 17162 17163 function addTransitionClass(el, cls) { 17164 cls.split(/\s+/).forEach(function (c) { 17165 return c && el.classList.add(c); 17166 }); 17167 (el._vtc || (el._vtc = new Set())).add(cls); 17168 } 17169 17170 function removeTransitionClass(el, cls) { 17171 cls.split(/\s+/).forEach(function (c) { 17172 return c && el.classList.remove(c); 17173 }); 17174 var _vtc = el._vtc; 17175 17176 if (_vtc) { 17177 _vtc.delete(cls); 17178 17179 if (!_vtc.size) { 17180 el._vtc = undefined; 17181 } 17182 } 17183 } 17184 17185 function nextFrame(cb) { 17186 requestAnimationFrame(function () { 17187 requestAnimationFrame(cb); 17188 }); 17189 } 17190 17191 var endId = 0; 17192 17193 function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { 17194 var id = el._endId = ++endId; 17195 17196 var resolveIfNotStale = function resolveIfNotStale() { 17197 if (id === el._endId) { 17198 resolve(); 17199 } 17200 }; 17201 17202 if (explicitTimeout) { 17203 return setTimeout(resolveIfNotStale, explicitTimeout); 17204 } 17205 17206 var _getTransitionInfo = getTransitionInfo(el, expectedType), 17207 type = _getTransitionInfo.type, 17208 timeout = _getTransitionInfo.timeout, 17209 propCount = _getTransitionInfo.propCount; 17210 17211 if (!type) { 17212 return resolve(); 17213 } 17214 17215 var endEvent = type + 'end'; 17216 var ended = 0; 17217 17218 var end = function end() { 17219 el.removeEventListener(endEvent, onEnd); 17220 resolveIfNotStale(); 17221 }; 17222 17223 var onEnd = function onEnd(e) { 17224 if (e.target === el && ++ended >= propCount) { 17225 end(); 17226 } 17227 }; 17228 17229 setTimeout(function () { 17230 if (ended < propCount) { 17231 end(); 17232 } 17233 }, timeout + 1); 17234 el.addEventListener(endEvent, onEnd); 17235 } 17236 17237 function getTransitionInfo(el, expectedType) { 17238 var styles = window.getComputedStyle(el); // JSDOM may return undefined for transition properties 17239 17240 var getStyleProperties = function getStyleProperties(key) { 17241 return (styles[key] || '').split(', '); 17242 }; 17243 17244 var transitionDelays = getStyleProperties(TRANSITION + 'Delay'); 17245 var transitionDurations = getStyleProperties(TRANSITION + 'Duration'); 17246 var transitionTimeout = getTimeout(transitionDelays, transitionDurations); 17247 var animationDelays = getStyleProperties(ANIMATION + 'Delay'); 17248 var animationDurations = getStyleProperties(ANIMATION + 'Duration'); 17249 var animationTimeout = getTimeout(animationDelays, animationDurations); 17250 var type = null; 17251 var timeout = 0; 17252 var propCount = 0; 17253 /* istanbul ignore if */ 17254 17255 if (expectedType === TRANSITION) { 17256 if (transitionTimeout > 0) { 17257 type = TRANSITION; 17258 timeout = transitionTimeout; 17259 propCount = transitionDurations.length; 17260 } 17261 } else if (expectedType === ANIMATION) { 17262 if (animationTimeout > 0) { 17263 type = ANIMATION; 17264 timeout = animationTimeout; 17265 propCount = animationDurations.length; 17266 } 17267 } else { 17268 timeout = Math.max(transitionTimeout, animationTimeout); 17269 type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; 17270 propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; 17271 } 17272 17273 var hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']); 17274 return { 17275 type: type, 17276 timeout: timeout, 17277 propCount: propCount, 17278 hasTransform: hasTransform 17279 }; 17280 } 17281 17282 function getTimeout(delays, durations) { 17283 while (delays.length < durations.length) { 17284 delays = delays.concat(delays); 17285 } 17286 17287 return Math.max.apply(Math, durations.map(function (d, i) { 17288 return toMs(d) + toMs(delays[i]); 17289 })); 17290 } // Old versions of Chromium (below 61.0.3163.100) formats floating pointer 17291 // numbers in a locale-dependent way, using a comma instead of a dot. 17292 // If comma is not replaced with a dot, the input will be rounded down 17293 // (i.e. acting as a floor function) causing unexpected behaviors 17294 17295 17296 function toMs(s) { 17297 return Number(s.slice(0, -1).replace(',', '.')) * 1000; 17298 } // synchronously force layout to put elements into a certain state 17299 17300 17301 function forceReflow() { 17302 return document.body.offsetHeight; 17303 } 17304 17305 var getModelAssigner = function getModelAssigner(vnode) { 17306 var fn = vnode.props['onUpdate:modelValue']; 17307 return isArray(fn) ? function (value) { 17308 return invokeArrayFns(fn, value); 17309 } : fn; 17310 }; 17311 17312 function onCompositionStart(e) { 17313 e.target.composing = true; 17314 } 17315 17316 function onCompositionEnd(e) { 17317 var target = e.target; 17318 17319 if (target.composing) { 17320 target.composing = false; 17321 trigger(target, 'input'); 17322 } 17323 } 17324 17325 function trigger(el, type) { 17326 var e = document.createEvent('HTMLEvents'); 17327 e.initEvent(type, true, true); 17328 el.dispatchEvent(e); 17329 } // We are exporting the v-model runtime directly as vnode hooks so that it can 17330 // be tree-shaken in case v-model is never used. 17331 17332 17333 var vModelText = { 17334 created: function created(el, _ref3, vnode) { 17335 var _ref3$modifiers = _ref3.modifiers, 17336 lazy = _ref3$modifiers.lazy, 17337 trim = _ref3$modifiers.trim, 17338 number = _ref3$modifiers.number; 17339 el._assign = getModelAssigner(vnode); 17340 var castToNumber = number || vnode.props && vnode.props.type === 'number'; 17341 addEventListener(el, lazy ? 'change' : 'input', function (e) { 17342 if (e.target.composing) return; 17343 var domValue = el.value; 17344 17345 if (trim) { 17346 domValue = domValue.trim(); 17347 } else if (castToNumber) { 17348 domValue = toNumber(domValue); 17349 } 17350 17351 el._assign(domValue); 17352 }); 17353 17354 if (trim) { 17355 addEventListener(el, 'change', function () { 17356 el.value = el.value.trim(); 17357 }); 17358 } 17359 17360 if (!lazy) { 17361 addEventListener(el, 'compositionstart', onCompositionStart); 17362 addEventListener(el, 'compositionend', onCompositionEnd); // Safari < 10.2 & UIWebView doesn't fire compositionend when 17363 // switching focus before confirming composition choice 17364 // this also fixes the issue where some browsers e.g. iOS Chrome 17365 // fires "change" instead of "input" on autocomplete. 17366 17367 addEventListener(el, 'change', onCompositionEnd); 17368 } 17369 }, 17370 // set value on mounted so it's after min/max for type="range" 17371 mounted: function mounted(el, _ref4) { 17372 var value = _ref4.value; 17373 el.value = value == null ? '' : value; 17374 }, 17375 beforeUpdate: function beforeUpdate(el, _ref5, vnode) { 17376 var value = _ref5.value, 17377 _ref5$modifiers = _ref5.modifiers, 17378 lazy = _ref5$modifiers.lazy, 17379 trim = _ref5$modifiers.trim, 17380 number = _ref5$modifiers.number; 17381 el._assign = getModelAssigner(vnode); // avoid clearing unresolved text. #2302 17382 17383 if (el.composing) return; 17384 17385 if (document.activeElement === el) { 17386 if (lazy) { 17387 return; 17388 } 17389 17390 if (trim && el.value.trim() === value) { 17391 return; 17392 } 17393 17394 if ((number || el.type === 'number') && toNumber(el.value) === value) { 17395 return; 17396 } 17397 } 17398 17399 var newValue = value == null ? '' : value; 17400 17401 if (el.value !== newValue) { 17402 el.value = newValue; 17403 } 17404 } 17405 }; 17406 var systemModifiers = ['ctrl', 'shift', 'alt', 'meta']; 17407 var modifierGuards = { 17408 stop: function stop(e) { 17409 return e.stopPropagation(); 17410 }, 17411 prevent: function prevent(e) { 17412 return e.preventDefault(); 17413 }, 17414 self: function self(e) { 17415 return e.target !== e.currentTarget; 17416 }, 17417 ctrl: function ctrl(e) { 17418 return !e.ctrlKey; 17419 }, 17420 shift: function shift(e) { 17421 return !e.shiftKey; 17422 }, 17423 alt: function alt(e) { 17424 return !e.altKey; 17425 }, 17426 meta: function meta(e) { 17427 return !e.metaKey; 17428 }, 17429 left: function left(e) { 17430 return 'button' in e && e.button !== 0; 17431 }, 17432 middle: function middle(e) { 17433 return 'button' in e && e.button !== 1; 17434 }, 17435 right: function right(e) { 17436 return 'button' in e && e.button !== 2; 17437 }, 17438 exact: function exact(e, modifiers) { 17439 return systemModifiers.some(function (m) { 17440 return e[m + "Key"] && !modifiers.includes(m); 17441 }); 17442 } 17443 }; 17444 /** 17445 * @private 17446 */ 17447 17448 var withModifiers = function withModifiers(fn, modifiers) { 17449 return function (event) { 17450 for (var _i35 = 0; _i35 < modifiers.length; _i35++) { 17451 var guard = modifierGuards[modifiers[_i35]]; 17452 if (guard && guard(event, modifiers)) return; 17453 } 17454 17455 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 17456 args[_key2 - 1] = arguments[_key2]; 17457 } 17458 17459 return fn.apply(void 0, [event].concat(args)); 17460 }; 17461 }; // Kept for 2.x compat. 17462 // Note: IE11 compat for `spacebar` and `del` is removed for now. 17463 17464 17465 var keyNames = { 17466 esc: 'escape', 17467 space: ' ', 17468 up: 'arrow-up', 17469 left: 'arrow-left', 17470 right: 'arrow-right', 17471 down: 'arrow-down', 17472 delete: 'backspace' 17473 }; 17474 /** 17475 * @private 17476 */ 17477 17478 var withKeys = function withKeys(fn, modifiers) { 17479 return function (event) { 17480 if (!('key' in event)) { 17481 return; 17482 } 17483 17484 var eventKey = hyphenate(event.key); 17485 17486 if (modifiers.some(function (k) { 17487 return k === eventKey || keyNames[k] === eventKey; 17488 })) { 17489 return fn(event); 17490 } 17491 }; 17492 }; 17493 17494 var vShow = { 17495 beforeMount: function beforeMount(el, _ref15, _ref16) { 17496 var value = _ref15.value; 17497 var transition = _ref16.transition; 17498 el._vod = el.style.display === 'none' ? '' : el.style.display; 17499 17500 if (transition && value) { 17501 transition.beforeEnter(el); 17502 } else { 17503 setDisplay(el, value); 17504 } 17505 }, 17506 mounted: function mounted(el, _ref17, _ref18) { 17507 var value = _ref17.value; 17508 var transition = _ref18.transition; 17509 17510 if (transition && value) { 17511 transition.enter(el); 17512 } 17513 }, 17514 updated: function updated(el, _ref19, _ref20) { 17515 var value = _ref19.value, 17516 oldValue = _ref19.oldValue; 17517 var transition = _ref20.transition; 17518 if (!value === !oldValue) return; 17519 17520 if (transition) { 17521 if (value) { 17522 transition.beforeEnter(el); 17523 setDisplay(el, true); 17524 transition.enter(el); 17525 } else { 17526 transition.leave(el, function () { 17527 setDisplay(el, false); 17528 }); 17529 } 17530 } else { 17531 setDisplay(el, value); 17532 } 17533 }, 17534 beforeUnmount: function beforeUnmount(el, _ref21) { 17535 var value = _ref21.value; 17536 setDisplay(el, value); 17537 } 17538 }; 17539 17540 function setDisplay(el, value) { 17541 el.style.display = value ? el._vod : 'none'; 17542 } // SSR vnode transforms, only used when user includes client-oriented render 17543 17544 17545 var rendererOptions = extend({ 17546 patchProp: patchProp 17547 }, nodeOps); // lazy create the renderer - this makes core renderer logic tree-shakable 17548 // in case the user only imports reactivity utilities from Vue. 17549 17550 var renderer; 17551 17552 function ensureRenderer() { 17553 return renderer || (renderer = createRenderer(rendererOptions)); 17554 } 17555 17556 var createApp = function createApp() { 17557 var _ensureRenderer; 17558 17559 var app = (_ensureRenderer = ensureRenderer()).createApp.apply(_ensureRenderer, arguments); 17560 17561 var mount = app.mount; 17562 17563 app.mount = function (containerOrSelector) { 17564 var container = normalizeContainer(containerOrSelector); 17565 if (!container) return; 17566 var component = app._component; 17567 17568 if (!isFunction(component) && !component.render && !component.template) { 17569 // __UNSAFE__ 17570 // Reason: potential execution of JS expressions in in-DOM template. 17571 // The user must make sure the in-DOM template is trusted. If it's 17572 // rendered by the server, the template should not contain any user data. 17573 component.template = container.innerHTML; 17574 } // clear content before mounting 17575 17576 17577 container.innerHTML = ''; 17578 var proxy = mount(container, false, container instanceof SVGElement); 17579 17580 if (container instanceof Element) { 17581 container.removeAttribute('v-cloak'); 17582 container.setAttribute('data-v-app', ''); 17583 } 17584 17585 return proxy; 17586 }; 17587 17588 return app; 17589 }; 17590 17591 function normalizeContainer(container) { 17592 if (isString(container)) { 17593 var res = document.querySelector(container); 17594 return res; 17595 } 17596 17597 return container; 17598 } 17599 /** 17600 * Media Event bus - used for communication between joomla and vue 17601 */ 17602 17603 17604 var Event = /*#__PURE__*/function () { 17605 /** 17606 * Media Event constructor 17607 */ 17608 function Event() { 17609 this.events = {}; 17610 } 17611 /** 17612 * Fire an event 17613 * @param event 17614 * @param data 17615 */ 17616 17617 17618 var _proto3 = Event.prototype; 17619 17620 _proto3.fire = function fire(event, data) { 17621 if (data === void 0) { 17622 data = null; 17623 } 17624 17625 if (this.events[event]) { 17626 this.events[event].forEach(function (fn) { 17627 return fn(data); 17628 }); 17629 } 17630 } 17631 /** 17632 * Listen to events 17633 * @param event 17634 * @param callback 17635 */ 17636 ; 17637 17638 _proto3.listen = function listen(event, callback) { 17639 this.events[event] = this.events[event] || []; 17640 this.events[event].push(callback); 17641 }; 17642 17643 return Event; 17644 }(); // Loading state 17645 17646 17647 var SET_IS_LOADING = 'SET_IS_LOADING'; // Selecting media items 17648 17649 var SELECT_DIRECTORY = 'SELECT_DIRECTORY'; 17650 var SELECT_BROWSER_ITEM = 'SELECT_BROWSER_ITEM'; 17651 var SELECT_BROWSER_ITEMS = 'SELECT_BROWSER_ITEMS'; 17652 var UNSELECT_BROWSER_ITEM = 'UNSELECT_BROWSER_ITEM'; 17653 var UNSELECT_ALL_BROWSER_ITEMS = 'UNSELECT_ALL_BROWSER_ITEMS'; // In/Decrease grid item size 17654 17655 var INCREASE_GRID_SIZE = 'INCREASE_GRID_SIZE'; 17656 var DECREASE_GRID_SIZE = 'DECREASE_GRID_SIZE'; // Api handlers 17657 17658 var LOAD_CONTENTS_SUCCESS = 'LOAD_CONTENTS_SUCCESS'; 17659 var LOAD_FULL_CONTENTS_SUCCESS = 'LOAD_FULL_CONTENTS_SUCCESS'; 17660 var CREATE_DIRECTORY_SUCCESS = 'CREATE_DIRECTORY_SUCCESS'; 17661 var UPLOAD_SUCCESS = 'UPLOAD_SUCCESS'; // Create folder modal 17662 17663 var SHOW_CREATE_FOLDER_MODAL = 'SHOW_CREATE_FOLDER_MODAL'; 17664 var HIDE_CREATE_FOLDER_MODAL = 'HIDE_CREATE_FOLDER_MODAL'; // Confirm Delete Modal 17665 17666 var SHOW_CONFIRM_DELETE_MODAL = 'SHOW_CONFIRM_DELETE_MODAL'; 17667 var HIDE_CONFIRM_DELETE_MODAL = 'HIDE_CONFIRM_DELETE_MODAL'; // Infobar 17668 17669 var SHOW_INFOBAR = 'SHOW_INFOBAR'; 17670 var HIDE_INFOBAR = 'HIDE_INFOBAR'; // Delete items 17671 17672 var DELETE_SUCCESS = 'DELETE_SUCCESS'; // List view 17673 17674 var CHANGE_LIST_VIEW = 'CHANGE_LIST_VIEW'; // Preview modal 17675 17676 var SHOW_PREVIEW_MODAL = 'SHOW_PREVIEW_MODAL'; 17677 var HIDE_PREVIEW_MODAL = 'HIDE_PREVIEW_MODAL'; // Rename modal 17678 17679 var SHOW_RENAME_MODAL = 'SHOW_RENAME_MODAL'; 17680 var HIDE_RENAME_MODAL = 'HIDE_RENAME_MODAL'; 17681 var RENAME_SUCCESS = 'RENAME_SUCCESS'; // Share model 17682 17683 var SHOW_SHARE_MODAL = 'SHOW_SHARE_MODAL'; 17684 var HIDE_SHARE_MODAL = 'HIDE_SHARE_MODAL'; // Search Query 17685 17686 var SET_SEARCH_QUERY = 'SET_SEARCH_QUERY'; 17687 17688 var Notifications = /*#__PURE__*/function () { 17689 function Notifications() {} 17690 17691 var _proto4 = Notifications.prototype; 17692 17693 /* Send and success notification */ 17694 // eslint-disable-next-line class-methods-use-this 17695 _proto4.success = function success(message, options) { 17696 // eslint-disable-next-line no-use-before-define 17697 notifications.notify(message, Object.assign({ 17698 type: 'message', 17699 // @todo rename it to success 17700 dismiss: true 17701 }, options)); 17702 } 17703 /* Send an error notification */ 17704 // eslint-disable-next-line class-methods-use-this 17705 ; 17706 17707 _proto4.error = function error(message, options) { 17708 // eslint-disable-next-line no-use-before-define 17709 notifications.notify(message, Object.assign({ 17710 type: 'error', 17711 // @todo rename it to danger 17712 dismiss: true 17713 }, options)); 17714 } 17715 /* Ask the user a question */ 17716 // eslint-disable-next-line class-methods-use-this 17717 ; 17718 17719 _proto4.ask = function ask(message) { 17720 return window.confirm(message); 17721 } 17722 /* Send a notification */ 17723 // eslint-disable-next-line class-methods-use-this 17724 ; 17725 17726 _proto4.notify = function notify(message, options) { 17727 var _Joomla$renderMessage; 17728 17729 var timer; 17730 17731 if (options.type === 'message') { 17732 timer = 3000; 17733 } 17734 17735 Joomla.renderMessages((_Joomla$renderMessage = {}, _Joomla$renderMessage[options.type] = [Joomla.Text._(message)], _Joomla$renderMessage), undefined, true, timer); 17736 }; 17737 17738 return Notifications; 17739 }(); // eslint-disable-next-line import/no-mutable-exports,import/prefer-default-export 17740 17741 17742 var notifications = new Notifications(); 17743 var script$t = { 17744 name: 'MediaApp', 17745 data: function data() { 17746 return { 17747 // The full height of the app in px 17748 fullHeight: '' 17749 }; 17750 }, 17751 computed: { 17752 disks: function disks() { 17753 return this.$store.state.disks; 17754 } 17755 }, 17756 created: function created() { 17757 var _this2 = this; 17758 17759 // Listen to the toolbar events 17760 MediaManager.Event.listen('onClickCreateFolder', function () { 17761 return _this2.$store.commit(SHOW_CREATE_FOLDER_MODAL); 17762 }); 17763 MediaManager.Event.listen('onClickDelete', function () { 17764 if (_this2.$store.state.selectedItems.length > 0) { 17765 _this2.$store.commit(SHOW_CONFIRM_DELETE_MODAL); 17766 } else { 17767 notifications.error('COM_MEDIA_PLEASE_SELECT_ITEM'); 17768 } 17769 }); 17770 }, 17771 mounted: function mounted() { 17772 var _this3 = this; 17773 17774 // Set the full height and add event listener when dom is updated 17775 this.$nextTick(function () { 17776 _this3.setFullHeight(); // Add the global resize event listener 17777 17778 17779 window.addEventListener('resize', _this3.setFullHeight); 17780 }); // Initial load the data 17781 17782 this.$store.dispatch('getContents', this.$store.state.selectedDirectory); 17783 }, 17784 beforeUnmount: function beforeUnmount() { 17785 // Remove the global resize event listener 17786 window.removeEventListener('resize', this.setFullHeight); 17787 }, 17788 methods: { 17789 /* Set the full height on the app container */ 17790 setFullHeight: function setFullHeight() { 17791 this.fullHeight = window.innerHeight - this.$el.getBoundingClientRect().top + "px"; 17792 } 17793 } 17794 }; 17795 var _hoisted_1$t = { 17796 class: "media-container" 17797 }; 17798 var _hoisted_2$l = { 17799 class: "media-sidebar" 17800 }; 17801 var _hoisted_3$g = { 17802 class: "media-main" 17803 }; 17804 17805 function render$t(_ctx, _cache, $props, $setup, $data, $options) { 17806 var _component_media_disk = resolveComponent("media-disk"); 17807 17808 var _component_media_toolbar = resolveComponent("media-toolbar"); 17809 17810 var _component_media_browser = resolveComponent("media-browser"); 17811 17812 var _component_media_upload = resolveComponent("media-upload"); 17813 17814 var _component_media_create_folder_modal = resolveComponent("media-create-folder-modal"); 17815 17816 var _component_media_preview_modal = resolveComponent("media-preview-modal"); 17817 17818 var _component_media_rename_modal = resolveComponent("media-rename-modal"); 17819 17820 var _component_media_share_modal = resolveComponent("media-share-modal"); 17821 17822 var _component_media_confirm_delete_modal = resolveComponent("media-confirm-delete-modal"); 17823 17824 return openBlock(), createElementBlock("div", _hoisted_1$t, [createBaseVNode("div", _hoisted_2$l, [(openBlock(true), createElementBlock(Fragment, null, renderList($options.disks, function (disk, index) { 17825 return openBlock(), createBlock(_component_media_disk, { 17826 key: index, 17827 uid: index, 17828 disk: disk 17829 }, null, 8 17830 /* PROPS */ 17831 , ["uid", "disk"]); 17832 }), 128 17833 /* KEYED_FRAGMENT */ 17834 ))]), createBaseVNode("div", _hoisted_3$g, [createVNode(_component_media_toolbar), createVNode(_component_media_browser)]), createVNode(_component_media_upload), createVNode(_component_media_create_folder_modal), createVNode(_component_media_preview_modal), createVNode(_component_media_rename_modal), createVNode(_component_media_share_modal), createVNode(_component_media_confirm_delete_modal)]); 17835 } 17836 17837 script$t.render = render$t; 17838 script$t.__file = "administrator/components/com_media/resources/scripts/components/app.vue"; 17839 var script$s = { 17840 name: 'MediaDisk', 17841 // eslint-disable-next-line vue/require-prop-types 17842 props: ['disk', 'uid'], 17843 computed: { 17844 diskId: function diskId() { 17845 return "disk-" + (this.uid + 1); 17846 } 17847 } 17848 }; 17849 var _hoisted_1$s = { 17850 class: "media-disk" 17851 }; 17852 var _hoisted_2$k = ["id"]; 17853 17854 function render$s(_ctx, _cache, $props, $setup, $data, $options) { 17855 var _component_media_drive = resolveComponent("media-drive"); 17856 17857 return openBlock(), createElementBlock("div", _hoisted_1$s, [createBaseVNode("h2", { 17858 id: $options.diskId, 17859 class: "media-disk-name" 17860 }, toDisplayString($props.disk.displayName), 9 17861 /* TEXT, PROPS */ 17862 , _hoisted_2$k), (openBlock(true), createElementBlock(Fragment, null, renderList($props.disk.drives, function (drive, index) { 17863 return openBlock(), createBlock(_component_media_drive, { 17864 key: index, 17865 "disk-id": $options.diskId, 17866 counter: index, 17867 drive: drive, 17868 total: $props.disk.drives.length 17869 }, null, 8 17870 /* PROPS */ 17871 , ["disk-id", "counter", "drive", "total"]); 17872 }), 128 17873 /* KEYED_FRAGMENT */ 17874 ))]); 17875 } 17876 17877 script$s.render = render$s; 17878 script$s.__file = "administrator/components/com_media/resources/scripts/components/tree/disk.vue"; 17879 var navigable = { 17880 methods: { 17881 navigateTo: function navigateTo(path) { 17882 this.$store.dispatch('getContents', path); 17883 } 17884 } 17885 }; 17886 var script$r = { 17887 name: 'MediaDrive', 17888 mixins: [navigable], 17889 // eslint-disable-next-line vue/require-prop-types 17890 props: ['drive', 'total', 'diskId', 'counter'], 17891 computed: { 17892 /* Whether or not the item is active */ 17893 isActive: function isActive() { 17894 return this.$store.state.selectedDirectory === this.drive.root; 17895 }, 17896 getTabindex: function getTabindex() { 17897 return this.isActive ? 0 : -1; 17898 } 17899 }, 17900 methods: { 17901 /* Handle the on drive click event */ 17902 onDriveClick: function onDriveClick() { 17903 this.navigateTo(this.drive.root); 17904 }, 17905 moveFocusToChildElement: function moveFocusToChildElement(nextRoot) { 17906 this.$refs[nextRoot].setFocusToFirstChild(); 17907 }, 17908 restoreFocus: function restoreFocus() { 17909 this.$refs['drive-root'].focus(); 17910 } 17911 } 17912 }; 17913 var _hoisted_1$r = ["aria-labelledby"]; 17914 var _hoisted_2$j = ["aria-setsize", "tabindex"]; 17915 var _hoisted_3$f = { 17916 class: "item-name" 17917 }; 17918 17919 function render$r(_ctx, _cache, $props, $setup, $data, $options) { 17920 var _component_media_tree = resolveComponent("media-tree"); 17921 17922 return openBlock(), createElementBlock("div", { 17923 class: "media-drive", 17924 onClick: _cache[2] || (_cache[2] = withModifiers(function ($event) { 17925 return $options.onDriveClick(); 17926 }, ["stop", "prevent"])) 17927 }, [createBaseVNode("ul", { 17928 class: "media-tree", 17929 role: "tree", 17930 "aria-labelledby": $props.diskId 17931 }, [createBaseVNode("li", { 17932 class: normalizeClass({ 17933 active: $options.isActive, 17934 'media-tree-item': true, 17935 'media-drive-name': true 17936 }), 17937 role: "none" 17938 }, [createBaseVNode("a", { 17939 ref: "drive-root", 17940 role: "treeitem", 17941 "aria-level": "1", 17942 "aria-setsize": $props.counter, 17943 "aria-posinset": 1, 17944 tabindex: $options.getTabindex, 17945 onKeyup: [_cache[0] || (_cache[0] = withKeys(function ($event) { 17946 return $options.moveFocusToChildElement($props.drive.root); 17947 }, ["right"])), _cache[1] || (_cache[1] = withKeys(function () { 17948 return $options.onDriveClick && $options.onDriveClick.apply($options, arguments); 17949 }, ["enter"]))] 17950 }, [createBaseVNode("span", _hoisted_3$f, toDisplayString($props.drive.displayName), 1 17951 /* TEXT */ 17952 )], 40 17953 /* PROPS, HYDRATE_EVENTS */ 17954 , _hoisted_2$j), createVNode(_component_media_tree, { 17955 ref: $props.drive.root, 17956 root: $props.drive.root, 17957 level: 2, 17958 "parent-index": 0, 17959 onMoveFocusToParent: $options.restoreFocus 17960 }, null, 8 17961 /* PROPS */ 17962 , ["root", "onMoveFocusToParent"])], 2 17963 /* CLASS */ 17964 )], 8 17965 /* PROPS */ 17966 , _hoisted_1$r)]); 17967 } 17968 17969 script$r.render = render$r; 17970 script$r.__file = "administrator/components/com_media/resources/scripts/components/tree/drive.vue"; 17971 var script$q = { 17972 name: 'MediaTree', 17973 mixins: [navigable], 17974 props: { 17975 root: { 17976 type: String, 17977 required: true 17978 }, 17979 level: { 17980 type: Number, 17981 required: true 17982 }, 17983 parentIndex: { 17984 type: Number, 17985 required: true 17986 } 17987 }, 17988 emits: ['move-focus-to-parent'], 17989 computed: { 17990 /* Get the directories */ 17991 directories: function directories() { 17992 var _this4 = this; 17993 17994 return this.$store.state.directories.filter(function (directory) { 17995 return directory.directory === _this4.root; 17996 }) // Sort alphabetically 17997 .sort(function (a, b) { 17998 return a.name.toUpperCase() < b.name.toUpperCase() ? -1 : 1; 17999 }); 18000 } 18001 }, 18002 methods: { 18003 isActive: function isActive(item) { 18004 return item.path === this.$store.state.selectedDirectory; 18005 }, 18006 getTabindex: function getTabindex(item) { 18007 return this.isActive(item) ? 0 : -1; 18008 }, 18009 onItemClick: function onItemClick(item) { 18010 this.navigateTo(item.path); 18011 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 18012 bubbles: true, 18013 cancelable: false, 18014 detail: {} 18015 })); 18016 }, 18017 hasChildren: function hasChildren(item) { 18018 return item.directories.length > 0; 18019 }, 18020 isOpen: function isOpen(item) { 18021 return this.$store.state.selectedDirectory.includes(item.path); 18022 }, 18023 iconClass: function iconClass(item) { 18024 return { 18025 fas: false, 18026 'icon-folder': !this.isOpen(item), 18027 'icon-folder-open': this.isOpen(item) 18028 }; 18029 }, 18030 setFocusToFirstChild: function setFocusToFirstChild() { 18031 this.$refs[this.root + "0"][0].focus(); 18032 }, 18033 moveFocusToNextElement: function moveFocusToNextElement(currentIndex) { 18034 if (currentIndex + 1 === this.directories.length) { 18035 return; 18036 } 18037 18038 this.$refs[this.root + (currentIndex + 1)][0].focus(); 18039 }, 18040 moveFocusToPreviousElement: function moveFocusToPreviousElement(currentIndex) { 18041 if (currentIndex === 0) { 18042 return; 18043 } 18044 18045 this.$refs[this.root + (currentIndex - 1)][0].focus(); 18046 }, 18047 moveFocusToChildElement: function moveFocusToChildElement(item) { 18048 if (!this.hasChildren(item)) { 18049 return; 18050 } 18051 18052 this.$refs[item.path][0].setFocusToFirstChild(); 18053 }, 18054 moveFocusToParentElement: function moveFocusToParentElement() { 18055 this.$emit('move-focus-to-parent', this.parentIndex); 18056 }, 18057 restoreFocus: function restoreFocus(parentIndex) { 18058 this.$refs[this.root + parentIndex][0].focus(); 18059 } 18060 } 18061 }; 18062 var _hoisted_1$q = { 18063 class: "media-tree", 18064 role: "group" 18065 }; 18066 var _hoisted_2$i = ["aria-level", "aria-setsize", "aria-posinset", "tabindex", "onClick", "onKeyup"]; 18067 var _hoisted_3$e = { 18068 class: "item-icon" 18069 }; 18070 var _hoisted_4$a = { 18071 class: "item-name" 18072 }; 18073 18074 function render$q(_ctx, _cache, $props, $setup, $data, $options) { 18075 var _component_media_tree = resolveComponent("media-tree"); 18076 18077 return openBlock(), createElementBlock("ul", _hoisted_1$q, [(openBlock(true), createElementBlock(Fragment, null, renderList($options.directories, function (item, index) { 18078 return openBlock(), createElementBlock("li", { 18079 key: item.path, 18080 class: normalizeClass(["media-tree-item", { 18081 active: $options.isActive(item) 18082 }]), 18083 role: "none" 18084 }, [createBaseVNode("a", { 18085 ref_for: true, 18086 ref: $props.root + index, 18087 role: "treeitem", 18088 "aria-level": $props.level, 18089 "aria-setsize": $options.directories.length, 18090 "aria-posinset": index, 18091 tabindex: $options.getTabindex(item), 18092 onClick: withModifiers(function ($event) { 18093 return $options.onItemClick(item); 18094 }, ["stop", "prevent"]), 18095 onKeyup: [withKeys(function ($event) { 18096 return $options.moveFocusToPreviousElement(index); 18097 }, ["up"]), withKeys(function ($event) { 18098 return $options.moveFocusToNextElement(index); 18099 }, ["down"]), withKeys(function ($event) { 18100 return $options.onItemClick(item); 18101 }, ["enter"]), withKeys(function ($event) { 18102 return $options.moveFocusToChildElement(item); 18103 }, ["right"]), _cache[0] || (_cache[0] = withKeys(function ($event) { 18104 return $options.moveFocusToParentElement(); 18105 }, ["left"]))] 18106 }, [createBaseVNode("span", _hoisted_3$e, [createBaseVNode("span", { 18107 class: normalizeClass($options.iconClass(item)) 18108 }, null, 2 18109 /* CLASS */ 18110 )]), createBaseVNode("span", _hoisted_4$a, toDisplayString(item.name), 1 18111 /* TEXT */ 18112 )], 40 18113 /* PROPS, HYDRATE_EVENTS */ 18114 , _hoisted_2$i), createVNode(Transition, { 18115 name: "slide-fade" 18116 }, { 18117 default: withCtx(function () { 18118 return [$options.hasChildren(item) ? withDirectives((openBlock(), createBlock(_component_media_tree, { 18119 key: 0, 18120 ref_for: true, 18121 ref: item.path, 18122 "aria-expanded": $options.isOpen(item) ? 'true' : 'false', 18123 root: item.path, 18124 level: $props.level + 1, 18125 "parent-index": index, 18126 onMoveFocusToParent: $options.restoreFocus 18127 }, null, 8 18128 /* PROPS */ 18129 , ["aria-expanded", "root", "level", "parent-index", "onMoveFocusToParent"])), [[vShow, $options.isOpen(item)]]) : createCommentVNode("v-if", true)]; 18130 }), 18131 _: 2 18132 /* DYNAMIC */ 18133 18134 }, 1024 18135 /* DYNAMIC_SLOTS */ 18136 )], 2 18137 /* CLASS */ 18138 ); 18139 }), 128 18140 /* KEYED_FRAGMENT */ 18141 ))]); 18142 } 18143 18144 script$q.render = render$q; 18145 script$q.__file = "administrator/components/com_media/resources/scripts/components/tree/tree.vue"; 18146 var script$p = { 18147 name: 'MediaToolbar', 18148 computed: { 18149 toggleListViewBtnIcon: function toggleListViewBtnIcon() { 18150 return this.isGridView ? 'icon-list' : 'icon-th'; 18151 }, 18152 isLoading: function isLoading() { 18153 return this.$store.state.isLoading; 18154 }, 18155 atLeastOneItemSelected: function atLeastOneItemSelected() { 18156 return this.$store.state.selectedItems.length > 0; 18157 }, 18158 isGridView: function isGridView() { 18159 return this.$store.state.listView === 'grid'; 18160 }, 18161 allItemsSelected: function allItemsSelected() { 18162 // eslint-disable-next-line max-len 18163 return this.$store.getters.getSelectedDirectoryContents.length === this.$store.state.selectedItems.length; 18164 }, 18165 search: function search() { 18166 return this.$store.state.search; 18167 } 18168 }, 18169 watch: { 18170 // eslint-disable-next-line 18171 '$store.state.selectedItems': function $storeStateSelectedItems() { 18172 if (!this.allItemsSelected) { 18173 this.$refs.mediaToolbarSelectAll.checked = false; 18174 } 18175 } 18176 }, 18177 methods: { 18178 toggleInfoBar: function toggleInfoBar() { 18179 if (this.$store.state.showInfoBar) { 18180 this.$store.commit(HIDE_INFOBAR); 18181 } else { 18182 this.$store.commit(SHOW_INFOBAR); 18183 } 18184 }, 18185 decreaseGridSize: function decreaseGridSize() { 18186 if (!this.isGridSize('sm')) { 18187 this.$store.commit(DECREASE_GRID_SIZE); 18188 } 18189 }, 18190 increaseGridSize: function increaseGridSize() { 18191 if (!this.isGridSize('xl')) { 18192 this.$store.commit(INCREASE_GRID_SIZE); 18193 } 18194 }, 18195 changeListView: function changeListView() { 18196 if (this.$store.state.listView === 'grid') { 18197 this.$store.commit(CHANGE_LIST_VIEW, 'table'); 18198 } else { 18199 this.$store.commit(CHANGE_LIST_VIEW, 'grid'); 18200 } 18201 }, 18202 toggleSelectAll: function toggleSelectAll() { 18203 if (this.allItemsSelected) { 18204 this.$store.commit(UNSELECT_ALL_BROWSER_ITEMS); 18205 } else { 18206 // eslint-disable-next-line max-len 18207 this.$store.commit(SELECT_BROWSER_ITEMS, this.$store.getters.getSelectedDirectoryContents); 18208 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 18209 bubbles: true, 18210 cancelable: false, 18211 detail: {} 18212 })); 18213 } 18214 }, 18215 isGridSize: function isGridSize(size) { 18216 return this.$store.state.gridSize === size; 18217 }, 18218 changeSearch: function changeSearch(query) { 18219 this.$store.commit(SET_SEARCH_QUERY, query.target.value); 18220 } 18221 } 18222 }; 18223 var _hoisted_1$p = ["aria-label"]; 18224 var _hoisted_2$h = { 18225 key: 0, 18226 class: "media-loader" 18227 }; 18228 var _hoisted_3$d = { 18229 class: "media-view-icons" 18230 }; 18231 var _hoisted_4$9 = ["aria-label"]; 18232 var _hoisted_5$9 = { 18233 class: "media-view-search-input", 18234 role: "search" 18235 }; 18236 var _hoisted_6$7 = { 18237 for: "media_search", 18238 class: "visually-hidden" 18239 }; 18240 var _hoisted_7$4 = ["placeholder", "value"]; 18241 var _hoisted_8$4 = { 18242 class: "media-view-icons" 18243 }; 18244 var _hoisted_9$4 = ["aria-label"]; 18245 18246 var _hoisted_10$2 = /*#__PURE__*/createBaseVNode("span", { 18247 class: "icon-search-minus", 18248 "aria-hidden": "true" 18249 }, null, -1 18250 /* HOISTED */ 18251 ); 18252 18253 var _hoisted_11$2 = [_hoisted_10$2]; 18254 var _hoisted_12$2 = ["aria-label"]; 18255 18256 var _hoisted_13$1 = /*#__PURE__*/createBaseVNode("span", { 18257 class: "icon-search-plus", 18258 "aria-hidden": "true" 18259 }, null, -1 18260 /* HOISTED */ 18261 ); 18262 18263 var _hoisted_14 = [_hoisted_13$1]; 18264 var _hoisted_15 = ["aria-label"]; 18265 var _hoisted_16 = ["aria-label"]; 18266 18267 var _hoisted_17 = /*#__PURE__*/createBaseVNode("span", { 18268 class: "icon-info", 18269 "aria-hidden": "true" 18270 }, null, -1 18271 /* HOISTED */ 18272 ); 18273 18274 var _hoisted_18 = [_hoisted_17]; 18275 18276 function render$p(_ctx, _cache, $props, $setup, $data, $options) { 18277 var _component_media_breadcrumb = resolveComponent("media-breadcrumb"); 18278 18279 return openBlock(), createElementBlock("div", { 18280 class: "media-toolbar", 18281 role: "toolbar", 18282 "aria-label": _ctx.translate('COM_MEDIA_TOOLBAR_LABEL') 18283 }, [$options.isLoading ? (openBlock(), createElementBlock("div", _hoisted_2$h)) : createCommentVNode("v-if", true), createBaseVNode("div", _hoisted_3$d, [createBaseVNode("input", { 18284 ref: "mediaToolbarSelectAll", 18285 type: "checkbox", 18286 class: "media-toolbar-icon media-toolbar-select-all", 18287 "aria-label": _ctx.translate('COM_MEDIA_SELECT_ALL'), 18288 onClick: _cache[0] || (_cache[0] = withModifiers(function () { 18289 return $options.toggleSelectAll && $options.toggleSelectAll.apply($options, arguments); 18290 }, ["stop"])) 18291 }, null, 8 18292 /* PROPS */ 18293 , _hoisted_4$9)]), createVNode(_component_media_breadcrumb), createBaseVNode("div", _hoisted_5$9, [createBaseVNode("label", _hoisted_6$7, toDisplayString(_ctx.translate('COM_MEDIA_SEARCH')), 1 18294 /* TEXT */ 18295 ), createBaseVNode("input", { 18296 id: "media_search", 18297 class: "form-control", 18298 type: "text", 18299 placeholder: _ctx.translate('COM_MEDIA_SEARCH'), 18300 value: $options.search, 18301 onInput: _cache[1] || (_cache[1] = function () { 18302 return $options.changeSearch && $options.changeSearch.apply($options, arguments); 18303 }) 18304 }, null, 40 18305 /* PROPS, HYDRATE_EVENTS */ 18306 , _hoisted_7$4)]), createBaseVNode("div", _hoisted_8$4, [$options.isGridView ? (openBlock(), createElementBlock("button", { 18307 key: 0, 18308 type: "button", 18309 class: normalizeClass(["media-toolbar-icon media-toolbar-decrease-grid-size", { 18310 disabled: $options.isGridSize('sm') 18311 }]), 18312 "aria-label": _ctx.translate('COM_MEDIA_DECREASE_GRID'), 18313 onClick: _cache[2] || (_cache[2] = withModifiers(function ($event) { 18314 return $options.decreaseGridSize(); 18315 }, ["stop", "prevent"])) 18316 }, _hoisted_11$2, 10 18317 /* CLASS, PROPS */ 18318 , _hoisted_9$4)) : createCommentVNode("v-if", true), $options.isGridView ? (openBlock(), createElementBlock("button", { 18319 key: 1, 18320 type: "button", 18321 class: normalizeClass(["media-toolbar-icon media-toolbar-increase-grid-size", { 18322 disabled: $options.isGridSize('xl') 18323 }]), 18324 "aria-label": _ctx.translate('COM_MEDIA_INCREASE_GRID'), 18325 onClick: _cache[3] || (_cache[3] = withModifiers(function ($event) { 18326 return $options.increaseGridSize(); 18327 }, ["stop", "prevent"])) 18328 }, _hoisted_14, 10 18329 /* CLASS, PROPS */ 18330 , _hoisted_12$2)) : createCommentVNode("v-if", true), createBaseVNode("button", { 18331 type: "button", 18332 href: "#", 18333 class: "media-toolbar-icon media-toolbar-list-view", 18334 "aria-label": _ctx.translate('COM_MEDIA_TOGGLE_LIST_VIEW'), 18335 onClick: _cache[4] || (_cache[4] = withModifiers(function ($event) { 18336 return $options.changeListView(); 18337 }, ["stop", "prevent"])) 18338 }, [createBaseVNode("span", { 18339 class: normalizeClass($options.toggleListViewBtnIcon), 18340 "aria-hidden": "true" 18341 }, null, 2 18342 /* CLASS */ 18343 )], 8 18344 /* PROPS */ 18345 , _hoisted_15), createBaseVNode("button", { 18346 type: "button", 18347 href: "#", 18348 class: "media-toolbar-icon media-toolbar-info", 18349 "aria-label": _ctx.translate('COM_MEDIA_TOGGLE_INFO'), 18350 onClick: _cache[5] || (_cache[5] = withModifiers(function () { 18351 return $options.toggleInfoBar && $options.toggleInfoBar.apply($options, arguments); 18352 }, ["stop", "prevent"])) 18353 }, _hoisted_18, 8 18354 /* PROPS */ 18355 , _hoisted_16)])], 8 18356 /* PROPS */ 18357 , _hoisted_1$p); 18358 } 18359 18360 script$p.render = render$p; 18361 script$p.__file = "administrator/components/com_media/resources/scripts/components/toolbar/toolbar.vue"; 18362 var script$o = { 18363 name: 'MediaBreadcrumb', 18364 mixins: [navigable], 18365 computed: { 18366 /* Get the crumbs from the current directory path */ 18367 crumbs: function crumbs() { 18368 var _this5 = this; 18369 18370 var items = []; 18371 var parts = this.$store.state.selectedDirectory.split('/'); // Add the drive as first element 18372 18373 if (parts) { 18374 var drive = this.findDrive(parts[0]); 18375 18376 if (drive) { 18377 items.push(drive); 18378 parts.shift(); 18379 } 18380 } 18381 18382 parts.filter(function (crumb) { 18383 return crumb.length !== 0; 18384 }).forEach(function (crumb) { 18385 items.push({ 18386 name: crumb, 18387 path: _this5.$store.state.selectedDirectory.split(crumb)[0] + crumb 18388 }); 18389 }); 18390 return items; 18391 }, 18392 18393 /* Whether or not the crumb is the last element in the list */ 18394 isLast: function isLast(item) { 18395 return this.crumbs.indexOf(item) === this.crumbs.length - 1; 18396 } 18397 }, 18398 methods: { 18399 /* Handle the on crumb click event */ 18400 onCrumbClick: function onCrumbClick(crumb) { 18401 this.navigateTo(crumb.path); 18402 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 18403 bubbles: true, 18404 cancelable: false, 18405 detail: {} 18406 })); 18407 }, 18408 findDrive: function findDrive(adapter) { 18409 var driveObject = null; 18410 this.$store.state.disks.forEach(function (disk) { 18411 disk.drives.forEach(function (drive) { 18412 if (drive.root.startsWith(adapter)) { 18413 driveObject = { 18414 name: drive.displayName, 18415 path: drive.root 18416 }; 18417 } 18418 }); 18419 }); 18420 return driveObject; 18421 } 18422 } 18423 }; 18424 var _hoisted_1$o = ["aria-label"]; 18425 var _hoisted_2$g = ["aria-current", "onClick"]; 18426 18427 function render$o(_ctx, _cache, $props, $setup, $data, $options) { 18428 return openBlock(), createElementBlock("nav", { 18429 class: "media-breadcrumb", 18430 "aria-label": _ctx.translate('COM_MEDIA_BREADCRUMB_LABEL') 18431 }, [createBaseVNode("ol", null, [(openBlock(true), createElementBlock(Fragment, null, renderList($options.crumbs, function (val, index) { 18432 return openBlock(), createElementBlock("li", { 18433 key: index, 18434 class: "media-breadcrumb-item" 18435 }, [createBaseVNode("a", { 18436 href: "#", 18437 "aria-current": index === Object.keys($options.crumbs).length - 1 ? 'page' : undefined, 18438 onClick: withModifiers(function ($event) { 18439 return $options.onCrumbClick(val); 18440 }, ["stop", "prevent"]) 18441 }, toDisplayString(val.name), 9 18442 /* TEXT, PROPS */ 18443 , _hoisted_2$g)]); 18444 }), 128 18445 /* KEYED_FRAGMENT */ 18446 ))])], 8 18447 /* PROPS */ 18448 , _hoisted_1$o); 18449 } 18450 18451 script$o.render = render$o; 18452 script$o.__file = "administrator/components/com_media/resources/scripts/components/breadcrumb/breadcrumb.vue"; 18453 var script$n = { 18454 name: 'MediaBrowser', 18455 computed: { 18456 /* Get the contents of the currently selected directory */ 18457 items: function items() { 18458 var _this6 = this; 18459 18460 // eslint-disable-next-line vue/no-side-effects-in-computed-properties 18461 var directories = this.$store.getters.getSelectedDirectoryDirectories // Sort by type and alphabetically 18462 .sort(function (a, b) { 18463 return a.name.toUpperCase() < b.name.toUpperCase() ? -1 : 1; 18464 }).filter(function (dir) { 18465 return dir.name.toLowerCase().includes(_this6.$store.state.search.toLowerCase()); 18466 }); // eslint-disable-next-line vue/no-side-effects-in-computed-properties 18467 18468 var files = this.$store.getters.getSelectedDirectoryFiles // Sort by type and alphabetically 18469 .sort(function (a, b) { 18470 return a.name.toUpperCase() < b.name.toUpperCase() ? -1 : 1; 18471 }).filter(function (file) { 18472 return file.name.toLowerCase().includes(_this6.$store.state.search.toLowerCase()); 18473 }); 18474 return [].concat(directories, files); 18475 }, 18476 18477 /* The styles for the media-browser element */ 18478 mediaBrowserStyles: function mediaBrowserStyles() { 18479 return { 18480 width: this.$store.state.showInfoBar ? '75%' : '100%' 18481 }; 18482 }, 18483 18484 /* The styles for the media-browser element */ 18485 listView: function listView() { 18486 return this.$store.state.listView; 18487 }, 18488 mediaBrowserGridItemsClass: function mediaBrowserGridItemsClass() { 18489 var _ref22; 18490 18491 return _ref22 = {}, _ref22["media-browser-items-" + this.$store.state.gridSize] = true, _ref22; 18492 }, 18493 isModal: function isModal() { 18494 return Joomla.getOptions('com_media', {}).isModal; 18495 }, 18496 currentDirectory: function currentDirectory() { 18497 var parts = this.$store.state.selectedDirectory.split('/').filter(function (crumb) { 18498 return crumb.length !== 0; 18499 }); // The first part is the name of the drive, so if we have a folder name display it. Else 18500 // find the filename 18501 18502 if (parts.length !== 1) { 18503 return parts[parts.length - 1]; 18504 } 18505 18506 var diskName = ''; 18507 this.$store.state.disks.forEach(function (disk) { 18508 disk.drives.forEach(function (drive) { 18509 if (drive.root === parts[0] + "/") { 18510 diskName = drive.displayName; 18511 } 18512 }); 18513 }); 18514 return diskName; 18515 } 18516 }, 18517 created: function created() { 18518 document.body.addEventListener('click', this.unselectAllBrowserItems, false); 18519 }, 18520 beforeUnmount: function beforeUnmount() { 18521 document.body.removeEventListener('click', this.unselectAllBrowserItems, false); 18522 }, 18523 methods: { 18524 /* Unselect all browser items */ 18525 unselectAllBrowserItems: function unselectAllBrowserItems(event) { 18526 var clickedDelete = !!(event.target.id !== undefined && event.target.id === 'mediaDelete'); 18527 var notClickedBrowserItems = this.$refs.browserItems && !this.$refs.browserItems.contains(event.target) || event.target === this.$refs.browserItems; 18528 var notClickedInfobar = this.$refs.infobar !== undefined && !this.$refs.infobar.$el.contains(event.target); 18529 var clickedOutside = notClickedBrowserItems && notClickedInfobar && !clickedDelete; 18530 18531 if (clickedOutside) { 18532 this.$store.commit(UNSELECT_ALL_BROWSER_ITEMS); 18533 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 18534 bubbles: true, 18535 cancelable: false, 18536 detail: { 18537 path: '', 18538 thumb: false, 18539 fileType: false, 18540 extension: false 18541 } 18542 })); 18543 } 18544 }, 18545 // Listeners for drag and drop 18546 // Fix for Chrome 18547 onDragEnter: function onDragEnter(e) { 18548 e.stopPropagation(); 18549 return false; 18550 }, 18551 // Notify user when file is over the drop area 18552 onDragOver: function onDragOver(e) { 18553 e.preventDefault(); 18554 document.querySelector('.media-dragoutline').classList.add('active'); 18555 return false; 18556 }, 18557 18558 /* Upload files */ 18559 upload: function upload(file) { 18560 var _this7 = this; 18561 18562 // Create a new file reader instance 18563 var reader = new FileReader(); // Add the on load callback 18564 18565 reader.onload = function (progressEvent) { 18566 var result = progressEvent.target.result; 18567 var splitIndex = result.indexOf('base64') + 7; 18568 var content = result.slice(splitIndex, result.length); // Upload the file 18569 18570 _this7.$store.dispatch('uploadFile', { 18571 name: file.name, 18572 parent: _this7.$store.state.selectedDirectory, 18573 content: content 18574 }); 18575 }; 18576 18577 reader.readAsDataURL(file); 18578 }, 18579 // Logic for the dropped file 18580 onDrop: function onDrop(e) { 18581 e.preventDefault(); // Loop through array of files and upload each file 18582 18583 if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length > 0) { 18584 // eslint-disable-next-line no-plusplus,no-cond-assign 18585 for (var _i36 = 0, f; f = e.dataTransfer.files[_i36]; _i36++) { 18586 document.querySelector('.media-dragoutline').classList.remove('active'); 18587 this.upload(f); 18588 } 18589 } 18590 18591 document.querySelector('.media-dragoutline').classList.remove('active'); 18592 }, 18593 // Reset the drop area border 18594 onDragLeave: function onDragLeave(e) { 18595 e.stopPropagation(); 18596 e.preventDefault(); 18597 document.querySelector('.media-dragoutline').classList.remove('active'); 18598 return false; 18599 } 18600 } 18601 }; 18602 var _hoisted_1$n = { 18603 class: "media-dragoutline" 18604 }; 18605 18606 var _hoisted_2$f = /*#__PURE__*/createBaseVNode("span", { 18607 class: "icon-cloud-upload upload-icon", 18608 "aria-hidden": "true" 18609 }, null, -1 18610 /* HOISTED */ 18611 ); 18612 18613 var _hoisted_3$c = { 18614 key: 0, 18615 class: "table media-browser-table" 18616 }; 18617 var _hoisted_4$8 = { 18618 class: "visually-hidden" 18619 }; 18620 var _hoisted_5$8 = { 18621 class: "media-browser-table-head" 18622 }; 18623 18624 var _hoisted_6$6 = /*#__PURE__*/createBaseVNode("th", { 18625 class: "type", 18626 scope: "col" 18627 }, null, -1 18628 /* HOISTED */ 18629 ); 18630 18631 var _hoisted_7$3 = { 18632 class: "name", 18633 scope: "col" 18634 }; 18635 var _hoisted_8$3 = { 18636 class: "size", 18637 scope: "col" 18638 }; 18639 var _hoisted_9$3 = { 18640 class: "dimension", 18641 scope: "col" 18642 }; 18643 var _hoisted_10$1 = { 18644 class: "created", 18645 scope: "col" 18646 }; 18647 var _hoisted_11$1 = { 18648 class: "modified", 18649 scope: "col" 18650 }; 18651 var _hoisted_12$1 = { 18652 key: 1, 18653 class: "media-browser-grid" 18654 }; 18655 18656 function render$n(_ctx, _cache, $props, $setup, $data, $options) { 18657 var _component_media_browser_item_row = resolveComponent("media-browser-item-row"); 18658 18659 var _component_media_browser_item = resolveComponent("media-browser-item"); 18660 18661 var _component_media_infobar = resolveComponent("media-infobar"); 18662 18663 return openBlock(), createElementBlock("div", null, [createBaseVNode("div", { 18664 ref: "browserItems", 18665 class: "media-browser", 18666 style: normalizeStyle($options.mediaBrowserStyles), 18667 onDragenter: _cache[0] || (_cache[0] = function () { 18668 return $options.onDragEnter && $options.onDragEnter.apply($options, arguments); 18669 }), 18670 onDrop: _cache[1] || (_cache[1] = function () { 18671 return $options.onDrop && $options.onDrop.apply($options, arguments); 18672 }), 18673 onDragover: _cache[2] || (_cache[2] = function () { 18674 return $options.onDragOver && $options.onDragOver.apply($options, arguments); 18675 }), 18676 onDragleave: _cache[3] || (_cache[3] = function () { 18677 return $options.onDragLeave && $options.onDragLeave.apply($options, arguments); 18678 }) 18679 }, [createBaseVNode("div", _hoisted_1$n, [_hoisted_2$f, createBaseVNode("p", null, toDisplayString(_ctx.translate('COM_MEDIA_DROP_FILE')), 1 18680 /* TEXT */ 18681 )]), $options.listView === 'table' ? (openBlock(), createElementBlock("table", _hoisted_3$c, [createBaseVNode("caption", _hoisted_4$8, toDisplayString(_ctx.sprintf('COM_MEDIA_BROWSER_TABLE_CAPTION', $options.currentDirectory)), 1 18682 /* TEXT */ 18683 ), createBaseVNode("thead", _hoisted_5$8, [createBaseVNode("tr", null, [_hoisted_6$6, createBaseVNode("th", _hoisted_7$3, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_NAME')), 1 18684 /* TEXT */ 18685 ), createBaseVNode("th", _hoisted_8$3, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_SIZE')), 1 18686 /* TEXT */ 18687 ), createBaseVNode("th", _hoisted_9$3, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_DIMENSION')), 1 18688 /* TEXT */ 18689 ), createBaseVNode("th", _hoisted_10$1, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_DATE_CREATED')), 1 18690 /* TEXT */ 18691 ), createBaseVNode("th", _hoisted_11$1, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_DATE_MODIFIED')), 1 18692 /* TEXT */ 18693 )])]), createBaseVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList($options.items, function (item) { 18694 return openBlock(), createBlock(_component_media_browser_item_row, { 18695 key: item.path, 18696 item: item 18697 }, null, 8 18698 /* PROPS */ 18699 , ["item"]); 18700 }), 128 18701 /* KEYED_FRAGMENT */ 18702 ))])])) : $options.listView === 'grid' ? (openBlock(), createElementBlock("div", _hoisted_12$1, [createBaseVNode("div", { 18703 class: normalizeClass(["media-browser-items", $options.mediaBrowserGridItemsClass]) 18704 }, [(openBlock(true), createElementBlock(Fragment, null, renderList($options.items, function (item) { 18705 return openBlock(), createBlock(_component_media_browser_item, { 18706 key: item.path, 18707 item: item 18708 }, null, 8 18709 /* PROPS */ 18710 , ["item"]); 18711 }), 128 18712 /* KEYED_FRAGMENT */ 18713 ))], 2 18714 /* CLASS */ 18715 )])) : createCommentVNode("v-if", true)], 36 18716 /* STYLE, HYDRATE_EVENTS */ 18717 ), createVNode(_component_media_infobar, { 18718 ref: "infobar" 18719 }, null, 512 18720 /* NEED_PATCH */ 18721 )]); 18722 } 18723 18724 script$n.render = render$n; 18725 script$n.__file = "administrator/components/com_media/resources/scripts/components/browser/browser.vue"; 18726 var script$m = { 18727 name: 'MediaBrowserItemDirectory', 18728 mixins: [navigable], 18729 // eslint-disable-next-line vue/require-prop-types 18730 props: ['item'], 18731 emits: ['toggle-settings'], 18732 data: function data() { 18733 return { 18734 showActions: false 18735 }; 18736 }, 18737 methods: { 18738 /* Handle the on preview double click event */ 18739 onPreviewDblClick: function onPreviewDblClick() { 18740 this.navigateTo(this.item.path); 18741 }, 18742 18743 /* Hide actions dropdown */ 18744 hideActions: function hideActions() { 18745 this.$refs.container.hideActions(); 18746 }, 18747 toggleSettings: function toggleSettings(bool) { 18748 this.$emit('toggle-settings', bool); 18749 } 18750 } 18751 }; 18752 18753 var _hoisted_1$m = /*#__PURE__*/createBaseVNode("div", { 18754 class: "file-background" 18755 }, [/*#__PURE__*/createBaseVNode("div", { 18756 class: "folder-icon" 18757 }, [/*#__PURE__*/createBaseVNode("span", { 18758 class: "icon-folder" 18759 })])], -1 18760 /* HOISTED */ 18761 ); 18762 18763 var _hoisted_2$e = [_hoisted_1$m]; 18764 var _hoisted_3$b = { 18765 class: "media-browser-item-info" 18766 }; 18767 18768 function render$m(_ctx, _cache, $props, $setup, $data, $options) { 18769 var _component_media_browser_action_items_container = resolveComponent("media-browser-action-items-container"); 18770 18771 return openBlock(), createElementBlock("div", { 18772 class: "media-browser-item-directory", 18773 onMouseleave: _cache[2] || (_cache[2] = function ($event) { 18774 return $options.hideActions(); 18775 }) 18776 }, [createBaseVNode("div", { 18777 class: "media-browser-item-preview", 18778 tabindex: "0", 18779 onDblclick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 18780 return $options.onPreviewDblClick(); 18781 }, ["stop", "prevent"])), 18782 onKeyup: _cache[1] || (_cache[1] = withKeys(function ($event) { 18783 return $options.onPreviewDblClick(); 18784 }, ["enter"])) 18785 }, _hoisted_2$e, 32 18786 /* HYDRATE_EVENTS */ 18787 ), createBaseVNode("div", _hoisted_3$b, toDisplayString($props.item.name), 1 18788 /* TEXT */ 18789 ), createVNode(_component_media_browser_action_items_container, { 18790 ref: "container", 18791 item: $props.item, 18792 onToggleSettings: $options.toggleSettings 18793 }, null, 8 18794 /* PROPS */ 18795 , ["item", "onToggleSettings"])], 32 18796 /* HYDRATE_EVENTS */ 18797 ); 18798 } 18799 18800 script$m.render = render$m; 18801 script$m.__file = "administrator/components/com_media/resources/scripts/components/browser/items/directory.vue"; 18802 var script$l = { 18803 name: 'MediaBrowserItemFile', 18804 // eslint-disable-next-line vue/require-prop-types 18805 props: ['item', 'focused'], 18806 emits: ['toggle-settings'], 18807 data: function data() { 18808 return { 18809 showActions: false 18810 }; 18811 }, 18812 methods: { 18813 /* Hide actions dropdown */ 18814 hideActions: function hideActions() { 18815 this.$refs.container.hideActions(); 18816 }, 18817 18818 /* Preview an item */ 18819 openPreview: function openPreview() { 18820 this.$refs.container.openPreview(); 18821 }, 18822 toggleSettings: function toggleSettings(bool) { 18823 this.$emit('toggle-settings', bool); 18824 } 18825 } 18826 }; 18827 18828 var _hoisted_1$l = /*#__PURE__*/createBaseVNode("div", { 18829 class: "media-browser-item-preview" 18830 }, [/*#__PURE__*/createBaseVNode("div", { 18831 class: "file-background" 18832 }, [/*#__PURE__*/createBaseVNode("div", { 18833 class: "file-icon" 18834 }, [/*#__PURE__*/createBaseVNode("span", { 18835 class: "icon-file-alt" 18836 })])])], -1 18837 /* HOISTED */ 18838 ); 18839 18840 var _hoisted_2$d = { 18841 class: "media-browser-item-info" 18842 }; 18843 var _hoisted_3$a = ["aria-label", "title"]; 18844 18845 function render$l(_ctx, _cache, $props, $setup, $data, $options) { 18846 var _component_media_browser_action_items_container = resolveComponent("media-browser-action-items-container"); 18847 18848 return openBlock(), createElementBlock("div", { 18849 class: "media-browser-item-file", 18850 onMouseleave: _cache[0] || (_cache[0] = function ($event) { 18851 return $options.hideActions(); 18852 }) 18853 }, [_hoisted_1$l, createBaseVNode("div", _hoisted_2$d, toDisplayString($props.item.name) + " " + toDisplayString($props.item.filetype), 1 18854 /* TEXT */ 18855 ), createBaseVNode("span", { 18856 class: "media-browser-select", 18857 "aria-label": _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM'), 18858 title: _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM') 18859 }, null, 8 18860 /* PROPS */ 18861 , _hoisted_3$a), createVNode(_component_media_browser_action_items_container, { 18862 ref: "container", 18863 item: $props.item, 18864 previewable: true, 18865 downloadable: true, 18866 shareable: true, 18867 onToggleSettings: $options.toggleSettings 18868 }, null, 8 18869 /* PROPS */ 18870 , ["item", "onToggleSettings"])], 32 18871 /* HYDRATE_EVENTS */ 18872 ); 18873 } 18874 18875 script$l.render = render$l; 18876 script$l.__file = "administrator/components/com_media/resources/scripts/components/browser/items/file.vue"; 18877 18878 var dirname = function dirname(path) { 18879 if (typeof path !== 'string') { 18880 throw new TypeError('Path must be a string. Received ' + JSON.stringify(path)); 18881 } 18882 18883 if (path.length === 0) return '.'; 18884 var code = path.charCodeAt(0); 18885 var hasRoot = code === 47; 18886 var end = -1; 18887 var matchedSlash = true; 18888 18889 for (var _i37 = path.length - 1; _i37 >= 1; --_i37) { 18890 code = path.charCodeAt(_i37); 18891 18892 if (code === 47) { 18893 if (!matchedSlash) { 18894 end = _i37; 18895 break; 18896 } 18897 } else { 18898 // We saw the first non-path separator 18899 matchedSlash = false; 18900 } 18901 } 18902 18903 if (end === -1) return hasRoot ? '/' : '.'; 18904 if (hasRoot && end === 1) return '//'; 18905 return path.slice(0, end); 18906 }; 18907 /** 18908 * Api class for communication with the server 18909 */ 18910 18911 18912 var Api = /*#__PURE__*/function () { 18913 /** 18914 * Store constructor 18915 */ 18916 function Api() { 18917 var options = Joomla.getOptions('com_media', {}); 18918 18919 if (options.apiBaseUrl === undefined) { 18920 throw new TypeError('Media api baseUrl is not defined'); 18921 } 18922 18923 if (options.csrfToken === undefined) { 18924 throw new TypeError('Media api csrf token is not defined'); 18925 } // eslint-disable-next-line no-underscore-dangle 18926 18927 18928 this._baseUrl = options.apiBaseUrl; // eslint-disable-next-line no-underscore-dangle 18929 18930 this._csrfToken = Joomla.getOptions('csrf.token'); 18931 this.imagesExtensions = options.imagesExtensions; 18932 this.audioExtensions = options.audioExtensions; 18933 this.videoExtensions = options.videoExtensions; 18934 this.documentExtensions = options.documentExtensions; 18935 this.mediaVersion = new Date().getTime().toString(); 18936 this.canCreate = options.canCreate || false; 18937 this.canEdit = options.canEdit || false; 18938 this.canDelete = options.canDelete || false; 18939 } 18940 /** 18941 * Get the contents of a directory from the server 18942 * @param {string} dir The directory path 18943 * @param {number} full whether or not the persistent url should be returned 18944 * @param {number} content whether or not the content should be returned 18945 * @returns {Promise} 18946 */ 18947 18948 18949 var _proto5 = Api.prototype; 18950 18951 _proto5.getContents = function getContents(dir, full, content) { 18952 var _this8 = this; 18953 18954 // Wrap the ajax call into a real promise 18955 return new Promise(function (resolve, reject) { 18956 // Do a check on full 18957 if (['0', '1'].indexOf(full) !== -1) { 18958 throw Error('Invalid parameter: full'); 18959 } // Do a check on download 18960 18961 18962 if (['0', '1'].indexOf(content) !== -1) { 18963 throw Error('Invalid parameter: content'); 18964 } // eslint-disable-next-line no-underscore-dangle 18965 18966 18967 var url = _this8._baseUrl + "&task=api.files&path=" + dir; 18968 18969 if (full) { 18970 url += "&url=" + full; 18971 } 18972 18973 if (content) { 18974 url += "&content=" + content; 18975 } 18976 18977 Joomla.request({ 18978 url: url, 18979 method: 'GET', 18980 headers: { 18981 'Content-Type': 'application/json' 18982 }, 18983 onSuccess: function onSuccess(response) { 18984 // eslint-disable-next-line no-underscore-dangle 18985 resolve(_this8._normalizeArray(JSON.parse(response).data)); 18986 }, 18987 onError: function onError(xhr) { 18988 reject(xhr); 18989 } 18990 }); // eslint-disable-next-line no-underscore-dangle 18991 }).catch(this._handleError); 18992 } 18993 /** 18994 * Create a directory 18995 * @param name 18996 * @param parent 18997 * @returns {Promise.<T>} 18998 */ 18999 ; 19000 19001 _proto5.createDirectory = function createDirectory(name, parent) { 19002 var _this9 = this; 19003 19004 // Wrap the ajax call into a real promise 19005 return new Promise(function (resolve, reject) { 19006 var _data; 19007 19008 // eslint-disable-next-line no-underscore-dangle 19009 var url = _this9._baseUrl + "&task=api.files&path=" + parent; // eslint-disable-next-line no-underscore-dangle 19010 19011 var data = (_data = {}, _data[_this9._csrfToken] = '1', _data.name = name, _data); 19012 Joomla.request({ 19013 url: url, 19014 method: 'POST', 19015 data: JSON.stringify(data), 19016 headers: { 19017 'Content-Type': 'application/json' 19018 }, 19019 onSuccess: function onSuccess(response) { 19020 notifications.success('COM_MEDIA_CREATE_NEW_FOLDER_SUCCESS'); // eslint-disable-next-line no-underscore-dangle 19021 19022 resolve(_this9._normalizeItem(JSON.parse(response).data)); 19023 }, 19024 onError: function onError(xhr) { 19025 notifications.error('COM_MEDIA_CREATE_NEW_FOLDER_ERROR'); 19026 reject(xhr); 19027 } 19028 }); // eslint-disable-next-line no-underscore-dangle 19029 }).catch(this._handleError); 19030 } 19031 /** 19032 * Upload a file 19033 * @param name 19034 * @param parent 19035 * @param content base64 encoded string 19036 * @param override boolean whether or not we should override existing files 19037 * @return {Promise.<T>} 19038 */ 19039 ; 19040 19041 _proto5.upload = function upload(name, parent, content, override) { 19042 var _this10 = this; 19043 19044 // Wrap the ajax call into a real promise 19045 return new Promise(function (resolve, reject) { 19046 var _data2; 19047 19048 // eslint-disable-next-line no-underscore-dangle 19049 var url = _this10._baseUrl + "&task=api.files&path=" + parent; 19050 var data = (_data2 = {}, _data2[_this10._csrfToken] = '1', _data2.name = name, _data2.content = content, _data2); // Append override 19051 19052 if (override === true) { 19053 data.override = true; 19054 } 19055 19056 Joomla.request({ 19057 url: url, 19058 method: 'POST', 19059 data: JSON.stringify(data), 19060 headers: { 19061 'Content-Type': 'application/json' 19062 }, 19063 onSuccess: function onSuccess(response) { 19064 notifications.success('COM_MEDIA_UPLOAD_SUCCESS'); // eslint-disable-next-line no-underscore-dangle 19065 19066 resolve(_this10._normalizeItem(JSON.parse(response).data)); 19067 }, 19068 onError: function onError(xhr) { 19069 reject(xhr); 19070 } 19071 }); // eslint-disable-next-line no-underscore-dangle 19072 }).catch(this._handleError); 19073 } 19074 /** 19075 * Rename an item 19076 * @param path 19077 * @param newPath 19078 * @return {Promise.<T>} 19079 */ 19080 // eslint-disable-next-line no-shadow 19081 ; 19082 19083 _proto5.rename = function rename(path, newPath) { 19084 var _this11 = this; 19085 19086 // Wrap the ajax call into a real promise 19087 return new Promise(function (resolve, reject) { 19088 var _data3; 19089 19090 // eslint-disable-next-line no-underscore-dangle 19091 var url = _this11._baseUrl + "&task=api.files&path=" + path; 19092 var data = (_data3 = {}, _data3[_this11._csrfToken] = '1', _data3.newPath = newPath, _data3); 19093 Joomla.request({ 19094 url: url, 19095 method: 'PUT', 19096 data: JSON.stringify(data), 19097 headers: { 19098 'Content-Type': 'application/json' 19099 }, 19100 onSuccess: function onSuccess(response) { 19101 notifications.success('COM_MEDIA_RENAME_SUCCESS'); // eslint-disable-next-line no-underscore-dangle 19102 19103 resolve(_this11._normalizeItem(JSON.parse(response).data)); 19104 }, 19105 onError: function onError(xhr) { 19106 notifications.error('COM_MEDIA_RENAME_ERROR'); 19107 reject(xhr); 19108 } 19109 }); // eslint-disable-next-line no-underscore-dangle 19110 }).catch(this._handleError); 19111 } 19112 /** 19113 * Delete a file 19114 * @param path 19115 * @return {Promise.<T>} 19116 */ 19117 // eslint-disable-next-line no-shadow 19118 ; 19119 19120 _proto5.delete = function _delete(path) { 19121 var _this12 = this; 19122 19123 // Wrap the ajax call into a real promise 19124 return new Promise(function (resolve, reject) { 19125 var _data4; 19126 19127 // eslint-disable-next-line no-underscore-dangle 19128 var url = _this12._baseUrl + "&task=api.files&path=" + path; // eslint-disable-next-line no-underscore-dangle 19129 19130 var data = (_data4 = {}, _data4[_this12._csrfToken] = '1', _data4); 19131 Joomla.request({ 19132 url: url, 19133 method: 'DELETE', 19134 data: JSON.stringify(data), 19135 headers: { 19136 'Content-Type': 'application/json' 19137 }, 19138 onSuccess: function onSuccess() { 19139 notifications.success('COM_MEDIA_DELETE_SUCCESS'); 19140 resolve(); 19141 }, 19142 onError: function onError(xhr) { 19143 notifications.error('COM_MEDIA_DELETE_ERROR'); 19144 reject(xhr); 19145 } 19146 }); // eslint-disable-next-line no-underscore-dangle 19147 }).catch(this._handleError); 19148 } 19149 /** 19150 * Normalize a single item 19151 * @param item 19152 * @returns {*} 19153 * @private 19154 */ 19155 // eslint-disable-next-line no-underscore-dangle,class-methods-use-this 19156 ; 19157 19158 _proto5._normalizeItem = function _normalizeItem(item) { 19159 if (item.type === 'dir') { 19160 item.directories = []; 19161 item.files = []; 19162 } 19163 19164 item.directory = dirname(item.path); 19165 19166 if (item.directory.indexOf(':', item.directory.length - 1) !== -1) { 19167 item.directory += '/'; 19168 } 19169 19170 return item; 19171 } 19172 /** 19173 * Normalize array data 19174 * @param data 19175 * @returns {{directories, files}} 19176 * @private 19177 */ 19178 // eslint-disable-next-line no-underscore-dangle 19179 ; 19180 19181 _proto5._normalizeArray = function _normalizeArray(data) { 19182 var _this13 = this; 19183 19184 var directories = data.filter(function (item) { 19185 return item.type === 'dir'; 19186 }) // eslint-disable-next-line no-underscore-dangle 19187 .map(function (directory) { 19188 return _this13._normalizeItem(directory); 19189 }); 19190 var files = data.filter(function (item) { 19191 return item.type === 'file'; 19192 }) // eslint-disable-next-line no-underscore-dangle 19193 .map(function (file) { 19194 return _this13._normalizeItem(file); 19195 }); 19196 return { 19197 directories: directories, 19198 files: files 19199 }; 19200 } 19201 /** 19202 * Handle errors 19203 * @param error 19204 * @private 19205 * 19206 * @TODO DN improve error handling 19207 */ 19208 // eslint-disable-next-line no-underscore-dangle,class-methods-use-this 19209 ; 19210 19211 _proto5._handleError = function _handleError(error) { 19212 var response = JSON.parse(error.response); 19213 19214 if (response.message) { 19215 notifications.error(response.message); 19216 } else { 19217 switch (error.status) { 19218 case 409: 19219 // Handled in consumer 19220 break; 19221 19222 case 404: 19223 notifications.error('COM_MEDIA_ERROR_NOT_FOUND'); 19224 break; 19225 19226 case 401: 19227 notifications.error('COM_MEDIA_ERROR_NOT_AUTHENTICATED'); 19228 break; 19229 19230 case 403: 19231 notifications.error('COM_MEDIA_ERROR_NOT_AUTHORIZED'); 19232 break; 19233 19234 case 500: 19235 notifications.error('COM_MEDIA_SERVER_ERROR'); 19236 break; 19237 19238 default: 19239 notifications.error('COM_MEDIA_ERROR'); 19240 } 19241 } 19242 19243 throw error; 19244 }; 19245 19246 return Api; 19247 }(); // eslint-disable-next-line import/prefer-default-export 19248 19249 19250 var api = new Api(); 19251 var script$k = { 19252 name: 'MediaBrowserItemImage', 19253 props: { 19254 item: { 19255 type: Object, 19256 required: true 19257 }, 19258 focused: { 19259 type: Boolean, 19260 required: true, 19261 default: false 19262 } 19263 }, 19264 emits: ['toggle-settings'], 19265 data: function data() { 19266 return { 19267 showActions: { 19268 type: Boolean, 19269 default: false 19270 } 19271 }; 19272 }, 19273 computed: { 19274 getURL: function getURL() { 19275 if (!this.item.thumb_path) { 19276 return ''; 19277 } 19278 19279 return this.item.thumb_path.split(Joomla.getOptions('system.paths').rootFull).length > 1 ? this.item.thumb_path + "?" + api.mediaVersion : "" + this.item.thumb_path; 19280 }, 19281 width: function width() { 19282 return this.item.width > 0 ? this.item.width : null; 19283 }, 19284 height: function height() { 19285 return this.item.height > 0 ? this.item.height : null; 19286 }, 19287 loading: function loading() { 19288 return this.item.width > 0 ? 'lazy' : null; 19289 }, 19290 altTag: function altTag() { 19291 return this.item.name; 19292 } 19293 }, 19294 methods: { 19295 /* Check if the item is an image to edit */ 19296 canEdit: function canEdit() { 19297 return ['jpg', 'jpeg', 'png'].includes(this.item.extension.toLowerCase()); 19298 }, 19299 19300 /* Hide actions dropdown */ 19301 hideActions: function hideActions() { 19302 this.$refs.container.hideActions(); 19303 }, 19304 19305 /* Preview an item */ 19306 openPreview: function openPreview() { 19307 this.$refs.container.openPreview(); 19308 }, 19309 19310 /* Edit an item */ 19311 editItem: function editItem() { 19312 // @todo should we use relative urls here? 19313 var fileBaseUrl = Joomla.getOptions('com_media').editViewUrl + "&path="; 19314 window.location.href = fileBaseUrl + this.item.path; 19315 }, 19316 toggleSettings: function toggleSettings(bool) { 19317 this.$emit('toggle-settings', bool); 19318 } 19319 } 19320 }; 19321 var _hoisted_1$k = ["title"]; 19322 var _hoisted_2$c = { 19323 class: "image-background" 19324 }; 19325 var _hoisted_3$9 = ["src", "alt", "loading", "width", "height"]; 19326 var _hoisted_4$7 = { 19327 key: 1, 19328 class: "icon-eye-slash image-placeholder", 19329 "aria-hidden": "true" 19330 }; 19331 var _hoisted_5$7 = ["title"]; 19332 var _hoisted_6$5 = ["aria-label", "title"]; 19333 19334 function render$k(_ctx, _cache, $props, $setup, $data, $options) { 19335 var _component_media_browser_action_items_container = resolveComponent("media-browser-action-items-container"); 19336 19337 return openBlock(), createElementBlock("div", { 19338 class: "media-browser-image", 19339 tabindex: "0", 19340 onDblclick: _cache[0] || (_cache[0] = function ($event) { 19341 return $options.openPreview(); 19342 }), 19343 onMouseleave: _cache[1] || (_cache[1] = function ($event) { 19344 return $options.hideActions(); 19345 }), 19346 onKeyup: _cache[2] || (_cache[2] = withKeys(function ($event) { 19347 return $options.openPreview(); 19348 }, ["enter"])) 19349 }, [createBaseVNode("div", { 19350 class: "media-browser-item-preview", 19351 title: $props.item.name 19352 }, [createBaseVNode("div", _hoisted_2$c, [$options.getURL ? (openBlock(), createElementBlock("img", { 19353 key: 0, 19354 class: "image-cropped", 19355 src: $options.getURL, 19356 alt: $options.altTag, 19357 loading: $options.loading, 19358 width: $options.width, 19359 height: $options.height 19360 }, null, 8 19361 /* PROPS */ 19362 , _hoisted_3$9)) : createCommentVNode("v-if", true), !$options.getURL ? (openBlock(), createElementBlock("span", _hoisted_4$7)) : createCommentVNode("v-if", true)])], 8 19363 /* PROPS */ 19364 , _hoisted_1$k), createBaseVNode("div", { 19365 class: "media-browser-item-info", 19366 title: $props.item.name 19367 }, toDisplayString($props.item.name) + " " + toDisplayString($props.item.filetype), 9 19368 /* TEXT, PROPS */ 19369 , _hoisted_5$7), createBaseVNode("span", { 19370 class: "media-browser-select", 19371 "aria-label": _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM'), 19372 title: _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM') 19373 }, null, 8 19374 /* PROPS */ 19375 , _hoisted_6$5), createVNode(_component_media_browser_action_items_container, { 19376 ref: "container", 19377 item: $props.item, 19378 edit: $options.editItem, 19379 previewable: true, 19380 downloadable: true, 19381 shareable: true, 19382 onToggleSettings: $options.toggleSettings 19383 }, null, 8 19384 /* PROPS */ 19385 , ["item", "edit", "onToggleSettings"])], 32 19386 /* HYDRATE_EVENTS */ 19387 ); 19388 } 19389 19390 script$k.render = render$k; 19391 script$k.__file = "administrator/components/com_media/resources/scripts/components/browser/items/image.vue"; 19392 var script$j = { 19393 name: 'MediaBrowserItemVideo', 19394 // eslint-disable-next-line vue/require-prop-types 19395 props: ['item', 'focused'], 19396 emits: ['toggle-settings'], 19397 data: function data() { 19398 return { 19399 showActions: false 19400 }; 19401 }, 19402 methods: { 19403 /* Hide actions dropdown */ 19404 hideActions: function hideActions() { 19405 this.$refs.container.hideActions(); 19406 }, 19407 19408 /* Preview an item */ 19409 openPreview: function openPreview() { 19410 this.$refs.container.openPreview(); 19411 }, 19412 toggleSettings: function toggleSettings(bool) { 19413 this.$emit('toggle-settings', bool); 19414 } 19415 } 19416 }; 19417 19418 var _hoisted_1$j = /*#__PURE__*/createBaseVNode("div", { 19419 class: "media-browser-item-preview" 19420 }, [/*#__PURE__*/createBaseVNode("div", { 19421 class: "file-background" 19422 }, [/*#__PURE__*/createBaseVNode("div", { 19423 class: "file-icon" 19424 }, [/*#__PURE__*/createBaseVNode("span", { 19425 class: "fas fa-file-video" 19426 })])])], -1 19427 /* HOISTED */ 19428 ); 19429 19430 var _hoisted_2$b = { 19431 class: "media-browser-item-info" 19432 }; 19433 19434 function render$j(_ctx, _cache, $props, $setup, $data, $options) { 19435 var _component_media_browser_action_items_container = resolveComponent("media-browser-action-items-container"); 19436 19437 return openBlock(), createElementBlock("div", { 19438 class: "media-browser-image", 19439 onDblclick: _cache[0] || (_cache[0] = function ($event) { 19440 return $options.openPreview(); 19441 }), 19442 onMouseleave: _cache[1] || (_cache[1] = function ($event) { 19443 return $options.hideActions(); 19444 }) 19445 }, [_hoisted_1$j, createBaseVNode("div", _hoisted_2$b, toDisplayString($props.item.name) + " " + toDisplayString($props.item.filetype), 1 19446 /* TEXT */ 19447 ), createVNode(_component_media_browser_action_items_container, { 19448 ref: "container", 19449 item: $props.item, 19450 previewable: true, 19451 downloadable: true, 19452 shareable: true, 19453 onToggleSettings: $options.toggleSettings 19454 }, null, 8 19455 /* PROPS */ 19456 , ["item", "onToggleSettings"])], 32 19457 /* HYDRATE_EVENTS */ 19458 ); 19459 } 19460 19461 script$j.render = render$j; 19462 script$j.__file = "administrator/components/com_media/resources/scripts/components/browser/items/video.vue"; 19463 var script$i = { 19464 name: 'MediaBrowserItemAudio', 19465 // eslint-disable-next-line vue/require-prop-types 19466 props: ['item', 'focused'], 19467 emits: ['toggle-settings'], 19468 data: function data() { 19469 return { 19470 showActions: false 19471 }; 19472 }, 19473 methods: { 19474 /* Hide actions dropdown */ 19475 hideActions: function hideActions() { 19476 this.$refs.container.hideActions(); 19477 }, 19478 19479 /* Preview an item */ 19480 openPreview: function openPreview() { 19481 this.$refs.container.openPreview(); 19482 }, 19483 toggleSettings: function toggleSettings(bool) { 19484 this.$emit('toggle-settings', bool); 19485 } 19486 } 19487 }; 19488 19489 var _hoisted_1$i = /*#__PURE__*/createBaseVNode("div", { 19490 class: "media-browser-item-preview" 19491 }, [/*#__PURE__*/createBaseVNode("div", { 19492 class: "file-background" 19493 }, [/*#__PURE__*/createBaseVNode("div", { 19494 class: "file-icon" 19495 }, [/*#__PURE__*/createBaseVNode("span", { 19496 class: "fas fa-file-audio" 19497 })])])], -1 19498 /* HOISTED */ 19499 ); 19500 19501 var _hoisted_2$a = { 19502 class: "media-browser-item-info" 19503 }; 19504 19505 function render$i(_ctx, _cache, $props, $setup, $data, $options) { 19506 var _component_media_browser_action_items_container = resolveComponent("media-browser-action-items-container"); 19507 19508 return openBlock(), createElementBlock("div", { 19509 class: "media-browser-audio", 19510 tabindex: "0", 19511 onDblclick: _cache[0] || (_cache[0] = function ($event) { 19512 return $options.openPreview(); 19513 }), 19514 onMouseleave: _cache[1] || (_cache[1] = function ($event) { 19515 return $options.hideActions(); 19516 }), 19517 onKeyup: _cache[2] || (_cache[2] = withKeys(function ($event) { 19518 return $options.openPreview(); 19519 }, ["enter"])) 19520 }, [_hoisted_1$i, createBaseVNode("div", _hoisted_2$a, toDisplayString($props.item.name) + " " + toDisplayString($props.item.filetype), 1 19521 /* TEXT */ 19522 ), createVNode(_component_media_browser_action_items_container, { 19523 ref: "container", 19524 item: $props.item, 19525 previewable: true, 19526 downloadable: true, 19527 shareable: true, 19528 onToggleSettings: $options.toggleSettings 19529 }, null, 8 19530 /* PROPS */ 19531 , ["item", "onToggleSettings"])], 32 19532 /* HYDRATE_EVENTS */ 19533 ); 19534 } 19535 19536 script$i.render = render$i; 19537 script$i.__file = "administrator/components/com_media/resources/scripts/components/browser/items/audio.vue"; 19538 var script$h = { 19539 name: 'MediaBrowserItemDocument', 19540 // eslint-disable-next-line vue/require-prop-types 19541 props: ['item', 'focused'], 19542 emits: ['toggle-settings'], 19543 data: function data() { 19544 return { 19545 showActions: false 19546 }; 19547 }, 19548 methods: { 19549 /* Hide actions dropdown */ 19550 hideActions: function hideActions() { 19551 this.$refs.container.hideActions(); 19552 }, 19553 19554 /* Preview an item */ 19555 openPreview: function openPreview() { 19556 this.$refs.container.openPreview(); 19557 }, 19558 toggleSettings: function toggleSettings(bool) { 19559 this.$emit('toggle-settings', bool); 19560 } 19561 } 19562 }; 19563 19564 var _hoisted_1$h = /*#__PURE__*/createBaseVNode("div", { 19565 class: "media-browser-item-preview" 19566 }, [/*#__PURE__*/createBaseVNode("div", { 19567 class: "file-background" 19568 }, [/*#__PURE__*/createBaseVNode("div", { 19569 class: "file-icon" 19570 }, [/*#__PURE__*/createBaseVNode("span", { 19571 class: "fas fa-file-pdf" 19572 })])])], -1 19573 /* HOISTED */ 19574 ); 19575 19576 var _hoisted_2$9 = { 19577 class: "media-browser-item-info" 19578 }; 19579 var _hoisted_3$8 = ["aria-label", "title"]; 19580 19581 function render$h(_ctx, _cache, $props, $setup, $data, $options) { 19582 var _component_media_browser_action_items_container = resolveComponent("media-browser-action-items-container"); 19583 19584 return openBlock(), createElementBlock("div", { 19585 class: "media-browser-doc", 19586 onDblclick: _cache[0] || (_cache[0] = function ($event) { 19587 return $options.openPreview(); 19588 }), 19589 onMouseleave: _cache[1] || (_cache[1] = function ($event) { 19590 return $options.hideActions(); 19591 }) 19592 }, [_hoisted_1$h, createBaseVNode("div", _hoisted_2$9, toDisplayString($props.item.name) + " " + toDisplayString($props.item.filetype), 1 19593 /* TEXT */ 19594 ), createBaseVNode("span", { 19595 class: "media-browser-select", 19596 "aria-label": _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM'), 19597 title: _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM') 19598 }, null, 8 19599 /* PROPS */ 19600 , _hoisted_3$8), createVNode(_component_media_browser_action_items_container, { 19601 ref: "container", 19602 item: $props.item, 19603 previewable: true, 19604 downloadable: true, 19605 shareable: true, 19606 onToggleSettings: $options.toggleSettings 19607 }, null, 8 19608 /* PROPS */ 19609 , ["item", "onToggleSettings"])], 32 19610 /* HYDRATE_EVENTS */ 19611 ); 19612 } 19613 19614 script$h.render = render$h; 19615 script$h.__file = "administrator/components/com_media/resources/scripts/components/browser/items/document.vue"; 19616 var BrowserItem = { 19617 props: ['item'], 19618 data: function data() { 19619 return { 19620 hoverActive: false 19621 }; 19622 }, 19623 methods: { 19624 /** 19625 * Return the correct item type component 19626 */ 19627 itemType: function itemType() { 19628 // Render directory items 19629 if (this.item.type === 'dir') return script$m; // Render image items 19630 19631 if (this.item.extension && api.imagesExtensions.includes(this.item.extension.toLowerCase())) { 19632 return script$k; 19633 } // Render video items 19634 19635 19636 if (this.item.extension && api.videoExtensions.includes(this.item.extension.toLowerCase())) { 19637 return script$j; 19638 } // Render audio items 19639 19640 19641 if (this.item.extension && api.audioExtensions.includes(this.item.extension.toLowerCase())) { 19642 return script$i; 19643 } // Render document items 19644 19645 19646 if (this.item.extension && api.documentExtensions.includes(this.item.extension.toLowerCase())) { 19647 return script$h; 19648 } // Default to file type 19649 19650 19651 return script$l; 19652 }, 19653 19654 /** 19655 * Get the styles for the media browser item 19656 * @returns {{}} 19657 */ 19658 styles: function styles() { 19659 return { 19660 width: "calc(" + this.$store.state.gridSize + "% - 20px)" 19661 }; 19662 }, 19663 19664 /** 19665 * Whether or not the item is currently selected 19666 * @returns {boolean} 19667 */ 19668 isSelected: function isSelected() { 19669 var _this14 = this; 19670 19671 return this.$store.state.selectedItems.some(function (selected) { 19672 return selected.path === _this14.item.path; 19673 }); 19674 }, 19675 19676 /** 19677 * Whether or not the item is currently active (on hover or via tab) 19678 * @returns {boolean} 19679 */ 19680 isHoverActive: function isHoverActive() { 19681 return this.hoverActive; 19682 }, 19683 19684 /** 19685 * Turns on the hover class 19686 */ 19687 mouseover: function mouseover() { 19688 this.hoverActive = true; 19689 }, 19690 19691 /** 19692 * Turns off the hover class 19693 */ 19694 mouseleave: function mouseleave() { 19695 this.hoverActive = false; 19696 }, 19697 19698 /** 19699 * Handle the click event 19700 * @param event 19701 */ 19702 handleClick: function handleClick(event) { 19703 if (this.item.path && this.item.type === 'file') { 19704 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 19705 bubbles: true, 19706 cancelable: false, 19707 detail: { 19708 path: this.item.path, 19709 thumb: this.item.thumb, 19710 fileType: this.item.mime_type ? this.item.mime_type : false, 19711 extension: this.item.extension ? this.item.extension : false, 19712 width: this.item.width ? this.item.width : 0, 19713 height: this.item.height ? this.item.height : 0 19714 } 19715 })); 19716 } 19717 19718 if (this.item.type === 'dir') { 19719 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 19720 bubbles: true, 19721 cancelable: false, 19722 detail: {} 19723 })); 19724 } // Handle clicks when the item was not selected 19725 19726 19727 if (!this.isSelected()) { 19728 // Unselect all other selected items, 19729 // if the shift key was not pressed during the click event 19730 if (!(event.shiftKey || event.keyCode === 13)) { 19731 this.$store.commit(UNSELECT_ALL_BROWSER_ITEMS); 19732 } 19733 19734 this.$store.commit(SELECT_BROWSER_ITEM, this.item); 19735 return; 19736 } 19737 19738 this.$store.dispatch('toggleBrowserItemSelect', this.item); 19739 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 19740 bubbles: true, 19741 cancelable: false, 19742 detail: {} 19743 })); // If more than one item was selected and the user clicks again on the selected item, 19744 // he most probably wants to unselect all other items. 19745 19746 if (this.$store.state.selectedItems.length > 1) { 19747 this.$store.commit(UNSELECT_ALL_BROWSER_ITEMS); 19748 this.$store.commit(SELECT_BROWSER_ITEM, this.item); 19749 } 19750 }, 19751 19752 /** 19753 * Handle the when an element is focused in the child to display the layover for a11y 19754 * @param active 19755 */ 19756 toggleSettings: function toggleSettings(active) { 19757 // eslint-disable-next-line no-unused-expressions 19758 active ? this.mouseover() : this.mouseleave(); 19759 } 19760 }, 19761 render: function render() { 19762 return h('div', { 19763 class: { 19764 'media-browser-item': true, 19765 selected: this.isSelected(), 19766 active: this.isHoverActive() 19767 }, 19768 onClick: this.handleClick, 19769 onMouseover: this.mouseover, 19770 onMouseleave: this.mouseleave 19771 }, [h(this.itemType(), { 19772 item: this.item, 19773 onToggleSettings: this.toggleSettings 19774 })]); 19775 } 19776 }; 19777 var script$g = { 19778 name: 'MediaBrowserItemRow', 19779 mixins: [navigable], 19780 // eslint-disable-next-line vue/require-prop-types 19781 props: ['item'], 19782 computed: { 19783 /* The dimension of a file */ 19784 dimension: function dimension() { 19785 if (!this.item.width) { 19786 return ''; 19787 } 19788 19789 return this.item.width + "px * " + this.item.height + "px"; 19790 }, 19791 isDir: function isDir() { 19792 return this.item.type === 'dir'; 19793 }, 19794 19795 /* The size of a file in KB */ 19796 size: function size() { 19797 if (!this.item.size) { 19798 return ''; 19799 } 19800 19801 return (this.item.size / 1024).toFixed(2) + " KB"; 19802 }, 19803 selected: function selected() { 19804 return !!this.isSelected(); 19805 } 19806 }, 19807 methods: { 19808 /* Handle the on row double click event */ 19809 onDblClick: function onDblClick() { 19810 if (this.isDir) { 19811 this.navigateTo(this.item.path); 19812 return; 19813 } // @todo remove the hardcoded extensions here 19814 19815 19816 var extensionWithPreview = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'mp4', 'mp3', 'pdf']; // Show preview 19817 19818 if (this.item.extension && extensionWithPreview.includes(this.item.extension.toLowerCase())) { 19819 this.$store.commit(SHOW_PREVIEW_MODAL); 19820 this.$store.dispatch('getFullContents', this.item); 19821 } 19822 }, 19823 19824 /** 19825 * Whether or not the item is currently selected 19826 * @returns {boolean} 19827 */ 19828 isSelected: function isSelected() { 19829 var _this15 = this; 19830 19831 return this.$store.state.selectedItems.some(function (selected) { 19832 return selected.path === _this15.item.path; 19833 }); 19834 }, 19835 19836 /** 19837 * Handle the click event 19838 * @param event 19839 */ 19840 onClick: function onClick(event) { 19841 var path = false; 19842 var data = { 19843 path: path, 19844 thumb: false, 19845 fileType: this.item.mime_type ? this.item.mime_type : false, 19846 extension: this.item.extension ? this.item.extension : false 19847 }; 19848 19849 if (this.item.type === 'file') { 19850 data.path = this.item.path; 19851 data.thumb = this.item.thumb ? this.item.thumb : false; 19852 data.width = this.item.width ? this.item.width : 0; 19853 data.height = this.item.height ? this.item.height : 0; 19854 window.parent.document.dispatchEvent(new CustomEvent('onMediaFileSelected', { 19855 bubbles: true, 19856 cancelable: false, 19857 detail: data 19858 })); 19859 } // Handle clicks when the item was not selected 19860 19861 19862 if (!this.isSelected()) { 19863 // Unselect all other selected items, 19864 // if the shift key was not pressed during the click event 19865 if (!(event.shiftKey || event.keyCode === 13)) { 19866 this.$store.commit(UNSELECT_ALL_BROWSER_ITEMS); 19867 } 19868 19869 this.$store.commit(SELECT_BROWSER_ITEM, this.item); 19870 return; 19871 } // If more than one item was selected and the user clicks again on the selected item, 19872 // he most probably wants to unselect all other items. 19873 19874 19875 if (this.$store.state.selectedItems.length > 1) { 19876 this.$store.commit(UNSELECT_ALL_BROWSER_ITEMS); 19877 this.$store.commit(SELECT_BROWSER_ITEM, this.item); 19878 } 19879 } 19880 } 19881 }; 19882 var _hoisted_1$g = ["data-type"]; 19883 var _hoisted_2$8 = { 19884 scope: "row", 19885 class: "name" 19886 }; 19887 var _hoisted_3$7 = { 19888 class: "size" 19889 }; 19890 var _hoisted_4$6 = { 19891 class: "dimension" 19892 }; 19893 var _hoisted_5$6 = { 19894 class: "created" 19895 }; 19896 var _hoisted_6$4 = { 19897 class: "modified" 19898 }; 19899 19900 function render$g(_ctx, _cache, $props, $setup, $data, $options) { 19901 return openBlock(), createElementBlock("tr", { 19902 class: normalizeClass(["media-browser-item", { 19903 selected: $options.selected 19904 }]), 19905 onDblclick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 19906 return $options.onDblClick(); 19907 }, ["stop", "prevent"])), 19908 onClick: _cache[1] || (_cache[1] = function () { 19909 return $options.onClick && $options.onClick.apply($options, arguments); 19910 }) 19911 }, [createBaseVNode("td", { 19912 class: "type", 19913 "data-type": $props.item.extension 19914 }, null, 8 19915 /* PROPS */ 19916 , _hoisted_1$g), createBaseVNode("th", _hoisted_2$8, toDisplayString($props.item.name), 1 19917 /* TEXT */ 19918 ), createBaseVNode("td", _hoisted_3$7, toDisplayString($options.size), 1 19919 /* TEXT */ 19920 ), createBaseVNode("td", _hoisted_4$6, toDisplayString($options.dimension), 1 19921 /* TEXT */ 19922 ), createBaseVNode("td", _hoisted_5$6, toDisplayString($props.item.create_date_formatted), 1 19923 /* TEXT */ 19924 ), createBaseVNode("td", _hoisted_6$4, toDisplayString($props.item.modified_date_formatted), 1 19925 /* TEXT */ 19926 )], 34 19927 /* CLASS, HYDRATE_EVENTS */ 19928 ); 19929 } 19930 19931 script$g.render = render$g; 19932 script$g.__file = "administrator/components/com_media/resources/scripts/components/browser/items/row.vue"; 19933 var script$f = { 19934 name: 'MediaModal', 19935 props: { 19936 /* Whether or not the close button in the header should be shown */ 19937 showClose: { 19938 type: Boolean, 19939 default: true 19940 }, 19941 19942 /* The size of the modal */ 19943 // eslint-disable-next-line vue/require-default-prop 19944 size: { 19945 type: String 19946 }, 19947 labelElement: { 19948 type: String, 19949 required: true 19950 } 19951 }, 19952 emits: ['close'], 19953 computed: { 19954 /* Get the modal css class */ 19955 modalClass: function modalClass() { 19956 return { 19957 'modal-sm': this.size === 'sm' 19958 }; 19959 } 19960 }, 19961 mounted: function mounted() { 19962 // Listen to keydown events on the document 19963 document.addEventListener('keydown', this.onKeyDown); 19964 }, 19965 beforeUnmount: function beforeUnmount() { 19966 // Remove the keydown event listener 19967 document.removeEventListener('keydown', this.onKeyDown); 19968 }, 19969 methods: { 19970 /* Close the modal instance */ 19971 close: function close() { 19972 this.$emit('close'); 19973 }, 19974 19975 /* Handle keydown events */ 19976 onKeyDown: function onKeyDown(event) { 19977 if (event.keyCode === 27) { 19978 this.close(); 19979 } 19980 } 19981 } 19982 }; 19983 var _hoisted_1$f = ["aria-labelledby"]; 19984 var _hoisted_2$7 = { 19985 class: "modal-content" 19986 }; 19987 var _hoisted_3$6 = { 19988 class: "modal-header" 19989 }; 19990 var _hoisted_4$5 = { 19991 class: "modal-body" 19992 }; 19993 var _hoisted_5$5 = { 19994 class: "modal-footer" 19995 }; 19996 19997 function render$f(_ctx, _cache, $props, $setup, $data, $options) { 19998 var _component_tab_lock = resolveComponent("tab-lock"); 19999 20000 return openBlock(), createElementBlock("div", { 20001 class: "media-modal-backdrop", 20002 onClick: _cache[2] || (_cache[2] = function ($event) { 20003 return $options.close(); 20004 }) 20005 }, [createBaseVNode("div", { 20006 class: "modal", 20007 style: { 20008 "display": "flex" 20009 }, 20010 onClick: _cache[1] || (_cache[1] = withModifiers(function () {}, ["stop"])) 20011 }, [createVNode(_component_tab_lock, null, { 20012 default: withCtx(function () { 20013 return [createBaseVNode("div", { 20014 class: normalizeClass(["modal-dialog", $options.modalClass]), 20015 role: "dialog", 20016 "aria-labelledby": $props.labelElement 20017 }, [createBaseVNode("div", _hoisted_2$7, [createBaseVNode("div", _hoisted_3$6, [renderSlot(_ctx.$slots, "header"), renderSlot(_ctx.$slots, "backdrop-close"), $props.showClose ? (openBlock(), createElementBlock("button", { 20018 key: 0, 20019 type: "button", 20020 class: "btn-close", 20021 "aria-label": "Close", 20022 onClick: _cache[0] || (_cache[0] = function ($event) { 20023 return $options.close(); 20024 }) 20025 })) : createCommentVNode("v-if", true)]), createBaseVNode("div", _hoisted_4$5, [renderSlot(_ctx.$slots, "body")]), createBaseVNode("div", _hoisted_5$5, [renderSlot(_ctx.$slots, "footer")])])], 10 20026 /* CLASS, PROPS */ 20027 , _hoisted_1$f)]; 20028 }), 20029 _: 3 20030 /* FORWARDED */ 20031 20032 })])]); 20033 } 20034 20035 script$f.render = render$f; 20036 script$f.__file = "administrator/components/com_media/resources/scripts/components/modals/modal.vue"; 20037 var script$e = { 20038 name: 'MediaCreateFolderModal', 20039 data: function data() { 20040 return { 20041 folder: '' 20042 }; 20043 }, 20044 methods: { 20045 /* Check if the the form is valid */ 20046 isValid: function isValid() { 20047 return this.folder; 20048 }, 20049 20050 /* Close the modal instance */ 20051 close: function close() { 20052 this.reset(); 20053 this.$store.commit(HIDE_CREATE_FOLDER_MODAL); 20054 }, 20055 20056 /* Save the form and create the folder */ 20057 save: function save() { 20058 // Check if the form is valid 20059 if (!this.isValid()) { 20060 // @todo show an error message to user for insert a folder name 20061 // @todo mark the field as invalid 20062 return; 20063 } // Create the directory 20064 20065 20066 this.$store.dispatch('createDirectory', { 20067 name: this.folder, 20068 parent: this.$store.state.selectedDirectory 20069 }); 20070 this.reset(); 20071 }, 20072 20073 /* Reset the form */ 20074 reset: function reset() { 20075 this.folder = ''; 20076 } 20077 } 20078 }; 20079 var _hoisted_1$e = { 20080 id: "createFolderTitle", 20081 class: "modal-title" 20082 }; 20083 var _hoisted_2$6 = { 20084 class: "p-3" 20085 }; 20086 var _hoisted_3$5 = { 20087 class: "form-group" 20088 }; 20089 var _hoisted_4$4 = { 20090 for: "folder" 20091 }; 20092 var _hoisted_5$4 = ["disabled"]; 20093 20094 function render$e(_ctx, _cache, $props, $setup, $data, $options) { 20095 var _component_media_modal = resolveComponent("media-modal"); 20096 20097 return _ctx.$store.state.showCreateFolderModal ? (openBlock(), createBlock(_component_media_modal, { 20098 key: 0, 20099 size: 'md', 20100 "label-element": "createFolderTitle", 20101 onClose: _cache[5] || (_cache[5] = function ($event) { 20102 return $options.close(); 20103 }) 20104 }, { 20105 header: withCtx(function () { 20106 return [createBaseVNode("h3", _hoisted_1$e, toDisplayString(_ctx.translate('COM_MEDIA_CREATE_NEW_FOLDER')), 1 20107 /* TEXT */ 20108 )]; 20109 }), 20110 body: withCtx(function () { 20111 return [createBaseVNode("div", _hoisted_2$6, [createBaseVNode("form", { 20112 class: "form", 20113 novalidate: "", 20114 onSubmit: _cache[2] || (_cache[2] = withModifiers(function () { 20115 return $options.save && $options.save.apply($options, arguments); 20116 }, ["prevent"])) 20117 }, [createBaseVNode("div", _hoisted_3$5, [createBaseVNode("label", _hoisted_4$4, toDisplayString(_ctx.translate('COM_MEDIA_FOLDER_NAME')), 1 20118 /* TEXT */ 20119 ), withDirectives(createBaseVNode("input", { 20120 id: "folder", 20121 "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { 20122 return $data.folder = $event; 20123 }), 20124 class: "form-control", 20125 type: "text", 20126 required: "", 20127 autocomplete: "off", 20128 onInput: _cache[1] || (_cache[1] = function ($event) { 20129 return $data.folder = $event.target.value; 20130 }) 20131 }, null, 544 20132 /* HYDRATE_EVENTS, NEED_PATCH */ 20133 ), [[vModelText, $data.folder, void 0, { 20134 trim: true 20135 }]])])], 32 20136 /* HYDRATE_EVENTS */ 20137 )])]; 20138 }), 20139 footer: withCtx(function () { 20140 return [createBaseVNode("div", null, [createBaseVNode("button", { 20141 class: "btn btn-secondary", 20142 onClick: _cache[3] || (_cache[3] = function ($event) { 20143 return $options.close(); 20144 }) 20145 }, toDisplayString(_ctx.translate('JCANCEL')), 1 20146 /* TEXT */ 20147 ), createBaseVNode("button", { 20148 class: "btn btn-success", 20149 disabled: !$options.isValid(), 20150 onClick: _cache[4] || (_cache[4] = function ($event) { 20151 return $options.save(); 20152 }) 20153 }, toDisplayString(_ctx.translate('JACTION_CREATE')), 9 20154 /* TEXT, PROPS */ 20155 , _hoisted_5$4)])]; 20156 }), 20157 _: 1 20158 /* STABLE */ 20159 20160 })) : createCommentVNode("v-if", true); 20161 } 20162 20163 script$e.render = render$e; 20164 script$e.__file = "administrator/components/com_media/resources/scripts/components/modals/create-folder-modal.vue"; 20165 var script$d = { 20166 name: 'MediaPreviewModal', 20167 computed: { 20168 /* Get the item to show in the modal */ 20169 item: function item() { 20170 // Use the currently selected directory as a fallback 20171 return this.$store.state.previewItem; 20172 }, 20173 20174 /* Get the hashed URL */ 20175 getHashedURL: function getHashedURL() { 20176 if (this.item.adapter.startsWith('local-')) { 20177 return this.item.url + "?" + api.mediaVersion; 20178 } 20179 20180 return this.item.url; 20181 } 20182 }, 20183 methods: { 20184 /* Close the modal */ 20185 close: function close() { 20186 this.$store.commit(HIDE_PREVIEW_MODAL); 20187 }, 20188 isImage: function isImage() { 20189 return this.item.mime_type.indexOf('image/') === 0; 20190 }, 20191 isVideo: function isVideo() { 20192 return this.item.mime_type.indexOf('video/') === 0; 20193 }, 20194 isAudio: function isAudio() { 20195 return this.item.mime_type.indexOf('audio/') === 0; 20196 }, 20197 isDoc: function isDoc() { 20198 return this.item.mime_type.indexOf('application/') === 0; 20199 } 20200 } 20201 }; 20202 var _hoisted_1$d = { 20203 id: "previewTitle", 20204 class: "modal-title text-light" 20205 }; 20206 var _hoisted_2$5 = { 20207 class: "image-background" 20208 }; 20209 var _hoisted_3$4 = ["src"]; 20210 var _hoisted_4$3 = { 20211 key: 1, 20212 controls: "" 20213 }; 20214 var _hoisted_5$3 = ["src", "type"]; 20215 var _hoisted_6$3 = ["type", "data"]; 20216 var _hoisted_7$2 = ["src", "type"]; 20217 20218 var _hoisted_8$2 = /*#__PURE__*/createBaseVNode("span", { 20219 class: "icon-times" 20220 }, null, -1 20221 /* HOISTED */ 20222 ); 20223 20224 var _hoisted_9$2 = [_hoisted_8$2]; 20225 20226 function render$d(_ctx, _cache, $props, $setup, $data, $options) { 20227 var _component_media_modal = resolveComponent("media-modal"); 20228 20229 return _ctx.$store.state.showPreviewModal && $options.item ? (openBlock(), createBlock(_component_media_modal, { 20230 key: 0, 20231 size: 'md', 20232 class: "media-preview-modal", 20233 "label-element": "previewTitle", 20234 "show-close": false, 20235 onClose: _cache[1] || (_cache[1] = function ($event) { 20236 return $options.close(); 20237 }) 20238 }, { 20239 header: withCtx(function () { 20240 return [createBaseVNode("h3", _hoisted_1$d, toDisplayString($options.item.name), 1 20241 /* TEXT */ 20242 )]; 20243 }), 20244 body: withCtx(function () { 20245 return [createBaseVNode("div", _hoisted_2$5, [$options.isAudio() ? (openBlock(), createElementBlock("audio", { 20246 key: 0, 20247 controls: "", 20248 src: $options.item.url 20249 }, null, 8 20250 /* PROPS */ 20251 , _hoisted_3$4)) : createCommentVNode("v-if", true), $options.isVideo() ? (openBlock(), createElementBlock("video", _hoisted_4$3, [createBaseVNode("source", { 20252 src: $options.item.url, 20253 type: $options.item.mime_type 20254 }, null, 8 20255 /* PROPS */ 20256 , _hoisted_5$3)])) : createCommentVNode("v-if", true), $options.isDoc() ? (openBlock(), createElementBlock("object", { 20257 key: 2, 20258 type: $options.item.mime_type, 20259 data: $options.item.url, 20260 width: "800", 20261 height: "600" 20262 }, null, 8 20263 /* PROPS */ 20264 , _hoisted_6$3)) : createCommentVNode("v-if", true), $options.isImage() ? (openBlock(), createElementBlock("img", { 20265 key: 3, 20266 src: $options.getHashedURL, 20267 type: $options.item.mime_type 20268 }, null, 8 20269 /* PROPS */ 20270 , _hoisted_7$2)) : createCommentVNode("v-if", true)])]; 20271 }), 20272 "backdrop-close": withCtx(function () { 20273 return [createBaseVNode("button", { 20274 type: "button", 20275 class: "media-preview-close", 20276 onClick: _cache[0] || (_cache[0] = function ($event) { 20277 return $options.close(); 20278 }) 20279 }, _hoisted_9$2)]; 20280 }), 20281 _: 1 20282 /* STABLE */ 20283 20284 })) : createCommentVNode("v-if", true); 20285 } 20286 20287 script$d.render = render$d; 20288 script$d.__file = "administrator/components/com_media/resources/scripts/components/modals/preview-modal.vue"; 20289 var script$c = { 20290 name: 'MediaRenameModal', 20291 computed: { 20292 item: function item() { 20293 return this.$store.state.selectedItems[this.$store.state.selectedItems.length - 1]; 20294 }, 20295 name: function name() { 20296 return this.item.name.replace("." + this.item.extension, ''); 20297 }, 20298 extension: function extension() { 20299 return this.item.extension; 20300 } 20301 }, 20302 updated: function updated() { 20303 var _this16 = this; 20304 20305 this.$nextTick(function () { 20306 return _this16.$refs.nameField ? _this16.$refs.nameField.focus() : null; 20307 }); 20308 }, 20309 methods: { 20310 /* Check if the form is valid */ 20311 isValid: function isValid() { 20312 return this.item.name.length > 0; 20313 }, 20314 20315 /* Close the modal instance */ 20316 close: function close() { 20317 this.$store.commit(HIDE_RENAME_MODAL); 20318 }, 20319 20320 /* Save the form and create the folder */ 20321 save: function save() { 20322 // Check if the form is valid 20323 if (!this.isValid()) { 20324 // @todo mark the field as invalid 20325 return; 20326 } 20327 20328 var newName = this.$refs.nameField.value; 20329 20330 if (this.extension.length) { 20331 newName += "." + this.item.extension; 20332 } 20333 20334 var newPath = this.item.directory; 20335 20336 if (newPath.substr(-1) !== '/') { 20337 newPath += '/'; 20338 } // Rename the item 20339 20340 20341 this.$store.dispatch('renameItem', { 20342 item: this.item, 20343 newPath: newPath + newName, 20344 newName: newName 20345 }); 20346 } 20347 } 20348 }; 20349 var _hoisted_1$c = { 20350 id: "renameTitle", 20351 class: "modal-title" 20352 }; 20353 var _hoisted_2$4 = { 20354 class: "form-group p-3" 20355 }; 20356 var _hoisted_3$3 = { 20357 for: "name" 20358 }; 20359 var _hoisted_4$2 = ["placeholder", "value"]; 20360 var _hoisted_5$2 = { 20361 key: 0, 20362 class: "input-group-text" 20363 }; 20364 var _hoisted_6$2 = ["disabled"]; 20365 20366 function render$c(_ctx, _cache, $props, $setup, $data, $options) { 20367 var _component_media_modal = resolveComponent("media-modal"); 20368 20369 return _ctx.$store.state.showRenameModal ? (openBlock(), createBlock(_component_media_modal, { 20370 key: 0, 20371 size: 'sm', 20372 "show-close": false, 20373 "label-element": "renameTitle", 20374 onClose: _cache[5] || (_cache[5] = function ($event) { 20375 return $options.close(); 20376 }) 20377 }, { 20378 header: withCtx(function () { 20379 return [createBaseVNode("h3", _hoisted_1$c, toDisplayString(_ctx.translate('COM_MEDIA_RENAME')), 1 20380 /* TEXT */ 20381 )]; 20382 }), 20383 body: withCtx(function () { 20384 return [createBaseVNode("div", null, [createBaseVNode("form", { 20385 class: "form", 20386 novalidate: "", 20387 onSubmit: _cache[0] || (_cache[0] = withModifiers(function () { 20388 return $options.save && $options.save.apply($options, arguments); 20389 }, ["prevent"])) 20390 }, [createBaseVNode("div", _hoisted_2$4, [createBaseVNode("label", _hoisted_3$3, toDisplayString(_ctx.translate('COM_MEDIA_NAME')), 1 20391 /* TEXT */ 20392 ), createBaseVNode("div", { 20393 class: normalizeClass({ 20394 'input-group': $options.extension.length 20395 }) 20396 }, [createBaseVNode("input", { 20397 id: "name", 20398 ref: "nameField", 20399 class: "form-control", 20400 type: "text", 20401 placeholder: _ctx.translate('COM_MEDIA_NAME'), 20402 value: $options.name, 20403 required: "", 20404 autocomplete: "off" 20405 }, null, 8 20406 /* PROPS */ 20407 , _hoisted_4$2), $options.extension.length ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString($options.extension), 1 20408 /* TEXT */ 20409 )) : createCommentVNode("v-if", true)], 2 20410 /* CLASS */ 20411 )])], 32 20412 /* HYDRATE_EVENTS */ 20413 )])]; 20414 }), 20415 footer: withCtx(function () { 20416 return [createBaseVNode("div", null, [createBaseVNode("button", { 20417 type: "button", 20418 class: "btn btn-secondary", 20419 onClick: _cache[1] || (_cache[1] = function ($event) { 20420 return $options.close(); 20421 }), 20422 onKeyup: _cache[2] || (_cache[2] = withKeys(function ($event) { 20423 return $options.close(); 20424 }, ["enter"])) 20425 }, toDisplayString(_ctx.translate('JCANCEL')), 33 20426 /* TEXT, HYDRATE_EVENTS */ 20427 ), createBaseVNode("button", { 20428 type: "button", 20429 class: "btn btn-success", 20430 disabled: !$options.isValid(), 20431 onClick: _cache[3] || (_cache[3] = function ($event) { 20432 return $options.save(); 20433 }), 20434 onKeyup: _cache[4] || (_cache[4] = withKeys(function ($event) { 20435 return $options.save(); 20436 }, ["enter"])) 20437 }, toDisplayString(_ctx.translate('JAPPLY')), 41 20438 /* TEXT, PROPS, HYDRATE_EVENTS */ 20439 , _hoisted_6$2)])]; 20440 }), 20441 _: 1 20442 /* STABLE */ 20443 20444 })) : createCommentVNode("v-if", true); 20445 } 20446 20447 script$c.render = render$c; 20448 script$c.__file = "administrator/components/com_media/resources/scripts/components/modals/rename-modal.vue"; 20449 var script$b = { 20450 name: 'MediaShareModal', 20451 computed: { 20452 item: function item() { 20453 return this.$store.state.selectedItems[this.$store.state.selectedItems.length - 1]; 20454 }, 20455 url: function url() { 20456 return this.$store.state.previewItem && Object.prototype.hasOwnProperty.call(this.$store.state.previewItem, 'url') ? this.$store.state.previewItem.url : null; 20457 } 20458 }, 20459 methods: { 20460 /* Close the modal instance and reset the form */ 20461 close: function close() { 20462 this.$store.commit(HIDE_SHARE_MODAL); 20463 this.$store.commit(LOAD_FULL_CONTENTS_SUCCESS, null); 20464 }, 20465 // Generate the url from backend 20466 generateUrl: function generateUrl() { 20467 this.$store.dispatch('getFullContents', this.item); 20468 }, 20469 // Copy to clipboard 20470 copyToClipboard: function copyToClipboard() { 20471 this.$refs.urlText.focus(); 20472 this.$refs.urlText.select(); 20473 20474 try { 20475 document.execCommand('copy'); 20476 } catch (err) { 20477 // @todo Error handling in joomla way 20478 // eslint-disable-next-line no-undef 20479 alert(translate('COM_MEDIA_SHARE_COPY_FAILED_ERROR')); 20480 } 20481 } 20482 } 20483 }; 20484 var _hoisted_1$b = { 20485 id: "shareTitle", 20486 class: "modal-title" 20487 }; 20488 var _hoisted_2$3 = { 20489 class: "p-3" 20490 }; 20491 var _hoisted_3$2 = { 20492 class: "desc" 20493 }; 20494 var _hoisted_4$1 = { 20495 key: 0, 20496 class: "control" 20497 }; 20498 var _hoisted_5$1 = { 20499 key: 1, 20500 class: "control" 20501 }; 20502 var _hoisted_6$1 = { 20503 class: "input-group" 20504 }; 20505 var _hoisted_7$1 = ["title"]; 20506 20507 var _hoisted_8$1 = /*#__PURE__*/createBaseVNode("span", { 20508 class: "icon-clipboard", 20509 "aria-hidden": "true" 20510 }, null, -1 20511 /* HOISTED */ 20512 ); 20513 20514 var _hoisted_9$1 = [_hoisted_8$1]; 20515 20516 function render$b(_ctx, _cache, $props, $setup, $data, $options) { 20517 var _component_media_modal = resolveComponent("media-modal"); 20518 20519 return _ctx.$store.state.showShareModal ? (openBlock(), createBlock(_component_media_modal, { 20520 key: 0, 20521 size: 'md', 20522 "show-close": false, 20523 "label-element": "shareTitle", 20524 onClose: _cache[4] || (_cache[4] = function ($event) { 20525 return $options.close(); 20526 }) 20527 }, { 20528 header: withCtx(function () { 20529 return [createBaseVNode("h3", _hoisted_1$b, toDisplayString(_ctx.translate('COM_MEDIA_SHARE')), 1 20530 /* TEXT */ 20531 )]; 20532 }), 20533 body: withCtx(function () { 20534 return [createBaseVNode("div", _hoisted_2$3, [createBaseVNode("div", _hoisted_3$2, [createTextVNode(toDisplayString(_ctx.translate('COM_MEDIA_SHARE_DESC')) + " ", 1 20535 /* TEXT */ 20536 ), !$options.url ? (openBlock(), createElementBlock("div", _hoisted_4$1, [createBaseVNode("button", { 20537 class: "btn btn-success w-100", 20538 type: "button", 20539 onClick: _cache[0] || (_cache[0] = function () { 20540 return $options.generateUrl && $options.generateUrl.apply($options, arguments); 20541 }) 20542 }, toDisplayString(_ctx.translate('COM_MEDIA_ACTION_SHARE')), 1 20543 /* TEXT */ 20544 )])) : (openBlock(), createElementBlock("div", _hoisted_5$1, [createBaseVNode("span", _hoisted_6$1, [withDirectives(createBaseVNode("input", { 20545 id: "url", 20546 ref: "urlText", 20547 "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { 20548 return $options.url = $event; 20549 }), 20550 readonly: "", 20551 type: "url", 20552 class: "form-control input-xxlarge", 20553 placeholder: "URL", 20554 autocomplete: "off" 20555 }, null, 512 20556 /* NEED_PATCH */ 20557 ), [[vModelText, $options.url]]), createBaseVNode("button", { 20558 class: "btn btn-secondary", 20559 type: "button", 20560 title: _ctx.translate('COM_MEDIA_SHARE_COPY'), 20561 onClick: _cache[2] || (_cache[2] = function () { 20562 return $options.copyToClipboard && $options.copyToClipboard.apply($options, arguments); 20563 }) 20564 }, _hoisted_9$1, 8 20565 /* PROPS */ 20566 , _hoisted_7$1)])]))])])]; 20567 }), 20568 footer: withCtx(function () { 20569 return [createBaseVNode("div", null, [createBaseVNode("button", { 20570 class: "btn btn-secondary", 20571 onClick: _cache[3] || (_cache[3] = function ($event) { 20572 return $options.close(); 20573 }) 20574 }, toDisplayString(_ctx.translate('JCANCEL')), 1 20575 /* TEXT */ 20576 )])]; 20577 }), 20578 _: 1 20579 /* STABLE */ 20580 20581 })) : createCommentVNode("v-if", true); 20582 } 20583 20584 script$b.render = render$b; 20585 script$b.__file = "administrator/components/com_media/resources/scripts/components/modals/share-modal.vue"; 20586 var script$a = { 20587 name: 'MediaShareModal', 20588 computed: { 20589 item: function item() { 20590 return this.$store.state.selectedItems[this.$store.state.selectedItems.length - 1]; 20591 } 20592 }, 20593 methods: { 20594 /* Delete Item */ 20595 deleteItem: function deleteItem() { 20596 this.$store.dispatch('deleteSelectedItems'); 20597 this.$store.commit(HIDE_CONFIRM_DELETE_MODAL); 20598 }, 20599 20600 /* Close the modal instance */ 20601 close: function close() { 20602 this.$store.commit(HIDE_CONFIRM_DELETE_MODAL); 20603 } 20604 } 20605 }; 20606 var _hoisted_1$a = { 20607 id: "confirmDeleteTitle", 20608 class: "modal-title" 20609 }; 20610 var _hoisted_2$2 = { 20611 class: "p-3" 20612 }; 20613 var _hoisted_3$1 = { 20614 class: "desc" 20615 }; 20616 20617 function render$a(_ctx, _cache, $props, $setup, $data, $options) { 20618 var _component_media_modal = resolveComponent("media-modal"); 20619 20620 return _ctx.$store.state.showConfirmDeleteModal ? (openBlock(), createBlock(_component_media_modal, { 20621 key: 0, 20622 size: 'md', 20623 "show-close": false, 20624 "label-element": "confirmDeleteTitle", 20625 onClose: _cache[2] || (_cache[2] = function ($event) { 20626 return $options.close(); 20627 }) 20628 }, { 20629 header: withCtx(function () { 20630 return [createBaseVNode("h3", _hoisted_1$a, toDisplayString(_ctx.translate('COM_MEDIA_CONFIRM_DELETE_MODAL_HEADING')), 1 20631 /* TEXT */ 20632 )]; 20633 }), 20634 body: withCtx(function () { 20635 return [createBaseVNode("div", _hoisted_2$2, [createBaseVNode("div", _hoisted_3$1, toDisplayString(_ctx.translate('JGLOBAL_CONFIRM_DELETE')), 1 20636 /* TEXT */ 20637 )])]; 20638 }), 20639 footer: withCtx(function () { 20640 return [createBaseVNode("div", null, [createBaseVNode("button", { 20641 class: "btn btn-success", 20642 onClick: _cache[0] || (_cache[0] = function ($event) { 20643 return $options.close(); 20644 }) 20645 }, toDisplayString(_ctx.translate('JCANCEL')), 1 20646 /* TEXT */ 20647 ), createBaseVNode("button", { 20648 id: "media-delete-item", 20649 class: "btn btn-danger", 20650 onClick: _cache[1] || (_cache[1] = function ($event) { 20651 return $options.deleteItem(); 20652 }) 20653 }, toDisplayString(_ctx.translate('COM_MEDIA_CONFIRM_DELETE_MODAL')), 1 20654 /* TEXT */ 20655 )])]; 20656 }), 20657 _: 1 20658 /* STABLE */ 20659 20660 })) : createCommentVNode("v-if", true); 20661 } 20662 20663 script$a.render = render$a; 20664 script$a.__file = "administrator/components/com_media/resources/scripts/components/modals/confirm-delete-modal.vue"; 20665 var script$9 = { 20666 name: 'MediaInfobar', 20667 computed: { 20668 /* Get the item to show in the infobar */ 20669 item: function item() { 20670 // Check if there are selected items 20671 var selectedItems = this.$store.state.selectedItems; // If there is only one selected item, show that one. 20672 20673 if (selectedItems.length === 1) { 20674 return selectedItems[0]; 20675 } // If there are more selected items, use the last one 20676 20677 20678 if (selectedItems.length > 1) { 20679 return selectedItems.slice(-1)[0]; 20680 } // Use the currently selected directory as a fallback 20681 20682 20683 return this.$store.getters.getSelectedDirectory; 20684 }, 20685 20686 /* Show/Hide the InfoBar */ 20687 showInfoBar: function showInfoBar() { 20688 return this.$store.state.showInfoBar; 20689 } 20690 }, 20691 methods: { 20692 hideInfoBar: function hideInfoBar() { 20693 this.$store.commit(HIDE_INFOBAR); 20694 } 20695 } 20696 }; 20697 var _hoisted_1$9 = { 20698 key: 0, 20699 class: "media-infobar" 20700 }; 20701 var _hoisted_2$1 = { 20702 key: 0, 20703 class: "text-center" 20704 }; 20705 20706 var _hoisted_3 = /*#__PURE__*/createBaseVNode("span", { 20707 class: "icon-file placeholder-icon" 20708 }, null, -1 20709 /* HOISTED */ 20710 ); 20711 20712 var _hoisted_4 = /*#__PURE__*/createTextVNode(" Select file or folder to view its details. "); 20713 20714 var _hoisted_5 = [_hoisted_3, _hoisted_4]; 20715 var _hoisted_6 = { 20716 key: 1 20717 }; 20718 var _hoisted_7 = { 20719 key: 0 20720 }; 20721 var _hoisted_8 = { 20722 key: 1 20723 }; 20724 var _hoisted_9 = { 20725 key: 2 20726 }; 20727 var _hoisted_10 = { 20728 key: 3 20729 }; 20730 var _hoisted_11 = { 20731 key: 4 20732 }; 20733 var _hoisted_12 = { 20734 key: 5 20735 }; 20736 var _hoisted_13 = { 20737 key: 6 20738 }; 20739 20740 function render$9(_ctx, _cache, $props, $setup, $data, $options) { 20741 return openBlock(), createBlock(Transition, { 20742 name: "infobar" 20743 }, { 20744 default: withCtx(function () { 20745 return [$options.showInfoBar && $options.item ? (openBlock(), createElementBlock("div", _hoisted_1$9, [createBaseVNode("span", { 20746 class: "infobar-close", 20747 onClick: _cache[0] || (_cache[0] = function ($event) { 20748 return $options.hideInfoBar(); 20749 }) 20750 }, "×"), createBaseVNode("h2", null, toDisplayString($options.item.name), 1 20751 /* TEXT */ 20752 ), $options.item.path === '/' ? (openBlock(), createElementBlock("div", _hoisted_2$1, _hoisted_5)) : (openBlock(), createElementBlock("dl", _hoisted_6, [createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_FOLDER')), 1 20753 /* TEXT */ 20754 ), createBaseVNode("dd", null, toDisplayString($options.item.directory), 1 20755 /* TEXT */ 20756 ), createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_TYPE')), 1 20757 /* TEXT */ 20758 ), $options.item.type === 'file' ? (openBlock(), createElementBlock("dd", _hoisted_7, toDisplayString(_ctx.translate('COM_MEDIA_FILE')), 1 20759 /* TEXT */ 20760 )) : $options.item.type === 'dir' ? (openBlock(), createElementBlock("dd", _hoisted_8, toDisplayString(_ctx.translate('COM_MEDIA_FOLDER')), 1 20761 /* TEXT */ 20762 )) : (openBlock(), createElementBlock("dd", _hoisted_9, " - ")), createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_DATE_CREATED')), 1 20763 /* TEXT */ 20764 ), createBaseVNode("dd", null, toDisplayString($options.item.create_date_formatted), 1 20765 /* TEXT */ 20766 ), createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_DATE_MODIFIED')), 1 20767 /* TEXT */ 20768 ), createBaseVNode("dd", null, toDisplayString($options.item.modified_date_formatted), 1 20769 /* TEXT */ 20770 ), createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_DIMENSION')), 1 20771 /* TEXT */ 20772 ), $options.item.width || $options.item.height ? (openBlock(), createElementBlock("dd", _hoisted_10, toDisplayString($options.item.width) + "px * " + toDisplayString($options.item.height) + "px ", 1 20773 /* TEXT */ 20774 )) : (openBlock(), createElementBlock("dd", _hoisted_11, " - ")), createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_SIZE')), 1 20775 /* TEXT */ 20776 ), $options.item.size ? (openBlock(), createElementBlock("dd", _hoisted_12, toDisplayString(($options.item.size / 1024).toFixed(2)) + " KB ", 1 20777 /* TEXT */ 20778 )) : (openBlock(), createElementBlock("dd", _hoisted_13, " - ")), createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_MIME_TYPE')), 1 20779 /* TEXT */ 20780 ), createBaseVNode("dd", null, toDisplayString($options.item.mime_type), 1 20781 /* TEXT */ 20782 ), createBaseVNode("dt", null, toDisplayString(_ctx.translate('COM_MEDIA_MEDIA_EXTENSION')), 1 20783 /* TEXT */ 20784 ), createBaseVNode("dd", null, toDisplayString($options.item.extension || '-'), 1 20785 /* TEXT */ 20786 )]))])) : createCommentVNode("v-if", true)]; 20787 }), 20788 _: 1 20789 /* STABLE */ 20790 20791 }); 20792 } 20793 20794 script$9.render = render$9; 20795 script$9.__file = "administrator/components/com_media/resources/scripts/components/infobar/infobar.vue"; 20796 var script$8 = { 20797 name: 'MediaUpload', 20798 props: { 20799 // eslint-disable-next-line vue/require-default-prop 20800 accept: { 20801 type: String 20802 }, 20803 // eslint-disable-next-line vue/require-prop-types 20804 extensions: { 20805 default: function _default() { 20806 return []; 20807 } 20808 }, 20809 name: { 20810 type: String, 20811 default: 'file' 20812 }, 20813 multiple: { 20814 type: Boolean, 20815 default: true 20816 } 20817 }, 20818 created: function created() { 20819 var _this17 = this; 20820 20821 // Listen to the toolbar upload click event 20822 MediaManager.Event.listen('onClickUpload', function () { 20823 return _this17.chooseFiles(); 20824 }); 20825 }, 20826 methods: { 20827 /* Open the choose-file dialog */ 20828 chooseFiles: function chooseFiles() { 20829 this.$refs.fileInput.click(); 20830 }, 20831 20832 /* Upload files */ 20833 upload: function upload(e) { 20834 var _this18 = this; 20835 20836 e.preventDefault(); 20837 var files = e.target.files; // Loop through array of files and upload each file 20838 20839 Array.from(files).forEach(function (file) { 20840 // Create a new file reader instance 20841 var reader = new FileReader(); // Add the on load callback 20842 20843 reader.onload = function (progressEvent) { 20844 var result = progressEvent.target.result; 20845 var splitIndex = result.indexOf('base64') + 7; 20846 var content = result.slice(splitIndex, result.length); // Upload the file 20847 20848 _this18.$store.dispatch('uploadFile', { 20849 name: file.name, 20850 parent: _this18.$store.state.selectedDirectory, 20851 content: content 20852 }); 20853 }; 20854 20855 reader.readAsDataURL(file); 20856 }); 20857 } 20858 } 20859 }; 20860 var _hoisted_1$8 = ["name", "multiple", "accept"]; 20861 20862 function render$8(_ctx, _cache, $props, $setup, $data, $options) { 20863 return openBlock(), createElementBlock("input", { 20864 ref: "fileInput", 20865 type: "file", 20866 class: "hidden", 20867 name: $props.name, 20868 multiple: $props.multiple, 20869 accept: $props.accept, 20870 onChange: _cache[0] || (_cache[0] = function () { 20871 return $options.upload && $options.upload.apply($options, arguments); 20872 }) 20873 }, null, 40 20874 /* PROPS, HYDRATE_EVENTS */ 20875 , _hoisted_1$8); 20876 } 20877 20878 script$8.render = render$8; 20879 script$8.__file = "administrator/components/com_media/resources/scripts/components/upload/upload.vue"; 20880 /** 20881 * Translate plugin 20882 */ 20883 20884 var Translate = { 20885 // Translate from Joomla text 20886 translate: function translate(key) { 20887 return Joomla.Text._(key, key); 20888 }, 20889 sprintf: function sprintf(string) { 20890 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 20891 args[_key - 1] = arguments[_key]; 20892 } // eslint-disable-next-line no-param-reassign 20893 20894 20895 string = Translate.translate(string); 20896 var i = 0; 20897 return string.replace(/%((%)|s|d)/g, function (m) { 20898 var val = args[i]; 20899 20900 if (m === '%d') { 20901 val = parseFloat(val); // eslint-disable-next-line no-restricted-globals 20902 20903 if (isNaN(val)) { 20904 val = 0; 20905 } 20906 } // eslint-disable-next-line no-plusplus 20907 20908 20909 i++; 20910 return val; 20911 }); 20912 }, 20913 install: function install(Vue) { 20914 return Vue.mixin({ 20915 methods: { 20916 translate: function translate(key) { 20917 return Translate.translate(key); 20918 }, 20919 sprintf: function sprintf(key) { 20920 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 20921 args[_key2 - 1] = arguments[_key2]; 20922 } 20923 20924 return Translate.sprintf(key, args); 20925 } 20926 } 20927 }); 20928 } 20929 }; 20930 20931 function getDevtoolsGlobalHook() { 20932 return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; 20933 } 20934 20935 function getTarget() { 20936 // @ts-ignore 20937 return typeof navigator !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : {}; 20938 } 20939 20940 var HOOK_SETUP = 'devtools-plugin:setup'; 20941 20942 function setupDevtoolsPlugin(pluginDescriptor, setupFn) { 20943 var hook = getDevtoolsGlobalHook(); 20944 20945 if (hook) { 20946 hook.emit(HOOK_SETUP, pluginDescriptor, setupFn); 20947 } else { 20948 var target = getTarget(); 20949 var list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; 20950 list.push({ 20951 pluginDescriptor: pluginDescriptor, 20952 setupFn: setupFn 20953 }); 20954 } 20955 } 20956 /*! 20957 * vuex v4.0.2 20958 * (c) 2021 Evan You 20959 * @license MIT 20960 */ 20961 20962 20963 var storeKey = 'store'; 20964 /** 20965 * forEach for object 20966 */ 20967 20968 function forEachValue(obj, fn) { 20969 Object.keys(obj).forEach(function (key) { 20970 return fn(obj[key], key); 20971 }); 20972 } 20973 20974 function isObject(obj) { 20975 return obj !== null && typeof obj === 'object'; 20976 } 20977 20978 function isPromise(val) { 20979 return val && typeof val.then === 'function'; 20980 } 20981 20982 function partial(fn, arg) { 20983 return function () { 20984 return fn(arg); 20985 }; 20986 } 20987 20988 function genericSubscribe(fn, subs, options) { 20989 if (subs.indexOf(fn) < 0) { 20990 options && options.prepend ? subs.unshift(fn) : subs.push(fn); 20991 } 20992 20993 return function () { 20994 var i = subs.indexOf(fn); 20995 20996 if (i > -1) { 20997 subs.splice(i, 1); 20998 } 20999 }; 21000 } 21001 21002 function resetStore(store, hot) { 21003 store._actions = Object.create(null); 21004 store._mutations = Object.create(null); 21005 store._wrappedGetters = Object.create(null); 21006 store._modulesNamespaceMap = Object.create(null); 21007 var state = store.state; // init all modules 21008 21009 installModule(store, state, [], store._modules.root, true); // reset state 21010 21011 resetStoreState(store, state, hot); 21012 } 21013 21014 function resetStoreState(store, state, hot) { 21015 var oldState = store._state; // bind store public getters 21016 21017 store.getters = {}; // reset local getters cache 21018 21019 store._makeLocalGettersCache = Object.create(null); 21020 var wrappedGetters = store._wrappedGetters; 21021 var computedObj = {}; 21022 forEachValue(wrappedGetters, function (fn, key) { 21023 // use computed to leverage its lazy-caching mechanism 21024 // direct inline function use will lead to closure preserving oldState. 21025 // using partial to return function with only arguments preserved in closure environment. 21026 computedObj[key] = partial(fn, store); 21027 Object.defineProperty(store.getters, key, { 21028 // TODO: use `computed` when it's possible. at the moment we can't due to 21029 // https://github.com/vuejs/vuex/pull/1883 21030 get: function get() { 21031 return computedObj[key](); 21032 }, 21033 enumerable: true // for local getters 21034 21035 }); 21036 }); 21037 store._state = reactive({ 21038 data: state 21039 }); // enable strict mode for new state 21040 21041 if (store.strict) { 21042 enableStrictMode(store); 21043 } 21044 21045 if (oldState) { 21046 if (hot) { 21047 // dispatch changes in all subscribed watchers 21048 // to force getter re-evaluation for hot reloading. 21049 store._withCommit(function () { 21050 oldState.data = null; 21051 }); 21052 } 21053 } 21054 } 21055 21056 function installModule(store, rootState, path, module, hot) { 21057 var isRoot = !path.length; 21058 21059 var namespace = store._modules.getNamespace(path); // register in namespace map 21060 21061 21062 if (module.namespaced) { 21063 if (store._modulesNamespaceMap[namespace] && "production" !== 'production') { 21064 console.error("[vuex] duplicate namespace " + namespace + " for the namespaced module " + path.join('/')); 21065 } 21066 21067 store._modulesNamespaceMap[namespace] = module; 21068 } // set state 21069 21070 21071 if (!isRoot && !hot) { 21072 var parentState = getNestedState(rootState, path.slice(0, -1)); 21073 var moduleName = path[path.length - 1]; 21074 21075 store._withCommit(function () { 21076 parentState[moduleName] = module.state; 21077 }); 21078 } 21079 21080 var local = module.context = makeLocalContext(store, namespace, path); 21081 module.forEachMutation(function (mutation, key) { 21082 var namespacedType = namespace + key; 21083 registerMutation(store, namespacedType, mutation, local); 21084 }); 21085 module.forEachAction(function (action, key) { 21086 var type = action.root ? key : namespace + key; 21087 var handler = action.handler || action; 21088 registerAction(store, type, handler, local); 21089 }); 21090 module.forEachGetter(function (getter, key) { 21091 var namespacedType = namespace + key; 21092 registerGetter(store, namespacedType, getter, local); 21093 }); 21094 module.forEachChild(function (child, key) { 21095 installModule(store, rootState, path.concat(key), child, hot); 21096 }); 21097 } 21098 /** 21099 * make localized dispatch, commit, getters and state 21100 * if there is no namespace, just use root ones 21101 */ 21102 21103 21104 function makeLocalContext(store, namespace, path) { 21105 var noNamespace = namespace === ''; 21106 var local = { 21107 dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) { 21108 var args = unifyObjectStyle(_type, _payload, _options); 21109 var payload = args.payload; 21110 var options = args.options; 21111 var type = args.type; 21112 21113 if (!options || !options.root) { 21114 type = namespace + type; 21115 } 21116 21117 return store.dispatch(type, payload); 21118 }, 21119 commit: noNamespace ? store.commit : function (_type, _payload, _options) { 21120 var args = unifyObjectStyle(_type, _payload, _options); 21121 var payload = args.payload; 21122 var options = args.options; 21123 var type = args.type; 21124 21125 if (!options || !options.root) { 21126 type = namespace + type; 21127 } 21128 21129 store.commit(type, payload, options); 21130 } 21131 }; // getters and state object must be gotten lazily 21132 // because they will be changed by state update 21133 21134 Object.defineProperties(local, { 21135 getters: { 21136 get: noNamespace ? function () { 21137 return store.getters; 21138 } : function () { 21139 return makeLocalGetters(store, namespace); 21140 } 21141 }, 21142 state: { 21143 get: function get() { 21144 return getNestedState(store.state, path); 21145 } 21146 } 21147 }); 21148 return local; 21149 } 21150 21151 function makeLocalGetters(store, namespace) { 21152 if (!store._makeLocalGettersCache[namespace]) { 21153 var gettersProxy = {}; 21154 var splitPos = namespace.length; 21155 Object.keys(store.getters).forEach(function (type) { 21156 // skip if the target getter is not match this namespace 21157 if (type.slice(0, splitPos) !== namespace) { 21158 return; 21159 } // extract local getter type 21160 21161 21162 var localType = type.slice(splitPos); // Add a port to the getters proxy. 21163 // Define as getter property because 21164 // we do not want to evaluate the getters in this time. 21165 21166 Object.defineProperty(gettersProxy, localType, { 21167 get: function get() { 21168 return store.getters[type]; 21169 }, 21170 enumerable: true 21171 }); 21172 }); 21173 store._makeLocalGettersCache[namespace] = gettersProxy; 21174 } 21175 21176 return store._makeLocalGettersCache[namespace]; 21177 } 21178 21179 function registerMutation(store, type, handler, local) { 21180 var entry = store._mutations[type] || (store._mutations[type] = []); 21181 entry.push(function wrappedMutationHandler(payload) { 21182 handler.call(store, local.state, payload); 21183 }); 21184 } 21185 21186 function registerAction(store, type, handler, local) { 21187 var entry = store._actions[type] || (store._actions[type] = []); 21188 entry.push(function wrappedActionHandler(payload) { 21189 var res = handler.call(store, { 21190 dispatch: local.dispatch, 21191 commit: local.commit, 21192 getters: local.getters, 21193 state: local.state, 21194 rootGetters: store.getters, 21195 rootState: store.state 21196 }, payload); 21197 21198 if (!isPromise(res)) { 21199 res = Promise.resolve(res); 21200 } 21201 21202 if (store._devtoolHook) { 21203 return res.catch(function (err) { 21204 store._devtoolHook.emit('vuex:error', err); 21205 21206 throw err; 21207 }); 21208 } else { 21209 return res; 21210 } 21211 }); 21212 } 21213 21214 function registerGetter(store, type, rawGetter, local) { 21215 if (store._wrappedGetters[type]) { 21216 return; 21217 } 21218 21219 store._wrappedGetters[type] = function wrappedGetter(store) { 21220 return rawGetter(local.state, // local state 21221 local.getters, // local getters 21222 store.state, // root state 21223 store.getters // root getters 21224 ); 21225 }; 21226 } 21227 21228 function enableStrictMode(store) { 21229 watch(function () { 21230 return store._state.data; 21231 }, function () {}, { 21232 deep: true, 21233 flush: 'sync' 21234 }); 21235 } 21236 21237 function getNestedState(state, path) { 21238 return path.reduce(function (state, key) { 21239 return state[key]; 21240 }, state); 21241 } 21242 21243 function unifyObjectStyle(type, payload, options) { 21244 if (isObject(type) && type.type) { 21245 options = payload; 21246 payload = type; 21247 type = type.type; 21248 } 21249 21250 return { 21251 type: type, 21252 payload: payload, 21253 options: options 21254 }; 21255 } 21256 21257 var LABEL_VUEX_BINDINGS = 'vuex bindings'; 21258 var MUTATIONS_LAYER_ID = 'vuex:mutations'; 21259 var ACTIONS_LAYER_ID = 'vuex:actions'; 21260 var INSPECTOR_ID = 'vuex'; 21261 var actionId = 0; 21262 21263 function addDevtools(app, store) { 21264 setupDevtoolsPlugin({ 21265 id: 'org.vuejs.vuex', 21266 app: app, 21267 label: 'Vuex', 21268 homepage: 'https://next.vuex.vuejs.org/', 21269 logo: 'https://vuejs.org/images/icons/favicon-96x96.png', 21270 packageName: 'vuex', 21271 componentStateTypes: [LABEL_VUEX_BINDINGS] 21272 }, function (api) { 21273 api.addTimelineLayer({ 21274 id: MUTATIONS_LAYER_ID, 21275 label: 'Vuex Mutations', 21276 color: COLOR_LIME_500 21277 }); 21278 api.addTimelineLayer({ 21279 id: ACTIONS_LAYER_ID, 21280 label: 'Vuex Actions', 21281 color: COLOR_LIME_500 21282 }); 21283 api.addInspector({ 21284 id: INSPECTOR_ID, 21285 label: 'Vuex', 21286 icon: 'storage', 21287 treeFilterPlaceholder: 'Filter stores...' 21288 }); 21289 api.on.getInspectorTree(function (payload) { 21290 if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { 21291 if (payload.filter) { 21292 var nodes = []; 21293 flattenStoreForInspectorTree(nodes, store._modules.root, payload.filter, ''); 21294 payload.rootNodes = nodes; 21295 } else { 21296 payload.rootNodes = [formatStoreForInspectorTree(store._modules.root, '')]; 21297 } 21298 } 21299 }); 21300 api.on.getInspectorState(function (payload) { 21301 if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { 21302 var modulePath = payload.nodeId; 21303 makeLocalGetters(store, modulePath); 21304 payload.state = formatStoreForInspectorState(getStoreModule(store._modules, modulePath), modulePath === 'root' ? store.getters : store._makeLocalGettersCache, modulePath); 21305 } 21306 }); 21307 api.on.editInspectorState(function (payload) { 21308 if (payload.app === app && payload.inspectorId === INSPECTOR_ID) { 21309 var modulePath = payload.nodeId; 21310 var path = payload.path; 21311 21312 if (modulePath !== 'root') { 21313 path = modulePath.split('/').filter(Boolean).concat(path); 21314 } 21315 21316 store._withCommit(function () { 21317 payload.set(store._state.data, path, payload.state.value); 21318 }); 21319 } 21320 }); 21321 store.subscribe(function (mutation, state) { 21322 var data = {}; 21323 21324 if (mutation.payload) { 21325 data.payload = mutation.payload; 21326 } 21327 21328 data.state = state; 21329 api.notifyComponentUpdate(); 21330 api.sendInspectorTree(INSPECTOR_ID); 21331 api.sendInspectorState(INSPECTOR_ID); 21332 api.addTimelineEvent({ 21333 layerId: MUTATIONS_LAYER_ID, 21334 event: { 21335 time: Date.now(), 21336 title: mutation.type, 21337 data: data 21338 } 21339 }); 21340 }); 21341 store.subscribeAction({ 21342 before: function before(action, state) { 21343 var data = {}; 21344 21345 if (action.payload) { 21346 data.payload = action.payload; 21347 } 21348 21349 action._id = actionId++; 21350 action._time = Date.now(); 21351 data.state = state; 21352 api.addTimelineEvent({ 21353 layerId: ACTIONS_LAYER_ID, 21354 event: { 21355 time: action._time, 21356 title: action.type, 21357 groupId: action._id, 21358 subtitle: 'start', 21359 data: data 21360 } 21361 }); 21362 }, 21363 after: function after(action, state) { 21364 var data = {}; 21365 21366 var duration = Date.now() - action._time; 21367 21368 data.duration = { 21369 _custom: { 21370 type: 'duration', 21371 display: duration + "ms", 21372 tooltip: 'Action duration', 21373 value: duration 21374 } 21375 }; 21376 21377 if (action.payload) { 21378 data.payload = action.payload; 21379 } 21380 21381 data.state = state; 21382 api.addTimelineEvent({ 21383 layerId: ACTIONS_LAYER_ID, 21384 event: { 21385 time: Date.now(), 21386 title: action.type, 21387 groupId: action._id, 21388 subtitle: 'end', 21389 data: data 21390 } 21391 }); 21392 } 21393 }); 21394 }); 21395 } // extracted from tailwind palette 21396 21397 21398 var COLOR_LIME_500 = 0x84cc16; 21399 var COLOR_DARK = 0x666666; 21400 var COLOR_WHITE = 0xffffff; 21401 var TAG_NAMESPACED = { 21402 label: 'namespaced', 21403 textColor: COLOR_WHITE, 21404 backgroundColor: COLOR_DARK 21405 }; 21406 /** 21407 * @param {string} path 21408 */ 21409 21410 function extractNameFromPath(path) { 21411 return path && path !== 'root' ? path.split('/').slice(-2, -1)[0] : 'Root'; 21412 } 21413 /** 21414 * @param {*} module 21415 * @return {import('@vue/devtools-api').CustomInspectorNode} 21416 */ 21417 21418 21419 function formatStoreForInspectorTree(module, path) { 21420 return { 21421 id: path || 'root', 21422 // all modules end with a `/`, we want the last segment only 21423 // cart/ -> cart 21424 // nested/cart/ -> cart 21425 label: extractNameFromPath(path), 21426 tags: module.namespaced ? [TAG_NAMESPACED] : [], 21427 children: Object.keys(module._children).map(function (moduleName) { 21428 return formatStoreForInspectorTree(module._children[moduleName], path + moduleName + '/'); 21429 }) 21430 }; 21431 } 21432 /** 21433 * @param {import('@vue/devtools-api').CustomInspectorNode[]} result 21434 * @param {*} module 21435 * @param {string} filter 21436 * @param {string} path 21437 */ 21438 21439 21440 function flattenStoreForInspectorTree(result, module, filter, path) { 21441 if (path.includes(filter)) { 21442 result.push({ 21443 id: path || 'root', 21444 label: path.endsWith('/') ? path.slice(0, path.length - 1) : path || 'Root', 21445 tags: module.namespaced ? [TAG_NAMESPACED] : [] 21446 }); 21447 } 21448 21449 Object.keys(module._children).forEach(function (moduleName) { 21450 flattenStoreForInspectorTree(result, module._children[moduleName], filter, path + moduleName + '/'); 21451 }); 21452 } 21453 /** 21454 * @param {*} module 21455 * @return {import('@vue/devtools-api').CustomInspectorState} 21456 */ 21457 21458 21459 function formatStoreForInspectorState(module, getters, path) { 21460 getters = path === 'root' ? getters : getters[path]; 21461 var gettersKeys = Object.keys(getters); 21462 var storeState = { 21463 state: Object.keys(module.state).map(function (key) { 21464 return { 21465 key: key, 21466 editable: true, 21467 value: module.state[key] 21468 }; 21469 }) 21470 }; 21471 21472 if (gettersKeys.length) { 21473 var tree = transformPathsToObjectTree(getters); 21474 storeState.getters = Object.keys(tree).map(function (key) { 21475 return { 21476 key: key.endsWith('/') ? extractNameFromPath(key) : key, 21477 editable: false, 21478 value: canThrow(function () { 21479 return tree[key]; 21480 }) 21481 }; 21482 }); 21483 } 21484 21485 return storeState; 21486 } 21487 21488 function transformPathsToObjectTree(getters) { 21489 var result = {}; 21490 Object.keys(getters).forEach(function (key) { 21491 var path = key.split('/'); 21492 21493 if (path.length > 1) { 21494 var target = result; 21495 var leafKey = path.pop(); 21496 path.forEach(function (p) { 21497 if (!target[p]) { 21498 target[p] = { 21499 _custom: { 21500 value: {}, 21501 display: p, 21502 tooltip: 'Module', 21503 abstract: true 21504 } 21505 }; 21506 } 21507 21508 target = target[p]._custom.value; 21509 }); 21510 target[leafKey] = canThrow(function () { 21511 return getters[key]; 21512 }); 21513 } else { 21514 result[key] = canThrow(function () { 21515 return getters[key]; 21516 }); 21517 } 21518 }); 21519 return result; 21520 } 21521 21522 function getStoreModule(moduleMap, path) { 21523 var names = path.split('/').filter(function (n) { 21524 return n; 21525 }); 21526 return names.reduce(function (module, moduleName, i) { 21527 var child = module[moduleName]; 21528 21529 if (!child) { 21530 throw new Error("Missing module \"" + moduleName + "\" for path \"" + path + "\"."); 21531 } 21532 21533 return i === names.length - 1 ? child : child._children; 21534 }, path === 'root' ? moduleMap : moduleMap.root._children); 21535 } 21536 21537 function canThrow(cb) { 21538 try { 21539 return cb(); 21540 } catch (e) { 21541 return e; 21542 } 21543 } // Base data struct for store's module, package with some attribute and method 21544 21545 21546 var Module = function Module(rawModule, runtime) { 21547 this.runtime = runtime; // Store some children item 21548 21549 this._children = Object.create(null); // Store the origin module object which passed by programmer 21550 21551 this._rawModule = rawModule; 21552 var rawState = rawModule.state; // Store the origin module's state 21553 21554 this.state = (typeof rawState === 'function' ? rawState() : rawState) || {}; 21555 }; 21556 21557 var prototypeAccessors$1 = { 21558 namespaced: { 21559 configurable: true 21560 } 21561 }; 21562 21563 prototypeAccessors$1.namespaced.get = function () { 21564 return !!this._rawModule.namespaced; 21565 }; 21566 21567 Module.prototype.addChild = function addChild(key, module) { 21568 this._children[key] = module; 21569 }; 21570 21571 Module.prototype.removeChild = function removeChild(key) { 21572 delete this._children[key]; 21573 }; 21574 21575 Module.prototype.getChild = function getChild(key) { 21576 return this._children[key]; 21577 }; 21578 21579 Module.prototype.hasChild = function hasChild(key) { 21580 return key in this._children; 21581 }; 21582 21583 Module.prototype.update = function update(rawModule) { 21584 this._rawModule.namespaced = rawModule.namespaced; 21585 21586 if (rawModule.actions) { 21587 this._rawModule.actions = rawModule.actions; 21588 } 21589 21590 if (rawModule.mutations) { 21591 this._rawModule.mutations = rawModule.mutations; 21592 } 21593 21594 if (rawModule.getters) { 21595 this._rawModule.getters = rawModule.getters; 21596 } 21597 }; 21598 21599 Module.prototype.forEachChild = function forEachChild(fn) { 21600 forEachValue(this._children, fn); 21601 }; 21602 21603 Module.prototype.forEachGetter = function forEachGetter(fn) { 21604 if (this._rawModule.getters) { 21605 forEachValue(this._rawModule.getters, fn); 21606 } 21607 }; 21608 21609 Module.prototype.forEachAction = function forEachAction(fn) { 21610 if (this._rawModule.actions) { 21611 forEachValue(this._rawModule.actions, fn); 21612 } 21613 }; 21614 21615 Module.prototype.forEachMutation = function forEachMutation(fn) { 21616 if (this._rawModule.mutations) { 21617 forEachValue(this._rawModule.mutations, fn); 21618 } 21619 }; 21620 21621 Object.defineProperties(Module.prototype, prototypeAccessors$1); 21622 21623 var ModuleCollection = function ModuleCollection(rawRootModule) { 21624 // register root module (Vuex.Store options) 21625 this.register([], rawRootModule, false); 21626 }; 21627 21628 ModuleCollection.prototype.get = function get(path) { 21629 return path.reduce(function (module, key) { 21630 return module.getChild(key); 21631 }, this.root); 21632 }; 21633 21634 ModuleCollection.prototype.getNamespace = function getNamespace(path) { 21635 var module = this.root; 21636 return path.reduce(function (namespace, key) { 21637 module = module.getChild(key); 21638 return namespace + (module.namespaced ? key + '/' : ''); 21639 }, ''); 21640 }; 21641 21642 ModuleCollection.prototype.update = function update$1(rawRootModule) { 21643 update([], this.root, rawRootModule); 21644 }; 21645 21646 ModuleCollection.prototype.register = function register(path, rawModule, runtime) { 21647 var this$1$1 = this; 21648 if (runtime === void 0) runtime = true; 21649 var newModule = new Module(rawModule, runtime); 21650 21651 if (path.length === 0) { 21652 this.root = newModule; 21653 } else { 21654 var parent = this.get(path.slice(0, -1)); 21655 parent.addChild(path[path.length - 1], newModule); 21656 } // register nested modules 21657 21658 21659 if (rawModule.modules) { 21660 forEachValue(rawModule.modules, function (rawChildModule, key) { 21661 this$1$1.register(path.concat(key), rawChildModule, runtime); 21662 }); 21663 } 21664 }; 21665 21666 ModuleCollection.prototype.unregister = function unregister(path) { 21667 var parent = this.get(path.slice(0, -1)); 21668 var key = path[path.length - 1]; 21669 var child = parent.getChild(key); 21670 21671 if (!child) { 21672 return; 21673 } 21674 21675 if (!child.runtime) { 21676 return; 21677 } 21678 21679 parent.removeChild(key); 21680 }; 21681 21682 ModuleCollection.prototype.isRegistered = function isRegistered(path) { 21683 var parent = this.get(path.slice(0, -1)); 21684 var key = path[path.length - 1]; 21685 21686 if (parent) { 21687 return parent.hasChild(key); 21688 } 21689 21690 return false; 21691 }; 21692 21693 function update(path, targetModule, newModule) { 21694 targetModule.update(newModule); // update nested modules 21695 21696 if (newModule.modules) { 21697 for (var key in newModule.modules) { 21698 if (!targetModule.getChild(key)) { 21699 return; 21700 } 21701 21702 update(path.concat(key), targetModule.getChild(key), newModule.modules[key]); 21703 } 21704 } 21705 } 21706 21707 function createStore(options) { 21708 return new Store(options); 21709 } 21710 21711 var Store = function Store(options) { 21712 var this$1$1 = this; 21713 if (options === void 0) options = {}; 21714 var plugins = options.plugins; 21715 if (plugins === void 0) plugins = []; 21716 var strict = options.strict; 21717 if (strict === void 0) strict = false; 21718 var devtools = options.devtools; // store internal state 21719 21720 this._committing = false; 21721 this._actions = Object.create(null); 21722 this._actionSubscribers = []; 21723 this._mutations = Object.create(null); 21724 this._wrappedGetters = Object.create(null); 21725 this._modules = new ModuleCollection(options); 21726 this._modulesNamespaceMap = Object.create(null); 21727 this._subscribers = []; 21728 this._makeLocalGettersCache = Object.create(null); 21729 this._devtools = devtools; // bind commit and dispatch to self 21730 21731 var store = this; 21732 var ref = this; 21733 var dispatch = ref.dispatch; 21734 var commit = ref.commit; 21735 21736 this.dispatch = function boundDispatch(type, payload) { 21737 return dispatch.call(store, type, payload); 21738 }; 21739 21740 this.commit = function boundCommit(type, payload, options) { 21741 return commit.call(store, type, payload, options); 21742 }; // strict mode 21743 21744 21745 this.strict = strict; 21746 var state = this._modules.root.state; // init root module. 21747 // this also recursively registers all sub-modules 21748 // and collects all module getters inside this._wrappedGetters 21749 21750 installModule(this, state, [], this._modules.root); // initialize the store state, which is responsible for the reactivity 21751 // (also registers _wrappedGetters as computed properties) 21752 21753 resetStoreState(this, state); // apply plugins 21754 21755 plugins.forEach(function (plugin) { 21756 return plugin(this$1$1); 21757 }); 21758 }; 21759 21760 var prototypeAccessors = { 21761 state: { 21762 configurable: true 21763 } 21764 }; 21765 21766 Store.prototype.install = function install(app, injectKey) { 21767 app.provide(injectKey || storeKey, this); 21768 app.config.globalProperties.$store = this; 21769 var useDevtools = this._devtools !== undefined ? this._devtools : __VUE_PROD_DEVTOOLS__; 21770 21771 if (useDevtools) { 21772 addDevtools(app, this); 21773 } 21774 }; 21775 21776 prototypeAccessors.state.get = function () { 21777 return this._state.data; 21778 }; 21779 21780 prototypeAccessors.state.set = function (v) {}; 21781 21782 Store.prototype.commit = function commit(_type, _payload, _options) { 21783 var this$1$1 = this; // check object-style commit 21784 21785 var ref = unifyObjectStyle(_type, _payload, _options); 21786 var type = ref.type; 21787 var payload = ref.payload; 21788 var mutation = { 21789 type: type, 21790 payload: payload 21791 }; 21792 var entry = this._mutations[type]; 21793 21794 if (!entry) { 21795 return; 21796 } 21797 21798 this._withCommit(function () { 21799 entry.forEach(function commitIterator(handler) { 21800 handler(payload); 21801 }); 21802 }); 21803 21804 this._subscribers.slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe 21805 .forEach(function (sub) { 21806 return sub(mutation, this$1$1.state); 21807 }); 21808 }; 21809 21810 Store.prototype.dispatch = function dispatch(_type, _payload) { 21811 var this$1$1 = this; // check object-style dispatch 21812 21813 var ref = unifyObjectStyle(_type, _payload); 21814 var type = ref.type; 21815 var payload = ref.payload; 21816 var action = { 21817 type: type, 21818 payload: payload 21819 }; 21820 var entry = this._actions[type]; 21821 21822 if (!entry) { 21823 return; 21824 } 21825 21826 try { 21827 this._actionSubscribers.slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe 21828 .filter(function (sub) { 21829 return sub.before; 21830 }).forEach(function (sub) { 21831 return sub.before(action, this$1$1.state); 21832 }); 21833 } catch (e) {} 21834 21835 var result = entry.length > 1 ? Promise.all(entry.map(function (handler) { 21836 return handler(payload); 21837 })) : entry[0](payload); 21838 return new Promise(function (resolve, reject) { 21839 result.then(function (res) { 21840 try { 21841 this$1$1._actionSubscribers.filter(function (sub) { 21842 return sub.after; 21843 }).forEach(function (sub) { 21844 return sub.after(action, this$1$1.state); 21845 }); 21846 } catch (e) {} 21847 21848 resolve(res); 21849 }, function (error) { 21850 try { 21851 this$1$1._actionSubscribers.filter(function (sub) { 21852 return sub.error; 21853 }).forEach(function (sub) { 21854 return sub.error(action, this$1$1.state, error); 21855 }); 21856 } catch (e) {} 21857 21858 reject(error); 21859 }); 21860 }); 21861 }; 21862 21863 Store.prototype.subscribe = function subscribe(fn, options) { 21864 return genericSubscribe(fn, this._subscribers, options); 21865 }; 21866 21867 Store.prototype.subscribeAction = function subscribeAction(fn, options) { 21868 var subs = typeof fn === 'function' ? { 21869 before: fn 21870 } : fn; 21871 return genericSubscribe(subs, this._actionSubscribers, options); 21872 }; 21873 21874 Store.prototype.watch = function watch$1(getter, cb, options) { 21875 var this$1$1 = this; 21876 return watch(function () { 21877 return getter(this$1$1.state, this$1$1.getters); 21878 }, cb, Object.assign({}, options)); 21879 }; 21880 21881 Store.prototype.replaceState = function replaceState(state) { 21882 var this$1$1 = this; 21883 21884 this._withCommit(function () { 21885 this$1$1._state.data = state; 21886 }); 21887 }; 21888 21889 Store.prototype.registerModule = function registerModule(path, rawModule, options) { 21890 if (options === void 0) options = {}; 21891 21892 if (typeof path === 'string') { 21893 path = [path]; 21894 } 21895 21896 this._modules.register(path, rawModule); 21897 21898 installModule(this, this.state, path, this._modules.get(path), options.preserveState); // reset store to update getters... 21899 21900 resetStoreState(this, this.state); 21901 }; 21902 21903 Store.prototype.unregisterModule = function unregisterModule(path) { 21904 var this$1$1 = this; 21905 21906 if (typeof path === 'string') { 21907 path = [path]; 21908 } 21909 21910 this._modules.unregister(path); 21911 21912 this._withCommit(function () { 21913 var parentState = getNestedState(this$1$1.state, path.slice(0, -1)); 21914 delete parentState[path[path.length - 1]]; 21915 }); 21916 21917 resetStore(this); 21918 }; 21919 21920 Store.prototype.hasModule = function hasModule(path) { 21921 if (typeof path === 'string') { 21922 path = [path]; 21923 } 21924 21925 return this._modules.isRegistered(path); 21926 }; 21927 21928 Store.prototype.hotUpdate = function hotUpdate(newOptions) { 21929 this._modules.update(newOptions); 21930 21931 resetStore(this, true); 21932 }; 21933 21934 Store.prototype._withCommit = function _withCommit(fn) { 21935 var committing = this._committing; 21936 this._committing = true; 21937 fn(); 21938 this._committing = committing; 21939 }; 21940 21941 Object.defineProperties(Store.prototype, prototypeAccessors); 21942 21943 var r = function r(_r) { 21944 return function (r) { 21945 return !!r && "object" == typeof r; 21946 }(_r) && !function (r) { 21947 var t = Object.prototype.toString.call(r); 21948 return "[object RegExp]" === t || "[object Date]" === t || function (r) { 21949 return r.$$typeof === e; 21950 }(r); 21951 }(_r); 21952 }, 21953 e = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103; 21954 21955 function t(r, e) { 21956 return !1 !== e.clone && e.isMergeableObject(r) ? u(Array.isArray(r) ? [] : {}, r, e) : r; 21957 } 21958 21959 function n(r, e, n) { 21960 return r.concat(e).map(function (r) { 21961 return t(r, n); 21962 }); 21963 } 21964 21965 function o(r) { 21966 return Object.keys(r).concat(function (r) { 21967 return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(r).filter(function (e) { 21968 return r.propertyIsEnumerable(e); 21969 }) : []; 21970 }(r)); 21971 } 21972 21973 function c(r, e) { 21974 try { 21975 return e in r; 21976 } catch (r) { 21977 return !1; 21978 } 21979 } 21980 21981 function u(e, i, a) { 21982 (a = a || {}).arrayMerge = a.arrayMerge || n, a.isMergeableObject = a.isMergeableObject || r, a.cloneUnlessOtherwiseSpecified = t; 21983 var f = Array.isArray(i); 21984 return f === Array.isArray(e) ? f ? a.arrayMerge(e, i, a) : function (r, e, n) { 21985 var i = {}; 21986 return n.isMergeableObject(r) && o(r).forEach(function (e) { 21987 i[e] = t(r[e], n); 21988 }), o(e).forEach(function (o) { 21989 (function (r, e) { 21990 return c(r, e) && !(Object.hasOwnProperty.call(r, e) && Object.propertyIsEnumerable.call(r, e)); 21991 })(r, o) || (i[o] = c(r, o) && n.isMergeableObject(e[o]) ? function (r, e) { 21992 if (!e.customMerge) return u; 21993 var t = e.customMerge(r); 21994 return "function" == typeof t ? t : u; 21995 }(o, n)(r[o], e[o], n) : t(e[o], n)); 21996 }), i; 21997 }(e, i, a) : t(i, a); 21998 } 21999 22000 u.all = function (r, e) { 22001 if (!Array.isArray(r)) throw new Error("first argument should be an array"); 22002 return r.reduce(function (r, t) { 22003 return u(r, t, e); 22004 }, {}); 22005 }; 22006 22007 var i = u; 22008 22009 function a(r) { 22010 var e = (r = r || {}).storage || window && window.localStorage, 22011 t = r.key || "vuex"; 22012 22013 function n(r, e) { 22014 var t = e.getItem(r); 22015 22016 try { 22017 return "string" == typeof t ? JSON.parse(t) : "object" == typeof t ? t : void 0; 22018 } catch (r) {} 22019 } 22020 22021 function o() { 22022 return !0; 22023 } 22024 22025 function c(r, e, t) { 22026 return t.setItem(r, JSON.stringify(e)); 22027 } 22028 22029 function u(r, e) { 22030 return Array.isArray(e) ? e.reduce(function (e, t) { 22031 return function (r, e, t, n) { 22032 return !/^(__proto__|constructor|prototype)$/.test(e) && ((e = e.split ? e.split(".") : e.slice(0)).slice(0, -1).reduce(function (r, e) { 22033 return r[e] = r[e] || {}; 22034 }, r)[e.pop()] = t), r; 22035 }(e, t, (n = r, void 0 === (n = ((o = t).split ? o.split(".") : o).reduce(function (r, e) { 22036 return r && r[e]; 22037 }, n)) ? void 0 : n)); 22038 var n, o; 22039 }, {}) : r; 22040 } 22041 22042 function a(r) { 22043 return function (e) { 22044 return r.subscribe(e); 22045 }; 22046 } 22047 22048 (r.assertStorage || function () { 22049 e.setItem("@@", 1), e.removeItem("@@"); 22050 })(e); 22051 22052 var f, 22053 s = function s() { 22054 return (r.getState || n)(t, e); 22055 }; 22056 22057 return r.fetchBeforeUse && (f = s()), function (n) { 22058 r.fetchBeforeUse || (f = s()), "object" == typeof f && null !== f && (n.replaceState(r.overwrite ? f : i(n.state, f, { 22059 arrayMerge: r.arrayMerger || function (r, e) { 22060 return e; 22061 }, 22062 clone: !1 22063 })), (r.rehydrated || function () {})(n)), (r.subscriber || a)(n)(function (n, i) { 22064 (r.filter || o)(n) && (r.setState || c)(t, (r.reducer || u)(i, r.paths), e); 22065 }); 22066 }; 22067 } // The options for persisting state 22068 // eslint-disable-next-line import/prefer-default-export 22069 22070 22071 var persistedStateOptions = { 22072 key: 'joomla.mediamanager', 22073 paths: ['selectedDirectory', 'showInfoBar', 'listView', 'gridSize', 'search'], 22074 storage: window.sessionStorage 22075 }; 22076 var options = Joomla.getOptions('com_media', {}); 22077 22078 if (options.providers === undefined || options.providers.length === 0) { 22079 throw new TypeError('Media providers are not defined.'); 22080 } 22081 /** 22082 * Get the drives 22083 * 22084 * @param {Array} adapterNames 22085 * @param {String} provider 22086 * 22087 * @return {Array} 22088 */ 22089 22090 22091 var getDrives = function getDrives(adapterNames, provider) { 22092 var drives = []; 22093 adapterNames.map(function (name) { 22094 return drives.push({ 22095 root: provider + "-" + name + ":/", 22096 displayName: name 22097 }); 22098 }); 22099 return drives; 22100 }; // Load disks from options 22101 22102 22103 var loadedDisks = options.providers.map(function (disk) { 22104 return { 22105 displayName: disk.displayName, 22106 drives: getDrives(disk.adapterNames, disk.name) 22107 }; 22108 }); 22109 var defaultDisk = loadedDisks.find(function (disk) { 22110 return disk.drives.length > 0 && disk.drives[0] !== undefined; 22111 }); 22112 22113 if (!defaultDisk) { 22114 throw new TypeError('No default media drive was found'); 22115 } // Override the storage if we have a path 22116 22117 22118 if (options.currentPath) { 22119 var storedState = JSON.parse(persistedStateOptions.storage.getItem(persistedStateOptions.key)); 22120 22121 if (storedState && storedState.selectedDirectory && storedState.selectedDirectory !== options.currentPath) { 22122 storedState.selectedDirectory = options.currentPath; 22123 persistedStateOptions.storage.setItem(persistedStateOptions.key, JSON.stringify(storedState)); 22124 } 22125 } // The initial state 22126 22127 22128 var state = { 22129 // The general loading state 22130 isLoading: false, 22131 // Will hold the activated filesystem disks 22132 disks: loadedDisks, 22133 // The loaded directories 22134 directories: loadedDisks.map(function () { 22135 return { 22136 path: defaultDisk.drives[0].root, 22137 name: defaultDisk.displayName, 22138 directories: [], 22139 files: [], 22140 directory: null 22141 }; 22142 }), 22143 // The loaded files 22144 files: [], 22145 // The selected disk. Providers are ordered by plugin ordering, so we set the first provider 22146 // in the list as the default provider and load first drive on it as default 22147 selectedDirectory: options.currentPath || defaultDisk.drives[0].root, 22148 // The currently selected items 22149 selectedItems: [], 22150 // The state of the infobar 22151 showInfoBar: false, 22152 // List view 22153 listView: 'grid', 22154 // The size of the grid items 22155 gridSize: 'md', 22156 // The state of confirm delete model 22157 showConfirmDeleteModal: false, 22158 // The state of create folder model 22159 showCreateFolderModal: false, 22160 // The state of preview model 22161 showPreviewModal: false, 22162 // The state of share model 22163 showShareModal: false, 22164 // The state of model 22165 showRenameModal: false, 22166 // The preview item 22167 previewItem: null, 22168 // The Search Query 22169 search: '' 22170 }; // Sometimes we may need to compute derived state based on store state, 22171 // for example filtering through a list of items and counting them. 22172 22173 /** 22174 * Get the currently selected directory 22175 * @param state 22176 * @returns {*} 22177 */ 22178 22179 var getSelectedDirectory = function getSelectedDirectory(state) { 22180 return state.directories.find(function (directory) { 22181 return directory.path === state.selectedDirectory; 22182 }); 22183 }; 22184 /** 22185 * Get the sudirectories of the currently selected directory 22186 * @param state 22187 * 22188 * @returns {Array|directories|{/}|computed.directories|*|Object} 22189 */ 22190 22191 22192 var getSelectedDirectoryDirectories = function getSelectedDirectoryDirectories(state) { 22193 return state.directories.filter(function (directory) { 22194 return directory.directory === state.selectedDirectory; 22195 }); 22196 }; 22197 /** 22198 * Get the files of the currently selected directory 22199 * @param state 22200 * 22201 * @returns {Array|files|{}|FileList|*} 22202 */ 22203 22204 22205 var getSelectedDirectoryFiles = function getSelectedDirectoryFiles(state) { 22206 return state.files.filter(function (file) { 22207 return file.directory === state.selectedDirectory; 22208 }); 22209 }; 22210 /** 22211 * Whether or not all items of the current directory are selected 22212 * @param state 22213 * @param getters 22214 * @returns Array 22215 */ 22216 22217 22218 var getSelectedDirectoryContents = function getSelectedDirectoryContents(state, getters) { 22219 return [].concat(getters.getSelectedDirectoryDirectories, getters.getSelectedDirectoryFiles); 22220 }; 22221 22222 var getters = /*#__PURE__*/Object.freeze({ 22223 __proto__: null, 22224 getSelectedDirectory: getSelectedDirectory, 22225 getSelectedDirectoryDirectories: getSelectedDirectoryDirectories, 22226 getSelectedDirectoryFiles: getSelectedDirectoryFiles, 22227 getSelectedDirectoryContents: getSelectedDirectoryContents 22228 }); 22229 22230 var updateUrlPath = function updateUrlPath(path) { 22231 var currentPath = path === null ? '' : path; 22232 var url = new URL(window.location.href); 22233 22234 if (url.searchParams.has('path')) { 22235 window.history.pushState(null, '', url.href.replace(/\b(path=).*?(&|$)/, "$1" + currentPath + "$2")); 22236 } else { 22237 window.history.pushState(null, '', url.href + (url.href.indexOf('?') > 0 ? '&' : '?') + "path=" + currentPath); 22238 } 22239 }; 22240 /** 22241 * Actions are similar to mutations, the difference being that: 22242 * Instead of mutating the state, actions commit mutations. 22243 * Actions can contain arbitrary asynchronous operations. 22244 */ 22245 22246 /** 22247 * Get contents of a directory from the api 22248 * @param context 22249 * @param payload 22250 */ 22251 22252 22253 var getContents = function getContents(context, payload) { 22254 // Update the url 22255 updateUrlPath(payload); 22256 context.commit(SET_IS_LOADING, true); 22257 api.getContents(payload, 0).then(function (contents) { 22258 context.commit(LOAD_CONTENTS_SUCCESS, contents); 22259 context.commit(UNSELECT_ALL_BROWSER_ITEMS); 22260 context.commit(SELECT_DIRECTORY, payload); 22261 context.commit(SET_IS_LOADING, false); 22262 }).catch(function (error) { 22263 // @todo error handling 22264 context.commit(SET_IS_LOADING, false); // eslint-disable-next-line no-console 22265 22266 console.log('error', error); 22267 }); 22268 }; 22269 /** 22270 * Get the full contents of a directory 22271 * @param context 22272 * @param payload 22273 */ 22274 22275 22276 var getFullContents = function getFullContents(context, payload) { 22277 context.commit(SET_IS_LOADING, true); 22278 api.getContents(payload.path, 1).then(function (contents) { 22279 context.commit(LOAD_FULL_CONTENTS_SUCCESS, contents.files[0]); 22280 context.commit(SET_IS_LOADING, false); 22281 }).catch(function (error) { 22282 // @todo error handling 22283 context.commit(SET_IS_LOADING, false); // eslint-disable-next-line no-console 22284 22285 console.log('error', error); 22286 }); 22287 }; 22288 /** 22289 * Download a file 22290 * @param context 22291 * @param payload 22292 */ 22293 22294 22295 var download = function download(context, payload) { 22296 api.getContents(payload.path, 0, 1).then(function (contents) { 22297 var file = contents.files[0]; // Convert the base 64 encoded string to a blob 22298 22299 var byteCharacters = atob(file.content); 22300 var byteArrays = []; 22301 22302 for (var offset = 0; offset < byteCharacters.length; offset += 512) { 22303 var slice = byteCharacters.slice(offset, offset + 512); 22304 var byteNumbers = new Array(slice.length); // eslint-disable-next-line no-plusplus 22305 22306 for (var _i38 = 0; _i38 < slice.length; _i38++) { 22307 byteNumbers[_i38] = slice.charCodeAt(_i38); 22308 } 22309 22310 var byteArray = new Uint8Array(byteNumbers); 22311 byteArrays.push(byteArray); 22312 } // Download file 22313 22314 22315 var blobURL = URL.createObjectURL(new Blob(byteArrays, { 22316 type: file.mime_type 22317 })); 22318 var a = document.createElement('a'); 22319 a.href = blobURL; 22320 a.download = file.name; 22321 document.body.appendChild(a); 22322 a.click(); 22323 document.body.removeChild(a); 22324 }).catch(function (error) { 22325 // eslint-disable-next-line no-console 22326 console.log('error', error); 22327 }); 22328 }; 22329 /** 22330 * Toggle the selection state of an item 22331 * @param context 22332 * @param payload 22333 */ 22334 22335 22336 var toggleBrowserItemSelect = function toggleBrowserItemSelect(context, payload) { 22337 var item = payload; 22338 var isSelected = context.state.selectedItems.some(function (selected) { 22339 return selected.path === item.path; 22340 }); 22341 22342 if (!isSelected) { 22343 context.commit(SELECT_BROWSER_ITEM, item); 22344 } else { 22345 context.commit(UNSELECT_BROWSER_ITEM, item); 22346 } 22347 }; 22348 /** 22349 * Create a new folder 22350 * @param context 22351 * @param payload object with the new folder name and its parent directory 22352 */ 22353 22354 22355 var createDirectory = function createDirectory(context, payload) { 22356 if (!api.canCreate) { 22357 return; 22358 } 22359 22360 context.commit(SET_IS_LOADING, true); 22361 api.createDirectory(payload.name, payload.parent).then(function (folder) { 22362 context.commit(CREATE_DIRECTORY_SUCCESS, folder); 22363 context.commit(HIDE_CREATE_FOLDER_MODAL); 22364 context.commit(SET_IS_LOADING, false); 22365 }).catch(function (error) { 22366 // @todo error handling 22367 context.commit(SET_IS_LOADING, false); // eslint-disable-next-line no-console 22368 22369 console.log('error', error); 22370 }); 22371 }; 22372 /** 22373 * Create a new folder 22374 * @param context 22375 * @param payload object with the new folder name and its parent directory 22376 */ 22377 22378 22379 var uploadFile = function uploadFile(context, payload) { 22380 if (!api.canCreate) { 22381 return; 22382 } 22383 22384 context.commit(SET_IS_LOADING, true); 22385 api.upload(payload.name, payload.parent, payload.content, payload.override || false).then(function (file) { 22386 context.commit(UPLOAD_SUCCESS, file); 22387 context.commit(SET_IS_LOADING, false); 22388 }).catch(function (error) { 22389 context.commit(SET_IS_LOADING, false); // Handle file exists 22390 22391 if (error.status === 409) { 22392 if (notifications.ask(Translate.sprintf('COM_MEDIA_FILE_EXISTS_AND_OVERRIDE', payload.name), {})) { 22393 payload.override = true; 22394 uploadFile(context, payload); 22395 } 22396 } 22397 }); 22398 }; 22399 /** 22400 * Rename an item 22401 * @param context 22402 * @param payload object: the item and the new path 22403 */ 22404 22405 22406 var renameItem = function renameItem(context, payload) { 22407 if (!api.canEdit) { 22408 return; 22409 } 22410 22411 if (typeof payload.item.canEdit !== 'undefined' && payload.item.canEdit === false) { 22412 return; 22413 } 22414 22415 context.commit(SET_IS_LOADING, true); 22416 api.rename(payload.item.path, payload.newPath).then(function (item) { 22417 context.commit(RENAME_SUCCESS, { 22418 item: item, 22419 oldPath: payload.item.path, 22420 newName: payload.newName 22421 }); 22422 context.commit(HIDE_RENAME_MODAL); 22423 context.commit(SET_IS_LOADING, false); 22424 }).catch(function (error) { 22425 // @todo error handling 22426 context.commit(SET_IS_LOADING, false); // eslint-disable-next-line no-console 22427 22428 console.log('error', error); 22429 }); 22430 }; 22431 /** 22432 * Delete the selected items 22433 * @param context 22434 */ 22435 22436 22437 var deleteSelectedItems = function deleteSelectedItems(context) { 22438 if (!api.canDelete) { 22439 return; 22440 } 22441 22442 context.commit(SET_IS_LOADING, true); // Get the selected items from the store 22443 22444 var selectedItems = context.state.selectedItems; 22445 22446 if (selectedItems.length > 0) { 22447 selectedItems.forEach(function (item) { 22448 if (typeof item.canDelete !== 'undefined' && item.canDelete === false) { 22449 return; 22450 } 22451 22452 api.delete(item.path).then(function () { 22453 context.commit(DELETE_SUCCESS, item); 22454 context.commit(UNSELECT_ALL_BROWSER_ITEMS); 22455 context.commit(SET_IS_LOADING, false); 22456 }).catch(function (error) { 22457 // @todo error handling 22458 context.commit(SET_IS_LOADING, false); // eslint-disable-next-line no-console 22459 22460 console.log('error', error); 22461 }); 22462 }); 22463 } 22464 }; 22465 22466 var actions = /*#__PURE__*/Object.freeze({ 22467 __proto__: null, 22468 getContents: getContents, 22469 getFullContents: getFullContents, 22470 download: download, 22471 toggleBrowserItemSelect: toggleBrowserItemSelect, 22472 createDirectory: createDirectory, 22473 uploadFile: uploadFile, 22474 renameItem: renameItem, 22475 deleteSelectedItems: deleteSelectedItems 22476 }); // Mutations are very similar to events: each mutation has a string type and a handler. 22477 // The handler function is where we perform actual state modifications, 22478 // and it will receive the state as the first argument. 22479 // The grid item sizes 22480 22481 var gridItemSizes = ['sm', 'md', 'lg', 'xl']; 22482 var mutations = (_mutations = {}, _mutations[SELECT_DIRECTORY] = function (state, payload) { 22483 state.selectedDirectory = payload; 22484 state.search = ''; 22485 }, _mutations[LOAD_CONTENTS_SUCCESS] = function (state, payload) { 22486 /** 22487 * Create the directory structure 22488 * @param path 22489 */ 22490 function createDirectoryStructureFromPath(path) { 22491 var exists = state.directories.some(function (existing) { 22492 return existing.path === path; 22493 }); 22494 22495 if (!exists) { 22496 // eslint-disable-next-line no-use-before-define 22497 var directory = directoryFromPath(path); // Add the sub directories and files 22498 22499 directory.directories = state.directories.filter(function (existing) { 22500 return existing.directory === directory.path; 22501 }).map(function (existing) { 22502 return existing.path; 22503 }); // Add the directory 22504 22505 state.directories.push(directory); 22506 22507 if (directory.directory) { 22508 createDirectoryStructureFromPath(directory.directory); 22509 } 22510 } 22511 } 22512 /** 22513 * Create a directory from a path 22514 * @param path 22515 */ 22516 22517 22518 function directoryFromPath(path) { 22519 var parts = path.split('/'); 22520 var directory = dirname(path); 22521 22522 if (directory.indexOf(':', directory.length - 1) !== -1) { 22523 directory += '/'; 22524 } 22525 22526 return { 22527 path: path, 22528 name: parts[parts.length - 1], 22529 directories: [], 22530 files: [], 22531 directory: directory !== '.' ? directory : null, 22532 type: 'dir', 22533 mime_type: 'directory' 22534 }; 22535 } 22536 /** 22537 * Add a directory 22538 * @param state 22539 * @param directory 22540 */ 22541 // eslint-disable-next-line no-shadow 22542 22543 22544 function addDirectory(state, directory) { 22545 var parentDirectory = state.directories.find(function (existing) { 22546 return existing.path === directory.directory; 22547 }); 22548 var parentDirectoryIndex = state.directories.indexOf(parentDirectory); 22549 var index = state.directories.findIndex(function (existing) { 22550 return existing.path === directory.path; 22551 }); 22552 22553 if (index === -1) { 22554 index = state.directories.length; 22555 } // Add the directory 22556 22557 22558 state.directories.splice(index, 1, directory); // Update the relation to the parent directory 22559 22560 if (parentDirectoryIndex !== -1) { 22561 state.directories.splice(parentDirectoryIndex, 1, Object.assign({}, parentDirectory, { 22562 directories: [].concat(parentDirectory.directories, [directory.path]) 22563 })); 22564 } 22565 } 22566 /** 22567 * Add a file 22568 * @param state 22569 * @param directory 22570 */ 22571 // eslint-disable-next-line no-shadow 22572 22573 22574 function addFile(state, file) { 22575 var parentDirectory = state.directories.find(function (directory) { 22576 return directory.path === file.directory; 22577 }); 22578 var parentDirectoryIndex = state.directories.indexOf(parentDirectory); 22579 var index = state.files.findIndex(function (existing) { 22580 return existing.path === file.path; 22581 }); 22582 22583 if (index === -1) { 22584 index = state.files.length; 22585 } // Add the file 22586 22587 22588 state.files.splice(index, 1, file); // Update the relation to the parent directory 22589 22590 if (parentDirectoryIndex !== -1) { 22591 state.directories.splice(parentDirectoryIndex, 1, Object.assign({}, parentDirectory, { 22592 files: [].concat(parentDirectory.files, [file.path]) 22593 })); 22594 } 22595 } // Create the parent directory structure if it does not exist 22596 22597 22598 createDirectoryStructureFromPath(state.selectedDirectory); // Add directories 22599 22600 payload.directories.forEach(function (directory) { 22601 addDirectory(state, directory); 22602 }); // Add files 22603 22604 payload.files.forEach(function (file) { 22605 addFile(state, file); 22606 }); 22607 }, _mutations[UPLOAD_SUCCESS] = function (state, payload) { 22608 var file = payload; 22609 var isNew = !state.files.some(function (existing) { 22610 return existing.path === file.path; 22611 }); // @todo handle file_exists 22612 22613 if (isNew) { 22614 var parentDirectory = state.directories.find(function (existing) { 22615 return existing.path === file.directory; 22616 }); 22617 var parentDirectoryIndex = state.directories.indexOf(parentDirectory); // Add the new file to the files array 22618 22619 state.files.push(file); // Update the relation to the parent directory 22620 22621 state.directories.splice(parentDirectoryIndex, 1, Object.assign({}, parentDirectory, { 22622 files: [].concat(parentDirectory.files, [file.path]) 22623 })); 22624 } 22625 }, _mutations[CREATE_DIRECTORY_SUCCESS] = function (state, payload) { 22626 var directory = payload; 22627 var isNew = !state.directories.some(function (existing) { 22628 return existing.path === directory.path; 22629 }); 22630 22631 if (isNew) { 22632 var parentDirectory = state.directories.find(function (existing) { 22633 return existing.path === directory.directory; 22634 }); 22635 var parentDirectoryIndex = state.directories.indexOf(parentDirectory); // Add the new directory to the directory 22636 22637 state.directories.push(directory); // Update the relation to the parent directory 22638 22639 state.directories.splice(parentDirectoryIndex, 1, Object.assign({}, parentDirectory, { 22640 directories: [].concat(parentDirectory.directories, [directory.path]) 22641 })); 22642 } 22643 }, _mutations[RENAME_SUCCESS] = function (state, payload) { 22644 state.selectedItems[state.selectedItems.length - 1].name = payload.newName; 22645 var item = payload.item; 22646 var oldPath = payload.oldPath; 22647 22648 if (item.type === 'file') { 22649 var index = state.files.findIndex(function (file) { 22650 return file.path === oldPath; 22651 }); 22652 state.files.splice(index, 1, item); 22653 } else { 22654 var _index = state.directories.findIndex(function (directory) { 22655 return directory.path === oldPath; 22656 }); 22657 22658 state.directories.splice(_index, 1, item); 22659 } 22660 }, _mutations[DELETE_SUCCESS] = function (state, payload) { 22661 var item = payload; // Delete file 22662 22663 if (item.type === 'file') { 22664 state.files.splice(state.files.findIndex(function (file) { 22665 return file.path === item.path; 22666 }), 1); 22667 } // Delete dir 22668 22669 22670 if (item.type === 'dir') { 22671 state.directories.splice(state.directories.findIndex(function (directory) { 22672 return directory.path === item.path; 22673 }), 1); 22674 } 22675 }, _mutations[SELECT_BROWSER_ITEM] = function (state, payload) { 22676 state.selectedItems.push(payload); 22677 }, _mutations[SELECT_BROWSER_ITEMS] = function (state, payload) { 22678 state.selectedItems = payload; 22679 }, _mutations[UNSELECT_BROWSER_ITEM] = function (state, payload) { 22680 var item = payload; 22681 state.selectedItems.splice(state.selectedItems.findIndex(function (selectedItem) { 22682 return selectedItem.path === item.path; 22683 }), 1); 22684 }, _mutations[UNSELECT_ALL_BROWSER_ITEMS] = function (state) { 22685 state.selectedItems = []; 22686 }, _mutations[SHOW_CREATE_FOLDER_MODAL] = function (state) { 22687 state.showCreateFolderModal = true; 22688 }, _mutations[HIDE_CREATE_FOLDER_MODAL] = function (state) { 22689 state.showCreateFolderModal = false; 22690 }, _mutations[SHOW_INFOBAR] = function (state) { 22691 state.showInfoBar = true; 22692 }, _mutations[HIDE_INFOBAR] = function (state) { 22693 state.showInfoBar = false; 22694 }, _mutations[CHANGE_LIST_VIEW] = function (state, view) { 22695 state.listView = view; 22696 }, _mutations[LOAD_FULL_CONTENTS_SUCCESS] = function (state, payload) { 22697 state.previewItem = payload; 22698 }, _mutations[SHOW_PREVIEW_MODAL] = function (state) { 22699 state.showPreviewModal = true; 22700 }, _mutations[HIDE_PREVIEW_MODAL] = function (state) { 22701 state.showPreviewModal = false; 22702 }, _mutations[SET_IS_LOADING] = function (state, payload) { 22703 state.isLoading = payload; 22704 }, _mutations[SHOW_RENAME_MODAL] = function (state) { 22705 state.showRenameModal = true; 22706 }, _mutations[HIDE_RENAME_MODAL] = function (state) { 22707 state.showRenameModal = false; 22708 }, _mutations[SHOW_SHARE_MODAL] = function (state) { 22709 state.showShareModal = true; 22710 }, _mutations[HIDE_SHARE_MODAL] = function (state) { 22711 state.showShareModal = false; 22712 }, _mutations[INCREASE_GRID_SIZE] = function (state) { 22713 var currentSizeIndex = gridItemSizes.indexOf(state.gridSize); 22714 22715 if (currentSizeIndex >= 0 && currentSizeIndex < gridItemSizes.length - 1) { 22716 // eslint-disable-next-line no-plusplus 22717 state.gridSize = gridItemSizes[++currentSizeIndex]; 22718 } 22719 }, _mutations[DECREASE_GRID_SIZE] = function (state) { 22720 var currentSizeIndex = gridItemSizes.indexOf(state.gridSize); 22721 22722 if (currentSizeIndex > 0 && currentSizeIndex < gridItemSizes.length) { 22723 // eslint-disable-next-line no-plusplus 22724 state.gridSize = gridItemSizes[--currentSizeIndex]; 22725 } 22726 }, _mutations[SET_SEARCH_QUERY] = function (state, query) { 22727 state.search = query; 22728 }, _mutations[SHOW_CONFIRM_DELETE_MODAL] = function (state) { 22729 state.showConfirmDeleteModal = true; 22730 }, _mutations[HIDE_CONFIRM_DELETE_MODAL] = function (state) { 22731 state.showConfirmDeleteModal = false; 22732 }, _mutations); 22733 var store = createStore({ 22734 state: state, 22735 getters: getters, 22736 actions: actions, 22737 mutations: mutations, 22738 plugins: [a(persistedStateOptions)], 22739 strict: "production" !== 'production' 22740 }); 22741 var script$7 = { 22742 name: 'MediaBrowserActionItemRename', 22743 props: { 22744 onFocused: { 22745 type: Function, 22746 default: function _default() {} 22747 }, 22748 mainAction: { 22749 type: Function, 22750 default: function _default() {} 22751 }, 22752 closingAction: { 22753 type: Function, 22754 default: function _default() {} 22755 } 22756 }, 22757 methods: { 22758 openRenameModal: function openRenameModal() { 22759 this.mainAction(); 22760 }, 22761 hideActions: function hideActions() { 22762 this.closingAction(); 22763 }, 22764 focused: function focused(bool) { 22765 this.onFocused(bool); 22766 } 22767 } 22768 }; 22769 var _hoisted_1$7 = ["aria-label", "title"]; 22770 22771 function render$7(_ctx, _cache, $props, $setup, $data, $options) { 22772 return openBlock(), createElementBlock("button", { 22773 ref: "actionRenameButton", 22774 type: "button", 22775 class: "action-rename", 22776 "aria-label": _ctx.translate('COM_MEDIA_ACTION_RENAME'), 22777 title: _ctx.translate('COM_MEDIA_ACTION_RENAME'), 22778 onKeyup: [_cache[1] || (_cache[1] = withKeys(function ($event) { 22779 return $options.openRenameModal(); 22780 }, ["enter"])), _cache[2] || (_cache[2] = withKeys(function ($event) { 22781 return $options.openRenameModal(); 22782 }, ["space"])), _cache[5] || (_cache[5] = withKeys(function ($event) { 22783 return $options.hideActions(); 22784 }, ["esc"]))], 22785 onFocus: _cache[3] || (_cache[3] = function ($event) { 22786 return $options.focused(true); 22787 }), 22788 onBlur: _cache[4] || (_cache[4] = function ($event) { 22789 return $options.focused(false); 22790 }) 22791 }, [createBaseVNode("span", { 22792 class: "image-browser-action icon-text-width", 22793 "aria-hidden": "true", 22794 onClick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 22795 return $options.openRenameModal(); 22796 }, ["stop"])) 22797 })], 40 22798 /* PROPS, HYDRATE_EVENTS */ 22799 , _hoisted_1$7); 22800 } 22801 22802 script$7.render = render$7; 22803 script$7.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/rename.vue"; 22804 var script$6 = { 22805 name: 'MediaBrowserActionItemToggle', 22806 props: { 22807 mainAction: { 22808 type: Function, 22809 default: function _default() {} 22810 } 22811 }, 22812 emits: ['on-focused'], 22813 methods: { 22814 openActions: function openActions() { 22815 this.mainAction(); 22816 }, 22817 focused: function focused(bool) { 22818 this.$emit('on-focused', bool); 22819 } 22820 } 22821 }; 22822 var _hoisted_1$6 = ["aria-label", "title"]; 22823 22824 function render$6(_ctx, _cache, $props, $setup, $data, $options) { 22825 return openBlock(), createElementBlock("button", { 22826 type: "button", 22827 class: "action-toggle", 22828 tabindex: "0", 22829 "aria-label": _ctx.translate('COM_MEDIA_OPEN_ITEM_ACTIONS'), 22830 title: _ctx.translate('COM_MEDIA_OPEN_ITEM_ACTIONS'), 22831 onKeyup: [_cache[1] || (_cache[1] = withKeys(function ($event) { 22832 return $options.openActions(); 22833 }, ["enter"])), _cache[4] || (_cache[4] = withKeys(function ($event) { 22834 return $options.openActions(); 22835 }, ["space"]))], 22836 onFocus: _cache[2] || (_cache[2] = function ($event) { 22837 return $options.focused(true); 22838 }), 22839 onBlur: _cache[3] || (_cache[3] = function ($event) { 22840 return $options.focused(false); 22841 }) 22842 }, [createBaseVNode("span", { 22843 class: "image-browser-action icon-ellipsis-h", 22844 "aria-hidden": "true", 22845 onClick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 22846 return $options.openActions(); 22847 }, ["stop"])) 22848 })], 40 22849 /* PROPS, HYDRATE_EVENTS */ 22850 , _hoisted_1$6); 22851 } 22852 22853 script$6.render = render$6; 22854 script$6.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/toggle.vue"; 22855 var script$5 = { 22856 name: 'MediaBrowserActionItemPreview', 22857 props: { 22858 onFocused: { 22859 type: Function, 22860 default: function _default() {} 22861 }, 22862 mainAction: { 22863 type: Function, 22864 default: function _default() {} 22865 }, 22866 closingAction: { 22867 type: Function, 22868 default: function _default() {} 22869 } 22870 }, 22871 methods: { 22872 openPreview: function openPreview() { 22873 this.mainAction(); 22874 }, 22875 hideActions: function hideActions() { 22876 this.closingAction(); 22877 }, 22878 focused: function focused(bool) { 22879 this.onFocused(bool); 22880 } 22881 } 22882 }; 22883 var _hoisted_1$5 = ["aria-label", "title"]; 22884 22885 function render$5(_ctx, _cache, $props, $setup, $data, $options) { 22886 return openBlock(), createElementBlock("button", { 22887 type: "button", 22888 class: "action-preview", 22889 "aria-label": _ctx.translate('COM_MEDIA_ACTION_PREVIEW'), 22890 title: _ctx.translate('COM_MEDIA_ACTION_PREVIEW'), 22891 onKeyup: [_cache[1] || (_cache[1] = withKeys(function ($event) { 22892 return $options.openPreview(); 22893 }, ["enter"])), _cache[2] || (_cache[2] = withKeys(function ($event) { 22894 return $options.openPreview(); 22895 }, ["space"])), _cache[5] || (_cache[5] = withKeys(function ($event) { 22896 return $options.hideActions(); 22897 }, ["esc"]))], 22898 onFocus: _cache[3] || (_cache[3] = function ($event) { 22899 return $options.focused(true); 22900 }), 22901 onBlur: _cache[4] || (_cache[4] = function ($event) { 22902 return $options.focused(false); 22903 }) 22904 }, [createBaseVNode("span", { 22905 class: "image-browser-action icon-search-plus", 22906 "aria-hidden": "true", 22907 onClick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 22908 return $options.openPreview(); 22909 }, ["stop"])) 22910 })], 40 22911 /* PROPS, HYDRATE_EVENTS */ 22912 , _hoisted_1$5); 22913 } 22914 22915 script$5.render = render$5; 22916 script$5.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/preview.vue"; 22917 var script$4 = { 22918 name: 'MediaBrowserActionItemDownload', 22919 props: { 22920 onFocused: { 22921 type: Function, 22922 default: function _default() {} 22923 }, 22924 mainAction: { 22925 type: Function, 22926 default: function _default() {} 22927 }, 22928 closingAction: { 22929 type: Function, 22930 default: function _default() {} 22931 } 22932 }, 22933 methods: { 22934 download: function download() { 22935 this.mainAction(); 22936 }, 22937 hideActions: function hideActions() { 22938 this.closingAction(); 22939 }, 22940 focused: function focused(bool) { 22941 this.onFocused(bool); 22942 } 22943 } 22944 }; 22945 var _hoisted_1$4 = ["aria-label", "title"]; 22946 22947 function render$4(_ctx, _cache, $props, $setup, $data, $options) { 22948 return openBlock(), createElementBlock("button", { 22949 type: "button", 22950 class: "action-download", 22951 "aria-label": _ctx.translate('COM_MEDIA_ACTION_DOWNLOAD'), 22952 title: _ctx.translate('COM_MEDIA_ACTION_DOWNLOAD'), 22953 onKeyup: [_cache[1] || (_cache[1] = withKeys(function ($event) { 22954 return $options.download(); 22955 }, ["enter"])), _cache[2] || (_cache[2] = withKeys(function ($event) { 22956 return $options.download(); 22957 }, ["space"])), _cache[5] || (_cache[5] = withKeys(function ($event) { 22958 return $options.hideActions(); 22959 }, ["esc"]))], 22960 onFocus: _cache[3] || (_cache[3] = function ($event) { 22961 return $options.focused(true); 22962 }), 22963 onBlur: _cache[4] || (_cache[4] = function ($event) { 22964 return $options.focused(false); 22965 }) 22966 }, [createBaseVNode("span", { 22967 class: "image-browser-action icon-download", 22968 "aria-hidden": "true", 22969 onClick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 22970 return $options.download(); 22971 }, ["stop"])) 22972 })], 40 22973 /* PROPS, HYDRATE_EVENTS */ 22974 , _hoisted_1$4); 22975 } 22976 22977 script$4.render = render$4; 22978 script$4.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/download.vue"; 22979 var script$3 = { 22980 name: 'MediaBrowserActionItemShare', 22981 props: { 22982 onFocused: { 22983 type: Function, 22984 default: function _default() {} 22985 }, 22986 mainAction: { 22987 type: Function, 22988 default: function _default() {} 22989 }, 22990 closingAction: { 22991 type: Function, 22992 default: function _default() {} 22993 } 22994 }, 22995 methods: { 22996 openShareUrlModal: function openShareUrlModal() { 22997 this.mainAction(); 22998 }, 22999 hideActions: function hideActions() { 23000 this.closingAction(); 23001 }, 23002 focused: function focused(bool) { 23003 this.onFocused(bool); 23004 } 23005 } 23006 }; 23007 var _hoisted_1$3 = ["aria-label", "title"]; 23008 23009 function render$3(_ctx, _cache, $props, $setup, $data, $options) { 23010 return openBlock(), createElementBlock("button", { 23011 type: "button", 23012 class: "action-url", 23013 "aria-label": _ctx.translate('COM_MEDIA_ACTION_SHARE'), 23014 title: _ctx.translate('COM_MEDIA_ACTION_SHARE'), 23015 onKeyup: [_cache[1] || (_cache[1] = withKeys(function ($event) { 23016 return $options.openShareUrlModal(); 23017 }, ["enter"])), _cache[2] || (_cache[2] = withKeys(function ($event) { 23018 return $options.openShareUrlModal(); 23019 }, ["space"])), _cache[5] || (_cache[5] = withKeys(function ($event) { 23020 return $options.hideActions(); 23021 }, ["esc"]))], 23022 onFocus: _cache[3] || (_cache[3] = function ($event) { 23023 return $options.focused(true); 23024 }), 23025 onBlur: _cache[4] || (_cache[4] = function ($event) { 23026 return $options.focused(false); 23027 }) 23028 }, [createBaseVNode("span", { 23029 class: "image-browser-action icon-link", 23030 "aria-hidden": "true", 23031 onClick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 23032 return $options.openShareUrlModal(); 23033 }, ["stop"])) 23034 })], 40 23035 /* PROPS, HYDRATE_EVENTS */ 23036 , _hoisted_1$3); 23037 } 23038 23039 script$3.render = render$3; 23040 script$3.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/share.vue"; 23041 var script$2 = { 23042 name: 'MediaBrowserActionItemDelete', 23043 props: { 23044 onFocused: { 23045 type: Function, 23046 default: function _default() {} 23047 }, 23048 mainAction: { 23049 type: Function, 23050 default: function _default() {} 23051 }, 23052 closingAction: { 23053 type: Function, 23054 default: function _default() {} 23055 } 23056 }, 23057 methods: { 23058 openConfirmDeleteModal: function openConfirmDeleteModal() { 23059 this.mainAction(); 23060 }, 23061 hideActions: function hideActions() { 23062 this.hideActions(); 23063 }, 23064 focused: function focused(bool) { 23065 this.onFocused(bool); 23066 } 23067 } 23068 }; 23069 var _hoisted_1$2 = ["aria-label", "title"]; 23070 23071 function render$2(_ctx, _cache, $props, $setup, $data, $options) { 23072 return openBlock(), createElementBlock("button", { 23073 type: "button", 23074 class: "action-delete", 23075 "aria-label": _ctx.translate('COM_MEDIA_ACTION_DELETE'), 23076 title: _ctx.translate('COM_MEDIA_ACTION_DELETE'), 23077 onKeyup: [_cache[1] || (_cache[1] = withKeys(function ($event) { 23078 return $options.openConfirmDeleteModal(); 23079 }, ["enter"])), _cache[2] || (_cache[2] = withKeys(function ($event) { 23080 return $options.openConfirmDeleteModal(); 23081 }, ["space"])), _cache[5] || (_cache[5] = withKeys(function ($event) { 23082 return $options.hideActions(); 23083 }, ["esc"]))], 23084 onFocus: _cache[3] || (_cache[3] = function ($event) { 23085 return $options.focused(true); 23086 }), 23087 onBlur: _cache[4] || (_cache[4] = function ($event) { 23088 return $options.focused(false); 23089 }) 23090 }, [createBaseVNode("span", { 23091 class: "image-browser-action icon-trash", 23092 "aria-hidden": "true", 23093 onClick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 23094 return $options.openConfirmDeleteModal(); 23095 }, ["stop"])) 23096 })], 40 23097 /* PROPS, HYDRATE_EVENTS */ 23098 , _hoisted_1$2); 23099 } 23100 23101 script$2.render = render$2; 23102 script$2.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/delete.vue"; 23103 var script$1 = { 23104 name: 'MediaBrowserActionItemEdit', 23105 props: { 23106 onFocused: { 23107 type: Function, 23108 default: function _default() {} 23109 }, 23110 mainAction: { 23111 type: Function, 23112 default: function _default() {} 23113 }, 23114 closingAction: { 23115 type: Function, 23116 default: function _default() {} 23117 } 23118 }, 23119 methods: { 23120 openRenameModal: function openRenameModal() { 23121 this.mainAction(); 23122 }, 23123 hideActions: function hideActions() { 23124 this.closingAction(); 23125 }, 23126 focused: function focused(bool) { 23127 this.onFocused(bool); 23128 }, 23129 editItem: function editItem() { 23130 this.mainAction(); 23131 } 23132 } 23133 }; 23134 var _hoisted_1$1 = ["aria-label", "title"]; 23135 23136 function render$1(_ctx, _cache, $props, $setup, $data, $options) { 23137 return openBlock(), createElementBlock("button", { 23138 type: "button", 23139 class: "action-edit", 23140 "aria-label": _ctx.translate('COM_MEDIA_ACTION_EDIT'), 23141 title: _ctx.translate('COM_MEDIA_ACTION_EDIT'), 23142 onKeyup: [_cache[1] || (_cache[1] = withKeys(function ($event) { 23143 return $options.editItem(); 23144 }, ["enter"])), _cache[2] || (_cache[2] = withKeys(function ($event) { 23145 return $options.editItem(); 23146 }, ["space"])), _cache[5] || (_cache[5] = withKeys(function ($event) { 23147 return $options.hideActions(); 23148 }, ["esc"]))], 23149 onFocus: _cache[3] || (_cache[3] = function ($event) { 23150 return $options.focused(true); 23151 }), 23152 onBlur: _cache[4] || (_cache[4] = function ($event) { 23153 return $options.focused(false); 23154 }) 23155 }, [createBaseVNode("span", { 23156 class: "image-browser-action icon-pencil-alt", 23157 "aria-hidden": "true", 23158 onClick: _cache[0] || (_cache[0] = withModifiers(function ($event) { 23159 return $options.editItem(); 23160 }, ["stop"])) 23161 })], 40 23162 /* PROPS, HYDRATE_EVENTS */ 23163 , _hoisted_1$1); 23164 } 23165 23166 script$1.render = render$1; 23167 script$1.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/edit.vue"; 23168 var script = { 23169 name: 'MediaBrowserActionItemsContainer', 23170 props: { 23171 item: { 23172 type: Object, 23173 default: function _default() {} 23174 }, 23175 edit: { 23176 type: Function, 23177 default: function _default() {} 23178 }, 23179 previewable: { 23180 type: Boolean, 23181 default: false 23182 }, 23183 downloadable: { 23184 type: Boolean, 23185 default: false 23186 }, 23187 shareable: { 23188 type: Boolean, 23189 default: false 23190 } 23191 }, 23192 emits: ['toggle-settings'], 23193 data: function data() { 23194 return { 23195 showActions: false 23196 }; 23197 }, 23198 computed: { 23199 canEdit: function canEdit() { 23200 return api.canEdit && (typeof this.item.canEdit !== 'undefined' ? this.item.canEdit : true); 23201 }, 23202 canDelete: function canDelete() { 23203 return api.canDelete && (typeof this.item.canDelete !== 'undefined' ? this.item.canDelete : true); 23204 }, 23205 canOpenEditView: function canOpenEditView() { 23206 return ['jpg', 'jpeg', 'png'].includes(this.item.extension.toLowerCase()); 23207 } 23208 }, 23209 watch: { 23210 // eslint-disable-next-line 23211 "$store.state.showRenameModal": function $storeStateShowRenameModal(show) { 23212 var _this19 = this; 23213 23214 if (!show && this.$refs.actionToggle && this.$store.state.selectedItems.find(function (item) { 23215 return item.name === _this19.item.name; 23216 }) !== undefined) { 23217 this.$refs.actionToggle.$el.focus(); 23218 } 23219 } 23220 }, 23221 methods: { 23222 /* Hide actions dropdown */ 23223 hideActions: function hideActions() { 23224 this.showActions = false; 23225 }, 23226 23227 /* Preview an item */ 23228 openPreview: function openPreview() { 23229 this.$store.commit(SHOW_PREVIEW_MODAL); 23230 this.$store.dispatch('getFullContents', this.item); 23231 }, 23232 23233 /* Download an item */ 23234 download: function download() { 23235 this.$store.dispatch('download', this.item); 23236 }, 23237 23238 /* Opening confirm delete modal */ 23239 openConfirmDeleteModal: function openConfirmDeleteModal() { 23240 this.$store.commit(UNSELECT_ALL_BROWSER_ITEMS); 23241 this.$store.commit(SELECT_BROWSER_ITEM, this.item); 23242 this.$store.commit(SHOW_CONFIRM_DELETE_MODAL); 23243 }, 23244 23245 /* Rename an item */ 23246 openRenameModal: function openRenameModal() { 23247 this.hideActions(); 23248 this.$store.commit(SELECT_BROWSER_ITEM, this.item); 23249 this.$store.commit(SHOW_RENAME_MODAL); 23250 }, 23251 23252 /* Open modal for share url */ 23253 openShareUrlModal: function openShareUrlModal() { 23254 this.$store.commit(SELECT_BROWSER_ITEM, this.item); 23255 this.$store.commit(SHOW_SHARE_MODAL); 23256 }, 23257 23258 /* Open actions dropdown */ 23259 openActions: function openActions() { 23260 this.showActions = true; 23261 var buttons = [].concat(this.$el.parentElement.querySelectorAll('.media-browser-actions-list button')); 23262 23263 if (buttons.length) { 23264 buttons[0].focus(); 23265 } 23266 }, 23267 23268 /* Open actions dropdown and focus on last element */ 23269 openLastActions: function openLastActions() { 23270 this.showActions = true; 23271 var buttons = [].concat(this.$el.parentElement.querySelectorAll('.media-browser-actions-list button')); 23272 23273 if (buttons.length) { 23274 this.$nextTick(function () { 23275 return buttons[buttons.length - 1].focus(); 23276 }); 23277 } 23278 }, 23279 editItem: function editItem() { 23280 this.edit(); 23281 }, 23282 focused: function focused(bool) { 23283 this.$emit('toggle-settings', bool); 23284 } 23285 } 23286 }; 23287 var _hoisted_1 = ["aria-label", "title"]; 23288 var _hoisted_2 = { 23289 key: 0, 23290 class: "media-browser-actions-list" 23291 }; 23292 23293 function render(_ctx, _cache, $props, $setup, $data, $options) { 23294 var _component_media_browser_action_item_toggle = resolveComponent("media-browser-action-item-toggle"); 23295 23296 var _component_media_browser_action_item_preview = resolveComponent("media-browser-action-item-preview"); 23297 23298 var _component_media_browser_action_item_download = resolveComponent("media-browser-action-item-download"); 23299 23300 var _component_media_browser_action_item_rename = resolveComponent("media-browser-action-item-rename"); 23301 23302 var _component_media_browser_action_item_edit = resolveComponent("media-browser-action-item-edit"); 23303 23304 var _component_media_browser_action_item_share = resolveComponent("media-browser-action-item-share"); 23305 23306 var _component_media_browser_action_item_delete = resolveComponent("media-browser-action-item-delete"); 23307 23308 return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("span", { 23309 class: "media-browser-select", 23310 "aria-label": _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM'), 23311 title: _ctx.translate('COM_MEDIA_TOGGLE_SELECT_ITEM'), 23312 tabindex: "0", 23313 onFocusin: _cache[0] || (_cache[0] = function ($event) { 23314 return $options.focused(true); 23315 }), 23316 onFocusout: _cache[1] || (_cache[1] = function ($event) { 23317 return $options.focused(false); 23318 }) 23319 }, null, 40 23320 /* PROPS, HYDRATE_EVENTS */ 23321 , _hoisted_1), createBaseVNode("div", { 23322 class: normalizeClass(["media-browser-actions", { 23323 active: $data.showActions 23324 }]) 23325 }, [createVNode(_component_media_browser_action_item_toggle, { 23326 ref: "actionToggle", 23327 "main-action": $options.openActions, 23328 onOnFocused: $options.focused, 23329 onKeyup: [_cache[2] || (_cache[2] = withKeys(function ($event) { 23330 return $options.openLastActions(); 23331 }, ["up"])), _cache[3] || (_cache[3] = withKeys(function ($event) { 23332 return $options.openActions(); 23333 }, ["down"]))] 23334 }, null, 8 23335 /* PROPS */ 23336 , ["main-action", "onOnFocused"]), $data.showActions ? (openBlock(), createElementBlock("div", _hoisted_2, [createBaseVNode("ul", null, [createBaseVNode("li", null, [$props.previewable ? (openBlock(), createBlock(_component_media_browser_action_item_preview, { 23337 key: 0, 23338 ref: "actionPreview", 23339 "on-focused": $options.focused, 23340 "main-action": $options.openPreview, 23341 "closing-action": $options.hideActions, 23342 onKeyup: [_cache[4] || (_cache[4] = withKeys(function ($event) { 23343 return _ctx.$refs.actionDelete.$el.focus(); 23344 }, ["up"])), _cache[5] || (_cache[5] = withKeys(function ($event) { 23345 return _ctx.$refs.actionDelete.$el.previousElementSibling.focus(); 23346 }, ["down"])), withKeys($options.hideActions, ["esc"])] 23347 }, null, 8 23348 /* PROPS */ 23349 , ["on-focused", "main-action", "closing-action", "onKeyup"])) : createCommentVNode("v-if", true)]), createBaseVNode("li", null, [$props.downloadable ? (openBlock(), createBlock(_component_media_browser_action_item_download, { 23350 key: 0, 23351 ref: "actionDownload", 23352 "on-focused": $options.focused, 23353 "main-action": $options.download, 23354 "closing-action": $options.hideActions, 23355 onKeyup: [_cache[6] || (_cache[6] = withKeys(function ($event) { 23356 return _ctx.$refs.actionPreview.$el.focus(); 23357 }, ["up"])), _cache[7] || (_cache[7] = withKeys(function ($event) { 23358 return _ctx.$refs.actionPreview.$el.previousElementSibling.focus(); 23359 }, ["down"])), withKeys($options.hideActions, ["esc"])] 23360 }, null, 8 23361 /* PROPS */ 23362 , ["on-focused", "main-action", "closing-action", "onKeyup"])) : createCommentVNode("v-if", true)]), createBaseVNode("li", null, [$options.canEdit ? (openBlock(), createBlock(_component_media_browser_action_item_rename, { 23363 key: 0, 23364 ref: "actionRename", 23365 "on-focused": $options.focused, 23366 "main-action": $options.openRenameModal, 23367 "closing-action": $options.hideActions, 23368 onKeyup: [_cache[8] || (_cache[8] = withKeys(function ($event) { 23369 return $props.downloadable ? _ctx.$refs.actionDownload.$el.focus() : _ctx.$refs.actionDownload.$el.previousElementSibling.focus(); 23370 }, ["up"])), _cache[9] || (_cache[9] = withKeys(function ($event) { 23371 return $options.canEdit ? _ctx.$refs.actionEdit.$el.focus() : $props.shareable ? _ctx.$refs.actionShare.$el.focus() : _ctx.$refs.actionShare.$el.previousElementSibling.focus(); 23372 }, ["down"])), withKeys($options.hideActions, ["esc"])] 23373 }, null, 8 23374 /* PROPS */ 23375 , ["on-focused", "main-action", "closing-action", "onKeyup"])) : createCommentVNode("v-if", true)]), createBaseVNode("li", null, [$options.canEdit && $options.canOpenEditView ? (openBlock(), createBlock(_component_media_browser_action_item_edit, { 23376 key: 0, 23377 ref: "actionEdit", 23378 "on-focused": $options.focused, 23379 "main-action": $options.editItem, 23380 "closing-action": $options.hideActions, 23381 onKeyup: [_cache[10] || (_cache[10] = withKeys(function ($event) { 23382 return _ctx.$refs.actionRename.$el.focus(); 23383 }, ["up"])), _cache[11] || (_cache[11] = withKeys(function ($event) { 23384 return _ctx.$refs.actionRename.$el.previousElementSibling.focus(); 23385 }, ["down"])), withKeys($options.hideActions, ["esc"])] 23386 }, null, 8 23387 /* PROPS */ 23388 , ["on-focused", "main-action", "closing-action", "onKeyup"])) : createCommentVNode("v-if", true)]), createBaseVNode("li", null, [$props.shareable ? (openBlock(), createBlock(_component_media_browser_action_item_share, { 23389 key: 0, 23390 ref: "actionShare", 23391 "on-focused": $options.focused, 23392 "main-action": $options.openShareUrlModal, 23393 "closing-action": $options.hideActions, 23394 onKeyup: [_cache[12] || (_cache[12] = withKeys(function ($event) { 23395 return $options.canEdit ? _ctx.$refs.actionEdit.$el.focus() : _ctx.$refs.actionEdit.$el.previousElementSibling.focus(); 23396 }, ["up"])), _cache[13] || (_cache[13] = withKeys(function ($event) { 23397 return _ctx.$refs.actionDelete.$el.focus(); 23398 }, ["down"])), withKeys($options.hideActions, ["esc"])] 23399 }, null, 8 23400 /* PROPS */ 23401 , ["on-focused", "main-action", "closing-action", "onKeyup"])) : createCommentVNode("v-if", true)]), createBaseVNode("li", null, [$options.canDelete ? (openBlock(), createBlock(_component_media_browser_action_item_delete, { 23402 key: 0, 23403 ref: "actionDelete", 23404 "on-focused": $options.focused, 23405 "main-action": $options.openConfirmDeleteModal, 23406 "hide-actions": $options.hideActions, 23407 onKeyup: [_cache[14] || (_cache[14] = withKeys(function ($event) { 23408 return $props.shareable ? _ctx.$refs.actionShare.$el.focus() : _ctx.$refs.actionShare.$el.previousElementSibling.focus(); 23409 }, ["up"])), _cache[15] || (_cache[15] = withKeys(function ($event) { 23410 return $props.previewable ? _ctx.$refs.actionPreview.$el.focus() : _ctx.$refs.actionPreview.$el.previousElementSibling.focus(); 23411 }, ["down"])), withKeys($options.hideActions, ["esc"])] 23412 }, null, 8 23413 /* PROPS */ 23414 , ["on-focused", "main-action", "hide-actions", "onKeyup"])) : createCommentVNode("v-if", true)])])])) : createCommentVNode("v-if", true)], 2 23415 /* CLASS */ 23416 )], 64 23417 /* STABLE_FRAGMENT */ 23418 ); 23419 } 23420 23421 script.render = render; 23422 script.__file = "administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue"; 23423 window.MediaManager = window.MediaManager || {}; // Register the media manager event bus 23424 23425 window.MediaManager.Event = new Event(); // Create the Vue app instance 23426 23427 var app = createApp(script$t); 23428 app.use(store); 23429 app.use(Translate); // Register the vue components 23430 23431 app.component('MediaDrive', script$r); 23432 app.component('MediaDisk', script$s); 23433 app.component('MediaTree', script$q); 23434 app.component('MediaToolbar', script$p); 23435 app.component('MediaBreadcrumb', script$o); 23436 app.component('MediaBrowser', script$n); 23437 app.component('MediaBrowserItem', BrowserItem); 23438 app.component('MediaBrowserItemRow', script$g); 23439 app.component('MediaModal', script$f); 23440 app.component('MediaCreateFolderModal', script$e); 23441 app.component('MediaPreviewModal', script$d); 23442 app.component('MediaRenameModal', script$c); 23443 app.component('MediaShareModal', script$b); 23444 app.component('MediaConfirmDeleteModal', script$a); 23445 app.component('MediaInfobar', script$9); 23446 app.component('MediaUpload', script$8); 23447 app.component('MediaBrowserActionItemToggle', script$6); 23448 app.component('MediaBrowserActionItemPreview', script$5); 23449 app.component('MediaBrowserActionItemDownload', script$4); 23450 app.component('MediaBrowserActionItemRename', script$7); 23451 app.component('MediaBrowserActionItemShare', script$3); 23452 app.component('MediaBrowserActionItemDelete', script$2); 23453 app.component('MediaBrowserActionItemEdit', script$1); 23454 app.component('MediaBrowserActionItemsContainer', script); 23455 app.mount('#com-media'); 23456 23457 return mediaManager; 23458 23459 })();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |