1(function(){var tt={55657:(function(S){var L,E;L=this,E=function(){"use strict";function K(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),n.push.apply(n,i)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?K(Object(n),!0).forEach((function(i){_(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))}))}return t}function C(t){return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(t)}function _(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t){return(function(e){if(Array.isArray(e))return m(e)})(t)||(function(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||c(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function c(t,e){if(t){if(typeof t=="string")return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}function m(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var d=function(t){return typeof t=="string"?document.querySelector(t):t()},p=function(t,e){var n=typeof t=="string"?document.createElement(t):t;for(var i in e){var s=e[i];if(i==="inside")s.append(n);else if(i==="dest")d(s[0]).insertAdjacentElement(s[1],n);else if(i==="around"){var o=s;o.parentNode.insertBefore(n,o),n.append(o),o.getAttribute("autofocus")!=null&&o.focus()}else i in n?n[i]=s:n.setAttribute(i,s)}return n},k=function(t,e){return t=String(t).toLowerCase(),e?t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):t},w=function(t,e){return p("mark",I({innerHTML:t},typeof e=="string"&&{class:e})).outerHTML},g=function(t,e){e.input.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e.feedback,cancelable:!0}))},T=function(t,e,n){var i=n||{},s=i.mode,o=i.diacritics,l=i.highlight,y=k(e,o);if(e=String(e),t=k(t,o),s==="loose"){var f=(t=t.replace(/ /g,"")).length,a=0,h=Array.from(e).map((function(b,v){return a<f&&y[v]===t[a]&&(b=l?w(b,l):b,a++),b})).join("");if(a===f)return h}else{var u=y.indexOf(t);if(~u)return t=e.substring(u,u+t.length),u=l?e.replace(t,w(t,l)):e}},j=function(t,e){return new Promise((function(n,i){var s;return(s=t.data).cache&&s.store?n():new Promise((function(o,l){return typeof s.src=="function"?s.src(e).then(o,l):o(s.src)})).then((function(o){try{return t.feedback=s.store=o,g("response",t),n()}catch(l){return i(l)}}),i)}))},x=function(t,e){var n=e.data,i=e.searchEngine,s=[];n.store.forEach((function(l,y){var f=function(u){var b=u?l[u]:l,v=typeof i=="function"?i(t,b):T(t,b,{mode:i,diacritics:e.diacritics,highlight:e.resultItem.highlight});if(v){var H={match:v,value:l};u&&(H.key=u),s.push(H)}};if(n.keys){var a,h=(function(u,b){var v=typeof Symbol!="undefined"&&u[Symbol.iterator]||u["@@iterator"];if(!v){if(Array.isArray(u)||(v=c(u))||b&&u&&typeof u.length=="number"){v&&(u=v);var H=0,N=function(){};return{s:N,n:function(){return H>=u.length?{done:!0}:{done:!1,value:u[H++]}},e:function(M){throw M},f:N}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var R,W=!0,B=!1;return{s:function(){v=v.call(u)},n:function(){var M=v.next();return W=M.done,M},e:function(M){B=!0,R=M},f:function(){try{W||v.return==null||v.return()}finally{if(B)throw R}}}})(n.keys);try{for(h.s();!(a=h.n()).done;)f(a.value)}catch(u){h.e(u)}finally{h.f()}}else f()})),n.filter&&(s=n.filter(s));var o=s.slice(0,e.resultsList.maxResults);e.feedback={query:t,matches:s,results:o},g("results",e)},O="aria-expanded",P="aria-activedescendant",q="aria-selected",Q=function(t,e){t.feedback.selection=I({index:e},t.feedback.results[e])},J=function(t){t.isOpen||((t.wrapper||t.input).setAttribute(O,!0),t.list.removeAttribute("hidden"),t.isOpen=!0,g("open",t))},D=function(t){t.isOpen&&((t.wrapper||t.input).setAttribute(O,!1),t.input.setAttribute(P,""),t.list.setAttribute("hidden",""),t.isOpen=!1,g("close",t))},z=function(t,e){var n=e.resultItem,i=e.list.getElementsByTagName(n.tag),s=!!n.selected&&n.selected.split(" ");if(e.isOpen&&i.length){var o,l,y=e.cursor;t>=i.length&&(t=0),t<0&&(t=i.length-1),e.cursor=t,y>-1&&(i[y].removeAttribute(q),s&&(l=i[y].classList).remove.apply(l,r(s))),i[t].setAttribute(q,!0),s&&(o=i[t].classList).add.apply(o,r(s)),e.input.setAttribute(P,i[e.cursor].id
3),e.list.scrollTop=i[t].offsetTop-e.list.clientHeight+i[t].clientHeight+5,e.feedback.cursor=e.cursor,Q(e,t),g("navigate",e)}},V=function(t){z(t.cursor+1,t)},X=function(t){z(t.cursor-1,t)},F=function(t,e,n){(n=n>=0?n:t.cursor)<0||(t.feedback.event=e,Q(t,n),g("selection",t),D(t))};function Y(t,e){var n=this;return new Promise((function(i,s){var o,l;return o=e||((l=t.input)instanceof HTMLInputElement||l instanceof HTMLTextAreaElement?l.value:l.innerHTML),(function(f,a,h){return a?a(f):f.length>=h})(o=t.query?t.query(o):o,t.trigger,t.threshold)?j(t,o).then((function(f){try{return t.feedback instanceof Error?i():(x(o,t),t.resultsList&&(function(a){var h=a.resultsList,u=a.list,b=a.resultItem,v=a.feedback,H=v.matches,N=v.results;if(a.cursor=-1,u.innerHTML="",H.length||h.noResults){var R=new DocumentFragment;N.forEach((function(W,B){var M=p(b.tag,I({id:"".concat(b.id,"_").concat(B),role:"option",innerHTML:W.match,inside:R},b.class&&{class:b.class}));b.element&&b.element(M,W)})),u.append(R),h.element&&h.element(u,v),J(a)}else D(a)})(t),y.call(n))}catch(a){return s(a)}}),s):(D(t),y.call(n));function y(){return i()}}))}var G=function(t,e){for(var n in t)for(var i in t[n])e(n,i)},et=function(t){var e,n,i,s=t.events,o=(e=function(){return Y(t)},n=t.debounce,function(){clearTimeout(i),i=setTimeout((function(){return e()}),n)}),l=t.events=I({input:I({},s&&s.input)},t.resultsList&&{list:s?I({},s.list):{}}),y={input:{input:function(){o()},keydown:function(f){(function(a,h){switch(a.keyCode){case 40:case 38:a.preventDefault(),a.keyCode===40?V(h):X(h);break;case 13:h.submit||a.preventDefault(),h.cursor>=0&&F(h,a);break;case 9:h.resultsList.tabSelect&&h.cursor>=0&&F(h,a);break;case 27:h.input.value="",D(h)}})(f,t)},blur:function(){D(t)}},list:{mousedown:function(f){f.preventDefault()},click:function(f){(function(a,h){var u=h.resultItem.tag.toUpperCase(),b=Array.from(h.list.querySelectorAll(u)),v=a.target.closest(u);v&&v.nodeName===u&&F(h,a,b.indexOf(v))})(f,t)}}};G(y,(function(f,a){(t.resultsList||a==="input")&&(l[f][a]||(l[f][a]=y[f][a]))})),G(l,(function(f,a){t[f].addEventListener(a,l[f][a])}))};function Z(t){var e=this;return new Promise((function(n,i){var s,o,l;if(s=t.placeHolder,l={role:"combobox","aria-owns":(o=t.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},p(t.input,I(I({"aria-controls":o.id,"aria-autocomplete":"both"},s&&{placeholder:s}),!t.wrapper&&I({},l))),t.wrapper&&(t.wrapper=p("div",I({around:t.input,class:t.name+"_wrapper"},l))),o&&(t.list=p(o.tag,I({dest:[o.destination,o.position],id:o.id,role:"listbox",hidden:"hidden"},o.class&&{class:o.class}))),et(t),t.data.cache)return j(t).then((function(f){try{return y.call(e)}catch(a){return i(a)}}),i);function y(){return g("init",t),n()}return y.call(e)}))}function nt(t){var e=t.prototype;e.init=function(){Z(this)},e.start=function(n){Y(this,n)},e.unInit=function(){if(this.wrapper){var n=this.wrapper.parentNode;n.insertBefore(this.input,this.wrapper),n.removeChild(this.wrapper)}var i;G((i=this).events,(function(s,o){i[s].removeEventListener(o,i.events[s][o])}))},e.open=function(){J(this)},e.close=function(){D(this)},e.goTo=function(n){z(n,this)},e.next=function(){V(this)},e.previous=function(){X(this)},e.select=function(n){F(this,null,n)},e.search=function(n,i,s){return T(n,i,s)}}return function t(e){this.options=e,this.id=t.instances=(t.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"},(function(n){var i=n.name,s=n.options,o=n.resultsList,l=n.resultItem;for(var y in s)if(C(s[y])==="object")for(var f in n[y]||(n[y]={}),s[y])n[y][f]=s[y][f];else n[y]=s[y];n.selector=n.selector||"#"+i,o.destination=o.destination||n.selector,o.id=o.id||i+"_list_"+n.id,l.id=l.id||i+"_result",n.input=d(n.selector)})(this),nt.call(this,t),Z(this)}},S.exports=E()})},U={};function A(S){var L=U[S];if(L!==void 0)return L.exports;var E=U[S]={exports:{}};return tt[S].call(E.exports,E,E.exports,A),E.exports}(function(){A.n=function(S){var L=S&&S.__esModule?function(){return S.default}:function(){return S};return A.d(L,{a:L}),L}})(),(function(){A.d=function(S,L){for(var E in L)A.o(L,E)&&!A.o(S,E)&&Object.defineProperty(S,E,{enumerable:!0,get:L[E]})}})(),(function(){A.o=function(S,L){return Object.prototype.hasOwnProperty.call(S,L)}})(),(function(){"use strict";var S=A(55657),L=A.n(S),E=(_,r,c)=>new Promise((m,d)=>{var p=g=>{try{w(c.next(g))}catch(T){d(T)}},k=g=>{try{w(c.throw(g))}catch(T){d(T)}},w=g=>g.done?m(g.value):Promise.resolve(g.value).then(p,k);w((c=c.apply(_,r)).next())});class K{constructor(r,c={}){this.element=r,this.stickySelectedSpan=null,this.clearStickySelectionSpan=null,this.stickyHiddenInput=null,this.promptDiv=null;const m=c.threshold||2;this.options=Object.assign({name:null,placeholder:"",mode:null,searchPrompt:!1,searchPromptText:`Type at least ${m} characters to search`,selected:null,threshold:m,maxResults:10,dataMatchKeys:null,dataSource:()=>[],dataFilter:null,delay:200,modifyList:null,modifyResult:null},c),this.autocomplete=new(L())({selector:()=>this.element,diacritics:!0,placeHolder:c.placeholder,debounce:200,threshold:this.options.threshold,data:{keys:this.options.dataMatchKeys,src:p=>E(this,null,function*(){const k=()=>new Promise(w=>{this.options.dataSource(p,w)});try{return yield k()}catch(w){return w}}),filter:p=>{const k=p.filter((w,g,T)=>T.findIndex(j=>j.value===w.value)===g);return this.options.dataFilter?this.options.dataFilter(k):k}},resultsList:{maxResults:this.options.maxResults,element:(p,k)=>{this.options.modifyList&&this.options.modifyList(p,k)}},resultItem:{element:(p,k)=>{this.options.modifyResult&&this.options.modifyResult(p,k.value)}},events:{input:{blur:()=>{this.promptDiv.style.display="none"}}}}),this.acWrapper=this.element.closest(".autoComplete_wrapper"),this.element.ac=this.autocomplete;const d=p=>{p.stopPropagation()};switch(this.element.addEventListener("close",d),this.element.addEventListener("open",d),this.createPromptDiv(),this.options.mode){case"sticky":this.createStickySelect(this.options.name);break;case"multi":this.createMultiSelect(this.options.name);break;default:}}setInput(r){this.autocomplete.input.value=r}handleEvent(r){switch(this.options.mode){case"single":this.setInput(r.detail.selection.value[r.detail.selection.key]);break;case"sticky":this.handleStickyEvents(r);break;case"multi":this.handleMultiEvents(r);break;default:}}handleMultiEvents(r){switch(r.type){case"selection":this.addMultiSelectItem(r.detail.selection);break;default:}}handleStickyEvents(r){switch(r.type){case"selection":this.addStickySelectItem(r.detail.selection);break;case"click":r.target===this.clearStickySelectionSpan&&this.removeStickySelection();break;case"keyup":this.stickyHiddenInput.value!==""&&r.target===this.element&&(["Escape","Backspace","Delete"].includes(r.key)||/^[a-z0-9]$/i.test(r.key))?this.removeStickySelection():this.options.searchPrompt&&(this.stickyHiddenInput.value===""&&this.element.value.length<this.options.threshold?this.promptDiv.style.display="block":this.promptDiv.style.display="none");break;default:}}createHiddenInput(r){const c=document.createElement("input");return c.name=this.options.name,c.type="hidden",r&&(c.value=r),this.acWrapper.prepend(c),c}removeStickySelection(){this.stickyHiddenInput.value="",this.element.placeholder=this.options.placeholder,this.clearStickySelectionSpan.style.display="none",this.stickySelectedSpan.style.display="none"}addStickySelectItem(r){this.stickyHiddenInput.value=r.value.value,this.element.placeholder="",this.stickySelectedSpan.innerHTML=r.value[r.key],this.stickySelectedSpan.style.display="block",this.clearStickySelectionSpan.style.display="block",this.setInput("")}addMultiSelectItem(r){this.setInput("");const c=document.createElement("span");c.classList.add("label","primary","autocomplete__selected-item","multi"),c.innerHTML=r.value[r.key];
3const m=document.createElement("span");m.classList.add("clear-multi-selection"),m.innerHTML="×",m.setAttribute("data-remove",r.value.value),m.addEventListener("click",k=>{const w=this.acWrapper.querySelector(`input[type='hidden'][value='${r.value.value}']`);w&&(w.remove(),k.target.parentElement.remove())}),c.appendChild(m);const d=this.acWrapper.querySelector(".multiselect"),p=d.querySelector("span.input-container");d.insertBefore(c,p),this.createHiddenInput(r.value.value)}createStickySelect(){this.stickySelectedSpan=document.createElement("span"),this.stickySelectedSpan.classList.add("autocomplete__selected-item","sticky"),this.stickySelectedSpan.style.display="none",this.stickySelectedSpan.addEventListener("click",()=>this.element.focus()),this.stickyHiddenInput=this.createHiddenInput(),this.clearStickySelectionSpan=document.createElement("span"),this.clearStickySelectionSpan.className="clear-sticky-selection",this.clearStickySelectionSpan.innerHTML="×",this.clearStickySelectionSpan.style.display="none",this.clearStickySelectionSpan.addEventListener("click",this),this.element.addEventListener("selection",this),this.element.addEventListener("keyup",this),this.acWrapper.insertBefore(this.clearStickySelectionSpan,this.element),this.acWrapper.insertBefore(this.stickySelectedSpan,this.element),this.options.selected&&this.addStickySelectItem(this.options.selected)}createMultiSelect(){const r=document.createElement("div");r.classList.add("multiselect");const c=document.createElement("span");c.classList.add("input-container"),r.appendChild(c),this.acWrapper.prepend(r),c.appendChild(this.element),this.element.addEventListener("selection",this),r.addEventListener("click",()=>{this.element.focus()}),this.options.selected&&this.options.selected.forEach(m=>{this.addMultiSelectItem(m)})}createPromptDiv(){this.promptDiv=document.createElement("div"),this.promptDiv.classList.add("search-prompt"),this.promptDiv.style.display="none",this.promptDiv.innerHTML=this.options.searchPromptText,this.acWrapper.appendChild(this.promptDiv)}}$(()=>{$("[data-decidim-geocoding]").each((_,r)=>{const c=$(r),m=new K(r,{mode:"single",dataMatchKeys:["value"],dataSource:(d,p)=>{c.trigger("geocoder-suggest.decidim",[d,p])}});r.addEventListener("selection",m),c.on("selection",d=>{const p=d.detail.selection.value;c.trigger("geocoder-suggest-select.decidim",[p]),p.coordinates&&c.trigger("geocoder-suggest-coordinates.decidim",[p.coordinates])})})});const I=_=>_.filter(r=>r!==null&&typeof r!="undefined"&&`${r}`.trim().length>0);function C(_,r,c=", "){const m=r.map(d=>Array.isArray(d)?C(_,d," "):_[d]||_[d.toLowerCase()]);return I(m).join(c).trim()}$(()=>{const _=C;$("[data-decidim-geocoding]").each((r,c)=>{const m=$(c),d=m.data("decidim-geocoding"),p=d.queryMinLength||2,k=d.addressFormat||[["street","houseNumber"],"district","city","county","state","country"],w=$("html").attr("lang");let g=null;!d.apiKey||d.apiKey.length<1||(m.on("geocoder-suggest.decidim",(T,j,x)=>{clearTimeout(g),!(`${j}`.trim().length<p)&&(g=setTimeout(()=>{$.ajax({method:"GET",url:"https://autocomplete.search.hereapi.com/v1/autocomplete",data:{apiKey:d.apiKey,q:j,lang:w},dataType:"json"}).done(O=>O.items?x(O.items.map(P=>{const q=_(P.address,k);return{key:q,value:q,locationId:P.id}})):null)},200))}),m.on("geocoder-suggest-select.decidim",(T,j)=>{$.ajax({method:"GET",url:"https://lookup.search.hereapi.com/v1/lookup",data:{apiKey:d.apiKey,id:j.locationId},dataType:"json"}).done(x=>{if(!x||Object.keys(x).length<1)return;const O=x.position;if(!O||!O.lat||!O.lng)return;const P=[O.lat,O.lng];m.trigger("geocoder-suggest-coordinates.decidim",[P])})}))})})})()})(); 4 5//# sourceMappingURL=decidim_geocoding_provider_here-670502db8daef7497015.js.map
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.