1import{k as p,B2 as d}from"./main-BVeaUmEJ.js";const f=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],v=p("outline","download","Download",f);async function h(e,o,t={}){const n=e.startsWith("data:"),a=o??w(e,t.contentType);let r=e,s=!1;if(!n)try{const c=await fetch(e,{mode:"cors"});if(!c.ok)throw new Error(`HTTP ${c.status}`);const m=await c.blob();r=URL.createObjectURL(m),s=!0}catch{return!1}const i=document.createElement("a");if(i.href=r,i.download=a,i.rel="noopener",document.body.appendChild(i),i.click(),document.body.removeChild(i),s){const c=URL.revokeObjectURL.bind(URL);setTimeout(()=>c(r),1e3)}return!0}const u={"video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov","image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/svg+xml":"svg"};function w(e,o){const t=Date.now();if(e.startsWith("data:")){const s=e.slice(5,e.indexOf(";")).split("/")[1]?.split("+")[0]??"bin";return`ai-image-${t}.${s}`}try{const s=new URL(e).pathname.split("/").pop()??"";if(s&&/\.[a-z0-9]{2,5}$/i.test(s))return s}catch{}const n=o?.split(";")[0]?.trim().toLowerCase(),a=n?u[n]:void 0;return n?.startsWith("video/")?`ai-video-${t}.${a??"mp4"}`:`ai-image-${t}.${a??"jpg"}`}const l={ttlMs:300*1e3,keys:{videoTool:`${d}:pending-video-tool`,imageEdit:`${d}:pending-image-edit`,imageToVideo:`${d}:pending-image-to-video`}};function y(e,o,t){if(typeof window>"u")return!1;try{const n={v:o,at:Date.now(),payload:t};return window.sessionStorage.setItem(l.keys[e],JSON.stringify(n)),!0}catch{return!1}}function b(e,o){if(typeof window>"u")return null;const t=l.keys[e];try{const n=window.sessionStorage.getItem(t);if(!n)return null;const a=JSON.parse(n),r=o.now??Date.now(),i=!!a&&a.v===o.version&&typeof a.at=="number"&&r-a.at<=l.ttlMs?o.parse(a.payload):null;return i===null?(window.sessionStorage.removeItem(t),null):o.accept&&!o.accept(i)?null:(window.sessionStorage.removeItem(t),i)}catch{try{window.sessionStorage.removeItem(t)}catch{}return null}}export{v as I,b as c,h as d,y as w};
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.