/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk"] = self["webpackChunk"] || []).push([["assets_js_global_js"],{

/***/ "./assets/js/global.js":
/*!*****************************!*\
  !*** ./assets/js/global.js ***!
  \*****************************/
/***/ (() => {

eval("function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction activeLoader() {\n  document.getElementById(\"loader\").style.display = \"block\";\n}\n// on vérifie que le global JS n'est chargé qu'une fois, notamment lors d'un refrechDiv\nif (window.hasOwnProperty('isGlobalJSLoaded')) {\n  window.stop();\n}\nwindow.isGlobalJSLoaded = true;\n\n/**\r\n * \r\n * @param callback : nom de la fonction à appeler\r\n * @param args : paramètres de la fonction \r\n * \t\t\t\t\t=> exemple lors d'envoi des paramètres en twig : \"['toto']\" \r\n * \t\t\t\t\t=> appel de la fonction depuis php, il faut changer les doubles quotes en quotes, exemple : myFunc(\".$myFunction.\", \".str_replace('\"',\"'\",$myParams).\")\r\n * Pour le JS direct il faut faire un appel de ce type : myFunc(test_msa, [\"test\"]);\r\n * Pour le JS direct , si il y a une variable contenant le nom de la fonction en question : myFunc(eval(fonction), [\"test\"]);\r\n */\nfunction myFunc(callback, args) {\n  callback.apply(this, args);\n}\nfunction transfertInformationAncienFramework(url, call) {\n  $(\"#lienHeader\").val(url);\n  $(\"#call\").val(call);\n  $(\"#formHeader\").submit();\n}\nfunction executeSRM(http, session) {\n  sAppQuery = \"ID_AUTO_SESSION=-A\" + session;\n  var sHREF = http + \"PublishedApplications/OxaSas/IPADE.application?\" + sAppQuery;\n  if (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)) {\n    $.ajax({\n      url: sHREF,\n      type: 'POST',\n      success: function success() {}\n    });\n  } else {\n    //document.write(\"Application query: \" + sHREF + \"<BR/>\");\n    window.location.href = sHREF;\n  }\n}\n/**\r\n * \r\n * function qui permet d'afficher des popups\r\n * @returns popup\r\n */\nfunction activePopup(title, body, classCss) {\n  var reload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n  if (title) {\n    document.getElementById('modal-title').innerHTML = title;\n  }\n  if (classCss) {\n    document.getElementById('modal-content').classList.add('modal_small');\n  }\n  if (body) {\n    // Jq.html is required here in order to execute <script> inside body\n    $(document.getElementById('modal-body')).html(body);\n  }\n\n  // Get the modal\n  var modal = document.getElementById('myModal');\n\n  // Get the button that opens the modal\n  var btn = document.getElementById(\"myBtn\");\n\n  // Get the <span> element that closes the modal\n  var span = document.getElementsByClassName(\"modal-close\")[0];\n\n  // When the user clicks the button, open the modal \n  //btn.onclick = function() {\n  modal.style.display = \"block\";\n\n  //\t    dragElement(document.getElementById((\"myModal\")));\n  //}\n\n  // When the user clicks on <span> (x), close the modal\n  span.onclick = function () {\n    modal.style.display = \"none\";\n  };\n  // Close the popoup with esc key \n  document.addEventListener('keydown', function (event) {\n    var key = event.key; // const {key} = event; in ES6+\n    if (key === \"Escape\") {\n      modal.style.display = \"none\";\n    }\n  });\n  if (reload) {\n    var modalObserver = new MutationObserver(function (mutations) {\n      mutations.forEach(function (mutation) {\n        if (mutation.attributeName === 'style') {\n          if (modal.style.display === 'none') {\n            window.location.reload();\n          }\n        }\n      });\n    });\n    var config = {\n      attributes: true,\n      childList: false,\n      subtree: false\n    };\n    modalObserver.observe(modal, config);\n  }\n\n  // When the user clicks anywhere outside of the modal, close it\n  //\twindow.onclick = function(event) {\n  //\t    if (event.target == modal) {\n  //\t        modal.style.display = \"none\";\n  //\t    }\n  //\t}\n\n  // PopUp draggable\n  $('#myModal .modal-content').css({\n    'top': '0',\n    'left': '0'\n  });\n  $('#myModal .modal-content').draggable({\n    handle: \".modal-header\"\n  });\n  $('.modal-header').removeClass('popup_informative');\n  $('.modal-header').removeClass('popup_error');\n  $('.modal-header').removeClass('popup_alert');\n\n  // TODO BAILA\n  //$('.infos_tooltip-learn').addClass('hiddenLearn');\n  //fin modal\n\n  // colorTrTable('#myModal');\n\n  return modal;\n}\nfunction ajaxDynamiqueTab(path, title, data) {\n  activeLoader();\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: data,\n    type: \"POST\",\n    statusCode: {\n      413: function _(xhr) {\n        desactiveLoader();\n        desactivePopup();\n        alert('Error - ModSecurity.');\n      },\n      500: function _(xhr) {\n        desactiveLoader();\n        desactivePopup();\n        alert('Internal Server Error.');\n      }\n    },\n    success: function success(result) {\n      activeHiddenDiv(title, result);\n    }\n  });\n}\nfunction activeHiddenDiv(title, body) {\n  desactiveLoader();\n  desactivePopup();\n  $('#mainAriane').nextAll().hide();\n  $('#mainAriane li').removeClass('active');\n  $('#arianeHidden').show();\n  $('#arianeHidden').addClass('active');\n  $('#divArianeHidden').show();\n  if (body) {\n    $('#divArianeHidden').html(body);\n  }\n  if (title) {\n    $('#textArianeHidden').html(title);\n  }\n  $('.hiddenAriane').show();\n}\nfunction desactiveHiddenDiv() {\n  $('#arianeHidden').hide();\n  $('#mainAriane').nextAll('div').show();\n  $('#mainAriane li:visible:last').addClass('active');\n  $('#textArianeHidden').html('');\n  $('#divArianeHidden').html('');\n  $('.hiddenAriane').hide();\n  jForm = undefined;\n}\nfunction activePopupError(title, body, classCss) {\n  var modal = activePopup(title, '', classCss);\n  modal.querySelector('#modal-body').innerHTML = '<div class=\"modal_erreur\">' + body + '</div>' + '<div class=\"modal-footer\">' + '<button type=\"button\" class=\"button secondaire\" ' + 'data-dismiss=\"modal\" onclick=\"desactivePopup ();\"' + '>' + window.oxaproc.trad['Fermer'] + '</button>' + '</div>';\n}\n\n//function draggable\n\nfunction dragElement(elmnt) {\n  var pos1 = 0,\n    pos2 = 0,\n    pos3 = 0,\n    pos4 = 0;\n  if (document.getElementById(elmnt.id + \"header\")) {\n    /* if present, the header is where you move the DIV from:*/\n    document.getElementById(elmnt.id + \"header\").onmousedown = dragMouseDown;\n  } else {\n    /* otherwise, move the DIV from anywhere inside the DIV:*/\n    elmnt.onmousedown = dragMouseDown;\n  }\n  function dragMouseDown(e) {\n    e = e || window.event;\n    // get the mouse cursor position at startup:\n    pos3 = e.clientX;\n    pos4 = e.clientY;\n    document.onmouseup = closeDragElement;\n    // call a function whenever the cursor moves:\n    document.onmousemove = elementDrag;\n  }\n  function elementDrag(e) {\n    e = e || window.event;\n    // calculate the new cursor position:\n    pos1 = pos3 - e.clientX;\n    pos2 = pos4 - e.clientY;\n    pos3 = e.clientX;\n    pos4 = e.clientY;\n    // set the element's new position:\n    elmnt.style.top = elmnt.offsetTop - pos2 + \"px\";\n    elmnt.style.left = elmnt.offsetLeft - pos1 + \"px\";\n  }\n  function closeDragElement() {\n    /* stop moving when mouse button is released:*/\n    document.onmouseup = null;\n    document.onmousemove = null;\n  }\n}\ndocument.addEventListener('click', function (event) {\n  var target = event.target;\n  if (!(target instanceof HTMLElement)) return;\n  if (!target.hasAttribute('data-dismiss') || target.getAttribute('data-dismiss') != 'modal') return;\n  desactivePopup();\n  return false;\n});\n\n// fin function draggable\n// TODO : Ajouter un timer sur la désactivation de la popup\nfunction desactivePopup() {\n  document.getElementById('myModal').style.display = \"none\";\n  $(\"#modal-content\").removeClass('modal_small');\n  $(\"#modal-content\").removeClass('modal_large');\n  $(\"#modal-title\").html('');\n  $(\"#modal-body\").html('');\n  $('iframe').not($('#bandeau > iframe')).show();\n  $('#wanteeedPanel').hide();\n}\nfunction triggerChangeEvent(element) {\n  element.dispatchEvent(new Event('change', {\n    bubbles: true,\n    detail: {\n      target: element\n    }\n  }));\n}\nfunction changeCodeLibelle(divCode, codeValue, divLibelle, libelleValue) {\n  if (libelleValue) {\n    var split_label = libelleValue.split(' (');\n    var label = split_label[0].toUpperCase();\n    var tooltip = $('#' + divCode).parent().find('.sec-label-tooltip');\n  }\n  if (divLibelle) {\n    if (libelleValue) {\n      $('#' + divLibelle).val(libelleValue);\n    } else {\n      $('#' + divLibelle).val(codeValue).change();\n    }\n    $('#' + divLibelle).removeClass('error white-tooltip');\n    $('#' + divLibelle).removeAttr(\"data-original-title\");\n  }\n  if (divCode) {\n    var _el = document.getElementById(divCode);\n    if (_el) {\n      $(_el).val(codeValue).blur();\n      triggerChangeEvent(_el);\n    }\n  }\n  if (libelleValue) {\n    $('#' + divCode).attr({\n      'data-libelle': label\n    });\n    if (tooltip.length > 0) {\n      tooltip.text(label);\n      $('#' + divCode).parent().addClass('white-tooltip');\n    }\n  }\n}\nfunction addEmailV2(input, mail, inputMail) {\n  mails = '';\n  if (input != '') {\n    mails += $('#' + inputMail).val() + \",\";\n  } else {\n    mails += $('#' + inputMail).val().trim() + mail.trim() + \",\";\n  }\n  $('#' + inputMail).val(mails);\n}\n\n// function removeDuplicates(array)\n// {\n// \treturn array.filter((value, index) => array.indexOf(value) === index);\n// }\n\nfunction fermerOnglet(idTrigger, idClose, iDivReset) {\n  //trigger l'onglet a afficher\n  if (idTrigger) {\n    $('#' + idTrigger).find('a').trigger('click');\n    $('#' + idClose).hide();\n    $('#' + iDivReset).html('');\n  }\n}\nfunction DisplayLoader() {\n  document.getElementById('loader').style.display = 'block';\n}\n\n/**\r\n * \r\n * function qui permet d'afficher des popups\r\n * @returns popup\r\n */\nfunction activeAlert() {\n  // Get the modal\n  var modal = document.getElementById('myModal');\n\n  // Get the button that opens the modal\n  var btn = document.getElementById(\"myBtn\");\n\n  // Get the <span> element that closes the modal\n  var span = document.getElementsByClassName(\"modal-close\")[0];\n\n  // When the user clicks the button, open the modal \n  btn.onclick = function () {\n    modal.style.display = \"block\";\n  };\n\n  // When the user clicks on <span> (x), close the modal\n  span.onclick = function () {\n    modal.style.display = \"none\";\n  };\n  // Close the popoup with esc key \n  span.addEventListener('keydown', function (event) {\n    var key = event.key; // const {key} = event; in ES6+\n    if (key === \"Escape\") {\n      modal.style.display = \"none\";\n    }\n  });\n\n  // When the user clicks anywhere outside of the modal, close it\n  //window.onclick = function(event) {\n  //    if (event.target == modal) {\n  //        modal.style.display = \"none\";\n  //    }\n  //}\n  //fin modal\n}\nfunction _ajaxPopup(path, title, divCode, divLibelle, params, width_popup) {\n  var reload = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;\n  if (path == null) throw 'Invalid path';\n  activeLoader();\n  var post = {\n    'divCode': divCode,\n    'divLibelle': divLibelle\n  };\n  post = $.extend(post, params);\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: post,\n    type: \"POST\",\n    statusCode: {\n      413: function _(xhr) {\n        desactiveLoader();\n        desactivePopup();\n        alert('Error - ModSecurity.');\n      },\n      500: function _(xhr) {\n        desactiveLoader();\n        desactivePopup();\n        alert('Internal Server Error.');\n      }\n    },\n    success: function success(result, textStatus, request) {\n      // Case : json popup\n      if (request.getResponseHeader('Content-Type') == 'application/json') {\n        var _data = JSON.parse(result);\n        if (_data.action != undefined) {\n          window.action[_data.action](request, null);\n          return;\n        }\n        window.action.successFormPopup(_data, textStatus, request);\n        desactiveLoader();\n        return;\n      }\n      if (width_popup == null || width_popup == '') width_popup = 'modal_small';\n      $(\"#modal-content\").removeClass('modal_large modal_small');\n      activePopup(title, result, width_popup, reload);\n      desactiveLoader();\n    },\n    error: function error(xhr) {\n      // Assume http 400 -> show constraint validation error\n      desactiveLoader();\n      activePopup('Erreur validation',\n      // TODO : translate\n      xhr.responseText, 'modal_small', reload);\n    }\n  });\n}\n/**\t\r\n * Pour tout les Pop-Up concernant les convertions tableau sous format CSV/PDF/WORD.. \r\n * @param path sur qu'elle vue on ce redirigera \r\n * @param title let itre de notre boite modal\r\n * @param idForm le formulaire qu'on va vouloir soumettre \r\n * @returns\r\n */\n\n//\n//function exportPop (path, title, idFom)\n//{\n//\tvar post = \"'idForm' : '\" + idForm + \"'\"; \n//\t\n//\n//\t$.ajax({\n//\t\tdataType : 'html', \n//\t\turl : path, \n//\t\tdata : $('#' + idForm), \n//\t\ttype: \"POST\", \n//\t\tsucess : function(result)\n//\t\t{\n//\t\t\t$(\"#modal-title\").html(title);\n//\t\t\t$(\"#modal-body\").html(result); \n//\t\t\tactivePopup();\n//\t\t\t\n//\t\t}\n//\t})\n//\t\n//}\n\n/**\t\r\n * La recherche en ajax sur un formulaire passer en paramètres\r\n * @param path (Le chemin de notr redirection de notre ajax)\r\n * @param div (Le contenue de la div qu'on cherche à modifier)\r\n * @param nomForm (Le nom de notre forumaire qu'on va envoyer)\r\n * @returns\r\n */\nfunction ajaxRechercheTableau(path, div, nomForm) {\n  if (path != '') {\n    activeLoader();\n    $.ajax({\n      url: path,\n      type: 'POST',\n      dataType: 'html',\n      data: $('#' + nomForm).serialize(),\n      success: function success(htmlData) {\n        desactiveLoader();\n        var result = $('<div />').append(htmlData).find('#' + div).html() + \"<script type='text/javascript' src='\" + baseUrl + \"js/parametre.js'></script>\";\n        $('#' + div).html(result);\n      }\n    });\n  }\n}\n\n/**\t\r\n * Rafraichir le menu lors d'un changement autormatique\r\n * @returns\r\n */\nfunction refreshNotification() {\n  $.ajax({\n    url: baseUrl + 'ajax/content/refresh-menu',\n    type: 'POST',\n    dataType: 'html',\n    success: function success(htmlData) {\n      var result = $('<div />').append(htmlData).find('#identification_client').html();\n      $('#identification_client').html(result);\n    }\n  });\n}\n\n/**\r\n * Le deploiement d'une infoBull coulissante \r\n * @param path (Le chemin de notre redirection de notre ajax\r\n * @param div (le contenue de la div qu'on va ajouter au depliement\r\n * @params (pour selectionner qu'elle éléments on va afficher )\r\n * @param idForm (Le boutton sur lequelles on va effectuer notre action)\r\n * @returns\r\n */\nfunction toggleSlide(path, div, params, idForm, tableHide, refresh) {\n  var children = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;\n  activeLoader();\n  if (idForm != '' && params == '') {\n    var data = $('#' + idForm).serialize();\n  } else {\n    var data = params;\n  }\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'html',\n    data: data,\n    success: function success(htmlData) {\n      desactiveLoader();\n      $('#' + div).html(htmlData + \"<script type='text/javascript' src='\" + baseUrl + \"js/parametre.js'></script>\");\n      index = div.replace('detail', '');\n      if ($('#' + index + 'detail').hasClass('hide_detail') || refresh) {\n        if (children === false) {\n          if (typeof tableHide !== \"undefined\" && tableHide != '') {\n            $('#' + tableHide + ' .detail_ligne').addClass('hide_detail');\n            $('#' + tableHide + ' tr').removeAttr('style');\n            // $('#'+tableHide+' .detail_ligne').removeAttr( 'style' );\n          } else {\n            $('.detail_ligne').addClass('hide_detail');\n            // $('.loupe').removeClass('actif');\n            $('table tr').removeAttr('style');\n          }\n        }\n        $('#' + index + 'detail').removeAttr('style');\n        // $('#'+index).children().addClass('actif');\n        $('#' + index + 'detail').removeClass('hide_detail');\n        $('#' + index).css({\n          'border': '2px solid rgba(102, 175, 233,0.9)',\n          'border-bottom': '0px',\n          'border-top': '2px solid rgba(102, 175, 233,0.9)',\n          'box-shadow': 'none'\n        });\n        $('#' + index + 'detail').css({\n          'background-color': 'rgba(74, 85, 107, 0.06)',\n          'border': '2px solid rgba(102, 175, 233,0.9)',\n          'border-top': '0px',\n          'border-bottom': '2px solid rgba(102, 175, 233,0.9)',\n          'box-shadow': 'none'\n        });\n      } else {\n        // $('#'+index).children().removeClass('actif');\n        $('#' + index + 'detail').addClass('hide_detail');\n        $('#' + index).removeAttr('style');\n        $('#' + index + 'detail').removeAttr('style');\n      }\n    }\n  });\n}\nfunction exportCsv(path, fileName, divForm, type) {\n  $(\"#typeExport\").val(type);\n  $(\"#exportDocument\").val('1');\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'html',\n    data: $('#' + divForm).serialize(),\n    success: function success(htmlData) {\n      $(\"#typeExport\").val('');\n      $(\"#exportDocument\").val('');\n    }\n  });\n}\n\n/**\r\n * Pour tout ce qui est des sousmission de formulaire en Ajax \r\n * @param path la vue sur laquelles on veux être redirigé lors de la soumissions\r\n * @param idForm l'id du formulaire qu'on veux soumettre \r\n * @returns\r\n */\nfunction formAjax(path, idForm) {\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'html',\n    data: $('#' + idForm).serialize(),\n    success: function success(htmlData) {\n      // Contenue à afficher lorsque le formulaire à bien été soumis \n      // TODO .. here\n    }\n  });\n}\n\n/** SI - CDC - SCA - CG **/\n\nfunction switchSIetDirectionOptionSelect() {\n  if ($('#input_selectOptionSietDirection').val() == 'si') {\n    $('#input_CODE_SI').val('');\n    $('#text_CODE_SI').val('');\n    $('#input_CODE_DIR').val('');\n    $('#text_CODE_DIR').val('');\n    $('#spanSi').show();\n    $('#spanDirection').hide();\n  } else {\n    $('#input_CODE_SI').val('');\n    $('#text_CODE_SI').val('');\n    $('#input_CODE_DIR').val('');\n    $('#text_CODE_DIR').val('');\n    $('#spanSi').hide();\n    $('#spanDirection').show();\n  }\n}\nfunction switchCDCetNAOptionSelect() {\n  if ($('#input_selectOptionCDCetNA').val() == 'cdc') {\n    $('#input_CODE_CDC').val('');\n    $('#text_CODE_CDC').val('');\n    $('#input_CODNAN').val('');\n    $('#text_CODNAN').val('');\n    $('#spanCdc').show();\n    $('#spanNa').hide();\n  } else {\n    $('#input_CODE_CDC').val('');\n    $('#text_CODE_CDC').val('');\n    $('#input_CODNAN').val('');\n    $('#text_CODNAN').val('');\n    $('#spanCdc').hide();\n    $('#spanNa').show();\n  }\n}\nfunction switchSCAetCAOptionSelect() {\n  if ($('#input_selectOptionSCAetCA').val() == 'sca') {\n    $('#input_CODE_SCA').val('');\n    $('#text_CODE_SCA').val('');\n    $('#input_CODE_CTA').val('');\n    $('#text_CODE_CTA').val('');\n    $('#spanSca').show();\n    $('#spanCa').hide();\n  } else {\n    $('#input_CODE_SCA').val('');\n    $('#text_CODE_SCA').val('');\n    $('#input_CODE_CTA').val('');\n    $('#text_CODE_CTA').val('');\n    $('#spanSca').hide();\n    $('#spanCa').show();\n  }\n}\nfunction affichageCG(path, inputSI, divCG, div2addMargin, inputSociete) {\n  if (div2addMargin != '') {\n    $('#' + div2addMargin).removeClass('margin10');\n  }\n  if ($('#' + inputSI).val() != '') {\n    $.ajax({\n      url: path,\n      type: 'POST',\n      dataType: 'JSON',\n      data: {\n        'CODE_SI': $('#' + inputSI).val(),\n        'CODE_STE': $('#' + inputSociete).val()\n      },\n      success: function success(json) {\n        $('#' + divCG + ' input').val('');\n        if (json.saisie) {\n          $('#' + divCG).show();\n          if (div2addMargin != '') {\n            $('#' + div2addMargin).addClass('margin10');\n          }\n        } else {\n          $('#' + divCG).hide();\n        }\n      }\n    });\n  } else {\n    $('#' + divCG + ' input').val('');\n    $('#' + divCG).hide();\n  }\n}\nfunction choixCG(path, inputCG, cgParId, affichagelibelle) {\n  idCG = $('#treeview li.node-selected').find('a').attr('href').substr(1);\n  if (idCG != '') {\n    $.ajax({\n      url: path,\n      type: 'POST',\n      dataType: 'JSON',\n      data: {\n        'idCG': idCG\n      },\n      success: function success(json) {\n        // Si le paramétrage CODE_GESTION_PAR_ID == 1, la valeur à prendre est CODE_GES, sinon CODE_AFF\n        if (cgParId) {\n          inputValue = json.CODE_GES;\n        } else {\n          inputValue = json.CODE_AFF;\n        }\n        if (affichagelibelle == '1') {\n          textValue = json.LIB_GES + ' (' + json.CODE_AFF + ')';\n        } else {\n          textValue = json.CODE_AFF;\n        }\n\n        // [Dossier n°34705]\n        var input_parent_id = $('#text_' + inputCG).parent().attr('id');\n        var custom_tooltip = $('#' + input_parent_id).parent().find('.sec-label-tooltip');\n        if (custom_tooltip.length > 0) {\n          custom_tooltip.text(json.LIB_GES);\n          $('#' + input_parent_id).parent().addClass('white-tooltip');\n        }\n        $('#input_' + inputCG).val(inputValue).removeClass(\"error white-tooltip\").attr(\"data-original-title\", '').trigger('change');\n        $('#text_' + inputCG).val(textValue).removeClass(\"error white-tooltip\").attr(\"data-original-title\", '');\n        desactivePopup();\n      }\n    });\n  }\n}\n\n/** Fonction permettant de charger l'ID_CG et de changer le code saisie du Code Gestion par son libellé **/\nfunction convertLibelleCodeGestion(path, object, CodeBDD, LibelleBDD, inputCode, inputText, CODE_STE, NUM_LOT, CODE_SI, input_SI, affichageLibelle, nonAffichageCode) {\n  value = object.value;\n  if (input_SI != '') {\n    CODE_SI = $('#' + input_SI).val();\n  }\n  paramAjax = {\n    'value': value,\n    'CodeBDD': CodeBDD,\n    'LibelleBDD': LibelleBDD,\n    'filter_egal_NUM_LOT': NUM_LOT,\n    'filter_egal_CODE_SI': CODE_SI,\n    'affichageLibelle': affichageLibelle\n  };\n  if (CODE_STE != null) {\n    paramAjax = $.extend(paramAjax, {\n      'filter_egal_CODE_STE': CODE_STE\n    });\n    ;\n  }\n  $.ajax({\n    dataType: 'html',\n    data: paramAjax,\n    url: path,\n    type: 'POST',\n    // la méthode indiquée dans le formulaire (get ou post)\n    success: function success(data) {\n      // je récupère la réponse du fichier PHP\n      data = data.split(\"$$\");\n      if (data[0] == '') data[0] = value;\n      if (data[1] == '') data[1] = value;\n      var libelle = '';\n      if (data[2] && affichageLibelle) {\n        if (nonAffichageCode) {\n          libelle = data[2];\n        } else {\n          libelle = data[2] + ' (' + data[1] + ')';\n        }\n      } else {\n        libelle = data[1];\n      }\n      var input_parent_id = $('#' + inputText).parent().attr('id');\n      var custom_tooltip = $('#' + input_parent_id).parent().find('.sec-label-tooltip');\n      if (custom_tooltip.length > 0) {\n        custom_tooltip.text(libelle);\n        $('#' + input_parent_id).parent().addClass('white-tooltip');\n      }\n      $('#' + inputCode).val(data[0]).change();\n      $('#' + inputText).val(libelle);\n      desactiveLoader();\n    }\n  });\n}\n\n/**** IBAN ****/\nfunction pressCleIban(inputIBANCLE, inputIBANCPT) {\n  if (inputIBANCLE.val().length == 2) {\n    inputIBANCPT.focus();\n  }\n}\nfunction formatNombre(nombre, separateur) {\n  nombre += '';\n  var valeur = nombre.replace(',', '.').split('.');\n  valeur[0] = valeur[0] || '0';\n  valeur[1] = valeur[1] || '00';\n  var reg = /(\\d+)(\\d{3})/;\n  while (reg.test(valeur[0])) {\n    valeur[0] = valeur[0].replace(reg, '$1' + separateur + '$2');\n  }\n  return valeur.join('.');\n}\nfunction detail(path, id, idLigne) {\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: {\n      'id': id\n    },\n    type: \"POST\",\n    success: function success(result) {\n      $('#' + idLigne + id + 'detail').html(result);\n    }\n  });\n}\nfunction supprimerFiltre(key, nomForm) {\n  if (key != '') {\n    if ($(\"#input_\" + key)) $(\"#input_\" + key).val(\"\");\n    if ($(\"#\" + key)) $(\"#\" + key).val(\"\");\n  }\n  $('#' + nomForm).submit();\n}\nfunction addFiltre(key, value, nomForm) {\n  $('#' + key).val(value);\n  $('#' + nomForm).append('<input type=\"hidden\" name=\"initOnglet\" id=\"initOnglet\" value=\"1\"/>');\n  $('#' + nomForm).submit();\n}\n\n/**\r\n * @deprecated use [data-checkall-input] instead\r\n */\nfunction checkout(id, idBox) {\n  if ($(\"#\" + idBox).is(':checked')) {\n    $(\".\" + id).prop('checked', true);\n  } else {\n    $(\".\" + id).prop('checked', false);\n  }\n}\n\n//_____________________________________________________________________________\n// Checkall\n\ndocument.addEventListener('change', function (event) {\n  if (!event.target.hasAttribute('data-checkall-input')) return;\n  var checked = event.target.checked;\n  var checkallId = event.target.getAttribute('data-checkall-input');\n  var _iterator = _createForOfIteratorHelper(document.querySelectorAll('[data-checkall=\"' + checkallId + '\"]')),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      el = _step.value;\n      el.checked = checked;\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n});\n\n/**\r\n * Uncheck parent input when one of its child is unchecked \r\n */\ndocument.addEventListener('change', function (event) {\n  if (!event.target.hasAttribute('data-checkall') || event.target.checked == true) {\n    return;\n  }\n  var checkallId = event.target.getAttribute('data-checkall');\n  if (event.target.checked == false) {\n    document.querySelector('[data-checkall-input=\"' + checkallId + '\"]').checked = false;\n  }\n});\n\n//_____________________________________________________________________________\n\n/** Fonction permettant de changer le code saisie dans un Zoom par son libellé **/\nfunction ConvertLibelle(path, object, Entity, CodeBDD, LibelleBDD, inputCode, inputText, remplissage, saisieCode, param, codeOnly) {\n  value = object.value;\n\n  // Reset code\n  $('#' + inputCode).val('');\n  paramAjax = {\n    'value': value,\n    'Entity': Entity,\n    'CodeBDD': CodeBDD,\n    'LibelleBDD': LibelleBDD\n  };\n  if (param != undefined && param != '') {\n    paramAjax = $.extend(paramAjax, param);\n  }\n  $.ajax({\n    dataType: 'html',\n    data: paramAjax,\n    url: path,\n    type: 'POST',\n    // la méthode indiquée dans le formulaire (get ou post)\n    success: function success(data) {\n      // je récupère la réponse du fichier PHP\n\n      $inputCode = $('#' + inputCode);\n      $inputText = $('#' + inputText);\n      data = data.split(\"$$\");\n      if (data[0] == '') data[0] = value;\n      if (data[1] == '') data[1] = value;\n      if (saisieCode) {\n        $inputCode.val(data[0]);\n        $inputText.val(data[1] ? data[1] + ' (' + data[0] + ')' : '').change();\n        return;\n      }\n      if (!remplissage) {\n        $inputCode.val(data[0]).change();\n        $inputText.val(data[1] ? data[1] + ' (' + data[0] + ')' : '');\n      } else {\n        $inputCode.val(data[1]).change();\n        $inputText.val(codeOnly ? data[0] : data[0] + ' (' + data[1] + ')');\n      }\n      desactiveLoader();\n    }\n  });\n}\n/** FONCTION POPUP ERREUR **/\n/**\r\n * @TODO : can be replaced ?\r\n */\nfunction activePopupErreur(path, titre, value, urlErreur, params, enteteTableau, pathArret) {\n  activeLoader();\n  if (params == null) {\n    params = '';\n  }\n  if (enteteTableau == null) {\n    enteteTableau = '';\n  }\n  if (pathArret == null) {\n    pathArret = '';\n  }\n  $(document).ready(function () {\n    $.ajax({\n      url: path,\n      data: {\n        'Erreur': value,\n        'Path': urlErreur,\n        'params': params,\n        'enteteTableau': enteteTableau,\n        'pathArret': pathArret\n      },\n      type: \"POST\",\n      success: function success(result) {\n        desactiveLoader();\n        document.getElementById('modal-content').classList.add('modal_small');\n        document.getElementById('modal-title').innerHTML = titre;\n        // TODO : remove script tag from ajax and use ``document.getElementById('modal-body').innerHTML = result;``\n        $('#modal-body').html(result);\n        activePopup();\n        $('.modal-header').addClass('popup_error');\n      }\n    });\n  });\n}\n\n/** FONCTION POPUP ERREUR **/\nfunction activePopupInformation(path, titre, value, urlErreur, params, enteteTableau, pathArret, message) {\n  activeLoader();\n  if (params == null) {\n    params = '';\n  }\n  if (enteteTableau == null) {\n    enteteTableau = '';\n  }\n  if (pathArret == null) {\n    pathArret = '';\n  }\n  $(document).ready(function () {\n    $.ajax({\n      url: path,\n      data: {\n        'Erreur': value,\n        'Path': urlErreur,\n        'params': params,\n        'enteteTableau': enteteTableau,\n        'pathArret': pathArret,\n        'message': message\n      },\n      type: \"POST\",\n      success: function success(result) {\n        desactiveLoader();\n        $(\"#modal-content\").addClass(\"modal_small\");\n        $(\"#modal-title\").html(titre);\n        $(\"#modal-body\").html(result);\n        activePopup();\n      }\n    });\n  });\n}\n/** gestion des fournisseurs **/\nfunction exportListeFournisseur(path) {\n  document.getElementById(\"loader\").style.display = \"block\";\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    type: \"POST\",\n    data: $('#filtre_fournisseur').serialize(),\n    success: function success(result) {\n      document.getElementById(\"loader\").style.display = \"none\";\n      window.open(result, '_blank');\n    }\n  });\n}\n/******* FIN FOURNISSEUR ************/\n\n/**************** MARCHE ************/\nfunction changeCreateur(input2Change) {\n  $('#' + input2Change).val($('#loginUtilisateur').text());\n}\n/************ FIN MARCHE ************/\n\n/* Popup de confirmation */\nfunction ajaxValidationPopupRedirect(path, form) {\n  activeLoader();\n  $.ajax({\n    url: path,\n    type: 'POST',\n    data: $('#' + form).serialize(),\n    success: function success(data) {\n      desactiveLoader();\n      $(\"#modal-content\").addClass(\"modal_small\");\n      $(\"#modal-body\").html(data);\n      $(\"#modal-title\").html('Erreur validation');\n      activePopup();\n    },\n    error: function error(data) {\n      var data = jQuery.parseJSON(data.responseText);\n      window.location.href = data.path;\n    }\n  });\n}\n;\n/**\r\n * ID -> Entity ou Reload selon le controller qui suivra\r\n * **/\nfunction popupConfirmation(path, id, URL, message, div, option, loader, popup, form, onclick, refresh, div_refresh, form_refresh, iconePopup, title, withOutPopup, reload) {\n  desactivePopup();\n  activeLoader();\n  if (div == undefined) div = \"content_tableau\";\n  $(document).ready(function () {\n    $.ajax({\n      dataType: 'html',\n      url: path,\n      data: {\n        'Path': URL,\n        'Message': message,\n        'Entity': id,\n        'div': div,\n        'option': option,\n        'loader': loader,\n        'popup': popup,\n        'form': form,\n        'onclick': onclick,\n        'refresh': refresh,\n        'div_refresh': div_refresh,\n        'form_refresh': form_refresh,\n        'iconePopup': iconePopup,\n        'withOutPopup': withOutPopup,\n        'reload': reload\n      },\n      type: \"POST\",\n      success: function success(result) {\n        desactiveLoader();\n        $(\"#modal-content\").addClass(\"modal_small\");\n        $(\"#modal-title\").html(title);\n        $(\"#modal-body\").html(result);\n        activePopup();\n      }\n    });\n  });\n}\nfunction popupConfirmSimple(title, textContent, action, payload, fnCallback) {\n  // TODO : translate\n  activePopup(title, \"<div class=\\\"modal-body bs-row flex-y-center\\\">\\n            <div class=\\\"icone-modal interrogation\\\"></div>\\n            <div class=\\\"bs-col p-base\\\">\".concat(textContent, \"</div>\\n        </div>\\n        <div class=\\\"modal-footer\\\">\\n            <button type=\\\"button\\\" class=\\\"button secondaire\\\" \\n                data-dismiss=\\\"modal\\\" \\n                onclick=\\\"desactivePopup();\\\"\\n            >\").concat(window.oxaproc.trad['Annuler'], \"</button>\\n            <button type=\\\"button\\\" class=\\\"button principal\\\" data-popupconfirm-btnconfirm>\\n                \").concat(window.oxaproc.trad['Confirmer'], \"\\n            </button>\\n        </div>\"), 'modal_small');\n  var btn = document.querySelector('[data-popupconfirm-btnconfirm]');\n  btn.addEventListener('click', function () {\n    activeLoader();\n    $.ajax({\n      url: action,\n      data: payload,\n      type: \"POST\",\n      success: fnCallback\n    });\n  });\n}\n\n/* Gestion entity */\nfunction ajouterEntity(path, entity, div) {\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: {\n      'entity': entity\n    },\n    type: \"POST\",\n    success: function success(result) {\n      refrechDiv(window.location.pathname, div);\n      desactivePopup();\n    }\n  });\n}\n/* ****** */\nfunction AjaxGestion(path, div, params, popup, form) {\n  activeLoader();\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    type: \"POST\",\n    data: {\n      'option': params\n    },\n    success: function success(result) {\n      desactiveLoader();\n      if (div == 'page') window.location.reload();else if (popup == 'true') {\n        $(\"#modal-content\").addClass(\"modal_small\");\n        $(\"#modal-title\").html('');\n        $(\"#modal-body\").html(result);\n        activePopup();\n        refrechDiv(window.location.pathname, div, form);\n      } else {\n        refrechDiv(window.location.pathname, div, form);\n      }\n    }\n  });\n}\nfunction AjaxTypeAchat(path, typeAchat) {\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: {\n      'typeAchat': typeAchat\n    },\n    type: \"POST\",\n    success: function success(result) {\n      //$('#content_tableau').html(result);\n      window.location.reload();\n    }\n  });\n}\n/**Export CSV **/\nfunction exportCSV(path, nomFormulaire) {\n  document.getElementById(\"loader\").style.display = \"block\";\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    type: \"POST\",\n    data: $('#' + nomFormulaire).serialize(),\n    success: function success(result) {\n      document.getElementById(\"loader\").style.display = \"none\";\n      window.open(result, '_blank');\n    }\n  });\n}\nfunction exportCSV2(path, nomFormulaire, pathInformation, pathPopupCreatFic) {\n  activeLoader();\n  var myForm = $('#' + nomFormulaire).serializeArray();\n  myForm.push({\n    name: 'exportPathAction',\n    value: path\n  });\n  jQuery.ajax({\n    url: pathPopupCreatFic,\n    type: 'POST',\n    dataType: 'HTML',\n    data: myForm,\n    success: function success(data) {\n      desactiveLoader();\n      var convert = jQuery.parseJSON(data);\n      activePopupInformation(pathInformation, 'Informations', \"\", \"\", \"\", \"\", \"\", convert.msgInfo);\n    }\n  });\n}\nfunction exportCSVWsdl(path, nomFormulaire, pathErreur) {\n  document.getElementById(\"loader\").style.display = \"block\";\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'JSON',\n    data: $('#' + nomFormulaire).serialize(),\n    success: function success(json) {\n      document.getElementById(\"loader\").style.display = \"none\";\n      if (json.statut == 'O') {\n        window.open(json.url, '_blank');\n      } else {\n        activePopupErreur(pathErreur, '', json.erreur);\n      }\n    }\n  });\n}\nfunction openPdf(path, nomFormulaire, pathErreur) {\n  document.getElementById(\"loader\").style.display = \"block\";\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'JSON',\n    data: $('#' + nomFormulaire).serialize(),\n    success: function success(json) {\n      document.getElementById(\"loader\").style.display = \"none\";\n      if (json.statut == 'O') {\n        window.open(json.url, '_blank');\n      } else {\n        activePopupErreur(pathErreur, '', json.erreur);\n      }\n    }\n  });\n}\n\n/** gestion session **/\nfunction objectifyForm(formArray) {\n  var returnArray = {};\n  for (var i = 0; i < formArray.length; i++) {\n    returnArray[formArray[i]['name']] = formArray[i]['value'];\n  }\n  return returnArray;\n}\nfunction lastSetSessionModule(path, form) {\n  var form = $(\"#\" + form).serializeArray();\n  form = objectifyForm(form);\n  form = JSON.stringify(form);\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: {\n      'form': form\n    },\n    type: \"POST\",\n    success: function success(result) {}\n  });\n}\nfunction setSessionModule(path, form) {\n  var form = $(\"#\" + form).serialize();\n  form = JSON.stringify(form);\n  $.ajax({\n    contentType: \"text/plain; charset=utf-8\",\n    processData: false,\n    url: path,\n    data: form,\n    type: \"POST\",\n    success: function success(result) {\n      console.log(result);\n    }\n  });\n}\nfunction unsetSession(path, module, redirection) {\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    type: \"POST\",\n    data: {\n      'module': module,\n      'redirection': redirection\n    },\n    success: function success(result) {\n      window.location.href = result;\n    }\n  });\n}\nfunction clickOnglet(path, onglet, module, redirection) {\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'html',\n    data: {\n      'onglet': onglet,\n      'module': module\n    },\n    success: function success(htmlData) {\n      window.location.href = redirection;\n    }\n  });\n}\n\n/** fin session **/\nfunction openWithPostData(page, categorie, titre) {\n  var form = document.createElement('form');\n  form.setAttribute('action', page);\n  form.setAttribute('method', 'post');\n  var data = {};\n  data['categorie'] = categorie;\n  data['titre'] = titre;\n  data[\"sendForm\"] = 0;\n  for (var n in data) {\n    var inputvar = document.createElement('input');\n    inputvar.setAttribute('type', 'hidden');\n    inputvar.setAttribute('name', n);\n    inputvar.setAttribute('value', data[n]);\n    form.appendChild(inputvar);\n  }\n  document.body.appendChild(form);\n  form.submit();\n}\nfunction convertDeviseInput() {\n  $('.span_devise_change').html($('#input_DEVISE').val());\n  //\tconsole.log($('#input_DEVISE').val());\n}\nfunction desactiveLoader() {\n  document.getElementById(\"loader\").style.display = \"none\";\n}\nfunction refreshPage() {\n  window.location = window.location.pathname;\n}\n\n/**\r\n * @param {string} s \r\n */\nfunction parseHtml(s) {\n  var parserEl = document.createElement('div'); // TODO\n  parserEl.innerHTML = s;\n  return parserEl.firstElementChild;\n}\n\n// Cette fonction nous permet lors du clique sur un boutton d'ajouter un élément en plus dans le tableau \n\n//function addRow(idTab){\n//\t\n//\t$(\"#tableID\").find('tbody').append($('<tr>').append($('<td>'))));\n//}\n//\n\n/**\r\n * Fonction Convert string representation of date and time to a timestamp\r\n */\nfunction strtotime(str, now) {\n  // Convert string representation of date and time to a timestamp    \n  //   \n  // version: 902.2516  \n  // discuss at: http://phpjs.org/functions/strtotime  \n  // +   original by: Caio Ariede (http://caioariede.com)  \n  // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)  \n  // +      input by: David  \n  // +   improved by: Caio Ariede (http://caioariede.com)  \n  // %        note 1: Examples all have a fixed timestamp to prevent tests to fail because of variable time(zones)  \n  // *     example 1: strtotime('+1 day', 1129633200);  \n  // *     returns 1: 1129719600  \n  // *     example 2: strtotime('+1 week 2 days 4 hours 2 seconds', 1129633200);  \n  // *     returns 2: 1130425202  \n  // *     example 3: strtotime('last month', 1129633200);  \n  // *     returns 3: 1127041200  \n  // *     example 4: strtotime('2009-05-04 08:30:00');  \n  // *     returns 4: 1241418600  \n  var i,\n    match,\n    s,\n    strTmp = '',\n    parse = '';\n  strTmp = str;\n  strTmp = strTmp.replace(/\\s{2,}|^\\s|\\s$/g, ' '); // unecessary spaces  \n  strTmp = strTmp.replace(/[\\t\\r\\n]/g, ''); // unecessary chars  \n\n  if (strTmp == 'now') {\n    return new Date().getTime();\n  } else if (!isNaN(parse = Date.parse(strTmp))) {\n    return parse / 1000;\n  } else if (now) {\n    now = new Date(now);\n  } else {\n    now = new Date();\n  }\n  strTmp = strTmp.toLowerCase();\n  var process = function process(m) {\n    var ago = m[2] && m[2] == 'ago';\n    var num = (num = m[0] == 'last' ? -1 : 1) * (ago ? -1 : 1);\n    switch (m[0]) {\n      case 'last':\n      case 'next':\n        switch (m[1].substring(0, 3)) {\n          case 'yea':\n            now.setFullYear(now.getFullYear() + num);\n            break;\n          case 'mon':\n            now.setMonth(now.getMonth() + num);\n            break;\n          case 'wee':\n            now.setDate(now.getDate() + num * 7);\n            break;\n          case 'day':\n            now.setDate(now.getDate() + num);\n            break;\n          case 'hou':\n            now.setHours(now.getHours() + num);\n            break;\n          case 'min':\n            now.setMinutes(now.getMinutes() + num);\n            break;\n          case 'sec':\n            now.setSeconds(now.getSeconds() + num);\n            break;\n          default:\n            var day;\n            if (typeof (day = __is_day[m[1].substring(0, 3)]) != 'undefined') {\n              var diff = day - now.getDay();\n              if (diff == 0) {\n                diff = 7 * num;\n              } else if (diff > 0) {\n                if (m[0] == 'last') diff -= 7;\n              } else {\n                if (m[0] == 'next') diff += 7;\n              }\n              now.setDate(now.getDate() + diff);\n            }\n        }\n        break;\n      default:\n        if (/\\d+/.test(m[0])) {\n          num *= parseInt(m[0]);\n          switch (m[1].substring(0, 3)) {\n            case 'yea':\n              now.setFullYear(now.getFullYear() + num);\n              break;\n            case 'mon':\n              now.setMonth(now.getMonth() + num);\n              break;\n            case 'wee':\n              now.setDate(now.getDate() + num * 7);\n              break;\n            case 'day':\n              now.setDate(now.getDate() + num);\n              break;\n            case 'hou':\n              now.setHours(now.getHours() + num);\n              break;\n            case 'min':\n              now.setMinutes(now.getMinutes() + num);\n              break;\n            case 'sec':\n              now.setSeconds(now.getSeconds() + num);\n              break;\n          }\n        } else {\n          return false;\n        }\n        break;\n    }\n    return true;\n  };\n  var __is = {\n    day: {\n      'sun': 0,\n      'mon': 1,\n      'tue': 2,\n      'wed': 3,\n      'thu': 4,\n      'fri': 5,\n      'sat': 6\n    },\n    mon: {\n      'jan': 0,\n      'feb': 1,\n      'mar': 2,\n      'apr': 3,\n      'may': 4,\n      'jun': 5,\n      'jul': 6,\n      'aug': 7,\n      'sep': 8,\n      'oct': 9,\n      'nov': 10,\n      'dec': 11\n    }\n  };\n  match = strTmp.match(/^(\\d{2,4}-\\d{2}-\\d{2})(\\s\\d{1,2}:\\d{1,2}(:\\d{1,2})?)?$/);\n  if (match != null) {\n    if (!match[2]) {\n      match[2] = '00:00:00';\n    } else if (!match[3]) {\n      match[2] += ':00';\n    }\n    s = match[1].split(/-/g);\n    for (i in __is.mon) {\n      if (__is.mon[i] == s[1] - 1) {\n        s[1] = i;\n      }\n    }\n    return strtotime(s[2] + ' ' + s[1] + ' ' + s[0] + ' ' + match[2]);\n  }\n  var regex = '([+-]?\\\\d+\\\\s' + '(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?' + '|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday' + '|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday)' + '|(last|next)\\\\s' + '(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?' + '|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday' + '|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday))' + '(\\\\sago)?';\n  match = strTmp.match(new RegExp(regex, 'g'));\n  if (match == null) {\n    return false;\n  }\n  for (i in match) {\n    if (!process(match[i].split(' '))) {\n      return false;\n    }\n  }\n  return now;\n}\nfunction refrechDiv(path, id, form, menu, paramJson) {\n  activeLoader();\n  if ((paramJson != null || paramJson != 'undefined') && (form == 'undefined' || form == null || form == '')) {\n    data = paramJson;\n  } else if (form) {\n    data = $('#' + form).serialize();\n  } else {\n    data = '';\n  }\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'html',\n    data: data,\n    success: function success(htmlData) {\n      refreshFonction(id, htmlData);\n      desactiveLoader();\n      return true;\n    }\n  });\n  return false;\n}\nfunction addFonctionAjax(content) {\n  var parametreJS = '<script type=\"text/javascript\" src=\"' + baseUrl + 'js/parametre.js\"></script>';\n  var globalJS = '<script type=\"text/javascript\" src=\"' + baseUrl + 'js/global.js\"></script>';\n  var validator = '<script type=\"text/javascript\" src=\"' + baseUrl + 'js/validator.js\"></script>';\n  return parametreJS + globalJS + validator + content;\n}\nfunction refreshFonction(id, content) {\n  var selector = '#' + id;\n  if (id.length == 0) {\n    selector = '.contenu';\n  }\n  var result = $('<div />').append(content).find(selector).html();\n  $(selector).html(result);\n}\nfunction bulleFiltreAdd(path, id, titre, value, form) {\n  if ($('#' + id).closest(\"#myModal\").length == 0) {\n    $.ajax({\n      url: path,\n      type: 'POST',\n      dataType: 'html',\n      data: {\n        'id': id,\n        'titre': titre,\n        'value': value\n      },\n      success: function success(htmlData) {\n        if (_typeof(form) === 'object') {\n          if (document.form) {\n            document.form.submit();\n          } else {\n            form.submit();\n          }\n        } else {\n          $('#' + form, document).submit();\n        }\n        return true;\n      }\n    });\n  }\n  return false;\n}\n\n/**\r\n * Fonction qui nous split la value dédiée au onChange\r\n * @return value separated \r\n */\nfunction separateurMilier(id) {\n  var nombre = $(id).val();\n  nombre = nombre.replace(new RegExp(' ', 'g'), '');\n  nombre += '';\n  var sep = ' ';\n  var reg = /(\\d+)(\\d{3})/;\n  while (reg.test(nombre)) {\n    nombre = nombre.replace(reg, '$1' + sep + '$2');\n  }\n  if (nombre.includes('.')) {\n    var splitNbr = nombre.split('.');\n    splitNbr[1] = splitNbr[1].replace(' ', '');\n    nombre = splitNbr[0] + '.' + splitNbr[1];\n  }\n  $(id).val(nombre);\n}\n\n/**\r\n * Fonction qui formate la date en fonction du parametrage\r\n * @returns date formaté\r\n */\nfunction formatDate(input, format) {\n  var date = $(input).val();\n  date = date.replace(new RegExp('/', 'g'), '');\n  date = date.replace(/-/g, '');\n  if (date == '') {\n    $(input).val();\n  } else {\n    if (format == 'jj/mm/aaaa') {\n      jj = date.substr(0, 2);\n      mm = date.substr(2, 2);\n      aaaa = date.substr(4, 4);\n      date = jj + '/' + mm + '/' + aaaa;\n    } else if (format == 'mm/jj/aaaa') {\n      mm = date.substr(0, 2);\n      jj = date.substr(2, 2);\n      aaaa = date.substr(4, 4);\n      date = mm + '/' + jj + '/' + aaaa;\n    } else if (format == 'aa-mm-jj') {\n      aa = date.substr(0, 2);\n      mm = date.substr(2, 2);\n      jj = date.substr(4, 2);\n      date = aa + '-' + mm + '-' + jj;\n    } else if (format == 'aaaa-mm-jj') {\n      aaaa = date.substr(0, 4);\n      mm = date.substr(4, 2);\n      jj = date.substr(6, 2);\n      date = aaaa + '-' + mm + '-' + jj;\n    } else if (format == 'aaaa/mm/jj') {\n      aaaa = date.substr(0, 4);\n      mm = date.substr(4, 2);\n      jj = date.substr(6, 2);\n      date = aaaa + '/' + mm + '/' + jj;\n    }\n    $(input).val(date);\n  }\n}\n/* CS */\nfunction initCs(path, destination, source, value, code_edition) {\n  $.ajax({\n    dataType: 'JSON',\n    url: path,\n    data: {\n      desti: destination,\n      source: source,\n      value: value\n    },\n    type: \"POST\",\n    success: function success(data) {\n      separateur = data.Constante;\n      if (data.ListeCS) {\n        for (i = 0; i < data.ListeCS.length; i++) {\n          valueCS = data.ListeCS[i].split(separateur);\n          if (valueCS[2] == 'LOGIQUE') {\n            if (valueCS[1] == 'O') {\n              valueCS[1] = true;\n            } else {\n              valueCS[1] = false;\n            }\n            changeValueSwitch('CS_EXTENTION' + separateur + destination + separateur + code_edition + separateur + valueCS[0], valueCS[1]);\n          } else {\n            if ($('#text_CS_EXTENTION' + separateur + destination + separateur + code_edition + separateur + valueCS[0]).length) {\n              $('#text_CS_EXTENTION' + separateur + destination + separateur + code_edition + separateur + valueCS[0]).val(valueCS[1]).change();\n            } else {\n              $('#input_CS_EXTENTION' + separateur + destination + separateur + code_edition + separateur + valueCS[0]).val(valueCS[1]);\n            }\n          }\n        }\n      }\n    }\n  });\n}\n\n/* Menu Contextuel : Click droit FAVORIS */\n\n$(function () {\n  $.contextMenu({\n    selector: '.menu_fav_ajout',\n    items: {\n      \"ajout\": {\n        name: addFavoris,\n        icon: \"favoris\",\n        callback: function callback(itemKey, option, e) {\n          ajouterFavorisLeft(option.$trigger);\n        }\n      }\n    }\n  });\n});\n$(function () {\n  $.contextMenu({\n    selector: '.menu_fav_suppr',\n    items: {\n      \"suppresion\": {\n        name: deleteFavoris,\n        icon: \"favoris\",\n        callback: function callback(itemKey, option, e) {\n          supprimerFavorisLeft(option.$trigger);\n        }\n      }\n    }\n  });\n});\n\n/* validator password */\nfunction affichageValidatorPassword(path, div, idInput) {\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: {\n      'input': $('#' + idInput).val()\n    },\n    type: \"POST\",\n    success: function success(result) {\n      $(\"#\" + div).html(result);\n    }\n  });\n}\n$('.switch input').click(function () {\n  if ($(this).is(':checked') == true) {\n    $(this).parent().find('.value_switch').text('Oui');\n  } else {\n    $(this).parent().find('.value_switch').text('Non');\n  }\n});\n\n/* permet le changement de value d'un switch avec son libelle */\nfunction changeValueSwitch(input, value) {\n  if (value) {\n    $(\"#input_\" + input).prop('checked', true).blur();\n    $(\"#value_switch_\" + input).html($(\"#input_\" + input).data('oui'));\n  } else {\n    $(\"#input_\" + input).prop('checked', false);\n    $(\"#value_switch_\" + input).html($(\"#input_\" + input).data('non'));\n  }\n}\nfunction changeValueMultiSelect(divCode, codeValue, divLibelle, libelleValue) {\n  //\tconsole.log(divCode+' : '+codeValue);\n  //\tconsole.log(divLibelle+' : '+libelleValue);\n\n  $('#' + divLibelle).val(libelleValue);\n  $('#' + divCode).val(codeValue).change();\n  $('#' + divLibelle).removeClass('error white-tooltip');\n  $('#' + divLibelle).removeAttr(\"data-original-title\");\n}\nfunction separateurBarr() {\n  var nombre = $(id).val();\n  nombre = nombre.replace(new RegExp(' ', 'g'), '');\n  nombre += '';\n  var sep = ' ';\n  var reg = /(\\d+)(\\d{3})/;\n  while (reg.test(nombre)) {\n    nombre = nombre.replace(reg, '$1' + sep + '$2');\n  }\n  $(id).val(nombre);\n}\nfunction notification(message, destinataire, onclick, url) {\n  var now = new Date();\n  socket.emit('envoiNotification', {\n    nom: jQuery('.nom').html(),\n    initiale: jQuery('.client > .initiale').html(),\n    destinataire: destinataire,\n    onclick: onclick,\n    url: url,\n    nomSociete: jQuery('.nomSocieteHeader').html(),\n    texte: now.getHours() + ':' + now.getMinutes() + ', ' + message\n  });\n}\n/* Popup ErreurPlusieursSignatures */\nfunction showBtnIgnorerPopupErrSign() {\n  // noDocCheck = '';\n  if ($('#form_erreurPlusieursXML').find('[name^=\"noDoc_\"]:checked').length > 0) {\n    // $('#form_erreurPlusieursXML').find('[name^=\"noDoc_\"]:checked').each(function() {\n    // \tnoDocCheck += '|' + $(this).attr('name').replace(\"noDoc_\", \"\");\n    // });\n\n    $('#ignorer').show();\n  } else {\n    $('#ignorer').hide();\n  }\n\n  // $('#listNoDoc').val(noDocCheck.substr(1));\n}\n\n/* GlobalAplication Popup Contacts fournisseur */\nfunction changeContactFou(idLigne, module) {\n  if (module == 'DA') {\n    tel = $('#form_contact [name=TEL' + idLigne + ']').val();\n    fax = $('#form_contact [name=FAX' + idLigne + ']').val();\n    email = $('#form_contact [name=EMAIL' + idLigne + ']').val();\n    if ($('#form_contact [name=TEL' + idLigne + ']').val() == '') {\n      tel = $('#form_contact #telFou').val();\n    }\n    if ($('#form_contact [name=FAX' + idLigne + ']').val() == '') {\n      fax = $('#form_contact #faxFou').val();\n    }\n    if ($('#form_contact [name=EMAIL' + idLigne + ']').val() == '') {\n      email = $('#form_contact #emailFou').val();\n    }\n    $('#form_creationDA #input_TEL_CTCT').val(tel);\n    $('#form_creationDA #input_POR_CFOU').val($('#form_contact [name=TELPORT' + idLigne + ']').val());\n    $('#form_creationDA #input_FAX_CTCT').val(fax);\n    $('#form_creationDA #input_EMA_CTCT').val(email);\n    if (email != '') {\n      $('#iconeEmailFou').show();\n    } else {\n      $('#iconeEmailFou').hide();\n    }\n  }\n}\nfunction ajaxPopupV2(path, idForm, title) {\n  activeLoader();\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'html',\n    data: $('#' + idForm).serialize(),\n    statusCode: {\n      413: function _(xhr) {\n        desactiveLoader();\n        desactivePopup();\n        alert('Error - ModSecurity.');\n      }\n    },\n    success: function success(data) {\n      desactiveLoader();\n      $(\"#modal-content\").addClass(\"modal_small\");\n      $(\"#modal-body\").html(data);\n      $(\"#modal-title\").html(title);\n      activePopup();\n    },\n    error: function error(data) {\n      var data = jQuery.parseJSON(data.responseText);\n      if (data.status == '500') {\n        desactiveLoader();\n        desactivePopup();\n        alert('Internal Server Error.');\n      } else {\n        //window.location.href = data.path;\n        if (data.redirectType == 'V1') {\n          transfertInformationAncienFramework(data.path);\n        } else {\n          redirectJSWithPost(data.path, data.post);\n        }\n      }\n    }\n  });\n}\nfunction ajaxPopupJSON(path, idForm) {\n  activeLoader();\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    type: \"POST\",\n    data: $('#' + idForm).serialize(),\n    statusCode: {\n      413: function _(xhr) {\n        desactiveLoader();\n        desactivePopup();\n        alert('Error - ModSecurity.');\n      }\n    },\n    success: function success(result) {\n      var data = jQuery.parseJSON(result);\n      if (data.statut == 'O') {\n        redirectJSWithPost(data.path, data.post);\n      } else {\n        desactiveLoader();\n        $(\"#modal-content\").addClass(\"modal_small\");\n        $(\"#modal-body\").html(data.content);\n        activePopup();\n      }\n    }\n  });\n}\n\n/**\r\n * Support for css height transition value<->auto \r\n */\nfunction updateCollapsable() {\n  document.querySelectorAll('[data-collaspsable]').forEach(function (elem) {\n    var prev = elem.style.width;\n    elem.style.setProperty('width', 'auto', 'important');\n    var s = elem.getBoundingClientRect().width.toString() + 'px';\n    elem.style.setProperty('width', prev);\n    setTimeout(function () {\n      elem.style.setProperty('width', s);\n    });\n  });\n}\nfunction init(AjaxNotificationMajNotification, calendarJPG, paramDateFormat, AjaxAutoCompleteAutocomplete) {\n  window.config = {\n    datepicker: {\n      showOn: \"button\",\n      changeYear: true,\n      changeMonth: true,\n      buttonImage: calendarJPG,\n      buttonImageOnly: true,\n      showAnim: \"fade\",\n      dateFormat: paramDateFormat\n    }\n  };\n  $(function () {\n    //  $.ajax({\n    // \t url : AjaxNotificationMajNotification, \n    // \t type: \"POST\",\n    // \t success : function(data){ \n    // \t\t $( \"#sidebarMenu\" ).append(data);\n    // \t }\n    //  });\n\n    //_____________________________________________________________________\n    // Datepicker\n\n    // on vérifie l'existence d'un attritbut data-maxdate avant d'exécuter datepicker\n    function datepickerConfig() {\n      $('.datepicker:not(:read-only):not(:disabled)').each(function () {\n        var _$$attr;\n        var params = window.config.datepicker;\n        $(this).datepicker(Object.assign(params, {\n          'maxDate': (_$$attr = $(this).attr('data-maxdate')) !== null && _$$attr !== void 0 ? _$$attr : ''\n        }));\n      });\n    }\n    datepickerConfig();\n\n    // Bind on dom mutation\n    var observer = new MutationObserver(function (mutationList) {\n      // TODO: only process new dom\n      datepickerConfig();\n    });\n    observer.observe(document.body, {\n      attributes: false,\n      childList: true,\n      subtree: true,\n      characterData: false\n    });\n\n    //_____________________________________________________________________\n    // Menu contextuel\n\n    function listenMC() {\n      var containers = document.querySelectorAll('[data-container-contextuel]');\n      containers.forEach(function (element) {\n        var parentId = element.getAttribute('data-container-contextuel');\n\n        // TODO : use CSS instead\n        var parent = document.querySelector('#' + parentId);\n        parent.addEventListener('mouseover', function (event) {\n          element.style.opacity = 1;\n        });\n        parent.addEventListener('mouseout', function (event) {\n          element.style.opacity = 0;\n        });\n\n        // Prevent element from been processed twice\n        element.removeAttribute('data-container-contextuel');\n      });\n    }\n\n    // Bind on dom mutation\n    var observerMc = new MutationObserver(function (mutationList) {\n      // TODO: only process new dom\n      listenMC();\n    });\n    observerMc.observe(document.body, {\n      attributes: false,\n      childList: true,\n      subtree: true,\n      characterData: false\n    });\n    listenMC();\n\n    //_____________________________________________________________________\n\n    // TODO on dom mutation\n    window.addEventListener('resize', updateCollapsable);\n    updateCollapsable();\n\n    //_____________________________________________________________________\n\n    $(\".autocomplete\").autocomplete({\n      minLength: 0,\n      source: function source(requete, response) {\n        // la fonction anonyme permet de maintenir une requête AJAX directement dans le plugin\n        var $el = $('#' + this.element[0].id);\n        var entity = $el.data().autocomplete;\n        if ($el.data().autocomplete.indexOf(\"libelle_\") == 0) {\n          entity = $el.data().autocomplete.replace('libelle_', '');\n        }\n        if ($el.data().autocompletefunction && $el.data().autocompletefunction != '') {\n          var pathAuto = AjaxAutoCompleteAutocomplete + '/' + $el.data().autocompletefunction;\n        } else {\n          var pathAuto = AjaxAutoCompleteAutocomplete;\n        }\n        var autocompletearray = '';\n        if ($el.data().autocompletearray && $el.data().autocompletearray != '') {\n          autocompletearray = $el.data().autocompletearray;\n        }\n\n        // autocompletearray = JSON.parse(autocompletearray);\n        var paramAjax = {\n          'search': requete.term,\n          'entity': entity\n        };\n        paramAjax = $.extend(paramAjax, autocompletearray);\n        paramAjax.toto = eval(\"(\" + paramAjax.toto + \")\");\n        $.ajax({\n          url: pathAuto,\n          // on appelle le script JSON\n          dataType: 'json',\n          // on spécifie bien que le type de données est en JSON\n          type: \"POST\",\n          data: paramAjax,\n          success: function success(data) {\n            response(data); // on se prépare à renvoyer les données réceptionnées grâce à l'évènement de succès\n          }\n        });\n      },\n      select: function select(event, ui) {\n        var entity = event.target.attributes['data-autocomplete'].value;\n        var i = 0;\n        if (event.target.attributes['data-autocomplete'].value.indexOf(\"libelle_\") == 0) {\n          entity = event.target.attributes['data-autocomplete'].value.replace('libelle_', '');\n          i = 1;\n        }\n        if (event.target.attributes['data-autocompletefunction'] && event.target.attributes['data-autocompletefunction'].value != '') {\n          var pathAuto = AjaxAutoCompleteAutocomplete + '/' + event.target.attributes['data-autocompletefunction'].value;\n        } else {\n          var pathAuto = AjaxAutoCompleteAutocomplete;\n        }\n        var autocompletearray = '';\n        if (event.target.attributes['data-autocompletearray'] && event.target.attributes['data-autocompletearray'].value != '') {\n          autocompletearray = event.target.attributes['data-autocompletearray'].value;\n        }\n        // autocompletearray = JSON.parse(autocompletearray);\n        // console.log(event.target.attributes['data-autocompletearray'].value);\n        var paramAjax = {\n          'value': ui.item.label,\n          'entity': entity\n        };\n        paramAjax = $.extend(paramAjax, autocompletearray);\n        $.ajax({\n          url: pathAuto,\n          // on appelle le script JSON\n          dataType: 'json',\n          // on spécifie bien que le type de données est en JSON\n          type: \"POST\",\n          data: paramAjax,\n          success: function success(data) {\n            var idValue = event.target.attributes['id'].value;\n            if ($('#' + event.target.attributes['id'].value.replace('text_', 'input_')).length != 0 && '#' + event.target.attributes['id'].value.replace('text_', 'input_') != '#' + event.target.attributes['id'].value) {\n              var idHidden = event.target.attributes['id'].value.replace('text_', 'input_');\n              $('#' + idHidden).val(data);\n              $('#' + idValue).val(data);\n            } else {\n              if (i) {\n                $('#' + idValue).val(ui.item.label);\n              } else {\n                $('#' + idValue).val(data);\n              }\n            }\n          }\n        });\n      }\n    });\n  });\n  function showDatepicker(id, calendarJPG, paramDateFormat) {\n    $(id).datepicker({\n      showOn: \"button\",\n      changeYear: true,\n      changeMonth: true,\n      buttonImage: calendarJPG,\n      buttonImageOnly: true,\n      showAnim: \"fade\",\n      dateFormat: paramDateFormat\n    });\n  }\n  var playSound = function () {\n    var s,\n      sounds = {},\n      soundUrls = {\n        laser: baseUrl + 'son/notification.mp3'\n      };\n    for (s in soundUrls) {\n      sounds[s] = new Audio(soundUrls[s]);\n      sounds[s].preload = 'auto';\n      sounds[s].load();\n    }\n    return function (soundname) {\n      if (soundname in sounds) {\n        sounds[soundname].play();\n      }\n    };\n  }();\n  var playSoundMessage = function () {\n    var s,\n      sounds = {},\n      soundUrls = {\n        laser: baseUrl + 'son/message.mp3'\n      };\n    for (s in soundUrls) {\n      sounds[s] = new Audio(soundUrls[s]);\n      sounds[s].preload = 'auto';\n      sounds[s].load();\n    }\n    return function (soundname) {\n      if (soundname in sounds) {\n        sounds[soundname].play();\n      }\n    };\n  }();\n  $(document).click(function (event) {\n    if (!$(event.target).closest('#sidebarMenu').length && !$(event.target).closest('#sidebarIconToggleId').length) {\n      if ($('#openSidebarMenu').is(':checked')) {\n        $(\"#openSidebarMenu\").prop('checked', false);\n        $(\"#imgFooterLogo\").hide();\n      }\n    } else if ($(event.target).closest('#sidebarIconToggleId').length) {\n      if (!$('#openSidebarMenu').is(':checked')) {\n        $(\"#imgFooterLogo\").fadeIn();\n        $(\"#openSidebarMenu\").prop('checked', true);\n      } else {\n        $(\"#imgFooterLogo\").hide();\n        $(\"#openSidebarMenu\").prop('checked', false);\n      }\n    }\n  });\n  jQuery(document).ready(function () {\n    /*setTimeout(function(){\r\n        $('.alert').alert('close')\r\n    }, 2000);*/\n\n    jQuery('.toast__close').click(function (e) {\n      e.preventDefault();\n      var parent = jQuery(this).parent('.toast');\n      parent.fadeOut(\"slow\", function () {\n        jQuery(this).remove();\n      });\n    });\n\n    /*\tvar socket = io.connect('https://ouislane.oxacloud.oxalys.fr:1337');\r\n        var socket = io.connect('https://ouislane.oxacloud.oxalys.fr:1337',{query: 'room='+Session_Login});\r\n        \r\n    \r\n    \r\n        /**\r\n            *  Socket affiche un nouvel utilisateur connecté\r\n            \r\n        socket.on('connexionUserRetour', function(data) {\r\n    \r\n        \r\n            jQuery('.toast__message').html(data.texte);\r\n            jQuery('.toast__type').html(data.nom);\r\n            jQuery('#initiale_toast').html(data.initiale);\r\n            \r\n            if(jQuery('.toast__container').is(':animated')) {\r\n                jQuery('.toast__container').stop().animate({opacity:'100'});\r\n            }\r\n        \r\n        \r\n            jQuery('.toast__container').fadeIn().delay(1000).fadeIn('slow');\r\n            playSound('laser');\r\n            jQuery('.toast__container').fadeIn().delay(3000).fadeOut('slow');\r\n        \r\n        \r\n        });\r\n    \r\n        \r\n        /**\r\n            *  Socket reception notification\r\n            \r\n        socket.on('receptionNotification', function(data) {\r\n    \r\n            jQuery('.toast__container').click(function() {\r\n                null;\r\n    \r\n            });\r\n    \r\n            jQuery('.toast__container').css( 'cursor', 'default' );\r\n            jQuery('.toast__message').html(data.texte);\r\n            jQuery('.toast__type').html(data.nom);\r\n            jQuery('#initiale_toast').html(data.initiale);\r\n            \r\n            if(jQuery('.toast__container').is(':animated')) {\r\n                jQuery('.toast__container').stop().animate({opacity:'100'});\r\n            }\r\n    \r\n            //refreshNotification();\r\n    \r\n            jQuery('.toast__container').fadeIn().delay(500).fadeIn('slow');\r\n            playSoundMessage('laser');\r\n            jQuery('.toast__container').fadeIn().delay(7000).fadeOut('slow');\r\n            \r\n            if(data.onclick != undefined && data.onclick!= '')\r\n            {\r\n                jQuery('.toast__container').click(function() {\r\n                    data.onclick;\r\n                });\r\n            }\r\n    \r\n            if(data.url != undefined && data.url!= '')\r\n            {\r\n                jQuery('.toast__container').css( 'cursor', 'pointer' );\r\n                jQuery('.toast__container').click(function() {\r\n                    jQuery(location).attr('href',data.url );\r\n        \r\n                });    \r\n            }\r\n            \r\n            $.ajax({\r\n                url : '{{ path(\"Ajax.Notification.ajoutNotification\")}}', // on appelle le script JSON\r\n                type: \"POST\",\r\n                dataType : 'html',\r\n                data : {'img' : data.img, 'nom' : data.nomNotif, 'message' :data.texteNotif , 'date' :data.date },\r\n                success : function(data){ \r\n                    jQuery( \"#notificationSidebarMenuInner\" ).prepend(data);\r\n                }\r\n            });\r\n        \r\n        });\r\n    \r\n    \r\n        //  $('#loginform').submit(function(event){\r\n            \r\n    \r\n            // verification du token\r\n            /*socket.emit('identifyToken',  { token : $('#token').val()}); \r\n            \r\n            socket.emit('login', {\r\n                username : $('#username').val(),\r\n                mail : $('#mail').val()\r\n            });\r\n            \r\n            //creer un identifiant par utilisateur\r\n            socket.emit('connectID', 1);\r\n        });\r\n        \r\n        //nouvelle utilisateur\r\n        socket.on('newusr', function(data){\r\n            $('<p>' + data.username + '</p>').appendTo('#test');\r\n    //\t\t  alert('baba ');\r\n        });\r\n        \r\n        // deconnection d'un utilisateur\r\n        socket.on('decouser', function(data) {\r\n    //\t\t  alert('aurevoir ' + data.username);\r\n            });\r\n        \r\n    //\t   envoi d'une notification\r\n    //\t  socket.emit('envoiNotification', {\r\n    //\t\t    room: 1,// l'identifiant a envoyer le message\r\n    //\t\t    message: \"Mon message de notification\"\r\n    //\t\t});\r\n        \r\n        // affichage de la notification\r\n    //\t  socket.on('notificationUsr', function(data) {\r\n    //\t\t  alert('Nouvelle connexion' + data);\r\n    //\t\t});\r\n    \r\n        */\n  });\n}\n$(function () {\n  $(\"[id^=mail_CS_EXTENTION]\").click(function () {\n    id = $(this).attr('id');\n    name_input = id.replace('mail_', '');\n    if ($('[name=\"' + name_input + '\"]').val() != \"\") {\n      document.location.href = \"mailto:\" + $('[name=\"' + name_input + '\"]').val();\n    }\n  });\n  $(\"[id^=url_CS_EXTENTION]\").click(function () {\n    id = $(this).attr('id');\n    name_input = id.replace('url_', '');\n    if ($('[name=\"' + name_input + '\"]').val() != \"\") {\n      window.open($('[name=\"' + name_input + '\"]').val(), \"_blank\");\n    }\n  });\n});\n\n/** Function drag & drop (reorder) */\n\nfunction reOrder(dom, domTarget, item, prev, next, newPosition, sign) {\n  var initialPosition = item.attr('data-order');\n  item.attr('data-order', 0);\n  $(dom).find(domTarget).each(function (i, e) {\n    var currentElementOrder = parseInt($(e).attr('data-order'));\n    if (sign === \"+\") {\n      if (currentElementOrder >= newPosition && currentElementOrder <= initialPosition) {\n        $(e).attr('data-order', currentElementOrder + 1);\n      }\n    } else {\n      if (currentElementOrder <= newPosition && currentElementOrder >= initialPosition) {\n        $(e).attr('data-order', currentElementOrder - 1);\n      }\n    }\n  });\n  item.attr('data-order', newPosition);\n  return newPosition;\n}\nfunction findNewPosition(prev, next, sign) {\n  if (sign === \"-\") return prev;\n  if (undefined === prev || isNaN(prev)) return 1;else return parseInt(prev) + 1;\n}\nfunction redirectJSWithPost(url, values, method, target, traditional, redirectTop) {\n  if (values) {\n    values['tokenCSRF'] = $('#tokenCSRF').val();\n  }\n  $.redirect(url, values, method, target, traditional, redirectTop);\n}\nfunction changeModule(path, mode) {\n  activeLoader();\n  $.ajax({\n    dataType: 'html',\n    url: path,\n    data: {\n      'type': mode\n    },\n    type: \"POST\",\n    statusCode: {\n      413: function _(xhr) {\n        desactiveLoader();\n        desactivePopup();\n        alert('Error - ModSecurity.');\n      }\n    },\n    success: function success(result) {\n      refrechDiv(window.location.pathname, 'menu-principal');\n    }\n  });\n}\n// creation du unserialize\nfunction unserialize(data) {\n  data = data.split('&');\n  var response = {};\n  var _iterator2 = _createForOfIteratorHelper(data),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var s = _step2.value;\n      var newData = s.split('=');\n      response[newData[0]] = newData[1];\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return response;\n}\n\n// Implementation du CSRF\n$.ajaxPrefilter(function (options, originalOptions, jqXHR) {\n  if (options.type.toLowerCase() != 'post') {\n    return;\n  }\n  if (options.data instanceof FormData) {\n    if (!options.data.has('tokenCSRF')) options.data.append('tokenCSRF', $('#tokenCSRF').val());\n    return;\n  }\n  if (!options.mimeType || options.mimeType == '') {\n    if (typeof options.data === 'string' || options.data instanceof String) {\n      var dataSerrialize = options.data;\n      if ('tokenCSRF' in unserialize(dataSerrialize) == false) {\n        options.data += '&tokenCSRF=' + encodeURIComponent($('#tokenCSRF').val());\n        if (options.data.charAt(0) == '&') {\n          options.data = options.data.substr(1);\n        }\n      }\n    } else if (_typeof(options.data) == 'object') {\n      options.data.tokenCSRF = $('#tokenCSRF').val();\n    }\n  } else {\n    options.data.append(\"tokenCSRF\", $('#tokenCSRF').val());\n  }\n});\nfunction consoliderGrille(path, pathInformation, titrePopup) {\n  activeLoader();\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'JSON',\n    processData: false,\n    // Required to use FormData\n    success: function success(response) {\n      var message = response.file !== '' ? response.file : '';\n      activePopupInformation(pathInformation, response.titre, \"\", \"\", \"\", \"\", \"\", response.message + '\\\\r\\\\n' + message);\n    },\n    error: function error(response) {\n      desactiveLoader();\n      $(\"#modal-content\").addClass(\"modal_small\");\n      $(\"#modal-title\").html(titrePopup);\n      $(\"#modal-body\").html(response.responseText);\n      activePopup();\n    }\n  });\n}\n/**\r\n * usage :  \r\n *     onsubmit=\"return ajaxSubmit(event);\"\r\n * @param SubmitEvent|HTMLFormElement event  \r\n * @param FormData|null formDataSup \r\n */\nfunction ajaxSubmit(event, formDataSup) {\n  // Get form\n  var form = event;\n  if (event instanceof Event) {\n    event.preventDefault();\n    form = event.target;\n  }\n  activeLoader();\n  var formData = new FormData(form);\n\n  // Merge formData\n  if (formDataSup !== undefined) {\n    var _iterator3 = _createForOfIteratorHelper(formDataSup.entries()),\n      _step3;\n    try {\n      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n        var pair = _step3.value;\n        formData.append(pair[0], pair[1]);\n      }\n    } catch (err) {\n      _iterator3.e(err);\n    } finally {\n      _iterator3.f();\n    }\n  }\n  $.ajax({\n    url: form.getAttribute('action'),\n    type: 'POST',\n    data: formData,\n    contentType: false,\n    processData: false,\n    success: function success(response, status, xhr) {\n      if (xhr.getResponseHeader('Content-Type') == 'application/json') {\n        response = JSON.parse(xhr.responseText);\n      }\n\n      // Call success callback\n      if (form.hasAttribute('data-onsuccess')) {\n        window.action[form.getAttribute('data-onsuccess')](response, status, xhr, form);\n        return;\n      }\n      if (form.hasAttribute('data-onsuccess-goto')) {\n        location.href = form.getAttribute('data-onsuccess-goto');\n        return;\n      }\n      desactiveLoader();\n    },\n    error: function error(xhr) {\n      // Call error callback\n      if (form.hasAttribute('data-onerror')) {\n        window.action[form.getAttribute('data-onerror')](xhr, form);\n        return;\n      }\n\n      // Case : form has an error displayer\n      var wrapperError = form.querySelector('[data-form-error]');\n      if (wrapperError) {\n        wrapperError.innerHTML = xhr.responseText;\n        desactiveLoader();\n        wrapperError.scrollIntoView({\n          behavior: 'smooth',\n          block: 'nearest'\n        });\n        return;\n      }\n\n      // Assume http 400 -> show constraint validation error\n      desactiveLoader();\n      activePopupError(window.oxaproc.trad['Erreur validation'], xhr.responseText, 'modal_small');\n    }\n  });\n  return false;\n}\nfunction ajaxHtmlUpdate(target, path, payload, callback) {\n  activeLoader();\n  return $.ajax({\n    url: path,\n    type: 'POST',\n    data: payload,\n    contentType: false,\n    processData: false,\n    success: function success(response, status, xhr) {\n      // target.innerHTML = response;\n      target.innerHTML = response;\n      if (callback) {\n        callback(response, status, xhr);\n      }\n      desactiveLoader();\n    },\n    error: function error(xhr) {\n      if (callback) {\n        callback(null, xhr.status, xhr);\n      }\n      desactiveLoader();\n    }\n  });\n}\nfunction iframeHeightAuto(obj) {\n  obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px';\n}\nwindow.action = Object.assign(window.action | {}, {\n  pageRefresh: function pageRefresh() {\n    location.reload();\n  },\n  ajaxPopup: function ajaxPopup(ev) {\n    var el = ev.target;\n    _ajaxPopup(el.getAttribute('data-ajaxpopup-path'), el.getAttribute('data-ajaxpopup-title'));\n  },\n  acsblt_changeFontSize: function acsblt_changeFontSize(ev) {\n    var value = parseInt(ev.target.value);\n    window.acsblt_setRootFontSize(value);\n    // Save into local storage\n    localStorage.setItem('acsblt-fs', value);\n    ev.target.scrollIntoView();\n  },\n  acsblt_closeBox: function acsblt_closeBox(ev) {\n    var section = document.getElementById('section-acsblt');\n    section.firstElementChild.style.display = 'none';\n    section.lastElementChild.style.display = '';\n  },\n  acsblt_openBox: function acsblt_openBox(ev) {\n    var section = document.getElementById('section-acsblt');\n    section.firstElementChild.style.display = '';\n    section.lastElementChild.style.display = 'none';\n  },\n  acsblt_toggleHightContrast: function acsblt_toggleHightContrast() {\n    // Toggle contrast mode (0->1, 1->0)\n    var i = window.acsblt_getContrastMode() ? 0 : 1;\n    window.acsblt_setContrastMode(i);\n    // Save into local storage\n    localStorage.setItem('acsblt-contrast', i);\n    // TODO : update button view\n  },\n  menuProfile_changeBackup: function menuProfile_changeBackup(event) {\n    idUser = event.target.value;\n    transfertInformationAncienFramework(\"TraiteAsync('user_backup.php?action=activeBackup&codeUser=\" + idUser + \"',document.forms.form_gestion.listeBackup,'','Activation du mode backup en cours')\");\n  },\n  menuProfile_quitBackup: function menuProfile_quitBackup(event) {\n    if (!confirm(event.target.getAttribute('data-quit-message'))) return;\n    transfertInformationAncienFramework(\"CallUrlAsync('user_backup.php?action=deconnexionBackup',document.forms.form_gestion.listeBackup,'','Désactivation du mode backup en cours...')\");\n  },\n  successFormDocTypeUpdate: function successFormDocTypeUpdate(response, status, xhr) {\n    // TODO : reload page ?\n    desactiveLoader();\n    desactivePopup();\n  },\n  successFormPopup: function successFormPopup(response, status, xhr) {\n    desactiveLoader();\n    activePopup(response.title, response.bodyHtml, response[\"class\"]);\n  },\n  arianePop: function arianePop(response, status, xhr) {\n    var _ariane = window.oxaproc.ariane;\n    if (_ariane.stack.length == 0) {\n      throw 'ariane has no path';\n    }\n    var lastPath = _ariane.stack[_ariane.stack.length - 2];\n    ariane(lastPath.path, lastPath.post);\n  }\n});\ndocument.addEventListener('click', function (event) {\n  var target = event.target;\n  if (!(target instanceof HTMLElement)) return;\n  var actioner = target.closest('[data-action-click]');\n  if (actioner == null) return;\n  window.action[actioner.getAttribute('data-action-click')](event, actioner);\n  return false;\n});\ndocument.addEventListener('change', function (event) {\n  var target = event.target;\n  if (!(target instanceof HTMLElement)) return;\n  if (!target.hasAttribute('data-action-change')) return;\n  window.action[target.getAttribute('data-action-change')](event);\n  return false;\n});\nwindow.acsblt_setRootFontSize = function (i) {\n  if (!Number.isInteger(i)) throw 'Invalid value ' + JSON.stringify(i);\n  var root = document.querySelector(':root');\n  root.style.fontSize = 12 + i + 'px';\n};\nwindow.acsblt_setContrastMode = function (i) {\n  if (i == 1) document.body.classList.add('hight-contrast-mode');else document.body.classList.remove('hight-contrast-mode');\n};\nwindow.acsblt_getContrastMode = function () {\n  return document.body.classList.contains('hight-contrast-mode') ? 1 : 0;\n};\nprPageLoad = new Promise(function (resolve, reject) {\n  // Case : `DOMContentLoaded` has already fired\n  if (document.readyState === 'complete') resolve(document);\n\n  // Loading hasn't finished yet\n  window.addEventListener('DOMContentLoaded', function (ev) {\n    resolve(document);\n  });\n});\nprPageLoad.then(function () {\n  // TODO : load AFTER dom parsing and BEFORE css rendering\n  // Load prefered font-size from local storage\n  var i = localStorage.getItem('acsblt-fs');\n  if (i == null) return;\n  window.acsblt_setRootFontSize(parseInt(i));\n  var ascblt_control_box = document.getElementById('menu-acsblt');\n  if (ascblt_control_box != null) ascblt_control_box.querySelector('input[type=range]').value = i;\n}).then(function () {\n  // TODO : load AFTER dom parsing and BEFORE css rendering\n  // Load prefered contrast mode from local storage\n  var i = localStorage.getItem('acsblt-contrast');\n  if (i == null) return;\n  window.acsblt_setContrastMode(parseInt(i));\n});\nvar scrollTimeout = null;\nwindow.addEventListener('scroll', function (event) {\n  if (scrollTimeout) {\n    clearTimeout(scrollTimeout);\n  }\n  scrollTimeout = setTimeout(function () {\n    window.dispatchEvent(new CustomEvent('scroll-echo', {\n      detail: {\n        original_event: event\n      }\n    }));\n  }, 10);\n});\nwindow.addEventListener('scroll-echo', function (event) {\n  var _iterator4 = _createForOfIteratorHelper(document.querySelectorAll('.follow-scroll')),\n    _step4;\n  try {\n    for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n      el = _step4.value;\n      if (!el.hasOwnProperty('followScrollOffset')) el.followScrollOffset = el.offsetTop;\n      if (window.pageYOffset > el.followScrollOffset) {\n        // Create placeholder\n        var markPlaceholder = 'data-followscroll-placeholder';\n        if (!el.nextElementSibling.hasAttribute(markPlaceholder)) {\n          var div = document.createElement('div');\n          div.setAttribute(markPlaceholder, '');\n          div.style.width = el.offsetWidth + 'px';\n          div.style.height = el.offsetHeight + 'px';\n          el.after(div);\n        }\n        el.classList.add('position-fixed');\n      } else {\n        el.classList.remove('position-fixed');\n      }\n    }\n  } catch (err) {\n    _iterator4.e(err);\n  } finally {\n    _iterator4.f();\n  }\n});\n\n//_____________________________________________________________________________\n// On change echo\n\ndocument.addEventListener('change', function (event) {\n  var _target$getAttribute;\n  var target = event.target;\n  if (!target.hasAttribute('data-onchangeecho')) {\n    return;\n  }\n  if (target._change_echo != null) {\n    clearTimeout(target._change_echo);\n  }\n  target._change_echo = setTimeout(function () {\n    target.dispatchEvent(new CustomEvent('change-echo', {\n      bubbles: true,\n      detail: {\n        original_event: event\n      }\n    }));\n  }, (_target$getAttribute = target.getAttribute('data-onchangeecho-delta')) !== null && _target$getAttribute !== void 0 ? _target$getAttribute : 750);\n});\n\n// Interpret attribute \"data-onchangeecho\"\ndocument.addEventListener('change-echo', function (event) {\n  var codejs = event.detail.original_event.target.getAttribute('data-onchangeecho');\n  if (codejs == null || codejs.length == 0) {\n    return;\n  }\n  eval(codejs);\n});\n\n//_____________________________________________________________________________\n// Async WSDL\n\nfunction asyncBackground(callback, payload, url) {\n  function asynchrone() {\n    setTimeout(function () {\n      $.ajax({\n        dataType: 'JSON',\n        url: typeof url !== 'undefined' ? url : window.oxaproc.path['Outil.Asynchrone.getResultAsynchrone'],\n        data: payload,\n        type: 'POST',\n        success: function success(retour) {\n          if (retour.Statut != 'O') {\n            asynchrone();\n            return;\n          }\n          post = retour.post;\n          if (post.redirect) {\n            redirectJSWithPost(post.pathRetour);\n            return;\n          }\n\n          // Success\n          if (callback != null) {\n            callback(payload, retour.reponseWSDL);\n          }\n        },\n        error: function error(data) {\n          desactiveLoader();\n          $(\"#modal-content\").addClass(\"modal_small\");\n          $(\"#modal-body\").html(data.responseText);\n          activePopup();\n        }\n      });\n    }, 2000);\n  }\n  asynchrone();\n}\n\n//_____________________________________________________________________________\n// ErreurXMl\n\n// TODO : remove pathAsync then replace ErreurXml_validationXML with ajaxSubmit\n\nfunction ErreurXml_validationXML(path, pathAsync) {\n  activeLoader();\n  $.ajax({\n    url: path,\n    type: 'POST',\n    dataType: 'JSON',\n    data: $('#form_erreurXML').serialize(),\n    success: function success(data) {\n      if (data.statut == 'wsdlEnAsync' && pathAsync) {\n        asyncBackground(function (requestData, dataRetourWsdl) {\n          ErreurXml_wsdlEnAsync(pathAsync, requestData, dataRetourWsdl);\n        }, data);\n        return;\n      } else if (data.statut == 'waiting' && pathAsync) {\n        return;\n      } else if (data.type == 'popup') {\n        desactiveLoader();\n        $(\"#modal-content\").addClass(data[\"class\"]);\n        $(\"#modal-body\").html(data.bodyHtml);\n        $(\"#modal-title\").html(data.title);\n        activePopup();\n        return;\n      }\n      desactiveLoader();\n      $(\"#modal-title\").html('');\n      $(\"#modal-body\").html(data);\n    },\n    error: function error(data) {\n      var IS_JSON = true;\n      try {\n        var test = jQuery.parseJSON(data.responseText);\n      } catch (e) {\n        var IS_JSON = false;\n      }\n      if (IS_JSON) {\n        //si retour json code 443, alors on fait la redirection\n        var data = jQuery.parseJSON(data.responseText);\n        if (data.postGestion) {\n          redirectJSWithPost(data.path, data.postGestion);\n          return;\n        }\n        if (data.divRefresh) {\n          refrechDiv(window.location.pathname, data.divRefresh, data.formRefresh);\n          desactivePopup();\n          return;\n        }\n        window.location.href = data.path;\n      } else {\n        desactiveLoader();\n        $(\"#modal-body\").html(data.responseText);\n        return;\n      }\n    }\n  });\n}\nfunction ErreurXml_wsdlEnAsync(pathAsync, requestData, dataRetourWsdl) {\n  $.ajax({\n    dataType: 'JSON',\n    url: pathAsync,\n    data: {\n      dataAsync: requestData,\n      dataRetourWsdl: dataRetourWsdl\n    },\n    type: 'POST',\n    success: function success(data) {\n      if (data.statut == 'wsdlEnAsync') {\n        asyncBackground(function (requestData, dataRetourWsdl) {\n          wsdlEnAsync(pathAsync, requestData, dataRetourWsdl);\n        }, data);\n        return;\n      } else if (data.statut == 'waiting' && pathAsync) {\n        return;\n      }\n      if (data.postGestion) {\n        redirectJSWithPost(data.path, data.postGestion);\n        return;\n      }\n      window.location.href = data.path;\n    },\n    error: function error(data) {\n      desactiveLoader();\n      $(\"#modal-content\").addClass(\"modal_small\");\n      $(\"#modal-body\").html(data.responseText);\n      activePopup();\n    }\n  });\n}\nfunction copyToClipBoard(element) {\n  var successMessage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n  var errorMessage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n  var nullMessage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';\n  var el = document.getElementById(element);\n  if (el !== null) {\n    var _value = el.value;\n    navigator.clipboard.writeText(_value).then(function () {\n      // alert('Texte copié');\n    })[\"catch\"](function (error) {\n      // alert('Erreur copy : '+error);\n    });\n  } else {\n    // alert(nullMessage);\n  }\n}\n\n//# sourceURL=webpack:///./assets/js/global.js?");

/***/ })

}]);