/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../_virtual/_rollupPluginBabelHelpers.js");var t=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};e.classCallCheck(this,t),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=n}return e.createClass(t,[{key:"openDB",value:function(e){var t=this,n=this,a=this.myDB.version||1,o=n.indexedDB.open(n.myDB.name,a);o.onerror=function(e){},o.onsuccess=function(a){t.myDB.db=a.target.result,e.call(n)},o.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,a=this.myDB.db.transaction(e,"readwrite").objectStore(e),o=0;o<t.length;o++)(n=a.add(t[o])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,a=this.myDB.db.transaction(e,"readwrite").objectStore(e),o=0;o<t.length;o++)(n=a.put(t[o])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var a=this,o=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);o.onerror=function(){n.call(a,null)},o.onsuccess=function(e){var t=e.target.result;n.call(a,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),t}();exports.default=t;