var d=Object.defineProperty;var v=(e,t,s)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var p=(e,t,s)=>(v(e,typeof t!="symbol"?t+"":t,s),s);import{aH as b,aJ as c,av as n,j as y,Z as A,n as j,e as m,o as w,b0 as l}from"./index-03b6134d.js";import"./index-0a53aaef.js";import"./postmen-9e6354af.js";import{A as f}from"./AssetViewer-1a9f3cad.js";const x=b("div",{position:"absolute",top:"100px",backgroundColor:"$panelBg",variants:{sticky:{true:{position:"absolute",top:0}}}}),O=c(({asset:e})=>n.jsx(x,{children:n.jsx("audio",{src:e.url,controls:!0,children:"Your browser does not support the audio element."})}));class _ extends f{constructor(){super(...arguments);p(this,"overridePreviewer",c(({asset:s})=>n.jsx(O,{asset:s})))}setViewAsset(s,r){}}var P=Object.defineProperty,U=Object.getOwnPropertyDescriptor,g=(e,t,s,r)=>{for(var o=r>1?void 0:r?U(t,s):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,s,o):a(o))||o);return r&&o&&P(t,s,o),o};let u=class extends y{async initByMain(e){const t=URL.createObjectURL(e);try{const s=await this.engine.resourceManager.load({url:t,type:A.Audio});this.bindEngineObject(s)}finally{URL.revokeObjectURL(t)}}};u=g([j({type:"Audio",label:m("asset.audio.title"),loaderType:"Audio",importMenuConfig:{type:w.Upload,tooltip:`请上传音频文件(支持 ${l.map(e=>e.slice(1).toUpperCase()).join(", ")})`,accept:l.join(",")},viewer:_,bundle({content:e}){return{content:e}}})],u);export{u as AudioAsset};
