"use strict";(self.webpackChunk_1js_files_in_taskbar=self.webpackChunk_1js_files_in_taskbar||[]).push([[4092],{35873:(l,i,e)=>{e.r(i),e.d(i,{default:()=>a});var o=e(6062),n=(e(39583),e(93468)),s=e(51636);const t=(l,i)=>{const e=(l=>{const i=document.createElement("a");return i.href=l,i.target="_blank",i.style.display="none",i.setAttribute("data-is-focusable","false"),i.onclick=l=>l.stopPropagation(),i})(l);e.setAttribute("download",i),(l=>{document.body.appendChild(l),l.click(),document.body.removeChild(l)})(e)};function u(l){return(null==l?void 0:l.sPWebUrl)&&(null==l?void 0:l.uniqueId)?l.sPWebUrl+"/_layouts/15/download.aspx?UniqueId="+l.uniqueId.replace(/[{}]/g,""):null}var d=e(90375);const r=(0,o.Ex)("search-dl.quickActions.download.tooltip"),a=(0,d.w)({id:"Download",entityType:"File",parameters:[{name:"file",entity:"File",isRequired:!0,validate:l=>function(l){var i,e,o,n,s,t,u,d;return!!((null===(i=l.customProps)||void 0===i?void 0:i.sPWebUrl)&&(null===(e=l.customProps)||void 0===e?void 0:e.uniqueId)||l.id.startsWith("SPO_")&&(null===(o=l.customProps)||void 0===o?void 0:o.fileUrl)&&!(null===(s=l.customProps)||void 0===s||null===(n=s.fileUrl)||void 0===n?void 0:n.endsWith(".aspx"))||(null===(t=l.customProps)||void 0===t?void 0:t.fileUrl)&&!(null===(d=l.customProps)||void 0===d||null===(u=d.fileUrl)||void 0===u?void 0:u.endsWith(".aspx")))}(l)}],execute:l=>{let{file:i}=l;const{customProps:e,id:o}=i.value,d=function(l,i){if((null==i?void 0:i.sPWebUrl)&&(null==i?void 0:i.uniqueId))return u({sPWebUrl:i.sPWebUrl,uniqueId:i.uniqueId});if(l.startsWith("SPO_")){const e=(null==i?void 0:i.sPWebUrl)||(0,n.R)((null==i?void 0:i.fileUrl)||l)||void 0;return e&&0!==e.length?u({sPWebUrl:e,uniqueId:(null==i?void 0:i.uniqueId)||(0,s.r)(l)})||"":null==i?void 0:i.fileUrl}return(null==i?void 0:i.fileUrl)||null}(o,e);return d&&d.length>0?(t(d,"Download File"),Promise.resolve()):Promise.reject(`Failed to get download URL + ${function(l,i){return[!(null==i?void 0:i.sPWebUrl)&&"sPWebUrl was missing",!(null==i?void 0:i.uniqueId)&&"uniqueId was missing",!l.startsWith("SPO_")&&"spoId was missing",!(null==i?void 0:i.fileUrl)&&"fileUrl was missing"].filter((l=>l)).join(", ")}(o,e)}`)},additionalProps:{icon:{iconName:"Download"},showSuccess:!0,tooltip:r}})}}]);