/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps 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/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./resources/js/moduleJs/moduleBase.js"
/*!*********************************************!*\
  !*** ./resources/js/moduleJs/moduleBase.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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar ModuleBase = /*#__PURE__*/function () {\n  function ModuleBase(options, data) {\n    _classCallCheck(this, ModuleBase);\n    _defineProperty(this, \"Opts\", {\n      testMode: false,\n      CSSSelectorContainer: '',\n      CSSSelectorForm: '',\n      token: null,\n      URL: {\n        getDataTableContent: null,\n        checkReadyToSend: null,\n        index: null,\n        show: null,\n        edit: null,\n        create: null,\n        store: null,\n        update: null,\n        destroy: null\n      },\n      dataTable: {\n        orderDirective: [1, 'asc'],\n        CSSSelector: null,\n        advanceSearchParameter: {}\n      }\n    });\n    _defineProperty(this, \"data\", null);\n    _defineProperty(this, \"root\", this);\n    this.Opts.CSSSelectorContainer = '.container' + this.constructor.name;\n    this.Opts.CSSSelectorForm = '.' + this.constructor.name + 'Form';\n    this.Opts.dataTable.CSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable';\n    this.root = this;\n    if (data !== \"undefined\" || data != null) {\n      this.data = data;\n    }\n    if (options != null) {\n      $.extend(this.Opts, options);\n    }\n  }\n  return _createClass(ModuleBase, [{\n    key: \"init\",\n    value: function init(options, data) {\n      if (data !== \"undefined\" || data != null) {\n        this.data = data;\n      }\n      if (options != null) {\n        $.extend(this.Opts, options);\n      }\n    }\n  }, {\n    key: \"datatableRowActionButtonClick\",\n    value: function datatableRowActionButtonClick(event, rootObj, options) {\n      debug('call ModuleBase.datatableRowActionButtonClick');\n      debug(rootObj);\n      var node = $(event[0].currentTarget);\n      var row = $(rootObj.Opts.dataTable.CSSSelector).DataTable().row(node.parents('tr'));\n      var rowData = row.data();\n      var actionName = 'datatableRowAction' + node.data('buttontype').capitalize();\n      if (typeof rootObj[actionName] === \"function\") {\n        return rootObj[actionName](rowData, node);\n      }\n    }\n  }, {\n    key: \"datatableRowActionAttachment\",\n    value: function datatableRowActionAttachment(rowData, node, options) {\n      debug('call ModuleBase.datatableRowActionAttachment ');\n      var fileName = 'downloadedFile';\n      if (typeof options.defaultFileName !== \"undefined\") {\n        fileName = options.defaultFileName;\n      }\n      if (rowData.fileUrl) {\n        if (rowData.fileName) {\n          fileName = rowData.fileName;\n        }\n        $.ajax({\n          url: rowData.fileUrl,\n          method: 'GET',\n          xhrFields: {\n            responseType: 'blob'\n          },\n          success: function success(data) {\n            var a = document.createElement('a');\n            var url = window.URL.createObjectURL(data);\n            a.href = url;\n            a.download = fileName;\n            document.body.append(a);\n            a.click();\n            a.remove();\n            window.URL.revokeObjectURL(url);\n          }\n        });\n      } else {\n        Toast.create({\n          title: \"Hiba!\",\n          message: 'Nincs csatolt fájl!',\n          status: TOAST_STATUS.DANGER,\n          timeout: 10000\n        });\n      }\n    }\n  }, {\n    key: \"datatableRowActionView\",\n    value: function datatableRowActionView(rowData, node, rootObj, options) {\n      debug('call ModuleBase.datatableRowActionView');\n      var ajaxUrl = rootObj.Opts.URL.show.replace('%id%', rowData.id);\n      /*\r\n              console.log(Opts.URL);\r\n      */\n      console.log(ajaxUrl);\n      APP.loadMainContent(ajaxUrl, rootObj.initViewShow);\n      console.log('ModuleBase.datatableRowActionEdit End');\n    }\n  }]);\n}();\nwindow.ModuleBase = ModuleBase;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 11212 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/moduleBase.js\n\n}");

/***/ },

/***/ "./resources/js/moduleJs/order.js"
/*!****************************************!*\
  !*** ./resources/js/moduleJs/order.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(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nwindow.OrderModulDefault = {\n  actionFunction: function actionFunction() {}\n};\nvar DataModelOrder = /*#__PURE__*/function (_DataModel) {\n  /*\n   * Constructor\n   */\n  function DataModelOrder(data, options) {\n    var _this;\n    _classCallCheck(this, DataModelOrder);\n    _this = _callSuper(this, DataModelOrder, [data, options]);\n    if (typeof _this.productSelected === \"undefined\") {\n      _this.productSelected = {};\n    }\n    if (typeof _this.productComment === \"undefined\") {\n      _this.productComment = {};\n    }\n    console.log(_this.constructor.name + ' constructor called');\n    return _this;\n  }\n  _inherits(DataModelOrder, _DataModel);\n  return _createClass(DataModelOrder);\n}(DataModel);\n;\nwindow.DataModelOrder = DataModelOrder;\nwindow.Stepper = function () {\n  /*\n   * Variables accessible\n   * in the class\n   */\n  var Opts = {\n    complete: ['supplier'],\n    available: ['supplier', 'parameter', 'productSelect', 'invoice', 'send'],\n    enable: ['supplier', 'invoice'],\n    load: [],\n    excludeLoaded: ['invoice', 'send'],\n    loaded: [],\n    active: false,\n    URL: {\n      create: ''\n    },\n    UrlData: false,\n    onAfterLoad: function onAfterLoad() {},\n    onAfterActivate: function onAfterActivate() {},\n    autoCallback: {\n      'invoice': {\n        onAfterActivate: function onAfterActivate() {}\n      },\n      'send': {\n        onAfterActivate: function onAfterActivate() {}\n      }\n    },\n    nowLoaded: false\n  };\n  var root = this;\n  /*\n   * Constructor\n   */\n  this.construct = function (options) {\n    $.extend(Opts, options);\n  };\n  this.getOpts = function () {\n    return Opts;\n  };\n  this.setOpts = function (options) {\n    $.extend(Opts, options);\n  };\n  this.init = function (options) {\n    $.extend(Opts, options);\n    debug(Opts);\n    $('.step').each(function () {\n      var stepName = $(this).data('stepname');\n      if (Opts.complete.includes(stepName)) {\n        root.setCompleted(stepName);\n      }\n      if (Opts.enable.includes(stepName)) {\n        root.setEnabled(stepName);\n      }\n      if (Opts.load.includes(stepName)) {\n        root.loadStepContent(stepName);\n      }\n      if (Opts.active === stepName) {\n        root.setActive(stepName);\n      }\n    });\n    root.bindClickAction();\n  };\n  this.bindClickAction = function () {\n    var stepClickButtons = $('.stepClick');\n    stepClickButtons.off('click');\n    stepClickButtons.on('click', root.stepClick);\n  };\n  this.setCompleted = function (stepName) {\n    console.log(stepName + ' completed');\n    $('.step[data-stepName=\"' + stepName + '\"]').addClass('completed');\n  };\n  this.unsetCompleted = function (stepName) {\n    console.log(stepName + ' Uncompleted');\n    $('.step[data-stepName=\"' + stepName + '\"]').removeClass('completed');\n    Opts.complete = arrayRemove(Opts.complete, stepName);\n  };\n  this.unsetEnabled = function (stepName) {\n    console.log(stepName + ' Un enabled');\n    $('.click' + stepName).contents().unwrap();\n    Opts.enable = arrayRemove(Opts.enable, stepName);\n  };\n  this.setEnabled = function (stepName) {\n    console.log(stepName + ' enabled');\n    var stepItem = $('.step[data-stepName=\"' + stepName + '\"]');\n    stepItem.html('<a class=\"stepClick click' + stepName + '\" data-stepName=\"' + stepName + '\" href=\"#\">' + stepItem.html() + '</a>');\n    root.bindClickAction();\n    //$('.stepClick').click(root.stepClick);\n  };\n  this.addEnabled = function (stepName) {\n    if (!Opts.enable.includes(stepName)) {\n      Opts.enable.push(stepName);\n    }\n    root.setEnabled(stepName);\n  };\n  this.addCompleted = function (stepName) {\n    if (!Opts.complete.includes(stepName)) {\n      Opts.complete.push(stepName);\n    }\n    root.setCompleted(stepName);\n    root.bindClickAction();\n  };\n  this.loadStepContent = function (stepName) {\n    var data = {\n      'type': stepName\n    };\n    $.extend(data, Opts.UrlData);\n    $.ajax({\n      async: true,\n      type: \"GET\",\n      url: Opts.URL.create,\n      data: data,\n      cache: false,\n      success: function success(result) {\n        var container = $('.SC' + stepName.capitalize());\n        if ($.inArray(stepName, Opts.excludeLoaded) == -1) {\n          Opts.loaded.push(stepName);\n        } else {\n          console.log('excluded View');\n        }\n        container.html(result);\n        if (Opts.nowLoaded) {\n          Opts.nowLoaded(stepName);\n        }\n        Opts.onAfterLoad();\n      }\n    });\n  };\n  this.clearLoaded = function () {\n    Opts.loaded = ['supplier'];\n    $('.stepContainer').each(function () {\n      /*\n                  console.log(this.classList);\n                  console.log(this.classList.contains('SCSupplier'));\n                  console.log($(this).attr('class'));\n      */\n      if (!this.classList.contains('SCSupplier')) {\n        $(this).html('');\n      }\n    });\n  };\n  this.setActiveFinish = function (stepName) {\n    var container = $('.SC' + stepName.capitalize());\n    if (stepName === 'productSelect') {\n      $('.containerStepper').addClass('activeSideBar');\n    } else {\n      $('.containerStepper').removeClass('activeSideBar');\n    }\n    debug('setActiveFinish show:' + stepName);\n    container.show();\n    Opts.nowLoaded = false;\n    root.active = stepName;\n    Opts.onAfterActivate();\n    if (typeof Opts.autoCallback[stepName] !== 'undefined') {\n      Opts.autoCallback[stepName].onAfterActivate();\n    }\n  };\n  this.setActive = function (stepName) {\n    $('.stepContainer').hide();\n    if (!Opts.loaded.includes(stepName)) {\n      root.loadStepContent(stepName);\n      Opts.nowLoaded = this.setActiveFinish;\n    } else {\n      this.setActiveFinish(stepName);\n    }\n  };\n  this.stepClick = function (event) {\n    event.preventDefault();\n    var stepName = $(event.currentTarget).data('stepname');\n    console.log('setActive:' + stepName);\n    root.setActive(stepName);\n  };\n};\nwindow.OrderModule = function () {\n  /*\n   * Variables accessible\n   * in the class\n   */\n  var Opts = {\n    testMode: false,\n    needStepper: true,\n    CSSSelectorForm: '.orderParameterForm',\n    defaultDeliveryDate: '',\n    dataSyncPauseTime: 500,\n    token: null,\n    URL: {\n      root: null,\n      getDataTableContentProductList: null,\n      checkReadyToSend: null,\n      index: null,\n      show: null,\n      edit: null,\n      create: null,\n      store: null,\n      update: null,\n      destroy: null,\n      toggleFavorites: null\n    }\n  };\n  var PublicVar = {};\n  var PublicVar2 = {\n    'asd': '21'\n  };\n  var ApiToken = null;\n  var Order = null;\n  var root = this;\n  var viewInicialized = [];\n  this.setOpts = function (options) {\n    $.extend(Opts, options);\n  };\n  this.getOpts = function () {\n    return Opts;\n  };\n  this.clickOrderEdit = function (data) {\n    debug('clickEdit');\n    debug(data);\n    var ajaxUrl = Opts.URL.edit.replace('%id%', data.id);\n    APP.loadMainContent(ajaxUrl);\n    /*        let ajaxData={};\n            ajaxData._token=Opts.token;\n            $.extend(ajaxData,Order);\n            let ajaxUrl=Opts.URL.edit.replace('%id%',data.id);\n            $.ajax({\n                url: ajaxUrl,\n                method:'GET',\n                data:ajaxData,\n                success:function (response) {\n                    if(response.success){\n                        let orderData=response.data;\n                        orderData.supplierId=orderData.supplier_id;\n                        delete(orderData.supplier_id);\n                        root.initOrder(orderData);\n                        root.initStepper();\n                        //root.afterOrderSetSupplierOk(data.data);\n                    }\n                }\n            });*/\n  };\n  this.afterOrderDeleted = function (data) {\n    if (data.success == true) {\n      debug('Order delete success');\n      APP.loadMainContent(Opts.URL.index);\n    } else {\n      Toast.create({\n        title: \"Error deleted !\",\n        message: '',\n        status: TOAST_STATUS.DANGER,\n        timeout: 5000\n      });\n    }\n  };\n  this.clickOrderDeleteConfirmed = function (event) {\n    debug('clickOrderDeleteConfirmed');\n    debug(event);\n    debug(event.data);\n    $('#dialogModal').modal('hide');\n    var ajaxData = {};\n    ajaxData._token = Opts.token;\n    var ajaxUrl = Opts.URL.destroy.replace('%id%', event.data.id);\n    $.ajax({\n      url: ajaxUrl,\n      data: ajaxData,\n      method: \"DELETE\",\n      success: root.afterOrderDeleted\n      //error:ajaxErrorHandler\n    });\n  };\n  this.initViewOrderSelect = function () {\n    debug('called initViewOrderSelect ');\n    $('.ordersSelectTable button').off('click');\n    $('.ordersSelectTable button').on('click', function () {\n      var action = $(this).data('action');\n      var orderId = $($(this).closest('tr')[0]).data('orderid');\n      debug(action);\n      debug(orderId);\n      if (action == 'delete') {\n        $('#dialogModal').on('show.bs.modal', function (event) {\n          // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).\n          // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.\n          var modal = $(this);\n          modal.find('.modal-title').text('Megerősítés ');\n          modal.find('.modal-body').text('Biztosan törli a megrendelést?');\n          modal.find('.buttonYes').off('click');\n          modal.find('.buttonYes').on('click', {\n            id: orderId\n          }, root.clickOrderDeleteConfirmed);\n        });\n        $('#dialogModal').modal('show');\n      } else {\n        root.clickOrderEdit({\n          id: orderId\n        });\n      }\n    });\n    $('.buttonNew').off('click');\n    $('.buttonNew').on('click', function () {\n      APP.loadMainContent(Opts.URL.index, 'force=true');\n    });\n  };\n  this.initStepper = function () {\n    debug(Order.getData());\n    viewInicialized = [];\n    $('.statusNamePlace').text('Nincs elküldve');\n    $('.statusNamePlace').addClass('statusBlink');\n    root.setDeliveryDate('-');\n    root.setSupplier('-');\n    var unEnabled = ['parameter', 'productSelect', 'invoice', 'send'];\n    $.each(unEnabled, function (index, value) {\n      root.Stepper.unsetEnabled(value);\n      root.Stepper.unsetCompleted(value);\n    });\n    debug(root.Stepper.getOpts()['available']);\n    debug(Order.getData()['orderStatus']);\n    var stepActive = 'supplier';\n    var stepComplete = ['supplier'];\n    var stepEnable = [];\n    var stepOnAfterActivate = function stepOnAfterActivate() {};\n    var avalaibleSteps = root.Stepper.getOpts()['available'];\n    var stepUrlData = false;\n    var stepAutoCallback = [];\n    var _iterator = _createForOfIteratorHelper(avalaibleSteps),\n      _step;\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var _stepName = _step.value;\n        stepOnAfterActivate = this['initView' + _stepName.capitalize()];\n        var item = {};\n        item['onAfterActivate'] = stepOnAfterActivate;\n        stepAutoCallback[_stepName] = item;\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n    debug(stepAutoCallback);\n    debug(Order.getData()['id']);\n    if (Order.getData()['id'] > 0) {\n      debug('hajra');\n      debug(Order.getData());\n      if (Order.getData()['deliveryDate']) {\n        root.setDeliveryDate(Order.getData()['deliveryDate']);\n        /*\n        @todo: weekly-t beallitani\n         */\n      }\n      if (Order.getData()['supplierName']) {\n        root.setSupplier(Order.getData()['supplierName']);\n      }\n      stepUrlData = {\n        'supplierId': Order.supplierId,\n        id: Order.id\n      };\n      var _iterator2 = _createForOfIteratorHelper(avalaibleSteps),\n        _step2;\n      try {\n        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n          var stepName = _step2.value;\n          console.log(stepName);\n          stepComplete.push(stepName);\n          stepEnable.push(stepName);\n          if (Order.getData()['orderStatus'] == stepName) {\n            stepActive = stepName;\n            /*\n            debug('initView'+stepName.capitalize());\n            if(stepName!=='invoice' && stepName!=='send'){\n                stepOnAfterActivate=this['initView'+stepName.capitalize()];\n            }else{\n                stepOnAfterActivate=function (){};\n            }\n            */\n            break;\n          }\n        }\n\n        /*\n                    //refactored for loop\n                    var BreakException = {};\n                    try {\n                        avalaibleSteps.forEach(function(stepName) {\n                            console.log(stepName);\n                            stepComplete.push(stepName);\n                            stepEnable.push(stepName);\n                            if(Order.getData()['orderStatus']==stepName){\n                                stepActive=stepName;\n                                throw BreakException;\n                            }\n        \n                        });\n                    } catch (e) {\n                        if (e !== BreakException) throw e;\n                    }*/\n      } catch (err) {\n        _iterator2.e(err);\n      } finally {\n        _iterator2.f();\n      }\n    }\n    root.Stepper.init({\n      complete: stepComplete,\n      enable: stepEnable,\n      loaded: [],\n      active: stepActive,\n      URL: {\n        create: Opts.URL.create\n      },\n      UrlData: stepUrlData,\n      onAfterActivate: stepOnAfterActivate,\n      autoCallback: stepAutoCallback\n      /*{\n          invoice: {\n              onAfterActivate:root.initViewInvoice\n          },\n          send: {\n              onAfterActivate:root.initViewSend\n          },\n       }*/\n    });\n  };\n  this.initOrder = function (data) {\n    Order = new DataModelOrder(data);\n  };\n  this.init = function (options) {\n    debug('OrderModul init called');\n    $.extend(Opts, window.OrderModulDefault, options);\n    Order = new DataModelOrder();\n    if (Opts.needStepper) {\n      if (typeof this.Stepper == 'undefined') {\n        this.Stepper = new Stepper();\n      }\n    }\n    if (Opts.testMode) {\n      return root.testMode();\n    }\n  };\n  this.setSupplier = function (supplierName, supplierId) {\n    if (supplierName) {\n      $('.supplierNamePlace').text(supplierName);\n    }\n    if (supplierId) {\n      Order.setData({\n        supplierId: supplierId\n      });\n      root.Stepper.setOpts({\n        'UrlData': {\n          'supplierId': supplierId\n        }\n      });\n    }\n  };\n  this.setDeliveryDate = function (dateText, dateTextTo) {\n    var dateTextHuman = dateText.replaceAll('-', '.') + '.';\n    if (dateTextHuman.length < 5) {\n      $('.deliveryDatePlace').text(dateText);\n      return;\n    }\n    if (dateTextTo) {\n      dateTextHuman += ' - ' + dateTextTo.replaceAll('-', '.') + '.';\n    }\n    $(Opts.CSSSelectorForm + ' .selectedDateText').text(dateTextHuman);\n    $('.deliveryDatePlace').text(dateTextHuman);\n    $(Opts.CSSSelectorForm + ' input[name=\"deliveryDate\"]').val(dateText);\n  };\n  this.getData = function () {\n    return Order;\n  };\n  this.setSupplierCompleted = function () {\n    console.log('bingo');\n    root.initViewParameter();\n  };\n  this.afterOrderSetSupplierOk = function (data) {\n    Toast.create({\n      title: \"Supplier selected !\",\n      message: data.supplier.name,\n      status: TOAST_STATUS.INFO,\n      timeout: 5000\n    });\n    root.setSupplier(data.supplier.name, data.supplier.id);\n    Order.setData({\n      id: data.id\n    });\n    root.Stepper.setOpts({\n      'UrlData': {\n        'supplierId': Order.supplierId,\n        id: Order.id\n      }\n    });\n    //root.Stepper.setOpts({onAfterLoad:root.setSupplierCompleted})\n    root.Stepper.setEnabled('parameter');\n    root.Stepper.addCompleted('parameter');\n    root.Stepper.setCompleted('parameter');\n    root.Stepper.setActive('parameter');\n  };\n  this.initViewSupplier = function () {\n    debug('call initViewSupplier');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    $('.supplierItem').off('click');\n    $('.supplierItem').on('click', function (event) {\n      console.log(Order.getData());\n      event.preventDefault();\n      var supplierId = $(event.currentTarget).data('id');\n      var supplierName = $(event.currentTarget).find('h5.card-title').text();\n      if (typeof Order.supplierId == 'undefined') {\n        //new order\n\n        var ajaxData = {};\n        ajaxData._token = Opts.token;\n        ajaxData.supplierId = supplierId;\n        ajaxData.storeType = 'supplierSelect';\n        $.extend(ajaxData, Order);\n        $.ajax({\n          url: Opts.URL.store,\n          method: 'POST',\n          data: ajaxData,\n          success: function success(data) {\n            if (data.success) {\n              root.afterOrderSetSupplierOk(data.data);\n            }\n          }\n        });\n        //Order.setData({supplierId:supplierId});\n      } else {\n        //ide kellene egy jo kis kerdes\n        if (Order.supplierId != supplierId) {\n          Toast.create({\n            title: \"Supplier change to!\",\n            message: supplierName,\n            status: TOAST_STATUS.WARNING,\n            timeout: 5000\n          });\n          root.Stepper.clearLoaded();\n          Order = new DataModelOrder();\n          //Order.setData({supplierId:supplierId});\n        }\n      }\n      return;\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n\n      //$('.supplierNamePlace').text(supplierName);\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n      //@todo:ide kell egy mentes!\n      //@todo:mentes eredemenyekeppen lehet valtani\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n    });\n  };\n  this.checkContactNameField = function () {\n    var CSSSelectorForm = '.orderParameterForm';\n    var node = $(CSSSelectorForm + ' input[name=contactName]');\n    if (node.val().length < 2) {\n      node.removeClass('is-valid');\n      node.addClass('is-invalid');\n      return false;\n    } else {\n      node.addClass('is-valid');\n      node.removeClass('is-invalid');\n      return true;\n    }\n  };\n  this.sendOrderDataToServer = function (updateType, callback, errorCallback) {\n    var ajaxData = {};\n    var ajaxUrl = Opts.URL.store;\n    var ajaxMethod = \"POST\";\n    if (Order.id) {\n      ajaxUrl = Opts.URL.update.replace('%id%', Order.id);\n      //ajaxMethod=\"PUT\";\n      //ajaxData=new FormData($(CSSSelectorForm)[0]);\n      ajaxData._method = 'PUT';\n    }\n    ajaxData._token = Opts.token;\n    ajaxData.updateType = updateType;\n    $.extend(ajaxData, Order);\n    debug(Order);\n    debug(ajaxData);\n    debug('ajaxUrl:' + ajaxUrl);\n    ajaxData = jsonToFormData(ajaxData);\n    $.ajax({\n      url: ajaxUrl,\n      data: ajaxData,\n      type: ajaxMethod,\n      contentType: false,\n      processData: false,\n      success: function success(data) {\n        debug('ajax returned data');\n        debug(data);\n        if (data.success) {\n          //root.afterOrderSetSupplierOk(data.data);\n          callback(data);\n        }\n      },\n      error: function error(xhr, ajaxOptions, thrownError) {\n        ajaxErrorHandler(xhr, ajaxOptions, thrownError);\n        if (typeof errorCallback != 'undefined') {\n          errorCallback(xhr.responseJSON);\n        }\n      }\n    });\n  };\n  this.afterOrderSetParameterOk = function (data) {\n    debug('called afterOrderSetParameterOk');\n    root.Stepper.setOpts({\n      'UrlData': {\n        'supplierId': Order.supplierId,\n        'id': Order.id\n      }\n    });\n    //root.Stepper.setOpts({onAfterLoad:root.setParameterCompleted})\n    root.Stepper.setEnabled('productSelect');\n    root.Stepper.addCompleted('productSelect');\n    root.Stepper.setCompleted('productSelect');\n    root.Stepper.setActive('productSelect');\n  };\n  this.selectCurrentWeek = function () {\n    console.error('selectCurrentWeek');\n    console.error($('.ui-datepicker').find('.ui-datepicker-current-day a'));\n    $('.ui-datepicker').find('.ui-datepicker-current-selected-weekday a').addClass('ui-state-active');\n  };\n  this.weekHover = function () {\n    console.error('hover Active');\n    $('.ui-datepicker-calendar tr').off('mousemove');\n    $('.ui-datepicker-calendar tr').off('mouseleave');\n    $('.ui-datepicker-calendar tr').on('mousemove', function () {\n      $(this).find('td a').addClass('ui-state-hover');\n    });\n    $('.ui-datepicker-calendar tr').on('mouseleave', function () {\n      $(this).find('td a').removeClass('ui-state-hover');\n    });\n  };\n  this.weekHoverSlow = function () {\n    console.error('weekHoverSlow');\n    if ($('.ui-datepicker-calendar tr').length < 1) {\n      setTimeout(root.weekHoverSlow, 1);\n      return;\n    }\n    root.weekHover();\n  };\n  this.initDatePicker = function (type) {\n    console.error('asdasdadad');\n    console.log('tipus' + type);\n    var CSSSelectorForm = '.orderParameterForm';\n    var startDate = new Date('1900-01-01');\n    var endDate = new Date('1900-01-02');\n    $(CSSSelectorForm + ' .datePicker').datepicker(\"destroy\");\n    if (type == 'weekly') {\n      $(CSSSelectorForm + ' .datePicker').datepicker({\n        showOtherMonths: true,\n        selectOtherMonths: true,\n        showWeek: true,\n        dateFormat: 'yy-mm-dd',\n        firstDay: 1,\n        minDate: new Date(),\n        afterShow: function afterShow(dateText, inst) {\n          root.weekHover();\n          root.selectCurrentWeek();\n        },\n        onSelect: function onSelect(dateText, inst) {\n          var date = $(this).datepicker('getDate');\n          startDate = new getMonday(date);\n          endDate = new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay() + 7);\n          root.setDeliveryDate($.datepicker.formatDate('yy-mm-dd', startDate), $.datepicker.formatDate('yy-mm-dd', endDate));\n        },\n        beforeShow: function beforeShow() {\n          console.group('beforeShow');\n          console.log(startDate);\n          console.log(endDate);\n          //root.weekHoverSlow();\n          console.groupEnd();\n        },\n        beforeShowDay: function beforeShowDay(date) {\n          console.group('beforeShowDay');\n          console.log(date.toLocaleDateString('hu-Hu'));\n          var cssClass = '';\n          if (date >= startDate && date <= endDate) {\n            console.error(date.toLocaleDateString('hu-Hu'));\n            cssClass = 'ui-datepicker-current-selected-weekday';\n            //cssClass = 'ui-state-active';\n          }\n          console.log(cssClass);\n          console.groupEnd();\n          return [true, cssClass];\n        },\n        onChangeMonthYear: function onChangeMonthYear(year, month, inst) {\n          //root.selectCurrentWeek();\n        }\n      });\n    } else {\n      // Szállítási korlátozás adatok betöltése (csak ha hasDeliveryConstraint = true)\n      var availableDates = [];\n      var nextDeliveryDate = null;\n      var hasDeliveryConstraint = false;\n      var holidays = [];\n      var workingDays = [];\n      var datepickerInput = $(CSSSelectorForm + ' .datePicker');\n      var calendarUrl = datepickerInput.data('delivery-calendar-url');\n      var supplierId = datepickerInput.data('supplier-id');\n      var profitCenterId = datepickerInput.data('profit-center-id');\n      if (calendarUrl && supplierId && profitCenterId) {\n        $.ajax({\n          url: calendarUrl,\n          data: {\n            supplierId: supplierId,\n            profitCenterId: profitCenterId,\n            orderDateTime: new Date().toISOString()\n          },\n          async: false,\n          success: function success(data) {\n            hasDeliveryConstraint = data.hasDeliveryConstraint || false;\n            // Ünnepnapok és áthelyezett munkanapok – mindig betöltjük\n            holidays = (data.holidays || []).map(function (h) {\n              return {\n                date: h.date,\n                description: h.description\n              };\n            });\n            workingDays = (data.workingDays || []).map(function (w) {\n              return {\n                date: w.date,\n                description: w.description\n              };\n            });\n            if (hasDeliveryConstraint) {\n              availableDates = data.availableDates || [];\n              nextDeliveryDate = data.nextDeliveryDate || null;\n            }\n            // Ha nincs szállítási korlátozás, az availableDates és nextDeliveryDate\n            // üres marad – a datepicker az eredeti módon viselkedik\n          }\n        });\n      }\n      if (hasDeliveryConstraint && nextDeliveryDate) {\n        // Következő szállítási nap beállítása alapértelmezettként\n        root.setDeliveryDate(nextDeliveryDate);\n        $(CSSSelectorForm + ' .selectedDateText').text(nextDeliveryDate);\n        $(CSSSelectorForm + ' input[name=\"deliveryDate\"]').val(nextDeliveryDate);\n        $('.deliveryDatePlace').text(nextDeliveryDate.replaceAll('-', '.') + '.');\n      }\n\n      // Szín jelmagyarázat megjelenítése csak szállítási korlátozás esetén\n      if (hasDeliveryConstraint) {\n        $('#deliveryDateLegend').show();\n      }\n      var datepickerOpts = {\n        dateFormat: 'yy-mm-dd',\n        minDate: hasDeliveryConstraint && nextDeliveryDate ? new Date(nextDeliveryDate) : new Date(),\n        onSelect: function onSelect(dateText) {\n          $(CSSSelectorForm + ' .selectedDateText').text(dateText);\n          $('.deliveryDatePlace').text(dateText.replaceAll('-', '.') + '.');\n          $(CSSSelectorForm + ' input[name=\"deliveryDate\"]').val(dateText);\n        }\n      };\n\n      // beforeShowDay: mindig aktív ha van munkanaptár adat vagy hasDeliveryConstraint\n      datepickerOpts.beforeShowDay = function (date) {\n        var dateStr = $.datepicker.formatDate('yy-mm-dd', date);\n        var holidayEntry = holidays.find(function (h) {\n          return h.date === dateStr;\n        });\n        var workingDayEntry = workingDays.find(function (w) {\n          return w.date === dateStr;\n        });\n        var isDelivery = hasDeliveryConstraint && availableDates.includes(dateStr);\n        var cssClasses = [];\n        var tooltip = '';\n        var selectable = true;\n        if (holidayEntry) {\n          cssClasses.push('work-calendar-holiday');\n          tooltip = 'Ünnepnap' + (holidayEntry.description ? ': ' + holidayEntry.description : '');\n        } else if (workingDayEntry) {\n          cssClasses.push('work-calendar-working-day');\n          tooltip = 'Áthelyezett munkanap' + (workingDayEntry.description ? ': ' + workingDayEntry.description : '');\n        }\n        if (hasDeliveryConstraint) {\n          if (isDelivery) {\n            cssClasses.push('delivery-day-available');\n            if (!tooltip) tooltip = 'Szállítási nap';\n          } else {\n            cssClasses.push('delivery-day-unavailable');\n            if (!tooltip) tooltip = 'Nem szállítási nap';\n            selectable = false;\n          }\n        }\n        // Ha ünnepnap és hasDeliveryConstraint nincs bekapcsolva, az ünnepnap is letiltandó\n        if (holidayEntry && !hasDeliveryConstraint) {\n          selectable = false;\n        }\n        return [selectable, cssClasses.join(' '), tooltip];\n      };\n      $(CSSSelectorForm + ' .datePicker').datepicker(datepickerOpts);\n    }\n  };\n  this.callChangeOrderType = function () {\n    console.log(this);\n    console.log(this.value);\n    root.initDatePicker(this.value);\n    //enum('daily', 'weekly')\n    /*let CSSSelectorForm='.orderParameterForm';\n    let node=$(CSSSelectorForm+' input[name=contactName]');\n    if(node.val().length<2){\n        node.removeClass('is-valid');\n        node.addClass('is-invalid');\n        return false;\n    }else{\n        node.addClass('is-valid');\n        node.removeClass('is-invalid');\n        return true;\n    }\n    */\n  };\n  this.initViewParameter = function () {\n    debug('call initViewParameter');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    var CSSSelectorForm = '.orderParameterForm';\n    $(CSSSelectorForm + ' .datePickerClick').click(function () {\n      $(CSSSelectorForm + ' .datePicker').datepicker('show');\n    });\n    $(CSSSelectorForm + ' .orderParameterDeliveryAddress').select2({}).show();\n    $(CSSSelectorForm + ' input[name=contactName]').off('blur');\n    $(CSSSelectorForm + ' input[name=contactName]').off('keyup');\n    $(CSSSelectorForm + ' input[name=contactName]').on('blur', root.checkContactNameField);\n    $(CSSSelectorForm + ' input[name=contactName]').on('keyup', root.checkContactNameField);\n    $(CSSSelectorForm + ' input[name=orderType]').off('change');\n    $(CSSSelectorForm + ' input[name=orderType]').on('change', root.callChangeOrderType);\n    $(CSSSelectorForm + ' .orderParameterNextButton').off('click');\n    if (Order.getData()['id'] > 0) {\n      if (Order.getData()['orderType'] == 'weekly') {\n        root.initDatePicker(Order.getData()['orderType']);\n        $(CSSSelectorForm + \" input[name=orderType][value=\" + Order.getData()['orderType'] + \"]\").prop('checked', true);\n        var endDate = new Date(Order.getData()['deliveryDate']);\n        endDate.setDate(endDate.getDate() + 6);\n        root.setDeliveryDate(Order.getData()['deliveryDate'], $.datepicker.formatDate('yy-mm-dd', endDate));\n        root.initDatePicker('weekly');\n      } else {\n        if (Order.getData()['deliveryDate']) {\n          root.setDeliveryDate(Order.getData()['deliveryDate']);\n        }\n        root.initDatePicker('daily');\n      }\n      if (Order.getData()['contactName']) {\n        $(CSSSelectorForm + ' input[name=contactName]').val(Order.getData()['contactName']);\n      }\n      if (Order.getData()['note']) {\n        $(CSSSelectorForm + ' textarea[name=note]').val(Order.getData()['note']);\n      }\n      if (Order.getData()['deliveryAddressId']) {\n        console.log($(CSSSelectorForm + ' select[name=deliveryAddressId]'));\n        $(CSSSelectorForm + ' select[name=deliveryAddressId]').val(Order.getData()['deliveryAddressId']);\n      }\n      if (Order.getData()['customNotificationEmail']) {\n        console.log($(CSSSelectorForm + ' select[name=customNotificationEmail]'));\n        $(CSSSelectorForm + ' select[name=customNotificationEmail]').val(Order.getData()['customNotificationEmail']);\n      }\n    } else {\n      root.initDatePicker('daily');\n    }\n    $(CSSSelectorForm + ' .orderParameterDeliveryAddress').select2({}).show();\n    $(CSSSelectorForm + ' .orderParameterCustomNotificationEmail').select2({}).show();\n    $(CSSSelectorForm).submit(function (event) {\n      event.preventDefault();\n      if ($(CSSSelectorForm)[0].checkValidity() === false) {\n        debug('validaton false');\n        event.stopPropagation();\n        return;\n      } else {\n        debug('validaton ok');\n        //do your ajax submition here\n      }\n      $('.deliveryDatePlace').text($(CSSSelectorForm + ' input[name=deliveryDate]').val().replaceAll('-', '.') + '.');\n      Order.setData({\n        contactName: $(CSSSelectorForm + ' input[name=contactName]').val(),\n        note: $(CSSSelectorForm + ' textarea[name=note]').val(),\n        orderType: $(CSSSelectorForm + ' input:checked[name=orderType]').val(),\n        deliveryDate: $(CSSSelectorForm + ' input[name=deliveryDate]').val(),\n        deliveryAddressId: $(CSSSelectorForm + ' select[name=deliveryAddressId]').val(),\n        deliveryAddress: $(CSSSelectorForm + ' select[name=deliveryAddress]').val(),\n        customNotificationEmail: $(CSSSelectorForm + ' select[name=customNotificationEmail]').val()\n      });\n      console.group('parameter form submit');\n      console.error($(CSSSelectorForm + ' input:checked[name=orderType]').val());\n      console.error($(CSSSelectorForm + ' input[name=deliveryDate]').val());\n      debug(Order.getData());\n      console.groupEnd();\n      root.sendOrderDataToServer('parameter', root.afterOrderSetParameterOk);\n    });\n  };\n  this.blank = function () {};\n  this.setParameterCompleted = function () {\n    console.log('setParameterCompleted called');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    //root.initViewProductSelect()\n  };\n  this.bindRowFavoritesAction = function () {\n    $('.buttonItemFavorites').off('click');\n    $('.buttonItemFavorites').on('click', function () {\n      var productId = $(this).data('id');\n      console.log(productId);\n      var ajaxUrl = Opts.URL.toggleFavorites.replace('%id%', productId);\n      var ajaxData = {};\n      ajaxData._token = Opts.token;\n      var button = this;\n      console.log(ajaxUrl);\n      $.ajax({\n        url: ajaxUrl,\n        method: 'POST',\n        data: ajaxData,\n        success: function success(response) {\n          if (response.success) {\n            if (response.status) {\n              console.log('true');\n              $(button).addClass('btn-warning');\n              $(button).removeClass('btn-light');\n            } else {\n              $(button).removeClass('btn-warning');\n              $(button).addClass('btn-light');\n              console.log('false');\n            }\n          }\n        }\n      });\n      /*\n                          $(this).toggleClass('btn-warning');\n                          $(this).toggleClass('btn-light');\n      */\n    });\n  };\n  this.bindRowDescriptionAction = function () {\n    $('textarea.orderItemComment').on('change', function () {\n      var comment = $(this).val();\n      var productId = $(this).data('id');\n      var productComment = Order.getData('productComment');\n      if (productComment !== null) {\n        if (typeof productComment[productId] == 'undefined' && comment.length === 0) {\n          return;\n        }\n        if (productComment[productId] === comment) {\n          return;\n        }\n      }\n      productComment[productId] = comment;\n      if (comment.length === 0) {\n        delete Order.productComment[productId];\n      }\n      Order.productComment = productComment;\n      queueAjax.push(Date.now());\n      root.syncOrderDataToServer();\n    });\n  };\n  this.productSelectDatatablesRowFormatter = function (d) {\n    // `d` is the original data object for the row\n    /**\n    @todo: felszedni es updatelni az adott termek memojat az orderban\n     */\n    console.group('productSelectDatatablesRowFormatter');\n    console.log(d);\n    var templateData = d;\n    templateData.comment = '';\n    //        debug(Order);\n    if (Order.productComment && Order.productComment !== null) {\n      debug(_typeof(Order.productComment[d.id]));\n      if (typeof Order.productComment[d.id] != 'undefined' && Order.productComment[d.id].length > 0) {\n        templateData.comment = Order.productComment[d.id];\n      }\n    }\n    /** @typedef {boolean} d.favorites */\n    if (d.favorites === true) {\n      templateData.btnFavoritesClass = 'btn-warning';\n    } else {\n      templateData.btnFavoritesClass = 'btn-light';\n    }\n    var template = $('template[data-name=\"orderProductSelectDetails\"]').html();\n    templateData.weekly = false;\n    if (Order.getData().orderType === 'weekly') {\n      templateData.weekly = true;\n      /*\n      \n                  templateData.weeklyDay=[\n                      {\"index\":1,\"name\":\"Hétfő\"},\n                  {\"index\":2,\"name\":\"Kedd\"},\n                  {\"index\":3,\"name\":\"Szerda\"},\n                  {\"index\":4,\"name\":\"Csütörtök\"},\n                  {\"index\":5,\"name\":\"Péntek\"},\n                  {\"index\":6,\"name\":\"Szombat\"},\n                  {\"index\":7,\"name\":\"Vasárnap\"},\n                  ];\n      \n                  templateData.weeklyDay=[\n                      {\"index\":2,\"name\":\"Hétfő\" },\n                      {\"name\":\"Kedd\"},\n                      {\"name\":\"Szerda\"},\n                      {\"name\":\"Csütörtök\"},\n                      {\"name\":\"Péntek\"},\n                      {\"name\":\"Szombat\"},\n                      {\"name\":\"Vasárnap\"}\n                  ];\n      */\n    }\n    var productSelected = Order.getData('productSelected');\n    if (typeof productSelected[d.id] != 'undefined') {\n      templateData.itemQuantity = productSelected[d.id];\n    }\n    console.log(['templateData', templateData]);\n    var oldTags = Mustache.tags;\n    Mustache.tags = [\"~!\", \"!~\"];\n    if (templateData['specification'] == 'false' || templateData['specification'] == false) {\n      templateData.specificationClass = 'd-none';\n    }\n    templateData.pictureImg = '';\n    if (templateData['picture'] == 'false' || templateData['picture'] == false) {\n      templateData.pictureClass = 'd-none';\n    } else {\n      templateData.pictureImg = '<img src= \"' + templateData['picture'] + '\" class=\"productPicture\" ></img>';\n    }\n    console.log('templateData', templateData);\n    //templateData['aa_specification']=false;\n    var render = Mustache.render(template, templateData);\n    Mustache.tags = oldTags;\n    console.groupEnd();\n    return render;\n    /*\n    solution before template\n            return '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">'+\n                '<tr>'+\n                '<td>Info:</td>'+\n                '<td>'+d.note+'</td>'+\n                '</tr>'+\n                '<tr>'+\n                '<td>hooreyca :</td>'+\n                '<td><span style=\"padding-right: 2em;\">'+d.hooreycaId+'</span>' +\n    \n                '<button type=\"button\"\\n' +\n                '        data-id=\"'+d.id+'\"\\n' +\n                '        class=\"buttonItemFavorites btn '+btnFavoritesClass+'\">\\n' +\n                '    <i class=\"bi bi-star-fill pr-2\" aria-hidden=\"true\"></i>\\n' +\n                '    Kedvenc\\n' +\n                '</button>' +\n                '</td>'+\n                '</tr>'+\n                /!*\n                            '<tr>'+\n                            '<td>Extension number:</td>'+\n                            '<td>'+d.extn+'</td>'+\n                            '</tr>'+\n                *!/\n                '<tr>'+\n                '<td>Info:</td>'+\n                '<td>'+d.note+'</td>'+\n                '</tr>'+\n                '<tr>'+\n                '<td>Megjegyzés:</td>'+\n                '<td><textarea class=\"orderItemComment\" data-id=\"'+d.id+'\">'+comment+'</textarea></td>'+\n                '</tr>'+\n                /!*\n                *!/\n                '</table>';\n    */\n  };\n  this.setDatatableHeaderText = function (text) {\n    $('.tableHeaderText').text(text);\n  };\n  this.getTreePathName = function (node) {\n    var res = '';\n    var items = $(node).parents('li').toArray();\n    items.shift();\n    items.reverse();\n    for (var item in items) {\n      console.log($(items[item]).children('a.categoryItem'));\n      if ($(items[item]).children('a.categoryItem').length > 0) {\n        res += $(items[item]).children('a.categoryItem').text() + '/';\n      }\n    }\n    res += $(node).text();\n    console.log(res);\n    return res;\n  };\n  var selectedProductGroup = null;\n  var dataTableSearchStr = null;\n  var dataTableSearchKrel = false;\n  this.searchProductByString = function (filterStr) {\n    root.setDatatableHeaderText('Termékek szűrve:' + filterStr);\n    dataTableSearchStr = filterStr;\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n  this.clickSearchProduct = function () {\n    debug(this);\n    var filterStr = $('.sidebar-search input[name=searchValue]').val();\n    debug(filterStr);\n    root.searchProductByString(filterStr);\n  };\n  this.clickFavoritesProduct = function () {\n    debug('clickFavoritesProduct');\n    root.setDatatableHeaderText('Termékek szűrve: kedvencek');\n    dataTableSearchStr = '**favorites**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n  this.clickOftenProduct = function () {\n    debug('clickOftenProduct');\n    root.setDatatableHeaderText('Termékek szűrve: gyakran vásárolt');\n    dataTableSearchStr = '**often**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n  this.clickSpecialOffer = function () {\n    debug('clickSpecialOffer');\n    root.setDatatableHeaderText('Termékek szűrve: Akciós termékek');\n    dataTableSearchStr = '**specialOffer**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n  this.clickLastProduct = function () {\n    debug('clickLastProduct');\n    root.setDatatableHeaderText('Termékek szűrve: utoljára vásárolt');\n    dataTableSearchStr = '**last**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n  this.clickWeeklyProduct = function () {\n    debug('clickWeeklyProduct');\n    root.setDatatableHeaderText('Termékek szűrve: Heti termékek');\n    dataTableSearchStr = '**weekly**';\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n  this.clickKrelProduct = function () {\n    debug('clickKrelProduct');\n    //root.setDatatableHeaderText('Termékek szűrve: Heti termékek');\n    //dataTableSearchStr='**weekly**';\n    //$('.dataTableOrderProductSelect').DataTable().ajax.reload();\n    $(this).parent().toggleClass('krelActive');\n    dataTableSearchKrel = !dataTableSearchKrel;\n    $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n  };\n  this.productSelectDataTableColumnDefs = function () {\n    return [{\n      \"width\": \"10px\",\n      \"targets\": 0\n    }, {\n      \"className\": \"dt-left\",\n      \"targets\": 1\n    },\n    //                { \"width\": \"120px\", \"targets\": 1 },\n    {\n      \"width\": \"28px\",\n      \"targets\": 2\n    }, {\n      \"width\": \"41px\",\n      \"targets\": 3\n    }, {\n      \"width\": \"76px\",\n      \"targets\": 4\n    }, {\n      \"width\": \"55px\",\n      \"targets\": 5\n    }, {\n      \"width\": \"70px\",\n      \"targets\": 6\n    }, {\n      \"width\": \"54px\",\n      \"targets\": 7\n    }, {\n      \"width\": \"57px\",\n      \"targets\": 8\n    }, {\n      \"width\": \"42px\",\n      \"targets\": 9\n    }, {\n      \"width\": \"100px\",\n      \"targets\": 10\n    }, {\n      \"className\": \"dt-center\",\n      \"targets\": \"_all\"\n    }];\n  };\n  this.productSelectDataTableColumn = function () {\n    var columnData = [{\n      \"className\": 'details-control',\n      \"orderable\": false,\n      \"data\": null,\n      \"defaultContent\": ''\n    }, {\n      \"data\": \"name\"\n    }, {\n      \"data\": \"krel\"\n    }, {\n      \"data\": \"packing\"\n    }, {\n      \"data\": \"unitValue\"\n    }, {\n      \"data\": \"productUnit\"\n    }, {\n      \"data\": \"sellerUnit\"\n    }, {\n      \"data\": \"unitMultiplier\"\n    }, {\n      \"data\": \"amountUnit\"\n    }, {\n      \"data\": \"price\"\n    }];\n    var actionColumn = {\n      \"className\": 'details-control2',\n      \"orderable\": false,\n      \"data\": null,\n      \"width\": \"100px\",\n      \"defaultContent\": ''\n    };\n    if (Order.getData('orderType') == 'daily') {\n      actionColumn.defaultContent = '<input type=\"number\" value=\"0\" min=\"0\" max=\"9999\" step=\"1\" data-decimals=\"1\"  class=\"form-control-sm inputNumberSpinner\" style=\"width: 1em;\" \"/>'\n      /*\n                          \"defaultContent\":'<div class=\"input-group input-group-sm \">' +\n                              '<button style=\"min-width: 1.5rem\" class=\"btn-sm btn-decrement btn-outline-secondary btn-minus\" type=\"button\">' +\n                              '<strong>−</strong></button>' +\n                              '<input type=\"text\" inputmode=\"decimal\" style=\"text-align: center\" class=\"form-control \" placeholder=\"\">' +\n                              '<button style=\"min-width: 1.5rem\" class=\"btn-sm btn-increment btn-outline-secondary btn-plus\" type=\"button\">' +\n                              '<strong>+</strong></button>' +\n                              '</div>'\n      */;\n    }\n    columnData.push(actionColumn);\n    return columnData;\n  };\n  this.getDatatables = function (orderType) {\n    console.error(orderType);\n    var table = $('.dataTableOrderProductSelect').DataTable({\n      language: {\n        url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n      },\n      //\"ajax\": \"{{asset('exapmle2.json')}}\",\n      \"ajax\": {\n        url: Opts.URL.getDataTableContentProductList,\n        data: function data(_data) {\n          _data.searchStr = dataTableSearchStr;\n          _data.krel = dataTableSearchKrel;\n          _data.groupId = selectedProductGroup;\n          _data.supplierId = Order.supplierId;\n          _data.deliveryDate = Order.deliveryDate;\n        }\n      },\n      buttons: {\n        buttons: []\n      },\n      \"columnDefs\": root.productSelectDataTableColumnDefs(),\n      \"columns\": root.productSelectDataTableColumn(),\n      \"order\": [[1, 'asc']]\n    });\n    return table;\n  };\n  this.productSelectDataTableDrawDT = function (e) {\n    //debug( 'Table draw complete: '+new Date().getTime() );\n\n    //$('td:contains(\"*\")').html('<i class=\"bi bi-check-circle-fill\"></i>');\n    $(\"td\").filter(function () {\n      return $(this).text() === '*';\n    }).html('<i class=\"bi bi-check-circle-fill\"></i>');\n    if (Order.getData().orderType == 'daily') {\n      $(\"input[type='number'].inputNumberSpinner\").inputSpinner({\n        template: '<div class=\"input-group ${groupClass}\">' + '<button style=\"min-width: ${buttonsWidth}\" class=\"btn btn-sm btn-decrement ${buttonsClass}\" type=\"button\">${decrementButton}</button>' +\n        //'<input type=\"text\" inputmode=\"decimal\" style=\"text-align: ${textAlign}\" class=\"productQuantity form-control\"/>' +\n        '<input type=\"text\" step=\"0.1\" data-decimals=\"2\" style=\"text-align: ${textAlign}\" class=\"productQuantity form-control\"/>' + '<button style=\"min-width: ${buttonsWidth}\" class=\"btn btn-sm btn-increment ${buttonsClass}\" type=\"button\">${incrementButton}</button>' + '</div>',\n        buttonsWidth: \"0.5rem\",\n        groupClass: \"\",\n        // css class of the resulting input-group\n        buttonsClass: \"btn-outline-secondary\"\n      });\n    }\n    root.bindWeakUserHelper();\n    /*\n    ----------------------------------------------------------\n    change order quantity\n     */\n    $(\".dataTableOrderProductSelect .details-control2 input[type=text]\").off('change');\n    $(\".dataTableOrderProductSelect .details-control2 input[type=text]\").on('change', function (e) {\n      var quantity = $(this).val();\n      quantity = quantity.replace(',', '.');\n      quantity = parseFloat(quantity);\n      var rowData = $('.dataTableOrderProductSelect').DataTable().row($(this).closest('tr')).data();\n      root.orderItemsChange(rowData, quantity);\n    });\n    $(\".dataTableOrderProductSelect .details-control2 input[type=text]\").each(function () {\n      //debug('ez a function2')\n      var quantity = $(this).val();\n      var rowData = $('.dataTableOrderProductSelect').DataTable().row($(this).closest('tr')).data();\n      if (Order.productSelected[rowData.id]) {\n        debug(rowData);\n        debug($($(this).closest('tr').find('input[type=number]')[0]));\n        debug(Order.productSelected[rowData.id]);\n        var quantityCurrent = Order.productSelected[rowData.id];\n        if (typeof quantityCurrent != 'string') {\n          quantityCurrent += '';\n        }\n        $($(this).closest('tr').find('input[type=number]')[0]).val(quantityCurrent.replace(',', '.'));\n      }\n    });\n    $(\".dataTableOrderProductSelect .details-control2 button\").off('click');\n    $(\".dataTableOrderProductSelect .details-control2 button\").on('click', function () {\n      // debug('.details-control2 button click ')\n      // debug(this);\n      $(this).parent().find('input[type=text]').trigger('change');\n    });\n  };\n  this.initViewProductSelect = function () {\n    var functionName = 'initViewProductSelect';\n    console.log(functionName + ' called');\n    if (viewInicialized.includes(functionName)) {\n      return;\n    }\n    //debug(Object.getOwnPropertyNames(root));\n    root.setDatatableHeaderText('');\n    root.Stepper.setOpts({\n      onAfterActivate: function onAfterActivate() {}\n    });\n    //@note: be kell kapcsolni az elonezetet\n    root.Stepper.addCompleted('invoice');\n    root.Stepper.addEnabled('invoice');\n    var CSSSelectorForm = '.orderParameterForm';\n    //console.log(Opts.URL.getDataTableContentProductList);change\n    debug(CSSSelectorForm + ' .fa-search');\n    $('.sidebar-search .fa-search').off('click');\n    $('.sidebar-search .fa-search').on('click', root.clickSearchProduct);\n    $('a.sidebar.favorites').off('click');\n    $('a.sidebar.favorites').on('click', root.clickFavoritesProduct);\n    $('a.sidebar.often').off('click');\n    $('a.sidebar.often').on('click', root.clickOftenProduct);\n    $('a.sidebar.last').off('click');\n    $('a.sidebar.last').on('click', root.clickLastProduct);\n    $('a.sidebar.weekly').off('click');\n    $('a.sidebar.weekly').on('click', root.clickWeeklyProduct);\n    $('a.sidebar.krel').off('click');\n    $('a.sidebar.krel').on('click', root.clickKrelProduct);\n    $('a.sidebar.specialOffer').off('click');\n    $('a.sidebar.specialOffer').on('click', root.clickSpecialOffer);\n    $('.sidebar-search input[name=searchValue]').off('keypress');\n    $('.sidebar-search input[name=searchValue]').on('keypress', function (event) {\n      if (event.which == 13) {\n        event.preventDefault();\n      }\n      if ($(this).val().length >= 2) {\n        root.searchProductByString($(this).val() + event.key);\n      }\n    });\n    $('.sidebar-wrapper .sidebar-menu .sidebar-dropdown .sidebar-submenu li a.categoryItem.clickable').off('click');\n    $('.sidebar-wrapper .sidebar-menu .sidebar-dropdown .sidebar-submenu li a.categoryItem.clickable').on('click', function () {\n      var groupId = $(this).data('id');\n      selectedProductGroup = groupId;\n      dataTableSearchStr = null;\n      console.log(groupId);\n      console.log(root.getTreePathName(this));\n      root.setDatatableHeaderText(root.getTreePathName(this));\n      /*\n                      let ajaxData={\n                          'groupId':groupId,\n                          'supplier_id':Order.supplierId,\n                      };\n                      //$('.dataTableOrderProductSelect').DataTable().ajax.data(ajaxData).load();\n      \n      */\n      /*\n                      let ajaxUrl=Opts.URL.getDataTableContentProductList+'?groupId='+groupId+'&supplier_id='+Order.supplierId;\n                      $('.dataTableOrderProductSelect').DataTable().ajax.url(ajaxUrl).load();\n      */\n      $('.dataTableOrderProductSelect').DataTable().ajax.reload();\n    });\n    var table = root.getDatatables(Order.getData('orderType'));\n    $('.dataTableOrderProductSelect').on('init.dt', function () {\n      console.log('Table initialisation complete: ' + new Date().getTime());\n    }).dataTable();\n    $('.dataTableOrderProductSelect').on('draw.dt', root.productSelectDataTableDrawDT).dataTable();\n\n    //$('.dataTableOrderProductSelect').on( 'draw.dt',  ).dataTable();\n\n    $('.dataTableOrderProductSelect').on('xhr.dt', function () {\n      debug('Table xhr complete: ' + new Date().getTime());\n    }).dataTable();\n\n    //$(\"input[type='number'].inputNumberSpinner\").inputSpinner();\n\n    /*\n    ----------------------------------------------------------\n     Add event listener for opening and closing details\n     */\n\n    $('.dataTableOrderProductSelect tbody').on('click', 'td.details-control', function () {\n      var tr = $(this).closest('tr');\n      var row = table.row(tr);\n      if (row.child.isShown()) {\n        // This row is already open - close it\n        row.child.hide();\n        tr.removeClass('shown');\n      } else {\n        // Open this row\n        row.child(root.productSelectDatatablesRowFormatter(row.data())).show();\n        tr.addClass('shown');\n        root.bindProductDetailsAction();\n      }\n    });\n    viewInicialized.push(functionName);\n  };\n  this.bindProductDetailsAction = function () {\n    root.bindRowDescriptionAction();\n    root.bindRowFavoritesAction();\n    if (Order.getData()['orderType'] == 'weekly') {\n      root.bindOrderItemWeekQuantity();\n    }\n  };\n  this.bindWeakUserHelper = function () {\n    $(\"input.inputNumberSpinner\").off(\"focus\");\n    $(\"input.inputNumberSpinner\").on(\"focus\", function () {\n      var quantity = $(this).val();\n      quantity = quantity.replace(',', '.');\n      quantity = parseFloat(quantity);\n      if (quantity === 0) {\n        $(this).val('');\n      }\n    });\n    $(\"input[type=text].inputNumberSpinner\").off(\"keypress\");\n    $(\"input[type=text].inputNumberSpinner\").on(\"keypress\", function (event) {\n      if (event.which == 13) {\n        //                console.error('enter pressed');\n        var actualItem = this;\n        var items = $(\"input[type=text].inputNumberSpinner\");\n        items.each(function (item) {\n          //                    console.log(this);\n          if (this == actualItem) {\n            //                        console.error(item);\n            if (item + 1 <= items.length) {\n              //                            console.error(items[item+1]);\n              $(items[item + 1]).focus();\n            }\n            return false;\n          }\n        });\n      }\n    });\n  };\n  this.bindOrderItemWeekQuantity = function () {\n    $(\"input.productSelectDayQuantity\").off('change');\n    $(\"input.productSelectDayQuantity\").on('change', function () {\n      console.log(this.name);\n      console.log(this.value);\n      console.log($(this).data('dayindex'));\n      var rowData = null;\n      var rowNode = $($(this).closest('table.orderProductSelectRowDetailsTable').closest('tr')).prev();\n      rowData = $('.dataTableOrderProductSelect').DataTable().row(rowNode).data();\n      console.log(rowData);\n      var quantity = $(this).val();\n      quantity = quantity.replace(',', '.');\n      quantity = parseFloat(quantity);\n      console.log(rowData.id);\n      root.orderItemsChange(rowData, quantity, $(this).data('dayindex'));\n      //            root.orderItemsChange\n      //orderItemsChange\n      //quantity[1683][1]\n    });\n  };\n  this.afterSyncOrderDataToServer = function (data) {\n    //root.toggleEnableSend();\n    //console.log('most vegzett. ennyit kiszed'+batchNum);\n    for (var i = 0; i < queueAjax.length; i++) {\n      console.log('shiftel');\n      queueAjax.shift();\n    }\n    //console.log('remaining left '+queueAjax.length);\n    setTimeout(function () {\n      syncDoing = false;\n      root.syncOrderDataToServer();\n    }, Opts.dataSyncPauseTime);\n  };\n  var queueAjax = [];\n  var syncDoing = false;\n  this.syncOrderDataToServer = function () {\n    //debug(queueAjax);\n    if (syncDoing) {\n      //debug('sync in progress....');\n      return false;\n    }\n    if (queueAjax.length < 1) {\n      return;\n    }\n    syncDoing = true;\n    root.sendOrderDataToServer('productSelect', root.afterSyncOrderDataToServer);\n    return;\n  };\n  this.orderItemsChange = function (ItemData, quantity, dayIndex) {\n    /*\n            debug('-----------------');\n            debug(ItemData);\n            debug(quantity);\n            debug(Order.getData('productSelected'));\n            debug('-----------------');\n    \n    */\n    if (isNaN(quantity)) {\n      quantity = 0;\n    }\n    var productSelected = Order.getData('productSelected');\n    console.group('orderItemsChange');\n    console.log(['productSelected', productSelected]);\n    console.log(['ItemData', ItemData]);\n    console.log(['ItemData.id', ItemData.id]);\n    console.log(['quantity', quantity]);\n    console.log(['dayIndex', dayIndex]);\n    console.log(productSelected[ItemData.id]);\n    var productSelectedItem = productSelected[ItemData.id];\n    /*\n    ha 0 ertek jon es nem is volt akkor hamar kiugratjuk\n     */\n    if (quantity == 0) {\n      console.error('quantity==0');\n      if (typeof productSelectedItem == 'undefined') {\n        console.error('itt lep1');\n        console.groupEnd();\n        return;\n      }\n      if (dayIndex) {\n        console.log('van dayIndex');\n        if (typeof productSelected[ItemData.id][dayIndex] == 'undefined') {\n          console.log(['productSelectedItem', productSelectedItem]);\n          console.error('itt lep2');\n          console.groupEnd();\n          return;\n        }\n      }\n    }\n    /*\n    ha azonos az ertek kiugrunk\n     */\n    if (dayIndex) {\n      if (typeof productSelected[ItemData.id] != 'undefined' && typeof productSelected[ItemData.id][dayIndex] != 'undefined') {\n        if (productSelected[ItemData.id][dayIndex] == quantity) {\n          console.error('azonos napi');\n          console.groupEnd();\n          return;\n        }\n      }\n    } else {\n      if (productSelected[ItemData.id] == quantity) {\n        console.error('azonos');\n        console.groupEnd();\n        return;\n      }\n    }\n    if (quantity == 0) {\n      if (dayIndex) {\n        delete Order.productSelected[ItemData.id][dayIndex];\n        delete productSelected[ItemData.id][dayIndex];\n      } else {\n        delete Order.productSelected[ItemData.id];\n        delete productSelected[ItemData.id];\n      }\n    } else {\n      /*\n      ha van ertek erteket adunk!\n       */\n      if (dayIndex) {\n        if (typeof productSelected[ItemData.id] == 'undefined') {\n          productSelected[ItemData.id] = [];\n        }\n        console.log('set quantity productSelected[ItemData.id][dayIndex]', quantity);\n        productSelected[ItemData.id][dayIndex] = quantity;\n      } else {\n        productSelected[ItemData.id] = quantity;\n        console.log('set quantity productSelected[ItemData.id]', quantity);\n      }\n    }\n    console.log(['productSelected', productSelected]);\n    Order.productSelected = productSelected;\n    console.groupEnd();\n    queueAjax.push(Date.now());\n    root.syncOrderDataToServer();\n    return;\n    // removed by dead control flow\n\n    // removed by dead control flow\n\n    // removed by dead control flow\n\n    // removed by dead control flow\n\n    // removed by dead control flow\n\n    // removed by dead control flow\n\n    // removed by dead control flow\n\n    // removed by dead control flow\n\n\n    /*\n    debug(Order.getData('productSelected'));\n    debug('*******************');\n    */\n  };\n  this.initViewInvoice = function () {\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    if (Object.keys(Order.productSelected).length > 0) {\n      root.Stepper.addCompleted('send');\n      root.Stepper.addEnabled('send');\n    }\n    var styleStr = '<link rel=\"stylesheet\" href=\"' + Opts.URL.root + '/css/invoice.css\">';\n    $('table.invoice button.printButton').off('click');\n    $('table.invoice button.printButton').on('click', function () {\n      window.print();\n      return;\n      // removed by dead control flow\n var newWin; \n      // removed by dead control flow\n\n      // removed by dead control flow\n var print; \n      // removed by dead control flow\n\n      //            newWin.document.write($('table.invoice').prop('outerHTML'));\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n      // removed by dead control flow\n\n    });\n  };\n  this.resetOrder = function () {\n    root.init();\n    root.setDeliveryDate('-');\n    root.setSupplier('-');\n  };\n  this.afterOrderSendOk = function (data) {\n    Toast.create({\n      title: \"Sent!\",\n      message: 'Order Sent',\n      status: TOAST_STATUS.INFO,\n      timeout: 5000\n    });\n    $('.buttonOrderSend').off('click');\n    $('.buttonOrderSend').prop('disabled', true);\n    $('.statusNamePlace').removeClass('statusBlink');\n    $('.statusNamePlace').text('elküldve');\n    $('.buttonOrderSending').toggleClass('d-none');\n    $('.buttonOrderSendOk').toggleClass('d-none');\n    $('div.invoiceContainer').html(data.retHTML);\n    //root.resetOrder();\n  };\n  this.afterOrderSendError = function (data) {\n    $('.buttonOrderSend').toggleClass('d-none');\n    $('.buttonOrderSending').toggleClass('d-none');\n    $.each(APP.OrderModule.Stepper.getOpts().available, function (index, value) {\n      APP.OrderModule.Stepper.setEnabled(value);\n      APP.OrderModule.Stepper.setCompleted(value);\n    });\n  };\n  this.initViewSend = function () {\n    console.log('initViewSend called 2');\n    root.Stepper.setOpts({\n      onAfterLoad: function onAfterLoad() {}\n    });\n    $('.buttonOrderSend').off('click');\n    $('.buttonOrderSend').on('click', function () {\n      console.log('Send buton clicked');\n      //@todo: datasynchere and callback\n      $('.buttonOrderSend').toggleClass('d-none');\n      $('.buttonOrderSending').toggleClass('d-none');\n      /**\n       * PM158\n       */\n      $.each(APP.OrderModule.Stepper.getOpts().available, function (index, value) {\n        root.Stepper.unsetEnabled(value);\n        root.Stepper.unsetCompleted(value);\n      });\n      /**\n        */\n      root.sendOrderDataToServer('send', root.afterOrderSendOk, root.afterOrderSendError);\n\n      /*            let ajaxData={};\n                  ajaxData._token=Opts.token;\n                  ajaxData.send=true;\n                  $.extend(ajaxData,Order);\n                  $.ajax({\n                     url: Opts.URL.store,\n                      method:'POST',\n                      data:ajaxData,\n                      success:function (data) {\n                          if(data.success){\n                              root.afterOrderSendOk(data);\n                          }\n                      }\n                  });*/\n    });\n  };\n  this.testModeSend = function () {};\n  this.testMode = function () {\n    console.log('testMode called ');\n    Order.setData({\n      id: 234,\n      supplierId: 7,\n      productSelected: {\n        116: 3,\n        293: 2\n      },\n      contactName: 'Contact Name',\n      note: 'Note',\n      type: 'daily',\n      deliveryDate: Opts.defaultDeliveryDate,\n      deliveryAddress: 12\n    });\n    console.log(Order.getData());\n    console.log('*******************');\n    //root.Stepper.setOpts({'UrlData':{'supplierId':supplierId}});\n    root.Stepper.setOpts({\n      'UrlData': {\n        'supplierId': Order.supplierId,\n        id: Order.id\n      }\n    });\n    this.Stepper.init({\n      URL: {\n        create: Opts.URL.create\n      },\n      /*\n      csupasz az elejerol\n                  complete:['supplier'],\n                  enable: ['supplier'],\n                  active: 'supplier',\n                  onAfterActivate:this.initViewSupplier,\n      \n      product select\n                  complete:['supplier','parameter','productSelect'],\n                  enable: ['supplier','parameter','productSelect'],\n                  active: 'productSelect',\n                  onAfterActivate:this.initViewProductSelect,\n      \n      fullos\n                  complete:['supplier','parameter','productSelect','invoice'],\n                  enable: ['supplier','parameter','productSelect','invoice','send'],\n                  active: 'productSelect',\n                  onAfterActivate:this.initViewProductSelect,\n      \n      send\n                  complete:['supplier','parameter','productSelect','invoice','send'],\n                  enable: ['supplier','parameter','productSelect','invoice','send'],\n                  active: 'send',\n                  onAfterActivate:this.initViewProductSelect,\n      \n      */\n      complete: ['supplier', 'parameter', 'productSelect'],\n      enable: ['supplier', 'parameter', 'productSelect'],\n      active: 'productSelect',\n      onAfterActivate: this.initViewProductSelect,\n      autoCallback: {\n        invoice: {\n          onAfterActivate: root.initViewInvoice\n        },\n        send: {\n          onAfterActivate: root.initViewSend\n        }\n      }\n    });\n    console.log('*******************');\n  };\n  this.toggleEnableSend = function () {\n    console.log('toggleEnableSend called');\n    var ajaxUrl = Opts.URL.checkReadyToSend.replace('%id%', Order.id);\n    $.ajax({\n      url: ajaxUrl,\n      success: function success(data) {\n        if (data.success) {\n          if (data.readyToSend) {\n            root.Stepper.addCompleted('send');\n            /*\n                                    root.Stepper.addCompleted('invoice');\n                                    root.Stepper.addEnabled('invoice');\n            */\n            root.Stepper.addEnabled('send');\n          } else {\n            root.Stepper.unsetCompleted('send');\n            /*\n                                    root.Stepper.unsetCompleted('invoice');\n                                    root.Stepper.unsetEnabled('invoice');\n            */\n            root.Stepper.unsetEnabled('send');\n          }\n        }\n        console.log(data);\n      }\n    });\n  };\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 175624 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/order.js\n\n}");

/***/ },

/***/ "./resources/js/moduleJs/orderArchive.js"
/*!***********************************************!*\
  !*** ./resources/js/moduleJs/orderArchive.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 _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && \"function\" == typeof p ? function (t) { return p.apply(e, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nif (typeof window.DataModelOrderArchive === \"undefined\") {\n  window.OrderArchiveModulDefault = {\n    actionFunction: function actionFunction() {}\n  };\n  var _DataModelOrderArchive = /*#__PURE__*/function (_DataModel) {\n    /*\r\n     * Constructor\r\n     */\n    function _DataModelOrderArchive(data, options) {\n      var _this;\n      _classCallCheck(this, _DataModelOrderArchive);\n      _this = _callSuper(this, _DataModelOrderArchive, [data, options]);\n      if (typeof _this.items === \"undefined\") {\n        _this.items = {};\n      }\n      console.log(_this.constructor.name + ' constructor called');\n      return _this;\n    }\n    _inherits(_DataModelOrderArchive, _DataModel);\n    return _createClass(_DataModelOrderArchive);\n  }(DataModel);\n  ;\n  window.DataModelOrderArchive = _DataModelOrderArchive;\n}\nif (typeof window.OrderArchiveModule === \"undefined\") {\n  var OrderArchiveModule = /*#__PURE__*/function (_ModuleBase) {\n    function OrderArchiveModule(options, data) {\n      var _this2;\n      _classCallCheck(this, OrderArchiveModule);\n      _this2 = _callSuper(this, OrderArchiveModule, [options, data]);\n      if (data !== \"undefined\" || data != null) {} else {\n        _this2.data = new DataModelOrderArchive();\n      }\n      _this2.dataTable = null;\n      _this2.Opts.dataTable.advanceSearchParameter = {\n        deliveryDateFrom: null,\n        deliveryDateTo: null,\n        profitCenterId: null,\n        supplierId: null\n      };\n      return _this2;\n    }\n    _inherits(OrderArchiveModule, _ModuleBase);\n    return _createClass(OrderArchiveModule, [{\n      key: \"datatableRowActionAttachment\",\n      value: function datatableRowActionAttachment(rowData, node) {\n        debug('call datatableRowActionAttachment');\n        _superPropGet(OrderArchiveModule, \"datatableRowActionAttachment\", this, 3)([rowData, node, {\n          defaultFileName: \"order\"\n        }]);\n      }\n    }, {\n      key: \"datatableRowActionView\",\n      value: function datatableRowActionView(rowData, node) {\n        debug('call datatableRowActionView');\n        _superPropGet(OrderArchiveModule, \"datatableRowActionView\", this, 3)([rowData, node, APP.OrderArchiveModule]);\n        console.log('datatableRowActionEdit End');\n      }\n    }, {\n      key: \"datatableRowActionButtonClick\",\n      value: function datatableRowActionButtonClick(event) {\n        debug('datatableRowActionButtonClick');\n        _superPropGet(OrderArchiveModule, \"datatableRowActionButtonClick\", this, 3)([event, APP.OrderArchiveModule]);\n      }\n      /*\r\n      datatableRowActionButtonClick (event){\r\n          debug('datatableRowActionButtonClick');\r\n          let node=$(event[0].currentTarget);\r\n          let row=$(dataTableCSSSelector).DataTable().row(node.parents('tr'));\r\n          let rowData=row.data();\r\n          let actionName='datatableRowAction'+node.data('buttontype').capitalize();\r\n          if (typeof root[actionName] === \"function\") {\r\n              return root[actionName](rowData,node)\r\n          }\r\n      }\r\n      */\n    }, {\n      key: \"datatableRowActionEdit\",\n      value: function datatableRowActionEdit(rowData, node) {\n        console.log('datatableRowActionEdit Called');\n        //Opts.onAfterInitViewDetails=root.autofillDetails;\n        var ajaxUrl = this.Opts.URL.edit.replace('%id%', rowData.id);\n        console.log(this.Opts.URL);\n        console.log(ajaxUrl);\n        /*\r\n        */\n        APP.loadMainContent(ajaxUrl);\n        console.log('datatableRowActionEdit End');\n      }\n    }, {\n      key: \"initViewShow\",\n      value: function initViewShow() {\n        debug('call initViewShow');\n        var root = APP.OrderArchiveModule;\n        var styleStr = '<link rel=\"stylesheet\" href=\"' + root.Opts.URL.root + '/css/invoice.css\">';\n        $('table.invoice button.printButton').off('click');\n        $('table.invoice button.printButton').on('click', function () {\n          window.print();\n          return;\n          // removed by dead control flow\n var newWin; \n          // removed by dead control flow\n\n          // removed by dead control flow\n var print; \n          // removed by dead control flow\n\n          //            newWin.document.write($('table.invoice').prop('outerHTML'));\n          // removed by dead control flow\n\n          // removed by dead control flow\n\n          //                newWin.close();\n        });\n      }\n    }, {\n      key: \"datatableCustomHeadButtonClickCallBack\",\n      value: function datatableCustomHeadButtonClickCallBack() {\n        console.info('hello itt vagyok');\n        $('.advanceSearchModal').modal('show');\n      }\n    }, {\n      key: \"initAdvancedSearch\",\n      value: function initAdvancedSearch() {\n        console.log('initAdvancedSearch');\n        window.datePickerTarget = '';\n        $('.deliveryDateFrom,.deliveryDateTo').datepicker({\n          dateFormat: 'yy-mm-dd',\n          //minDate:new Date(),\n          onSelect: function onSelect(dateText) {\n            debug('target:' + window.datePickerTarget);\n            $('.' + window.datePickerTarget + 'SelectedDateText').text(dateText);\n            debug($(' input[name=\"' + window.datePickerTarget + '\"]'));\n            $(' input[name=\"' + window.datePickerTarget + '\"]').val(dateText);\n          }\n        });\n        $('.datePickerClick').click(function () {\n          debug($(this).data('target'));\n          datePickerTarget = $(this).data('target');\n          //$('.datePicker .'+datePickerTarget).datepicker('show');\n          $('.' + datePickerTarget).datepicker('show');\n        });\n        $(\".selectProfitCenter,.selectSupplier\").select2({\n          maximumSelectionLength: 1\n        });\n        /*\r\n        stored advanceSearchParameter restoring\r\n        */\n        var advanceFiltered = false;\n        $.each(this.Opts.dataTable.advanceSearchParameter, function (k, v) {\n          if (v != null) {\n            advanceFiltered = true;\n            console.log(k + ' > ' + v);\n            $('.advanceSearchModal input[name=' + k + '],.advanceSearchModal select[name=' + k + ']').val(v).trigger('change');\n            $('.' + k + 'SelectedDateText').text(v);\n          }\n        });\n        if (advanceFiltered) {\n          $('.dt-button.btn-advanceSearchParameter').addClass('btn-success');\n        }\n        /*\r\n        clearing advanceSearchParameter\r\n        */\n        $('.advanceSearchModal .buttonClear').off('click');\n        $('.advanceSearchModal .buttonClear').on('click', function () {\n          $('.advanceSearchModal input,.advanceSearchModal select').val('').trigger('change');\n          $('.SelectedDateText').text('\\xa0');\n          var root = APP.OrderArchiveModule;\n          $.each(root.Opts.dataTable.advanceSearchParameter, function (k, v) {\n            root.Opts.dataTable.advanceSearchParameter[k] = null;\n          });\n          $('.dt-button.btn-advanceSearchParameter').removeClass('btn-success');\n          var dataTableCSSSelector = root.Opts.CSSSelectorContainer + ' .dataTable';\n          $(dataTableCSSSelector).DataTable().ajax.reload();\n          $('.advanceSearchModal').modal('hide');\n        });\n\n        /*\r\n        process advanceSearchParameter\r\n        */\n        $('.advanceSearchModal .buttonSave').off('click');\n        $('.advanceSearchModal .buttonSave').on('click', function () {\n          console.log('clicked advanced search ');\n          var root = APP.OrderArchiveModule;\n          var dataSearch = $('.advanceSearchModalForm').find('input,select').serializeArray();\n          console.log(dataSearch);\n          console.log(root.Opts);\n          console.log(root.Opts.dataTable.advanceSearchParameter);\n          $.each(root.Opts.dataTable.advanceSearchParameter, function (k, v) {\n            root.Opts.dataTable.advanceSearchParameter[k] = null;\n          });\n          $.each(dataSearch, function (k, item) {\n            console.log(item['name']);\n            console.log(item['value']);\n            if (typeof root.Opts.dataTable.advanceSearchParameter[item['name']] != 'undefined' && item['value'].length > 0) {\n              root.Opts.dataTable.advanceSearchParameter[item['name']] = item['value'];\n            }\n          });\n          console.log(root.Opts.dataTable.advanceSearchParameter);\n          var dataTableCSSSelector = root.Opts.CSSSelectorContainer + ' .dataTable';\n          $(dataTableCSSSelector).DataTable().ajax.reload();\n          $('.dt-button.btn-advanceSearchParameter').addClass('btn-success');\n          $('.advanceSearchModal').modal('hide');\n        });\n      }\n    }, {\n      key: \"initViewList\",\n      value: function initViewList() {\n        var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        debug('listview inicialization');\n        if (APP.IsUserAdmin) {\n          this.DtColumns = [{\n            \"data\": \"supplier_name\"\n          }, {\n            \"data\": \"deliveryDate\"\n          }, {\n            \"data\": \"profit_center.name\"\n          }, {\n            \"data\": \"deliveryAddressName\"\n          }, {\n            \"data\": \"sentTime\"\n          }, {\n            \"data\": \"humanId\"\n          }, {\n            \"data\": \"confirmed\"\n          }, null];\n        } else {\n          this.DtColumns = [{\n            \"data\": \"supplier_name\"\n          }, {\n            \"data\": \"deliveryDate\"\n          }, {\n            \"data\": \"deliveryAddressName\"\n          }, {\n            \"data\": \"sentTime\"\n          }, {\n            \"data\": \"humanId\"\n          }, {\n            \"data\": \"confirmed\"\n          }, null];\n        }\n        var dataTableCSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable'; //\n        var colNum = $(dataTableCSSSelector + ' thead th').length; //buttons insert position need\n        APP.setOpts({\n          //datatableRowActionButtonClickCallBack:this.datatableRowActionButtonClick,\n          datatableRowActionButtonClickCallBack: this.datatableRowActionButtonClick,\n          datatableCustomHeadButtonClickCallBack: this.datatableCustomHeadButtonClickCallBack\n        });\n        var orderDirective = this.Opts.dataTable.orderDirective;\n        var advanceSearchParameter = this.Opts.dataTable.advanceSearchParameter;\n        if (typeof options['orderDirective'] != 'undefined') {\n          orderDirective = options['orderDirective'];\n        }\n        //let ajaxUrl=this.Opts.URL.getDataTableContent;\n        this.dataTable = $(dataTableCSSSelector).DataTable({\n          language: {\n            url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n          },\n          //\"ajax\": \"{{asset('exapmle2.json')}}\",\n          \"ajax\": {\n            url: this.Opts.URL.getDataTableContent,\n            data: function data(_data) {\n              _data.advanceSearchParameter = advanceSearchParameter;\n              /*\r\n              data.searchParam=this.Opts.dataTable.advanceSearchParameter\r\n                                      data.searchStr=dataTableSearchStr;\r\n                                      data.groupId=selectedProductGroup;\r\n                                      data.supplierId=Order.supplierId;\r\n                                      data.deliveryDate=Order.deliveryDate;\r\n              */\n            }\n          },\n          \"columnDefs\": [{\n            \"targets\": colNum - 1,\n            \"render\": function render(data, type, row) {\n              var buttons = APP.datatableAddRowViewButton(0, arguments);\n              buttons += APP.datatableAddRowAttachmentButton(0, arguments);\n              //buttons+=APP.datatableAddRowEditButton(0, arguments);\n              if (row.canEditable) {\n                buttons += APP.datatableAddRowEditButton(0, {\n                  title: \"módosítás\"\n                });\n              }\n              return buttons;\n            }\n          }, {\n            \"targets\": colNum - 2,\n            \"render\": function render(data, type, row) {\n              if (row.confirmed == null) {\n                return '<span class=\"badge badge-pill badge-danger\"><i class=\"fas fa-handshake-slash\"></i></span>';\n              } else {\n                return row.confirmed;\n              }\n            }\n          }, {\n            \"targets\": 1,\n            \"render\": function render(data, type, row) {\n              row = null;\n              return type === \"sort\" ? data.latinise() : data;\n            }\n          }\n          //{ \"visible\": false,  \"targets\": [ 0 ] }\n          ],\n          buttons: {\n            buttons: ['excel', 'pdf', {\n              extend: 'print',\n              //text: 'Print current page',\n              'title': 'title custom text',\n              'messageTop': 'Message On Top',\n              autoPrint: true\n            }, {\n              text: 'Szürők',\n              action: function action(e, dt, node, config) {\n                APP.datatableCustomHeadButtonClickCallBack();\n              },\n              className: 'btn-advanceSearchParameter'\n            }\n            /**/]\n          },\n          \"columns\": this.DtColumns,\n          \"order\": orderDirective,\n          \"stateSave\": false,\n          \"drawCallback\": function drawCallback(settings) {\n            settings = null;\n            APP.datatableAddRowAction(dataTableCSSSelector);\n          }\n        });\n        this.initAdvancedSearch();\n        debug('listview end');\n      }\n    }]);\n  }(ModuleBase);\n  window.OrderArchiveModule = OrderArchiveModule;\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 34940 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/orderArchive.js\n\n}");

/***/ },

/***/ "./resources/js/moduleJs/priceList.js"
/*!********************************************!*\
  !*** ./resources/js/moduleJs/priceList.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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && \"function\" == typeof p ? function (t) { return p.apply(e, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nif (typeof window.PriceListModule === \"undefined\") {\n  var PriceListModule = /*#__PURE__*/function (_ModuleBase) {\n    function PriceListModule() {\n      _classCallCheck(this, PriceListModule);\n      return _callSuper(this, PriceListModule, arguments);\n    }\n    _inherits(PriceListModule, _ModuleBase);\n    return _createClass(PriceListModule, [{\n      key: \"datatableRowActionAttachment\",\n      value: function datatableRowActionAttachment(rowData, node) {\n        debug('call datatableRowActionAttachment');\n        _superPropGet(PriceListModule, \"datatableRowActionAttachment\", this, 3)([rowData, node, {\n          defaultFileName: \"arlista.xls\"\n        }]);\n      }\n    }, {\n      key: \"datatableRowActionView\",\n      value: function datatableRowActionView(rowData, node) {\n        debug('call datatableRowActionView');\n      }\n    }, {\n      key: \"datatableRowActionButtonClick\",\n      value: function datatableRowActionButtonClick(event) {\n        debug('datatableRowActionButtonClick');\n        var rootObj = APP.PriceListModule;\n        var node = $(event[0].currentTarget);\n        var row = $(rootObj.Opts.dataTable.CSSSelector).DataTable().row(node.parents('tr'));\n        var rowData = row.data();\n        var actionName = 'datatableRowAction' + node.data('buttontype').capitalize();\n        if (typeof rootObj[actionName] === \"function\") {\n          return rootObj[actionName](rowData, node);\n        }\n      }\n    }, {\n      key: \"initViewList\",\n      value: function initViewList() {\n        var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        debug('listview inicialization');\n        var dataTableCSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable'; //\n        var colNum = $(dataTableCSSSelector + ' thead th').length; //buttons insert position need\n        APP.setOpts({\n          //datatableRowActionButtonClickCallBack:this.datatableRowActionButtonClick,\n          datatableRowActionButtonClickCallBack: this.datatableRowActionButtonClick\n        });\n        var orderDirective = this.Opts.dataTable.orderDirective;\n        if (typeof options['orderDirective'] != 'undefined') {\n          orderDirective = options['orderDirective'];\n        }\n        //let ajaxUrl=this.Opts.URL.getDataTableContent;\n        $(dataTableCSSSelector).DataTable({\n          language: {\n            url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n          },\n          //\"ajax\": \"{{asset('exapmle2.json')}}\",\n          \"ajax\": {\n            url: this.Opts.URL.getDataTableContent,\n            data: function data(_data) {\n              /*\r\n                                      data.searchStr=dataTableSearchStr;\r\n                                      data.groupId=selectedProductGroup;\r\n                                      data.supplierId=Order.supplierId;\r\n                                      data.deliveryDate=Order.deliveryDate;\r\n              */\n            }\n          },\n          \"columnDefs\": [{\n            \"targets\": colNum - 1,\n            \"render\": function render(data, type, row) {\n              if (row.fileUrl) {\n                var buttons = APP.datatableAddRowAttachmentButton(0, arguments);\n                return buttons;\n              } else {\n                return '';\n              }\n            }\n          }\n          /* {\r\n               \"targets\": 1,\r\n               \"render\": function ( data, type, row ) {\r\n                   row=null;\r\n                   return type === \"sort\" ? data.latinise() : data;\r\n               },\r\n           },*/\n          //{ \"visible\": false,  \"targets\": [ 0 ] }\n          ],\n          buttons: {\n            buttons: [\n              /*      'excel','pdf',\r\n                    {\r\n                        extend: 'print',\r\n                        //text: 'Print current page',\r\n                        'title': 'title custom text',\r\n                        'messageTop': 'Message On Top',\r\n                        autoPrint: true\r\n                    },\r\n              */ /**/\n            ]\n          },\n          \"columns\": [{\n            \"data\": \"id\"\n          }, {\n            \"data\": \"supplierName\"\n          }, {\n            \"data\": \"available\"\n          }, {\n            \"data\": \"created_at\"\n          }, {\n            \"data\": \"note\"\n          }, null],\n          \"order\": orderDirective,\n          //\"stateSave\": true,\n          \"drawCallback\": function drawCallback(settings) {\n            settings = null;\n            APP.datatableAddRowAction(dataTableCSSSelector);\n          }\n        });\n        debug('listview end');\n      }\n    }]);\n  }(ModuleBase);\n  ;\n  window.PriceListModule = PriceListModule;\n}\n;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 11704 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/priceList.js\n\n}");

/***/ },

/***/ "./resources/js/moduleJs/supplier.js"
/*!*******************************************!*\
  !*** ./resources/js/moduleJs/supplier.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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && \"function\" == typeof p ? function (t) { return p.apply(e, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nif (typeof window.SupplierModule === \"undefined\") {\n  var SupplierModule = /*#__PURE__*/function (_ModuleBase) {\n    function SupplierModule() {\n      _classCallCheck(this, SupplierModule);\n      return _callSuper(this, SupplierModule, arguments);\n    }\n    _inherits(SupplierModule, _ModuleBase);\n    return _createClass(SupplierModule, [{\n      key: \"datatableRowActionAttachment\",\n      value: function datatableRowActionAttachment(rowData, node) {\n        debug('call datatableRowActionAttachment');\n        _superPropGet(SupplierModule, \"datatableRowActionAttachment\", this, 3)([rowData, node, {\n          defaultFileName: \"arlista.xls\"\n        }]);\n      }\n    }, {\n      key: \"datatableRowActionView\",\n      value: function datatableRowActionView(rowData, node) {\n        debug('call datatableRowActionView');\n        _superPropGet(SupplierModule, \"datatableRowActionView\", this, 3)([rowData, node, APP.SupplierModule]);\n      }\n    }, {\n      key: \"datatableRowActionButtonClick\",\n      value: function datatableRowActionButtonClick(event) {\n        debug('datatableRowActionButtonClick');\n        var rootObj = APP.SupplierModule;\n        var node = $(event[0].currentTarget);\n        var row = $(rootObj.Opts.dataTable.CSSSelector).DataTable().row(node.parents('tr'));\n        var rowData = row.data();\n        var actionName = 'datatableRowAction' + node.data('buttontype').capitalize();\n        if (typeof rootObj[actionName] === \"function\") {\n          return rootObj[actionName](rowData, node);\n        }\n      }\n    }, {\n      key: \"initViewShow\",\n      value: function initViewShow() {\n        $('.productCategorySelect').select2({\n          disabled: true\n        });\n        $('.serviceSelect').select2({\n          disabled: true\n        });\n        APP.SupplierModule.renderContact();\n      }\n    }, {\n      key: \"initViewList\",\n      value: function initViewList() {\n        var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        debug('listview inicialization');\n        var dataTableCSSSelector = this.Opts.CSSSelectorContainer + ' .dataTable'; //\n        var colNum = $(dataTableCSSSelector + ' thead th').length; //buttons insert position need\n        APP.setOpts({\n          //datatableRowActionButtonClickCallBack:this.datatableRowActionButtonClick,\n          datatableRowActionButtonClickCallBack: this.datatableRowActionButtonClick\n        });\n        var orderDirective = this.Opts.dataTable.orderDirective;\n        if (typeof options['orderDirective'] != 'undefined') {\n          orderDirective = options['orderDirective'];\n        }\n        //let ajaxUrl=this.Opts.URL.getDataTableContent;\n        $(dataTableCSSSelector).DataTable({\n          language: {\n            url: '//cdn.datatables.net/plug-ins/1.10.24/i18n/Hungarian.json'\n          },\n          \"ajax\": {\n            url: this.Opts.URL.getDataTableContent,\n            data: function data(_data) {}\n          },\n          \"columnDefs\": [{\n            \"targets\": colNum - 1,\n            \"render\": function render(data, type, row) {\n              var buttons = APP.datatableAddRowViewButton(0, arguments);\n              return buttons;\n            }\n          }],\n          buttons: {\n            buttons: []\n          },\n          \"columns\": [{\n            \"data\": \"name\"\n          }, {\n            \"data\": \"product_group\"\n          }, {\n            \"data\": \"service\"\n          },\n          /*\r\n                                  { \"data\": \"hooreycaId\" },\r\n                                  { \"data\": \"nameId\" },\r\n                                  { \"data\": \"created_at\" },\r\n          */\n          null],\n          \"order\": orderDirective,\n          //\"stateSave\": true,\n          \"drawCallback\": function drawCallback(settings) {\n            settings = null;\n            APP.datatableAddRowAction(dataTableCSSSelector);\n          }\n        });\n        debug('listview end');\n      }\n    }, {\n      key: \"renderContact\",\n      value: function renderContact() {\n        var rowNum = 1;\n        console.log('renderingContacts');\n        $.each(APP.Supplier.getData('contact'), function () {\n          var contactData = this;\n          contactData.rowNum = rowNum;\n          //console.log(contactData);\n          var template = $('template[data-name=\"supplierContactTableRow\"]').html();\n          var render = Mustache.render(template, contactData);\n          $('.contactTable tbody').append(render);\n          rowNum++;\n        });\n      }\n    }]);\n  }(ModuleBase);\n  ;\n  window.SupplierModule = SupplierModule;\n}\n;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 12376 characters]\n//# sourceURL=webpack-internal:///./resources/js/moduleJs/supplier.js\n\n}");

/***/ }

/******/ 	});
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval-source-map devtool is used.
/******/ 	__webpack_modules__["./resources/js/moduleJs/moduleBase.js"]();
/******/ 	__webpack_modules__["./resources/js/moduleJs/order.js"]();
/******/ 	__webpack_modules__["./resources/js/moduleJs/orderArchive.js"]();
/******/ 	__webpack_modules__["./resources/js/moduleJs/priceList.js"]();
/******/ 	var __webpack_exports__ = {};
/******/ 	__webpack_modules__["./resources/js/moduleJs/supplier.js"]();
/******/ 	
/******/ })()
;