"use strict";(self.webpackChunkvt_ui_main=self.webpackChunkvt_ui_main||[]).push([[47031],{46156:(e,t,r)=>{var i=r(48704),n=r(16645),o=r(62832),l=r(15323),a=r(5644);let s,d,c,u,p,h=e=>e;function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o,l,a=[],s=!0,d=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(i=o.call(r)).done)&&(a.push(i.value),a.length!==t);s=!0);}catch(e){d=!0,n=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(d)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r=0;a--)(n=e[a])&&(l=(o<3?n(l):o>3?n(t,r,l):n(t,r))||l);return o>3&&l&&Object.defineProperty(t,r,l),l};let m=(s=class extends i.LitElement{constructor(){super(...arguments),this.min=0,this.max=100,this.lower=0,this.upper=100,this.step=1,this.disabled=!1,this.showValues=!1,this.deferUpdates=!1}get changingLower(){var e;return this._changingLower==this.min?this.min:null===(e=this._changingLower)||void 0===e?void 0:e.toFixed(this.decimalsCount)}get changingUpper(){var e;return this._changingUpper==this.max?this.max:null===(e=this._changingUpper)||void 0===e?void 0:e.toFixed(this.decimalsCount)}get decimalsCount(){const e=this.step.toString().split(".");return 2===e.length?e[1].length:0}connectedCallback(){super.connectedCallback(),this._changingLower=this.lower,this._changingUpper=this.upper}firstUpdated(e){super.firstUpdated(e),this.fromSlider.value=this.lower.toString(),this.toSlider.value=this.upper.toString(),this.fillSlider(this.fromSlider,this.toSlider)}onSubmitChange(e){const t=e.currentTarget.elements,r=t.item(0),i=t.item(1);e.target===r?this.controlFromSlider(r,i):this.controlToSlider(r,i);var n=f(this.getParsed(r,i),2);this._changingLower=n[0],this._changingUpper=n[1],("input"===e.type&&!this.deferUpdates||"change"===e.type)&&this.dispatchEvent(new CustomEvent("range-change",{detail:{lower:r.value,upper:i.value},bubbles:!0}))}getParsed(e,t){return[parseFloat(e.value),parseFloat(t.value)]}fillSlider(e,t){const r=Number(t.max),i=Number(t.min),n=r-i,o=Number(e.value)-i,l=Number(t.value)-i;t.style.background=`linear-gradient(\n to right,\n var(--bs-disabled-color) 0%,\n var(--bs-disabled-color) ${o/n*100}%,\n var(--slider-color) ${o/n*100}%,\n var(--slider-color) ${l/n*100}%, \n var(--bs-disabled-color) ${l/n*100}%, \n var(--bs-disabled-color) 100%)`,this.fromThumb.style.left=`calc(${o/n*100}% - calc(var(--thumb-size) * ${o/n}))`,this.toThumb.style.left=`calc(${l/n*100}% - calc(var(--thumb-size) * ${l/n}))`}controlFromSlider(e,t){const r=f(this.getParsed(e,t),2),i=r[0],n=r[1];i>n&&(e.value=n.toString()),this.fillSlider(e,t)}controlToSlider(e,t){const r=f(this.getParsed(e,t),2),i=r[0],n=r[1];this.setToggleAccessible(t),t.value=i<=n?n.toString():i.toString(),this.fillSlider(e,t)}setToggleAccessible(e){Number(e.value)<=0?e.style.zIndex="2":e.style.zIndex="0"}renderTrickToKeepSpace(){return(0,i.html)(d||(d=h``),this.changingLower,this.changingUpper)}render(){return(0,i.html)(c||(c=h` ${0}
${0}${0} ${0}${0}
`),this.showValues?this.renderTrickToKeepSpace():i.nothing,this.onSubmitChange,this.deferUpdates?this.onSubmitChange:null,this.lower.toString(),this.min,this.max,this.step,this.disabled,this.showValues?(0,i.html)(u||(u=h``),this.changingLower):i.nothing,(0,o.classMap)({"text-muted":this.disabled}),l.dragIndicatorIcon,this.upper.toString(),this.min,this.max,this.step,this.disabled,this.showValues?(0,i.html)(p||(p=h``),this.changingUpper):i.nothing,(0,o.classMap)({"text-muted":this.disabled}),l.dragIndicatorIcon)}},s.styles=(0,i.unsafeCSS)(a.A),s);v([(0,n.property)({type:Number})],m.prototype,"min",void 0),v([(0,n.property)({type:Number})],m.prototype,"max",void 0),v([(0,n.property)({type:Number})],m.prototype,"lower",void 0),v([(0,n.property)({type:Number})],m.prototype,"upper",void 0),v([(0,n.property)({type:Number})],m.prototype,"step",void 0),v([(0,n.property)({type:Boolean})],m.prototype,"disabled",void 0),v([(0,n.property)({type:Boolean})],m.prototype,"showValues",void 0),v([(0,n.property)({type:Boolean})],m.prototype,"deferUpdates",void 0),v([(0,n.state)()],m.prototype,"_changingLower",void 0),v([(0,n.state)()],m.prototype,"_changingUpper",void 0),v([(0,n.query)("#fromSlider")],m.prototype,"fromSlider",void 0),v([(0,n.query)("#toSlider")],m.prototype,"toSlider",void 0),v([(0,n.query)("#fromThumb")],m.prototype,"fromThumb",void 0),v([(0,n.query)("#toThumb")],m.prototype,"toThumb",void 0),m=v([(0,n.customElement)("dual-range-input")],m)},88243:(e,t,r)=>{r.d(t,{R:()=>b});var i=r(48704),n=r(16645),o=r(96987),l=r(71012),a=r(72121);let s,d,c,u,p,h,f=e=>e;var b,v=function(e,t,r,i){var n,o=arguments.length,l=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(l=(o<3?n(l):o>3?n(t,r,l):n(t,r))||l);return o>3&&l&&Object.defineProperty(t,r,l),l};!function(e){e.RADIO="radio",e.LIST="list"}(b||(b={}));let m=class extends l.D{constructor(){super(...arguments),this.disabled=!1}createRenderRoot(){return this}renderLabel(e){return e?(0,i.html)(s||(s=f``),e):i.nothing}renderOptionRow(e,t){return(0,i.html)(d||(d=f`
`),this.filter.subtype===b.LIST?(0,i.html)(c||(c=f``),e.option,t,e.option,!!e.selected,this.disabled):i.nothing,this.filter.subtype===b.RADIO?(0,i.html)(u||(u=f` `),e.option,t,e.option,!!e.selected,this.disabled):i.nothing,e.label,"number"==typeof e.count?(0,i.html)(p||(p=f`
${0}
`),o.w9.humanizeCount(e.count)):i.nothing)}render(){var e;if(null!==(e=this.filter)&&void 0!==e&&null!==(e=e.presets)&&void 0!==e&&e.length)return(0,i.html)(h||(h=f` ${0}
${0}
`),(0,i.unsafeCSS)(a.A),this.renderLabel(this.filter.label),this.filter.presets.map((e=>this.renderOptionRow(e,this.filter.name))))}};v([(0,n.property)({type:Object})],m.prototype,"filter",void 0),v([(0,n.property)({type:Boolean})],m.prototype,"disabled",void 0),m=v([(0,n.customElement)("presets-filter")],m)},47031:(e,t,r)=>{r.d(t,{RJ:()=>W,q4:()=>H});var i=r(48704),n=r(16645),o=r(62832),l=r(85200),a=r(71012),s=(r(46156),r(53519)),d=r.n(s),c=r(96987),u=r(20025);let p,h,f=e=>e;function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function v(e){for(var t=1;t=0;a--)(n=e[a])&&(l=(o<3?n(l):o>3?n(t,r,l):n(t,r))||l);return o>3&&l&&Object.defineProperty(t,r,l),l};let g=class extends a.D{constructor(){super(...arguments),this.disabled=!1,this.dispatchChange=d()((()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))}),500)}renderLabel(e){return e?(0,i.html)(p||(p=f``),e):i.nothing}handleRangeChange(e){e.stopPropagation();const t=e.currentTarget,r=new Date(t.value);if(this.filter&&!isNaN(r.getTime())){var i,n;const e=c.w9.dateToTimestamp(t.value)/1e3,r="end"===t.name?e:null===(i=this.filter.values)||void 0===i?void 0:i.end,o="start"===t.name?e:null===(n=this.filter.values)||void 0===n?void 0:n.start;this.filter=v(v({},this.filter),{},{values:v(v({},r?{end:r}:{}),o?{start:o}:{})}),this.dispatchChange()}}render(){var e,t;if(this.filter)return(0,i.html)(h||(h=f` ${0}
-
`),(0,i.unsafeCSS)(u.A),this.renderLabel(this.filter.label),this.disabled,c.w9.parseDateShortFormat(null===(e=this.filter.values)||void 0===e?void 0:e.start)||"",this.handleRangeChange.bind(this),this.disabled,c.w9.parseDateShortFormat(null===(t=this.filter.values)||void 0===t?void 0:t.end)||"",this.handleRangeChange.bind(this))}};y([(0,n.property)({type:Object})],g.prototype,"filter",void 0),y([(0,n.property)({type:Boolean})],g.prototype,"disabled",void 0),g=y([(0,n.customElement)("date-filter")],g);r(68743),r(88243);var $=r(60807);let w,S,O,k,j=e=>e;var D=function(e,t,r,i){var n,o=arguments.length,l=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(l=(o<3?n(l):o>3?n(t,r,l):n(t,r))||l);return o>3&&l&&Object.defineProperty(t,r,l),l};let R=class extends a.D{constructor(){super(...arguments),this.disabled=!1}createRenderRoot(){return this}renderLabel(e){return e?(0,i.html)(w||(w=j``),e):i.nothing}renderOptionRow(e,t){return(0,i.html)(S||(S=j`
`),e.option,t,e.option,!!e.selected,this.disabled,e.label,"number"==typeof e.count?(0,i.html)(O||(O=j`
${0}
`),c.w9.humanizeCount(e.count)):i.nothing)}render(){var e;if(null!==(e=this.filter)&&void 0!==e&&null!==(e=e.options)&&void 0!==e&&e.length)return(0,i.html)(k||(k=j` ${0}
${0}
`),(0,i.unsafeCSS)($.A),this.renderLabel(this.filter.label),this.filter.options.map((e=>this.renderOptionRow(e,this.filter.name))))}};D([(0,n.property)({type:Object})],R.prototype,"filter",void 0),D([(0,n.property)({type:Boolean})],R.prototype,"disabled",void 0),R=D([(0,n.customElement)("radio-filter")],R);var E=r(80280);let A,P,x,T,F,C,L,I,U,N,z,_=e=>e;function B(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return q(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==r.return||r.return()}finally{if(a)throw o}}}}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r=0;a--)(n=e[a])&&(l=(o<3?n(l):o>3?n(t,r,l):n(t,r))||l);return o>3&&l&&Object.defineProperty(t,r,l),l};!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.LIST=1]="LIST",e[e.DATE=2]="DATE",e[e.QUERY=3]="QUERY",e[e.RADIO=4]="RADIO",e[e.SLIDER=5]="SLIDER",e[e.PRESETS=6]="PRESETS"}(W||(W={}));let G=(A=class extends a.D{constructor(){super(...arguments),this.data=[],this.localData=[],this.disabled=!1,this.noCleareable=!1,this.loading=!1}willUpdate(e){e.has("data")&&this.data&&this.data.length>0&&(!this.localData.length||this.data.filter((e=>[W.DATE,W.RADIO].includes(e.style))).length>0)&&(this.localData=this.data)}renderLabel(e){return e?(0,i.html)(P||(P=_``),e):i.nothing}renderQueryField(e){return(0,i.html)(x||(x=_`${0} `),this.renderLabel(e.label),e.name,(0,l.ifDefined)(e.placeholder),this.disabled,(e=>{"Enter"===e.key&&this.submitForm()}))}renderDateField(e){return(0,i.html)(T||(T=_``),this.disabled,e)}renderListField(e){var t;return null!==(t=e.options)&&void 0!==t&&t.length?(0,i.html)(F||(F=_``),e,this.disabled,7):i.nothing}renderRadioField(e){var t;return null!==(t=e.options)&&void 0!==t&&t.length?(0,i.html)(C||(C=_``),this.disabled,e):i.nothing}renderPresetsField(e){var t;return null!==(t=e.presets)&&void 0!==t&&t.length?(0,i.html)(L||(L=_``),this.disabled,e):i.nothing}renderSliderField(e){var t,r,n,o,l=this;const a=null!==(t=null===(r=e.values)||void 0===r?void 0:r.start)&&void 0!==t?t:e.float_range.start,s=null!==(n=null===(o=e.values)||void 0===o?void 0:o.end)&&void 0!==n?n:e.float_range.end;return(0,i.html)(I||(I=_`
${0}
`),this.renderLabel(e.label),!0,!0,this.disabled,function(){var t=Y((function*(t){l.updateFiltersData(M(M({},e),{},{values:{start:t.detail.lower,end:t.detail.upper}})),l.requestUpdate(),yield l.updateComplete,l.submitForm()}));return function(e){return t.apply(this,arguments)}}(),e.float_range.start,e.float_range.end,a,s,.1)}renderFilter(e){var t;if(null===(t=this.hiddenFilters)||void 0===t||!t.includes(e.name))switch(e.style){case W.QUERY:return this.renderQueryField(e);case W.DATE:return this.renderDateField(e);case W.LIST:return this.renderListField(e);case W.RADIO:return this.renderRadioField(e);case W.SLIDER:return this.renderSliderField(e);case W.PRESETS:return this.renderPresetsField(e)}}submitForm(){const e={},t=new FormData(this.form);var r,i=B(t.keys());try{for(i.s();!(r=i.n()).done;){const i=r.value,n=t.getAll(i).filter((e=>!!e));0!==n.length&&(e[i]=n.map((e=>e.toString())))}}catch(e){i.e(e)}finally{i.f()}const n=this.data.filter((e=>{const t=e.options;if(!t)return;return!!t.find((e=>e.name))})).map((e=>{const t=e.options.find((e=>e.name));return[e.name,t.name]})),o={};this.localData.filter((e=>(e.style===W.SLIDER||e.style===W.DATE)&&!!e.values)).forEach((e=>{var t,r,i,n;o[e.name]=[...null!==(t=e.values)&&void 0!==t&&t.start?[`${null===(r=e.values)||void 0===r?void 0:r.start}+`]:[],...null!==(i=e.values)&&void 0!==i&&i.end?[`${null===(n=e.values)||void 0===n?void 0:n.end}-`]:[]]})),this.dispatchEvent(new H(e,n,o))}reset(){var e;null===(e=this.form)||void 0===e||e.reset(),this.localData.forEach((e=>{var t;e.style!==W.SLIDER&&e.style!==W.DATE||(e.values=void 0),e.style===W.LIST&&(null===(t=e.options)||void 0===t||t.forEach((e=>{e.selected=!1})))})),this.dispatchEvent(new X)}updateFiltersData(e){e&&(this.localData=this.localData.map((t=>t.name===e.name?e:t)))}render(){var e=this;return(0,i.html)(U||(U=_`
Filters ${0}
${0} ${0}
`),function(){var t=Y((function*(t){const r=t.target.filter;e.updateFiltersData(r),yield e.updateComplete,e.submitForm()}));return function(e){return t.apply(this,arguments)}}(),(e=>{e.stopPropagation(),e.preventDefault()}),this.noCleareable?i.nothing:(0,i.html)(N||(N=_`Clear All`),(0,o.classMap)({"text-muted":this.disabled,"pe-none":this.disabled}),(()=>this.reset())),this.loading?i.nothing:this.localData.map(this.renderFilter.bind(this)),this.loading?(0,i.html)(z||(z=_`
`)):i.nothing)}},A.styles=(0,i.unsafeCSS)(E.A),A);J([(0,n.property)({type:Array})],G.prototype,"data",void 0),J([(0,n.state)()],G.prototype,"localData",void 0),J([(0,n.property)({type:Array})],G.prototype,"hiddenFilters",void 0),J([(0,n.property)({type:Boolean})],G.prototype,"disabled",void 0),J([(0,n.property)({type:Boolean})],G.prototype,"noCleareable",void 0),J([(0,n.query)("form#filtersForm")],G.prototype,"form",void 0),J([(0,n.property)({type:Boolean})],G.prototype,"loading",void 0),G=J([(0,n.customElement)("dynamic-filters")],G);class H extends CustomEvent{constructor(e){super("filters-changed-event",{detail:{filters:e,groups:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],andFilters:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},bubbles:!0,composed:!0})}}class X extends CustomEvent{constructor(){super("reset-filters-clicked",{bubbles:!0,composed:!0})}}},5644:(e,t,r)=>{var i=r(89547),n=r.n(i),o=r(38532),l=r.n(o),a=r(88869),s=l()(n());s.i(a.A),s.push([e.id,":host{--thumb-size: 20px;--track-height: 4px;--slider-color: var(--bs-border-color);display:inline-block}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;pointer-events:all;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--slider-color);border-radius:50%;cursor:pointer}input[type=range]::-moz-range-thumb{-webkit-appearance:none;pointer-events:all;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--slider-color);border-radius:50%;cursor:pointer}input[type=range]{-webkit-appearance:none;appearance:none;height:2px;width:100%;background-color:var(--bs-disabled-color);pointer-events:none;height:var(--track-height)}#fromSlider{background-color:rgba(0,0,0,0);z-index:1}.thumb{z-index:1;height:var(--thumb-size);width:var(--thumb-size);transform:translateY(calc(-50% + var(--track-height) / 2));pointer-events:none;background-color:var(--slider-color);border-radius:50%}",""]),t.A=s},20025:(e,t,r)=>{var i=r(89547),n=r.n(i),o=r(38532),l=r.n(o),a=r(88869),s=l()(n());s.i(a.A),s.push([e.id,"",""]),t.A=s},72121:(e,t,r)=>{var i=r(89547),n=r.n(i),o=r(38532),l=r.n(o),a=r(88869),s=l()(n());s.i(a.A),s.push([e.id,"",""]),t.A=s},60807:(e,t,r)=>{var i=r(89547),n=r.n(i),o=r(38532),l=r.n(o),a=r(88869),s=l()(n());s.i(a.A),s.push([e.id,"",""]),t.A=s},80280:(e,t,r)=>{var i=r(89547),n=r.n(i),o=r(38532),l=r.n(o),a=r(88869),s=l()(n());s.i(a.A),s.push([e.id,":host{display:block}",""]),t.A=s}}]); //# sourceMappingURL=47031.059aa26916e6bb9fe21d.js.map