1(self.webpackChunk=self.webpackChunk||[]).push([[32867],{121(e,t){var s,n,i;"undefined"!=typeof self&&self,n=[],void 0!==(i="function"==typeof(s=function(){"use strict";let e=window.document,t=new WeakMap,s="autocomplete-",n="Address",i={PAGED:"paged",SHORT:"short"},o=Object.create(null,{context:{value:"nld",writable:!0},autocompleteUrl:{writable:!0},addressDetailsUrl:{writable:!0},tags:{value:{"unvalidated-housenumber":"(unknown house number)","unvalidated-housenumber-addition":"(unknown house number addition)"},writable:!0},cssPrefix:{value:"postcodenl-autocomplete-",writable:!0},minLength:{value:1,writable:!0},delay:{value:300,writable:!0},appendTo:{value:e.body,writable:!0},autoFocus:{value:!0,writable:!0},autoSelectSingleAddress:{value:!0,writable:!0},autoResize:{value:!0,writable:!0},showLogo:{value:!0,writable:!0},getResponseMessage:{value:function(e){return(e>1?e+" address suggestions available. ":"One address suggestion available. ")+"Use up and down arrow keys to navigate."},writable:!0},language:{writable:!0},buildingListMode:{set(e){Object.values(i).includes(e)?this.mode=e:console.error("Invalid mode for option buildingListMode:",e)},get(){return this.mode||i.SHORT}}}),r=function(n){let i=this,o=e.createElement("ul"),r=e.createElement("div"),l={menuOpen:n.cssPrefix+"menu-open",itemFocus:n.cssPrefix+"item-focus",logo:n.cssPrefix+"logo"},a=function(e){let t=e.getBoundingClientRect();r.style.top=t.bottom+(window.scrollY||window.pageYOffset)+"px",r.style.left=t.left+(window.scrollX||window.pageXOffset)+"px",n.autoResize&&(r.style.width=t.width+"px")},u=function(e,n,i){let r=o.children.length;if(0===r)return;i=i||!1;let l=e,a;if((n=n||!1)&&(l=null===f?e>0?e-1:r+e:(a=d(f))+e),l%=r,l=l>=0?l:r+l,n&&null!==f&&(e>0&&l<a||e<0&&l>a)){c(null),w.value=E,t.get(w).context=L;return}c(o.children[l]);let u=t.get(f);i&&!0===w.dispatchEvent(new CustomEvent(s+"focus",{detail:u,cancelable:!0,bubbles:!0}))&&(w.value=u.value,t.get(w).context=u.context,b=l,o.scrollTop>f.offsetTop?o.scrollTop=f.offsetTop:f.offsetTop>=o.clientHeight+o.scrollTop&&(o.scrollTop=f.offsetHeight+f.offsetTop-o.clientHeight))},d=function(e){return Array.prototype.indexOf.call(o.children,e)},c=function(e){h(),(f=e)&&f.classList.add(l.itemFocus)},h=function(){null!==f&&f.classList.remove(l.itemFocus)},p=function(e){v&&e.target!==w&&!r.contains(e.target)&&i.close()},g=function(){v&&i.close()},v=!1,m=!1,f=null,b=null,w,E,L;Object.defineProperties(this,{isOpen:{get:function(){return v}},isMousedown:{get:function(){return m}},hasFocus:{get:function(){return null!==f}},wrapper:{get:function(){return r}},ul:{get:function(){return o}},suppress:{value:!1,writable:!0}}),r.classList.add(n.cssPrefix+"menu"),r.classList.toggle(l.logo,n.showLogo),o.classList.add(n.cssPrefix+"menu-items"),r.appendChild(o),o.addEventListener("mousemove",function(e){if(e.target===f||e.target===o)return;let t=e.target;for(;t.parentElement!==o;)t=t.parentElement;c(t),u(d(t))}),r.addEventListener("mousedown",function(){m=!0}),r.addEventListener("click",function(e){e.preventDefault(),null!==f&&i.select(),window.setTimeout(function(){m=!1})}),Object.prototype.isPrototypeOf.call(HTMLElement.prototype,n.appendTo)?n.appendTo.appendChild(r):(e.querySelector(n.appendTo)||e.body).appendChild(r),this.setItems=function(e,s){o.innerHTML="";for(let n=0,i,r;r=e[n++];)i=s(o,r),t.set(i,r);c(null),b=null,o.scrollTop=0},this.open=function(e){E=(w=e).value,L=t.get(w).context,n.autoFocus&&null===b&&(b=0),null!==b&&u(b),v||this.suppress||(a(w),r.classList.add(l.menuOpen),o.scrollTop=0,v=!0,w.dispatchEvent(new CustomEvent(s+"open",{bubbles:!0})))},this.close=function(e){v&&(e&&(w.value=E,t.get(w).context=L,b=null),i.blur(),r.classList.remove(l.menuOpen),v=!1,w.dispatchEvent(new CustomEvent(s+"close",{bubbles:!0})))},this.focusPrevious=u.bind(this,-1,!0),this.focusNext=u.bind(this,1,!0),this.blur=function(){c(null)},this.select=function(e){let n=t.get(f),i=d(f);!0===w.dispatchEvent(new CustomEvent(s+"select",{detail:n,cancelable:!0,bubbles:!0}))&&(w.value=n.value,b=i),(void 0===e||e)&&w.focus()},this.clear=function(){c(null),b=null,o.innerHTML=""},this.destroy=function(){return null!==r.parentNode&&(r.parentNode.removeChild(r),e.removeEventListener("click",p),window.removeEventListener("resize",g),!0)},e.addEventListener("click",p),window.addEventListener("resize",g)},l=function(){let e=new Uint8Array(32),t=[],s="0123456789abcdef";(window.crypto||window.msCrypto).getRandomValues(e);for(let n=0,i=s.length;n<32;n++)t.push(s[e[n]%i]);return t.join("")},a=function(t){let s=2,n=t;
1for(;null!==e.getElementById(n);)n=t+"-"+s,s++;return n},u=function(e,t){for(let s in t)e[s]=t[s];return e},d=function(e){return Object.prototype.toString.call(e).slice(8,-1)};"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,s){s=s||{bubbles:!1,cancelable:!1,detail:null};var n=e.createEvent("CustomEvent");return n.initCustomEvent(t,s.bubbles,s.cancelable,s.detail),n}),0===window.DOMTokenList.prototype.toggle.length&&(window.DOMTokenList.prototype.toggle=function(e){return arguments.length>1?(this[arguments[1]?"add":"remove"](e),!!arguments[1]):(this[this.contains(e)?"remove":"add"](e),this.contains(e))});let c=function(c,h){let p;if("String"===d(c))p=e.querySelectorAll(c);else if(Object.prototype.isPrototypeOf.call(HTMLElement.prototype,c))p=[c];else if(Object.prototype.isPrototypeOf.call(NodeList.prototype,c))p=c;else throw TypeError("Element(s) or selector has invalid type. Use HTMLElement, NodeList or valid CSS selector string.");if(0===p.length)return;(h=u(Object.create(o),h)).context=h.context.toLowerCase(),Object.defineProperty(this,"options",{get:function(){return h}});let g=null,v=null,m=null,f=null,b=null,w=[],E=this,L=new r(h),y=h.cssPrefix+"address-input-blank",x=l(),A=e.createElement("div"),C="aria-live-region";A.id=a(C),A.setAttribute("role","status"),A.setAttribute("aria-live","assertive"),A.classList.add(h.cssPrefix+C),e.body.appendChild(A),window.addEventListener("beforeunload",function(){window.clearTimeout(g)}),Object.defineProperty(this,"elements",{get:function(){return{menu:L.wrapper,menuItems:L.ul,liveRegion:A}}}),this.announce=function(e){A.innerHTML="<div>"+e+"</div>"}
1,this.xhrGet=function(e,n){null!==f&&f.readyState<4&&f.abort(),(f=new XMLHttpRequest).addEventListener("load",function(){200===this.status&&n.call(this,JSON.parse(f.response))});let i=x;if(null!==b){let e=b,n=function(t){200!==this.status&&e.dispatchEvent(new CustomEvent(s+"error",{detail:{event:t,request:this},bubbles:!0}))};i=t.get(e).sessionId,f.addEventListener("error",n),f.addEventListener("load",n),e.classList.add(h.cssPrefix+"loading"),f.addEventListener("loadend",function(){e.classList.remove(h.cssPrefix+"loading")})}return f.open("GET",e),f.setRequestHeader("X-Autocomplete-Session",i),f.send(),f},this.getSuggestions=function(e,t,s){let n=[this.options.autocompleteUrl,encodeURIComponent(e),encodeURIComponent(t),h.language||""];return h.buildingListMode!==i.SHORT&&n.push(h.buildingListMode),this.xhrGet(n.join("/").replace(/\/+$/,""),s)},this.getDetails=function(e){let t=null,s=arguments[1],n=[e];return 3==arguments.length&&(t=arguments[1],s=arguments[2],n.push(t)),this.xhrGet(this.options.addressDetailsUrl+"/"+n.join("/"),s)},this.renderItem=function(t,s){let i=e.createElement("li"),o=e.createElement("span");if(i.classList.add(this.options.cssPrefix+"item"),o.classList.add(this.options.cssPrefix+"item-label"),o.innerHTML=this.highlight(s.label,s.highlights),i.appendChild(o),s.precision!==n&&i.classList.add(this.options.cssPrefix+"item-more"),s.description){let t=e.createElement("span");t.textContent=s.description,t.classList.add(this.options.cssPrefix+"item-description"),i.appendChild(t)}if(s.tags)for(let t=0,n;n=s.tags[t++];){let t=e.createElement("em");t.textContent=this.options.tags[n],t.classList.add(this.options.cssPrefix+"item-tag"),i.appendChild(t)}return t.appendChild(i),i},this.highlight=function(e,t){if(0===t.length)return e;let s=0,n=0,i=0,o=[],r;for(;r=t[s++];)o.push(e.slice(i,r[0])),n=r[0],i=r[1],o.push("<mark>"+e.slice(n,i)+"</mark>");return o.push(e.slice(i)),o.join("")},this.setCountry=function(e){h.context=e.toLowerCase();for(let e=0,s;s=p[e++];)t.get(s).context=h.context},this.setLanguage=function(e){h.language=e},this.search=function(e){let s;if(s="Object"===d(arguments[1])?arguments[1]:{term:arguments[1],context:arguments[2]},void 0!==s.term&&(e.value=s.term),void 0!==s.context){let n=t.get(e);n.context=s.context,t.set(e,n)}let n=L.suppress;L.suppress=!(void 0===s.showMenu||s.showMenu),b=e,e.classList.toggle(y,""===e.value),S(e),L.suppress=n},this.reset=function(){v=null,m=null,w=[],L.clear();for(let e=0,s;s=p[e++];){let e=t.get(s);e.context=h.context,e.match={},s.value="",s.classList.add(y)}},this.destroy=function(){if(L.destroy()){e.body.removeChild(A);for(let e=0,i;i=p[e++];){let e=t.get(i);for(var s in e.eventHandlers)i.removeEventListener(s,e.eventHandlers[s]);for(var n in e.initialAttributeValues){let t=e.initialAttributeValues[n];null===t?i.removeAttribute(n):i.setAttribute(n,t)}t.delete(i),i.classList.remove(h.cssPrefix+"address-input",h.cssPrefix+"loading",y,h.cssPrefix+"logo")}}},Array.prototype.forEach.call(p,function(e){let i=Object.create(null),o=!1;t.set(e,{match:{},context:h.context,eventHandlers:i,initialAttributeValues:{spellcheck:e.hasAttribute("spellcheck")?e.getAttribute("spellcheck"):null,autocomplete:e.hasAttribute("autocomplete")?e.getAttribute("autocomplete"):null,"aria-controls":e.hasAttribute("aria-controls")?e.getAttribute("aria-controls"):null},sessionId:l()}),!1===e.hasAttribute("autocomplete")&&(e.autocomplete="off"),e.spellcheck=!1,e.setAttribute("aria-controls",A.id),e.classList.add(h.cssPrefix+"address-input"),e.classList.toggle(y,""===e.value),e.classList.toggle(h.cssPrefix+"logo",h.showLogo),e.addEventListener("keydown",i.keydown=function(t){switch(o=!0,t.key){case"ArrowUp":case"Up":L.isOpen?L.focusPrevious(!0):S(e),t.preventDefault();break;case"ArrowDown":case"Down":L.isOpen?L.focusNext(!0):S(e),t.preventDefault();break;case"Escape":case"Esc":L.close(!0);break;case"Tab":L.hasFocus&&(L.select(),t.preventDefault());break;case"Enter":L.hasFocus?(L.select(),t.preventDefault()):L.close();break;default:P(e)}}),e.addEventListener("input",i.input=function(){if(e.classList.remove(y),L.blur(),w=[],o){o=!1;return}P(e)}),e.addEventListener("focus",i.focus=function(){if(L.isMousedown)return;L.open(e);let s=t.get(e);(void 0===s.match.precision||s.match.precision!==n)&&S(e)}),e.addEventListener("click",i.click=L.open.bind(L,e)),e.addEventListener(s+"select",i[s+"select"]=function(s){let i=t.get(e);i.match=s.detail,s.detail.precision===n?L.close():(L.open(e),i.context=s.detail.context,window.setTimeout(S,0,e))}),e.addEventListener("blur",i.blur=function(){L.isMousedown||(window.clearTimeout(g),T(),L.close(),e.classList.toggle(y,""===e.value))}),e.dispatchEvent(new CustomEvent(s+"create",{detail:E,bubbles:!0}))});let T=function(){h.autoFocus&&h.autoSelectSingleAddress&&L.hasFocus&&1===w.length&&w[0].precision===n&&L.select(!1)},P=function(e){window.clearTimeout(g);let t=10;e.value.length>3&&(t=h.delay),g=window.setTimeout(S,t,e)},S=function(e){L.open(e);let n=t.get(e);if(b=e,e.value===v&&n.context===m)return;let i=n.context===m&&null!==v&&(0===e.value.indexOf(v)||0===v.indexOf(e.value));if(v=e.value,m=n.context,n.match={},e.value.length<h.minLength){n.context=h.context,L.clear();return}if(!1===e.dispatchEvent(new CustomEvent(s+"search",{cancelable:!0,bubbles:!0})))return;let o=L.suppress;E.getSuggestions.call(E,n.context,e.value,function(t){"String"===d(t.newContext)&&(n.context=t.newContext),!0!==e.dispatchEvent(new CustomEvent(s+"response",{detail:t,cancelable:!0,bubbles:!0}))||(w=t.matches||[],i&&0===w.length||(L.setItems(w,E.renderItem.bind(E)),E.announce(h.getResponseMessage(w.length,h.language)),!1===o&&L.open(e)))})}};return Object.defineProperty(c,"defaults",{get:function(){return o}}),Object.defineProperty(c,"version",{value:"1.4.2"}),c})?s.apply(t,n):s)&&(e.exports=i)},319(e,t,s){"use strict";s.d(t,{A:()=>i});var n=s(368);class i{constructor(e="",t=!0){this.client=new n.A,this.prefix=e,this.enabled=t}log(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.enabled)return this.prefix&&(t=`[${this.prefix}] ${t}`),this.client.post(window.router["frontend.memo.postcode.debug.log"],{level:e,message:t,context:s}
1).catch(()=>"")}debug(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(100,e,t)}info(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(200,e,t)}notice(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(250,e,t)}warning(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(300,e,t)}error(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(400,e,t)}critical(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(500,e,t)}alert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(550,e,t)}emergency(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.log(600,e,t)}}},321(e,t,s){"use strict";s.d(t,{A:()=>i});var n=s(795);class i{constructor(e){this.el=e}hasAlert(){return!1!==n.A.querySelectorAll(this.el,".alert",!1)}hasWarning(){return!1!==n.A.querySelectorAll(this.el,".alert-warning",!1)}hasError(){return!1!==n.A.querySelectorAll(this.el,".alert-danger",!1)}show(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];t&&this.remove(),this.el.insertAdjacentHTML("beforeend",e)}remove(){let e=n.A.querySelectorAll(this.el,".alert",!1);e&&e.forEach(e=>e.remove())}}},368(e,t,s){"use strict";s.d(t,{A:()=>i});class n{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",n=this._createPreparedRequest("GET",e,s);return this._sendRequest(n,null,t)}post(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(t,n);let i=this._createPreparedRequest("POST",e,n);return this._sendRequest(i,t,s)}delete(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(t,n);let i=this._createPreparedRequest("DELETE",e,n);return this._sendRequest(i,t,s)}patch(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(t,n);let i=this._createPreparedRequest("PATCH",e,n);return this._sendRequest(i,t,s)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,s){return this._registerOnLoaded(e,s),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,s){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),this._request}}class i{constructor(){this.client=new n}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"application/json";return new Promise((s,n)=>{this.client.get(e,(e,t)=>this._resolveResponse(t,s,n),t)})}post(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json";return new Promise((n,i)=>{this.client.post(e,this._resolveRequest(t,s),(e,t)=>this._resolveResponse(t,n,i),s)})}delete(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json";return new Promise((n,i)=>{this.client.delete(e,this._resolveRequest(t,s),(e,t)=>this._resolveResponse(t,n,i),s)})}patch(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json";return new Promise((n,i)=>{this.client.patch(e,this._resolveRequest(t,s),(e,t)=>this._resolveResponse(t,n,i),s)})}abort(){this.client.abort()}_resolveRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"application/json";return t.includes("application/json")?JSON.stringify(e):e}_resolveResponse(e,t,s){let n=e.responseText,i=e.getResponseHeader("Content-Type");if(!i){e.status<400?t():s();return}i.includes("application/json")&&(n=JSON.parse(e.responseText)),e.status<400?t(n):s(n)}}},635(e,t,s){"use strict";s.d(t,{A:()=>i});var n=s(368);class i{constructor(){this.client=new n.A,this.cache=new Map}generate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=JSON.stringify(arguments);return this.cache.has(o)?Promise.resolve(this.cache.get(o)):this.client.post(window.router["frontend.memo.postcode.alert.generate"],{content:e,type:t,heading:s,dismissible:n,showIcon:i}).catch(()=>"").then(e=>this.cache.set(o,e).get(o))}success(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return this.generate(e,"success",t,s,n)}warning(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return this.generate(e,"warning",t,s,n)}danger(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return this.generate(e,"danger",t,s,n)}info(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];
1return this.generate(e,"info",t,s,n)}primary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return this.generate(e,"primary",t,s,n)}secondary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return this.generate(e,"secondary",t,s,n)}light(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return this.generate(e,"light",t,s,n)}dark(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return this.generate(e,"dark",t,s,n)}}},707(e,t,s){"use strict";s.d(t,{A:()=>n});class n{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let s=n.toUpperCamelCase(e,t);return n.lcFirst(s)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>n.ucFirst(e.toLowerCase())).join(""):n.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},795(e,t,s){"use strict";s.d(t,{A:()=>i});var n=s(707);class i{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!i.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!1===i.hasAttribute(e,t))throw Error(`The required property "${t}" does not exist!`);if("function"!=typeof e.getAttribute){if(s)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=t.replace(/^data(|-)/,""),r=n.A.toLowerCamelCase(o,"-");if(!i.isNode(e)){if(s)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(s)throw Error("This node doesn't support the dataset attribute!");return}let l=e.dataset[r];if(void 0===l){if(s)throw Error(`The required data attribute "${t}" does not exist on ${e}!`);return l}return n.A.parsePrimitive(l)}static querySelector(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!i.isNode(e))throw Error("The parent node is not a valid HTML Node!");let n=e.querySelector(t)||!1;if(s&&!1===n)throw Error(`The required element "${t}" does not exist in parent node!`);return n}static querySelectorAll(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!i.isNode(e))throw Error("The parent node is not a valid HTML Node!");let n=e.querySelectorAll(t);if(0===n.length&&(n=!1),s&&!1===n)throw Error(`At least one item of "${t}" must exist in parent node!`);return n}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=` 2 input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]), 3 select:not([tabindex^="-"]):not([disabled]), 4 textarea:not([tabindex^="-"]):not([disabled]), 5 button:not([tabindex^="-"]):not([disabled]), 6 a[href]:not([tabindex^="-"]):not([disabled]), 7 [tabindex]:not([tabindex^="-"]):not([disabled]) 8 `;return e.querySelectorAll(t)}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}},867(e,t,s){"use strict";s.r(t),s.d(t,{default:()=>h});
8var n=s(795),i=s(321),o=s(635),r=s(368),l=s(121),a=s.n(l);let u=Object.freeze({Locality:"Locality",PostalCode:"PostalCode",Street:"Street",PartialAddress:"PartialAddress",Address:"Address",None:"None"}),d=function(e,t){let s=new(a())(e,t);return s.xhrPromise=function(e){return new Promise((t,s)=>{let n=this.xhrGet(e,e=>t(e)),i=function(){200!==this.status&&s(JSON.parse(n.responseText))};n.addEventListener("error",i),n.addEventListener("load",i)})},s.getSuggestions=async function(e,t,s){let n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=new URLSearchParams;return i.set("context",e),i.set("term",t),this.xhrPromise(`${this.options.autocompleteUrl}?${i.toString()}`).then(s).catch(e=>{if(!n)return Promise.reject(e)})},s.getDetails=async function(e,t){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=new URLSearchParams;return n.set("context",e),this.xhrPromise(`${this.options.addressDetailsUrl}?${n.toString()}`).then(t).catch(e=>{if(!s)return Promise.reject(e)})},s};var c=s(319);class h extends window.PluginBaseClass{static #e=this.options={elementSelector:"input",messages:{selectCompleteAddress:null},enableLogging:!1};init(){this._initServices(),this._initAutocomplete(),this._registerEvents()}_initServices(){this.client=new r.A,this.alert=new i.A(this.el),this.alertGenerator=new o.A,this.logger=new c.A("Autocomplete",this.options.enableLogging);let e=window.PluginManager.getPluginInstanceFromElement(this.el.closest("[data-postcode-address-field-switch]"),"PostcodeAddressFieldSwitch");this.emitter=e.$emitter}_initAutocomplete(){this.autocompleteElement=n.A.querySelector(this.el,this.options.elementSelector),this.autocomplete=new d(this.autocompleteElement,{autocompleteUrl:window.router["frontend.memo.postcode.autocomplete.search"],addressDetailsUrl:window.router["frontend.memo.postcode.autocomplete.details"],showLogo:!1}),this.isLoadingDetails=!1}_registerEvents(){this.autocompleteElement.addEventListener("autocomplete-search",this.onSearch.bind(this)),this.autocompleteElement.addEventListener("autocomplete-select",this.onSelect.bind(this)),this.autocompleteElement.addEventListener("autocomplete-open",this.onOpen.bind(this)),this.autocompleteElement.addEventListener("autocomplete-close",this.onClose.bind(this)),this.autocompleteElement.addEventListener("autocomplete-error",this.onError.bind(this)),this.emitter.unsubscribe("show-address"),this.emitter.subscribe("show-address",this.onShowAddress.bind(this)),this.emitter.unsubscribe("update-country"),this.emitter.subscribe("update-country",this.onUpdateCountry.bind(this)),this.emitter.unsubscribe("before-template-switch"),this.emitter.subscribe("before-template-switch",this.onTemplateSwitch.bind(this))}onShowAddress(e){let t=e.detail;0!==Object.keys(t).length&&(this.logger.debug("Show address",{address:t}),this.autocompleteElement.value=this._composeAddress(t),this._setValid())}onUpdateCountry(e){try{this.autocomplete.setCountry(e.detail.iso)}catch(e){}}onTemplateSwitch(){this.autocomplete.destroy()}onSearch(e){this._setInvalid(),this._removeServerInvalid(),this.emitter.publish("update-address",[]),this.alert.remove()}onSelect(e){this.alert.remove(),u.Address===e.detail.precision&&(this.isLoadingDetails=!0,this.logger.debug("Load address details",{detail:e.detail}),this.autocomplete.getDetails(e.detail.context,e=>{this.logger.debug("Received address details",{address:e}),this.emitter.publish("update-address",e)}).then(()=>{this._setValid(),this.alert.remove(),this.isLoadingDetails=!1}))}onOpen(e){this.alert.hasError()||this.alert.remove()}onClose(e){this._isValid()||this.alert.hasError()||this.isLoadingDetails||!(e.target.value.length>0)||this.alertGenerator.warning(this.options.messages.selectCompleteAddress||"").then(e=>{this._isValid()||this.alert.show(e)}),this._isValid()&&this.alert.remove()}onError(e){let t=JSON.parse(e.detail.request.responseText);this.alertGenerator.danger(t.message).then(e=>this.alert.show(e))}_composeAddress(e){return`${e.street||""} ${`${e.houseNumber||""} ${e.addition||""}`.trim()}, ${e.postcode||""} ${e.city||""}`}_isValid(){return this.autocompleteElement.classList.contains("is-valid-address")}_setValid(){this.autocompleteElement.classList.add("is-valid-address")}_setInvalid(){this.autocompleteElement.classList.remove("is-valid-address")}_removeServerInvalid(){this.autocompleteElement.classList.remove("is-invalid")}}}}]);
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.