bootstrap-table-cookie.js 107 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109
  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 = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. })(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. Object.defineProperty(Constructor, "prototype", {
  26. writable: false
  27. });
  28. return Constructor;
  29. }
  30. function _inherits(subClass, superClass) {
  31. if (typeof superClass !== "function" && superClass !== null) {
  32. throw new TypeError("Super expression must either be null or a function");
  33. }
  34. subClass.prototype = Object.create(superClass && superClass.prototype, {
  35. constructor: {
  36. value: subClass,
  37. writable: true,
  38. configurable: true
  39. }
  40. });
  41. Object.defineProperty(subClass, "prototype", {
  42. writable: false
  43. });
  44. if (superClass) _setPrototypeOf(subClass, superClass);
  45. }
  46. function _getPrototypeOf(o) {
  47. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  48. return o.__proto__ || Object.getPrototypeOf(o);
  49. };
  50. return _getPrototypeOf(o);
  51. }
  52. function _setPrototypeOf(o, p) {
  53. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  54. o.__proto__ = p;
  55. return o;
  56. };
  57. return _setPrototypeOf(o, p);
  58. }
  59. function _isNativeReflectConstruct() {
  60. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  61. if (Reflect.construct.sham) return false;
  62. if (typeof Proxy === "function") return true;
  63. try {
  64. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  65. return true;
  66. } catch (e) {
  67. return false;
  68. }
  69. }
  70. function _assertThisInitialized(self) {
  71. if (self === void 0) {
  72. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  73. }
  74. return self;
  75. }
  76. function _possibleConstructorReturn(self, call) {
  77. if (call && (typeof call === "object" || typeof call === "function")) {
  78. return call;
  79. } else if (call !== void 0) {
  80. throw new TypeError("Derived constructors may only return object or undefined");
  81. }
  82. return _assertThisInitialized(self);
  83. }
  84. function _createSuper(Derived) {
  85. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  86. return function _createSuperInternal() {
  87. var Super = _getPrototypeOf(Derived),
  88. result;
  89. if (hasNativeReflectConstruct) {
  90. var NewTarget = _getPrototypeOf(this).constructor;
  91. result = Reflect.construct(Super, arguments, NewTarget);
  92. } else {
  93. result = Super.apply(this, arguments);
  94. }
  95. return _possibleConstructorReturn(this, result);
  96. };
  97. }
  98. function _superPropBase(object, property) {
  99. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  100. object = _getPrototypeOf(object);
  101. if (object === null) break;
  102. }
  103. return object;
  104. }
  105. function _get() {
  106. if (typeof Reflect !== "undefined" && Reflect.get) {
  107. _get = Reflect.get;
  108. } else {
  109. _get = function _get(target, property, receiver) {
  110. var base = _superPropBase(target, property);
  111. if (!base) return;
  112. var desc = Object.getOwnPropertyDescriptor(base, property);
  113. if (desc.get) {
  114. return desc.get.call(arguments.length < 3 ? target : receiver);
  115. }
  116. return desc.value;
  117. };
  118. }
  119. return _get.apply(this, arguments);
  120. }
  121. function _unsupportedIterableToArray(o, minLen) {
  122. if (!o) return;
  123. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  124. var n = Object.prototype.toString.call(o).slice(8, -1);
  125. if (n === "Object" && o.constructor) n = o.constructor.name;
  126. if (n === "Map" || n === "Set") return Array.from(o);
  127. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  128. }
  129. function _arrayLikeToArray(arr, len) {
  130. if (len == null || len > arr.length) len = arr.length;
  131. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  132. return arr2;
  133. }
  134. function _createForOfIteratorHelper(o, allowArrayLike) {
  135. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  136. if (!it) {
  137. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  138. if (it) o = it;
  139. var i = 0;
  140. var F = function () {};
  141. return {
  142. s: F,
  143. n: function () {
  144. if (i >= o.length) return {
  145. done: true
  146. };
  147. return {
  148. done: false,
  149. value: o[i++]
  150. };
  151. },
  152. e: function (e) {
  153. throw e;
  154. },
  155. f: F
  156. };
  157. }
  158. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  159. }
  160. var normalCompletion = true,
  161. didErr = false,
  162. err;
  163. return {
  164. s: function () {
  165. it = it.call(o);
  166. },
  167. n: function () {
  168. var step = it.next();
  169. normalCompletion = step.done;
  170. return step;
  171. },
  172. e: function (e) {
  173. didErr = true;
  174. err = e;
  175. },
  176. f: function () {
  177. try {
  178. if (!normalCompletion && it.return != null) it.return();
  179. } finally {
  180. if (didErr) throw err;
  181. }
  182. }
  183. };
  184. }
  185. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  186. function createCommonjsModule(fn, module) {
  187. return module = { exports: {} }, fn(module, module.exports), module.exports;
  188. }
  189. var check = function (it) {
  190. return it && it.Math == Math && it;
  191. };
  192. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  193. var global_1 =
  194. // eslint-disable-next-line es-x/no-global-this -- safe
  195. check(typeof globalThis == 'object' && globalThis) ||
  196. check(typeof window == 'object' && window) ||
  197. // eslint-disable-next-line no-restricted-globals -- safe
  198. check(typeof self == 'object' && self) ||
  199. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  200. // eslint-disable-next-line no-new-func -- fallback
  201. (function () { return this; })() || Function('return this')();
  202. var fails = function (exec) {
  203. try {
  204. return !!exec();
  205. } catch (error) {
  206. return true;
  207. }
  208. };
  209. // Detect IE8's incomplete defineProperty implementation
  210. var descriptors = !fails(function () {
  211. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  212. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  213. });
  214. var functionBindNative = !fails(function () {
  215. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  216. var test = (function () { /* empty */ }).bind();
  217. // eslint-disable-next-line no-prototype-builtins -- safe
  218. return typeof test != 'function' || test.hasOwnProperty('prototype');
  219. });
  220. var call$2 = Function.prototype.call;
  221. var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
  222. return call$2.apply(call$2, arguments);
  223. };
  224. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  225. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  226. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  227. // Nashorn ~ JDK8 bug
  228. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  229. // `Object.prototype.propertyIsEnumerable` method implementation
  230. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  231. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  232. var descriptor = getOwnPropertyDescriptor$1(this, V);
  233. return !!descriptor && descriptor.enumerable;
  234. } : $propertyIsEnumerable;
  235. var objectPropertyIsEnumerable = {
  236. f: f$5
  237. };
  238. var createPropertyDescriptor = function (bitmap, value) {
  239. return {
  240. enumerable: !(bitmap & 1),
  241. configurable: !(bitmap & 2),
  242. writable: !(bitmap & 4),
  243. value: value
  244. };
  245. };
  246. var FunctionPrototype$2 = Function.prototype;
  247. var bind$1 = FunctionPrototype$2.bind;
  248. var call$1 = FunctionPrototype$2.call;
  249. var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
  250. var functionUncurryThis = functionBindNative ? function (fn) {
  251. return fn && uncurryThis(fn);
  252. } : function (fn) {
  253. return fn && function () {
  254. return call$1.apply(fn, arguments);
  255. };
  256. };
  257. var toString$1 = functionUncurryThis({}.toString);
  258. var stringSlice$5 = functionUncurryThis(''.slice);
  259. var classofRaw = function (it) {
  260. return stringSlice$5(toString$1(it), 8, -1);
  261. };
  262. var Object$4 = global_1.Object;
  263. var split = functionUncurryThis(''.split);
  264. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  265. var indexedObject = fails(function () {
  266. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  267. // eslint-disable-next-line no-prototype-builtins -- safe
  268. return !Object$4('z').propertyIsEnumerable(0);
  269. }) ? function (it) {
  270. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  271. } : Object$4;
  272. var TypeError$b = global_1.TypeError;
  273. // `RequireObjectCoercible` abstract operation
  274. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  275. var requireObjectCoercible = function (it) {
  276. if (it == undefined) throw TypeError$b("Can't call method on " + it);
  277. return it;
  278. };
  279. // toObject with fallback for non-array-like ES3 strings
  280. var toIndexedObject = function (it) {
  281. return indexedObject(requireObjectCoercible(it));
  282. };
  283. // `IsCallable` abstract operation
  284. // https://tc39.es/ecma262/#sec-iscallable
  285. var isCallable = function (argument) {
  286. return typeof argument == 'function';
  287. };
  288. var isObject = function (it) {
  289. return typeof it == 'object' ? it !== null : isCallable(it);
  290. };
  291. var aFunction = function (argument) {
  292. return isCallable(argument) ? argument : undefined;
  293. };
  294. var getBuiltIn = function (namespace, method) {
  295. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  296. };
  297. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  298. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  299. var process = global_1.process;
  300. var Deno = global_1.Deno;
  301. var versions = process && process.versions || Deno && Deno.version;
  302. var v8 = versions && versions.v8;
  303. var match, version;
  304. if (v8) {
  305. match = v8.split('.');
  306. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  307. // but their correct versions are not interesting for us
  308. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  309. }
  310. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  311. // so check `userAgent` even if `.v8` exists, but 0
  312. if (!version && engineUserAgent) {
  313. match = engineUserAgent.match(/Edge\/(\d+)/);
  314. if (!match || match[1] >= 74) {
  315. match = engineUserAgent.match(/Chrome\/(\d+)/);
  316. if (match) version = +match[1];
  317. }
  318. }
  319. var engineV8Version = version;
  320. /* eslint-disable es-x/no-symbol -- required for testing */
  321. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  322. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  323. var symbol = Symbol();
  324. // Chrome 38 Symbol has incorrect toString conversion
  325. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  326. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  327. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  328. !Symbol.sham && engineV8Version && engineV8Version < 41;
  329. });
  330. /* eslint-disable es-x/no-symbol -- required for testing */
  331. var useSymbolAsUid = nativeSymbol
  332. && !Symbol.sham
  333. && typeof Symbol.iterator == 'symbol';
  334. var Object$3 = global_1.Object;
  335. var isSymbol = useSymbolAsUid ? function (it) {
  336. return typeof it == 'symbol';
  337. } : function (it) {
  338. var $Symbol = getBuiltIn('Symbol');
  339. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  340. };
  341. var String$3 = global_1.String;
  342. var tryToString = function (argument) {
  343. try {
  344. return String$3(argument);
  345. } catch (error) {
  346. return 'Object';
  347. }
  348. };
  349. var TypeError$a = global_1.TypeError;
  350. // `Assert: IsCallable(argument) is true`
  351. var aCallable = function (argument) {
  352. if (isCallable(argument)) return argument;
  353. throw TypeError$a(tryToString(argument) + ' is not a function');
  354. };
  355. // `GetMethod` abstract operation
  356. // https://tc39.es/ecma262/#sec-getmethod
  357. var getMethod = function (V, P) {
  358. var func = V[P];
  359. return func == null ? undefined : aCallable(func);
  360. };
  361. var TypeError$9 = global_1.TypeError;
  362. // `OrdinaryToPrimitive` abstract operation
  363. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  364. var ordinaryToPrimitive = function (input, pref) {
  365. var fn, val;
  366. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  367. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  368. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  369. throw TypeError$9("Can't convert object to primitive value");
  370. };
  371. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  372. var defineProperty = Object.defineProperty;
  373. var setGlobal = function (key, value) {
  374. try {
  375. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  376. } catch (error) {
  377. global_1[key] = value;
  378. } return value;
  379. };
  380. var SHARED = '__core-js_shared__';
  381. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  382. var sharedStore = store$1;
  383. var shared = createCommonjsModule(function (module) {
  384. (module.exports = function (key, value) {
  385. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  386. })('versions', []).push({
  387. version: '3.22.4',
  388. mode: 'global',
  389. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  390. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  391. source: 'https://github.com/zloirock/core-js'
  392. });
  393. });
  394. var Object$2 = global_1.Object;
  395. // `ToObject` abstract operation
  396. // https://tc39.es/ecma262/#sec-toobject
  397. var toObject = function (argument) {
  398. return Object$2(requireObjectCoercible(argument));
  399. };
  400. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  401. // `HasOwnProperty` abstract operation
  402. // https://tc39.es/ecma262/#sec-hasownproperty
  403. // eslint-disable-next-line es-x/no-object-hasown -- safe
  404. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  405. return hasOwnProperty(toObject(it), key);
  406. };
  407. var id = 0;
  408. var postfix = Math.random();
  409. var toString = functionUncurryThis(1.0.toString);
  410. var uid = function (key) {
  411. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  412. };
  413. var WellKnownSymbolsStore = shared('wks');
  414. var Symbol$1 = global_1.Symbol;
  415. var symbolFor = Symbol$1 && Symbol$1['for'];
  416. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  417. var wellKnownSymbol = function (name) {
  418. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  419. var description = 'Symbol.' + name;
  420. if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
  421. WellKnownSymbolsStore[name] = Symbol$1[name];
  422. } else if (useSymbolAsUid && symbolFor) {
  423. WellKnownSymbolsStore[name] = symbolFor(description);
  424. } else {
  425. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  426. }
  427. } return WellKnownSymbolsStore[name];
  428. };
  429. var TypeError$8 = global_1.TypeError;
  430. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  431. // `ToPrimitive` abstract operation
  432. // https://tc39.es/ecma262/#sec-toprimitive
  433. var toPrimitive = function (input, pref) {
  434. if (!isObject(input) || isSymbol(input)) return input;
  435. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  436. var result;
  437. if (exoticToPrim) {
  438. if (pref === undefined) pref = 'default';
  439. result = functionCall(exoticToPrim, input, pref);
  440. if (!isObject(result) || isSymbol(result)) return result;
  441. throw TypeError$8("Can't convert object to primitive value");
  442. }
  443. if (pref === undefined) pref = 'number';
  444. return ordinaryToPrimitive(input, pref);
  445. };
  446. // `ToPropertyKey` abstract operation
  447. // https://tc39.es/ecma262/#sec-topropertykey
  448. var toPropertyKey = function (argument) {
  449. var key = toPrimitive(argument, 'string');
  450. return isSymbol(key) ? key : key + '';
  451. };
  452. var document$1 = global_1.document;
  453. // typeof document.createElement is 'object' in old IE
  454. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  455. var documentCreateElement = function (it) {
  456. return EXISTS$1 ? document$1.createElement(it) : {};
  457. };
  458. // Thanks to IE8 for its funny defineProperty
  459. var ie8DomDefine = !descriptors && !fails(function () {
  460. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  461. return Object.defineProperty(documentCreateElement('div'), 'a', {
  462. get: function () { return 7; }
  463. }).a != 7;
  464. });
  465. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  466. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  467. // `Object.getOwnPropertyDescriptor` method
  468. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  469. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  470. O = toIndexedObject(O);
  471. P = toPropertyKey(P);
  472. if (ie8DomDefine) try {
  473. return $getOwnPropertyDescriptor$1(O, P);
  474. } catch (error) { /* empty */ }
  475. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  476. };
  477. var objectGetOwnPropertyDescriptor = {
  478. f: f$4
  479. };
  480. // V8 ~ Chrome 36-
  481. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  482. var v8PrototypeDefineBug = descriptors && fails(function () {
  483. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  484. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  485. value: 42,
  486. writable: false
  487. }).prototype != 42;
  488. });
  489. var String$2 = global_1.String;
  490. var TypeError$7 = global_1.TypeError;
  491. // `Assert: Type(argument) is Object`
  492. var anObject = function (argument) {
  493. if (isObject(argument)) return argument;
  494. throw TypeError$7(String$2(argument) + ' is not an object');
  495. };
  496. var TypeError$6 = global_1.TypeError;
  497. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  498. var $defineProperty = Object.defineProperty;
  499. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  500. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  501. var ENUMERABLE = 'enumerable';
  502. var CONFIGURABLE$1 = 'configurable';
  503. var WRITABLE = 'writable';
  504. // `Object.defineProperty` method
  505. // https://tc39.es/ecma262/#sec-object.defineproperty
  506. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  507. anObject(O);
  508. P = toPropertyKey(P);
  509. anObject(Attributes);
  510. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  511. var current = $getOwnPropertyDescriptor(O, P);
  512. if (current && current[WRITABLE]) {
  513. O[P] = Attributes.value;
  514. Attributes = {
  515. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  516. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  517. writable: false
  518. };
  519. }
  520. } return $defineProperty(O, P, Attributes);
  521. } : $defineProperty : function defineProperty(O, P, Attributes) {
  522. anObject(O);
  523. P = toPropertyKey(P);
  524. anObject(Attributes);
  525. if (ie8DomDefine) try {
  526. return $defineProperty(O, P, Attributes);
  527. } catch (error) { /* empty */ }
  528. if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
  529. if ('value' in Attributes) O[P] = Attributes.value;
  530. return O;
  531. };
  532. var objectDefineProperty = {
  533. f: f$3
  534. };
  535. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  536. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  537. } : function (object, key, value) {
  538. object[key] = value;
  539. return object;
  540. };
  541. var FunctionPrototype$1 = Function.prototype;
  542. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  543. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  544. var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
  545. // additional protection from minified / mangled / dropped function names
  546. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  547. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
  548. var functionName = {
  549. EXISTS: EXISTS,
  550. PROPER: PROPER,
  551. CONFIGURABLE: CONFIGURABLE
  552. };
  553. var functionToString = functionUncurryThis(Function.toString);
  554. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  555. if (!isCallable(sharedStore.inspectSource)) {
  556. sharedStore.inspectSource = function (it) {
  557. return functionToString(it);
  558. };
  559. }
  560. var inspectSource = sharedStore.inspectSource;
  561. var WeakMap$1 = global_1.WeakMap;
  562. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  563. var keys = shared('keys');
  564. var sharedKey = function (key) {
  565. return keys[key] || (keys[key] = uid(key));
  566. };
  567. var hiddenKeys$1 = {};
  568. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  569. var TypeError$5 = global_1.TypeError;
  570. var WeakMap = global_1.WeakMap;
  571. var set, get, has;
  572. var enforce = function (it) {
  573. return has(it) ? get(it) : set(it, {});
  574. };
  575. var getterFor = function (TYPE) {
  576. return function (it) {
  577. var state;
  578. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  579. throw TypeError$5('Incompatible receiver, ' + TYPE + ' required');
  580. } return state;
  581. };
  582. };
  583. if (nativeWeakMap || sharedStore.state) {
  584. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  585. var wmget = functionUncurryThis(store.get);
  586. var wmhas = functionUncurryThis(store.has);
  587. var wmset = functionUncurryThis(store.set);
  588. set = function (it, metadata) {
  589. if (wmhas(store, it)) throw new TypeError$5(OBJECT_ALREADY_INITIALIZED);
  590. metadata.facade = it;
  591. wmset(store, it, metadata);
  592. return metadata;
  593. };
  594. get = function (it) {
  595. return wmget(store, it) || {};
  596. };
  597. has = function (it) {
  598. return wmhas(store, it);
  599. };
  600. } else {
  601. var STATE = sharedKey('state');
  602. hiddenKeys$1[STATE] = true;
  603. set = function (it, metadata) {
  604. if (hasOwnProperty_1(it, STATE)) throw new TypeError$5(OBJECT_ALREADY_INITIALIZED);
  605. metadata.facade = it;
  606. createNonEnumerableProperty(it, STATE, metadata);
  607. return metadata;
  608. };
  609. get = function (it) {
  610. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  611. };
  612. has = function (it) {
  613. return hasOwnProperty_1(it, STATE);
  614. };
  615. }
  616. var internalState = {
  617. set: set,
  618. get: get,
  619. has: has,
  620. enforce: enforce,
  621. getterFor: getterFor
  622. };
  623. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  624. var defineProperty = objectDefineProperty.f;
  625. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  626. var enforceInternalState = internalState.enforce;
  627. var getInternalState = internalState.get;
  628. var CONFIGURABLE_LENGTH = !fails(function () {
  629. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  630. });
  631. var TEMPLATE = String(String).split('String');
  632. var makeBuiltIn = module.exports = function (value, name, options) {
  633. if (String(name).slice(0, 7) === 'Symbol(') {
  634. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  635. }
  636. if (options && options.getter) name = 'get ' + name;
  637. if (options && options.setter) name = 'set ' + name;
  638. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  639. defineProperty(value, 'name', { value: name, configurable: true });
  640. }
  641. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  642. defineProperty(value, 'length', { value: options.arity });
  643. }
  644. var state = enforceInternalState(value);
  645. if (!hasOwnProperty_1(state, 'source')) {
  646. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  647. } return value;
  648. };
  649. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  650. // eslint-disable-next-line no-extend-native -- required
  651. Function.prototype.toString = makeBuiltIn(function toString() {
  652. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  653. }, 'toString');
  654. });
  655. var defineBuiltIn = function (O, key, value, options) {
  656. var unsafe = options ? !!options.unsafe : false;
  657. var simple = options ? !!options.enumerable : false;
  658. var noTargetGet = options ? !!options.noTargetGet : false;
  659. var name = options && options.name !== undefined ? options.name : key;
  660. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  661. if (O === global_1) {
  662. if (simple) O[key] = value;
  663. else setGlobal(key, value);
  664. return O;
  665. } else if (!unsafe) {
  666. delete O[key];
  667. } else if (!noTargetGet && O[key]) {
  668. simple = true;
  669. }
  670. if (simple) O[key] = value;
  671. else createNonEnumerableProperty(O, key, value);
  672. return O;
  673. };
  674. var ceil = Math.ceil;
  675. var floor$1 = Math.floor;
  676. // `ToIntegerOrInfinity` abstract operation
  677. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  678. var toIntegerOrInfinity = function (argument) {
  679. var number = +argument;
  680. // eslint-disable-next-line no-self-compare -- safe
  681. return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
  682. };
  683. var max$2 = Math.max;
  684. var min$3 = Math.min;
  685. // Helper for a popular repeating case of the spec:
  686. // Let integer be ? ToInteger(index).
  687. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  688. var toAbsoluteIndex = function (index, length) {
  689. var integer = toIntegerOrInfinity(index);
  690. return integer < 0 ? max$2(integer + length, 0) : min$3(integer, length);
  691. };
  692. var min$2 = Math.min;
  693. // `ToLength` abstract operation
  694. // https://tc39.es/ecma262/#sec-tolength
  695. var toLength = function (argument) {
  696. return argument > 0 ? min$2(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  697. };
  698. // `LengthOfArrayLike` abstract operation
  699. // https://tc39.es/ecma262/#sec-lengthofarraylike
  700. var lengthOfArrayLike = function (obj) {
  701. return toLength(obj.length);
  702. };
  703. // `Array.prototype.{ indexOf, includes }` methods implementation
  704. var createMethod$2 = function (IS_INCLUDES) {
  705. return function ($this, el, fromIndex) {
  706. var O = toIndexedObject($this);
  707. var length = lengthOfArrayLike(O);
  708. var index = toAbsoluteIndex(fromIndex, length);
  709. var value;
  710. // Array#includes uses SameValueZero equality algorithm
  711. // eslint-disable-next-line no-self-compare -- NaN check
  712. if (IS_INCLUDES && el != el) while (length > index) {
  713. value = O[index++];
  714. // eslint-disable-next-line no-self-compare -- NaN check
  715. if (value != value) return true;
  716. // Array#indexOf ignores holes, Array#includes - not
  717. } else for (;length > index; index++) {
  718. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  719. } return !IS_INCLUDES && -1;
  720. };
  721. };
  722. var arrayIncludes = {
  723. // `Array.prototype.includes` method
  724. // https://tc39.es/ecma262/#sec-array.prototype.includes
  725. includes: createMethod$2(true),
  726. // `Array.prototype.indexOf` method
  727. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  728. indexOf: createMethod$2(false)
  729. };
  730. var indexOf$1 = arrayIncludes.indexOf;
  731. var push$3 = functionUncurryThis([].push);
  732. var objectKeysInternal = function (object, names) {
  733. var O = toIndexedObject(object);
  734. var i = 0;
  735. var result = [];
  736. var key;
  737. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$3(result, key);
  738. // Don't enum bug & hidden keys
  739. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  740. ~indexOf$1(result, key) || push$3(result, key);
  741. }
  742. return result;
  743. };
  744. // IE8- don't enum bug keys
  745. var enumBugKeys = [
  746. 'constructor',
  747. 'hasOwnProperty',
  748. 'isPrototypeOf',
  749. 'propertyIsEnumerable',
  750. 'toLocaleString',
  751. 'toString',
  752. 'valueOf'
  753. ];
  754. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  755. // `Object.getOwnPropertyNames` method
  756. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  757. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  758. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  759. return objectKeysInternal(O, hiddenKeys);
  760. };
  761. var objectGetOwnPropertyNames = {
  762. f: f$2
  763. };
  764. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  765. var f$1 = Object.getOwnPropertySymbols;
  766. var objectGetOwnPropertySymbols = {
  767. f: f$1
  768. };
  769. var concat$1 = functionUncurryThis([].concat);
  770. // all object keys, includes non-enumerable and symbols
  771. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  772. var keys = objectGetOwnPropertyNames.f(anObject(it));
  773. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  774. return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
  775. };
  776. var copyConstructorProperties = function (target, source, exceptions) {
  777. var keys = ownKeys(source);
  778. var defineProperty = objectDefineProperty.f;
  779. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  780. for (var i = 0; i < keys.length; i++) {
  781. var key = keys[i];
  782. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  783. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  784. }
  785. }
  786. };
  787. var replacement = /#|\.prototype\./;
  788. var isForced = function (feature, detection) {
  789. var value = data[normalize(feature)];
  790. return value == POLYFILL ? true
  791. : value == NATIVE ? false
  792. : isCallable(detection) ? fails(detection)
  793. : !!detection;
  794. };
  795. var normalize = isForced.normalize = function (string) {
  796. return String(string).replace(replacement, '.').toLowerCase();
  797. };
  798. var data = isForced.data = {};
  799. var NATIVE = isForced.NATIVE = 'N';
  800. var POLYFILL = isForced.POLYFILL = 'P';
  801. var isForced_1 = isForced;
  802. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  803. /*
  804. options.target - name of the target object
  805. options.global - target is the global object
  806. options.stat - export as static methods of target
  807. options.proto - export as prototype methods of target
  808. options.real - real prototype method for the `pure` version
  809. options.forced - export even if the native feature is available
  810. options.bind - bind methods to the target, required for the `pure` version
  811. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  812. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  813. options.sham - add a flag to not completely full polyfills
  814. options.enumerable - export as enumerable property
  815. options.noTargetGet - prevent calling a getter on target
  816. options.name - the .name of the function if it does not match the key
  817. */
  818. var _export = function (options, source) {
  819. var TARGET = options.target;
  820. var GLOBAL = options.global;
  821. var STATIC = options.stat;
  822. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  823. if (GLOBAL) {
  824. target = global_1;
  825. } else if (STATIC) {
  826. target = global_1[TARGET] || setGlobal(TARGET, {});
  827. } else {
  828. target = (global_1[TARGET] || {}).prototype;
  829. }
  830. if (target) for (key in source) {
  831. sourceProperty = source[key];
  832. if (options.noTargetGet) {
  833. descriptor = getOwnPropertyDescriptor(target, key);
  834. targetProperty = descriptor && descriptor.value;
  835. } else targetProperty = target[key];
  836. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  837. // contained in target
  838. if (!FORCED && targetProperty !== undefined) {
  839. if (typeof sourceProperty == typeof targetProperty) continue;
  840. copyConstructorProperties(sourceProperty, targetProperty);
  841. }
  842. // add a flag to not completely full polyfills
  843. if (options.sham || (targetProperty && targetProperty.sham)) {
  844. createNonEnumerableProperty(sourceProperty, 'sham', true);
  845. }
  846. defineBuiltIn(target, key, sourceProperty, options);
  847. }
  848. };
  849. // `Object.keys` method
  850. // https://tc39.es/ecma262/#sec-object.keys
  851. // eslint-disable-next-line es-x/no-object-keys -- safe
  852. var objectKeys = Object.keys || function keys(O) {
  853. return objectKeysInternal(O, enumBugKeys);
  854. };
  855. // `Object.defineProperties` method
  856. // https://tc39.es/ecma262/#sec-object.defineproperties
  857. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  858. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  859. anObject(O);
  860. var props = toIndexedObject(Properties);
  861. var keys = objectKeys(Properties);
  862. var length = keys.length;
  863. var index = 0;
  864. var key;
  865. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  866. return O;
  867. };
  868. var objectDefineProperties = {
  869. f: f
  870. };
  871. var html = getBuiltIn('document', 'documentElement');
  872. /* global ActiveXObject -- old IE, WSH */
  873. var GT = '>';
  874. var LT = '<';
  875. var PROTOTYPE = 'prototype';
  876. var SCRIPT = 'script';
  877. var IE_PROTO = sharedKey('IE_PROTO');
  878. var EmptyConstructor = function () { /* empty */ };
  879. var scriptTag = function (content) {
  880. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  881. };
  882. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  883. var NullProtoObjectViaActiveX = function (activeXDocument) {
  884. activeXDocument.write(scriptTag(''));
  885. activeXDocument.close();
  886. var temp = activeXDocument.parentWindow.Object;
  887. activeXDocument = null; // avoid memory leak
  888. return temp;
  889. };
  890. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  891. var NullProtoObjectViaIFrame = function () {
  892. // Thrash, waste and sodomy: IE GC bug
  893. var iframe = documentCreateElement('iframe');
  894. var JS = 'java' + SCRIPT + ':';
  895. var iframeDocument;
  896. iframe.style.display = 'none';
  897. html.appendChild(iframe);
  898. // https://github.com/zloirock/core-js/issues/475
  899. iframe.src = String(JS);
  900. iframeDocument = iframe.contentWindow.document;
  901. iframeDocument.open();
  902. iframeDocument.write(scriptTag('document.F=Object'));
  903. iframeDocument.close();
  904. return iframeDocument.F;
  905. };
  906. // Check for document.domain and active x support
  907. // No need to use active x approach when document.domain is not set
  908. // see https://github.com/es-shims/es5-shim/issues/150
  909. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  910. // avoid IE GC bug
  911. var activeXDocument;
  912. var NullProtoObject = function () {
  913. try {
  914. activeXDocument = new ActiveXObject('htmlfile');
  915. } catch (error) { /* ignore */ }
  916. NullProtoObject = typeof document != 'undefined'
  917. ? document.domain && activeXDocument
  918. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  919. : NullProtoObjectViaIFrame()
  920. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  921. var length = enumBugKeys.length;
  922. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  923. return NullProtoObject();
  924. };
  925. hiddenKeys$1[IE_PROTO] = true;
  926. // `Object.create` method
  927. // https://tc39.es/ecma262/#sec-object.create
  928. // eslint-disable-next-line es-x/no-object-create -- safe
  929. var objectCreate = Object.create || function create(O, Properties) {
  930. var result;
  931. if (O !== null) {
  932. EmptyConstructor[PROTOTYPE] = anObject(O);
  933. result = new EmptyConstructor();
  934. EmptyConstructor[PROTOTYPE] = null;
  935. // add "__proto__" for Object.getPrototypeOf polyfill
  936. result[IE_PROTO] = O;
  937. } else result = NullProtoObject();
  938. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  939. };
  940. var UNSCOPABLES = wellKnownSymbol('unscopables');
  941. var ArrayPrototype = Array.prototype;
  942. // Array.prototype[@@unscopables]
  943. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  944. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  945. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  946. configurable: true,
  947. value: objectCreate(null)
  948. });
  949. }
  950. // add a key to Array.prototype[@@unscopables]
  951. var addToUnscopables = function (key) {
  952. ArrayPrototype[UNSCOPABLES][key] = true;
  953. };
  954. var $includes = arrayIncludes.includes;
  955. // FF99+ bug
  956. var BROKEN_ON_SPARSE = fails(function () {
  957. return !Array(1).includes();
  958. });
  959. // `Array.prototype.includes` method
  960. // https://tc39.es/ecma262/#sec-array.prototype.includes
  961. _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
  962. includes: function includes(el /* , fromIndex = 0 */) {
  963. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  964. }
  965. });
  966. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  967. addToUnscopables('includes');
  968. var MATCH$1 = wellKnownSymbol('match');
  969. // `IsRegExp` abstract operation
  970. // https://tc39.es/ecma262/#sec-isregexp
  971. var isRegexp = function (it) {
  972. var isRegExp;
  973. return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  974. };
  975. var TypeError$4 = global_1.TypeError;
  976. var notARegexp = function (it) {
  977. if (isRegexp(it)) {
  978. throw TypeError$4("The method doesn't accept regular expressions");
  979. } return it;
  980. };
  981. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  982. var test = {};
  983. test[TO_STRING_TAG$1] = 'z';
  984. var toStringTagSupport = String(test) === '[object z]';
  985. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  986. var Object$1 = global_1.Object;
  987. // ES3 wrong here
  988. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  989. // fallback for IE11 Script Access Denied error
  990. var tryGet = function (it, key) {
  991. try {
  992. return it[key];
  993. } catch (error) { /* empty */ }
  994. };
  995. // getting tag from ES6+ `Object.prototype.toString`
  996. var classof = toStringTagSupport ? classofRaw : function (it) {
  997. var O, tag, result;
  998. return it === undefined ? 'Undefined' : it === null ? 'Null'
  999. // @@toStringTag case
  1000. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  1001. // builtinTag case
  1002. : CORRECT_ARGUMENTS ? classofRaw(O)
  1003. // ES3 arguments fallback
  1004. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  1005. };
  1006. var String$1 = global_1.String;
  1007. var toString_1 = function (argument) {
  1008. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1009. return String$1(argument);
  1010. };
  1011. var MATCH = wellKnownSymbol('match');
  1012. var correctIsRegexpLogic = function (METHOD_NAME) {
  1013. var regexp = /./;
  1014. try {
  1015. '/./'[METHOD_NAME](regexp);
  1016. } catch (error1) {
  1017. try {
  1018. regexp[MATCH] = false;
  1019. return '/./'[METHOD_NAME](regexp);
  1020. } catch (error2) { /* empty */ }
  1021. } return false;
  1022. };
  1023. var stringIndexOf$1 = functionUncurryThis(''.indexOf);
  1024. // `String.prototype.includes` method
  1025. // https://tc39.es/ecma262/#sec-string.prototype.includes
  1026. _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
  1027. includes: function includes(searchString /* , position = 0 */) {
  1028. return !!~stringIndexOf$1(
  1029. toString_1(requireObjectCoercible(this)),
  1030. toString_1(notARegexp(searchString)),
  1031. arguments.length > 1 ? arguments[1] : undefined
  1032. );
  1033. }
  1034. });
  1035. // `IsArray` abstract operation
  1036. // https://tc39.es/ecma262/#sec-isarray
  1037. // eslint-disable-next-line es-x/no-array-isarray -- safe
  1038. var isArray = Array.isArray || function isArray(argument) {
  1039. return classofRaw(argument) == 'Array';
  1040. };
  1041. var createProperty = function (object, key, value) {
  1042. var propertyKey = toPropertyKey(key);
  1043. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1044. else object[propertyKey] = value;
  1045. };
  1046. var noop = function () { /* empty */ };
  1047. var empty = [];
  1048. var construct = getBuiltIn('Reflect', 'construct');
  1049. var constructorRegExp = /^\s*(?:class|function)\b/;
  1050. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  1051. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  1052. var isConstructorModern = function isConstructor(argument) {
  1053. if (!isCallable(argument)) return false;
  1054. try {
  1055. construct(noop, empty, argument);
  1056. return true;
  1057. } catch (error) {
  1058. return false;
  1059. }
  1060. };
  1061. var isConstructorLegacy = function isConstructor(argument) {
  1062. if (!isCallable(argument)) return false;
  1063. switch (classof(argument)) {
  1064. case 'AsyncFunction':
  1065. case 'GeneratorFunction':
  1066. case 'AsyncGeneratorFunction': return false;
  1067. }
  1068. try {
  1069. // we can't check .prototype since constructors produced by .bind haven't it
  1070. // `Function#toString` throws on some built-it function in some legacy engines
  1071. // (for example, `DOMQuad` and similar in FF41-)
  1072. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  1073. } catch (error) {
  1074. return true;
  1075. }
  1076. };
  1077. isConstructorLegacy.sham = true;
  1078. // `IsConstructor` abstract operation
  1079. // https://tc39.es/ecma262/#sec-isconstructor
  1080. var isConstructor = !construct || fails(function () {
  1081. var called;
  1082. return isConstructorModern(isConstructorModern.call)
  1083. || !isConstructorModern(Object)
  1084. || !isConstructorModern(function () { called = true; })
  1085. || called;
  1086. }) ? isConstructorLegacy : isConstructorModern;
  1087. var SPECIES$3 = wellKnownSymbol('species');
  1088. var Array$2 = global_1.Array;
  1089. // a part of `ArraySpeciesCreate` abstract operation
  1090. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1091. var arraySpeciesConstructor = function (originalArray) {
  1092. var C;
  1093. if (isArray(originalArray)) {
  1094. C = originalArray.constructor;
  1095. // cross-realm fallback
  1096. if (isConstructor(C) && (C === Array$2 || isArray(C.prototype))) C = undefined;
  1097. else if (isObject(C)) {
  1098. C = C[SPECIES$3];
  1099. if (C === null) C = undefined;
  1100. }
  1101. } return C === undefined ? Array$2 : C;
  1102. };
  1103. // `ArraySpeciesCreate` abstract operation
  1104. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1105. var arraySpeciesCreate = function (originalArray, length) {
  1106. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1107. };
  1108. var SPECIES$2 = wellKnownSymbol('species');
  1109. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1110. // We can't use this feature detection in V8 since it causes
  1111. // deoptimization and serious performance degradation
  1112. // https://github.com/zloirock/core-js/issues/677
  1113. return engineV8Version >= 51 || !fails(function () {
  1114. var array = [];
  1115. var constructor = array.constructor = {};
  1116. constructor[SPECIES$2] = function () {
  1117. return { foo: 1 };
  1118. };
  1119. return array[METHOD_NAME](Boolean).foo !== 1;
  1120. });
  1121. };
  1122. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1123. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1124. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1125. var TypeError$3 = global_1.TypeError;
  1126. // We can't use this feature detection in V8 since it causes
  1127. // deoptimization and serious performance degradation
  1128. // https://github.com/zloirock/core-js/issues/679
  1129. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1130. var array = [];
  1131. array[IS_CONCAT_SPREADABLE] = false;
  1132. return array.concat()[0] !== array;
  1133. });
  1134. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1135. var isConcatSpreadable = function (O) {
  1136. if (!isObject(O)) return false;
  1137. var spreadable = O[IS_CONCAT_SPREADABLE];
  1138. return spreadable !== undefined ? !!spreadable : isArray(O);
  1139. };
  1140. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1141. // `Array.prototype.concat` method
  1142. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1143. // with adding support of @@isConcatSpreadable and @@species
  1144. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  1145. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1146. concat: function concat(arg) {
  1147. var O = toObject(this);
  1148. var A = arraySpeciesCreate(O, 0);
  1149. var n = 0;
  1150. var i, k, length, len, E;
  1151. for (i = -1, length = arguments.length; i < length; i++) {
  1152. E = i === -1 ? O : arguments[i];
  1153. if (isConcatSpreadable(E)) {
  1154. len = lengthOfArrayLike(E);
  1155. if (n + len > MAX_SAFE_INTEGER) throw TypeError$3(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1156. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1157. } else {
  1158. if (n >= MAX_SAFE_INTEGER) throw TypeError$3(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1159. createProperty(A, n++, E);
  1160. }
  1161. }
  1162. A.length = n;
  1163. return A;
  1164. }
  1165. });
  1166. // `RegExp.prototype.flags` getter implementation
  1167. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1168. var regexpFlags = function () {
  1169. var that = anObject(this);
  1170. var result = '';
  1171. if (that.hasIndices) result += 'd';
  1172. if (that.global) result += 'g';
  1173. if (that.ignoreCase) result += 'i';
  1174. if (that.multiline) result += 'm';
  1175. if (that.dotAll) result += 's';
  1176. if (that.unicode) result += 'u';
  1177. if (that.sticky) result += 'y';
  1178. return result;
  1179. };
  1180. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1181. var $RegExp$2 = global_1.RegExp;
  1182. var UNSUPPORTED_Y$2 = fails(function () {
  1183. var re = $RegExp$2('a', 'y');
  1184. re.lastIndex = 2;
  1185. return re.exec('abcd') != null;
  1186. });
  1187. // UC Browser bug
  1188. // https://github.com/zloirock/core-js/issues/1008
  1189. var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
  1190. return !$RegExp$2('a', 'y').sticky;
  1191. });
  1192. var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
  1193. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  1194. var re = $RegExp$2('^r', 'gy');
  1195. re.lastIndex = 2;
  1196. return re.exec('str') != null;
  1197. });
  1198. var regexpStickyHelpers = {
  1199. BROKEN_CARET: BROKEN_CARET,
  1200. MISSED_STICKY: MISSED_STICKY,
  1201. UNSUPPORTED_Y: UNSUPPORTED_Y$2
  1202. };
  1203. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  1204. var $RegExp$1 = global_1.RegExp;
  1205. var regexpUnsupportedDotAll = fails(function () {
  1206. var re = $RegExp$1('.', 's');
  1207. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  1208. });
  1209. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  1210. var $RegExp = global_1.RegExp;
  1211. var regexpUnsupportedNcg = fails(function () {
  1212. var re = $RegExp('(?<a>b)', 'g');
  1213. return re.exec('b').groups.a !== 'b' ||
  1214. 'b'.replace(re, '$<a>c') !== 'bc';
  1215. });
  1216. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  1217. /* eslint-disable regexp/no-useless-quantifier -- testing */
  1218. var getInternalState = internalState.get;
  1219. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  1220. var nativeExec = RegExp.prototype.exec;
  1221. var patchedExec = nativeExec;
  1222. var charAt$3 = functionUncurryThis(''.charAt);
  1223. var indexOf = functionUncurryThis(''.indexOf);
  1224. var replace$1 = functionUncurryThis(''.replace);
  1225. var stringSlice$4 = functionUncurryThis(''.slice);
  1226. var UPDATES_LAST_INDEX_WRONG = (function () {
  1227. var re1 = /a/;
  1228. var re2 = /b*/g;
  1229. functionCall(nativeExec, re1, 'a');
  1230. functionCall(nativeExec, re2, 'a');
  1231. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1232. })();
  1233. var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
  1234. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1235. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1236. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
  1237. if (PATCH) {
  1238. patchedExec = function exec(string) {
  1239. var re = this;
  1240. var state = getInternalState(re);
  1241. var str = toString_1(string);
  1242. var raw = state.raw;
  1243. var result, reCopy, lastIndex, match, i, object, group;
  1244. if (raw) {
  1245. raw.lastIndex = re.lastIndex;
  1246. result = functionCall(patchedExec, raw, str);
  1247. re.lastIndex = raw.lastIndex;
  1248. return result;
  1249. }
  1250. var groups = state.groups;
  1251. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  1252. var flags = functionCall(regexpFlags, re);
  1253. var source = re.source;
  1254. var charsAdded = 0;
  1255. var strCopy = str;
  1256. if (sticky) {
  1257. flags = replace$1(flags, 'y', '');
  1258. if (indexOf(flags, 'g') === -1) {
  1259. flags += 'g';
  1260. }
  1261. strCopy = stringSlice$4(str, re.lastIndex);
  1262. // Support anchored sticky behavior.
  1263. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  1264. source = '(?: ' + source + ')';
  1265. strCopy = ' ' + strCopy;
  1266. charsAdded++;
  1267. }
  1268. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1269. // simulate the 'y' flag.
  1270. reCopy = new RegExp('^(?:' + source + ')', flags);
  1271. }
  1272. if (NPCG_INCLUDED) {
  1273. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1274. }
  1275. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1276. match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
  1277. if (sticky) {
  1278. if (match) {
  1279. match.input = stringSlice$4(match.input, charsAdded);
  1280. match[0] = stringSlice$4(match[0], charsAdded);
  1281. match.index = re.lastIndex;
  1282. re.lastIndex += match[0].length;
  1283. } else re.lastIndex = 0;
  1284. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1285. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1286. }
  1287. if (NPCG_INCLUDED && match && match.length > 1) {
  1288. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1289. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1290. functionCall(nativeReplace, match[0], reCopy, function () {
  1291. for (i = 1; i < arguments.length - 2; i++) {
  1292. if (arguments[i] === undefined) match[i] = undefined;
  1293. }
  1294. });
  1295. }
  1296. if (match && groups) {
  1297. match.groups = object = objectCreate(null);
  1298. for (i = 0; i < groups.length; i++) {
  1299. group = groups[i];
  1300. object[group[0]] = match[group[1]];
  1301. }
  1302. }
  1303. return match;
  1304. };
  1305. }
  1306. var regexpExec = patchedExec;
  1307. // `RegExp.prototype.exec` method
  1308. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1309. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1310. exec: regexpExec
  1311. });
  1312. var FunctionPrototype = Function.prototype;
  1313. var apply = FunctionPrototype.apply;
  1314. var call = FunctionPrototype.call;
  1315. // eslint-disable-next-line es-x/no-reflect -- safe
  1316. var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
  1317. return call.apply(apply, arguments);
  1318. });
  1319. // TODO: Remove from `core-js@4` since it's moved to entry points
  1320. var SPECIES$1 = wellKnownSymbol('species');
  1321. var RegExpPrototype$2 = RegExp.prototype;
  1322. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  1323. var SYMBOL = wellKnownSymbol(KEY);
  1324. var DELEGATES_TO_SYMBOL = !fails(function () {
  1325. // String methods call symbol-named RegEp methods
  1326. var O = {};
  1327. O[SYMBOL] = function () { return 7; };
  1328. return ''[KEY](O) != 7;
  1329. });
  1330. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1331. // Symbol-named RegExp methods call .exec
  1332. var execCalled = false;
  1333. var re = /a/;
  1334. if (KEY === 'split') {
  1335. // We can't use real regex here since it causes deoptimization
  1336. // and serious performance degradation in V8
  1337. // https://github.com/zloirock/core-js/issues/306
  1338. re = {};
  1339. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1340. // a new one. We need to return the patched regex when creating the new one.
  1341. re.constructor = {};
  1342. re.constructor[SPECIES$1] = function () { return re; };
  1343. re.flags = '';
  1344. re[SYMBOL] = /./[SYMBOL];
  1345. }
  1346. re.exec = function () { execCalled = true; return null; };
  1347. re[SYMBOL]('');
  1348. return !execCalled;
  1349. });
  1350. if (
  1351. !DELEGATES_TO_SYMBOL ||
  1352. !DELEGATES_TO_EXEC ||
  1353. FORCED
  1354. ) {
  1355. var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
  1356. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1357. var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
  1358. var $exec = regexp.exec;
  1359. if ($exec === regexpExec || $exec === RegExpPrototype$2.exec) {
  1360. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1361. // The native String method already delegates to @@method (this
  1362. // polyfilled function), leasing to infinite recursion.
  1363. // We avoid it by directly calling the native @@method method.
  1364. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  1365. }
  1366. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  1367. }
  1368. return { done: false };
  1369. });
  1370. defineBuiltIn(String.prototype, KEY, methods[0]);
  1371. defineBuiltIn(RegExpPrototype$2, SYMBOL, methods[1]);
  1372. }
  1373. if (SHAM) createNonEnumerableProperty(RegExpPrototype$2[SYMBOL], 'sham', true);
  1374. };
  1375. var charAt$2 = functionUncurryThis(''.charAt);
  1376. var charCodeAt = functionUncurryThis(''.charCodeAt);
  1377. var stringSlice$3 = functionUncurryThis(''.slice);
  1378. var createMethod$1 = function (CONVERT_TO_STRING) {
  1379. return function ($this, pos) {
  1380. var S = toString_1(requireObjectCoercible($this));
  1381. var position = toIntegerOrInfinity(pos);
  1382. var size = S.length;
  1383. var first, second;
  1384. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1385. first = charCodeAt(S, position);
  1386. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1387. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  1388. ? CONVERT_TO_STRING
  1389. ? charAt$2(S, position)
  1390. : first
  1391. : CONVERT_TO_STRING
  1392. ? stringSlice$3(S, position, position + 2)
  1393. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1394. };
  1395. };
  1396. var stringMultibyte = {
  1397. // `String.prototype.codePointAt` method
  1398. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1399. codeAt: createMethod$1(false),
  1400. // `String.prototype.at` method
  1401. // https://github.com/mathiasbynens/String.prototype.at
  1402. charAt: createMethod$1(true)
  1403. };
  1404. var charAt$1 = stringMultibyte.charAt;
  1405. // `AdvanceStringIndex` abstract operation
  1406. // https://tc39.es/ecma262/#sec-advancestringindex
  1407. var advanceStringIndex = function (S, index, unicode) {
  1408. return index + (unicode ? charAt$1(S, index).length : 1);
  1409. };
  1410. var floor = Math.floor;
  1411. var charAt = functionUncurryThis(''.charAt);
  1412. var replace = functionUncurryThis(''.replace);
  1413. var stringSlice$2 = functionUncurryThis(''.slice);
  1414. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  1415. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  1416. // `GetSubstitution` abstract operation
  1417. // https://tc39.es/ecma262/#sec-getsubstitution
  1418. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  1419. var tailPos = position + matched.length;
  1420. var m = captures.length;
  1421. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1422. if (namedCaptures !== undefined) {
  1423. namedCaptures = toObject(namedCaptures);
  1424. symbols = SUBSTITUTION_SYMBOLS;
  1425. }
  1426. return replace(replacement, symbols, function (match, ch) {
  1427. var capture;
  1428. switch (charAt(ch, 0)) {
  1429. case '$': return '$';
  1430. case '&': return matched;
  1431. case '`': return stringSlice$2(str, 0, position);
  1432. case "'": return stringSlice$2(str, tailPos);
  1433. case '<':
  1434. capture = namedCaptures[stringSlice$2(ch, 1, -1)];
  1435. break;
  1436. default: // \d\d?
  1437. var n = +ch;
  1438. if (n === 0) return match;
  1439. if (n > m) {
  1440. var f = floor(n / 10);
  1441. if (f === 0) return match;
  1442. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  1443. return match;
  1444. }
  1445. capture = captures[n - 1];
  1446. }
  1447. return capture === undefined ? '' : capture;
  1448. });
  1449. };
  1450. var TypeError$2 = global_1.TypeError;
  1451. // `RegExpExec` abstract operation
  1452. // https://tc39.es/ecma262/#sec-regexpexec
  1453. var regexpExecAbstract = function (R, S) {
  1454. var exec = R.exec;
  1455. if (isCallable(exec)) {
  1456. var result = functionCall(exec, R, S);
  1457. if (result !== null) anObject(result);
  1458. return result;
  1459. }
  1460. if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
  1461. throw TypeError$2('RegExp#exec called on incompatible receiver');
  1462. };
  1463. var REPLACE = wellKnownSymbol('replace');
  1464. var max$1 = Math.max;
  1465. var min$1 = Math.min;
  1466. var concat = functionUncurryThis([].concat);
  1467. var push$2 = functionUncurryThis([].push);
  1468. var stringIndexOf = functionUncurryThis(''.indexOf);
  1469. var stringSlice$1 = functionUncurryThis(''.slice);
  1470. var maybeToString = function (it) {
  1471. return it === undefined ? it : String(it);
  1472. };
  1473. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1474. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1475. var REPLACE_KEEPS_$0 = (function () {
  1476. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  1477. return 'a'.replace(/./, '$0') === '$0';
  1478. })();
  1479. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1480. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1481. if (/./[REPLACE]) {
  1482. return /./[REPLACE]('a', '$0') === '';
  1483. }
  1484. return false;
  1485. })();
  1486. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1487. var re = /./;
  1488. re.exec = function () {
  1489. var result = [];
  1490. result.groups = { a: '7' };
  1491. return result;
  1492. };
  1493. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  1494. return ''.replace(re, '$<a>') !== '7';
  1495. });
  1496. // @@replace logic
  1497. fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  1498. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1499. return [
  1500. // `String.prototype.replace` method
  1501. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1502. function replace(searchValue, replaceValue) {
  1503. var O = requireObjectCoercible(this);
  1504. var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
  1505. return replacer
  1506. ? functionCall(replacer, searchValue, O, replaceValue)
  1507. : functionCall(nativeReplace, toString_1(O), searchValue, replaceValue);
  1508. },
  1509. // `RegExp.prototype[@@replace]` method
  1510. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1511. function (string, replaceValue) {
  1512. var rx = anObject(this);
  1513. var S = toString_1(string);
  1514. if (
  1515. typeof replaceValue == 'string' &&
  1516. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  1517. stringIndexOf(replaceValue, '$<') === -1
  1518. ) {
  1519. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  1520. if (res.done) return res.value;
  1521. }
  1522. var functionalReplace = isCallable(replaceValue);
  1523. if (!functionalReplace) replaceValue = toString_1(replaceValue);
  1524. var global = rx.global;
  1525. if (global) {
  1526. var fullUnicode = rx.unicode;
  1527. rx.lastIndex = 0;
  1528. }
  1529. var results = [];
  1530. while (true) {
  1531. var result = regexpExecAbstract(rx, S);
  1532. if (result === null) break;
  1533. push$2(results, result);
  1534. if (!global) break;
  1535. var matchStr = toString_1(result[0]);
  1536. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1537. }
  1538. var accumulatedResult = '';
  1539. var nextSourcePosition = 0;
  1540. for (var i = 0; i < results.length; i++) {
  1541. result = results[i];
  1542. var matched = toString_1(result[0]);
  1543. var position = max$1(min$1(toIntegerOrInfinity(result.index), S.length), 0);
  1544. var captures = [];
  1545. // NOTE: This is equivalent to
  1546. // captures = result.slice(1).map(maybeToString)
  1547. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1548. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1549. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1550. for (var j = 1; j < result.length; j++) push$2(captures, maybeToString(result[j]));
  1551. var namedCaptures = result.groups;
  1552. if (functionalReplace) {
  1553. var replacerArgs = concat([matched], captures, position, S);
  1554. if (namedCaptures !== undefined) push$2(replacerArgs, namedCaptures);
  1555. var replacement = toString_1(functionApply(replaceValue, undefined, replacerArgs));
  1556. } else {
  1557. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1558. }
  1559. if (position >= nextSourcePosition) {
  1560. accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
  1561. nextSourcePosition = position + matched.length;
  1562. }
  1563. }
  1564. return accumulatedResult + stringSlice$1(S, nextSourcePosition);
  1565. }
  1566. ];
  1567. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  1568. // `Object.prototype.toString` method implementation
  1569. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1570. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1571. return '[object ' + classof(this) + ']';
  1572. };
  1573. // `Object.prototype.toString` method
  1574. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1575. if (!toStringTagSupport) {
  1576. defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
  1577. }
  1578. // iterable DOM collections
  1579. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1580. var domIterables = {
  1581. CSSRuleList: 0,
  1582. CSSStyleDeclaration: 0,
  1583. CSSValueList: 0,
  1584. ClientRectList: 0,
  1585. DOMRectList: 0,
  1586. DOMStringList: 0,
  1587. DOMTokenList: 1,
  1588. DataTransferItemList: 0,
  1589. FileList: 0,
  1590. HTMLAllCollection: 0,
  1591. HTMLCollection: 0,
  1592. HTMLFormElement: 0,
  1593. HTMLSelectElement: 0,
  1594. MediaList: 0,
  1595. MimeTypeArray: 0,
  1596. NamedNodeMap: 0,
  1597. NodeList: 1,
  1598. PaintRequestList: 0,
  1599. Plugin: 0,
  1600. PluginArray: 0,
  1601. SVGLengthList: 0,
  1602. SVGNumberList: 0,
  1603. SVGPathSegList: 0,
  1604. SVGPointList: 0,
  1605. SVGStringList: 0,
  1606. SVGTransformList: 0,
  1607. SourceBufferList: 0,
  1608. StyleSheetList: 0,
  1609. TextTrackCueList: 0,
  1610. TextTrackList: 0,
  1611. TouchList: 0
  1612. };
  1613. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  1614. var classList = documentCreateElement('span').classList;
  1615. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  1616. var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  1617. var bind = functionUncurryThis(functionUncurryThis.bind);
  1618. // optional / simple context binding
  1619. var functionBindContext = function (fn, that) {
  1620. aCallable(fn);
  1621. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  1622. return fn.apply(that, arguments);
  1623. };
  1624. };
  1625. var push$1 = functionUncurryThis([].push);
  1626. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  1627. var createMethod = function (TYPE) {
  1628. var IS_MAP = TYPE == 1;
  1629. var IS_FILTER = TYPE == 2;
  1630. var IS_SOME = TYPE == 3;
  1631. var IS_EVERY = TYPE == 4;
  1632. var IS_FIND_INDEX = TYPE == 6;
  1633. var IS_FILTER_REJECT = TYPE == 7;
  1634. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1635. return function ($this, callbackfn, that, specificCreate) {
  1636. var O = toObject($this);
  1637. var self = indexedObject(O);
  1638. var boundFunction = functionBindContext(callbackfn, that);
  1639. var length = lengthOfArrayLike(self);
  1640. var index = 0;
  1641. var create = specificCreate || arraySpeciesCreate;
  1642. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  1643. var value, result;
  1644. for (;length > index; index++) if (NO_HOLES || index in self) {
  1645. value = self[index];
  1646. result = boundFunction(value, index, O);
  1647. if (TYPE) {
  1648. if (IS_MAP) target[index] = result; // map
  1649. else if (result) switch (TYPE) {
  1650. case 3: return true; // some
  1651. case 5: return value; // find
  1652. case 6: return index; // findIndex
  1653. case 2: push$1(target, value); // filter
  1654. } else switch (TYPE) {
  1655. case 4: return false; // every
  1656. case 7: push$1(target, value); // filterReject
  1657. }
  1658. }
  1659. }
  1660. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1661. };
  1662. };
  1663. var arrayIteration = {
  1664. // `Array.prototype.forEach` method
  1665. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1666. forEach: createMethod(0),
  1667. // `Array.prototype.map` method
  1668. // https://tc39.es/ecma262/#sec-array.prototype.map
  1669. map: createMethod(1),
  1670. // `Array.prototype.filter` method
  1671. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1672. filter: createMethod(2),
  1673. // `Array.prototype.some` method
  1674. // https://tc39.es/ecma262/#sec-array.prototype.some
  1675. some: createMethod(3),
  1676. // `Array.prototype.every` method
  1677. // https://tc39.es/ecma262/#sec-array.prototype.every
  1678. every: createMethod(4),
  1679. // `Array.prototype.find` method
  1680. // https://tc39.es/ecma262/#sec-array.prototype.find
  1681. find: createMethod(5),
  1682. // `Array.prototype.findIndex` method
  1683. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1684. findIndex: createMethod(6),
  1685. // `Array.prototype.filterReject` method
  1686. // https://github.com/tc39/proposal-array-filtering
  1687. filterReject: createMethod(7)
  1688. };
  1689. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1690. var method = [][METHOD_NAME];
  1691. return !!method && fails(function () {
  1692. // eslint-disable-next-line no-useless-call -- required for testing
  1693. method.call(null, argument || function () { return 1; }, 1);
  1694. });
  1695. };
  1696. var $forEach = arrayIteration.forEach;
  1697. var STRICT_METHOD$1 = arrayMethodIsStrict('forEach');
  1698. // `Array.prototype.forEach` method implementation
  1699. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1700. var arrayForEach = !STRICT_METHOD$1 ? function forEach(callbackfn /* , thisArg */) {
  1701. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1702. // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
  1703. } : [].forEach;
  1704. var handlePrototype = function (CollectionPrototype) {
  1705. // some Chrome versions have non-configurable methods on DOMTokenList
  1706. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1707. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1708. } catch (error) {
  1709. CollectionPrototype.forEach = arrayForEach;
  1710. }
  1711. };
  1712. for (var COLLECTION_NAME in domIterables) {
  1713. if (domIterables[COLLECTION_NAME]) {
  1714. handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
  1715. }
  1716. }
  1717. handlePrototype(domTokenListPrototype);
  1718. var RegExpPrototype$1 = RegExp.prototype;
  1719. var regexpGetFlags = function (R) {
  1720. var flags = R.flags;
  1721. return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwnProperty_1(R, 'flags') && objectIsPrototypeOf(RegExpPrototype$1, R)
  1722. ? functionCall(regexpFlags, R) : flags;
  1723. };
  1724. var PROPER_FUNCTION_NAME = functionName.PROPER;
  1725. var TO_STRING = 'toString';
  1726. var RegExpPrototype = RegExp.prototype;
  1727. var n$ToString = RegExpPrototype[TO_STRING];
  1728. var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1729. // FF44- RegExp#toString has a wrong name
  1730. var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
  1731. // `RegExp.prototype.toString` method
  1732. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1733. if (NOT_GENERIC || INCORRECT_NAME) {
  1734. defineBuiltIn(RegExp.prototype, TO_STRING, function toString() {
  1735. var R = anObject(this);
  1736. var pattern = toString_1(R.source);
  1737. var flags = toString_1(regexpGetFlags(R));
  1738. return '/' + pattern + '/' + flags;
  1739. }, { unsafe: true });
  1740. }
  1741. var $find = arrayIteration.find;
  1742. var FIND = 'find';
  1743. var SKIPS_HOLES = true;
  1744. // Shouldn't skip holes
  1745. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1746. // `Array.prototype.find` method
  1747. // https://tc39.es/ecma262/#sec-array.prototype.find
  1748. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1749. find: function find(callbackfn /* , that = undefined */) {
  1750. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1751. }
  1752. });
  1753. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1754. addToUnscopables(FIND);
  1755. var $filter = arrayIteration.filter;
  1756. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');
  1757. // `Array.prototype.filter` method
  1758. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1759. // with adding support of @@species
  1760. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1761. filter: function filter(callbackfn /* , thisArg */) {
  1762. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1763. }
  1764. });
  1765. var TypeError$1 = global_1.TypeError;
  1766. // `Assert: IsConstructor(argument) is true`
  1767. var aConstructor = function (argument) {
  1768. if (isConstructor(argument)) return argument;
  1769. throw TypeError$1(tryToString(argument) + ' is not a constructor');
  1770. };
  1771. var SPECIES = wellKnownSymbol('species');
  1772. // `SpeciesConstructor` abstract operation
  1773. // https://tc39.es/ecma262/#sec-speciesconstructor
  1774. var speciesConstructor = function (O, defaultConstructor) {
  1775. var C = anObject(O).constructor;
  1776. var S;
  1777. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
  1778. };
  1779. var Array$1 = global_1.Array;
  1780. var max = Math.max;
  1781. var arraySliceSimple = function (O, start, end) {
  1782. var length = lengthOfArrayLike(O);
  1783. var k = toAbsoluteIndex(start, length);
  1784. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1785. var result = Array$1(max(fin - k, 0));
  1786. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1787. result.length = n;
  1788. return result;
  1789. };
  1790. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
  1791. var MAX_UINT32 = 0xFFFFFFFF;
  1792. var min = Math.min;
  1793. var $push = [].push;
  1794. var exec = functionUncurryThis(/./.exec);
  1795. var push = functionUncurryThis($push);
  1796. var stringSlice = functionUncurryThis(''.slice);
  1797. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1798. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1799. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1800. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1801. var re = /(?:)/;
  1802. var originalExec = re.exec;
  1803. re.exec = function () { return originalExec.apply(this, arguments); };
  1804. var result = 'ab'.split(re);
  1805. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1806. });
  1807. // @@split logic
  1808. fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  1809. var internalSplit;
  1810. if (
  1811. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1812. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1813. 'test'.split(/(?:)/, -1).length != 4 ||
  1814. 'ab'.split(/(?:ab)*/).length != 2 ||
  1815. '.'.split(/(.?)(.?)/).length != 4 ||
  1816. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  1817. '.'.split(/()()/).length > 1 ||
  1818. ''.split(/.?/).length
  1819. ) {
  1820. // based on es5-shim implementation, need to rework it
  1821. internalSplit = function (separator, limit) {
  1822. var string = toString_1(requireObjectCoercible(this));
  1823. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1824. if (lim === 0) return [];
  1825. if (separator === undefined) return [string];
  1826. // If `separator` is not a regex, use native split
  1827. if (!isRegexp(separator)) {
  1828. return functionCall(nativeSplit, string, separator, lim);
  1829. }
  1830. var output = [];
  1831. var flags = (separator.ignoreCase ? 'i' : '') +
  1832. (separator.multiline ? 'm' : '') +
  1833. (separator.unicode ? 'u' : '') +
  1834. (separator.sticky ? 'y' : '');
  1835. var lastLastIndex = 0;
  1836. // Make `global` and avoid `lastIndex` issues by working with a copy
  1837. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1838. var match, lastIndex, lastLength;
  1839. while (match = functionCall(regexpExec, separatorCopy, string)) {
  1840. lastIndex = separatorCopy.lastIndex;
  1841. if (lastIndex > lastLastIndex) {
  1842. push(output, stringSlice(string, lastLastIndex, match.index));
  1843. if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
  1844. lastLength = match[0].length;
  1845. lastLastIndex = lastIndex;
  1846. if (output.length >= lim) break;
  1847. }
  1848. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1849. }
  1850. if (lastLastIndex === string.length) {
  1851. if (lastLength || !exec(separatorCopy, '')) push(output, '');
  1852. } else push(output, stringSlice(string, lastLastIndex));
  1853. return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
  1854. };
  1855. // Chakra, V8
  1856. } else if ('0'.split(undefined, 0).length) {
  1857. internalSplit = function (separator, limit) {
  1858. return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
  1859. };
  1860. } else internalSplit = nativeSplit;
  1861. return [
  1862. // `String.prototype.split` method
  1863. // https://tc39.es/ecma262/#sec-string.prototype.split
  1864. function split(separator, limit) {
  1865. var O = requireObjectCoercible(this);
  1866. var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
  1867. return splitter
  1868. ? functionCall(splitter, separator, O, limit)
  1869. : functionCall(internalSplit, toString_1(O), separator, limit);
  1870. },
  1871. // `RegExp.prototype[@@split]` method
  1872. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1873. //
  1874. // NOTE: This cannot be properly polyfilled in engines that don't support
  1875. // the 'y' flag.
  1876. function (string, limit) {
  1877. var rx = anObject(this);
  1878. var S = toString_1(string);
  1879. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  1880. if (res.done) return res.value;
  1881. var C = speciesConstructor(rx, RegExp);
  1882. var unicodeMatching = rx.unicode;
  1883. var flags = (rx.ignoreCase ? 'i' : '') +
  1884. (rx.multiline ? 'm' : '') +
  1885. (rx.unicode ? 'u' : '') +
  1886. (UNSUPPORTED_Y ? 'g' : 'y');
  1887. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1888. // simulate the 'y' flag.
  1889. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  1890. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1891. if (lim === 0) return [];
  1892. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1893. var p = 0;
  1894. var q = 0;
  1895. var A = [];
  1896. while (q < S.length) {
  1897. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  1898. var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
  1899. var e;
  1900. if (
  1901. z === null ||
  1902. (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  1903. ) {
  1904. q = advanceStringIndex(S, q, unicodeMatching);
  1905. } else {
  1906. push(A, stringSlice(S, p, q));
  1907. if (A.length === lim) return A;
  1908. for (var i = 1; i <= z.length - 1; i++) {
  1909. push(A, z[i]);
  1910. if (A.length === lim) return A;
  1911. }
  1912. q = p = e;
  1913. }
  1914. }
  1915. push(A, stringSlice(S, p));
  1916. return A;
  1917. }
  1918. ];
  1919. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  1920. var $map = arrayIteration.map;
  1921. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  1922. // `Array.prototype.map` method
  1923. // https://tc39.es/ecma262/#sec-array.prototype.map
  1924. // with adding support of @@species
  1925. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1926. map: function map(callbackfn /* , thisArg */) {
  1927. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1928. }
  1929. });
  1930. // `SameValue` abstract operation
  1931. // https://tc39.es/ecma262/#sec-samevalue
  1932. // eslint-disable-next-line es-x/no-object-is -- safe
  1933. var sameValue = Object.is || function is(x, y) {
  1934. // eslint-disable-next-line no-self-compare -- NaN check
  1935. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1936. };
  1937. // @@search logic
  1938. fixRegexpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
  1939. return [
  1940. // `String.prototype.search` method
  1941. // https://tc39.es/ecma262/#sec-string.prototype.search
  1942. function search(regexp) {
  1943. var O = requireObjectCoercible(this);
  1944. var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
  1945. return searcher ? functionCall(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString_1(O));
  1946. },
  1947. // `RegExp.prototype[@@search]` method
  1948. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  1949. function (string) {
  1950. var rx = anObject(this);
  1951. var S = toString_1(string);
  1952. var res = maybeCallNative(nativeSearch, rx, S);
  1953. if (res.done) return res.value;
  1954. var previousLastIndex = rx.lastIndex;
  1955. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  1956. var result = regexpExecAbstract(rx, S);
  1957. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  1958. return result === null ? -1 : result.index;
  1959. }
  1960. ];
  1961. });
  1962. var un$Join = functionUncurryThis([].join);
  1963. var ES3_STRINGS = indexedObject != Object;
  1964. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1965. // `Array.prototype.join` method
  1966. // https://tc39.es/ecma262/#sec-array.prototype.join
  1967. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1968. join: function join(separator) {
  1969. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  1970. }
  1971. });
  1972. /**
  1973. * @author: Dennis Hernández
  1974. * @webSite: http://djhvscf.github.io/Blog
  1975. * @update zhixin wen <wenzhixin2010@gmail.com>
  1976. */
  1977. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1978. var UtilsCookie = {
  1979. cookieIds: {
  1980. sortOrder: 'bs.table.sortOrder',
  1981. sortName: 'bs.table.sortName',
  1982. sortPriority: 'bs.table.sortPriority',
  1983. pageNumber: 'bs.table.pageNumber',
  1984. pageList: 'bs.table.pageList',
  1985. columns: 'bs.table.columns',
  1986. cardView: 'bs.table.cardView',
  1987. searchText: 'bs.table.searchText',
  1988. reorderColumns: 'bs.table.reorderColumns',
  1989. filterControl: 'bs.table.filterControl',
  1990. filterBy: 'bs.table.filterBy'
  1991. },
  1992. getCurrentHeader: function getCurrentHeader(that) {
  1993. return that.options.height ? that.$tableHeader : that.$header;
  1994. },
  1995. getCurrentSearchControls: function getCurrentSearchControls(that) {
  1996. return that.options.height ? 'table select, table input' : 'select, input';
  1997. },
  1998. isCookieSupportedByBrowser: function isCookieSupportedByBrowser() {
  1999. return navigator.cookieEnabled;
  2000. },
  2001. isCookieEnabled: function isCookieEnabled(that, cookieName) {
  2002. return that.options.cookiesEnabled.includes(cookieName);
  2003. },
  2004. setCookie: function setCookie(that, cookieName, cookieValue) {
  2005. if (!that.options.cookie || !UtilsCookie.isCookieEnabled(that, cookieName)) {
  2006. return;
  2007. }
  2008. return that._storage.setItem("".concat(that.options.cookieIdTable, ".").concat(cookieName), cookieValue);
  2009. },
  2010. getCookie: function getCookie(that, cookieName) {
  2011. if (!cookieName || !UtilsCookie.isCookieEnabled(that, cookieName)) {
  2012. return null;
  2013. }
  2014. return that._storage.getItem("".concat(that.options.cookieIdTable, ".").concat(cookieName));
  2015. },
  2016. deleteCookie: function deleteCookie(that, cookieName) {
  2017. return that._storage.removeItem("".concat(that.options.cookieIdTable, ".").concat(cookieName));
  2018. },
  2019. calculateExpiration: function calculateExpiration(cookieExpire) {
  2020. var time = cookieExpire.replace(/[0-9]*/, ''); // s,mi,h,d,m,y
  2021. cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, ''); // number
  2022. switch (time.toLowerCase()) {
  2023. case 's':
  2024. cookieExpire = +cookieExpire;
  2025. break;
  2026. case 'mi':
  2027. cookieExpire *= 60;
  2028. break;
  2029. case 'h':
  2030. cookieExpire = cookieExpire * 60 * 60;
  2031. break;
  2032. case 'd':
  2033. cookieExpire = cookieExpire * 24 * 60 * 60;
  2034. break;
  2035. case 'm':
  2036. cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
  2037. break;
  2038. case 'y':
  2039. cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
  2040. break;
  2041. default:
  2042. cookieExpire = undefined;
  2043. break;
  2044. }
  2045. if (!cookieExpire) {
  2046. return '';
  2047. }
  2048. var d = new Date();
  2049. d.setTime(d.getTime() + cookieExpire * 1000);
  2050. return d.toGMTString();
  2051. },
  2052. initCookieFilters: function initCookieFilters(bootstrapTable) {
  2053. setTimeout(function () {
  2054. var parsedCookieFilters = JSON.parse(UtilsCookie.getCookie(bootstrapTable, UtilsCookie.cookieIds.filterControl));
  2055. if (!bootstrapTable._filterControlValuesLoaded && parsedCookieFilters) {
  2056. var cachedFilters = {};
  2057. var header = UtilsCookie.getCurrentHeader(bootstrapTable);
  2058. var searchControls = UtilsCookie.getCurrentSearchControls(bootstrapTable);
  2059. var applyCookieFilters = function applyCookieFilters(element, filteredCookies) {
  2060. filteredCookies.forEach(function (cookie) {
  2061. var value = element.value.toString();
  2062. var text = cookie.text;
  2063. if (text === '' || element.type === 'radio' && value !== text) {
  2064. return;
  2065. }
  2066. if (element.tagName === 'INPUT' && element.type === 'radio' && value === text) {
  2067. element.checked = true;
  2068. cachedFilters[cookie.field] = text;
  2069. } else if (element.tagName === 'INPUT') {
  2070. element.value = text;
  2071. cachedFilters[cookie.field] = text;
  2072. } else if (element.tagName === 'SELECT' && bootstrapTable.options.filterControlContainer) {
  2073. element.value = text;
  2074. cachedFilters[cookie.field] = text;
  2075. } else if (text !== '' && element.tagName === 'SELECT') {
  2076. cachedFilters[cookie.field] = text;
  2077. var _iterator = _createForOfIteratorHelper(element),
  2078. _step;
  2079. try {
  2080. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  2081. var currentElement = _step.value;
  2082. if (currentElement.value === text) {
  2083. currentElement.selected = true;
  2084. return;
  2085. }
  2086. }
  2087. } catch (err) {
  2088. _iterator.e(err);
  2089. } finally {
  2090. _iterator.f();
  2091. }
  2092. var option = document.createElement('option');
  2093. option.value = text;
  2094. option.text = text;
  2095. element.add(option, element[1]);
  2096. element.selectedIndex = 1;
  2097. }
  2098. });
  2099. };
  2100. var filterContainer = header;
  2101. if (bootstrapTable.options.filterControlContainer) {
  2102. filterContainer = $__default["default"]("".concat(bootstrapTable.options.filterControlContainer));
  2103. }
  2104. filterContainer.find(searchControls).each(function () {
  2105. var field = $__default["default"](this).closest('[data-field]').data('field');
  2106. var filteredCookies = parsedCookieFilters.filter(function (cookie) {
  2107. return cookie.field === field;
  2108. });
  2109. applyCookieFilters(this, filteredCookies);
  2110. });
  2111. bootstrapTable.initColumnSearch(cachedFilters);
  2112. bootstrapTable._filterControlValuesLoaded = true;
  2113. bootstrapTable.initServer();
  2114. }
  2115. }, 250);
  2116. }
  2117. };
  2118. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  2119. cookie: false,
  2120. cookieExpire: '2h',
  2121. cookiePath: null,
  2122. cookieDomain: null,
  2123. cookieSecure: null,
  2124. cookieSameSite: 'Lax',
  2125. cookieIdTable: '',
  2126. cookiesEnabled: ['bs.table.sortOrder', 'bs.table.sortName', 'bs.table.sortPriority', 'bs.table.pageNumber', 'bs.table.pageList', 'bs.table.columns', 'bs.table.searchText', 'bs.table.filterControl', 'bs.table.filterBy', 'bs.table.reorderColumns', 'bs.table.cardView'],
  2127. cookieStorage: 'cookieStorage',
  2128. // localStorage, sessionStorage, customStorage
  2129. cookieCustomStorageGet: null,
  2130. cookieCustomStorageSet: null,
  2131. cookieCustomStorageDelete: null,
  2132. // internal variable
  2133. _filterControls: [],
  2134. _filterControlValuesLoaded: false,
  2135. _storage: {
  2136. setItem: undefined,
  2137. getItem: undefined,
  2138. removeItem: undefined
  2139. }
  2140. });
  2141. $__default["default"].fn.bootstrapTable.methods.push('getCookies');
  2142. $__default["default"].fn.bootstrapTable.methods.push('deleteCookie');
  2143. $__default["default"].extend($__default["default"].fn.bootstrapTable.utils, {
  2144. setCookie: UtilsCookie.setCookie,
  2145. getCookie: UtilsCookie.getCookie
  2146. });
  2147. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  2148. _inherits(_class, _$$BootstrapTable);
  2149. var _super = _createSuper(_class);
  2150. function _class() {
  2151. _classCallCheck(this, _class);
  2152. return _super.apply(this, arguments);
  2153. }
  2154. _createClass(_class, [{
  2155. key: "init",
  2156. value: function init() {
  2157. if (this.options.cookie) {
  2158. if (this.options.cookieStorage === 'cookieStorage' && !UtilsCookie.isCookieSupportedByBrowser()) {
  2159. throw new Error('Cookies are not enabled in this browser.');
  2160. }
  2161. this.configureStorage(); // FilterBy logic
  2162. var filterByCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterBy);
  2163. if (typeof filterByCookieValue === 'boolean' && !filterByCookieValue) {
  2164. throw new Error('The cookie value of filterBy must be a json!');
  2165. }
  2166. var filterByCookie = {};
  2167. try {
  2168. filterByCookie = JSON.parse(filterByCookieValue);
  2169. } catch (e) {
  2170. throw new Error('Could not parse the json of the filterBy cookie!');
  2171. }
  2172. this.filterColumns = filterByCookie ? filterByCookie : {}; // FilterControl logic
  2173. this._filterControls = [];
  2174. this._filterControlValuesLoaded = false;
  2175. this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ? this.options.cookiesEnabled.replace('[', '').replace(']', '').replace(/'/g, '').replace(/ /g, '').toLowerCase().split(',') : this.options.cookiesEnabled;
  2176. if (this.options.filterControl) {
  2177. var that = this;
  2178. this.$el.on('column-search.bs.table', function (e, field, text) {
  2179. var isNewField = true;
  2180. for (var i = 0; i < that._filterControls.length; i++) {
  2181. if (that._filterControls[i].field === field) {
  2182. that._filterControls[i].text = text;
  2183. isNewField = false;
  2184. break;
  2185. }
  2186. }
  2187. if (isNewField) {
  2188. that._filterControls.push({
  2189. field: field,
  2190. text: text
  2191. });
  2192. }
  2193. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that._filterControls));
  2194. }).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that));
  2195. }
  2196. }
  2197. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  2198. }
  2199. }, {
  2200. key: "initServer",
  2201. value: function initServer() {
  2202. var _get2;
  2203. if (this.options.cookie && this.options.filterControl && !this._filterControlValuesLoaded) {
  2204. var cookie = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.filterControl));
  2205. if (cookie) {
  2206. return;
  2207. }
  2208. }
  2209. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2210. args[_key] = arguments[_key];
  2211. }
  2212. (_get2 = _get(_getPrototypeOf(_class.prototype), "initServer", this)).call.apply(_get2, [this].concat(args));
  2213. }
  2214. }, {
  2215. key: "initTable",
  2216. value: function initTable() {
  2217. var _get3;
  2218. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2219. args[_key2] = arguments[_key2];
  2220. }
  2221. (_get3 = _get(_getPrototypeOf(_class.prototype), "initTable", this)).call.apply(_get3, [this].concat(args));
  2222. this.initCookie();
  2223. }
  2224. }, {
  2225. key: "onSort",
  2226. value: function onSort() {
  2227. var _get4;
  2228. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  2229. args[_key3] = arguments[_key3];
  2230. }
  2231. (_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
  2232. if (!this.options.cookie) {
  2233. return;
  2234. }
  2235. if (this.options.sortName === undefined || this.options.sortOrder === undefined) {
  2236. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName);
  2237. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder);
  2238. } else {
  2239. this.options.sortPriority = null;
  2240. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority);
  2241. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder);
  2242. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName);
  2243. }
  2244. }
  2245. }, {
  2246. key: "onMultipleSort",
  2247. value: function onMultipleSort() {
  2248. var _get5;
  2249. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2250. args[_key4] = arguments[_key4];
  2251. }
  2252. (_get5 = _get(_getPrototypeOf(_class.prototype), "onMultipleSort", this)).call.apply(_get5, [this].concat(args));
  2253. if (!this.options.cookie) {
  2254. return;
  2255. }
  2256. if (this.options.sortPriority === undefined) {
  2257. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortPriority);
  2258. } else {
  2259. this.options.sortName = undefined;
  2260. this.options.sortOrder = undefined;
  2261. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortName);
  2262. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds.sortOrder);
  2263. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortPriority, JSON.stringify(this.options.sortPriority));
  2264. }
  2265. }
  2266. }, {
  2267. key: "onPageNumber",
  2268. value: function onPageNumber() {
  2269. var _get6;
  2270. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2271. args[_key5] = arguments[_key5];
  2272. }
  2273. (_get6 = _get(_getPrototypeOf(_class.prototype), "onPageNumber", this)).call.apply(_get6, [this].concat(args));
  2274. if (!this.options.cookie) {
  2275. return;
  2276. }
  2277. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2278. }
  2279. }, {
  2280. key: "onPageListChange",
  2281. value: function onPageListChange() {
  2282. var _get7;
  2283. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2284. args[_key6] = arguments[_key6];
  2285. }
  2286. (_get7 = _get(_getPrototypeOf(_class.prototype), "onPageListChange", this)).call.apply(_get7, [this].concat(args));
  2287. if (!this.options.cookie) {
  2288. return;
  2289. }
  2290. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize);
  2291. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2292. }
  2293. }, {
  2294. key: "onPagePre",
  2295. value: function onPagePre() {
  2296. var _get8;
  2297. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2298. args[_key7] = arguments[_key7];
  2299. }
  2300. (_get8 = _get(_getPrototypeOf(_class.prototype), "onPagePre", this)).call.apply(_get8, [this].concat(args));
  2301. if (!this.options.cookie) {
  2302. return;
  2303. }
  2304. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2305. }
  2306. }, {
  2307. key: "onPageNext",
  2308. value: function onPageNext() {
  2309. var _get9;
  2310. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2311. args[_key8] = arguments[_key8];
  2312. }
  2313. (_get9 = _get(_getPrototypeOf(_class.prototype), "onPageNext", this)).call.apply(_get9, [this].concat(args));
  2314. if (!this.options.cookie) {
  2315. return;
  2316. }
  2317. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2318. }
  2319. }, {
  2320. key: "_toggleColumn",
  2321. value: function _toggleColumn() {
  2322. var _get10;
  2323. for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
  2324. args[_key9] = arguments[_key9];
  2325. }
  2326. (_get10 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get10, [this].concat(args));
  2327. if (!this.options.cookie) {
  2328. return;
  2329. }
  2330. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  2331. return column.field;
  2332. })));
  2333. }
  2334. }, {
  2335. key: "_toggleAllColumns",
  2336. value: function _toggleAllColumns() {
  2337. var _get11;
  2338. for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
  2339. args[_key10] = arguments[_key10];
  2340. }
  2341. (_get11 = _get(_getPrototypeOf(_class.prototype), "_toggleAllColumns", this)).call.apply(_get11, [this].concat(args));
  2342. if (!this.options.cookie) {
  2343. return;
  2344. }
  2345. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  2346. return column.field;
  2347. })));
  2348. }
  2349. }, {
  2350. key: "toggleView",
  2351. value: function toggleView() {
  2352. _get(_getPrototypeOf(_class.prototype), "toggleView", this).call(this);
  2353. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.cardView, this.options.cardView);
  2354. }
  2355. }, {
  2356. key: "selectPage",
  2357. value: function selectPage(page) {
  2358. _get(_getPrototypeOf(_class.prototype), "selectPage", this).call(this, page);
  2359. if (!this.options.cookie) {
  2360. return;
  2361. }
  2362. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page);
  2363. }
  2364. }, {
  2365. key: "onSearch",
  2366. value: function onSearch(event) {
  2367. _get(_getPrototypeOf(_class.prototype), "onSearch", this).call(this, event, arguments.length > 1 ? arguments[1] : true);
  2368. if (!this.options.cookie) {
  2369. return;
  2370. }
  2371. if (this.options.search) {
  2372. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText);
  2373. }
  2374. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2375. }
  2376. }, {
  2377. key: "initHeader",
  2378. value: function initHeader() {
  2379. var _get12;
  2380. if (this.options.reorderableColumns && this.options.cookie) {
  2381. this.columnsSortOrder = JSON.parse(UtilsCookie.getCookie(this, UtilsCookie.cookieIds.reorderColumns));
  2382. }
  2383. for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
  2384. args[_key11] = arguments[_key11];
  2385. }
  2386. (_get12 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get12, [this].concat(args));
  2387. }
  2388. }, {
  2389. key: "persistReorderColumnsState",
  2390. value: function persistReorderColumnsState(that) {
  2391. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.reorderColumns, JSON.stringify(that.columnsSortOrder));
  2392. }
  2393. }, {
  2394. key: "filterBy",
  2395. value: function filterBy() {
  2396. var _get13;
  2397. for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
  2398. args[_key12] = arguments[_key12];
  2399. }
  2400. (_get13 = _get(_getPrototypeOf(_class.prototype), "filterBy", this)).call.apply(_get13, [this].concat(args));
  2401. if (!this.options.cookie) {
  2402. return;
  2403. }
  2404. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns));
  2405. }
  2406. }, {
  2407. key: "initCookie",
  2408. value: function initCookie() {
  2409. var _this = this;
  2410. if (!this.options.cookie) {
  2411. return;
  2412. }
  2413. if (this.options.cookieIdTable === '' || this.options.cookieExpire === '') {
  2414. console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.');
  2415. this.options.cookie = false; // Make sure that the cookie extension is disabled
  2416. return;
  2417. }
  2418. var sortOrderCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortOrder);
  2419. var sortOrderNameCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortName);
  2420. var sortPriorityCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.sortPriority);
  2421. var pageNumberCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageNumber);
  2422. var pageListCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.pageList);
  2423. var searchTextCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.searchText);
  2424. var cardViewCookie = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.cardView);
  2425. var columnsCookieValue = UtilsCookie.getCookie(this, UtilsCookie.cookieIds.columns);
  2426. if (typeof columnsCookieValue === 'boolean' && !columnsCookieValue) {
  2427. throw new Error('The cookie value of filterBy must be a json!');
  2428. }
  2429. var columnsCookie = {};
  2430. try {
  2431. columnsCookie = JSON.parse(columnsCookieValue);
  2432. } catch (e) {
  2433. throw new Error('Could not parse the json of the columns cookie!', columnsCookieValue);
  2434. }
  2435. try {
  2436. sortPriorityCookie = JSON.parse(sortPriorityCookie);
  2437. } catch (e) {
  2438. throw new Error('Could not parse the json of the sortPriority cookie!', sortPriorityCookie);
  2439. }
  2440. if (!sortPriorityCookie) {
  2441. // sortOrder
  2442. this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder; // sortName
  2443. this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName;
  2444. } else {
  2445. this.options.sortOrder = undefined;
  2446. this.options.sortName = undefined;
  2447. } // sortPriority
  2448. this.options.sortPriority = sortPriorityCookie ? sortPriorityCookie : this.options.sortPriority;
  2449. if (this.options.sortOrder || this.options.sortName) {
  2450. // sortPriority
  2451. this.options.sortPriority = null;
  2452. } // pageNumber
  2453. this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber; // pageSize
  2454. this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize; // searchText
  2455. if (UtilsCookie.isCookieEnabled(this, 'bs.table.searchText') && this.options.searchText === '') {
  2456. this.options.searchText = searchTextCookie ? searchTextCookie : '';
  2457. } // cardView
  2458. this.options.cardView = cardViewCookie === 'true' ? cardViewCookie : false;
  2459. if (columnsCookie) {
  2460. var _iterator2 = _createForOfIteratorHelper(this.columns),
  2461. _step2;
  2462. try {
  2463. var _loop = function _loop() {
  2464. var column = _step2.value;
  2465. if (!column.switchable) {
  2466. return "continue";
  2467. }
  2468. column.visible = columnsCookie.filter(function (columnField) {
  2469. if (_this.isSelectionColumn(column)) {
  2470. return true;
  2471. }
  2472. /**
  2473. * This is needed for the old saved cookies or the table will show no columns!
  2474. * It can be removed in 2-3 Versions Later!!
  2475. * TODO: Remove this part some versions later e.g. 1.17.3
  2476. */
  2477. if (columnField instanceof Object) {
  2478. return columnField.field === column.field;
  2479. }
  2480. return columnField === column.field;
  2481. }).length > 0;
  2482. };
  2483. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  2484. var _ret = _loop();
  2485. if (_ret === "continue") continue;
  2486. }
  2487. } catch (err) {
  2488. _iterator2.e(err);
  2489. } finally {
  2490. _iterator2.f();
  2491. }
  2492. }
  2493. }
  2494. }, {
  2495. key: "getCookies",
  2496. value: function getCookies() {
  2497. var bootstrapTable = this;
  2498. var cookies = {};
  2499. $__default["default"].each(UtilsCookie.cookieIds, function (key, value) {
  2500. cookies[key] = UtilsCookie.getCookie(bootstrapTable, value);
  2501. if (key === 'columns') {
  2502. cookies[key] = JSON.parse(cookies[key]);
  2503. }
  2504. });
  2505. return cookies;
  2506. }
  2507. }, {
  2508. key: "deleteCookie",
  2509. value: function deleteCookie(cookieName) {
  2510. if (!cookieName) {
  2511. return;
  2512. }
  2513. UtilsCookie.deleteCookie(this, UtilsCookie.cookieIds[cookieName]);
  2514. }
  2515. }, {
  2516. key: "configureStorage",
  2517. value: function configureStorage() {
  2518. var that = this;
  2519. this._storage = {};
  2520. switch (this.options.cookieStorage) {
  2521. case 'cookieStorage':
  2522. this._storage.setItem = function (cookieName, cookieValue) {
  2523. document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
  2524. };
  2525. this._storage.getItem = function (cookieName) {
  2526. var value = "; ".concat(document.cookie);
  2527. var parts = value.split("; ".concat(cookieName, "="));
  2528. return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null;
  2529. };
  2530. this._storage.removeItem = function (cookieName) {
  2531. document.cookie = [encodeURIComponent(cookieName), '=', '; expires=Thu, 01 Jan 1970 00:00:00 GMT', that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
  2532. };
  2533. break;
  2534. case 'localStorage':
  2535. this._storage.setItem = function (cookieName, cookieValue) {
  2536. localStorage.setItem(cookieName, cookieValue);
  2537. };
  2538. this._storage.getItem = function (cookieName) {
  2539. return localStorage.getItem(cookieName);
  2540. };
  2541. this._storage.removeItem = function (cookieName) {
  2542. localStorage.removeItem(cookieName);
  2543. };
  2544. break;
  2545. case 'sessionStorage':
  2546. this._storage.setItem = function (cookieName, cookieValue) {
  2547. sessionStorage.setItem(cookieName, cookieValue);
  2548. };
  2549. this._storage.getItem = function (cookieName) {
  2550. return sessionStorage.getItem(cookieName);
  2551. };
  2552. this._storage.removeItem = function (cookieName) {
  2553. sessionStorage.removeItem(cookieName);
  2554. };
  2555. break;
  2556. case 'customStorage':
  2557. if (!this.options.cookieCustomStorageSet || !this.options.cookieCustomStorageGet || !this.options.cookieCustomStorageDelete) {
  2558. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  2559. }
  2560. this._storage.setItem = function (cookieName, cookieValue) {
  2561. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageSet, [cookieName, cookieValue], '');
  2562. };
  2563. this._storage.getItem = function (cookieName) {
  2564. return Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageGet, [cookieName], '');
  2565. };
  2566. this._storage.removeItem = function (cookieName) {
  2567. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageDelete, [cookieName], '');
  2568. };
  2569. break;
  2570. default:
  2571. throw new Error('Storage method not supported.');
  2572. }
  2573. }
  2574. }]);
  2575. return _class;
  2576. }($__default["default"].BootstrapTable);
  2577. }));