/*! * artplayer-tool-github.js v3.1.8 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2019 Harvey Zack * Released under the MIT License. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).ArtplayerToolGithub=t()}(this,function(){"use strict";var e,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};return function(e,t){e.exports=function(){var u=function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);te.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function x(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o>4,f[c++]=(15&r)<<4|o>>2,f[c++]=(3&o)<<6|63&i;return s}function F(e){var t,n=new Uint8Array(e),r="";for(t=0;t>2],r+=O[(3&n[t])<<4|n[t+1]>>4],r+=O[(15&n[t+1])<<2|n[t+2]>>6],r+=O[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var z={serialize:function(t,n){var e="";if(t&&(e=B.call(t)),t&&("[object ArrayBuffer]"===e||t.buffer&&"[object ArrayBuffer]"===B.call(t.buffer))){var r,o=D;t instanceof ArrayBuffer?(r=t,o+=R):(r=t.buffer,"[object Int8Array]"===e?o+="si08":"[object Uint8Array]"===e?o+="ui08":"[object Uint8ClampedArray]"===e?o+="uic8":"[object Int16Array]"===e?o+="si16":"[object Uint16Array]"===e?o+="ur16":"[object Int32Array]"===e?o+="si32":"[object Uint32Array]"===e?o+="ui32":"[object Float32Array]"===e?o+="fl32":"[object Float64Array]"===e?o+="fl64":n(new Error("Failed to get type for BinaryArray"))),n(o+F(r))}else if("[object Blob]"===e){var i=new FileReader;i.onload=function(){var e="~~local_forage_type~"+t.type+"~"+F(this.result);n(D+T+e)},i.readAsArrayBuffer(t)}else try{n(JSON.stringify(t))}catch(e){console.error("Couldn't convert value into a JSON string: ",t),n(null,e)}},deserialize:function(e){if(e.substring(0,L)!==D)return JSON.parse(e);var t,n=e.substring(C),r=e.substring(L,C);if(r===T&&A.test(n)){var o=n.match(A);t=o[1],n=n.substring(o[0].length)}var i=P(n);switch(r){case R:return i;case T:return s([i],{type:t});case"si08":return new Int8Array(i);case"ui08":return new Uint8Array(i);case"uic8":return new Uint8ClampedArray(i);case"si16":return new Int16Array(i);case"ur16":return new Uint16Array(i);case"si32":return new Int32Array(i);case"ui32":return new Uint32Array(i);case"fl32":return new Float32Array(i);case"fl64":return new Float64Array(i);default:throw new Error("Unkown type: "+r)}},stringToBuffer:P,bufferToString:F};function M(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function U(e,r,o,i,a,u){e.executeSql(o,i,a,function(e,n){n.code===n.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(e,t){t.rows.length?u(e,n):M(e,r,function(){e.executeSql(o,i,a,u)},u)},u):u(e,n)},u)}var q={_driver:"webSQLStorage",_initStorage:function(e){var r=this,o={db:null};if(e)for(var t in e)o[t]="string"!=typeof e[t]?e[t].toString():e[t];var n=new l(function(t,n){try{o.db=openDatabase(o.name,String(o.version),o.description,o.size)}catch(e){return n(e)}o.db.transaction(function(e){M(e,o,function(){r._dbInfo=o,t()},function(e,t){n(t)})},n)});return o.serializer=z,n},_support:"function"==typeof openDatabase,iterate:function(s,e){var t=this,n=new l(function(c,n){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(e){U(e,u,"SELECT * FROM "+u.storeName,[],function(e,t){for(var n=t.rows,r=n.length,o=0;o '__WebKitDatabaseInfoTable__'",[],function(e,t){for(var n=[],r=0;r