bootstrap-table-print.js 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = global || self, factory(global.jQuery));
  5. }(this, function ($) { 'use strict';
  6. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  7. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  8. function createCommonjsModule(fn, module) {
  9. return module = { exports: {} }, fn(module, module.exports), module.exports;
  10. }
  11. var O = 'object';
  12. var check = function (it) {
  13. return it && it.Math == Math && it;
  14. };
  15. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  16. var global_1 =
  17. // eslint-disable-next-line no-undef
  18. check(typeof globalThis == O && globalThis) ||
  19. check(typeof window == O && window) ||
  20. check(typeof self == O && self) ||
  21. check(typeof commonjsGlobal == O && commonjsGlobal) ||
  22. // eslint-disable-next-line no-new-func
  23. Function('return this')();
  24. var fails = function (exec) {
  25. try {
  26. return !!exec();
  27. } catch (error) {
  28. return true;
  29. }
  30. };
  31. // Thank's IE8 for his funny defineProperty
  32. var descriptors = !fails(function () {
  33. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  34. });
  35. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  36. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  37. // Nashorn ~ JDK8 bug
  38. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  39. // `Object.prototype.propertyIsEnumerable` method implementation
  40. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  41. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  42. var descriptor = getOwnPropertyDescriptor(this, V);
  43. return !!descriptor && descriptor.enumerable;
  44. } : nativePropertyIsEnumerable;
  45. var objectPropertyIsEnumerable = {
  46. f: f
  47. };
  48. var createPropertyDescriptor = function (bitmap, value) {
  49. return {
  50. enumerable: !(bitmap & 1),
  51. configurable: !(bitmap & 2),
  52. writable: !(bitmap & 4),
  53. value: value
  54. };
  55. };
  56. var toString = {}.toString;
  57. var classofRaw = function (it) {
  58. return toString.call(it).slice(8, -1);
  59. };
  60. var split = ''.split;
  61. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  62. var indexedObject = fails(function () {
  63. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  64. // eslint-disable-next-line no-prototype-builtins
  65. return !Object('z').propertyIsEnumerable(0);
  66. }) ? function (it) {
  67. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  68. } : Object;
  69. // `RequireObjectCoercible` abstract operation
  70. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  71. var requireObjectCoercible = function (it) {
  72. if (it == undefined) throw TypeError("Can't call method on " + it);
  73. return it;
  74. };
  75. // toObject with fallback for non-array-like ES3 strings
  76. var toIndexedObject = function (it) {
  77. return indexedObject(requireObjectCoercible(it));
  78. };
  79. var isObject = function (it) {
  80. return typeof it === 'object' ? it !== null : typeof it === 'function';
  81. };
  82. // `ToPrimitive` abstract operation
  83. // https://tc39.github.io/ecma262/#sec-toprimitive
  84. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  85. // and the second argument - flag - preferred type is a string
  86. var toPrimitive = function (input, PREFERRED_STRING) {
  87. if (!isObject(input)) return input;
  88. var fn, val;
  89. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  91. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  92. throw TypeError("Can't convert object to primitive value");
  93. };
  94. var hasOwnProperty = {}.hasOwnProperty;
  95. var has = function (it, key) {
  96. return hasOwnProperty.call(it, key);
  97. };
  98. var document = global_1.document;
  99. // typeof document.createElement is 'object' in old IE
  100. var EXISTS = isObject(document) && isObject(document.createElement);
  101. var documentCreateElement = function (it) {
  102. return EXISTS ? document.createElement(it) : {};
  103. };
  104. // Thank's IE8 for his funny defineProperty
  105. var ie8DomDefine = !descriptors && !fails(function () {
  106. return Object.defineProperty(documentCreateElement('div'), 'a', {
  107. get: function () { return 7; }
  108. }).a != 7;
  109. });
  110. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  111. // `Object.getOwnPropertyDescriptor` method
  112. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  113. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  114. O = toIndexedObject(O);
  115. P = toPrimitive(P, true);
  116. if (ie8DomDefine) try {
  117. return nativeGetOwnPropertyDescriptor(O, P);
  118. } catch (error) { /* empty */ }
  119. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  120. };
  121. var objectGetOwnPropertyDescriptor = {
  122. f: f$1
  123. };
  124. var anObject = function (it) {
  125. if (!isObject(it)) {
  126. throw TypeError(String(it) + ' is not an object');
  127. } return it;
  128. };
  129. var nativeDefineProperty = Object.defineProperty;
  130. // `Object.defineProperty` method
  131. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  132. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  133. anObject(O);
  134. P = toPrimitive(P, true);
  135. anObject(Attributes);
  136. if (ie8DomDefine) try {
  137. return nativeDefineProperty(O, P, Attributes);
  138. } catch (error) { /* empty */ }
  139. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  140. if ('value' in Attributes) O[P] = Attributes.value;
  141. return O;
  142. };
  143. var objectDefineProperty = {
  144. f: f$2
  145. };
  146. var hide = descriptors ? function (object, key, value) {
  147. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  148. } : function (object, key, value) {
  149. object[key] = value;
  150. return object;
  151. };
  152. var setGlobal = function (key, value) {
  153. try {
  154. hide(global_1, key, value);
  155. } catch (error) {
  156. global_1[key] = value;
  157. } return value;
  158. };
  159. var shared = createCommonjsModule(function (module) {
  160. var SHARED = '__core-js_shared__';
  161. var store = global_1[SHARED] || setGlobal(SHARED, {});
  162. (module.exports = function (key, value) {
  163. return store[key] || (store[key] = value !== undefined ? value : {});
  164. })('versions', []).push({
  165. version: '3.1.3',
  166. mode: 'global',
  167. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  168. });
  169. });
  170. var functionToString = shared('native-function-to-string', Function.toString);
  171. var WeakMap = global_1.WeakMap;
  172. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
  173. var id = 0;
  174. var postfix = Math.random();
  175. var uid = function (key) {
  176. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  177. };
  178. var keys = shared('keys');
  179. var sharedKey = function (key) {
  180. return keys[key] || (keys[key] = uid(key));
  181. };
  182. var hiddenKeys = {};
  183. var WeakMap$1 = global_1.WeakMap;
  184. var set, get, has$1;
  185. var enforce = function (it) {
  186. return has$1(it) ? get(it) : set(it, {});
  187. };
  188. var getterFor = function (TYPE) {
  189. return function (it) {
  190. var state;
  191. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  192. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  193. } return state;
  194. };
  195. };
  196. if (nativeWeakMap) {
  197. var store = new WeakMap$1();
  198. var wmget = store.get;
  199. var wmhas = store.has;
  200. var wmset = store.set;
  201. set = function (it, metadata) {
  202. wmset.call(store, it, metadata);
  203. return metadata;
  204. };
  205. get = function (it) {
  206. return wmget.call(store, it) || {};
  207. };
  208. has$1 = function (it) {
  209. return wmhas.call(store, it);
  210. };
  211. } else {
  212. var STATE = sharedKey('state');
  213. hiddenKeys[STATE] = true;
  214. set = function (it, metadata) {
  215. hide(it, STATE, metadata);
  216. return metadata;
  217. };
  218. get = function (it) {
  219. return has(it, STATE) ? it[STATE] : {};
  220. };
  221. has$1 = function (it) {
  222. return has(it, STATE);
  223. };
  224. }
  225. var internalState = {
  226. set: set,
  227. get: get,
  228. has: has$1,
  229. enforce: enforce,
  230. getterFor: getterFor
  231. };
  232. var redefine = createCommonjsModule(function (module) {
  233. var getInternalState = internalState.get;
  234. var enforceInternalState = internalState.enforce;
  235. var TEMPLATE = String(functionToString).split('toString');
  236. shared('inspectSource', function (it) {
  237. return functionToString.call(it);
  238. });
  239. (module.exports = function (O, key, value, options) {
  240. var unsafe = options ? !!options.unsafe : false;
  241. var simple = options ? !!options.enumerable : false;
  242. var noTargetGet = options ? !!options.noTargetGet : false;
  243. if (typeof value == 'function') {
  244. if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
  245. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  246. }
  247. if (O === global_1) {
  248. if (simple) O[key] = value;
  249. else setGlobal(key, value);
  250. return;
  251. } else if (!unsafe) {
  252. delete O[key];
  253. } else if (!noTargetGet && O[key]) {
  254. simple = true;
  255. }
  256. if (simple) O[key] = value;
  257. else hide(O, key, value);
  258. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  259. })(Function.prototype, 'toString', function toString() {
  260. return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
  261. });
  262. });
  263. var path = global_1;
  264. var aFunction = function (variable) {
  265. return typeof variable == 'function' ? variable : undefined;
  266. };
  267. var getBuiltIn = function (namespace, method) {
  268. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  269. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  270. };
  271. var ceil = Math.ceil;
  272. var floor = Math.floor;
  273. // `ToInteger` abstract operation
  274. // https://tc39.github.io/ecma262/#sec-tointeger
  275. var toInteger = function (argument) {
  276. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  277. };
  278. var min = Math.min;
  279. // `ToLength` abstract operation
  280. // https://tc39.github.io/ecma262/#sec-tolength
  281. var toLength = function (argument) {
  282. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  283. };
  284. var max = Math.max;
  285. var min$1 = Math.min;
  286. // Helper for a popular repeating case of the spec:
  287. // Let integer be ? ToInteger(index).
  288. // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
  289. var toAbsoluteIndex = function (index, length) {
  290. var integer = toInteger(index);
  291. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  292. };
  293. // `Array.prototype.{ indexOf, includes }` methods implementation
  294. var createMethod = function (IS_INCLUDES) {
  295. return function ($this, el, fromIndex) {
  296. var O = toIndexedObject($this);
  297. var length = toLength(O.length);
  298. var index = toAbsoluteIndex(fromIndex, length);
  299. var value;
  300. // Array#includes uses SameValueZero equality algorithm
  301. // eslint-disable-next-line no-self-compare
  302. if (IS_INCLUDES && el != el) while (length > index) {
  303. value = O[index++];
  304. // eslint-disable-next-line no-self-compare
  305. if (value != value) return true;
  306. // Array#indexOf ignores holes, Array#includes - not
  307. } else for (;length > index; index++) {
  308. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  309. } return !IS_INCLUDES && -1;
  310. };
  311. };
  312. var arrayIncludes = {
  313. // `Array.prototype.includes` method
  314. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  315. includes: createMethod(true),
  316. // `Array.prototype.indexOf` method
  317. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  318. indexOf: createMethod(false)
  319. };
  320. var indexOf = arrayIncludes.indexOf;
  321. var objectKeysInternal = function (object, names) {
  322. var O = toIndexedObject(object);
  323. var i = 0;
  324. var result = [];
  325. var key;
  326. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  327. // Don't enum bug & hidden keys
  328. while (names.length > i) if (has(O, key = names[i++])) {
  329. ~indexOf(result, key) || result.push(key);
  330. }
  331. return result;
  332. };
  333. // IE8- don't enum bug keys
  334. var enumBugKeys = [
  335. 'constructor',
  336. 'hasOwnProperty',
  337. 'isPrototypeOf',
  338. 'propertyIsEnumerable',
  339. 'toLocaleString',
  340. 'toString',
  341. 'valueOf'
  342. ];
  343. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  344. // `Object.getOwnPropertyNames` method
  345. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  346. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  347. return objectKeysInternal(O, hiddenKeys$1);
  348. };
  349. var objectGetOwnPropertyNames = {
  350. f: f$3
  351. };
  352. var f$4 = Object.getOwnPropertySymbols;
  353. var objectGetOwnPropertySymbols = {
  354. f: f$4
  355. };
  356. // all object keys, includes non-enumerable and symbols
  357. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  358. var keys = objectGetOwnPropertyNames.f(anObject(it));
  359. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  360. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  361. };
  362. var copyConstructorProperties = function (target, source) {
  363. var keys = ownKeys(source);
  364. var defineProperty = objectDefineProperty.f;
  365. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  366. for (var i = 0; i < keys.length; i++) {
  367. var key = keys[i];
  368. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  369. }
  370. };
  371. var replacement = /#|\.prototype\./;
  372. var isForced = function (feature, detection) {
  373. var value = data[normalize(feature)];
  374. return value == POLYFILL ? true
  375. : value == NATIVE ? false
  376. : typeof detection == 'function' ? fails(detection)
  377. : !!detection;
  378. };
  379. var normalize = isForced.normalize = function (string) {
  380. return String(string).replace(replacement, '.').toLowerCase();
  381. };
  382. var data = isForced.data = {};
  383. var NATIVE = isForced.NATIVE = 'N';
  384. var POLYFILL = isForced.POLYFILL = 'P';
  385. var isForced_1 = isForced;
  386. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  387. /*
  388. options.target - name of the target object
  389. options.global - target is the global object
  390. options.stat - export as static methods of target
  391. options.proto - export as prototype methods of target
  392. options.real - real prototype method for the `pure` version
  393. options.forced - export even if the native feature is available
  394. options.bind - bind methods to the target, required for the `pure` version
  395. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  396. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  397. options.sham - add a flag to not completely full polyfills
  398. options.enumerable - export as enumerable property
  399. options.noTargetGet - prevent calling a getter on target
  400. */
  401. var _export = function (options, source) {
  402. var TARGET = options.target;
  403. var GLOBAL = options.global;
  404. var STATIC = options.stat;
  405. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  406. if (GLOBAL) {
  407. target = global_1;
  408. } else if (STATIC) {
  409. target = global_1[TARGET] || setGlobal(TARGET, {});
  410. } else {
  411. target = (global_1[TARGET] || {}).prototype;
  412. }
  413. if (target) for (key in source) {
  414. sourceProperty = source[key];
  415. if (options.noTargetGet) {
  416. descriptor = getOwnPropertyDescriptor$1(target, key);
  417. targetProperty = descriptor && descriptor.value;
  418. } else targetProperty = target[key];
  419. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  420. // contained in target
  421. if (!FORCED && targetProperty !== undefined) {
  422. if (typeof sourceProperty === typeof targetProperty) continue;
  423. copyConstructorProperties(sourceProperty, targetProperty);
  424. }
  425. // add a flag to not completely full polyfills
  426. if (options.sham || (targetProperty && targetProperty.sham)) {
  427. hide(sourceProperty, 'sham', true);
  428. }
  429. // extend global
  430. redefine(target, key, sourceProperty, options);
  431. }
  432. };
  433. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  434. // Chrome 38 Symbol has incorrect toString conversion
  435. // eslint-disable-next-line no-undef
  436. return !String(Symbol());
  437. });
  438. // `IsArray` abstract operation
  439. // https://tc39.github.io/ecma262/#sec-isarray
  440. var isArray = Array.isArray || function isArray(arg) {
  441. return classofRaw(arg) == 'Array';
  442. };
  443. // `ToObject` abstract operation
  444. // https://tc39.github.io/ecma262/#sec-toobject
  445. var toObject = function (argument) {
  446. return Object(requireObjectCoercible(argument));
  447. };
  448. // `Object.keys` method
  449. // https://tc39.github.io/ecma262/#sec-object.keys
  450. var objectKeys = Object.keys || function keys(O) {
  451. return objectKeysInternal(O, enumBugKeys);
  452. };
  453. // `Object.defineProperties` method
  454. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  455. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  456. anObject(O);
  457. var keys = objectKeys(Properties);
  458. var length = keys.length;
  459. var index = 0;
  460. var key;
  461. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  462. return O;
  463. };
  464. var html = getBuiltIn('document', 'documentElement');
  465. var IE_PROTO = sharedKey('IE_PROTO');
  466. var PROTOTYPE = 'prototype';
  467. var Empty = function () { /* empty */ };
  468. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  469. var createDict = function () {
  470. // Thrash, waste and sodomy: IE GC bug
  471. var iframe = documentCreateElement('iframe');
  472. var length = enumBugKeys.length;
  473. var lt = '<';
  474. var script = 'script';
  475. var gt = '>';
  476. var js = 'java' + script + ':';
  477. var iframeDocument;
  478. iframe.style.display = 'none';
  479. html.appendChild(iframe);
  480. iframe.src = String(js);
  481. iframeDocument = iframe.contentWindow.document;
  482. iframeDocument.open();
  483. iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
  484. iframeDocument.close();
  485. createDict = iframeDocument.F;
  486. while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
  487. return createDict();
  488. };
  489. // `Object.create` method
  490. // https://tc39.github.io/ecma262/#sec-object.create
  491. var objectCreate = Object.create || function create(O, Properties) {
  492. var result;
  493. if (O !== null) {
  494. Empty[PROTOTYPE] = anObject(O);
  495. result = new Empty();
  496. Empty[PROTOTYPE] = null;
  497. // add "__proto__" for Object.getPrototypeOf polyfill
  498. result[IE_PROTO] = O;
  499. } else result = createDict();
  500. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  501. };
  502. hiddenKeys[IE_PROTO] = true;
  503. var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
  504. var toString$1 = {}.toString;
  505. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  506. ? Object.getOwnPropertyNames(window) : [];
  507. var getWindowNames = function (it) {
  508. try {
  509. return nativeGetOwnPropertyNames(it);
  510. } catch (error) {
  511. return windowNames.slice();
  512. }
  513. };
  514. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  515. var f$5 = function getOwnPropertyNames(it) {
  516. return windowNames && toString$1.call(it) == '[object Window]'
  517. ? getWindowNames(it)
  518. : nativeGetOwnPropertyNames(toIndexedObject(it));
  519. };
  520. var objectGetOwnPropertyNamesExternal = {
  521. f: f$5
  522. };
  523. var Symbol$1 = global_1.Symbol;
  524. var store$1 = shared('wks');
  525. var wellKnownSymbol = function (name) {
  526. return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
  527. || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
  528. };
  529. var f$6 = wellKnownSymbol;
  530. var wrappedWellKnownSymbol = {
  531. f: f$6
  532. };
  533. var defineProperty = objectDefineProperty.f;
  534. var defineWellKnownSymbol = function (NAME) {
  535. var Symbol = path.Symbol || (path.Symbol = {});
  536. if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
  537. value: wrappedWellKnownSymbol.f(NAME)
  538. });
  539. };
  540. var defineProperty$1 = objectDefineProperty.f;
  541. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  542. var setToStringTag = function (it, TAG, STATIC) {
  543. if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  544. defineProperty$1(it, TO_STRING_TAG, { configurable: true, value: TAG });
  545. }
  546. };
  547. var aFunction$1 = function (it) {
  548. if (typeof it != 'function') {
  549. throw TypeError(String(it) + ' is not a function');
  550. } return it;
  551. };
  552. // optional / simple context binding
  553. var bindContext = function (fn, that, length) {
  554. aFunction$1(fn);
  555. if (that === undefined) return fn;
  556. switch (length) {
  557. case 0: return function () {
  558. return fn.call(that);
  559. };
  560. case 1: return function (a) {
  561. return fn.call(that, a);
  562. };
  563. case 2: return function (a, b) {
  564. return fn.call(that, a, b);
  565. };
  566. case 3: return function (a, b, c) {
  567. return fn.call(that, a, b, c);
  568. };
  569. }
  570. return function (/* ...args */) {
  571. return fn.apply(that, arguments);
  572. };
  573. };
  574. var SPECIES = wellKnownSymbol('species');
  575. // `ArraySpeciesCreate` abstract operation
  576. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  577. var arraySpeciesCreate = function (originalArray, length) {
  578. var C;
  579. if (isArray(originalArray)) {
  580. C = originalArray.constructor;
  581. // cross-realm fallback
  582. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  583. else if (isObject(C)) {
  584. C = C[SPECIES];
  585. if (C === null) C = undefined;
  586. }
  587. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  588. };
  589. var push = [].push;
  590. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  591. var createMethod$1 = function (TYPE) {
  592. var IS_MAP = TYPE == 1;
  593. var IS_FILTER = TYPE == 2;
  594. var IS_SOME = TYPE == 3;
  595. var IS_EVERY = TYPE == 4;
  596. var IS_FIND_INDEX = TYPE == 6;
  597. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  598. return function ($this, callbackfn, that, specificCreate) {
  599. var O = toObject($this);
  600. var self = indexedObject(O);
  601. var boundFunction = bindContext(callbackfn, that, 3);
  602. var length = toLength(self.length);
  603. var index = 0;
  604. var create = specificCreate || arraySpeciesCreate;
  605. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  606. var value, result;
  607. for (;length > index; index++) if (NO_HOLES || index in self) {
  608. value = self[index];
  609. result = boundFunction(value, index, O);
  610. if (TYPE) {
  611. if (IS_MAP) target[index] = result; // map
  612. else if (result) switch (TYPE) {
  613. case 3: return true; // some
  614. case 5: return value; // find
  615. case 6: return index; // findIndex
  616. case 2: push.call(target, value); // filter
  617. } else if (IS_EVERY) return false; // every
  618. }
  619. }
  620. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  621. };
  622. };
  623. var arrayIteration = {
  624. // `Array.prototype.forEach` method
  625. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  626. forEach: createMethod$1(0),
  627. // `Array.prototype.map` method
  628. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  629. map: createMethod$1(1),
  630. // `Array.prototype.filter` method
  631. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  632. filter: createMethod$1(2),
  633. // `Array.prototype.some` method
  634. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  635. some: createMethod$1(3),
  636. // `Array.prototype.every` method
  637. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  638. every: createMethod$1(4),
  639. // `Array.prototype.find` method
  640. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  641. find: createMethod$1(5),
  642. // `Array.prototype.findIndex` method
  643. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  644. findIndex: createMethod$1(6)
  645. };
  646. var $forEach = arrayIteration.forEach;
  647. var HIDDEN = sharedKey('hidden');
  648. var SYMBOL = 'Symbol';
  649. var PROTOTYPE$1 = 'prototype';
  650. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  651. var setInternalState = internalState.set;
  652. var getInternalState = internalState.getterFor(SYMBOL);
  653. var ObjectPrototype = Object[PROTOTYPE$1];
  654. var $Symbol = global_1.Symbol;
  655. var JSON = global_1.JSON;
  656. var nativeJSONStringify = JSON && JSON.stringify;
  657. var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  658. var nativeDefineProperty$1 = objectDefineProperty.f;
  659. var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
  660. var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
  661. var AllSymbols = shared('symbols');
  662. var ObjectPrototypeSymbols = shared('op-symbols');
  663. var StringToSymbolRegistry = shared('string-to-symbol-registry');
  664. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  665. var WellKnownSymbolsStore = shared('wks');
  666. var QObject = global_1.QObject;
  667. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  668. var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
  669. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  670. var setSymbolDescriptor = descriptors && fails(function () {
  671. return objectCreate(nativeDefineProperty$1({}, 'a', {
  672. get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; }
  673. })).a != 7;
  674. }) ? function (O, P, Attributes) {
  675. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype, P);
  676. if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
  677. nativeDefineProperty$1(O, P, Attributes);
  678. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  679. nativeDefineProperty$1(ObjectPrototype, P, ObjectPrototypeDescriptor);
  680. }
  681. } : nativeDefineProperty$1;
  682. var wrap = function (tag, description) {
  683. var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]);
  684. setInternalState(symbol, {
  685. type: SYMBOL,
  686. tag: tag,
  687. description: description
  688. });
  689. if (!descriptors) symbol.description = description;
  690. return symbol;
  691. };
  692. var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) {
  693. return typeof it == 'symbol';
  694. } : function (it) {
  695. return Object(it) instanceof $Symbol;
  696. };
  697. var $defineProperty = function defineProperty(O, P, Attributes) {
  698. if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  699. anObject(O);
  700. var key = toPrimitive(P, true);
  701. anObject(Attributes);
  702. if (has(AllSymbols, key)) {
  703. if (!Attributes.enumerable) {
  704. if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {}));
  705. O[HIDDEN][key] = true;
  706. } else {
  707. if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
  708. Attributes = objectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  709. } return setSymbolDescriptor(O, key, Attributes);
  710. } return nativeDefineProperty$1(O, key, Attributes);
  711. };
  712. var $defineProperties = function defineProperties(O, Properties) {
  713. anObject(O);
  714. var properties = toIndexedObject(Properties);
  715. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  716. $forEach(keys, function (key) {
  717. if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
  718. });
  719. return O;
  720. };
  721. var $create = function create(O, Properties) {
  722. return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties);
  723. };
  724. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  725. var P = toPrimitive(V, true);
  726. var enumerable = nativePropertyIsEnumerable$1.call(this, P);
  727. if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
  728. return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
  729. };
  730. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  731. var it = toIndexedObject(O);
  732. var key = toPrimitive(P, true);
  733. if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
  734. var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
  735. if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
  736. descriptor.enumerable = true;
  737. }
  738. return descriptor;
  739. };
  740. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  741. var names = nativeGetOwnPropertyNames$1(toIndexedObject(O));
  742. var result = [];
  743. $forEach(names, function (key) {
  744. if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
  745. });
  746. return result;
  747. };
  748. var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
  749. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  750. var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  751. var result = [];
  752. $forEach(names, function (key) {
  753. if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
  754. result.push(AllSymbols[key]);
  755. }
  756. });
  757. return result;
  758. };
  759. // `Symbol` constructor
  760. // https://tc39.github.io/ecma262/#sec-symbol-constructor
  761. if (!nativeSymbol) {
  762. $Symbol = function Symbol() {
  763. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
  764. var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
  765. var tag = uid(description);
  766. var setter = function (value) {
  767. if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
  768. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  769. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  770. };
  771. if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  772. return wrap(tag, description);
  773. };
  774. redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
  775. return getInternalState(this).tag;
  776. });
  777. objectPropertyIsEnumerable.f = $propertyIsEnumerable;
  778. objectDefineProperty.f = $defineProperty;
  779. objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
  780. objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  781. objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
  782. if (descriptors) {
  783. // https://github.com/tc39/proposal-Symbol-description
  784. nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', {
  785. configurable: true,
  786. get: function description() {
  787. return getInternalState(this).description;
  788. }
  789. });
  790. {
  791. redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  792. }
  793. }
  794. wrappedWellKnownSymbol.f = function (name) {
  795. return wrap(wellKnownSymbol(name), name);
  796. };
  797. }
  798. _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, {
  799. Symbol: $Symbol
  800. });
  801. $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
  802. defineWellKnownSymbol(name);
  803. });
  804. _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
  805. // `Symbol.for` method
  806. // https://tc39.github.io/ecma262/#sec-symbol.for
  807. 'for': function (key) {
  808. var string = String(key);
  809. if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
  810. var symbol = $Symbol(string);
  811. StringToSymbolRegistry[string] = symbol;
  812. SymbolToStringRegistry[symbol] = string;
  813. return symbol;
  814. },
  815. // `Symbol.keyFor` method
  816. // https://tc39.github.io/ecma262/#sec-symbol.keyfor
  817. keyFor: function keyFor(sym) {
  818. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
  819. if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
  820. },
  821. useSetter: function () { USE_SETTER = true; },
  822. useSimple: function () { USE_SETTER = false; }
  823. });
  824. _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
  825. // `Object.create` method
  826. // https://tc39.github.io/ecma262/#sec-object.create
  827. create: $create,
  828. // `Object.defineProperty` method
  829. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  830. defineProperty: $defineProperty,
  831. // `Object.defineProperties` method
  832. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  833. defineProperties: $defineProperties,
  834. // `Object.getOwnPropertyDescriptor` method
  835. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
  836. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  837. });
  838. _export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
  839. // `Object.getOwnPropertyNames` method
  840. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  841. getOwnPropertyNames: $getOwnPropertyNames,
  842. // `Object.getOwnPropertySymbols` method
  843. // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
  844. getOwnPropertySymbols: $getOwnPropertySymbols
  845. });
  846. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  847. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  848. _export({ target: 'Object', stat: true, forced: fails(function () { objectGetOwnPropertySymbols.f(1); }) }, {
  849. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  850. return objectGetOwnPropertySymbols.f(toObject(it));
  851. }
  852. });
  853. // `JSON.stringify` method behavior with symbols
  854. // https://tc39.github.io/ecma262/#sec-json.stringify
  855. JSON && _export({ target: 'JSON', stat: true, forced: !nativeSymbol || fails(function () {
  856. var symbol = $Symbol();
  857. // MS Edge converts symbol values to JSON as {}
  858. return nativeJSONStringify([symbol]) != '[null]'
  859. // WebKit converts symbol values to JSON as null
  860. || nativeJSONStringify({ a: symbol }) != '{}'
  861. // V8 throws on boxed symbols
  862. || nativeJSONStringify(Object(symbol)) != '{}';
  863. }) }, {
  864. stringify: function stringify(it) {
  865. var args = [it];
  866. var index = 1;
  867. var replacer, $replacer;
  868. while (arguments.length > index) args.push(arguments[index++]);
  869. $replacer = replacer = args[1];
  870. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  871. if (!isArray(replacer)) replacer = function (key, value) {
  872. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  873. if (!isSymbol(value)) return value;
  874. };
  875. args[1] = replacer;
  876. return nativeJSONStringify.apply(JSON, args);
  877. }
  878. });
  879. // `Symbol.prototype[@@toPrimitive]` method
  880. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
  881. if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
  882. // `Symbol.prototype[@@toStringTag]` property
  883. // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
  884. setToStringTag($Symbol, SYMBOL);
  885. hiddenKeys[HIDDEN] = true;
  886. var defineProperty$2 = objectDefineProperty.f;
  887. var NativeSymbol = global_1.Symbol;
  888. if (descriptors && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
  889. // Safari 12 bug
  890. NativeSymbol().description !== undefined
  891. )) {
  892. var EmptyStringDescriptionStore = {};
  893. // wrap Symbol constructor for correct work with undefined description
  894. var SymbolWrapper = function Symbol() {
  895. var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
  896. var result = this instanceof SymbolWrapper
  897. ? new NativeSymbol(description)
  898. // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  899. : description === undefined ? NativeSymbol() : NativeSymbol(description);
  900. if (description === '') EmptyStringDescriptionStore[result] = true;
  901. return result;
  902. };
  903. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  904. var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
  905. symbolPrototype.constructor = SymbolWrapper;
  906. var symbolToString = symbolPrototype.toString;
  907. var native = String(NativeSymbol('test')) == 'Symbol(test)';
  908. var regexp = /^Symbol\((.*)\)[^)]+$/;
  909. defineProperty$2(symbolPrototype, 'description', {
  910. configurable: true,
  911. get: function description() {
  912. var symbol = isObject(this) ? this.valueOf() : this;
  913. var string = symbolToString.call(symbol);
  914. if (has(EmptyStringDescriptionStore, symbol)) return '';
  915. var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
  916. return desc === '' ? undefined : desc;
  917. }
  918. });
  919. _export({ global: true, forced: true }, {
  920. Symbol: SymbolWrapper
  921. });
  922. }
  923. // `Symbol.iterator` well-known symbol
  924. // https://tc39.github.io/ecma262/#sec-symbol.iterator
  925. defineWellKnownSymbol('iterator');
  926. var createProperty = function (object, key, value) {
  927. var propertyKey = toPrimitive(key);
  928. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  929. else object[propertyKey] = value;
  930. };
  931. var SPECIES$1 = wellKnownSymbol('species');
  932. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  933. return !fails(function () {
  934. var array = [];
  935. var constructor = array.constructor = {};
  936. constructor[SPECIES$1] = function () {
  937. return { foo: 1 };
  938. };
  939. return array[METHOD_NAME](Boolean).foo !== 1;
  940. });
  941. };
  942. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  943. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  944. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  945. var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
  946. var array = [];
  947. array[IS_CONCAT_SPREADABLE] = false;
  948. return array.concat()[0] !== array;
  949. });
  950. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  951. var isConcatSpreadable = function (O) {
  952. if (!isObject(O)) return false;
  953. var spreadable = O[IS_CONCAT_SPREADABLE];
  954. return spreadable !== undefined ? !!spreadable : isArray(O);
  955. };
  956. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  957. // `Array.prototype.concat` method
  958. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  959. // with adding support of @@isConcatSpreadable and @@species
  960. _export({ target: 'Array', proto: true, forced: FORCED }, {
  961. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  962. var O = toObject(this);
  963. var A = arraySpeciesCreate(O, 0);
  964. var n = 0;
  965. var i, k, length, len, E;
  966. for (i = -1, length = arguments.length; i < length; i++) {
  967. E = i === -1 ? O : arguments[i];
  968. if (isConcatSpreadable(E)) {
  969. len = toLength(E.length);
  970. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  971. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  972. } else {
  973. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  974. createProperty(A, n++, E);
  975. }
  976. }
  977. A.length = n;
  978. return A;
  979. }
  980. });
  981. var $filter = arrayIteration.filter;
  982. // `Array.prototype.filter` method
  983. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  984. // with adding support of @@species
  985. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
  986. filter: function filter(callbackfn /* , thisArg */) {
  987. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  988. }
  989. });
  990. var UNSCOPABLES = wellKnownSymbol('unscopables');
  991. var ArrayPrototype = Array.prototype;
  992. // Array.prototype[@@unscopables]
  993. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  994. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  995. hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
  996. }
  997. // add a key to Array.prototype[@@unscopables]
  998. var addToUnscopables = function (key) {
  999. ArrayPrototype[UNSCOPABLES][key] = true;
  1000. };
  1001. var $find = arrayIteration.find;
  1002. var FIND = 'find';
  1003. var SKIPS_HOLES = true;
  1004. // Shouldn't skip holes
  1005. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1006. // `Array.prototype.find` method
  1007. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  1008. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1009. find: function find(callbackfn /* , that = undefined */) {
  1010. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1011. }
  1012. });
  1013. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1014. addToUnscopables(FIND);
  1015. var correctPrototypeGetter = !fails(function () {
  1016. function F() { /* empty */ }
  1017. F.prototype.constructor = null;
  1018. return Object.getPrototypeOf(new F()) !== F.prototype;
  1019. });
  1020. var IE_PROTO$1 = sharedKey('IE_PROTO');
  1021. var ObjectPrototype$1 = Object.prototype;
  1022. // `Object.getPrototypeOf` method
  1023. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  1024. var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
  1025. O = toObject(O);
  1026. if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
  1027. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  1028. return O.constructor.prototype;
  1029. } return O instanceof Object ? ObjectPrototype$1 : null;
  1030. };
  1031. var ITERATOR = wellKnownSymbol('iterator');
  1032. var BUGGY_SAFARI_ITERATORS = false;
  1033. var returnThis = function () { return this; };
  1034. // `%IteratorPrototype%` object
  1035. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  1036. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  1037. if ([].keys) {
  1038. arrayIterator = [].keys();
  1039. // Safari 8 has buggy iterators w/o `next`
  1040. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  1041. else {
  1042. PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
  1043. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  1044. }
  1045. }
  1046. if (IteratorPrototype == undefined) IteratorPrototype = {};
  1047. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  1048. if ( !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
  1049. var iteratorsCore = {
  1050. IteratorPrototype: IteratorPrototype,
  1051. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  1052. };
  1053. var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
  1054. var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
  1055. var TO_STRING_TAG = NAME + ' Iterator';
  1056. IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
  1057. setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
  1058. return IteratorConstructor;
  1059. };
  1060. var aPossiblePrototype = function (it) {
  1061. if (!isObject(it) && it !== null) {
  1062. throw TypeError("Can't set " + String(it) + ' as a prototype');
  1063. } return it;
  1064. };
  1065. // `Object.setPrototypeOf` method
  1066. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  1067. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1068. /* eslint-disable no-proto */
  1069. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  1070. var CORRECT_SETTER = false;
  1071. var test = {};
  1072. var setter;
  1073. try {
  1074. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  1075. setter.call(test, []);
  1076. CORRECT_SETTER = test instanceof Array;
  1077. } catch (error) { /* empty */ }
  1078. return function setPrototypeOf(O, proto) {
  1079. anObject(O);
  1080. aPossiblePrototype(proto);
  1081. if (CORRECT_SETTER) setter.call(O, proto);
  1082. else O.__proto__ = proto;
  1083. return O;
  1084. };
  1085. }() : undefined);
  1086. var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
  1087. var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
  1088. var ITERATOR$1 = wellKnownSymbol('iterator');
  1089. var KEYS = 'keys';
  1090. var VALUES = 'values';
  1091. var ENTRIES = 'entries';
  1092. var returnThis$1 = function () { return this; };
  1093. var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  1094. createIteratorConstructor(IteratorConstructor, NAME, next);
  1095. var getIterationMethod = function (KIND) {
  1096. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  1097. if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
  1098. switch (KIND) {
  1099. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  1100. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  1101. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  1102. } return function () { return new IteratorConstructor(this); };
  1103. };
  1104. var TO_STRING_TAG = NAME + ' Iterator';
  1105. var INCORRECT_VALUES_NAME = false;
  1106. var IterablePrototype = Iterable.prototype;
  1107. var nativeIterator = IterablePrototype[ITERATOR$1]
  1108. || IterablePrototype['@@iterator']
  1109. || DEFAULT && IterablePrototype[DEFAULT];
  1110. var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
  1111. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  1112. var CurrentIteratorPrototype, methods, KEY;
  1113. // fix native
  1114. if (anyNativeIterator) {
  1115. CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
  1116. if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
  1117. if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
  1118. if (objectSetPrototypeOf) {
  1119. objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
  1120. } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
  1121. hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
  1122. }
  1123. }
  1124. // Set @@toStringTag to native iterators
  1125. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
  1126. }
  1127. }
  1128. // fix Array#{values, @@iterator}.name in V8 / FF
  1129. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  1130. INCORRECT_VALUES_NAME = true;
  1131. defaultIterator = function values() { return nativeIterator.call(this); };
  1132. }
  1133. // define iterator
  1134. if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
  1135. hide(IterablePrototype, ITERATOR$1, defaultIterator);
  1136. }
  1137. // export additional methods
  1138. if (DEFAULT) {
  1139. methods = {
  1140. values: getIterationMethod(VALUES),
  1141. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  1142. entries: getIterationMethod(ENTRIES)
  1143. };
  1144. if (FORCED) for (KEY in methods) {
  1145. if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  1146. redefine(IterablePrototype, KEY, methods[KEY]);
  1147. }
  1148. } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
  1149. }
  1150. return methods;
  1151. };
  1152. var ARRAY_ITERATOR = 'Array Iterator';
  1153. var setInternalState$1 = internalState.set;
  1154. var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
  1155. // `Array.prototype.entries` method
  1156. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  1157. // `Array.prototype.keys` method
  1158. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  1159. // `Array.prototype.values` method
  1160. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  1161. // `Array.prototype[@@iterator]` method
  1162. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  1163. // `CreateArrayIterator` internal method
  1164. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  1165. var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
  1166. setInternalState$1(this, {
  1167. type: ARRAY_ITERATOR,
  1168. target: toIndexedObject(iterated), // target
  1169. index: 0, // next index
  1170. kind: kind // kind
  1171. });
  1172. // `%ArrayIteratorPrototype%.next` method
  1173. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  1174. }, function () {
  1175. var state = getInternalState$1(this);
  1176. var target = state.target;
  1177. var kind = state.kind;
  1178. var index = state.index++;
  1179. if (!target || index >= target.length) {
  1180. state.target = undefined;
  1181. return { value: undefined, done: true };
  1182. }
  1183. if (kind == 'keys') return { value: index, done: false };
  1184. if (kind == 'values') return { value: target[index], done: false };
  1185. return { value: [index, target[index]], done: false };
  1186. }, 'values');
  1187. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1188. addToUnscopables('keys');
  1189. addToUnscopables('values');
  1190. addToUnscopables('entries');
  1191. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  1192. var method = [][METHOD_NAME];
  1193. return !method || !fails(function () {
  1194. // eslint-disable-next-line no-useless-call,no-throw-literal
  1195. method.call(null, argument || function () { throw 1; }, 1);
  1196. });
  1197. };
  1198. var nativeJoin = [].join;
  1199. var ES3_STRINGS = indexedObject != Object;
  1200. var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
  1201. // `Array.prototype.join` method
  1202. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  1203. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
  1204. join: function join(separator) {
  1205. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1206. }
  1207. });
  1208. var $map = arrayIteration.map;
  1209. // `Array.prototype.map` method
  1210. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  1211. // with adding support of @@species
  1212. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, {
  1213. map: function map(callbackfn /* , thisArg */) {
  1214. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1215. }
  1216. });
  1217. var SPECIES$2 = wellKnownSymbol('species');
  1218. var nativeSlice = [].slice;
  1219. var max$1 = Math.max;
  1220. // `Array.prototype.slice` method
  1221. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  1222. // fallback for not array-like ES3 strings and DOM objects
  1223. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
  1224. slice: function slice(start, end) {
  1225. var O = toIndexedObject(this);
  1226. var length = toLength(O.length);
  1227. var k = toAbsoluteIndex(start, length);
  1228. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1229. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1230. var Constructor, result, n;
  1231. if (isArray(O)) {
  1232. Constructor = O.constructor;
  1233. // cross-realm fallback
  1234. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  1235. Constructor = undefined;
  1236. } else if (isObject(Constructor)) {
  1237. Constructor = Constructor[SPECIES$2];
  1238. if (Constructor === null) Constructor = undefined;
  1239. }
  1240. if (Constructor === Array || Constructor === undefined) {
  1241. return nativeSlice.call(O, k, fin);
  1242. }
  1243. }
  1244. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  1245. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1246. result.length = n;
  1247. return result;
  1248. }
  1249. });
  1250. var nativeSort = [].sort;
  1251. var test = [1, 2, 3];
  1252. // IE8-
  1253. var FAILS_ON_UNDEFINED = fails(function () {
  1254. test.sort(undefined);
  1255. });
  1256. // V8 bug
  1257. var FAILS_ON_NULL = fails(function () {
  1258. test.sort(null);
  1259. });
  1260. // Old WebKit
  1261. var SLOPPY_METHOD$1 = sloppyArrayMethod('sort');
  1262. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$1;
  1263. // `Array.prototype.sort` method
  1264. // https://tc39.github.io/ecma262/#sec-array.prototype.sort
  1265. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  1266. sort: function sort(comparefn) {
  1267. return comparefn === undefined
  1268. ? nativeSort.call(toObject(this))
  1269. : nativeSort.call(toObject(this), aFunction$1(comparefn));
  1270. }
  1271. });
  1272. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  1273. // ES3 wrong here
  1274. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  1275. // fallback for IE11 Script Access Denied error
  1276. var tryGet = function (it, key) {
  1277. try {
  1278. return it[key];
  1279. } catch (error) { /* empty */ }
  1280. };
  1281. // getting tag from ES6+ `Object.prototype.toString`
  1282. var classof = function (it) {
  1283. var O, tag, result;
  1284. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1285. // @@toStringTag case
  1286. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
  1287. // builtinTag case
  1288. : CORRECT_ARGUMENTS ? classofRaw(O)
  1289. // ES3 arguments fallback
  1290. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  1291. };
  1292. var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
  1293. var test$1 = {};
  1294. test$1[TO_STRING_TAG$2] = 'z';
  1295. // `Object.prototype.toString` method implementation
  1296. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1297. var objectToString = String(test$1) !== '[object z]' ? function toString() {
  1298. return '[object ' + classof(this) + ']';
  1299. } : test$1.toString;
  1300. var ObjectPrototype$2 = Object.prototype;
  1301. // `Object.prototype.toString` method
  1302. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1303. if (objectToString !== ObjectPrototype$2.toString) {
  1304. redefine(ObjectPrototype$2, 'toString', objectToString, { unsafe: true });
  1305. }
  1306. // `String.prototype.{ codePointAt, at }` methods implementation
  1307. var createMethod$2 = function (CONVERT_TO_STRING) {
  1308. return function ($this, pos) {
  1309. var S = String(requireObjectCoercible($this));
  1310. var position = toInteger(pos);
  1311. var size = S.length;
  1312. var first, second;
  1313. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1314. first = S.charCodeAt(position);
  1315. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1316. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1317. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1318. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1319. };
  1320. };
  1321. var stringMultibyte = {
  1322. // `String.prototype.codePointAt` method
  1323. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  1324. codeAt: createMethod$2(false),
  1325. // `String.prototype.at` method
  1326. // https://github.com/mathiasbynens/String.prototype.at
  1327. charAt: createMethod$2(true)
  1328. };
  1329. var charAt = stringMultibyte.charAt;
  1330. var STRING_ITERATOR = 'String Iterator';
  1331. var setInternalState$2 = internalState.set;
  1332. var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
  1333. // `String.prototype[@@iterator]` method
  1334. // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
  1335. defineIterator(String, 'String', function (iterated) {
  1336. setInternalState$2(this, {
  1337. type: STRING_ITERATOR,
  1338. string: String(iterated),
  1339. index: 0
  1340. });
  1341. // `%StringIteratorPrototype%.next` method
  1342. // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
  1343. }, function next() {
  1344. var state = getInternalState$2(this);
  1345. var string = state.string;
  1346. var index = state.index;
  1347. var point;
  1348. if (index >= string.length) return { value: undefined, done: true };
  1349. point = charAt(string, index);
  1350. state.index += point.length;
  1351. return { value: point, done: false };
  1352. });
  1353. // iterable DOM collections
  1354. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1355. var domIterables = {
  1356. CSSRuleList: 0,
  1357. CSSStyleDeclaration: 0,
  1358. CSSValueList: 0,
  1359. ClientRectList: 0,
  1360. DOMRectList: 0,
  1361. DOMStringList: 0,
  1362. DOMTokenList: 1,
  1363. DataTransferItemList: 0,
  1364. FileList: 0,
  1365. HTMLAllCollection: 0,
  1366. HTMLCollection: 0,
  1367. HTMLFormElement: 0,
  1368. HTMLSelectElement: 0,
  1369. MediaList: 0,
  1370. MimeTypeArray: 0,
  1371. NamedNodeMap: 0,
  1372. NodeList: 1,
  1373. PaintRequestList: 0,
  1374. Plugin: 0,
  1375. PluginArray: 0,
  1376. SVGLengthList: 0,
  1377. SVGNumberList: 0,
  1378. SVGPathSegList: 0,
  1379. SVGPointList: 0,
  1380. SVGStringList: 0,
  1381. SVGTransformList: 0,
  1382. SourceBufferList: 0,
  1383. StyleSheetList: 0,
  1384. TextTrackCueList: 0,
  1385. TextTrackList: 0,
  1386. TouchList: 0
  1387. };
  1388. var ITERATOR$2 = wellKnownSymbol('iterator');
  1389. var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
  1390. var ArrayValues = es_array_iterator.values;
  1391. for (var COLLECTION_NAME in domIterables) {
  1392. var Collection = global_1[COLLECTION_NAME];
  1393. var CollectionPrototype = Collection && Collection.prototype;
  1394. if (CollectionPrototype) {
  1395. // some Chrome versions have non-configurable methods on DOMTokenList
  1396. if (CollectionPrototype[ITERATOR$2] !== ArrayValues) try {
  1397. hide(CollectionPrototype, ITERATOR$2, ArrayValues);
  1398. } catch (error) {
  1399. CollectionPrototype[ITERATOR$2] = ArrayValues;
  1400. }
  1401. if (!CollectionPrototype[TO_STRING_TAG$3]) hide(CollectionPrototype, TO_STRING_TAG$3, COLLECTION_NAME);
  1402. if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
  1403. // some Chrome versions have non-configurable methods on DOMTokenList
  1404. if (CollectionPrototype[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
  1405. hide(CollectionPrototype, METHOD_NAME, es_array_iterator[METHOD_NAME]);
  1406. } catch (error) {
  1407. CollectionPrototype[METHOD_NAME] = es_array_iterator[METHOD_NAME];
  1408. }
  1409. }
  1410. }
  1411. }
  1412. function _classCallCheck(instance, Constructor) {
  1413. if (!(instance instanceof Constructor)) {
  1414. throw new TypeError("Cannot call a class as a function");
  1415. }
  1416. }
  1417. function _defineProperties(target, props) {
  1418. for (var i = 0; i < props.length; i++) {
  1419. var descriptor = props[i];
  1420. descriptor.enumerable = descriptor.enumerable || false;
  1421. descriptor.configurable = true;
  1422. if ("value" in descriptor) descriptor.writable = true;
  1423. Object.defineProperty(target, descriptor.key, descriptor);
  1424. }
  1425. }
  1426. function _createClass(Constructor, protoProps, staticProps) {
  1427. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  1428. if (staticProps) _defineProperties(Constructor, staticProps);
  1429. return Constructor;
  1430. }
  1431. function _inherits(subClass, superClass) {
  1432. if (typeof superClass !== "function" && superClass !== null) {
  1433. throw new TypeError("Super expression must either be null or a function");
  1434. }
  1435. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1436. constructor: {
  1437. value: subClass,
  1438. writable: true,
  1439. configurable: true
  1440. }
  1441. });
  1442. if (superClass) _setPrototypeOf(subClass, superClass);
  1443. }
  1444. function _getPrototypeOf(o) {
  1445. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1446. return o.__proto__ || Object.getPrototypeOf(o);
  1447. };
  1448. return _getPrototypeOf(o);
  1449. }
  1450. function _setPrototypeOf(o, p) {
  1451. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1452. o.__proto__ = p;
  1453. return o;
  1454. };
  1455. return _setPrototypeOf(o, p);
  1456. }
  1457. function _assertThisInitialized(self) {
  1458. if (self === void 0) {
  1459. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1460. }
  1461. return self;
  1462. }
  1463. function _possibleConstructorReturn(self, call) {
  1464. if (call && (typeof call === "object" || typeof call === "function")) {
  1465. return call;
  1466. }
  1467. return _assertThisInitialized(self);
  1468. }
  1469. function _superPropBase(object, property) {
  1470. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1471. object = _getPrototypeOf(object);
  1472. if (object === null) break;
  1473. }
  1474. return object;
  1475. }
  1476. function _get(target, property, receiver) {
  1477. if (typeof Reflect !== "undefined" && Reflect.get) {
  1478. _get = Reflect.get;
  1479. } else {
  1480. _get = function _get(target, property, receiver) {
  1481. var base = _superPropBase(target, property);
  1482. if (!base) return;
  1483. var desc = Object.getOwnPropertyDescriptor(base, property);
  1484. if (desc.get) {
  1485. return desc.get.call(receiver);
  1486. }
  1487. return desc.value;
  1488. };
  1489. }
  1490. return _get(target, property, receiver || target);
  1491. }
  1492. /**
  1493. * @update zhixin wen <wenzhixin2010@gmail.com>
  1494. */
  1495. var Utils = $.fn.bootstrapTable.utils;
  1496. function printPageBuilderDefault(table) {
  1497. return "\n <html>\n <head>\n <style type=\"text/css\" media=\"print\">\n @page {\n size: auto;\n margin: 25px 0 25px 0;\n }\n </style>\n <style type=\"text/css\" media=\"all\">\n table {\n border-collapse: collapse;\n font-size: 12px;\n }\n table, th, td {\n border: 1px solid grey;\n }\n th, td {\n text-align: center;\n vertical-align: middle;\n }\n p {\n font-weight: bold;\n margin-left:20px;\n }\n table {\n width:94%;\n margin-left:3%;\n margin-right:3%;\n }\n div.bs-table-print {\n text-align:center;\n }\n </style>\n </head>\n <title>Print Table</title>\n <body>\n <p>Printed on: ".concat(new Date(), " </p>\n <div class=\"bs-table-print\">").concat(table, "</div>\n </body>\n </html>");
  1498. }
  1499. $.extend($.fn.bootstrapTable.defaults, {
  1500. showPrint: false,
  1501. printAsFilteredAndSortedOnUI: true,
  1502. printSortColumn: undefined,
  1503. printSortOrder: 'asc',
  1504. printPageBuilder: function printPageBuilder(table) {
  1505. return printPageBuilderDefault(table);
  1506. }
  1507. });
  1508. $.extend($.fn.bootstrapTable.COLUMN_DEFAULTS, {
  1509. printFilter: undefined,
  1510. printIgnore: false,
  1511. printFormatter: undefined
  1512. });
  1513. $.extend($.fn.bootstrapTable.defaults.icons, {
  1514. print: {
  1515. bootstrap3: 'glyphicon-print icon-share'
  1516. }[$.fn.bootstrapTable.theme] || 'fa-print'
  1517. });
  1518. $.BootstrapTable =
  1519. /*#__PURE__*/
  1520. function (_$$BootstrapTable) {
  1521. _inherits(_class, _$$BootstrapTable);
  1522. function _class() {
  1523. _classCallCheck(this, _class);
  1524. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  1525. }
  1526. _createClass(_class, [{
  1527. key: "initToolbar",
  1528. value: function initToolbar() {
  1529. var _get2,
  1530. _this = this;
  1531. this.showToolbar = this.showToolbar || this.options.showPrint;
  1532. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1533. args[_key] = arguments[_key];
  1534. }
  1535. (_get2 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get2, [this].concat(args));
  1536. if (!this.options.showPrint) {
  1537. return;
  1538. }
  1539. var $btnGroup = this.$toolbar.find('>.columns');
  1540. var $print = $btnGroup.find('button.bs-print');
  1541. if (!$print.length) {
  1542. $print = $("\n <button class=\"".concat(this.constants.buttonsClass, " bs-print\" type=\"button\">\n <i class=\"").concat(this.options.iconsPrefix, " ").concat(this.options.icons.print, "\"></i>\n </button>")).appendTo($btnGroup);
  1543. }
  1544. $print.off('click').on('click', function () {
  1545. _this.doPrint(_this.options.printAsFilteredAndSortedOnUI ? _this.getData() : _this.options.data.slice(0));
  1546. });
  1547. }
  1548. }, {
  1549. key: "doPrint",
  1550. value: function doPrint(data) {
  1551. var _this2 = this;
  1552. var formatValue = function formatValue(row, i, column) {
  1553. var value = row[column.field];
  1554. if (typeof column.printFormatter === 'function') {
  1555. return column.printFormatter.apply(column, [value, row, i]);
  1556. }
  1557. return typeof value === 'undefined' ? '-' : value;
  1558. };
  1559. var buildTable = function buildTable(data, columnsArray) {
  1560. var dir = _this2.$el.attr('dir') || 'ltr';
  1561. var html = ["<table dir=\"".concat(dir, "\"><thead>")];
  1562. var _iteratorNormalCompletion = true;
  1563. var _didIteratorError = false;
  1564. var _iteratorError = undefined;
  1565. try {
  1566. for (var _iterator = columnsArray[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  1567. var _columns = _step.value;
  1568. html.push('<tr>');
  1569. for (var h = 0; h < _columns.length; h++) {
  1570. if (!_columns[h].printIgnore) {
  1571. html.push("<th\n ".concat(Utils.sprintf(' rowspan="%s"', _columns[h].rowspan), "\n ").concat(Utils.sprintf(' colspan="%s"', _columns[h].colspan), "\n >").concat(_columns[h].title, "</th>"));
  1572. }
  1573. }
  1574. html.push('</tr>');
  1575. }
  1576. } catch (err) {
  1577. _didIteratorError = true;
  1578. _iteratorError = err;
  1579. } finally {
  1580. try {
  1581. if (!_iteratorNormalCompletion && _iterator.return != null) {
  1582. _iterator.return();
  1583. }
  1584. } finally {
  1585. if (_didIteratorError) {
  1586. throw _iteratorError;
  1587. }
  1588. }
  1589. }
  1590. html.push('</thead><tbody>');
  1591. for (var i = 0; i < data.length; i++) {
  1592. html.push('<tr>');
  1593. var _iteratorNormalCompletion2 = true;
  1594. var _didIteratorError2 = false;
  1595. var _iteratorError2 = undefined;
  1596. try {
  1597. for (var _iterator2 = columnsArray[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  1598. var columns = _step2.value;
  1599. for (var j = 0; j < columns.length; j++) {
  1600. if (!columns[j].printIgnore && columns[j].field) {
  1601. html.push('<td>', formatValue(data[i], i, columns[j]), '</td>');
  1602. }
  1603. }
  1604. }
  1605. } catch (err) {
  1606. _didIteratorError2 = true;
  1607. _iteratorError2 = err;
  1608. } finally {
  1609. try {
  1610. if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  1611. _iterator2.return();
  1612. }
  1613. } finally {
  1614. if (_didIteratorError2) {
  1615. throw _iteratorError2;
  1616. }
  1617. }
  1618. }
  1619. html.push('</tr>');
  1620. }
  1621. html.push('</tbody></table>');
  1622. return html.join('');
  1623. };
  1624. var sortRows = function sortRows(data, colName, sortOrder) {
  1625. if (!colName) {
  1626. return data;
  1627. }
  1628. var reverse = sortOrder !== 'asc';
  1629. reverse = -(+reverse || -1);
  1630. return data.sort(function (a, b) {
  1631. return reverse * a[colName].localeCompare(b[colName]);
  1632. });
  1633. };
  1634. var filterRow = function filterRow(row, filters) {
  1635. for (var index = 0; index < filters.length; ++index) {
  1636. if (row[filters[index].colName] !== filters[index].value) {
  1637. return false;
  1638. }
  1639. }
  1640. return true;
  1641. };
  1642. var filterRows = function filterRows(data, filters) {
  1643. return data.filter(function (row) {
  1644. return filterRow(row, filters);
  1645. });
  1646. };
  1647. var getColumnFilters = function getColumnFilters(columns) {
  1648. return !columns || !columns[0] ? [] : columns[0].filter(function (col) {
  1649. return col.printFilter;
  1650. }).map(function (col) {
  1651. return {
  1652. colName: col.field,
  1653. value: col.printFilter
  1654. };
  1655. });
  1656. };
  1657. data = filterRows(data, getColumnFilters(this.options.columns));
  1658. data = sortRows(data, this.options.printSortColumn, this.options.printSortOrder);
  1659. var table = buildTable(data, this.options.columns);
  1660. var newWin = window.open('');
  1661. newWin.document.write(this.options.printPageBuilder.call(this, table));
  1662. newWin.print();
  1663. newWin.close();
  1664. }
  1665. }]);
  1666. return _class;
  1667. }($.BootstrapTable);
  1668. }));