PageSourceSearch

https://www.upstairs.com/frontend/app.form.nrmOJ.js

js upstairs.com collected 2026-10-08 02:16:46 UTC 18,351 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkteam_awesome=self.webpackChunkteam_awesome||[]).push([["src_components_form_form_tsx"],{4454(t,e,n){n.d(e,{mount:()=>C});var a=n(1635),r=n(4862),o=n.n(r),i=n(5982),l=n(4588),u=n(1965),s=function(t,e){var n,a;void 0===e&&(e=!0);var r,o,i=m(t);if(a||!t.mandatory||t.alwaysValid||("showroomdatepicker"===t.type?i&&("string"!=typeof i||i.includes("T"))||(a=t.validationMessages.mandatory):("string"==typeof i&&0===i.trim().length||Array.isArray(i)&&0===i.length||!i)&&(a=t.validationMessages.acceptTerms?t.validationMessages.acceptTerms:t.validationMessages.mandatory)),!a&&t.maximumLength){var l="string"==typeof i||Array.isArray(i)?i.length:0;l>t.maximumLength&&(r=t.validationMessages.maxLength,o={MAX:"".concat(t.maximumLength),LENGTH:"".concat(l),EXCEEDS:"".concat(l-t.maximumLength)},a=r.replaceAll(/\[(.*?)\]/g,function(t,e){return o[e]}))}return!a&&t.regularExpression&&("string"!=typeof i||new RegExp(t.regularExpression).test(i)||(a=null!==(n=t.validationMessages.regex)&&void 0!==n?n:t.validationMessages.invalidType)),e&&(t.error=a),a},c=function(t,e){return(void 0===e?t.pages:[t.pages[e]]).flatMap(function(t){return t.fieldsets}).flatMap(function(t){return t.containers}).flatMap(function(t){return t.fields})},d=function(t){return Object.fromEntries(c(t).map(function(t){return[t.alias,m(t)]}))},f=function(t){return c(t).filter(function(t){return["datepicker","dropdownlist","checkbox","checkboxlist","radiobuttonlist"].includes(t.type)}).map(function(t){var e,n;return{key:null!==(e=t.caption)&&void 0!==e?e:t.alias,val:null===(n=m(t))||void 0===n?void 0:n.toString()}})},m=function(t){return t.value?t.value:t.defaultValue?t.defaultValue:null},p=function(t,e){var n,a,r,o,i="weert",l=null!==(n=null==e?void 0:e.toLowerCase())&&void 0!==n?n:i;if(!t)return l;var u,s=t.querySelector('select[name="Location"]'),c=Array.from(null!==(a=t.querySelectorAll('input[name="Location"]:not([type="hidden"])'))&&void 0!==a?a:[]).map(function(t){return t.parentElement});if(!s&&0===c.length)return l;if(s)u=s.options[s.selectedIndex];else if(c.length>0){var d=c.find(function(t){return t.classList.contains("checked")});u={value:null===(o=null===(r=null==d?void 0:d.querySelector("span"))||void 0===r?void 0:r.textContent)||void 0===o?void 0:o.toLowerCase()}}return(null==u?void 0:u.value)||i},v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.C6)(e,t),e.prototype.view=function(t){var e=t.attrs,n=e.field,a=e.showCaption;return o()("div",{className:(0,u.cleanString)("form-field",n.error&&"invalid")},(null==a||a)&&n.showCaption&&n.caption&&o()("div",{className:"field-header"},o()("label",{className:"label",for:n.id},n.caption," ",n.indicator&&o()("span",{className:"indicator"},n.indicator))),o()("div",{className:(0,u.cleanString)("field",n.displayLayout&&"Horizontal"==n.displayLayout&&"horizontal"),title:n.toolTip},t.children),n.showValidation&&n.error&&o()("div",{className:"error"},o()("span",{role:"alert","aria-atomic":!0},o().trust(n.error))))},e}(i.I),g={hiddenfield:function(t,e){return o()("input",{id:t.id,name:t.alias,type:"hidden",value:m(t)})},textbox:function(t,e){var n;return o()(v,{field:t},o()("div",{className:(0,u.cleanString)("control textbox")},o()("input",{id:t.id,name:t.alias,autocomplete:t.autocomplete,type:"text",value:m(t),pattern:t.regularExpression?t.regularExpression.replace(/^\/|\/$/g,"").replace(/^\^|\$$/g,""):void 0,oninput:function(n){t.value=n.target.value,t.error&&s(t),e()},onchange:function(n){t.value=n.target.value,s(t),e()},placeholder:t.placeholder||"",max:t.maximumLength}),t.maximumLength&&(null===(n=t.value)||void 0===n?void 0:n.length)>.8*t.maximumLength&&o()("span",{className:(0,u.cleanString)("charcount",t.value.length>t.maximumLength&&"error")},t.value.length," / ",t.maximumLength)))},textarea:function(t,e){var n;return o()(v,{field:t},o()("div",{className:(0,u.cleanString)("control textarea")},o()("textarea",{id:t.id,name:t.alias,autocomplete:t.autocomplete,rows:t.numberOfRows,value:m(t),oninput:function(n){t.value=n.target.value,t.error&&s(t),e()},onchange:function(n){t.value=n.target.value,s(t),e()},placeholder:t.placeholder||"",max:t.maximumLength}),t.maximumLength&&(null===(n=t.value)||void 0===n?void 0:n.length)>.8*t.maximumLength&&o()("span",{className:(0,u.cleanString)("charcount",t.value.length>t.maximumLength&&"error")},t.value.length," / ",t.maximumLength)))},datepicker:function(t,e){return o()(v,{field:t},o()("label",{className:(0,u.cleanString)("control datepicker",t.error)},o()("input",{id:t.id,name:t.alias,type:"date",value:m(t),oninput:function(n){t.value=n.target.value,t.error&&s(t),e()},onchange:function(n){t.value=n.target.value,s(t),e()}})))},dropdownlist:function(t,e){return o()(v,{field:t},o()("div",{className:(0,u.cleanString)("control dropdownlist",t.allowMultipleSelections&&"multiple")},o()("div",{className:"select"},t.allowMultipleSelections?o()("select",{id:t.id,name:t.alias,multiple:!0},t.values.map(function(n){var a,r=(null!==(a=t.value)&&void 0!==a?a:[t.defaultValue]).includes(n.value);return o()("option",{className:(0,u.cleanString)(r&&"selected"),value:n.value,selected:r,onclick:function(n){var a=t.value=Array.isArray(t.value)?t.value:[],r=a.indexOf(n.target.value);-1===r?a.push(n.target.value):a.splice(r,1),s(t),e()}},n.caption)})):o()("select",{id:t.id,name:t.alias,value:m(t),onchange:function(n){t.value=n.target.value,n.target.setAttribute("value",n.target.value||""),s(t),e()}},t.defaultValue&&o()("option",{selected:!0,disabled:!0,hidden:!0},t.defaultValue),t.values.map(function(e){return o()("option",{value:e.value,className:(0,u.cleanString)(m(t)===e.value&&"selected")},e.caption)})))))},checkbox:function(t,e){return o()(v,{field:t,showCaption:!1},o()("div",{className:"control checkbox"},o()("label",{className:(0,u.cleanString)("checkbox-item",t.value&&"checked")},o()("input",{id:t.id,name:t.alias,type:"checkbox",checked:m(t),onchange:function(n){t.value=n.target.checked,s(t),e()}}),o()("span",null,o().trust(t.caption)))))},checkboxlist:function(t,e){return o()(v,{field:t},o()("div",{className:(0,u.cleanString)("control checkboxlist",t.allowMultipleSelections&&"multiple")},t.values.map(function(n){var a,r=(null!==(a=t.value)&&void 0!==a?a:[t.defaultValue]).includes(n.value),i="".concat(t.id,".").concat(n.value);return o()("label",{className:(0,u.cleanString)("checkbox-item",r&&"checked")},o()("input",{id:i,className:(0,u.cleanString)(r&&"checked"),name:t.alias,type:"checkbox",checked:r,onchange:function(a){t.value=Array.isArray(t.value)?t.value:[];var r=t.value.indexOf(n.value);-1===r?a.target.checked&&t.value.push(n.value):a.target.checked||t.value.splice(r,1),s(t),e()}}),o()("span",null,n.caption))})))},radiobuttonlist:function(t,e){return o()(v,{field:t},o()("div",{className:(0,u.cleanString)("control radiobuttonlist")},t.values.map(function(n){var a,r=(null!==(a=t.value)&&void 0!==a?a:t.defaultValue)===n.value,i="".concat(t.id,".").concat(n.value);return o()("label",{className:(0,u.cleanString)("radio-item",r&&"checked")},o()("input",{id:i,className:(0,u.cleanString)(r&&"checked"),name:t.alias,type:"radio",checked:r,onchange:function(a){t.value=n.value,s(t),e()}}),o()("span",null,n.caption))})))},showroomdatepicker:function(t,e,r,i){return o()(v,{field:t},o()("div",{className:(0,u.cleanString)("control oj-date-picker-wrapper"),oncreate:function(l){return(0,a.sH)(void 0,void 0,void 0,function(){var u;return(0,a.YH)(this,function(a){switch(a.label){case 0:return[4,n.e("src_components_form_datePicker_datePicker_tsx").then(n.bind(n,6416))];
1case 1:return u=a.sent().OjDatePicker,o().mount(l.dom,{view:function(){return o()(u,{location:p(l.dom.closest("form"),t.defaultShowroomLocation),translations:r,culture:t.culture,value:m(t),minDate:t.minDate,maxDate:t.maxDate,mandatory:t.mandatory,formId:null==i?void 0:i.id,formName:null==i?void 0:i.title,formType:null==i?void 0:i.title,onchange:function(n,a,r){t.value=n&&a?"".concat(n.getFullYear(),"-").concat(String(n.getMonth()+1).padStart(2,"0"),"-").concat(String(n.getDate()).padStart(2,"0"),"T").concat(a,":00"):null,t.alwaysValid=r,s(t,!1),e()},onrequiredchange:function(e){t.alwaysValid=e,t.error&&s(t)}})}}),[2]}})})}}))}},h=n(5347),y=n(2741),b=n(2865),w=n(5682),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.C6)(e,t),e.prototype.view=function(t){return o().fragment((0,a.Cl)({},t.attrs),t.children)},e}(i.I),x=localStorage,N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.C6)(e,t),e.prototype.view=function(t){var e=t.attrs.container,n=e.caption,a=e.fields;return o()("div",{className:(0,u.cleanString)("form-field-container")},n&&o()("span",null,n),o()("div",{className:(0,u.cleanString)("fields","col-".concat(null==a?void 0:a.length))},a.map(function(e){return g[e.type](e,function(){return t.attrs.onchange(e)},t.attrs.translations,t.attrs.formConfig)})))},e}(i.I),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.C6)(e,t),e.prototype.view=function(t){var e=t.attrs.group,n=e.caption,a=e.containers;return o()("div",{className:(0,u.cleanString)("form-group")},n&&o()("span",{className:"group-title"},n),o()("div",{className:"containers"},a.map(function(e){return o()(N,{container:e,onchange:t.attrs.onchange,translations:t.attrs.translations,formConfig:t.attrs.formConfig})})))},e}(i.I),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.C6)(e,t),e.prototype.view=function(t){var e=t.attrs.page,n=e.caption,a=e.fieldsets;return o()("div",{className:(0,u.cleanString)("form-page",!t.attrs.initial&&(0,l.uo)(t))},n&&o()("span",{className:"page-title"},n),o()("div",{className:"groups",style:"--rows: ".concat(a.length,";")},a.map(function(e){return o()(k,{group:e,onchange:t.attrs.onchange,translations:t.attrs.translations,formConfig:t.attrs.formConfig})})))},e.prototype.oncreate=function(t){(0,l.Yx)(t)},e.prototype.onbeforeremove=function(t){return(0,l.O4)(t)},e}(i.I),L=function(t){function e(){var e=t.apply(this,(0,a.fX)([],(0,a.zs)(arguments),!1))||this;return e.direction="next",e.initial=!0,e}return(0,a.C6)(e,t),e.prototype.oninit=function(t){this.fields=c(t.attrs.form)},e.prototype.view=function(t){var e=this,n=t.attrs,a=n.page,r=n.form,i=n.translations;return o()("form",{role:"form",className:(0,u.cleanString)("form","-dir-".concat(this.direction),(0,l.uo)(t)),oncreate:function(t){return e.formRoot=t.dom}},o()("div",{className:"page"},r.pages[a]&&o()(_,{key:a,page:r.pages[a],onchange:t.attrs.onchange,initial:this.initial,translations:t.attrs.translations,formConfig:t.attrs.config})),t.attrs.form.showValidationSummary&&o()("div",{className:"error-summary"},this.fields.filter(function(t){return t.path[0]===a&&t.error}).map(function(e){return o()("button",{onclick:function(){t.attrs.onNavigate(e.path[0]);var n=document.getElementById(e.id);n.scrollIntoView({behavior:"smooth"}),n.focus()}},o()("span",null,e.caption),o()("span",null,e.error))})),o()("div",{className:"nav pages"},r.pages.length>1&&o()("button",{type:"button",className:"link-default",disabled:a<1,onclick:function(){return e.nav(t,-1)}},o()(h.B,{src:"/frontend/assets/static/icons/small-chevron-left.svg"}),o()("span",null,i.previous||"previous")),r.pages.length>1&&o()("span",null,a+1," / ",r.pages.length),a>r.pages.length-2?o()("button",{type:"button",className:"btn-primary",onclick:function(){return!e.busy&&e.submit(t)}},this.busy?o()(S,null,o()("span",null,o()(h.B,{src:"/frontend/assets/static/icons/loader.svg"})),o()("span",{className:"invisible"},i.signUpVerb||i.submit||"submit")):o()("span",null,i.signUpVerb||i.submit||"submit")):o()("button",{type:"button",className:"link-default",onclick:function(){return e.nav(t,1)}},o()("span",null,i.next||"next"),o()(h.B,{src:"/frontend/assets/static/icons/small-chevron-right.svg"}))))},e.prototype.oncreate=function(t){this.initial=!1,(0,l.Yx)(t)},e.prototype.onbeforeupdate=function(t,e){this.direction=t.attrs.page>e.attrs.page?"next":"prev"},e.prototype.onbeforeremove=function(t){return(0,l.O4)(t)},e.prototype.submit=function(t){return(0,a.sH)(this,void 0,void 0,function(){return(0,a.YH)(this,function(e){switch(e.label){case 0:return t.attrs.onvalidate(void 0,!0,this.formRoot)?(this.busy=!0,[4,t.attrs.onsubmit().catch(function(t){})]):[2];case 1:return e.sent(),this.busy=!1,o().redraw(),[2]}})})},e.prototype.nav=function(t,e){e>0&&!t.attrs.onvalidate(t.attrs.page,!0,this.formRoot)||t.attrs.onNavigate(t.attrs.page+e)},e}(i.I),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.C6)(e,t),e.prototype.view=function(t){return o()("div",{className:(0,u.cleanString)("form-submitted",(0,l.uo)(t))},o()("div",{class:"richtext"},"Thank you"==t.attrs.translations.messageOnSubmit?o()("p",null,o().trust(t.attrs.translations.formsSubmittedDescription)):o()("p",null,o().trust(t.attrs.translations.messageOnSubmit))),o()("div",{className:"btn-container spacing-sm"},o()("button",{className:"btn-primary",onclick:t.attrs.onreset},t.attrs.translations.formsReload),t.attrs.goto&&o()("a",{className:"btn-primary",href:t.attrs.goto.url,target:t.attrs.goto.target},o()("span",null,t.attrs.goto.name),o()(h.B,{src:"/frontend/assets/static/icons/chevron-right.svg"}))))},e.prototype.oncreate=function(t){(0,l.Yx)(t)},e.prototype.onbeforeremove=function(t){return(0,l.O4)(t)},e}(i.I),C=function(t,e,r,i){return(0,a.sH)(void 0,void 0,void 0,function(){var l,m,v,g,h,S,N,k,_,C,I,V,O,M,A,H,D;return(0,a.YH)(this,function(T){switch(T.label){case 0:return[4,n.e("src_utils_sourcebuster_ts").then(n.bind(n,6479)).catch(function(){return{}})];case 1:return l=T.sent(),null===(D=l.setSourcebuster)||void 0===D||D.call(l),e.form.pages.sort(function(t,e){return t.sortOrder-e.sortOrder}
1),e.form.pages.forEach(function(t,n){t.fieldsets.sort(function(t,e){return t.sortOrder-e.sortOrder}),t.fieldsets.forEach(function(t,a){t.containers.forEach(function(t,r){t.fields.forEach(function(t,o){t.path=[n,a,r,o],t.showValidation=!e.form.hideFieldValidation})})})}),m="form.".concat(e.id),g=null,h=0,S=null,N=0,k=function(t,e,n){var a;if(!(n.pages.length<=1)&&S){var r=Date.now()-S,o=d(n),i=(null===(a=n.pages[t])||void 0===a?void 0:a.caption)||"Step ".concat(t+1);y.ea.emit("gtm:formStep",{form_id:e.id,form_name:e.title,form_type:e.title,step_number:t+1,step_name:i,page_url:location.href,time_on_step:r,language:window.language||"nl",location:o.Location||""})}},_=function(t,e,n,a){var r;(0,b.mL)(((r={})[t]=e.toString(),r)),n&&a&&a.pages.length>1&&N!==e&&(k(e,n,a),N=e,S=Date.now())},C=function(n){return function(){return(0,a.sH)(void 0,void 0,void 0,function(){var r,u,s,w,S,N,L,E,C,I,O,M,A;return(0,a.YH)(this,function(a){switch(a.label){case 0:return r=d(e.form),c(e.form).some(function(t){return"showroomdatepicker"===t.type})&&!r.Location&&(u=c(e.form).find(function(t){return"showroomdatepicker"===t.type}),s=p(t.querySelector("form"),null==u?void 0:u.defaultShowroomLocation),r.Location=s.charAt(0).toUpperCase()+s.slice(1)),g&&!h&&(h=Date.now()-g),w=e.form.pages.length-1,k(w,e,e.form),S=(0,b.eY)(),[4,fetch(e.apiEndpoint,{method:"POST",headers:{"content-type":"application/json","accept-language":window.culture||"nl"},body:JSON.stringify({CurrentPage:e.currentPage,Values:r,QueryParams:location.search,SourcebusterSource:null===(O=l.getSourcebusterSource)||void 0===O?void 0:O.call(l),SourcebusterMedium:null===(M=l.getSourcebusterMedium)||void 0===M?void 0:M.call(l),SourcebusterEntrancePoint:null===(A=l.getSourcebusterEntrancePoint)||void 0===A?void 0:A.call(l),CampaignId:S.campaignId,SourceId:S.sourceId})})];case 1:return 200!==(N=a.sent()).status?[3,2]:(v=!0,null==i||i(!0),window.off("beforeunload.unSubmit"),y.ea.emit("gtm:formSubmit",{currency:"EUR",location_id:e.title,options:f(e.form),value:null}),y.ea.emit("gtm:formSuccess",{form_name:e.title,form_id:e.id,form_type:e.title,page_url:location.href,time_on_form:h,language:window.language||"nl",location:r.Location||""}),x.removeItem(m),V({fields:{}}),[3,4]);case 2:return[4,N.json()];case 3:L=a.sent(),E=c(e.form).filter(function(t){var e,n=L.errors.find(function(e){return e.alias===t.alias});return!!n&&(L.errors.splice(L.errors.indexOf(n),1),t.error=null!==(e=t.validationMessages[n.errors[0]])&&void 0!==e?e:n.errors[0],!0)}),C=E[0],_(n,C.path[0],e,e.form),(I=document.getElementById(C.id)).scrollIntoView({behavior:"smooth"}),I.focus(),a.label=4;case 4:return o().redraw(),[2]}})})}},I=function(t,n,a){void 0===n&&(n=!0);var r=c(e.form,t).filter(function(t){return s(t,n)});if(r.length>0){y.ea.emit("gtm:formError",{location_id:e.title,options:r.map(function(t){var e;return{key:null!==(e=t.caption)&&void 0!==e?e:t.alias,val:t.error}})});var o=r[0];if(o){var i=(null==a?void 0:a.querySelector("#".concat(CSS.escape(o.id))))||document.getElementById(o.id);i&&(i.scrollIntoView({behavior:"smooth"}),i.focus())}}return 0===r.length},V=function(t){e.form.pages.forEach(function(e){return e.fieldsets.forEach(function(e){return e.containers.forEach(function(e){return e.fields.forEach(function(e){return e.value=t.fields[e.alias]})})})})},O=function(t){return(0,a.sH)(void 0,void 0,void 0,function(){return(0,a.YH)(this,function(n){return delete t.defaultValue,M(t),g||(g=Date.now(),S=Date.now(),y.ea.emit("gtm:startForm",{form_name:e.title,form_id:e.id,form_type:e.title,page_url:location.href,language:window.language||"nl"})),window.has("beforeunload.unSubmit")||window.on("beforeunload.unSubmit",function(){v||y.ea.emit("gtm:formUnsubmit",{currency:"EUR",location_id:e.title,options:f(e.form),value:null})}),[2]})})},M=(0,u.debounce)(1e3,function(t){return(0,a.sH)(void 0,void 0,void 0,function(){var t;return(0,a.YH)(this,function(n){return t={fields:d(e.form)},x.setItem(m,JSON.stringify(t)),[2]})})}),A=x.getItem(m),(H=JSON.parse(A))&&V(H),o().mount(t,{view:function(t){var n,a=null!==(n=o().parseQueryString(location.search)[r])&&void 0!==n?n:0;return v?o()(E,{form:e.form,id:r,goto:e.goToPage,translations:e.translations,onreset
1:function(){v=!1,null==i||i(!1),_(r,0,e,e.form)}}):o()(L,{page:+a,form:e.form,id:r,config:e,translations:e.translations,onchange:O,onsubmit:C(r),onvalidate:I,onNavigate:function(t){return _(r,t,e,e.form)}})}}),o().redraw(),setTimeout(function(){return(0,w.ZU)(c(e.form),{AddressLookup:e.translations.addressLookup})},100),[2]}})})}}}]);

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.