{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../demo7/src/js/pages/custom/inbox/inbox.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;;AAEA,2DAA2D;AAC3D,2DAA2D;;AAE3D;AACA;;AAEA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB,aAAa;;AAEb;AACA;AACA;;AAEA,oDAAoD,OAAO;AAC3D;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB,aAAa;;AAEb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC","file":"js/pages/custom/inbox/inbox.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"../demo7/src/js/pages/custom/inbox/inbox.js\");\n","\"use strict\";\r\n\r\n// Class definition\r\nvar KTAppInbox = function() {\r\n // Private properties\r\n var _asideEl;\r\n var _listEl;\r\n var _viewEl;\r\n var _composeEl;\r\n var _replyEl;\r\n var _asideOffcanvas;\r\n\r\n // Private methods\r\n var _initEditor = function(form, editor) {\r\n // init editor\r\n var options = {\r\n modules: {\r\n toolbar: {}\r\n },\r\n placeholder: 'Type message...',\r\n theme: 'snow'\r\n };\r\n\r\n // Init editor\r\n var editor = new Quill('#' + editor, options);\r\n\r\n // Customize editor\r\n var toolbar = KTUtil.find(form, '.ql-toolbar');\r\n var editor = KTUtil.find(form, '.ql-editor');\r\n\r\n if (toolbar) {\r\n KTUtil.addClass(toolbar, 'px-5 border-top-0 border-left-0 border-right-0');\r\n }\r\n\r\n if (editor) {\r\n KTUtil.addClass(editor, 'px-8');\r\n }\r\n }\r\n\r\n var _initForm = function(formEl) {\r\n var formEl = KTUtil.getById(formEl);\r\n\r\n // Init autocompletes\r\n var toEl = KTUtil.find(formEl, '[name=compose_to]');\r\n var tagifyTo = new Tagify(toEl, {\r\n delimiters: \", \", // add new tags when a comma or a space character is entered\r\n maxTags: 10,\r\n blacklist: [\"fuck\", \"shit\", \"pussy\"],\r\n keepInvalidTags: true, // do not remove invalid tags (but keep them marked as invalid)\r\n whitelist: [{\r\n value: 'Chris Muller',\r\n email: 'chris.muller@wix.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_11.jpg',\r\n class: 'tagify__tag--primary'\r\n }, {\r\n value: 'Nick Bold',\r\n email: 'nick.seo@gmail.com',\r\n initials: 'SS',\r\n initialsState: 'warning',\r\n pic: ''\r\n }, {\r\n value: 'Alon Silko',\r\n email: 'alon@keenthemes.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_6.jpg'\r\n }, {\r\n value: 'Sam Seanic',\r\n email: 'sam.senic@loop.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_8.jpg'\r\n }, {\r\n value: 'Sara Loran',\r\n email: 'sara.loran@tilda.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_9.jpg'\r\n }, {\r\n value: 'Eric Davok',\r\n email: 'davok@mix.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_13.jpg'\r\n }, {\r\n value: 'Sam Seanic',\r\n email: 'sam.senic@loop.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_13.jpg'\r\n }, {\r\n value: 'Lina Nilson',\r\n email: 'lina.nilson@loop.com',\r\n initials: 'LN',\r\n initialsState: 'danger',\r\n pic: './assets/media/users/100_15.jpg'\r\n }],\r\n templates: {\r\n dropdownItem: function(tagData) {\r\n try {\r\n var html = '';\r\n\r\n html += '
';\r\n html += '
';\r\n html += ' ';\r\n html += ' ' + (tagData.initials ? tagData.initials : '') + '';\r\n html += ' ';\r\n html += '
';\r\n html += ' '+ (tagData.value ? tagData.value : '') + '';\r\n html += ' ' + (tagData.email ? tagData.email : '') + '';\r\n html += '
';\r\n html += '
';\r\n html += '
';\r\n\r\n return html;\r\n } catch (err) {}\r\n }\r\n },\r\n transformTag: function(tagData) {\r\n tagData.class = 'tagify__tag tagify__tag--primary';\r\n },\r\n dropdown: {\r\n classname: \"color-blue\",\r\n enabled: 1,\r\n maxItems: 5\r\n }\r\n });\r\n\r\n var ccEl = KTUtil.find(formEl, '[name=compose_cc]');\r\n var tagifyCc = new Tagify(ccEl, {\r\n delimiters: \", \", // add new tags when a comma or a space character is entered\r\n maxTags: 10,\r\n blacklist: [\"fuck\", \"shit\", \"pussy\"],\r\n keepInvalidTags: true, // do not remove invalid tags (but keep them marked as invalid)\r\n whitelist: [{\r\n value: 'Chris Muller',\r\n email: 'chris.muller@wix.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_11.jpg',\r\n class: 'tagify__tag--primary'\r\n }, {\r\n value: 'Nick Bold',\r\n email: 'nick.seo@gmail.com',\r\n initials: 'SS',\r\n initialsState: 'warning',\r\n pic: ''\r\n }, {\r\n value: 'Alon Silko',\r\n email: 'alon@keenthemes.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_6.jpg'\r\n }, {\r\n value: 'Sam Seanic',\r\n email: 'sam.senic@loop.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_8.jpg'\r\n }, {\r\n value: 'Sara Loran',\r\n email: 'sara.loran@tilda.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_9.jpg'\r\n }, {\r\n value: 'Eric Davok',\r\n email: 'davok@mix.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_13.jpg'\r\n }, {\r\n value: 'Sam Seanic',\r\n email: 'sam.senic@loop.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_13.jpg'\r\n }, {\r\n value: 'Lina Nilson',\r\n email: 'lina.nilson@loop.com',\r\n initials: 'LN',\r\n initialsState: 'danger',\r\n pic: './assets/media/users/100_15.jpg'\r\n }],\r\n templates: {\r\n dropdownItem: function(tagData) {\r\n try {\r\n var html = '';\r\n\r\n html += '
';\r\n html += '
';\r\n html += ' ';\r\n html += ' ' + (tagData.initials ? tagData.initials : '') + '';\r\n html += ' ';\r\n html += '
';\r\n html += ' '+ (tagData.value ? tagData.value : '') + '';\r\n html += ' ' + (tagData.email ? tagData.email : '') + '';\r\n html += '
';\r\n html += '
';\r\n html += '
';\r\n\r\n return html;\r\n } catch (err) {}\r\n }\r\n },\r\n transformTag: function(tagData) {\r\n tagData.class = 'tagify__tag tagify__tag--primary';\r\n },\r\n dropdown: {\r\n classname: \"color-blue\",\r\n enabled: 1,\r\n maxItems: 5\r\n }\r\n });\r\n\r\n var bccEl = KTUtil.find(formEl, '[name=compose_bcc]');\r\n var tagifyBcc = new Tagify(bccEl, {\r\n delimiters: \", \", // add new tags when a comma or a space character is entered\r\n maxTags: 10,\r\n blacklist: [\"fuck\", \"shit\", \"pussy\"],\r\n keepInvalidTags: true, // do not remove invalid tags (but keep them marked as invalid)\r\n whitelist: [{\r\n value: 'Chris Muller',\r\n email: 'chris.muller@wix.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_11.jpg',\r\n class: 'tagify__tag--primary'\r\n }, {\r\n value: 'Nick Bold',\r\n email: 'nick.seo@gmail.com',\r\n initials: 'SS',\r\n initialsState: 'warning',\r\n pic: ''\r\n }, {\r\n value: 'Alon Silko',\r\n email: 'alon@keenthemes.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_6.jpg'\r\n }, {\r\n value: 'Sam Seanic',\r\n email: 'sam.senic@loop.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_8.jpg'\r\n }, {\r\n value: 'Sara Loran',\r\n email: 'sara.loran@tilda.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_9.jpg'\r\n }, {\r\n value: 'Eric Davok',\r\n email: 'davok@mix.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_13.jpg'\r\n }, {\r\n value: 'Sam Seanic',\r\n email: 'sam.senic@loop.com',\r\n initials: '',\r\n initialsState: '',\r\n pic: './assets/media/users/100_13.jpg'\r\n }, {\r\n value: 'Lina Nilson',\r\n email: 'lina.nilson@loop.com',\r\n initials: 'LN',\r\n initialsState: 'danger',\r\n pic: './assets/media/users/100_15.jpg'\r\n }],\r\n templates: {\r\n dropdownItem: function(tagData) {\r\n try {\r\n var html = '';\r\n\r\n html += '
';\r\n html += '
';\r\n html += ' ';\r\n html += ' ' + (tagData.initials ? tagData.initials : '') + '';\r\n html += ' ';\r\n html += '
';\r\n html += ' '+ (tagData.value ? tagData.value : '') + '';\r\n html += ' ' + (tagData.email ? tagData.email : '') + '';\r\n html += '
';\r\n html += '
';\r\n html += '
';\r\n\r\n return html;\r\n } catch (err) {}\r\n }\r\n },\r\n transformTag: function(tagData) {\r\n tagData.class = 'tagify__tag tagify__tag--primary';\r\n },\r\n dropdown: {\r\n classname: \"color-blue\",\r\n enabled: 1,\r\n maxItems: 5\r\n }\r\n });\r\n\r\n // CC input show\r\n KTUtil.on(formEl, '[data-inbox=\"cc-show\"]', 'click', function(e) {\r\n var inputEl = KTUtil.find(formEl, '.inbox-to-cc');\r\n KTUtil.removeClass(inputEl, 'd-none');\r\n KTUtil.addClass(inputEl, 'd-flex');\r\n KTUtil.find(formEl, \"[name=compose_cc]\").focus();\r\n });\r\n\r\n // CC input hide\r\n KTUtil.on(formEl, '[data-inbox=\"cc-hide\"]', 'click', function(e) {\r\n var inputEl = KTUtil.find(formEl, '.inbox-to-cc');\r\n KTUtil.removeClass(inputEl, 'd-flex');\r\n KTUtil.addClass(inputEl, 'd-none');\r\n });\r\n\r\n // BCC input show\r\n KTUtil.on(formEl, '[data-inbox=\"bcc-show\"]', 'click', function(e) {\r\n var inputEl = KTUtil.find(formEl, '.inbox-to-bcc');\r\n KTUtil.removeClass(inputEl, 'd-none');\r\n KTUtil.addClass(inputEl, 'd-flex');\r\n KTUtil.find(formEl, \"[name=compose_bcc]\").focus();\r\n });\r\n\r\n // BCC input hide\r\n KTUtil.on(formEl, '[data-inbox=\"bcc-hide\"]', 'click', function(e) {\r\n var inputEl = KTUtil.find(formEl, '.inbox-to-bcc');\r\n KTUtil.removeClass(inputEl, 'd-flex');\r\n KTUtil.addClass(inputEl, 'd-none');\r\n });\r\n }\r\n\r\n var _initAttachments = function(elemId) {\r\n var id = \"#\" + elemId;\r\n var previewNode = $(id + \" .dropzone-item\");\r\n previewNode.id = \"\";\r\n var previewTemplate = previewNode.parent('.dropzone-items').html();\r\n previewNode.remove();\r\n\r\n var myDropzone = new Dropzone(id, { // Make the whole body a dropzone\r\n url: \"https://keenthemes.com/scripts/void.php\", // Set the url for your upload script location\r\n parallelUploads: 20,\r\n maxFilesize: 1, // Max filesize in MB\r\n previewTemplate: previewTemplate,\r\n previewsContainer: id + \" .dropzone-items\", // Define the container to display the previews\r\n clickable: id + \"_select\" // Define the element that should be used as click trigger to select files.\r\n });\r\n\r\n myDropzone.on(\"addedfile\", function(file) {\r\n // Hookup the start button\r\n $(document).find(id + ' .dropzone-item').css('display', '');\r\n });\r\n\r\n // Update the total progress bar\r\n myDropzone.on(\"totaluploadprogress\", function(progress) {\r\n document.querySelector(id + \" .progress-bar\").style.width = progress + \"%\";\r\n });\r\n\r\n myDropzone.on(\"sending\", function(file) {\r\n // Show the total progress bar when upload starts\r\n document.querySelector(id + \" .progress-bar\").style.opacity = \"1\";\r\n });\r\n\r\n // Hide the total progress bar when nothing's uploading anymore\r\n myDropzone.on(\"complete\", function(progress) {\r\n var thisProgressBar = id + \" .dz-complete\";\r\n setTimeout(function() {\r\n $(thisProgressBar + \" .progress-bar, \" + thisProgressBar + \" .progress\").css('opacity', '0');\r\n }, 300)\r\n });\r\n }\r\n\r\n // Public methods\r\n return {\r\n // Public functions\r\n init: function() {\r\n // Init variables\r\n _asideEl = KTUtil.getById('kt_inbox_aside');\r\n _listEl = KTUtil.getById('kt_inbox_list');\r\n _viewEl = KTUtil.getById('kt_inbox_view');\r\n _composeEl = KTUtil.getById('kt_inbox_compose');\r\n _replyEl = KTUtil.getById('kt_inbox_reply');\r\n\r\n // Init handlers\r\n KTAppInbox.initAside();\r\n KTAppInbox.initList();\r\n KTAppInbox.initView();\r\n KTAppInbox.initReply();\r\n KTAppInbox.initCompose();\r\n },\r\n\r\n initAside: function() {\r\n // Mobile offcanvas for mobile mode\r\n _asideOffcanvas = new KTOffcanvas(_asideEl, {\r\n overlay: true,\r\n baseClass: 'offcanvas-mobile',\r\n //closeBy: 'kt_inbox_aside_close',\r\n toggleBy: 'kt_subheader_mobile_toggle'\r\n });\r\n\r\n // View list\r\n KTUtil.on(_asideEl, '.list-item[data-action=\"list\"]', 'click', function(e) {\r\n var type = KTUtil.attr(this, 'data-type');\r\n var listItemsEl = KTUtil.find(_listEl, '.kt-inbox__items');\r\n var navItemEl = this.closest('.kt-nav__item');\r\n var navItemActiveEl = KTUtil.find(_asideEl, '.kt-nav__item.kt-nav__item--active');\r\n\r\n // demo loading\r\n var loading = new KTDialog({\r\n 'type': 'loader',\r\n 'placement': 'top center',\r\n 'message': 'Loading ...'\r\n });\r\n loading.show();\r\n\r\n setTimeout(function() {\r\n loading.hide();\r\n\r\n KTUtil.css(_listEl, 'display', 'flex'); // show list\r\n KTUtil.css(_viewEl, 'display', 'none'); // hide view\r\n\r\n KTUtil.addClass(navItemEl, 'kt-nav__item--active');\r\n KTUtil.removeClass(navItemActiveEl, 'kt-nav__item--active');\r\n\r\n KTUtil.attr(listItemsEl, 'data-type', type);\r\n }, 600);\r\n });\r\n },\r\n\r\n initList: function() {\r\n // View message\r\n KTUtil.on(_listEl, '[data-inbox=\"message\"]', 'click', function(e) {\r\n var actionsEl = KTUtil.find(this, '[data-inbox=\"actions\"]');\r\n\r\n // skip actions click\r\n if (e.target === actionsEl || (actionsEl && actionsEl.contains(e.target) === true)) {\r\n return false;\r\n }\r\n\r\n // Demo loading\r\n var loading = new KTDialog({\r\n 'type': 'loader',\r\n 'placement': 'top center',\r\n 'message': 'Loading ...'\r\n });\r\n loading.show();\r\n\r\n setTimeout(function() {\r\n loading.hide();\r\n\r\n KTUtil.addClass(_listEl, 'd-none');\r\n KTUtil.removeClass(_listEl, 'd-block');\r\n\r\n KTUtil.addClass(_viewEl, 'd-block');\r\n KTUtil.removeClass(_viewEl, 'd-none');\r\n }, 700);\r\n });\r\n\r\n // Group selection\r\n KTUtil.on(_listEl, '[data-inbox=\"group-select\"] input', 'click', function() {\r\n var messages = KTUtil.findAll(_listEl, '[data-inbox=\"message\"]');\r\n\r\n for (var i = 0, j = messages.length; i < j; i++) {\r\n var message = messages[i];\r\n var checkbox = KTUtil.find(message, '.checkbox input');\r\n checkbox.checked = this.checked;\r\n\r\n if (this.checked) {\r\n KTUtil.addClass(message, 'active');\r\n } else {\r\n KTUtil.removeClass(message, 'active');\r\n }\r\n }\r\n });\r\n\r\n // Individual selection\r\n KTUtil.on(_listEl, '[data-inbox=\"message\"] [data-inbox=\"actions\"] .checkbox input', 'click', function() {\r\n var item = this.closest('[data-inbox=\"message\"]');\r\n\r\n if (item && this.checked) {\r\n KTUtil.addClass(item, 'active');\r\n } else {\r\n KTUtil.removeClass(item, 'active');\r\n }\r\n });\r\n },\r\n\r\n initView: function() {\r\n // Back to listing\r\n KTUtil.on(_viewEl, '[data-inbox=\"back\"]', 'click', function() {\r\n // demo loading\r\n var loading = new KTDialog({\r\n 'type': 'loader',\r\n 'placement': 'top center',\r\n 'message': 'Loading ...'\r\n });\r\n\r\n loading.show();\r\n\r\n setTimeout(function() {\r\n loading.hide();\r\n\r\n KTUtil.addClass(_listEl, 'd-block');\r\n KTUtil.removeClass(_listEl, 'd-none');\r\n\r\n KTUtil.addClass(_viewEl, 'd-none');\r\n KTUtil.removeClass(_viewEl, 'd-block');\r\n }, 700);\r\n });\r\n\r\n // Expand/Collapse reply\r\n KTUtil.on(_viewEl, '[data-inbox=\"message\"]', 'click', function(e) {\r\n var message = this.closest('[data-inbox=\"message\"]');\r\n\r\n var dropdownToggleEl = KTUtil.find(this, '[data-toggle=\"dropdown\"]');\r\n var toolbarEl = KTUtil.find(this, '[data-inbox=\"toolbar\"]');\r\n\r\n // skip dropdown toggle click\r\n if (e.target === dropdownToggleEl || (dropdownToggleEl && dropdownToggleEl.contains(e.target) === true)) {\r\n return false;\r\n }\r\n\r\n // skip group actions click\r\n if (e.target === toolbarEl || (toolbarEl && toolbarEl.contains(e.target) === true)) {\r\n return false;\r\n }\r\n\r\n if (KTUtil.hasClass(message, 'toggle-on')) {\r\n KTUtil.addClass(message, 'toggle-off');\r\n KTUtil.removeClass(message, 'toggle-on');\r\n } else {\r\n KTUtil.removeClass(message, 'toggle-off');\r\n KTUtil.addClass(message, 'toggle-on');\r\n }\r\n });\r\n },\r\n\r\n initReply: function() {\r\n _initEditor(_replyEl, 'kt_inbox_reply_editor');\r\n _initAttachments('kt_inbox_reply_attachments');\r\n _initForm('kt_inbox_reply_form');\r\n },\r\n\r\n initCompose: function() {\r\n _initEditor(_composeEl, 'kt_inbox_compose_editor');\r\n _initAttachments('kt_inbox_compose_attachments');\r\n _initForm('kt_inbox_compose_form');\r\n\r\n // Remove reply form\r\n KTUtil.on(_composeEl, '[data-inbox=\"dismiss\"]', 'click', function(e) {\r\n swal.fire({\r\n text: \"Are you sure to discard this message ?\",\r\n type: \"danger\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Discard draft\",\r\n confirmButtonClass: \"btn btn-danger\",\r\n showCancelButton: true,\r\n cancelButtonText: \"Cancel\",\r\n cancelButtonClass: \"btn btn-light-primary\"\r\n }).then(function(result) {\r\n $(_composeEl).modal('hide');\r\n });\r\n });\r\n }\r\n };\r\n}();\r\n\r\n// Class Initialization\r\njQuery(document).ready(function() {\r\n KTAppInbox.init();\r\n});\r\n"],"sourceRoot":""}