1"use strict";(self.webpackChunkproteuspartners=self.webpackChunkproteuspartners||[]).push([[553],{1553:function(t,e,n){n.r(e),n.d(e,{default:function(){return a}});var r={name:"DownloadList",props:{postId:{type:String,default:void 0},postType:{type:String,default:void 0},label:{type:String,default:void 0}},data:function(){return{currentArrayKey:[],downloadsArrays:[],hasError:!1,isLoaded:!1,options:[],selectedOption:0}},mounted:function(){this.getDownloads()},methods:{createOptions:function(){var t=this;this.downloadsArrays.forEach(function(e,n){t.options.push({id:n,name:e.name,value:t.handleifyString(e.name)})})},getDownloads:function(){var t=this;axios.get("/wp-json/wp/v2/".concat(this.postType,"/").concat(this.postId)).then(function(e){var n=e.data.acf.downloads;t.downloadsArrays=t.splitArrayByProperty(n,"option_name"),t.createOptions(),t.getCurrentArrayKey(),t.isLoaded=!0}).catch(function(e){t.hasError=!0,console.error("[DownloadList] getDownloads failed -",e.message)})},handleifyString:function(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-$/,"").replace(/^-/,"")},getCurrentArrayKey:function(){this.currentArrayKey=this.selectedOption},splitArrayByProperty:function(t,e){var n=[];t.forEach(function(t){var r=t[e];n.indexOf(r)<0&&n.push(r)});var r=[];return n.forEach(function(n){r.push({name:n,arrayGroup:t.filter(function(t){return t[e]===n})})}),r}}},a=(0,n(4486).A)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"res-Downloads"},[n("div",{staticClass:"res-Downloads_InputGroup"},[t.label?n("label",{staticClass:"res-Downloads_Label",attrs:{for:"refine"}},[t._v("\n "+t._s(t.label)+":\n ")]):t._e(),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedOption,expression:"selectedOption"}],staticClass:"res-Downloads_Select",attrs:{name:"downloadsSelect",id:"downloadsSelect"},on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){return"_value"in t?t._value:t.value});t.selectedOption=e.target.multiple?n:n[0]},function(e){return t.getCurrentArrayKey()}]}},t._l(t.options,function(e,r){return n("option",{domProps:{value:e.id}},[t._v("\n "+t._s(e.name)+"\n ")])}),0)]),t._v(" "),t.hasError?n("p",{staticClass:"res-Downloads_Error"},[t._v("\n Unable to load downloads.\n ")]):t.isLoaded?n("ul",{staticClass:"res-Download_Items"},t._l(t.downloadsArrays[t.currentArrayKey].arrayGroup,function(e){return n("li",{staticClass:"res-Download_Item"},[n("a",{staticClass:"res-Download_Link",attrs:{href:e.download_file,title:e.download_title,target:"_blank"}},[t._v("\n "+t._s(e.download_title)+"\n ")])])}),0):t._e()])},[],!1,null,null,null).exports}}]);
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.