1import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{C as n,D as r,E as i,Ft as a,Lt as o,S as s,Z as c,j as l,q as u,t as d,ut as f,w as p,x as m}from"./vue.runtime.esm-bundler-CFudVDr2.js";import{t as h}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as g}from"./lodash-B9Vws8nc.js";var _=e(g(),1),v={name:`UsageFilter`,data(){return{maxDisplay:2,ITEM_NAME_CHARACTER_LIMIT:16}},computed:{itemTextAccordingToLanguage(){return this.$i18n.locale===`fr`?`itemTextFR`:`itemTextEN`},hasCommercialFeature(){return this.$store.getters[`global/isFeatureAccessible`](`has-commercial-in-explo`)},usageItems(){let e=[{itemTextFR:this.$t(`mc.filters.collective-housings`),itemTextEN:this.$t(`mc.filters.collective-housings`),itemValue:2},{itemTextFR:this.$t(`mc.filters.students-housings`),itemTextEN:this.$t(`mc.filters.students-housings`),itemValue:21},{itemTextFR:this.$t(`global.office`),itemTextEN:this.$t(`global.office`),itemValue:3},{itemTextFR:this.$t(`mc.single-housing`),itemTextEN:this.$t(`mc.single-housing`),itemValue:1}];return this.hasCommercialFeature&&e.push({itemTextFR:this.$t(`mc.filters.commercial`),itemTextEN:this.$t(`mc.filters.commercial`),itemValue:17}),e},selectedUsages:{get(){let e=this.$store.state.macroComposants.selectedBuildingUseTypes||[];return this.usageItems.filter(t=>e.includes(t.itemValue))},set(e){let t=e.map(e=>e.itemValue);this.$store.commit(`macroComposants/setSelectedBuildingUseTypes`,t)}},isUsageFilterActive:{get(){return this.$store.state.macroComposants.activeFilters[3]},set(e){this.$store.commit(`macroComposants/setActiveFilters`,[3,e])}}},watch:{selectedUsages(e){this.isUsageFilterActive=e.length>0?{itemTextFR:`Usage`,itemTextEN:`Usage`,itemTextDE:`Verwendung`,itemValue:`usage`}:null}},methods:{removeSelection(e){this.selectedUsages=this.selectedUsages.filter(t=>t.itemValue!==e.itemValue)},shortenItemLabel(e){return(0,_.truncate)(e,{length:this.ITEM_NAME_CHARACTER_LIMIT})},shouldShowTooltip(e){return e?.length>this.ITEM_NAME_CHARACTER_LIMIT}}},y=t({default:()=>S});d();var b={class:`usage-filter mb-4`};function x(e,t,d,h,g,_){let v=c(`v-tooltip`),y=c(`v-chip`),x=c(`v-select`);return u(),p(`div`,b,[r(x,{modelValue:_.selectedUsages,"onUpdate:modelValue":t[0]||=e=>_.selectedUsages=e,"item-title":_.itemTextAccordingToLanguage,"item-value":`itemValue`,items:_.usageItems,label:e.$t(`global.usage`),density:`compact`,chips:``,"hide-details":``,variant:`outlined`,"return-object":``,multiple:``,clearable:``,"clear-icon":`mdi-close-circle`,"bg-color":`white`},{selection:f(({item:t,index:c})=>[c<g.maxDisplay?(u(),s(y,{key:0,size:`small`,closable:``,color:`blue_green_1`,class:`text-paragraph-regular-s text-white`,"onClick:close":e=>_.removeSelection(t.raw)},{default:f(()=>[r(v,{location:`bottom`,disabled:!_.shouldShowTooltip(e.$i18n.locale===`fr`?t.raw.itemTextFR:t.raw.itemTextEN)},{activator:f(({props:n})=>[m(`span`,a(l(n)),o(_.shortenItemLabel(e.$i18n.locale===`fr`?t.raw.itemTextFR:t.raw.itemTextEN)),17)]),default:f(()=>[m(`span`,null,o(e.$i18n.locale===`fr`?t.raw.itemTextFR:t.raw.itemTextEN),1)]),_:2},1032,[`disabled`])]),_:2},1032,[`onClick:close`])):n(``,!0),c===g.maxDisplay?(u(),s(y,{key:1,size:`small`,color:`blue_green_1`,class:`text-white text-caption`},{default:f(()=>[i(` +`+o(_.selectedUsages.length-g.maxDisplay),1)]),_:1})):n(``,!0)]),_:1},8,[`modelValue`,`item-title`,`items`,`label`])])}var S=h(v,[[`render`,x]]);export{y as n,S as t};
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.