bootstrap-table-cell-input.js 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087
  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 UNSCOPABLES = wellKnownSymbol('unscopables');
  982. var ArrayPrototype = Array.prototype;
  983. // Array.prototype[@@unscopables]
  984. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  985. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  986. hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
  987. }
  988. // add a key to Array.prototype[@@unscopables]
  989. var addToUnscopables = function (key) {
  990. ArrayPrototype[UNSCOPABLES][key] = true;
  991. };
  992. var $find = arrayIteration.find;
  993. var FIND = 'find';
  994. var SKIPS_HOLES = true;
  995. // Shouldn't skip holes
  996. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  997. // `Array.prototype.find` method
  998. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  999. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1000. find: function find(callbackfn /* , that = undefined */) {
  1001. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1002. }
  1003. });
  1004. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1005. addToUnscopables(FIND);
  1006. var correctPrototypeGetter = !fails(function () {
  1007. function F() { /* empty */ }
  1008. F.prototype.constructor = null;
  1009. return Object.getPrototypeOf(new F()) !== F.prototype;
  1010. });
  1011. var IE_PROTO$1 = sharedKey('IE_PROTO');
  1012. var ObjectPrototype$1 = Object.prototype;
  1013. // `Object.getPrototypeOf` method
  1014. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  1015. var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
  1016. O = toObject(O);
  1017. if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
  1018. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  1019. return O.constructor.prototype;
  1020. } return O instanceof Object ? ObjectPrototype$1 : null;
  1021. };
  1022. var ITERATOR = wellKnownSymbol('iterator');
  1023. var BUGGY_SAFARI_ITERATORS = false;
  1024. var returnThis = function () { return this; };
  1025. // `%IteratorPrototype%` object
  1026. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  1027. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  1028. if ([].keys) {
  1029. arrayIterator = [].keys();
  1030. // Safari 8 has buggy iterators w/o `next`
  1031. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  1032. else {
  1033. PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
  1034. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  1035. }
  1036. }
  1037. if (IteratorPrototype == undefined) IteratorPrototype = {};
  1038. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  1039. if ( !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
  1040. var iteratorsCore = {
  1041. IteratorPrototype: IteratorPrototype,
  1042. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  1043. };
  1044. var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
  1045. var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
  1046. var TO_STRING_TAG = NAME + ' Iterator';
  1047. IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
  1048. setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
  1049. return IteratorConstructor;
  1050. };
  1051. var aPossiblePrototype = function (it) {
  1052. if (!isObject(it) && it !== null) {
  1053. throw TypeError("Can't set " + String(it) + ' as a prototype');
  1054. } return it;
  1055. };
  1056. // `Object.setPrototypeOf` method
  1057. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  1058. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1059. /* eslint-disable no-proto */
  1060. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  1061. var CORRECT_SETTER = false;
  1062. var test = {};
  1063. var setter;
  1064. try {
  1065. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  1066. setter.call(test, []);
  1067. CORRECT_SETTER = test instanceof Array;
  1068. } catch (error) { /* empty */ }
  1069. return function setPrototypeOf(O, proto) {
  1070. anObject(O);
  1071. aPossiblePrototype(proto);
  1072. if (CORRECT_SETTER) setter.call(O, proto);
  1073. else O.__proto__ = proto;
  1074. return O;
  1075. };
  1076. }() : undefined);
  1077. var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
  1078. var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
  1079. var ITERATOR$1 = wellKnownSymbol('iterator');
  1080. var KEYS = 'keys';
  1081. var VALUES = 'values';
  1082. var ENTRIES = 'entries';
  1083. var returnThis$1 = function () { return this; };
  1084. var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  1085. createIteratorConstructor(IteratorConstructor, NAME, next);
  1086. var getIterationMethod = function (KIND) {
  1087. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  1088. if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
  1089. switch (KIND) {
  1090. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  1091. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  1092. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  1093. } return function () { return new IteratorConstructor(this); };
  1094. };
  1095. var TO_STRING_TAG = NAME + ' Iterator';
  1096. var INCORRECT_VALUES_NAME = false;
  1097. var IterablePrototype = Iterable.prototype;
  1098. var nativeIterator = IterablePrototype[ITERATOR$1]
  1099. || IterablePrototype['@@iterator']
  1100. || DEFAULT && IterablePrototype[DEFAULT];
  1101. var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
  1102. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  1103. var CurrentIteratorPrototype, methods, KEY;
  1104. // fix native
  1105. if (anyNativeIterator) {
  1106. CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
  1107. if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
  1108. if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
  1109. if (objectSetPrototypeOf) {
  1110. objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
  1111. } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
  1112. hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
  1113. }
  1114. }
  1115. // Set @@toStringTag to native iterators
  1116. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
  1117. }
  1118. }
  1119. // fix Array#{values, @@iterator}.name in V8 / FF
  1120. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  1121. INCORRECT_VALUES_NAME = true;
  1122. defaultIterator = function values() { return nativeIterator.call(this); };
  1123. }
  1124. // define iterator
  1125. if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
  1126. hide(IterablePrototype, ITERATOR$1, defaultIterator);
  1127. }
  1128. // export additional methods
  1129. if (DEFAULT) {
  1130. methods = {
  1131. values: getIterationMethod(VALUES),
  1132. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  1133. entries: getIterationMethod(ENTRIES)
  1134. };
  1135. if (FORCED) for (KEY in methods) {
  1136. if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  1137. redefine(IterablePrototype, KEY, methods[KEY]);
  1138. }
  1139. } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
  1140. }
  1141. return methods;
  1142. };
  1143. var ARRAY_ITERATOR = 'Array Iterator';
  1144. var setInternalState$1 = internalState.set;
  1145. var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
  1146. // `Array.prototype.entries` method
  1147. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  1148. // `Array.prototype.keys` method
  1149. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  1150. // `Array.prototype.values` method
  1151. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  1152. // `Array.prototype[@@iterator]` method
  1153. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  1154. // `CreateArrayIterator` internal method
  1155. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  1156. var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
  1157. setInternalState$1(this, {
  1158. type: ARRAY_ITERATOR,
  1159. target: toIndexedObject(iterated), // target
  1160. index: 0, // next index
  1161. kind: kind // kind
  1162. });
  1163. // `%ArrayIteratorPrototype%.next` method
  1164. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  1165. }, function () {
  1166. var state = getInternalState$1(this);
  1167. var target = state.target;
  1168. var kind = state.kind;
  1169. var index = state.index++;
  1170. if (!target || index >= target.length) {
  1171. state.target = undefined;
  1172. return { value: undefined, done: true };
  1173. }
  1174. if (kind == 'keys') return { value: index, done: false };
  1175. if (kind == 'values') return { value: target[index], done: false };
  1176. return { value: [index, target[index]], done: false };
  1177. }, 'values');
  1178. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1179. addToUnscopables('keys');
  1180. addToUnscopables('values');
  1181. addToUnscopables('entries');
  1182. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  1183. var method = [][METHOD_NAME];
  1184. return !method || !fails(function () {
  1185. // eslint-disable-next-line no-useless-call,no-throw-literal
  1186. method.call(null, argument || function () { throw 1; }, 1);
  1187. });
  1188. };
  1189. var nativeJoin = [].join;
  1190. var ES3_STRINGS = indexedObject != Object;
  1191. var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
  1192. // `Array.prototype.join` method
  1193. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  1194. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
  1195. join: function join(separator) {
  1196. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1197. }
  1198. });
  1199. var SPECIES$2 = wellKnownSymbol('species');
  1200. var nativeSlice = [].slice;
  1201. var max$1 = Math.max;
  1202. // `Array.prototype.slice` method
  1203. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  1204. // fallback for not array-like ES3 strings and DOM objects
  1205. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
  1206. slice: function slice(start, end) {
  1207. var O = toIndexedObject(this);
  1208. var length = toLength(O.length);
  1209. var k = toAbsoluteIndex(start, length);
  1210. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1211. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1212. var Constructor, result, n;
  1213. if (isArray(O)) {
  1214. Constructor = O.constructor;
  1215. // cross-realm fallback
  1216. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  1217. Constructor = undefined;
  1218. } else if (isObject(Constructor)) {
  1219. Constructor = Constructor[SPECIES$2];
  1220. if (Constructor === null) Constructor = undefined;
  1221. }
  1222. if (Constructor === Array || Constructor === undefined) {
  1223. return nativeSlice.call(O, k, fin);
  1224. }
  1225. }
  1226. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  1227. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1228. result.length = n;
  1229. return result;
  1230. }
  1231. });
  1232. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  1233. // ES3 wrong here
  1234. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  1235. // fallback for IE11 Script Access Denied error
  1236. var tryGet = function (it, key) {
  1237. try {
  1238. return it[key];
  1239. } catch (error) { /* empty */ }
  1240. };
  1241. // getting tag from ES6+ `Object.prototype.toString`
  1242. var classof = function (it) {
  1243. var O, tag, result;
  1244. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1245. // @@toStringTag case
  1246. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
  1247. // builtinTag case
  1248. : CORRECT_ARGUMENTS ? classofRaw(O)
  1249. // ES3 arguments fallback
  1250. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  1251. };
  1252. var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
  1253. var test = {};
  1254. test[TO_STRING_TAG$2] = 'z';
  1255. // `Object.prototype.toString` method implementation
  1256. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1257. var objectToString = String(test) !== '[object z]' ? function toString() {
  1258. return '[object ' + classof(this) + ']';
  1259. } : test.toString;
  1260. var ObjectPrototype$2 = Object.prototype;
  1261. // `Object.prototype.toString` method
  1262. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1263. if (objectToString !== ObjectPrototype$2.toString) {
  1264. redefine(ObjectPrototype$2, 'toString', objectToString, { unsafe: true });
  1265. }
  1266. // `String.prototype.{ codePointAt, at }` methods implementation
  1267. var createMethod$2 = function (CONVERT_TO_STRING) {
  1268. return function ($this, pos) {
  1269. var S = String(requireObjectCoercible($this));
  1270. var position = toInteger(pos);
  1271. var size = S.length;
  1272. var first, second;
  1273. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1274. first = S.charCodeAt(position);
  1275. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1276. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1277. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1278. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1279. };
  1280. };
  1281. var stringMultibyte = {
  1282. // `String.prototype.codePointAt` method
  1283. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  1284. codeAt: createMethod$2(false),
  1285. // `String.prototype.at` method
  1286. // https://github.com/mathiasbynens/String.prototype.at
  1287. charAt: createMethod$2(true)
  1288. };
  1289. var charAt = stringMultibyte.charAt;
  1290. var STRING_ITERATOR = 'String Iterator';
  1291. var setInternalState$2 = internalState.set;
  1292. var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
  1293. // `String.prototype[@@iterator]` method
  1294. // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
  1295. defineIterator(String, 'String', function (iterated) {
  1296. setInternalState$2(this, {
  1297. type: STRING_ITERATOR,
  1298. string: String(iterated),
  1299. index: 0
  1300. });
  1301. // `%StringIteratorPrototype%.next` method
  1302. // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
  1303. }, function next() {
  1304. var state = getInternalState$2(this);
  1305. var string = state.string;
  1306. var index = state.index;
  1307. var point;
  1308. if (index >= string.length) return { value: undefined, done: true };
  1309. point = charAt(string, index);
  1310. state.index += point.length;
  1311. return { value: point, done: false };
  1312. });
  1313. // `RegExp.prototype.flags` getter implementation
  1314. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  1315. var regexpFlags = function () {
  1316. var that = anObject(this);
  1317. var result = '';
  1318. if (that.global) result += 'g';
  1319. if (that.ignoreCase) result += 'i';
  1320. if (that.multiline) result += 'm';
  1321. if (that.dotAll) result += 's';
  1322. if (that.unicode) result += 'u';
  1323. if (that.sticky) result += 'y';
  1324. return result;
  1325. };
  1326. var nativeExec = RegExp.prototype.exec;
  1327. // This always refers to the native implementation, because the
  1328. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  1329. // which loads this file before patching the method.
  1330. var nativeReplace = String.prototype.replace;
  1331. var patchedExec = nativeExec;
  1332. var UPDATES_LAST_INDEX_WRONG = (function () {
  1333. var re1 = /a/;
  1334. var re2 = /b*/g;
  1335. nativeExec.call(re1, 'a');
  1336. nativeExec.call(re2, 'a');
  1337. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1338. })();
  1339. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1340. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1341. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  1342. if (PATCH) {
  1343. patchedExec = function exec(str) {
  1344. var re = this;
  1345. var lastIndex, reCopy, match, i;
  1346. if (NPCG_INCLUDED) {
  1347. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  1348. }
  1349. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1350. match = nativeExec.call(re, str);
  1351. if (UPDATES_LAST_INDEX_WRONG && match) {
  1352. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1353. }
  1354. if (NPCG_INCLUDED && match && match.length > 1) {
  1355. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1356. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1357. nativeReplace.call(match[0], reCopy, function () {
  1358. for (i = 1; i < arguments.length - 2; i++) {
  1359. if (arguments[i] === undefined) match[i] = undefined;
  1360. }
  1361. });
  1362. }
  1363. return match;
  1364. };
  1365. }
  1366. var regexpExec = patchedExec;
  1367. var SPECIES$3 = wellKnownSymbol('species');
  1368. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1369. // #replace needs built-in support for named groups.
  1370. // #match works fine because it just return the exec results, even if it has
  1371. // a "grops" property.
  1372. var re = /./;
  1373. re.exec = function () {
  1374. var result = [];
  1375. result.groups = { a: '7' };
  1376. return result;
  1377. };
  1378. return ''.replace(re, '$<a>') !== '7';
  1379. });
  1380. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1381. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1382. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1383. var re = /(?:)/;
  1384. var originalExec = re.exec;
  1385. re.exec = function () { return originalExec.apply(this, arguments); };
  1386. var result = 'ab'.split(re);
  1387. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1388. });
  1389. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  1390. var SYMBOL = wellKnownSymbol(KEY);
  1391. var DELEGATES_TO_SYMBOL = !fails(function () {
  1392. // String methods call symbol-named RegEp methods
  1393. var O = {};
  1394. O[SYMBOL] = function () { return 7; };
  1395. return ''[KEY](O) != 7;
  1396. });
  1397. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1398. // Symbol-named RegExp methods call .exec
  1399. var execCalled = false;
  1400. var re = /a/;
  1401. re.exec = function () { execCalled = true; return null; };
  1402. if (KEY === 'split') {
  1403. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1404. // a new one. We need to return the patched regex when creating the new one.
  1405. re.constructor = {};
  1406. re.constructor[SPECIES$3] = function () { return re; };
  1407. }
  1408. re[SYMBOL]('');
  1409. return !execCalled;
  1410. });
  1411. if (
  1412. !DELEGATES_TO_SYMBOL ||
  1413. !DELEGATES_TO_EXEC ||
  1414. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  1415. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  1416. ) {
  1417. var nativeRegExpMethod = /./[SYMBOL];
  1418. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1419. if (regexp.exec === regexpExec) {
  1420. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1421. // The native String method already delegates to @@method (this
  1422. // polyfilled function), leasing to infinite recursion.
  1423. // We avoid it by directly calling the native @@method method.
  1424. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  1425. }
  1426. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  1427. }
  1428. return { done: false };
  1429. });
  1430. var stringMethod = methods[0];
  1431. var regexMethod = methods[1];
  1432. redefine(String.prototype, KEY, stringMethod);
  1433. redefine(RegExp.prototype, SYMBOL, length == 2
  1434. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  1435. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  1436. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  1437. // 21.2.5.6 RegExp.prototype[@@match](string)
  1438. // 21.2.5.9 RegExp.prototype[@@search](string)
  1439. : function (string) { return regexMethod.call(string, this); }
  1440. );
  1441. if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
  1442. }
  1443. };
  1444. var charAt$1 = stringMultibyte.charAt;
  1445. // `AdvanceStringIndex` abstract operation
  1446. // https://tc39.github.io/ecma262/#sec-advancestringindex
  1447. var advanceStringIndex = function (S, index, unicode) {
  1448. return index + (unicode ? charAt$1(S, index).length : 1);
  1449. };
  1450. // `RegExpExec` abstract operation
  1451. // https://tc39.github.io/ecma262/#sec-regexpexec
  1452. var regexpExecAbstract = function (R, S) {
  1453. var exec = R.exec;
  1454. if (typeof exec === 'function') {
  1455. var result = exec.call(R, S);
  1456. if (typeof result !== 'object') {
  1457. throw TypeError('RegExp exec method returned something other than an Object or null');
  1458. }
  1459. return result;
  1460. }
  1461. if (classofRaw(R) !== 'RegExp') {
  1462. throw TypeError('RegExp#exec called on incompatible receiver');
  1463. }
  1464. return regexpExec.call(R, S);
  1465. };
  1466. var max$2 = Math.max;
  1467. var min$2 = Math.min;
  1468. var floor$1 = Math.floor;
  1469. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
  1470. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
  1471. var maybeToString = function (it) {
  1472. return it === undefined ? it : String(it);
  1473. };
  1474. // @@replace logic
  1475. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
  1476. return [
  1477. // `String.prototype.replace` method
  1478. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  1479. function replace(searchValue, replaceValue) {
  1480. var O = requireObjectCoercible(this);
  1481. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1482. return replacer !== undefined
  1483. ? replacer.call(searchValue, O, replaceValue)
  1484. : nativeReplace.call(String(O), searchValue, replaceValue);
  1485. },
  1486. // `RegExp.prototype[@@replace]` method
  1487. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  1488. function (regexp, replaceValue) {
  1489. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1490. if (res.done) return res.value;
  1491. var rx = anObject(regexp);
  1492. var S = String(this);
  1493. var functionalReplace = typeof replaceValue === 'function';
  1494. if (!functionalReplace) replaceValue = String(replaceValue);
  1495. var global = rx.global;
  1496. if (global) {
  1497. var fullUnicode = rx.unicode;
  1498. rx.lastIndex = 0;
  1499. }
  1500. var results = [];
  1501. while (true) {
  1502. var result = regexpExecAbstract(rx, S);
  1503. if (result === null) break;
  1504. results.push(result);
  1505. if (!global) break;
  1506. var matchStr = String(result[0]);
  1507. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1508. }
  1509. var accumulatedResult = '';
  1510. var nextSourcePosition = 0;
  1511. for (var i = 0; i < results.length; i++) {
  1512. result = results[i];
  1513. var matched = String(result[0]);
  1514. var position = max$2(min$2(toInteger(result.index), S.length), 0);
  1515. var captures = [];
  1516. // NOTE: This is equivalent to
  1517. // captures = result.slice(1).map(maybeToString)
  1518. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1519. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1520. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1521. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1522. var namedCaptures = result.groups;
  1523. if (functionalReplace) {
  1524. var replacerArgs = [matched].concat(captures, position, S);
  1525. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1526. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1527. } else {
  1528. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1529. }
  1530. if (position >= nextSourcePosition) {
  1531. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1532. nextSourcePosition = position + matched.length;
  1533. }
  1534. }
  1535. return accumulatedResult + S.slice(nextSourcePosition);
  1536. }
  1537. ];
  1538. // https://tc39.github.io/ecma262/#sec-getsubstitution
  1539. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  1540. var tailPos = position + matched.length;
  1541. var m = captures.length;
  1542. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1543. if (namedCaptures !== undefined) {
  1544. namedCaptures = toObject(namedCaptures);
  1545. symbols = SUBSTITUTION_SYMBOLS;
  1546. }
  1547. return nativeReplace.call(replacement, symbols, function (match, ch) {
  1548. var capture;
  1549. switch (ch.charAt(0)) {
  1550. case '$': return '$';
  1551. case '&': return matched;
  1552. case '`': return str.slice(0, position);
  1553. case "'": return str.slice(tailPos);
  1554. case '<':
  1555. capture = namedCaptures[ch.slice(1, -1)];
  1556. break;
  1557. default: // \d\d?
  1558. var n = +ch;
  1559. if (n === 0) return match;
  1560. if (n > m) {
  1561. var f = floor$1(n / 10);
  1562. if (f === 0) return match;
  1563. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  1564. return match;
  1565. }
  1566. capture = captures[n - 1];
  1567. }
  1568. return capture === undefined ? '' : capture;
  1569. });
  1570. }
  1571. });
  1572. // iterable DOM collections
  1573. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1574. var domIterables = {
  1575. CSSRuleList: 0,
  1576. CSSStyleDeclaration: 0,
  1577. CSSValueList: 0,
  1578. ClientRectList: 0,
  1579. DOMRectList: 0,
  1580. DOMStringList: 0,
  1581. DOMTokenList: 1,
  1582. DataTransferItemList: 0,
  1583. FileList: 0,
  1584. HTMLAllCollection: 0,
  1585. HTMLCollection: 0,
  1586. HTMLFormElement: 0,
  1587. HTMLSelectElement: 0,
  1588. MediaList: 0,
  1589. MimeTypeArray: 0,
  1590. NamedNodeMap: 0,
  1591. NodeList: 1,
  1592. PaintRequestList: 0,
  1593. Plugin: 0,
  1594. PluginArray: 0,
  1595. SVGLengthList: 0,
  1596. SVGNumberList: 0,
  1597. SVGPathSegList: 0,
  1598. SVGPointList: 0,
  1599. SVGStringList: 0,
  1600. SVGTransformList: 0,
  1601. SourceBufferList: 0,
  1602. StyleSheetList: 0,
  1603. TextTrackCueList: 0,
  1604. TextTrackList: 0,
  1605. TouchList: 0
  1606. };
  1607. var ITERATOR$2 = wellKnownSymbol('iterator');
  1608. var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
  1609. var ArrayValues = es_array_iterator.values;
  1610. for (var COLLECTION_NAME in domIterables) {
  1611. var Collection = global_1[COLLECTION_NAME];
  1612. var CollectionPrototype = Collection && Collection.prototype;
  1613. if (CollectionPrototype) {
  1614. // some Chrome versions have non-configurable methods on DOMTokenList
  1615. if (CollectionPrototype[ITERATOR$2] !== ArrayValues) try {
  1616. hide(CollectionPrototype, ITERATOR$2, ArrayValues);
  1617. } catch (error) {
  1618. CollectionPrototype[ITERATOR$2] = ArrayValues;
  1619. }
  1620. if (!CollectionPrototype[TO_STRING_TAG$3]) hide(CollectionPrototype, TO_STRING_TAG$3, COLLECTION_NAME);
  1621. if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
  1622. // some Chrome versions have non-configurable methods on DOMTokenList
  1623. if (CollectionPrototype[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
  1624. hide(CollectionPrototype, METHOD_NAME, es_array_iterator[METHOD_NAME]);
  1625. } catch (error) {
  1626. CollectionPrototype[METHOD_NAME] = es_array_iterator[METHOD_NAME];
  1627. }
  1628. }
  1629. }
  1630. }
  1631. /**
  1632. * @author andrey matveev <aamatveef@gmail.com>
  1633. * @version: v1.1.0
  1634. * https://github.com/aamatveev/bootstrap-table
  1635. * extensions:
  1636. */
  1637. $.extend($.fn.bootstrapTable.defaults, {
  1638. cellInputEnabled: false,
  1639. cellInputType: 'text',
  1640. // text or select or textarea
  1641. cellInputUniqueId: '',
  1642. cellInputSelectOptinons: [],
  1643. // [{ text: '', value: '', disabled: false, default: true },{}]
  1644. cellInputIsDeciaml: false,
  1645. onCellInputInit: function onCellInputInit() {
  1646. return false;
  1647. },
  1648. onCellInputBlur: function onCellInputBlur(field, row, oldValue, $el) {
  1649. return false;
  1650. },
  1651. onCellInputFocus: function onCellInputFocus(field, row, oldValue, $el) {
  1652. return false;
  1653. },
  1654. onCellInputKeyup: function onCellInputKeyup(field, row, oldValue, $el) {
  1655. return false;
  1656. },
  1657. onCellInputKeydown: function onCellInputKeydown(field, row, oldValue, $el) {
  1658. return false;
  1659. },
  1660. onCellInputSelectChange: function onCellInputSelectChange(field, row, oldValue, $el) {
  1661. return false;
  1662. }
  1663. });
  1664. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  1665. 'cellinput-init.bs.table': 'onCellInputInit',
  1666. 'cellinput-blur.bs.table': 'onCellInputBlur',
  1667. 'cellinput-focus.bs.table': 'onCellInputFocus',
  1668. 'cellinput-keyup.bs.table': 'onCellInputKeyup',
  1669. 'cellinput-keydown.bs.table': 'onCellInputKeydown',
  1670. 'cellinput-selectchange.bs.table': 'onCellInputSelectChange'
  1671. });
  1672. var BootstrapTable = $.fn.bootstrapTable.Constructor;
  1673. var _initTable = BootstrapTable.prototype.initTable;
  1674. var _initBody = BootstrapTable.prototype.initBody;
  1675. BootstrapTable.prototype.initTable = function () {
  1676. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1677. args[_key] = arguments[_key];
  1678. }
  1679. _initTable.apply(this, Array.prototype.slice.apply(args)); // exit if table.options.cellInputEnabled = false
  1680. if (!this.options.cellInputEnabled) {
  1681. return;
  1682. }
  1683. $.each(this.columns, function (i, column) {
  1684. // exit if column.cellInputEnabled = false
  1685. if (!column.cellInputEnabled) {
  1686. return;
  1687. }
  1688. var _formatter = column.formatter;
  1689. if (column.cellInputType === 'text') {
  1690. column.formatter = function (value, row, index) {
  1691. var result = _formatter ? _formatter(value, row, index) : value; // Решает проблему невозможности ввода кавычек &quot;
  1692. result = typeof result === 'string' ? result.replace(/"/g, '&quot;') : result;
  1693. var isSetDataUniqueIdAttr = column.cellInputUniqueId && column.cellInputUniqueId.length > 0;
  1694. var disableCallbackFunc = column.cellInputDisableCallbackFunc;
  1695. return ['<input type="text" class="table-td-textbox form-control"', // ' id="' + column.field + '"',
  1696. isSetDataUniqueIdAttr ? " data-uniqueid=\"".concat(row[column.cellInputUniqueId], "\"") : '', " data-name=\"".concat(column.field, "\""), " data-value=\"".concat(result, "\""), " value=\"".concat(result, "\""), ' autofocus="autofocus"', typeof disableCallbackFunc !== 'undefined' && disableCallbackFunc(row) ? ' disabled="disabled"' : '', '>'].join('');
  1697. };
  1698. } else if (column.cellInputType === 'select') {
  1699. column.formatter = function (value, row, index) {
  1700. var result = _formatter ? _formatter(value, row, index) : value;
  1701. var optionDatas = column.cellInputSelectOptinons !== null ? column.cellInputSelectOptinons : [];
  1702. var selectoptions = [];
  1703. var arrAllowedValues = [];
  1704. for (var k = 0; k < optionDatas.length; k++) {
  1705. arrAllowedValues.push(optionDatas[k].value);
  1706. }
  1707. var allowedVal = $.inArray(value, arrAllowedValues) >= 0;
  1708. var _iteratorNormalCompletion = true;
  1709. var _didIteratorError = false;
  1710. var _iteratorError = undefined;
  1711. try {
  1712. for (var _iterator = optionDatas[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  1713. var optionData = _step.value;
  1714. var isSelected = optionData.value === value;
  1715. if (!allowedVal && optionData.disabled) {
  1716. isSelected = true;
  1717. result = optionData.value;
  1718. }
  1719. selectoptions.push("<option value=\"".concat(optionData.value, "\" ").concat(isSelected ? ' selected="selected" ' : '').concat(optionData.disabled ? ' disabled' : '', ">").concat(optionData.text, "</option>"));
  1720. }
  1721. } catch (err) {
  1722. _didIteratorError = true;
  1723. _iteratorError = err;
  1724. } finally {
  1725. try {
  1726. if (!_iteratorNormalCompletion && _iterator.return != null) {
  1727. _iterator.return();
  1728. }
  1729. } finally {
  1730. if (_didIteratorError) {
  1731. throw _iteratorError;
  1732. }
  1733. }
  1734. }
  1735. var isSetDataUniqueIdAttr = column.cellInputUniqueId && column.cellInputUniqueId.length > 0;
  1736. var disableCallbackFunc = column.disableCallbackFunc;
  1737. return ['<select class="form-control" style="padding: 4px;"', isSetDataUniqueIdAttr ? " data-uniqueid=\"".concat(row[column.cellInputUniqueId], "\"") : '', " data-name=\"".concat(column.field, "\""), " data-value=\"".concat(result, "\""), typeof disableCallbackFunc !== 'undefined' && disableCallbackFunc(row) ? ' disabled="disabled"' : '', '>', selectoptions.join(''), '</select>'].join('');
  1738. };
  1739. }
  1740. });
  1741. };
  1742. BootstrapTable.prototype.initBody = function (fixedScroll) {
  1743. var that = this;
  1744. _initBody.apply(this, Array.prototype.slice.apply(arguments));
  1745. if (!this.options.cellInputEnabled) {
  1746. return;
  1747. }
  1748. $.each(this.columns, function (i, column) {
  1749. if (column.cellInputType === 'text') {
  1750. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('blur').on('blur', function (e) {
  1751. var data = that.getData();
  1752. var index = $(this).parents('tr[data-index]').data('index');
  1753. var row = data[index];
  1754. var newValue = $(this).val();
  1755. row[column.field] = newValue;
  1756. that.trigger('cellinput-blur', column.field, row, $(this));
  1757. });
  1758. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('keyup').on('keyup', function (e) {
  1759. var data = that.getData();
  1760. var index = $(this).parents('tr[data-index]').data('index');
  1761. var row = data[index];
  1762. var oldValue = row[column.field];
  1763. var newValue = $(this).val();
  1764. row[column.field] = newValue;
  1765. that.trigger('cellinput-keyup', column.field, row, oldValue, index, $(this));
  1766. });
  1767. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('keydown').on('keydown', function (e) {
  1768. var data = that.getData();
  1769. var index = $(this).parents('tr[data-index]').data('index');
  1770. var row = data[index];
  1771. var oldValue = row[column.field];
  1772. var newValue = $(this).val();
  1773. if (!column.tdtexboxIsDeciaml) {
  1774. row[column.field] = newValue;
  1775. }
  1776. that.trigger('cellinput-keydown', column.field, row, oldValue, index, $(this));
  1777. });
  1778. that.$body.find("input[data-name=\"".concat(column.field, "\"]")).off('focus').on('focus', function (e) {
  1779. var data = that.getData();
  1780. var index = $(this).parents('tr[data-index]').data('index');
  1781. var row = data[index];
  1782. that.trigger('cellinput-focus', column.field, row, $(this));
  1783. });
  1784. } else if (column.cellInputType === 'select') {
  1785. that.$body.find("select[data-name=\"".concat(column.field, "\"]")).off('change').on('change', function (e) {
  1786. var data = that.getData();
  1787. var index = $(this).parents('tr[data-index]').data('index');
  1788. var row = data[index];
  1789. var oldValue = row[column.field];
  1790. var newValue = $(this).val();
  1791. var isBoolTrue = newValue.toLowerCase() === 'true';
  1792. var isBoolFalse = newValue.toLowerCase() === 'false';
  1793. row[column.field] = isBoolTrue ? true : isBoolFalse ? false : newValue;
  1794. that.trigger('cellinput-selectchange', column.field, row, oldValue, index, $(this));
  1795. });
  1796. }
  1797. });
  1798. this.trigger('cellinput-init');
  1799. };
  1800. }));