PageSourceSearch

https://superyachtjobs.com/build/assets/DownloadPDFButton-BzJGVzkJ.js

js superyachtjobs.com collected 2026-10-07 23:55:50 UTC 1,637 bytes, 1 lines download raw bytes

1import{u as R,r as j,j as l,f as E,A as F}from"./filteringStore-DBKx3oq_.js";import{u as v,T as D}from"./app-CSfDaM_X.js";import{I as N}from"./index-Cz24Nrvv.js";const P=e=>e?(e.split(/[\\/]/).pop()||e).replace(/(\.pdf)+$/i,"")+".pdf":"report.pdf",I=({exists:e,format:d,name:w})=>{const{filter:{selection:y}}=R(),{showToast:b}=v(),[a,c]=j.useState(!1),h=async g=>{var p,r,m;if(g.stopPropagation(),!!e){c(!0);try{const o=await F.post(route("api.data.report.download",{format:d}),y,{responseType:"blob",headers:{Accept:"application/pdf"}});if(!o||!o.data)throw new Error("Invalid file response");const x=new Blob([o.data],{type:"application/pdf"}),f=window.URL.createObjectURL(x),t=document.createElement("a");t.href=f;let u="";try{const n=((p=o.headers)==null?void 0:p["content-disposition"])||((m=(r=o.headers)==null?void 0:r.get)==null?void 0:m.call(r,"content-disposition")),s=n&&/filename\*=(?:UTF-8'')?([^;]+)/i.exec(n),i=!s&&n&&/filename="?([^";]+)"?/i.exec(n);u=decodeURIComponent(((s==null?void 0:s[1])||(i==null?void 0:i[1])||"").trim())}catch{}t.download=P(u||w),document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(f)}catch(o){console.error("Error downloading report:",o),b("Error","Failed to download the report. Please try again later.",D.ERROR)}finally{c(!1)}}};return l.jsx("button",{onClick:e&&!a?h:void 0,className:`p-3 rounded-md transition ${e&&!a?"text-white":"text-gray-400 cursor-not-allowed"}`,disabled:a||!e,"aria-disabled":!e,children:a?l.jsx(N,{className:"text-2xl text-gray-500 animate-spin",size:20}):l.jsx(E,{color:e?"black":"gray",size:20})})};export{I as default};

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.