Gitlab Schedule Duplicator

The [gs-duplicator] is a utility tool for GitLab that simplifies the duplication, creation, and updating of GitLab pipeline schedules. Its key features include cloning schedules with identical configurations, editing schedules using dropdown options derived from variable descriptions, and downloading schedule configurations as .env files for backup and transfer. The gs-duplicator aims to streamline and optimize the GitLab workflow, providing users with an efficient and user-friendly experience.

当前为 2023-12-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Gitlab Schedule Duplicator
  3. // @namespace https://github.com/tranphuquy19
  4. // @description The [gs-duplicator] is a utility tool for GitLab that simplifies the duplication, creation, and updating of GitLab pipeline schedules. Its key features include cloning schedules with identical configurations, editing schedules using dropdown options derived from variable descriptions, and downloading schedule configurations as .env files for backup and transfer. The gs-duplicator aims to streamline and optimize the GitLab workflow, providing users with an efficient and user-friendly experience.
  5. // @match https://gitlab.com/*/pipeline_schedules*
  6. // @match https://*.gitlab.com/*/pipeline_schedules*
  7. // @grant GM_addStyle
  8. // @run-at document-end
  9. // @supportURL https://github.com/tranphuquy19/gs-duplicator/issues
  10. // @license MIT
  11. // @author tranphuquy19
  12. // @version 1701827118589
  13. // ==/UserScript==
  14. /******/ (() => { // webpackBootstrap
  15. /******/ var __webpack_modules__ = ([
  16. /* 0 */
  17. /***/ ((__unused_webpack_module, exports) => {
  18.  
  19. "use strict";
  20.  
  21. var _a, _b;
  22. Object.defineProperty(exports, "__esModule", ({ value: true }));
  23. exports.saveGitlabToolSettings = exports.saveGitlabToken = exports.replaceEnterWithN = exports.sortVarByName = exports.enableMarkdownVarDescription = exports.autoShowDropDown = exports.getTheOptionsFrom = exports.includeAllVariables = exports.wrappedVarBy = exports.gitlabDefaultPipelineSchedule = exports.gitlabRestPerPage = exports.gitlabSvgIconUrl = exports.gitlabToken = exports.gitlabProjectId = exports.gitlabGraphqlUrl = exports.gitlabApiUrl = exports.gitlabUrl = exports.gitlabTokenLocalStorageKey = void 0;
  24. const gitlabTokenLocalStorageKey = 'gitlab_token';
  25. exports.gitlabTokenLocalStorageKey = gitlabTokenLocalStorageKey;
  26. const gitlabUrl = document.location.origin;
  27. exports.gitlabUrl = gitlabUrl;
  28. const gitlabApiUrl = `${gitlabUrl}/api/v4`;
  29. exports.gitlabApiUrl = gitlabApiUrl;
  30. const gitlabGraphqlUrl = `${gitlabUrl}/api/graphql`;
  31. exports.gitlabGraphqlUrl = gitlabGraphqlUrl;
  32. const gitlabProjectId = ((_a = document.querySelector('#project_id')) === null || _a === void 0 ? void 0 : _a.value) ||
  33. ((_b = document.querySelector('body')) === null || _b === void 0 ? void 0 : _b.getAttribute('data-project-id'));
  34. exports.gitlabProjectId = gitlabProjectId;
  35. const gitlabToken = window.atob(localStorage.getItem(gitlabTokenLocalStorageKey) || '');
  36. exports.gitlabToken = gitlabToken;
  37. let includeAllVariables = false;
  38. exports.includeAllVariables = includeAllVariables;
  39. let gitlabSvgIconUrl = `/assets/icons-29e9caf34d9cc5889ea5f1dce460a0578cd14318aabc385b1fe54ce6069c9874.svg`;
  40. exports.gitlabSvgIconUrl = gitlabSvgIconUrl;
  41. let gitlabRestPerPage = 9999; // Number of items per page for REST API
  42. exports.gitlabRestPerPage = gitlabRestPerPage;
  43. let gitlabDefaultPipelineSchedule = {
  44. active: false,
  45. cron: '0 15 * * *',
  46. description: 'New pipeline schedule',
  47. cron_timezone: 'UTC',
  48. ref: 'main',
  49. };
  50. exports.gitlabDefaultPipelineSchedule = gitlabDefaultPipelineSchedule;
  51. let wrappedVarBy = '"';
  52. exports.wrappedVarBy = wrappedVarBy;
  53. let replaceEnterWithN = true;
  54. exports.replaceEnterWithN = replaceEnterWithN;
  55. let getTheOptionsFrom = 'merge_both'; // var_description, gitlab_variable_options, merge_both
  56. exports.getTheOptionsFrom = getTheOptionsFrom;
  57. let autoShowDropDown = true;
  58. exports.autoShowDropDown = autoShowDropDown;
  59. let enableMarkdownVarDescription = true;
  60. exports.enableMarkdownVarDescription = enableMarkdownVarDescription;
  61. let sortVarByName = true;
  62. exports.sortVarByName = sortVarByName;
  63. const gitlabToolSettingsLSKey = 'gitlab-tool-settings';
  64. const gitlabToolSettings = localStorage.getItem(gitlabToolSettingsLSKey);
  65. if (gitlabToolSettings === null) {
  66. localStorage.setItem(gitlabToolSettingsLSKey, JSON.stringify({
  67. gitlabDefaultPipelineSchedule,
  68. wrappedVarBy,
  69. gitlabSvgIconUrl,
  70. gitlabRestPerPage,
  71. includeAllVariables,
  72. getTheOptionsFrom,
  73. autoShowDropDown,
  74. enableMarkdownVarDescription,
  75. sortVarByName,
  76. replaceEnterWithN,
  77. }));
  78. }
  79. else {
  80. const settings = JSON.parse(gitlabToolSettings);
  81. exports.gitlabDefaultPipelineSchedule = gitlabDefaultPipelineSchedule = settings.gitlabDefaultPipelineSchedule;
  82. exports.wrappedVarBy = wrappedVarBy = settings.wrappedVarBy;
  83. exports.gitlabSvgIconUrl = gitlabSvgIconUrl = settings.gitlabSvgIconUrl;
  84. exports.gitlabRestPerPage = gitlabRestPerPage = settings.gitlabRestPerPage;
  85. exports.includeAllVariables = includeAllVariables = settings.includeAllVariables || false;
  86. exports.getTheOptionsFrom = getTheOptionsFrom = settings.getTheOptionsFrom || 'merge_both';
  87. exports.autoShowDropDown = autoShowDropDown = settings.autoShowDropDown || true;
  88. exports.enableMarkdownVarDescription = enableMarkdownVarDescription = settings.enableMarkdownVarDescription || true;
  89. exports.sortVarByName = sortVarByName = settings.sortVarByName || false;
  90. exports.replaceEnterWithN = replaceEnterWithN = settings.replaceEnterWithN || true;
  91. }
  92. const saveGitlabToken = (token) => {
  93. localStorage.setItem(gitlabTokenLocalStorageKey, window.btoa(token));
  94. };
  95. exports.saveGitlabToken = saveGitlabToken;
  96. const saveGitlabToolSettings = (settings) => {
  97. const oldSettings = JSON.parse(localStorage.getItem(gitlabToolSettingsLSKey) || '');
  98. const newSettings = Object.assign(Object.assign({}, oldSettings), settings);
  99. localStorage.setItem(gitlabToolSettingsLSKey, JSON.stringify(newSettings));
  100. };
  101. exports.saveGitlabToolSettings = saveGitlabToolSettings;
  102. exports["default"] = {
  103. gitlabTokenLocalStorageKey,
  104. gitlabUrl,
  105. gitlabApiUrl,
  106. gitlabGraphqlUrl,
  107. gitlabProjectId,
  108. gitlabToken,
  109. gitlabSvgIconUrl,
  110. gitlabRestPerPage,
  111. gitlabDefaultPipelineSchedule,
  112. wrappedVarBy,
  113. includeAllVariables,
  114. getTheOptionsFrom,
  115. autoShowDropDown,
  116. enableMarkdownVarDescription,
  117. sortVarByName,
  118. replaceEnterWithN,
  119. saveGitlabToken,
  120. saveGitlabToolSettings,
  121. };
  122.  
  123.  
  124. /***/ }),
  125. /* 1 */
  126. /***/ (function(module, exports) {
  127.  
  128. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  129. * jQuery JavaScript Library v3.7.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/animatedSelector,-effects/Tween
  130. * https://jquery.com/
  131. *
  132. * Copyright OpenJS Foundation and other contributors
  133. * Released under the MIT license
  134. * https://jquery.org/license
  135. *
  136. * Date: 2023-08-28T13:37Z
  137. */
  138. ( function( global, factory ) {
  139.  
  140. "use strict";
  141.  
  142. if ( true && typeof module.exports === "object" ) {
  143.  
  144. // For CommonJS and CommonJS-like environments where a proper `window`
  145. // is present, execute the factory and get jQuery.
  146. // For environments that do not have a `window` with a `document`
  147. // (such as Node.js), expose a factory as module.exports.
  148. // This accentuates the need for the creation of a real `window`.
  149. // e.g. var jQuery = require("jquery")(window);
  150. // See ticket trac-14549 for more info.
  151. module.exports = global.document ?
  152. factory( global, true ) :
  153. function( w ) {
  154. if ( !w.document ) {
  155. throw new Error( "jQuery requires a window with a document" );
  156. }
  157. return factory( w );
  158. };
  159. } else {
  160. factory( global );
  161. }
  162.  
  163. // Pass this if window is not defined yet
  164. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  165.  
  166. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  167. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  168. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  169. // enough that all such attempts are guarded in a try block.
  170. "use strict";
  171.  
  172. var arr = [];
  173.  
  174. var getProto = Object.getPrototypeOf;
  175.  
  176. var slice = arr.slice;
  177.  
  178. var flat = arr.flat ? function( array ) {
  179. return arr.flat.call( array );
  180. } : function( array ) {
  181. return arr.concat.apply( [], array );
  182. };
  183.  
  184.  
  185. var push = arr.push;
  186.  
  187. var indexOf = arr.indexOf;
  188.  
  189. var class2type = {};
  190.  
  191. var toString = class2type.toString;
  192.  
  193. var hasOwn = class2type.hasOwnProperty;
  194.  
  195. var fnToString = hasOwn.toString;
  196.  
  197. var ObjectFunctionString = fnToString.call( Object );
  198.  
  199. var support = {};
  200.  
  201. var isFunction = function isFunction( obj ) {
  202.  
  203. // Support: Chrome <=57, Firefox <=52
  204. // In some browsers, typeof returns "function" for HTML <object> elements
  205. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  206. // We don't want to classify *any* DOM node as a function.
  207. // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
  208. // Plus for old WebKit, typeof returns "function" for HTML collections
  209. // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
  210. return typeof obj === "function" && typeof obj.nodeType !== "number" &&
  211. typeof obj.item !== "function";
  212. };
  213.  
  214.  
  215. var isWindow = function isWindow( obj ) {
  216. return obj != null && obj === obj.window;
  217. };
  218.  
  219.  
  220. var document = window.document;
  221.  
  222.  
  223.  
  224. var preservedScriptAttributes = {
  225. type: true,
  226. src: true,
  227. nonce: true,
  228. noModule: true
  229. };
  230.  
  231. function DOMEval( code, node, doc ) {
  232. doc = doc || document;
  233.  
  234. var i, val,
  235. script = doc.createElement( "script" );
  236.  
  237. script.text = code;
  238. if ( node ) {
  239. for ( i in preservedScriptAttributes ) {
  240.  
  241. // Support: Firefox 64+, Edge 18+
  242. // Some browsers don't support the "nonce" property on scripts.
  243. // On the other hand, just using `getAttribute` is not enough as
  244. // the `nonce` attribute is reset to an empty string whenever it
  245. // becomes browsing-context connected.
  246. // See https://github.com/whatwg/html/issues/2369
  247. // See https://html.spec.whatwg.org/#nonce-attributes
  248. // The `node.getAttribute` check was added for the sake of
  249. // `jQuery.globalEval` so that it can fake a nonce-containing node
  250. // via an object.
  251. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  252. if ( val ) {
  253. script.setAttribute( i, val );
  254. }
  255. }
  256. }
  257. doc.head.appendChild( script ).parentNode.removeChild( script );
  258. }
  259.  
  260.  
  261. function toType( obj ) {
  262. if ( obj == null ) {
  263. return obj + "";
  264. }
  265.  
  266. // Support: Android <=2.3 only (functionish RegExp)
  267. return typeof obj === "object" || typeof obj === "function" ?
  268. class2type[ toString.call( obj ) ] || "object" :
  269. typeof obj;
  270. }
  271. /* global Symbol */
  272. // Defining this global in .eslintrc.json would create a danger of using the global
  273. // unguarded in another place, it seems safer to define global only for this module
  274.  
  275.  
  276.  
  277. var version = "3.7.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/animatedSelector,-effects/Tween",
  278.  
  279. rhtmlSuffix = /HTML$/i,
  280.  
  281. // Define a local copy of jQuery
  282. jQuery = function( selector, context ) {
  283.  
  284. // The jQuery object is actually just the init constructor 'enhanced'
  285. // Need init if jQuery is called (just allow error to be thrown if not included)
  286. return new jQuery.fn.init( selector, context );
  287. };
  288.  
  289. jQuery.fn = jQuery.prototype = {
  290.  
  291. // The current version of jQuery being used
  292. jquery: version,
  293.  
  294. constructor: jQuery,
  295.  
  296. // The default length of a jQuery object is 0
  297. length: 0,
  298.  
  299. toArray: function() {
  300. return slice.call( this );
  301. },
  302.  
  303. // Get the Nth element in the matched element set OR
  304. // Get the whole matched element set as a clean array
  305. get: function( num ) {
  306.  
  307. // Return all the elements in a clean array
  308. if ( num == null ) {
  309. return slice.call( this );
  310. }
  311.  
  312. // Return just the one element from the set
  313. return num < 0 ? this[ num + this.length ] : this[ num ];
  314. },
  315.  
  316. // Take an array of elements and push it onto the stack
  317. // (returning the new matched element set)
  318. pushStack: function( elems ) {
  319.  
  320. // Build a new jQuery matched element set
  321. var ret = jQuery.merge( this.constructor(), elems );
  322.  
  323. // Add the old object onto the stack (as a reference)
  324. ret.prevObject = this;
  325.  
  326. // Return the newly-formed element set
  327. return ret;
  328. },
  329.  
  330. // Execute a callback for every element in the matched set.
  331. each: function( callback ) {
  332. return jQuery.each( this, callback );
  333. },
  334.  
  335. map: function( callback ) {
  336. return this.pushStack( jQuery.map( this, function( elem, i ) {
  337. return callback.call( elem, i, elem );
  338. } ) );
  339. },
  340.  
  341. slice: function() {
  342. return this.pushStack( slice.apply( this, arguments ) );
  343. },
  344.  
  345. first: function() {
  346. return this.eq( 0 );
  347. },
  348.  
  349. last: function() {
  350. return this.eq( -1 );
  351. },
  352.  
  353. even: function() {
  354. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  355. return ( i + 1 ) % 2;
  356. } ) );
  357. },
  358.  
  359. odd: function() {
  360. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  361. return i % 2;
  362. } ) );
  363. },
  364.  
  365. eq: function( i ) {
  366. var len = this.length,
  367. j = +i + ( i < 0 ? len : 0 );
  368. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  369. },
  370.  
  371. end: function() {
  372. return this.prevObject || this.constructor();
  373. },
  374.  
  375. // For internal use only.
  376. // Behaves like an Array's method, not like a jQuery method.
  377. push: push,
  378. sort: arr.sort,
  379. splice: arr.splice
  380. };
  381.  
  382. jQuery.extend = jQuery.fn.extend = function() {
  383. var options, name, src, copy, copyIsArray, clone,
  384. target = arguments[ 0 ] || {},
  385. i = 1,
  386. length = arguments.length,
  387. deep = false;
  388.  
  389. // Handle a deep copy situation
  390. if ( typeof target === "boolean" ) {
  391. deep = target;
  392.  
  393. // Skip the boolean and the target
  394. target = arguments[ i ] || {};
  395. i++;
  396. }
  397.  
  398. // Handle case when target is a string or something (possible in deep copy)
  399. if ( typeof target !== "object" && !isFunction( target ) ) {
  400. target = {};
  401. }
  402.  
  403. // Extend jQuery itself if only one argument is passed
  404. if ( i === length ) {
  405. target = this;
  406. i--;
  407. }
  408.  
  409. for ( ; i < length; i++ ) {
  410.  
  411. // Only deal with non-null/undefined values
  412. if ( ( options = arguments[ i ] ) != null ) {
  413.  
  414. // Extend the base object
  415. for ( name in options ) {
  416. copy = options[ name ];
  417.  
  418. // Prevent Object.prototype pollution
  419. // Prevent never-ending loop
  420. if ( name === "__proto__" || target === copy ) {
  421. continue;
  422. }
  423.  
  424. // Recurse if we're merging plain objects or arrays
  425. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  426. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  427. src = target[ name ];
  428.  
  429. // Ensure proper type for the source value
  430. if ( copyIsArray && !Array.isArray( src ) ) {
  431. clone = [];
  432. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  433. clone = {};
  434. } else {
  435. clone = src;
  436. }
  437. copyIsArray = false;
  438.  
  439. // Never move original objects, clone them
  440. target[ name ] = jQuery.extend( deep, clone, copy );
  441.  
  442. // Don't bring in undefined values
  443. } else if ( copy !== undefined ) {
  444. target[ name ] = copy;
  445. }
  446. }
  447. }
  448. }
  449.  
  450. // Return the modified object
  451. return target;
  452. };
  453.  
  454. jQuery.extend( {
  455.  
  456. // Unique for each copy of jQuery on the page
  457. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  458.  
  459. // Assume jQuery is ready without the ready module
  460. isReady: true,
  461.  
  462. error: function( msg ) {
  463. throw new Error( msg );
  464. },
  465.  
  466. noop: function() {},
  467.  
  468. isPlainObject: function( obj ) {
  469. var proto, Ctor;
  470.  
  471. // Detect obvious negatives
  472. // Use toString instead of jQuery.type to catch host objects
  473. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  474. return false;
  475. }
  476.  
  477. proto = getProto( obj );
  478.  
  479. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  480. if ( !proto ) {
  481. return true;
  482. }
  483.  
  484. // Objects with prototype are plain iff they were constructed by a global Object function
  485. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  486. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  487. },
  488.  
  489. isEmptyObject: function( obj ) {
  490. var name;
  491.  
  492. for ( name in obj ) {
  493. return false;
  494. }
  495. return true;
  496. },
  497.  
  498. // Evaluates a script in a provided context; falls back to the global one
  499. // if not specified.
  500. globalEval: function( code, options, doc ) {
  501. DOMEval( code, { nonce: options && options.nonce }, doc );
  502. },
  503.  
  504. each: function( obj, callback ) {
  505. var length, i = 0;
  506.  
  507. if ( isArrayLike( obj ) ) {
  508. length = obj.length;
  509. for ( ; i < length; i++ ) {
  510. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  511. break;
  512. }
  513. }
  514. } else {
  515. for ( i in obj ) {
  516. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  517. break;
  518. }
  519. }
  520. }
  521.  
  522. return obj;
  523. },
  524.  
  525.  
  526. // Retrieve the text value of an array of DOM nodes
  527. text: function( elem ) {
  528. var node,
  529. ret = "",
  530. i = 0,
  531. nodeType = elem.nodeType;
  532.  
  533. if ( !nodeType ) {
  534.  
  535. // If no nodeType, this is expected to be an array
  536. while ( ( node = elem[ i++ ] ) ) {
  537.  
  538. // Do not traverse comment nodes
  539. ret += jQuery.text( node );
  540. }
  541. }
  542. if ( nodeType === 1 || nodeType === 11 ) {
  543. return elem.textContent;
  544. }
  545. if ( nodeType === 9 ) {
  546. return elem.documentElement.textContent;
  547. }
  548. if ( nodeType === 3 || nodeType === 4 ) {
  549. return elem.nodeValue;
  550. }
  551.  
  552. // Do not include comment or processing instruction nodes
  553.  
  554. return ret;
  555. },
  556.  
  557. // results is for internal usage only
  558. makeArray: function( arr, results ) {
  559. var ret = results || [];
  560.  
  561. if ( arr != null ) {
  562. if ( isArrayLike( Object( arr ) ) ) {
  563. jQuery.merge( ret,
  564. typeof arr === "string" ?
  565. [ arr ] : arr
  566. );
  567. } else {
  568. push.call( ret, arr );
  569. }
  570. }
  571.  
  572. return ret;
  573. },
  574.  
  575. inArray: function( elem, arr, i ) {
  576. return arr == null ? -1 : indexOf.call( arr, elem, i );
  577. },
  578.  
  579. isXMLDoc: function( elem ) {
  580. var namespace = elem && elem.namespaceURI,
  581. docElem = elem && ( elem.ownerDocument || elem ).documentElement;
  582.  
  583. // Assume HTML when documentElement doesn't yet exist, such as inside
  584. // document fragments.
  585. return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" );
  586. },
  587.  
  588. // Support: Android <=4.0 only, PhantomJS 1 only
  589. // push.apply(_, arraylike) throws on ancient WebKit
  590. merge: function( first, second ) {
  591. var len = +second.length,
  592. j = 0,
  593. i = first.length;
  594.  
  595. for ( ; j < len; j++ ) {
  596. first[ i++ ] = second[ j ];
  597. }
  598.  
  599. first.length = i;
  600.  
  601. return first;
  602. },
  603.  
  604. grep: function( elems, callback, invert ) {
  605. var callbackInverse,
  606. matches = [],
  607. i = 0,
  608. length = elems.length,
  609. callbackExpect = !invert;
  610.  
  611. // Go through the array, only saving the items
  612. // that pass the validator function
  613. for ( ; i < length; i++ ) {
  614. callbackInverse = !callback( elems[ i ], i );
  615. if ( callbackInverse !== callbackExpect ) {
  616. matches.push( elems[ i ] );
  617. }
  618. }
  619.  
  620. return matches;
  621. },
  622.  
  623. // arg is for internal usage only
  624. map: function( elems, callback, arg ) {
  625. var length, value,
  626. i = 0,
  627. ret = [];
  628.  
  629. // Go through the array, translating each of the items to their new values
  630. if ( isArrayLike( elems ) ) {
  631. length = elems.length;
  632. for ( ; i < length; i++ ) {
  633. value = callback( elems[ i ], i, arg );
  634.  
  635. if ( value != null ) {
  636. ret.push( value );
  637. }
  638. }
  639.  
  640. // Go through every key on the object,
  641. } else {
  642. for ( i in elems ) {
  643. value = callback( elems[ i ], i, arg );
  644.  
  645. if ( value != null ) {
  646. ret.push( value );
  647. }
  648. }
  649. }
  650.  
  651. // Flatten any nested arrays
  652. return flat( ret );
  653. },
  654.  
  655. // A global GUID counter for objects
  656. guid: 1,
  657.  
  658. // jQuery.support is not used in Core but other projects attach their
  659. // properties to it so it needs to exist.
  660. support: support
  661. } );
  662.  
  663. if ( typeof Symbol === "function" ) {
  664. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  665. }
  666.  
  667. // Populate the class2type map
  668. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  669. function( _i, name ) {
  670. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  671. } );
  672.  
  673. function isArrayLike( obj ) {
  674.  
  675. // Support: real iOS 8.2 only (not reproducible in simulator)
  676. // `in` check used to prevent JIT error (gh-2145)
  677. // hasOwn isn't used here due to false negatives
  678. // regarding Nodelist length in IE
  679. var length = !!obj && "length" in obj && obj.length,
  680. type = toType( obj );
  681.  
  682. if ( isFunction( obj ) || isWindow( obj ) ) {
  683. return false;
  684. }
  685.  
  686. return type === "array" || length === 0 ||
  687. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  688. }
  689.  
  690.  
  691. function nodeName( elem, name ) {
  692.  
  693. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  694.  
  695. }
  696. var pop = arr.pop;
  697.  
  698.  
  699. var sort = arr.sort;
  700.  
  701.  
  702. var splice = arr.splice;
  703.  
  704.  
  705. var whitespace = "[\\x20\\t\\r\\n\\f]";
  706.  
  707.  
  708. var rtrimCSS = new RegExp(
  709. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  710. "g"
  711. );
  712.  
  713.  
  714.  
  715.  
  716. // Note: an element does not contain itself
  717. jQuery.contains = function( a, b ) {
  718. var bup = b && b.parentNode;
  719.  
  720. return a === bup || !!( bup && bup.nodeType === 1 && (
  721.  
  722. // Support: IE 9 - 11+
  723. // IE doesn't have `contains` on SVG.
  724. a.contains ?
  725. a.contains( bup ) :
  726. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  727. ) );
  728. };
  729.  
  730.  
  731.  
  732.  
  733. // CSS string/identifier serialization
  734. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  735. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  736.  
  737. function fcssescape( ch, asCodePoint ) {
  738. if ( asCodePoint ) {
  739.  
  740. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  741. if ( ch === "\0" ) {
  742. return "\uFFFD";
  743. }
  744.  
  745. // Control characters and (dependent upon position) numbers get escaped as code points
  746. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  747. }
  748.  
  749. // Other potentially-special ASCII characters get backslash-escaped
  750. return "\\" + ch;
  751. }
  752.  
  753. jQuery.escapeSelector = function( sel ) {
  754. return ( sel + "" ).replace( rcssescape, fcssescape );
  755. };
  756.  
  757.  
  758.  
  759.  
  760. var preferredDoc = document,
  761. pushNative = push;
  762.  
  763. ( function() {
  764.  
  765. var i,
  766. Expr,
  767. outermostContext,
  768. sortInput,
  769. hasDuplicate,
  770. push = pushNative,
  771.  
  772. // Local document vars
  773. document,
  774. documentElement,
  775. documentIsHTML,
  776. rbuggyQSA,
  777. matches,
  778.  
  779. // Instance-specific data
  780. expando = jQuery.expando,
  781. dirruns = 0,
  782. done = 0,
  783. classCache = createCache(),
  784. tokenCache = createCache(),
  785. compilerCache = createCache(),
  786. nonnativeSelectorCache = createCache(),
  787. sortOrder = function( a, b ) {
  788. if ( a === b ) {
  789. hasDuplicate = true;
  790. }
  791. return 0;
  792. },
  793.  
  794. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
  795. "loop|multiple|open|readonly|required|scoped",
  796.  
  797. // Regular expressions
  798.  
  799. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  800. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  801. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  802.  
  803. // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
  804. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  805.  
  806. // Operator (capture 2)
  807. "*([*^$|!~]?=)" + whitespace +
  808.  
  809. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  810. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  811. whitespace + "*\\]",
  812.  
  813. pseudos = ":(" + identifier + ")(?:\\((" +
  814.  
  815. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  816. // 1. quoted (capture 3; capture 4 or capture 5)
  817. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  818.  
  819. // 2. simple (capture 6)
  820. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  821.  
  822. // 3. anything else (capture 2)
  823. ".*" +
  824. ")\\)|)",
  825.  
  826. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  827. rwhitespace = new RegExp( whitespace + "+", "g" ),
  828.  
  829. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  830. rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
  831. whitespace + "*" ),
  832. rdescend = new RegExp( whitespace + "|>" ),
  833.  
  834. rpseudo = new RegExp( pseudos ),
  835. ridentifier = new RegExp( "^" + identifier + "$" ),
  836.  
  837. matchExpr = {
  838. ID: new RegExp( "^#(" + identifier + ")" ),
  839. CLASS: new RegExp( "^\\.(" + identifier + ")" ),
  840. TAG: new RegExp( "^(" + identifier + "|[*])" ),
  841. ATTR: new RegExp( "^" + attributes ),
  842. PSEUDO: new RegExp( "^" + pseudos ),
  843. CHILD: new RegExp(
  844. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  845. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  846. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  847. bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
  848.  
  849. // For use in libraries implementing .is()
  850. // We use this for POS matching in `select`
  851. needsContext: new RegExp( "^" + whitespace +
  852. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  853. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  854. },
  855.  
  856. rinputs = /^(?:input|select|textarea|button)$/i,
  857. rheader = /^h\d$/i,
  858.  
  859. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  860. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  861.  
  862. rsibling = /[+~]/,
  863.  
  864. // CSS escapes
  865. // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  866. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
  867. "?|\\\\([^\\r\\n\\f])", "g" ),
  868. funescape = function( escape, nonHex ) {
  869. var high = "0x" + escape.slice( 1 ) - 0x10000;
  870.  
  871. if ( nonHex ) {
  872.  
  873. // Strip the backslash prefix from a non-hex escape sequence
  874. return nonHex;
  875. }
  876.  
  877. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  878. // Support: IE <=11+
  879. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  880. // surrogate pair
  881. return high < 0 ?
  882. String.fromCharCode( high + 0x10000 ) :
  883. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  884. },
  885.  
  886. // Used for iframes; see `setDocument`.
  887. // Support: IE 9 - 11+, Edge 12 - 18+
  888. // Removing the function wrapper causes a "Permission Denied"
  889. // error in IE/Edge.
  890. unloadHandler = function() {
  891. setDocument();
  892. },
  893.  
  894. inDisabledFieldset = addCombinator(
  895. function( elem ) {
  896. return elem.disabled === true && nodeName( elem, "fieldset" );
  897. },
  898. { dir: "parentNode", next: "legend" }
  899. );
  900.  
  901. // Support: IE <=9 only
  902. // Accessing document.activeElement can throw unexpectedly
  903. // https://bugs.jquery.com/ticket/13393
  904. function safeActiveElement() {
  905. try {
  906. return document.activeElement;
  907. } catch ( err ) { }
  908. }
  909.  
  910. // Optimize for push.apply( _, NodeList )
  911. try {
  912. push.apply(
  913. ( arr = slice.call( preferredDoc.childNodes ) ),
  914. preferredDoc.childNodes
  915. );
  916.  
  917. // Support: Android <=4.0
  918. // Detect silently failing push.apply
  919. // eslint-disable-next-line no-unused-expressions
  920. arr[ preferredDoc.childNodes.length ].nodeType;
  921. } catch ( e ) {
  922. push = {
  923. apply: function( target, els ) {
  924. pushNative.apply( target, slice.call( els ) );
  925. },
  926. call: function( target ) {
  927. pushNative.apply( target, slice.call( arguments, 1 ) );
  928. }
  929. };
  930. }
  931.  
  932. function find( selector, context, results, seed ) {
  933. var m, i, elem, nid, match, groups, newSelector,
  934. newContext = context && context.ownerDocument,
  935.  
  936. // nodeType defaults to 9, since context defaults to document
  937. nodeType = context ? context.nodeType : 9;
  938.  
  939. results = results || [];
  940.  
  941. // Return early from calls with invalid selector or context
  942. if ( typeof selector !== "string" || !selector ||
  943. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  944.  
  945. return results;
  946. }
  947.  
  948. // Try to shortcut find operations (as opposed to filters) in HTML documents
  949. if ( !seed ) {
  950. setDocument( context );
  951. context = context || document;
  952.  
  953. if ( documentIsHTML ) {
  954.  
  955. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  956. // (excepting DocumentFragment context, where the methods don't exist)
  957. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  958.  
  959. // ID selector
  960. if ( ( m = match[ 1 ] ) ) {
  961.  
  962. // Document context
  963. if ( nodeType === 9 ) {
  964. if ( ( elem = context.getElementById( m ) ) ) {
  965.  
  966. // Support: IE 9 only
  967. // getElementById can match elements by name instead of ID
  968. if ( elem.id === m ) {
  969. push.call( results, elem );
  970. return results;
  971. }
  972. } else {
  973. return results;
  974. }
  975.  
  976. // Element context
  977. } else {
  978.  
  979. // Support: IE 9 only
  980. // getElementById can match elements by name instead of ID
  981. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  982. find.contains( context, elem ) &&
  983. elem.id === m ) {
  984.  
  985. push.call( results, elem );
  986. return results;
  987. }
  988. }
  989.  
  990. // Type selector
  991. } else if ( match[ 2 ] ) {
  992. push.apply( results, context.getElementsByTagName( selector ) );
  993. return results;
  994.  
  995. // Class selector
  996. } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {
  997. push.apply( results, context.getElementsByClassName( m ) );
  998. return results;
  999. }
  1000. }
  1001.  
  1002. // Take advantage of querySelectorAll
  1003. if ( !nonnativeSelectorCache[ selector + " " ] &&
  1004. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {
  1005.  
  1006. newSelector = selector;
  1007. newContext = context;
  1008.  
  1009. // qSA considers elements outside a scoping root when evaluating child or
  1010. // descendant combinators, which is not what we want.
  1011. // In such cases, we work around the behavior by prefixing every selector in the
  1012. // list with an ID selector referencing the scope context.
  1013. // The technique has to be used as well when a leading combinator is used
  1014. // as such selectors are not recognized by querySelectorAll.
  1015. // Thanks to Andrew Dupont for this technique.
  1016. if ( nodeType === 1 &&
  1017. ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
  1018.  
  1019. // Expand context for sibling selectors
  1020. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  1021. context;
  1022.  
  1023. // We can use :scope instead of the ID hack if the browser
  1024. // supports it & if we're not changing the context.
  1025. // Support: IE 11+, Edge 17 - 18+
  1026. // IE/Edge sometimes throw a "Permission denied" error when
  1027. // strict-comparing two documents; shallow comparisons work.
  1028. // eslint-disable-next-line eqeqeq
  1029. if ( newContext != context || !support.scope ) {
  1030.  
  1031. // Capture the context ID, setting it first if necessary
  1032. if ( ( nid = context.getAttribute( "id" ) ) ) {
  1033. nid = jQuery.escapeSelector( nid );
  1034. } else {
  1035. context.setAttribute( "id", ( nid = expando ) );
  1036. }
  1037. }
  1038.  
  1039. // Prefix every selector in the list
  1040. groups = tokenize( selector );
  1041. i = groups.length;
  1042. while ( i-- ) {
  1043. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  1044. toSelector( groups[ i ] );
  1045. }
  1046. newSelector = groups.join( "," );
  1047. }
  1048.  
  1049. try {
  1050. push.apply( results,
  1051. newContext.querySelectorAll( newSelector )
  1052. );
  1053. return results;
  1054. } catch ( qsaError ) {
  1055. nonnativeSelectorCache( selector, true );
  1056. } finally {
  1057. if ( nid === expando ) {
  1058. context.removeAttribute( "id" );
  1059. }
  1060. }
  1061. }
  1062. }
  1063. }
  1064.  
  1065. // All others
  1066. return select( selector.replace( rtrimCSS, "$1" ), context, results, seed );
  1067. }
  1068.  
  1069. /**
  1070. * Create key-value caches of limited size
  1071. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  1072. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  1073. * deleting the oldest entry
  1074. */
  1075. function createCache() {
  1076. var keys = [];
  1077.  
  1078. function cache( key, value ) {
  1079.  
  1080. // Use (key + " ") to avoid collision with native prototype properties
  1081. // (see https://github.com/jquery/sizzle/issues/157)
  1082. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  1083.  
  1084. // Only keep the most recent entries
  1085. delete cache[ keys.shift() ];
  1086. }
  1087. return ( cache[ key + " " ] = value );
  1088. }
  1089. return cache;
  1090. }
  1091.  
  1092. /**
  1093. * Mark a function for special use by jQuery selector module
  1094. * @param {Function} fn The function to mark
  1095. */
  1096. function markFunction( fn ) {
  1097. fn[ expando ] = true;
  1098. return fn;
  1099. }
  1100.  
  1101. /**
  1102. * Support testing using an element
  1103. * @param {Function} fn Passed the created element and returns a boolean result
  1104. */
  1105. function assert( fn ) {
  1106. var el = document.createElement( "fieldset" );
  1107.  
  1108. try {
  1109. return !!fn( el );
  1110. } catch ( e ) {
  1111. return false;
  1112. } finally {
  1113.  
  1114. // Remove from its parent by default
  1115. if ( el.parentNode ) {
  1116. el.parentNode.removeChild( el );
  1117. }
  1118.  
  1119. // release memory in IE
  1120. el = null;
  1121. }
  1122. }
  1123.  
  1124. /**
  1125. * Returns a function to use in pseudos for input types
  1126. * @param {String} type
  1127. */
  1128. function createInputPseudo( type ) {
  1129. return function( elem ) {
  1130. return nodeName( elem, "input" ) && elem.type === type;
  1131. };
  1132. }
  1133.  
  1134. /**
  1135. * Returns a function to use in pseudos for buttons
  1136. * @param {String} type
  1137. */
  1138. function createButtonPseudo( type ) {
  1139. return function( elem ) {
  1140. return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) &&
  1141. elem.type === type;
  1142. };
  1143. }
  1144.  
  1145. /**
  1146. * Returns a function to use in pseudos for :enabled/:disabled
  1147. * @param {Boolean} disabled true for :disabled; false for :enabled
  1148. */
  1149. function createDisabledPseudo( disabled ) {
  1150.  
  1151. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  1152. return function( elem ) {
  1153.  
  1154. // Only certain elements can match :enabled or :disabled
  1155. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  1156. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  1157. if ( "form" in elem ) {
  1158.  
  1159. // Check for inherited disabledness on relevant non-disabled elements:
  1160. // * listed form-associated elements in a disabled fieldset
  1161. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  1162. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  1163. // * option elements in a disabled optgroup
  1164. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  1165. // All such elements have a "form" property.
  1166. if ( elem.parentNode && elem.disabled === false ) {
  1167.  
  1168. // Option elements defer to a parent optgroup if present
  1169. if ( "label" in elem ) {
  1170. if ( "label" in elem.parentNode ) {
  1171. return elem.parentNode.disabled === disabled;
  1172. } else {
  1173. return elem.disabled === disabled;
  1174. }
  1175. }
  1176.  
  1177. // Support: IE 6 - 11+
  1178. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  1179. return elem.isDisabled === disabled ||
  1180.  
  1181. // Where there is no isDisabled, check manually
  1182. elem.isDisabled !== !disabled &&
  1183. inDisabledFieldset( elem ) === disabled;
  1184. }
  1185.  
  1186. return elem.disabled === disabled;
  1187.  
  1188. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  1189. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  1190. // even exist on them, let alone have a boolean value.
  1191. } else if ( "label" in elem ) {
  1192. return elem.disabled === disabled;
  1193. }
  1194.  
  1195. // Remaining elements are neither :enabled nor :disabled
  1196. return false;
  1197. };
  1198. }
  1199.  
  1200. /**
  1201. * Returns a function to use in pseudos for positionals
  1202. * @param {Function} fn
  1203. */
  1204. function createPositionalPseudo( fn ) {
  1205. return markFunction( function( argument ) {
  1206. argument = +argument;
  1207. return markFunction( function( seed, matches ) {
  1208. var j,
  1209. matchIndexes = fn( [], seed.length, argument ),
  1210. i = matchIndexes.length;
  1211.  
  1212. // Match elements found at the specified indexes
  1213. while ( i-- ) {
  1214. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  1215. seed[ j ] = !( matches[ j ] = seed[ j ] );
  1216. }
  1217. }
  1218. } );
  1219. } );
  1220. }
  1221.  
  1222. /**
  1223. * Checks a node for validity as a jQuery selector context
  1224. * @param {Element|Object=} context
  1225. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  1226. */
  1227. function testContext( context ) {
  1228. return context && typeof context.getElementsByTagName !== "undefined" && context;
  1229. }
  1230.  
  1231. /**
  1232. * Sets document-related variables once based on the current document
  1233. * @param {Element|Object} [node] An element or document object to use to set the document
  1234. * @returns {Object} Returns the current document
  1235. */
  1236. function setDocument( node ) {
  1237. var subWindow,
  1238. doc = node ? node.ownerDocument || node : preferredDoc;
  1239.  
  1240. // Return early if doc is invalid or already selected
  1241. // Support: IE 11+, Edge 17 - 18+
  1242. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1243. // two documents; shallow comparisons work.
  1244. // eslint-disable-next-line eqeqeq
  1245. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  1246. return document;
  1247. }
  1248.  
  1249. // Update global variables
  1250. document = doc;
  1251. documentElement = document.documentElement;
  1252. documentIsHTML = !jQuery.isXMLDoc( document );
  1253.  
  1254. // Support: iOS 7 only, IE 9 - 11+
  1255. // Older browsers didn't support unprefixed `matches`.
  1256. matches = documentElement.matches ||
  1257. documentElement.webkitMatchesSelector ||
  1258. documentElement.msMatchesSelector;
  1259.  
  1260. // Support: IE 9 - 11+, Edge 12 - 18+
  1261. // Accessing iframe documents after unload throws "permission denied" errors
  1262. // (see trac-13936).
  1263. // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,
  1264. // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.
  1265. if ( documentElement.msMatchesSelector &&
  1266.  
  1267. // Support: IE 11+, Edge 17 - 18+
  1268. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1269. // two documents; shallow comparisons work.
  1270. // eslint-disable-next-line eqeqeq
  1271. preferredDoc != document &&
  1272. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  1273.  
  1274. // Support: IE 9 - 11+, Edge 12 - 18+
  1275. subWindow.addEventListener( "unload", unloadHandler );
  1276. }
  1277.  
  1278. // Support: IE <10
  1279. // Check if getElementById returns elements by name
  1280. // The broken getElementById methods don't pick up programmatically-set names,
  1281. // so use a roundabout getElementsByName test
  1282. support.getById = assert( function( el ) {
  1283. documentElement.appendChild( el ).id = jQuery.expando;
  1284. return !document.getElementsByName ||
  1285. !document.getElementsByName( jQuery.expando ).length;
  1286. } );
  1287.  
  1288. // Support: IE 9 only
  1289. // Check to see if it's possible to do matchesSelector
  1290. // on a disconnected node.
  1291. support.disconnectedMatch = assert( function( el ) {
  1292. return matches.call( el, "*" );
  1293. } );
  1294.  
  1295. // Support: IE 9 - 11+, Edge 12 - 18+
  1296. // IE/Edge don't support the :scope pseudo-class.
  1297. support.scope = assert( function() {
  1298. return document.querySelectorAll( ":scope" );
  1299. } );
  1300.  
  1301. // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
  1302. // Make sure the `:has()` argument is parsed unforgivingly.
  1303. // We include `*` in the test to detect buggy implementations that are
  1304. // _selectively_ forgiving (specifically when the list includes at least
  1305. // one valid selector).
  1306. // Note that we treat complete lack of support for `:has()` as if it were
  1307. // spec-compliant support, which is fine because use of `:has()` in such
  1308. // environments will fail in the qSA path and fall back to jQuery traversal
  1309. // anyway.
  1310. support.cssHas = assert( function() {
  1311. try {
  1312. document.querySelector( ":has(*,:jqfake)" );
  1313. return false;
  1314. } catch ( e ) {
  1315. return true;
  1316. }
  1317. } );
  1318.  
  1319. // ID filter and find
  1320. if ( support.getById ) {
  1321. Expr.filter.ID = function( id ) {
  1322. var attrId = id.replace( runescape, funescape );
  1323. return function( elem ) {
  1324. return elem.getAttribute( "id" ) === attrId;
  1325. };
  1326. };
  1327. Expr.find.ID = function( id, context ) {
  1328. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1329. var elem = context.getElementById( id );
  1330. return elem ? [ elem ] : [];
  1331. }
  1332. };
  1333. } else {
  1334. Expr.filter.ID = function( id ) {
  1335. var attrId = id.replace( runescape, funescape );
  1336. return function( elem ) {
  1337. var node = typeof elem.getAttributeNode !== "undefined" &&
  1338. elem.getAttributeNode( "id" );
  1339. return node && node.value === attrId;
  1340. };
  1341. };
  1342.  
  1343. // Support: IE 6 - 7 only
  1344. // getElementById is not reliable as a find shortcut
  1345. Expr.find.ID = function( id, context ) {
  1346. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1347. var node, i, elems,
  1348. elem = context.getElementById( id );
  1349.  
  1350. if ( elem ) {
  1351.  
  1352. // Verify the id attribute
  1353. node = elem.getAttributeNode( "id" );
  1354. if ( node && node.value === id ) {
  1355. return [ elem ];
  1356. }
  1357.  
  1358. // Fall back on getElementsByName
  1359. elems = context.getElementsByName( id );
  1360. i = 0;
  1361. while ( ( elem = elems[ i++ ] ) ) {
  1362. node = elem.getAttributeNode( "id" );
  1363. if ( node && node.value === id ) {
  1364. return [ elem ];
  1365. }
  1366. }
  1367. }
  1368.  
  1369. return [];
  1370. }
  1371. };
  1372. }
  1373.  
  1374. // Tag
  1375. Expr.find.TAG = function( tag, context ) {
  1376. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1377. return context.getElementsByTagName( tag );
  1378.  
  1379. // DocumentFragment nodes don't have gEBTN
  1380. } else {
  1381. return context.querySelectorAll( tag );
  1382. }
  1383. };
  1384.  
  1385. // Class
  1386. Expr.find.CLASS = function( className, context ) {
  1387. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1388. return context.getElementsByClassName( className );
  1389. }
  1390. };
  1391.  
  1392. /* QSA/matchesSelector
  1393. ---------------------------------------------------------------------- */
  1394.  
  1395. // QSA and matchesSelector support
  1396.  
  1397. rbuggyQSA = [];
  1398.  
  1399. // Build QSA regex
  1400. // Regex strategy adopted from Diego Perini
  1401. assert( function( el ) {
  1402.  
  1403. var input;
  1404.  
  1405. documentElement.appendChild( el ).innerHTML =
  1406. "<a id='" + expando + "' href='' disabled='disabled'></a>" +
  1407. "<select id='" + expando + "-\r\\' disabled='disabled'>" +
  1408. "<option selected=''></option></select>";
  1409.  
  1410. // Support: iOS <=7 - 8 only
  1411. // Boolean attributes and "value" are not treated correctly in some XML documents
  1412. if ( !el.querySelectorAll( "[selected]" ).length ) {
  1413. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1414. }
  1415.  
  1416. // Support: iOS <=7 - 8 only
  1417. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1418. rbuggyQSA.push( "~=" );
  1419. }
  1420.  
  1421. // Support: iOS 8 only
  1422. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1423. // In-page `selector#id sibling-combinator selector` fails
  1424. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1425. rbuggyQSA.push( ".#.+[+~]" );
  1426. }
  1427.  
  1428. // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
  1429. // In some of the document kinds, these selectors wouldn't work natively.
  1430. // This is probably OK but for backwards compatibility we want to maintain
  1431. // handling them through jQuery traversal in jQuery 3.x.
  1432. if ( !el.querySelectorAll( ":checked" ).length ) {
  1433. rbuggyQSA.push( ":checked" );
  1434. }
  1435.  
  1436. // Support: Windows 8 Native Apps
  1437. // The type and name attributes are restricted during .innerHTML assignment
  1438. input = document.createElement( "input" );
  1439. input.setAttribute( "type", "hidden" );
  1440. el.appendChild( input ).setAttribute( "name", "D" );
  1441.  
  1442. // Support: IE 9 - 11+
  1443. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1444. // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
  1445. // In some of the document kinds, these selectors wouldn't work natively.
  1446. // This is probably OK but for backwards compatibility we want to maintain
  1447. // handling them through jQuery traversal in jQuery 3.x.
  1448. documentElement.appendChild( el ).disabled = true;
  1449. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1450. rbuggyQSA.push( ":enabled", ":disabled" );
  1451. }
  1452.  
  1453. // Support: IE 11+, Edge 15 - 18+
  1454. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  1455. // Adding a temporary attribute to the document before the selection works
  1456. // around the issue.
  1457. // Interestingly, IE 10 & older don't seem to have the issue.
  1458. input = document.createElement( "input" );
  1459. input.setAttribute( "name", "" );
  1460. el.appendChild( input );
  1461. if ( !el.querySelectorAll( "[name='']" ).length ) {
  1462. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  1463. whitespace + "*(?:''|\"\")" );
  1464. }
  1465. } );
  1466.  
  1467. if ( !support.cssHas ) {
  1468.  
  1469. // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
  1470. // Our regular `try-catch` mechanism fails to detect natively-unsupported
  1471. // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
  1472. // in browsers that parse the `:has()` argument as a forgiving selector list.
  1473. // https://drafts.csswg.org/selectors/#relational now requires the argument
  1474. // to be parsed unforgivingly, but browsers have not yet fully adjusted.
  1475. rbuggyQSA.push( ":has" );
  1476. }
  1477.  
  1478. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1479.  
  1480. /* Sorting
  1481. ---------------------------------------------------------------------- */
  1482.  
  1483. // Document order sorting
  1484. sortOrder = function( a, b ) {
  1485.  
  1486. // Flag for duplicate removal
  1487. if ( a === b ) {
  1488. hasDuplicate = true;
  1489. return 0;
  1490. }
  1491.  
  1492. // Sort on method existence if only one input has compareDocumentPosition
  1493. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1494. if ( compare ) {
  1495. return compare;
  1496. }
  1497.  
  1498. // Calculate position if both inputs belong to the same document
  1499. // Support: IE 11+, Edge 17 - 18+
  1500. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1501. // two documents; shallow comparisons work.
  1502. // eslint-disable-next-line eqeqeq
  1503. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  1504. a.compareDocumentPosition( b ) :
  1505.  
  1506. // Otherwise we know they are disconnected
  1507. 1;
  1508.  
  1509. // Disconnected nodes
  1510. if ( compare & 1 ||
  1511. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1512.  
  1513. // Choose the first element that is related to our preferred document
  1514. // Support: IE 11+, Edge 17 - 18+
  1515. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1516. // two documents; shallow comparisons work.
  1517. // eslint-disable-next-line eqeqeq
  1518. if ( a === document || a.ownerDocument == preferredDoc &&
  1519. find.contains( preferredDoc, a ) ) {
  1520. return -1;
  1521. }
  1522.  
  1523. // Support: IE 11+, Edge 17 - 18+
  1524. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1525. // two documents; shallow comparisons work.
  1526. // eslint-disable-next-line eqeqeq
  1527. if ( b === document || b.ownerDocument == preferredDoc &&
  1528. find.contains( preferredDoc, b ) ) {
  1529. return 1;
  1530. }
  1531.  
  1532. // Maintain original order
  1533. return sortInput ?
  1534. ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
  1535. 0;
  1536. }
  1537.  
  1538. return compare & 4 ? -1 : 1;
  1539. };
  1540.  
  1541. return document;
  1542. }
  1543.  
  1544. find.matches = function( expr, elements ) {
  1545. return find( expr, null, null, elements );
  1546. };
  1547.  
  1548. find.matchesSelector = function( elem, expr ) {
  1549. setDocument( elem );
  1550.  
  1551. if ( documentIsHTML &&
  1552. !nonnativeSelectorCache[ expr + " " ] &&
  1553. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1554.  
  1555. try {
  1556. var ret = matches.call( elem, expr );
  1557.  
  1558. // IE 9's matchesSelector returns false on disconnected nodes
  1559. if ( ret || support.disconnectedMatch ||
  1560.  
  1561. // As well, disconnected nodes are said to be in a document
  1562. // fragment in IE 9
  1563. elem.document && elem.document.nodeType !== 11 ) {
  1564. return ret;
  1565. }
  1566. } catch ( e ) {
  1567. nonnativeSelectorCache( expr, true );
  1568. }
  1569. }
  1570.  
  1571. return find( expr, document, null, [ elem ] ).length > 0;
  1572. };
  1573.  
  1574. find.contains = function( context, elem ) {
  1575.  
  1576. // Set document vars if needed
  1577. // Support: IE 11+, Edge 17 - 18+
  1578. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1579. // two documents; shallow comparisons work.
  1580. // eslint-disable-next-line eqeqeq
  1581. if ( ( context.ownerDocument || context ) != document ) {
  1582. setDocument( context );
  1583. }
  1584. return jQuery.contains( context, elem );
  1585. };
  1586.  
  1587.  
  1588. find.attr = function( elem, name ) {
  1589.  
  1590. // Set document vars if needed
  1591. // Support: IE 11+, Edge 17 - 18+
  1592. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1593. // two documents; shallow comparisons work.
  1594. // eslint-disable-next-line eqeqeq
  1595. if ( ( elem.ownerDocument || elem ) != document ) {
  1596. setDocument( elem );
  1597. }
  1598.  
  1599. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1600.  
  1601. // Don't get fooled by Object.prototype properties (see trac-13807)
  1602. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1603. fn( elem, name, !documentIsHTML ) :
  1604. undefined;
  1605.  
  1606. if ( val !== undefined ) {
  1607. return val;
  1608. }
  1609.  
  1610. return elem.getAttribute( name );
  1611. };
  1612.  
  1613. find.error = function( msg ) {
  1614. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1615. };
  1616.  
  1617. /**
  1618. * Document sorting and removing duplicates
  1619. * @param {ArrayLike} results
  1620. */
  1621. jQuery.uniqueSort = function( results ) {
  1622. var elem,
  1623. duplicates = [],
  1624. j = 0,
  1625. i = 0;
  1626.  
  1627. // Unless we *know* we can detect duplicates, assume their presence
  1628. //
  1629. // Support: Android <=4.0+
  1630. // Testing for detecting duplicates is unpredictable so instead assume we can't
  1631. // depend on duplicate detection in all browsers without a stable sort.
  1632. hasDuplicate = !support.sortStable;
  1633. sortInput = !support.sortStable && slice.call( results, 0 );
  1634. sort.call( results, sortOrder );
  1635.  
  1636. if ( hasDuplicate ) {
  1637. while ( ( elem = results[ i++ ] ) ) {
  1638. if ( elem === results[ i ] ) {
  1639. j = duplicates.push( i );
  1640. }
  1641. }
  1642. while ( j-- ) {
  1643. splice.call( results, duplicates[ j ], 1 );
  1644. }
  1645. }
  1646.  
  1647. // Clear input after sorting to release objects
  1648. // See https://github.com/jquery/sizzle/pull/225
  1649. sortInput = null;
  1650.  
  1651. return results;
  1652. };
  1653.  
  1654. jQuery.fn.uniqueSort = function() {
  1655. return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );
  1656. };
  1657.  
  1658. Expr = jQuery.expr = {
  1659.  
  1660. // Can be adjusted by the user
  1661. cacheLength: 50,
  1662.  
  1663. createPseudo: markFunction,
  1664.  
  1665. match: matchExpr,
  1666.  
  1667. attrHandle: {},
  1668.  
  1669. find: {},
  1670.  
  1671. relative: {
  1672. ">": { dir: "parentNode", first: true },
  1673. " ": { dir: "parentNode" },
  1674. "+": { dir: "previousSibling", first: true },
  1675. "~": { dir: "previousSibling" }
  1676. },
  1677.  
  1678. preFilter: {
  1679. ATTR: function( match ) {
  1680. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1681.  
  1682. // Move the given value to match[3] whether quoted or unquoted
  1683. match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" )
  1684. .replace( runescape, funescape );
  1685.  
  1686. if ( match[ 2 ] === "~=" ) {
  1687. match[ 3 ] = " " + match[ 3 ] + " ";
  1688. }
  1689.  
  1690. return match.slice( 0, 4 );
  1691. },
  1692.  
  1693. CHILD: function( match ) {
  1694.  
  1695. /* matches from matchExpr["CHILD"]
  1696. 1 type (only|nth|...)
  1697. 2 what (child|of-type)
  1698. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1699. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1700. 5 sign of xn-component
  1701. 6 x of xn-component
  1702. 7 sign of y-component
  1703. 8 y of y-component
  1704. */
  1705. match[ 1 ] = match[ 1 ].toLowerCase();
  1706.  
  1707. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1708.  
  1709. // nth-* requires argument
  1710. if ( !match[ 3 ] ) {
  1711. find.error( match[ 0 ] );
  1712. }
  1713.  
  1714. // numeric x and y parameters for Expr.filter.CHILD
  1715. // remember that false/true cast respectively to 0/1
  1716. match[ 4 ] = +( match[ 4 ] ?
  1717. match[ 5 ] + ( match[ 6 ] || 1 ) :
  1718. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" )
  1719. );
  1720. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  1721.  
  1722. // other types prohibit arguments
  1723. } else if ( match[ 3 ] ) {
  1724. find.error( match[ 0 ] );
  1725. }
  1726.  
  1727. return match;
  1728. },
  1729.  
  1730. PSEUDO: function( match ) {
  1731. var excess,
  1732. unquoted = !match[ 6 ] && match[ 2 ];
  1733.  
  1734. if ( matchExpr.CHILD.test( match[ 0 ] ) ) {
  1735. return null;
  1736. }
  1737.  
  1738. // Accept quoted arguments as-is
  1739. if ( match[ 3 ] ) {
  1740. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1741.  
  1742. // Strip excess characters from unquoted arguments
  1743. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1744.  
  1745. // Get excess from tokenize (recursively)
  1746. ( excess = tokenize( unquoted, true ) ) &&
  1747.  
  1748. // advance to the next closing parenthesis
  1749. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1750.  
  1751. // excess is a negative index
  1752. match[ 0 ] = match[ 0 ].slice( 0, excess );
  1753. match[ 2 ] = unquoted.slice( 0, excess );
  1754. }
  1755.  
  1756. // Return only captures needed by the pseudo filter method (type and argument)
  1757. return match.slice( 0, 3 );
  1758. }
  1759. },
  1760.  
  1761. filter: {
  1762.  
  1763. TAG: function( nodeNameSelector ) {
  1764. var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1765. return nodeNameSelector === "*" ?
  1766. function() {
  1767. return true;
  1768. } :
  1769. function( elem ) {
  1770. return nodeName( elem, expectedNodeName );
  1771. };
  1772. },
  1773.  
  1774. CLASS: function( className ) {
  1775. var pattern = classCache[ className + " " ];
  1776.  
  1777. return pattern ||
  1778. ( pattern = new RegExp( "(^|" + whitespace + ")" + className +
  1779. "(" + whitespace + "|$)" ) ) &&
  1780. classCache( className, function( elem ) {
  1781. return pattern.test(
  1782. typeof elem.className === "string" && elem.className ||
  1783. typeof elem.getAttribute !== "undefined" &&
  1784. elem.getAttribute( "class" ) ||
  1785. ""
  1786. );
  1787. } );
  1788. },
  1789.  
  1790. ATTR: function( name, operator, check ) {
  1791. return function( elem ) {
  1792. var result = find.attr( elem, name );
  1793.  
  1794. if ( result == null ) {
  1795. return operator === "!=";
  1796. }
  1797. if ( !operator ) {
  1798. return true;
  1799. }
  1800.  
  1801. result += "";
  1802.  
  1803. if ( operator === "=" ) {
  1804. return result === check;
  1805. }
  1806. if ( operator === "!=" ) {
  1807. return result !== check;
  1808. }
  1809. if ( operator === "^=" ) {
  1810. return check && result.indexOf( check ) === 0;
  1811. }
  1812. if ( operator === "*=" ) {
  1813. return check && result.indexOf( check ) > -1;
  1814. }
  1815. if ( operator === "$=" ) {
  1816. return check && result.slice( -check.length ) === check;
  1817. }
  1818. if ( operator === "~=" ) {
  1819. return ( " " + result.replace( rwhitespace, " " ) + " " )
  1820. .indexOf( check ) > -1;
  1821. }
  1822. if ( operator === "|=" ) {
  1823. return result === check || result.slice( 0, check.length + 1 ) === check + "-";
  1824. }
  1825.  
  1826. return false;
  1827. };
  1828. },
  1829.  
  1830. CHILD: function( type, what, _argument, first, last ) {
  1831. var simple = type.slice( 0, 3 ) !== "nth",
  1832. forward = type.slice( -4 ) !== "last",
  1833. ofType = what === "of-type";
  1834.  
  1835. return first === 1 && last === 0 ?
  1836.  
  1837. // Shortcut for :nth-*(n)
  1838. function( elem ) {
  1839. return !!elem.parentNode;
  1840. } :
  1841.  
  1842. function( elem, _context, xml ) {
  1843. var cache, outerCache, node, nodeIndex, start,
  1844. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1845. parent = elem.parentNode,
  1846. name = ofType && elem.nodeName.toLowerCase(),
  1847. useCache = !xml && !ofType,
  1848. diff = false;
  1849.  
  1850. if ( parent ) {
  1851.  
  1852. // :(first|last|only)-(child|of-type)
  1853. if ( simple ) {
  1854. while ( dir ) {
  1855. node = elem;
  1856. while ( ( node = node[ dir ] ) ) {
  1857. if ( ofType ?
  1858. nodeName( node, name ) :
  1859. node.nodeType === 1 ) {
  1860.  
  1861. return false;
  1862. }
  1863. }
  1864.  
  1865. // Reverse direction for :only-* (if we haven't yet done so)
  1866. start = dir = type === "only" && !start && "nextSibling";
  1867. }
  1868. return true;
  1869. }
  1870.  
  1871. start = [ forward ? parent.firstChild : parent.lastChild ];
  1872.  
  1873. // non-xml :nth-child(...) stores cache data on `parent`
  1874. if ( forward && useCache ) {
  1875.  
  1876. // Seek `elem` from a previously-cached index
  1877. outerCache = parent[ expando ] || ( parent[ expando ] = {} );
  1878. cache = outerCache[ type ] || [];
  1879. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1880. diff = nodeIndex && cache[ 2 ];
  1881. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1882.  
  1883. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1884.  
  1885. // Fallback to seeking `elem` from the start
  1886. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1887.  
  1888. // When found, cache indexes on `parent` and break
  1889. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1890. outerCache[ type ] = [ dirruns, nodeIndex, diff ];
  1891. break;
  1892. }
  1893. }
  1894.  
  1895. } else {
  1896.  
  1897. // Use previously-cached element index if available
  1898. if ( useCache ) {
  1899. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1900. cache = outerCache[ type ] || [];
  1901. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1902. diff = nodeIndex;
  1903. }
  1904.  
  1905. // xml :nth-child(...)
  1906. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1907. if ( diff === false ) {
  1908.  
  1909. // Use the same loop as above to seek `elem` from the start
  1910. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1911. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1912.  
  1913. if ( ( ofType ?
  1914. nodeName( node, name ) :
  1915. node.nodeType === 1 ) &&
  1916. ++diff ) {
  1917.  
  1918. // Cache the index of each encountered element
  1919. if ( useCache ) {
  1920. outerCache = node[ expando ] ||
  1921. ( node[ expando ] = {} );
  1922. outerCache[ type ] = [ dirruns, diff ];
  1923. }
  1924.  
  1925. if ( node === elem ) {
  1926. break;
  1927. }
  1928. }
  1929. }
  1930. }
  1931. }
  1932.  
  1933. // Incorporate the offset, then check against cycle size
  1934. diff -= last;
  1935. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1936. }
  1937. };
  1938. },
  1939.  
  1940. PSEUDO: function( pseudo, argument ) {
  1941.  
  1942. // pseudo-class names are case-insensitive
  1943. // https://www.w3.org/TR/selectors/#pseudo-classes
  1944. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1945. // Remember that setFilters inherits from pseudos
  1946. var args,
  1947. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1948. find.error( "unsupported pseudo: " + pseudo );
  1949.  
  1950. // The user may use createPseudo to indicate that
  1951. // arguments are needed to create the filter function
  1952. // just as jQuery does
  1953. if ( fn[ expando ] ) {
  1954. return fn( argument );
  1955. }
  1956.  
  1957. // But maintain support for old signatures
  1958. if ( fn.length > 1 ) {
  1959. args = [ pseudo, pseudo, "", argument ];
  1960. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1961. markFunction( function( seed, matches ) {
  1962. var idx,
  1963. matched = fn( seed, argument ),
  1964. i = matched.length;
  1965. while ( i-- ) {
  1966. idx = indexOf.call( seed, matched[ i ] );
  1967. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  1968. }
  1969. } ) :
  1970. function( elem ) {
  1971. return fn( elem, 0, args );
  1972. };
  1973. }
  1974.  
  1975. return fn;
  1976. }
  1977. },
  1978.  
  1979. pseudos: {
  1980.  
  1981. // Potentially complex pseudos
  1982. not: markFunction( function( selector ) {
  1983.  
  1984. // Trim the selector passed to compile
  1985. // to avoid treating leading and trailing
  1986. // spaces as combinators
  1987. var input = [],
  1988. results = [],
  1989. matcher = compile( selector.replace( rtrimCSS, "$1" ) );
  1990.  
  1991. return matcher[ expando ] ?
  1992. markFunction( function( seed, matches, _context, xml ) {
  1993. var elem,
  1994. unmatched = matcher( seed, null, xml, [] ),
  1995. i = seed.length;
  1996.  
  1997. // Match elements unmatched by `matcher`
  1998. while ( i-- ) {
  1999. if ( ( elem = unmatched[ i ] ) ) {
  2000. seed[ i ] = !( matches[ i ] = elem );
  2001. }
  2002. }
  2003. } ) :
  2004. function( elem, _context, xml ) {
  2005. input[ 0 ] = elem;
  2006. matcher( input, null, xml, results );
  2007.  
  2008. // Don't keep the element
  2009. // (see https://github.com/jquery/sizzle/issues/299)
  2010. input[ 0 ] = null;
  2011. return !results.pop();
  2012. };
  2013. } ),
  2014.  
  2015. has: markFunction( function( selector ) {
  2016. return function( elem ) {
  2017. return find( selector, elem ).length > 0;
  2018. };
  2019. } ),
  2020.  
  2021. contains: markFunction( function( text ) {
  2022. text = text.replace( runescape, funescape );
  2023. return function( elem ) {
  2024. return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;
  2025. };
  2026. } ),
  2027.  
  2028. // "Whether an element is represented by a :lang() selector
  2029. // is based solely on the element's language value
  2030. // being equal to the identifier C,
  2031. // or beginning with the identifier C immediately followed by "-".
  2032. // The matching of C against the element's language value is performed case-insensitively.
  2033. // The identifier C does not have to be a valid language name."
  2034. // https://www.w3.org/TR/selectors/#lang-pseudo
  2035. lang: markFunction( function( lang ) {
  2036.  
  2037. // lang value must be a valid identifier
  2038. if ( !ridentifier.test( lang || "" ) ) {
  2039. find.error( "unsupported lang: " + lang );
  2040. }
  2041. lang = lang.replace( runescape, funescape ).toLowerCase();
  2042. return function( elem ) {
  2043. var elemLang;
  2044. do {
  2045. if ( ( elemLang = documentIsHTML ?
  2046. elem.lang :
  2047. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  2048.  
  2049. elemLang = elemLang.toLowerCase();
  2050. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  2051. }
  2052. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  2053. return false;
  2054. };
  2055. } ),
  2056.  
  2057. // Miscellaneous
  2058. target: function( elem ) {
  2059. var hash = window.location && window.location.hash;
  2060. return hash && hash.slice( 1 ) === elem.id;
  2061. },
  2062.  
  2063. root: function( elem ) {
  2064. return elem === documentElement;
  2065. },
  2066.  
  2067. focus: function( elem ) {
  2068. return elem === safeActiveElement() &&
  2069. document.hasFocus() &&
  2070. !!( elem.type || elem.href || ~elem.tabIndex );
  2071. },
  2072.  
  2073. // Boolean properties
  2074. enabled: createDisabledPseudo( false ),
  2075. disabled: createDisabledPseudo( true ),
  2076.  
  2077. checked: function( elem ) {
  2078.  
  2079. // In CSS3, :checked should return both checked and selected elements
  2080. // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  2081. return ( nodeName( elem, "input" ) && !!elem.checked ) ||
  2082. ( nodeName( elem, "option" ) && !!elem.selected );
  2083. },
  2084.  
  2085. selected: function( elem ) {
  2086.  
  2087. // Support: IE <=11+
  2088. // Accessing the selectedIndex property
  2089. // forces the browser to treat the default option as
  2090. // selected when in an optgroup.
  2091. if ( elem.parentNode ) {
  2092. // eslint-disable-next-line no-unused-expressions
  2093. elem.parentNode.selectedIndex;
  2094. }
  2095.  
  2096. return elem.selected === true;
  2097. },
  2098.  
  2099. // Contents
  2100. empty: function( elem ) {
  2101.  
  2102. // https://www.w3.org/TR/selectors/#empty-pseudo
  2103. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  2104. // but not by others (comment: 8; processing instruction: 7; etc.)
  2105. // nodeType < 6 works because attributes (2) do not appear as children
  2106. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  2107. if ( elem.nodeType < 6 ) {
  2108. return false;
  2109. }
  2110. }
  2111. return true;
  2112. },
  2113.  
  2114. parent: function( elem ) {
  2115. return !Expr.pseudos.empty( elem );
  2116. },
  2117.  
  2118. // Element/input types
  2119. header: function( elem ) {
  2120. return rheader.test( elem.nodeName );
  2121. },
  2122.  
  2123. input: function( elem ) {
  2124. return rinputs.test( elem.nodeName );
  2125. },
  2126.  
  2127. button: function( elem ) {
  2128. return nodeName( elem, "input" ) && elem.type === "button" ||
  2129. nodeName( elem, "button" );
  2130. },
  2131.  
  2132. text: function( elem ) {
  2133. var attr;
  2134. return nodeName( elem, "input" ) && elem.type === "text" &&
  2135.  
  2136. // Support: IE <10 only
  2137. // New HTML5 attribute values (e.g., "search") appear
  2138. // with elem.type === "text"
  2139. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  2140. attr.toLowerCase() === "text" );
  2141. },
  2142.  
  2143. // Position-in-collection
  2144. first: createPositionalPseudo( function() {
  2145. return [ 0 ];
  2146. } ),
  2147.  
  2148. last: createPositionalPseudo( function( _matchIndexes, length ) {
  2149. return [ length - 1 ];
  2150. } ),
  2151.  
  2152. eq: createPositionalPseudo( function( _matchIndexes, length, argument ) {
  2153. return [ argument < 0 ? argument + length : argument ];
  2154. } ),
  2155.  
  2156. even: createPositionalPseudo( function( matchIndexes, length ) {
  2157. var i = 0;
  2158. for ( ; i < length; i += 2 ) {
  2159. matchIndexes.push( i );
  2160. }
  2161. return matchIndexes;
  2162. } ),
  2163.  
  2164. odd: createPositionalPseudo( function( matchIndexes, length ) {
  2165. var i = 1;
  2166. for ( ; i < length; i += 2 ) {
  2167. matchIndexes.push( i );
  2168. }
  2169. return matchIndexes;
  2170. } ),
  2171.  
  2172. lt: createPositionalPseudo( function( matchIndexes, length, argument ) {
  2173. var i;
  2174.  
  2175. if ( argument < 0 ) {
  2176. i = argument + length;
  2177. } else if ( argument > length ) {
  2178. i = length;
  2179. } else {
  2180. i = argument;
  2181. }
  2182.  
  2183. for ( ; --i >= 0; ) {
  2184. matchIndexes.push( i );
  2185. }
  2186. return matchIndexes;
  2187. } ),
  2188.  
  2189. gt: createPositionalPseudo( function( matchIndexes, length, argument ) {
  2190. var i = argument < 0 ? argument + length : argument;
  2191. for ( ; ++i < length; ) {
  2192. matchIndexes.push( i );
  2193. }
  2194. return matchIndexes;
  2195. } )
  2196. }
  2197. };
  2198.  
  2199. Expr.pseudos.nth = Expr.pseudos.eq;
  2200.  
  2201. // Add button/input type pseudos
  2202. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  2203. Expr.pseudos[ i ] = createInputPseudo( i );
  2204. }
  2205. for ( i in { submit: true, reset: true } ) {
  2206. Expr.pseudos[ i ] = createButtonPseudo( i );
  2207. }
  2208.  
  2209. // Easy API for creating new setFilters
  2210. function setFilters() {}
  2211. setFilters.prototype = Expr.filters = Expr.pseudos;
  2212. Expr.setFilters = new setFilters();
  2213.  
  2214. function tokenize( selector, parseOnly ) {
  2215. var matched, match, tokens, type,
  2216. soFar, groups, preFilters,
  2217. cached = tokenCache[ selector + " " ];
  2218.  
  2219. if ( cached ) {
  2220. return parseOnly ? 0 : cached.slice( 0 );
  2221. }
  2222.  
  2223. soFar = selector;
  2224. groups = [];
  2225. preFilters = Expr.preFilter;
  2226.  
  2227. while ( soFar ) {
  2228.  
  2229. // Comma and first run
  2230. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  2231. if ( match ) {
  2232.  
  2233. // Don't consume trailing commas as valid
  2234. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  2235. }
  2236. groups.push( ( tokens = [] ) );
  2237. }
  2238.  
  2239. matched = false;
  2240.  
  2241. // Combinators
  2242. if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
  2243. matched = match.shift();
  2244. tokens.push( {
  2245. value: matched,
  2246.  
  2247. // Cast descendant combinators to space
  2248. type: match[ 0 ].replace( rtrimCSS, " " )
  2249. } );
  2250. soFar = soFar.slice( matched.length );
  2251. }
  2252.  
  2253. // Filters
  2254. for ( type in Expr.filter ) {
  2255. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  2256. ( match = preFilters[ type ]( match ) ) ) ) {
  2257. matched = match.shift();
  2258. tokens.push( {
  2259. value: matched,
  2260. type: type,
  2261. matches: match
  2262. } );
  2263. soFar = soFar.slice( matched.length );
  2264. }
  2265. }
  2266.  
  2267. if ( !matched ) {
  2268. break;
  2269. }
  2270. }
  2271.  
  2272. // Return the length of the invalid excess
  2273. // if we're just parsing
  2274. // Otherwise, throw an error or return tokens
  2275. if ( parseOnly ) {
  2276. return soFar.length;
  2277. }
  2278.  
  2279. return soFar ?
  2280. find.error( selector ) :
  2281.  
  2282. // Cache the tokens
  2283. tokenCache( selector, groups ).slice( 0 );
  2284. }
  2285.  
  2286. function toSelector( tokens ) {
  2287. var i = 0,
  2288. len = tokens.length,
  2289. selector = "";
  2290. for ( ; i < len; i++ ) {
  2291. selector += tokens[ i ].value;
  2292. }
  2293. return selector;
  2294. }
  2295.  
  2296. function addCombinator( matcher, combinator, base ) {
  2297. var dir = combinator.dir,
  2298. skip = combinator.next,
  2299. key = skip || dir,
  2300. checkNonElements = base && key === "parentNode",
  2301. doneName = done++;
  2302.  
  2303. return combinator.first ?
  2304.  
  2305. // Check against closest ancestor/preceding element
  2306. function( elem, context, xml ) {
  2307. while ( ( elem = elem[ dir ] ) ) {
  2308. if ( elem.nodeType === 1 || checkNonElements ) {
  2309. return matcher( elem, context, xml );
  2310. }
  2311. }
  2312. return false;
  2313. } :
  2314.  
  2315. // Check against all ancestor/preceding elements
  2316. function( elem, context, xml ) {
  2317. var oldCache, outerCache,
  2318. newCache = [ dirruns, doneName ];
  2319.  
  2320. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  2321. if ( xml ) {
  2322. while ( ( elem = elem[ dir ] ) ) {
  2323. if ( elem.nodeType === 1 || checkNonElements ) {
  2324. if ( matcher( elem, context, xml ) ) {
  2325. return true;
  2326. }
  2327. }
  2328. }
  2329. } else {
  2330. while ( ( elem = elem[ dir ] ) ) {
  2331. if ( elem.nodeType === 1 || checkNonElements ) {
  2332. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  2333.  
  2334. if ( skip && nodeName( elem, skip ) ) {
  2335. elem = elem[ dir ] || elem;
  2336. } else if ( ( oldCache = outerCache[ key ] ) &&
  2337. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  2338.  
  2339. // Assign to newCache so results back-propagate to previous elements
  2340. return ( newCache[ 2 ] = oldCache[ 2 ] );
  2341. } else {
  2342.  
  2343. // Reuse newcache so results back-propagate to previous elements
  2344. outerCache[ key ] = newCache;
  2345.  
  2346. // A match means we're done; a fail means we have to keep checking
  2347. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  2348. return true;
  2349. }
  2350. }
  2351. }
  2352. }
  2353. }
  2354. return false;
  2355. };
  2356. }
  2357.  
  2358. function elementMatcher( matchers ) {
  2359. return matchers.length > 1 ?
  2360. function( elem, context, xml ) {
  2361. var i = matchers.length;
  2362. while ( i-- ) {
  2363. if ( !matchers[ i ]( elem, context, xml ) ) {
  2364. return false;
  2365. }
  2366. }
  2367. return true;
  2368. } :
  2369. matchers[ 0 ];
  2370. }
  2371.  
  2372. function multipleContexts( selector, contexts, results ) {
  2373. var i = 0,
  2374. len = contexts.length;
  2375. for ( ; i < len; i++ ) {
  2376. find( selector, contexts[ i ], results );
  2377. }
  2378. return results;
  2379. }
  2380.  
  2381. function condense( unmatched, map, filter, context, xml ) {
  2382. var elem,
  2383. newUnmatched = [],
  2384. i = 0,
  2385. len = unmatched.length,
  2386. mapped = map != null;
  2387.  
  2388. for ( ; i < len; i++ ) {
  2389. if ( ( elem = unmatched[ i ] ) ) {
  2390. if ( !filter || filter( elem, context, xml ) ) {
  2391. newUnmatched.push( elem );
  2392. if ( mapped ) {
  2393. map.push( i );
  2394. }
  2395. }
  2396. }
  2397. }
  2398.  
  2399. return newUnmatched;
  2400. }
  2401.  
  2402. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  2403. if ( postFilter && !postFilter[ expando ] ) {
  2404. postFilter = setMatcher( postFilter );
  2405. }
  2406. if ( postFinder && !postFinder[ expando ] ) {
  2407. postFinder = setMatcher( postFinder, postSelector );
  2408. }
  2409. return markFunction( function( seed, results, context, xml ) {
  2410. var temp, i, elem, matcherOut,
  2411. preMap = [],
  2412. postMap = [],
  2413. preexisting = results.length,
  2414.  
  2415. // Get initial elements from seed or context
  2416. elems = seed ||
  2417. multipleContexts( selector || "*",
  2418. context.nodeType ? [ context ] : context, [] ),
  2419.  
  2420. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  2421. matcherIn = preFilter && ( seed || !selector ) ?
  2422. condense( elems, preMap, preFilter, context, xml ) :
  2423. elems;
  2424.  
  2425. if ( matcher ) {
  2426.  
  2427. // If we have a postFinder, or filtered seed, or non-seed postFilter
  2428. // or preexisting results,
  2429. matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  2430.  
  2431. // ...intermediate processing is necessary
  2432. [] :
  2433.  
  2434. // ...otherwise use results directly
  2435. results;
  2436.  
  2437. // Find primary matches
  2438. matcher( matcherIn, matcherOut, context, xml );
  2439. } else {
  2440. matcherOut = matcherIn;
  2441. }
  2442.  
  2443. // Apply postFilter
  2444. if ( postFilter ) {
  2445. temp = condense( matcherOut, postMap );
  2446. postFilter( temp, [], context, xml );
  2447.  
  2448. // Un-match failing elements by moving them back to matcherIn
  2449. i = temp.length;
  2450. while ( i-- ) {
  2451. if ( ( elem = temp[ i ] ) ) {
  2452. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  2453. }
  2454. }
  2455. }
  2456.  
  2457. if ( seed ) {
  2458. if ( postFinder || preFilter ) {
  2459. if ( postFinder ) {
  2460.  
  2461. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2462. temp = [];
  2463. i = matcherOut.length;
  2464. while ( i-- ) {
  2465. if ( ( elem = matcherOut[ i ] ) ) {
  2466.  
  2467. // Restore matcherIn since elem is not yet a final match
  2468. temp.push( ( matcherIn[ i ] = elem ) );
  2469. }
  2470. }
  2471. postFinder( null, ( matcherOut = [] ), temp, xml );
  2472. }
  2473.  
  2474. // Move matched elements from seed to results to keep them synchronized
  2475. i = matcherOut.length;
  2476. while ( i-- ) {
  2477. if ( ( elem = matcherOut[ i ] ) &&
  2478. ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {
  2479.  
  2480. seed[ temp ] = !( results[ temp ] = elem );
  2481. }
  2482. }
  2483. }
  2484.  
  2485. // Add elements to results, through postFinder if defined
  2486. } else {
  2487. matcherOut = condense(
  2488. matcherOut === results ?
  2489. matcherOut.splice( preexisting, matcherOut.length ) :
  2490. matcherOut
  2491. );
  2492. if ( postFinder ) {
  2493. postFinder( null, results, matcherOut, xml );
  2494. } else {
  2495. push.apply( results, matcherOut );
  2496. }
  2497. }
  2498. } );
  2499. }
  2500.  
  2501. function matcherFromTokens( tokens ) {
  2502. var checkContext, matcher, j,
  2503. len = tokens.length,
  2504. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  2505. implicitRelative = leadingRelative || Expr.relative[ " " ],
  2506. i = leadingRelative ? 1 : 0,
  2507.  
  2508. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2509. matchContext = addCombinator( function( elem ) {
  2510. return elem === checkContext;
  2511. }, implicitRelative, true ),
  2512. matchAnyContext = addCombinator( function( elem ) {
  2513. return indexOf.call( checkContext, elem ) > -1;
  2514. }, implicitRelative, true ),
  2515. matchers = [ function( elem, context, xml ) {
  2516.  
  2517. // Support: IE 11+, Edge 17 - 18+
  2518. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2519. // two documents; shallow comparisons work.
  2520. // eslint-disable-next-line eqeqeq
  2521. var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
  2522. ( checkContext = context ).nodeType ?
  2523. matchContext( elem, context, xml ) :
  2524. matchAnyContext( elem, context, xml ) );
  2525.  
  2526. // Avoid hanging onto element
  2527. // (see https://github.com/jquery/sizzle/issues/299)
  2528. checkContext = null;
  2529. return ret;
  2530. } ];
  2531.  
  2532. for ( ; i < len; i++ ) {
  2533. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  2534. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  2535. } else {
  2536. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  2537.  
  2538. // Return special upon seeing a positional matcher
  2539. if ( matcher[ expando ] ) {
  2540.  
  2541. // Find the next relative operator (if any) for proper handling
  2542. j = ++i;
  2543. for ( ; j < len; j++ ) {
  2544. if ( Expr.relative[ tokens[ j ].type ] ) {
  2545. break;
  2546. }
  2547. }
  2548. return setMatcher(
  2549. i > 1 && elementMatcher( matchers ),
  2550. i > 1 && toSelector(
  2551.  
  2552. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2553. tokens.slice( 0, i - 1 )
  2554. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  2555. ).replace( rtrimCSS, "$1" ),
  2556. matcher,
  2557. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2558. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  2559. j < len && toSelector( tokens )
  2560. );
  2561. }
  2562. matchers.push( matcher );
  2563. }
  2564. }
  2565.  
  2566. return elementMatcher( matchers );
  2567. }
  2568.  
  2569. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2570. var bySet = setMatchers.length > 0,
  2571. byElement = elementMatchers.length > 0,
  2572. superMatcher = function( seed, context, xml, results, outermost ) {
  2573. var elem, j, matcher,
  2574. matchedCount = 0,
  2575. i = "0",
  2576. unmatched = seed && [],
  2577. setMatched = [],
  2578. contextBackup = outermostContext,
  2579.  
  2580. // We must always have either seed elements or outermost context
  2581. elems = seed || byElement && Expr.find.TAG( "*", outermost ),
  2582.  
  2583. // Use integer dirruns iff this is the outermost matcher
  2584. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  2585. len = elems.length;
  2586.  
  2587. if ( outermost ) {
  2588.  
  2589. // Support: IE 11+, Edge 17 - 18+
  2590. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2591. // two documents; shallow comparisons work.
  2592. // eslint-disable-next-line eqeqeq
  2593. outermostContext = context == document || context || outermost;
  2594. }
  2595.  
  2596. // Add elements passing elementMatchers directly to results
  2597. // Support: iOS <=7 - 9 only
  2598. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
  2599. // elements by id. (see trac-14142)
  2600. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  2601. if ( byElement && elem ) {
  2602. j = 0;
  2603.  
  2604. // Support: IE 11+, Edge 17 - 18+
  2605. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2606. // two documents; shallow comparisons work.
  2607. // eslint-disable-next-line eqeqeq
  2608. if ( !context && elem.ownerDocument != document ) {
  2609. setDocument( elem );
  2610. xml = !documentIsHTML;
  2611. }
  2612. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2613. if ( matcher( elem, context || document, xml ) ) {
  2614. push.call( results, elem );
  2615. break;
  2616. }
  2617. }
  2618. if ( outermost ) {
  2619. dirruns = dirrunsUnique;
  2620. }
  2621. }
  2622.  
  2623. // Track unmatched elements for set filters
  2624. if ( bySet ) {
  2625.  
  2626. // They will have gone through all possible matchers
  2627. if ( ( elem = !matcher && elem ) ) {
  2628. matchedCount--;
  2629. }
  2630.  
  2631. // Lengthen the array for every element, matched or not
  2632. if ( seed ) {
  2633. unmatched.push( elem );
  2634. }
  2635. }
  2636. }
  2637.  
  2638. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2639. // makes the latter nonnegative.
  2640. matchedCount += i;
  2641.  
  2642. // Apply set filters to unmatched elements
  2643. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2644. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2645. // no element matchers and no seed.
  2646. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2647. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2648. // numerically zero.
  2649. if ( bySet && i !== matchedCount ) {
  2650. j = 0;
  2651. while ( ( matcher = setMatchers[ j++ ] ) ) {
  2652. matcher( unmatched, setMatched, context, xml );
  2653. }
  2654.  
  2655. if ( seed ) {
  2656.  
  2657. // Reintegrate element matches to eliminate the need for sorting
  2658. if ( matchedCount > 0 ) {
  2659. while ( i-- ) {
  2660. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2661. setMatched[ i ] = pop.call( results );
  2662. }
  2663. }
  2664. }
  2665.  
  2666. // Discard index placeholder values to get only actual matches
  2667. setMatched = condense( setMatched );
  2668. }
  2669.  
  2670. // Add matches to results
  2671. push.apply( results, setMatched );
  2672.  
  2673. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2674. if ( outermost && !seed && setMatched.length > 0 &&
  2675. ( matchedCount + setMatchers.length ) > 1 ) {
  2676.  
  2677. jQuery.uniqueSort( results );
  2678. }
  2679. }
  2680.  
  2681. // Override manipulation of globals by nested matchers
  2682. if ( outermost ) {
  2683. dirruns = dirrunsUnique;
  2684. outermostContext = contextBackup;
  2685. }
  2686.  
  2687. return unmatched;
  2688. };
  2689.  
  2690. return bySet ?
  2691. markFunction( superMatcher ) :
  2692. superMatcher;
  2693. }
  2694.  
  2695. function compile( selector, match /* Internal Use Only */ ) {
  2696. var i,
  2697. setMatchers = [],
  2698. elementMatchers = [],
  2699. cached = compilerCache[ selector + " " ];
  2700.  
  2701. if ( !cached ) {
  2702.  
  2703. // Generate a function of recursive functions that can be used to check each element
  2704. if ( !match ) {
  2705. match = tokenize( selector );
  2706. }
  2707. i = match.length;
  2708. while ( i-- ) {
  2709. cached = matcherFromTokens( match[ i ] );
  2710. if ( cached[ expando ] ) {
  2711. setMatchers.push( cached );
  2712. } else {
  2713. elementMatchers.push( cached );
  2714. }
  2715. }
  2716.  
  2717. // Cache the compiled function
  2718. cached = compilerCache( selector,
  2719. matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2720.  
  2721. // Save selector and tokenization
  2722. cached.selector = selector;
  2723. }
  2724. return cached;
  2725. }
  2726.  
  2727. /**
  2728. * A low-level selection function that works with jQuery's compiled
  2729. * selector functions
  2730. * @param {String|Function} selector A selector or a pre-compiled
  2731. * selector function built with jQuery selector compile
  2732. * @param {Element} context
  2733. * @param {Array} [results]
  2734. * @param {Array} [seed] A set of elements to match against
  2735. */
  2736. function select( selector, context, results, seed ) {
  2737. var i, tokens, token, type, find,
  2738. compiled = typeof selector === "function" && selector,
  2739. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2740.  
  2741. results = results || [];
  2742.  
  2743. // Try to minimize operations if there is only one selector in the list and no seed
  2744. // (the latter of which guarantees us context)
  2745. if ( match.length === 1 ) {
  2746.  
  2747. // Reduce context if the leading compound selector is an ID
  2748. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  2749. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  2750. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  2751.  
  2752. context = ( Expr.find.ID(
  2753. token.matches[ 0 ].replace( runescape, funescape ),
  2754. context
  2755. ) || [] )[ 0 ];
  2756. if ( !context ) {
  2757. return results;
  2758.  
  2759. // Precompiled matchers will still verify ancestry, so step up a level
  2760. } else if ( compiled ) {
  2761. context = context.parentNode;
  2762. }
  2763.  
  2764. selector = selector.slice( tokens.shift().value.length );
  2765. }
  2766.  
  2767. // Fetch a seed set for right-to-left matching
  2768. i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;
  2769. while ( i-- ) {
  2770. token = tokens[ i ];
  2771.  
  2772. // Abort if we hit a combinator
  2773. if ( Expr.relative[ ( type = token.type ) ] ) {
  2774. break;
  2775. }
  2776. if ( ( find = Expr.find[ type ] ) ) {
  2777.  
  2778. // Search, expanding context for leading sibling combinators
  2779. if ( ( seed = find(
  2780. token.matches[ 0 ].replace( runescape, funescape ),
  2781. rsibling.test( tokens[ 0 ].type ) &&
  2782. testContext( context.parentNode ) || context
  2783. ) ) ) {
  2784.  
  2785. // If seed is empty or no tokens remain, we can return early
  2786. tokens.splice( i, 1 );
  2787. selector = seed.length && toSelector( tokens );
  2788. if ( !selector ) {
  2789. push.apply( results, seed );
  2790. return results;
  2791. }
  2792.  
  2793. break;
  2794. }
  2795. }
  2796. }
  2797. }
  2798.  
  2799. // Compile and execute a filtering function if one is not provided
  2800. // Provide `match` to avoid retokenization if we modified the selector above
  2801. ( compiled || compile( selector, match ) )(
  2802. seed,
  2803. context,
  2804. !documentIsHTML,
  2805. results,
  2806. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2807. );
  2808. return results;
  2809. }
  2810.  
  2811. // One-time assignments
  2812.  
  2813. // Support: Android <=4.0 - 4.1+
  2814. // Sort stability
  2815. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2816.  
  2817. // Initialize against the default document
  2818. setDocument();
  2819.  
  2820. // Support: Android <=4.0 - 4.1+
  2821. // Detached nodes confoundingly follow *each other*
  2822. support.sortDetached = assert( function( el ) {
  2823.  
  2824. // Should return 1, but returns 4 (following)
  2825. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2826. } );
  2827.  
  2828. jQuery.find = find;
  2829.  
  2830. // Deprecated
  2831. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2832. jQuery.unique = jQuery.uniqueSort;
  2833.  
  2834. // These have always been private, but they used to be documented as part of
  2835. // Sizzle so let's maintain them for now for backwards compatibility purposes.
  2836. find.compile = compile;
  2837. find.select = select;
  2838. find.setDocument = setDocument;
  2839. find.tokenize = tokenize;
  2840.  
  2841. find.escape = jQuery.escapeSelector;
  2842. find.getText = jQuery.text;
  2843. find.isXML = jQuery.isXMLDoc;
  2844. find.selectors = jQuery.expr;
  2845. find.support = jQuery.support;
  2846. find.uniqueSort = jQuery.uniqueSort;
  2847.  
  2848. /* eslint-enable */
  2849.  
  2850. } )();
  2851.  
  2852.  
  2853. var dir = function( elem, dir, until ) {
  2854. var matched = [],
  2855. truncate = until !== undefined;
  2856.  
  2857. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2858. if ( elem.nodeType === 1 ) {
  2859. if ( truncate && jQuery( elem ).is( until ) ) {
  2860. break;
  2861. }
  2862. matched.push( elem );
  2863. }
  2864. }
  2865. return matched;
  2866. };
  2867.  
  2868.  
  2869. var siblings = function( n, elem ) {
  2870. var matched = [];
  2871.  
  2872. for ( ; n; n = n.nextSibling ) {
  2873. if ( n.nodeType === 1 && n !== elem ) {
  2874. matched.push( n );
  2875. }
  2876. }
  2877.  
  2878. return matched;
  2879. };
  2880.  
  2881.  
  2882. var rneedsContext = jQuery.expr.match.needsContext;
  2883.  
  2884. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  2885.  
  2886.  
  2887.  
  2888. // Implement the identical functionality for filter and not
  2889. function winnow( elements, qualifier, not ) {
  2890. if ( isFunction( qualifier ) ) {
  2891. return jQuery.grep( elements, function( elem, i ) {
  2892. return !!qualifier.call( elem, i, elem ) !== not;
  2893. } );
  2894. }
  2895.  
  2896. // Single element
  2897. if ( qualifier.nodeType ) {
  2898. return jQuery.grep( elements, function( elem ) {
  2899. return ( elem === qualifier ) !== not;
  2900. } );
  2901. }
  2902.  
  2903. // Arraylike of elements (jQuery, arguments, Array)
  2904. if ( typeof qualifier !== "string" ) {
  2905. return jQuery.grep( elements, function( elem ) {
  2906. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2907. } );
  2908. }
  2909.  
  2910. // Filtered directly for both simple and complex selectors
  2911. return jQuery.filter( qualifier, elements, not );
  2912. }
  2913.  
  2914. jQuery.filter = function( expr, elems, not ) {
  2915. var elem = elems[ 0 ];
  2916.  
  2917. if ( not ) {
  2918. expr = ":not(" + expr + ")";
  2919. }
  2920.  
  2921. if ( elems.length === 1 && elem.nodeType === 1 ) {
  2922. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  2923. }
  2924.  
  2925. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2926. return elem.nodeType === 1;
  2927. } ) );
  2928. };
  2929.  
  2930. jQuery.fn.extend( {
  2931. find: function( selector ) {
  2932. var i, ret,
  2933. len = this.length,
  2934. self = this;
  2935.  
  2936. if ( typeof selector !== "string" ) {
  2937. return this.pushStack( jQuery( selector ).filter( function() {
  2938. for ( i = 0; i < len; i++ ) {
  2939. if ( jQuery.contains( self[ i ], this ) ) {
  2940. return true;
  2941. }
  2942. }
  2943. } ) );
  2944. }
  2945.  
  2946. ret = this.pushStack( [] );
  2947.  
  2948. for ( i = 0; i < len; i++ ) {
  2949. jQuery.find( selector, self[ i ], ret );
  2950. }
  2951.  
  2952. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  2953. },
  2954. filter: function( selector ) {
  2955. return this.pushStack( winnow( this, selector || [], false ) );
  2956. },
  2957. not: function( selector ) {
  2958. return this.pushStack( winnow( this, selector || [], true ) );
  2959. },
  2960. is: function( selector ) {
  2961. return !!winnow(
  2962. this,
  2963.  
  2964. // If this is a positional/relative selector, check membership in the returned set
  2965. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2966. typeof selector === "string" && rneedsContext.test( selector ) ?
  2967. jQuery( selector ) :
  2968. selector || [],
  2969. false
  2970. ).length;
  2971. }
  2972. } );
  2973.  
  2974.  
  2975. // Initialize a jQuery object
  2976.  
  2977.  
  2978. // A central reference to the root jQuery(document)
  2979. var rootjQuery,
  2980.  
  2981. // A simple way to check for HTML strings
  2982. // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
  2983. // Strict HTML recognition (trac-11290: must start with <)
  2984. // Shortcut simple #id case for speed
  2985. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  2986.  
  2987. init = jQuery.fn.init = function( selector, context, root ) {
  2988. var match, elem;
  2989.  
  2990. // HANDLE: $(""), $(null), $(undefined), $(false)
  2991. if ( !selector ) {
  2992. return this;
  2993. }
  2994.  
  2995. // Method init() accepts an alternate rootjQuery
  2996. // so migrate can support jQuery.sub (gh-2101)
  2997. root = root || rootjQuery;
  2998.  
  2999. // Handle HTML strings
  3000. if ( typeof selector === "string" ) {
  3001. if ( selector[ 0 ] === "<" &&
  3002. selector[ selector.length - 1 ] === ">" &&
  3003. selector.length >= 3 ) {
  3004.  
  3005. // Assume that strings that start and end with <> are HTML and skip the regex check
  3006. match = [ null, selector, null ];
  3007.  
  3008. } else {
  3009. match = rquickExpr.exec( selector );
  3010. }
  3011.  
  3012. // Match html or make sure no context is specified for #id
  3013. if ( match && ( match[ 1 ] || !context ) ) {
  3014.  
  3015. // HANDLE: $(html) -> $(array)
  3016. if ( match[ 1 ] ) {
  3017. context = context instanceof jQuery ? context[ 0 ] : context;
  3018.  
  3019. // Option to run scripts is true for back-compat
  3020. // Intentionally let the error be thrown if parseHTML is not present
  3021. jQuery.merge( this, jQuery.parseHTML(
  3022. match[ 1 ],
  3023. context && context.nodeType ? context.ownerDocument || context : document,
  3024. true
  3025. ) );
  3026.  
  3027. // HANDLE: $(html, props)
  3028. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  3029. for ( match in context ) {
  3030.  
  3031. // Properties of context are called as methods if possible
  3032. if ( isFunction( this[ match ] ) ) {
  3033. this[ match ]( context[ match ] );
  3034.  
  3035. // ...and otherwise set as attributes
  3036. } else {
  3037. this.attr( match, context[ match ] );
  3038. }
  3039. }
  3040. }
  3041.  
  3042. return this;
  3043.  
  3044. // HANDLE: $(#id)
  3045. } else {
  3046. elem = document.getElementById( match[ 2 ] );
  3047.  
  3048. if ( elem ) {
  3049.  
  3050. // Inject the element directly into the jQuery object
  3051. this[ 0 ] = elem;
  3052. this.length = 1;
  3053. }
  3054. return this;
  3055. }
  3056.  
  3057. // HANDLE: $(expr, $(...))
  3058. } else if ( !context || context.jquery ) {
  3059. return ( context || root ).find( selector );
  3060.  
  3061. // HANDLE: $(expr, context)
  3062. // (which is just equivalent to: $(context).find(expr)
  3063. } else {
  3064. return this.constructor( context ).find( selector );
  3065. }
  3066.  
  3067. // HANDLE: $(DOMElement)
  3068. } else if ( selector.nodeType ) {
  3069. this[ 0 ] = selector;
  3070. this.length = 1;
  3071. return this;
  3072.  
  3073. // HANDLE: $(function)
  3074. // Shortcut for document ready
  3075. } else if ( isFunction( selector ) ) {
  3076. return root.ready !== undefined ?
  3077. root.ready( selector ) :
  3078.  
  3079. // Execute immediately if ready is not present
  3080. selector( jQuery );
  3081. }
  3082.  
  3083. return jQuery.makeArray( selector, this );
  3084. };
  3085.  
  3086. // Give the init function the jQuery prototype for later instantiation
  3087. init.prototype = jQuery.fn;
  3088.  
  3089. // Initialize central reference
  3090. rootjQuery = jQuery( document );
  3091.  
  3092.  
  3093. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  3094.  
  3095. // Methods guaranteed to produce a unique set when starting from a unique set
  3096. guaranteedUnique = {
  3097. children: true,
  3098. contents: true,
  3099. next: true,
  3100. prev: true
  3101. };
  3102.  
  3103. jQuery.fn.extend( {
  3104. has: function( target ) {
  3105. var targets = jQuery( target, this ),
  3106. l = targets.length;
  3107.  
  3108. return this.filter( function() {
  3109. var i = 0;
  3110. for ( ; i < l; i++ ) {
  3111. if ( jQuery.contains( this, targets[ i ] ) ) {
  3112. return true;
  3113. }
  3114. }
  3115. } );
  3116. },
  3117.  
  3118. closest: function( selectors, context ) {
  3119. var cur,
  3120. i = 0,
  3121. l = this.length,
  3122. matched = [],
  3123. targets = typeof selectors !== "string" && jQuery( selectors );
  3124.  
  3125. // Positional selectors never match, since there's no _selection_ context
  3126. if ( !rneedsContext.test( selectors ) ) {
  3127. for ( ; i < l; i++ ) {
  3128. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  3129.  
  3130. // Always skip document fragments
  3131. if ( cur.nodeType < 11 && ( targets ?
  3132. targets.index( cur ) > -1 :
  3133.  
  3134. // Don't pass non-elements to jQuery#find
  3135. cur.nodeType === 1 &&
  3136. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  3137.  
  3138. matched.push( cur );
  3139. break;
  3140. }
  3141. }
  3142. }
  3143. }
  3144.  
  3145. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  3146. },
  3147.  
  3148. // Determine the position of an element within the set
  3149. index: function( elem ) {
  3150.  
  3151. // No argument, return index in parent
  3152. if ( !elem ) {
  3153. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  3154. }
  3155.  
  3156. // Index in selector
  3157. if ( typeof elem === "string" ) {
  3158. return indexOf.call( jQuery( elem ), this[ 0 ] );
  3159. }
  3160.  
  3161. // Locate the position of the desired element
  3162. return indexOf.call( this,
  3163.  
  3164. // If it receives a jQuery object, the first element is used
  3165. elem.jquery ? elem[ 0 ] : elem
  3166. );
  3167. },
  3168.  
  3169. add: function( selector, context ) {
  3170. return this.pushStack(
  3171. jQuery.uniqueSort(
  3172. jQuery.merge( this.get(), jQuery( selector, context ) )
  3173. )
  3174. );
  3175. },
  3176.  
  3177. addBack: function( selector ) {
  3178. return this.add( selector == null ?
  3179. this.prevObject : this.prevObject.filter( selector )
  3180. );
  3181. }
  3182. } );
  3183.  
  3184. function sibling( cur, dir ) {
  3185. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  3186. return cur;
  3187. }
  3188.  
  3189. jQuery.each( {
  3190. parent: function( elem ) {
  3191. var parent = elem.parentNode;
  3192. return parent && parent.nodeType !== 11 ? parent : null;
  3193. },
  3194. parents: function( elem ) {
  3195. return dir( elem, "parentNode" );
  3196. },
  3197. parentsUntil: function( elem, _i, until ) {
  3198. return dir( elem, "parentNode", until );
  3199. },
  3200. next: function( elem ) {
  3201. return sibling( elem, "nextSibling" );
  3202. },
  3203. prev: function( elem ) {
  3204. return sibling( elem, "previousSibling" );
  3205. },
  3206. nextAll: function( elem ) {
  3207. return dir( elem, "nextSibling" );
  3208. },
  3209. prevAll: function( elem ) {
  3210. return dir( elem, "previousSibling" );
  3211. },
  3212. nextUntil: function( elem, _i, until ) {
  3213. return dir( elem, "nextSibling", until );
  3214. },
  3215. prevUntil: function( elem, _i, until ) {
  3216. return dir( elem, "previousSibling", until );
  3217. },
  3218. siblings: function( elem ) {
  3219. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  3220. },
  3221. children: function( elem ) {
  3222. return siblings( elem.firstChild );
  3223. },
  3224. contents: function( elem ) {
  3225. if ( elem.contentDocument != null &&
  3226.  
  3227. // Support: IE 11+
  3228. // <object> elements with no `data` attribute has an object
  3229. // `contentDocument` with a `null` prototype.
  3230. getProto( elem.contentDocument ) ) {
  3231.  
  3232. return elem.contentDocument;
  3233. }
  3234.  
  3235. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  3236. // Treat the template element as a regular one in browsers that
  3237. // don't support it.
  3238. if ( nodeName( elem, "template" ) ) {
  3239. elem = elem.content || elem;
  3240. }
  3241.  
  3242. return jQuery.merge( [], elem.childNodes );
  3243. }
  3244. }, function( name, fn ) {
  3245. jQuery.fn[ name ] = function( until, selector ) {
  3246. var matched = jQuery.map( this, fn, until );
  3247.  
  3248. if ( name.slice( -5 ) !== "Until" ) {
  3249. selector = until;
  3250. }
  3251.  
  3252. if ( selector && typeof selector === "string" ) {
  3253. matched = jQuery.filter( selector, matched );
  3254. }
  3255.  
  3256. if ( this.length > 1 ) {
  3257.  
  3258. // Remove duplicates
  3259. if ( !guaranteedUnique[ name ] ) {
  3260. jQuery.uniqueSort( matched );
  3261. }
  3262.  
  3263. // Reverse order for parents* and prev-derivatives
  3264. if ( rparentsprev.test( name ) ) {
  3265. matched.reverse();
  3266. }
  3267. }
  3268.  
  3269. return this.pushStack( matched );
  3270. };
  3271. } );
  3272. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  3273.  
  3274.  
  3275.  
  3276. // Convert String-formatted options into Object-formatted ones
  3277. function createOptions( options ) {
  3278. var object = {};
  3279. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  3280. object[ flag ] = true;
  3281. } );
  3282. return object;
  3283. }
  3284.  
  3285. /*
  3286. * Create a callback list using the following parameters:
  3287. *
  3288. * options: an optional list of space-separated options that will change how
  3289. * the callback list behaves or a more traditional option object
  3290. *
  3291. * By default a callback list will act like an event callback list and can be
  3292. * "fired" multiple times.
  3293. *
  3294. * Possible options:
  3295. *
  3296. * once: will ensure the callback list can only be fired once (like a Deferred)
  3297. *
  3298. * memory: will keep track of previous values and will call any callback added
  3299. * after the list has been fired right away with the latest "memorized"
  3300. * values (like a Deferred)
  3301. *
  3302. * unique: will ensure a callback can only be added once (no duplicate in the list)
  3303. *
  3304. * stopOnFalse: interrupt callings when a callback returns false
  3305. *
  3306. */
  3307. jQuery.Callbacks = function( options ) {
  3308.  
  3309. // Convert options from String-formatted to Object-formatted if needed
  3310. // (we check in cache first)
  3311. options = typeof options === "string" ?
  3312. createOptions( options ) :
  3313. jQuery.extend( {}, options );
  3314.  
  3315. var // Flag to know if list is currently firing
  3316. firing,
  3317.  
  3318. // Last fire value for non-forgettable lists
  3319. memory,
  3320.  
  3321. // Flag to know if list was already fired
  3322. fired,
  3323.  
  3324. // Flag to prevent firing
  3325. locked,
  3326.  
  3327. // Actual callback list
  3328. list = [],
  3329.  
  3330. // Queue of execution data for repeatable lists
  3331. queue = [],
  3332.  
  3333. // Index of currently firing callback (modified by add/remove as needed)
  3334. firingIndex = -1,
  3335.  
  3336. // Fire callbacks
  3337. fire = function() {
  3338.  
  3339. // Enforce single-firing
  3340. locked = locked || options.once;
  3341.  
  3342. // Execute callbacks for all pending executions,
  3343. // respecting firingIndex overrides and runtime changes
  3344. fired = firing = true;
  3345. for ( ; queue.length; firingIndex = -1 ) {
  3346. memory = queue.shift();
  3347. while ( ++firingIndex < list.length ) {
  3348.  
  3349. // Run callback and check for early termination
  3350. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  3351. options.stopOnFalse ) {
  3352.  
  3353. // Jump to end and forget the data so .add doesn't re-fire
  3354. firingIndex = list.length;
  3355. memory = false;
  3356. }
  3357. }
  3358. }
  3359.  
  3360. // Forget the data if we're done with it
  3361. if ( !options.memory ) {
  3362. memory = false;
  3363. }
  3364.  
  3365. firing = false;
  3366.  
  3367. // Clean up if we're done firing for good
  3368. if ( locked ) {
  3369.  
  3370. // Keep an empty list if we have data for future add calls
  3371. if ( memory ) {
  3372. list = [];
  3373.  
  3374. // Otherwise, this object is spent
  3375. } else {
  3376. list = "";
  3377. }
  3378. }
  3379. },
  3380.  
  3381. // Actual Callbacks object
  3382. self = {
  3383.  
  3384. // Add a callback or a collection of callbacks to the list
  3385. add: function() {
  3386. if ( list ) {
  3387.  
  3388. // If we have memory from a past run, we should fire after adding
  3389. if ( memory && !firing ) {
  3390. firingIndex = list.length - 1;
  3391. queue.push( memory );
  3392. }
  3393.  
  3394. ( function add( args ) {
  3395. jQuery.each( args, function( _, arg ) {
  3396. if ( isFunction( arg ) ) {
  3397. if ( !options.unique || !self.has( arg ) ) {
  3398. list.push( arg );
  3399. }
  3400. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  3401.  
  3402. // Inspect recursively
  3403. add( arg );
  3404. }
  3405. } );
  3406. } )( arguments );
  3407.  
  3408. if ( memory && !firing ) {
  3409. fire();
  3410. }
  3411. }
  3412. return this;
  3413. },
  3414.  
  3415. // Remove a callback from the list
  3416. remove: function() {
  3417. jQuery.each( arguments, function( _, arg ) {
  3418. var index;
  3419. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  3420. list.splice( index, 1 );
  3421.  
  3422. // Handle firing indexes
  3423. if ( index <= firingIndex ) {
  3424. firingIndex--;
  3425. }
  3426. }
  3427. } );
  3428. return this;
  3429. },
  3430.  
  3431. // Check if a given callback is in the list.
  3432. // If no argument is given, return whether or not list has callbacks attached.
  3433. has: function( fn ) {
  3434. return fn ?
  3435. jQuery.inArray( fn, list ) > -1 :
  3436. list.length > 0;
  3437. },
  3438.  
  3439. // Remove all callbacks from the list
  3440. empty: function() {
  3441. if ( list ) {
  3442. list = [];
  3443. }
  3444. return this;
  3445. },
  3446.  
  3447. // Disable .fire and .add
  3448. // Abort any current/pending executions
  3449. // Clear all callbacks and values
  3450. disable: function() {
  3451. locked = queue = [];
  3452. list = memory = "";
  3453. return this;
  3454. },
  3455. disabled: function() {
  3456. return !list;
  3457. },
  3458.  
  3459. // Disable .fire
  3460. // Also disable .add unless we have memory (since it would have no effect)
  3461. // Abort any pending executions
  3462. lock: function() {
  3463. locked = queue = [];
  3464. if ( !memory && !firing ) {
  3465. list = memory = "";
  3466. }
  3467. return this;
  3468. },
  3469. locked: function() {
  3470. return !!locked;
  3471. },
  3472.  
  3473. // Call all callbacks with the given context and arguments
  3474. fireWith: function( context, args ) {
  3475. if ( !locked ) {
  3476. args = args || [];
  3477. args = [ context, args.slice ? args.slice() : args ];
  3478. queue.push( args );
  3479. if ( !firing ) {
  3480. fire();
  3481. }
  3482. }
  3483. return this;
  3484. },
  3485.  
  3486. // Call all the callbacks with the given arguments
  3487. fire: function() {
  3488. self.fireWith( this, arguments );
  3489. return this;
  3490. },
  3491.  
  3492. // To know if the callbacks have already been called at least once
  3493. fired: function() {
  3494. return !!fired;
  3495. }
  3496. };
  3497.  
  3498. return self;
  3499. };
  3500.  
  3501.  
  3502. function Identity( v ) {
  3503. return v;
  3504. }
  3505. function Thrower( ex ) {
  3506. throw ex;
  3507. }
  3508.  
  3509. function adoptValue( value, resolve, reject, noValue ) {
  3510. var method;
  3511.  
  3512. try {
  3513.  
  3514. // Check for promise aspect first to privilege synchronous behavior
  3515. if ( value && isFunction( ( method = value.promise ) ) ) {
  3516. method.call( value ).done( resolve ).fail( reject );
  3517.  
  3518. // Other thenables
  3519. } else if ( value && isFunction( ( method = value.then ) ) ) {
  3520. method.call( value, resolve, reject );
  3521.  
  3522. // Other non-thenables
  3523. } else {
  3524.  
  3525. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  3526. // * false: [ value ].slice( 0 ) => resolve( value )
  3527. // * true: [ value ].slice( 1 ) => resolve()
  3528. resolve.apply( undefined, [ value ].slice( noValue ) );
  3529. }
  3530.  
  3531. // For Promises/A+, convert exceptions into rejections
  3532. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  3533. // Deferred#then to conditionally suppress rejection.
  3534. } catch ( value ) {
  3535.  
  3536. // Support: Android 4.0 only
  3537. // Strict mode functions invoked without .call/.apply get global-object context
  3538. reject.apply( undefined, [ value ] );
  3539. }
  3540. }
  3541.  
  3542. jQuery.extend( {
  3543.  
  3544. Deferred: function( func ) {
  3545. var tuples = [
  3546.  
  3547. // action, add listener, callbacks,
  3548. // ... .then handlers, argument index, [final state]
  3549. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  3550. jQuery.Callbacks( "memory" ), 2 ],
  3551. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  3552. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  3553. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  3554. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  3555. ],
  3556. state = "pending",
  3557. promise = {
  3558. state: function() {
  3559. return state;
  3560. },
  3561. always: function() {
  3562. deferred.done( arguments ).fail( arguments );
  3563. return this;
  3564. },
  3565. "catch": function( fn ) {
  3566. return promise.then( null, fn );
  3567. },
  3568.  
  3569. // Keep pipe for back-compat
  3570. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  3571. var fns = arguments;
  3572.  
  3573. return jQuery.Deferred( function( newDefer ) {
  3574. jQuery.each( tuples, function( _i, tuple ) {
  3575.  
  3576. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  3577. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  3578.  
  3579. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  3580. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  3581. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  3582. deferred[ tuple[ 1 ] ]( function() {
  3583. var returned = fn && fn.apply( this, arguments );
  3584. if ( returned && isFunction( returned.promise ) ) {
  3585. returned.promise()
  3586. .progress( newDefer.notify )
  3587. .done( newDefer.resolve )
  3588. .fail( newDefer.reject );
  3589. } else {
  3590. newDefer[ tuple[ 0 ] + "With" ](
  3591. this,
  3592. fn ? [ returned ] : arguments
  3593. );
  3594. }
  3595. } );
  3596. } );
  3597. fns = null;
  3598. } ).promise();
  3599. },
  3600. then: function( onFulfilled, onRejected, onProgress ) {
  3601. var maxDepth = 0;
  3602. function resolve( depth, deferred, handler, special ) {
  3603. return function() {
  3604. var that = this,
  3605. args = arguments,
  3606. mightThrow = function() {
  3607. var returned, then;
  3608.  
  3609. // Support: Promises/A+ section 2.3.3.3.3
  3610. // https://promisesaplus.com/#point-59
  3611. // Ignore double-resolution attempts
  3612. if ( depth < maxDepth ) {
  3613. return;
  3614. }
  3615.  
  3616. returned = handler.apply( that, args );
  3617.  
  3618. // Support: Promises/A+ section 2.3.1
  3619. // https://promisesaplus.com/#point-48
  3620. if ( returned === deferred.promise() ) {
  3621. throw new TypeError( "Thenable self-resolution" );
  3622. }
  3623.  
  3624. // Support: Promises/A+ sections 2.3.3.1, 3.5
  3625. // https://promisesaplus.com/#point-54
  3626. // https://promisesaplus.com/#point-75
  3627. // Retrieve `then` only once
  3628. then = returned &&
  3629.  
  3630. // Support: Promises/A+ section 2.3.4
  3631. // https://promisesaplus.com/#point-64
  3632. // Only check objects and functions for thenability
  3633. ( typeof returned === "object" ||
  3634. typeof returned === "function" ) &&
  3635. returned.then;
  3636.  
  3637. // Handle a returned thenable
  3638. if ( isFunction( then ) ) {
  3639.  
  3640. // Special processors (notify) just wait for resolution
  3641. if ( special ) {
  3642. then.call(
  3643. returned,
  3644. resolve( maxDepth, deferred, Identity, special ),
  3645. resolve( maxDepth, deferred, Thrower, special )
  3646. );
  3647.  
  3648. // Normal processors (resolve) also hook into progress
  3649. } else {
  3650.  
  3651. // ...and disregard older resolution values
  3652. maxDepth++;
  3653.  
  3654. then.call(
  3655. returned,
  3656. resolve( maxDepth, deferred, Identity, special ),
  3657. resolve( maxDepth, deferred, Thrower, special ),
  3658. resolve( maxDepth, deferred, Identity,
  3659. deferred.notifyWith )
  3660. );
  3661. }
  3662.  
  3663. // Handle all other returned values
  3664. } else {
  3665.  
  3666. // Only substitute handlers pass on context
  3667. // and multiple values (non-spec behavior)
  3668. if ( handler !== Identity ) {
  3669. that = undefined;
  3670. args = [ returned ];
  3671. }
  3672.  
  3673. // Process the value(s)
  3674. // Default process is resolve
  3675. ( special || deferred.resolveWith )( that, args );
  3676. }
  3677. },
  3678.  
  3679. // Only normal processors (resolve) catch and reject exceptions
  3680. process = special ?
  3681. mightThrow :
  3682. function() {
  3683. try {
  3684. mightThrow();
  3685. } catch ( e ) {
  3686.  
  3687. if ( jQuery.Deferred.exceptionHook ) {
  3688. jQuery.Deferred.exceptionHook( e,
  3689. process.error );
  3690. }
  3691.  
  3692. // Support: Promises/A+ section 2.3.3.3.4.1
  3693. // https://promisesaplus.com/#point-61
  3694. // Ignore post-resolution exceptions
  3695. if ( depth + 1 >= maxDepth ) {
  3696.  
  3697. // Only substitute handlers pass on context
  3698. // and multiple values (non-spec behavior)
  3699. if ( handler !== Thrower ) {
  3700. that = undefined;
  3701. args = [ e ];
  3702. }
  3703.  
  3704. deferred.rejectWith( that, args );
  3705. }
  3706. }
  3707. };
  3708.  
  3709. // Support: Promises/A+ section 2.3.3.3.1
  3710. // https://promisesaplus.com/#point-57
  3711. // Re-resolve promises immediately to dodge false rejection from
  3712. // subsequent errors
  3713. if ( depth ) {
  3714. process();
  3715. } else {
  3716.  
  3717. // Call an optional hook to record the error, in case of exception
  3718. // since it's otherwise lost when execution goes async
  3719. if ( jQuery.Deferred.getErrorHook ) {
  3720. process.error = jQuery.Deferred.getErrorHook();
  3721.  
  3722. // The deprecated alias of the above. While the name suggests
  3723. // returning the stack, not an error instance, jQuery just passes
  3724. // it directly to `console.warn` so both will work; an instance
  3725. // just better cooperates with source maps.
  3726. } else if ( jQuery.Deferred.getStackHook ) {
  3727. process.error = jQuery.Deferred.getStackHook();
  3728. }
  3729. window.setTimeout( process );
  3730. }
  3731. };
  3732. }
  3733.  
  3734. return jQuery.Deferred( function( newDefer ) {
  3735.  
  3736. // progress_handlers.add( ... )
  3737. tuples[ 0 ][ 3 ].add(
  3738. resolve(
  3739. 0,
  3740. newDefer,
  3741. isFunction( onProgress ) ?
  3742. onProgress :
  3743. Identity,
  3744. newDefer.notifyWith
  3745. )
  3746. );
  3747.  
  3748. // fulfilled_handlers.add( ... )
  3749. tuples[ 1 ][ 3 ].add(
  3750. resolve(
  3751. 0,
  3752. newDefer,
  3753. isFunction( onFulfilled ) ?
  3754. onFulfilled :
  3755. Identity
  3756. )
  3757. );
  3758.  
  3759. // rejected_handlers.add( ... )
  3760. tuples[ 2 ][ 3 ].add(
  3761. resolve(
  3762. 0,
  3763. newDefer,
  3764. isFunction( onRejected ) ?
  3765. onRejected :
  3766. Thrower
  3767. )
  3768. );
  3769. } ).promise();
  3770. },
  3771.  
  3772. // Get a promise for this deferred
  3773. // If obj is provided, the promise aspect is added to the object
  3774. promise: function( obj ) {
  3775. return obj != null ? jQuery.extend( obj, promise ) : promise;
  3776. }
  3777. },
  3778. deferred = {};
  3779.  
  3780. // Add list-specific methods
  3781. jQuery.each( tuples, function( i, tuple ) {
  3782. var list = tuple[ 2 ],
  3783. stateString = tuple[ 5 ];
  3784.  
  3785. // promise.progress = list.add
  3786. // promise.done = list.add
  3787. // promise.fail = list.add
  3788. promise[ tuple[ 1 ] ] = list.add;
  3789.  
  3790. // Handle state
  3791. if ( stateString ) {
  3792. list.add(
  3793. function() {
  3794.  
  3795. // state = "resolved" (i.e., fulfilled)
  3796. // state = "rejected"
  3797. state = stateString;
  3798. },
  3799.  
  3800. // rejected_callbacks.disable
  3801. // fulfilled_callbacks.disable
  3802. tuples[ 3 - i ][ 2 ].disable,
  3803.  
  3804. // rejected_handlers.disable
  3805. // fulfilled_handlers.disable
  3806. tuples[ 3 - i ][ 3 ].disable,
  3807.  
  3808. // progress_callbacks.lock
  3809. tuples[ 0 ][ 2 ].lock,
  3810.  
  3811. // progress_handlers.lock
  3812. tuples[ 0 ][ 3 ].lock
  3813. );
  3814. }
  3815.  
  3816. // progress_handlers.fire
  3817. // fulfilled_handlers.fire
  3818. // rejected_handlers.fire
  3819. list.add( tuple[ 3 ].fire );
  3820.  
  3821. // deferred.notify = function() { deferred.notifyWith(...) }
  3822. // deferred.resolve = function() { deferred.resolveWith(...) }
  3823. // deferred.reject = function() { deferred.rejectWith(...) }
  3824. deferred[ tuple[ 0 ] ] = function() {
  3825. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  3826. return this;
  3827. };
  3828.  
  3829. // deferred.notifyWith = list.fireWith
  3830. // deferred.resolveWith = list.fireWith
  3831. // deferred.rejectWith = list.fireWith
  3832. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  3833. } );
  3834.  
  3835. // Make the deferred a promise
  3836. promise.promise( deferred );
  3837.  
  3838. // Call given func if any
  3839. if ( func ) {
  3840. func.call( deferred, deferred );
  3841. }
  3842.  
  3843. // All done!
  3844. return deferred;
  3845. },
  3846.  
  3847. // Deferred helper
  3848. when: function( singleValue ) {
  3849. var
  3850.  
  3851. // count of uncompleted subordinates
  3852. remaining = arguments.length,
  3853.  
  3854. // count of unprocessed arguments
  3855. i = remaining,
  3856.  
  3857. // subordinate fulfillment data
  3858. resolveContexts = Array( i ),
  3859. resolveValues = slice.call( arguments ),
  3860.  
  3861. // the primary Deferred
  3862. primary = jQuery.Deferred(),
  3863.  
  3864. // subordinate callback factory
  3865. updateFunc = function( i ) {
  3866. return function( value ) {
  3867. resolveContexts[ i ] = this;
  3868. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  3869. if ( !( --remaining ) ) {
  3870. primary.resolveWith( resolveContexts, resolveValues );
  3871. }
  3872. };
  3873. };
  3874.  
  3875. // Single- and empty arguments are adopted like Promise.resolve
  3876. if ( remaining <= 1 ) {
  3877. adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
  3878. !remaining );
  3879.  
  3880. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  3881. if ( primary.state() === "pending" ||
  3882. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  3883.  
  3884. return primary.then();
  3885. }
  3886. }
  3887.  
  3888. // Multiple arguments are aggregated like Promise.all array elements
  3889. while ( i-- ) {
  3890. adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
  3891. }
  3892.  
  3893. return primary.promise();
  3894. }
  3895. } );
  3896.  
  3897.  
  3898. // These usually indicate a programmer mistake during development,
  3899. // warn about them ASAP rather than swallowing them by default.
  3900. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  3901.  
  3902. // If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
  3903. // captured before the async barrier to get the original error cause
  3904. // which may otherwise be hidden.
  3905. jQuery.Deferred.exceptionHook = function( error, asyncError ) {
  3906.  
  3907. // Support: IE 8 - 9 only
  3908. // Console exists when dev tools are open, which can happen at any time
  3909. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  3910. window.console.warn( "jQuery.Deferred exception: " + error.message,
  3911. error.stack, asyncError );
  3912. }
  3913. };
  3914.  
  3915.  
  3916.  
  3917.  
  3918. jQuery.readyException = function( error ) {
  3919. window.setTimeout( function() {
  3920. throw error;
  3921. } );
  3922. };
  3923.  
  3924.  
  3925.  
  3926.  
  3927. // The deferred used on DOM ready
  3928. var readyList = jQuery.Deferred();
  3929.  
  3930. jQuery.fn.ready = function( fn ) {
  3931.  
  3932. readyList
  3933. .then( fn )
  3934.  
  3935. // Wrap jQuery.readyException in a function so that the lookup
  3936. // happens at the time of error handling instead of callback
  3937. // registration.
  3938. .catch( function( error ) {
  3939. jQuery.readyException( error );
  3940. } );
  3941.  
  3942. return this;
  3943. };
  3944.  
  3945. jQuery.extend( {
  3946.  
  3947. // Is the DOM ready to be used? Set to true once it occurs.
  3948. isReady: false,
  3949.  
  3950. // A counter to track how many items to wait for before
  3951. // the ready event fires. See trac-6781
  3952. readyWait: 1,
  3953.  
  3954. // Handle when the DOM is ready
  3955. ready: function( wait ) {
  3956.  
  3957. // Abort if there are pending holds or we're already ready
  3958. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3959. return;
  3960. }
  3961.  
  3962. // Remember that the DOM is ready
  3963. jQuery.isReady = true;
  3964.  
  3965. // If a normal DOM Ready event fired, decrement, and wait if need be
  3966. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3967. return;
  3968. }
  3969.  
  3970. // If there are functions bound, to execute
  3971. readyList.resolveWith( document, [ jQuery ] );
  3972. }
  3973. } );
  3974.  
  3975. jQuery.ready.then = readyList.then;
  3976.  
  3977. // The ready event handler and self cleanup method
  3978. function completed() {
  3979. document.removeEventListener( "DOMContentLoaded", completed );
  3980. window.removeEventListener( "load", completed );
  3981. jQuery.ready();
  3982. }
  3983.  
  3984. // Catch cases where $(document).ready() is called
  3985. // after the browser event has already occurred.
  3986. // Support: IE <=9 - 10 only
  3987. // Older IE sometimes signals "interactive" too soon
  3988. if ( document.readyState === "complete" ||
  3989. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  3990.  
  3991. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3992. window.setTimeout( jQuery.ready );
  3993.  
  3994. } else {
  3995.  
  3996. // Use the handy event callback
  3997. document.addEventListener( "DOMContentLoaded", completed );
  3998.  
  3999. // A fallback to window.onload, that will always work
  4000. window.addEventListener( "load", completed );
  4001. }
  4002.  
  4003.  
  4004.  
  4005.  
  4006. // Multifunctional method to get and set values of a collection
  4007. // The value/s can optionally be executed if it's a function
  4008. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  4009. var i = 0,
  4010. len = elems.length,
  4011. bulk = key == null;
  4012.  
  4013. // Sets many values
  4014. if ( toType( key ) === "object" ) {
  4015. chainable = true;
  4016. for ( i in key ) {
  4017. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  4018. }
  4019.  
  4020. // Sets one value
  4021. } else if ( value !== undefined ) {
  4022. chainable = true;
  4023.  
  4024. if ( !isFunction( value ) ) {
  4025. raw = true;
  4026. }
  4027.  
  4028. if ( bulk ) {
  4029.  
  4030. // Bulk operations run against the entire set
  4031. if ( raw ) {
  4032. fn.call( elems, value );
  4033. fn = null;
  4034.  
  4035. // ...except when executing function values
  4036. } else {
  4037. bulk = fn;
  4038. fn = function( elem, _key, value ) {
  4039. return bulk.call( jQuery( elem ), value );
  4040. };
  4041. }
  4042. }
  4043.  
  4044. if ( fn ) {
  4045. for ( ; i < len; i++ ) {
  4046. fn(
  4047. elems[ i ], key, raw ?
  4048. value :
  4049. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  4050. );
  4051. }
  4052. }
  4053. }
  4054.  
  4055. if ( chainable ) {
  4056. return elems;
  4057. }
  4058.  
  4059. // Gets
  4060. if ( bulk ) {
  4061. return fn.call( elems );
  4062. }
  4063.  
  4064. return len ? fn( elems[ 0 ], key ) : emptyGet;
  4065. };
  4066.  
  4067.  
  4068. // Matches dashed string for camelizing
  4069. var rmsPrefix = /^-ms-/,
  4070. rdashAlpha = /-([a-z])/g;
  4071.  
  4072. // Used by camelCase as callback to replace()
  4073. function fcamelCase( _all, letter ) {
  4074. return letter.toUpperCase();
  4075. }
  4076.  
  4077. // Convert dashed to camelCase; used by the css and data modules
  4078. // Support: IE <=9 - 11, Edge 12 - 15
  4079. // Microsoft forgot to hump their vendor prefix (trac-9572)
  4080. function camelCase( string ) {
  4081. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  4082. }
  4083. var acceptData = function( owner ) {
  4084.  
  4085. // Accepts only:
  4086. // - Node
  4087. // - Node.ELEMENT_NODE
  4088. // - Node.DOCUMENT_NODE
  4089. // - Object
  4090. // - Any
  4091. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  4092. };
  4093.  
  4094.  
  4095.  
  4096.  
  4097. function Data() {
  4098. this.expando = jQuery.expando + Data.uid++;
  4099. }
  4100.  
  4101. Data.uid = 1;
  4102.  
  4103. Data.prototype = {
  4104.  
  4105. cache: function( owner ) {
  4106.  
  4107. // Check if the owner object already has a cache
  4108. var value = owner[ this.expando ];
  4109.  
  4110. // If not, create one
  4111. if ( !value ) {
  4112. value = {};
  4113.  
  4114. // We can accept data for non-element nodes in modern browsers,
  4115. // but we should not, see trac-8335.
  4116. // Always return an empty object.
  4117. if ( acceptData( owner ) ) {
  4118.  
  4119. // If it is a node unlikely to be stringify-ed or looped over
  4120. // use plain assignment
  4121. if ( owner.nodeType ) {
  4122. owner[ this.expando ] = value;
  4123.  
  4124. // Otherwise secure it in a non-enumerable property
  4125. // configurable must be true to allow the property to be
  4126. // deleted when data is removed
  4127. } else {
  4128. Object.defineProperty( owner, this.expando, {
  4129. value: value,
  4130. configurable: true
  4131. } );
  4132. }
  4133. }
  4134. }
  4135.  
  4136. return value;
  4137. },
  4138. set: function( owner, data, value ) {
  4139. var prop,
  4140. cache = this.cache( owner );
  4141.  
  4142. // Handle: [ owner, key, value ] args
  4143. // Always use camelCase key (gh-2257)
  4144. if ( typeof data === "string" ) {
  4145. cache[ camelCase( data ) ] = value;
  4146.  
  4147. // Handle: [ owner, { properties } ] args
  4148. } else {
  4149.  
  4150. // Copy the properties one-by-one to the cache object
  4151. for ( prop in data ) {
  4152. cache[ camelCase( prop ) ] = data[ prop ];
  4153. }
  4154. }
  4155. return cache;
  4156. },
  4157. get: function( owner, key ) {
  4158. return key === undefined ?
  4159. this.cache( owner ) :
  4160.  
  4161. // Always use camelCase key (gh-2257)
  4162. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  4163. },
  4164. access: function( owner, key, value ) {
  4165.  
  4166. // In cases where either:
  4167. //
  4168. // 1. No key was specified
  4169. // 2. A string key was specified, but no value provided
  4170. //
  4171. // Take the "read" path and allow the get method to determine
  4172. // which value to return, respectively either:
  4173. //
  4174. // 1. The entire cache object
  4175. // 2. The data stored at the key
  4176. //
  4177. if ( key === undefined ||
  4178. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  4179.  
  4180. return this.get( owner, key );
  4181. }
  4182.  
  4183. // When the key is not a string, or both a key and value
  4184. // are specified, set or extend (existing objects) with either:
  4185. //
  4186. // 1. An object of properties
  4187. // 2. A key and value
  4188. //
  4189. this.set( owner, key, value );
  4190.  
  4191. // Since the "set" path can have two possible entry points
  4192. // return the expected data based on which path was taken[*]
  4193. return value !== undefined ? value : key;
  4194. },
  4195. remove: function( owner, key ) {
  4196. var i,
  4197. cache = owner[ this.expando ];
  4198.  
  4199. if ( cache === undefined ) {
  4200. return;
  4201. }
  4202.  
  4203. if ( key !== undefined ) {
  4204.  
  4205. // Support array or space separated string of keys
  4206. if ( Array.isArray( key ) ) {
  4207.  
  4208. // If key is an array of keys...
  4209. // We always set camelCase keys, so remove that.
  4210. key = key.map( camelCase );
  4211. } else {
  4212. key = camelCase( key );
  4213.  
  4214. // If a key with the spaces exists, use it.
  4215. // Otherwise, create an array by matching non-whitespace
  4216. key = key in cache ?
  4217. [ key ] :
  4218. ( key.match( rnothtmlwhite ) || [] );
  4219. }
  4220.  
  4221. i = key.length;
  4222.  
  4223. while ( i-- ) {
  4224. delete cache[ key[ i ] ];
  4225. }
  4226. }
  4227.  
  4228. // Remove the expando if there's no more data
  4229. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  4230.  
  4231. // Support: Chrome <=35 - 45
  4232. // Webkit & Blink performance suffers when deleting properties
  4233. // from DOM nodes, so set to undefined instead
  4234. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  4235. if ( owner.nodeType ) {
  4236. owner[ this.expando ] = undefined;
  4237. } else {
  4238. delete owner[ this.expando ];
  4239. }
  4240. }
  4241. },
  4242. hasData: function( owner ) {
  4243. var cache = owner[ this.expando ];
  4244. return cache !== undefined && !jQuery.isEmptyObject( cache );
  4245. }
  4246. };
  4247. var dataPriv = new Data();
  4248.  
  4249. var dataUser = new Data();
  4250.  
  4251.  
  4252.  
  4253. // Implementation Summary
  4254. //
  4255. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  4256. // 2. Improve the module's maintainability by reducing the storage
  4257. // paths to a single mechanism.
  4258. // 3. Use the same single mechanism to support "private" and "user" data.
  4259. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  4260. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  4261. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  4262.  
  4263. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  4264. rmultiDash = /[A-Z]/g;
  4265.  
  4266. function getData( data ) {
  4267. if ( data === "true" ) {
  4268. return true;
  4269. }
  4270.  
  4271. if ( data === "false" ) {
  4272. return false;
  4273. }
  4274.  
  4275. if ( data === "null" ) {
  4276. return null;
  4277. }
  4278.  
  4279. // Only convert to a number if it doesn't change the string
  4280. if ( data === +data + "" ) {
  4281. return +data;
  4282. }
  4283.  
  4284. if ( rbrace.test( data ) ) {
  4285. return JSON.parse( data );
  4286. }
  4287.  
  4288. return data;
  4289. }
  4290.  
  4291. function dataAttr( elem, key, data ) {
  4292. var name;
  4293.  
  4294. // If nothing was found internally, try to fetch any
  4295. // data from the HTML5 data-* attribute
  4296. if ( data === undefined && elem.nodeType === 1 ) {
  4297. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  4298. data = elem.getAttribute( name );
  4299.  
  4300. if ( typeof data === "string" ) {
  4301. try {
  4302. data = getData( data );
  4303. } catch ( e ) {}
  4304.  
  4305. // Make sure we set the data so it isn't changed later
  4306. dataUser.set( elem, key, data );
  4307. } else {
  4308. data = undefined;
  4309. }
  4310. }
  4311. return data;
  4312. }
  4313.  
  4314. jQuery.extend( {
  4315. hasData: function( elem ) {
  4316. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  4317. },
  4318.  
  4319. data: function( elem, name, data ) {
  4320. return dataUser.access( elem, name, data );
  4321. },
  4322.  
  4323. removeData: function( elem, name ) {
  4324. dataUser.remove( elem, name );
  4325. },
  4326.  
  4327. // TODO: Now that all calls to _data and _removeData have been replaced
  4328. // with direct calls to dataPriv methods, these can be deprecated.
  4329. _data: function( elem, name, data ) {
  4330. return dataPriv.access( elem, name, data );
  4331. },
  4332.  
  4333. _removeData: function( elem, name ) {
  4334. dataPriv.remove( elem, name );
  4335. }
  4336. } );
  4337.  
  4338. jQuery.fn.extend( {
  4339. data: function( key, value ) {
  4340. var i, name, data,
  4341. elem = this[ 0 ],
  4342. attrs = elem && elem.attributes;
  4343.  
  4344. // Gets all values
  4345. if ( key === undefined ) {
  4346. if ( this.length ) {
  4347. data = dataUser.get( elem );
  4348.  
  4349. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  4350. i = attrs.length;
  4351. while ( i-- ) {
  4352.  
  4353. // Support: IE 11 only
  4354. // The attrs elements can be null (trac-14894)
  4355. if ( attrs[ i ] ) {
  4356. name = attrs[ i ].name;
  4357. if ( name.indexOf( "data-" ) === 0 ) {
  4358. name = camelCase( name.slice( 5 ) );
  4359. dataAttr( elem, name, data[ name ] );
  4360. }
  4361. }
  4362. }
  4363. dataPriv.set( elem, "hasDataAttrs", true );
  4364. }
  4365. }
  4366.  
  4367. return data;
  4368. }
  4369.  
  4370. // Sets multiple values
  4371. if ( typeof key === "object" ) {
  4372. return this.each( function() {
  4373. dataUser.set( this, key );
  4374. } );
  4375. }
  4376.  
  4377. return access( this, function( value ) {
  4378. var data;
  4379.  
  4380. // The calling jQuery object (element matches) is not empty
  4381. // (and therefore has an element appears at this[ 0 ]) and the
  4382. // `value` parameter was not undefined. An empty jQuery object
  4383. // will result in `undefined` for elem = this[ 0 ] which will
  4384. // throw an exception if an attempt to read a data cache is made.
  4385. if ( elem && value === undefined ) {
  4386.  
  4387. // Attempt to get data from the cache
  4388. // The key will always be camelCased in Data
  4389. data = dataUser.get( elem, key );
  4390. if ( data !== undefined ) {
  4391. return data;
  4392. }
  4393.  
  4394. // Attempt to "discover" the data in
  4395. // HTML5 custom data-* attrs
  4396. data = dataAttr( elem, key );
  4397. if ( data !== undefined ) {
  4398. return data;
  4399. }
  4400.  
  4401. // We tried really hard, but the data doesn't exist.
  4402. return;
  4403. }
  4404.  
  4405. // Set the data...
  4406. this.each( function() {
  4407.  
  4408. // We always store the camelCased key
  4409. dataUser.set( this, key, value );
  4410. } );
  4411. }, null, value, arguments.length > 1, null, true );
  4412. },
  4413.  
  4414. removeData: function( key ) {
  4415. return this.each( function() {
  4416. dataUser.remove( this, key );
  4417. } );
  4418. }
  4419. } );
  4420.  
  4421.  
  4422. jQuery.extend( {
  4423. queue: function( elem, type, data ) {
  4424. var queue;
  4425.  
  4426. if ( elem ) {
  4427. type = ( type || "fx" ) + "queue";
  4428. queue = dataPriv.get( elem, type );
  4429.  
  4430. // Speed up dequeue by getting out quickly if this is just a lookup
  4431. if ( data ) {
  4432. if ( !queue || Array.isArray( data ) ) {
  4433. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  4434. } else {
  4435. queue.push( data );
  4436. }
  4437. }
  4438. return queue || [];
  4439. }
  4440. },
  4441.  
  4442. dequeue: function( elem, type ) {
  4443. type = type || "fx";
  4444.  
  4445. var queue = jQuery.queue( elem, type ),
  4446. startLength = queue.length,
  4447. fn = queue.shift(),
  4448. hooks = jQuery._queueHooks( elem, type ),
  4449. next = function() {
  4450. jQuery.dequeue( elem, type );
  4451. };
  4452.  
  4453. // If the fx queue is dequeued, always remove the progress sentinel
  4454. if ( fn === "inprogress" ) {
  4455. fn = queue.shift();
  4456. startLength--;
  4457. }
  4458.  
  4459. if ( fn ) {
  4460.  
  4461. // Add a progress sentinel to prevent the fx queue from being
  4462. // automatically dequeued
  4463. if ( type === "fx" ) {
  4464. queue.unshift( "inprogress" );
  4465. }
  4466.  
  4467. // Clear up the last queue stop function
  4468. delete hooks.stop;
  4469. fn.call( elem, next, hooks );
  4470. }
  4471.  
  4472. if ( !startLength && hooks ) {
  4473. hooks.empty.fire();
  4474. }
  4475. },
  4476.  
  4477. // Not public - generate a queueHooks object, or return the current one
  4478. _queueHooks: function( elem, type ) {
  4479. var key = type + "queueHooks";
  4480. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  4481. empty: jQuery.Callbacks( "once memory" ).add( function() {
  4482. dataPriv.remove( elem, [ type + "queue", key ] );
  4483. } )
  4484. } );
  4485. }
  4486. } );
  4487.  
  4488. jQuery.fn.extend( {
  4489. queue: function( type, data ) {
  4490. var setter = 2;
  4491.  
  4492. if ( typeof type !== "string" ) {
  4493. data = type;
  4494. type = "fx";
  4495. setter--;
  4496. }
  4497.  
  4498. if ( arguments.length < setter ) {
  4499. return jQuery.queue( this[ 0 ], type );
  4500. }
  4501.  
  4502. return data === undefined ?
  4503. this :
  4504. this.each( function() {
  4505. var queue = jQuery.queue( this, type, data );
  4506.  
  4507. // Ensure a hooks for this queue
  4508. jQuery._queueHooks( this, type );
  4509.  
  4510. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  4511. jQuery.dequeue( this, type );
  4512. }
  4513. } );
  4514. },
  4515. dequeue: function( type ) {
  4516. return this.each( function() {
  4517. jQuery.dequeue( this, type );
  4518. } );
  4519. },
  4520. clearQueue: function( type ) {
  4521. return this.queue( type || "fx", [] );
  4522. },
  4523.  
  4524. // Get a promise resolved when queues of a certain type
  4525. // are emptied (fx is the type by default)
  4526. promise: function( type, obj ) {
  4527. var tmp,
  4528. count = 1,
  4529. defer = jQuery.Deferred(),
  4530. elements = this,
  4531. i = this.length,
  4532. resolve = function() {
  4533. if ( !( --count ) ) {
  4534. defer.resolveWith( elements, [ elements ] );
  4535. }
  4536. };
  4537.  
  4538. if ( typeof type !== "string" ) {
  4539. obj = type;
  4540. type = undefined;
  4541. }
  4542. type = type || "fx";
  4543.  
  4544. while ( i-- ) {
  4545. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  4546. if ( tmp && tmp.empty ) {
  4547. count++;
  4548. tmp.empty.add( resolve );
  4549. }
  4550. }
  4551. resolve();
  4552. return defer.promise( obj );
  4553. }
  4554. } );
  4555. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  4556.  
  4557. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  4558.  
  4559.  
  4560. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  4561.  
  4562. var documentElement = document.documentElement;
  4563.  
  4564.  
  4565.  
  4566. var isAttached = function( elem ) {
  4567. return jQuery.contains( elem.ownerDocument, elem );
  4568. },
  4569. composed = { composed: true };
  4570.  
  4571. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  4572. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  4573. // Support: iOS 10.0-10.2 only
  4574. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  4575. // leading to errors. We need to check for `getRootNode`.
  4576. if ( documentElement.getRootNode ) {
  4577. isAttached = function( elem ) {
  4578. return jQuery.contains( elem.ownerDocument, elem ) ||
  4579. elem.getRootNode( composed ) === elem.ownerDocument;
  4580. };
  4581. }
  4582. var isHiddenWithinTree = function( elem, el ) {
  4583.  
  4584. // isHiddenWithinTree might be called from jQuery#filter function;
  4585. // in that case, element will be second argument
  4586. elem = el || elem;
  4587.  
  4588. // Inline style trumps all
  4589. return elem.style.display === "none" ||
  4590. elem.style.display === "" &&
  4591.  
  4592. // Otherwise, check computed style
  4593. // Support: Firefox <=43 - 45
  4594. // Disconnected elements can have computed display: none, so first confirm that elem is
  4595. // in the document.
  4596. isAttached( elem ) &&
  4597.  
  4598. jQuery.css( elem, "display" ) === "none";
  4599. };
  4600.  
  4601.  
  4602.  
  4603. function adjustCSS( elem, prop, valueParts, tween ) {
  4604. var adjusted, scale,
  4605. maxIterations = 20,
  4606. currentValue = tween ?
  4607. function() {
  4608. return tween.cur();
  4609. } :
  4610. function() {
  4611. return jQuery.css( elem, prop, "" );
  4612. },
  4613. initial = currentValue(),
  4614. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  4615.  
  4616. // Starting value computation is required for potential unit mismatches
  4617. initialInUnit = elem.nodeType &&
  4618. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  4619. rcssNum.exec( jQuery.css( elem, prop ) );
  4620.  
  4621. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  4622.  
  4623. // Support: Firefox <=54
  4624. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  4625. initial = initial / 2;
  4626.  
  4627. // Trust units reported by jQuery.css
  4628. unit = unit || initialInUnit[ 3 ];
  4629.  
  4630. // Iteratively approximate from a nonzero starting point
  4631. initialInUnit = +initial || 1;
  4632.  
  4633. while ( maxIterations-- ) {
  4634.  
  4635. // Evaluate and update our best guess (doubling guesses that zero out).
  4636. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  4637. jQuery.style( elem, prop, initialInUnit + unit );
  4638. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  4639. maxIterations = 0;
  4640. }
  4641. initialInUnit = initialInUnit / scale;
  4642.  
  4643. }
  4644.  
  4645. initialInUnit = initialInUnit * 2;
  4646. jQuery.style( elem, prop, initialInUnit + unit );
  4647.  
  4648. // Make sure we update the tween properties later on
  4649. valueParts = valueParts || [];
  4650. }
  4651.  
  4652. if ( valueParts ) {
  4653. initialInUnit = +initialInUnit || +initial || 0;
  4654.  
  4655. // Apply relative offset (+=/-=) if specified
  4656. adjusted = valueParts[ 1 ] ?
  4657. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  4658. +valueParts[ 2 ];
  4659. if ( tween ) {
  4660. tween.unit = unit;
  4661. tween.start = initialInUnit;
  4662. tween.end = adjusted;
  4663. }
  4664. }
  4665. return adjusted;
  4666. }
  4667.  
  4668.  
  4669. var defaultDisplayMap = {};
  4670.  
  4671. function getDefaultDisplay( elem ) {
  4672. var temp,
  4673. doc = elem.ownerDocument,
  4674. nodeName = elem.nodeName,
  4675. display = defaultDisplayMap[ nodeName ];
  4676.  
  4677. if ( display ) {
  4678. return display;
  4679. }
  4680.  
  4681. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  4682. display = jQuery.css( temp, "display" );
  4683.  
  4684. temp.parentNode.removeChild( temp );
  4685.  
  4686. if ( display === "none" ) {
  4687. display = "block";
  4688. }
  4689. defaultDisplayMap[ nodeName ] = display;
  4690.  
  4691. return display;
  4692. }
  4693.  
  4694. function showHide( elements, show ) {
  4695. var display, elem,
  4696. values = [],
  4697. index = 0,
  4698. length = elements.length;
  4699.  
  4700. // Determine new display value for elements that need to change
  4701. for ( ; index < length; index++ ) {
  4702. elem = elements[ index ];
  4703. if ( !elem.style ) {
  4704. continue;
  4705. }
  4706.  
  4707. display = elem.style.display;
  4708. if ( show ) {
  4709.  
  4710. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  4711. // check is required in this first loop unless we have a nonempty display value (either
  4712. // inline or about-to-be-restored)
  4713. if ( display === "none" ) {
  4714. values[ index ] = dataPriv.get( elem, "display" ) || null;
  4715. if ( !values[ index ] ) {
  4716. elem.style.display = "";
  4717. }
  4718. }
  4719. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  4720. values[ index ] = getDefaultDisplay( elem );
  4721. }
  4722. } else {
  4723. if ( display !== "none" ) {
  4724. values[ index ] = "none";
  4725.  
  4726. // Remember what we're overwriting
  4727. dataPriv.set( elem, "display", display );
  4728. }
  4729. }
  4730. }
  4731.  
  4732. // Set the display of the elements in a second loop to avoid constant reflow
  4733. for ( index = 0; index < length; index++ ) {
  4734. if ( values[ index ] != null ) {
  4735. elements[ index ].style.display = values[ index ];
  4736. }
  4737. }
  4738.  
  4739. return elements;
  4740. }
  4741.  
  4742. jQuery.fn.extend( {
  4743. show: function() {
  4744. return showHide( this, true );
  4745. },
  4746. hide: function() {
  4747. return showHide( this );
  4748. },
  4749. toggle: function( state ) {
  4750. if ( typeof state === "boolean" ) {
  4751. return state ? this.show() : this.hide();
  4752. }
  4753.  
  4754. return this.each( function() {
  4755. if ( isHiddenWithinTree( this ) ) {
  4756. jQuery( this ).show();
  4757. } else {
  4758. jQuery( this ).hide();
  4759. }
  4760. } );
  4761. }
  4762. } );
  4763. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  4764.  
  4765. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  4766.  
  4767. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  4768.  
  4769.  
  4770.  
  4771. ( function() {
  4772. var fragment = document.createDocumentFragment(),
  4773. div = fragment.appendChild( document.createElement( "div" ) ),
  4774. input = document.createElement( "input" );
  4775.  
  4776. // Support: Android 4.0 - 4.3 only
  4777. // Check state lost if the name is set (trac-11217)
  4778. // Support: Windows Web Apps (WWA)
  4779. // `name` and `type` must use .setAttribute for WWA (trac-14901)
  4780. input.setAttribute( "type", "radio" );
  4781. input.setAttribute( "checked", "checked" );
  4782. input.setAttribute( "name", "t" );
  4783.  
  4784. div.appendChild( input );
  4785.  
  4786. // Support: Android <=4.1 only
  4787. // Older WebKit doesn't clone checked state correctly in fragments
  4788. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  4789.  
  4790. // Support: IE <=11 only
  4791. // Make sure textarea (and checkbox) defaultValue is properly cloned
  4792. div.innerHTML = "<textarea>x</textarea>";
  4793. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  4794.  
  4795. // Support: IE <=9 only
  4796. // IE <=9 replaces <option> tags with their contents when inserted outside of
  4797. // the select element.
  4798. div.innerHTML = "<option></option>";
  4799. support.option = !!div.lastChild;
  4800. } )();
  4801.  
  4802.  
  4803. // We have to close these tags to support XHTML (trac-13200)
  4804. var wrapMap = {
  4805.  
  4806. // XHTML parsers do not magically insert elements in the
  4807. // same way that tag soup parsers do. So we cannot shorten
  4808. // this by omitting <tbody> or other required elements.
  4809. thead: [ 1, "<table>", "</table>" ],
  4810. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  4811. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4812. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4813.  
  4814. _default: [ 0, "", "" ]
  4815. };
  4816.  
  4817. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4818. wrapMap.th = wrapMap.td;
  4819.  
  4820. // Support: IE <=9 only
  4821. if ( !support.option ) {
  4822. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  4823. }
  4824.  
  4825.  
  4826. function getAll( context, tag ) {
  4827.  
  4828. // Support: IE <=9 - 11 only
  4829. // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
  4830. var ret;
  4831.  
  4832. if ( typeof context.getElementsByTagName !== "undefined" ) {
  4833. ret = context.getElementsByTagName( tag || "*" );
  4834.  
  4835. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  4836. ret = context.querySelectorAll( tag || "*" );
  4837.  
  4838. } else {
  4839. ret = [];
  4840. }
  4841.  
  4842. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  4843. return jQuery.merge( [ context ], ret );
  4844. }
  4845.  
  4846. return ret;
  4847. }
  4848.  
  4849.  
  4850. // Mark scripts as having already been evaluated
  4851. function setGlobalEval( elems, refElements ) {
  4852. var i = 0,
  4853. l = elems.length;
  4854.  
  4855. for ( ; i < l; i++ ) {
  4856. dataPriv.set(
  4857. elems[ i ],
  4858. "globalEval",
  4859. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  4860. );
  4861. }
  4862. }
  4863.  
  4864.  
  4865. var rhtml = /<|&#?\w+;/;
  4866.  
  4867. function buildFragment( elems, context, scripts, selection, ignored ) {
  4868. var elem, tmp, tag, wrap, attached, j,
  4869. fragment = context.createDocumentFragment(),
  4870. nodes = [],
  4871. i = 0,
  4872. l = elems.length;
  4873.  
  4874. for ( ; i < l; i++ ) {
  4875. elem = elems[ i ];
  4876.  
  4877. if ( elem || elem === 0 ) {
  4878.  
  4879. // Add nodes directly
  4880. if ( toType( elem ) === "object" ) {
  4881.  
  4882. // Support: Android <=4.0 only, PhantomJS 1 only
  4883. // push.apply(_, arraylike) throws on ancient WebKit
  4884. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4885.  
  4886. // Convert non-html into a text node
  4887. } else if ( !rhtml.test( elem ) ) {
  4888. nodes.push( context.createTextNode( elem ) );
  4889.  
  4890. // Convert html into DOM nodes
  4891. } else {
  4892. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  4893.  
  4894. // Deserialize a standard representation
  4895. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4896. wrap = wrapMap[ tag ] || wrapMap._default;
  4897. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  4898.  
  4899. // Descend through wrappers to the right content
  4900. j = wrap[ 0 ];
  4901. while ( j-- ) {
  4902. tmp = tmp.lastChild;
  4903. }
  4904.  
  4905. // Support: Android <=4.0 only, PhantomJS 1 only
  4906. // push.apply(_, arraylike) throws on ancient WebKit
  4907. jQuery.merge( nodes, tmp.childNodes );
  4908.  
  4909. // Remember the top-level container
  4910. tmp = fragment.firstChild;
  4911.  
  4912. // Ensure the created nodes are orphaned (trac-12392)
  4913. tmp.textContent = "";
  4914. }
  4915. }
  4916. }
  4917.  
  4918. // Remove wrapper from fragment
  4919. fragment.textContent = "";
  4920.  
  4921. i = 0;
  4922. while ( ( elem = nodes[ i++ ] ) ) {
  4923.  
  4924. // Skip elements already in the context collection (trac-4087)
  4925. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  4926. if ( ignored ) {
  4927. ignored.push( elem );
  4928. }
  4929. continue;
  4930. }
  4931.  
  4932. attached = isAttached( elem );
  4933.  
  4934. // Append to fragment
  4935. tmp = getAll( fragment.appendChild( elem ), "script" );
  4936.  
  4937. // Preserve script evaluation history
  4938. if ( attached ) {
  4939. setGlobalEval( tmp );
  4940. }
  4941.  
  4942. // Capture executables
  4943. if ( scripts ) {
  4944. j = 0;
  4945. while ( ( elem = tmp[ j++ ] ) ) {
  4946. if ( rscriptType.test( elem.type || "" ) ) {
  4947. scripts.push( elem );
  4948. }
  4949. }
  4950. }
  4951. }
  4952.  
  4953. return fragment;
  4954. }
  4955.  
  4956.  
  4957. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  4958.  
  4959. function returnTrue() {
  4960. return true;
  4961. }
  4962.  
  4963. function returnFalse() {
  4964. return false;
  4965. }
  4966.  
  4967. function on( elem, types, selector, data, fn, one ) {
  4968. var origFn, type;
  4969.  
  4970. // Types can be a map of types/handlers
  4971. if ( typeof types === "object" ) {
  4972.  
  4973. // ( types-Object, selector, data )
  4974. if ( typeof selector !== "string" ) {
  4975.  
  4976. // ( types-Object, data )
  4977. data = data || selector;
  4978. selector = undefined;
  4979. }
  4980. for ( type in types ) {
  4981. on( elem, type, selector, data, types[ type ], one );
  4982. }
  4983. return elem;
  4984. }
  4985.  
  4986. if ( data == null && fn == null ) {
  4987.  
  4988. // ( types, fn )
  4989. fn = selector;
  4990. data = selector = undefined;
  4991. } else if ( fn == null ) {
  4992. if ( typeof selector === "string" ) {
  4993.  
  4994. // ( types, selector, fn )
  4995. fn = data;
  4996. data = undefined;
  4997. } else {
  4998.  
  4999. // ( types, data, fn )
  5000. fn = data;
  5001. data = selector;
  5002. selector = undefined;
  5003. }
  5004. }
  5005. if ( fn === false ) {
  5006. fn = returnFalse;
  5007. } else if ( !fn ) {
  5008. return elem;
  5009. }
  5010.  
  5011. if ( one === 1 ) {
  5012. origFn = fn;
  5013. fn = function( event ) {
  5014.  
  5015. // Can use an empty set, since event contains the info
  5016. jQuery().off( event );
  5017. return origFn.apply( this, arguments );
  5018. };
  5019.  
  5020. // Use same guid so caller can remove using origFn
  5021. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  5022. }
  5023. return elem.each( function() {
  5024. jQuery.event.add( this, types, fn, data, selector );
  5025. } );
  5026. }
  5027.  
  5028. /*
  5029. * Helper functions for managing events -- not part of the public interface.
  5030. * Props to Dean Edwards' addEvent library for many of the ideas.
  5031. */
  5032. jQuery.event = {
  5033.  
  5034. global: {},
  5035.  
  5036. add: function( elem, types, handler, data, selector ) {
  5037.  
  5038. var handleObjIn, eventHandle, tmp,
  5039. events, t, handleObj,
  5040. special, handlers, type, namespaces, origType,
  5041. elemData = dataPriv.get( elem );
  5042.  
  5043. // Only attach events to objects that accept data
  5044. if ( !acceptData( elem ) ) {
  5045. return;
  5046. }
  5047.  
  5048. // Caller can pass in an object of custom data in lieu of the handler
  5049. if ( handler.handler ) {
  5050. handleObjIn = handler;
  5051. handler = handleObjIn.handler;
  5052. selector = handleObjIn.selector;
  5053. }
  5054.  
  5055. // Ensure that invalid selectors throw exceptions at attach time
  5056. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  5057. if ( selector ) {
  5058. jQuery.find.matchesSelector( documentElement, selector );
  5059. }
  5060.  
  5061. // Make sure that the handler has a unique ID, used to find/remove it later
  5062. if ( !handler.guid ) {
  5063. handler.guid = jQuery.guid++;
  5064. }
  5065.  
  5066. // Init the element's event structure and main handler, if this is the first
  5067. if ( !( events = elemData.events ) ) {
  5068. events = elemData.events = Object.create( null );
  5069. }
  5070. if ( !( eventHandle = elemData.handle ) ) {
  5071. eventHandle = elemData.handle = function( e ) {
  5072.  
  5073. // Discard the second event of a jQuery.event.trigger() and
  5074. // when an event is called after a page has unloaded
  5075. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  5076. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  5077. };
  5078. }
  5079.  
  5080. // Handle multiple events separated by a space
  5081. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  5082. t = types.length;
  5083. while ( t-- ) {
  5084. tmp = rtypenamespace.exec( types[ t ] ) || [];
  5085. type = origType = tmp[ 1 ];
  5086. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  5087.  
  5088. // There *must* be a type, no attaching namespace-only handlers
  5089. if ( !type ) {
  5090. continue;
  5091. }
  5092.  
  5093. // If event changes its type, use the special event handlers for the changed type
  5094. special = jQuery.event.special[ type ] || {};
  5095.  
  5096. // If selector defined, determine special event api type, otherwise given type
  5097. type = ( selector ? special.delegateType : special.bindType ) || type;
  5098.  
  5099. // Update special based on newly reset type
  5100. special = jQuery.event.special[ type ] || {};
  5101.  
  5102. // handleObj is passed to all event handlers
  5103. handleObj = jQuery.extend( {
  5104. type: type,
  5105. origType: origType,
  5106. data: data,
  5107. handler: handler,
  5108. guid: handler.guid,
  5109. selector: selector,
  5110. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  5111. namespace: namespaces.join( "." )
  5112. }, handleObjIn );
  5113.  
  5114. // Init the event handler queue if we're the first
  5115. if ( !( handlers = events[ type ] ) ) {
  5116. handlers = events[ type ] = [];
  5117. handlers.delegateCount = 0;
  5118.  
  5119. // Only use addEventListener if the special events handler returns false
  5120. if ( !special.setup ||
  5121. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  5122.  
  5123. if ( elem.addEventListener ) {
  5124. elem.addEventListener( type, eventHandle );
  5125. }
  5126. }
  5127. }
  5128.  
  5129. if ( special.add ) {
  5130. special.add.call( elem, handleObj );
  5131.  
  5132. if ( !handleObj.handler.guid ) {
  5133. handleObj.handler.guid = handler.guid;
  5134. }
  5135. }
  5136.  
  5137. // Add to the element's handler list, delegates in front
  5138. if ( selector ) {
  5139. handlers.splice( handlers.delegateCount++, 0, handleObj );
  5140. } else {
  5141. handlers.push( handleObj );
  5142. }
  5143.  
  5144. // Keep track of which events have ever been used, for event optimization
  5145. jQuery.event.global[ type ] = true;
  5146. }
  5147.  
  5148. },
  5149.  
  5150. // Detach an event or set of events from an element
  5151. remove: function( elem, types, handler, selector, mappedTypes ) {
  5152.  
  5153. var j, origCount, tmp,
  5154. events, t, handleObj,
  5155. special, handlers, type, namespaces, origType,
  5156. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  5157.  
  5158. if ( !elemData || !( events = elemData.events ) ) {
  5159. return;
  5160. }
  5161.  
  5162. // Once for each type.namespace in types; type may be omitted
  5163. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  5164. t = types.length;
  5165. while ( t-- ) {
  5166. tmp = rtypenamespace.exec( types[ t ] ) || [];
  5167. type = origType = tmp[ 1 ];
  5168. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  5169.  
  5170. // Unbind all events (on this namespace, if provided) for the element
  5171. if ( !type ) {
  5172. for ( type in events ) {
  5173. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  5174. }
  5175. continue;
  5176. }
  5177.  
  5178. special = jQuery.event.special[ type ] || {};
  5179. type = ( selector ? special.delegateType : special.bindType ) || type;
  5180. handlers = events[ type ] || [];
  5181. tmp = tmp[ 2 ] &&
  5182. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  5183.  
  5184. // Remove matching events
  5185. origCount = j = handlers.length;
  5186. while ( j-- ) {
  5187. handleObj = handlers[ j ];
  5188.  
  5189. if ( ( mappedTypes || origType === handleObj.origType ) &&
  5190. ( !handler || handler.guid === handleObj.guid ) &&
  5191. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  5192. ( !selector || selector === handleObj.selector ||
  5193. selector === "**" && handleObj.selector ) ) {
  5194. handlers.splice( j, 1 );
  5195.  
  5196. if ( handleObj.selector ) {
  5197. handlers.delegateCount--;
  5198. }
  5199. if ( special.remove ) {
  5200. special.remove.call( elem, handleObj );
  5201. }
  5202. }
  5203. }
  5204.  
  5205. // Remove generic event handler if we removed something and no more handlers exist
  5206. // (avoids potential for endless recursion during removal of special event handlers)
  5207. if ( origCount && !handlers.length ) {
  5208. if ( !special.teardown ||
  5209. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  5210.  
  5211. jQuery.removeEvent( elem, type, elemData.handle );
  5212. }
  5213.  
  5214. delete events[ type ];
  5215. }
  5216. }
  5217.  
  5218. // Remove data and the expando if it's no longer used
  5219. if ( jQuery.isEmptyObject( events ) ) {
  5220. dataPriv.remove( elem, "handle events" );
  5221. }
  5222. },
  5223.  
  5224. dispatch: function( nativeEvent ) {
  5225.  
  5226. var i, j, ret, matched, handleObj, handlerQueue,
  5227. args = new Array( arguments.length ),
  5228.  
  5229. // Make a writable jQuery.Event from the native event object
  5230. event = jQuery.event.fix( nativeEvent ),
  5231.  
  5232. handlers = (
  5233. dataPriv.get( this, "events" ) || Object.create( null )
  5234. )[ event.type ] || [],
  5235. special = jQuery.event.special[ event.type ] || {};
  5236.  
  5237. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  5238. args[ 0 ] = event;
  5239.  
  5240. for ( i = 1; i < arguments.length; i++ ) {
  5241. args[ i ] = arguments[ i ];
  5242. }
  5243.  
  5244. event.delegateTarget = this;
  5245.  
  5246. // Call the preDispatch hook for the mapped type, and let it bail if desired
  5247. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  5248. return;
  5249. }
  5250.  
  5251. // Determine handlers
  5252. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  5253.  
  5254. // Run delegates first; they may want to stop propagation beneath us
  5255. i = 0;
  5256. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  5257. event.currentTarget = matched.elem;
  5258.  
  5259. j = 0;
  5260. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  5261. !event.isImmediatePropagationStopped() ) {
  5262.  
  5263. // If the event is namespaced, then each handler is only invoked if it is
  5264. // specially universal or its namespaces are a superset of the event's.
  5265. if ( !event.rnamespace || handleObj.namespace === false ||
  5266. event.rnamespace.test( handleObj.namespace ) ) {
  5267.  
  5268. event.handleObj = handleObj;
  5269. event.data = handleObj.data;
  5270.  
  5271. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  5272. handleObj.handler ).apply( matched.elem, args );
  5273.  
  5274. if ( ret !== undefined ) {
  5275. if ( ( event.result = ret ) === false ) {
  5276. event.preventDefault();
  5277. event.stopPropagation();
  5278. }
  5279. }
  5280. }
  5281. }
  5282. }
  5283.  
  5284. // Call the postDispatch hook for the mapped type
  5285. if ( special.postDispatch ) {
  5286. special.postDispatch.call( this, event );
  5287. }
  5288.  
  5289. return event.result;
  5290. },
  5291.  
  5292. handlers: function( event, handlers ) {
  5293. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  5294. handlerQueue = [],
  5295. delegateCount = handlers.delegateCount,
  5296. cur = event.target;
  5297.  
  5298. // Find delegate handlers
  5299. if ( delegateCount &&
  5300.  
  5301. // Support: IE <=9
  5302. // Black-hole SVG <use> instance trees (trac-13180)
  5303. cur.nodeType &&
  5304.  
  5305. // Support: Firefox <=42
  5306. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  5307. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  5308. // Support: IE 11 only
  5309. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  5310. !( event.type === "click" && event.button >= 1 ) ) {
  5311.  
  5312. for ( ; cur !== this; cur = cur.parentNode || this ) {
  5313.  
  5314. // Don't check non-elements (trac-13208)
  5315. // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
  5316. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  5317. matchedHandlers = [];
  5318. matchedSelectors = {};
  5319. for ( i = 0; i < delegateCount; i++ ) {
  5320. handleObj = handlers[ i ];
  5321.  
  5322. // Don't conflict with Object.prototype properties (trac-13203)
  5323. sel = handleObj.selector + " ";
  5324.  
  5325. if ( matchedSelectors[ sel ] === undefined ) {
  5326. matchedSelectors[ sel ] = handleObj.needsContext ?
  5327. jQuery( sel, this ).index( cur ) > -1 :
  5328. jQuery.find( sel, this, null, [ cur ] ).length;
  5329. }
  5330. if ( matchedSelectors[ sel ] ) {
  5331. matchedHandlers.push( handleObj );
  5332. }
  5333. }
  5334. if ( matchedHandlers.length ) {
  5335. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  5336. }
  5337. }
  5338. }
  5339. }
  5340.  
  5341. // Add the remaining (directly-bound) handlers
  5342. cur = this;
  5343. if ( delegateCount < handlers.length ) {
  5344. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  5345. }
  5346.  
  5347. return handlerQueue;
  5348. },
  5349.  
  5350. addProp: function( name, hook ) {
  5351. Object.defineProperty( jQuery.Event.prototype, name, {
  5352. enumerable: true,
  5353. configurable: true,
  5354.  
  5355. get: isFunction( hook ) ?
  5356. function() {
  5357. if ( this.originalEvent ) {
  5358. return hook( this.originalEvent );
  5359. }
  5360. } :
  5361. function() {
  5362. if ( this.originalEvent ) {
  5363. return this.originalEvent[ name ];
  5364. }
  5365. },
  5366.  
  5367. set: function( value ) {
  5368. Object.defineProperty( this, name, {
  5369. enumerable: true,
  5370. configurable: true,
  5371. writable: true,
  5372. value: value
  5373. } );
  5374. }
  5375. } );
  5376. },
  5377.  
  5378. fix: function( originalEvent ) {
  5379. return originalEvent[ jQuery.expando ] ?
  5380. originalEvent :
  5381. new jQuery.Event( originalEvent );
  5382. },
  5383.  
  5384. special: {
  5385. load: {
  5386.  
  5387. // Prevent triggered image.load events from bubbling to window.load
  5388. noBubble: true
  5389. },
  5390. click: {
  5391.  
  5392. // Utilize native event to ensure correct state for checkable inputs
  5393. setup: function( data ) {
  5394.  
  5395. // For mutual compressibility with _default, replace `this` access with a local var.
  5396. // `|| data` is dead code meant only to preserve the variable through minification.
  5397. var el = this || data;
  5398.  
  5399. // Claim the first handler
  5400. if ( rcheckableType.test( el.type ) &&
  5401. el.click && nodeName( el, "input" ) ) {
  5402.  
  5403. // dataPriv.set( el, "click", ... )
  5404. leverageNative( el, "click", true );
  5405. }
  5406.  
  5407. // Return false to allow normal processing in the caller
  5408. return false;
  5409. },
  5410. trigger: function( data ) {
  5411.  
  5412. // For mutual compressibility with _default, replace `this` access with a local var.
  5413. // `|| data` is dead code meant only to preserve the variable through minification.
  5414. var el = this || data;
  5415.  
  5416. // Force setup before triggering a click
  5417. if ( rcheckableType.test( el.type ) &&
  5418. el.click && nodeName( el, "input" ) ) {
  5419.  
  5420. leverageNative( el, "click" );
  5421. }
  5422.  
  5423. // Return non-false to allow normal event-path propagation
  5424. return true;
  5425. },
  5426.  
  5427. // For cross-browser consistency, suppress native .click() on links
  5428. // Also prevent it if we're currently inside a leveraged native-event stack
  5429. _default: function( event ) {
  5430. var target = event.target;
  5431. return rcheckableType.test( target.type ) &&
  5432. target.click && nodeName( target, "input" ) &&
  5433. dataPriv.get( target, "click" ) ||
  5434. nodeName( target, "a" );
  5435. }
  5436. },
  5437.  
  5438. beforeunload: {
  5439. postDispatch: function( event ) {
  5440.  
  5441. // Support: Firefox 20+
  5442. // Firefox doesn't alert if the returnValue field is not set.
  5443. if ( event.result !== undefined && event.originalEvent ) {
  5444. event.originalEvent.returnValue = event.result;
  5445. }
  5446. }
  5447. }
  5448. }
  5449. };
  5450.  
  5451. // Ensure the presence of an event listener that handles manually-triggered
  5452. // synthetic events by interrupting progress until reinvoked in response to
  5453. // *native* events that it fires directly, ensuring that state changes have
  5454. // already occurred before other listeners are invoked.
  5455. function leverageNative( el, type, isSetup ) {
  5456.  
  5457. // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add
  5458. if ( !isSetup ) {
  5459. if ( dataPriv.get( el, type ) === undefined ) {
  5460. jQuery.event.add( el, type, returnTrue );
  5461. }
  5462. return;
  5463. }
  5464.  
  5465. // Register the controller as a special universal handler for all event namespaces
  5466. dataPriv.set( el, type, false );
  5467. jQuery.event.add( el, type, {
  5468. namespace: false,
  5469. handler: function( event ) {
  5470. var result,
  5471. saved = dataPriv.get( this, type );
  5472.  
  5473. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  5474.  
  5475. // Interrupt processing of the outer synthetic .trigger()ed event
  5476. if ( !saved ) {
  5477.  
  5478. // Store arguments for use when handling the inner native event
  5479. // There will always be at least one argument (an event object), so this array
  5480. // will not be confused with a leftover capture object.
  5481. saved = slice.call( arguments );
  5482. dataPriv.set( this, type, saved );
  5483.  
  5484. // Trigger the native event and capture its result
  5485. this[ type ]();
  5486. result = dataPriv.get( this, type );
  5487. dataPriv.set( this, type, false );
  5488.  
  5489. if ( saved !== result ) {
  5490.  
  5491. // Cancel the outer synthetic event
  5492. event.stopImmediatePropagation();
  5493. event.preventDefault();
  5494.  
  5495. return result;
  5496. }
  5497.  
  5498. // If this is an inner synthetic event for an event with a bubbling surrogate
  5499. // (focus or blur), assume that the surrogate already propagated from triggering
  5500. // the native event and prevent that from happening again here.
  5501. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  5502. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  5503. // less bad than duplication.
  5504. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  5505. event.stopPropagation();
  5506. }
  5507.  
  5508. // If this is a native event triggered above, everything is now in order
  5509. // Fire an inner synthetic event with the original arguments
  5510. } else if ( saved ) {
  5511.  
  5512. // ...and capture the result
  5513. dataPriv.set( this, type, jQuery.event.trigger(
  5514. saved[ 0 ],
  5515. saved.slice( 1 ),
  5516. this
  5517. ) );
  5518.  
  5519. // Abort handling of the native event by all jQuery handlers while allowing
  5520. // native handlers on the same element to run. On target, this is achieved
  5521. // by stopping immediate propagation just on the jQuery event. However,
  5522. // the native event is re-wrapped by a jQuery one on each level of the
  5523. // propagation so the only way to stop it for jQuery is to stop it for
  5524. // everyone via native `stopPropagation()`. This is not a problem for
  5525. // focus/blur which don't bubble, but it does also stop click on checkboxes
  5526. // and radios. We accept this limitation.
  5527. event.stopPropagation();
  5528. event.isImmediatePropagationStopped = returnTrue;
  5529. }
  5530. }
  5531. } );
  5532. }
  5533.  
  5534. jQuery.removeEvent = function( elem, type, handle ) {
  5535.  
  5536. // This "if" is needed for plain objects
  5537. if ( elem.removeEventListener ) {
  5538. elem.removeEventListener( type, handle );
  5539. }
  5540. };
  5541.  
  5542. jQuery.Event = function( src, props ) {
  5543.  
  5544. // Allow instantiation without the 'new' keyword
  5545. if ( !( this instanceof jQuery.Event ) ) {
  5546. return new jQuery.Event( src, props );
  5547. }
  5548.  
  5549. // Event object
  5550. if ( src && src.type ) {
  5551. this.originalEvent = src;
  5552. this.type = src.type;
  5553.  
  5554. // Events bubbling up the document may have been marked as prevented
  5555. // by a handler lower down the tree; reflect the correct value.
  5556. this.isDefaultPrevented = src.defaultPrevented ||
  5557. src.defaultPrevented === undefined &&
  5558.  
  5559. // Support: Android <=2.3 only
  5560. src.returnValue === false ?
  5561. returnTrue :
  5562. returnFalse;
  5563.  
  5564. // Create target properties
  5565. // Support: Safari <=6 - 7 only
  5566. // Target should not be a text node (trac-504, trac-13143)
  5567. this.target = ( src.target && src.target.nodeType === 3 ) ?
  5568. src.target.parentNode :
  5569. src.target;
  5570.  
  5571. this.currentTarget = src.currentTarget;
  5572. this.relatedTarget = src.relatedTarget;
  5573.  
  5574. // Event type
  5575. } else {
  5576. this.type = src;
  5577. }
  5578.  
  5579. // Put explicitly provided properties onto the event object
  5580. if ( props ) {
  5581. jQuery.extend( this, props );
  5582. }
  5583.  
  5584. // Create a timestamp if incoming event doesn't have one
  5585. this.timeStamp = src && src.timeStamp || Date.now();
  5586.  
  5587. // Mark it as fixed
  5588. this[ jQuery.expando ] = true;
  5589. };
  5590.  
  5591. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  5592. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  5593. jQuery.Event.prototype = {
  5594. constructor: jQuery.Event,
  5595. isDefaultPrevented: returnFalse,
  5596. isPropagationStopped: returnFalse,
  5597. isImmediatePropagationStopped: returnFalse,
  5598. isSimulated: false,
  5599.  
  5600. preventDefault: function() {
  5601. var e = this.originalEvent;
  5602.  
  5603. this.isDefaultPrevented = returnTrue;
  5604.  
  5605. if ( e && !this.isSimulated ) {
  5606. e.preventDefault();
  5607. }
  5608. },
  5609. stopPropagation: function() {
  5610. var e = this.originalEvent;
  5611.  
  5612. this.isPropagationStopped = returnTrue;
  5613.  
  5614. if ( e && !this.isSimulated ) {
  5615. e.stopPropagation();
  5616. }
  5617. },
  5618. stopImmediatePropagation: function() {
  5619. var e = this.originalEvent;
  5620.  
  5621. this.isImmediatePropagationStopped = returnTrue;
  5622.  
  5623. if ( e && !this.isSimulated ) {
  5624. e.stopImmediatePropagation();
  5625. }
  5626.  
  5627. this.stopPropagation();
  5628. }
  5629. };
  5630.  
  5631. // Includes all common event props including KeyEvent and MouseEvent specific props
  5632. jQuery.each( {
  5633. altKey: true,
  5634. bubbles: true,
  5635. cancelable: true,
  5636. changedTouches: true,
  5637. ctrlKey: true,
  5638. detail: true,
  5639. eventPhase: true,
  5640. metaKey: true,
  5641. pageX: true,
  5642. pageY: true,
  5643. shiftKey: true,
  5644. view: true,
  5645. "char": true,
  5646. code: true,
  5647. charCode: true,
  5648. key: true,
  5649. keyCode: true,
  5650. button: true,
  5651. buttons: true,
  5652. clientX: true,
  5653. clientY: true,
  5654. offsetX: true,
  5655. offsetY: true,
  5656. pointerId: true,
  5657. pointerType: true,
  5658. screenX: true,
  5659. screenY: true,
  5660. targetTouches: true,
  5661. toElement: true,
  5662. touches: true,
  5663. which: true
  5664. }, jQuery.event.addProp );
  5665.  
  5666. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  5667.  
  5668. function focusMappedHandler( nativeEvent ) {
  5669. if ( document.documentMode ) {
  5670.  
  5671. // Support: IE 11+
  5672. // Attach a single focusin/focusout handler on the document while someone wants
  5673. // focus/blur. This is because the former are synchronous in IE while the latter
  5674. // are async. In other browsers, all those handlers are invoked synchronously.
  5675.  
  5676. // `handle` from private data would already wrap the event, but we need
  5677. // to change the `type` here.
  5678. var handle = dataPriv.get( this, "handle" ),
  5679. event = jQuery.event.fix( nativeEvent );
  5680. event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
  5681. event.isSimulated = true;
  5682.  
  5683. // First, handle focusin/focusout
  5684. handle( nativeEvent );
  5685.  
  5686. // ...then, handle focus/blur
  5687. //
  5688. // focus/blur don't bubble while focusin/focusout do; simulate the former by only
  5689. // invoking the handler at the lower level.
  5690. if ( event.target === event.currentTarget ) {
  5691.  
  5692. // The setup part calls `leverageNative`, which, in turn, calls
  5693. // `jQuery.event.add`, so event handle will already have been set
  5694. // by this point.
  5695. handle( event );
  5696. }
  5697. } else {
  5698.  
  5699. // For non-IE browsers, attach a single capturing handler on the document
  5700. // while someone wants focusin/focusout.
  5701. jQuery.event.simulate( delegateType, nativeEvent.target,
  5702. jQuery.event.fix( nativeEvent ) );
  5703. }
  5704. }
  5705.  
  5706. jQuery.event.special[ type ] = {
  5707.  
  5708. // Utilize native event if possible so blur/focus sequence is correct
  5709. setup: function() {
  5710.  
  5711. var attaches;
  5712.  
  5713. // Claim the first handler
  5714. // dataPriv.set( this, "focus", ... )
  5715. // dataPriv.set( this, "blur", ... )
  5716. leverageNative( this, type, true );
  5717.  
  5718. if ( document.documentMode ) {
  5719.  
  5720. // Support: IE 9 - 11+
  5721. // We use the same native handler for focusin & focus (and focusout & blur)
  5722. // so we need to coordinate setup & teardown parts between those events.
  5723. // Use `delegateType` as the key as `type` is already used by `leverageNative`.
  5724. attaches = dataPriv.get( this, delegateType );
  5725. if ( !attaches ) {
  5726. this.addEventListener( delegateType, focusMappedHandler );
  5727. }
  5728. dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );
  5729. } else {
  5730.  
  5731. // Return false to allow normal processing in the caller
  5732. return false;
  5733. }
  5734. },
  5735. trigger: function() {
  5736.  
  5737. // Force setup before trigger
  5738. leverageNative( this, type );
  5739.  
  5740. // Return non-false to allow normal event-path propagation
  5741. return true;
  5742. },
  5743.  
  5744. teardown: function() {
  5745. var attaches;
  5746.  
  5747. if ( document.documentMode ) {
  5748. attaches = dataPriv.get( this, delegateType ) - 1;
  5749. if ( !attaches ) {
  5750. this.removeEventListener( delegateType, focusMappedHandler );
  5751. dataPriv.remove( this, delegateType );
  5752. } else {
  5753. dataPriv.set( this, delegateType, attaches );
  5754. }
  5755. } else {
  5756.  
  5757. // Return false to indicate standard teardown should be applied
  5758. return false;
  5759. }
  5760. },
  5761.  
  5762. // Suppress native focus or blur if we're currently inside
  5763. // a leveraged native-event stack
  5764. _default: function( event ) {
  5765. return dataPriv.get( event.target, type );
  5766. },
  5767.  
  5768. delegateType: delegateType
  5769. };
  5770.  
  5771. // Support: Firefox <=44
  5772. // Firefox doesn't have focus(in | out) events
  5773. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  5774. //
  5775. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  5776. // focus(in | out) events fire after focus & blur events,
  5777. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  5778. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  5779. //
  5780. // Support: IE 9 - 11+
  5781. // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,
  5782. // attach a single handler for both events in IE.
  5783. jQuery.event.special[ delegateType ] = {
  5784. setup: function() {
  5785.  
  5786. // Handle: regular nodes (via `this.ownerDocument`), window
  5787. // (via `this.document`) & document (via `this`).
  5788. var doc = this.ownerDocument || this.document || this,
  5789. dataHolder = document.documentMode ? this : doc,
  5790. attaches = dataPriv.get( dataHolder, delegateType );
  5791.  
  5792. // Support: IE 9 - 11+
  5793. // We use the same native handler for focusin & focus (and focusout & blur)
  5794. // so we need to coordinate setup & teardown parts between those events.
  5795. // Use `delegateType` as the key as `type` is already used by `leverageNative`.
  5796. if ( !attaches ) {
  5797. if ( document.documentMode ) {
  5798. this.addEventListener( delegateType, focusMappedHandler );
  5799. } else {
  5800. doc.addEventListener( type, focusMappedHandler, true );
  5801. }
  5802. }
  5803. dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );
  5804. },
  5805. teardown: function() {
  5806. var doc = this.ownerDocument || this.document || this,
  5807. dataHolder = document.documentMode ? this : doc,
  5808. attaches = dataPriv.get( dataHolder, delegateType ) - 1;
  5809.  
  5810. if ( !attaches ) {
  5811. if ( document.documentMode ) {
  5812. this.removeEventListener( delegateType, focusMappedHandler );
  5813. } else {
  5814. doc.removeEventListener( type, focusMappedHandler, true );
  5815. }
  5816. dataPriv.remove( dataHolder, delegateType );
  5817. } else {
  5818. dataPriv.set( dataHolder, delegateType, attaches );
  5819. }
  5820. }
  5821. };
  5822. } );
  5823.  
  5824. // Create mouseenter/leave events using mouseover/out and event-time checks
  5825. // so that event delegation works in jQuery.
  5826. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  5827. //
  5828. // Support: Safari 7 only
  5829. // Safari sends mouseenter too often; see:
  5830. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  5831. // for the description of the bug (it existed in older Chrome versions as well).
  5832. jQuery.each( {
  5833. mouseenter: "mouseover",
  5834. mouseleave: "mouseout",
  5835. pointerenter: "pointerover",
  5836. pointerleave: "pointerout"
  5837. }, function( orig, fix ) {
  5838. jQuery.event.special[ orig ] = {
  5839. delegateType: fix,
  5840. bindType: fix,
  5841.  
  5842. handle: function( event ) {
  5843. var ret,
  5844. target = this,
  5845. related = event.relatedTarget,
  5846. handleObj = event.handleObj;
  5847.  
  5848. // For mouseenter/leave call the handler if related is outside the target.
  5849. // NB: No relatedTarget if the mouse left/entered the browser window
  5850. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  5851. event.type = handleObj.origType;
  5852. ret = handleObj.handler.apply( this, arguments );
  5853. event.type = fix;
  5854. }
  5855. return ret;
  5856. }
  5857. };
  5858. } );
  5859.  
  5860. jQuery.fn.extend( {
  5861.  
  5862. on: function( types, selector, data, fn ) {
  5863. return on( this, types, selector, data, fn );
  5864. },
  5865. one: function( types, selector, data, fn ) {
  5866. return on( this, types, selector, data, fn, 1 );
  5867. },
  5868. off: function( types, selector, fn ) {
  5869. var handleObj, type;
  5870. if ( types && types.preventDefault && types.handleObj ) {
  5871.  
  5872. // ( event ) dispatched jQuery.Event
  5873. handleObj = types.handleObj;
  5874. jQuery( types.delegateTarget ).off(
  5875. handleObj.namespace ?
  5876. handleObj.origType + "." + handleObj.namespace :
  5877. handleObj.origType,
  5878. handleObj.selector,
  5879. handleObj.handler
  5880. );
  5881. return this;
  5882. }
  5883. if ( typeof types === "object" ) {
  5884.  
  5885. // ( types-object [, selector] )
  5886. for ( type in types ) {
  5887. this.off( type, selector, types[ type ] );
  5888. }
  5889. return this;
  5890. }
  5891. if ( selector === false || typeof selector === "function" ) {
  5892.  
  5893. // ( types [, fn] )
  5894. fn = selector;
  5895. selector = undefined;
  5896. }
  5897. if ( fn === false ) {
  5898. fn = returnFalse;
  5899. }
  5900. return this.each( function() {
  5901. jQuery.event.remove( this, types, fn, selector );
  5902. } );
  5903. }
  5904. } );
  5905.  
  5906.  
  5907. var
  5908.  
  5909. // Support: IE <=10 - 11, Edge 12 - 13 only
  5910. // In IE/Edge using regex groups here causes severe slowdowns.
  5911. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  5912. rnoInnerhtml = /<script|<style|<link/i,
  5913.  
  5914. // checked="checked" or checked
  5915. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  5916.  
  5917. rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  5918.  
  5919. // Prefer a tbody over its parent table for containing new rows
  5920. function manipulationTarget( elem, content ) {
  5921. if ( nodeName( elem, "table" ) &&
  5922. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  5923.  
  5924. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  5925. }
  5926.  
  5927. return elem;
  5928. }
  5929.  
  5930. // Replace/restore the type attribute of script elements for safe DOM manipulation
  5931. function disableScript( elem ) {
  5932. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  5933. return elem;
  5934. }
  5935. function restoreScript( elem ) {
  5936. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  5937. elem.type = elem.type.slice( 5 );
  5938. } else {
  5939. elem.removeAttribute( "type" );
  5940. }
  5941.  
  5942. return elem;
  5943. }
  5944.  
  5945. function cloneCopyEvent( src, dest ) {
  5946. var i, l, type, pdataOld, udataOld, udataCur, events;
  5947.  
  5948. if ( dest.nodeType !== 1 ) {
  5949. return;
  5950. }
  5951.  
  5952. // 1. Copy private data: events, handlers, etc.
  5953. if ( dataPriv.hasData( src ) ) {
  5954. pdataOld = dataPriv.get( src );
  5955. events = pdataOld.events;
  5956.  
  5957. if ( events ) {
  5958. dataPriv.remove( dest, "handle events" );
  5959.  
  5960. for ( type in events ) {
  5961. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  5962. jQuery.event.add( dest, type, events[ type ][ i ] );
  5963. }
  5964. }
  5965. }
  5966. }
  5967.  
  5968. // 2. Copy user data
  5969. if ( dataUser.hasData( src ) ) {
  5970. udataOld = dataUser.access( src );
  5971. udataCur = jQuery.extend( {}, udataOld );
  5972.  
  5973. dataUser.set( dest, udataCur );
  5974. }
  5975. }
  5976.  
  5977. // Fix IE bugs, see support tests
  5978. function fixInput( src, dest ) {
  5979. var nodeName = dest.nodeName.toLowerCase();
  5980.  
  5981. // Fails to persist the checked state of a cloned checkbox or radio button.
  5982. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  5983. dest.checked = src.checked;
  5984.  
  5985. // Fails to return the selected option to the default selected state when cloning options
  5986. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  5987. dest.defaultValue = src.defaultValue;
  5988. }
  5989. }
  5990.  
  5991. function domManip( collection, args, callback, ignored ) {
  5992.  
  5993. // Flatten any nested arrays
  5994. args = flat( args );
  5995.  
  5996. var fragment, first, scripts, hasScripts, node, doc,
  5997. i = 0,
  5998. l = collection.length,
  5999. iNoClone = l - 1,
  6000. value = args[ 0 ],
  6001. valueIsFunction = isFunction( value );
  6002.  
  6003. // We can't cloneNode fragments that contain checked, in WebKit
  6004. if ( valueIsFunction ||
  6005. ( l > 1 && typeof value === "string" &&
  6006. !support.checkClone && rchecked.test( value ) ) ) {
  6007. return collection.each( function( index ) {
  6008. var self = collection.eq( index );
  6009. if ( valueIsFunction ) {
  6010. args[ 0 ] = value.call( this, index, self.html() );
  6011. }
  6012. domManip( self, args, callback, ignored );
  6013. } );
  6014. }
  6015.  
  6016. if ( l ) {
  6017. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  6018. first = fragment.firstChild;
  6019.  
  6020. if ( fragment.childNodes.length === 1 ) {
  6021. fragment = first;
  6022. }
  6023.  
  6024. // Require either new content or an interest in ignored elements to invoke the callback
  6025. if ( first || ignored ) {
  6026. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  6027. hasScripts = scripts.length;
  6028.  
  6029. // Use the original fragment for the last item
  6030. // instead of the first because it can end up
  6031. // being emptied incorrectly in certain situations (trac-8070).
  6032. for ( ; i < l; i++ ) {
  6033. node = fragment;
  6034.  
  6035. if ( i !== iNoClone ) {
  6036. node = jQuery.clone( node, true, true );
  6037.  
  6038. // Keep references to cloned scripts for later restoration
  6039. if ( hasScripts ) {
  6040.  
  6041. // Support: Android <=4.0 only, PhantomJS 1 only
  6042. // push.apply(_, arraylike) throws on ancient WebKit
  6043. jQuery.merge( scripts, getAll( node, "script" ) );
  6044. }
  6045. }
  6046.  
  6047. callback.call( collection[ i ], node, i );
  6048. }
  6049.  
  6050. if ( hasScripts ) {
  6051. doc = scripts[ scripts.length - 1 ].ownerDocument;
  6052.  
  6053. // Re-enable scripts
  6054. jQuery.map( scripts, restoreScript );
  6055.  
  6056. // Evaluate executable scripts on first document insertion
  6057. for ( i = 0; i < hasScripts; i++ ) {
  6058. node = scripts[ i ];
  6059. if ( rscriptType.test( node.type || "" ) &&
  6060. !dataPriv.access( node, "globalEval" ) &&
  6061. jQuery.contains( doc, node ) ) {
  6062.  
  6063. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  6064.  
  6065. // Optional AJAX dependency, but won't run scripts if not present
  6066. if ( jQuery._evalUrl && !node.noModule ) {
  6067. jQuery._evalUrl( node.src, {
  6068. nonce: node.nonce || node.getAttribute( "nonce" )
  6069. }, doc );
  6070. }
  6071. } else {
  6072.  
  6073. // Unwrap a CDATA section containing script contents. This shouldn't be
  6074. // needed as in XML documents they're already not visible when
  6075. // inspecting element contents and in HTML documents they have no
  6076. // meaning but we're preserving that logic for backwards compatibility.
  6077. // This will be removed completely in 4.0. See gh-4904.
  6078. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  6079. }
  6080. }
  6081. }
  6082. }
  6083. }
  6084. }
  6085.  
  6086. return collection;
  6087. }
  6088.  
  6089. function remove( elem, selector, keepData ) {
  6090. var node,
  6091. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  6092. i = 0;
  6093.  
  6094. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  6095. if ( !keepData && node.nodeType === 1 ) {
  6096. jQuery.cleanData( getAll( node ) );
  6097. }
  6098.  
  6099. if ( node.parentNode ) {
  6100. if ( keepData && isAttached( node ) ) {
  6101. setGlobalEval( getAll( node, "script" ) );
  6102. }
  6103. node.parentNode.removeChild( node );
  6104. }
  6105. }
  6106.  
  6107. return elem;
  6108. }
  6109.  
  6110. jQuery.extend( {
  6111. htmlPrefilter: function( html ) {
  6112. return html;
  6113. },
  6114.  
  6115. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  6116. var i, l, srcElements, destElements,
  6117. clone = elem.cloneNode( true ),
  6118. inPage = isAttached( elem );
  6119.  
  6120. // Fix IE cloning issues
  6121. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  6122. !jQuery.isXMLDoc( elem ) ) {
  6123.  
  6124. // We eschew jQuery#find here for performance reasons:
  6125. // https://jsperf.com/getall-vs-sizzle/2
  6126. destElements = getAll( clone );
  6127. srcElements = getAll( elem );
  6128.  
  6129. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  6130. fixInput( srcElements[ i ], destElements[ i ] );
  6131. }
  6132. }
  6133.  
  6134. // Copy the events from the original to the clone
  6135. if ( dataAndEvents ) {
  6136. if ( deepDataAndEvents ) {
  6137. srcElements = srcElements || getAll( elem );
  6138. destElements = destElements || getAll( clone );
  6139.  
  6140. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  6141. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  6142. }
  6143. } else {
  6144. cloneCopyEvent( elem, clone );
  6145. }
  6146. }
  6147.  
  6148. // Preserve script evaluation history
  6149. destElements = getAll( clone, "script" );
  6150. if ( destElements.length > 0 ) {
  6151. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  6152. }
  6153.  
  6154. // Return the cloned set
  6155. return clone;
  6156. },
  6157.  
  6158. cleanData: function( elems ) {
  6159. var data, elem, type,
  6160. special = jQuery.event.special,
  6161. i = 0;
  6162.  
  6163. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  6164. if ( acceptData( elem ) ) {
  6165. if ( ( data = elem[ dataPriv.expando ] ) ) {
  6166. if ( data.events ) {
  6167. for ( type in data.events ) {
  6168. if ( special[ type ] ) {
  6169. jQuery.event.remove( elem, type );
  6170.  
  6171. // This is a shortcut to avoid jQuery.event.remove's overhead
  6172. } else {
  6173. jQuery.removeEvent( elem, type, data.handle );
  6174. }
  6175. }
  6176. }
  6177.  
  6178. // Support: Chrome <=35 - 45+
  6179. // Assign undefined instead of using delete, see Data#remove
  6180. elem[ dataPriv.expando ] = undefined;
  6181. }
  6182. if ( elem[ dataUser.expando ] ) {
  6183.  
  6184. // Support: Chrome <=35 - 45+
  6185. // Assign undefined instead of using delete, see Data#remove
  6186. elem[ dataUser.expando ] = undefined;
  6187. }
  6188. }
  6189. }
  6190. }
  6191. } );
  6192.  
  6193. jQuery.fn.extend( {
  6194. detach: function( selector ) {
  6195. return remove( this, selector, true );
  6196. },
  6197.  
  6198. remove: function( selector ) {
  6199. return remove( this, selector );
  6200. },
  6201.  
  6202. text: function( value ) {
  6203. return access( this, function( value ) {
  6204. return value === undefined ?
  6205. jQuery.text( this ) :
  6206. this.empty().each( function() {
  6207. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6208. this.textContent = value;
  6209. }
  6210. } );
  6211. }, null, value, arguments.length );
  6212. },
  6213.  
  6214. append: function() {
  6215. return domManip( this, arguments, function( elem ) {
  6216. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6217. var target = manipulationTarget( this, elem );
  6218. target.appendChild( elem );
  6219. }
  6220. } );
  6221. },
  6222.  
  6223. prepend: function() {
  6224. return domManip( this, arguments, function( elem ) {
  6225. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  6226. var target = manipulationTarget( this, elem );
  6227. target.insertBefore( elem, target.firstChild );
  6228. }
  6229. } );
  6230. },
  6231.  
  6232. before: function() {
  6233. return domManip( this, arguments, function( elem ) {
  6234. if ( this.parentNode ) {
  6235. this.parentNode.insertBefore( elem, this );
  6236. }
  6237. } );
  6238. },
  6239.  
  6240. after: function() {
  6241. return domManip( this, arguments, function( elem ) {
  6242. if ( this.parentNode ) {
  6243. this.parentNode.insertBefore( elem, this.nextSibling );
  6244. }
  6245. } );
  6246. },
  6247.  
  6248. empty: function() {
  6249. var elem,
  6250. i = 0;
  6251.  
  6252. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  6253. if ( elem.nodeType === 1 ) {
  6254.  
  6255. // Prevent memory leaks
  6256. jQuery.cleanData( getAll( elem, false ) );
  6257.  
  6258. // Remove any remaining nodes
  6259. elem.textContent = "";
  6260. }
  6261. }
  6262.  
  6263. return this;
  6264. },
  6265.  
  6266. clone: function( dataAndEvents, deepDataAndEvents ) {
  6267. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  6268. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  6269.  
  6270. return this.map( function() {
  6271. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  6272. } );
  6273. },
  6274.  
  6275. html: function( value ) {
  6276. return access( this, function( value ) {
  6277. var elem = this[ 0 ] || {},
  6278. i = 0,
  6279. l = this.length;
  6280.  
  6281. if ( value === undefined && elem.nodeType === 1 ) {
  6282. return elem.innerHTML;
  6283. }
  6284.  
  6285. // See if we can take a shortcut and just use innerHTML
  6286. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  6287. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  6288.  
  6289. value = jQuery.htmlPrefilter( value );
  6290.  
  6291. try {
  6292. for ( ; i < l; i++ ) {
  6293. elem = this[ i ] || {};
  6294.  
  6295. // Remove element nodes and prevent memory leaks
  6296. if ( elem.nodeType === 1 ) {
  6297. jQuery.cleanData( getAll( elem, false ) );
  6298. elem.innerHTML = value;
  6299. }
  6300. }
  6301.  
  6302. elem = 0;
  6303.  
  6304. // If using innerHTML throws an exception, use the fallback method
  6305. } catch ( e ) {}
  6306. }
  6307.  
  6308. if ( elem ) {
  6309. this.empty().append( value );
  6310. }
  6311. }, null, value, arguments.length );
  6312. },
  6313.  
  6314. replaceWith: function() {
  6315. var ignored = [];
  6316.  
  6317. // Make the changes, replacing each non-ignored context element with the new content
  6318. return domManip( this, arguments, function( elem ) {
  6319. var parent = this.parentNode;
  6320.  
  6321. if ( jQuery.inArray( this, ignored ) < 0 ) {
  6322. jQuery.cleanData( getAll( this ) );
  6323. if ( parent ) {
  6324. parent.replaceChild( elem, this );
  6325. }
  6326. }
  6327.  
  6328. // Force callback invocation
  6329. }, ignored );
  6330. }
  6331. } );
  6332.  
  6333. jQuery.each( {
  6334. appendTo: "append",
  6335. prependTo: "prepend",
  6336. insertBefore: "before",
  6337. insertAfter: "after",
  6338. replaceAll: "replaceWith"
  6339. }, function( name, original ) {
  6340. jQuery.fn[ name ] = function( selector ) {
  6341. var elems,
  6342. ret = [],
  6343. insert = jQuery( selector ),
  6344. last = insert.length - 1,
  6345. i = 0;
  6346.  
  6347. for ( ; i <= last; i++ ) {
  6348. elems = i === last ? this : this.clone( true );
  6349. jQuery( insert[ i ] )[ original ]( elems );
  6350.  
  6351. // Support: Android <=4.0 only, PhantomJS 1 only
  6352. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  6353. push.apply( ret, elems.get() );
  6354. }
  6355.  
  6356. return this.pushStack( ret );
  6357. };
  6358. } );
  6359. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  6360.  
  6361. var rcustomProp = /^--/;
  6362.  
  6363.  
  6364. var getStyles = function( elem ) {
  6365.  
  6366. // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
  6367. // IE throws on elements created in popups
  6368. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  6369. var view = elem.ownerDocument.defaultView;
  6370.  
  6371. if ( !view || !view.opener ) {
  6372. view = window;
  6373. }
  6374.  
  6375. return view.getComputedStyle( elem );
  6376. };
  6377.  
  6378. var swap = function( elem, options, callback ) {
  6379. var ret, name,
  6380. old = {};
  6381.  
  6382. // Remember the old values, and insert the new ones
  6383. for ( name in options ) {
  6384. old[ name ] = elem.style[ name ];
  6385. elem.style[ name ] = options[ name ];
  6386. }
  6387.  
  6388. ret = callback.call( elem );
  6389.  
  6390. // Revert the old values
  6391. for ( name in options ) {
  6392. elem.style[ name ] = old[ name ];
  6393. }
  6394.  
  6395. return ret;
  6396. };
  6397.  
  6398.  
  6399. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  6400.  
  6401.  
  6402.  
  6403. ( function() {
  6404.  
  6405. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  6406. // so they're executed at the same time to save the second computation.
  6407. function computeStyleTests() {
  6408.  
  6409. // This is a singleton, we need to execute it only once
  6410. if ( !div ) {
  6411. return;
  6412. }
  6413.  
  6414. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  6415. "margin-top:1px;padding:0;border:0";
  6416. div.style.cssText =
  6417. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  6418. "margin:auto;border:1px;padding:1px;" +
  6419. "width:60%;top:1%";
  6420. documentElement.appendChild( container ).appendChild( div );
  6421.  
  6422. var divStyle = window.getComputedStyle( div );
  6423. pixelPositionVal = divStyle.top !== "1%";
  6424.  
  6425. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  6426. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  6427.  
  6428. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  6429. // Some styles come back with percentage values, even though they shouldn't
  6430. div.style.right = "60%";
  6431. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  6432.  
  6433. // Support: IE 9 - 11 only
  6434. // Detect misreporting of content dimensions for box-sizing:border-box elements
  6435. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  6436.  
  6437. // Support: IE 9 only
  6438. // Detect overflow:scroll screwiness (gh-3699)
  6439. // Support: Chrome <=64
  6440. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  6441. div.style.position = "absolute";
  6442. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  6443.  
  6444. documentElement.removeChild( container );
  6445.  
  6446. // Nullify the div so it wouldn't be stored in the memory and
  6447. // it will also be a sign that checks already performed
  6448. div = null;
  6449. }
  6450.  
  6451. function roundPixelMeasures( measure ) {
  6452. return Math.round( parseFloat( measure ) );
  6453. }
  6454.  
  6455. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  6456. reliableTrDimensionsVal, reliableMarginLeftVal,
  6457. container = document.createElement( "div" ),
  6458. div = document.createElement( "div" );
  6459.  
  6460. // Finish early in limited (non-browser) environments
  6461. if ( !div.style ) {
  6462. return;
  6463. }
  6464.  
  6465. // Support: IE <=9 - 11 only
  6466. // Style of cloned element affects source element cloned (trac-8908)
  6467. div.style.backgroundClip = "content-box";
  6468. div.cloneNode( true ).style.backgroundClip = "";
  6469. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  6470.  
  6471. jQuery.extend( support, {
  6472. boxSizingReliable: function() {
  6473. computeStyleTests();
  6474. return boxSizingReliableVal;
  6475. },
  6476. pixelBoxStyles: function() {
  6477. computeStyleTests();
  6478. return pixelBoxStylesVal;
  6479. },
  6480. pixelPosition: function() {
  6481. computeStyleTests();
  6482. return pixelPositionVal;
  6483. },
  6484. reliableMarginLeft: function() {
  6485. computeStyleTests();
  6486. return reliableMarginLeftVal;
  6487. },
  6488. scrollboxSize: function() {
  6489. computeStyleTests();
  6490. return scrollboxSizeVal;
  6491. },
  6492.  
  6493. // Support: IE 9 - 11+, Edge 15 - 18+
  6494. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  6495. // set in CSS while `offset*` properties report correct values.
  6496. // Behavior in IE 9 is more subtle than in newer versions & it passes
  6497. // some versions of this test; make sure not to make it pass there!
  6498. //
  6499. // Support: Firefox 70+
  6500. // Only Firefox includes border widths
  6501. // in computed dimensions. (gh-4529)
  6502. reliableTrDimensions: function() {
  6503. var table, tr, trChild, trStyle;
  6504. if ( reliableTrDimensionsVal == null ) {
  6505. table = document.createElement( "table" );
  6506. tr = document.createElement( "tr" );
  6507. trChild = document.createElement( "div" );
  6508.  
  6509. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  6510. tr.style.cssText = "box-sizing:content-box;border:1px solid";
  6511.  
  6512. // Support: Chrome 86+
  6513. // Height set through cssText does not get applied.
  6514. // Computed height then comes back as 0.
  6515. tr.style.height = "1px";
  6516. trChild.style.height = "9px";
  6517.  
  6518. // Support: Android 8 Chrome 86+
  6519. // In our bodyBackground.html iframe,
  6520. // display for all div elements is set to "inline",
  6521. // which causes a problem only in Android 8 Chrome 86.
  6522. // Ensuring the div is `display: block`
  6523. // gets around this issue.
  6524. trChild.style.display = "block";
  6525.  
  6526. documentElement
  6527. .appendChild( table )
  6528. .appendChild( tr )
  6529. .appendChild( trChild );
  6530.  
  6531. trStyle = window.getComputedStyle( tr );
  6532. reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
  6533. parseInt( trStyle.borderTopWidth, 10 ) +
  6534. parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
  6535.  
  6536. documentElement.removeChild( table );
  6537. }
  6538. return reliableTrDimensionsVal;
  6539. }
  6540. } );
  6541. } )();
  6542.  
  6543.  
  6544. function curCSS( elem, name, computed ) {
  6545. var width, minWidth, maxWidth, ret,
  6546. isCustomProp = rcustomProp.test( name ),
  6547.  
  6548. // Support: Firefox 51+
  6549. // Retrieving style before computed somehow
  6550. // fixes an issue with getting wrong values
  6551. // on detached elements
  6552. style = elem.style;
  6553.  
  6554. computed = computed || getStyles( elem );
  6555.  
  6556. // getPropertyValue is needed for:
  6557. // .css('filter') (IE 9 only, trac-12537)
  6558. // .css('--customProperty) (gh-3144)
  6559. if ( computed ) {
  6560.  
  6561. // Support: IE <=9 - 11+
  6562. // IE only supports `"float"` in `getPropertyValue`; in computed styles
  6563. // it's only available as `"cssFloat"`. We no longer modify properties
  6564. // sent to `.css()` apart from camelCasing, so we need to check both.
  6565. // Normally, this would create difference in behavior: if
  6566. // `getPropertyValue` returns an empty string, the value returned
  6567. // by `.css()` would be `undefined`. This is usually the case for
  6568. // disconnected elements. However, in IE even disconnected elements
  6569. // with no styles return `"none"` for `getPropertyValue( "float" )`
  6570. ret = computed.getPropertyValue( name ) || computed[ name ];
  6571.  
  6572. if ( isCustomProp && ret ) {
  6573.  
  6574. // Support: Firefox 105+, Chrome <=105+
  6575. // Spec requires trimming whitespace for custom properties (gh-4926).
  6576. // Firefox only trims leading whitespace. Chrome just collapses
  6577. // both leading & trailing whitespace to a single space.
  6578. //
  6579. // Fall back to `undefined` if empty string returned.
  6580. // This collapses a missing definition with property defined
  6581. // and set to an empty string but there's no standard API
  6582. // allowing us to differentiate them without a performance penalty
  6583. // and returning `undefined` aligns with older jQuery.
  6584. //
  6585. // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
  6586. // as whitespace while CSS does not, but this is not a problem
  6587. // because CSS preprocessing replaces them with U+000A LINE FEED
  6588. // (which *is* CSS whitespace)
  6589. // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
  6590. ret = ret.replace( rtrimCSS, "$1" ) || undefined;
  6591. }
  6592.  
  6593. if ( ret === "" && !isAttached( elem ) ) {
  6594. ret = jQuery.style( elem, name );
  6595. }
  6596.  
  6597. // A tribute to the "awesome hack by Dean Edwards"
  6598. // Android Browser returns percentage for some values,
  6599. // but width seems to be reliably pixels.
  6600. // This is against the CSSOM draft spec:
  6601. // https://drafts.csswg.org/cssom/#resolved-values
  6602. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  6603.  
  6604. // Remember the original values
  6605. width = style.width;
  6606. minWidth = style.minWidth;
  6607. maxWidth = style.maxWidth;
  6608.  
  6609. // Put in the new values to get a computed value out
  6610. style.minWidth = style.maxWidth = style.width = ret;
  6611. ret = computed.width;
  6612.  
  6613. // Revert the changed values
  6614. style.width = width;
  6615. style.minWidth = minWidth;
  6616. style.maxWidth = maxWidth;
  6617. }
  6618. }
  6619.  
  6620. return ret !== undefined ?
  6621.  
  6622. // Support: IE <=9 - 11 only
  6623. // IE returns zIndex value as an integer.
  6624. ret + "" :
  6625. ret;
  6626. }
  6627.  
  6628.  
  6629. function addGetHookIf( conditionFn, hookFn ) {
  6630.  
  6631. // Define the hook, we'll check on the first run if it's really needed.
  6632. return {
  6633. get: function() {
  6634. if ( conditionFn() ) {
  6635.  
  6636. // Hook not needed (or it's not possible to use it due
  6637. // to missing dependency), remove it.
  6638. delete this.get;
  6639. return;
  6640. }
  6641.  
  6642. // Hook needed; redefine it so that the support test is not executed again.
  6643. return ( this.get = hookFn ).apply( this, arguments );
  6644. }
  6645. };
  6646. }
  6647.  
  6648.  
  6649. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  6650. emptyStyle = document.createElement( "div" ).style,
  6651. vendorProps = {};
  6652.  
  6653. // Return a vendor-prefixed property or undefined
  6654. function vendorPropName( name ) {
  6655.  
  6656. // Check for vendor prefixed names
  6657. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  6658. i = cssPrefixes.length;
  6659.  
  6660. while ( i-- ) {
  6661. name = cssPrefixes[ i ] + capName;
  6662. if ( name in emptyStyle ) {
  6663. return name;
  6664. }
  6665. }
  6666. }
  6667.  
  6668. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  6669. function finalPropName( name ) {
  6670. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  6671.  
  6672. if ( final ) {
  6673. return final;
  6674. }
  6675. if ( name in emptyStyle ) {
  6676. return name;
  6677. }
  6678. return vendorProps[ name ] = vendorPropName( name ) || name;
  6679. }
  6680.  
  6681.  
  6682. var
  6683.  
  6684. // Swappable if display is none or starts with table
  6685. // except "table", "table-cell", or "table-caption"
  6686. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  6687. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  6688. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  6689. cssNormalTransform = {
  6690. letterSpacing: "0",
  6691. fontWeight: "400"
  6692. };
  6693.  
  6694. function setPositiveNumber( _elem, value, subtract ) {
  6695.  
  6696. // Any relative (+/-) values have already been
  6697. // normalized at this point
  6698. var matches = rcssNum.exec( value );
  6699. return matches ?
  6700.  
  6701. // Guard against undefined "subtract", e.g., when used as in cssHooks
  6702. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  6703. value;
  6704. }
  6705.  
  6706. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  6707. var i = dimension === "width" ? 1 : 0,
  6708. extra = 0,
  6709. delta = 0,
  6710. marginDelta = 0;
  6711.  
  6712. // Adjustment may not be necessary
  6713. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  6714. return 0;
  6715. }
  6716.  
  6717. for ( ; i < 4; i += 2 ) {
  6718.  
  6719. // Both box models exclude margin
  6720. // Count margin delta separately to only add it after scroll gutter adjustment.
  6721. // This is needed to make negative margins work with `outerHeight( true )` (gh-3982).
  6722. if ( box === "margin" ) {
  6723. marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  6724. }
  6725.  
  6726. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  6727. if ( !isBorderBox ) {
  6728.  
  6729. // Add padding
  6730. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  6731.  
  6732. // For "border" or "margin", add border
  6733. if ( box !== "padding" ) {
  6734. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6735.  
  6736. // But still keep track of it otherwise
  6737. } else {
  6738. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6739. }
  6740.  
  6741. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  6742. // "padding" or "margin"
  6743. } else {
  6744.  
  6745. // For "content", subtract padding
  6746. if ( box === "content" ) {
  6747. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  6748. }
  6749.  
  6750. // For "content" or "padding", subtract border
  6751. if ( box !== "margin" ) {
  6752. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  6753. }
  6754. }
  6755. }
  6756.  
  6757. // Account for positive content-box scroll gutter when requested by providing computedVal
  6758. if ( !isBorderBox && computedVal >= 0 ) {
  6759.  
  6760. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  6761. // Assuming integer scroll gutter, subtract the rest and round down
  6762. delta += Math.max( 0, Math.ceil(
  6763. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  6764. computedVal -
  6765. delta -
  6766. extra -
  6767. 0.5
  6768.  
  6769. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  6770. // Use an explicit zero to avoid NaN (gh-3964)
  6771. ) ) || 0;
  6772. }
  6773.  
  6774. return delta + marginDelta;
  6775. }
  6776.  
  6777. function getWidthOrHeight( elem, dimension, extra ) {
  6778.  
  6779. // Start with computed style
  6780. var styles = getStyles( elem ),
  6781.  
  6782. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  6783. // Fake content-box until we know it's needed to know the true value.
  6784. boxSizingNeeded = !support.boxSizingReliable() || extra,
  6785. isBorderBox = boxSizingNeeded &&
  6786. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  6787. valueIsBorderBox = isBorderBox,
  6788.  
  6789. val = curCSS( elem, dimension, styles ),
  6790. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  6791.  
  6792. // Support: Firefox <=54
  6793. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  6794. if ( rnumnonpx.test( val ) ) {
  6795. if ( !extra ) {
  6796. return val;
  6797. }
  6798. val = "auto";
  6799. }
  6800.  
  6801.  
  6802. // Support: IE 9 - 11 only
  6803. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  6804. // In those cases, the computed value can be trusted to be border-box.
  6805. if ( ( !support.boxSizingReliable() && isBorderBox ||
  6806.  
  6807. // Support: IE 10 - 11+, Edge 15 - 18+
  6808. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  6809. // set in CSS while `offset*` properties report correct values.
  6810. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  6811. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  6812.  
  6813. // Fall back to offsetWidth/offsetHeight when value is "auto"
  6814. // This happens for inline elements with no explicit setting (gh-3571)
  6815. val === "auto" ||
  6816.  
  6817. // Support: Android <=4.1 - 4.3 only
  6818. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  6819. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  6820.  
  6821. // Make sure the element is visible & connected
  6822. elem.getClientRects().length ) {
  6823.  
  6824. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  6825.  
  6826. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  6827. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  6828. // retrieved value as a content box dimension.
  6829. valueIsBorderBox = offsetProp in elem;
  6830. if ( valueIsBorderBox ) {
  6831. val = elem[ offsetProp ];
  6832. }
  6833. }
  6834.  
  6835. // Normalize "" and auto
  6836. val = parseFloat( val ) || 0;
  6837.  
  6838. // Adjust for the element's box model
  6839. return ( val +
  6840. boxModelAdjustment(
  6841. elem,
  6842. dimension,
  6843. extra || ( isBorderBox ? "border" : "content" ),
  6844. valueIsBorderBox,
  6845. styles,
  6846.  
  6847. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  6848. val
  6849. )
  6850. ) + "px";
  6851. }
  6852.  
  6853. jQuery.extend( {
  6854.  
  6855. // Add in style property hooks for overriding the default
  6856. // behavior of getting and setting a style property
  6857. cssHooks: {
  6858. opacity: {
  6859. get: function( elem, computed ) {
  6860. if ( computed ) {
  6861.  
  6862. // We should always get a number back from opacity
  6863. var ret = curCSS( elem, "opacity" );
  6864. return ret === "" ? "1" : ret;
  6865. }
  6866. }
  6867. }
  6868. },
  6869.  
  6870. // Don't automatically add "px" to these possibly-unitless properties
  6871. cssNumber: {
  6872. animationIterationCount: true,
  6873. aspectRatio: true,
  6874. borderImageSlice: true,
  6875. columnCount: true,
  6876. flexGrow: true,
  6877. flexShrink: true,
  6878. fontWeight: true,
  6879. gridArea: true,
  6880. gridColumn: true,
  6881. gridColumnEnd: true,
  6882. gridColumnStart: true,
  6883. gridRow: true,
  6884. gridRowEnd: true,
  6885. gridRowStart: true,
  6886. lineHeight: true,
  6887. opacity: true,
  6888. order: true,
  6889. orphans: true,
  6890. scale: true,
  6891. widows: true,
  6892. zIndex: true,
  6893. zoom: true,
  6894.  
  6895. // SVG-related
  6896. fillOpacity: true,
  6897. floodOpacity: true,
  6898. stopOpacity: true,
  6899. strokeMiterlimit: true,
  6900. strokeOpacity: true
  6901. },
  6902.  
  6903. // Add in properties whose names you wish to fix before
  6904. // setting or getting the value
  6905. cssProps: {},
  6906.  
  6907. // Get and set the style property on a DOM Node
  6908. style: function( elem, name, value, extra ) {
  6909.  
  6910. // Don't set styles on text and comment nodes
  6911. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  6912. return;
  6913. }
  6914.  
  6915. // Make sure that we're working with the right name
  6916. var ret, type, hooks,
  6917. origName = camelCase( name ),
  6918. isCustomProp = rcustomProp.test( name ),
  6919. style = elem.style;
  6920.  
  6921. // Make sure that we're working with the right name. We don't
  6922. // want to query the value if it is a CSS custom property
  6923. // since they are user-defined.
  6924. if ( !isCustomProp ) {
  6925. name = finalPropName( origName );
  6926. }
  6927.  
  6928. // Gets hook for the prefixed version, then unprefixed version
  6929. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  6930.  
  6931. // Check if we're setting a value
  6932. if ( value !== undefined ) {
  6933. type = typeof value;
  6934.  
  6935. // Convert "+=" or "-=" to relative numbers (trac-7345)
  6936. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  6937. value = adjustCSS( elem, name, ret );
  6938.  
  6939. // Fixes bug trac-9237
  6940. type = "number";
  6941. }
  6942.  
  6943. // Make sure that null and NaN values aren't set (trac-7116)
  6944. if ( value == null || value !== value ) {
  6945. return;
  6946. }
  6947.  
  6948. // If a number was passed in, add the unit (except for certain CSS properties)
  6949. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  6950. // "px" to a few hardcoded values.
  6951. if ( type === "number" && !isCustomProp ) {
  6952. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  6953. }
  6954.  
  6955. // background-* props affect original clone's values
  6956. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  6957. style[ name ] = "inherit";
  6958. }
  6959.  
  6960. // If a hook was provided, use that value, otherwise just set the specified value
  6961. if ( !hooks || !( "set" in hooks ) ||
  6962. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  6963.  
  6964. if ( isCustomProp ) {
  6965. style.setProperty( name, value );
  6966. } else {
  6967. style[ name ] = value;
  6968. }
  6969. }
  6970.  
  6971. } else {
  6972.  
  6973. // If a hook was provided get the non-computed value from there
  6974. if ( hooks && "get" in hooks &&
  6975. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  6976.  
  6977. return ret;
  6978. }
  6979.  
  6980. // Otherwise just get the value from the style object
  6981. return style[ name ];
  6982. }
  6983. },
  6984.  
  6985. css: function( elem, name, extra, styles ) {
  6986. var val, num, hooks,
  6987. origName = camelCase( name ),
  6988. isCustomProp = rcustomProp.test( name );
  6989.  
  6990. // Make sure that we're working with the right name. We don't
  6991. // want to modify the value if it is a CSS custom property
  6992. // since they are user-defined.
  6993. if ( !isCustomProp ) {
  6994. name = finalPropName( origName );
  6995. }
  6996.  
  6997. // Try prefixed name followed by the unprefixed name
  6998. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  6999.  
  7000. // If a hook was provided get the computed value from there
  7001. if ( hooks && "get" in hooks ) {
  7002. val = hooks.get( elem, true, extra );
  7003. }
  7004.  
  7005. // Otherwise, if a way to get the computed value exists, use that
  7006. if ( val === undefined ) {
  7007. val = curCSS( elem, name, styles );
  7008. }
  7009.  
  7010. // Convert "normal" to computed value
  7011. if ( val === "normal" && name in cssNormalTransform ) {
  7012. val = cssNormalTransform[ name ];
  7013. }
  7014.  
  7015. // Make numeric if forced or a qualifier was provided and val looks numeric
  7016. if ( extra === "" || extra ) {
  7017. num = parseFloat( val );
  7018. return extra === true || isFinite( num ) ? num || 0 : val;
  7019. }
  7020.  
  7021. return val;
  7022. }
  7023. } );
  7024.  
  7025. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  7026. jQuery.cssHooks[ dimension ] = {
  7027. get: function( elem, computed, extra ) {
  7028. if ( computed ) {
  7029.  
  7030. // Certain elements can have dimension info if we invisibly show them
  7031. // but it must have a current display style that would benefit
  7032. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  7033.  
  7034. // Support: Safari 8+
  7035. // Table columns in Safari have non-zero offsetWidth & zero
  7036. // getBoundingClientRect().width unless display is changed.
  7037. // Support: IE <=11 only
  7038. // Running getBoundingClientRect on a disconnected node
  7039. // in IE throws an error.
  7040. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  7041. swap( elem, cssShow, function() {
  7042. return getWidthOrHeight( elem, dimension, extra );
  7043. } ) :
  7044. getWidthOrHeight( elem, dimension, extra );
  7045. }
  7046. },
  7047.  
  7048. set: function( elem, value, extra ) {
  7049. var matches,
  7050. styles = getStyles( elem ),
  7051.  
  7052. // Only read styles.position if the test has a chance to fail
  7053. // to avoid forcing a reflow.
  7054. scrollboxSizeBuggy = !support.scrollboxSize() &&
  7055. styles.position === "absolute",
  7056.  
  7057. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  7058. boxSizingNeeded = scrollboxSizeBuggy || extra,
  7059. isBorderBox = boxSizingNeeded &&
  7060. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  7061. subtract = extra ?
  7062. boxModelAdjustment(
  7063. elem,
  7064. dimension,
  7065. extra,
  7066. isBorderBox,
  7067. styles
  7068. ) :
  7069. 0;
  7070.  
  7071. // Account for unreliable border-box dimensions by comparing offset* to computed and
  7072. // faking a content-box to get border and padding (gh-3699)
  7073. if ( isBorderBox && scrollboxSizeBuggy ) {
  7074. subtract -= Math.ceil(
  7075. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  7076. parseFloat( styles[ dimension ] ) -
  7077. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  7078. 0.5
  7079. );
  7080. }
  7081.  
  7082. // Convert to pixels if value adjustment is needed
  7083. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  7084. ( matches[ 3 ] || "px" ) !== "px" ) {
  7085.  
  7086. elem.style[ dimension ] = value;
  7087. value = jQuery.css( elem, dimension );
  7088. }
  7089.  
  7090. return setPositiveNumber( elem, value, subtract );
  7091. }
  7092. };
  7093. } );
  7094.  
  7095. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  7096. function( elem, computed ) {
  7097. if ( computed ) {
  7098. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  7099. elem.getBoundingClientRect().left -
  7100. swap( elem, { marginLeft: 0 }, function() {
  7101. return elem.getBoundingClientRect().left;
  7102. } )
  7103. ) + "px";
  7104. }
  7105. }
  7106. );
  7107.  
  7108. // These hooks are used by animate to expand properties
  7109. jQuery.each( {
  7110. margin: "",
  7111. padding: "",
  7112. border: "Width"
  7113. }, function( prefix, suffix ) {
  7114. jQuery.cssHooks[ prefix + suffix ] = {
  7115. expand: function( value ) {
  7116. var i = 0,
  7117. expanded = {},
  7118.  
  7119. // Assumes a single number if not a string
  7120. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  7121.  
  7122. for ( ; i < 4; i++ ) {
  7123. expanded[ prefix + cssExpand[ i ] + suffix ] =
  7124. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  7125. }
  7126.  
  7127. return expanded;
  7128. }
  7129. };
  7130.  
  7131. if ( prefix !== "margin" ) {
  7132. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  7133. }
  7134. } );
  7135.  
  7136. jQuery.fn.extend( {
  7137. css: function( name, value ) {
  7138. return access( this, function( elem, name, value ) {
  7139. var styles, len,
  7140. map = {},
  7141. i = 0;
  7142.  
  7143. if ( Array.isArray( name ) ) {
  7144. styles = getStyles( elem );
  7145. len = name.length;
  7146.  
  7147. for ( ; i < len; i++ ) {
  7148. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  7149. }
  7150.  
  7151. return map;
  7152. }
  7153.  
  7154. return value !== undefined ?
  7155. jQuery.style( elem, name, value ) :
  7156. jQuery.css( elem, name );
  7157. }, name, value, arguments.length > 1 );
  7158. }
  7159. } );
  7160.  
  7161.  
  7162. // Based off of the plugin by Clint Helfers, with permission.
  7163. jQuery.fn.delay = function( time, type ) {
  7164. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  7165. type = type || "fx";
  7166.  
  7167. return this.queue( type, function( next, hooks ) {
  7168. var timeout = window.setTimeout( next, time );
  7169. hooks.stop = function() {
  7170. window.clearTimeout( timeout );
  7171. };
  7172. } );
  7173. };
  7174.  
  7175.  
  7176. ( function() {
  7177. var input = document.createElement( "input" ),
  7178. select = document.createElement( "select" ),
  7179. opt = select.appendChild( document.createElement( "option" ) );
  7180.  
  7181. input.type = "checkbox";
  7182.  
  7183. // Support: Android <=4.3 only
  7184. // Default value for a checkbox should be "on"
  7185. support.checkOn = input.value !== "";
  7186.  
  7187. // Support: IE <=11 only
  7188. // Must access selectedIndex to make default options select
  7189. support.optSelected = opt.selected;
  7190.  
  7191. // Support: IE <=11 only
  7192. // An input loses its value after becoming a radio
  7193. input = document.createElement( "input" );
  7194. input.value = "t";
  7195. input.type = "radio";
  7196. support.radioValue = input.value === "t";
  7197. } )();
  7198.  
  7199.  
  7200. var boolHook,
  7201. attrHandle = jQuery.expr.attrHandle;
  7202.  
  7203. jQuery.fn.extend( {
  7204. attr: function( name, value ) {
  7205. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  7206. },
  7207.  
  7208. removeAttr: function( name ) {
  7209. return this.each( function() {
  7210. jQuery.removeAttr( this, name );
  7211. } );
  7212. }
  7213. } );
  7214.  
  7215. jQuery.extend( {
  7216. attr: function( elem, name, value ) {
  7217. var ret, hooks,
  7218. nType = elem.nodeType;
  7219.  
  7220. // Don't get/set attributes on text, comment and attribute nodes
  7221. if ( nType === 3 || nType === 8 || nType === 2 ) {
  7222. return;
  7223. }
  7224.  
  7225. // Fallback to prop when attributes are not supported
  7226. if ( typeof elem.getAttribute === "undefined" ) {
  7227. return jQuery.prop( elem, name, value );
  7228. }
  7229.  
  7230. // Attribute hooks are determined by the lowercase version
  7231. // Grab necessary hook if one is defined
  7232. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  7233. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  7234. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  7235. }
  7236.  
  7237. if ( value !== undefined ) {
  7238. if ( value === null ) {
  7239. jQuery.removeAttr( elem, name );
  7240. return;
  7241. }
  7242.  
  7243. if ( hooks && "set" in hooks &&
  7244. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  7245. return ret;
  7246. }
  7247.  
  7248. elem.setAttribute( name, value + "" );
  7249. return value;
  7250. }
  7251.  
  7252. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  7253. return ret;
  7254. }
  7255.  
  7256. ret = jQuery.find.attr( elem, name );
  7257.  
  7258. // Non-existent attributes return null, we normalize to undefined
  7259. return ret == null ? undefined : ret;
  7260. },
  7261.  
  7262. attrHooks: {
  7263. type: {
  7264. set: function( elem, value ) {
  7265. if ( !support.radioValue && value === "radio" &&
  7266. nodeName( elem, "input" ) ) {
  7267. var val = elem.value;
  7268. elem.setAttribute( "type", value );
  7269. if ( val ) {
  7270. elem.value = val;
  7271. }
  7272. return value;
  7273. }
  7274. }
  7275. }
  7276. },
  7277.  
  7278. removeAttr: function( elem, value ) {
  7279. var name,
  7280. i = 0,
  7281.  
  7282. // Attribute names can contain non-HTML whitespace characters
  7283. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  7284. attrNames = value && value.match( rnothtmlwhite );
  7285.  
  7286. if ( attrNames && elem.nodeType === 1 ) {
  7287. while ( ( name = attrNames[ i++ ] ) ) {
  7288. elem.removeAttribute( name );
  7289. }
  7290. }
  7291. }
  7292. } );
  7293.  
  7294. // Hooks for boolean attributes
  7295. boolHook = {
  7296. set: function( elem, value, name ) {
  7297. if ( value === false ) {
  7298.  
  7299. // Remove boolean attributes when set to false
  7300. jQuery.removeAttr( elem, name );
  7301. } else {
  7302. elem.setAttribute( name, name );
  7303. }
  7304. return name;
  7305. }
  7306. };
  7307.  
  7308. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  7309. var getter = attrHandle[ name ] || jQuery.find.attr;
  7310.  
  7311. attrHandle[ name ] = function( elem, name, isXML ) {
  7312. var ret, handle,
  7313. lowercaseName = name.toLowerCase();
  7314.  
  7315. if ( !isXML ) {
  7316.  
  7317. // Avoid an infinite loop by temporarily removing this function from the getter
  7318. handle = attrHandle[ lowercaseName ];
  7319. attrHandle[ lowercaseName ] = ret;
  7320. ret = getter( elem, name, isXML ) != null ?
  7321. lowercaseName :
  7322. null;
  7323. attrHandle[ lowercaseName ] = handle;
  7324. }
  7325. return ret;
  7326. };
  7327. } );
  7328.  
  7329.  
  7330.  
  7331.  
  7332. var rfocusable = /^(?:input|select|textarea|button)$/i,
  7333. rclickable = /^(?:a|area)$/i;
  7334.  
  7335. jQuery.fn.extend( {
  7336. prop: function( name, value ) {
  7337. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  7338. },
  7339.  
  7340. removeProp: function( name ) {
  7341. return this.each( function() {
  7342. delete this[ jQuery.propFix[ name ] || name ];
  7343. } );
  7344. }
  7345. } );
  7346.  
  7347. jQuery.extend( {
  7348. prop: function( elem, name, value ) {
  7349. var ret, hooks,
  7350. nType = elem.nodeType;
  7351.  
  7352. // Don't get/set properties on text, comment and attribute nodes
  7353. if ( nType === 3 || nType === 8 || nType === 2 ) {
  7354. return;
  7355. }
  7356.  
  7357. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  7358.  
  7359. // Fix name and attach hooks
  7360. name = jQuery.propFix[ name ] || name;
  7361. hooks = jQuery.propHooks[ name ];
  7362. }
  7363.  
  7364. if ( value !== undefined ) {
  7365. if ( hooks && "set" in hooks &&
  7366. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  7367. return ret;
  7368. }
  7369.  
  7370. return ( elem[ name ] = value );
  7371. }
  7372.  
  7373. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  7374. return ret;
  7375. }
  7376.  
  7377. return elem[ name ];
  7378. },
  7379.  
  7380. propHooks: {
  7381. tabIndex: {
  7382. get: function( elem ) {
  7383.  
  7384. // Support: IE <=9 - 11 only
  7385. // elem.tabIndex doesn't always return the
  7386. // correct value when it hasn't been explicitly set
  7387. // Use proper attribute retrieval (trac-12072)
  7388. var tabindex = jQuery.find.attr( elem, "tabindex" );
  7389.  
  7390. if ( tabindex ) {
  7391. return parseInt( tabindex, 10 );
  7392. }
  7393.  
  7394. if (
  7395. rfocusable.test( elem.nodeName ) ||
  7396. rclickable.test( elem.nodeName ) &&
  7397. elem.href
  7398. ) {
  7399. return 0;
  7400. }
  7401.  
  7402. return -1;
  7403. }
  7404. }
  7405. },
  7406.  
  7407. propFix: {
  7408. "for": "htmlFor",
  7409. "class": "className"
  7410. }
  7411. } );
  7412.  
  7413. // Support: IE <=11 only
  7414. // Accessing the selectedIndex property
  7415. // forces the browser to respect setting selected
  7416. // on the option
  7417. // The getter ensures a default option is selected
  7418. // when in an optgroup
  7419. // eslint rule "no-unused-expressions" is disabled for this code
  7420. // since it considers such accessions noop
  7421. if ( !support.optSelected ) {
  7422. jQuery.propHooks.selected = {
  7423. get: function( elem ) {
  7424.  
  7425. /* eslint no-unused-expressions: "off" */
  7426.  
  7427. var parent = elem.parentNode;
  7428. if ( parent && parent.parentNode ) {
  7429. parent.parentNode.selectedIndex;
  7430. }
  7431. return null;
  7432. },
  7433. set: function( elem ) {
  7434.  
  7435. /* eslint no-unused-expressions: "off" */
  7436.  
  7437. var parent = elem.parentNode;
  7438. if ( parent ) {
  7439. parent.selectedIndex;
  7440.  
  7441. if ( parent.parentNode ) {
  7442. parent.parentNode.selectedIndex;
  7443. }
  7444. }
  7445. }
  7446. };
  7447. }
  7448.  
  7449. jQuery.each( [
  7450. "tabIndex",
  7451. "readOnly",
  7452. "maxLength",
  7453. "cellSpacing",
  7454. "cellPadding",
  7455. "rowSpan",
  7456. "colSpan",
  7457. "useMap",
  7458. "frameBorder",
  7459. "contentEditable"
  7460. ], function() {
  7461. jQuery.propFix[ this.toLowerCase() ] = this;
  7462. } );
  7463.  
  7464.  
  7465.  
  7466.  
  7467. // Strip and collapse whitespace according to HTML spec
  7468. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  7469. function stripAndCollapse( value ) {
  7470. var tokens = value.match( rnothtmlwhite ) || [];
  7471. return tokens.join( " " );
  7472. }
  7473.  
  7474.  
  7475. function getClass( elem ) {
  7476. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  7477. }
  7478.  
  7479. function classesToArray( value ) {
  7480. if ( Array.isArray( value ) ) {
  7481. return value;
  7482. }
  7483. if ( typeof value === "string" ) {
  7484. return value.match( rnothtmlwhite ) || [];
  7485. }
  7486. return [];
  7487. }
  7488.  
  7489. jQuery.fn.extend( {
  7490. addClass: function( value ) {
  7491. var classNames, cur, curValue, className, i, finalValue;
  7492.  
  7493. if ( isFunction( value ) ) {
  7494. return this.each( function( j ) {
  7495. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  7496. } );
  7497. }
  7498.  
  7499. classNames = classesToArray( value );
  7500.  
  7501. if ( classNames.length ) {
  7502. return this.each( function() {
  7503. curValue = getClass( this );
  7504. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  7505.  
  7506. if ( cur ) {
  7507. for ( i = 0; i < classNames.length; i++ ) {
  7508. className = classNames[ i ];
  7509. if ( cur.indexOf( " " + className + " " ) < 0 ) {
  7510. cur += className + " ";
  7511. }
  7512. }
  7513.  
  7514. // Only assign if different to avoid unneeded rendering.
  7515. finalValue = stripAndCollapse( cur );
  7516. if ( curValue !== finalValue ) {
  7517. this.setAttribute( "class", finalValue );
  7518. }
  7519. }
  7520. } );
  7521. }
  7522.  
  7523. return this;
  7524. },
  7525.  
  7526. removeClass: function( value ) {
  7527. var classNames, cur, curValue, className, i, finalValue;
  7528.  
  7529. if ( isFunction( value ) ) {
  7530. return this.each( function( j ) {
  7531. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  7532. } );
  7533. }
  7534.  
  7535. if ( !arguments.length ) {
  7536. return this.attr( "class", "" );
  7537. }
  7538.  
  7539. classNames = classesToArray( value );
  7540.  
  7541. if ( classNames.length ) {
  7542. return this.each( function() {
  7543. curValue = getClass( this );
  7544.  
  7545. // This expression is here for better compressibility (see addClass)
  7546. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  7547.  
  7548. if ( cur ) {
  7549. for ( i = 0; i < classNames.length; i++ ) {
  7550. className = classNames[ i ];
  7551.  
  7552. // Remove *all* instances
  7553. while ( cur.indexOf( " " + className + " " ) > -1 ) {
  7554. cur = cur.replace( " " + className + " ", " " );
  7555. }
  7556. }
  7557.  
  7558. // Only assign if different to avoid unneeded rendering.
  7559. finalValue = stripAndCollapse( cur );
  7560. if ( curValue !== finalValue ) {
  7561. this.setAttribute( "class", finalValue );
  7562. }
  7563. }
  7564. } );
  7565. }
  7566.  
  7567. return this;
  7568. },
  7569.  
  7570. toggleClass: function( value, stateVal ) {
  7571. var classNames, className, i, self,
  7572. type = typeof value,
  7573. isValidValue = type === "string" || Array.isArray( value );
  7574.  
  7575. if ( isFunction( value ) ) {
  7576. return this.each( function( i ) {
  7577. jQuery( this ).toggleClass(
  7578. value.call( this, i, getClass( this ), stateVal ),
  7579. stateVal
  7580. );
  7581. } );
  7582. }
  7583.  
  7584. if ( typeof stateVal === "boolean" && isValidValue ) {
  7585. return stateVal ? this.addClass( value ) : this.removeClass( value );
  7586. }
  7587.  
  7588. classNames = classesToArray( value );
  7589.  
  7590. return this.each( function() {
  7591. if ( isValidValue ) {
  7592.  
  7593. // Toggle individual class names
  7594. self = jQuery( this );
  7595.  
  7596. for ( i = 0; i < classNames.length; i++ ) {
  7597. className = classNames[ i ];
  7598.  
  7599. // Check each className given, space separated list
  7600. if ( self.hasClass( className ) ) {
  7601. self.removeClass( className );
  7602. } else {
  7603. self.addClass( className );
  7604. }
  7605. }
  7606.  
  7607. // Toggle whole class name
  7608. } else if ( value === undefined || type === "boolean" ) {
  7609. className = getClass( this );
  7610. if ( className ) {
  7611.  
  7612. // Store className if set
  7613. dataPriv.set( this, "__className__", className );
  7614. }
  7615.  
  7616. // If the element has a class name or if we're passed `false`,
  7617. // then remove the whole classname (if there was one, the above saved it).
  7618. // Otherwise bring back whatever was previously saved (if anything),
  7619. // falling back to the empty string if nothing was stored.
  7620. if ( this.setAttribute ) {
  7621. this.setAttribute( "class",
  7622. className || value === false ?
  7623. "" :
  7624. dataPriv.get( this, "__className__" ) || ""
  7625. );
  7626. }
  7627. }
  7628. } );
  7629. },
  7630.  
  7631. hasClass: function( selector ) {
  7632. var className, elem,
  7633. i = 0;
  7634.  
  7635. className = " " + selector + " ";
  7636. while ( ( elem = this[ i++ ] ) ) {
  7637. if ( elem.nodeType === 1 &&
  7638. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  7639. return true;
  7640. }
  7641. }
  7642.  
  7643. return false;
  7644. }
  7645. } );
  7646.  
  7647.  
  7648.  
  7649.  
  7650. var rreturn = /\r/g;
  7651.  
  7652. jQuery.fn.extend( {
  7653. val: function( value ) {
  7654. var hooks, ret, valueIsFunction,
  7655. elem = this[ 0 ];
  7656.  
  7657. if ( !arguments.length ) {
  7658. if ( elem ) {
  7659. hooks = jQuery.valHooks[ elem.type ] ||
  7660. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  7661.  
  7662. if ( hooks &&
  7663. "get" in hooks &&
  7664. ( ret = hooks.get( elem, "value" ) ) !== undefined
  7665. ) {
  7666. return ret;
  7667. }
  7668.  
  7669. ret = elem.value;
  7670.  
  7671. // Handle most common string cases
  7672. if ( typeof ret === "string" ) {
  7673. return ret.replace( rreturn, "" );
  7674. }
  7675.  
  7676. // Handle cases where value is null/undef or number
  7677. return ret == null ? "" : ret;
  7678. }
  7679.  
  7680. return;
  7681. }
  7682.  
  7683. valueIsFunction = isFunction( value );
  7684.  
  7685. return this.each( function( i ) {
  7686. var val;
  7687.  
  7688. if ( this.nodeType !== 1 ) {
  7689. return;
  7690. }
  7691.  
  7692. if ( valueIsFunction ) {
  7693. val = value.call( this, i, jQuery( this ).val() );
  7694. } else {
  7695. val = value;
  7696. }
  7697.  
  7698. // Treat null/undefined as ""; convert numbers to string
  7699. if ( val == null ) {
  7700. val = "";
  7701.  
  7702. } else if ( typeof val === "number" ) {
  7703. val += "";
  7704.  
  7705. } else if ( Array.isArray( val ) ) {
  7706. val = jQuery.map( val, function( value ) {
  7707. return value == null ? "" : value + "";
  7708. } );
  7709. }
  7710.  
  7711. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  7712.  
  7713. // If set returns undefined, fall back to normal setting
  7714. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  7715. this.value = val;
  7716. }
  7717. } );
  7718. }
  7719. } );
  7720.  
  7721. jQuery.extend( {
  7722. valHooks: {
  7723. option: {
  7724. get: function( elem ) {
  7725.  
  7726. var val = jQuery.find.attr( elem, "value" );
  7727. return val != null ?
  7728. val :
  7729.  
  7730. // Support: IE <=10 - 11 only
  7731. // option.text throws exceptions (trac-14686, trac-14858)
  7732. // Strip and collapse whitespace
  7733. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  7734. stripAndCollapse( jQuery.text( elem ) );
  7735. }
  7736. },
  7737. select: {
  7738. get: function( elem ) {
  7739. var value, option, i,
  7740. options = elem.options,
  7741. index = elem.selectedIndex,
  7742. one = elem.type === "select-one",
  7743. values = one ? null : [],
  7744. max = one ? index + 1 : options.length;
  7745.  
  7746. if ( index < 0 ) {
  7747. i = max;
  7748.  
  7749. } else {
  7750. i = one ? index : 0;
  7751. }
  7752.  
  7753. // Loop through all the selected options
  7754. for ( ; i < max; i++ ) {
  7755. option = options[ i ];
  7756.  
  7757. // Support: IE <=9 only
  7758. // IE8-9 doesn't update selected after form reset (trac-2551)
  7759. if ( ( option.selected || i === index ) &&
  7760.  
  7761. // Don't return options that are disabled or in a disabled optgroup
  7762. !option.disabled &&
  7763. ( !option.parentNode.disabled ||
  7764. !nodeName( option.parentNode, "optgroup" ) ) ) {
  7765.  
  7766. // Get the specific value for the option
  7767. value = jQuery( option ).val();
  7768.  
  7769. // We don't need an array for one selects
  7770. if ( one ) {
  7771. return value;
  7772. }
  7773.  
  7774. // Multi-Selects return an array
  7775. values.push( value );
  7776. }
  7777. }
  7778.  
  7779. return values;
  7780. },
  7781.  
  7782. set: function( elem, value ) {
  7783. var optionSet, option,
  7784. options = elem.options,
  7785. values = jQuery.makeArray( value ),
  7786. i = options.length;
  7787.  
  7788. while ( i-- ) {
  7789. option = options[ i ];
  7790.  
  7791. /* eslint-disable no-cond-assign */
  7792.  
  7793. if ( option.selected =
  7794. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  7795. ) {
  7796. optionSet = true;
  7797. }
  7798.  
  7799. /* eslint-enable no-cond-assign */
  7800. }
  7801.  
  7802. // Force browsers to behave consistently when non-matching value is set
  7803. if ( !optionSet ) {
  7804. elem.selectedIndex = -1;
  7805. }
  7806. return values;
  7807. }
  7808. }
  7809. }
  7810. } );
  7811.  
  7812. // Radios and checkboxes getter/setter
  7813. jQuery.each( [ "radio", "checkbox" ], function() {
  7814. jQuery.valHooks[ this ] = {
  7815. set: function( elem, value ) {
  7816. if ( Array.isArray( value ) ) {
  7817. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  7818. }
  7819. }
  7820. };
  7821. if ( !support.checkOn ) {
  7822. jQuery.valHooks[ this ].get = function( elem ) {
  7823. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  7824. };
  7825. }
  7826. } );
  7827.  
  7828.  
  7829.  
  7830.  
  7831. // Return jQuery for attributes-only inclusion
  7832.  
  7833.  
  7834. // Cross-browser xml parsing
  7835. jQuery.parseXML = function( data ) {
  7836. var xml, parserErrorElem;
  7837. if ( !data || typeof data !== "string" ) {
  7838. return null;
  7839. }
  7840.  
  7841. // Support: IE 9 - 11 only
  7842. // IE throws on parseFromString with invalid input.
  7843. try {
  7844. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  7845. } catch ( e ) {}
  7846.  
  7847. parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
  7848. if ( !xml || parserErrorElem ) {
  7849. jQuery.error( "Invalid XML: " + (
  7850. parserErrorElem ?
  7851. jQuery.map( parserErrorElem.childNodes, function( el ) {
  7852. return el.textContent;
  7853. } ).join( "\n" ) :
  7854. data
  7855. ) );
  7856. }
  7857. return xml;
  7858. };
  7859.  
  7860.  
  7861. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  7862. stopPropagationCallback = function( e ) {
  7863. e.stopPropagation();
  7864. };
  7865.  
  7866. jQuery.extend( jQuery.event, {
  7867.  
  7868. trigger: function( event, data, elem, onlyHandlers ) {
  7869.  
  7870. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  7871. eventPath = [ elem || document ],
  7872. type = hasOwn.call( event, "type" ) ? event.type : event,
  7873. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  7874.  
  7875. cur = lastElement = tmp = elem = elem || document;
  7876.  
  7877. // Don't do events on text and comment nodes
  7878. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  7879. return;
  7880. }
  7881.  
  7882. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  7883. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  7884. return;
  7885. }
  7886.  
  7887. if ( type.indexOf( "." ) > -1 ) {
  7888.  
  7889. // Namespaced trigger; create a regexp to match event type in handle()
  7890. namespaces = type.split( "." );
  7891. type = namespaces.shift();
  7892. namespaces.sort();
  7893. }
  7894. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  7895.  
  7896. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  7897. event = event[ jQuery.expando ] ?
  7898. event :
  7899. new jQuery.Event( type, typeof event === "object" && event );
  7900.  
  7901. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  7902. event.isTrigger = onlyHandlers ? 2 : 3;
  7903. event.namespace = namespaces.join( "." );
  7904. event.rnamespace = event.namespace ?
  7905. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  7906. null;
  7907.  
  7908. // Clean up the event in case it is being reused
  7909. event.result = undefined;
  7910. if ( !event.target ) {
  7911. event.target = elem;
  7912. }
  7913.  
  7914. // Clone any incoming data and prepend the event, creating the handler arg list
  7915. data = data == null ?
  7916. [ event ] :
  7917. jQuery.makeArray( data, [ event ] );
  7918.  
  7919. // Allow special events to draw outside the lines
  7920. special = jQuery.event.special[ type ] || {};
  7921. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  7922. return;
  7923. }
  7924.  
  7925. // Determine event propagation path in advance, per W3C events spec (trac-9951)
  7926. // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
  7927. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  7928.  
  7929. bubbleType = special.delegateType || type;
  7930. if ( !rfocusMorph.test( bubbleType + type ) ) {
  7931. cur = cur.parentNode;
  7932. }
  7933. for ( ; cur; cur = cur.parentNode ) {
  7934. eventPath.push( cur );
  7935. tmp = cur;
  7936. }
  7937.  
  7938. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  7939. if ( tmp === ( elem.ownerDocument || document ) ) {
  7940. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  7941. }
  7942. }
  7943.  
  7944. // Fire handlers on the event path
  7945. i = 0;
  7946. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  7947. lastElement = cur;
  7948. event.type = i > 1 ?
  7949. bubbleType :
  7950. special.bindType || type;
  7951.  
  7952. // jQuery handler
  7953. handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
  7954. dataPriv.get( cur, "handle" );
  7955. if ( handle ) {
  7956. handle.apply( cur, data );
  7957. }
  7958.  
  7959. // Native handler
  7960. handle = ontype && cur[ ontype ];
  7961. if ( handle && handle.apply && acceptData( cur ) ) {
  7962. event.result = handle.apply( cur, data );
  7963. if ( event.result === false ) {
  7964. event.preventDefault();
  7965. }
  7966. }
  7967. }
  7968. event.type = type;
  7969.  
  7970. // If nobody prevented the default action, do it now
  7971. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  7972.  
  7973. if ( ( !special._default ||
  7974. special._default.apply( eventPath.pop(), data ) === false ) &&
  7975. acceptData( elem ) ) {
  7976.  
  7977. // Call a native DOM method on the target with the same name as the event.
  7978. // Don't do default actions on window, that's where global variables be (trac-6170)
  7979. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  7980.  
  7981. // Don't re-trigger an onFOO event when we call its FOO() method
  7982. tmp = elem[ ontype ];
  7983.  
  7984. if ( tmp ) {
  7985. elem[ ontype ] = null;
  7986. }
  7987.  
  7988. // Prevent re-triggering of the same event, since we already bubbled it above
  7989. jQuery.event.triggered = type;
  7990.  
  7991. if ( event.isPropagationStopped() ) {
  7992. lastElement.addEventListener( type, stopPropagationCallback );
  7993. }
  7994.  
  7995. elem[ type ]();
  7996.  
  7997. if ( event.isPropagationStopped() ) {
  7998. lastElement.removeEventListener( type, stopPropagationCallback );
  7999. }
  8000.  
  8001. jQuery.event.triggered = undefined;
  8002.  
  8003. if ( tmp ) {
  8004. elem[ ontype ] = tmp;
  8005. }
  8006. }
  8007. }
  8008. }
  8009.  
  8010. return event.result;
  8011. },
  8012.  
  8013. // Piggyback on a donor event to simulate a different one
  8014. // Used only for `focus(in | out)` events
  8015. simulate: function( type, elem, event ) {
  8016. var e = jQuery.extend(
  8017. new jQuery.Event(),
  8018. event,
  8019. {
  8020. type: type,
  8021. isSimulated: true
  8022. }
  8023. );
  8024.  
  8025. jQuery.event.trigger( e, null, elem );
  8026. }
  8027.  
  8028. } );
  8029.  
  8030. jQuery.fn.extend( {
  8031.  
  8032. trigger: function( type, data ) {
  8033. return this.each( function() {
  8034. jQuery.event.trigger( type, data, this );
  8035. } );
  8036. },
  8037. triggerHandler: function( type, data ) {
  8038. var elem = this[ 0 ];
  8039. if ( elem ) {
  8040. return jQuery.event.trigger( type, data, elem, true );
  8041. }
  8042. }
  8043. } );
  8044.  
  8045.  
  8046. var
  8047. rbracket = /\[\]$/,
  8048. rCRLF = /\r?\n/g,
  8049. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  8050. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  8051.  
  8052. function buildParams( prefix, obj, traditional, add ) {
  8053. var name;
  8054.  
  8055. if ( Array.isArray( obj ) ) {
  8056.  
  8057. // Serialize array item.
  8058. jQuery.each( obj, function( i, v ) {
  8059. if ( traditional || rbracket.test( prefix ) ) {
  8060.  
  8061. // Treat each array item as a scalar.
  8062. add( prefix, v );
  8063.  
  8064. } else {
  8065.  
  8066. // Item is non-scalar (array or object), encode its numeric index.
  8067. buildParams(
  8068. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  8069. v,
  8070. traditional,
  8071. add
  8072. );
  8073. }
  8074. } );
  8075.  
  8076. } else if ( !traditional && toType( obj ) === "object" ) {
  8077.  
  8078. // Serialize object item.
  8079. for ( name in obj ) {
  8080. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  8081. }
  8082.  
  8083. } else {
  8084.  
  8085. // Serialize scalar item.
  8086. add( prefix, obj );
  8087. }
  8088. }
  8089.  
  8090. // Serialize an array of form elements or a set of
  8091. // key/values into a query string
  8092. jQuery.param = function( a, traditional ) {
  8093. var prefix,
  8094. s = [],
  8095. add = function( key, valueOrFunction ) {
  8096.  
  8097. // If value is a function, invoke it and use its return value
  8098. var value = isFunction( valueOrFunction ) ?
  8099. valueOrFunction() :
  8100. valueOrFunction;
  8101.  
  8102. s[ s.length ] = encodeURIComponent( key ) + "=" +
  8103. encodeURIComponent( value == null ? "" : value );
  8104. };
  8105.  
  8106. if ( a == null ) {
  8107. return "";
  8108. }
  8109.  
  8110. // If an array was passed in, assume that it is an array of form elements.
  8111. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  8112.  
  8113. // Serialize the form elements
  8114. jQuery.each( a, function() {
  8115. add( this.name, this.value );
  8116. } );
  8117.  
  8118. } else {
  8119.  
  8120. // If traditional, encode the "old" way (the way 1.3.2 or older
  8121. // did it), otherwise encode params recursively.
  8122. for ( prefix in a ) {
  8123. buildParams( prefix, a[ prefix ], traditional, add );
  8124. }
  8125. }
  8126.  
  8127. // Return the resulting serialization
  8128. return s.join( "&" );
  8129. };
  8130.  
  8131. jQuery.fn.extend( {
  8132. serialize: function() {
  8133. return jQuery.param( this.serializeArray() );
  8134. },
  8135. serializeArray: function() {
  8136. return this.map( function() {
  8137.  
  8138. // Can add propHook for "elements" to filter or add form elements
  8139. var elements = jQuery.prop( this, "elements" );
  8140. return elements ? jQuery.makeArray( elements ) : this;
  8141. } ).filter( function() {
  8142. var type = this.type;
  8143.  
  8144. // Use .is( ":disabled" ) so that fieldset[disabled] works
  8145. return this.name && !jQuery( this ).is( ":disabled" ) &&
  8146. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  8147. ( this.checked || !rcheckableType.test( type ) );
  8148. } ).map( function( _i, elem ) {
  8149. var val = jQuery( this ).val();
  8150.  
  8151. if ( val == null ) {
  8152. return null;
  8153. }
  8154.  
  8155. if ( Array.isArray( val ) ) {
  8156. return jQuery.map( val, function( val ) {
  8157. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  8158. } );
  8159. }
  8160.  
  8161. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  8162. } ).get();
  8163. }
  8164. } );
  8165.  
  8166.  
  8167. jQuery.fn.extend( {
  8168. wrapAll: function( html ) {
  8169. var wrap;
  8170.  
  8171. if ( this[ 0 ] ) {
  8172. if ( isFunction( html ) ) {
  8173. html = html.call( this[ 0 ] );
  8174. }
  8175.  
  8176. // The elements to wrap the target around
  8177. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  8178.  
  8179. if ( this[ 0 ].parentNode ) {
  8180. wrap.insertBefore( this[ 0 ] );
  8181. }
  8182.  
  8183. wrap.map( function() {
  8184. var elem = this;
  8185.  
  8186. while ( elem.firstElementChild ) {
  8187. elem = elem.firstElementChild;
  8188. }
  8189.  
  8190. return elem;
  8191. } ).append( this );
  8192. }
  8193.  
  8194. return this;
  8195. },
  8196.  
  8197. wrapInner: function( html ) {
  8198. if ( isFunction( html ) ) {
  8199. return this.each( function( i ) {
  8200. jQuery( this ).wrapInner( html.call( this, i ) );
  8201. } );
  8202. }
  8203.  
  8204. return this.each( function() {
  8205. var self = jQuery( this ),
  8206. contents = self.contents();
  8207.  
  8208. if ( contents.length ) {
  8209. contents.wrapAll( html );
  8210.  
  8211. } else {
  8212. self.append( html );
  8213. }
  8214. } );
  8215. },
  8216.  
  8217. wrap: function( html ) {
  8218. var htmlIsFunction = isFunction( html );
  8219.  
  8220. return this.each( function( i ) {
  8221. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  8222. } );
  8223. },
  8224.  
  8225. unwrap: function( selector ) {
  8226. this.parent( selector ).not( "body" ).each( function() {
  8227. jQuery( this ).replaceWith( this.childNodes );
  8228. } );
  8229. return this;
  8230. }
  8231. } );
  8232.  
  8233.  
  8234. jQuery.expr.pseudos.hidden = function( elem ) {
  8235. return !jQuery.expr.pseudos.visible( elem );
  8236. };
  8237. jQuery.expr.pseudos.visible = function( elem ) {
  8238. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  8239. };
  8240.  
  8241.  
  8242.  
  8243.  
  8244. // Support: Safari 8 only
  8245. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8246. // collapse sibling forms: the second one becomes a child of the first one.
  8247. // Because of that, this security measure has to be disabled in Safari 8.
  8248. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8249. support.createHTMLDocument = ( function() {
  8250. var body = document.implementation.createHTMLDocument( "" ).body;
  8251. body.innerHTML = "<form></form><form></form>";
  8252. return body.childNodes.length === 2;
  8253. } )();
  8254.  
  8255.  
  8256. // Argument "data" should be string of html
  8257. // context (optional): If specified, the fragment will be created in this context,
  8258. // defaults to document
  8259. // keepScripts (optional): If true, will include scripts passed in the html string
  8260. jQuery.parseHTML = function( data, context, keepScripts ) {
  8261. if ( typeof data !== "string" ) {
  8262. return [];
  8263. }
  8264. if ( typeof context === "boolean" ) {
  8265. keepScripts = context;
  8266. context = false;
  8267. }
  8268.  
  8269. var base, parsed, scripts;
  8270.  
  8271. if ( !context ) {
  8272.  
  8273. // Stop scripts or inline event handlers from being executed immediately
  8274. // by using document.implementation
  8275. if ( support.createHTMLDocument ) {
  8276. context = document.implementation.createHTMLDocument( "" );
  8277.  
  8278. // Set the base href for the created document
  8279. // so any parsed elements with URLs
  8280. // are based on the document's URL (gh-2965)
  8281. base = context.createElement( "base" );
  8282. base.href = document.location.href;
  8283. context.head.appendChild( base );
  8284. } else {
  8285. context = document;
  8286. }
  8287. }
  8288.  
  8289. parsed = rsingleTag.exec( data );
  8290. scripts = !keepScripts && [];
  8291.  
  8292. // Single tag
  8293. if ( parsed ) {
  8294. return [ context.createElement( parsed[ 1 ] ) ];
  8295. }
  8296.  
  8297. parsed = buildFragment( [ data ], context, scripts );
  8298.  
  8299. if ( scripts && scripts.length ) {
  8300. jQuery( scripts ).remove();
  8301. }
  8302.  
  8303. return jQuery.merge( [], parsed.childNodes );
  8304. };
  8305.  
  8306.  
  8307. jQuery.offset = {
  8308. setOffset: function( elem, options, i ) {
  8309. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8310. position = jQuery.css( elem, "position" ),
  8311. curElem = jQuery( elem ),
  8312. props = {};
  8313.  
  8314. // Set position first, in-case top/left are set even on static elem
  8315. if ( position === "static" ) {
  8316. elem.style.position = "relative";
  8317. }
  8318.  
  8319. curOffset = curElem.offset();
  8320. curCSSTop = jQuery.css( elem, "top" );
  8321. curCSSLeft = jQuery.css( elem, "left" );
  8322. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8323. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8324.  
  8325. // Need to be able to calculate position if either
  8326. // top or left is auto and position is either absolute or fixed
  8327. if ( calculatePosition ) {
  8328. curPosition = curElem.position();
  8329. curTop = curPosition.top;
  8330. curLeft = curPosition.left;
  8331.  
  8332. } else {
  8333. curTop = parseFloat( curCSSTop ) || 0;
  8334. curLeft = parseFloat( curCSSLeft ) || 0;
  8335. }
  8336.  
  8337. if ( isFunction( options ) ) {
  8338.  
  8339. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8340. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8341. }
  8342.  
  8343. if ( options.top != null ) {
  8344. props.top = ( options.top - curOffset.top ) + curTop;
  8345. }
  8346. if ( options.left != null ) {
  8347. props.left = ( options.left - curOffset.left ) + curLeft;
  8348. }
  8349.  
  8350. if ( "using" in options ) {
  8351. options.using.call( elem, props );
  8352.  
  8353. } else {
  8354. curElem.css( props );
  8355. }
  8356. }
  8357. };
  8358.  
  8359. jQuery.fn.extend( {
  8360.  
  8361. // offset() relates an element's border box to the document origin
  8362. offset: function( options ) {
  8363.  
  8364. // Preserve chaining for setter
  8365. if ( arguments.length ) {
  8366. return options === undefined ?
  8367. this :
  8368. this.each( function( i ) {
  8369. jQuery.offset.setOffset( this, options, i );
  8370. } );
  8371. }
  8372.  
  8373. var rect, win,
  8374. elem = this[ 0 ];
  8375.  
  8376. if ( !elem ) {
  8377. return;
  8378. }
  8379.  
  8380. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  8381. // Support: IE <=11 only
  8382. // Running getBoundingClientRect on a
  8383. // disconnected node in IE throws an error
  8384. if ( !elem.getClientRects().length ) {
  8385. return { top: 0, left: 0 };
  8386. }
  8387.  
  8388. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  8389. rect = elem.getBoundingClientRect();
  8390. win = elem.ownerDocument.defaultView;
  8391. return {
  8392. top: rect.top + win.pageYOffset,
  8393. left: rect.left + win.pageXOffset
  8394. };
  8395. },
  8396.  
  8397. // position() relates an element's margin box to its offset parent's padding box
  8398. // This corresponds to the behavior of CSS absolute positioning
  8399. position: function() {
  8400. if ( !this[ 0 ] ) {
  8401. return;
  8402. }
  8403.  
  8404. var offsetParent, offset, doc,
  8405. elem = this[ 0 ],
  8406. parentOffset = { top: 0, left: 0 };
  8407.  
  8408. // position:fixed elements are offset from the viewport, which itself always has zero offset
  8409. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8410.  
  8411. // Assume position:fixed implies availability of getBoundingClientRect
  8412. offset = elem.getBoundingClientRect();
  8413.  
  8414. } else {
  8415. offset = this.offset();
  8416.  
  8417. // Account for the *real* offset parent, which can be the document or its root element
  8418. // when a statically positioned element is identified
  8419. doc = elem.ownerDocument;
  8420. offsetParent = elem.offsetParent || doc.documentElement;
  8421. while ( offsetParent &&
  8422. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  8423. jQuery.css( offsetParent, "position" ) === "static" ) {
  8424.  
  8425. offsetParent = offsetParent.parentNode;
  8426. }
  8427. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  8428.  
  8429. // Incorporate borders into its offset, since they are outside its content origin
  8430. parentOffset = jQuery( offsetParent ).offset();
  8431. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  8432. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  8433. }
  8434. }
  8435.  
  8436. // Subtract parent offsets and element margins
  8437. return {
  8438. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8439. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8440. };
  8441. },
  8442.  
  8443. // This method will return documentElement in the following cases:
  8444. // 1) For the element inside the iframe without offsetParent, this method will return
  8445. // documentElement of the parent window
  8446. // 2) For the hidden or detached element
  8447. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8448. //
  8449. // but those exceptions were never presented as a real life use-cases
  8450. // and might be considered as more preferable results.
  8451. //
  8452. // This logic, however, is not guaranteed and can change at any point in the future
  8453. offsetParent: function() {
  8454. return this.map( function() {
  8455. var offsetParent = this.offsetParent;
  8456.  
  8457. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8458. offsetParent = offsetParent.offsetParent;
  8459. }
  8460.  
  8461. return offsetParent || documentElement;
  8462. } );
  8463. }
  8464. } );
  8465.  
  8466. // Create scrollLeft and scrollTop methods
  8467. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8468. var top = "pageYOffset" === prop;
  8469.  
  8470. jQuery.fn[ method ] = function( val ) {
  8471. return access( this, function( elem, method, val ) {
  8472.  
  8473. // Coalesce documents and windows
  8474. var win;
  8475. if ( isWindow( elem ) ) {
  8476. win = elem;
  8477. } else if ( elem.nodeType === 9 ) {
  8478. win = elem.defaultView;
  8479. }
  8480.  
  8481. if ( val === undefined ) {
  8482. return win ? win[ prop ] : elem[ method ];
  8483. }
  8484.  
  8485. if ( win ) {
  8486. win.scrollTo(
  8487. !top ? val : win.pageXOffset,
  8488. top ? val : win.pageYOffset
  8489. );
  8490.  
  8491. } else {
  8492. elem[ method ] = val;
  8493. }
  8494. }, method, val, arguments.length );
  8495. };
  8496. } );
  8497.  
  8498. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8499. // Add the top/left cssHooks using jQuery.fn.position
  8500. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8501. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8502. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8503. // rather than make the css module depend on the offset module, just check for it here
  8504. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  8505. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8506. function( elem, computed ) {
  8507. if ( computed ) {
  8508. computed = curCSS( elem, prop );
  8509.  
  8510. // If curCSS returns percentage, fallback to offset
  8511. return rnumnonpx.test( computed ) ?
  8512. jQuery( elem ).position()[ prop ] + "px" :
  8513. computed;
  8514. }
  8515. }
  8516. );
  8517. } );
  8518.  
  8519.  
  8520. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8521. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8522. jQuery.each( {
  8523. padding: "inner" + name,
  8524. content: type,
  8525. "": "outer" + name
  8526. }, function( defaultExtra, funcName ) {
  8527.  
  8528. // Margin is only for outerHeight, outerWidth
  8529. jQuery.fn[ funcName ] = function( margin, value ) {
  8530. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8531. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8532.  
  8533. return access( this, function( elem, type, value ) {
  8534. var doc;
  8535.  
  8536. if ( isWindow( elem ) ) {
  8537.  
  8538. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8539. return funcName.indexOf( "outer" ) === 0 ?
  8540. elem[ "inner" + name ] :
  8541. elem.document.documentElement[ "client" + name ];
  8542. }
  8543.  
  8544. // Get document width or height
  8545. if ( elem.nodeType === 9 ) {
  8546. doc = elem.documentElement;
  8547.  
  8548. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8549. // whichever is greatest
  8550. return Math.max(
  8551. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8552. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8553. doc[ "client" + name ]
  8554. );
  8555. }
  8556.  
  8557. return value === undefined ?
  8558.  
  8559. // Get width or height on the element, requesting but not forcing parseFloat
  8560. jQuery.css( elem, type, extra ) :
  8561.  
  8562. // Set width or height on the element
  8563. jQuery.style( elem, type, value, extra );
  8564. }, type, chainable ? margin : undefined, chainable );
  8565. };
  8566. } );
  8567. } );
  8568.  
  8569.  
  8570. jQuery.fn.extend( {
  8571.  
  8572. bind: function( types, data, fn ) {
  8573. return this.on( types, null, data, fn );
  8574. },
  8575. unbind: function( types, fn ) {
  8576. return this.off( types, null, fn );
  8577. },
  8578.  
  8579. delegate: function( selector, types, data, fn ) {
  8580. return this.on( types, selector, data, fn );
  8581. },
  8582. undelegate: function( selector, types, fn ) {
  8583.  
  8584. // ( namespace ) or ( selector, types [, fn] )
  8585. return arguments.length === 1 ?
  8586. this.off( selector, "**" ) :
  8587. this.off( types, selector || "**", fn );
  8588. },
  8589.  
  8590. hover: function( fnOver, fnOut ) {
  8591. return this
  8592. .on( "mouseenter", fnOver )
  8593. .on( "mouseleave", fnOut || fnOver );
  8594. }
  8595. } );
  8596.  
  8597. jQuery.each(
  8598. ( "blur focus focusin focusout resize scroll click dblclick " +
  8599. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8600. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  8601. function( _i, name ) {
  8602.  
  8603. // Handle event binding
  8604. jQuery.fn[ name ] = function( data, fn ) {
  8605. return arguments.length > 0 ?
  8606. this.on( name, null, data, fn ) :
  8607. this.trigger( name );
  8608. };
  8609. }
  8610. );
  8611.  
  8612.  
  8613.  
  8614.  
  8615. // Support: Android <=4.0 only
  8616. // Make sure we trim BOM and NBSP
  8617. // Require that the "whitespace run" starts from a non-whitespace
  8618. // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
  8619. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  8620.  
  8621. // Bind a function to a context, optionally partially applying any
  8622. // arguments.
  8623. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  8624. // However, it is not slated for removal any time soon
  8625. jQuery.proxy = function( fn, context ) {
  8626. var tmp, args, proxy;
  8627.  
  8628. if ( typeof context === "string" ) {
  8629. tmp = fn[ context ];
  8630. context = fn;
  8631. fn = tmp;
  8632. }
  8633.  
  8634. // Quick check to determine if target is callable, in the spec
  8635. // this throws a TypeError, but we will just return undefined.
  8636. if ( !isFunction( fn ) ) {
  8637. return undefined;
  8638. }
  8639.  
  8640. // Simulated bind
  8641. args = slice.call( arguments, 2 );
  8642. proxy = function() {
  8643. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  8644. };
  8645.  
  8646. // Set the guid of unique handler to the same of original handler, so it can be removed
  8647. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  8648.  
  8649. return proxy;
  8650. };
  8651.  
  8652. jQuery.holdReady = function( hold ) {
  8653. if ( hold ) {
  8654. jQuery.readyWait++;
  8655. } else {
  8656. jQuery.ready( true );
  8657. }
  8658. };
  8659. jQuery.isArray = Array.isArray;
  8660. jQuery.parseJSON = JSON.parse;
  8661. jQuery.nodeName = nodeName;
  8662. jQuery.isFunction = isFunction;
  8663. jQuery.isWindow = isWindow;
  8664. jQuery.camelCase = camelCase;
  8665. jQuery.type = toType;
  8666.  
  8667. jQuery.now = Date.now;
  8668.  
  8669. jQuery.isNumeric = function( obj ) {
  8670.  
  8671. // As of jQuery 3.0, isNumeric is limited to
  8672. // strings and numbers (primitives or objects)
  8673. // that can be coerced to finite numbers (gh-2662)
  8674. var type = jQuery.type( obj );
  8675. return ( type === "number" || type === "string" ) &&
  8676.  
  8677. // parseFloat NaNs numeric-cast false positives ("")
  8678. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  8679. // subtraction forces infinities to NaN
  8680. !isNaN( obj - parseFloat( obj ) );
  8681. };
  8682.  
  8683. jQuery.trim = function( text ) {
  8684. return text == null ?
  8685. "" :
  8686. ( text + "" ).replace( rtrim, "$1" );
  8687. };
  8688.  
  8689.  
  8690.  
  8691. // Register as a named AMD module, since jQuery can be concatenated with other
  8692. // files that may use define, but not via a proper concatenation script that
  8693. // understands anonymous AMD modules. A named AMD is safest and most robust
  8694. // way to register. Lowercase jquery is used because AMD module names are
  8695. // derived from file names, and jQuery is normally delivered in a lowercase
  8696. // file name. Do this after creating the global so that if an AMD module wants
  8697. // to call noConflict to hide this version of jQuery, it will work.
  8698.  
  8699. // Note that for maximum portability, libraries that are not jQuery should
  8700. // declare themselves as anonymous modules, and avoid setting a global if an
  8701. // AMD loader is present. jQuery is a special case. For more information, see
  8702. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8703.  
  8704. if ( true ) {
  8705. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  8706. return jQuery;
  8707. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  8708. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  8709. }
  8710.  
  8711.  
  8712.  
  8713.  
  8714. var
  8715.  
  8716. // Map over jQuery in case of overwrite
  8717. _jQuery = window.jQuery,
  8718.  
  8719. // Map over the $ in case of overwrite
  8720. _$ = window.$;
  8721.  
  8722. jQuery.noConflict = function( deep ) {
  8723. if ( window.$ === jQuery ) {
  8724. window.$ = _$;
  8725. }
  8726.  
  8727. if ( deep && window.jQuery === jQuery ) {
  8728. window.jQuery = _jQuery;
  8729. }
  8730.  
  8731. return jQuery;
  8732. };
  8733.  
  8734. // Expose jQuery and $ identifiers, even in AMD
  8735. // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8736. // and CommonJS for browser emulators (trac-13566)
  8737. if ( typeof noGlobal === "undefined" ) {
  8738. window.jQuery = window.$ = jQuery;
  8739. }
  8740.  
  8741.  
  8742.  
  8743.  
  8744. return jQuery;
  8745. } );
  8746.  
  8747.  
  8748. /***/ }),
  8749. /* 2 */
  8750. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  8751.  
  8752. "use strict";
  8753.  
  8754. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  8755. if (k2 === undefined) k2 = k;
  8756. var desc = Object.getOwnPropertyDescriptor(m, k);
  8757. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  8758. desc = { enumerable: true, get: function() { return m[k]; } };
  8759. }
  8760. Object.defineProperty(o, k2, desc);
  8761. }) : (function(o, m, k, k2) {
  8762. if (k2 === undefined) k2 = k;
  8763. o[k2] = m[k];
  8764. }));
  8765. var __exportStar = (this && this.__exportStar) || function(m, exports) {
  8766. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
  8767. };
  8768. Object.defineProperty(exports, "__esModule", ({ value: true }));
  8769. __exportStar(__webpack_require__(34), exports);
  8770. __exportStar(__webpack_require__(29), exports);
  8771. __exportStar(__webpack_require__(35), exports);
  8772. __exportStar(__webpack_require__(36), exports);
  8773. __exportStar(__webpack_require__(9), exports);
  8774. __exportStar(__webpack_require__(16), exports);
  8775. __exportStar(__webpack_require__(31), exports);
  8776. __exportStar(__webpack_require__(8), exports);
  8777. __exportStar(__webpack_require__(10), exports);
  8778. __exportStar(__webpack_require__(3), exports);
  8779. __exportStar(__webpack_require__(18), exports);
  8780. __exportStar(__webpack_require__(50), exports);
  8781. __exportStar(__webpack_require__(19), exports);
  8782.  
  8783.  
  8784. /***/ }),
  8785. /* 3 */
  8786. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  8787.  
  8788. "use strict";
  8789.  
  8790. var __importDefault = (this && this.__importDefault) || function (mod) {
  8791. return (mod && mod.__esModule) ? mod : { "default": mod };
  8792. };
  8793. Object.defineProperty(exports, "__esModule", ({ value: true }));
  8794. exports.HttpClient = void 0;
  8795. const axios_1 = __importDefault(__webpack_require__(4));
  8796. const axios_cache_interceptor_1 = __webpack_require__(32);
  8797. const storage = (0, axios_cache_interceptor_1.buildWebStorage)(window.sessionStorage, 'gs-');
  8798. class HttpClient {
  8799. constructor(baseURL) {
  8800. this._handleResponse = ({ data }) => data;
  8801. this._handleError = (error) => Promise.reject(error);
  8802. this.client = (0, axios_cache_interceptor_1.setupCache)(axios_1.default.create({ baseURL }), {
  8803. storage: storage,
  8804. generateKey: axios_cache_interceptor_1.defaultKeyGenerator,
  8805. headerInterpreter: axios_cache_interceptor_1.defaultHeaderInterpreter,
  8806. debug: (msg) => console.log(msg),
  8807. ttl: 1000 * 15,
  8808. cachePredicate: {
  8809. statusCheck: (status) => status >= 200 && status < 400,
  8810. },
  8811. });
  8812. this._initializeResponseInterceptor();
  8813. }
  8814. _initializeResponseInterceptor() {
  8815. this.client.interceptors.response.use(this._handleResponse, this._handleError);
  8816. }
  8817. }
  8818. exports.HttpClient = HttpClient;
  8819.  
  8820.  
  8821. /***/ }),
  8822. /* 4 */
  8823. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  8824.  
  8825. "use strict";
  8826. // Axios v1.6.0 Copyright (c) 2023 Matt Zabriskie and contributors
  8827.  
  8828.  
  8829. function bind(fn, thisArg) {
  8830. return function wrap() {
  8831. return fn.apply(thisArg, arguments);
  8832. };
  8833. }
  8834.  
  8835. // utils is a library of generic helper functions non-specific to axios
  8836.  
  8837. const {toString} = Object.prototype;
  8838. const {getPrototypeOf} = Object;
  8839.  
  8840. const kindOf = (cache => thing => {
  8841. const str = toString.call(thing);
  8842. return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
  8843. })(Object.create(null));
  8844.  
  8845. const kindOfTest = (type) => {
  8846. type = type.toLowerCase();
  8847. return (thing) => kindOf(thing) === type
  8848. };
  8849.  
  8850. const typeOfTest = type => thing => typeof thing === type;
  8851.  
  8852. /**
  8853. * Determine if a value is an Array
  8854. *
  8855. * @param {Object} val The value to test
  8856. *
  8857. * @returns {boolean} True if value is an Array, otherwise false
  8858. */
  8859. const {isArray} = Array;
  8860.  
  8861. /**
  8862. * Determine if a value is undefined
  8863. *
  8864. * @param {*} val The value to test
  8865. *
  8866. * @returns {boolean} True if the value is undefined, otherwise false
  8867. */
  8868. const isUndefined = typeOfTest('undefined');
  8869.  
  8870. /**
  8871. * Determine if a value is a Buffer
  8872. *
  8873. * @param {*} val The value to test
  8874. *
  8875. * @returns {boolean} True if value is a Buffer, otherwise false
  8876. */
  8877. function isBuffer(val) {
  8878. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  8879. && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
  8880. }
  8881.  
  8882. /**
  8883. * Determine if a value is an ArrayBuffer
  8884. *
  8885. * @param {*} val The value to test
  8886. *
  8887. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  8888. */
  8889. const isArrayBuffer = kindOfTest('ArrayBuffer');
  8890.  
  8891.  
  8892. /**
  8893. * Determine if a value is a view on an ArrayBuffer
  8894. *
  8895. * @param {*} val The value to test
  8896. *
  8897. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  8898. */
  8899. function isArrayBufferView(val) {
  8900. let result;
  8901. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  8902. result = ArrayBuffer.isView(val);
  8903. } else {
  8904. result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
  8905. }
  8906. return result;
  8907. }
  8908.  
  8909. /**
  8910. * Determine if a value is a String
  8911. *
  8912. * @param {*} val The value to test
  8913. *
  8914. * @returns {boolean} True if value is a String, otherwise false
  8915. */
  8916. const isString = typeOfTest('string');
  8917.  
  8918. /**
  8919. * Determine if a value is a Function
  8920. *
  8921. * @param {*} val The value to test
  8922. * @returns {boolean} True if value is a Function, otherwise false
  8923. */
  8924. const isFunction = typeOfTest('function');
  8925.  
  8926. /**
  8927. * Determine if a value is a Number
  8928. *
  8929. * @param {*} val The value to test
  8930. *
  8931. * @returns {boolean} True if value is a Number, otherwise false
  8932. */
  8933. const isNumber = typeOfTest('number');
  8934.  
  8935. /**
  8936. * Determine if a value is an Object
  8937. *
  8938. * @param {*} thing The value to test
  8939. *
  8940. * @returns {boolean} True if value is an Object, otherwise false
  8941. */
  8942. const isObject = (thing) => thing !== null && typeof thing === 'object';
  8943.  
  8944. /**
  8945. * Determine if a value is a Boolean
  8946. *
  8947. * @param {*} thing The value to test
  8948. * @returns {boolean} True if value is a Boolean, otherwise false
  8949. */
  8950. const isBoolean = thing => thing === true || thing === false;
  8951.  
  8952. /**
  8953. * Determine if a value is a plain Object
  8954. *
  8955. * @param {*} val The value to test
  8956. *
  8957. * @returns {boolean} True if value is a plain Object, otherwise false
  8958. */
  8959. const isPlainObject = (val) => {
  8960. if (kindOf(val) !== 'object') {
  8961. return false;
  8962. }
  8963.  
  8964. const prototype = getPrototypeOf(val);
  8965. return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
  8966. };
  8967.  
  8968. /**
  8969. * Determine if a value is a Date
  8970. *
  8971. * @param {*} val The value to test
  8972. *
  8973. * @returns {boolean} True if value is a Date, otherwise false
  8974. */
  8975. const isDate = kindOfTest('Date');
  8976.  
  8977. /**
  8978. * Determine if a value is a File
  8979. *
  8980. * @param {*} val The value to test
  8981. *
  8982. * @returns {boolean} True if value is a File, otherwise false
  8983. */
  8984. const isFile = kindOfTest('File');
  8985.  
  8986. /**
  8987. * Determine if a value is a Blob
  8988. *
  8989. * @param {*} val The value to test
  8990. *
  8991. * @returns {boolean} True if value is a Blob, otherwise false
  8992. */
  8993. const isBlob = kindOfTest('Blob');
  8994.  
  8995. /**
  8996. * Determine if a value is a FileList
  8997. *
  8998. * @param {*} val The value to test
  8999. *
  9000. * @returns {boolean} True if value is a File, otherwise false
  9001. */
  9002. const isFileList = kindOfTest('FileList');
  9003.  
  9004. /**
  9005. * Determine if a value is a Stream
  9006. *
  9007. * @param {*} val The value to test
  9008. *
  9009. * @returns {boolean} True if value is a Stream, otherwise false
  9010. */
  9011. const isStream = (val) => isObject(val) && isFunction(val.pipe);
  9012.  
  9013. /**
  9014. * Determine if a value is a FormData
  9015. *
  9016. * @param {*} thing The value to test
  9017. *
  9018. * @returns {boolean} True if value is an FormData, otherwise false
  9019. */
  9020. const isFormData = (thing) => {
  9021. let kind;
  9022. return thing && (
  9023. (typeof FormData === 'function' && thing instanceof FormData) || (
  9024. isFunction(thing.append) && (
  9025. (kind = kindOf(thing)) === 'formdata' ||
  9026. // detect form-data instance
  9027. (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
  9028. )
  9029. )
  9030. )
  9031. };
  9032.  
  9033. /**
  9034. * Determine if a value is a URLSearchParams object
  9035. *
  9036. * @param {*} val The value to test
  9037. *
  9038. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  9039. */
  9040. const isURLSearchParams = kindOfTest('URLSearchParams');
  9041.  
  9042. /**
  9043. * Trim excess whitespace off the beginning and end of a string
  9044. *
  9045. * @param {String} str The String to trim
  9046. *
  9047. * @returns {String} The String freed of excess whitespace
  9048. */
  9049. const trim = (str) => str.trim ?
  9050. str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
  9051.  
  9052. /**
  9053. * Iterate over an Array or an Object invoking a function for each item.
  9054. *
  9055. * If `obj` is an Array callback will be called passing
  9056. * the value, index, and complete array for each item.
  9057. *
  9058. * If 'obj' is an Object callback will be called passing
  9059. * the value, key, and complete object for each property.
  9060. *
  9061. * @param {Object|Array} obj The object to iterate
  9062. * @param {Function} fn The callback to invoke for each item
  9063. *
  9064. * @param {Boolean} [allOwnKeys = false]
  9065. * @returns {any}
  9066. */
  9067. function forEach(obj, fn, {allOwnKeys = false} = {}) {
  9068. // Don't bother if no value provided
  9069. if (obj === null || typeof obj === 'undefined') {
  9070. return;
  9071. }
  9072.  
  9073. let i;
  9074. let l;
  9075.  
  9076. // Force an array if not already something iterable
  9077. if (typeof obj !== 'object') {
  9078. /*eslint no-param-reassign:0*/
  9079. obj = [obj];
  9080. }
  9081.  
  9082. if (isArray(obj)) {
  9083. // Iterate over array values
  9084. for (i = 0, l = obj.length; i < l; i++) {
  9085. fn.call(null, obj[i], i, obj);
  9086. }
  9087. } else {
  9088. // Iterate over object keys
  9089. const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
  9090. const len = keys.length;
  9091. let key;
  9092.  
  9093. for (i = 0; i < len; i++) {
  9094. key = keys[i];
  9095. fn.call(null, obj[key], key, obj);
  9096. }
  9097. }
  9098. }
  9099.  
  9100. function findKey(obj, key) {
  9101. key = key.toLowerCase();
  9102. const keys = Object.keys(obj);
  9103. let i = keys.length;
  9104. let _key;
  9105. while (i-- > 0) {
  9106. _key = keys[i];
  9107. if (key === _key.toLowerCase()) {
  9108. return _key;
  9109. }
  9110. }
  9111. return null;
  9112. }
  9113.  
  9114. const _global = (() => {
  9115. /*eslint no-undef:0*/
  9116. if (typeof globalThis !== "undefined") return globalThis;
  9117. return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g)
  9118. })();
  9119.  
  9120. const isContextDefined = (context) => !isUndefined(context) && context !== _global;
  9121.  
  9122. /**
  9123. * Accepts varargs expecting each argument to be an object, then
  9124. * immutably merges the properties of each object and returns result.
  9125. *
  9126. * When multiple objects contain the same key the later object in
  9127. * the arguments list will take precedence.
  9128. *
  9129. * Example:
  9130. *
  9131. * ```js
  9132. * var result = merge({foo: 123}, {foo: 456});
  9133. * console.log(result.foo); // outputs 456
  9134. * ```
  9135. *
  9136. * @param {Object} obj1 Object to merge
  9137. *
  9138. * @returns {Object} Result of all merge properties
  9139. */
  9140. function merge(/* obj1, obj2, obj3, ... */) {
  9141. const {caseless} = isContextDefined(this) && this || {};
  9142. const result = {};
  9143. const assignValue = (val, key) => {
  9144. const targetKey = caseless && findKey(result, key) || key;
  9145. if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
  9146. result[targetKey] = merge(result[targetKey], val);
  9147. } else if (isPlainObject(val)) {
  9148. result[targetKey] = merge({}, val);
  9149. } else if (isArray(val)) {
  9150. result[targetKey] = val.slice();
  9151. } else {
  9152. result[targetKey] = val;
  9153. }
  9154. };
  9155.  
  9156. for (let i = 0, l = arguments.length; i < l; i++) {
  9157. arguments[i] && forEach(arguments[i], assignValue);
  9158. }
  9159. return result;
  9160. }
  9161.  
  9162. /**
  9163. * Extends object a by mutably adding to it the properties of object b.
  9164. *
  9165. * @param {Object} a The object to be extended
  9166. * @param {Object} b The object to copy properties from
  9167. * @param {Object} thisArg The object to bind function to
  9168. *
  9169. * @param {Boolean} [allOwnKeys]
  9170. * @returns {Object} The resulting value of object a
  9171. */
  9172. const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
  9173. forEach(b, (val, key) => {
  9174. if (thisArg && isFunction(val)) {
  9175. a[key] = bind(val, thisArg);
  9176. } else {
  9177. a[key] = val;
  9178. }
  9179. }, {allOwnKeys});
  9180. return a;
  9181. };
  9182.  
  9183. /**
  9184. * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
  9185. *
  9186. * @param {string} content with BOM
  9187. *
  9188. * @returns {string} content value without BOM
  9189. */
  9190. const stripBOM = (content) => {
  9191. if (content.charCodeAt(0) === 0xFEFF) {
  9192. content = content.slice(1);
  9193. }
  9194. return content;
  9195. };
  9196.  
  9197. /**
  9198. * Inherit the prototype methods from one constructor into another
  9199. * @param {function} constructor
  9200. * @param {function} superConstructor
  9201. * @param {object} [props]
  9202. * @param {object} [descriptors]
  9203. *
  9204. * @returns {void}
  9205. */
  9206. const inherits = (constructor, superConstructor, props, descriptors) => {
  9207. constructor.prototype = Object.create(superConstructor.prototype, descriptors);
  9208. constructor.prototype.constructor = constructor;
  9209. Object.defineProperty(constructor, 'super', {
  9210. value: superConstructor.prototype
  9211. });
  9212. props && Object.assign(constructor.prototype, props);
  9213. };
  9214.  
  9215. /**
  9216. * Resolve object with deep prototype chain to a flat object
  9217. * @param {Object} sourceObj source object
  9218. * @param {Object} [destObj]
  9219. * @param {Function|Boolean} [filter]
  9220. * @param {Function} [propFilter]
  9221. *
  9222. * @returns {Object}
  9223. */
  9224. const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
  9225. let props;
  9226. let i;
  9227. let prop;
  9228. const merged = {};
  9229.  
  9230. destObj = destObj || {};
  9231. // eslint-disable-next-line no-eq-null,eqeqeq
  9232. if (sourceObj == null) return destObj;
  9233.  
  9234. do {
  9235. props = Object.getOwnPropertyNames(sourceObj);
  9236. i = props.length;
  9237. while (i-- > 0) {
  9238. prop = props[i];
  9239. if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
  9240. destObj[prop] = sourceObj[prop];
  9241. merged[prop] = true;
  9242. }
  9243. }
  9244. sourceObj = filter !== false && getPrototypeOf(sourceObj);
  9245. } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
  9246.  
  9247. return destObj;
  9248. };
  9249.  
  9250. /**
  9251. * Determines whether a string ends with the characters of a specified string
  9252. *
  9253. * @param {String} str
  9254. * @param {String} searchString
  9255. * @param {Number} [position= 0]
  9256. *
  9257. * @returns {boolean}
  9258. */
  9259. const endsWith = (str, searchString, position) => {
  9260. str = String(str);
  9261. if (position === undefined || position > str.length) {
  9262. position = str.length;
  9263. }
  9264. position -= searchString.length;
  9265. const lastIndex = str.indexOf(searchString, position);
  9266. return lastIndex !== -1 && lastIndex === position;
  9267. };
  9268.  
  9269.  
  9270. /**
  9271. * Returns new array from array like object or null if failed
  9272. *
  9273. * @param {*} [thing]
  9274. *
  9275. * @returns {?Array}
  9276. */
  9277. const toArray = (thing) => {
  9278. if (!thing) return null;
  9279. if (isArray(thing)) return thing;
  9280. let i = thing.length;
  9281. if (!isNumber(i)) return null;
  9282. const arr = new Array(i);
  9283. while (i-- > 0) {
  9284. arr[i] = thing[i];
  9285. }
  9286. return arr;
  9287. };
  9288.  
  9289. /**
  9290. * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
  9291. * thing passed in is an instance of Uint8Array
  9292. *
  9293. * @param {TypedArray}
  9294. *
  9295. * @returns {Array}
  9296. */
  9297. // eslint-disable-next-line func-names
  9298. const isTypedArray = (TypedArray => {
  9299. // eslint-disable-next-line func-names
  9300. return thing => {
  9301. return TypedArray && thing instanceof TypedArray;
  9302. };
  9303. })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
  9304.  
  9305. /**
  9306. * For each entry in the object, call the function with the key and value.
  9307. *
  9308. * @param {Object<any, any>} obj - The object to iterate over.
  9309. * @param {Function} fn - The function to call for each entry.
  9310. *
  9311. * @returns {void}
  9312. */
  9313. const forEachEntry = (obj, fn) => {
  9314. const generator = obj && obj[Symbol.iterator];
  9315.  
  9316. const iterator = generator.call(obj);
  9317.  
  9318. let result;
  9319.  
  9320. while ((result = iterator.next()) && !result.done) {
  9321. const pair = result.value;
  9322. fn.call(obj, pair[0], pair[1]);
  9323. }
  9324. };
  9325.  
  9326. /**
  9327. * It takes a regular expression and a string, and returns an array of all the matches
  9328. *
  9329. * @param {string} regExp - The regular expression to match against.
  9330. * @param {string} str - The string to search.
  9331. *
  9332. * @returns {Array<boolean>}
  9333. */
  9334. const matchAll = (regExp, str) => {
  9335. let matches;
  9336. const arr = [];
  9337.  
  9338. while ((matches = regExp.exec(str)) !== null) {
  9339. arr.push(matches);
  9340. }
  9341.  
  9342. return arr;
  9343. };
  9344.  
  9345. /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
  9346. const isHTMLForm = kindOfTest('HTMLFormElement');
  9347.  
  9348. const toCamelCase = str => {
  9349. return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
  9350. function replacer(m, p1, p2) {
  9351. return p1.toUpperCase() + p2;
  9352. }
  9353. );
  9354. };
  9355.  
  9356. /* Creating a function that will check if an object has a property. */
  9357. const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
  9358.  
  9359. /**
  9360. * Determine if a value is a RegExp object
  9361. *
  9362. * @param {*} val The value to test
  9363. *
  9364. * @returns {boolean} True if value is a RegExp object, otherwise false
  9365. */
  9366. const isRegExp = kindOfTest('RegExp');
  9367.  
  9368. const reduceDescriptors = (obj, reducer) => {
  9369. const descriptors = Object.getOwnPropertyDescriptors(obj);
  9370. const reducedDescriptors = {};
  9371.  
  9372. forEach(descriptors, (descriptor, name) => {
  9373. let ret;
  9374. if ((ret = reducer(descriptor, name, obj)) !== false) {
  9375. reducedDescriptors[name] = ret || descriptor;
  9376. }
  9377. });
  9378.  
  9379. Object.defineProperties(obj, reducedDescriptors);
  9380. };
  9381.  
  9382. /**
  9383. * Makes all methods read-only
  9384. * @param {Object} obj
  9385. */
  9386.  
  9387. const freezeMethods = (obj) => {
  9388. reduceDescriptors(obj, (descriptor, name) => {
  9389. // skip restricted props in strict mode
  9390. if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
  9391. return false;
  9392. }
  9393.  
  9394. const value = obj[name];
  9395.  
  9396. if (!isFunction(value)) return;
  9397.  
  9398. descriptor.enumerable = false;
  9399.  
  9400. if ('writable' in descriptor) {
  9401. descriptor.writable = false;
  9402. return;
  9403. }
  9404.  
  9405. if (!descriptor.set) {
  9406. descriptor.set = () => {
  9407. throw Error('Can not rewrite read-only method \'' + name + '\'');
  9408. };
  9409. }
  9410. });
  9411. };
  9412.  
  9413. const toObjectSet = (arrayOrString, delimiter) => {
  9414. const obj = {};
  9415.  
  9416. const define = (arr) => {
  9417. arr.forEach(value => {
  9418. obj[value] = true;
  9419. });
  9420. };
  9421.  
  9422. isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  9423.  
  9424. return obj;
  9425. };
  9426.  
  9427. const noop = () => {};
  9428.  
  9429. const toFiniteNumber = (value, defaultValue) => {
  9430. value = +value;
  9431. return Number.isFinite(value) ? value : defaultValue;
  9432. };
  9433.  
  9434. const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
  9435.  
  9436. const DIGIT = '0123456789';
  9437.  
  9438. const ALPHABET = {
  9439. DIGIT,
  9440. ALPHA,
  9441. ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
  9442. };
  9443.  
  9444. const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
  9445. let str = '';
  9446. const {length} = alphabet;
  9447. while (size--) {
  9448. str += alphabet[Math.random() * length|0];
  9449. }
  9450.  
  9451. return str;
  9452. };
  9453.  
  9454. /**
  9455. * If the thing is a FormData object, return true, otherwise return false.
  9456. *
  9457. * @param {unknown} thing - The thing to check.
  9458. *
  9459. * @returns {boolean}
  9460. */
  9461. function isSpecCompliantForm(thing) {
  9462. return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
  9463. }
  9464.  
  9465. const toJSONObject = (obj) => {
  9466. const stack = new Array(10);
  9467.  
  9468. const visit = (source, i) => {
  9469.  
  9470. if (isObject(source)) {
  9471. if (stack.indexOf(source) >= 0) {
  9472. return;
  9473. }
  9474.  
  9475. if(!('toJSON' in source)) {
  9476. stack[i] = source;
  9477. const target = isArray(source) ? [] : {};
  9478.  
  9479. forEach(source, (value, key) => {
  9480. const reducedValue = visit(value, i + 1);
  9481. !isUndefined(reducedValue) && (target[key] = reducedValue);
  9482. });
  9483.  
  9484. stack[i] = undefined;
  9485.  
  9486. return target;
  9487. }
  9488. }
  9489.  
  9490. return source;
  9491. };
  9492.  
  9493. return visit(obj, 0);
  9494. };
  9495.  
  9496. const isAsyncFn = kindOfTest('AsyncFunction');
  9497.  
  9498. const isThenable = (thing) =>
  9499. thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
  9500.  
  9501. var utils = {
  9502. isArray,
  9503. isArrayBuffer,
  9504. isBuffer,
  9505. isFormData,
  9506. isArrayBufferView,
  9507. isString,
  9508. isNumber,
  9509. isBoolean,
  9510. isObject,
  9511. isPlainObject,
  9512. isUndefined,
  9513. isDate,
  9514. isFile,
  9515. isBlob,
  9516. isRegExp,
  9517. isFunction,
  9518. isStream,
  9519. isURLSearchParams,
  9520. isTypedArray,
  9521. isFileList,
  9522. forEach,
  9523. merge,
  9524. extend,
  9525. trim,
  9526. stripBOM,
  9527. inherits,
  9528. toFlatObject,
  9529. kindOf,
  9530. kindOfTest,
  9531. endsWith,
  9532. toArray,
  9533. forEachEntry,
  9534. matchAll,
  9535. isHTMLForm,
  9536. hasOwnProperty,
  9537. hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
  9538. reduceDescriptors,
  9539. freezeMethods,
  9540. toObjectSet,
  9541. toCamelCase,
  9542. noop,
  9543. toFiniteNumber,
  9544. findKey,
  9545. global: _global,
  9546. isContextDefined,
  9547. ALPHABET,
  9548. generateString,
  9549. isSpecCompliantForm,
  9550. toJSONObject,
  9551. isAsyncFn,
  9552. isThenable
  9553. };
  9554.  
  9555. /**
  9556. * Create an Error with the specified message, config, error code, request and response.
  9557. *
  9558. * @param {string} message The error message.
  9559. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  9560. * @param {Object} [config] The config.
  9561. * @param {Object} [request] The request.
  9562. * @param {Object} [response] The response.
  9563. *
  9564. * @returns {Error} The created error.
  9565. */
  9566. function AxiosError(message, code, config, request, response) {
  9567. Error.call(this);
  9568.  
  9569. if (Error.captureStackTrace) {
  9570. Error.captureStackTrace(this, this.constructor);
  9571. } else {
  9572. this.stack = (new Error()).stack;
  9573. }
  9574.  
  9575. this.message = message;
  9576. this.name = 'AxiosError';
  9577. code && (this.code = code);
  9578. config && (this.config = config);
  9579. request && (this.request = request);
  9580. response && (this.response = response);
  9581. }
  9582.  
  9583. utils.inherits(AxiosError, Error, {
  9584. toJSON: function toJSON() {
  9585. return {
  9586. // Standard
  9587. message: this.message,
  9588. name: this.name,
  9589. // Microsoft
  9590. description: this.description,
  9591. number: this.number,
  9592. // Mozilla
  9593. fileName: this.fileName,
  9594. lineNumber: this.lineNumber,
  9595. columnNumber: this.columnNumber,
  9596. stack: this.stack,
  9597. // Axios
  9598. config: utils.toJSONObject(this.config),
  9599. code: this.code,
  9600. status: this.response && this.response.status ? this.response.status : null
  9601. };
  9602. }
  9603. });
  9604.  
  9605. const prototype$1 = AxiosError.prototype;
  9606. const descriptors = {};
  9607.  
  9608. [
  9609. 'ERR_BAD_OPTION_VALUE',
  9610. 'ERR_BAD_OPTION',
  9611. 'ECONNABORTED',
  9612. 'ETIMEDOUT',
  9613. 'ERR_NETWORK',
  9614. 'ERR_FR_TOO_MANY_REDIRECTS',
  9615. 'ERR_DEPRECATED',
  9616. 'ERR_BAD_RESPONSE',
  9617. 'ERR_BAD_REQUEST',
  9618. 'ERR_CANCELED',
  9619. 'ERR_NOT_SUPPORT',
  9620. 'ERR_INVALID_URL'
  9621. // eslint-disable-next-line func-names
  9622. ].forEach(code => {
  9623. descriptors[code] = {value: code};
  9624. });
  9625.  
  9626. Object.defineProperties(AxiosError, descriptors);
  9627. Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
  9628.  
  9629. // eslint-disable-next-line func-names
  9630. AxiosError.from = (error, code, config, request, response, customProps) => {
  9631. const axiosError = Object.create(prototype$1);
  9632.  
  9633. utils.toFlatObject(error, axiosError, function filter(obj) {
  9634. return obj !== Error.prototype;
  9635. }, prop => {
  9636. return prop !== 'isAxiosError';
  9637. });
  9638.  
  9639. AxiosError.call(axiosError, error.message, code, config, request, response);
  9640.  
  9641. axiosError.cause = error;
  9642.  
  9643. axiosError.name = error.name;
  9644.  
  9645. customProps && Object.assign(axiosError, customProps);
  9646.  
  9647. return axiosError;
  9648. };
  9649.  
  9650. // eslint-disable-next-line strict
  9651. var httpAdapter = null;
  9652.  
  9653. /**
  9654. * Determines if the given thing is a array or js object.
  9655. *
  9656. * @param {string} thing - The object or array to be visited.
  9657. *
  9658. * @returns {boolean}
  9659. */
  9660. function isVisitable(thing) {
  9661. return utils.isPlainObject(thing) || utils.isArray(thing);
  9662. }
  9663.  
  9664. /**
  9665. * It removes the brackets from the end of a string
  9666. *
  9667. * @param {string} key - The key of the parameter.
  9668. *
  9669. * @returns {string} the key without the brackets.
  9670. */
  9671. function removeBrackets(key) {
  9672. return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
  9673. }
  9674.  
  9675. /**
  9676. * It takes a path, a key, and a boolean, and returns a string
  9677. *
  9678. * @param {string} path - The path to the current key.
  9679. * @param {string} key - The key of the current object being iterated over.
  9680. * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
  9681. *
  9682. * @returns {string} The path to the current key.
  9683. */
  9684. function renderKey(path, key, dots) {
  9685. if (!path) return key;
  9686. return path.concat(key).map(function each(token, i) {
  9687. // eslint-disable-next-line no-param-reassign
  9688. token = removeBrackets(token);
  9689. return !dots && i ? '[' + token + ']' : token;
  9690. }).join(dots ? '.' : '');
  9691. }
  9692.  
  9693. /**
  9694. * If the array is an array and none of its elements are visitable, then it's a flat array.
  9695. *
  9696. * @param {Array<any>} arr - The array to check
  9697. *
  9698. * @returns {boolean}
  9699. */
  9700. function isFlatArray(arr) {
  9701. return utils.isArray(arr) && !arr.some(isVisitable);
  9702. }
  9703.  
  9704. const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
  9705. return /^is[A-Z]/.test(prop);
  9706. });
  9707.  
  9708. /**
  9709. * Convert a data object to FormData
  9710. *
  9711. * @param {Object} obj
  9712. * @param {?Object} [formData]
  9713. * @param {?Object} [options]
  9714. * @param {Function} [options.visitor]
  9715. * @param {Boolean} [options.metaTokens = true]
  9716. * @param {Boolean} [options.dots = false]
  9717. * @param {?Boolean} [options.indexes = false]
  9718. *
  9719. * @returns {Object}
  9720. **/
  9721.  
  9722. /**
  9723. * It converts an object into a FormData object
  9724. *
  9725. * @param {Object<any, any>} obj - The object to convert to form data.
  9726. * @param {string} formData - The FormData object to append to.
  9727. * @param {Object<string, any>} options
  9728. *
  9729. * @returns
  9730. */
  9731. function toFormData(obj, formData, options) {
  9732. if (!utils.isObject(obj)) {
  9733. throw new TypeError('target must be an object');
  9734. }
  9735.  
  9736. // eslint-disable-next-line no-param-reassign
  9737. formData = formData || new (FormData)();
  9738.  
  9739. // eslint-disable-next-line no-param-reassign
  9740. options = utils.toFlatObject(options, {
  9741. metaTokens: true,
  9742. dots: false,
  9743. indexes: false
  9744. }, false, function defined(option, source) {
  9745. // eslint-disable-next-line no-eq-null,eqeqeq
  9746. return !utils.isUndefined(source[option]);
  9747. });
  9748.  
  9749. const metaTokens = options.metaTokens;
  9750. // eslint-disable-next-line no-use-before-define
  9751. const visitor = options.visitor || defaultVisitor;
  9752. const dots = options.dots;
  9753. const indexes = options.indexes;
  9754. const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
  9755. const useBlob = _Blob && utils.isSpecCompliantForm(formData);
  9756.  
  9757. if (!utils.isFunction(visitor)) {
  9758. throw new TypeError('visitor must be a function');
  9759. }
  9760.  
  9761. function convertValue(value) {
  9762. if (value === null) return '';
  9763.  
  9764. if (utils.isDate(value)) {
  9765. return value.toISOString();
  9766. }
  9767.  
  9768. if (!useBlob && utils.isBlob(value)) {
  9769. throw new AxiosError('Blob is not supported. Use a Buffer instead.');
  9770. }
  9771.  
  9772. if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
  9773. return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
  9774. }
  9775.  
  9776. return value;
  9777. }
  9778.  
  9779. /**
  9780. * Default visitor.
  9781. *
  9782. * @param {*} value
  9783. * @param {String|Number} key
  9784. * @param {Array<String|Number>} path
  9785. * @this {FormData}
  9786. *
  9787. * @returns {boolean} return true to visit the each prop of the value recursively
  9788. */
  9789. function defaultVisitor(value, key, path) {
  9790. let arr = value;
  9791.  
  9792. if (value && !path && typeof value === 'object') {
  9793. if (utils.endsWith(key, '{}')) {
  9794. // eslint-disable-next-line no-param-reassign
  9795. key = metaTokens ? key : key.slice(0, -2);
  9796. // eslint-disable-next-line no-param-reassign
  9797. value = JSON.stringify(value);
  9798. } else if (
  9799. (utils.isArray(value) && isFlatArray(value)) ||
  9800. ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
  9801. )) {
  9802. // eslint-disable-next-line no-param-reassign
  9803. key = removeBrackets(key);
  9804.  
  9805. arr.forEach(function each(el, index) {
  9806. !(utils.isUndefined(el) || el === null) && formData.append(
  9807. // eslint-disable-next-line no-nested-ternary
  9808. indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
  9809. convertValue(el)
  9810. );
  9811. });
  9812. return false;
  9813. }
  9814. }
  9815.  
  9816. if (isVisitable(value)) {
  9817. return true;
  9818. }
  9819.  
  9820. formData.append(renderKey(path, key, dots), convertValue(value));
  9821.  
  9822. return false;
  9823. }
  9824.  
  9825. const stack = [];
  9826.  
  9827. const exposedHelpers = Object.assign(predicates, {
  9828. defaultVisitor,
  9829. convertValue,
  9830. isVisitable
  9831. });
  9832.  
  9833. function build(value, path) {
  9834. if (utils.isUndefined(value)) return;
  9835.  
  9836. if (stack.indexOf(value) !== -1) {
  9837. throw Error('Circular reference detected in ' + path.join('.'));
  9838. }
  9839.  
  9840. stack.push(value);
  9841.  
  9842. utils.forEach(value, function each(el, key) {
  9843. const result = !(utils.isUndefined(el) || el === null) && visitor.call(
  9844. formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
  9845. );
  9846.  
  9847. if (result === true) {
  9848. build(el, path ? path.concat(key) : [key]);
  9849. }
  9850. });
  9851.  
  9852. stack.pop();
  9853. }
  9854.  
  9855. if (!utils.isObject(obj)) {
  9856. throw new TypeError('data must be an object');
  9857. }
  9858.  
  9859. build(obj);
  9860.  
  9861. return formData;
  9862. }
  9863.  
  9864. /**
  9865. * It encodes a string by replacing all characters that are not in the unreserved set with
  9866. * their percent-encoded equivalents
  9867. *
  9868. * @param {string} str - The string to encode.
  9869. *
  9870. * @returns {string} The encoded string.
  9871. */
  9872. function encode$1(str) {
  9873. const charMap = {
  9874. '!': '%21',
  9875. "'": '%27',
  9876. '(': '%28',
  9877. ')': '%29',
  9878. '~': '%7E',
  9879. '%20': '+',
  9880. '%00': '\x00'
  9881. };
  9882. return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
  9883. return charMap[match];
  9884. });
  9885. }
  9886.  
  9887. /**
  9888. * It takes a params object and converts it to a FormData object
  9889. *
  9890. * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
  9891. * @param {Object<string, any>} options - The options object passed to the Axios constructor.
  9892. *
  9893. * @returns {void}
  9894. */
  9895. function AxiosURLSearchParams(params, options) {
  9896. this._pairs = [];
  9897.  
  9898. params && toFormData(params, this, options);
  9899. }
  9900.  
  9901. const prototype = AxiosURLSearchParams.prototype;
  9902.  
  9903. prototype.append = function append(name, value) {
  9904. this._pairs.push([name, value]);
  9905. };
  9906.  
  9907. prototype.toString = function toString(encoder) {
  9908. const _encode = encoder ? function(value) {
  9909. return encoder.call(this, value, encode$1);
  9910. } : encode$1;
  9911.  
  9912. return this._pairs.map(function each(pair) {
  9913. return _encode(pair[0]) + '=' + _encode(pair[1]);
  9914. }, '').join('&');
  9915. };
  9916.  
  9917. /**
  9918. * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
  9919. * URI encoded counterparts
  9920. *
  9921. * @param {string} val The value to be encoded.
  9922. *
  9923. * @returns {string} The encoded value.
  9924. */
  9925. function encode(val) {
  9926. return encodeURIComponent(val).
  9927. replace(/%3A/gi, ':').
  9928. replace(/%24/g, '$').
  9929. replace(/%2C/gi, ',').
  9930. replace(/%20/g, '+').
  9931. replace(/%5B/gi, '[').
  9932. replace(/%5D/gi, ']');
  9933. }
  9934.  
  9935. /**
  9936. * Build a URL by appending params to the end
  9937. *
  9938. * @param {string} url The base of the url (e.g., http://www.google.com)
  9939. * @param {object} [params] The params to be appended
  9940. * @param {?object} options
  9941. *
  9942. * @returns {string} The formatted url
  9943. */
  9944. function buildURL(url, params, options) {
  9945. /*eslint no-param-reassign:0*/
  9946. if (!params) {
  9947. return url;
  9948. }
  9949. const _encode = options && options.encode || encode;
  9950.  
  9951. const serializeFn = options && options.serialize;
  9952.  
  9953. let serializedParams;
  9954.  
  9955. if (serializeFn) {
  9956. serializedParams = serializeFn(params, options);
  9957. } else {
  9958. serializedParams = utils.isURLSearchParams(params) ?
  9959. params.toString() :
  9960. new AxiosURLSearchParams(params, options).toString(_encode);
  9961. }
  9962.  
  9963. if (serializedParams) {
  9964. const hashmarkIndex = url.indexOf("#");
  9965.  
  9966. if (hashmarkIndex !== -1) {
  9967. url = url.slice(0, hashmarkIndex);
  9968. }
  9969. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  9970. }
  9971.  
  9972. return url;
  9973. }
  9974.  
  9975. class InterceptorManager {
  9976. constructor() {
  9977. this.handlers = [];
  9978. }
  9979.  
  9980. /**
  9981. * Add a new interceptor to the stack
  9982. *
  9983. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  9984. * @param {Function} rejected The function to handle `reject` for a `Promise`
  9985. *
  9986. * @return {Number} An ID used to remove interceptor later
  9987. */
  9988. use(fulfilled, rejected, options) {
  9989. this.handlers.push({
  9990. fulfilled,
  9991. rejected,
  9992. synchronous: options ? options.synchronous : false,
  9993. runWhen: options ? options.runWhen : null
  9994. });
  9995. return this.handlers.length - 1;
  9996. }
  9997.  
  9998. /**
  9999. * Remove an interceptor from the stack
  10000. *
  10001. * @param {Number} id The ID that was returned by `use`
  10002. *
  10003. * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
  10004. */
  10005. eject(id) {
  10006. if (this.handlers[id]) {
  10007. this.handlers[id] = null;
  10008. }
  10009. }
  10010.  
  10011. /**
  10012. * Clear all interceptors from the stack
  10013. *
  10014. * @returns {void}
  10015. */
  10016. clear() {
  10017. if (this.handlers) {
  10018. this.handlers = [];
  10019. }
  10020. }
  10021.  
  10022. /**
  10023. * Iterate over all the registered interceptors
  10024. *
  10025. * This method is particularly useful for skipping over any
  10026. * interceptors that may have become `null` calling `eject`.
  10027. *
  10028. * @param {Function} fn The function to call for each interceptor
  10029. *
  10030. * @returns {void}
  10031. */
  10032. forEach(fn) {
  10033. utils.forEach(this.handlers, function forEachHandler(h) {
  10034. if (h !== null) {
  10035. fn(h);
  10036. }
  10037. });
  10038. }
  10039. }
  10040.  
  10041. var InterceptorManager$1 = InterceptorManager;
  10042.  
  10043. var transitionalDefaults = {
  10044. silentJSONParsing: true,
  10045. forcedJSONParsing: true,
  10046. clarifyTimeoutError: false
  10047. };
  10048.  
  10049. var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
  10050.  
  10051. var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
  10052.  
  10053. var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
  10054.  
  10055. /**
  10056. * Determine if we're running in a standard browser environment
  10057. *
  10058. * This allows axios to run in a web worker, and react-native.
  10059. * Both environments support XMLHttpRequest, but not fully standard globals.
  10060. *
  10061. * web workers:
  10062. * typeof window -> undefined
  10063. * typeof document -> undefined
  10064. *
  10065. * react-native:
  10066. * navigator.product -> 'ReactNative'
  10067. * nativescript
  10068. * navigator.product -> 'NativeScript' or 'NS'
  10069. *
  10070. * @returns {boolean}
  10071. */
  10072. const isStandardBrowserEnv = (() => {
  10073. let product;
  10074. if (typeof navigator !== 'undefined' && (
  10075. (product = navigator.product) === 'ReactNative' ||
  10076. product === 'NativeScript' ||
  10077. product === 'NS')
  10078. ) {
  10079. return false;
  10080. }
  10081.  
  10082. return typeof window !== 'undefined' && typeof document !== 'undefined';
  10083. })();
  10084.  
  10085. /**
  10086. * Determine if we're running in a standard browser webWorker environment
  10087. *
  10088. * Although the `isStandardBrowserEnv` method indicates that
  10089. * `allows axios to run in a web worker`, the WebWorker will still be
  10090. * filtered out due to its judgment standard
  10091. * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
  10092. * This leads to a problem when axios post `FormData` in webWorker
  10093. */
  10094. const isStandardBrowserWebWorkerEnv = (() => {
  10095. return (
  10096. typeof WorkerGlobalScope !== 'undefined' &&
  10097. // eslint-disable-next-line no-undef
  10098. self instanceof WorkerGlobalScope &&
  10099. typeof self.importScripts === 'function'
  10100. );
  10101. })();
  10102.  
  10103.  
  10104. var platform = {
  10105. isBrowser: true,
  10106. classes: {
  10107. URLSearchParams: URLSearchParams$1,
  10108. FormData: FormData$1,
  10109. Blob: Blob$1
  10110. },
  10111. isStandardBrowserEnv,
  10112. isStandardBrowserWebWorkerEnv,
  10113. protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
  10114. };
  10115.  
  10116. function toURLEncodedForm(data, options) {
  10117. return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
  10118. visitor: function(value, key, path, helpers) {
  10119. if (platform.isNode && utils.isBuffer(value)) {
  10120. this.append(key, value.toString('base64'));
  10121. return false;
  10122. }
  10123.  
  10124. return helpers.defaultVisitor.apply(this, arguments);
  10125. }
  10126. }, options));
  10127. }
  10128.  
  10129. /**
  10130. * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
  10131. *
  10132. * @param {string} name - The name of the property to get.
  10133. *
  10134. * @returns An array of strings.
  10135. */
  10136. function parsePropPath(name) {
  10137. // foo[x][y][z]
  10138. // foo.x.y.z
  10139. // foo-x-y-z
  10140. // foo x y z
  10141. return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
  10142. return match[0] === '[]' ? '' : match[1] || match[0];
  10143. });
  10144. }
  10145.  
  10146. /**
  10147. * Convert an array to an object.
  10148. *
  10149. * @param {Array<any>} arr - The array to convert to an object.
  10150. *
  10151. * @returns An object with the same keys and values as the array.
  10152. */
  10153. function arrayToObject(arr) {
  10154. const obj = {};
  10155. const keys = Object.keys(arr);
  10156. let i;
  10157. const len = keys.length;
  10158. let key;
  10159. for (i = 0; i < len; i++) {
  10160. key = keys[i];
  10161. obj[key] = arr[key];
  10162. }
  10163. return obj;
  10164. }
  10165.  
  10166. /**
  10167. * It takes a FormData object and returns a JavaScript object
  10168. *
  10169. * @param {string} formData The FormData object to convert to JSON.
  10170. *
  10171. * @returns {Object<string, any> | null} The converted object.
  10172. */
  10173. function formDataToJSON(formData) {
  10174. function buildPath(path, value, target, index) {
  10175. let name = path[index++];
  10176. const isNumericKey = Number.isFinite(+name);
  10177. const isLast = index >= path.length;
  10178. name = !name && utils.isArray(target) ? target.length : name;
  10179.  
  10180. if (isLast) {
  10181. if (utils.hasOwnProp(target, name)) {
  10182. target[name] = [target[name], value];
  10183. } else {
  10184. target[name] = value;
  10185. }
  10186.  
  10187. return !isNumericKey;
  10188. }
  10189.  
  10190. if (!target[name] || !utils.isObject(target[name])) {
  10191. target[name] = [];
  10192. }
  10193.  
  10194. const result = buildPath(path, value, target[name], index);
  10195.  
  10196. if (result && utils.isArray(target[name])) {
  10197. target[name] = arrayToObject(target[name]);
  10198. }
  10199.  
  10200. return !isNumericKey;
  10201. }
  10202.  
  10203. if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
  10204. const obj = {};
  10205.  
  10206. utils.forEachEntry(formData, (name, value) => {
  10207. buildPath(parsePropPath(name), value, obj, 0);
  10208. });
  10209.  
  10210. return obj;
  10211. }
  10212.  
  10213. return null;
  10214. }
  10215.  
  10216. /**
  10217. * It takes a string, tries to parse it, and if it fails, it returns the stringified version
  10218. * of the input
  10219. *
  10220. * @param {any} rawValue - The value to be stringified.
  10221. * @param {Function} parser - A function that parses a string into a JavaScript object.
  10222. * @param {Function} encoder - A function that takes a value and returns a string.
  10223. *
  10224. * @returns {string} A stringified version of the rawValue.
  10225. */
  10226. function stringifySafely(rawValue, parser, encoder) {
  10227. if (utils.isString(rawValue)) {
  10228. try {
  10229. (parser || JSON.parse)(rawValue);
  10230. return utils.trim(rawValue);
  10231. } catch (e) {
  10232. if (e.name !== 'SyntaxError') {
  10233. throw e;
  10234. }
  10235. }
  10236. }
  10237.  
  10238. return (encoder || JSON.stringify)(rawValue);
  10239. }
  10240.  
  10241. const defaults = {
  10242.  
  10243. transitional: transitionalDefaults,
  10244.  
  10245. adapter: ['xhr', 'http'],
  10246.  
  10247. transformRequest: [function transformRequest(data, headers) {
  10248. const contentType = headers.getContentType() || '';
  10249. const hasJSONContentType = contentType.indexOf('application/json') > -1;
  10250. const isObjectPayload = utils.isObject(data);
  10251.  
  10252. if (isObjectPayload && utils.isHTMLForm(data)) {
  10253. data = new FormData(data);
  10254. }
  10255.  
  10256. const isFormData = utils.isFormData(data);
  10257.  
  10258. if (isFormData) {
  10259. if (!hasJSONContentType) {
  10260. return data;
  10261. }
  10262. return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
  10263. }
  10264.  
  10265. if (utils.isArrayBuffer(data) ||
  10266. utils.isBuffer(data) ||
  10267. utils.isStream(data) ||
  10268. utils.isFile(data) ||
  10269. utils.isBlob(data)
  10270. ) {
  10271. return data;
  10272. }
  10273. if (utils.isArrayBufferView(data)) {
  10274. return data.buffer;
  10275. }
  10276. if (utils.isURLSearchParams(data)) {
  10277. headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
  10278. return data.toString();
  10279. }
  10280.  
  10281. let isFileList;
  10282.  
  10283. if (isObjectPayload) {
  10284. if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
  10285. return toURLEncodedForm(data, this.formSerializer).toString();
  10286. }
  10287.  
  10288. if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
  10289. const _FormData = this.env && this.env.FormData;
  10290.  
  10291. return toFormData(
  10292. isFileList ? {'files[]': data} : data,
  10293. _FormData && new _FormData(),
  10294. this.formSerializer
  10295. );
  10296. }
  10297. }
  10298.  
  10299. if (isObjectPayload || hasJSONContentType ) {
  10300. headers.setContentType('application/json', false);
  10301. return stringifySafely(data);
  10302. }
  10303.  
  10304. return data;
  10305. }],
  10306.  
  10307. transformResponse: [function transformResponse(data) {
  10308. const transitional = this.transitional || defaults.transitional;
  10309. const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
  10310. const JSONRequested = this.responseType === 'json';
  10311.  
  10312. if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
  10313. const silentJSONParsing = transitional && transitional.silentJSONParsing;
  10314. const strictJSONParsing = !silentJSONParsing && JSONRequested;
  10315.  
  10316. try {
  10317. return JSON.parse(data);
  10318. } catch (e) {
  10319. if (strictJSONParsing) {
  10320. if (e.name === 'SyntaxError') {
  10321. throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
  10322. }
  10323. throw e;
  10324. }
  10325. }
  10326. }
  10327.  
  10328. return data;
  10329. }],
  10330.  
  10331. /**
  10332. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  10333. * timeout is not created.
  10334. */
  10335. timeout: 0,
  10336.  
  10337. xsrfCookieName: 'XSRF-TOKEN',
  10338. xsrfHeaderName: 'X-XSRF-TOKEN',
  10339.  
  10340. maxContentLength: -1,
  10341. maxBodyLength: -1,
  10342.  
  10343. env: {
  10344. FormData: platform.classes.FormData,
  10345. Blob: platform.classes.Blob
  10346. },
  10347.  
  10348. validateStatus: function validateStatus(status) {
  10349. return status >= 200 && status < 300;
  10350. },
  10351.  
  10352. headers: {
  10353. common: {
  10354. 'Accept': 'application/json, text/plain, */*',
  10355. 'Content-Type': undefined
  10356. }
  10357. }
  10358. };
  10359.  
  10360. utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
  10361. defaults.headers[method] = {};
  10362. });
  10363.  
  10364. var defaults$1 = defaults;
  10365.  
  10366. // RawAxiosHeaders whose duplicates are ignored by node
  10367. // c.f. https://nodejs.org/api/http.html#http_message_headers
  10368. const ignoreDuplicateOf = utils.toObjectSet([
  10369. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  10370. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  10371. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  10372. 'referer', 'retry-after', 'user-agent'
  10373. ]);
  10374.  
  10375. /**
  10376. * Parse headers into an object
  10377. *
  10378. * ```
  10379. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  10380. * Content-Type: application/json
  10381. * Connection: keep-alive
  10382. * Transfer-Encoding: chunked
  10383. * ```
  10384. *
  10385. * @param {String} rawHeaders Headers needing to be parsed
  10386. *
  10387. * @returns {Object} Headers parsed into an object
  10388. */
  10389. var parseHeaders = rawHeaders => {
  10390. const parsed = {};
  10391. let key;
  10392. let val;
  10393. let i;
  10394.  
  10395. rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
  10396. i = line.indexOf(':');
  10397. key = line.substring(0, i).trim().toLowerCase();
  10398. val = line.substring(i + 1).trim();
  10399.  
  10400. if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
  10401. return;
  10402. }
  10403.  
  10404. if (key === 'set-cookie') {
  10405. if (parsed[key]) {
  10406. parsed[key].push(val);
  10407. } else {
  10408. parsed[key] = [val];
  10409. }
  10410. } else {
  10411. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  10412. }
  10413. });
  10414.  
  10415. return parsed;
  10416. };
  10417.  
  10418. const $internals = Symbol('internals');
  10419.  
  10420. function normalizeHeader(header) {
  10421. return header && String(header).trim().toLowerCase();
  10422. }
  10423.  
  10424. function normalizeValue(value) {
  10425. if (value === false || value == null) {
  10426. return value;
  10427. }
  10428.  
  10429. return utils.isArray(value) ? value.map(normalizeValue) : String(value);
  10430. }
  10431.  
  10432. function parseTokens(str) {
  10433. const tokens = Object.create(null);
  10434. const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  10435. let match;
  10436.  
  10437. while ((match = tokensRE.exec(str))) {
  10438. tokens[match[1]] = match[2];
  10439. }
  10440.  
  10441. return tokens;
  10442. }
  10443.  
  10444. const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
  10445.  
  10446. function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
  10447. if (utils.isFunction(filter)) {
  10448. return filter.call(this, value, header);
  10449. }
  10450.  
  10451. if (isHeaderNameFilter) {
  10452. value = header;
  10453. }
  10454.  
  10455. if (!utils.isString(value)) return;
  10456.  
  10457. if (utils.isString(filter)) {
  10458. return value.indexOf(filter) !== -1;
  10459. }
  10460.  
  10461. if (utils.isRegExp(filter)) {
  10462. return filter.test(value);
  10463. }
  10464. }
  10465.  
  10466. function formatHeader(header) {
  10467. return header.trim()
  10468. .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
  10469. return char.toUpperCase() + str;
  10470. });
  10471. }
  10472.  
  10473. function buildAccessors(obj, header) {
  10474. const accessorName = utils.toCamelCase(' ' + header);
  10475.  
  10476. ['get', 'set', 'has'].forEach(methodName => {
  10477. Object.defineProperty(obj, methodName + accessorName, {
  10478. value: function(arg1, arg2, arg3) {
  10479. return this[methodName].call(this, header, arg1, arg2, arg3);
  10480. },
  10481. configurable: true
  10482. });
  10483. });
  10484. }
  10485.  
  10486. class AxiosHeaders {
  10487. constructor(headers) {
  10488. headers && this.set(headers);
  10489. }
  10490.  
  10491. set(header, valueOrRewrite, rewrite) {
  10492. const self = this;
  10493.  
  10494. function setHeader(_value, _header, _rewrite) {
  10495. const lHeader = normalizeHeader(_header);
  10496.  
  10497. if (!lHeader) {
  10498. throw new Error('header name must be a non-empty string');
  10499. }
  10500.  
  10501. const key = utils.findKey(self, lHeader);
  10502.  
  10503. if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
  10504. self[key || _header] = normalizeValue(_value);
  10505. }
  10506. }
  10507.  
  10508. const setHeaders = (headers, _rewrite) =>
  10509. utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
  10510.  
  10511. if (utils.isPlainObject(header) || header instanceof this.constructor) {
  10512. setHeaders(header, valueOrRewrite);
  10513. } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
  10514. setHeaders(parseHeaders(header), valueOrRewrite);
  10515. } else {
  10516. header != null && setHeader(valueOrRewrite, header, rewrite);
  10517. }
  10518.  
  10519. return this;
  10520. }
  10521.  
  10522. get(header, parser) {
  10523. header = normalizeHeader(header);
  10524.  
  10525. if (header) {
  10526. const key = utils.findKey(this, header);
  10527.  
  10528. if (key) {
  10529. const value = this[key];
  10530.  
  10531. if (!parser) {
  10532. return value;
  10533. }
  10534.  
  10535. if (parser === true) {
  10536. return parseTokens(value);
  10537. }
  10538.  
  10539. if (utils.isFunction(parser)) {
  10540. return parser.call(this, value, key);
  10541. }
  10542.  
  10543. if (utils.isRegExp(parser)) {
  10544. return parser.exec(value);
  10545. }
  10546.  
  10547. throw new TypeError('parser must be boolean|regexp|function');
  10548. }
  10549. }
  10550. }
  10551.  
  10552. has(header, matcher) {
  10553. header = normalizeHeader(header);
  10554.  
  10555. if (header) {
  10556. const key = utils.findKey(this, header);
  10557.  
  10558. return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
  10559. }
  10560.  
  10561. return false;
  10562. }
  10563.  
  10564. delete(header, matcher) {
  10565. const self = this;
  10566. let deleted = false;
  10567.  
  10568. function deleteHeader(_header) {
  10569. _header = normalizeHeader(_header);
  10570.  
  10571. if (_header) {
  10572. const key = utils.findKey(self, _header);
  10573.  
  10574. if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
  10575. delete self[key];
  10576.  
  10577. deleted = true;
  10578. }
  10579. }
  10580. }
  10581.  
  10582. if (utils.isArray(header)) {
  10583. header.forEach(deleteHeader);
  10584. } else {
  10585. deleteHeader(header);
  10586. }
  10587.  
  10588. return deleted;
  10589. }
  10590.  
  10591. clear(matcher) {
  10592. const keys = Object.keys(this);
  10593. let i = keys.length;
  10594. let deleted = false;
  10595.  
  10596. while (i--) {
  10597. const key = keys[i];
  10598. if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
  10599. delete this[key];
  10600. deleted = true;
  10601. }
  10602. }
  10603.  
  10604. return deleted;
  10605. }
  10606.  
  10607. normalize(format) {
  10608. const self = this;
  10609. const headers = {};
  10610.  
  10611. utils.forEach(this, (value, header) => {
  10612. const key = utils.findKey(headers, header);
  10613.  
  10614. if (key) {
  10615. self[key] = normalizeValue(value);
  10616. delete self[header];
  10617. return;
  10618. }
  10619.  
  10620. const normalized = format ? formatHeader(header) : String(header).trim();
  10621.  
  10622. if (normalized !== header) {
  10623. delete self[header];
  10624. }
  10625.  
  10626. self[normalized] = normalizeValue(value);
  10627.  
  10628. headers[normalized] = true;
  10629. });
  10630.  
  10631. return this;
  10632. }
  10633.  
  10634. concat(...targets) {
  10635. return this.constructor.concat(this, ...targets);
  10636. }
  10637.  
  10638. toJSON(asStrings) {
  10639. const obj = Object.create(null);
  10640.  
  10641. utils.forEach(this, (value, header) => {
  10642. value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
  10643. });
  10644.  
  10645. return obj;
  10646. }
  10647.  
  10648. [Symbol.iterator]() {
  10649. return Object.entries(this.toJSON())[Symbol.iterator]();
  10650. }
  10651.  
  10652. toString() {
  10653. return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
  10654. }
  10655.  
  10656. get [Symbol.toStringTag]() {
  10657. return 'AxiosHeaders';
  10658. }
  10659.  
  10660. static from(thing) {
  10661. return thing instanceof this ? thing : new this(thing);
  10662. }
  10663.  
  10664. static concat(first, ...targets) {
  10665. const computed = new this(first);
  10666.  
  10667. targets.forEach((target) => computed.set(target));
  10668.  
  10669. return computed;
  10670. }
  10671.  
  10672. static accessor(header) {
  10673. const internals = this[$internals] = (this[$internals] = {
  10674. accessors: {}
  10675. });
  10676.  
  10677. const accessors = internals.accessors;
  10678. const prototype = this.prototype;
  10679.  
  10680. function defineAccessor(_header) {
  10681. const lHeader = normalizeHeader(_header);
  10682.  
  10683. if (!accessors[lHeader]) {
  10684. buildAccessors(prototype, _header);
  10685. accessors[lHeader] = true;
  10686. }
  10687. }
  10688.  
  10689. utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
  10690.  
  10691. return this;
  10692. }
  10693. }
  10694.  
  10695. AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
  10696.  
  10697. // reserved names hotfix
  10698. utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
  10699. let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
  10700. return {
  10701. get: () => value,
  10702. set(headerValue) {
  10703. this[mapped] = headerValue;
  10704. }
  10705. }
  10706. });
  10707.  
  10708. utils.freezeMethods(AxiosHeaders);
  10709.  
  10710. var AxiosHeaders$1 = AxiosHeaders;
  10711.  
  10712. /**
  10713. * Transform the data for a request or a response
  10714. *
  10715. * @param {Array|Function} fns A single function or Array of functions
  10716. * @param {?Object} response The response object
  10717. *
  10718. * @returns {*} The resulting transformed data
  10719. */
  10720. function transformData(fns, response) {
  10721. const config = this || defaults$1;
  10722. const context = response || config;
  10723. const headers = AxiosHeaders$1.from(context.headers);
  10724. let data = context.data;
  10725.  
  10726. utils.forEach(fns, function transform(fn) {
  10727. data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
  10728. });
  10729.  
  10730. headers.normalize();
  10731.  
  10732. return data;
  10733. }
  10734.  
  10735. function isCancel(value) {
  10736. return !!(value && value.__CANCEL__);
  10737. }
  10738.  
  10739. /**
  10740. * A `CanceledError` is an object that is thrown when an operation is canceled.
  10741. *
  10742. * @param {string=} message The message.
  10743. * @param {Object=} config The config.
  10744. * @param {Object=} request The request.
  10745. *
  10746. * @returns {CanceledError} The created error.
  10747. */
  10748. function CanceledError(message, config, request) {
  10749. // eslint-disable-next-line no-eq-null,eqeqeq
  10750. AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
  10751. this.name = 'CanceledError';
  10752. }
  10753.  
  10754. utils.inherits(CanceledError, AxiosError, {
  10755. __CANCEL__: true
  10756. });
  10757.  
  10758. /**
  10759. * Resolve or reject a Promise based on response status.
  10760. *
  10761. * @param {Function} resolve A function that resolves the promise.
  10762. * @param {Function} reject A function that rejects the promise.
  10763. * @param {object} response The response.
  10764. *
  10765. * @returns {object} The response.
  10766. */
  10767. function settle(resolve, reject, response) {
  10768. const validateStatus = response.config.validateStatus;
  10769. if (!response.status || !validateStatus || validateStatus(response.status)) {
  10770. resolve(response);
  10771. } else {
  10772. reject(new AxiosError(
  10773. 'Request failed with status code ' + response.status,
  10774. [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
  10775. response.config,
  10776. response.request,
  10777. response
  10778. ));
  10779. }
  10780. }
  10781.  
  10782. var cookies = platform.isStandardBrowserEnv ?
  10783.  
  10784. // Standard browser envs support document.cookie
  10785. (function standardBrowserEnv() {
  10786. return {
  10787. write: function write(name, value, expires, path, domain, secure) {
  10788. const cookie = [];
  10789. cookie.push(name + '=' + encodeURIComponent(value));
  10790.  
  10791. if (utils.isNumber(expires)) {
  10792. cookie.push('expires=' + new Date(expires).toGMTString());
  10793. }
  10794.  
  10795. if (utils.isString(path)) {
  10796. cookie.push('path=' + path);
  10797. }
  10798.  
  10799. if (utils.isString(domain)) {
  10800. cookie.push('domain=' + domain);
  10801. }
  10802.  
  10803. if (secure === true) {
  10804. cookie.push('secure');
  10805. }
  10806.  
  10807. document.cookie = cookie.join('; ');
  10808. },
  10809.  
  10810. read: function read(name) {
  10811. const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  10812. return (match ? decodeURIComponent(match[3]) : null);
  10813. },
  10814.  
  10815. remove: function remove(name) {
  10816. this.write(name, '', Date.now() - 86400000);
  10817. }
  10818. };
  10819. })() :
  10820.  
  10821. // Non standard browser env (web workers, react-native) lack needed support.
  10822. (function nonStandardBrowserEnv() {
  10823. return {
  10824. write: function write() {},
  10825. read: function read() { return null; },
  10826. remove: function remove() {}
  10827. };
  10828. })();
  10829.  
  10830. /**
  10831. * Determines whether the specified URL is absolute
  10832. *
  10833. * @param {string} url The URL to test
  10834. *
  10835. * @returns {boolean} True if the specified URL is absolute, otherwise false
  10836. */
  10837. function isAbsoluteURL(url) {
  10838. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  10839. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  10840. // by any combination of letters, digits, plus, period, or hyphen.
  10841. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  10842. }
  10843.  
  10844. /**
  10845. * Creates a new URL by combining the specified URLs
  10846. *
  10847. * @param {string} baseURL The base URL
  10848. * @param {string} relativeURL The relative URL
  10849. *
  10850. * @returns {string} The combined URL
  10851. */
  10852. function combineURLs(baseURL, relativeURL) {
  10853. return relativeURL
  10854. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  10855. : baseURL;
  10856. }
  10857.  
  10858. /**
  10859. * Creates a new URL by combining the baseURL with the requestedURL,
  10860. * only when the requestedURL is not already an absolute URL.
  10861. * If the requestURL is absolute, this function returns the requestedURL untouched.
  10862. *
  10863. * @param {string} baseURL The base URL
  10864. * @param {string} requestedURL Absolute or relative URL to combine
  10865. *
  10866. * @returns {string} The combined full path
  10867. */
  10868. function buildFullPath(baseURL, requestedURL) {
  10869. if (baseURL && !isAbsoluteURL(requestedURL)) {
  10870. return combineURLs(baseURL, requestedURL);
  10871. }
  10872. return requestedURL;
  10873. }
  10874.  
  10875. var isURLSameOrigin = platform.isStandardBrowserEnv ?
  10876.  
  10877. // Standard browser envs have full support of the APIs needed to test
  10878. // whether the request URL is of the same origin as current location.
  10879. (function standardBrowserEnv() {
  10880. const msie = /(msie|trident)/i.test(navigator.userAgent);
  10881. const urlParsingNode = document.createElement('a');
  10882. let originURL;
  10883.  
  10884. /**
  10885. * Parse a URL to discover it's components
  10886. *
  10887. * @param {String} url The URL to be parsed
  10888. * @returns {Object}
  10889. */
  10890. function resolveURL(url) {
  10891. let href = url;
  10892.  
  10893. if (msie) {
  10894. // IE needs attribute set twice to normalize properties
  10895. urlParsingNode.setAttribute('href', href);
  10896. href = urlParsingNode.href;
  10897. }
  10898.  
  10899. urlParsingNode.setAttribute('href', href);
  10900.  
  10901. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  10902. return {
  10903. href: urlParsingNode.href,
  10904. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  10905. host: urlParsingNode.host,
  10906. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  10907. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  10908. hostname: urlParsingNode.hostname,
  10909. port: urlParsingNode.port,
  10910. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  10911. urlParsingNode.pathname :
  10912. '/' + urlParsingNode.pathname
  10913. };
  10914. }
  10915.  
  10916. originURL = resolveURL(window.location.href);
  10917.  
  10918. /**
  10919. * Determine if a URL shares the same origin as the current location
  10920. *
  10921. * @param {String} requestURL The URL to test
  10922. * @returns {boolean} True if URL shares the same origin, otherwise false
  10923. */
  10924. return function isURLSameOrigin(requestURL) {
  10925. const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  10926. return (parsed.protocol === originURL.protocol &&
  10927. parsed.host === originURL.host);
  10928. };
  10929. })() :
  10930.  
  10931. // Non standard browser envs (web workers, react-native) lack needed support.
  10932. (function nonStandardBrowserEnv() {
  10933. return function isURLSameOrigin() {
  10934. return true;
  10935. };
  10936. })();
  10937.  
  10938. function parseProtocol(url) {
  10939. const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  10940. return match && match[1] || '';
  10941. }
  10942.  
  10943. /**
  10944. * Calculate data maxRate
  10945. * @param {Number} [samplesCount= 10]
  10946. * @param {Number} [min= 1000]
  10947. * @returns {Function}
  10948. */
  10949. function speedometer(samplesCount, min) {
  10950. samplesCount = samplesCount || 10;
  10951. const bytes = new Array(samplesCount);
  10952. const timestamps = new Array(samplesCount);
  10953. let head = 0;
  10954. let tail = 0;
  10955. let firstSampleTS;
  10956.  
  10957. min = min !== undefined ? min : 1000;
  10958.  
  10959. return function push(chunkLength) {
  10960. const now = Date.now();
  10961.  
  10962. const startedAt = timestamps[tail];
  10963.  
  10964. if (!firstSampleTS) {
  10965. firstSampleTS = now;
  10966. }
  10967.  
  10968. bytes[head] = chunkLength;
  10969. timestamps[head] = now;
  10970.  
  10971. let i = tail;
  10972. let bytesCount = 0;
  10973.  
  10974. while (i !== head) {
  10975. bytesCount += bytes[i++];
  10976. i = i % samplesCount;
  10977. }
  10978.  
  10979. head = (head + 1) % samplesCount;
  10980.  
  10981. if (head === tail) {
  10982. tail = (tail + 1) % samplesCount;
  10983. }
  10984.  
  10985. if (now - firstSampleTS < min) {
  10986. return;
  10987. }
  10988.  
  10989. const passed = startedAt && now - startedAt;
  10990.  
  10991. return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
  10992. };
  10993. }
  10994.  
  10995. function progressEventReducer(listener, isDownloadStream) {
  10996. let bytesNotified = 0;
  10997. const _speedometer = speedometer(50, 250);
  10998.  
  10999. return e => {
  11000. const loaded = e.loaded;
  11001. const total = e.lengthComputable ? e.total : undefined;
  11002. const progressBytes = loaded - bytesNotified;
  11003. const rate = _speedometer(progressBytes);
  11004. const inRange = loaded <= total;
  11005.  
  11006. bytesNotified = loaded;
  11007.  
  11008. const data = {
  11009. loaded,
  11010. total,
  11011. progress: total ? (loaded / total) : undefined,
  11012. bytes: progressBytes,
  11013. rate: rate ? rate : undefined,
  11014. estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
  11015. event: e
  11016. };
  11017.  
  11018. data[isDownloadStream ? 'download' : 'upload'] = true;
  11019.  
  11020. listener(data);
  11021. };
  11022. }
  11023.  
  11024. const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
  11025.  
  11026. var xhrAdapter = isXHRAdapterSupported && function (config) {
  11027. return new Promise(function dispatchXhrRequest(resolve, reject) {
  11028. let requestData = config.data;
  11029. const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
  11030. const responseType = config.responseType;
  11031. let onCanceled;
  11032. function done() {
  11033. if (config.cancelToken) {
  11034. config.cancelToken.unsubscribe(onCanceled);
  11035. }
  11036.  
  11037. if (config.signal) {
  11038. config.signal.removeEventListener('abort', onCanceled);
  11039. }
  11040. }
  11041.  
  11042. let contentType;
  11043.  
  11044. if (utils.isFormData(requestData)) {
  11045. if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
  11046. requestHeaders.setContentType(false); // Let the browser set it
  11047. } else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){
  11048. requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
  11049. } else if(utils.isString(contentType = requestHeaders.getContentType())){
  11050. // fix semicolon duplication issue for ReactNative FormData implementation
  11051. requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1'));
  11052. }
  11053. }
  11054.  
  11055. let request = new XMLHttpRequest();
  11056.  
  11057. // HTTP basic authentication
  11058. if (config.auth) {
  11059. const username = config.auth.username || '';
  11060. const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
  11061. requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
  11062. }
  11063.  
  11064. const fullPath = buildFullPath(config.baseURL, config.url);
  11065.  
  11066. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  11067.  
  11068. // Set the request timeout in MS
  11069. request.timeout = config.timeout;
  11070.  
  11071. function onloadend() {
  11072. if (!request) {
  11073. return;
  11074. }
  11075. // Prepare the response
  11076. const responseHeaders = AxiosHeaders$1.from(
  11077. 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
  11078. );
  11079. const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
  11080. request.responseText : request.response;
  11081. const response = {
  11082. data: responseData,
  11083. status: request.status,
  11084. statusText: request.statusText,
  11085. headers: responseHeaders,
  11086. config,
  11087. request
  11088. };
  11089.  
  11090. settle(function _resolve(value) {
  11091. resolve(value);
  11092. done();
  11093. }, function _reject(err) {
  11094. reject(err);
  11095. done();
  11096. }, response);
  11097.  
  11098. // Clean up request
  11099. request = null;
  11100. }
  11101.  
  11102. if ('onloadend' in request) {
  11103. // Use onloadend if available
  11104. request.onloadend = onloadend;
  11105. } else {
  11106. // Listen for ready state to emulate onloadend
  11107. request.onreadystatechange = function handleLoad() {
  11108. if (!request || request.readyState !== 4) {
  11109. return;
  11110. }
  11111.  
  11112. // The request errored out and we didn't get a response, this will be
  11113. // handled by onerror instead
  11114. // With one exception: request that using file: protocol, most browsers
  11115. // will return status as 0 even though it's a successful request
  11116. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  11117. return;
  11118. }
  11119. // readystate handler is calling before onerror or ontimeout handlers,
  11120. // so we should call onloadend on the next 'tick'
  11121. setTimeout(onloadend);
  11122. };
  11123. }
  11124.  
  11125. // Handle browser request cancellation (as opposed to a manual cancellation)
  11126. request.onabort = function handleAbort() {
  11127. if (!request) {
  11128. return;
  11129. }
  11130.  
  11131. reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
  11132.  
  11133. // Clean up request
  11134. request = null;
  11135. };
  11136.  
  11137. // Handle low level network errors
  11138. request.onerror = function handleError() {
  11139. // Real errors are hidden from us by the browser
  11140. // onerror should only fire if it's a network error
  11141. reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
  11142.  
  11143. // Clean up request
  11144. request = null;
  11145. };
  11146.  
  11147. // Handle timeout
  11148. request.ontimeout = function handleTimeout() {
  11149. let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
  11150. const transitional = config.transitional || transitionalDefaults;
  11151. if (config.timeoutErrorMessage) {
  11152. timeoutErrorMessage = config.timeoutErrorMessage;
  11153. }
  11154. reject(new AxiosError(
  11155. timeoutErrorMessage,
  11156. transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
  11157. config,
  11158. request));
  11159.  
  11160. // Clean up request
  11161. request = null;
  11162. };
  11163.  
  11164. // Add xsrf header
  11165. // This is only done if running in a standard browser environment.
  11166. // Specifically not if we're in a web worker, or react-native.
  11167. if (platform.isStandardBrowserEnv) {
  11168. // Add xsrf header
  11169. // regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
  11170. const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
  11171.  
  11172. if (xsrfValue) {
  11173. requestHeaders.set(config.xsrfHeaderName, xsrfValue);
  11174. }
  11175. }
  11176.  
  11177. // Remove Content-Type if data is undefined
  11178. requestData === undefined && requestHeaders.setContentType(null);
  11179.  
  11180. // Add headers to the request
  11181. if ('setRequestHeader' in request) {
  11182. utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
  11183. request.setRequestHeader(key, val);
  11184. });
  11185. }
  11186.  
  11187. // Add withCredentials to request if needed
  11188. if (!utils.isUndefined(config.withCredentials)) {
  11189. request.withCredentials = !!config.withCredentials;
  11190. }
  11191.  
  11192. // Add responseType to request if needed
  11193. if (responseType && responseType !== 'json') {
  11194. request.responseType = config.responseType;
  11195. }
  11196.  
  11197. // Handle progress if needed
  11198. if (typeof config.onDownloadProgress === 'function') {
  11199. request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
  11200. }
  11201.  
  11202. // Not all browsers support upload events
  11203. if (typeof config.onUploadProgress === 'function' && request.upload) {
  11204. request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
  11205. }
  11206.  
  11207. if (config.cancelToken || config.signal) {
  11208. // Handle cancellation
  11209. // eslint-disable-next-line func-names
  11210. onCanceled = cancel => {
  11211. if (!request) {
  11212. return;
  11213. }
  11214. reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
  11215. request.abort();
  11216. request = null;
  11217. };
  11218.  
  11219. config.cancelToken && config.cancelToken.subscribe(onCanceled);
  11220. if (config.signal) {
  11221. config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
  11222. }
  11223. }
  11224.  
  11225. const protocol = parseProtocol(fullPath);
  11226.  
  11227. if (protocol && platform.protocols.indexOf(protocol) === -1) {
  11228. reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
  11229. return;
  11230. }
  11231.  
  11232.  
  11233. // Send the request
  11234. request.send(requestData || null);
  11235. });
  11236. };
  11237.  
  11238. const knownAdapters = {
  11239. http: httpAdapter,
  11240. xhr: xhrAdapter
  11241. };
  11242.  
  11243. utils.forEach(knownAdapters, (fn, value) => {
  11244. if (fn) {
  11245. try {
  11246. Object.defineProperty(fn, 'name', {value});
  11247. } catch (e) {
  11248. // eslint-disable-next-line no-empty
  11249. }
  11250. Object.defineProperty(fn, 'adapterName', {value});
  11251. }
  11252. });
  11253.  
  11254. const renderReason = (reason) => `- ${reason}`;
  11255.  
  11256. const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
  11257.  
  11258. var adapters = {
  11259. getAdapter: (adapters) => {
  11260. adapters = utils.isArray(adapters) ? adapters : [adapters];
  11261.  
  11262. const {length} = adapters;
  11263. let nameOrAdapter;
  11264. let adapter;
  11265.  
  11266. const rejectedReasons = {};
  11267.  
  11268. for (let i = 0; i < length; i++) {
  11269. nameOrAdapter = adapters[i];
  11270. let id;
  11271.  
  11272. adapter = nameOrAdapter;
  11273.  
  11274. if (!isResolvedHandle(nameOrAdapter)) {
  11275. adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
  11276.  
  11277. if (adapter === undefined) {
  11278. throw new AxiosError(`Unknown adapter '${id}'`);
  11279. }
  11280. }
  11281.  
  11282. if (adapter) {
  11283. break;
  11284. }
  11285.  
  11286. rejectedReasons[id || '#' + i] = adapter;
  11287. }
  11288.  
  11289. if (!adapter) {
  11290.  
  11291. const reasons = Object.entries(rejectedReasons)
  11292. .map(([id, state]) => `adapter ${id} ` +
  11293. (state === false ? 'is not supported by the environment' : 'is not available in the build')
  11294. );
  11295.  
  11296. let s = length ?
  11297. (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
  11298. 'as no adapter specified';
  11299.  
  11300. throw new AxiosError(
  11301. `There is no suitable adapter to dispatch the request ` + s,
  11302. 'ERR_NOT_SUPPORT'
  11303. );
  11304. }
  11305.  
  11306. return adapter;
  11307. },
  11308. adapters: knownAdapters
  11309. };
  11310.  
  11311. /**
  11312. * Throws a `CanceledError` if cancellation has been requested.
  11313. *
  11314. * @param {Object} config The config that is to be used for the request
  11315. *
  11316. * @returns {void}
  11317. */
  11318. function throwIfCancellationRequested(config) {
  11319. if (config.cancelToken) {
  11320. config.cancelToken.throwIfRequested();
  11321. }
  11322.  
  11323. if (config.signal && config.signal.aborted) {
  11324. throw new CanceledError(null, config);
  11325. }
  11326. }
  11327.  
  11328. /**
  11329. * Dispatch a request to the server using the configured adapter.
  11330. *
  11331. * @param {object} config The config that is to be used for the request
  11332. *
  11333. * @returns {Promise} The Promise to be fulfilled
  11334. */
  11335. function dispatchRequest(config) {
  11336. throwIfCancellationRequested(config);
  11337.  
  11338. config.headers = AxiosHeaders$1.from(config.headers);
  11339.  
  11340. // Transform request data
  11341. config.data = transformData.call(
  11342. config,
  11343. config.transformRequest
  11344. );
  11345.  
  11346. if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
  11347. config.headers.setContentType('application/x-www-form-urlencoded', false);
  11348. }
  11349.  
  11350. const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
  11351.  
  11352. return adapter(config).then(function onAdapterResolution(response) {
  11353. throwIfCancellationRequested(config);
  11354.  
  11355. // Transform response data
  11356. response.data = transformData.call(
  11357. config,
  11358. config.transformResponse,
  11359. response
  11360. );
  11361.  
  11362. response.headers = AxiosHeaders$1.from(response.headers);
  11363.  
  11364. return response;
  11365. }, function onAdapterRejection(reason) {
  11366. if (!isCancel(reason)) {
  11367. throwIfCancellationRequested(config);
  11368.  
  11369. // Transform response data
  11370. if (reason && reason.response) {
  11371. reason.response.data = transformData.call(
  11372. config,
  11373. config.transformResponse,
  11374. reason.response
  11375. );
  11376. reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
  11377. }
  11378. }
  11379.  
  11380. return Promise.reject(reason);
  11381. });
  11382. }
  11383.  
  11384. const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
  11385.  
  11386. /**
  11387. * Config-specific merge-function which creates a new config-object
  11388. * by merging two configuration objects together.
  11389. *
  11390. * @param {Object} config1
  11391. * @param {Object} config2
  11392. *
  11393. * @returns {Object} New object resulting from merging config2 to config1
  11394. */
  11395. function mergeConfig(config1, config2) {
  11396. // eslint-disable-next-line no-param-reassign
  11397. config2 = config2 || {};
  11398. const config = {};
  11399.  
  11400. function getMergedValue(target, source, caseless) {
  11401. if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
  11402. return utils.merge.call({caseless}, target, source);
  11403. } else if (utils.isPlainObject(source)) {
  11404. return utils.merge({}, source);
  11405. } else if (utils.isArray(source)) {
  11406. return source.slice();
  11407. }
  11408. return source;
  11409. }
  11410.  
  11411. // eslint-disable-next-line consistent-return
  11412. function mergeDeepProperties(a, b, caseless) {
  11413. if (!utils.isUndefined(b)) {
  11414. return getMergedValue(a, b, caseless);
  11415. } else if (!utils.isUndefined(a)) {
  11416. return getMergedValue(undefined, a, caseless);
  11417. }
  11418. }
  11419.  
  11420. // eslint-disable-next-line consistent-return
  11421. function valueFromConfig2(a, b) {
  11422. if (!utils.isUndefined(b)) {
  11423. return getMergedValue(undefined, b);
  11424. }
  11425. }
  11426.  
  11427. // eslint-disable-next-line consistent-return
  11428. function defaultToConfig2(a, b) {
  11429. if (!utils.isUndefined(b)) {
  11430. return getMergedValue(undefined, b);
  11431. } else if (!utils.isUndefined(a)) {
  11432. return getMergedValue(undefined, a);
  11433. }
  11434. }
  11435.  
  11436. // eslint-disable-next-line consistent-return
  11437. function mergeDirectKeys(a, b, prop) {
  11438. if (prop in config2) {
  11439. return getMergedValue(a, b);
  11440. } else if (prop in config1) {
  11441. return getMergedValue(undefined, a);
  11442. }
  11443. }
  11444.  
  11445. const mergeMap = {
  11446. url: valueFromConfig2,
  11447. method: valueFromConfig2,
  11448. data: valueFromConfig2,
  11449. baseURL: defaultToConfig2,
  11450. transformRequest: defaultToConfig2,
  11451. transformResponse: defaultToConfig2,
  11452. paramsSerializer: defaultToConfig2,
  11453. timeout: defaultToConfig2,
  11454. timeoutMessage: defaultToConfig2,
  11455. withCredentials: defaultToConfig2,
  11456. adapter: defaultToConfig2,
  11457. responseType: defaultToConfig2,
  11458. xsrfCookieName: defaultToConfig2,
  11459. xsrfHeaderName: defaultToConfig2,
  11460. onUploadProgress: defaultToConfig2,
  11461. onDownloadProgress: defaultToConfig2,
  11462. decompress: defaultToConfig2,
  11463. maxContentLength: defaultToConfig2,
  11464. maxBodyLength: defaultToConfig2,
  11465. beforeRedirect: defaultToConfig2,
  11466. transport: defaultToConfig2,
  11467. httpAgent: defaultToConfig2,
  11468. httpsAgent: defaultToConfig2,
  11469. cancelToken: defaultToConfig2,
  11470. socketPath: defaultToConfig2,
  11471. responseEncoding: defaultToConfig2,
  11472. validateStatus: mergeDirectKeys,
  11473. headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
  11474. };
  11475.  
  11476. utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
  11477. const merge = mergeMap[prop] || mergeDeepProperties;
  11478. const configValue = merge(config1[prop], config2[prop], prop);
  11479. (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
  11480. });
  11481.  
  11482. return config;
  11483. }
  11484.  
  11485. const VERSION = "1.6.0";
  11486.  
  11487. const validators$1 = {};
  11488.  
  11489. // eslint-disable-next-line func-names
  11490. ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
  11491. validators$1[type] = function validator(thing) {
  11492. return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
  11493. };
  11494. });
  11495.  
  11496. const deprecatedWarnings = {};
  11497.  
  11498. /**
  11499. * Transitional option validator
  11500. *
  11501. * @param {function|boolean?} validator - set to false if the transitional option has been removed
  11502. * @param {string?} version - deprecated version / removed since version
  11503. * @param {string?} message - some message with additional info
  11504. *
  11505. * @returns {function}
  11506. */
  11507. validators$1.transitional = function transitional(validator, version, message) {
  11508. function formatMessage(opt, desc) {
  11509. return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
  11510. }
  11511.  
  11512. // eslint-disable-next-line func-names
  11513. return (value, opt, opts) => {
  11514. if (validator === false) {
  11515. throw new AxiosError(
  11516. formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
  11517. AxiosError.ERR_DEPRECATED
  11518. );
  11519. }
  11520.  
  11521. if (version && !deprecatedWarnings[opt]) {
  11522. deprecatedWarnings[opt] = true;
  11523. // eslint-disable-next-line no-console
  11524. console.warn(
  11525. formatMessage(
  11526. opt,
  11527. ' has been deprecated since v' + version + ' and will be removed in the near future'
  11528. )
  11529. );
  11530. }
  11531.  
  11532. return validator ? validator(value, opt, opts) : true;
  11533. };
  11534. };
  11535.  
  11536. /**
  11537. * Assert object's properties type
  11538. *
  11539. * @param {object} options
  11540. * @param {object} schema
  11541. * @param {boolean?} allowUnknown
  11542. *
  11543. * @returns {object}
  11544. */
  11545.  
  11546. function assertOptions(options, schema, allowUnknown) {
  11547. if (typeof options !== 'object') {
  11548. throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
  11549. }
  11550. const keys = Object.keys(options);
  11551. let i = keys.length;
  11552. while (i-- > 0) {
  11553. const opt = keys[i];
  11554. const validator = schema[opt];
  11555. if (validator) {
  11556. const value = options[opt];
  11557. const result = value === undefined || validator(value, opt, options);
  11558. if (result !== true) {
  11559. throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
  11560. }
  11561. continue;
  11562. }
  11563. if (allowUnknown !== true) {
  11564. throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
  11565. }
  11566. }
  11567. }
  11568.  
  11569. var validator = {
  11570. assertOptions,
  11571. validators: validators$1
  11572. };
  11573.  
  11574. const validators = validator.validators;
  11575.  
  11576. /**
  11577. * Create a new instance of Axios
  11578. *
  11579. * @param {Object} instanceConfig The default config for the instance
  11580. *
  11581. * @return {Axios} A new instance of Axios
  11582. */
  11583. class Axios {
  11584. constructor(instanceConfig) {
  11585. this.defaults = instanceConfig;
  11586. this.interceptors = {
  11587. request: new InterceptorManager$1(),
  11588. response: new InterceptorManager$1()
  11589. };
  11590. }
  11591.  
  11592. /**
  11593. * Dispatch a request
  11594. *
  11595. * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
  11596. * @param {?Object} config
  11597. *
  11598. * @returns {Promise} The Promise to be fulfilled
  11599. */
  11600. request(configOrUrl, config) {
  11601. /*eslint no-param-reassign:0*/
  11602. // Allow for axios('example/url'[, config]) a la fetch API
  11603. if (typeof configOrUrl === 'string') {
  11604. config = config || {};
  11605. config.url = configOrUrl;
  11606. } else {
  11607. config = configOrUrl || {};
  11608. }
  11609.  
  11610. config = mergeConfig(this.defaults, config);
  11611.  
  11612. const {transitional, paramsSerializer, headers} = config;
  11613.  
  11614. if (transitional !== undefined) {
  11615. validator.assertOptions(transitional, {
  11616. silentJSONParsing: validators.transitional(validators.boolean),
  11617. forcedJSONParsing: validators.transitional(validators.boolean),
  11618. clarifyTimeoutError: validators.transitional(validators.boolean)
  11619. }, false);
  11620. }
  11621.  
  11622. if (paramsSerializer != null) {
  11623. if (utils.isFunction(paramsSerializer)) {
  11624. config.paramsSerializer = {
  11625. serialize: paramsSerializer
  11626. };
  11627. } else {
  11628. validator.assertOptions(paramsSerializer, {
  11629. encode: validators.function,
  11630. serialize: validators.function
  11631. }, true);
  11632. }
  11633. }
  11634.  
  11635. // Set config.method
  11636. config.method = (config.method || this.defaults.method || 'get').toLowerCase();
  11637.  
  11638. // Flatten headers
  11639. let contextHeaders = headers && utils.merge(
  11640. headers.common,
  11641. headers[config.method]
  11642. );
  11643.  
  11644. headers && utils.forEach(
  11645. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  11646. (method) => {
  11647. delete headers[method];
  11648. }
  11649. );
  11650.  
  11651. config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
  11652.  
  11653. // filter out skipped interceptors
  11654. const requestInterceptorChain = [];
  11655. let synchronousRequestInterceptors = true;
  11656. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  11657. if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
  11658. return;
  11659. }
  11660.  
  11661. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  11662.  
  11663. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  11664. });
  11665.  
  11666. const responseInterceptorChain = [];
  11667. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  11668. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  11669. });
  11670.  
  11671. let promise;
  11672. let i = 0;
  11673. let len;
  11674.  
  11675. if (!synchronousRequestInterceptors) {
  11676. const chain = [dispatchRequest.bind(this), undefined];
  11677. chain.unshift.apply(chain, requestInterceptorChain);
  11678. chain.push.apply(chain, responseInterceptorChain);
  11679. len = chain.length;
  11680.  
  11681. promise = Promise.resolve(config);
  11682.  
  11683. while (i < len) {
  11684. promise = promise.then(chain[i++], chain[i++]);
  11685. }
  11686.  
  11687. return promise;
  11688. }
  11689.  
  11690. len = requestInterceptorChain.length;
  11691.  
  11692. let newConfig = config;
  11693.  
  11694. i = 0;
  11695.  
  11696. while (i < len) {
  11697. const onFulfilled = requestInterceptorChain[i++];
  11698. const onRejected = requestInterceptorChain[i++];
  11699. try {
  11700. newConfig = onFulfilled(newConfig);
  11701. } catch (error) {
  11702. onRejected.call(this, error);
  11703. break;
  11704. }
  11705. }
  11706.  
  11707. try {
  11708. promise = dispatchRequest.call(this, newConfig);
  11709. } catch (error) {
  11710. return Promise.reject(error);
  11711. }
  11712.  
  11713. i = 0;
  11714. len = responseInterceptorChain.length;
  11715.  
  11716. while (i < len) {
  11717. promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
  11718. }
  11719.  
  11720. return promise;
  11721. }
  11722.  
  11723. getUri(config) {
  11724. config = mergeConfig(this.defaults, config);
  11725. const fullPath = buildFullPath(config.baseURL, config.url);
  11726. return buildURL(fullPath, config.params, config.paramsSerializer);
  11727. }
  11728. }
  11729.  
  11730. // Provide aliases for supported request methods
  11731. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  11732. /*eslint func-names:0*/
  11733. Axios.prototype[method] = function(url, config) {
  11734. return this.request(mergeConfig(config || {}, {
  11735. method,
  11736. url,
  11737. data: (config || {}).data
  11738. }));
  11739. };
  11740. });
  11741.  
  11742. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  11743. /*eslint func-names:0*/
  11744.  
  11745. function generateHTTPMethod(isForm) {
  11746. return function httpMethod(url, data, config) {
  11747. return this.request(mergeConfig(config || {}, {
  11748. method,
  11749. headers: isForm ? {
  11750. 'Content-Type': 'multipart/form-data'
  11751. } : {},
  11752. url,
  11753. data
  11754. }));
  11755. };
  11756. }
  11757.  
  11758. Axios.prototype[method] = generateHTTPMethod();
  11759.  
  11760. Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
  11761. });
  11762.  
  11763. var Axios$1 = Axios;
  11764.  
  11765. /**
  11766. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  11767. *
  11768. * @param {Function} executor The executor function.
  11769. *
  11770. * @returns {CancelToken}
  11771. */
  11772. class CancelToken {
  11773. constructor(executor) {
  11774. if (typeof executor !== 'function') {
  11775. throw new TypeError('executor must be a function.');
  11776. }
  11777.  
  11778. let resolvePromise;
  11779.  
  11780. this.promise = new Promise(function promiseExecutor(resolve) {
  11781. resolvePromise = resolve;
  11782. });
  11783.  
  11784. const token = this;
  11785.  
  11786. // eslint-disable-next-line func-names
  11787. this.promise.then(cancel => {
  11788. if (!token._listeners) return;
  11789.  
  11790. let i = token._listeners.length;
  11791.  
  11792. while (i-- > 0) {
  11793. token._listeners[i](cancel);
  11794. }
  11795. token._listeners = null;
  11796. });
  11797.  
  11798. // eslint-disable-next-line func-names
  11799. this.promise.then = onfulfilled => {
  11800. let _resolve;
  11801. // eslint-disable-next-line func-names
  11802. const promise = new Promise(resolve => {
  11803. token.subscribe(resolve);
  11804. _resolve = resolve;
  11805. }).then(onfulfilled);
  11806.  
  11807. promise.cancel = function reject() {
  11808. token.unsubscribe(_resolve);
  11809. };
  11810.  
  11811. return promise;
  11812. };
  11813.  
  11814. executor(function cancel(message, config, request) {
  11815. if (token.reason) {
  11816. // Cancellation has already been requested
  11817. return;
  11818. }
  11819.  
  11820. token.reason = new CanceledError(message, config, request);
  11821. resolvePromise(token.reason);
  11822. });
  11823. }
  11824.  
  11825. /**
  11826. * Throws a `CanceledError` if cancellation has been requested.
  11827. */
  11828. throwIfRequested() {
  11829. if (this.reason) {
  11830. throw this.reason;
  11831. }
  11832. }
  11833.  
  11834. /**
  11835. * Subscribe to the cancel signal
  11836. */
  11837.  
  11838. subscribe(listener) {
  11839. if (this.reason) {
  11840. listener(this.reason);
  11841. return;
  11842. }
  11843.  
  11844. if (this._listeners) {
  11845. this._listeners.push(listener);
  11846. } else {
  11847. this._listeners = [listener];
  11848. }
  11849. }
  11850.  
  11851. /**
  11852. * Unsubscribe from the cancel signal
  11853. */
  11854.  
  11855. unsubscribe(listener) {
  11856. if (!this._listeners) {
  11857. return;
  11858. }
  11859. const index = this._listeners.indexOf(listener);
  11860. if (index !== -1) {
  11861. this._listeners.splice(index, 1);
  11862. }
  11863. }
  11864.  
  11865. /**
  11866. * Returns an object that contains a new `CancelToken` and a function that, when called,
  11867. * cancels the `CancelToken`.
  11868. */
  11869. static source() {
  11870. let cancel;
  11871. const token = new CancelToken(function executor(c) {
  11872. cancel = c;
  11873. });
  11874. return {
  11875. token,
  11876. cancel
  11877. };
  11878. }
  11879. }
  11880.  
  11881. var CancelToken$1 = CancelToken;
  11882.  
  11883. /**
  11884. * Syntactic sugar for invoking a function and expanding an array for arguments.
  11885. *
  11886. * Common use case would be to use `Function.prototype.apply`.
  11887. *
  11888. * ```js
  11889. * function f(x, y, z) {}
  11890. * var args = [1, 2, 3];
  11891. * f.apply(null, args);
  11892. * ```
  11893. *
  11894. * With `spread` this example can be re-written.
  11895. *
  11896. * ```js
  11897. * spread(function(x, y, z) {})([1, 2, 3]);
  11898. * ```
  11899. *
  11900. * @param {Function} callback
  11901. *
  11902. * @returns {Function}
  11903. */
  11904. function spread(callback) {
  11905. return function wrap(arr) {
  11906. return callback.apply(null, arr);
  11907. };
  11908. }
  11909.  
  11910. /**
  11911. * Determines whether the payload is an error thrown by Axios
  11912. *
  11913. * @param {*} payload The value to test
  11914. *
  11915. * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
  11916. */
  11917. function isAxiosError(payload) {
  11918. return utils.isObject(payload) && (payload.isAxiosError === true);
  11919. }
  11920.  
  11921. const HttpStatusCode = {
  11922. Continue: 100,
  11923. SwitchingProtocols: 101,
  11924. Processing: 102,
  11925. EarlyHints: 103,
  11926. Ok: 200,
  11927. Created: 201,
  11928. Accepted: 202,
  11929. NonAuthoritativeInformation: 203,
  11930. NoContent: 204,
  11931. ResetContent: 205,
  11932. PartialContent: 206,
  11933. MultiStatus: 207,
  11934. AlreadyReported: 208,
  11935. ImUsed: 226,
  11936. MultipleChoices: 300,
  11937. MovedPermanently: 301,
  11938. Found: 302,
  11939. SeeOther: 303,
  11940. NotModified: 304,
  11941. UseProxy: 305,
  11942. Unused: 306,
  11943. TemporaryRedirect: 307,
  11944. PermanentRedirect: 308,
  11945. BadRequest: 400,
  11946. Unauthorized: 401,
  11947. PaymentRequired: 402,
  11948. Forbidden: 403,
  11949. NotFound: 404,
  11950. MethodNotAllowed: 405,
  11951. NotAcceptable: 406,
  11952. ProxyAuthenticationRequired: 407,
  11953. RequestTimeout: 408,
  11954. Conflict: 409,
  11955. Gone: 410,
  11956. LengthRequired: 411,
  11957. PreconditionFailed: 412,
  11958. PayloadTooLarge: 413,
  11959. UriTooLong: 414,
  11960. UnsupportedMediaType: 415,
  11961. RangeNotSatisfiable: 416,
  11962. ExpectationFailed: 417,
  11963. ImATeapot: 418,
  11964. MisdirectedRequest: 421,
  11965. UnprocessableEntity: 422,
  11966. Locked: 423,
  11967. FailedDependency: 424,
  11968. TooEarly: 425,
  11969. UpgradeRequired: 426,
  11970. PreconditionRequired: 428,
  11971. TooManyRequests: 429,
  11972. RequestHeaderFieldsTooLarge: 431,
  11973. UnavailableForLegalReasons: 451,
  11974. InternalServerError: 500,
  11975. NotImplemented: 501,
  11976. BadGateway: 502,
  11977. ServiceUnavailable: 503,
  11978. GatewayTimeout: 504,
  11979. HttpVersionNotSupported: 505,
  11980. VariantAlsoNegotiates: 506,
  11981. InsufficientStorage: 507,
  11982. LoopDetected: 508,
  11983. NotExtended: 510,
  11984. NetworkAuthenticationRequired: 511,
  11985. };
  11986.  
  11987. Object.entries(HttpStatusCode).forEach(([key, value]) => {
  11988. HttpStatusCode[value] = key;
  11989. });
  11990.  
  11991. var HttpStatusCode$1 = HttpStatusCode;
  11992.  
  11993. /**
  11994. * Create an instance of Axios
  11995. *
  11996. * @param {Object} defaultConfig The default config for the instance
  11997. *
  11998. * @returns {Axios} A new instance of Axios
  11999. */
  12000. function createInstance(defaultConfig) {
  12001. const context = new Axios$1(defaultConfig);
  12002. const instance = bind(Axios$1.prototype.request, context);
  12003.  
  12004. // Copy axios.prototype to instance
  12005. utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
  12006.  
  12007. // Copy context to instance
  12008. utils.extend(instance, context, null, {allOwnKeys: true});
  12009.  
  12010. // Factory for creating new instances
  12011. instance.create = function create(instanceConfig) {
  12012. return createInstance(mergeConfig(defaultConfig, instanceConfig));
  12013. };
  12014.  
  12015. return instance;
  12016. }
  12017.  
  12018. // Create the default instance to be exported
  12019. const axios = createInstance(defaults$1);
  12020.  
  12021. // Expose Axios class to allow class inheritance
  12022. axios.Axios = Axios$1;
  12023.  
  12024. // Expose Cancel & CancelToken
  12025. axios.CanceledError = CanceledError;
  12026. axios.CancelToken = CancelToken$1;
  12027. axios.isCancel = isCancel;
  12028. axios.VERSION = VERSION;
  12029. axios.toFormData = toFormData;
  12030.  
  12031. // Expose AxiosError class
  12032. axios.AxiosError = AxiosError;
  12033.  
  12034. // alias for CanceledError for backward compatibility
  12035. axios.Cancel = axios.CanceledError;
  12036.  
  12037. // Expose all/spread
  12038. axios.all = function all(promises) {
  12039. return Promise.all(promises);
  12040. };
  12041.  
  12042. axios.spread = spread;
  12043.  
  12044. // Expose isAxiosError
  12045. axios.isAxiosError = isAxiosError;
  12046.  
  12047. // Expose mergeConfig
  12048. axios.mergeConfig = mergeConfig;
  12049.  
  12050. axios.AxiosHeaders = AxiosHeaders$1;
  12051.  
  12052. axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
  12053.  
  12054. axios.getAdapter = adapters.getAdapter;
  12055.  
  12056. axios.HttpStatusCode = HttpStatusCode$1;
  12057.  
  12058. axios.default = axios;
  12059.  
  12060. module.exports = axios;
  12061. //# sourceMappingURL=axios.cjs.map
  12062.  
  12063.  
  12064. /***/ }),
  12065. /* 5 */
  12066. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12067.  
  12068. "use strict";
  12069.  
  12070. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  12071. if (k2 === undefined) k2 = k;
  12072. var desc = Object.getOwnPropertyDescriptor(m, k);
  12073. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  12074. desc = { enumerable: true, get: function() { return m[k]; } };
  12075. }
  12076. Object.defineProperty(o, k2, desc);
  12077. }) : (function(o, m, k, k2) {
  12078. if (k2 === undefined) k2 = k;
  12079. o[k2] = m[k];
  12080. }));
  12081. var __exportStar = (this && this.__exportStar) || function(m, exports) {
  12082. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
  12083. };
  12084. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12085. __exportStar(__webpack_require__(37), exports);
  12086. __exportStar(__webpack_require__(38), exports);
  12087. __exportStar(__webpack_require__(39), exports);
  12088. __exportStar(__webpack_require__(40), exports);
  12089. __exportStar(__webpack_require__(41), exports);
  12090. __exportStar(__webpack_require__(42), exports);
  12091. __exportStar(__webpack_require__(17), exports);
  12092. __exportStar(__webpack_require__(43), exports);
  12093. __exportStar(__webpack_require__(44), exports);
  12094. __exportStar(__webpack_require__(45), exports);
  12095. __exportStar(__webpack_require__(46), exports);
  12096. __exportStar(__webpack_require__(30), exports);
  12097.  
  12098.  
  12099. /***/ }),
  12100. /* 6 */
  12101. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12102.  
  12103. "use strict";
  12104.  
  12105. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  12106. if (k2 === undefined) k2 = k;
  12107. var desc = Object.getOwnPropertyDescriptor(m, k);
  12108. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  12109. desc = { enumerable: true, get: function() { return m[k]; } };
  12110. }
  12111. Object.defineProperty(o, k2, desc);
  12112. }) : (function(o, m, k, k2) {
  12113. if (k2 === undefined) k2 = k;
  12114. o[k2] = m[k];
  12115. }));
  12116. var __exportStar = (this && this.__exportStar) || function(m, exports) {
  12117. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
  12118. };
  12119. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12120. __exportStar(__webpack_require__(12), exports);
  12121. __exportStar(__webpack_require__(20), exports);
  12122. __exportStar(__webpack_require__(13), exports);
  12123. __exportStar(__webpack_require__(7), exports);
  12124. __exportStar(__webpack_require__(25), exports);
  12125. __exportStar(__webpack_require__(51), exports);
  12126. __exportStar(__webpack_require__(26), exports);
  12127.  
  12128.  
  12129. /***/ }),
  12130. /* 7 */
  12131. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12132.  
  12133. "use strict";
  12134.  
  12135. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  12136. if (k2 === undefined) k2 = k;
  12137. var desc = Object.getOwnPropertyDescriptor(m, k);
  12138. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  12139. desc = { enumerable: true, get: function() { return m[k]; } };
  12140. }
  12141. Object.defineProperty(o, k2, desc);
  12142. }) : (function(o, m, k, k2) {
  12143. if (k2 === undefined) k2 = k;
  12144. o[k2] = m[k];
  12145. }));
  12146. var __exportStar = (this && this.__exportStar) || function(m, exports) {
  12147. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
  12148. };
  12149. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12150. __exportStar(__webpack_require__(21), exports);
  12151. __exportStar(__webpack_require__(22), exports);
  12152. __exportStar(__webpack_require__(23), exports);
  12153. __exportStar(__webpack_require__(24), exports);
  12154.  
  12155.  
  12156. /***/ }),
  12157. /* 8 */
  12158. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12159.  
  12160. "use strict";
  12161.  
  12162. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12163. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12164. return new (P || (P = Promise))(function (resolve, reject) {
  12165. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12166. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12167. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12168. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12169. });
  12170. };
  12171. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12172. exports.GitlabHttpClient = void 0;
  12173. const axios_1 = __webpack_require__(4);
  12174. const config_1 = __webpack_require__(0);
  12175. const types_1 = __webpack_require__(5);
  12176. const get_gl_token_1 = __webpack_require__(9);
  12177. const http_client_base_1 = __webpack_require__(3);
  12178. class GitlabHttpClient extends http_client_base_1.HttpClient {
  12179. constructor(_token) {
  12180. super(config_1.gitlabApiUrl);
  12181. this._token = _token;
  12182. this._handleRequest = (config) => {
  12183. if (!!config && !!config.headers) {
  12184. config.headers['PRIVATE-TOKEN'] = this._token || '';
  12185. }
  12186. return config;
  12187. };
  12188. this._handleUnauthorizedError = (error) => {
  12189. var _a;
  12190. if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
  12191. this._token = (0, get_gl_token_1.getGitlabToken)();
  12192. }
  12193. return Promise.reject(error);
  12194. };
  12195. this._initInterceptor = () => {
  12196. this.client.interceptors.request.use(this._handleRequest, this._handleError);
  12197. };
  12198. this._init();
  12199. }
  12200. static getInstance() {
  12201. if (!this.instance) {
  12202. this.instance = new GitlabHttpClient();
  12203. }
  12204. return this.instance;
  12205. }
  12206. getPipelines() {
  12207. return __awaiter(this, void 0, void 0, function* () {
  12208. try {
  12209. const pipelines = yield this.client.get(`projects/${config_1.gitlabProjectId}/pipelines`);
  12210. return pipelines;
  12211. }
  12212. catch (error) {
  12213. if (error instanceof axios_1.AxiosError) {
  12214. this._handleUnauthorizedError(error);
  12215. }
  12216. }
  12217. });
  12218. }
  12219. getPipelineSchedules() {
  12220. return __awaiter(this, void 0, void 0, function* () {
  12221. try {
  12222. const schedules = yield this.client.get(`projects/${config_1.gitlabProjectId}/pipeline_schedules`);
  12223. return schedules;
  12224. }
  12225. catch (error) {
  12226. if (error instanceof axios_1.AxiosError) {
  12227. this._handleUnauthorizedError(error);
  12228. }
  12229. }
  12230. });
  12231. }
  12232. getPipeLineScheduleById(scheduleId) {
  12233. return __awaiter(this, void 0, void 0, function* () {
  12234. if (!scheduleId) {
  12235. throw new Error('scheduleId is required');
  12236. }
  12237. try {
  12238. const schedule = yield this.client.get(`projects/${config_1.gitlabProjectId}/pipeline_schedules/${scheduleId}`);
  12239. return schedule;
  12240. }
  12241. catch (error) {
  12242. if (error instanceof axios_1.AxiosError) {
  12243. this._handleUnauthorizedError(error);
  12244. }
  12245. }
  12246. });
  12247. }
  12248. createPipelineSchedule(schedule) {
  12249. return __awaiter(this, void 0, void 0, function* () {
  12250. try {
  12251. const newSchedule = yield this.client.post(`projects/${config_1.gitlabProjectId}/pipeline_schedules`, schedule);
  12252. const { id } = newSchedule;
  12253. yield Promise.all((schedule.variables || []).map((variable) => this.createPipelineScheduleVariable(id, variable)));
  12254. return newSchedule;
  12255. }
  12256. catch (error) {
  12257. if (error instanceof axios_1.AxiosError) {
  12258. this._handleUnauthorizedError(error);
  12259. }
  12260. }
  12261. });
  12262. }
  12263. createPipelineScheduleVariable(scheduleId, variable) {
  12264. return __awaiter(this, void 0, void 0, function* () {
  12265. if (!scheduleId) {
  12266. throw new Error('scheduleId is required');
  12267. }
  12268. const _newVariable = {
  12269. key: variable.key,
  12270. value: variable.value,
  12271. variable_type: variable.variable_type !== types_1.CreateGitlabScheduleVariableTypes.FILE
  12272. ? types_1.CreateGitlabScheduleVariableTypes.ENV_VAR
  12273. : types_1.CreateGitlabScheduleVariableTypes.FILE,
  12274. };
  12275. try {
  12276. const newVariable = yield this.client.post(`projects/${config_1.gitlabProjectId}/pipeline_schedules/${scheduleId}/variables`, _newVariable);
  12277. return newVariable;
  12278. }
  12279. catch (error) {
  12280. if (error instanceof axios_1.AxiosError) {
  12281. this._handleUnauthorizedError(error);
  12282. }
  12283. }
  12284. });
  12285. }
  12286. getProjectBranches(projectId) {
  12287. return __awaiter(this, void 0, void 0, function* () {
  12288. try {
  12289. const branches = yield this.client.get(`projects/${projectId || config_1.gitlabProjectId}/repository/branches?per_page=${config_1.gitlabRestPerPage}`);
  12290. return branches.map((branch) => branch.name);
  12291. }
  12292. catch (error) {
  12293. if (error instanceof axios_1.AxiosError) {
  12294. this._handleUnauthorizedError(error);
  12295. }
  12296. }
  12297. });
  12298. }
  12299. getProjectVariables(projectId) {
  12300. return __awaiter(this, void 0, void 0, function* () {
  12301. try {
  12302. const variables = yield this.client.get(`projects/${projectId}/variables`);
  12303. return variables;
  12304. }
  12305. catch (error) {
  12306. if (error instanceof axios_1.AxiosError) {
  12307. this._handleUnauthorizedError(error);
  12308. }
  12309. }
  12310. });
  12311. }
  12312. _init() {
  12313. this._token = (0, get_gl_token_1.getTokenFromLocalStorage)();
  12314. this._initInterceptor();
  12315. }
  12316. }
  12317. exports.GitlabHttpClient = GitlabHttpClient;
  12318.  
  12319.  
  12320. /***/ }),
  12321. /* 9 */
  12322. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  12323.  
  12324. "use strict";
  12325.  
  12326. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12327. exports.getGitlabToken = exports.getTokenFromLocalStorage = void 0;
  12328. const config_1 = __webpack_require__(0);
  12329. function getTokenFromLocalStorage() {
  12330. const _lsToken = window.atob(localStorage.getItem(config_1.gitlabTokenLocalStorageKey) || '');
  12331. if (_lsToken && _lsToken.length > 0) {
  12332. return _lsToken;
  12333. }
  12334. else {
  12335. return '';
  12336. }
  12337. }
  12338. exports.getTokenFromLocalStorage = getTokenFromLocalStorage;
  12339. function getGitlabToken() {
  12340. const inputToken = prompt('Invalid Gitlab token. Please enter a valid token:');
  12341. if (inputToken && inputToken.length > 0) {
  12342. (0, config_1.saveGitlabToken)(inputToken);
  12343. return inputToken;
  12344. }
  12345. else {
  12346. throw new Error('token is required');
  12347. }
  12348. }
  12349. exports.getGitlabToken = getGitlabToken;
  12350.  
  12351.  
  12352. /***/ }),
  12353. /* 10 */
  12354. /***/ ((__unused_webpack_module, exports) => {
  12355.  
  12356. "use strict";
  12357.  
  12358. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12359. exports.getProjectIdFromTemplateVar = exports.getScheduleIdFromUrl = exports.getScheduleIdFromGid = exports.getOptionsFromVarDescription = exports.getProjectFullPath = exports.isPipelineScheduleUrl = exports.isEditPipelineScheduleUrl = exports.getGitlabScheduleIdFromUrl = void 0;
  12360. const getGitlabScheduleIdFromUrl = (url) => {
  12361. const regex = /\/pipeline_schedules\/(\d+)/;
  12362. const match = url === null || url === void 0 ? void 0 : url.match(regex);
  12363. return (match === null || match === void 0 ? void 0 : match[1]) || '';
  12364. };
  12365. exports.getGitlabScheduleIdFromUrl = getGitlabScheduleIdFromUrl;
  12366. const isEditPipelineScheduleUrl = (url) => {
  12367. const regex = /\/pipeline_schedules\/(\d+)\/edit/;
  12368. return regex.test(url || '');
  12369. };
  12370. exports.isEditPipelineScheduleUrl = isEditPipelineScheduleUrl;
  12371. const isPipelineScheduleUrl = (url) => {
  12372. const regex = /\/pipeline_schedules$/;
  12373. return regex.test(url || '');
  12374. };
  12375. exports.isPipelineScheduleUrl = isPipelineScheduleUrl;
  12376. const getProjectFullPath = (url) => {
  12377. const regex = /\/(.*?)\/-\/pipeline_schedules/;
  12378. const match = url.match(regex);
  12379. return (match === null || match === void 0 ? void 0 : match[1]) || '';
  12380. };
  12381. exports.getProjectFullPath = getProjectFullPath;
  12382. const getOptionsFromVarDescription = (description) => {
  12383. var _a;
  12384. const regex = /^\[(.*?)\]/;
  12385. const match = description.match(regex);
  12386. return ((_a = match === null || match === void 0 ? void 0 : match[1]) === null || _a === void 0 ? void 0 : _a.split(',').map((value) => value.trim())) || [];
  12387. };
  12388. exports.getOptionsFromVarDescription = getOptionsFromVarDescription;
  12389. const getScheduleIdFromGid = (gid) => {
  12390. //gid://gitlab/Ci::PipelineSchedule/<six_digits>
  12391. const regex = /\/(\d+)$/;
  12392. const match = gid.match(regex);
  12393. return (match === null || match === void 0 ? void 0 : match[1]) || '';
  12394. };
  12395. exports.getScheduleIdFromGid = getScheduleIdFromGid;
  12396. const getScheduleIdFromUrl = (url) => {
  12397. //https://gitlab.com/<project_path>/-/pipeline_schedules/<schedule_id>/edit?id=<schedule_id>
  12398. const regex = /\/pipeline_schedules\/(\d+)/;
  12399. const match = url.match(regex);
  12400. return (match === null || match === void 0 ? void 0 : match[1]) || '';
  12401. };
  12402. exports.getScheduleIdFromUrl = getScheduleIdFromUrl;
  12403. /**
  12404. * Get project id from template variable string format '$glBranches(:project_id)'
  12405. * @param varStr sample string: '$glBranches(41703858)'
  12406. * @returns project id
  12407. */
  12408. const getProjectIdFromTemplateVar = (varStr) => {
  12409. const regex = /\$glBranches\((\d+)?\)/;
  12410. const match = varStr.match(regex);
  12411. return (match === null || match === void 0 ? void 0 : match[1]) || '';
  12412. };
  12413. exports.getProjectIdFromTemplateVar = getProjectIdFromTemplateVar;
  12414.  
  12415.  
  12416. /***/ }),
  12417. /* 11 */
  12418. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12419.  
  12420. "use strict";
  12421.  
  12422. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  12423. if (k2 === undefined) k2 = k;
  12424. var desc = Object.getOwnPropertyDescriptor(m, k);
  12425. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  12426. desc = { enumerable: true, get: function() { return m[k]; } };
  12427. }
  12428. Object.defineProperty(o, k2, desc);
  12429. }) : (function(o, m, k, k2) {
  12430. if (k2 === undefined) k2 = k;
  12431. o[k2] = m[k];
  12432. }));
  12433. var __exportStar = (this && this.__exportStar) || function(m, exports) {
  12434. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
  12435. };
  12436. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12437. __exportStar(__webpack_require__(15), exports);
  12438. __exportStar(__webpack_require__(28), exports);
  12439.  
  12440.  
  12441. /***/ }),
  12442. /* 12 */
  12443. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12444.  
  12445. "use strict";
  12446.  
  12447. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12448. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12449. return new (P || (P = Promise))(function (resolve, reject) {
  12450. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12451. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12452. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12453. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12454. });
  12455. };
  12456. var __importDefault = (this && this.__importDefault) || function (mod) {
  12457. return (mod && mod.__esModule) ? mod : { "default": mod };
  12458. };
  12459. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12460. exports.DuplicateBtnComponent = void 0;
  12461. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  12462. const config_1 = __webpack_require__(0);
  12463. const shared_1 = __webpack_require__(2);
  12464. function DuplicateBtnComponent(scheduleId) {
  12465. if (!scheduleId) {
  12466. return;
  12467. }
  12468. const duplicateBtnHtml = `
  12469. <a title="Duplicate" class="btn gl-button btn-default btn-icon" style="margin-right: 1em;">
  12470. <svg class="s16" data-testid="duplicate-icon">
  12471. <use href="${config_1.gitlabSvgIconUrl}#duplicate"></use>
  12472. </svg>
  12473. </a>`;
  12474. const duplicateBtnJObject = (0, jquery_slim_1.default)(duplicateBtnHtml);
  12475. // add click event to the duplicateBtn
  12476. duplicateBtnJObject.on('click', function () {
  12477. return __awaiter(this, void 0, void 0, function* () {
  12478. const glClient = shared_1.GitlabHttpClient.getInstance();
  12479. const schedule = yield glClient.getPipeLineScheduleById(scheduleId);
  12480. if (!schedule)
  12481. return;
  12482. const newSchedule = yield glClient.createPipelineSchedule({
  12483. active: schedule.active,
  12484. cron: schedule.cron,
  12485. cron_timezone: schedule.cron_timezone,
  12486. description: `${schedule.description}-copy`,
  12487. ref: schedule.ref,
  12488. variables: schedule.variables,
  12489. });
  12490. if (!!newSchedule && confirm(`Duplicated successfully! Go to the edit page?`)) {
  12491. window.location.href = `${window.location.href}/${newSchedule === null || newSchedule === void 0 ? void 0 : newSchedule.id}/edit`;
  12492. }
  12493. else {
  12494. window.location.reload();
  12495. }
  12496. });
  12497. });
  12498. return duplicateBtnJObject;
  12499. }
  12500. exports.DuplicateBtnComponent = DuplicateBtnComponent;
  12501.  
  12502.  
  12503. /***/ }),
  12504. /* 13 */
  12505. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12506.  
  12507. "use strict";
  12508.  
  12509. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12510. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12511. return new (P || (P = Promise))(function (resolve, reject) {
  12512. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12513. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12514. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12515. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12516. });
  12517. };
  12518. var __importDefault = (this && this.__importDefault) || function (mod) {
  12519. return (mod && mod.__esModule) ? mod : { "default": mod };
  12520. };
  12521. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12522. exports.DownloadEnvBtnComponent = void 0;
  12523. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  12524. const config_1 = __webpack_require__(0);
  12525. const shared_1 = __webpack_require__(2);
  12526. function DownloadEnvBtnComponent(scheduleId) {
  12527. if (!scheduleId) {
  12528. return;
  12529. }
  12530. const downloadEnvBtnHtml = `<a title="Download Env File" class="btn gl-button btn-default btn-icon">
  12531. <svg class="s16" data-testid="download-icon">
  12532. <use href="${config_1.gitlabSvgIconUrl}#download"></use>
  12533. </svg>
  12534. </a>`;
  12535. const downloadEnvBtnJObject = (0, jquery_slim_1.default)(downloadEnvBtnHtml);
  12536. // add click event to the downloadEnvBtn
  12537. downloadEnvBtnJObject.on('click', () => __awaiter(this, void 0, void 0, function* () {
  12538. var _a, _b;
  12539. const glClient = shared_1.GitlabHttpClient.getInstance();
  12540. const glGraphqlClient = shared_1.GitlabGraphqlClient.getInstance();
  12541. const variables = [];
  12542. const schedule = yield glClient.getPipeLineScheduleById(scheduleId);
  12543. if (!schedule)
  12544. return;
  12545. if (config_1.includeAllVariables) {
  12546. const fullPath = (0, shared_1.getProjectFullPath)(window.location.pathname);
  12547. const ciVariables = (yield glGraphqlClient.getCiConfigVariables(fullPath, (schedule === null || schedule === void 0 ? void 0 : schedule.ref) || config_1.gitlabDefaultPipelineSchedule.ref)) || [];
  12548. // left join ciVariables and schedule.variables
  12549. const joined = (0, shared_1.leftJoin)(ciVariables, (_a = schedule === null || schedule === void 0 ? void 0 : schedule.variables) !== null && _a !== void 0 ? _a : [], 'key', (left, right) => (Object.assign(Object.assign({}, left), right)));
  12550. variables.push(...joined);
  12551. }
  12552. else {
  12553. variables.push(...((_b = schedule === null || schedule === void 0 ? void 0 : schedule.variables) !== null && _b !== void 0 ? _b : []));
  12554. }
  12555. (0, shared_1.downloadEnvFile)(variables, schedule.description);
  12556. }));
  12557. return downloadEnvBtnJObject;
  12558. }
  12559. exports.DownloadEnvBtnComponent = DownloadEnvBtnComponent;
  12560.  
  12561.  
  12562. /***/ }),
  12563. /* 14 */
  12564. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12565.  
  12566. "use strict";
  12567.  
  12568. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12569. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12570. return new (P || (P = Promise))(function (resolve, reject) {
  12571. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12572. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12573. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12574. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12575. });
  12576. };
  12577. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12578. const styles_1 = __webpack_require__(33);
  12579. const pages_1 = __webpack_require__(11);
  12580. const shared_1 = __webpack_require__(2);
  12581. const RUN_SCRIPT_AFTER_MS = 0;
  12582. const main = () => __awaiter(void 0, void 0, void 0, function* () {
  12583. const url = window.location.href;
  12584. GM_addStyle(styles_1.css);
  12585. if ((0, shared_1.isPipelineScheduleUrl)(url)) {
  12586. setTimeout(pages_1.pipelineSchedulesPage, RUN_SCRIPT_AFTER_MS);
  12587. }
  12588. else if ((0, shared_1.isEditPipelineScheduleUrl)(url)) {
  12589. setTimeout(pages_1.editPipelineSchedulePage, RUN_SCRIPT_AFTER_MS);
  12590. }
  12591. });
  12592. (() => __awaiter(void 0, void 0, void 0, function* () {
  12593. try {
  12594. main();
  12595. }
  12596. catch (error) {
  12597. console.error(error);
  12598. }
  12599. }))();
  12600.  
  12601.  
  12602. /***/ }),
  12603. /* 15 */
  12604. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12605.  
  12606. "use strict";
  12607.  
  12608. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12609. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12610. return new (P || (P = Promise))(function (resolve, reject) {
  12611. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12612. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12613. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12614. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12615. });
  12616. };
  12617. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12618. exports.pipelineSchedulesPage = void 0;
  12619. const components_1 = __webpack_require__(6);
  12620. const shared_1 = __webpack_require__(2);
  12621. const pipelineSchedulesPage = () => __awaiter(void 0, void 0, void 0, function* () {
  12622. const glGraphqlClient = shared_1.GitlabGraphqlClient.getInstance();
  12623. const fullPath = (0, shared_1.getProjectFullPath)(window.location.pathname);
  12624. const [pipeLineIds, _] = yield Promise.all([
  12625. glGraphqlClient.getPipelineScheduleIdsQuery(fullPath),
  12626. (0, shared_1.waitForElement)('tr[data-testid="pipeline-schedule-table-row"]'), // wait for the pipeline schedule table to be rendered
  12627. ]);
  12628. // find the buttons with attribute title="Play" in the btnGroup
  12629. // let playBtns = $('.tab-pane.active').find('.btn-group').find(`[title='Run pipeline schedule']`);
  12630. // if (playBtns.length === 0) {
  12631. // playBtns = $('.btn-group').find(`[title='Play']`);
  12632. // }
  12633. // find the button with text "New schedule"
  12634. const newScheduleBtns = $('.btn.btn-confirm:contains("New schedule")');
  12635. const newScheduleBtn = $(newScheduleBtns.get());
  12636. const quickNewScheduleBtn = (0, components_1.QuickNewScheduleBtnComponent)();
  12637. const settingsBtn = (0, components_1.GitlabToolSettingsBtnComponent)();
  12638. // create a new div btnGroup with class ml-auto, move the newScheduleBtn to the enter of the new btnGroup
  12639. const newBtnGroup = $('<div class="gl-ml-auto"></div>');
  12640. newBtnGroup.insertBefore(newScheduleBtn);
  12641. newScheduleBtn.appendTo(newBtnGroup);
  12642. if (quickNewScheduleBtn) {
  12643. quickNewScheduleBtn.insertBefore(newScheduleBtn);
  12644. settingsBtn.insertAfter(newScheduleBtn);
  12645. }
  12646. // find the buttons with attribute datat-testid="delete-pipeline-schedule-btn" in the btnGroup
  12647. const deleteBtns = $('.tab-pane.active')
  12648. .find('.btn-group')
  12649. .find(`[data-testid='delete-pipeline-schedule-btn']`);
  12650. for (const [index, btnItem] of Array.from(deleteBtns).entries()) {
  12651. const delBtn = $(btnItem);
  12652. // const playBtnHref = editBtn.attr('href') as string;
  12653. // const scheduleId = getGitlabScheduleIdFromUrl(playBtnHref);
  12654. const duplicateBtn = (0, components_1.DuplicateBtnComponent)(pipeLineIds[index]);
  12655. if (duplicateBtn) {
  12656. duplicateBtn.insertBefore(delBtn);
  12657. const downloadEnvFileBtn = (0, components_1.DownloadEnvBtnComponent)(pipeLineIds[index]);
  12658. if (downloadEnvFileBtn) {
  12659. downloadEnvFileBtn.insertBefore(duplicateBtn);
  12660. }
  12661. }
  12662. }
  12663. const glChooseBranchDropdown = yield (0, components_1.ChooseBranchDropdownComponent)();
  12664. glChooseBranchDropdown.insertBefore(quickNewScheduleBtn);
  12665. });
  12666. exports.pipelineSchedulesPage = pipelineSchedulesPage;
  12667.  
  12668.  
  12669. /***/ }),
  12670. /* 16 */
  12671. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12672.  
  12673. "use strict";
  12674.  
  12675. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12676. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12677. return new (P || (P = Promise))(function (resolve, reject) {
  12678. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12679. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12680. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12681. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12682. });
  12683. };
  12684. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12685. exports.GitlabGraphqlClient = void 0;
  12686. const axios_1 = __webpack_require__(4);
  12687. const config_1 = __webpack_require__(0);
  12688. const types_1 = __webpack_require__(5);
  12689. const get_gl_token_1 = __webpack_require__(9);
  12690. const gitlab_graphql_query_1 = __webpack_require__(31);
  12691. const gitlab_resource_extractor_1 = __webpack_require__(10);
  12692. const http_client_base_1 = __webpack_require__(3);
  12693. class GitlabGraphqlClient extends http_client_base_1.HttpClient {
  12694. constructor(_token) {
  12695. super(config_1.gitlabGraphqlUrl);
  12696. this._token = _token;
  12697. this.RETRIES = 5;
  12698. this._handleRequest = (config) => {
  12699. if (!!config && !!config.headers) {
  12700. config.headers['Authorization'] = `Bearer ${this._token}`;
  12701. }
  12702. return config;
  12703. };
  12704. this._handleUnauthorizedError = (error) => {
  12705. var _a;
  12706. if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
  12707. this._token = (0, get_gl_token_1.getGitlabToken)();
  12708. }
  12709. };
  12710. this._initInterceptor = () => {
  12711. this.client.interceptors.request.use(this._handleRequest, this._handleError);
  12712. };
  12713. this._init();
  12714. }
  12715. static getInstance() {
  12716. if (!this.instance) {
  12717. this.instance = new GitlabGraphqlClient();
  12718. }
  12719. return this.instance;
  12720. }
  12721. getCiConfigVariables(projectUrl, ref) {
  12722. var _a, _b, _c;
  12723. return __awaiter(this, void 0, void 0, function* () {
  12724. let ciConfigVariables = [];
  12725. let retries = 0;
  12726. try {
  12727. let isBreak = false;
  12728. while (!isBreak && retries < this.RETRIES) {
  12729. const { data: glGetCiConfigVarRes } = yield this.client.post('', {
  12730. operationName: 'ciConfigVariables',
  12731. query: gitlab_graphql_query_1.getCiConfigVariablesQueryStr,
  12732. variables: {
  12733. fullPath: projectUrl,
  12734. ref,
  12735. },
  12736. });
  12737. if (((_a = glGetCiConfigVarRes === null || glGetCiConfigVarRes === void 0 ? void 0 : glGetCiConfigVarRes.project) === null || _a === void 0 ? void 0 : _a.ciConfigVariables) !== null &&
  12738. !!glGetCiConfigVarRes &&
  12739. ((_c = (_b = glGetCiConfigVarRes === null || glGetCiConfigVarRes === void 0 ? void 0 : glGetCiConfigVarRes.project) === null || _b === void 0 ? void 0 : _b.ciConfigVariables) === null || _c === void 0 ? void 0 : _c.length) != 0) {
  12740. ciConfigVariables = glGetCiConfigVarRes.project.ciConfigVariables;
  12741. isBreak = true;
  12742. }
  12743. retries++;
  12744. }
  12745. return ciConfigVariables
  12746. ? ciConfigVariables
  12747. .filter((variable) => variable.description !== null)
  12748. .map((variable) => ({
  12749. key: variable.key,
  12750. value: variable.value,
  12751. description: variable.description,
  12752. variable_type: types_1.GitlabScheduleVariableTypes.ENV_VAR,
  12753. valueOptions: variable.valueOptions,
  12754. }))
  12755. : [];
  12756. }
  12757. catch (error) {
  12758. if (error instanceof axios_1.AxiosError) {
  12759. this._handleUnauthorizedError(error);
  12760. }
  12761. }
  12762. });
  12763. }
  12764. /**
  12765. * Get Gitlab pipeline schedules by ids
  12766. * @param projectPath
  12767. * @param ids - let null to get all schedules
  12768. * @returns
  12769. */
  12770. getPipelineSchedulesQuery(projectPath, ids = null) {
  12771. return __awaiter(this, void 0, void 0, function* () {
  12772. const { data } = yield this.client.post('', {
  12773. operationName: 'getPipelineSchedulesQuery',
  12774. query: gitlab_graphql_query_1.getPipelineSchedulesQueryStr,
  12775. variables: {
  12776. ids: ids,
  12777. projectPath,
  12778. first: 50,
  12779. last: null,
  12780. nextPageCursor: '',
  12781. prevPageCursor: '',
  12782. },
  12783. });
  12784. return data;
  12785. });
  12786. }
  12787. getPipelineScheduleIdsQuery(projectPath) {
  12788. var _a, _b, _c;
  12789. return __awaiter(this, void 0, void 0, function* () {
  12790. const res = yield this.getPipelineSchedulesQuery(projectPath);
  12791. return (_c = (_b = (_a = res === null || res === void 0 ? void 0 : res.project) === null || _a === void 0 ? void 0 : _a.pipelineSchedules) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.map((node) => {
  12792. return (0, gitlab_resource_extractor_1.getScheduleIdFromGid)(node.id);
  12793. });
  12794. });
  12795. }
  12796. updatePipelineSchedule(pipelineScheduleId, projectPath, updatedPipelineSchedule) {
  12797. var _a;
  12798. return __awaiter(this, void 0, void 0, function* () {
  12799. const updatedVariables = updatedPipelineSchedule.variables;
  12800. const crtPipelineSchedule = yield this.getPipelineSchedulesQuery(projectPath, pipelineScheduleId);
  12801. const crtPipelineScheduleVariables = (_a = crtPipelineSchedule.project.pipelineSchedules.nodes[0]) === null || _a === void 0 ? void 0 : _a.variables.nodes;
  12802. const _variables = crtPipelineScheduleVariables === null || crtPipelineScheduleVariables === void 0 ? void 0 : crtPipelineScheduleVariables.map((pipelineVariable) => {
  12803. const updatedVariable = updatedVariables.find((variable) => variable.key === pipelineVariable.key);
  12804. // check pipelineVariable is deleted by key
  12805. const isDeleted = updatedVariables.findIndex((variable) => variable.key === pipelineVariable.key) === -1;
  12806. return Object.assign(Object.assign({}, pipelineVariable), { __typename: undefined, value: (updatedVariable === null || updatedVariable === void 0 ? void 0 : updatedVariable.value) || '', destroy: isDeleted });
  12807. });
  12808. // check if there are new variables in updatedVariables by key
  12809. const newVariables = updatedVariables.filter((variable) => {
  12810. return ((crtPipelineScheduleVariables === null || crtPipelineScheduleVariables === void 0 ? void 0 : crtPipelineScheduleVariables.findIndex((pipelineVariable) => pipelineVariable.key === variable.key)) === -1);
  12811. });
  12812. const _newVariables = newVariables.map((_newVariable) => {
  12813. return {
  12814. key: _newVariable.key,
  12815. value: _newVariable.value,
  12816. variableType: 'ENV_VAR',
  12817. };
  12818. });
  12819. if (newVariables.length > 0) {
  12820. _variables === null || _variables === void 0 ? void 0 : _variables.push(..._newVariables);
  12821. }
  12822. const payload = {
  12823. operationName: 'updatePipelineSchedule',
  12824. query: gitlab_graphql_query_1.updatePipelineScheduleMutationStr,
  12825. variables: {
  12826. input: Object.assign(Object.assign({}, crtPipelineSchedule.project.pipelineSchedules.nodes[0]), { active: updatedPipelineSchedule.activate, cron: updatedPipelineSchedule.cron, cronTimezone: updatedPipelineSchedule.cronTimezone, description: updatedPipelineSchedule.description, ref: updatedPipelineSchedule.ref, variables: _variables,
  12827. // remove unused fields
  12828. __typename: undefined, editPath: undefined, forTag: undefined, lastPipeline: undefined, nextRunAt: undefined, realNextRun: undefined, refForDisplay: undefined, refPath: undefined, userPermissions: undefined, owner: undefined }),
  12829. },
  12830. };
  12831. const res = yield this.client.post('', payload);
  12832. return res;
  12833. });
  12834. }
  12835. _init() {
  12836. this._token = (0, get_gl_token_1.getTokenFromLocalStorage)();
  12837. this._initInterceptor();
  12838. }
  12839. }
  12840. exports.GitlabGraphqlClient = GitlabGraphqlClient;
  12841.  
  12842.  
  12843. /***/ }),
  12844. /* 17 */
  12845. /***/ ((__unused_webpack_module, exports) => {
  12846.  
  12847. "use strict";
  12848.  
  12849. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12850. exports.CreateGitlabScheduleVariableTypes = exports.GitlabScheduleVariableTypes = void 0;
  12851. var GitlabScheduleVariableTypes;
  12852. (function (GitlabScheduleVariableTypes) {
  12853. GitlabScheduleVariableTypes["ENV_VAR"] = "Variable";
  12854. GitlabScheduleVariableTypes["FILE"] = "File";
  12855. })(GitlabScheduleVariableTypes = exports.GitlabScheduleVariableTypes || (exports.GitlabScheduleVariableTypes = {}));
  12856. var CreateGitlabScheduleVariableTypes;
  12857. (function (CreateGitlabScheduleVariableTypes) {
  12858. CreateGitlabScheduleVariableTypes["ENV_VAR"] = "env_var";
  12859. CreateGitlabScheduleVariableTypes["FILE"] = "file";
  12860. })(CreateGitlabScheduleVariableTypes = exports.CreateGitlabScheduleVariableTypes || (exports.CreateGitlabScheduleVariableTypes = {}));
  12861.  
  12862.  
  12863. /***/ }),
  12864. /* 18 */
  12865. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12866.  
  12867. "use strict";
  12868.  
  12869. var __importDefault = (this && this.__importDefault) || function (mod) {
  12870. return (mod && mod.__esModule) ? mod : { "default": mod };
  12871. };
  12872. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12873. exports.$ = void 0;
  12874. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  12875. function $(selector) {
  12876. const htmlElements = (0, jquery_slim_1.default)(selector);
  12877. if (htmlElements.length === 0) {
  12878. console.error(`No element found for selector ${selector}`);
  12879. }
  12880. return htmlElements;
  12881. }
  12882. exports.$ = $;
  12883.  
  12884.  
  12885. /***/ }),
  12886. /* 19 */
  12887. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12888.  
  12889. "use strict";
  12890.  
  12891. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12892. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12893. return new (P || (P = Promise))(function (resolve, reject) {
  12894. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12895. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12896. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12897. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12898. });
  12899. };
  12900. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12901. exports.VarOptionStorage = void 0;
  12902. const gitlab_http_client_1 = __webpack_require__(8);
  12903. const gitlab_resource_extractor_1 = __webpack_require__(10);
  12904. class VarOptionStorage {
  12905. constructor() {
  12906. this.glHttpClient = gitlab_http_client_1.GitlabHttpClient.getInstance();
  12907. this.options = {};
  12908. }
  12909. static getInstance() {
  12910. if (!VarOptionStorage.instance) {
  12911. VarOptionStorage.instance = new VarOptionStorage();
  12912. }
  12913. return VarOptionStorage.instance;
  12914. }
  12915. // Extract the options from the variable description
  12916. setOptions(options) {
  12917. return __awaiter(this, void 0, void 0, function* () {
  12918. const promises = [];
  12919. for (const key of Object.keys(options)) {
  12920. const values = options[key];
  12921. if (!!values) {
  12922. for (let i = 0; i < values.length; i++) {
  12923. const value = values[i];
  12924. if (!!value) {
  12925. if (value.match(/\$glBranches\((\d+)?\)/)) {
  12926. const projectId = (0, gitlab_resource_extractor_1.getProjectIdFromTemplateVar)(value);
  12927. promises.push(this.glHttpClient.getProjectBranches(projectId).then((branches) => {
  12928. values.splice(i, 1, ...(branches || []));
  12929. }));
  12930. }
  12931. }
  12932. }
  12933. }
  12934. }
  12935. yield Promise.all(promises);
  12936. this.options = options;
  12937. });
  12938. }
  12939. getOptions() {
  12940. return this.options;
  12941. }
  12942. getOptionsByKey(key) {
  12943. return this.options[key] || [];
  12944. }
  12945. hasOptions() {
  12946. return Object.keys(this.options).length > 0;
  12947. }
  12948. addOption(key, value) {
  12949. var _a, _b;
  12950. if (!this.options[key]) {
  12951. this.options[key] = [];
  12952. }
  12953. if (((_a = this.options[key]) === null || _a === void 0 ? void 0 : _a.indexOf(value)) === -1) {
  12954. (_b = this.options[key]) === null || _b === void 0 ? void 0 : _b.push(value);
  12955. }
  12956. }
  12957. removeOption(key, value) {
  12958. var _a, _b;
  12959. if (!this.options[key]) {
  12960. return;
  12961. }
  12962. const index = ((_a = this.options[key]) === null || _a === void 0 ? void 0 : _a.indexOf(value)) || -1;
  12963. if (index !== -1) {
  12964. (_b = this.options[key]) === null || _b === void 0 ? void 0 : _b.splice(index, 1);
  12965. }
  12966. }
  12967. }
  12968. exports.VarOptionStorage = VarOptionStorage;
  12969.  
  12970.  
  12971. /***/ }),
  12972. /* 20 */
  12973. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  12974.  
  12975. "use strict";
  12976.  
  12977. var __importDefault = (this && this.__importDefault) || function (mod) {
  12978. return (mod && mod.__esModule) ? mod : { "default": mod };
  12979. };
  12980. Object.defineProperty(exports, "__esModule", ({ value: true }));
  12981. exports.QuickNewScheduleBtnComponent = void 0;
  12982. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  12983. function QuickNewScheduleBtnComponent() {
  12984. const quickNewScheduleBtnHtml = `
  12985. <a class="btn gl-button btn-success mr-2">
  12986. <span>Quick new schedule</span>
  12987. </a>`;
  12988. const quickNewScheduleBtnJObject = (0, jquery_slim_1.default)(quickNewScheduleBtnHtml);
  12989. quickNewScheduleBtnJObject.on('click', function () {
  12990. (0, jquery_slim_1.default)(`#gs-dropdown-choose-branch`).toggle();
  12991. });
  12992. return quickNewScheduleBtnJObject;
  12993. }
  12994. exports.QuickNewScheduleBtnComponent = QuickNewScheduleBtnComponent;
  12995.  
  12996.  
  12997. /***/ }),
  12998. /* 21 */
  12999. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13000.  
  13001. "use strict";
  13002.  
  13003. var __importDefault = (this && this.__importDefault) || function (mod) {
  13004. return (mod && mod.__esModule) ? mod : { "default": mod };
  13005. };
  13006. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13007. exports.GitlabCheckboxComponent = void 0;
  13008. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  13009. function GitlabCheckboxComponent(label, controlLabel, className, checked = true, checkboxId) {
  13010. const _checkboxId = checkboxId !== null && checkboxId !== void 0 ? checkboxId : label.replaceAll(' ', '') + '_checkbox';
  13011. const checkboxComponentHtml = `
  13012. <div class="${className !== null && className !== void 0 ? className : 'col-md-2'}">
  13013. <label class="label-bold" for="${_checkboxId}">${label}</label>
  13014. <div>
  13015. <div class="gl-form-checkbox custom-control custom-checkbox">
  13016. <input class="custom-control-input" type="checkbox" id="${_checkboxId}" ${checked ? 'checked' : ''}>
  13017. <label class="custom-control-label" for="${_checkboxId}"><span>${controlLabel}</span></label>
  13018. </div>
  13019. </div>
  13020. </div>
  13021. `;
  13022. return (0, jquery_slim_1.default)(checkboxComponentHtml);
  13023. }
  13024. exports.GitlabCheckboxComponent = GitlabCheckboxComponent;
  13025.  
  13026.  
  13027. /***/ }),
  13028. /* 22 */
  13029. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13030.  
  13031. "use strict";
  13032.  
  13033. var __importDefault = (this && this.__importDefault) || function (mod) {
  13034. return (mod && mod.__esModule) ? mod : { "default": mod };
  13035. };
  13036. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13037. exports.GitlabDropdownComponent = void 0;
  13038. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  13039. const config_1 = __webpack_require__(0);
  13040. function GitlabDropdownComponent(dropdownName, dropdownTitle, dropdownItems) {
  13041. // Dropdown
  13042. const glDropdownHtml = `
  13043. <div class="dropdown b-dropdown gl-dropdown undefined btn-group" id="gs-dropdown-${dropdownName}">
  13044. </div>`;
  13045. const glDropdownJObject = (0, jquery_slim_1.default)(glDropdownHtml);
  13046. glDropdownJObject.hide();
  13047. // Dropdown toggle button
  13048. const glDropdownToggleBtnHtml = `
  13049. <button aria-haspopup="true" aria-expanded="false" type="button" class="btn dropdown-toggle btn-default btn-md gl-button gl-dropdown-toggle">
  13050. <span class="gl-dropdown-button-text">${dropdownTitle}</span>
  13051. <svg data-testid="chevron-down-icon" role="img" aria-hidden="true" class="gl-button-icon dropdown-chevron gl-icon s16">
  13052. <use href="${config_1.gitlabSvgIconUrl}#chevron-down"></use>
  13053. </svg>
  13054. </button>`;
  13055. const glDropdownToggleBtnJObject = (0, jquery_slim_1.default)(glDropdownToggleBtnHtml);
  13056. glDropdownJObject.on('click', () => {
  13057. (0, jquery_slim_1.default)(`#gs-dropdown-${dropdownName}`).toggleClass('show');
  13058. });
  13059. glDropdownJObject.append(glDropdownToggleBtnJObject);
  13060. // Dropdown menu
  13061. const glDropdownMenuHtml = `
  13062. <ul role="menu" tabindex="-1" class="dropdown-menu" aria-labelledby="" style="">
  13063. <div class="gl-dropdown-inner">
  13064. <div class="gl-dropdown-contents" id="gs-dropdown-contents-${dropdownName}">
  13065. </div>
  13066. </div>
  13067. </ul>`;
  13068. const glDropdownMenuJObject = (0, jquery_slim_1.default)(glDropdownMenuHtml);
  13069. glDropdownJObject.append(glDropdownMenuJObject);
  13070. // Dropdown menu items
  13071. const addItemsToDropdown = (items) => {
  13072. for (const item of items) {
  13073. const glDropdownMenuItemHtml = `
  13074. <li role="presentation" class="gl-dropdown-item">
  13075. <button role="menuitem" type="button" class="dropdown-item">
  13076. <div class="gl-dropdown-item-text-wrapper">
  13077. <p class="gl-dropdown-item-text-primary">${item.text}</p>
  13078. </div>
  13079. </button>
  13080. </li>`;
  13081. const glDropdownMenuItemJObject = (0, jquery_slim_1.default)(glDropdownMenuItemHtml);
  13082. glDropdownMenuItemJObject.on('click', item.fn);
  13083. glDropdownMenuJObject
  13084. .find(`#gs-dropdown-contents-${dropdownName}`)
  13085. .append(glDropdownMenuItemJObject);
  13086. }
  13087. };
  13088. if (dropdownItems instanceof Promise) {
  13089. dropdownItems.then((items) => {
  13090. addItemsToDropdown(items);
  13091. return items;
  13092. });
  13093. }
  13094. else {
  13095. addItemsToDropdown(dropdownItems);
  13096. }
  13097. // remove class 'show' when clicking outside of dropdown
  13098. (0, jquery_slim_1.default)(document).on('click', (e) => {
  13099. if (!(0, jquery_slim_1.default)(e.target).closest(glDropdownJObject).length) {
  13100. glDropdownJObject.removeClass('show');
  13101. }
  13102. });
  13103. return glDropdownJObject;
  13104. }
  13105. exports.GitlabDropdownComponent = GitlabDropdownComponent;
  13106.  
  13107.  
  13108. /***/ }),
  13109. /* 23 */
  13110. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13111.  
  13112. "use strict";
  13113.  
  13114. var __importDefault = (this && this.__importDefault) || function (mod) {
  13115. return (mod && mod.__esModule) ? mod : { "default": mod };
  13116. };
  13117. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13118. exports.GitlabRemoveVariableRowComponent = void 0;
  13119. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  13120. const config_1 = __webpack_require__(0);
  13121. function GitlabRemoveVariableRowComponent() {
  13122. const removeBtnHtml = `
  13123. <button data-testid="remove-ci-variable-row" aria-label="Remove variable" type="button" class="btn gl-md-ml-3 gl-mb-3 custom-remove-variable-btn btn-danger btn-md gl-button btn-danger-secondary btn-icon">
  13124. <svg data-testid="clear-icon" role="img" aria-hidden="true" class="gl-button-icon gl-icon s16">
  13125. <use href="${config_1.gitlabSvgIconUrl}#clear">
  13126. </use>
  13127. </svg>
  13128. </button>`;
  13129. return (0, jquery_slim_1.default)(removeBtnHtml);
  13130. }
  13131. exports.GitlabRemoveVariableRowComponent = GitlabRemoveVariableRowComponent;
  13132.  
  13133.  
  13134. /***/ }),
  13135. /* 24 */
  13136. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13137.  
  13138. "use strict";
  13139.  
  13140. var __importDefault = (this && this.__importDefault) || function (mod) {
  13141. return (mod && mod.__esModule) ? mod : { "default": mod };
  13142. };
  13143. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13144. exports.GitlabSelectionComponent = void 0;
  13145. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  13146. function GitlabSelectionComponent(options, selectedValue, data_testId, data_qaSelector, action) {
  13147. const gitlabSelectionHtml = `
  13148. <select class="js-ci-variable-input-variable-type form-control select-control custom-select table-section" data-testid=${data_testId} data-qa-selector=${data_qaSelector}>
  13149. ${options.map((option) => {
  13150. return `<option ${option === selectedValue ? 'selected="selected"' : ''} value="${option}">${option}</option>`;
  13151. })}
  13152. </select>`;
  13153. const gitlabSelectionJObject = (0, jquery_slim_1.default)(gitlabSelectionHtml);
  13154. gitlabSelectionJObject.change(function () {
  13155. action((0, jquery_slim_1.default)(this).val());
  13156. });
  13157. return gitlabSelectionJObject;
  13158. }
  13159. exports.GitlabSelectionComponent = GitlabSelectionComponent;
  13160.  
  13161.  
  13162. /***/ }),
  13163. /* 25 */
  13164. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13165.  
  13166. "use strict";
  13167.  
  13168. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13169. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13170. return new (P || (P = Promise))(function (resolve, reject) {
  13171. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13172. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13173. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13174. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13175. });
  13176. };
  13177. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13178. exports.ChooseBranchDropdownComponent = void 0;
  13179. const config_1 = __webpack_require__(0);
  13180. const shared_1 = __webpack_require__(2);
  13181. const shared_components_1 = __webpack_require__(7);
  13182. function ChooseBranchDropdownComponent() {
  13183. return __awaiter(this, void 0, void 0, function* () {
  13184. const glClient = shared_1.GitlabHttpClient.getInstance();
  13185. const glGraphqlClient = shared_1.GitlabGraphqlClient.getInstance();
  13186. const branches = yield glClient.getProjectBranches();
  13187. const dropdownItems = branches === null || branches === void 0 ? void 0 : branches.map((branchName) => ({
  13188. text: branchName,
  13189. fn: () => __awaiter(this, void 0, void 0, function* () {
  13190. const fullPath = (0, shared_1.getProjectFullPath)(window.location.pathname);
  13191. if (fullPath) {
  13192. const vars = yield glGraphqlClient.getCiConfigVariables(fullPath, `refs/heads/${branchName}`);
  13193. if (!vars)
  13194. return;
  13195. const newPipelineSchedule = yield glClient.createPipelineSchedule(Object.assign(Object.assign({}, config_1.gitlabDefaultPipelineSchedule), { ref: branchName }));
  13196. yield Promise.all(vars.map((_var) => glClient.createPipelineScheduleVariable(newPipelineSchedule === null || newPipelineSchedule === void 0 ? void 0 : newPipelineSchedule.id, _var)));
  13197. if (!!newPipelineSchedule && confirm(`Create schedule success! Go to the edit page?`)) {
  13198. window.location.href = `${window.location.href}/${newPipelineSchedule === null || newPipelineSchedule === void 0 ? void 0 : newPipelineSchedule.id}/edit`;
  13199. }
  13200. else {
  13201. window.location.reload();
  13202. }
  13203. }
  13204. }),
  13205. }));
  13206. return (0, shared_components_1.GitlabDropdownComponent)('choose-branch', 'Copy vars from branch', dropdownItems || [{ text: 'No branches found', fn: () => { } }]);
  13207. });
  13208. }
  13209. exports.ChooseBranchDropdownComponent = ChooseBranchDropdownComponent;
  13210.  
  13211.  
  13212. /***/ }),
  13213. /* 26 */
  13214. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13215.  
  13216. "use strict";
  13217.  
  13218. var __importDefault = (this && this.__importDefault) || function (mod) {
  13219. return (mod && mod.__esModule) ? mod : { "default": mod };
  13220. };
  13221. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13222. exports.GitlabToolSettingsBtnComponent = void 0;
  13223. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  13224. const config_1 = __webpack_require__(0);
  13225. const gl_settings_modal_component_1 = __webpack_require__(27);
  13226. let glToolsSettingsModalOpenedState = false;
  13227. function GitlabToolSettingsBtnComponent() {
  13228. const glToolSettingsBtnHtml = `
  13229. <a class="btn gl-button btn-default ml-2">
  13230. <svg class="s16" data-testid="settings-icon">
  13231. <use href="${config_1.gitlabSvgIconUrl}#settings"></use>
  13232. </svg>
  13233. <span>Schedule Settings</span>
  13234. </a>`;
  13235. const glToolSettingsBtn = (0, jquery_slim_1.default)(glToolSettingsBtnHtml);
  13236. const addModal = () => {
  13237. const modalJObject = (0, gl_settings_modal_component_1.GitlabToolSettingsModalComponent)((eventType, payload) => {
  13238. switch (eventType) {
  13239. case 'close':
  13240. case 'cancel':
  13241. modalJObject.remove();
  13242. break;
  13243. case 'okay':
  13244. const [gitlabToken, gitlabToolSettings] = payload;
  13245. (0, config_1.saveGitlabToken)(gitlabToken);
  13246. (0, config_1.saveGitlabToolSettings)(gitlabToolSettings);
  13247. modalJObject.remove();
  13248. // reload page
  13249. window.location.reload();
  13250. break;
  13251. default:
  13252. modalJObject.remove();
  13253. break;
  13254. }
  13255. });
  13256. (0, jquery_slim_1.default)('body').append(modalJObject);
  13257. (0, jquery_slim_1.default)('body').addClass('modal-open');
  13258. };
  13259. const removeModal = () => {
  13260. (0, jquery_slim_1.default)('.modal').remove();
  13261. (0, jquery_slim_1.default)('body').removeClass('modal-open');
  13262. glToolsSettingsModalOpenedState = false;
  13263. };
  13264. const toggleModal = () => {
  13265. if (glToolsSettingsModalOpenedState) {
  13266. removeModal();
  13267. }
  13268. else {
  13269. addModal();
  13270. }
  13271. };
  13272. glToolSettingsBtn.on('click', toggleModal);
  13273. return glToolSettingsBtn;
  13274. }
  13275. exports.GitlabToolSettingsBtnComponent = GitlabToolSettingsBtnComponent;
  13276.  
  13277.  
  13278. /***/ }),
  13279. /* 27 */
  13280. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13281.  
  13282. "use strict";
  13283.  
  13284. var __importDefault = (this && this.__importDefault) || function (mod) {
  13285. return (mod && mod.__esModule) ? mod : { "default": mod };
  13286. };
  13287. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13288. exports.GitlabToolSettingsModalComponent = void 0;
  13289. const jquery_slim_1 = __importDefault(__webpack_require__(1));
  13290. const config_1 = __webpack_require__(0);
  13291. const shared_1 = __webpack_require__(2);
  13292. function GitlabToolSettingsModalComponent(cbEvent) {
  13293. const modalHtml = `<div style="position: absolute; z-index: 1040;">
  13294. <div role="dialog" aria-label="Gitlab Tool Settings" class="modal show gl-modal" aria-modal="true"
  13295. style="display: flex;">
  13296. <div class="modal-dialog modal-md modal-dialog-scrollable">
  13297. <span tabindex="0" />
  13298. <div tabindex="-1" class="modal-content">
  13299. <header class="modal-header">
  13300. <h4 class="modal-title">Gitlab Tool Settings</h4>
  13301. <button aria-label="Close" type="button"
  13302. class="btn btn-default btn-sm gl-button btn-default-tertiary btn-icon js-modal-action-close">
  13303. <svg data-testid="close-icon" role="img" aria-hidden="true" class="gl-button-icon gl-icon s16">
  13304. <use href="${config_1.gitlabSvgIconUrl}#close" />
  13305. </svg>
  13306. </button>
  13307. </header>
  13308. <div class="modal-body" style="height: 60vh;">
  13309. <form class="">
  13310. <div class="separator" style="margin-top:0;">Gitlab API Settings</div>
  13311. <div role="group" class="form-group gl-form-group">
  13312. <label for="input-1" class="d-block col-form-label">Gitlab token:</label>
  13313. <div>
  13314. <div role="group" class="input-group">
  13315. <div class="input-group-prepend">
  13316. <div class="input-group-text">Token</div>
  13317. </div>
  13318. <input id="i-gitlab-token" type="password" class="form-control gl-form-input" aria-label="">
  13319. </div>
  13320. <div class="gl-alert gl-alert-warning mt-1">
  13321. <svg data-testid="warning-icon" role="img" aria-hidden="true" class="gl-icon s16 gl-alert-icon">
  13322. <use href="${config_1.gitlabSvgIconUrl}#warning"></use>
  13323. </svg>
  13324. <div role="alert" aria-live="assertive" class="gl-alert-content">
  13325. <h2 class="gl-alert-title">Warning</h2>
  13326. <div class="gl-alert-body"> Do not share your token with anyone. <br> Access to the \`api\` with
  13327. read/write permission is mandatory for the token!!! </div>
  13328. </div>
  13329. </div>
  13330. <span class="form-text text-gl-muted">Don't have a token? <a
  13331. href="https://gitlab.com/-/profile/personal_access_tokens" target="_blank">Create one</a>
  13332. </span>
  13333. </div>
  13334. <div role="group" class="form-group gl-form-group mt-1">
  13335. <label for="i-gitlab-rest-per-page" class="d-block col-form-label"> Number of items per page: </label>
  13336. <div>
  13337. <input id="i-gitlab-rest-per-page" type="number" placeholder="50" required="required"
  13338. aria-required="true" class="gl-form-input form-control">
  13339. </div>
  13340. </div>
  13341. </div>
  13342. <div class="separator">Download ENV vars file Settings</div>
  13343. <div role="group" class="form-group gl-form-group">
  13344. <label for="i-wrap-var-value" class="d-block col-form-label"> Wrap the variable value with: </label>
  13345. <div>
  13346. <select id="i-wrap-the-variable-value-with" required="required" aria-required="true"
  13347. class="gl-form-select custom-select">
  13348. <option value="none">None</option>
  13349. <option value="single_quotation_mark">Single quotation mark <b>'</b>
  13350. </option>
  13351. <option value="double_quotation_mark">Double quotation mark <b>"</b>
  13352. </option>
  13353. </select>
  13354. </div>
  13355. <small class="form-text text-gl-muted">Wrap the variable value in the ENV vars download file. Example:
  13356. <span style="color: dimgray;">VAR_X='abc'</span> or <span style="color: dimgray;">VAR_X="abc"</span>,
  13357. etc. </small>
  13358. </div>
  13359. <div role="group" class="form-group gl-form-group mb-1"
  13360. title="Including variables defined in .gitlab-ci.yml. See: https://docs.gitlab.com/ee/api/graphql/reference/#ciconfigvariable">
  13361. <div class="gl-form-checkbox custom-control custom-checkbox">
  13362. <input id="i-include-all-variables" type="checkbox" name="checkboxes-4" class="custom-control-input"
  13363. value="squash">
  13364. <label for="i-include-all-variables" class="custom-control-label">Include all variables </label>
  13365. </div>
  13366. </div>
  13367. <div role="group" class="form-group gl-form-group mb-1">
  13368. <div class="gl-form-checkbox custom-control custom-checkbox">
  13369. <input id="i-replace-enter-with-n" type="checkbox" name="checkboxes-8" class="custom-control-input"
  13370. value="squash">
  13371. <label for="i-replace-enter-with-n" class="custom-control-label">Replace enter with <code>\\n</code>
  13372. </label>
  13373. </div>
  13374. </div>
  13375. <div class="separator">Schedule page Settings</div>
  13376. <div role="group" class="form-group gl-form-group">
  13377. <label for="i-wrap-var-value" class="d-block col-form-label"
  13378. title="Choose to take options from variable description or from Gitlab variable options (defined in .gitlab-ci.yml) or both.">
  13379. Get the options from: </label>
  13380. <div>
  13381. <select id="i-get-the-options-from" required="required" aria-required="true"
  13382. class="gl-form-select custom-select">
  13383. <option value="var_description">Variable description</option>
  13384. <option value="gitlab_variable_options"
  13385. title="See: https://docs.gitlab.com/ee/ci/yaml/#variablesoptions">Gitlab variable options</option>
  13386. <option value="merge_both">Combine both</option>
  13387. </select>
  13388. </div>
  13389. <small class="form-text text-gl-muted">Choose to take options from variable description or from Gitlab variable options (defined in .gitlab-ci.yml, see: <a
  13390. href="https://docs.gitlab.com/ee/ci/yaml/#variablesoptions" target="_blank">Gitlab variable options</a>) or both.
  13391. </small>
  13392. </div>
  13393. <div role="group" class="form-group gl-form-group mb-1">
  13394. <div class="gl-form-checkbox custom-control custom-checkbox">
  13395. <input id="i-schedule-page-auto-show-dropdown" type="checkbox" name="checkboxes-5"
  13396. class="custom-control-input" disabled checked="checked">
  13397. <label for="i-schedule-page-auto-show-dropdown" class="custom-control-label">Auto show dropdown(s)
  13398. </label>
  13399. </div>
  13400. </div>
  13401. <div role="group" class="form-group gl-form-group mb-1">
  13402. <div class="gl-form-checkbox custom-control custom-checkbox">
  13403. <input id="i-enable-markdown-var-description" type="checkbox" name="checkboxes-6"
  13404. class="custom-control-input" disabled checked="checked">
  13405. <label for="i-enable-markdown-var-description" class="custom-control-label">Enable markdown variable
  13406. description
  13407. </label>
  13408. </div>
  13409. </div>
  13410. <div role="group" class="form-group gl-form-group mb-1">
  13411. <div class="gl-form-checkbox custom-control custom-checkbox">
  13412. <input id="i-sort-var-by-name" type="checkbox" name="checkboxes-7" class="custom-control-input"
  13413. disabled checked="unchecked">
  13414. <label for="i-sort-var-by-name" class="custom-control-label">Sort variables by name (A-Z)
  13415. </label>
  13416. </div>
  13417. </div>
  13418. <div class="separator">Default new Schedule Settings</div>
  13419. <div role="group" class="form-group gl-form-group">
  13420. <label for="i-default-schedule-description" class="d-block col-form-label"> Description: </label>
  13421. <div>
  13422. <input id="i-default-schedule-description" type="text" placeholder="default schedule description"
  13423. required="required" aria-required="true" class="gl-form-input form-control">
  13424. </div>
  13425. </div>
  13426. <div role="group" class="form-group gl-form-group">
  13427. <label for="i-default-schedule-interval-pattern" class="d-block col-form-label"> Interval pattern:
  13428. </label>
  13429. <div>
  13430. <input id="i-default-schedule-interval-pattern" type="text" placeholder="0 15 * * *" required="required"
  13431. aria-required="true" class="gl-form-input form-control">
  13432. </div>
  13433. </div>
  13434. <div role="group" class="form-group gl-form-group">
  13435. <label for="i-default-schedule-cron-timezone" class="d-block col-form-label"> Cron timezone: </label>
  13436. <div>
  13437. <input id="i-default-schedule-cron-timezone" type="text" placeholder="UTC" required="required"
  13438. aria-required="true" class="gl-form-input form-control">
  13439. </div>
  13440. </div>
  13441. <div role="group" class="form-group gl-form-group">
  13442. <label for="i-default-schedule-target-branch" class="d-block col-form-label"> Target branch: </label>
  13443. <div>
  13444. <input id="i-default-schedule-target-branch" type="text" placeholder="main" required="required"
  13445. aria-required="true" class="gl-form-input form-control">
  13446. </div>
  13447. </div>
  13448. <div role="group" class="form-group gl-form-group">
  13449. <div class="gl-form-checkbox custom-control custom-checkbox">
  13450. <input id="i-default-schedule-active-by-default" type="checkbox" name="checkboxes-4"
  13451. class="custom-control-input" value="squash">
  13452. <label for="i-default-schedule-active-by-default" class="custom-control-label">Active by default
  13453. </label>
  13454. </div>
  13455. </div>
  13456. </form>
  13457. </div>
  13458. <footer class="modal-footer">
  13459. <button type="button" class="btn js-modal-action-cancel btn-default btn-md gl-button">
  13460. <span class="gl-button-text">Cancel</span>
  13461. </button>
  13462. <button type="button"
  13463. class="btn js-modal-action-secondary btn-confirm btn-md gl-button btn-confirm-secondary">
  13464. <span class="gl-button-text">Discard Changes</span>
  13465. </button>
  13466. <button type="button" class="btn js-modal-action-primary btn-confirm btn-md gl-button">
  13467. <span class="gl-button-text">Okay</span>
  13468. </button>
  13469. </footer>
  13470. </div>
  13471. <span tabindex="0" />
  13472. </div>
  13473. </div>
  13474. <div class="modal-backdrop" />
  13475. </div>
  13476. `;
  13477. const modalJObject = (0, jquery_slim_1.default)(modalHtml);
  13478. // Inject the values to the modal
  13479. const updateData = () => {
  13480. // Gitlab token
  13481. modalJObject.find('#i-gitlab-token').val(config_1.gitlabToken);
  13482. modalJObject.find('#i-gitlab-rest-per-page').val(config_1.gitlabRestPerPage);
  13483. // wrap the variable value with
  13484. switch (config_1.wrappedVarBy) {
  13485. case '':
  13486. modalJObject.find('select#i-wrap-the-variable-value-with').val('none');
  13487. break;
  13488. case "'":
  13489. modalJObject.find('select#i-wrap-the-variable-value-with').val('single_quotation_mark');
  13490. break;
  13491. case '"':
  13492. modalJObject.find('select#i-wrap-the-variable-value-with').val('double_quotation_mark');
  13493. break;
  13494. default:
  13495. modalJObject.find('select#i-wrap-the-variable-value-with').val('none');
  13496. break;
  13497. }
  13498. modalJObject.find('#i-include-all-variables').prop('checked', config_1.includeAllVariables);
  13499. modalJObject.find('#i-get-the-options-from').val(config_1.getTheOptionsFrom);
  13500. modalJObject.find('#i-schedule-page-auto-show-dropdown').prop('checked', config_1.autoShowDropDown);
  13501. modalJObject
  13502. .find('#i-enable-markdown-var-description')
  13503. .prop('checked', config_1.enableMarkdownVarDescription);
  13504. modalJObject.find('#i-sort-var-by-name').prop('checked', config_1.sortVarByName);
  13505. modalJObject.find('#i-replace-enter-with-n').prop('checked', config_1.replaceEnterWithN);
  13506. const { active, cron, description, cron_timezone, ref } = config_1.gitlabDefaultPipelineSchedule;
  13507. modalJObject.find('#i-default-schedule-description').val(description);
  13508. modalJObject.find('#i-default-schedule-interval-pattern').val(cron);
  13509. modalJObject.find('#i-default-schedule-cron-timezone').val(cron_timezone);
  13510. modalJObject.find('#i-default-schedule-target-branch').val(ref);
  13511. modalJObject.find('#i-default-schedule-active-by-default').prop('checked', active);
  13512. modalJObject.find('#i-include-all-variables').prop('checked', config_1.includeAllVariables);
  13513. };
  13514. updateData();
  13515. // Get the values from the modal
  13516. const getValues = () => {
  13517. var _a, _b, _c, _d, _e, _f;
  13518. const gitlabToken = ((_a = modalJObject.find('#i-gitlab-token').val()) === null || _a === void 0 ? void 0 : _a.toString()) || '';
  13519. const gitlabRestPerPage = parseInt(((_b = modalJObject.find('#i-gitlab-rest-per-page').val()) === null || _b === void 0 ? void 0 : _b.toString()) || '50');
  13520. const wrappedVarByOption = modalJObject.find('select#i-wrap-the-variable-value-with').val();
  13521. let wrappedVarBy = '';
  13522. switch (wrappedVarByOption) {
  13523. case 'none':
  13524. wrappedVarBy = '';
  13525. break;
  13526. case 'single_quotation_mark':
  13527. wrappedVarBy = "'";
  13528. break;
  13529. case 'double_quotation_mark':
  13530. wrappedVarBy = '"';
  13531. break;
  13532. default:
  13533. wrappedVarBy = '';
  13534. break;
  13535. }
  13536. const getTheOptionsFromOption = modalJObject.find('select#i-get-the-options-from').val();
  13537. let getTheOptionsFrom = shared_1.GetTheOptionsFrom.VAR_DESCRIPTION;
  13538. switch (getTheOptionsFromOption) {
  13539. case 'var_description':
  13540. getTheOptionsFrom = shared_1.GetTheOptionsFrom.VAR_DESCRIPTION;
  13541. break;
  13542. case 'gitlab_variable_options':
  13543. getTheOptionsFrom = shared_1.GetTheOptionsFrom.GITLAB_VARIABLE_OPTIONS;
  13544. break;
  13545. case 'merge_both':
  13546. getTheOptionsFrom = shared_1.GetTheOptionsFrom.MERGE_BOTH;
  13547. break;
  13548. default:
  13549. getTheOptionsFrom = shared_1.GetTheOptionsFrom.VAR_DESCRIPTION;
  13550. break;
  13551. }
  13552. const autoShowDropDown = modalJObject
  13553. .find('#i-schedule-page-auto-show-dropdown')
  13554. .prop('checked');
  13555. const enableMarkdownVarDescription = modalJObject
  13556. .find('#i-enable-markdown-var-description')
  13557. .prop('checked');
  13558. const sortVarByName = modalJObject.find('#i-sort-var-by-name').prop('checked');
  13559. const includeAllVariables = modalJObject.find('#i-include-all-variables').prop('checked');
  13560. const replaceEnterWithN = modalJObject.find('#i-replace-enter-with-n').prop('checked');
  13561. const gitlabDefaultPipelineSchedule = {
  13562. active: modalJObject.find('#i-default-schedule-active-by-default').prop('checked'),
  13563. cron: ((_c = modalJObject.find('#i-default-schedule-interval-pattern').val()) === null || _c === void 0 ? void 0 : _c.toString()) || '0 15 * * *',
  13564. description: ((_d = modalJObject.find('#i-default-schedule-description').val()) === null || _d === void 0 ? void 0 : _d.toString()) ||
  13565. 'Default schedule',
  13566. cron_timezone: ((_e = modalJObject.find('#i-default-schedule-cron-timezone').val()) === null || _e === void 0 ? void 0 : _e.toString()) || 'UTC',
  13567. ref: ((_f = modalJObject.find('#i-default-schedule-target-branch').val()) === null || _f === void 0 ? void 0 : _f.toString()) || 'main',
  13568. };
  13569. return [
  13570. gitlabToken,
  13571. {
  13572. gitlabRestPerPage,
  13573. wrappedVarBy,
  13574. includeAllVariables,
  13575. gitlabDefaultPipelineSchedule,
  13576. getTheOptionsFrom,
  13577. autoShowDropDown,
  13578. enableMarkdownVarDescription,
  13579. sortVarByName,
  13580. replaceEnterWithN,
  13581. },
  13582. ];
  13583. };
  13584. modalJObject.find('.js-modal-action-cancel').on('click', function () {
  13585. cbEvent('cancel', null);
  13586. });
  13587. modalJObject.find('.js-modal-action-secondary').on('click', function () {
  13588. updateData();
  13589. });
  13590. modalJObject.find('.js-modal-action-primary').on('click', function () {
  13591. cbEvent('okay', getValues());
  13592. });
  13593. modalJObject.find('.js-modal-action-close').on('click', function () {
  13594. cbEvent('close', null);
  13595. });
  13596. // outside click
  13597. modalJObject.find('.modal').on('click', function (e) {
  13598. if (e.target === this) {
  13599. cbEvent('discard', null);
  13600. }
  13601. });
  13602. return modalJObject;
  13603. }
  13604. exports.GitlabToolSettingsModalComponent = GitlabToolSettingsModalComponent;
  13605.  
  13606.  
  13607. /***/ }),
  13608. /* 28 */
  13609. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  13610.  
  13611. "use strict";
  13612.  
  13613. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13614. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13615. return new (P || (P = Promise))(function (resolve, reject) {
  13616. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13617. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13618. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13619. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13620. });
  13621. };
  13622. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13623. exports.editPipelineSchedulePage = void 0;
  13624. const components_1 = __webpack_require__(6);
  13625. const config_1 = __webpack_require__(0);
  13626. const shared_1 = __webpack_require__(2);
  13627. const { ROW_CONTAINER, REVEAL_VALUES_BTN, SUBMIT_BTN, BRANCH_SELECT, CI_VARIABLE_ROW, VARIABLE_KEY_INPUT, VARIABLE_SECRET_INPUT,
  13628. // VARIABLE_SECRET_HIDDEN_INPUT,
  13629. VARIABLE_SECRET_INPUT_CLASS, REMOVE_VARIABLE_BTN, } = shared_1.EDIT_PIPELINE_SCHEDULE_PAGE_SELECTORS;
  13630. const getPersistedVariables = () => {
  13631. let persistedVariables = (0, shared_1.$)(ROW_CONTAINER);
  13632. if (persistedVariables.length === 0) {
  13633. console.error('[GitLab Duplicator]-persistedVariables is empty');
  13634. }
  13635. else {
  13636. // remove last persistedVariables item from array
  13637. persistedVariables = Array.from(persistedVariables).slice(0, -1);
  13638. }
  13639. return persistedVariables;
  13640. };
  13641. const editPipelineSchedulePage = () => __awaiter(void 0, void 0, void 0, function* () {
  13642. var _a, _b, _c;
  13643. const isShowDropdown = true;
  13644. const varOptionStorage = shared_1.VarOptionStorage.getInstance();
  13645. const glGraphqlClient = shared_1.GitlabGraphqlClient.getInstance();
  13646. // wait for the page to be rendered
  13647. console.info('Waiting for the page to be rendered');
  13648. yield Promise.all([
  13649. (0, shared_1.waitForElement)(ROW_CONTAINER),
  13650. (0, shared_1.waitForElement)(REVEAL_VALUES_BTN),
  13651. (0, shared_1.waitForElement)(SUBMIT_BTN),
  13652. (0, shared_1.waitForElement)(BRANCH_SELECT),
  13653. ]);
  13654. console.info('Page is rendered');
  13655. const revealValuesBtn = (0, shared_1.$)(REVEAL_VALUES_BTN);
  13656. // $('.ci-variable-row-remove-button').css({ 'margin-left': '3rem' });
  13657. const editPipelineScheduleBtn = (0, shared_1.$)(SUBMIT_BTN);
  13658. editPipelineScheduleBtn.hide();
  13659. const newEditPipelineScheduleBtn = (0, shared_1.$)('<button type="button" class="btn btn-confirm btn-md gl-button">Edit pipeline schedule</button>');
  13660. newEditPipelineScheduleBtn.insertAfter(editPipelineScheduleBtn);
  13661. const currentBranch = (0, shared_1.$)(BRANCH_SELECT).find('button').first().text().trim();
  13662. if (revealValuesBtn) {
  13663. revealValuesBtn.trigger('click');
  13664. }
  13665. const fullPath = (0, shared_1.getProjectFullPath)(window.location.pathname);
  13666. const ciConfigVariables = (yield glGraphqlClient.getCiConfigVariables(fullPath, `refs/heads/${currentBranch}`)) || [];
  13667. const descriptionOption = {};
  13668. for (const ciConfigVar of ciConfigVariables) {
  13669. const varOptions = (0, shared_1.getOptionsFromVarDescription)(ciConfigVar.description);
  13670. if (config_1.getTheOptionsFrom === shared_1.GetTheOptionsFrom.VAR_DESCRIPTION) {
  13671. if (varOptions.length > 0) {
  13672. descriptionOption[ciConfigVar.key] = (0, shared_1.getOptionsFromVarDescription)(ciConfigVar.description);
  13673. }
  13674. }
  13675. else if (config_1.getTheOptionsFrom === shared_1.GetTheOptionsFrom.GITLAB_VARIABLE_OPTIONS) {
  13676. if (!!ciConfigVar.valueOptions && ciConfigVar.valueOptions.length > 0) {
  13677. descriptionOption[ciConfigVar.key] = ciConfigVar.valueOptions;
  13678. }
  13679. }
  13680. else if (config_1.getTheOptionsFrom === shared_1.GetTheOptionsFrom.MERGE_BOTH) {
  13681. if (varOptions.length > 0 ||
  13682. (!!ciConfigVar.valueOptions && ciConfigVar.valueOptions.length > 0)) {
  13683. const glValueOptions = ciConfigVar.valueOptions || [];
  13684. // create a set to remove duplicate values
  13685. const mergedOptions = new Set([
  13686. ...(0, shared_1.getOptionsFromVarDescription)(ciConfigVar.description),
  13687. ...glValueOptions,
  13688. ]);
  13689. descriptionOption[ciConfigVar.key] = Array.from(mergedOptions);
  13690. }
  13691. }
  13692. }
  13693. yield varOptionStorage.setOptions(descriptionOption);
  13694. const keyOptions = varOptionStorage.getOptions();
  13695. const persistedVariables = getPersistedVariables();
  13696. // Activated checkbox
  13697. const checkBoxRow = (0, shared_1.$)('.gl-form-checkbox.gl-mb-3.custom-control.custom-checkbox');
  13698. const showValueOptionsDropdownCheckbox = (0, components_1.GitlabCheckboxComponent)('Show dropdown(s)', 'Turn on', 'pl-0', isShowDropdown, 'show_dropdown_checkbox');
  13699. showValueOptionsDropdownCheckbox.insertAfter(checkBoxRow);
  13700. const _rows = [];
  13701. for (const persistedVariable of persistedVariables) {
  13702. const persistedVariableRow = (0, shared_1.$)(persistedVariable);
  13703. persistedVariableRow.find(CI_VARIABLE_ROW).removeClass('gl-mb-3 gl-pb-2');
  13704. //#region Get components
  13705. const variableTypeSelect = persistedVariableRow.find('button.btn.dropdown-toggle.gl-dropdown-toggle');
  13706. const variableType = variableTypeSelect.text().trim();
  13707. const variableKeyInput = persistedVariableRow.find(VARIABLE_KEY_INPUT);
  13708. const variableKey = variableKeyInput.val();
  13709. const variableSecretValueInput = persistedVariableRow.find(VARIABLE_SECRET_INPUT);
  13710. const variableSecretValue = variableSecretValueInput.val();
  13711. const removeVariableBtn = persistedVariableRow.find(REMOVE_VARIABLE_BTN);
  13712. removeVariableBtn.addClass('origin-remove-variable-btn');
  13713. removeVariableBtn.hide();
  13714. const newRemoveVariableBtn = (0, components_1.GitlabRemoveVariableRowComponent)();
  13715. newRemoveVariableBtn.insertAfter(removeVariableBtn);
  13716. newRemoveVariableBtn.on('click', () => {
  13717. persistedVariableRow.remove();
  13718. });
  13719. //#endregion
  13720. //#region Adding var description
  13721. const descriptionTxt = (_a = ciConfigVariables.find((v) => v.key === variableKey)) === null || _a === void 0 ? void 0 : _a.description;
  13722. if (descriptionTxt) {
  13723. const varDescriptionComponent = (0, components_1.VarDescriptionComponent)((0, shared_1.convertMarkdownToHtml)(descriptionTxt));
  13724. removeVariableBtn.on('click', () => {
  13725. varDescriptionComponent.remove();
  13726. });
  13727. // varDescriptionComponent.insertAfter(persistedVariableRow.find('.ci-variable-row'));
  13728. persistedVariableRow.append(varDescriptionComponent);
  13729. }
  13730. else {
  13731. persistedVariableRow.find(CI_VARIABLE_ROW).attr('style', 'padding-bottom: 16px;');
  13732. }
  13733. //#endregion
  13734. // if variableSecretValue is not in the list of options, add it to the list
  13735. if (((_b = keyOptions[variableKey]) === null || _b === void 0 ? void 0 : _b.indexOf(variableSecretValue)) === -1) {
  13736. (_c = keyOptions[variableKey]) === null || _c === void 0 ? void 0 : _c.push(variableSecretValue);
  13737. }
  13738. let variableSecretValueDropdown = null;
  13739. if ((keyOptions[variableKey] || []).length > 0) {
  13740. variableSecretValueDropdown = (0, components_1.GitlabSelectionComponent)(keyOptions[variableKey] || [], variableSecretValue, VARIABLE_SECRET_INPUT_CLASS, 'ci_variable_value_field', (value) => {
  13741. console.log('value', value);
  13742. });
  13743. }
  13744. _rows.push({
  13745. key: variableKey,
  13746. variableType,
  13747. original: {
  13748. valueInput: variableSecretValueInput,
  13749. },
  13750. clone: variableSecretValueDropdown
  13751. ? {
  13752. valueInput: variableSecretValueDropdown,
  13753. }
  13754. : null,
  13755. });
  13756. }
  13757. const reloadForm = (allowShowDropdown) => {
  13758. var _a, _b;
  13759. for (const row of _rows) {
  13760. if (allowShowDropdown) {
  13761. if (row.clone) {
  13762. if (row.original.valueInput.is(':visible')) {
  13763. // alow empty value
  13764. const currentValue = row.original.valueInput.val();
  13765. if (((_a = keyOptions[row.key]) === null || _a === void 0 ? void 0 : _a.indexOf(currentValue)) === -1) {
  13766. (_b = keyOptions[row.key]) === null || _b === void 0 ? void 0 : _b.push(currentValue);
  13767. }
  13768. row.clone.valueInput = (0, components_1.GitlabSelectionComponent)(keyOptions[row.key] || [], currentValue, 'pipeline-form-ci-variable-value', 'ci_variable_value_field', (value) => {
  13769. console.log('value', value);
  13770. });
  13771. row.clone.valueInput.val(currentValue);
  13772. row.clone.valueInput.replaceAll(row.original.valueInput);
  13773. }
  13774. }
  13775. }
  13776. else {
  13777. if (row.clone) {
  13778. if (row.clone.valueInput.is(':visible')) {
  13779. const currentValue = row.clone.valueInput.val();
  13780. row.original.valueInput.val(currentValue);
  13781. row.original.valueInput.replaceAll(row.clone.valueInput);
  13782. }
  13783. }
  13784. }
  13785. }
  13786. };
  13787. if (isShowDropdown) {
  13788. reloadForm(isShowDropdown);
  13789. }
  13790. showValueOptionsDropdownCheckbox.on('click', (e) => {
  13791. if (e.target.nodeName !== 'INPUT')
  13792. return;
  13793. else {
  13794. const isChecked = (0, shared_1.$)('#show_dropdown_checkbox').is(':checked');
  13795. reloadForm(isChecked);
  13796. editPipelineScheduleBtn.show();
  13797. newEditPipelineScheduleBtn.hide();
  13798. (0, shared_1.$)('.origin-remove-variable-btn').show();
  13799. (0, shared_1.$)('.custom-remove-variable-btn').hide();
  13800. }
  13801. });
  13802. //#region Reveal button click event
  13803. revealValuesBtn.on('click', () => {
  13804. var _a, _b;
  13805. const _isShowDropdown = (0, shared_1.$)('#show_dropdown_checkbox').is(':checked');
  13806. const isHidden = revealValuesBtn.text().includes('Reveal value');
  13807. if (isHidden) {
  13808. if (_isShowDropdown) {
  13809. for (const row of _rows) {
  13810. (_a = row.clone) === null || _a === void 0 ? void 0 : _a.valueInput.show();
  13811. }
  13812. }
  13813. else {
  13814. // do nothing
  13815. }
  13816. }
  13817. else {
  13818. if (_isShowDropdown) {
  13819. for (const row of _rows) {
  13820. (_b = row.clone) === null || _b === void 0 ? void 0 : _b.valueInput.hide();
  13821. }
  13822. }
  13823. else {
  13824. // do nothing
  13825. }
  13826. }
  13827. });
  13828. //#endregion
  13829. newEditPipelineScheduleBtn.on('click', () => __awaiter(void 0, void 0, void 0, function* () {
  13830. var _d;
  13831. const updatedVariables = [];
  13832. const crtPersistedVariables = getPersistedVariables();
  13833. for (const persistedVariable of crtPersistedVariables) {
  13834. const persistedVariableRow = (0, shared_1.$)(persistedVariable);
  13835. const variableKeyInput = persistedVariableRow.find(VARIABLE_KEY_INPUT);
  13836. const variableKey = variableKeyInput.val();
  13837. if (variableKey === undefined)
  13838. continue;
  13839. const variableSecretValueInput = persistedVariableRow.find(VARIABLE_SECRET_INPUT);
  13840. const variableSecretValue = variableSecretValueInput.val();
  13841. if (variableSecretValue === undefined)
  13842. continue;
  13843. updatedVariables.push({
  13844. key: variableKey,
  13845. value: variableSecretValue,
  13846. });
  13847. }
  13848. // get last div
  13849. const scheduleVueElement = (_d = (0, shared_1.$)('#content-body > div.col-lg-8.gl-pl-0')) === null || _d === void 0 ? void 0 : _d.get()[0];
  13850. const scheduleVueInstanceData = scheduleVueElement.__vue__.$data;
  13851. const updatedPipelineSchedule = {
  13852. description: scheduleVueInstanceData.description,
  13853. cron: scheduleVueInstanceData.cron,
  13854. cronTimezone: scheduleVueInstanceData.cronTimezone,
  13855. ref: scheduleVueInstanceData.scheduleRef,
  13856. activate: scheduleVueInstanceData.activated,
  13857. variables: updatedVariables,
  13858. };
  13859. yield glGraphqlClient.updatePipelineSchedule((0, shared_1.getScheduleIdFromUrl)(window.location.pathname), fullPath, updatedPipelineSchedule);
  13860. // navigate to pipeline schedules page
  13861. window.location.href = `${window.location.origin}/${fullPath}/-/pipeline_schedules`;
  13862. }));
  13863. //#endregion
  13864. });
  13865. exports.editPipelineSchedulePage = editPipelineSchedulePage;
  13866.  
  13867.  
  13868. /***/ }),
  13869. /* 29 */
  13870. /***/ ((__unused_webpack_module, exports) => {
  13871.  
  13872. "use strict";
  13873.  
  13874. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13875. exports.EDIT_PIPELINE_SCHEDULE_PAGE_SELECTORS = exports.GetTheOptionsFrom = void 0;
  13876. var GetTheOptionsFrom;
  13877. (function (GetTheOptionsFrom) {
  13878. GetTheOptionsFrom["VAR_DESCRIPTION"] = "var_description";
  13879. GetTheOptionsFrom["GITLAB_VARIABLE_OPTIONS"] = "gitlab_variable_options";
  13880. GetTheOptionsFrom["MERGE_BOTH"] = "merge_both";
  13881. })(GetTheOptionsFrom = exports.GetTheOptionsFrom || (exports.GetTheOptionsFrom = {}));
  13882. // Define selectors of EditPipelineSchedulePage component
  13883. exports.EDIT_PIPELINE_SCHEDULE_PAGE_SELECTORS = {
  13884. ROW_CONTAINER: 'fieldset > div > div',
  13885. REVEAL_VALUES_BTN: 'button[data-testid="variable-security-btn"]',
  13886. SUBMIT_BTN: 'button[data-testid="schedule-submit-button"]',
  13887. BRANCH_SELECT: 'div[id="schedule-target-branch-tag"]',
  13888. CI_VARIABLE_ROW: 'div[data-testid="ci-variable-row"]',
  13889. VARIABLE_KEY_INPUT: 'input[data-testid="pipeline-form-ci-variable-key"]',
  13890. VARIABLE_SECRET_HIDDEN_INPUT: 'textarea[data-testid="pipeline-form-ci-variable-hidden-value"]',
  13891. VARIABLE_SECRET_INPUT_CLASS: 'pipeline-form-ci-variable-value',
  13892. VARIABLE_SECRET_INPUT: `:is(textarea, select)[data-testid="pipeline-form-ci-variable-value"]`,
  13893. REMOVE_VARIABLE_BTN: 'button[data-testid="remove-ci-variable-row"]',
  13894. };
  13895.  
  13896.  
  13897. /***/ }),
  13898. /* 30 */
  13899. /***/ ((__unused_webpack_module, exports) => {
  13900.  
  13901. "use strict";
  13902.  
  13903. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13904. exports.HttpMethods = void 0;
  13905. var HttpMethods;
  13906. (function (HttpMethods) {
  13907. HttpMethods["GET"] = "GET";
  13908. HttpMethods["POST"] = "POST";
  13909. HttpMethods["PUT"] = "PUT";
  13910. HttpMethods["PATCH"] = "PATCH";
  13911. HttpMethods["DELETE"] = "DELETE";
  13912. })(HttpMethods = exports.HttpMethods || (exports.HttpMethods = {}));
  13913.  
  13914.  
  13915. /***/ }),
  13916. /* 31 */
  13917. /***/ ((__unused_webpack_module, exports) => {
  13918.  
  13919. "use strict";
  13920.  
  13921. Object.defineProperty(exports, "__esModule", ({ value: true }));
  13922. exports.updatePipelineScheduleMutationStr = exports.getPipelineScheduleQueryStr = exports.getPipelineSchedulesQueryStr = exports.getCiConfigVariablesQueryStr = void 0;
  13923. exports.getCiConfigVariablesQueryStr = `query ciConfigVariables($fullPath: ID!, $ref: String!) {
  13924. project(fullPath: $fullPath) {
  13925. id
  13926. ciConfigVariables(ref: $ref) {
  13927. description
  13928. key
  13929. value
  13930. valueOptions
  13931. __typename
  13932. }
  13933. __typename
  13934. }
  13935. }
  13936. `;
  13937. exports.getPipelineSchedulesQueryStr = `query getPipelineSchedulesQuery($projectPath: ID!, $status: PipelineScheduleStatus, $ids: [ID!] = null, $first: Int, $last: Int, $prevPageCursor: String = "", $nextPageCursor: String = "") {
  13938. currentUser {
  13939. id
  13940. username
  13941. __typename
  13942. }
  13943. project(fullPath: $projectPath) {
  13944. id
  13945. pipelineSchedules(
  13946. status: $status
  13947. ids: $ids
  13948. first: $first
  13949. last: $last
  13950. after: $nextPageCursor
  13951. before: $prevPageCursor
  13952. ) {
  13953. count
  13954. nodes {
  13955. id
  13956. description
  13957. cron
  13958. cronTimezone
  13959. ref
  13960. forTag
  13961. editPath
  13962. refPath
  13963. refForDisplay
  13964. lastPipeline {
  13965. id
  13966. detailedStatus {
  13967. id
  13968. group
  13969. icon
  13970. label
  13971. text
  13972. detailsPath
  13973. __typename
  13974. }
  13975. __typename
  13976. }
  13977. active
  13978. nextRunAt
  13979. realNextRun
  13980. owner {
  13981. id
  13982. username
  13983. avatarUrl
  13984. name
  13985. webPath
  13986. __typename
  13987. }
  13988. variables {
  13989. nodes {
  13990. id
  13991. variableType
  13992. key
  13993. value
  13994. __typename
  13995. }
  13996. __typename
  13997. }
  13998. userPermissions {
  13999. playPipelineSchedule
  14000. updatePipelineSchedule
  14001. adminPipelineSchedule
  14002. __typename
  14003. }
  14004. __typename
  14005. }
  14006. pageInfo {
  14007. ...PageInfo
  14008. __typename
  14009. }
  14010. __typename
  14011. }
  14012. __typename
  14013. }
  14014. }
  14015.  
  14016. fragment PageInfo on PageInfo {
  14017. hasNextPage
  14018. hasPreviousPage
  14019. startCursor
  14020. endCursor
  14021. __typename
  14022. }
  14023. `;
  14024. exports.getPipelineScheduleQueryStr = `query getPipelineSchedulesQuery($projectPath: ID!, $status: PipelineScheduleStatus, $ids: [ID!] = null) {
  14025. currentUser {
  14026. id
  14027. username
  14028. __typename
  14029. }
  14030. project(fullPath: $projectPath) {
  14031. id
  14032. pipelineSchedules(status: $status, ids: $ids) {
  14033. count
  14034. nodes {
  14035. id
  14036. description
  14037. cron
  14038. cronTimezone
  14039. ref
  14040. forTag
  14041. editPath
  14042. refPath
  14043. refForDisplay
  14044. lastPipeline {
  14045. id
  14046. detailedStatus {
  14047. id
  14048. group
  14049. icon
  14050. label
  14051. text
  14052. detailsPath
  14053. __typename
  14054. }
  14055. __typename
  14056. }
  14057. active
  14058. nextRunAt
  14059. realNextRun
  14060. owner {
  14061. id
  14062. username
  14063. avatarUrl
  14064. name
  14065. webPath
  14066. __typename
  14067. }
  14068. variables {
  14069. nodes {
  14070. id
  14071. variableType
  14072. key
  14073. value
  14074. __typename
  14075. }
  14076. __typename
  14077. }
  14078. userPermissions {
  14079. playPipelineSchedule
  14080. updatePipelineSchedule
  14081. adminPipelineSchedule
  14082. __typename
  14083. }
  14084. __typename
  14085. }
  14086. __typename
  14087. }
  14088. __typename
  14089. }
  14090. }
  14091. `;
  14092. exports.updatePipelineScheduleMutationStr = `mutation updatePipelineSchedule($input: PipelineScheduleUpdateInput!) {
  14093. pipelineScheduleUpdate(input: $input) {
  14094. clientMutationId
  14095. errors
  14096. __typename
  14097. }
  14098. }
  14099. `;
  14100.  
  14101.  
  14102. /***/ }),
  14103. /* 32 */
  14104. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  14105.  
  14106. (()=>{"use strict";var e={d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Header:()=>r,buildKeyGenerator:()=>b,buildMemoryStorage:()=>v,buildStorage:()=>w,buildWebStorage:()=>C,canStale:()=>p,createCacheResponse:()=>d,createValidateStatus:()=>i,defaultHeaderInterpreter:()=>n,defaultKeyGenerator:()=>I,defaultRequestInterceptor:()=>u,defaultResponseInterceptor:()=>h,isExpired:()=>m,isMethodIn:()=>s,isStorage:()=>g,setupCache:()=>x,testCachePredicate:()=>f,updateCache:()=>l,updateStaleRequest:()=>c});const a=__webpack_require__(47),r=Object.freeze({IfModifiedSince:"if-modified-since",LastModified:"last-modified",IfNoneMatch:"if-none-match",CacheControl:"cache-control",ETag:"etag",Expires:"expires",Age:"age",XAxiosCacheEtag:"x-axios-cache-etag",XAxiosCacheLastModified:"x-axios-cache-last-modified",XAxiosCacheStaleIfError:"x-axios-cache-stale-if-error"}),n=e=>{if(!e)return"not enough headers";const t=e[r.CacheControl];if(t){const{noCache:n,noStore:o,mustRevalidate:i,maxAge:s,immutable:c}=(0,a.parse)(String(t));if(n||o)return"dont cache";if(c)return 31536e6;if(i)return 0;if(void 0!==s){const t=e[r.Age];return t?1e3*(s-Number(t)):1e3*s}}const n=e[r.Expires];if(n){const e=Date.parse(String(n))-Date.now();return e>=0?e:"dont cache"}return"not enough headers"},o=__webpack_require__(48);function i(e){return e?t=>e(t)||304===t:e=>e>=200&&e<300||304===e}function s(e="get",t=[]){return e=e.toLowerCase(),t.some((t=>t===e))}function c(e,t){var a;t.headers||(t.headers={});const{etag:n,modifiedSince:o}=t.cache;if(n){const o=!0===n?null===(a=e.data)||void 0===a?void 0:a.headers[r.ETag]:n;o&&(t.headers[r.IfNoneMatch]=o)}o&&(t.headers[r.IfModifiedSince]=!0===o?e.data.headers[r.LastModified]||new Date(e.createdAt).toUTCString():o.toUTCString())}function d(e,t){return 304===e.status&&t?(e.cached=!0,e.data=t.data,e.status=t.status,e.statusText=t.statusText,e.headers=Object.assign(Object.assign({},t.headers),e.headers),t):{data:e.data,status:e.status,statusText:e.statusText,headers:e.headers}}function u(e){const t=async t=>{var a;const r=t.id=e.generateKey(t);if(!1===t.cache)return t;if(t.cache=Object.assign(Object.assign({},e.defaults.cache),t.cache),!s(t.method,t.cache.methods))return t;let n=await e.storage.get(r,t);const d=t.cache.override;e:if("empty"===n.state||"stale"===n.state||d){if(e.waiting[r]&&!d&&(n=await e.storage.get(r,t),"empty"!==n.state)){0;break e}return e.waiting[r]=(0,o.deferred)(),null===(a=e.waiting[r])||void 0===a||a.catch((()=>{})),await e.storage.set(r,{state:"loading",previous:d?n.data?"stale":"empty":n.state,data:n.data,createdAt:d&&!n.createdAt?Date.now():n.createdAt},t),"stale"===n.state&&c(n,t),t.validateStatus=i(t.validateStatus),t}let u;if("loading"===n.state){const a=e.waiting[r];if(!a)return await e.storage.remove(r,t),t;0;try{u=await a}catch(e){return t}}else u=n.data;return t.adapter=()=>Promise.resolve({config:t,data:u.data,headers:u.headers,status:u.status,statusText:u.statusText,cached:!0,id:r}),t};return{onFulfilled:t,apply:()=>e.interceptors.request.use(t)}}async function f(e,t){var a;if("function"==typeof t)return t(e);const{statusCheck:r,responseMatch:n,containsHeaders:o}=t;if(r&&!await r(e.status)||n&&!await n(e))return!1;if(o)for(const[t,r]of Object.entries(o))if(!await r(null!==(a=e.headers[t.toLowerCase()])&&void 0!==a?a:e.headers[t]))return!1;return!0}async function l(e,t,a){if("function"==typeof a)return a(t);for(const[r,n]of Object.entries(a)){if("delete"===n){await e.remove(r,t.config);continue}const a=await e.get(r,t.config);if("loading"===a.state)continue;const o=await n(a,t);"delete"!==o?"ignore"!==o&&await e.set(r,o,t.config):await e.remove(r,t.config)}}function h(e){const t=async(t,a)=>{var r;await e.storage.remove(t,a),null===(r=e.waiting[t])||void 0===r||r.reject(),delete e.waiting[t]},a=async a=>{var n,o,i;const s=a.id=null!==(n=(i=a.config).id)&&void 0!==n?n:i.id=e.generateKey(a.config);if(null!==(o=a.cached)&&void 0!==o||(a.cached=!1),a.cached)return a;const c=a.config.cache;if(!c)return Object.assign(Object.assign({},a),{cached:!1});const u=a.config,h=await e.storage.get(s,u);if((null==c?void 0:c.update)&&await l(e.storage,a,c.update),"loading"!==h.state)return a;if(!h.data&&!await f(a,c.cachePredicate))return await t(s,u),a;for(const e of Object.keys(a.headers))e.startsWith("x-axios-cache")&&delete a.headers[e];c.etag&&!0!==c.etag&&(a.headers[r.XAxiosCacheEtag]=c.etag),c.modifiedSince&&(a.headers[r.XAxiosCacheLastModified]=!0===c.modifiedSince?"use-cache-timestamp":c.modifiedSince.toUTCString());let g=c.ttl||-1;if(null==c?void 0:c.interpretHeader){const r=e.headerInterpreter(a.headers);if("dont cache"===r)return await t(s,u),a;g="not enough headers"===r?g:r}const p=d(a,h.data);"function"==typeof g&&(g=await g(a)),c.staleIfError&&(a.headers[r.XAxiosCacheStaleIfError]=String(g));const m={state:"cached",ttl:g,createdAt:Date.now(),data:p},w=e.waiting[s];return w&&(w.resolve(m.data),delete e.waiting[s]),await e.storage.set(s,m,u),a},n=async a=>{var r;const n=a.config;if(!(null==n?void 0:n.cache)||!n.id)throw a;const o=await e.storage.get(n.id,n),i=n.cache;if("loading"!==o.state||"stale"!==o.previous)throw await t(n.id,n),a;if(null==i?void 0:i.staleIfError){const t="function"==typeof i.staleIfError?await i.staleIfError(a.response,o,a):i.staleIfError;if(!0===t||"number"==typeof t&&o.createdAt+t>Date.now())return null===(r=e.waiting[n.id])||void 0===r||r.resolve(o.data),delete e.waiting[n.id],await e.storage.set(n.id,{state:"stale",createdAt:Date.now(),data:o.data},n),{cached:!0,config:n,id:n.id,data:o.data.data,headers:o.data.headers,status:o.data.status,statusText:o.data.statusText}}throw a};return{onFulfilled:a,onRejected:n,apply:()=>e.interceptors.response.use(a,n)}}const g=e=>!!e&&!!e["is-storage"];function p(e){const t=e.data.headers;return r.ETag in t||r.LastModified in t||r.XAxiosCacheEtag in t||r.XAxiosCacheStaleIfError in t||r.XAxiosCacheLastModified in t}function m(e){return e.createdAt+e.ttl<=Date.now()}function w({set:e,find:t,remove:a}){return{"is-storage":1,set:e,remove:a,get:async(r,n)=>{const o=await t(r,n);if(!o)return{state:"empty"};if("cached"!==o.state||!m(o))return o;if(p(o)){const t={state:"stale",createdAt:o.createdAt,data:o.data};return await e(r,t,n),t}return await a(r,n),{state:"empty"}}}}function v(e=!1){const t=w({set:(e,a)=>{t.data[e]=a},remove:e=>{delete t.data[e]},find:a=>{const r=t.data[a];return e&&void 0!==r?"function"==typeof structuredClone?structuredClone(r):JSON.parse(JSON.stringify(r)):r}});return t.data=Object.create(null),t}const y=__webpack_require__(49),S=/^\/|\/$/g;function b(e){return t=>{if(t.id)return t.id;const a=e(t);return"string"==typeof a||"number"==typeof a?`${a}`:`${(0,y.hash)(a)}`}}const I=b((({baseURL:e="",url:t="",method:a="get",params:r,data:n})=>(e&&(e=e.replace(S,"")),t&&(t=t.replace(S,"")),a&&(a=a.toLowerCase()),{url:e+(e&&t?"/":"")+t,params:r,method:a,data:n})));function x(e,t={}){var a,r,o,i,s;const c=e;if(c.storage=t.storage||v(),!g(c.storage))throw new Error("Use buildStorage() function");return c.waiting=t.waiting||{},c.generateKey=t.generateKey||I,c.headerInterpreter=t.headerInterpreter||n,c.requestInterceptor=t.requestInterceptor||u(c),c.responseInterceptor=t.responseInterceptor||h(c),c.debug=t.debug,c.defaults.cache={update:t.update||{},ttl:null!==(a=t.ttl)&&void 0!==a?a:3e5,methods:t.methods||["get"],cachePredicate:t.cachePredicate||{statusCheck:e=>e>=200&&e<400},etag:null===(r=t.etag)||void 0===r||r,modifiedSince:null!==(o=t.modifiedSince)&&void 0!==o?o:!1===t.etag,interpretHeader:null===(i=t.interpretHeader)||void 0===i||i,staleIfError:null===(s=t.staleIfError)||void 0===s||s,override:!1},c.requestInterceptor.apply(),c.responseInterceptor.apply(),c}function C(e,t=""){return w({find:a=>{const r=e.getItem(t+a);return r?JSON.parse(r):void 0},remove:a=>{e.removeItem(t+a)},set:(a,r)=>{const n=()=>e.setItem(t+a,JSON.stringify(r));try{return n()}catch(r){const o=Object.entries(e).filter((e=>e[0].startsWith(t))).map((e=>[e[0],JSON.parse(e[1])]));for(const t of o)"cached"===t[1].state&&m(t[1])&&!p(t[1])&&e.removeItem(t[0]);try{return n()}catch(t){const a=o.sort(((e,t)=>(e[1].createdAt||0)-(t[1].createdAt||0)));for(const t of a){e.removeItem(t[0]);try{return n()}catch(e){}}}e.removeItem(t+a)}}})}module.exports=t})();
  14107.  
  14108. /***/ }),
  14109. /* 33 */
  14110. /***/ ((__unused_webpack_module, exports) => {
  14111.  
  14112. "use strict";
  14113.  
  14114. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14115. exports.css = void 0;
  14116. exports.css = `
  14117. .separator {
  14118. display: flex;
  14119. align-items: center;
  14120. text-align: center;
  14121. color: #737278;
  14122. font-size: 0.9rem;
  14123. font-weight: 500;
  14124. margin: 2rem 0 0.2rem 0;
  14125. }
  14126.  
  14127. .separator::before,
  14128. .separator::after {
  14129. content: '';
  14130. flex: 1;
  14131. border-bottom: 1px dashed #737278;
  14132. }
  14133.  
  14134. .separator:not(:empty)::before {
  14135. margin-right: .5em;
  14136. }
  14137.  
  14138. .separator:not(:empty)::after {
  14139. margin-left: .5em;
  14140. }
  14141.  
  14142. .modal-body label {
  14143. webkit-user-select: none;
  14144. -khtml-user-select: none;
  14145. -moz-user-select: -moz-none;
  14146. -o-user-select: none;
  14147. user-select: none;
  14148. }
  14149.  
  14150. `;
  14151.  
  14152.  
  14153. /***/ }),
  14154. /* 34 */
  14155. /***/ ((__unused_webpack_module, exports) => {
  14156.  
  14157. "use strict";
  14158.  
  14159. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14160. exports.leftJoin = void 0;
  14161. function leftJoin(left, right, key, select) {
  14162. const rightLookup = right.reduce((lookup, item) => {
  14163. lookup.set(item[key], item);
  14164. return lookup;
  14165. }, new Map());
  14166. return left.map((item) => {
  14167. return select(item, rightLookup.get(item[key]));
  14168. });
  14169. }
  14170. exports.leftJoin = leftJoin;
  14171.  
  14172.  
  14173. /***/ }),
  14174. /* 35 */
  14175. /***/ ((__unused_webpack_module, exports) => {
  14176.  
  14177. "use strict";
  14178.  
  14179. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14180. exports.htmlVarInjector = exports.waitForElement = void 0;
  14181. /**
  14182. * Wait for an element to appear in the DOM
  14183. * @param selector CSS selector
  14184. * @param timeout Timeout in milliseconds
  14185. * @returns
  14186. */
  14187. function waitForElement(selector, timeout = 5000) {
  14188. return new Promise((resolve, reject) => {
  14189. const element = document.querySelector(selector);
  14190. if (element) {
  14191. return resolve(element);
  14192. }
  14193. let observer = null;
  14194. const timeoutId = setTimeout(() => {
  14195. if (observer) {
  14196. observer.disconnect();
  14197. }
  14198. reject(`Element with selector ${selector} not found within ${timeout}ms`);
  14199. }, timeout);
  14200. observer = new MutationObserver(() => {
  14201. const element = document.querySelector(selector);
  14202. if (element) {
  14203. clearTimeout(timeoutId);
  14204. if (observer) {
  14205. observer.disconnect();
  14206. }
  14207. resolve(element);
  14208. }
  14209. });
  14210. observer.observe(document.body, {
  14211. childList: true,
  14212. subtree: true,
  14213. });
  14214. });
  14215. }
  14216. exports.waitForElement = waitForElement;
  14217. // this method will replace all ${key} in html with the value of params[key]
  14218. function htmlVarInjector(html, params) {
  14219. return html.replace(/\${(.*?)}/g, (match, key) => {
  14220. return params[key];
  14221. });
  14222. }
  14223. exports.htmlVarInjector = htmlVarInjector;
  14224.  
  14225.  
  14226. /***/ }),
  14227. /* 36 */
  14228. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  14229.  
  14230. "use strict";
  14231.  
  14232. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14233. exports.downloadEnvFile = void 0;
  14234. const config_1 = __webpack_require__(0);
  14235. function saveAs(blob, filename) {
  14236. const url = window.URL.createObjectURL(blob);
  14237. const a = document.createElement('a');
  14238. a.href = url;
  14239. a.download = filename;
  14240. a.click();
  14241. window.URL.revokeObjectURL(url);
  14242. }
  14243. function downloadEnvFile(variables, description) {
  14244. const envFileContent = variables
  14245. .map((variable) => {
  14246. const keyValue = `${variable.key}=${config_1.wrappedVarBy}${variable.value.replaceAll('"', '\\"')}${config_1.wrappedVarBy}`;
  14247. return config_1.replaceEnterWithN ? keyValue.replaceAll('\n', '\\n') : keyValue;
  14248. })
  14249. .join('\n');
  14250. const blob = new Blob([envFileContent], { type: 'text/plain;charset=utf-8' });
  14251. saveAs(blob, `${description}.env`);
  14252. }
  14253. exports.downloadEnvFile = downloadEnvFile;
  14254.  
  14255.  
  14256. /***/ }),
  14257. /* 37 */
  14258. /***/ ((__unused_webpack_module, exports) => {
  14259.  
  14260. "use strict";
  14261.  
  14262. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14263.  
  14264.  
  14265. /***/ }),
  14266. /* 38 */
  14267. /***/ ((__unused_webpack_module, exports) => {
  14268.  
  14269. "use strict";
  14270.  
  14271. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14272.  
  14273.  
  14274. /***/ }),
  14275. /* 39 */
  14276. /***/ ((__unused_webpack_module, exports) => {
  14277.  
  14278. "use strict";
  14279.  
  14280. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14281.  
  14282.  
  14283. /***/ }),
  14284. /* 40 */
  14285. /***/ ((__unused_webpack_module, exports) => {
  14286.  
  14287. "use strict";
  14288.  
  14289. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14290.  
  14291.  
  14292. /***/ }),
  14293. /* 41 */
  14294. /***/ ((__unused_webpack_module, exports) => {
  14295.  
  14296. "use strict";
  14297.  
  14298. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14299.  
  14300.  
  14301. /***/ }),
  14302. /* 42 */
  14303. /***/ ((__unused_webpack_module, exports) => {
  14304.  
  14305. "use strict";
  14306.  
  14307. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14308.  
  14309.  
  14310. /***/ }),
  14311. /* 43 */
  14312. /***/ ((__unused_webpack_module, exports) => {
  14313.  
  14314. "use strict";
  14315.  
  14316. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14317.  
  14318.  
  14319. /***/ }),
  14320. /* 44 */
  14321. /***/ ((__unused_webpack_module, exports) => {
  14322.  
  14323. "use strict";
  14324.  
  14325. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14326.  
  14327.  
  14328. /***/ }),
  14329. /* 45 */
  14330. /***/ ((__unused_webpack_module, exports) => {
  14331.  
  14332. "use strict";
  14333.  
  14334. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14335.  
  14336.  
  14337. /***/ }),
  14338. /* 46 */
  14339. /***/ ((__unused_webpack_module, exports) => {
  14340.  
  14341. "use strict";
  14342.  
  14343. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14344.  
  14345.  
  14346. /***/ }),
  14347. /* 47 */
  14348. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  14349.  
  14350. "use strict";
  14351. __webpack_require__.r(__webpack_exports__);
  14352. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  14353. /* harmony export */ "isCacheControl": () => (/* binding */ i),
  14354. /* harmony export */ "parse": () => (/* binding */ s),
  14355. /* harmony export */ "tokenize": () => (/* binding */ n)
  14356. /* harmony export */ });
  14357. var e=Symbol("cache-parser");function a(e){return("string"==typeof e||"number"==typeof e)&&(e=Number(e))>=0&&e<Infinity}function r(e){return!0===e||"number"==typeof e||"string"==typeof e&&"false"!==e}var t=Number;function s(s){var n=Object.defineProperty({},e,{enumerable:!1,value:1});if(!s||"string"!=typeof s)return n;var i=function(e){var a={},r=e.toLowerCase().replace(/\s+/g,"").split(",");for(var t in r){var s,n=r[t].split("=",2);a[n[0]]=null==(s=n[1])||s}return a}(s),u=i["max-age"],l=i["max-stale"],o=i["min-fresh"],m=i["s-maxage"],p=i["stale-if-error"],h=i["stale-while-revalidate"];return r(i.immutable)&&(n.immutable=!0),a(u)&&(n.maxAge=t(u)),a(l)&&(n.maxStale=t(l)),a(o)&&(n.minFresh=t(o)),r(i["must-revalidate"])&&(n.mustRevalidate=!0),r(i["must-understand"])&&(n.mustUnderstand=!0),r(i["no-cache"])&&(n.noCache=!0),r(i["no-store"])&&(n.noStore=!0),r(i["no-transform"])&&(n.noTransform=!0),r(i["only-if-cached"])&&(n.onlyIfCached=!0),r(i.private)&&(n.private=!0),r(i["proxy-revalidate"])&&(n.proxyRevalidate=!0),r(i.public)&&(n.public=!0),a(m)&&(n.sMaxAge=t(m)),a(p)&&(n.staleIfError=t(p)),a(h)&&(n.staleWhileRevalidate=t(h)),n}function n(e){if(!e||"object"!=typeof e)return[];var t=[];return r(e.immutable)&&t.push("immutable"),a(e.maxAge)&&t.push("max-age="+e.maxAge),a(e.maxStale)&&t.push("max-stale="+e.maxStale),a(e.minFresh)&&t.push("min-fresh="+e.minFresh),r(e.mustRevalidate)&&t.push("must-revalidate"),r(e.mustUnderstand)&&t.push("must-understand"),r(e.noCache)&&t.push("no-cache"),r(e.noStore)&&t.push("no-store"),r(e.noTransform)&&t.push("no-transform"),r(e.onlyIfCached)&&t.push("only-if-cached"),r(e.private)&&t.push("private"),r(e.proxyRevalidate)&&t.push("proxy-revalidate"),r(e.public)&&t.push("public"),a(e.sMaxAge)&&t.push("s-maxage="+e.sMaxAge),a(e.staleIfError)&&t.push("stale-if-error="+e.staleIfError),a(e.staleWhileRevalidate)&&t.push("stale-while-revalidate="+e.staleWhileRevalidate),t}function i(a){return!!a&&!!a[e]}
  14358. //# sourceMappingURL=index.mjs.map
  14359.  
  14360.  
  14361. /***/ }),
  14362. /* 48 */
  14363. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  14364.  
  14365. "use strict";
  14366. __webpack_require__.r(__webpack_exports__);
  14367. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  14368. /* harmony export */ "deferred": () => (/* binding */ e),
  14369. /* harmony export */ "isDeferred": () => (/* binding */ n)
  14370. /* harmony export */ });
  14371. var r=Symbol();function e(){var e,n,o=new Promise(function(r,o){e=r,n=o});return o.resolve=e,o.reject=n,o[r]=1,o}function n(e){return!!e&&!!e[r]}
  14372. //# sourceMappingURL=index.mjs.map
  14373.  
  14374.  
  14375. /***/ }),
  14376. /* 49 */
  14377. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  14378.  
  14379. "use strict";
  14380. __webpack_require__.r(__webpack_exports__);
  14381. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  14382. /* harmony export */ "hash": () => (/* binding */ t),
  14383. /* harmony export */ "serialize": () => (/* binding */ r)
  14384. /* harmony export */ });
  14385. function r(t){var n=typeof t;if(t&&"object"===n&&!(t instanceof Date||t instanceof RegExp)){for(var e=Array.isArray(t)?[]:{},o=Object.keys(t).sort(function(r,t){return r>t?1:-1}),i=o.length;i--;){var a=o[i];e[a]=r(t[a])}return String(t.constructor)+JSON.stringify(e,o)}return n+String(t)}function t(t){t=r(t);for(var n=5381,e=0;e<t.length;)n=33*n^t.charCodeAt(e++);return n}
  14386. //# sourceMappingURL=index.mjs.map
  14387.  
  14388.  
  14389. /***/ }),
  14390. /* 50 */
  14391. /***/ ((__unused_webpack_module, exports) => {
  14392.  
  14393. "use strict";
  14394.  
  14395. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14396. exports.convertMarkdownToHtml = void 0;
  14397. function convertMarkdownToHtml(markdownString) {
  14398. const boldRegex = /\*\*(.*?)\*\*/g;
  14399. const italicRegex = /\*(.*?)\*/g;
  14400. const strikethroughRegex = /~~(.*?)~~/g;
  14401. const codeRegex = /`(.*?)`/g;
  14402. const linkRegex = /\[(.*?)\]\((.*?)\)/g;
  14403. const breakLineRegex = /\n/g;
  14404. const tabRegex = /\t/g;
  14405. const customOpenTagRegex = /<(.*?)>/g;
  14406. const customCloseTagRegex = /<\/(.*?)>/g;
  14407. const boldHtml = '<strong>$1</strong>';
  14408. const italicHtml = '<em>$1</em>';
  14409. const strikethroughHtml = '<del>$1</del>';
  14410. const codeHtml = '<code>$1</code>';
  14411. const linkHtml = '<a href="$2" target="_blank">$1</a>';
  14412. const breakLineHtml = '<br />';
  14413. const tabHtml = '&nbsp;&nbsp;&nbsp;&nbsp;';
  14414. const customOpenTagHtml = '&lt;$1&gt;';
  14415. const customCloseTagHtml = '&lt;/$1&gt;';
  14416. // convert special characters between backticks to html entities
  14417. // get the text between backticks
  14418. const textBetweenBackticks = markdownString.match(/`(.*?)`/g);
  14419. if (textBetweenBackticks) {
  14420. textBetweenBackticks.forEach((text) => {
  14421. // get the text between backticks
  14422. const textWithoutBackticks = text.replace(/`/g, '');
  14423. // convert special characters to html entities
  14424. const div = document.createElement('div');
  14425. div.innerText = div.textContent = textWithoutBackticks;
  14426. const textWithHtmlEntities = div.innerHTML;
  14427. // replace the text between backticks with the text with html entities
  14428. markdownString = markdownString.replace(text, `\`${textWithHtmlEntities}\``);
  14429. });
  14430. }
  14431. // convert markdown to html
  14432. const htmlString = markdownString
  14433. .replace(customCloseTagRegex, customCloseTagHtml)
  14434. .replace(customOpenTagRegex, customOpenTagHtml)
  14435. .replace(boldRegex, boldHtml)
  14436. .replace(italicRegex, italicHtml)
  14437. .replace(strikethroughRegex, strikethroughHtml)
  14438. .replace(codeRegex, codeHtml)
  14439. .replace(linkRegex, linkHtml)
  14440. .replace(breakLineRegex, breakLineHtml)
  14441. .replace(tabRegex, tabHtml);
  14442. return htmlString;
  14443. }
  14444. exports.convertMarkdownToHtml = convertMarkdownToHtml;
  14445.  
  14446.  
  14447. /***/ }),
  14448. /* 51 */
  14449. /***/ ((__unused_webpack_module, exports) => {
  14450.  
  14451. "use strict";
  14452.  
  14453. Object.defineProperty(exports, "__esModule", ({ value: true }));
  14454. exports.VarDescriptionComponent = void 0;
  14455. function VarDescriptionComponent(text) {
  14456. const varDescriptionHtml = `
  14457. <div class="gl-text-gray-500 pb-4 pt-0 mt-0">
  14458. ${text}
  14459. </div>`;
  14460. return $(varDescriptionHtml);
  14461. }
  14462. exports.VarDescriptionComponent = VarDescriptionComponent;
  14463.  
  14464.  
  14465. /***/ })
  14466. /******/ ]);
  14467. /************************************************************************/
  14468. /******/ // The module cache
  14469. /******/ var __webpack_module_cache__ = {};
  14470. /******/
  14471. /******/ // The require function
  14472. /******/ function __webpack_require__(moduleId) {
  14473. /******/ // Check if module is in cache
  14474. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  14475. /******/ if (cachedModule !== undefined) {
  14476. /******/ return cachedModule.exports;
  14477. /******/ }
  14478. /******/ // Create a new module (and put it into the cache)
  14479. /******/ var module = __webpack_module_cache__[moduleId] = {
  14480. /******/ // no module.id needed
  14481. /******/ // no module.loaded needed
  14482. /******/ exports: {}
  14483. /******/ };
  14484. /******/
  14485. /******/ // Execute the module function
  14486. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  14487. /******/
  14488. /******/ // Return the exports of the module
  14489. /******/ return module.exports;
  14490. /******/ }
  14491. /******/
  14492. /************************************************************************/
  14493. /******/ /* webpack/runtime/define property getters */
  14494. /******/ (() => {
  14495. /******/ // define getter functions for harmony exports
  14496. /******/ __webpack_require__.d = (exports, definition) => {
  14497. /******/ for(var key in definition) {
  14498. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  14499. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  14500. /******/ }
  14501. /******/ }
  14502. /******/ };
  14503. /******/ })();
  14504. /******/
  14505. /******/ /* webpack/runtime/global */
  14506. /******/ (() => {
  14507. /******/ __webpack_require__.g = (function() {
  14508. /******/ if (typeof globalThis === 'object') return globalThis;
  14509. /******/ try {
  14510. /******/ return this || new Function('return this')();
  14511. /******/ } catch (e) {
  14512. /******/ if (typeof window === 'object') return window;
  14513. /******/ }
  14514. /******/ })();
  14515. /******/ })();
  14516. /******/
  14517. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  14518. /******/ (() => {
  14519. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  14520. /******/ })();
  14521. /******/
  14522. /******/ /* webpack/runtime/make namespace object */
  14523. /******/ (() => {
  14524. /******/ // define __esModule on exports
  14525. /******/ __webpack_require__.r = (exports) => {
  14526. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  14527. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  14528. /******/ }
  14529. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  14530. /******/ };
  14531. /******/ })();
  14532. /******/
  14533. /************************************************************************/
  14534. /******/
  14535. /******/ // startup
  14536. /******/ // Load entry module and return exports
  14537. /******/ // This entry module is referenced by other modules so it can't be inlined
  14538. /******/ var __webpack_exports__ = __webpack_require__(14);
  14539. /******/
  14540. /******/ })()
  14541. ;

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址