PageSourceSearch

https://www.thewhittakerinn.com/integration/tc-theme/public/js/chunk/chunk-tc-lead-cad6fbc103310bcae2b6.js

js thewhittakerinn.com collected 2026-09-29 15:13:01 UTC 10,028 bytes, 1 lines download raw bytes

1"use strict";(self.tcthemejsonpFunction=self.tcthemejsonpFunction||[]).push([[9603],{4903(e,t,r){r.d(t,{default:()=>E});var a=r(4692),i=r.n(a),o=r(8823),l=r.n(o),s=r(5056),n=r(8972);const d=e=>{const t=e.getAttribute("data-validation-error-id");let r;if(!t)return;const a=document.getElementById(t);a&&a.remove(),e.classList.remove("error"),e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),e.removeAttribute("data-validation-error-id"),r=e.closest(".file-upload-wrapper"),r&&r.querySelector(".f-input").classList.remove("error")},c=(e,t,r,a)=>{const i=document.createElement("label"),o=(e=>"checkbox"===e.type||"radio"===e.type?e.closest(".form-group--horizontal, .form-group"):"file"===e.type?e.closest(".file-upload-wrapper"):"SELECT"===e.tagName?e.parentElement:e)(e),l=a?a(e,t):t;let s;var n,d;i.id=r,i.className="error",i.setAttribute("role","alert"),i.textContent=l,e.id&&(i.htmlFor=e.id),"checkbox"===e.type||"radio"===e.type?o.appendChild(i):(d=i,(n=o).parentNode.insertBefore(d,n.nextSibling)),e.classList.add("error"),e.setAttribute("aria-invalid","true"),e.setAttribute("aria-describedby",r),e.setAttribute("data-validation-error-id",r),s=e.closest(".file-upload-wrapper"),s&&s.querySelector(".f-input").classList.add("error")};var u=r(948);const{QJ:h,dh:m}=n.iW,{fireEvent:f}=n.Wp;var p=function(e){this.init(e)};p.prototype={init:function(e){if(this.$form=i()(e),this.loading=!1,this.modal={$el:this.$form.find(".dialog").appendTo("body")},!this.modal.$el.length)return console.warn(".dialog is missing in the form",this.$form),!1;this.modal.$dialog=i()(this.modal.$el[0]),this.messages={error:this.$form.find(".template-error").html(),success:this.$form.find(".template-success").html()},this.$message=this.modal.$el.find(".js-message"),function(e,t){const r=(e=>{const t={},r=e.querySelectorAll('input[type="checkbox"][required], input[type="radio"][required]');return Array.prototype.forEach.call(r,e=>{var r=e.type+":"+e.name;t[r]||(t[r]=[]),t[r].push(e),e.required=!1,e.setAttribute("aria-required","true")}),Object.keys(t).map(e=>t[e])})(e),a=t.formatErrorMessage,i=()=>{let i=0;const o={},l=e.querySelectorAll("[data-validation-error-id]"),s=e.querySelectorAll('input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea');return Array.prototype.forEach.call(l,d),r.forEach(t=>{if(!t.some(e=>e.checked)){const r=t[0],l=(window.validationMessages||{}).required||"This field is required.";let s;i+=1,s="form-validation-error-"+(e.id||"lead")+"-"+i,o[r.name]=l,c(r,l,s,a),t.slice(1).forEach(e=>{e.classList.add("error"),e.setAttribute("aria-invalid","true"),e.setAttribute("data-validation-error-id",s)})}}),Array.prototype.forEach.call(s,t=>{let r,l;t.disabled||t.checkValidity()||(r=(e=>{const t=window.validationMessages||{};return e.validity.valueMissing?t.required||"This field is required.":e.validity.typeMismatch&&"email"===e.type?t.email||e.validationMessage:e.validity.typeMismatch&&"url"===e.type&&t.url||e.validationMessage})(t),i+=1,l="form-validation-error-"+(e.id||"lead")+"-"+i,o[t.name]=r,c(t,r,l,a))}),!i||(t.onInvalid(o),!1)};e.noValidate=!0,e.addEventListener("submit",r=>{r.preventDefault(),i()&&t.onValidSubmit(e)}),e.addEventListener("input",e=>{d(e.target)}),e.addEventListener("change",e=>{const t=((e,t)=>{let r=null;return e.some(e=>-1!==e.indexOf(t)&&(r=e,!0)),r})(r,e.target);t?(e=>{Array.prototype.forEach.call(e,d)})(t):d(e.target)})}(e,{formatErrorMessage:(e,t)=>h.forms.addLabelToValidationMessage(e,t),onInvalid:e=>{f("event.error.formSubmission",e)},onValidSubmit:e=>{"1"===e.dataset.enableRecaptcha&&window.GoogleAPIs.hasRecaptcha()?window.GoogleAPIs.recaptcha(t=>this.submitForm(e,t)):this.submitForm(e)}});let t=i()(this.$form.find('input[name="form_recipients[]"]')[0]),r=t.val();this.$form.find(".js-form-recipient").on("change",function(e){let a=i()(e.currentTarget).val(),o=i()(e.currentTarget.selectedOptions)[0].disabled,l=i()(e.currentTarget.selectedOptions)[0].textContent;t.val(r),a?.length>0&&t.val(a),l?.length>0&&!o&&i()(this.$form.find('input[class="js-form-selected-property"]')[0]).val(l)}.bind(this))},submitForm:function(e,t=null){if(this.loading)return!1;this.changeLoading(!0);let r="success",a=0,o=this.$form.find('input[type="file"]'),l=e.dataset.formType;const n=new FormData(e);let d=this.$form[0]?.id;o.each(function(e){if(this.files.length)return a=1}),t&&i()(e).prepend(`<input type="hidden" name="g-recaptcha-response" value="${t}">`);let c=e.querySelectorAll(".js-form-recipient.js-property-recipient"),h=e.querySelectorAll('input[name="form_recipients[]"]')[0],m=!c?.[0]?.hasAttribute("data-placeholder")||!1,p=e.querySelectorAll(".js-form-selected-property")?.[0];m&&""==p?.value&&(p.value=c?.[0]?.[0]?.innerText,c?.[0]?.[0]?.value&&h&&(h.value=c?.[0]?.[0]?.value));let g=new FormData(e);window.GalaxyHelpers.sendLead(g).then(()=>{}).catch(e=>{console.error(e),r="error",document.querySelector(".error-message-container")?.classList.remove("hide")}).finally(()=>
1{if(this.changeLoading(!1),this.$message.html(this.messages[r]),"success"==r){window.enableResponseMessageInSamePage[d]?y({entriesFormDataObj:n,formIdToShow:d}):(s.A.open(this.modal.$dialog,{touch:!1}),this.modal.$dialog.on("click",".js-dialog-close",()=>{s.A.close()})),e.reset(),i()(e).find(".js-form-selected-property").val("");let t=i()(e).find("select.select2");t.val(t?.find("option")?.eq(0)?.val()).trigger("change"),o.val(""),i()(e).find(".file-name").text("No file selected"),i()(e).find(".file-upload").addClass("hidden"),f("event.formSubmission",l),u.A.clear()}else window.enableResponseMessageInSamePage[d]&&A(d);t&&i()(e).find('[name="g-recaptcha-response"]').remove()})},changeLoading:function(e=!0){e?this.$form.addClass("loading"):this.$form.removeClass("loading"),this.loading=e}};const g=(e,t,r,a)=>{let i=r.getAttribute("type"),o=e+"-"+a;"hidden"!==i&&"radio"!==i&&(r.setAttribute("id",o),t.querySelectorAll("label, .label, .form-label").forEach((e,t)=>{e.setAttribute("for",o)}))},y=({entriesFormDataObj:e,formIdToShow:t})=>{const r=[];let a=0;for(const[t,i]of e)if(t.startsWith("section_")||t.startsWith("label_","")||t.startsWith("label-value_","")){const o=t.startsWith("section_")?"section":t,l=t.startsWith("section_")?t:t.replace("label_","").replace("label-value_",""),s=""!==e.getAll(l).join(", ")?e.getAll(l).join(", "):e.getAll(l+"[]").join(", ");"section"===o?r.push({key:o,toHide:a>=5,value:s}):""!==s&&(a++,r.push({key:i,toHide:a>5,value:s}))}window.submissionSummaryDataArray||(window.submissionSummaryDataArray=[]),window.submissionSummaryDataArray[t]=r,b(t),w(t),window.dispatchEvent(new Event(`submissionDataExecuted-${t}`)),S(t)},v=e=>{let t=e.id.split("-");return"id-"+t[t.length-1]},b=e=>{let t=e;document.querySelectorAll(".js-lead").forEach(e=>{const r=v(e);t===r&&e.classList.add("hide")}),document.querySelectorAll(".box__title-before").forEach(e=>{t===e.id&&e.classList.add("hide")}),document.querySelectorAll(".success-message-container").forEach(e=>{const r=v(e);t===r&&e.classList.remove("hide")})},A=e=>{let t=e;document.querySelectorAll(".error-message-container").forEach(e=>{const r=v(e);t===r&&e.classList.remove("hide")})},w=e=>{let t=e;document.querySelectorAll(".js-new-form").forEach(r=>{r.id===t&&r.addEventListener("click",()=>{document.querySelectorAll(".js-lead").forEach(e=>{t===e.id&&e.classList.remove("hide")}),document.querySelectorAll(".box__title-before").forEach(e=>{t===e.id&&e.classList.remove("hide")}),document.querySelectorAll(".success-message-container").forEach(r=>{const a=v(r);t===a&&(r.classList.add("hide"),window.dispatchEvent(new Event(`hideSuccessMessage-${e}`)))})})}),document.querySelectorAll(".js-back-to-home").forEach(e=>{e.addEventListener("click",()=>{window.location.href="/"})})},S=e=>{let t=e;document.querySelectorAll(".success-message-header").forEach(e=>{t===e.id&&e.scrollIntoView({behavior:"smooth",block:"center"})})},E={init:function(){i()(".form-group").each(function(e,t){let r=i()(t).find("input.form-input, select, textarea").attr("id");if(!r){r="form-input-"+(0,n.bD)();let e=t.querySelectorAll(".checkbox-radio-custom");e.length?e.forEach((e,t)=>{e.querySelectorAll("input, select, textarea").forEach((a,i)=>{g(r,e,a,t)})}):t.querySelectorAll("input, select, textarea").forEach((e,a)=>{g(r,t,e,a)})}}),i()(".js-lead").each(function(){new p(this)}),i()(".file-upload-wrapper").each(function(){i()(this).on("change",function(){const e=i()(this),t=e.children(".f-input"),r=e.find(".file-upload"),a=e.find(".file-name");let o=t.attr("data-default");if(e.find(".uploadBtn")[0].files.length>0){const i=e.find(".uploadBtn")[0].files[0].name;t.removeClass("error").attr("aria-label",`${t.data("selected")}: ${i}`),a.text(i),r.removeClass("hidden").attr("aria-label",`${r.data("clear")} ${i}`),e.parent().find('.error[role="alert"]').hide(),e.find(".uploadBtn").focus(),r.on("click",function(){a.text(o),r.addClass("hidden"),e.find('input[type="file"]').val("")})}else{a.text(o),r.addClass("hidden"),t.addClass("error").attr("aria-label",t.data("default"));let i=e.parent().children(".form-label").text().replace(/\*/g,"").replace(/ *\([^)]*\) */g,"").trim();e.parent().find('.error[role="alert"]').show().text(i+" "+validationMessages.required)}}),i()(this).find(".fileUpload").on("click",function(){i()(this).next().trigger("click")})});let e=[];const t="rtl"==i()("html").attr("dir"),r=(new Date).getFullYear(),a=[r-100,r+100],o=(e,t)=>(0,n.w$)(e).format(t);i()(".datepicker").each(function(r,s){e[r]=new(l())({field:s,container:s.parentElement,format:i()(this).data("date-format"),firstDay:i()(this).data("first-day"),theme:i()(this).data("theme"),minDate:1===i()(this).data("min-date")?new Date:null,i18n:m().getAll(),keyboardInput
1:!0,isRTL:t,yearRange:a,toString:o,onDraw:e=>{e.el.querySelector(".pika-next").innerHTML='<svg class="icon" aria-hidden="true"><use href="#icon-arrow-right"></svg>',e.el.querySelector(".pika-prev").innerHTML='<svg class="icon" aria-hidden="true"><use href="#icon-arrow-left"></svg>'}})})}}}}]);

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.