(self["webpackChunk"] = self["webpackChunk"] || []).push([["adminlte-index"],{

/***/ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/app.index.js":
/*!**********************************************************************************!*\
  !*** ../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/app.index.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_index_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.scss */ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.scss");



/***/ }),

/***/ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.js":
/*!******************************************************************************!*\
  !*** ../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

__webpack_require__(/*! core-js/modules/es.date.to-string.js */ "./node_modules/core-js/modules/es.date.to-string.js");

__webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");

__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js");

__webpack_require__(/*! core-js/modules/es.array.find.js */ "./node_modules/core-js/modules/es.array.find.js");

__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js");

__webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js");

__webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js");

__webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");

__webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js");

__webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js");

$(document).ready(function () {
  lcCrudIndexToggle();
  lcCrudIndexBatchActions();
  lcCrudIndexInitFilter();
});

function lcCrudIndexToggle() {
  var toggles = document.querySelectorAll('.custom-switch input[type="checkbox"]');

  for (i = 0; i < toggles.length; i++) {
    toggles[i].addEventListener('change', function () {
      var toggle = this;
      var newValue = this.checked;
      var oldValue = !newValue;
      var toggleUrl = this.closest('.custom-switch').dataset.url + "&newValue=" + newValue.toString();
      var toggleRequest = $.ajax({
        type: "POST",
        url: toggleUrl,
        data: {},
        dataType: 'json'
      });
      toggleRequest.done(function (response) {
        SovNotification.add('success', 'La propriété a bien été mise à jour.');
      });
      toggleRequest.fail(function () {
        toggle.checked = oldValue;
        toggle.disabled = true;
        toggle.closest('.checkbox-switch').classList.add('disabled');
        SovNotification.add('error', 'Une erreur est survenue.');
      });
    });
  }
}

function lcCrudIndexBatchActions() {
  var titleContent = $('.content-header-title > .title').html();
  $(document).on('click', '.deselect-batch-button', function () {
    $(this).closest('.content').find(':checkbox.form-batch-checkbox-all').prop('checked', false).trigger('change');
  });
  $(document).on('change', '.form-batch-checkbox-all', function () {
    $(this).closest('.content').find(':checkbox.form-batch-checkbox').prop('checked', $(this).prop('checked')).trigger('change');
  });
  $(document).on('change', '.form-batch-checkbox', function () {
    var $content = $(this).closest('.content-wrapper');
    var $input = $content.find(':hidden#batch_form_entityIds');
    var ids = $input.val() ? $input.val().split(',') : [];
    var id = $(this).val();

    if ($(this).prop('checked')) {
      $(this).closest('tr').addClass('selected-row');

      if (-1 === ids.indexOf(id)) {
        ids.push(id);
      }
    } else {
      $(this).closest('tr').removeClass('selected-row');
      ids = ids.filter(function (value) {
        return value !== id;
      });
      $content.find(':checkbox.form-batch-checkbox-all').prop('checked', false);
    }

    if (0 === ids.length) {
      $content.find('.global-actions').show();
      $content.find('.batch-actions').hide();
      $content.find('table').removeClass('table-batch');
    } else {
      $content.find('.batch-actions').show();
      $content.find('.global-actions').hide();
      $content.find('table').addClass('table-batch');
    }

    $input.val(ids.join(','));
    $content.find('.content-header-title > .title').html(0 === ids.length ? titleContent : '');
  });
  var modalTitle = $('#batch-action-confirmation-title');
  var titleContentWithPlaceholders = modalTitle.text();
  $('[data-action-batch]').on('click', function (event) {
    event.preventDefault();
    event.stopPropagation();
    var $actionElement = $(this);
    var actionName = $actionElement.attr('data-action-name');
    var selectedItems = $('input[type="checkbox"].form-batch-checkbox:checked');
    modalTitle.text(titleContentWithPlaceholders.replace('%action_name%', actionName).replace('%num_items%', selectedItems.length));
    $('#modal-batch-action').modal({
      backdrop: true,
      keyboard: true
    }).off('click', '#modal-batch-action-button').on('click', '#modal-batch-action-button', function () {
      $actionElement.unbind('click');
      $form = document.createElement('form');
      $form.setAttribute('action', $actionElement.attr('data-action-url'));
      $form.setAttribute('method', 'POST');
      $actionNameInput = document.createElement('input');
      $actionNameInput.setAttribute('type', 'hidden');
      $actionNameInput.setAttribute('name', 'batchActionName');
      $actionNameInput.setAttribute('value', $actionElement.attr('data-action-name'));
      $form.appendChild($actionNameInput);
      $entityFqcnInput = document.createElement('input');
      $entityFqcnInput.setAttribute('type', 'hidden');
      $entityFqcnInput.setAttribute('name', 'entityFqcn');
      $entityFqcnInput.setAttribute('value', $actionElement.attr('data-entity-fqcn'));
      $form.appendChild($entityFqcnInput);
      $actionUrlInput = document.createElement('input');
      $actionUrlInput.setAttribute('type', 'hidden');
      $actionUrlInput.setAttribute('name', 'batchActionUrl');
      $actionUrlInput.setAttribute('value', $actionElement.attr('data-action-url'));
      $form.appendChild($actionUrlInput);
      $csrfTokenInput = document.createElement('input');
      $csrfTokenInput.setAttribute('type', 'hidden');
      $csrfTokenInput.setAttribute('name', 'batchActionCsrfToken');
      $csrfTokenInput.setAttribute('value', $actionElement.attr('data-action-csrf-token'));
      $form.appendChild($csrfTokenInput);
      selectedItems.each(function (i, item) {
        $entityIdInput = document.createElement('input');
        $entityIdInput.setAttribute('type', 'hidden');
        $entityIdInput.setAttribute('name', "batchActionEntityIds[".concat(i, "]"));
        $entityIdInput.setAttribute('value', item.value);
        $form.appendChild($entityIdInput);
      });
      document.body.appendChild($form); //modalTitle.text(titleContentWithPlaceholders);

      $form.submit();
    });
  });
}

function lcCrudIndexInitFilter() {
  $('#filters_form_reset').val('');
  $('.lc-reset-filters').on('click', function (e) {
    //e.preventDefault();
    $(this).parents('.table-filters-line').find('select,input').val('').trigger('change');
    $('#filters_form_reset').val('clearAll');
    Tools.log($(this).prop('form'));
    $(this).prop('form').submit(); //$(this).parents('form').submit();
  });
}

/***/ }),

/***/ "./node_modules/core-js/internals/array-method-is-strict.js":
/*!******************************************************************!*\
  !*** ./node_modules/core-js/internals/array-method-is-strict.js ***!
  \******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");

module.exports = function (METHOD_NAME, argument) {
  var method = [][METHOD_NAME];
  return !!method && fails(function () {
    // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
    method.call(null, argument || function () { throw 1; }, 1);
  });
};


/***/ }),

/***/ "./node_modules/core-js/internals/classof.js":
/*!***************************************************!*\
  !*** ./node_modules/core-js/internals/classof.js ***!
  \***************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
var classofRaw = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");

var TO_STRING_TAG = wellKnownSymbol('toStringTag');
// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';

// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
  try {
    return it[key];
  } catch (error) { /* empty */ }
};

// getting tag from ES6+ `Object.prototype.toString`
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  var O, tag, result;
  return it === undefined ? 'Undefined' : it === null ? 'Null'
    // @@toStringTag case
    : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
    // builtinTag case
    : CORRECT_ARGUMENTS ? classofRaw(O)
    // ES3 arguments fallback
    : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
};


/***/ }),

/***/ "./node_modules/core-js/internals/object-to-string.js":
/*!************************************************************!*\
  !*** ./node_modules/core-js/internals/object-to-string.js ***!
  \************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");

// `Object.prototype.toString` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.tostring
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  return '[object ' + classof(this) + ']';
};


/***/ }),

/***/ "./node_modules/core-js/internals/to-string-tag-support.js":
/*!*****************************************************************!*\
  !*** ./node_modules/core-js/internals/to-string-tag-support.js ***!
  \*****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");

var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};

test[TO_STRING_TAG] = 'z';

module.exports = String(test) === '[object z]';


/***/ }),

/***/ "./node_modules/core-js/modules/es.array.index-of.js":
/*!***********************************************************!*\
  !*** ./node_modules/core-js/modules/es.array.index-of.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

/* eslint-disable es/no-array-prototype-indexof -- required for testing */
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
var $indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf;
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");

var nativeIndexOf = [].indexOf;

var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
var STRICT_METHOD = arrayMethodIsStrict('indexOf');

// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
    return NEGATIVE_ZERO
      // convert -0 to +0
      ? nativeIndexOf.apply(this, arguments) || 0
      : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  }
});


/***/ }),

/***/ "./node_modules/core-js/modules/es.array.join.js":
/*!*******************************************************!*\
  !*** ./node_modules/core-js/modules/es.array.join.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js");

var nativeJoin = [].join;

var ES3_STRINGS = IndexedObject != Object;
var STRICT_METHOD = arrayMethodIsStrict('join', ',');

// `Array.prototype.join` method
// https://tc39.es/ecma262/#sec-array.prototype.join
$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  join: function join(separator) {
    return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  }
});


/***/ }),

/***/ "./node_modules/core-js/modules/es.object.to-string.js":
/*!*************************************************************!*\
  !*** ./node_modules/core-js/modules/es.object.to-string.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
var toString = __webpack_require__(/*! ../internals/object-to-string */ "./node_modules/core-js/internals/object-to-string.js");

// `Object.prototype.toString` method
// https://tc39.es/ecma262/#sec-object.prototype.tostring
if (!TO_STRING_TAG_SUPPORT) {
  redefine(Object.prototype, 'toString', toString, { unsafe: true });
}


/***/ }),

/***/ "./node_modules/core-js/modules/es.regexp.to-string.js":
/*!*************************************************************!*\
  !*** ./node_modules/core-js/modules/es.regexp.to-string.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
var flags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js");

var TO_STRING = 'toString';
var RegExpPrototype = RegExp.prototype;
var nativeToString = RegExpPrototype[TO_STRING];

var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
// FF44- RegExp#toString has a wrong name
var INCORRECT_NAME = nativeToString.name != TO_STRING;

// `RegExp.prototype.toString` method
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
if (NOT_GENERIC || INCORRECT_NAME) {
  redefine(RegExp.prototype, TO_STRING, function toString() {
    var R = anObject(this);
    var p = String(R.source);
    var rf = R.flags;
    var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
    return '/' + p + '/' + f;
  }, { unsafe: true });
}


/***/ }),

/***/ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.scss":
/*!********************************************************************************!*\
  !*** ../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.scss ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ })

},
/******/ __webpack_require__ => { // webpackRuntimeModules
/******/ "use strict";
/******/ 
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
/******/ __webpack_require__.O(0, ["vendors-node_modules_core-js_internals_export_js","vendors-node_modules_core-js_modules_es_string_replace_js","vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-ca58f0"], () => (__webpack_exec__("../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/app.index.js")));
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 27828 characters]