1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[82104],{104:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});var s=i(107);class o extends window.PluginBaseClass{init(){this._client=new s.Z(window.accessKey,window.contextToken),this._getButton(),this._getNotificationStockForm(),this._getHiddenSubmit(),this._getMessages(),this._getOverlayBlock(),this._registerEvents()}_registerEvents(){if(this.el.addEventListener("submit",this._handleSubmit.bind(this)),this._button&&(this._button.addEventListener("submit",this._handleSubmit.bind(this)),this._button.addEventListener("click",this._handleSubmit.bind(this))),this._iconButtons&&this._hiddenForm)for(let t=0;t<this._iconButtons.length;t++)this._iconButtons[t].addEventListener("click",this._handleStockNotificationSubmit.bind(this,this._iconButtons[t])),this.options.confirmed&&this._iconButtons[t].click()}_getButton(){this._button=this.el.querySelector("button")}_getNotificationStockForm(){let t=this.el.closest(".buy-widget");t?(this._iconButtons=t.querySelectorAll([this.options.stockNotificationSubmitSelector]),this._hiddenForm=t.querySelectorAll([this.options.hiddenStockNotificationFormSelector])):(this._iconButtons=document.querySelectorAll([this.options.stockNotificationSubmitSelector]),this._hiddenForm=document.querySelectorAll([this.options.hiddenStockNotificationFormSelector]))}_getMessages(){this._messageNotify=this.el.querySelector(this.options.messageNotify),this._messageExist=this.el.querySelector(this.options.messageExist),this._form=this.el.querySelector(this.options.stockNotificationForm),this._privacyNotice=this.el.querySelector(this.options.privacyNotificationWrapper)}_getHiddenSubmit(){this._hiddenSubmit=this.el.querySelector(this.options.hiddenSubmitSelector)}_getOverlayBlock(){this._block=this.el.querySelector(this.options.overlayBlock)}_handleSubmit(t){t.preventDefault(),this.el.checkValidity()?this._submitForm():this._showValidation()}_handleStockNotificationSubmit(t,e){e.preventDefault();for(let e=0;e<this._hiddenForm.length;e++){let i=this._hiddenForm[e];if(i&&(i.classList.contains("d-none")?i.classList.remove("d-none"):i.classList.add("d-none"),t)){let e=t.querySelector(this.options.hiddenStockNotificationArrowSelector);e&&(e.classList.contains("d-none")?e.classList.remove("d-none"):e.classList.add("d-none")),t.title===this.options.stockNotificationBellMessage?t.title=this.options.stockHideNotificationBellMessage:t.title=this.options.stockNotificationBellMessage,t.ariaLabel===this.options.stockNotificationBellMessage?t.ariaLabel=this.options.stockHideNotificationBellMessage:t.ariaLabel=this.options.stockNotificationBellMessage}}}_showValidation(){this._hiddenSubmit.click()}_submitForm(){this.$emitter.publish("beforeSubmit"),this.sendAjaxFormSubmit()}sendAjaxFormSubmit(){let{_client:t,el:e,options:i}=this,s=new FormData(e);t.post(e.action,s,this._handleResponse.bind(this),i.contentType)}_handleResponse(t){let e=null;try{e=JSON.parse(t)}catch(t){}if(!e||!(e.length>0))return!1;{let t=!0,i=!1,s="";for(let o=0;o<e.length;o++)"danger"===e[o].type&&(t=!1),"emailExist"===e[o].message&&(i=!0),s+=e[o].alert;this._createResponse(t,s,i)}}_toggleMessage(t){t?(this._messageNotify.classList.contains("d-none")||this._messageNotify.classList.add("d-none"),this._messageExist.classList.contains("d-none")&&this._messageExist.classList.remove("d-none")):(this._messageExist.classList.contains("d-none")||this._messageExist.classList.add("d-none"),this._messageNotify.classList.contains("d-none")||this._messageNotify.classList.add("d-none"))}_createResponse(t,e,i){let s=this.options,o=this._block;
1i?this._toggleMessage(!0):(this._toggleMessage(!1),o.classList.add(s.activeClass),t?(this._form.classList.contains("d-none")||this._form.classList.add("d-none"),this._privacyNotice&&!this._privacyNotice.classList.contains("d-none")&&this._privacyNotice.classList.add("d-none"),o.innerHTML='<div class="overlay-inner">'+e+"</div>"):(o.innerHTML='<div class="overlay-inner">'+e+"</div>",setTimeout(function(){o.classList.remove(s.activeClass)},s.overlayTime)))}}o.options={stockNotificationBellMessage:"",stockHideNotificationBellMessage:"",confirmed:!1,hiddenSubmitSelector:".submit--hidden",stockNotificationSubmitSelector:".acris-stock-notification-button",hiddenStockNotificationFormSelector:".acris-stock-notification-form-display-form",hiddenStockNotificationArrowSelector:".acris-stock-notification-button-collapse-icon",overlayBlock:".acris-stock-notification-alert-overlay",messageNotify:".acris-stock-notification-notify",messageExist:".acris-stock-notification-exists",stockNotificationForm:".acris-stock-notification-form-input-group",privacyNotificationWrapper:".stock-notification-privacy-notice",activeClass:"is-active",contentType:"application/x-www-form-urlencoded",overlayTime:4e3}},107:(t,e,i)=>{i.d(e,{Z:()=>s});class s{get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",t,i);return this._sendRequest(s,null,e)}post(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("POST",t,s);return this._sendRequest(o,e,i)}delete(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(o,e,i)}patch(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(o,e,i)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn("the request to ".concat(t.responseURL," was aborted"))}),t.addEventListener("error",()=>{console.warn("the request to ".concat(t.responseURL," failed with status ").concat(t.status))}),t.addEventListener("timeout",()=>{console.warn("the request to ".concat(t.responseURL," timed out"))})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,i){return this._registerOnLoaded(t,i),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,i){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}}}]);
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.