UNPKG

@europeana/portal

Version:
2 lines 30.3 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[96],{1047:function(t,e){},1048:function(t,e,n){"use strict";n(885)},1049:function(t,e,n){var r=n(137)(!1);r.push([t.i,'[class^=icon-][data-v-34be82f6],[class*=" icon-"][data-v-34be82f6]{font-family:"icomoon";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;vertical-align:middle;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-accept[data-v-34be82f6]::before{content:""}.icon-ic-add[data-v-34be82f6]::before{content:""}.icon-arrow-down[data-v-34be82f6]::before{content:""}.icon-back[data-v-34be82f6]::before{content:""}.icon-cancel-circle[data-v-34be82f6]::before{content:""}.icon-caret-down[data-v-34be82f6]::before{content:""}.icon-check-circle[data-v-34be82f6]::before{content:""}.icon-clear[data-v-34be82f6]::before{content:""}.icon-close[data-v-34be82f6]::before{content:""}.icon-ic-download[data-v-34be82f6]::before{content:""}.icon-edit[data-v-34be82f6]::before{content:""}.icon-external-link[data-v-34be82f6]::before{content:""}.icon-facebook[data-v-34be82f6]::before{content:""}.icon-ic-feedback[data-v-34be82f6]::before{content:""}.icon-file[data-v-34be82f6]::before{content:""}.icon-filter[data-v-34be82f6]::before{content:""}.icon-globe[data-v-34be82f6]::before{content:""}.icon-heart[data-v-34be82f6]::before{content:""}.icon-info[data-v-34be82f6]::before{content:""}.icon-info-outline[data-v-34be82f6]::before{content:""}.icon-instagram[data-v-34be82f6]::before{content:""}.icon-language[data-v-34be82f6]::before{content:""}.icon-license[data-v-34be82f6]::before{content:""}.icon-link[data-v-34be82f6]::before{content:""}.icon-linkedin[data-v-34be82f6]::before{content:""}.icon-pinterest[data-v-34be82f6]::before{content:""}.icon-push-pin[data-v-34be82f6]::before{content:""}.icon-reject[data-v-34be82f6]::before{content:""}.icon-search[data-v-34be82f6]::before{content:""}.icon-share[data-v-34be82f6]::before{content:""}.icon-ic-tag[data-v-34be82f6]::before{content:""}.icon-temporary-tag[data-v-34be82f6]::before{content:""}.icon-translate[data-v-34be82f6]::before{content:""}.icon-twitter[data-v-34be82f6]::before{content:""}.icon-3d[data-v-34be82f6]::before{content:""}.icon-sound[data-v-34be82f6]::before{content:""}.icon-text[data-v-34be82f6]::before{content:""}.icon-image[data-v-34be82f6]::before{content:""}.icon-video[data-v-34be82f6]::before{content:""}.icon-unavailable[data-v-34be82f6]::before{content:""}.icon-ic-move-vert[data-v-34be82f6]::before{content:""}.icon-ic-move-xy[data-v-34be82f6]::before{content:""}.icon-menu[data-v-34be82f6]::before{content:""}.filters-title[data-v-34be82f6]{font-size:.875rem;font-weight:600;line-height:1;margin:1.25rem 1rem}.col-filters[data-v-34be82f6]{flex-grow:0;padding:0;margin-top:-1rem}@media(max-width: 991px){.col-filters[data-v-34be82f6]{display:flex;position:fixed;right:0;top:0;bottom:0;padding-top:1rem;transition:right 300ms ease-in-out;z-index:1050;max-width:none;overflow:hidden}.col-filters .side-filters[data-v-34be82f6]{flex-shrink:0;margin-right:-320px;overflow-y:auto;width:320px;max-width:75vw;animation:appear-data-v-34be82f6 300ms ease-in-out;transition:margin-right 300ms ease-in-out}@keyframes appear-data-v-34be82f6{from{margin-right:-320px}to{margin-right:0}}.col-filters.hide[data-v-34be82f6]{display:none}.col-filters.open[data-v-34be82f6]{left:0}.col-filters.open .side-filters[data-v-34be82f6]{margin-right:0}.col-filters.open .filters-backdrop[data-v-34be82f6]{content:"";width:100%;height:100%;background-color:rgba(0,0,0,.7)}}@media(min-width: 992px){.col-filters[data-v-34be82f6]{max-width:320px;min-width:220px;min-height:31rem}.col-filters[data-v-34be82f6]::after{border-top:145px solid #fff;border-left:60px solid transparent;content:"";display:block;height:0;position:absolute;right:0;top:100%;width:0;z-index:1}.col-filters .filters-backdrop[data-v-34be82f6]{display:none}}.col-filters .side-filters[data-v-34be82f6]{background-color:#fff;height:100%}@media(min-width: 992px){.col-filters .icon-clear[data-v-34be82f6]{display:none}}.form-group[data-v-34be82f6]{margin-bottom:1.5rem}',""]),t.exports=r},1124:function(t,e,n){"use strict";n.r(e);n(16),n(15),n(19),n(20),n(41),n(68),n(64),n(71);var r=n(2),o=(n(10),n(43),n(46),n(21),n(81),n(52),n(13),n(47),n(34),n(80),n(30),n(58),n(62),n(250),n(111),n(50),n(14),n(176)),c=n.n(o),l=n(1024),f=n.n(l),h=n(108),d=n(158),v=n(204),m=n(23),y=(n(75),n(315),n(37),n(139),{name:"ColourSwatch",props:{hexCode:{type:String,default:""}}}),F=n(59),O=Object(F.a)(y,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"colour-palette",style:"backgroundColor: "+t.hexCode,attrs:{"data-qa":"colour swatch "+t.hexCode}})}),[],!1,null,null,null).exports,S=n(1118),w=n(1046),_=n(31),A=n(884);function C(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return T(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}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,c=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){l=!0,o=t},f:function(){try{c||null==n.return||n.return()}finally{if(l)throw o}}}}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function E(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function $(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?E(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):E(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var P={name:"SideFacetDropdown",components:{BFormTags:S.a,BFormTag:w.a,ColourSwatch:O,AlertMessage:function(){return n.e(12).then(n.bind(null,727))},LoadingSpinner:function(){return n.e(5).then(n.bind(null,729))}},mixins:[A.a],props:{name:{type:String,required:!0},selected:{type:[Array,String],default:function(){return[]}},type:{type:String,required:!0},staticFields:{type:Array,default:null},search:{type:Boolean,default:!1},groupBy:{type:Array,default:null}},data:function(){return{searchFacet:"",RADIO:"radio",CHECKBOX:"checkbox",MAXIMUM_VALUES_DISPLAY_COUNT:50,MAXIMUM_VALUES_RETRIEVAL_COUNT:125e3,preSelected:null,fetched:!!this.staticFields,fields:this.staticFields||[],selectedOptions:this.selected||[],activeSearchInput:!1,mayFetch:!1,fetching:!1}},fetch:function(){var t=this;return this.staticFields?(this.fields=this.staticFields,this.fetched=!0,Promise.resolve()):!this.mayFetch||this.fetching?Promise.resolve():(this.fetching=!0,this.queryFacet().then((function(e){t.fetching=!1,t.fields=e||[],t.fetched=!0})))},computed:$({searchable:function(){return this.search&&this.fields.length>0},selectedFilters:function(){return Object(r.a)({},this.name,[].concat(this.selected))},groupedOptions:function(){if(!this.groupBy)return this.fields;var t,e=this.groupBy.map((function(t){return{label:"*".concat(t,"*"),substring:t,count:0}})),n=C(this.fields);try{var r=function(){var n=t.value,r=e.find((function(t){return n.label.includes(t.substring)}));r?r.count=r.count+n.count:e.push(n)};for(n.s();!(t=n.n()).done;)r()}catch(t){n.e(t)}finally{n.f()}return e.filter((function(t){return t.count>0})).map((function(t){return{label:t.label,count:t.count}}))},sortedOptions:function(){var t=this;if(this.isRadio)return this.fields.slice(0).sort((function(a,b){return t.tFacetOption(t.name,a).localeCompare(t.tFacetOption(t.name,b))}));var e=this.groupedOptions,n=function(a,b){return b.count-a.count},r=e.filter((function(e){return t.selected.includes(e.label)})).sort(n),o=e.filter((function(e){return!t.selected.includes(e.label)})).sort(n);return r.concat(o)},availableSortedOptions:function(){var t=this;if(!this.fetched)return[];var e=this.criteria,n=this.selectedOptions.map((function(option){return Object(_.k)(option.replace(/^"(.*)"$/,"$1"))})),r=this.sortedOptions.filter((function(option){return-1===n.indexOf(t.isRadio?option:option.label)}));return e?r.filter((function(option){var n=t.isRadio?option:option.label,r=t.tFacetOption(t.name,n).toLowerCase().indexOf(e)>-1,o=n.toLowerCase().indexOf(e)>-1;return r||o})):r},availableSortedDisplayableOptions:function(){return this.search&&this.availableSortedOptions.length>this.MAXIMUM_VALUES_DISPLAY_COUNT?this.availableSortedOptions.slice(0,this.MAXIMUM_VALUES_DISPLAY_COUNT):this.availableSortedOptions},truncated:function(){return this.search&&this.availableSortedOptions.length-this.MAXIMUM_VALUES_DISPLAY_COUNT>=0},truncatedAmount:function(){return this.truncated?this.availableSortedOptions.length-this.MAXIMUM_VALUES_DISPLAY_COUNT:0},isColourPalette:function(){return"COLOURPALETTE"===this.name},facetName:function(){return this.tFacetName(this.name)},facetNameNoSpaces:function(){return this.tFacetName(this.name).replace(/\s/g,"-").toLowerCase()},isRadio:function(){return this.type===this.RADIO},collection:function(){return this.$store.getters["search/collection"]},theme:function(){var t=this;return v.a.find((function(e){return e.qf===t.collection}))},moreOptionsName:function(){return this.tFacetKey(this.name,"moreName")},themeSpecificFieldLabelPattern:function(){var t,e,n=this;return null===(t=((null===(e=this.theme)||void 0===e?void 0:e.facets)||[]).find((function(t){return t.field===n.name})))||void 0===t?void 0:t.label},paramsForFacets:function(){var t=$($({},this.apiParams),{},{rows:0,profile:"facets",facet:this.name});return this.search&&(t["f.".concat(this.name,".facet.limit")]=this.MAXIMUM_VALUES_RETRIEVAL_COUNT),t},criteria:function(){return this.searchFacet.trim().toLowerCase()},activeLabel:function(){return this.selectedFilters[this.name].length>0||this.activeSearchInput}},Object(h.c)({apiOptions:function(t){return t.search.apiOptions},apiParams:function(t){return t.search.apiParams}})),watch:{selected:function(){this.init()},"$route.query.reusability":"refetch","$route.query.api":"refetch","$route.query.query":"refetch","$route.query.qf":"refetch"},mounted:function(){this.init()},methods:{queryFacet:function(){var t=this;return this.$apis.record.search(this.paramsForFacets,$($({},this.apiOptions),{},{locale:this.$i18n.locale})).then((function(t){var e,n;return(null===(e=t.facets)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.fields)||[]})).then((function(e){return t.filterFacetFields(e)})).catch(function(){var e=Object(m.a)(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("search/updateForFailure",n);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},filterFacetFields:function(t){var e=this;return"REUSABILITY"===this.name?t=t.filter((function(t){return"uncategorized"!==t.label})):"contentTier"===this.name&&(t=this.filterContentTierFields(t)),this.themeSpecificFieldLabelPattern&&(t=t.filter((function(t){return e.themeSpecificFieldLabelPattern.test(t.label)}))),t},filterContentTierFields:function(t){var e=["0"];return this.collection?e=["2","3","4"]:this.$store.getters["entity/id"]&&(e=this.$store.getters["entity/id"].includes("/organization/")?null:["1","2","3","4"]),e&&(t=t.filter((function(t){return e.includes(t.label)}))),t},enquoteFacetFieldFilterValue:function(t){return d.e.includes(this.name)||this.groupBy?t:'"'.concat(Object(_.e)(t),'"')},refetch:function(){var t=this;this.$nextTick((function(){t.fetched=!1,t.$fetch()}))},prefetch:function(){var t=this;return this.fetched?Promise.resolve():(this.mayFetch=!0,this.$fetch().then((function(){t.mayFetch=!1})))},init:function(){this.isRadio&&Array.isArray(this.selected)?this.preSelected=this.selected[0]:this.preSelected=this.selected,this.selectedOptions=this.selected||[]},removeOption:function(t){var e=t.tag;(0,t.removeTag)(e),this.$emit("changed",this.name,this.selected.filter((function(t){return t!==e})))},selectOption:function(t){var option=t.option,e=t.addTag,n=t.removeTag;this.isRadio&&1===this.selectedOptions.length&&n(this.selectedOptions[0]);var r=this.isRadio?option:option.label;e(r),this.searchFacet="",this.$emit("changed",this.name,this.isRadio?r:this.selected.concat(this.enquoteFacetFieldFilterValue(r)))},shownDropdown:function(){this.searchable&&this.setSearchFocus()},setSearchFocus:function(){this.$refs["search-input"].focus()},resetDropdown:function(){this.searchFacet="",this.$refs.dropdown.$refs.menu.scrollTop=0,this.mayFetch=!1}}},x=P,k=n(1047),R=n.n(k),j=Object(F.a)(x,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("b-form-tags",{staticClass:"side-filter-autosuggest",attrs:{id:t.facetNameNoSpaces,"no-outer-focus":"",limit:t.isRadio?1:null},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.tags,o=e.addTag,c=e.removeTag;return[n("label",{staticClass:"facet-label",class:{"facet-label-active":t.activeLabel}},[t._v("\n "+t._s(t.facetName)+"\n ")]),t._v(" "),t.$fetchState.error?n("b-container",[n("AlertMessage",{attrs:{error:t.$fetchState.error.message}})],1):[r.length>0?n("ul",t._l(r,(function(e){return n("li",{key:e,staticClass:"list-inline-item mw-100"},[n("b-form-tag",{staticClass:"remove-button",attrs:{"data-qa":"filter badge",pill:"",variant:"primary-light"},on:{remove:function(n){return t.removeOption({tag:e,removeTag:c})}}},[n("span",[t._v("\n "+t._s(t.tFacetOption(t.name,e,!0))+"\n ")])])],1)})),0):t._e(),t._v(" "),n("b-dropdown",{ref:"dropdown",attrs:{block:"","no-flip":"","data-qa":t.name+" side facet dropdown button"},on:{show:t.prefetch,shown:t.shownDropdown,hidden:t.resetDropdown},nativeOn:{mouseover:function(e){return t.prefetch.apply(null,arguments)},focusin:function(e){return t.prefetch.apply(null,arguments)}},scopedSlots:t._u([{key:"button-content",fn:function(){return[n("span",{staticClass:"select-label"},[t._v("\n "+t._s(t.tFacetKey(t.name,"select"))+"\n ")])]},proxy:!0}],null,!0)},[t._v(" "),t.searchable?[n("b-dropdown-form",{on:{submit:function(t){return t.stopPropagation(),t.preventDefault(),function(){}.apply(null,arguments)}}},[n("b-form-group",{attrs:{"label-for":t.facetNameNoSpaces+"-search-input"}},[n("b-form-input",{ref:"search-input",attrs:{id:t.facetNameNoSpaces+"-search-input",type:"text",autocomplete:"off",placeholder:t.$t("sideFilters.search"),"data-qa":"side facet dropdown search input"},on:{input:function(e){t.activeSearchInput=!0},blur:function(e){t.activeSearchInput=!1}},model:{value:t.searchFacet,callback:function(e){t.searchFacet=e},expression:"searchFacet"}}),t._v(" "),n("span",{staticClass:"icon-search"})],1)],1)]:t._e(),t._v(" "),t._l(t.availableSortedDisplayableOptions,(function(option,e){return n("b-dropdown-item-button",{key:e,attrs:{"data-qa":(t.isRadio?option:option.label)+" "+t.name+" field"},on:{click:function(e){return t.selectOption({option:option,addTag:o,removeTag:c})}}},[t.isRadio?n("span",[t._v("\n "+t._s(t.tFacetOption(t.name,option))+"\n ")]):[t.isColourPalette?n("ColourSwatch",{attrs:{"hex-code":option.label}}):t._e(),t._v(" "),n("span",[t._v("\n "+t._s(t.tFacetOption(t.name,option.label))+"\n ")]),t._v(" "),n("span",[t._v("("+t._s(t._f("localise")(option.count))+")")])]],2)})),t._v(" "),t.truncated?[n("b-dropdown-divider"),t._v(" "),n("b-dropdown-item-button",{staticClass:"more-facet-values-button",attrs:{"data-qa":"more facet values available button"},nativeOn:{"!click":function(e){return e.stopPropagation(),t.setSearchFocus.apply(null,arguments)}}},[n("i18n",{attrs:{path:"facets.moreOptions",tag:"span"}},[n("span",{staticClass:"font-weight-bold"},[t._v("\n "+t._s(t._f("localise")(t.truncatedAmount))+"\n ")]),t._v("\n "+t._s(t.moreOptionsName))])],1)]:t._e(),t._v(" "),t.$fetchState.pending?n("b-dropdown-text",{staticClass:"text-center"},[n("LoadingSpinner")],1):t.fetched&&0===t.availableSortedDisplayableOptions.length?n("b-dropdown-text",[t._v("\n "+t._s(t.$t("sideFilters.noOptions"))+"\n ")]):t._e()],2)]]}}]),model:{value:t.selectedOptions,callback:function(e){t.selectedOptions=e},expression:"selectedOptions"}})],1)}),[],!1,null,null,null);"function"==typeof R.a&&R()(j);var D=j.exports;function I(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}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,c=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){l=!0,o=t},f:function(){try{c||null==n.return||n.return()}finally{if(l)throw o}}}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function U(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function N(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?U(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):U(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var M={name:"SideFilters",components:{ClientOnly:c.a,SideFacetDropdown:D,SideDateFilter:function(){return n.e(111).then(n.bind(null,1188))},SideSwitchFilter:function(){return Promise.all([n.e(19),n.e(101)]).then(n.bind(null,1189))}},props:{route:{type:Object,default:function(){return{name:"search"}}}},data:function(){return{DEFAULT_FACET_NAMES:["TYPE","REUSABILITY","COUNTRY","LANGUAGE","PROVIDER","DATA_PROVIDER","COLOURPALETTE","IMAGE_ASPECTRATIO","IMAGE_SIZE","MIME_TYPE","RIGHTS","contentTier"],SEARCHABLE_FACETS:["COUNTRY","LANGUAGE","PROVIDER","DATA_PROVIDER","COLOURPALETTE","MIME_TYPE","CREATOR","proxy_dc_type.en","proxy_dc_format.en","proxy_dcterms_medium.en"],hideFilterSheet:!0}},computed:N(N(N({},Object(h.c)({collectionFacetEnabled:function(t){return t.search.collectionFacetEnabled},showFiltersSheet:function(t){return t.search.showFiltersSheet},totalResults:function(t){return t.search.totalResults},userParams:function(t){return t.search.userParams}})),Object(h.b)({collection:"search/collection"})),{},{filters:function(){var t,e,n,r=Object(d.b)(null===(t=this.$store.state.search.userParams)||void 0===t?void 0:t.qf);return null!==(e=this.$store.state.search.userParams)&&void 0!==e&&e.reusability&&(r.REUSABILITY=this.$store.state.search.userParams.reusability.split(",")),null!==(n=this.$store.state.search.apiParams)&&void 0!==n&&n.api&&(r.api=this.$store.state.search.apiParams.api),r},resettableFilters:function(){var t=this,e=this.filterableFacets.map((function(t){return t.name})).filter((function(e){return t.filters[e]}));return this.contentTierFacetSwitch&&this.filters.contentTier&&e.push("contentTier"),this.enableApiFilter&&this.filters.api!==this.apiFilterDefaultValue&&e.push("api"),this.enableDateFilter&&this.filters[this.dateFilterField]&&e.push(this.dateFilterField),e},theme:function(){var t=this;return v.a.find((function(e){return e.qf===t.collection}))},themeSpecificFacetNames:function(){var t;return((null===(t=this.theme)||void 0===t?void 0:t.facets)||[]).map((function(t){return t.field}))},facetNames:function(){return this.themeSpecificFacetNames.concat(this.DEFAULT_FACET_NAMES)},resetButtonDisabled:function(){return this.$store.state.search.liveQueries.length>0},filterableFacets:function(){var t=this,e=this.facetNames.map((function(e){return{name:e,search:t.SEARCHABLE_FACETS.includes(e)}}));return this.collectionFacetEnabled&&e.unshift({name:"collection",staticFields:v.a.map((function(t){return t.qf}))}),this.contentTierFacetSwitch&&(e=e.filter((function(t){return"contentTier"!==t.name}))),e},contentTierFacetSwitch:function(){return!this.$store.getters["search/collection"]&&!this.$store.getters["entity/id"]},boost:function(){return this.userParams.boost},qf:function(){return this.userParams.qf},query:function(){return this.userParams.query},reusability:function(){return this.userParams.reusability},api:function(){return this.userParams.api},view:function(){return this.userParams.view},page:function(){return Number(this.$route.query.page||1)},enableApiFilter:function(){var t,e;return!(null===(t=this.theme)||void 0===t||null===(e=t.filters)||void 0===e||!e.api)},apiFilterDefaultValue:function(){var t,e,n;return(null===(t=this.theme)||void 0===t||null===(e=t.filters)||void 0===e||null===(n=e.api)||void 0===n?void 0:n.default)||null},enableDateFilter:function(){var t,e;return!(null===(t=this.theme)||void 0===t||null===(e=t.filters)||void 0===e||!e.date)},dateFilterField:function(){var t,e,n;return(null===(t=this.theme)||void 0===t||null===(e=t.filters)||void 0===e||null===(n=e.date)||void 0===n?void 0:n.field)||null},dateFilter:function(){var t=this.filters[this.dateFilterField];if(!t||t.length<1)return{start:null,end:null,specific:this.isCheckedSpecificDate};var e=Object(d.c)(t[0]);return e?N(N({},e),{},{specific:!1}):{start:t[0],end:null,specific:!0}},totalResultsLocalised:function(){return this.$options.filters.localise(this.totalResults)}}),watch:{showFiltersSheet:function(t){var e=this;t?this.hideFilterSheet=!1:setTimeout((function(){return e.hideFilterSheet=!0}),300)}},created:function(){this.$store.commit("search/setShowFiltersToggle",!0)},beforeDestroy:function(){this.$store.commit("search/setShowFiltersToggle",!1)},methods:{facetDropdownType:function(t){return"collection"===t||"api"===t?"radio":"checkbox"},changeFacet:function(t,e){void 0===this.filters[t]&&(Array.isArray(e)&&0===e.length||!e)||f()(this.filters[t],e)||this.rerouteSearch(this.queryUpdatesForFacetChanges(Object(r.a)({},t,e)))},queryUpdatesForFacetChanges:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},this.filters);for(var n in t)e[n]=t[n];if(Object.prototype.hasOwnProperty.call(t,"collection")||!this.collection)for(var r in e)"collection"!==r&&!this.DEFAULT_FACET_NAMES.includes(r)&&this.resettableFilters.includes(r)&&(e[r]=[]);return Object.prototype.hasOwnProperty.call(t,"collection")&&Object.prototype.hasOwnProperty.call(e,"contentTier")&&(e.contentTier=[]),this.queryUpdatesForFilters(e)},queryUpdatesForFilters:function(t){var e={qf:[],page:1};for(var n in t)switch(n){case"REUSABILITY":e.reusability=t[n].length>0?t[n].join(","):null;break;case"api":e.api=t[n];break;default:e.qf=e.qf.concat(this.queryUpdatesForFilter(n,t[n]))}return e},queryUpdatesForFilter:function(t,e){return[].concat(e).filter((function(t){return null!=t})).map((function(e){return"".concat(t,":").concat(e)}))},rerouteSearch:function(t){var e=this,n=this.updateCurrentSearchQuery(t);this.$goto(this.$path(N(N({},this.route),{query:n}))),t.qf&&t.qf.forEach((function(filter){return e.$matomo&&e.$matomo.trackEvent("Filters","Filter selected",filter)})),t.reusability&&this.$matomo&&this.$matomo.trackEvent("Filters","Reusability filter selected",t.reusability)},updateCurrentSearchQuery:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={boost:this.boost,page:this.page,qf:this.qf,query:this.query,reusability:this.reusability,view:this.view,api:this.api},n=N(N({},e),t);for(var r in n)null===n[r]&&delete n[r];return n},resetFilters:function(){var t,e=Object.assign({},this.filters),n=I(this.resettableFilters);try{for(n.s();!(t=n.n()).done;){e[t.value]=[]}}catch(t){n.e(t)}finally{n.f()}return this.rerouteSearch(this.queryUpdatesForFilters(e))},hasResettableFilters:function(){return this.resettableFilters.length>0},dateFilterSelected:function(t,e){var n=[];e.specific?e.start&&(n=[e.start]):(e.start||e.end)&&(n=[Object(d.d)(e)]),this.isCheckedSpecificDate=e.specific,this.changeFacet(t,n)},toggleFilterSheet:function(){this.$store.commit("search/setShowFiltersSheet",!this.$store.state.search.showFiltersSheet)},sideFacetDropdownGroupBy:function(t){return"RIGHTS"===t?["/CNE/","/InC-EDU/","/InC-OW-EU/","/InC/","/licenses/by-nc-nd/","/licenses/by-nc-sa/","/licenses/by-nc/","/licenses/by-nd/","/licenses/by-sa/","/licenses/by/","/NoC-NC/","/NoC-OKLR/","/publicdomain/mark/","/publicdomain/zero/","/rights/out-of-copyright-non-commercial/","/rights/rr-f/","/rights/unknown/"]:null}}},B=M,V=(n(1048),Object(F.a)(B,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-col",{staticClass:"col-filters col-3",class:{open:t.showFiltersSheet,hide:t.hideFilterSheet}},[n("div",{staticClass:"filters-backdrop",on:{click:t.toggleFilterSheet}}),t._v(" "),n("b-container",{staticClass:"side-filters",attrs:{"data-qa":"side filters"}},[n("client-only",[n("b-row",{staticClass:"border-bottom border-top d-flex justify-content-between align-items-center flex-nowrap"},[t.totalResults?n("div",{staticClass:"filters-title",attrs:{"data-qa":"total results"}},[t._v("\n "+t._s(t.$tc("items.itemCount",t.totalResultsLocalised,{count:t.totalResultsLocalised}))+"\n "),n("div",{staticClass:"visually-hidden",attrs:{role:"status"}},[t._v("\n "+t._s(t.$t("searchHasLoaded",[t.totalResultsLocalised]))+"\n ")])]):n("h2",{staticClass:"filters-title"},[t._v("\n "+t._s(t.$t("filterResults"))+"\n ")]),t._v(" "),t.hasResettableFilters()?n("button",{staticClass:"btn btn-outline-primary mr-3",attrs:{disabled:t.resetButtonDisabled,"data-qa":"reset filters button"},on:{click:t.resetFilters}},[t._v("\n "+t._s(t.$t("reset"))+"\n ")]):t._e(),t._v(" "),n("b-button",{staticClass:"button-icon-only icon-clear mx-3",attrs:{"data-qa":"close filters button",variant:"light-flat","aria-label":t.$t("header.closeSidebar")},on:{click:t.toggleFilterSheet}})],1),t._v(" "),n("b-row",{staticClass:"mb-3 mt-4"},[n("b-col",{attrs:{"data-qa":"search filters"}},[n("div",{staticClass:"position-relative"},[t.enableApiFilter?n("SideSwitchFilter",{attrs:{value:t.filters.api,name:"api",label:t.$t("facets.api.switch"),tooltip:t.$t("facets.api.switchMoreInfo"),"checked-value":"fulltext","unchecked-value":"metadata","default-value":t.apiFilterDefaultValue},on:{changed:t.changeFacet}}):t._e(),t._v(" "),t.enableDateFilter?n("SideDateFilter",{attrs:{name:t.dateFilterField,start:t.dateFilter.start,end:t.dateFilter.end,specific:t.dateFilter.specific},on:{dateFilter:t.dateFilterSelected}}):t._e(),t._v(" "),t._l(t.filterableFacets,(function(e){return n("SideFacetDropdown",{key:e.name,attrs:{name:e.name,type:t.facetDropdownType(e.name),selected:t.filters[e.name],"static-fields":e.staticFields,search:e.search,"group-by":t.sideFacetDropdownGroupBy(e.name),role:"search","aria-label":e.name},on:{changed:t.changeFacet}})})),t._v(" "),t.contentTierFacetSwitch?n("SideSwitchFilter",{attrs:{value:t.filters.contentTier,name:"contentTier",label:t.$t("facets.contentTier.options.0"),"checked-value":'"0"',"unchecked-value":null,"default-value":null},on:{changed:t.changeFacet}}):t._e()],2)])],1)],1)],1)],1)}),[],!1,null,"34be82f6",null));e.default=V.exports},884:function(t,e,n){"use strict";n(21),n(37),n(30),n(80),n(10),n(52);var r=n(204),o=n(31),c=function(t,e,n){var r=null;return t.$te(e)?r=n(null):t.$i18n.locale!==t.$i18n.fallbackLocale&&t.$te(e,t.$i18n.fallbackLocale)&&(r=n(t.$i18n.fallbackLocale)),r};e.a={methods:{tNull:function(t,e){var n=this;return c(this,t,(function(r){return n.$t(t,r,e)}))},tcNull:function(t,e,n){var r=this;return c(this,t,(function(o){return r.$tc(t,e,o,n)}))},tFacetKey:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.replace(/\..*$/,""),o=this.$store.getters["search/collection"];if(o){var c=this.tcNull("collections.".concat(o,".facets.").concat(r,".").concat(e),n);if(c)return c}var l=this.tcNull("facets.".concat(r,".").concat(e),n);return l||r},tFacetName:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.tFacetKey(t,"name",e)},tFacetOption:function(t,e,n){var c,l,f=this,h=this.$store.getters["search/collection"],d=r.a.find((function(t){return t.qf===h})),v=null===(c=((null==d?void 0:d.facets)||[]).find((function(e){return e.field===t})))||void 0===c?void 0:c.label,m=function(){var r=e;n&&(r=Object(o.k)(r.replace(/^"(.*)"$/,"$1"))),v&&(r=r.replace(v,""));var c="facets.".concat(t,".options.").concat(r);return f.tNull(c)||r};return"MIME_TYPE"===t?(l=m())!==e?l:e.split("/")[1].replace(/^x-/,"").toUpperCase():m()}}}},885:function(t,e,n){var content=n(1049);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(138).default)("65be4708",content,!0,{sourceMap:!1})}}]); //# sourceMappingURL=3161d34.js.map