1(window.webpackJsonp=window.webpackJsonp||[]).push([[98],{0:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){f()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)}function a(){var e,t=navigator,n=t.userAgent;return n.match(/chrome|chromium|crios/i)?e="chrome":n.match(/firefox|fxios/i)?e="firefox":n.match(/safari/i)?e="safari":n.match(/opr\//i)?e="opera":n.match(/edg/i)&&(e="edge"),e}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/support/",n=new URL(window.location.href).pathname,r=n.split(t)[0];return r?"".concat(r).concat(e):e}function l(e,t,n){var r="true"===e.getAttribute("aria-disabled"),i=JSON.stringify(t)!==JSON.stringify(n);i?r&&e.setAttribute("aria-disabled","false"):!r&&e.setAttribute("aria-disabled","true")}n.d(t,"i",function(){return o}),n.d(t,"d",function(){return b}),n.d(t,"q",function(){return v}),n.d(t,"x",function(){return y}),n.d(t,"s",function(){return E}),n.d(t,"N",function(){return w}),n.d(t,"L",function(){return _}),n.d(t,"u",function(){return S}),n.d(t,"J",function(){return L}),n.d(t,"G",function(){return T}),n.d(t,"b",function(){return k}),n.d(t,"k",function(){return A}),n.d(t,"f",function(){return x}),n.d(t,"Q",function(){return O}),n.d(t,"B",function(){return N}),n.d(t,"p",function(){return M}),n.d(t,"y",function(){return D}),n.d(t,"E",function(){return g}),n.d(t,"D",function(){return m}),n.d(t,"n",function(){return R}),n.d(t,"K",function(){return I}),n.d(t,"C",function(){return P}),n.d(t,"o",function(){return B}),n.d(t,"e",function(){return $}),n.d(t,"l",function(){return H}),n.d(t,"j",function(){return j}),n.d(t,"c",function(){return F}),n.d(t,"A",function(){return V}),n.d(t,"h",function(){return z}),n.d(t,"O",function(){return U}),n.d(t,"M",function(){return l}),n.d(t,"r",function(){return K}),n.d(t,"t",function(){return q}),n.d(t,"F",function(){return W}),n.d(t,"a",function(){return a}),n.d(t,"z",function(){return s}),n.d(t,"v",function(){return oe}),n.d(t,"m",function(){return ie}),n.d(t,"g",function(){return ae}),n.d(t,"I",function(){return se}),n.d(t,"w",function(){return ce}),n.d(t,"H",function(){return de}),n.d(t,"P",function(){return fe});var c=n(1),d=n.n(c),u=n(10),f=n.n(u),p=n(17),h=n(2),g=function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML.replace(/"/g,""")},m=function(e){try{return encodeURIComponent(e)}catch(t){return e}},v=function(){return window.localStorage.getItem("recentSearches")?JSON.parse(window.localStorage.getItem("recentSearches")):[]},b=function(){localStorage.setItem("recentSearches","")},C=function(){return window.store.currentLocale||window.store.defaultLocale},y=function(){var e=document.querySelector(".fw-recent-searches"),t=v();e.innerHTML=t.map(function(e){return'<li><a class="ps-32 line-clamp-2" href="/'.concat(C(),"/support/search?term=").concat(m(e),'">').concat(g(e),"</a></li>")}).join("")},E=function(e,t){return e&&e.classList.contains(t)},w=function(e){var t=[].concat(e);t.forEach(function(e){e&&e.classList.toggle("d-none")})},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"primary",n=[].concat(e);n.forEach(function(e){E(e,"btn-".concat(t))?e.classList.replace("btn-".concat(t),"btn-outline-".concat(t)):e.classList.replace("btn-outline-".concat(t),"btn-".concat(t))})},S=function(e){var t=[].concat(e);t.forEach(function(e){e&&!e.classList.contains("d-none")&&e.classList.add("d-none")})},L=function(e){var t=[].concat(e);t.forEach(function(e){e&&e.classList.contains("d-none")&&e.classList.remove("d-none")})}
1,T=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})},k=function(e){var t=document.createElement("input");T(t,{type:"hidden",name:"authenticity_token",value:window.csrfToken}),e.appendChild(t)},A=function(e,t){return fetch(e,i(i({},t),{},{headers:{"X-CSRF-Token":window.csrfToken}}))},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,n=null;return function(){for(var r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];clearTimeout(n),n=setTimeout(function(){e.apply(void 0,i)},t)}},O=function(e,t){e&&e.addEventListener("change",function(e){var t={};t[e.target.id]=e.target.value,Object(h.d)(e.target,Object(h.a)(e.target),t)}),t&&EventManager.on("click",t,function(){return e.dataset.formChanged=!1,Object(h.c)(e,Object(h.b)(e))?Promise.resolve():Promise.reject()})},N=function(e){[].concat(d()(e.querySelectorAll(".form-group .form-control")),d()(e.querySelectorAll(".form-group .form-check-input"))).forEach(function(t){if(E(t,"invalid"))if(t.classList.remove("invalid"),"checkbox"===t.type)t.nextElementSibling.nextElementSibling.classList.remove("d-block"),t.nextElementSibling.nextElementSibling.classList.add("d-none");else{var n=t.id&&e.querySelector(".invalid-feedback.".concat(t.id));n&&(n.classList.remove("d-block"),n.classList.add("d-none"))}})},M=function(e){return e.charCode?e.charCode:e.keyCode?e.keyCode:e.which?e.which:0},D=function(e){var t=M(e);return t>=48&&57>=t||t>=65&&90>=t||t>=96&&105>=t||8===t||32===t?!0:!1},I=function(e,t){return sessionStorage.setItem(e,JSON.stringify(t))},R=function(e){return sessionStorage.getItem(e)?JSON.parse(sessionStorage.getItem(e)):void 0},P=function(e){return sessionStorage.removeItem(e)},B=function(e){var t=["Bytes","KB","MB","GB","TB"];if(!e)return"0 Byte";var n=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return"".concat(Math.round(e/Math.pow(1024,n),2)," ").concat(t[n])},$=function(e){return e.replace(/[A-Z]/g,function(e,t){return(0!==t?"-":"")+e.toLowerCase()})},H=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e&&e.tagName!==t.toUpperCase();){if(n&&e.tagName===n)return null;e=e.parentElement}return e},j={email:{presence:!0,email:!0}},F=50,V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={},n=new URLSearchParams(document.location.search);return n.forEach(function(n,r){var i=decodeURIComponent(n);e.includes(r)||(r in t?t[r].push(i):t[r]=[i])}),t},z=function(e){return JSON.parse(JSON.stringify(e))},U=function(e){if(window.history.replaceState){var t="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname,"?").concat(e);window.history.replaceState({path:t},"",t)}},K=function(e){return"choicesInstance"in e},q=function(e){return"_flatpickr"in e},W=function(e){return e.offsetHeight+e.scrollTop>=e.scrollHeight},Y=function(e,t){var n=e.getAttribute("aria-describedby");n&&!t.getAttribute("aria-describedby")&&t.setAttribute("aria-describedby",n)},Z=function(e){if(!e)return"";var t=e.getAttribute("aria-label");if(t)return t.trim();if(e.id){var n=document.querySelector('label[for="'.concat(e.id,'"]'));if(n)return n.textContent.replace(/\*/g,"").trim()}var r=e.closest(".form-group"),i=r&&r.querySelector("label.form-label");return i?i.textContent.replace(/\*/g,"").trim():""},G=function(e){if(!e)return null;if(e.id){var t=document.querySelector('label[for="'.concat(e.id,'"]'));if(t)return t}var n=e.closest(".form-group");return n?n.querySelector("label.form-label"):null},X=function(e,t){var n=G(e),r=t.getAttribute("placeholder")||e.getAttribute("placeholder")||"",i=Z(e),o=i&&r&&!t.value?"".concat(i,", ").concat(r):i;n?(n.id||(n.id="".concat(e.id,"-label")),t.setAttribute("aria-labelledby",n.id),t.removeAttribute("aria-label")):o&&(t.setAttribute("aria-label",o),t.removeAttribute("aria-labelledby"))},Q=function(){var e=document.getElementById("flatpickr-sr-announcement");e||(e=document.createElement("span"),e.id="flatpickr-sr-announcement",e.className="visually-hidden",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),document.body.appendChild(e)),e.textContent="",setTimeout(function(){e.textContent=window.I18n.t("portal_js_translations.date_picker_opened",{defaultValue:"Date picker opened"})},100)},J=function(e){var t=e.input,n=e.altInput,r=e.calendarContainer,i=n||t;if(i&&t){var o=Z(t);X(t,i),Y(t,i),i.setAttribute("aria-haspopup","dialog"),i.removeAttribute("aria-expanded"),i.removeAttribute("role"),r&&(r.setAttribute("role","dialog"),r.removeAttribute("aria-modal"),r.getAttribute("aria-label")||r.setAttribute("aria-label",o||window.I18n.t("portal_js_translations.date_picker",{defaultValue:"Date picker"})))}},ee=function(e){var t=e.calendarContainer,n=e.yearElements;if(t&&!t.dataset.a11yKeyboardNavBound){t.dataset.a11yKeyboardNavBound="true";var r=function(e,t,n){e&&(e.setAttribute("tabindex","0"),e.setAttribute("role","button"),t&&e.setAttribute("aria-label",t),e.addEventListener("keydown",function(e){var t=M(e);(13===t||32===t)&&(e.preventDefault(),n())}))};r(t.querySelector(".flatpickr-prev-month"),window.I18n.t("portal_js_translations.date_picker_prev_month",{defaultValue:"Previous month"}),function(){return e.changeMonth(-1)}),r(t.querySelector(".flatpickr-next-month"),window.I18n.t("portal_js_translations.date_picker_next_month",{defaultValue:"Next month"}),function(){return e.changeMonth(1)}),t.querySelectorAll(".arrowUp").forEach(function(t){r(t,window.I18n.t("portal_js_translations.date_picker_increase_year",{defaultValue:"Increase year"}),function(){return e.changeYear(e.currentYear+1)})}),t.querySelectorAll(".arrowDown").forEach(function(t){r(t,window.I18n.t("portal_js_translations.date_picker_decrease_year",{defaultValue:"Decrease year"}),function(){return e.changeYear(e.currentYear-1)})}
1),(n||[]).forEach(function(e){return e.setAttribute("tabindex","0")})}},te=function(e){var t=e.daysContainer;if(t){var n=function(){var n=e.selectedDateElem,r=e.todayDateElem;t.querySelectorAll(".flatpickr-day").forEach(function(e){e.tabIndex=-1});var i=function(e){return!!e&&t.contains(e)},o=i(n)&&n||i(r)&&r||t.querySelector(".flatpickr-day:not(.flatpickr-disabled):not(.hidden)");o&&(o.tabIndex=0)};n(),t.dataset.a11yRovingTabIndexBound||(t.dataset.a11yRovingTabIndexBound="true",t.addEventListener("focusin",function(e){e.target.classList.contains("flatpickr-day")&&(t.querySelectorAll(".flatpickr-day").forEach(function(e){e.tabIndex=-1}),e.target.tabIndex=0)}))}},ne=function(e){var t=e.calendarContainer,n=e.daysContainer,r=e.yearElements;if(!t)return[];var i=n&&n.querySelector('.flatpickr-day[tabindex="0"]'),o=t.querySelector(".flatpickr-prev-month"),a=t.querySelector(".flatpickr-next-month");return[i,o].concat(d()(r||[]),[a]).filter(Boolean)},re=function(e){var t=e.calendarContainer;if(t&&!t.dataset.a11yFocusTrapBound){t.dataset.a11yFocusTrapBound="true";var n=function(t){if(9===M(t)&&e.isOpen){var n=ne(e);if(n.length){t.preventDefault();var r=n.indexOf(document.activeElement),i=t.shiftKey?-1:1,o=-1===r?0:(r+i+n.length)%n.length;n[o].focus()}}};t.addEventListener("keydown",n);var r=e.altInput||e.input;r&&r.addEventListener("keydown",n)}},ie={onReady:function(e,t,n){J(n),ee(n),te(n),re(n)},onMonthChange:function(e,t,n){te(n)},onYearChange:function(e,t,n){te(n)},onOpen:function(e,t,n){var r=n.altInput||n.input;r&&r.setAttribute("aria-expanded","true"),Q(),te(n),requestAnimationFrame(function(){requestAnimationFrame(function(){var e=n.daysContainer,t=e&&e.querySelector('.flatpickr-day[tabindex="0"]');t&&t.focus()})})},onClose:function(e,t,n){var r=n.altInput||n.input;r&&r.removeAttribute("aria-expanded")}},oe=function(e){var t=window.I18n.t("portal_js_translations.flatpickr_translations")||{},n=window.I18n.t("portal_js_translations.flatpickr_translations_fix")||{},r=n.weekdays,o=i(i({},t),{},{weekdays:r}),a=i({altInput:!0,altInputClass:"form-control alt-flatpickr-input",altFormat:"j M, Y",dateFormat:"Y-m-d",locale:o},ie);e.querySelectorAll('input[type="date"]').forEach(function(e){Object(p.a)(e,a)})},ae=function(e){try{var t=e?String(e):"";return t.replace(/<?/g,"<").replace(/>?/g,">")}catch(n){return e}},se=function(e){var t,n,r,i,o,a,s;if(null!==e&&void 0!==e&&null!==(t=e.defaults)&&void 0!==t&&t.options){null!==(n=window)&&void 0!==n&&null!==(r=n.store)&&void 0!==r&&null!==(i=r.portalLaunchParty)&&void 0!==i&&i.enableStrictSearch&&(e.defaults.options.searchFields=["label"],e.defaults.options.fuseOptions={threshold:.1,ignoreLocation:!0,distance:1e3});var l=null===(o=window)||void 0===o?void 0:null===(a=o.store)||void 0===a?void 0:null===(s=a.portalLaunchParty)||void 0===s?void 0:s.homepageNavAccessibilityEnabled,c=document.getElementById("navbarContent");l&&c&&c.classList.add("home_nav_accessibility_lp")}},le=["notice","warning","error"],ce=function(){setTimeout(function(){le.forEach(function(e){var t=document.querySelector("#".concat(e,".alert"));t&&t.focus()})},500)},de=function(e){var t=e.containerOuter.element,n=t.closest(".form-group");if(n){var r=n.querySelector("div.invalid-feedback"),i=r&&r.id;i&&!t.getAttribute("aria-describedby")&&t.setAttribute("aria-describedby",i)}},ue="helpdesk_ticket_forms_dropdown",fe=function(e){var t=e.passedElement.element;if(t.id===ue){var n=e.containerOuter.element,r=t.closest(".fw-helpdesk-ticket-forms-dropdown-container"),i=r&&r.querySelector(".heading"),o=i&&i.textContent.trim()||t.getAttribute("aria-label")||"",a=t.options[t.selectedIndex],s=a&&a.value?a.textContent.trim():"";n.setAttribute("aria-label",s?"".concat(o,", ").concat(s):o)}}},111:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(0),i=function(e,t,n){return'<li><a class="'.concat(e,'" href="').concat(t,'">').concat(n,"</a></li>")},o=function(e,t,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s="/".concat(window.store.currentLocale,"/support/search/").concat(e,"/suggest?term=").concat(n,"&max_matches=5"),l="topics"===e?"fw-topic":"fw-article";Object(r.k)(s,{method:"GET"}).then(function(e){return e.json()}).then(function(e){var n="";e.length>0?(e.forEach(function(e){n+=i(l,e.url,e.title)}),o.innerHTML=n):o.innerHTML=window.I18n.t("portal_js_translations.search.sr_no_result_msg"),Object(r.J)([o.parentElement,a]),Object(r.s)(t,"loading")&&t.classList.remove("loading")})}},15:function(e,t,n){"use strict";function r(){document.querySelectorAll(".choices__list .choices__item.choices__item--selectable").forEach(function(e){e.getAttribute("role")||e.setAttribute("role","option")}),document.querySelectorAll(".choices.form-select").forEach(function(e){var t=e.getAttribute("role"),n=e.previousElementSibling;if(n&&"LABEL"===n.tagName){var r=n.getAttribute("id"),i=r||n.textContent.trim().replace(/ /g,"-");e.getAttribute("aria-label")||e.setAttribute("aria-label",i),r||n.setAttribute("id",i),"listbox"!==t&&"combobox"!==t||e.getAttribute("aria-labelledby")||e.setAttribute("aria-labelledby",i)}if("combobox"===t){var o=e.querySelector(".choices__inner");"listbox"===(null===o||void 0===o?void 0:o.getAttribute("role"))&&o.removeAttribute("role"),e.querySelectorAll(".choices__list").forEach(function(e){e.getAttribute("role")||e.setAttribute("role","listbox")})}}),document.querySelectorAll('.choices__list[role="listbox"]').forEach(function(e){var t=e.closest(".choices.form-select");if(t){var n=t.getAttribute("aria-labelledby");n&&!e.getAttribute("aria-labelledby")&&e.setAttribute("aria-labelledby",n)}})}t.a=r},198:function(e,t,n){"use strict";n.r(t);var r=n(20),i=n.n(r),o=n(1),a=n.n(o),s=n(5),l=n.n(s),c=n(82),d=(n.n(c),n(85),n(34),n(94),n(84),n(9)),u=n.n(d),f=n(7),p=n.n(f),h=n(35),g=n(39),m=n(15),v=n(37),b=n(2),C=n(0),y=n(111),E=n(25),w=",";Object(C.i)(function(){var e=document.querySelector("#new_helpdesk_ticket");if(e){var t=document.querySelector(".form-group.helpdesk_ticket_email"),n=document.querySelector("#helpdesk_ticket_email"),r=document.querySelector(".requester-name"),o=document.querySelector(".form-group.helpdesk_ticket_company_id"),s=document.querySelector("#helpdesk_ticket_company_id"),c=s&&s.value,d=document.querySelector("#new-ticket-cc-toggle"),f=document.querySelector(".new-ticket-cc-field"),_=document.querySelector("#cc-field"),S=document.querySelector("#cc-emails-clone"),L=document.querySelector("#helpdesk_ticket_subject"),T=document.querySelector("#helpdesk_ticket_group_id"),k=document.querySelector("#helpdesk_ticket_responder_id"),A=document.querySelectorAll(".new_ticket_dynamic_
1sections"),x=document.querySelector("#meta_seen_articles"),O=document.querySelector("#meta_user_agent"),N=document.querySelector(".new-ticket-submit-button");Object(h.a)(document.querySelectorAll(".nested_field"));var M=document.querySelector("#helpdesk_ticket_workspace_id")||document.querySelector("#helpdesk_ticket_department_id");M&&T&&M.addEventListener("change",function(){var e="helpdesk_ticket_workspace_id"===M.id?"workspace_id":"department_id",t=M.value||"";Object(C.k)("/helpdesk/commons/department_workspace_groups?".concat(e,"=").concat(encodeURIComponent(t)),{method:"GET"}).then(function(e){return e.text()}).then(function(e){T.innerHTML=sanitizeHtml(e),T.dispatchEvent(new Event("change"))})});var D=document.querySelector("#helpdesk_ticket_product_id"),I=document.querySelector("#helpdesk_ticket_workspace_id")||document.querySelector("#helpdesk_ticket_department_id");I&&D&&I.addEventListener("change",function(){var e=I.value||"",t="helpdesk_ticket_workspace_id"===I.id?"workspace_id":"department_id";Object(C.k)("/helpdesk/commons/workspace_products?".concat(t,"=").concat(encodeURIComponent(e)),{method:"GET"}).then(function(e){return e.text()}).then(function(e){D.innerHTML=sanitizeHtml(e),D.dispatchEvent(new Event("change"))})}),T&&T.addEventListener("change",function(e){if(k){var t=k.dataset.placeholder||window.I18n.translate("portal_elements.dropdown_default");Object(C.k)("/helpdesk/commons/group_agents/".concat(e.target.value,"?blank_value=").concat(t),{method:"GET"}).then(function(e){return e.text()}).then(function(e){k.choicesInstance.destroy(),k.innerHTML=e,k.choicesInstance=new u.a(k,{searchEnabled:k.options.length>3,classNames:{containerOuter:"choices form-select",shouldSort:!1},callbackOnInit:function(){Object(C.H)(this)}}),Object(m.a)()})}});var R=function(e,t){e&&e.addEventListener("change",function(e){var t={};t[e.target.id]=e.target.value,Object(b.d)(e.target,Object(b.a)(e.target),t)}),t&&(EventManager.on("click",t,function(){return e.dataset.formChanged=!1,Object(b.c)(e,Object(b.b)(e))?Promise.resolve():Promise.reject()}),EventManager.on("keypress",t,function(n){if(13===n.keyCode&&!t.classList.contains("disabled")){if(e.dataset.formChanged=!1,!Object(b.c)(e,Object(b.b)(e)))return Promise.reject();e.dispatchEvent(new Event("submit"))}return Promise.resolve()}))},P=function(e){var t;return Object(C.s)(e,"any-cc-field")?(t=new u.a(e,{searchEnabled:!0,removeItems:!0,shouldSort:!1,duplicateItemsAllowed:!1,delimiter:w,removeItemButton:!0,classNames:{containerOuter:"choices form-select custom-select--multiple"},noResultsText:window.I18n.t("portal_validation.email"),noChoicesText:window.I18n.t("portal_js_translations.tickets.add_multiple_cc"),callbackOnCreateTemplates:function(e){return{input:function(){return e('\n <input type="text" class="choices__input choices__input--cloned search-input" autocomplete="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" aria-label="false" placeholder="'.concat(window.I18n.t("portal_js_translations.new_ticket.any_cc_placeholder_text"),'">\n '))}}}}),e.addEventListener("hideDropdown",function(){t.clearChoices()}),e.addEventListener("removeItem",function(){t.clearChoices()}),e.addEventListener("search",function(n){t.clearChoices();var r=t.getValue(!0);if(r.length<C.c){var i,o=n.detail.value,s=void 0===o?"":o,l=s.includes(w),c=[],d=s.split(w);a()(new Set(d)).forEach(function(e){return e?(i=r.includes(e),!i&&!p()({email:e},C.j)&&c.push({label:e,value:e})):!1}),i&&(t.clearChoices(),document.querySelector(".has-no-results").innerHTML=window.I18n.t("portal_validation.unique")),c.length&&(t.setChoices(c),(c.length>1||1===c.length&&l)&&(t.setValue(c),t.clearChoices(),t.clearInput(),e.dispatchEvent(new Event("change"))))}else document.querySelector(".has-no-results").innerHTML=window.I18n.t("portal_js_translations.tickets.max_cc",{count:C.c})})):Object(C.s)(e,"company-cc-field")?t=new u.a(e,{searchEnabled:e.options.length>3,removeItems:!0,duplicateItemsAllowed:!1,delimiter:w,removeItemButton:!0,classNames:{containerOuter:"choices form-select custom-select--multiple"},callbackOnCreateTemplates:function(t){return{input:function(){return t('\n <input type="text" class="choices__input choices__input--cloned search-input" autocomplete="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" aria-label="false" placeholder="'.concat(window.I18n.t("portal_js_translations.new_ticket.company_cc_placeholder_text")).concat(e.dataset.userCompany,'">\n '))}}}}):Object(C.s)(e,"contractor-company-cc-field")&&(t=new u.a(e,{searchEnabled:!0,removeItems:!0,duplicateItemsAllowed:!1,delimiter:w,removeItemButton:!0,classNames:{containerOuter:"choices form-select custom-select--multiple"},callbackOnCreateTemplates:function(e){var t=this;return{input:function(){return e('\n <input type="text" class="choices__input choices__input--cloned search-input" autocomplete="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" aria-label="false" placeholder="'.concat(window.I18n.t("portal_js_translations.new_ticket.contractor_cc_placeholder_text"),'">\n '))},choice:function(n,r){return e('\n <div class="'.concat(n.item," ").concat(n.itemChoice," ").concat(r.disabled?n.itemDisabled:n.itemSelectable," ").concat(r.value,'"\n data-select-text="').concat(t.config.itemSelectText,'"\n data-choice\n ').concat(r.disabled?'data-choice-disabled aria-disabled="true"':"data-choice-selectable",'\n data-id="').concat(r.id,'"\n data-value="').concat(r.value,'"\n ').concat(r.groupId>0?'role="treeitem"':'role="option"',">\n <b>").concat(r.label,"</b><br/>").concat(r.customProperties.email,"\n </div>\n "))}}}})),e.addEventListener("hideDropdown",function(){t.clearInput()}),e.addEventListener("change",function(){var n=t.getValue(!0),r=document.querySelector(".search-input");Object(C.s)(e,"any-cc-field")?(S.value=n.toString(),r.placeholder=0===n.length?window.I18n.t("portal_js_translations.new_ticket.any_cc_placeholder_text"):""):Object(C.s)(e,"company-cc-field")?r.placeholder=0===n.length?"".concat(window.I18n.t("portal_js_translations.new_ticket.company_cc_placeholder_text")).concat(e.dataset.userCompany):"":Object(C.s)(e,"contractor-company-cc-field")&&(r.placeholder=0===n.length?window.I18n.t("portal_js_translations.new_ticket.contractor_cc_placeholder_text"):"")}),t&&(e.choicesInstance=t),t},B=_&&P(_),$=s&&new u.a(s,{searchEnabled:!0,shouldSort:!1,classNames:{containerOuter:"choices form-select"}}
1);$&&(s.choicesInstance=$);var H=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!0;t&&Object(C.u)(d),Object(C.u)(f),d.innerText="Add CC",d.dataset.toggleText="Hide CC"},j=function(e){var t=new FormData;t.append("email",e),Object(C.k)("/helpdesk/commons/user_companies",{method:"POST",body:t}).then(function(e){return e.json()}).then(function(e){var t;if(e!==!1){$.clearChoices();var n=e.map(function(e){return{label:e[0],value:e[1].toString()}}),r=s.dataset.placeholder||window.I18n.translate("portal_elements.dropdown_default");n.unshift({label:r,value:""}),$.setChoices(n),$.setChoiceByValue(n[0].value),Object(C.J)(o),s.dispatchEvent(new Event("change"))}else Object(C.u)(o),_&&!Object(C.s)(_,"any-cc-field")&&H(B);null!==(t=window.store)&&void 0!==t&&t.ticket_fields&&(window.store.ticket_fields.find(function(e){return"company"===e.name}).choices=e||[])})};if(R(e,N),d&&d.addEventListener("click",function(){var e=d.innerText;d.innerText=d.dataset.toggleText,d.dataset.toggleText=e,Object(C.N)(f)}),s&&(t.parentElement.insertBefore(o,t.nextSibling),s.addEventListener("change",function(e){_&&Object(C.s)(_,"contractor-company-cc-field")&&B.clearStore(),c=e.target.value}),_&&s&&Object(C.s)(_,"contractor-company-cc-field")&&_.addEventListener("search",Object(C.f)(function(e){var t=e.detail.value;Object(C.k)("/search/autocomplete/company_users?q=".concat(t,"&customer_id=").concat(c,"&customer_portal=true"),{method:"GET"}).then(function(e){return e.json()}).then(function(e){var t=e.results,n=t.map(function(e){return{label:e.value,value:e.email,customProperties:{name:e.value,email:e.email}}});B.clearChoices(),B.setChoices(n)})},1e3))),n&&("true"===n.dataset.notAllowOthers?(n.setAttribute("readOnly",!0),s&&j(n.value)):(n.addEventListener("change",function(e){var t=n.dataset.userEmail,i=e.target.value,o=p()({email:i},C.j),a=e.isTrusted;if(i===t||o){if(Object(C.u)(r),a){for(var l=n.closest(".form-group"),c=l.nextElementSibling;c&&(!c.classList.contains("form-group")||c.classList.contains("d-none"));)c=c.nextElementSibling;if(c){var u=c.querySelector("input, textarea, .choices.form-select, .fr-box.fr-basic.fr-top");u&&u.focus()}}_&&Object(C.J)([d])}else{if(Object(C.J)(r),a){var f=r.querySelector("input");f&&f.focus()}_&&!Object(C.s)(_,"any-cc-field")&&H(B)}s&&j(i)}),n.dispatchEvent(new Event("change")))),L&&"true"===L.dataset.allowSolutionSuggester){var F=document.querySelector(".fw-sidebar-wrapper");L.addEventListener("keyup",Object(C.f)(function(e){var t=e.target.value;L.classList.add("loading");var n=F.querySelector(".suggestions-results");Object(y.a)("solutions",L,t,n,F)}),1e3)}A&&A.forEach(function(e){e.addEventListener("change",function(e){var t=e.target.id,n=document.querySelector(".".concat(t,"_section_wrapper"));if(n){n.innerHTML="";var r=JSON.parse(e.target.nextElementSibling.firstElementChild.dataset.customProperties)&&JSON.parse(e.target.nextElementSibling.firstElementChild.dataset.customProperties).id,i=document.querySelector(".".concat(t,"-section-ticket-field-").concat(r));n.innerHTML=i?Object(C.g)(i.value):"",n.querySelectorAll(".choices").forEach(function(e){var t={searchEnabled:e.options&&e.options.length>3,shouldSort:!1,classNames:{containerOuter:"choices form-select",selectedState:"".concat(e.id,"-is-selected")},callbackOnInit:function(){Object(C.H)(this)}};e.choicesInstance=new u.a(e,t)}),Object(C.v)(n),Object(E.a)(n),Object(h.a)(n.querySelectorAll(".nested_field")),Object(g.a)(n.querySelectorAll(".fw-custom-multi-select")),Object(m.a)()}}),e.dispatchEvent(new Event("change"))}),O&&(O.value=window.navigator.userAgent),e&&(e.addEventListener("submit:failed",function(){return Object(v.a)(N)}),EventManager.on("submit",e,i()(l.a.mark(function V(){var e,t;return l.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(Object(v.a)(N),"true"!==N.dataset.recaptchaEnterprise){n.next=7;break}if(e=document.getElementById("recaptcha-frame"),!e){n.next=7;break}return e.contentWindow.recaptchaV3(),n.next=7,new Promise(function(e){setTimeout(e,700)});case 7:x&&Object(C.n)("seenArticlesArray")&&Object(C.n)("seenArticlesArray").length>0&&(t=Object(C.n)("seenArticlesArray").slice().splice(-50),x.value=JSON.stringify(JSON.stringify(t)),Object(C.C)("seenArticlesArray"));case 8:case"end":return n.stop()}},V)})))),Object(g.a)(document.querySelectorAll(".fw-custom-multi-select")),Object(m.a)()}})},2:function(e,t,n){"use strict";n.d(t,"b",function(){return k}),n.d(t,"a",function(){return T}),n.d(t,"c",function(){return N}),n.d(t,"d",function(){return A});var r=n(3),i=n.n(r),o=n(1),a=n.n(o),s=n(7),l=n.n(s),c="ext",d=30,u=5,f=8,p=/^\d+$/,h=/^\+?[\d()\-.\s/#*,;a-zA-Z]+$/,g="portal_validation.phone_parity",m=function(e){var t=String(null==e?"":e).match(/\d/g);return t?t.length:0},v=function(e){var t=String(null==e?"":e).match(/[a-zA-Z]/g);return m(e)+(t?t.length:0)},b=function(e){if(void 0===e||null===e||""===e)return{phone:"",extension:""};var t=String(e),n=t.lastIndexOf(c);return-1===n?{phone:t.trim(),extension:""}:{phone:t.slice(0,n).replace(/\s+$/,""),extension:t.slice(n+c.length).trim()}},C=function(e){return p.test(e)?e.length>f?"extensionTooLong":null:"extensionCharset"},y=function(e,t){return h.test(e)?v(e)<u?"minDigits":e.length+t>d?t>
10?"maxMainChars":"maxMainCharsNoExtension":null:"mainCharset"},E=function(e,t){if(void 0===e||null===e||""===String(e).trim())return null;var n=b(String(e).trim()),r=n.phone,i=n.extension,o=i.trim();if(!r&&o)return"extensionOnly";if(o&&t===!1)return"extensionSegmentDisallowed";if(o){var a=C(o);if(a)return a}return y(r,o.length)},w=function(e){return window.I18n.translate("".concat(g,".").concat(e),{defaultValue:window.I18n.translate("portal_validation.phone")})};l.a.validators.phoneParity=function(e,t){var n=Object.prototype.hasOwnProperty.call(t,"combinedValue")?t.combinedValue:e,r=E(n,t.allowExtension);return r?w(r):void 0};var _=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t;switch(e.type){case"email":""!==e.value&&(n.email={message:window.I18n.translate("portal_validation.email")});break;case"url":""!==e.value&&(n.url={message:window.I18n.translate("portal_validation.url")});break;case"text":if(e.dataset.phoneParity){var r=document.getElementById("".concat(e.id,"_ext")),i=r?r.value.trim():"";if(""!==e.value||""!==i){var o=i?"".concat(e.value.trim()).concat(c).concat(i):e.value;n.phoneParity={allowExtension:"work"===e.dataset.phoneParity,combinedValue:o,message:window.I18n.translate("portal_validation.phone")}}}""!==e.value&&(e.dataset.decimal||e.dataset.number)&&(e.dataset.decimal&&(n.format={pattern:/^-?\d+(\.\d{0,2})?$/i,message:window.I18n.translate("portal_validation.decimal")}),e.dataset.number&&(n.format={pattern:/^-?\d+$/i,message:window.I18n.translate("portal_validation.number")}))}return n},S=function(e,t){if(e){var n=document.getElementById(e),r=document.querySelector(".invalid-feedback.".concat(e));n&&n.classList.add("invalid"),n&&n.setAttribute("aria-invalid","true"),r&&(r.innerHTML=t,r.classList.add("d-block"))}},L=function(e){if(e){var t=document.getElementById(e),n=document.querySelector(".invalid-feedback.".concat(e));t&&t.classList.remove("invalid"),t&&t.removeAttribute("aria-invalid"),n&&(n.classList.remove("d-block"),n.innerHTML="")}},T=function(e){var t={},n=_(e);return Object.keys(n).length&&(t[e.id]=n),t},k=function(e){var t={};return[].concat(a()(e.querySelectorAll(":not(.d-none).form-group .form-control")),a()(e.querySelectorAll(":not(.d-none).form-check .form-check-input")),a()(e.querySelectorAll(".nested_field :not(.d-none).form-check .form-check-input"))).forEach(function(e){var n=_(e);e.required&&""!==e.id&&(n.presence={message:window.I18n.translate("portal_validation.required"),allowEmpty:!1}),Object.keys(n).length&&(t[e.id]=n)}),t},A=function(e,t,n){L(e.id);var r=l()(n,t,{fullMessages:!1});if(r){var o=i()(r[e.id],1),a=o[0];S(e.id,a)}},x=function(e){if(e){if(e.classList.contains("rich-editor")){var t=e.previousElementSibling&&e.previousElementSibling.querySelector(".fr-element");if(t)return void t.focus()}var n=e.choicesInstance;if(n){var r;if(r=e.multiple?n.input&&n.input.element:n.containerOuter&&n.containerOuter.element)return void r.focus()}e.focus()}},O=function(e){e&&x(e.querySelector(".invalid"))},N=function(e,t){var n={};[].concat(a()(e.querySelectorAll(":not(.d-none).form-group .form-control")),a()(e.querySelectorAll(":not(.d-none).form-check .form-check-input")),a()(e.querySelectorAll(".nested_field :not(.d-none).form-check .form-check-input"))).forEach(function(e){L(e.id),"checkbox"===e.type?n[e.id]=e.checked?"true":"":"textarea"===e.type&&e.classList.contains("rich-editor")?n[e.id]=e.previousElementSibling.querySelector(".fr-element").innerText:n[e.id]=e.value});var r=l()(n,t,{fullMessages:!1});return r?(e.dataset.errors=!0,Object.entries(r).forEach(function(e){var t=i()(e,2),n=t[0],r=t[1],o=i()(r,1),a=o[0];S(n,a)}),O(e),!1):(e.dataset.errors=!1,!0)}},25:function(e,t,n){"use strict";function r(e,t){function n(e){var t=e.search.records.map(function(e){return{label:e.data[e.metadata.primary_field_name],value:e.display_id}}),n=o.config.choices.find(function(e){return e.placeholder});if(n.selected=!1,o.clearChoices(),o.setChoices([n].concat(t)),r&&!t.length){var i="function"==typeof o.config.noResultsText?o.config.noResultsText():o.config.noResultsText,a=o._getTemplate("notice",i,"no-results");o.choiceList.element.append(a)}o.containerInner.element.querySelector(".choices__item--selectable").classList.remove("loading"); 2}
2var r=i(t.detail.value),o=e.choicesInstance,a=e.id.split("helpdesk_ticket_custom_field_")[1],s=e.dataset.primaryContactAssoc,c="/api/_/support/ticket/custom_objects/search?term=".concat(encodeURIComponent(r),"&field_name=").concat(encodeURIComponent(a));s&&(c+="&primary_contact_assoc=".concat(encodeURIComponent(s))),o.containerInner.element.querySelector(".choices__item--selectable").classList.add("loading"),Object(l.k)(c,{method:"GET"}).then(function(e){return e.json()}).then(n)}function i(e){return"string"!=typeof e?e:e.replace(/"/g,'"').replace(/</g,"<").replace(/&rt;/g,">").replace(/&/g,"&")}function o(e){e.querySelectorAll(c).forEach(d)}var a=n(9),s=n.n(a),l=n(0),c='[data-lookup-field="true"]',d=function(e){var t={searchEnabled:!0,searchPlaceholderValue:window.I18n.t("portal_js_translations.please_enter_one_or_more"),shouldSort:!1,removeItemButton:!0,classNames:{containerOuter:"choices form-select hide-default-option"},noResultsText:window.I18n.t("portal_js_translations.search.sr_no_result_msg"),callbackOnInit:function(){var e,t=this.containerInner.element.querySelector("select"),n=t.dataset,r=n.selectedRecordId,i=n.selectedRecordText;if(i)e={label:i,value:r};else{var o=t.querySelector("option").textContent;e={label:o,value:""}}this.setValue([e])}};e.choicesInstance=new s.a(e,t);var n;e.addEventListener("search",function(t){var i;null===(i=e.choicesInstance.choiceList.getChild(".has-no-results"))||void 0===i?void 0:i.remove(),clearTimeout(n),n=setTimeout(function(){r(e,t)},250)})};t.a=o},29:function(e,t,n){"use strict";var r=n(3),i=n.n(r),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!1,n=document.createElement("script");Object.entries(e).forEach(function(e){var t=i()(e,2),r=t[0],o=t[1],a="boolean"==typeof o?"":o;n.setAttribute(r,a)});var r=t?"head":"body",o=document.querySelector("".concat(r," script"));return o.parentNode.insertBefore(n,o),new Promise(function(e,t){n.onload=function(){e.apply(void 0,arguments)},n.onerror=function(){t(new Error("Error in loading scripts"))}})};t.a=o},34:function(e,t,n){"use strict";function r(e){if(!e.options)return!1;var t=Array.from(e.options).filter(function(e){return""!==e.value}).length;if(1>=t)return!1;var n=e.closest("form");if(!n)return!1;var r=n.querySelectorAll("select.choices");return r.length>0&&r[r.length-1]===e}var i=n(9),o=n.n(i),a=n(15),s=n(0),l=n(25);Object(s.i)(function(){document.querySelectorAll(".choices").forEach(function(e){var t={searchEnabled:e.options&&e.options.length>3,shouldSort:!1,position:r(e)?"top":"auto",classNames:{containerOuter:"choices form-select"},searchResultLimit:25,noResultsText:window.I18n.t("portal_js_translations.search.sr_no_result_msg"),callbackOnInit:function(){var e=this,t=this.containerOuter.element,n=t.parentElement.querySelector("label")&&t.parentElement.querySelector("label").textContent.trim(),r=this.passedElement.element.getAttribute("aria-label"),i=n||r;i&&t.setAttribute("aria-label",i),Object(s.H)(this);var o=this.passedElement.element;"helpdesk_ticket_forms_dropdown"===o.id&&(Object(s.P)(this),o.addEventListener("change",function(){Object(s.P)(e)})),Object(a.a)()}};e.choicesInstance=new o.a(e,t)}),Object(l.a)(document)})},35:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){a()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.d(t,"a",function(){return b});var o=n(10),a=n.n(o),s=n(3),l=n.n(s),c=n(4),d=n.n(c),u=n(6),f=n.n(u),p=n(9),h=n.n(p),g=n(15),m=n(0),v=function(){function e(t){d()(this,e),this.tree=this.convertToObject(t)}return f()(e,[{key:"convertToObject",value:function(e){var t=this,n=new Map;return Array.isArray(e)?(e.forEach(function(e){var r=l()(e,3),i=r[0],o=r[1],a=r[2],s=String(i),c={label:o,value:i,children:a?t.convertToObject(a):new Map};n.set(s,c)}),n):n}},{key:"constructOptionsObject",value:function(e,t){if(!(e&&"-1"!==e&&"0"!==e&&t instanceof Map))return new Map;var n=String(e);return t.has(n)?t.get(n).children:new Map}},{key:"createNestedField",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i="",o=r.classes?r.classes:"";
2r.attributes&&r.attributes.forEach(function(e){i="".concat(e.key," = ").concat(e.value," ")});var a=r.isFilter?"".concat(e.name,"[]"):"helpdesk_ticket[custom_field][".concat(e.name,"]");return'<div class="form-group">\n <label for="helpdesk_ticket_custom_field_'.concat(e.name,'">\n ').concat(e.label_in_portal," ").concat(n?'<span class="fw-asterisk">*</span>':"",'\n </label>\n\n <select class="form-control choices nested-child-fields ').concat(o,'"\n ').concat(n?"required":"",'\n id="helpdesk_ticket_custom_field_').concat(e.name,'"\n name="').concat(a,'"\n ').concat(i,"\n >\n ").concat(t,'\n </select>\n <div class="invalid-feedback helpdesk_ticket_custom_field_').concat(e.name,'" id="helpdesk_ticket_custom_field_').concat(e.name,'-error-message"></div>\n </div>')}},{key:"createOptions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e&&e.toString().replace(/"/g,""")||"",i=t||window.I18n.translate("portal_elements.dropdown_default"),o=n&&n.toString().replace(/"/g,"""),a=o&&o===r,s=a?'<option value="'.concat(r,'" selected>').concat(i,"</option>"):'<option value="'.concat(r,'">').concat(i,"</option>");return s}},{key:"createField",value:function(e,t,n,r,o){var a=this,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},c="",d=l()(e,1),u=d[0],f=this.constructOptionsObject(u,t);e.forEach(function(t,n){var i="";f.size>0&&(s.isFilter?(i+=a.createOptions("",window.I18n.translate("portal_elements.any")),i+=a.createOptions("0",window.I18n.translate("portal_elements.none"),e[n+1])):i+=a.createOptions(),f.forEach(function(t){var r=t.label,o=t.value;i+=a.createOptions(o,r,e[n+1])}),c+=a.createNestedField(r[n],i,o,s)),f=a.constructOptionsObject(e[n+1],f)}),n.innerHTML=c;var p=n.querySelectorAll(".choices"),v={searchEnabled:!1,shouldSort:!1,searchResultLimit:25,classNames:{containerOuter:"choices form-select",itemDisabled:"dropdown-divider"},callbackOnInit:function(){Object(m.H)(this)}};p.forEach(function(e){var t,n=i(i({},v),{},{searchEnabled:(null!==(t=null===e||void 0===e?void 0:e.options)&&void 0!==t?t:[]).length>3});e.choicesInstance=new h.a(e,n)}),Object(g.a)();var b=n.querySelectorAll(".nested-child-fields"),C=[u];b.forEach(function(e,i){if(C.push(e.value),e){var l=a;e.addEventListener("change",function(e){C.length=i+1,C.push(e.target.value),l.createField(C,t,n,r,o,s)})}});var y=new CustomEvent("dependantFieldChildsUpdated",{detail:{elements:b}});document.body.dispatchEvent(y)}}]),e}(),b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach(function(e){var n=e.querySelector(".parent_field"),r=e.querySelector(".child_field"),i=JSON.parse(n.dataset.nestedChoices),o=new v(i),a=JSON.parse(n.dataset.nestedLevels),s="null"!==n.dataset.selectedChoices&&Object.values(JSON.parse(n.dataset.selectedChoices)).filter(function(e){return null!==e}),l=JSON.parse(n.dataset.requiredField);s&&o.createField(s,o.tree,r,a,l,t),n.addEventListener("change",function(e){var n=[e.target.value];o.createField(n,o.tree,r,a,l,t)})})}},37:function(e,t,n){"use strict";var r=function(e){e.classList.toggle("disabled");var t=e.dataset.submitText,n=e.innerText;e.innerText=t,e.dataset.submitText=n};t.a=r},39:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(9),i=n.n(r),o=",",a=function(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},s=function(e){e.forEach(function(e){var t=e.dataset.placeholder||window.I18n.t("portal_js_translations.new_ticket.multi_select_placeholder_text"),n=a(t),r=new i.a(e,{removeItems:!0,shouldSort:!1,duplicateItemsAllowed:!1,delimiter:o,removeItemButton:!0,classNames:{containerOuter:"choices form-select custom-select--multiple"},callbackOnCreateTemplates:function(e){return{input:function(){return e('\n <input type="text" class="choices__input choices__input--cloned search-input" autocomplete="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" aria-label="'.concat(n,'" placeholder="').concat(n,'">\n '))}}}}),s=function(){var e=r.getValue(!0),n=Array.isArray(e)&&e.some(function(e){return""!==e&&null!=e&&""!==String(e).trim()});r.input.placeholder=n?"":t,r.input.setWidth()};e.addEventListener("change",s),s(),e.choicesInstance=r})}},8:function(e,t,n){"use strict";function r(e,t){return e?"BUTTON"===e.tagName?!0:"INPUT"===e.tagName&&["button","submit","reset"].includes(e.type)?!0:13===t&&"A"===e.tagName&&e.hasAttribute("href")?!0:!1:!1}function i(e){if("click"===e.type)return!0;
2if("keypress"===e.type){var t=e.charCode||e.keyCode;return 32!==t&&13!==t?!1:r(e.target,t)?!1:!0}return!1}t.a=i},82:function(e,t){var n=function(e,t){function n(n){var r=n.data;switch(r.type){case"token":if(t)t(r.token);else{var a="g-recaptcha-response",s=document.getElementById(a);if(!s){var l=jQuery("#recaptcha-frame").closest("form");s=document.createElement("input"),s.type="hidden",s.name=a,s.id=a,l.append(s)}s.value=r.token}break;case"expand":if(e.height=i.expand.height,e.width=i.expand.width,e.scrollIntoView(),r.recaptchaFixEnabled){var c=document.querySelector(".recaptcha-frame").contentWindow,d=c.document.querySelector("div:last-child div:last-child");d&&(d.style.height=o)}break;case"minimize":e.height=i.minimize.height,e.width=i.minimize.width}}var r={};r.channel=new MessageChannel,r.channel.port1.onmessage=n,e.contentWindow.postMessage("init",window.location.origin,[r.channel.port2]),"MutationObserver"in window||(e.style.resize="both");var i={minimize:{height:"100px",width:"320px"},expand:{height:"500px",width:"350px"}},o="490px"};window.onload=function(){var e=document.getElementById("recaptcha-frame");return e&&"false"!==e.dataset.selfinvoke?void n(e):!0}},83:function(e,t,n){function r(e){if(!n.o(i,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=i[e],r=t[0];return n.e(t[1]).then(function(){return n.t(r,7)})}var i={"./ar":[43,1],"./ar.js":[43,1],"./bs":[44,2],"./bs.js":[44,2],"./cs":[45,3],"./cs.js":[45,3],"./da":[46,4],"./da.js":[46,4],"./de":[47,5],"./de.js":[47,5],"./el":[48,6],"./el.js":[48,6],"./en_ca":[49,7],"./en_ca.js":[49,7],"./en_gb":[50,8],"./en_gb.js":[50,8],"./es":[51,9],"./es.js":[51,9],"./et":[52,10],"./et.js":[52,10],"./fa":[53,11],"./fa.js":[53,11],"./fi":[54,12],"./fi.js":[54,12],"./fr":[55,13],"./fr.js":[55,13],"./he":[56,14],"./he.js":[56,14],"./hr":[57,15],"./hr.js":[57,15],"./hu":[58,16],"./hu.js":[58,16],"./id":[59,17],"./id.js":[59,17],"./it":[60,18],"./it.js":[60,18],"./ja":[61,19],"./ja.js":[61,19],"./ko":[62,20],"./ko.js":[62,20],"./ku":[63,21],"./ku.js":[63,21],"./me":[64,22],"./me.js":[64,22],"./nb":[65,23],"./nb.js":[65,23],"./nl":[66,24],"./nl.js":[66,24],"./pl":[67,25],"./pl.js":[67,25],"./pt_br":[68,26],"./pt_br.js":[68,26],"./pt_pt":[69,27],"./pt_pt.js":[69,27],"./ro":[70,28],"./ro.js":[70,28],"./ru":[71,29],"./ru.js":[71,29],"./sk":[72,30],"./sk.js":[72,30],"./sl":[73,31],"./sl.js":[73,31],"./sr":[74,32],"./sr.js":[74,32],"./sv":[75,33],"./sv.js":[75,33],"./th":[76,34],"./th.js":[76,34],"./tr":[77,35],"./tr.js":[77,35],"./uk":[78,36],"./uk.js":[78,36],"./vi":[79,37],"./vi.js":[79,37],"./zh_cn":[80,38],"./zh_cn.js":[80,38],"./zh_tw":[81,39],"./zh_tw.js":[81,39]};r.keys=function(){return Object.keys(i)},r.id=83,e.exports=r},84:function(e,t,n){"use strict";var r=n(8),i=n(0),o=n(29);Object(i.i)(function(){var e=0,t=20971520,n=20971520,a=/(?:\.([^.]+))?$/,s=document.getElementById("upload_file"),l=document.getElementById("files_list"),c=[],d=[],u="cloudApps"in window.store,f=[];u&&""!==window.store.cloudApps.dropboxAppKey&&Object(o.a)({id:"dropboxjs",src:"https://www.dropbox.com/static/api/2/dropins.js","data-app-key":window.store.cloudApps.dropboxAppKey});var p=function(e){var t=new DataTransfer;return e.forEach(function(e){t.items.add(e)}),t.files},h=function(){return Array.from(l.files)},g=function(e){l.files=p(e)},m=function(e){return e.size<=t},v=function(t){return t?t.size+e<=n:n>=e},b=function(e){var t=window.store.blockedExtensions.split(","),n=new RegExp(a).exec(e.name)[1];return n&&t.includes(n.toLowerCase())},C=function(e){var t=window.store.allowedExtensions.split(","),n=new RegExp(a).exec(e.name)[1];return n&&t.includes(n.toLowerCase())},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="error"===t,r=e.provider||"file";return"<div\n class='".concat(n?"errorAttachment":"proper-attachments-list"," attachment-props-container d-inline-block align-top'\n id='attachment_").concat(e.id,"'\n data-fileid='").concat(e.id,"'\n data-filesize='").concat(e.size,"'\n >\n <div class='attachment file-container file-props-font d-inline-block position-relative ").concat(n?"error-file":"","'>
2\n <span class='visually-hidden' tabindex='0'>").concat(e.name," (").concat(e.humanizedSize,")</span>\n <button type=\"button\" class='remove-file-icon position-absolute' aria-label='remove file: ").concat(e.name,"' data-provider='").concat(r,"' data-fileid='").concat(e.id,"'>×</button>\n <span aria-hidden='true' class='file-name position-absolute overflow-hidden ").concat(n?"text-decoration-line-through":"","' title='").concat(e.name,"' id='file-name-").concat(e.id,"'>").concat(e.name,"</span>\n <span aria-hidden='true' class='file-size position-absolute ").concat(n?"text-decoration-line-through":"","' id='file-size-").concat(e.id,"'>(").concat(e.humanizedSize,")</span>\n </div>\n </div>")},E=function(e,t,n){var i=document.getElementById("".concat(t,"_error_heading"));i.innerHTML=n;var o=document.getElementById("".concat(t,"_error_attachments_list"));o.insertAdjacentHTML("beforeend",y(e,"error"));var a=o.querySelector("#attachment_".concat(e.id," .remove-file-icon"));["click","keypress"].forEach(function(n){a.addEventListener(n,function(n){if(Object(r.a)(n)===!0){n.target.parentElement.parentElement.remove();var a=document.getElementById("attach_btn");a&&a.focus(),o.firstElementChild||(i.innerHTML=""),"cumulative"===t?c=c.filter(function(t){return t.id!==e.id}):d=d.filter(function(t){return t.id!==e.id})}})})},w=function(t,n){var r=parseInt(t.dataset.fileid);n&&document.getElementById("cloud_attachment_input_".concat(r)).remove();var i=h(),o=t.dataset.filesize,a=i.filter(function(e){return e.id!==r});g(a),e-=o,t.remove();var s=document.getElementById("attach_btn");s&&s.focus();var l=c;c=[];var d=document.getElementById("cumulative_error_attachments_list");d.innerHTML="";var u=document.getElementById("cumulative_error_heading");u.innerHTML="",L(l)},_=function(e){var t=document.getElementById("attachments_list");t.insertAdjacentHTML("beforeend",y(e));var n=t.querySelector("#attachment_".concat(e.id," .remove-file-icon"));["click","keypress"].forEach(function(e){n.addEventListener(e,function(e){if(Object(r.a)(e)===!0){var t="file"!==e.target.dataset.provider;w(e.target.parentElement.parentElement,t)}})})},S=function(){var e=document.querySelectorAll(".proper-attachments-list");
2return e.length?e[e.length-1].dataset.fileid:0},L=function(r){var o=S(),a=h(),s=a.concat(c,d),l=r.filter(function(e){return!s.find(function(t){return t.name===e.name&&t.size===e.size&&t.type===e.type})});l.forEach(function(r){r.id=++o,r.humanizedSize=Object(i.o)(r.size);var s=""!==window.store.blockedExtensions?!b(r):!0;if(1==s&&(s=""!==window.store.allowedExtensions?C(r):!0),s){var l=!m(r),u=!v(r);l&&(E(r,"individual",window.I18n.t("portal_js_translations.attachment_upload.individual_size_exceeded",{size:Object(i.o)(t)})),d.push(r)),l||u&&(E(r,"cumulative",window.I18n.t("portal_js_translations.attachment_upload.cumulative_size_exceeded",{size:Object(i.o)(n)})),c.push(r)),l||u||(_(r),a.push(r),e+=r.size)}else E(r,"individual",window.I18n.t("portal_js_translations.attachment_upload.extension_blocked")),d.push(r)}),g(a)};null===s||void 0===s?void 0:s.addEventListener("change",function(e){var t=Object.values(e.target.files);L(t)});var T=function(e){return f.some(function(t){return t.link===e})},k=function(e,t,n){if(!T(e.link)){var r=document.createElement("input");r.id="cloud_attachment_input_".concat(parseInt(n)),r.type="hidden",r.value=JSON.stringify(e),r.name="[cloud_file_attachments][]",t.appendChild(r),f.push(e),_(e)}},A=function(e){var t={success:function(t){var n=parseInt(S())+1,r={id:n,link:t[0].link,name:t[0].name,size:t[0].bytes,humanizedSize:Object(i.o)(t[0].bytes),provider:"dropbox"};k(r,e,n)}};Dropbox.choose(t)};["click","keypress"].forEach(function(e){document.querySelectorAll("[data-attach-type]").forEach(function(t){t.addEventListener(e,function(e){e.preventDefault();var n=t.dataset.attachType;if(Object(r.a)(e))switch(n){case"dropbox":A(t.parentElement);break;default:s.click()}})})})})},85:function(e,t,n){"use strict";function r(e){return e?C[String(e).trim().toLowerCase()]||"":""}function i(){document.querySelectorAll('[rel="highlighter"]').forEach(function(e){e.addEventListener("click",function(){this.setAttribute("data-fw-edit",!0),E.setAttribute("data-fw-edit",!0),E.value=this.innerText,w.value=r(this.dataset.codeBrush),_.show()})})}function o(e){var t=e.selection.element(),n=e.node.blockParent(t)?e.node.blockParent(t):t,r=window.getComputedStyle(t),i={styles:{},formats:{}},o=["strong","em","u","s"],a=["backgroundColor","color"];return a.forEach(function(e){if("backgroundColor"===e&&o.includes(t.tagName.toLowerCase())){var a=Object(b.l)(t,"SPAN",n.tagName);if(a)return void(i.styles[e]=window.getComputedStyle(a)[e])}i.styles[e]=r[e]}),o.forEach(function(t){i.formats[t]=e.format.is(t)}),i}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){d()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l,c=n(10),d=n.n(c),u=n(20),f=n.n(u),p=n(5),h=n.n(p),g=n(24),m=n.n(g),v=(n(105),n(106),n(107),n(108),n(109),n(27)),b=n(0),C={html:"html",css:"css",javascript:"js",js:"js",sass:"sass",xml:"xml",ruby:"ruby",php:"php",java:"java","c#":"csharp",csharp:"csharp","c++":"cpp",cpp:"cpp",objectivec:"objc","obj c":"objc",objc:"objc",perl:"perl",python:"python",vb:"vbnet",vbnet:"vbnet",sql:"sql","generic language":"text",text:"text"},y=document.querySelector("#codeInsertModal"),E=y.querySelector("#codeSnippet"),w=y.querySelector("#codeLanguage"),_=new v.b(y),S=document.querySelector("#insertCode");S.addEventListener("click",function(){var e=document.querySelector(".rich-editor")["data-froala.editor"],t=w.value,n=r(t),o=E.value;if(o=o.replace(/\t/g," "),"true"===E.dataset.fwEdit){var a=document.querySelector('pre[data-fw-edit="true"]');a.innerText=o,n?a.setAttribute("data-code-brush",n):a.removeAttribute("data-code-brush"),a.setAttribute("data-fw-edit",!1),E.setAttribute("data-fw-edit",!1),_.hide()}else{var s=document.createElement("div"),c=document.createElement("pre");c.setAttribute("rel","highlighter"),c.setAttribute("contenteditable","false"),c.classList.add("inserted-code"),n&&c.setAttribute("data-code-brush",n),c.innerText=o,s.appendChild(c),e.selection.restore(
2),e.html.insert(s.outerHTML),e.html.insert("<p></p>"),e.undo.saveStep(),i(),_.hide(),e.events.focus(),Object.keys(l.formats).forEach(function(t){l.formats[t]&&e.format.apply(t)}),Object.keys(l.styles).forEach(function(t){e.format.applyStyle(Object(b.e)(t),l.styles[t])})}}),m.a.DefineIcon("code",{NAME:"code",SVG_KEY:"codeView"}),m.a.RegisterCommand("code",{title:window.I18n.t("portal_js_translations.code_snippet.title",{defaultValue:"Code Snippet"}),focus:!1,undo:!1,refreshAfterCallback:!1,callback:function(){l=o(this),this.$el.text()&&this.selection.save(),E.value="",w.selectedIndex=0,_.show()}});var L={"ja-JP":"ja","nb-NO":"nb","pt-BR":"pt_br","pt-PT":"pt_pt","ru-RU":"ru","zh-CN":"zh_cn","zh-TW":"zh_tw","sv-SE":"sv",ar:"ar",bs:"bs",cs:"cs",da:"da",de:"de",en:"en",en_ca:"en_ca",en_gb:"en_gb",es:"es",et:"et",fa:"fa",fi:"fi",fr:"fr",he:"he",hr:"hr",hi:"hi",hu:"hu",id:"id",it:"it",ko:"ko",me:"me",nl:"nl",pl:"pl",ro:"ro",sk:"sk",sr:"sr",th:"th",tr:"tr",uk:"uk",vi:"vi"},T=L;Object(b.i)(function(){function e(){return t.apply(this,arguments)}var t=f()(h.a.mark(function r(){var e,t,i,o,a,l,c;return h.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=window.store&&window.store.currentLocale,i=T[t],i&&"en"!==i&&(e=n(83)("./".concat(i))["catch"](function(){console.error("Failed to load Froala language file for ".concat(i))})),o=["#61BD6D","#1ABC9C","#54ACD2","#2C82C9","#9365B8","#475577","#00A885","#3D8EB9","#2969B0","#553982","#28324E","#000000","#F7DA64","#FBA026","#EB6B56","#E25041","#A38F84","#FFFFFF","#FAC51C","#F37934","#B8312F","#7C706B","#D1D5D8","REMOVE"],a=["insertLink","insertImage"],l={toolbarButtons:[["bold","italic","underline","strikeThrough"],["formatOL","formatUL"],["textColor","backgroundColor"],a,["clearFormatting","code"]],height:110,zIndex:10,colorsBackground:o,colorsText:o,listAdvancedTypes:!1,key:"UBB7jD5D3F3C3I3A6C7bHIMFI1EWBXIJe1BZLZFd1d1MXQLjC10D7D5D4B2A3D3E2J3B6==",attribution:!1,requestHeaders:{"X-CSRF-Token":window.csrfToken},pasteDeniedAttrs:["class","id"],pasteDeniedTags:["meta"],imageUploadParam:"uploaded_data",imageUploadParams:{_uniquekey:(new Date).getTime(),authenticity_token:window.csrfToken},imageDefaultAlign:"left",linkInsertButtons:["linkBack"],linkEditButtons:["linkEdit","linkRemove"],videoInsertButtons:["videoBack","|","videoByURL","videoEmbed"],events:{"image.error":function(e,t){var n=document.querySelector(".fr-popup.fr-active .fr-message");n.innerHTML=JSON.parse(t)&&JSON.parse(t).error},"paste.after":function(){var e,t,n=(null===this||void 0===this?void 0:null===(e=this.$el)||void 0===e?void 0:null===(t=e[0])||void 0===t?void 0:t.querySelectorAll("table"))||[];n.forEach(function(e){var t;null!==e&&void 0!==e&&null!==(t=e.style)&&void 0!==t&&t.width||(e.style.width="fit-content")})},initialized:function(){this.$el[0].setAttribute("aria-label",this.$oel[0].getAttribute("aria-label")),this.$el[0].setAttribute("role","textbox"),this.$el[0].setAttribute("aria-multiline","true"),window.dispatchEvent(new Event("froalaInitialized"))}},language:i||null},!e){r.next=9;break}return r.next=9,e;case 9:c=document.querySelectorAll(".rich-editor"),c.forEach(function(e){var t={},n="";Object(b.s)(e,"new-ticket-editor")?(n=".new-ticket-editor",t=s(s({},l),{imageUploadURL:"/tickets_uploaded_images"}),e.placeholder&&(t.placeholderText=e.placeholder)):Object(b.s)(e,"ticket-reply-editor")?(n=".ticket-reply-editor",t=s(s({},l),{htmlAllowedEmptyTags:["div","p"],imageUploadURL:"/tickets_uploaded_images"})):Object(b.s)(e,"forum-editor")?(n=".forum-editor",t=s(s({},l),{imageUploadURL:"/forums_uploaded_images"})):(n=".rich-editor",t=l),new m.a(n,t)});case 11:case"end":return r.stop()}},r)}));return e}())},94:function(e,t,n){"use strict";var r=n(0);Object(r.i)(function(){Object(r.v)(document)})}},[[198,0]]]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.