1 line
170 KiB
Plaintext
1 line
170 KiB
Plaintext
{"version":3,"file":"app.min.js","sources":["../../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../../UILib/ui-lib/lib/app/communications/internal.js","../../../../../../UILib/ui-lib/lib/app/communications/comments.js"],"sourcesContent":["import { createElement, setTooltip, showAlert, createPicture, createAudio, createVideo, createFile, createIcon, Popup, Grid, Dropdown } from \"../../ui\";\r\nimport { global, isEmail } from \"../../utility\";\r\n\r\nexport function createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n};\r\n\r\nexport function appendMedia(container, mimeType, url) {\r\n switch (mimeType) {\r\n case 'application/pdf':\r\n case '.pdf':\r\n container.appendChild(createFile(url, 'file-pdf'));\r\n break;\r\n case 'application/msword':\r\n case 'application/vnd.ms-word':\r\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\r\n case '.doc':\r\n case '.docx':\r\n container.appendChild(createFile(url, 'file-word'));\r\n break;\r\n case 'application/vnd.ms-excel':\r\n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\r\n case '.xls':\r\n case '.xlsx':\r\n container.appendChild(createFile(url, 'file-excel'));\r\n break;\r\n case 'application/vnd.ms-powerpoint':\r\n case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':\r\n case '.ppt':\r\n case '.pptx':\r\n container.appendChild(createFile(url, 'file-powerpoint'));\r\n break;\r\n case 'application/smil':\r\n case '.smil':\r\n // TODO: ignore smil files\r\n // container.appendChild(createFile(url, 'smile'));\r\n break;\r\n case 'audio/aac':\r\n case 'audio/amr':\r\n case 'audio/mp3':\r\n case 'audio/mpeg':\r\n case 'audio/x-mpeg':\r\n case 'audio/ogg':\r\n case 'audio/opus':\r\n case 'audio/wav':\r\n case 'audio/webm':\r\n case '.aac':\r\n case '.amr':\r\n case '.mp3':\r\n case '.ogg':\r\n case '.opus':\r\n case '.wav':\r\n container.appendChild(createAudio(mimeType, url));\r\n break;\r\n case 'text/plain':\r\n case 'text/x-vcard':\r\n case '.txt':\r\n case '.vcard':\r\n container.appendChild(createFile(url, 'id-card'));\r\n break;\r\n case 'video/3gpp':\r\n case 'video/mp2t':\r\n case 'video/mp4':\r\n case 'video/mpeg':\r\n case 'video/x-mpeg':\r\n case 'video/quicktime':\r\n case 'video/webm':\r\n case '.3gp':\r\n case '.3gpp':\r\n case '.mp4':\r\n case '.mpg':\r\n case '.mov':\r\n case '.webm':\r\n container.appendChild(createVideo(url));\r\n break;\r\n case '.jpg':\r\n case '.jpeg':\r\n case '.jfif':\r\n case '.png':\r\n case '.gif':\r\n case '.bmp':\r\n container.appendChild(createPicture(url));\r\n break;\r\n default:\r\n if (/^image\\//.test(mimeType)) {\r\n container.appendChild(createPicture(url));\r\n } else if (/^audio\\//.test(mimeType)) {\r\n container.appendChild(createFile(url, 'music'));\r\n } else if (/^video\\//.test(mimeType)) {\r\n container.appendChild(createFile(url, 'video'));\r\n } else {\r\n container.appendChild(createFile(url));\r\n }\r\n break;\r\n }\r\n return container;\r\n};\r\n\r\nconst MaxAttachmentSize = {\r\n limit: 1_258_291,\r\n text: '1.2MB'\r\n};\r\n\r\nexport const fileSupported = [\r\n '.amr',\r\n '.ogv',\r\n 'application/msword',\r\n 'application/vnd.ms-word',\r\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n 'application/vnd.ms-excel',\r\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\r\n 'application/vnd.ms-powerpoint',\r\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\r\n 'application/pdf',\r\n 'audio/aac',\r\n 'audio/amr',\r\n 'audio/mp3',\r\n 'audio/mpeg',\r\n 'audio/x-mpeg',\r\n 'audio/ogg',\r\n 'audio/opus',\r\n 'audio/wav',\r\n 'audio/webm',\r\n 'image/bmp',\r\n 'image/gif',\r\n 'image/jpeg',\r\n 'image/jfif',\r\n 'image/png',\r\n 'image/tiff',\r\n 'image/webp',\r\n 'text/plain',\r\n 'text/vcard',\r\n 'text/x-vcard',\r\n 'video/3gpp',\r\n 'video/mp2t',\r\n 'video/mp4',\r\n 'video/mpeg',\r\n 'video/x-mpeg',\r\n 'video/quicktime',\r\n 'video/webm',\r\n];\r\n\r\nexport function insertFile(container, file, r) {\r\n const label = container.querySelector('.file-selector>.selector-name');\r\n if (label != null && file != null) {\r\n let type = file.type;\r\n if (type == null || type.length === 0) {\r\n type = file.name;\r\n type = type.substring(type.lastIndexOf('.'));\r\n }\r\n if (fileSupported.indexOf(type) < 0) {\r\n showAlert(r('P_WO_ERROR', 'Error'), r('P_CU_TYPENOTSUPPORTED', 'File type \"{type}\" is now not supported.').replace('{type}', type));\r\n return;\r\n }\r\n const isImage = /^image\\//.test(type);\r\n if (!isImage && file.size > MaxAttachmentSize.limit) {\r\n showAlert(r('P_WO_ERROR', 'Error'), r('P_WO_ATTACHMENTSIZEEXCEEDSTHEMAXIMUMTIPS', `Attachment size exceeds the maximum allowed to be sent (${MaxAttachmentSize.text})`), 'warn');\r\n return;\r\n }\r\n const fn = file.name;\r\n label.style.display = '';\r\n label.innerText = fn;\r\n if (isImage) {\r\n const img = new Image();\r\n const reader = new FileReader();\r\n reader.onload = e => {\r\n img.src = e.target.result;\r\n setTooltip(label, img);\r\n };\r\n reader.onerror = () => setTooltip(label, fn);\r\n reader.readAsDataURL(file);\r\n // img.src = URL.createObjectURL(file);\r\n // setTooltip(label, img);\r\n } else {\r\n setTooltip(label, fn);\r\n }\r\n return file;\r\n }\r\n};\r\n\r\nfunction getStatusText(status, dict) {\r\n switch (status) {\r\n case 0:\r\n case 1:\r\n case 5:\r\n case 6:\r\n return dict[status];\r\n case 9:\r\n case 10:\r\n case 412:\r\n return dict[9];\r\n default:\r\n return dict[9999];\r\n }\r\n}\r\n\r\nexport function getMessageStatus(comm, r, _var) {\r\n const messageStatus = {\r\n 0: r('P_CU_PENDING', 'Pending'),\r\n 1: r('P_WO_SENT', 'Sent'),\r\n 5: r('P_CU_DELIVERYCONFIRMED', 'Delivery Confirmed'),\r\n 6: r('P_CU_RESENT', 'Resent'),\r\n 9: r('P_MA_FAILED', 'Failed'),\r\n 9999: r('P_CU_UNKNOWN', 'Unknown')\r\n };\r\n const knownStatus = [0, 1, 5, 6, 9, 10, 412];\r\n const okStatus = [1, 5, 6];\r\n const failedStatus = [9, 10, 412];\r\n\r\n let status = -100; // 没有状态,页面上不显示\r\n const ls = [];\r\n const msgs = [];\r\n if (!comm.StatusIncorrect && comm.Participator?.length > 0) {\r\n // if (comm.Id === 433339) {\r\n // comm.Participator[4].Status = 6;\r\n // }\r\n for (let p of comm.Participator) {\r\n if (!isEmail(p.CustomerNumber)) {\r\n if (ls.indexOf(p.Status) < 0) {\r\n ls.push(p.Status);\r\n }\r\n p.statusText = getStatusText(p.Status, messageStatus);\r\n msgs.push(p);\r\n }\r\n }\r\n }\r\n if (ls.length === 1) {\r\n status = ls[0];\r\n } else if (ls.length > 1) {\r\n // status = -10; // 多种状态\r\n status = ls\r\n .filter(s => okStatus.indexOf(s) < 0) // ok status\r\n .sort((a, b) => b - a)[0] ?? 1;\r\n }\r\n const statusText = messageStatus[failedStatus.includes(status) ? 9 : status] ?? messageStatus[9999];\r\n const statusColor = okStatus.includes(status) ? null : '#ffc107';\r\n const statusUpdatable = _var.option.statusUpdatable;\r\n let statusTips;\r\n if (statusUpdatable !== false || ls.length > 1) {\r\n statusTips = createElement('div', tip => {\r\n for (let i = 0; i < msgs.length; ++i) {\r\n tip.appendChild(createElement('div', t => {\r\n const p = msgs[i];\r\n if (statusUpdatable !== false && p.StatusChanged) {\r\n t.append(\r\n createElement('span', s => s.innerText = `${p.CustomerNumber}: `),\r\n createElement('span', s => {\r\n s.style.color = '#2140fb';\r\n s.style.cursor = 'pointer';\r\n s.innerText = p.statusText;\r\n s.addEventListener('click', () => {\r\n if (typeof _var.option.onMessageStatusClicked === 'function') {\r\n _var.option.onMessageStatusClicked(p);\r\n }\r\n });\r\n })\r\n )\r\n } else {\r\n t.innerText = `${p.CustomerNumber}: ${p.statusText}`;\r\n }\r\n }));\r\n }\r\n if (statusUpdatable !== false) {\r\n tip.appendChild(createElement('div', b => {\r\n b.className = 'tip-function-button';\r\n // setTooltip(b, r('P_CU_UPDATESTATUS', 'Update Status'));\r\n b.addEventListener('click', async () => {\r\n for (let p of comm.Participator) {\r\n switch (p.Status) {\r\n case 0:\r\n case 1:\r\n case 5:\r\n case 6:\r\n p.statusChanged = String(p.Status);\r\n break;\r\n case 9:\r\n case 10:\r\n case 412:\r\n p.statusChanged = '9';\r\n break;\r\n default:\r\n p.statusChanged = '-1';\r\n break;\r\n }\r\n }\r\n const gridContainer = createElement('div', 'status-grid');\r\n const popup = new Popup({\r\n onMasking: _var.option.onMasking,\r\n title: r('P_CU_UPDATESTATUS', 'Update Status'),\r\n content: createElement('div', wrapper => {\r\n wrapper.className = 'update-status-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n gridContainer\r\n ),\r\n buttons: [\r\n {\r\n text: r('P_WO_OK', 'OK'),\r\n key: 'ok',\r\n trigger: () => {\r\n const changed = msgs.filter(m => {\r\n switch (m.statusChanged) {\r\n case '-1':\r\n return knownStatus.includes(m.Status);\r\n case '9':\r\n return failedStatus.indexOf(m.Status) < 0;\r\n default:\r\n return String(m.Status) !== m.statusChanged;\r\n }\r\n }).map(m => {\r\n let status = Number(m.statusChanged);\r\n if (isNaN(status) || status < 0) {\r\n status = 9999;\r\n }\r\n return {\r\n Id: m.Id,\r\n Status: status\r\n };\r\n });\r\n if (typeof _var.option.onUpdateMessageStatus === 'function') {\r\n _var.option.onUpdateMessageStatus(changed);\r\n }\r\n }\r\n },\r\n {\r\n text: r('P_WO_CANCEL', 'Cancel'),\r\n key: 'cancel'\r\n }\r\n ]\r\n });\r\n await popup.show();\r\n const grid = new Grid(gridContainer);\r\n // grid.headerVisible = false;\r\n grid.allowHtml = true;\r\n grid.columns = [\r\n {\r\n key: 'CustomerNumber',\r\n caption: r('P_JS_NUMBER', 'Number'),\r\n width: 150\r\n },\r\n /*{\r\n key: 'customerName',\r\n caption: r('P_WOS_CUSTOMERNAME', 'Customer Name'),\r\n width: 120\r\n },*/\r\n {\r\n key: 'statusText',\r\n caption: r('P_CU_CURRENTSTATUS', 'Current Status'),\r\n width: 155\r\n },\r\n {\r\n key: 'statusChanged',\r\n caption: r('P_CU_REVISEDSTATUS', 'Revised Status'),\r\n width: 155,\r\n type: Grid.ColumnTypes.Dropdown,\r\n source: [\r\n { value: '-1', text: messageStatus[9999] },\r\n { value: '0', text: messageStatus[0] },\r\n { value: '1', text: messageStatus[1] },\r\n { value: '5', text: messageStatus[5] },\r\n { value: '6', text: messageStatus[6] },\r\n { value: '9', text: messageStatus[9] }\r\n ]\r\n }\r\n ];\r\n grid.init();\r\n grid.source = msgs;\r\n });\r\n }, createIcon('fa-light', 'wave-sine')));\r\n }\r\n });\r\n }\r\n return [status, statusText, statusColor, statusTips];\r\n};\r\n\r\nexport function getMessageSendTo(comm, contacts, followers, r) {\r\n let sendto = '';\r\n if (!comm.IsReply && comm.OriPhoneNumbers?.length > 0) {\r\n for (let oriph of comm.OriPhoneNumbers) {\r\n let cname;\r\n const email = isEmail(oriph);\r\n if (contacts?.length > 0) {\r\n let c = email ?\r\n contacts.find(c => c.Email === oriph) :\r\n contacts.find(c => c.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n } else if (followers?.length > 0) {\r\n c = email ?\r\n followers.find(f => f.Email === oriph) :\r\n followers.find(f => f.MobilePhone === oriph);\r\n if (c != null) {\r\n cname = `${email ? c.Email : c.MobilePhoneDisplayText} - ${c.Name}`;\r\n }\r\n }\r\n }\r\n sendto += (cname ?? oriph) + '\\n';\r\n }\r\n }\r\n if (sendto !== '') {\r\n sendto = r('P_CU_SENDTO_COLON', 'Sent to :') + `\\n${sendto}`;\r\n }\r\n return sendto;\r\n}\r\n\r\nexport function updateCustomerName(messages, contacts) {\r\n if (messages?.length > 0 && contacts?.length > 0) {\r\n for (let m of messages) {\r\n if (m.Participator?.length > 0) {\r\n for (let p of m.Participator) {\r\n const contact = contacts.filter(c => c.MobilePhoneDisplayText === p.CustomerNumber)[0];\r\n p.customerName = contact?.Name;\r\n }\r\n }\r\n }\r\n }\r\n}","import { Grid, Dropdown, createElement, createCheckbox, Popup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r as lang } from \"../../utility\";\r\n\r\nlet r = lang;\r\n\r\nexport class Contact {\r\n _var = {};\r\n\r\n constructor(option = {}) {\r\n this._var.option = option;\r\n const getText = option?.getText;\r\n if (typeof getText === 'function') {\r\n r = getText;\r\n }\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this._var.option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('P_CR_TEXT', 'Text') },\r\n { value: '1', text: r('P_CR_EMAIL', 'Email') },\r\n { value: '2', text: r('P_CR_PHONE', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this._var.option.company) {\r\n buttons.push({\r\n text: c == null ? r('P_WO_ADDCONTACTRECORD', 'Add Contact Record') : r('P_WO_EDITCONTACTRECORD', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this._var.option.onSave === 'function') {\r\n return this._var.option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('P_WO_WORKORDERONLY', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n //item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this._var.option.onSave === 'function') {\r\n return this._var.option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('P_WO_CANCEL', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = new Popup({\r\n onMasking: this._var.option.onMasking,\r\n title: c == null ? r('P_CR_ADDCONTACT', 'Add Contact') : r('P_CR_EDITCONTACT', 'Edit Contact'),\r\n content: createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('P_CR_CONTACTNAME_COLON', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('P_CR_CONTACTPREFERENCES_COLON', 'Contact Preferences:')),\r\n preferences.create()\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('P_CR_EMAILADDRESS_COLON', 'Email Address:')),\r\n contactEmail\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('P_WO_MOBILE_COLON', 'Mobile:')),\r\n contactMobile\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('P_CR_OPTOUT_COLON', 'Opt Out:')),\r\n checkOpt\r\n ),\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label', r('P_CR_NOTES_COLON', 'Notes:')),\r\n contactNotes\r\n )\r\n ),\r\n buttons\r\n })\r\n if (c != null) {\r\n contactName.value = c.Name;\r\n preferences.select(String(c.ContactPreference));\r\n contactEmail.value = c.Email;\r\n contactMobile.value = c.MobilePhone;\r\n checkOpt.querySelector('input').checked = c.OptOut;\r\n contactNotes.value = c.Notes;\r\n } else {\r\n preferences.select('0');\r\n }\r\n this._var.refs = {\r\n contactName,\r\n preferences,\r\n contactEmail,\r\n contactMobile,\r\n checkOpt,\r\n contactNotes\r\n };\r\n const result = await popup.show(parent);\r\n setTimeout(() => contactName.focus());\r\n return result;\r\n }\r\n\r\n prepare() {\r\n const name = this._var.refs.contactName.value;\r\n const pref = this._var.refs.preferences.selected.value;\r\n const email = this._var.refs.contactEmail.value;\r\n const phone = this._var.refs.contactMobile.value;\r\n const opt = this._var.refs.checkOpt.querySelector('input').checked;\r\n const notes = this._var.refs.contactNotes.value;\r\n const title = this._var.option.contact == null ? r('P_CR_ADDCONTACT', 'Add Contact') : r('P_CR_EDITCONTACT', 'Edit Contact');\r\n if (nullOrEmpty(name)) {\r\n showAlert(title, r('P_CR_CONTACTNAMECANNOTBEEMPTY', 'Contact Name cannot be empty.'), 'warn')\r\n .then(() => this._var.refs.contactName.focus());\r\n return null;\r\n }\r\n if ((pref == 0 || pref == 2) && nullOrEmpty(phone)) {\r\n showAlert(title, r('P_CR_MOBILECANNOTBEEMPTY', 'Mobile cannot be empty.'), 'warn')\r\n .then(() => this._var.refs.contactMobile.focus());\r\n return null;\r\n }\r\n if (pref == 1 && nullOrEmpty(email)) {\r\n showAlert(title, r('P_CU_EMAILCANNOTBEEMPTY', 'Email cannot be empty.'), 'warn')\r\n .then(() => this._var.refs.contactEmail.focus());\r\n return null;\r\n }\r\n if (!nullOrEmpty(email) && !isEmail(email)) {\r\n showAlert(title, r('P_CR_EMAILISNOTAVALIDEMAILADDRESS', 'The email address is invalid.'), 'warn')\r\n .then(() => this._var.refs.contactEmail.focus());\r\n return null;\r\n }\r\n\r\n let contact = this._var.option.contact;\r\n if (contact == null) {\r\n contact = {};\r\n } else if (contact.OptOut !== opt) {\r\n if (opt !== false || contact.OptOut_BC === false) {\r\n contact.selected = !opt;\r\n }\r\n }\r\n contact.OldName = contact.Name;\r\n contact.OldMobilePhone = contact.MobilePhone;\r\n contact.Name = name;\r\n contact.ContactPreference = pref;\r\n contact.Email = email;\r\n contact.MobilePhone = phone;\r\n contact.OptOut = opt;\r\n contact.Notes = notes;\r\n return contact;\r\n }\r\n}\r\n\r\nexport class CustomerRecordContact {\r\n _var = {};\r\n\r\n constructor(option = {}) {\r\n this._var.option = option;\r\n const getText = option?.getText;\r\n if (typeof getText === 'function') {\r\n r = getText;\r\n }\r\n }\r\n\r\n async show(title, parent = document.body) {\r\n // const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const gridContainer = createElement('div', 'selcontact-grid');\r\n const popup = new Popup({\r\n onMasking: this._var.option.onMasking,\r\n title,\r\n content: createElement('div', 'selcontact-wrapper',\r\n gridContainer\r\n ),\r\n buttons: [\r\n {\r\n text: r('P_WO_OK', 'OK'),\r\n key: 'ok',\r\n trigger: () => {\r\n if (typeof this._var.option.onOk === 'function') {\r\n return this._var.option.onOk.call(this, this._var.grid.source.filter(f => f.selected));\r\n }\r\n }\r\n },\r\n { text: r('P_WO_CANCEL', 'Cancel'), key: 'cancel' }\r\n ]\r\n });\r\n const result = await popup.show(parent);\r\n // grid\r\n const grid = new Grid(gridContainer);\r\n grid.columns = [\r\n {\r\n key: 'selected',\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 40,\r\n // enabled: item => !nullOrEmpty(item.ID)\r\n },\r\n { key: 'Name', caption: r(\"P_CR_CONTACTNAME\", \"Contact Name\"), width: 100 },\r\n { key: 'Email', caption: r(\"P_CR_CONTACTEMAIL\", \"Contact Email\"), css: { 'width': 180, 'text-align': 'left' } },\r\n { key: 'MobilePhoneDisplayText', caption: r(\"P_CR_CONTACTMOBILE\", \"Contact Mobile\"), width: 130 },\r\n { key: 'ContactPreferenceStr', caption: r(\"P_CR_CONTACTPREFERENCES\", \"Contact Preferences\"), width: 100 },\r\n { key: 'OptOut', caption: r(\"P_CR_OPTOUT\", \"Opt Out\"), type: Grid.ColumnTypes.Checkbox, width: 70, enabled: false, align: 'center' },\r\n { key: 'Notes', caption: r(\"P_CR_NOTES\", \"Notes\"), width: 120 }\r\n ];\r\n grid.init();\r\n grid.source = this._var.option.contacts.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n this._var.grid = grid;\r\n return result;\r\n }\r\n\r\n set source(contacts) {\r\n this._var.option.contacts = contacts;\r\n const grid = this._var.grid;\r\n if (grid != null) {\r\n this._var.grid.source = contacts;\r\n }\r\n }\r\n}","import { Grid, createElement, Popup } from \"../../ui\";\r\nimport { nullOrEmpty, r as lang, contains } from \"../../utility\";\r\n\r\nlet r = lang;\r\n\r\nexport default class Follower {\r\n _var = {};\r\n\r\n constructor(option = {}) {\r\n this._var.option = option;\r\n const getText = option?.getText;\r\n if (typeof getText === 'function') {\r\n r = getText;\r\n }\r\n }\r\n\r\n async show(title, parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const gridContainer = createElement('div', 'follower-grid');\r\n const popup = new Popup({\r\n onMasking: this._var.option.onMasking,\r\n title,\r\n content: createElement('div', 'follower-wrapper',\r\n createElement('div', div => div.innerText = r('P_CR_WHODOYOUWANTTORECEIVECUSTOMERNOTIFICATIONS', 'Who do you want to receive customer notifications?')),\r\n createElement('input', search => {\r\n search.type = 'text';\r\n search.tabIndex = tabIndex + 3;\r\n search.className = 'ui-input follower-search';\r\n search.addEventListener('input', () => {\r\n const key = search.value;\r\n if (nullOrEmpty(key)) {\r\n this._var.grid.source = this._var.option.followers.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n } else {\r\n this._var.grid.source = this._var.option.followers.filter(f => f.Text || f.Email || contains(f.DisplayName, key, true))\r\n .sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n }\r\n });\r\n }),\r\n gridContainer\r\n ),\r\n buttons: [\r\n {\r\n text: r('P_WO_OK', 'OK'),\r\n key: 'ok',\r\n trigger: () => {\r\n if (typeof this._var.option.onOk === 'function') {\r\n return this._var.option.onOk.call(this, this._var.grid.source.filter(f => f.Email || f.Text));\r\n }\r\n }\r\n },\r\n { text: r('P_WO_CANCEL', 'Cancel'), key: 'cancel' }\r\n ]\r\n });\r\n const result = await popup.show(parent);\r\n result.querySelector('.follower-search').focus();\r\n // grid\r\n const grid = new Grid(gridContainer);\r\n grid.columns = [\r\n { key: 'DisplayName', caption: r('P_WO_CONTACTNAME', 'Contact Name'), width: 240 },\r\n { key: 'ContactTypeName', caption: r('P_WO_CONTACTTYPE', 'Contact Type'), width: 120 },\r\n {\r\n key: 'Text',\r\n caption: r('P_CR_TEXT', 'Text'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 60,\r\n enabled: item => !nullOrEmpty(item.Mobile)\r\n },\r\n {\r\n key: 'Email',\r\n caption: r('P_CR_EMAIL', 'Email'),\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 70,\r\n // enabled: item => !nullOrEmpty(item.ID)\r\n }\r\n ];\r\n grid.init();\r\n grid.source = this._var.option.followers.sort(function (a, b) { return ((b.Text || b.Email) ? 1 : 0) - ((a.Text || a.Email) ? 1 : 0) });\r\n this._var.grid = grid;\r\n return result;\r\n }\r\n}","import { Grid, GridColumn, createElement, setTooltip, createIcon, createCheckbox, createRadiobox, showAlert, showConfirm, Popup } from \"../../ui\";\r\nimport { r as lang, nullOrEmpty, formatUrl, escapeEmoji, isEmail, isPhone } from \"../../utility\";\r\nimport { createBox, appendMedia, fileSupported, insertFile, getMessageSendTo, getMessageStatus, updateCustomerName } from \"./lib\";\r\nimport { Contact, CustomerRecordContact } from \"./contact\";\r\nimport Follower from \"./follower\";\r\n\r\nclass NoteCol extends GridColumn {\r\n static create() {\r\n const wrapper = createElement('div', 'contact-wrapper',\r\n createElement('div', 'contact-name'),\r\n createElement('div', 'contact-note')\r\n );\r\n return wrapper;\r\n }\r\n\r\n static setValue(element, _val, it, _col, grid) {\r\n const item = it.values;\r\n const name = element.querySelector('.contact-name');\r\n name.innerText = item.Name;\r\n if (name.scrollWidth > name.offsetWidth) {\r\n setTooltip(name, item.Name, false, grid.element);\r\n }\r\n\r\n const notes = element.querySelector('.contact-note');\r\n notes.innerText = item.Notes;\r\n if (notes.scrollWidth > notes.offsetWidth) {\r\n setTooltip(notes, item.Notes, false, grid.element);\r\n }\r\n }\r\n}\r\n\r\nlet r = lang;\r\n\r\nexport default class CustomerCommunication {\r\n _var = {\r\n data: {}\r\n };\r\n\r\n constructor(opt) {\r\n this._var.option = opt ?? {};\r\n const getText = opt?.getText;\r\n if (typeof getText === 'function') {\r\n r = getText;\r\n }\r\n }\r\n\r\n get _autoUpdates() { return this._var.container.querySelector('.check-auto-update>input') }\r\n get autoUpdatesEnabled() { return this._autoUpdates?.disabled !== true }\r\n set autoUpdatesEnabled(flag) {\r\n const element = this._autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get autoUpdates() { return this._autoUpdates?.checked }\r\n set autoUpdates(flag) {\r\n const element = this._autoUpdates;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n get _statusLink() { return this._var.container.querySelector('.check-status-link>input') }\r\n get statusLinkEnabled() { return this._statusLink?.disabled !== true }\r\n set statusLinkEnabled(flag) {\r\n const element = this._statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n element.disabled = true;\r\n element.parentElement?.classList?.add('disabled');\r\n } else {\r\n element.disabled = false;\r\n element.parentElement?.classList?.remove('disabled');\r\n }\r\n }\r\n get statusLink() { return this._statusLink?.checked }\r\n set statusLink(flag) {\r\n const element = this._statusLink;\r\n if (element == null) {\r\n return;\r\n }\r\n element.checked = flag;\r\n element.dispatchEvent(new Event('change'));\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set loading(flag) {\r\n if (this._var.container == null) {\r\n return;\r\n }\r\n this._var.enter.disabled = flag;\r\n this._var.container.querySelector('.customer-name>.ui-input').disabled = flag;\r\n this._var.container.querySelector('.button-send-message').disabled = flag;\r\n this._var.container.querySelector('.button-edit-contacts').disabled = flag;\r\n this._var.container.querySelector('.button-edit-followers').disabled = flag;\r\n }\r\n\r\n get text() { return this._var.enter?.value }\r\n set text(s) {\r\n const element = this._var.enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this._var.option.maxLength);\r\n this._var.container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n get file() { return this._var.file || this._var.fileControl?.files?.[0] }\r\n set file(f) {\r\n this._var.fileControl?.remove();\r\n const label = this._var.container.querySelector('.file-selector>.selector-name');\r\n if (f == null) {\r\n this._var.fileControl = null;\r\n this._var.file = null;\r\n if (label != null) {\r\n label.style.display = 'none';\r\n label.innerText = '';\r\n label.querySelector('.ui-tooltip-wrapper')?.remove();\r\n }\r\n } else {\r\n if (f instanceof HTMLInputElement) {\r\n this._var.fileControl = f;\r\n this._var.file = f.files[0];\r\n const link = this._var.container.querySelector('.file-selector>.selector-link');\r\n if (link != null) {\r\n link.appendChild(f);\r\n }\r\n } else {\r\n this._var.fileControl = null;\r\n this._var.file = f;\r\n }\r\n if (label != null) {\r\n label.style.display = '';\r\n label.innerText = f.name;\r\n setTooltip(label, f.name);\r\n }\r\n }\r\n }\r\n\r\n get customerName() { return this._var.container.querySelector('.customer-name>.ui-input')?.value }\r\n set customerName(name) {\r\n const element = this._var.container.querySelector('.customer-name>.ui-input');\r\n if (element == null) {\r\n return;\r\n }\r\n element.value = name;\r\n }\r\n\r\n get contacts() {\r\n return [...this._var.contacts.children].filter(el => {\r\n return el.querySelector('span').dataset.notsend == \"false\";\r\n }).map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Key': span.dataset.to, 'Value': span.dataset.name };\r\n });\r\n }\r\n set contacts(contacts) {\r\n this.setData('contacts', contacts);\r\n this._var.contacts.replaceChildren();\r\n if (contacts?.length > 0) {\r\n var cs = contacts.sort(function (a, b) {\r\n if (a.Name == b.Name) {\r\n return 0;\r\n }\r\n return a.Name > b.Name ? 1 : -1;\r\n });\r\n const messages = this._var.data.messages;\r\n if (this._var.contactsUpdated !== true && messages?.length > 0) {\r\n updateCustomerName(messages, contacts);\r\n this._var.contactsUpdated = true;\r\n }\r\n for (let c of cs) {\r\n //if (c.OptOut || c.OptOut_BC || c.selected === false) {\r\n // continue;\r\n //}\r\n const mp = String(c.MobilePhoneDisplayText).trim();\r\n const email = String(c.Email).trim();\r\n const pref = String(c.ContactPreference);\r\n if ((pref !== '1') && !isPhone(mp) ||\r\n pref === '1' && !isEmail(email)) {\r\n continue;\r\n }\r\n const to = pref === '1' ? email : mp;\r\n let icon;\r\n let method;\r\n let tipstr;\r\n if (c.OptOut || c.OptOut_BC || c.selected === false) {\r\n icon = 'times';\r\n tipstr = r('P_CU_OPTEDOUT_PROMPT', 'User has opted out of messages');\r\n }\r\n else {\r\n switch (pref) {\r\n case '0':\r\n if (c.MobilePhoneStatus !== 0) {\r\n icon = 'times';\r\n if (c.MobilePhoneStatus === 412) {\r\n // landline\r\n tipstr = r('P_CU_LANDLINE', 'Landline');\r\n }\r\n } else {\r\n icon = 'comment-lines';\r\n }\r\n method = r('P_CU_TEXTSTO_COLON', 'Texts to:');\r\n break;\r\n case '2':\r\n icon = 'phone';\r\n tipstr = r('P_CU_NOMESSAGE', 'No Messages Sent');\r\n break;\r\n default:\r\n icon = 'envelope';\r\n method = r('P_CU_EMAILSTO_COLON', 'Emails to:');\r\n break;\r\n }\r\n }\r\n const span = createElement('span', span => {\r\n span.dataset.to = to;\r\n span.dataset.name = c.Name;\r\n span.dataset.notsend = c.OptOut || c.OptOut_BC || c.selected === false;\r\n span.innerText = c.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon, { 'fill': (c.OptOut || c.OptOut_BC || c.selected === false) ? 'red' : '' }),\r\n span\r\n );\r\n this._var.contacts.appendChild(item);\r\n let tip = tipstr || `${method} ${to}`;\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tip = r('P_WO_NAME_COLON', 'Name:') + ` ${c.Name}\\n${tip}`;\r\n }\r\n setTooltip(span, tip);\r\n }\r\n this._var.message.scrollTop = this._var.message.scrollHeight\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this._var.option.readonly = flag;\r\n if (this._var.container == null) {\r\n return;\r\n }\r\n const link = this._var.container.querySelector('.check-status-link');\r\n if (flag === true) {\r\n link.classList.add('disabled');\r\n } else {\r\n link.classList.remove('disabled');\r\n }\r\n link.querySelector('input').disabled = flag;\r\n const display = flag === true ? 'none' : '';\r\n this._var.container.querySelector('.button-edit-contacts').style.display = display;\r\n this._var.container.querySelector('.button-edit-followers').style.display = display;\r\n // this._var.enter.disabled = flag === true;\r\n this._var.container.querySelector('.message-bar').style.display = display;\r\n // this._var.container.querySelector('.button-send-message').style.display = display;\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set recordReadonly(flag) {\r\n this._var.option.recordReadonly = flag;\r\n if (this._var.container == null) {\r\n return;\r\n }\r\n this._var.container.querySelector('.button-edit-contacts').style.display = flag === true ? 'none' : '';\r\n this._var.container.querySelector('.button-edit-followers').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n /**\r\n * @param {String} name\r\n */\r\n set companyName(name) {\r\n this._var.option.companyName = name;\r\n const div = this._var.container.querySelector('.title-company');\r\n if (nullOrEmpty(name)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = name;\r\n div.style.display = '';\r\n }\r\n }\r\n /**\r\n * @param {String} code\r\n */\r\n set companyCode(code) {\r\n const option = this._var.option;\r\n option.companyCode = code;\r\n const div = this._var.container.querySelector('.title-company');\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n div.innerText = option.companyName;\r\n if (!nullOrEmpty(code))\r\n div.innerText = option.companyName + \"/\" + code;\r\n div.style.display = '';\r\n }\r\n }\r\n\r\n get followers() {\r\n return [...this._var.followers.children].map(el => {\r\n const span = el.querySelector('span');\r\n return { 'Email': span.dataset.email, 'MobilePhone': span.dataset.mp, 'Value': span.dataset.name };\r\n });\r\n }\r\n set followers(followers) {\r\n this._var.data.followers = followers;\r\n this._var.followers.replaceChildren();\r\n if (followers?.length > 0) {\r\n this._var.container.querySelector('.follower-bar').style.display = '';\r\n setTooltip(this._var.buttonFollower, r('P_CU_EDITFOLLOWERS', 'Edit Followers'));\r\n this._var.container.querySelector('.follower-bar>.bar-list').appendChild(this._var.buttonFollower);\r\n for (let f of followers) {\r\n if (f.OptOut) {\r\n continue;\r\n }\r\n const mp = String(f.MobilePhone).trim();\r\n const mpDisplay = String(f.MobilePhoneDisplayText).trim();\r\n const email = String(f.Email).trim();\r\n const tips = [];\r\n if (f.SendEmail) {\r\n tips.push(r('P_CU_EMAILSTO_COLON', 'Emails to:') + ` ${email}`);\r\n }\r\n if (f.SendText) {\r\n tips.push(r('P_CU_TEXTSTO_COLON', 'Texts to:') + ` ${mpDisplay}`);\r\n }\r\n let icon;\r\n if (f.SendText && f.SendEmail) {\r\n icon = 'at';\r\n } else {\r\n icon = f.SendText ? 'comment-lines' : 'envelope';\r\n }\r\n const span = createElement('span', span => {\r\n if (f.SendEmail) {\r\n span.dataset.email = email;\r\n }\r\n if (f.SendText) {\r\n span.dataset.mp = mp;\r\n }\r\n span.dataset.name = f.Name;\r\n span.innerText = f.Name;\r\n });\r\n const item = createElement('div', 'contact-item',\r\n createIcon('fa-light', icon),\r\n span\r\n );\r\n this._var.followers.appendChild(item);\r\n if (span.scrollWidth > span.offsetWidth) {\r\n tips.splice(0, 0, r('P_WO_NAME_COLON', 'Name:') + ` ${f.Name}`);\r\n }\r\n setTooltip(span, tips.join('\\n'));\r\n }\r\n } else {\r\n this._var.container.querySelector('.follower-bar').style.display = 'none';\r\n setTooltip(this._var.buttonFollower, r('P_CR_ADDFOLLOWERS', 'Add Followers'));\r\n this._var.container.querySelector('.button-edit-contacts').insertAdjacentElement('beforebegin', this._var.buttonFollower)\r\n }\r\n this._var.message.scrollTop = this._var.message.scrollHeight\r\n }\r\n\r\n setData(key, data) {\r\n this._var.data[key] = data;\r\n }\r\n\r\n create() {\r\n const option = this._var.option;\r\n const readonly = option.readonly;\r\n // functions\r\n const checkAutoUpdate = createCheckbox({\r\n className: 'check-auto-update',\r\n checked: option.autoUpdates,\r\n checkedNode: createIcon('fa-regular', 'redo-alt'),\r\n uncheckedNode: createIcon('fa-regular', 'ban'),\r\n onchange: function () {\r\n setTooltip(checkAutoUpdate, this.checked ?\r\n r('P_CU_AUTOUPDATESENABLED', 'Auto Updates Enabled') :\r\n r('P_CU_AUTOUPDATESDISABLED', 'Auto Updates Disabled'));\r\n }\r\n });\r\n if (option.autoUpdatesVisible === false) {\r\n checkAutoUpdate.style.display = 'none';\r\n }\r\n const This = this;\r\n const checkLink = createCheckbox({\r\n className: 'check-status-link',\r\n enabled: !readonly,\r\n checked: option.statusLink,\r\n checkedNode: createIcon('fa-regular', 'link'),\r\n uncheckedNode: createIcon('fa-regular', 'unlink'),\r\n onchange: function () {\r\n setTooltip(checkLink, this.checked ?\r\n r('P_WO_STATUSLINKINCLUDED', 'Status Link Included') :\r\n r('P_WO_STATUSLINKEXCLUDED', 'Status Link Excluded'));\r\n if (typeof option.onStatusLinkChanged === 'function') {\r\n option.onStatusLinkChanged.call(This, this.checked);\r\n }\r\n }\r\n });\r\n if (option.statusLinkVisible === false) {\r\n checkLink.style.display = 'none';\r\n }\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = option.title ?? r('P_WO_CUSTOMERCOMMUNICATION', 'Customer Communication');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n [\r\n setTooltip(checkAutoUpdate, r('P_CU_AUTOUPDATESENABLED', 'Auto Updates Enabled')),\r\n setTooltip(checkLink, r('P_WO_STATUSLINKEXCLUDED', 'Status Link Excluded'))\r\n ]\r\n );\r\n // contacts\r\n this._var.contacts = this._createContacts(container, option);\r\n // followers\r\n this._var.followers = this._createFollowers(container, option);\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('P_CU_ENTERMESSAGEHERE', 'Enter Message Here');\r\n option.maxLength ??= 3000;\r\n enter.maxLength = option.maxLength;\r\n // if (readonly === true) {\r\n // enter.disabled = true;\r\n // }\r\n enter.addEventListener('input', () => {\r\n const val = this.text;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(option.maxLength);\r\n this._var.container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n enter.addEventListener('paste', e => {\r\n if (option.customerNameVisible === true) {\r\n return;\r\n }\r\n const items = e.clipboardData.items;\r\n if (items?.length > 0) {\r\n const item = items[0];\r\n const entry = item.webkitGetAsEntry();\r\n if (item.kind === 'file' && (entry == null || entry.isFile)) {\r\n const file = item.getAsFile();\r\n if (file != null) {\r\n e.preventDefault();\r\n this.file = insertFile(container, file, r);\r\n }\r\n }\r\n }\r\n // const file = e.clipboardData.files[0];\r\n // if (file != null) {\r\n // e.preventDefault();\r\n // this.file = insertFile(container, file, r);\r\n // }\r\n });\r\n this._var.enter = enter;\r\n container.appendChild(\r\n createElement('div', div => {\r\n div.className = 'message-bar';\r\n if (readonly === true) {\r\n div.style.display = 'none';\r\n }\r\n div.addEventListener('dragover', e => {\r\n if (option.readonly !== true) {\r\n const item = e.dataTransfer.items[0];\r\n if (item?.kind === 'file') {\r\n e.preventDefault();\r\n if (item.type.length > 0 && fileSupported.indexOf(item.type) < 0) {\r\n e.dataTransfer.dropEffect = 'none';\r\n } else {\r\n e.dataTransfer.dropEffect = 'link';\r\n }\r\n }\r\n }\r\n });\r\n div.addEventListener('drop', e => {\r\n if (option.readonly !== true) {\r\n const file = e.dataTransfer.files[0];\r\n if (file != null) {\r\n e.preventDefault();\r\n this.file = insertFile(container, file, r);\r\n }\r\n }\r\n });\r\n },\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', 'customer-left',\r\n createElement('div', div => {\r\n div.className = 'customer-name';\r\n if (option.customerNameVisible !== true) {\r\n div.style.display = 'none';\r\n }\r\n },\r\n createElement('span', span => span.innerText = r('P_WO_NAME_COLON', 'Name:')),\r\n createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n })\r\n ),\r\n createElement('div', 'file-selector',\r\n createElement('div', div => {\r\n div.className = 'selector-link';\r\n div.addEventListener('click', () => {\r\n this._var.fileControl?.remove();\r\n const file = createElement('input', input => {\r\n input.type = 'file';\r\n input.accept = fileSupported.join(',');\r\n input.addEventListener('change', () => {\r\n const file = insertFile(container, input.files?.[0], r);\r\n if (file != null) {\r\n this.file = file;\r\n }\r\n });\r\n });\r\n div.appendChild(this._var.fileControl = file);\r\n file.dispatchEvent(new MouseEvent('click'));\r\n });\r\n },\r\n createIcon('fa-regular', 'link')\r\n ),\r\n createElement('span', span => {\r\n span.className = 'selector-name';\r\n span.style.display = 'none';\r\n }),\r\n createElement('layer', layer => {\r\n layer.appendChild(createIcon('fa-regular', 'times'));\r\n layer.addEventListener('click', () => this.file = null);\r\n })\r\n )\r\n ),\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n // if (readonly === true) {\r\n // button.style.display = 'none';\r\n // }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('P_M3_SENDMESSAGE', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n const val = this.text;\r\n if (nullOrEmpty(val?.trim())) {\r\n const p = showAlert(r('P_WO_ERROR', 'Error'), r('P_WO_PLEASEINPUTTHEMESSAGE', 'Please input the message.'), 'warn');\r\n if (typeof option.onMasking === 'function') {\r\n option.onMasking(true);\r\n p.then(() => option.onMasking(false));\r\n }\r\n return;\r\n }\r\n if (typeof option.onAddMessage === 'function') {\r\n this.loading = true;\r\n option.onAddMessage(this.text, this.file);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this._var.message = message;\r\n container.appendChild(message);\r\n return this._var.container = container;\r\n }\r\n\r\n _createContacts(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const contacts = createElement('div', 'bar-list-container');\r\n container.append(\r\n createElement('div', 'contact-bar',\r\n createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-circle', {\r\n 'fill': 'lightgray'\r\n })\r\n ),\r\n createElement('div', 'bar-list',\r\n contacts,\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-edit-contacts';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-edit'));\r\n setTooltip(button, r('P_CU_EDITCONTACTS', 'Edit Contacts'));\r\n button.addEventListener('click', () => {\r\n const pop = new Popup({\r\n onMasking: option.onMasking,\r\n title: createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.alignItems = 'center';\r\n div.style.padding = '10px 0 6px 12px';\r\n div.append(\r\n createElement('div', div => {\r\n div.className = 'ui-popup-move';\r\n div.style.flex = '1 1 auto';\r\n },\r\n createElement('div', div => div.innerText = r('P_CU_EDITCONTACTS', 'Edit Contacts')),\r\n createElement('div', div => {\r\n div.className = 'title-company';\r\n div.style.maxWidth = '540px';\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n } else {\r\n if (nullOrEmpty(option.companyCode)) {\r\n div.innerText = option.companyName;\r\n } else {\r\n div.innerText = option.companyName + \"/\" + option.companyCode;\r\n }\r\n }\r\n })\r\n ),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-from-customer-record';\r\n if (recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'handshake', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n const sel = new CustomerRecordContact({\r\n getText: option.getText,\r\n // onMasking: option.onMasking,\r\n contacts: [],\r\n onOk: list => {\r\n if (typeof option.onSelectCRContacts === 'function') {\r\n list?.map(c => {\r\n delete c.selected;\r\n return c;\r\n });\r\n const result = option.onSelectCRContacts(list);\r\n }\r\n const r = this._var.data.contacts;\r\n this._var.gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n this._var.gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n }\r\n });\r\n var title = r('P_CU_SELECTFROMCUSTOMERRECORD', 'Select from Customer Record');\r\n sel.show(title, container);\r\n\r\n if (typeof option.onOpenSelectCRContacts === 'function') {\r\n const result = option.onOpenSelectCRContacts();\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n r.map(c => {\r\n for (let cc of this._var.data.contacts) {\r\n if (c.Id === cc.Id) {\r\n c.selected = true;\r\n break;\r\n }\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = false;\r\n }\r\n return c;\r\n });\r\n this._var.data.contacts.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n\r\n sel.source = r;\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n });\r\n setTooltip(button, r('P_CU_SELECTFROMCUSTOMERRECORD', 'Select from Customer Record'))\r\n }),\r\n createElement('button', button => {\r\n button.style.flex = '0 0 auto';\r\n button.style.backgroundColor = 'rgb(1, 199, 172)';\r\n button.style.marginRight = '10px';\r\n button.className = 'roundbtn button-add-contact';\r\n if (recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'user-plus', {\r\n width: '16px',\r\n height: '16px'\r\n }));\r\n button.addEventListener('click', () => {\r\n const add = new Contact({\r\n getText: option.getText,\r\n // onMasking: option.onMasking,\r\n company: !nullOrEmpty(option.companyName),\r\n onSave: item => {\r\n const exists = this._var.gridContact.source.some(s => s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('P_CR_ADDCONTACT', 'Add Contact'), r('P_WO_CONTACTNAMEANDMOBILEUNIQUECOMBINATION', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item, true);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n this._var.gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n this._var.gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n add.show(container);\r\n });\r\n setTooltip(button, r('P_CR_ADDCONTACT', 'Add Contact'))\r\n })\r\n )\r\n }),\r\n content: createElement('div', null,\r\n createElement('div', div => {\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n }\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('P_CU_CONTACTSFROMCUSTOMERRECORD', 'Contacts from Customer Record');\r\n }),\r\n createElement('div', div => {\r\n if (nullOrEmpty(option.companyName)) {\r\n div.style.display = 'none';\r\n }\r\n div.className = 'contacts-record';\r\n div.style.maxHeight = '200px';\r\n div.style.width = '675px';\r\n div.style.overflow = 'auto';\r\n }),\r\n createElement('div', div => {\r\n div.style.fontWeight = 'bold';\r\n div.innerText = r('P_CU_CONTACTSNOTCUSTOMERRECORD', 'Contacts not on Customer Record');\r\n }),\r\n createElement('div', div => {\r\n div.className = 'contacts-wo';\r\n div.style.maxHeight = '200px';\r\n div.style.width = '675px';\r\n div.style.overflow = 'auto';\r\n })\r\n )\r\n });\r\n pop.show(container).then(() => {\r\n const selectedCol = This => {\r\n return {\r\n key: 'selected',\r\n type: Grid.ColumnTypes.Checkbox,\r\n width: 50,\r\n enabled: item => !item.OptOut && !item.OptOut_BC,\r\n onChanged: function () {\r\n if (typeof option.onChanged === 'function') {\r\n option.onChanged([...This._var.gridContact.source, ...This._var.gridWo.source]);\r\n }\r\n },\r\n tooltip: item => item.selected ? r('P_CU_OPTEDIN', 'Opted In') : r('P_CU_OPTEDOUT', 'Opted Out')\r\n }\r\n };\r\n const iconCol = {\r\n key: 'type',\r\n type: Grid.ColumnTypes.Icon,\r\n width: 50,\r\n filter: c => {\r\n switch (String(c.ContactPreference)) {\r\n case '0': return 'comment-lines';\r\n case '2': return 'mobile';\r\n default: return 'envelope';\r\n }\r\n },\r\n className: 'icon-contact-type',\r\n iconType: 'fa-light'\r\n };\r\n const nameCol = { key: 'Name', type: NoteCol, width: 160 };\r\n const buttonCol = {\r\n type: Grid.ColumnTypes.Icon,\r\n width: 40,\r\n visible: !recordReadonly,\r\n align: 'center',\r\n iconType: 'fa-light'\r\n };\r\n const createEditCol = (This) => {\r\n return {\r\n key: 'edit',\r\n ...buttonCol,\r\n text: 'edit',\r\n tooltip: r('P_WO_EDIT', 'Edit'),\r\n events: {\r\n onclick: function () {\r\n const edit = new Contact({\r\n getText: option.getText,\r\n // onMasking: option.onMasking,\r\n contact: this,\r\n company: !nullOrEmpty(option.companyName),\r\n onSave: (item, _op) => {\r\n const exists =\r\n This._var.gridContact.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone) ||\r\n This._var.gridWo.source.some(s => s !== this && s.Name === item.Name && s.MobilePhone === item.MobilePhone);\r\n if (exists) {\r\n showAlert(r('P_CR_EDITCONTACT', 'Edit Contact'), r('P_WO_CONTACTNAMEANDMOBILEUNIQUECOMBINATION', 'Contact name and contact mobile must be a unique combination.'), 'warn');\r\n return false;\r\n }\r\n if (typeof option.onSave === 'function') {\r\n const result = option.onSave(item);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n This._var.gridContact.source = r.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n This._var.gridWo.source = r.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n edit.show(container);\r\n }\r\n }\r\n }\r\n };\r\n // contacts from customer record\r\n const grid = new Grid();\r\n grid.height = 0;\r\n grid.allowHtml = true;\r\n grid.headerVisible = false;\r\n grid.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('P_WO_DELETE', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(\r\n r('P_CU_REMOVECONTACT', 'Remove Contact'),\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.style.paddingLeft = '16px';\r\n div.innerText = r('P_CU_REMOVEFROM', 'Remove {name} from').replace('{name}', this.Name);\r\n }),\r\n createElement('div', div => {\r\n div.style.display = 'flex';\r\n div.style.justifyContent = 'center';\r\n div.style.marginTop = '10px';\r\n },\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('P_CUSTOMERRECORD', 'Customer Record'),\r\n checked: true,\r\n className: 'radio-customer-record'\r\n }),\r\n createRadiobox({\r\n name: 'remove-type',\r\n label: r('P_WORKORDER', 'Work Order')\r\n })\r\n )\r\n ),\r\n [\r\n { key: 'ok', text: r('P_WO_OK', 'OK') },\r\n { key: 'cancel', text: r('P_WO_CANCEL', 'Cancel') }\r\n ]\r\n ).then(result => {\r\n if (result?.key === 'ok') {\r\n const isRecord = result.popup.container.querySelector('.radio-customer-record>input').checked;\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this, isRecord);\r\n }\r\n const index = grid.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = grid.source;\r\n source.splice(index, 1);\r\n grid.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n grid.init(pop.container.querySelector('.contacts-record'));\r\n const customerRecords = this._var.data.contacts.filter(c => c.Id >= 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n grid.extraRows = customerRecords.filter(c => !nullOrEmpty(c.Notes)).length;\r\n grid.source = customerRecords;\r\n grid.onSelectedRowChanged = index => {\r\n if (index >= 0 && this._var.gridWo.selectedIndexes?.length > 0) {\r\n this._var.gridWo.selectedIndexes = [];\r\n }\r\n };\r\n this._var.gridContact = grid;\r\n\r\n // contacts from work order only\r\n const gridWo = new Grid();\r\n gridWo.height = 0;\r\n gridWo.allowHtml = true;\r\n gridWo.headerVisible = false;\r\n gridWo.columns = [\r\n selectedCol(this),\r\n iconCol,\r\n nameCol,\r\n { key: 'Email', width: 180 },\r\n { key: 'MobilePhoneDisplayText', width: 130 },\r\n createEditCol(this),\r\n {\r\n key: 'delete',\r\n ...buttonCol,\r\n text: 'times',\r\n tooltip: r('P_WO_DELETE', 'Delete'),\r\n events: {\r\n onclick: function () {\r\n showConfirm(r('P_CU_REMOVECONTACT', 'Remove Contact'), r('P_CU_REMOVEFROMWORKORDER', 'You are removing {name} from work order.\\n\\nDo you want to Continue?').replace('{name}', this.Name), [\r\n { key: 'continue', text: r('P_JS_CONTINUE', 'Continue') },\r\n { key: 'cancel', text: r('P_WO_CANCEL', 'Cancel') }\r\n ]).then(result => {\r\n if (result?.key === 'continue') {\r\n if (typeof option.onDelete === 'function') {\r\n option.onDelete(result.key, this);\r\n }\r\n const index = gridWo.source.indexOf(this);\r\n if (index >= 0) {\r\n const source = gridWo.source;\r\n source.splice(index, 1);\r\n gridWo.extraRows = source.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = source;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n ];\r\n gridWo.init(pop.container.querySelector('.contacts-wo'));\r\n const workOrderOnly = this._var.data.contacts.filter(c => c.Id < 0).map(c => {\r\n if (c.OptOut || c.OptOut_BC) {\r\n return c;\r\n }\r\n if (typeof c.selected === 'undefined') {\r\n c.selected = true;\r\n }\r\n return c;\r\n });\r\n gridWo.extraRows = workOrderOnly.filter(c => !nullOrEmpty(c.Notes)).length;\r\n gridWo.source = workOrderOnly;\r\n gridWo.onSelectedRowChanged = index => {\r\n if (index >= 0 && this._var.gridContact.selectedIndexes?.length > 0) {\r\n this._var.gridContact.selectedIndexes = [];\r\n }\r\n };\r\n this._var.gridWo = gridWo;\r\n });\r\n });\r\n })\r\n ),\r\n createElement('div', div => {\r\n div.className = 'bar-info';\r\n div.innerText = r('P_CR_CONTACTINFORMATION', 'Contact Information');\r\n }),\r\n createElement('div', div => {\r\n if (option.contactCollapserVisible === false) {\r\n div.style.display = 'none';\r\n return;\r\n }\r\n if (option.contactCollapsed) {\r\n container.classList.add('collapsed');\r\n div.className = 'bar-collapser collapsed';\r\n } else {\r\n div.className = 'bar-collapser';\r\n }\r\n div.addEventListener('click', () => {\r\n const collapsed = div.classList.contains('collapsed');\r\n if (collapsed) {\r\n div.classList.remove('collapsed');\r\n container.classList.remove('collapsed');\r\n } else {\r\n div.classList.add('collapsed');\r\n container.classList.add('collapsed');\r\n }\r\n if (typeof option.onContactCollapsed === 'function') {\r\n option.onContactCollapsed.call(this, !collapsed);\r\n }\r\n });\r\n div.append(createElement('span'));\r\n })\r\n )\r\n );\r\n return contacts;\r\n }\r\n\r\n _createFollowers(container, option) {\r\n const readonly = option.readonly;\r\n const recordReadonly = option.recordReadonly;\r\n const followers = createElement('div', 'bar-list-container');\r\n const buttonEditFollower = createElement('button', button => {\r\n button.className = 'roundbtn button-edit-followers';\r\n button.style.backgroundColor = 'rgb(48, 107, 255)';\r\n if (readonly === true || recordReadonly) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'pen'));\r\n setTooltip(button, r('P_CU_EDITFOLLOWERS', 'Edit Followers'));\r\n button.addEventListener('click', () => {\r\n if (typeof option.onInitFollower === 'function') {\r\n option.onInitFollower(this._var.data.followers).then(data => {\r\n if (typeof data === 'string') {\r\n showAlert(r('P_CUSTOMERRECORD', 'Customer Record'), data, 'warn');\r\n return;\r\n }\r\n const add = new Follower({\r\n getText: option.getText,\r\n onMasking: option.onMasking,\r\n followers: data,\r\n onOk: list => {\r\n if (typeof option.onAddFollower === 'function') {\r\n const result = option.onAddFollower(list);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n // this.followers = r;\r\n return r;\r\n });\r\n }\r\n return false;\r\n }\r\n }\r\n });\r\n var title = this._var.data.followers?.length > 0 ? r('P_CU_EDITFOLLOWERS', 'Edit Followers') : r('P_CR_ADDFOLLOWERS', 'Add Followers');\r\n add.show(title, container);\r\n });\r\n }\r\n });\r\n });\r\n this._var.buttonFollower = buttonEditFollower;\r\n container.append(\r\n createElement('div', div => {\r\n div.className = 'contact-bar follower-bar';\r\n div.style.display = 'none';\r\n },\r\n setTooltip(createElement('div', 'bar-icon',\r\n createIcon('fa-solid', 'user-tag', {\r\n 'fill': '#fff',\r\n 'background-color': 'lightgray',\r\n 'box-sizing': 'border-box',\r\n 'border-radius': '15px',\r\n 'padding': '4px'\r\n })\r\n ), r('P_CU_COPIED', 'Copied')),\r\n createElement('div', 'bar-list',\r\n followers,\r\n buttonEditFollower\r\n )\r\n )\r\n );\r\n return followers;\r\n }\r\n\r\n load(data, contacts, followers) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n contacts ??= this._var.data.contacts;\r\n followers ??= this._var.data.allfollowers;\r\n this.setData('messages', data);\r\n if (this._var.contactsUpdated !== true) {\r\n const contacts = this._var.data.contacts;\r\n if (contacts?.length > 0) {\r\n updateCustomerName(data, contacts);\r\n this._var.contactsUpdated = true;\r\n }\r\n }\r\n for (let comm of data) {\r\n const div = createElement('div', 'item-div');\r\n let name;\r\n if (comm.IsReply && contacts?.length > 0) {\r\n const c = isEmail(comm.Sender) ?\r\n contacts.find(c => c.Email === comm.Sender) :\r\n contacts.find(c => c.MobilePhone === comm.Sender);\r\n name = c?.Name;\r\n }\r\n name ??= comm.IsReply && String(comm.FormatSender) !== '' ? comm.FormatSender : comm.Sender;\r\n const sendto = getMessageSendTo(comm, contacts, followers, r)\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = name;\r\n if (!comm.IsReply && sendto?.length > 0) {\r\n setTooltip(div, sendto);\r\n }\r\n }));\r\n const content = createElement('div', 'item-content');\r\n const mmsParts = createElement('div', div => div.style.display = 'none');\r\n content.appendChild(createElement('span', span => {\r\n if (/https?:\\/\\//i.test(comm.Message)) {\r\n span.innerHTML = formatUrl(escapeEmoji(comm.Message));\r\n } else {\r\n span.innerText = escapeEmoji(comm.Message);\r\n }\r\n span.appendChild(mmsParts);\r\n }));\r\n if (comm.MMSParts?.length > 0) {\r\n mmsParts.style.display = '';\r\n for (let kv of comm.MMSParts) {\r\n appendMedia(mmsParts, kv.Key, kv.Value);\r\n }\r\n }\r\n if (comm.IsReply) {\r\n div.classList.add('item-other');\r\n } else {\r\n div.classList.add('item-self');\r\n const [status, text, color, tips] = getMessageStatus(comm, r, this._var);\r\n if (status !== -100) {\r\n if (color != null) {\r\n content.style.backgroundColor = color;\r\n }\r\n const divstatus = createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = text;\r\n if (tips != null) {\r\n setTooltip(div, tips);\r\n }\r\n });\r\n content.appendChild(divstatus);\r\n }\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comm.TimeStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this._var.message.replaceChildren(...children);\r\n this._var.message.scrollTop = this._var.message.scrollHeight\r\n // setTimeout(() => this._var.message.scrollTop = this._var.message.scrollHeight, 0);\r\n }\r\n}","import { createElement, setTooltip, createIcon } from \"../../ui\";\r\nimport { r as lang, nullOrEmpty, escapeHtml, escapeEmoji } from \"../../utility\";\r\nimport { createBox, appendMedia } from \"./lib\";\r\nimport { fileSupported, insertFile, getMessageSendTo, getMessageStatus, updateCustomerName } from \"./lib\";\r\n\r\nlet r = lang;\r\n\r\nexport default class InternalComment {\r\n _var = {};\r\n // _var.container;\r\n // _var.option;\r\n // _var.enter;\r\n // _var.fileControl;\r\n // _var.file;\r\n // _var.message;\r\n\r\n constructor(opt) {\r\n this._var.option = opt ?? {};\r\n const getText = opt?.getText;\r\n if (typeof getText === 'function') {\r\n r = getText;\r\n }\r\n }\r\n\r\n get text() { return this._var.enter?.value }\r\n set text(s) {\r\n const element = this._var.enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this._var.option.maxLength);\r\n this._var.container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n /**\r\n * @param {any} contacts\r\n */\r\n set contacts(contacts) {\r\n this._var.contacts = contacts;\r\n if (this._var.contactsUpdated !== true && contacts?.length > 0) {\r\n const comments = this._var.comments;\r\n if (comments?.length > 0) {\r\n updateCustomerName(this._var.comments, contacts);\r\n this._var.contactsUpdated = true;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set loading(flag) {\r\n if (this._var.container == null) {\r\n return;\r\n }\r\n this._var.enter.disabled = flag;\r\n this._var.container.querySelector('.button-send-message').disabled = flag;\r\n this._var.container.querySelector('.button-post-note').disabled = flag;\r\n }\r\n\r\n get file() { return this._var.file || this._var.fileControl?.files?.[0] }\r\n set file(f) {\r\n this._var.fileControl?.remove();\r\n const label = this._var.container.querySelector('.file-selector>.selector-name');\r\n if (f == null) {\r\n this._var.fileControl = null;\r\n this._var.file = null;\r\n if (label != null) {\r\n label.style.display = 'none';\r\n label.innerText = '';\r\n label.querySelector('.ui-tooltip-wrapper')?.remove();\r\n }\r\n } else {\r\n if (f instanceof HTMLInputElement) {\r\n this._var.fileControl = f;\r\n this._var.file = f.files[0];\r\n const link = this._var.container.querySelector('.file-selector>.selector-link');\r\n if (link != null) {\r\n link.appendChild(f);\r\n }\r\n } else {\r\n this._var.fileControl = null;\r\n this._var.file = f;\r\n }\r\n if (label != null) {\r\n label.style.display = '';\r\n label.innerText = f.name;\r\n setTooltip(label, f.name);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this._var.option.readonly = flag;\r\n if (this._var.container == null) {\r\n return;\r\n }\r\n this._var.enter.disabled = flag === true;\r\n this._var.container.querySelector('.button-send-message').style.display = flag === true ? 'none' : '';\r\n this._var.container.querySelector('.button-post-note').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n create() {\r\n const option = this._var.option;\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = r('P_WO_INTERNALCOMMENTS', 'Internal Comments');\r\n })\r\n ), []\r\n );\r\n const readonly = option.readonly;\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('P_CU_ENTERCOMMENTHERE', 'Enter Comment Here');\r\n enter.maxLength = option.maxLength ??= 3000;\r\n enter.addEventListener('input', () => {\r\n const val = this.text;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(option.maxLength);\r\n this._var.container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n if (readonly === true) {\r\n enter.disabled = true;\r\n }\r\n enter.addEventListener('paste', e => {\r\n const file = e.clipboardData.files[0];\r\n if (file != null) {\r\n e.preventDefault();\r\n this.file = insertFile(container, file, r);\r\n }\r\n });\r\n this._var.enter = enter;\r\n container.appendChild(\r\n createElement('div', div => {\r\n div.className = 'message-bar';\r\n div.addEventListener('dragover', e => {\r\n if (option.readonly !== true) {\r\n const item = e.dataTransfer.items[0];\r\n if (item?.kind === 'file') {\r\n e.preventDefault();\r\n if (item.type.length > 0 && fileSupported.indexOf(item.type) < 0) {\r\n e.dataTransfer.dropEffect = 'none';\r\n } else {\r\n e.dataTransfer.dropEffect = 'link';\r\n }\r\n }\r\n }\r\n });\r\n div.addEventListener('drop', e => {\r\n if (option.readonly !== true) {\r\n const file = e.dataTransfer.files[0];\r\n if (file != null) {\r\n e.preventDefault();\r\n this.file = insertFile(container, file, r);\r\n }\r\n }\r\n });\r\n },\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', 'customer-left',\r\n createElement('div', 'file-selector',\r\n createElement('div', div => {\r\n div.className = 'selector-link';\r\n // div.style.display = 'none';\r\n div.addEventListener('click', () => {\r\n this._var.fileControl?.remove();\r\n const file = createElement('input', input => {\r\n input.type = 'file';\r\n input.accept = fileSupported.join(',');\r\n input.addEventListener('change', () => {\r\n const file = insertFile(container, input.files?.[0], r);\r\n if (file != null) {\r\n this.file = file;\r\n }\r\n });\r\n });\r\n div.appendChild(this._var.fileControl = file);\r\n file.dispatchEvent(new MouseEvent('click'));\r\n });\r\n },\r\n createIcon('fa-regular', 'link')\r\n ),\r\n createElement('span', span => {\r\n span.className = 'selector-name';\r\n span.style.display = 'none';\r\n }),\r\n createElement('layer', layer => {\r\n layer.appendChild(createIcon('fa-regular', 'times'));\r\n layer.addEventListener('click', () => this.file = null);\r\n })\r\n )\r\n ),\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n if (readonly === true || option.noMessage === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n setTooltip(button, r('P_M3_SENDMESSAGE', 'Send Message'));\r\n button.addEventListener('click', () => {\r\n const val = this.text;\r\n if (nullOrEmpty(val?.trim())) {\r\n return;\r\n }\r\n if (typeof option.onAddMessage === 'function') {\r\n this.loading = true;\r\n option.onAddMessage(this.text);\r\n }\r\n })\r\n }),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-post-note';\r\n button.style.border = '1px solid rgb(19, 150, 204)';\r\n button.style.fill = 'rgb(19, 150, 204)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'comment-alt-lines'));\r\n setTooltip(button, r('P_CU_POSTNOTE', 'Post Note'));\r\n button.addEventListener('click', () => {\r\n const val = this.text;\r\n if (nullOrEmpty(val?.trim())) {\r\n return;\r\n }\r\n if (typeof option.onAddComment === 'function') {\r\n this.loading = true;\r\n option.onAddComment(this.text, this.file);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this._var.message = message;\r\n container.appendChild(message);\r\n return this._var.container = container;\r\n }\r\n\r\n load(data) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n this._var.comments = data;\r\n if (this._var.contactsUpdated !== true) {\r\n const contacts = this._var.contacts;\r\n if (contacts?.length > 0) {\r\n updateCustomerName(data, contacts);\r\n this._var.contactsUpdated = true;\r\n }\r\n }\r\n for (let comment of data) {\r\n const div = createElement('div', 'item-div');\r\n const sendto = getMessageSendTo(comment, null, null, r)\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = comment.Sender;\r\n if (sendto?.length > 0) {\r\n setTooltip(div, sendto);\r\n }\r\n }));\r\n const content = createElement('div', 'item-content');\r\n const mmsParts = createElement('div', div => div.style.display = 'none');\r\n content.appendChild(createElement('span', span => span.innerHTML = escapeHtml(escapeEmoji(comment.Message)), mmsParts));\r\n if (comment.MMSParts?.length > 0) {\r\n mmsParts.style.display = '';\r\n for (let kv of comment.MMSParts) {\r\n appendMedia(mmsParts, kv.Key, kv.Value);\r\n }\r\n }\r\n // if (comment.FollowUp?.length > 0) {\r\n // div.classList.add('item-sent');\r\n // const sendto = r('P_CU_SENDTO_COLON', 'Sent To :') + '\\r\\n' + comment.FollowUp.split(';').join('\\r\\n');\r\n // content.appendChild(createElement('div', div => {\r\n // div.className = 'item-status';\r\n // div.innerText = r('P_WO_SENT', 'Sent');\r\n // setTooltip(div, sendto);\r\n // }));\r\n // }\r\n const [status, text, color, tips] = getMessageStatus(comment, r, this._var);\r\n if (status !== -100) {\r\n if (color != null) {\r\n content.style.backgroundColor = color;\r\n }\r\n const divstatus = createElement('div', div => {\r\n div.className = 'item-status';\r\n div.innerText = text;\r\n if (tips != null) {\r\n setTooltip(div, tips);\r\n }\r\n });\r\n content.appendChild(divstatus);\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comment.TimeStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this._var.message.replaceChildren(...children);\r\n this._var.message.scrollTop = this._var.message.scrollHeight\r\n // setTimeout(() => this._var.message.scrollTop = this._var.message.scrollHeight, 0);\r\n }\r\n}","import { createElement, setTooltip, createIcon } from \"../../ui\";\r\nimport { r as lang, nullOrEmpty, escapeHtml, escapeEmoji } from \"../../utility\";\r\nimport { createBox, appendMedia } from \"./lib\";\r\n\r\nlet r = lang;\r\n\r\nexport default class CustomerRecordComment {\r\n _var = {};\r\n\r\n constructor(opt) {\r\n this._var.option = opt ?? {};\r\n const getText = opt?.getText;\r\n if (typeof getText === 'function') {\r\n r = getText;\r\n }\r\n }\r\n\r\n get text() { return this._var.enter?.value }\r\n set text(s) {\r\n const element = this._var.enter;\r\n if (element != null) {\r\n element.value = s\r\n s = String(nullOrEmpty(s) ? 0 : val.length) + '/' + String(this._var.option.maxLength);\r\n this._var.container.querySelector('.message-bar .prompt-count').innerText = s;\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set loading(flag) {\r\n if (this._var.container == null) {\r\n return;\r\n }\r\n this._var.enter.disabled = flag;\r\n this._var.container.querySelector('.button-send-message').disabled = flag;\r\n }\r\n\r\n /**\r\n * @param {boolean} flag\r\n */\r\n set readonly(flag) {\r\n this._var.option.readonly = flag;\r\n if (this._var.container == null) {\r\n return;\r\n }\r\n this._var.enter.disabled = flag === true;\r\n this._var.container.querySelector('.button-send-message').style.display = flag === true ? 'none' : '';\r\n this._var.container.querySelector('.message-bar .prompt-count').style.display = flag === true ? 'none' : '';\r\n }\r\n\r\n create() {\r\n const readonly = this._var.option.readonly;\r\n const container = createBox(\r\n createElement('div', null,\r\n createElement('div', div => {\r\n div.className = 'title-module';\r\n div.innerText = r('P_CR_COMMENTS', 'Comments');\r\n })\r\n ),\r\n [\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-close';\r\n button.style.backgroundColor = 'transparent';\r\n if (this._var.option.hasClose !== true) {\r\n button.style.display = 'none';\r\n return;\r\n }\r\n button.appendChild(createIcon('fa-solid', 'times', {\r\n fill: '#000'\r\n }));\r\n button.addEventListener('click', () => {\r\n if (typeof this._var.option.onClose === 'function') {\r\n this._var.option.onClose();\r\n }\r\n })\r\n })\r\n ]\r\n );\r\n // enter box\r\n const enter = createElement('textarea', 'ui-text');\r\n enter.placeholder = r('P_CU_ENTERCOMMENTHERE', 'Enter Comment Here');\r\n enter.maxLength = this._var.option.maxLength ??= 3000;\r\n enter.addEventListener('input', () => {\r\n const val = this.text;\r\n const s = String(nullOrEmpty(val) ? 0 : val.length) + '/' + String(this._var.option.maxLength);\r\n this._var.container.querySelector('.message-bar .prompt-count').innerText = s;\r\n });\r\n if (readonly === true) {\r\n enter.disabled = true;\r\n }\r\n this._var.enter = enter;\r\n container.appendChild(\r\n createElement('div', 'message-bar',\r\n enter,\r\n createElement('div', div => div.style.textAlign = 'right',\r\n createElement('div', 'prompt-count'),\r\n createElement('button', button => {\r\n button.className = 'roundbtn button-send-message';\r\n button.style.backgroundColor = 'rgb(19, 150, 204)';\r\n if (readonly === true) {\r\n button.style.display = 'none';\r\n }\r\n button.appendChild(createIcon('fa-solid', 'paper-plane'));\r\n // setTooltip(button, r('P_M3_SENDMESSAGE', 'Send Message'));\r\n setTooltip(button, r('P_CU_POSTNOTE', 'Post Note'));\r\n button.addEventListener('click', () => {\r\n if (typeof this._var.option.onAddComment === 'function') {\r\n this._var.option.onAddComment(this.text);\r\n }\r\n })\r\n })\r\n )\r\n )\r\n );\r\n\r\n const message = createElement('div', 'list-bar');\r\n this._var.message = message;\r\n container.appendChild(message);\r\n return this._var.container = container;\r\n }\r\n\r\n load(data) {\r\n const children = [];\r\n if (data?.length > 0) {\r\n for (let comment of data) {\r\n const div = createElement('div', 'item-div');\r\n // if (sendto !== '') {\r\n // sendto = r('P_CU_SENDTO_COLON', 'Sent To :') + `\\n${sendto}`;\r\n // }\r\n div.appendChild(createElement('div', div => {\r\n div.className = 'item-poster';\r\n div.innerText = comment.UserName;\r\n }));\r\n const content = createElement('div', 'item-content');\r\n const mmsParts = createElement('div', div => div.style.display = 'none');\r\n content.appendChild(createElement('span', span => span.innerHTML = escapeHtml(escapeEmoji(comment.Comment)), mmsParts));\r\n if (comment.MMSParts?.length > 0) {\r\n mmsParts.style.display = '';\r\n for (let kv of comment.MMSParts) {\r\n appendMedia(mmsParts, kv.Key, kv.Value);\r\n }\r\n }\r\n div.append(\r\n content,\r\n createElement('div', div => {\r\n div.className = 'item-time';\r\n div.innerText = comment.SubmitLocalDateStr;\r\n })\r\n );\r\n children.push(div);\r\n }\r\n children[0].style.marginTop = '0';\r\n }\r\n this._var.message.replaceChildren(...children);\r\n this._var.message.scrollTop = this._var.message.scrollHeight\r\n // setTimeout(() => this._var.message.scrollTop = this._var.message.scrollHeight, 0);\r\n }\r\n}"],"names":["createElement","createBox","title","functions","container","header","appendMedia","mimeType","url","createFile","createAudio","createVideo","createPicture","MaxAttachmentSize","fileSupported","insertFile","file","r","label","type","showAlert","isImage","fn","img","reader","e","setTooltip","getStatusText","status","dict","getMessageStatus","comm","_var","messageStatus","knownStatus","okStatus","failedStatus","ls","msgs","_a","p","isEmail","s","a","b","statusText","statusColor","statusUpdatable","statusTips","tip","i","t","gridContainer","Popup","wrapper","changed","m","grid","Grid","createIcon","getMessageSendTo","contacts","followers","sendto","oriph","cname","email","c","f","updateCustomerName","messages","contact","Contact","option","__publicField","getText","parent","tabIndex","contactName","input","preferences","Dropdown","contactEmail","contactMobile","checkOpt","createCheckbox","contactNotes","txt","buttons","item","popup","result","name","pref","phone","opt","notes","nullOrEmpty","CustomerRecordContact","lang","Follower","div","search","key","contains","NoteCol","GridColumn","element","_val","it","_col","CustomerCommunication","flag","_b","_d","_c","link","el","span","cs","mp","isPhone","to","icon","method","tipstr","display","code","mpDisplay","tips","data","readonly","checkAutoUpdate","This","checkLink","enter","val","items","entry","layer","button","message","recordReadonly","pop","sel","list","cc","selectedCol","iconCol","nameCol","buttonCol","createEditCol","_op","showConfirm","createRadiobox","isRecord","index","source","customerRecords","gridWo","workOrderOnly","collapsed","buttonEditFollower","add","children","content","mmsParts","formatUrl","escapeEmoji","kv","text","color","divstatus","InternalComment","comments","comment","escapeHtml","CustomerRecordComment"],"mappings":"8YAAA,MAAAA,EAAA,OAAA,QAAA,EAAA,sTACA,OAAA,aAAA,EAAA,8CAEO,SAASC,EAAUC,EAAOC,EAAW,CACxC,MAAMC,EAAYJ,EAAc,MAAO,MAAM,EACvCK,EAASL,EAAc,MAAO,YAChCE,EACAF,EAAc,MAAO,kBAAmB,GAAGG,CAAS,CAC5D,EACI,OAAAC,EAAU,YAAYC,CAAM,EACrBD,CACX,CAEO,SAASE,EAAYF,EAAWG,EAAUC,EAAK,CAClD,OAAQD,EAAQ,CACZ,IAAK,kBACL,IAAK,OACDH,EAAU,YAAYK,EAAWD,EAAK,UAAU,CAAC,EACjD,MACJ,IAAK,qBACL,IAAK,0BACL,IAAK,0EACL,IAAK,OACL,IA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