/*! StateRestore 1.4.1
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from 'jquery';
import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
(function () {
'use strict';
var $$2;
var dataTable$1;
function setJQuery$1(jq) {
$$2 = jq;
dataTable$1 = jq.fn.dataTable;
}
var StateRestore = /** @class */ (function () {
function StateRestore(settings, opts, identifier, state, isPreDefined, successCallback) {
if (state === void 0) { state = undefined; }
if (isPreDefined === void 0) { isPreDefined = false; }
if (successCallback === void 0) { successCallback = function () { return null; }; }
// Check that the required version of DataTables is included
if (!dataTable$1 || !dataTable$1.versionCheck || !dataTable$1.versionCheck('1.10.0')) {
throw new Error('StateRestore requires DataTables 1.10 or newer');
}
// Check that Select is included
// eslint-disable-next-line no-extra-parens
if (!dataTable$1.Buttons) {
throw new Error('StateRestore requires Buttons');
}
var table = new dataTable$1.Api(settings);
this.classes = $$2.extend(true, {}, StateRestore.classes);
// Get options from user
this.c = $$2.extend(true, {}, StateRestore.defaults, opts);
this.s = {
dt: table,
identifier: identifier,
isPreDefined: isPreDefined,
savedState: null,
tableId: state && state.stateRestore ? state.stateRestore.tableId : undefined
};
this.dom = {
background: $$2('
'),
closeButton: $$2('×
'),
confirmation: $$2(''),
confirmationButton: $$2('