(window.webpackJsonpLIS=window.webpackJsonpLIS||[]).push([[2],{395:function(t,e,r){"use strict";r.r(e),r.d(e,"ToubizPoiRemoveFilters",function(){return i});var n=r(3);function a(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tags=e,this.form=document.querySelector("[data-toubiz-results-list\\.filter-form]"),this.tags&&this.form&&this.initTags()}var e,r,i;return e=t,(r=[{key:"initTags",value:function(){var t=this,e=!0,r=!1,n=void 0;try{for(var a,o=this.getTags()[Symbol.iterator]();!(e=(a=o.next()).done);e=!0){a.value.addEventListener("click",function(e){e.preventDefault(),t.removeFilter(e.currentTarget),t.fireAllTagsRemovedEventIfNoTagsLeft()})}}catch(t){r=!0,n=t}finally{try{e||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"removeFilter",value:function(t){var e=t.dataset.id,r=!0,a=!1,o=void 0;try{for(var i,l=this.form.querySelectorAll('[data-id="'.concat(e,'"]'))[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var u=i.value,c=u.getAttribute("type");"checkbox"===c?u.checked=!1:"number"===c&&(u.value=""),Object(n.a)(u,"input")}}catch(t){a=!0,o=t}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}t.parentNode&&t.parentNode.removeChild(t),Object(n.a)(this.tags,"tagRemoved")}},{key:"fireAllTagsRemovedEventIfNoTagsLeft",value:function(){0===this.getTags().length&&Object(n.a)(this.tags,"allTagsRemoved")}},{key:"getTags",value:function(){return a(document.querySelectorAll("[data-js-poi-filter-tag]"))}}])&&o(e.prototype,r),i&&o(e,i),t}()}}]);