var b=Object.defineProperty;var y=(t,e,r)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var p=(t,e,r)=>(y(t,typeof e!="symbol"?e+"":e,r),r);import{aG as f,aU as c,aC as n,u as O,x as d,j,a7 as A,n as w,e as m,o as P}from"./index-a76b28be.js";import"./index-4d966268.js";import"./postmen-a4b10828.js";import{A as _}from"./AssetViewer-06848056.js";var g=Object.defineProperty,x=Object.getOwnPropertyDescriptor,v=(t,e,r,o)=>{for(var s=o>1?void 0:o?x(e,r):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=(o?i(e,r,s):i(s))||s);return o&&s&&g(e,r,s),s};const h=f("div",{position:"absolute",top:"100px",backgroundColor:"$panelBg",variants:{sticky:{true:{position:"absolute",top:0}}}}),R=c(({asset:t})=>n.jsx(h,{children:n.jsx("audio",{src:t.url,controls:!0,children:"Your browser does not support the audio element."})}));class l extends _{constructor(){super();p(this,"duration",0);p(this,"playing",!1);p(this,"audioName");p(this,"overridePreviewer",c(({asset:r})=>n.jsx(R,{asset:r})));O(this)}setViewAsset(r,o){}}v([d],l.prototype,"duration",2);v([d],l.prototype,"playing",2);var U=Object.defineProperty,C=Object.getOwnPropertyDescriptor,D=(t,e,r,o)=>{for(var s=o>1?void 0:o?C(e,r):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=(o?i(e,r,s):i(s))||s);return o&&s&&U(e,r,s),s};let u=class extends j{constructor(e){super(e);p(this,"urlObj")}async initByMain(e){this.urlObj=e;const r=URL.createObjectURL(e);try{const o=await this.engine.resourceManager.load({url:r,type:A.Audio});this.bindEngineObject(o)}finally{URL.revokeObjectURL(r)}}};u=D([w({type:"Audio",label:m("asset.audio.title"),loaderType:"Audio",importMenuConfig:{type:P.Upload,tooltip:"请上传音频文件(支持 OGG, WAV, MP3)",accept:".ogg,.wav,.mp3"},viewer:l,bundle({content:t}){return{content:t}}})],u);export{u as AudioAsset};
