(window.webpackJsonp=window.webpackJsonp||[]).push([[24,4],{1360:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(1),r=a(555),i=a.n(r),s=a(462),o=a(63),c=a(140),l=a(3);const h=Math.PI/4,u=Math.acos(Math.sqrt(2/3)),d=96*Math.sqrt(3);function m(e,t,a){return Math.min(Math.max(e,t),a)}const p=class extends n.Component{constructor(){super(...arguments),this._prevPos=[0,0],this._theta=h,this._phi=u,this._eye=[128,128,128],this._center=[32,32,32],this._lo=[0,0,0],this._hi=[128,128,128],this._distance=d,this._view=l.b.identity(l.b.create()),this._proj=l.b.identity(l.b.create()),this._viewProj=l.b.identity(l.b.create()),this._bgColor=[0,0,0,0],this._container=null,this._meshHash="",this._buffer=null,this._vao=null,this._vertexCount=0,this._rafID=0,this._drawFrame=()=>{const e=p._regl;if(!e)return;const t=this._eye,a=this._center,n=this._theta,r=this._phi,i=this._distance,s=this._lo,o=this._hi;a[0]=.5*(s[0]+o[0]),a[1]=.5*(s[1]+o[1]),a[2]=.5*(s[2]+o[2]),t[0]=Math.cos(n)*Math.cos(r)*i+a[0],t[1]=Math.sin(r)*i+a[1],t[2]=Math.sin(n)*Math.cos(r)*i+a[2],l.b.lookAt(l.b.identity(this._view),t,a,[0,1,0]),l.b.perspective(l.b.identity(this._proj),Math.PI/4,e._gl.drawingBufferWidth/e._gl.drawingBufferHeight,.5,512),l.b.mul(this._viewProj,this._proj,this._view),e.poll(),e.clear({color:this._bgColor,depth:1}),this._vertexCount>0&&p._drawMesh.call(this)},this._frame=()=>{this._drawFrame(),this._rafID=requestAnimationFrame(this._frame)},this._handleMouseDown=(e,t)=>{this._prevPos[0]=e,this._prevPos[1]=t,document.body.addEventListener("mousemove",this._handleMouseMove,{passive:!1}),document.body.addEventListener("touchmove",this._handleMouseMove,{passive:!1}),document.body.addEventListener("mouseup",this._handleMouseUp),document.body.addEventListener("touchend",this._handleMouseUp),this._rafID=requestAnimationFrame(this._frame)},this._lastPinchDist=0,this._handleMouseMove=e=>{e.preventDefault();const{_prevPos:t}=this;let a,n;if(e.touches&&e.touches.length){if(1!==e.touches.length){const t=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY),a=this._lastPinchDist-t;return this._lastPinchDist=t,void(this._distance=m(this._distance+.1*a,.1,200))}{const t=e.touches[0];a=t.clientX,n=t.clientY}}else a=e.clientX,n=e.clientY;const r=.01*(a-t[0]),i=.01*(n-t[1]);this._theta+=r,this._phi=m(this._phi+i,-1.57,1.57),t[0]=a,t[1]=n},this._handleMouseUp=()=>{cancelAnimationFrame(this._rafID),document.body.removeEventListener("mousemove",this._handleMouseMove),document.body.removeEventListener("touchmove",this._handleMouseMove),document.body.removeEventListener("mouseup",this._handleMouseUp),document.body.removeEventListener("touchend",this._handleMouseUp)},this._handleTouchStart=e=>{e.preventDefault();const t=e.touches[0];t&&(1===e.touches.length?this._handleMouseDown(t.clientX,t.clientY):this._lastPinchDist=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY))},this._handleWheel=e=>{e.stopPropagation(),e.preventDefault();const{deltaY:t}=e;this._distance=m(this._distance+.1*t,.1,200),this._drawFrame()}}static _initRegl(){if(this._regl)return;const e=this._canvas=document.createElement("canvas");e.width=e.height=512,Object.assign(e.style,{width:"100%",height:"100%",margin:0,padding:0,"pointer-events":"none"}),this._regl=i()({canvas:e,attributes:{premultipliedAlpha:!1,preserveDrawingBuffer:!1,alpha:!0},optionalExtensions:["oes_vertex_array_object"]}),this._drawMesh=this._regl({frag:"\n precision mediump float;\n varying vec3 color;\n void main () {\n gl_FragColor = vec4(color, 1);\n }",vert:"\n precision highp float;\n attribute vec4 s0, s1;\n varying mediump vec3 color;\n uniform highp mat4 viewProj;\n void main () {\n mediump float faceCode = s1.a;\n lowp float h0 = step(faceCode, 0.5);\n lowp float h1 = step(faceCode, 1.5);\n lowp float h2 = step(faceCode, 2.5);\n lowp float h3 = step(faceCode, 3.5);\n lowp float h4 = step(faceCode, 4.5);\n lowp vec3 faceNormal = vec3(\n h1 - 2. * h0,\n h3 - 2. * h2 + h1,\n 1. - 2. * h4 + h3);\n float light = (s0.w / 255.) * (1.6 + 0.3 * faceNormal.x + 0.4 * faceNormal.y + 0.25 * faceNormal.z) * 0.5;\n color = (s1.rgb / 255.) * light;\n gl_Position = viewProj * vec4(s0.xyz, 1);\n gl_PointSize = 4.0;\n }",attributes:{s0:0,s1:1},uniforms:{viewProj:this._regl.this("_viewProj")},depth:{enable:!0,mask:!0},vao:this._regl.this("_vao"),count:this._regl.this("_vertexCount"),offset:0,primitive:"triangles"})}_loadMesh(){return e=this,t=null,a=function*(){const e=p._regl;if(!e)return;e.poll(),e.clear({color:this._bgColor,depth:1});const t=this._meshHash,a=yield this.props.content.retrieve(t);if(!a||t!==this._meshHash)return;this._vao&&this._vao.destroy(),this._buffer&&this._buffer.destroy();const n=Object(s.a)(new c.d(()=>{},[],""),new o.b(a));if(!n)return;const r=this._lo,i=this._hi;r[0]=r[1]=r[2]=256,i[0]=i[1]=i[2]=0;for(let e=0;e>>8,s=(16711680&a)>>>16,o=Math.min(r,i,s),c=Math.max(r,i,s),d=Math.round(15*(r-o+1)/(c-o+1))|Math.round(15*(i-o+1)/(c-o+1))<<4|Math.round(15*(s-o+1)/(c-o+1))<<8,m=h[e],p=h[e+3],f=h[e+6],g=h[e+9];let b=0,v=0;for(let t=0;t<3;++t)b+=Math.abs(n[4*e+t]-n[4*(e+1)+t]),v+=Math.abs(n[4*e+t]-n[4*(e+2)+t]);d in l?l[d]+=b*v:l[d]=b*v,u[t++]=m,u[t++]=a,u[t++]=p,u[t++]=a,u[t++]=f,u[t++]=a,u[t++]=f,u[t++]=a,u[t++]=p,u[t++]=a,u[t++]=g,u[t++]=a}const d=+Object.keys(l).sort((e,t)=>l[t]-l[e])[0];this._bgColor[0]=Math.min(1,(15&d)/15+.25),this._bgColor[1]=Math.min(1,(240&d)/240+.25),this._bgColor[2]=Math.min(1,(3840&d)/3840+.25),this._bgColor[3]=.25;const m=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);this._vertexCount=u.length/2;const f=this._buffer=e.buffer(m);this._vao=e.vao({attributes:[{buffer:f,size:4,stride:8,offset:0,type:"uint8",normalized:!1},{buffer:f,size:4,stride:8,offset:4,type:"uint8",normalized:!1}],elements:null,count:p._regl.this("_vertexCount"),offset:0,instances:-1,primitive:"triangles"}),this._drawFrame()},new Promise((n,r)=>{var i=e=>{try{o(a.next(e))}catch(e){r(e)}},s=e=>{try{o(a.throw(e))}catch(e){r(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,s);o((a=a.apply(e,t)).next())});var e,t,a}componentDidMount(){p._initRegl(),this._meshHash!==this.props.hash&&(this._meshHash=this.props.hash,this._loadMesh().catch(e=>console.error(e)))}componentWillUnmount(){if(this._container){this._container.removeEventListener("touchstart",this._handleTouchStart),this._container.removeEventListener("wheel",this._handleWheel);const e=p._canvas;e&&e.parentNode&&e.parentNode.removeChild(e)}}componentWillReceiveProps(e){e.hash!==this._meshHash&&(this._meshHash=e.hash,this._loadMesh().catch(e=>console.error(e)))}render(){return n.createElement("div",{style:{cursor:"grab"},className:this.props.className,onMouseDown:e=>{1===e.buttons&&this._handleMouseDown(e.clientX,e.clientY)},ref:e=>{if(e&&!this._container){this._container=e,e.addEventListener("touchstart",this._handleTouchStart,{passive:!1}),e.addEventListener("wheel",this._handleWheel,{passive:!1}),p._initRegl();const t=p._canvas;if(t){t.parentNode&&t.parentNode.removeChild(t);const a=e.getBoundingClientRect();t.width=Math.ceil(a.width*window.devicePixelRatio),t.height=Math.ceil(a.height*window.devicePixelRatio),this._container.appendChild(t)}}}})}resetCanvasSize(){const e=p._canvas,t=this._container;if(t&&e){e.parentNode&&e.parentNode.removeChild(e);const a=t.getBoundingClientRect();e.width=Math.ceil(a.width*window.devicePixelRatio),e.height=Math.ceil(a.height*window.devicePixelRatio),t.appendChild(e),this._drawFrame()}}};let f=p;f._regl=null,f._drawMesh=()=>{}},1361:function(e,t,a){"use strict";a.d(t,"g",(function(){return ne})),a.d(t,"c",(function(){return se})),a.d(t,"f",(function(){return oe})),a.d(t,"a",(function(){return ce})),a.d(t,"e",(function(){return le})),a.d(t,"b",(function(){return he})),a.d(t,"d",(function(){return ue}));var n=a(1),r=a.n(n),i=a(73),s=a(264),o=a(252),c=a(51),l=a(1360),h=a(19),u=a(1370),d=a(68),m=a(501),p=a(1363),f=a(52),g=a(23),b=a(22),v=a(236),_=a(2),y=a(57),w=a(46),E=a(112),C=a(302),P=a(11),j=a(61),N=a(152),O=a(24),k=a(7),R=a(169),S=a(107),x=a(328),M=a(369),T=a(131),B=a(64),I=a(370),W=a(8),A=a(75),z=a(222),U=a(62),F=a(294),D=a(327),H=a(132),L=a(60),q=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,V=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,K=(e,t,a)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,G=(e,t)=>{for(var a in t||(t={}))Z.call(t,a)&&K(e,a,t[a]);if(V)for(var a of V(t))Q.call(t,a)&&K(e,a,t[a]);return e},J=(e,t)=>X(e,Y(t)),$=(e,t,a)=>new Promise((n,r)=>{var i=e=>{try{o(a.next(e))}catch(e){r(e)}},s=e=>{try{o(a.throw(e))}catch(e){r(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,s);o((a=a.apply(e,t)).next())});const ee=a(1362),te=(a(1369),s.c.api.get.ret),ae=s.c.api.list.ret,ne=e=>{const{id:t,type:a,followBtnCls:r,addViewBrowse:s=!0,onFetchContent:c}=e,l=Object(o.b)(),u=Object(w.b)(j.c),d=Object(w.b)(j.a),p=Object(i.g)(),b=re({id:t,type:a,onFetchContent:c}),y=ie({id:t,type:a}),[O,k]=Object(n.useState)({all:[],thumbnail:[],tail:[]}),[R,S]=Object(n.useState)(!1),[x,M]=Object(n.useState)(!1),T=Object(F.a)();Object(n.useEffect)(()=>{s&&u.id&&l.rpc.user.api.addBrowseHistory(t).catch(e=>{l.logger.error(e.toString())})},[t,s]),Object(n.useEffect)(()=>{u.initialized&&(b.call().then(e=>{k({all:e.collaborator||[],thumbnail:(e.collaborator||[]).slice(0,4),tail:(e.collaborator||[]).slice(4)})}).catch(e=>{l.logger.error(e.toString()),h.a.rpcError(e)}),y.call().catch(e=>{l.logger.error(e.toString()),h.a.rpcError(e)}))},[a,t,u.initialized,u.id]),Object(n.useEffect)(()=>{b&&Object(C.a)({title:b.data.name,desc:b.data.describe,imgUrl:Object(f.a)(b.data.image)})},[b.data.name,b.data.describe,b.data.image,b.data.content_id]);const B=Object(m.b)({className:r,initValue:{isFollowing:b.data.is_following,followerCount:b.data.follower_count,followingCount:b.data.following_count},text:{followed:Object(_.e)("followed"),followedHover:Object(_.e)("cancelFollow"),unfollow:e=>{return"+ "+Object(_.e)("follow")+" "+((t=e.followerCount)<=0?"":Object(v.b)(t));var t}},onFollowChange:e=>$(void 0,null,(function*(){try{return yield l.rpc.user.api.follow({id:b.data.author_id,isFollow:e.isFollowing}),!0}catch(e){return h.a.rpcError(e),l.logger.error(e.toString()),!1}}))}),I=` v.${b.data.version} | ${Object(E.b)(b.data.published_at,!0,"/")}`,W={commentRPC:l.rpc.comment,userRPC:l.rpc.user,onReport:l.rpc.reputation.api.report,showLogin:T.handleLogin,content:b.data,userId:u.id,userAvatar:u.data.avatar_hash,userFlag:u.data.flags,userReputation:u.data.reputation,contentResolver:l.content,userPermission:u.data.permission,visitUser:e=>{p.push(P.b.user(e))},onConfirmProtocol:()=>{u.setData({flags:u.data.flags|g.a.UserFlags.agreementOnComment})},muteUntil:u.data.muted_till,showReputation:()=>d.showSpecial(N.b.reputation),blockList:u.blockList,updateBlock:(e,t)=>u.updateBlock(e,t)};return{content:b,suggestContents:y,followHook:B,followUserFn:e=>$(void 0,null,(function*(){yield l.rpc.user.api.follow({id:e,isFollow:!0});const t=O.all.map(t=>t.id===e?J(G({},t),{is_following:!0}):t);k({all:t,thumbnail:t.slice(0,4),tail:t.slice(4)})})),collaborators:O,setCollaborators:k,versionText:I,commentProps:W,showReport:x,setShowReport:M,fullScreenModel:R,setFullScreenModel:S}},re=e=>{const t=Object(o.b)(),a=Object(w.b)(j.c),{id:n,type:r,onFetchContent:i}=e;let s=!1;return Object(y.a)(()=>$(void 0,null,(function*(){const e=yield t.rpc.content.api.get({type:"id",data:{type:r,isPublic:!0,contentId:n,userId:a.id,meshHash:r===g.a.ContentType.asset}});return s=!0,i&&i(e),J(G({},e),{initialize:s})})),[n,a.id,r],te.clone(te.identity))},ie=e=>{const t=Object(o.b)(),{id:a,type:n}=(Object(w.b)(j.c),e),r=window.innerWidth<1200&&window.innerWidth>=1024?5:6;return Object(y.a)(()=>$(void 0,null,(function*(){const e=Object(H.a)()?L.a.content.getRecommendModelListUsingGet({limit:r,excludeId:a,type:n}):t.rpc.content.api.list({recommendByContentId:a,type:n,limit:r,offset:0,sort:g.a.ContentOrder.updated,filter:void 0,authorId:void 0,status:void 0,isPublic:!0,noCache:void 0});try{const t=yield e;return Object(H.a)()?{rows:t}:t}catch(e){}})),[a,n],ae.clone(ae.identity))},se=e=>{const{type:t,content:a,fullScreen:i,className:s,gap:h=0,bannerHeight:m=210}=e,f=Object(o.b)(),b=Object(n.createRef)();Object(n.useEffect)(()=>{b.current&&b.current.resetCanvasSize()},[i]);const v=Object(d.d)()-h;let _;switch(t){case g.a.ContentType.game:_=a.banner&&a.banner.length?r.a.createElement(u.a,{autoPlay:a.banner.length>1,infiniteLoop:a.banner.length>1,showArrows:!1},a.banner.map((e,t)=>r.a.createElement("div",{key:t},r.a.createElement(c.c,{hash:e,width:v,height:m,className:s})))):r.a.createElement(c.c,{hash:a.image,width:v,height:m,className:s});break;case g.a.ContentType.asset:_=r.a.createElement(l.a,{ref:b,hash:a.meshHash,className:s,content:f.content});break;case g.a.ContentType.music:_=r.a.createElement(p.a,{hash:a.audio_hash,image:a.image,width:v,height:m,className:s})}return r.a.createElement("div",{className:s},_)},oe=e=>{const{type:t,width:a,content:n,setContent:i,setShowReport:s,onEnterCallBack:o}=e;return r.a.createElement("div",{className:ee.bottomBar},r.a.createElement(ce,{type:t,content:n,setContent:i,setShowReport:s}),r.a.createElement(le,{type:t,width:a,content:n,onEnterCallBack:o}))},ce=e=>{const{type:t,content:a,setContent:n,setShowReport:s}=e,c=Object(i.g)(),l=Object(o.b)(),u=Object(w.b)(j.c),d=Object(w.b)(j.a),m=Object(F.a)(),p=Object(w.b)(j.d,()=>[]),b=Object(M.b)(),v=["","game","voxel","music"],y=new U.a,E=[{text:Object(_.e)("editContent"),onClick:()=>{switch(t){case g.a.ContentType.game:l.openGameEdit({content_id:a.content_id,user_id:u.id});break;case g.a.ContentType.asset:p.open({content_id:a.content_id,hash:a.hash,user_id:u.id,name:a.name});break;case g.a.ContentType.music:b.openProject({name:a.name,content_id:a.content_id,hash:a.hash,description:a.describe})}},hide:u.id!==a.author_id},{text:Object(_.e)("removeContent"),hide:u.id!==a.author_id,onClick:()=>{d.showCustomModal({title:Object(_.e)("removeContent")+" "+a.name+" ?",body:Object(_.e)("cancelPublishNoticeBody",{type:Object(_.e)(g.a.ContentType[t])}),confirmText:Object(_.e)("acceptReport")},()=>$(void 0,null,(function*(){try{yield l.rpc.content.api.cancelPublish({content_id:a.content_id,user_id:u.id}),h.a.success("submitSuccess"),c.push("/")}catch(e){l.logger.error(e.toString()),h.a.error(Object(_.e)("submitFail"))}})))}},{text:Object(_.e)("report"),hide:!u.id||u.id===a.author_id,onClick:()=>{s(!0)}}],C=e=>n=>{const r={work_type:v[t],work_name:a.name,work_ID:""+a.content_id,platform:Object(k.b)()};"clickShare"===e?y.clickShare(G(G({},r),n)):"workShare"===e?y.workShare(G(G({},r),n)):y.clickCollect(G(G({},r),n))};return r.a.createElement("div",{className:ee.actionBtns},r.a.createElement(O.a,{size:24,icon:a.is_collected?"fav-filled":"fav",className:"hover-highlight",onClick:()=>$(void 0,null,(function*(){if(u.isLogin)try{const e=a.is_collected;e?yield l.rpc.user.api.deleteCollectedContent(a.content_id):(yield l.rpc.user.api.collectContent(a.content_id),D.a.workBeCollect({contentId:a.content_id,userId:a.author_id})),n(Object.assign({},a,{is_collected:!e})),C("collect")({isCollect:!e})}catch(e){l.logger.error(e.toString)}else m.handleLogin()}))}),r.a.createElement(O.a,{size:24,icon:"share",className:"hover-highlight",onClick:()=>{if(C("clickShare")({triggered_from:U.b.DESCRIPTION_PAGE}),Object(k.f)())if(z.a.enabled())z.a.emit({name:"share",params:{target:"page",params:{title:a.name,desc:a.describe,imageUrl:Object(f.a)(a.image),webUrl:window.location.href,workType:v[t],workId:a.content_id}}});else{Object(R.a)(window.location.href)?(h.a.success(Object(_.e)("linkCopied")),C("workShare")({share_method:"复制链接",triggered_from:U.b.DESCRIPTION_PAGE,fail_reason:""})):(h.a.error(Object(_.e)("linkCopyFailed")),C("workShare")({share_method:"复制链接",triggered_from:U.b.DESCRIPTION_PAGE,fail_reason:"linkCopyFailed"}))}else d.showShareBox({title:a.name,desc:a.describe,image:Object(f.a)(a.image),id:a.content_id,platform:Object(k.b)(),workType:v[t]})}}),u.isLogin?r.a.createElement(S.a,{posX:"center",posY:Object(k.f)()?"up":"down",distance:Object(k.f)()?16:void 0,popup:r.a.createElement(x.a,{items:E})},r.a.createElement(O.a,{icon:"more",className:"hover-highlight",size:24})):r.a.createElement("div",{style:{cursor:"pointer"},onClick:m.handleLogin},r.a.createElement(O.a,{icon:"more",className:"hover-highlight",size:24})))},le=e=>{const{type:t,width:a=180,content:n,onEnterCallBack:i}=e,s=Object(o.b)();return t===g.a.ContentType.game?r.a.createElement(T.a,{className:ee.startBtn,color:"red-gradient",type:"primary",width:a,onClick:()=>{s.openGamePlay({url:n.url,content_id:n.content_id}),i&&i()}},Object(_.e)("enterMap")):t===g.a.ContentType.asset?r.a.createElement(T.a,{color:"red-gradient",type:"primary",width:a,className:ee.startBtn,onClick:()=>{i&&i()}},Object(_.e)("fullScreenView")):null},he=e=>{const{collaborators:t,setCollaborators:a,showMoreCollaborator:n,setShowMoreCollaborator:i}=e,s=Object(o.b)(),l=Object(w.b)(j.c),u=Object(w.b)(j.a),d=e=>r.a.createElement("div",{key:e.id,title:e.displayname},r.a.createElement(A.a,{to:P.b.user(e.id),className:ee.collaboratorItem},r.a.createElement("div",{className:ee.collaboratorAvatarContainer},r.a.createElement(c.c,{hash:e.avatar,className:ee.collaboratorAvatar,width:48,height:48}),l.id!==e.id&&r.a.createElement(O.a,{size:20,icon:e.is_following?"followed":"create-highlight",className:ee.collaboratorPlus,onClick:n=>{n.preventDefault(),((e,n)=>{if(!l.isLogin)return i(!1),void u.showLogin();s.rpc.user.api.follow({id:e,isFollow:!0}).then(r=>{const i=t.all.map(t=>t.id===e?J(G({},t),{is_following:!0}):t);a({all:i,thumbnail:i.slice(0,4),tail:i.slice(4)}),h.a.success(Object(_.e)("followUserSuccessfully",{user:n}))}).catch(e=>{h.a.rpcError(e),s.logger.error(e)})})(e.id,e.displayname)}}))));return r.a.createElement("div",{className:ee.collaboratorContainer},r.a.createElement("div",{className:ee.collaboratorHead},r.a.createElement(W.a,null,Object(_.e)("collaborator")),t.tail.length>0&&r.a.createElement(O.a,{size:16,icon:"arrow-right",className:n?ee.arrowUp:ee.arrowDown,onClick:()=>i(!n)})),r.a.createElement("div",{className:ee.collaboratorBody},r.a.createElement("div",{className:ee.collaboratorBlock},t.thumbnail.map(e=>d(e))),n&&t.tail.length>0&&r.a.createElement("div",{className:ee.collaboratorAbsolute},r.a.createElement("div",{className:Object(b.a)(ee.collaboratorBlock)},t.all.map(e=>d(e))),t.all.length>=100&&r.a.createElement(W.a,{className:"flex justify-center mt-16",weight:"minor",size:14},Object(_.e)("onlyDisplay100Collaborators")))))},ue=e=>{const{type:t,content:a,onClose:i}=e,s=Object(o.b)(),c=Object(w.b)(j.c),l=Object(n.useCallback)(e=>{switch(e){case g.a.ContentType.game:return B.h.map;case g.a.ContentType.asset:return B.h.model;case g.a.ContentType.music:return B.h.music;default:return B.h.map}},[]),h=Object(n.useCallback)(e=>{switch(e){case g.a.ContentType.game:return"map";case g.a.ContentType.asset:return"model";case g.a.ContentType.music:return"music";default:return"map"}},[]);return r.a.createElement(I.a,{type:l(t),content:a.name,userId:a.author_id,userName:a.author_name,reputation:c.data.reputation,onClose:i,onSubmit:e=>$(void 0,null,(function*(){const n=yield Promise.all(e.screenshots.map(({file:e})=>$(void 0,null,(function*(){return yield s.content.storeImageFile(e)}))));yield s.rpc.reputation.api.report({type:h(t),data:{contentId:a.content_id,targetId:a.author_id,reason:e.reason.reduce((e,t)=>e|t),description:e.desc,screenshot:n}})}))})}},1362:function(e,t,a){e.exports={card:"_2tDaZcQ-h1Q7AE5uAKxuFC",collaboratorContainer:"_15FIpHxeQ42x3ZpMKfS7NT",collaboratorHead:"_3Kxgf5UM0dhK3ZbMiJN_Yk",arrowUp:"_1LlzwU7WRKYf8HJ6iiRDlm",arrowDown:"v1n65LGZ_eI75Kz-fwiH0",collaboratorBody:"_12IWX1XIhk3CskUKefTily",collaboratorBlock:"_388fi5ZF6FfutPDiVq1iDg",collaboratorAbsolute:"_1QyD9-YfVC9K6roWqP_7Iw",collaboratorItem:"iIrSO70OSXGDUquQgB6no",collaboratorAvatarContainer:"hKW3kfY0bDnkQlOrN3ndR",collaboratorAvatar:"TlxyTD-Cwi-gsccQUxPSX",collaboratorPlusContainer:"_3ZCmfmJ0QmKoSUzeM9XZZl",collaboratorPlus:"_3IimhT1YXN28kghFYh4oxe",head:"_3V0q3uB5f1k_MGmv7YPLrb",voxelContainer:"_2-R47gEhLeuwFoe6I5QB3C",actionBtns:"_1WICvWqK5nvauypwjwCzYJ",fullScreenViewerCloseIcon:"_3sLz5oPvYNM9rIUEIr-uqo",bottomBar:"_3QHXeKHZfMzUjJi-jsFh4H"}},1363:function(e,t,a){"use strict";a.d(t,"a",(function(){return _}));var n=a(1),r=a.n(n),i=a(52),s=a(22),o=a(24),c=a(556),l=a(1356),h=a(94),u=a(51);const d=a(1364),m=r.a.memo(r.a.forwardRef((e,t)=>{const a=e.colorBefore||"var(--color-primary)",n=e.colorAfter||"white",i=e.colorBuffer||"var(--color-primary-light)",o={};return o["--color-before"]=a,o["--color-after"]=n,o["--color-buffer"]=i,r.a.createElement("input",{type:"range",className:Object(s.a)(d.slider,e.className),ref:t,step:e.step,min:e.min,max:e.max,onInput:e=>{const t=e.target;t.style.setProperty("--before-width",(+t.value+.5)/+t.max*100+"%")},style:o,onChange:t=>{e.onChange(+t.target.value)}})})),p=a(1365);function f(e){const[t,a]=Object(n.useState)(!1);return Object(n.useEffect)(()=>{a(!1)},[e.hash]),t?r.a.createElement(o.a,{icon:"music-pause",size:24,onClick:()=>{e.onAction(!1),a(!1)}}):r.a.createElement(o.a,{icon:"music-play",size:24,onClick:()=>{e.onAction(!0),a(!0)}})}function g(e){const t=Math.floor(e/60),a=Math.floor(e%60);return isNaN(t)||isNaN(a)?"":`${t}:${a<10?"0"+a:a}`}var b=r.a.memo(e=>{const{hash:t,image:a}=e,o=Object(n.useRef)(null),c=Object(n.useRef)(null),l=Object(n.useRef)(null),h=Object(n.useRef)(null),d=Object(n.useRef)(null),b=Object(n.useRef)(null),v=Object(n.useRef)(0),_=Object(n.useRef)(()=>{const e=c.current,t=o.current,a=l.current,n=Math.floor((null==t?void 0:t.currentTime)||0);a.textContent=g(n),e.value=""+n;const r=+e.max;r!==1/0&&e.style.setProperty("--before-width",n/r*100+"%"),v.current=requestAnimationFrame(_.current)}),y=()=>{const e=o.current.duration;c.current.max=""+Math.floor(e),h.current.textContent=g(e)};return Object(n.useEffect)(()=>{cancelAnimationFrame(v.current),o.current.pause(),l.current.textContent="0:00",h.current.textContent="";const e=c.current;return e.value="0",e.style.setProperty("--before-width","0%"),e.style.setProperty("--buffer-width","0%"),()=>{cancelAnimationFrame(v.current)}},[e.hash]),r.a.createElement("div",{className:Object(s.a)(p.container,e.className)},r.a.createElement(u.c,{hash:a,width:e.width,height:e.height,className:p.cover}),r.a.createElement("div",{className:p.player},r.a.createElement("div",{className:p.actionBtn},r.a.createElement(f,{onAction:e=>{const t=o.current;e?(t.play().catch(console.error),v.current=requestAnimationFrame(_.current)):(t.pause(),cancelAnimationFrame(v.current))},hash:e.hash})),r.a.createElement("div",{className:p.seekSlider},r.a.createElement("span",{className:p.currentTime,ref:l},"0:00"),r.a.createElement(m,{ref:c,max:60,min:0,onChange:e=>{const t=o.current.duration;t&&t!==1/0&&(l.current.textContent=g(e),o.current.currentTime=e)}}),r.a.createElement("span",{className:p.endTime,ref:h},"0:00")),r.a.createElement("div",{className:p.volumeSlider},r.a.createElement("span",{className:p.volume,ref:b},"0:00"),r.a.createElement("input",{type:"range",ref:d}))),r.a.createElement("audio",{preload:"metadata",src:t&&Object(i.a)(t)+".mp3"||"",ref:o,onLoadedMetadata:e=>{y()},onProgress:()=>{(()=>{const{buffered:e,readyState:t}=o.current;if(t<4)return;const a=Math.floor(e.end(e.length-1));c.current.style.setProperty("--buffer-width",a/+c.current.max*100+"%")})()},onDurationChange:()=>{y()}}))});const v=a(1366),_=r.a.memo(e=>{try{return w()?r.a.createElement(P,{hash:e.hash,image:e.image,width:e.width,height:e.height,className:e.className}):r.a.createElement(b,{hash:e.hash,image:e.image,width:e.width,height:e.height,className:e.className})}catch(e){console.error(e)}return r.a.createElement(b,{hash:e.hash,image:e.image,width:e.width,height:e.height,className:e.className})});let y;function w(){if(!y){const e=window.AudioContext||window.webkitAudioContext||!1;if(!e)throw new Error("Sorry, but the Web Audio API is not supported by your browser. Please, consider upgrading to the latest version or downloading Google Chrome or Mozilla Firefox");y=new e}return y}function E(e,t){return a=this,n=null,r=function*(){let a;if(a="undefined"!=typeof window&&void 0!==window.webkitAudioContext?yield new Promise((a,n)=>{e.decodeAudioData(t.slice(0),e=>{a(e)},e=>{console.error("decodeAudioData error:",e),n(e)})}):yield e.decodeAudioData(t.slice(0)),a)return a;throw new Error("Recorder Error: cannot decode exported MP3")},new Promise((e,t)=>{var i=e=>{try{o(r.next(e))}catch(e){t(e)}},s=e=>{try{o(r.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,s);o((r=r.apply(a,n)).next())});var a,n,r}function C(e,t,a,n){!function(e,t,a,n){const r=e.width,i=e.height,s=r/2.5,o=e.getContext("2d");if(o){o.clearRect(0,0,r,i),o.save(),o.strokeStyle=n,o.translate(0,i/2),o.globalAlpha=1,o.lineWidth=2;const e=t.length,c=Math.floor(e/s),l=r/s,h=Math.round(s*a);o.beginPath();for(let e=0;e<=h;e++){const a=Math.floor(c*e),n=e*l,r=t[a]*i;o.moveTo(n,r),o.lineTo(n,-1*r)}o.stroke(),o.strokeStyle="#fff",o.beginPath();for(let e=h+1;e<=s;e++){const a=Math.floor(c*e),n=e*l,r=t[a]*i;o.moveTo(n,r),o.lineTo(n,-1*r)}o.stroke(),o.restore()}}(t,e.getChannelData(0),a,n)}const P=r.a.memo(e=>{const{hash:t,image:a}=e,u=w(),d=Object(n.useRef)(null),[m,p]=Object(n.useState)(!1),f=Object(n.useRef)(null),[g,b]=Object(n.useState)(!1),_=Object(n.useRef)(null),y=Object(n.useRef)(null),P=Object(n.useRef)(null),j=Object(n.useRef)(null),N=Object(n.useRef)(null),O=Object(n.useRef)(!1),k=Object(n.useRef)(0),R=Object(n.useRef)(0),[S,x]=Object(n.useState)(0),M=Object(n.useRef)(0),T=r.a.useRef(-1);Object(n.useEffect)(()=>{let t=!0;return d.current=null,_.current=null,O.current=!1,k.current=0,M.current=0,R.current=0,p(!1),b(!1),x(0),y.current&&(y.current.innerText="0.00"),P.current&&(P.current.style.width="0%"),j.current&&(j.current.style.left="-7px"),u&&fetch(Object(i.a)(e.hash)).then(e=>{t&&e.arrayBuffer().then(e=>{t&&E(u,e).then(e=>{t&&(d.current=e,x(e.duration),p(!0))}).catch(e=>{console.error(e)})}).catch(e=>{console.error(e)})}).catch(e=>{console.error(e)}),()=>{t=!1,U()}},[e.hash]),Object(n.useEffect)(()=>{const t=f.current;m&&t&&(e.width>700?(t.width=Math.round(.85*e.width),t.height=150):e.width<=440?(t.width=e.width-10,t.height=e.width/3):(t.width=Math.round(.85*e.width),t.height=130),t.style.width=t.width+"px",t.style.height=t.height+"px",d.current&&C(d.current,t,0,"#fff"))},[m]);const B=e=>{P.current&&(P.current.style.width=100*e+"%"),y.current&&(y.current.innerText=(e*d.current.duration).toFixed(2)),j.current&&0==O.current&&(j.current.style.left=`calc(${100*e}% - 7px)`),d.current&&f.current&&C(d.current,f.current,e,"#e9591d")},I=Object(n.useRef)(e=>{const t=_.current;if(t&&"started"===t.state&&!1===t.finished){const e=f.current;if(d.current&&e&&t){const e=(F()-M.current+k.current)/d.current.duration;B(e)}}t&&"started"===t.state&&t.finished&&(U(),b(!1),k.current=0,P.current&&(P.current.style.width="100%"),y.current&&(y.current.innerText=d.current.duration.toFixed(2)),d.current&&f.current&&C(d.current,f.current,1,"#e9591d")),T.current=requestAnimationFrame(I.current)});Object(n.useEffect)(()=>(T.current=requestAnimationFrame(I.current),()=>{cancelAnimationFrame(T.current)}),[]);const W=Object(n.useRef)(null),A=Object(n.useRef)(null),z=()=>{W.current=e=>{if(N.current){const t=N.current.getBoundingClientRect();let a=0;"mousemove"==e.type&&(a=e.clientX),"touchmove"==e.type&&(a=e.touches[0].clientX);const n=Object(l.a)((a-t.left)/t.width,0,1),r=S*n;R.current=r,j.current&&(j.current.style.left=`calc(${100*n}% - 7px)`)}},A.current=e=>{if(O.current=!1,N.current){if(_.current&&!_.current.finished&&g){const e=F();_.current.seek(R.current,e),M.current=e}k.current=R.current}W.current&&(window.removeEventListener("mousemove",W.current),window.removeEventListener("touchmove",W.current)),A.current&&(window.removeEventListener("mouseup",A.current),window.removeEventListener("touchend",A.current))},window.addEventListener("mousemove",W.current),window.addEventListener("mouseup",A.current),window.addEventListener("touchmove",W.current),window.addEventListener("touchend",A.current)},U=()=>{const e=_.current;null!==e&&(e.stop(),_.current=null)},F=()=>u.currentTime;return u?r.a.createElement("div",{className:Object(s.a)(v.container,e.className)},r.a.createElement("div",{className:Object(s.a)(v.heroImg,m?v.blur:""),style:{backgroundImage:`url(${Object(i.a)(a)})`,backgroundSize:"100% auto",width:e.width+"px",height:e.height+"px",backgroundPosition:"center"}}),r.a.createElement("div",{className:Object(s.a)(v.waveformWrapper,m?v.show:""),style:{width:e.width+"px",height:e.height+"px"}},r.a.createElement("canvas",{ref:f,className:v.waveformCvs}),r.a.createElement("div",{className:v.playerControls},r.a.createElement("div",{className:v.controlsWrapper},r.a.createElement("div",{className:v.controlBtn},g?r.a.createElement(o.a,{icon:"music-pause",size:35,onClick:()=>{U(),b(!1),k.current=0}}):r.a.createElement(o.a,{icon:"music-play",size:35,onClick:()=>{b(!0),(()=>{if(null!==_.current||!d.current)return;const e=F();_.current=new c.d(d.current,u),_.current.start(e,k.current),M.current=e})()}})),r.a.createElement("div",{className:v.progressBarWrapper},r.a.createElement("div",{className:v.mainBar,ref:N,onMouseUp:e=>{const t=e.target.getBoundingClientRect(),a=(e.clientX-t.left)/t.width,n=S*a;if(k.current=n,_.current&&!_.current.finished&&g){e.clientX;const t=F();_.current.seek(k.current,t),M.current=t}else B(a)}},r.a.createElement("div",{className:v.prgressArea,ref:P})),r.a.createElement("div",{className:v.progressTime,ref:y},"0.00"),r.a.createElement("div",{className:v.duration},S.toFixed(2)),r.a.createElement("div",{className:v.progressButton,ref:j,onMouseDown:()=>{O.current=!0,z()},onTouchStart:()=>{O.current=!0,z()}}))))),!1===m?r.a.createElement("div",{className:v.loadingWrapper},r.a.createElement(h.a,null)):null):r.a.createElement("div",null,"Sorry, but the Web Audio API is not supported by your browser.")})},1364:function(e,t,a){e.exports={slider:"_2Z_BFdBM8dffdZ9twJWjoH"}},1365:function(e,t,a){e.exports={container:"uJITfLXCP3drZaCsn4mFm",player:"_2fz3mhvVpcr7JqHot5NaL3",actionBtn:"_2ULh2w63bD8tBSckruM5cn",seekSlider:"_3XRtA_3d0WjH1IuYw1AikY",currentTime:"k_DPWxZIjQkl4CAl1_awj",endTime:"_2N0bWh1x00VFQlJWOn_S3x",volumeSlider:"YVMzBK69-zMccaKqPKe-b"}},1366:function(e,t,a){e.exports={container:"_1TjuhwQbqft35u0aqg2xnZ",heroImg:"_50tryRVdZC6n3EeGmkb3y",blur:"_12NjGvuKVFfZVDiHOF0krW",waveformWrapper:"_1hjuka41AxBUh0nSBnwyUP",show:"_1M7vtJXTsgjvMhQG23CPmP",palybtn:"VyxCZrtryBMC9Fu3r6wP2",playerControls:"_36KWdINr_ZhlTZV-4fmucp",controlsWrapper:"_4aSDqyI877-YfXYFpFXzF",controlBtn:"_1J4d0x6BIiTOUxV4CWs1m2",progressBarWrapper:"_10yaSq4LuBTKViZ5ptMl6z",mainBar:"TV-3EW4vf4tTrih4uHKo1",prgressArea:"_3LrKCuQcNPXWovz8xOZ0b7",progressTime:"_1E7XA-8riYYDvrrCuVH2QA",duration:"_12K32WUqU3MgD79ipwKdWF",progressButton:"_3oF_qjXx51mPqqWTxORDZY",loadingWrapper:"_1afsecrHuIo8icJEkeAgPH"}},1369:function(e,t,a){e.exports={card:"_1Zy2Jmx_kstIag_nqZlZ8y",head:"_21nZ7QmoMgswIj5JRLqA_5",collaborator:"_3e36jxk9aQkwTWIPhksTsj",voxelContainer:"_2fJ3jpXm7zACMsu6i3fUme",fullScreen:"_3ORiIAg_yl8DWoPAHRefvX",screenshots:"BX1HfUwVl4Q7nDf8GwPNS",badgeBox:"_1Yq0R8Ij98iFU2G04HegE7",nameStyle:"_18yWEaG4VCx8pafk4wkQHk",badge:"BQQD2tosxI0ds5IO1S1X5"}},1372:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return f}));var n=a(1),r=a.n(n),i=a(23),s=a(11),o=a(75),c=a(8),l=a(481),h=a(51),u=a(7),d=a(132);const m=a(1373);function p(e){const t=e.type===i.a.ContentType.game;return r.a.createElement(o.a,{className:m.container+" flex w-full",to:s.b.content(e.type,e.content_id)},r.a.createElement(h.b,{hash:e.image,className:"rounded-8",height:60,width:60}),r.a.createElement("div",{className:"ml-12 overflow-hidden"},r.a.createElement(c.a,{size:14,className:"mb-4",bold:!0,autoLineHeight:!0},e.name),r.a.createElement(l.a,{view:t?void 0:e.view_count,play:t?e.play_count:void 0,comment:Object(d.a)()?void 0:e.comment_count,width:"107px",className:Object(u.g)()?"mb-4":"mb-8"}),r.a.createElement("div",{className:"flex"},r.a.createElement(h.b,{hash:e.author_avatar,className:m.authorAvatar,width:13,height:13}),r.a.createElement(c.a,{size:12,className:"ml-4",autoLineHeight:!0},e.author_name))))}function f(e){return r.a.createElement("div",{className:m.list},e.children)}},1373:function(e,t,a){e.exports={list:"_2SwICguaVtEAvFyv-NiasT",container:"_20p8foIhxGbiUAIg148zGh",authorAvatar:"Y3lnNwWu3MpBEhfipbL9O"}},1616:function(e,t,a){"use strict";a.r(t),a.d(t,"PhoneContentPage",(function(){return U}));var n=a(1),r=a.n(n),i=a(23),s=a(196),o=a(51),c=a(8),l=a(96),h=a(481),u=a(68),d=a(94),m=a(24),p=a(2),f=a(75),g=a(46),b=a(61),v=a(11),_=a(19),y=a(252),w=a(1361),E=a(93),C=a(174),P=a(331),j=a(413),N=a(1372),O=a(325),k=a(22),R=a(364),S=a(294),x=a(132),M=Object.defineProperty,T=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,W=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const A=a(1362),z=a(1369),U=e=>{const{id:t,type:a}=e,{content:M,collaborators:U,suggestContents:F,versionText:D,commentProps:H,followUserFn:L,followHook:q,showReport:X,setShowReport:Y,fullScreenModel:V,setFullScreenModel:Z}=Object(w.g)({id:t,type:a}),Q=Object(y.b)(),K=Object(g.b)(b.c),G=a===i.a.ContentType.game,J=Object(S.a)(),[$,ee]=Object(n.useState)(!1),[te,ae]=Object(n.useState)(!1),ne=e=>r.a.createElement("div",{key:e.id,title:e.displayname},r.a.createElement(f.a,{to:v.b.user(e.id),className:A.collaboratorItem},r.a.createElement("div",{className:A.collaboratorAvatarContainer},r.a.createElement(o.c,{hash:e.avatar,className:A.collaboratorAvatar,width:48,height:48}),K.id!==e.id&&r.a.createElement(m.a,{size:20,icon:e.is_following?"followed":"create-highlight",className:A.collaboratorPlus,onClick:t=>{t.preventDefault(),((e,t)=>{if(!K.isLogin)return ee(!1),void J.handleLogin();L(e).then(()=>{_.a.success(Object(p.e)("followUserSuccessfully",{user:t}))}).catch(e=>{_.a.rpcError(e),Q.logger.error(e)})})(e.id,e.displayname)}}))));let re;return re=K.initialized&&M.loading?r.a.createElement(u.c,{center:!0},r.a.createElement(d.a,null)):r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:z.card},r.a.createElement("div",{className:z.head},r.a.createElement(o.c,{width:64,height:64,hash:M.data.image,className:"rounded-8 block"}),r.a.createElement(l.a.h,{size:16}),r.a.createElement("div",null,r.a.createElement("div",null),r.a.createElement(c.a,{size:16,bold:!0},M.data.name),r.a.createElement(h.a,{view:G?void 0:M.data.view_count,play:G?M.data.play_count:void 0,comment:M.data.comment_count,width:"120px"})))),r.a.createElement(w.c,{type:a,content:M.data,fullScreen:V,className:Object(k.a)(z.voxelContainer,V&&z.fullScreen)}),r.a.createElement("div",{className:z.card},r.a.createElement("div",{className:"flex"},r.a.createElement(f.a,{className:"flex flex-1 mr-16 overflow-hidden",to:v.b.user(M.data.author_id)},r.a.createElement(o.c,{hash:M.data.author_avatar,className:"rounded-full",width:30,height:30}),r.a.createElement(l.a.h,{size:8}),r.a.createElement("div",{className:z.badgeBox},r.a.createElement("div",{className:z.nameStyle},r.a.createElement(C.a,{size:14,name:M.data.author_name,isBig:!1})),r.a.createElement(C.d,{type:M.data.author_tag,isBig:!0,className:z.badge})),r.a.createElement(l.a.h,{size:4})),K.id!==M.data.author_id&&q.render({color:"red",type:"default"})),U.all.length>0&&r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a.v,{size:12}),r.a.createElement("div",{className:z.collaborator,onClick:()=>ee(!0)},r.a.createElement(c.a,null,Object(p.e)("collaborator")),r.a.createElement("div",{className:"flex"},U.thumbnail.slice().map(e=>r.a.createElement(o.c,{hash:e.avatar,className:"rounded-full mr-16",width:24,height:24})),r.a.createElement(m.a,{icon:"arrow-right",size:16}))))),r.a.createElement(l.a.v,{size:8}),r.a.createElement("div",{className:z.card},r.a.createElement("div",{className:"flex justify-between"},r.a.createElement(P.a,{fontSize:16},Object(p.e)("describe")),r.a.createElement("div",{className:"flex",onClick:()=>ae(!te)},r.a.createElement(c.a,{size:14,color:"green"},te?Object(p.e)("collapse"):Object(p.e)("expand")),r.a.createElement(l.a.h,{size:4}),r.a.createElement(m.a,{icon:"arrow-expand",size:16,className:te?"":"rotate-180"}))),r.a.createElement(l.a.v,{size:8}),r.a.createElement(c.a,{size:14,wrap:!0,lineClamp:te?0:3,lineHeight:25},M.data.describe),te&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"flex justify-between w-full mb-8 mt-16"},M.data.version>1&&r.a.createElement(P.a,{fontSize:16},Object(p.e)("update")),r.a.createElement(c.a,{weight:"minor",size:14},D)),M.data.notice&&r.a.createElement(c.a,{wrap:!0,lineHeight:25,size:14},M.data.notice))),r.a.createElement(l.a.v,{size:8}),!Object(x.a)()&&r.a.createElement("div",{className:"w-full p-16 bg-white"},r.a.createElement(j.b,((e,t)=>{for(var a in t||(t={}))B.call(t,a)&&W(e,a,t[a]);if(T)for(var a of T(t))I.call(t,a)&&W(e,a,t[a]);return e})({},H))),r.a.createElement(l.a.v,{size:8}),r.a.createElement("div",{className:z.card},r.a.createElement(P.a,{fontSize:16},Object(p.e)("recommend")),r.a.createElement(l.a.v,{size:12}),r.a.createElement(N.b,null,F.data.rows.map((e,t)=>r.a.createElement(N.a,{key:e.content_id,image:e.image,name:e.name,play_count:e.play_count,view_count:e.view_count,comment_count:e.comment_count,content_id:e.content_id,author_name:e.author_name,author_id:e.author_id,type:a,author_avatar:e.author_avatar}))))),M.initialize&&!M.data.content_id?r.a.createElement(R.a,null):r.a.createElement(u.c,{fullWidth:!0},r.a.createElement(s.a,{showBack:!0}),re,r.a.createElement(w.f,{type:a,content:M.data,setContent:M.setData,setShowReport:Y,onEnterCallBack:()=>{a===i.a.ContentType.asset&&Z(!0)}}),r.a.createElement(l.a.v,{size:56}),r.a.createElement(E.a,{invisible:!$,onClose:()=>ee(!1),title:Object(p.e)("collaborator"),maxHeight:"456px"},r.a.createElement("div",{className:A.collaboratorBlock},U.all.map(e=>ne(e))),U.all.length>=100&&r.a.createElement(c.a,{className:"flex justify-center mt-16",weight:"minor",size:14},Object(p.e)("onlyDisplay100Collaborators"))),X&&r.a.createElement(w.d,{type:a,content:M.data,onClose:()=>Y(!1)}),V&&r.a.createElement(m.a,{icon:"close",className:A.fullScreenViewerCloseIcon,size:24,onClick:()=>Z(!1)}),r.a.createElement(O.a,null))};t.default=U},462:function(e,t,a){"use strict";a.d(t,"a",(function(){return m}));const n=new Array(256),r=new Array(256);for(let e=0;e<256;++e)n[e]=r[e]=0;const i=[];function s(e){return 8*e>>>0}const o=s(0),c=s(1),l=s(2),h=s(3);function u(e,t,a,n){return(e<>>0|t<>>0|a<>>0|n<>>0)>>>0}const d=[0<>>0,153<>>0,204<>>0,255<>>0];function m(e,t){if(-11!==t.readInt32())return null;const a=t.readVarint(),o=t.readVarint(),c=t.readVarint();for(let e=0;e>1,f=(p+2)%3,g=(p+1)%3,b=s(p),v=s(f),_=s(g),y=o<>>0,w=a<>>0;for(let e=0;e>>0,a=t.readUint8()<<_>>>0,i=t.readUint8()<>>0,s=t.readUint8()<<_>>>0,o=t.readUint8(),c=t.readUint8(),h=(n[o]|w)>>>0,p=r[o];l[m+1]=h,l[m+2]=p,l[m+4]=h,l[m+5]=p,l[m+7]=h,l[m+8]=p,l[m+10]=h,l[m+11]=p;const f=d[3&c],g=d[c>>2&3],b=d[c>>4&3],E=d[c>>6],C=(e|a|y|f)>>>0,P=(e|s|y|E)>>>0,j=(i|a|y|g)>>>0,N=(i|s|y|b)>>>0,O=(f+b-(g+E)||Math.max(f,b)-Math.max(g,E))<0,k=O-1>>>0,R=k&C|~k&P,S=k&N|~k&j,x=C^P^R,M=N^j^S,T=u^O;l[m]=R,l[m+(3<{const e=this.now();if(!this._loop){const t=e-this._startTime+this._offset;(t>=this.audioBuffer.duration||this.audioBuffer.duration-t>=0&&this.audioBuffer.duration-t<=1e-4)&&(this._finished=!0)}},this._source.loop=this._loop,this._source.loopStart=this._loopStart,this._source.loopEnd=Math.min(this._loopEnd,this.audioBuffer.duration),this._state="started",this._source.start(e,t),this._offset=t,this._startTime=e}get state(){return this._state}get finished(){return this._finished}stop(e){void 0===e&&(e=this.now()),this._source&&(this._source.stop(e),this._source.disconnect(),this._state="stopped")}seek(e,t){this.stop(t),this.start(t,e)}}function c(e,t){const a=[],n=t.getChannelData(0),r=t.length/e.clientWidth,i=~~(r/10)||1;for(let t=0;t0&&(h+=e*e,l++),e<0&&(u+=e*e,c++)}a[2*t]=256*Math.sqrt(h/l),a[2*t+1]=256*-Math.sqrt(u/c)}return a}function l(e,t,a,n){if(e&&t){const r=e.getContext("2d");if(r){let i=!1;e.height!==n&&(i=!0,e.style.height=n+"px",e.height=n),e.width!==t.clientWidth&&(i=!0,e.style.width=t.clientWidth+"px",e.width=t.clientWidth),i?(r.translate(.5,n/2),r.scale(.5,n/256),r.lineWidth=2):(r.setTransform(1,0,0,1,0,0),r.translate(.5,n/2),r.scale(.5,n/256)),r.clearRect(0,0,e.width,e.height),r.strokeStyle="white",r.fillStyle="white";const s=0,o=t.clientWidth;for(let e=s;e=-.5&&l<=.5){const n=i;for(;e.5){e-=1;break}i=2*(e-s)}n===i?(r.moveTo(i,-.5),r.lineTo(i,.5)):(r.stroke(),r.lineWidth=1,r.beginPath(),r.moveTo(n-.5,0),r.lineTo(i+.5,0),r.stroke(),r.lineWidth=2,r.beginPath())}else c>-.5&&(c=-.5),l<.5&&(l=.5),r.moveTo(i,c),r.lineTo(i,l)}r.stroke()}}}class h extends n.Component{constructor(e){super(e),this.player=null,this.canvasRef=n.createRef(),this.containerRef=n.createRef(),this.containerWidth=0,this._onResizeChange=e=>{if(this.containerRef.current&&this.canvasRef.current&&this.containerRef.current.clientWidth!==this.containerWidth){const e=c(this.containerRef.current,this.props.buffer);l(this.canvasRef.current,this.containerRef.current,e,this.props.waveformHeight),this.containerWidth=this.containerRef.current.clientWidth}},this.play=()=>{null===this.player&&(this.player=new o(this.props.buffer,this.props.audioContext),this.player.loop=!0,this.player.loopStart=this.state.startPos,this.player.loopEnd=this.state.endPos,this.player.start())},this.stop=()=>{null!==this.player&&(this.player.stop(),this.player=null)},this.state={startPos:0,endPos:e.buffer.duration,isPlaying:!1,quality:22050}}now(){return this.props.audioContext.currentTime}shouldComponentUpdate(e,t){if(e.waveformHeight!==this.props.waveformHeight){if(this.containerRef.current&&this.canvasRef.current){const e=c(this.containerRef.current,this.props.buffer);l(this.canvasRef.current,this.containerRef.current,e,this.props.waveformHeight)}return!0}return t.endPos!==this.state.endPos||t.startPos!==this.state.startPos||t.quality!==this.state.quality||t.isPlaying!==this.state.isPlaying}componentDidMount(){if(window.addEventListener("resize",this._onResizeChange),this.containerRef.current&&(this.containerWidth=this.containerRef.current.clientWidth),this.canvasRef.current&&this.containerRef.current){const e=c(this.containerRef.current,this.props.buffer);l(this.canvasRef.current,this.containerRef.current,e,this.props.waveformHeight)}}componentWillUnmount(){window.removeEventListener("resize",this._onResizeChange),this.stop()}render(){const{isPlaying:e,startPos:t,endPos:a}=this.state;return n.createElement("div",{className:s.container,ref:this.containerRef},n.createElement("div",{className:[s.playButton,e?s.stop:""].join(" "),onClick:()=>{e?(this.setState({isPlaying:!1}),this.stop()):(this.setState({isPlaying:!0}),this.play())}},n.createElement("div",{className:[s.Icon,s.tabIcon].join(" ")})),n.createElement("div",{className:s.waveformWrapper,style:{height:this.props.waveformHeight+"px"}},n.createElement("canvas",{style:{height:this.props.waveformHeight+"px"},ref:this.canvasRef}),n.createElement("div",{className:s.waveformMask,style:{left:"0",width:t/this.props.buffer.duration*100+"%"}}),n.createElement("div",{className:s.waveformMask,style:{right:"0",width:100*(1-a/this.props.buffer.duration)+"%"}})),n.createElement("div",{className:s.sliderWrapper},n.createElement("label",null,Object(i.e)("AudioStartPos")," : "),n.createElement("span",null,t," s"),n.createElement("input",{className:[s.small,s.input].join(" "),type:"range",min:0,max:this.props.buffer.duration,step:.001,value:t,onChange:t=>{const n=Number(t.target.value);n{const r=Number(n.target.value);r>t&&(this.setState({endPos:r}),e&&this.player&&(this.player.loopEnd=r),this.props.onChange(this.state.startPos,a,this.state.quality))}})),n.createElement("div",{className:s.AudioQualityWrapper},n.createElement("label",{className:s.label},Object(i.e)("AudioQuality")),n.createElement("div",{style:{display:"flex",padding:"0 10px",marginTop:"5px"}},n.createElement("div",{className:[s.qualityRatioItem,8e3===this.state.quality?s.selected:""].join(" "),onClick:()=>{this.setState({quality:8e3}),this.props.onChange(this.state.startPos,this.state.endPos,8e3)}},Object(i.e)("Low"),"(8kHZ)"),n.createElement("div",{className:[s.qualityRatioItem,22050===this.state.quality?s.selected:""].join(" "),onClick:()=>{this.setState({quality:22050}),this.props.onChange(this.state.startPos,this.state.endPos,22050)}},Object(i.e)("Middle"),"(22kHZ)"),n.createElement("div",{className:[s.qualityRatioItem,32e3===this.state.quality?s.selected:""].join(" "),onClick:()=>{this.setState({quality:32e3}),this.props.onChange(this.state.startPos,this.state.endPos,32e3)}},Object(i.e)("High"),"(32kHZ)"))))}}class u extends n.Component{constructor(e){super(e),this.player=null,this.canvasRef=n.createRef(),this.containerRef=n.createRef(),this.waveformMaskRef=n.createRef(),this.playerProgressRef=n.createRef(),this.currPosRef=n.createRef(),this.containerWidth=0,this.audioBuffer=null,this._animationId=null,this._startTime=0,this._changingSeekTime=!1,this.onload=()=>{if(this.canvasRef.current&&this.containerRef.current&&this.audioBuffer){const e=c(this.containerRef.current,this.audioBuffer);l(this.canvasRef.current,this.containerRef.current,e,this.props.waveformHeight)}},this._onResizeChange=e=>{if(this.containerRef.current&&this.canvasRef.current&&this.state.loaded&&this.audioBuffer&&this.containerRef.current.clientWidth!==this.containerWidth){const e=c(this.containerRef.current,this.audioBuffer);l(this.canvasRef.current,this.containerRef.current,e,this.props.waveformHeight),this.containerWidth=this.containerRef.current.clientWidth}},this.updatePlayProgress=()=>{if(!this._changingSeekTime){const e=this.playerProgressRef.current,t=this.waveformMaskRef.current,a=this.now()-this._startTime+this.state.theSeekToPos;if(e&&this.state.isPlaying&&this.audioBuffer&&this.player&&"started"===this.player.state&&!1===this.player.finished){const n=this.audioBuffer.duration;t&&(t.style.width=a%n/n*100+"%"),e.value=(a%n).toFixed(3),this.currPosRef.current&&(this.currPosRef.current.innerText=e.value)}this.player&&this.player.finished&&this.state.isPlaying&&(this.stop(),this.setState({isPlaying:!1,theSeekToPos:0},this._resetProgressUI))}this._animationId=requestAnimationFrame(this.updatePlayProgress)},this._resetProgressUI=()=>{this.waveformMaskRef.current&&(this.waveformMaskRef.current.style.width="0"),this.currPosRef.current&&(this.currPosRef.current.innerText="0")},this.play=()=>{if(null!==this.player||null===this.audioBuffer)return;this.player=new o(this.audioBuffer,this.props.audioContext);const e=this.now();this.player.start(e,this.state.theSeekToPos),this._startTime=e},this.stop=()=>{null!==this.player&&(this.player.stop(),this.player=null)},this.onMouseUp=()=>{if(this._changingSeekTime&&this.player&&!this.player.finished&&this.state.isPlaying){const e=this.now();this.player.seek(this.state.theSeekToPos,e),this._startTime=e}this._changingSeekTime=!1,document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchend",this.onMouseUp)},this.bindMouseEvent=()=>{document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("touchend",this.onMouseUp)},this.state={loaded:!1,isPlaying:!1,theSeekToPos:0}}now(){return this.props.audioContext.currentTime}shouldComponentUpdate(e,t){return e.data!==this.props.data?("string"==typeof e.data?this.fetchAudio(e.data):(this.audioBuffer=e.data,this.setState({loaded:!0})),!0):e.waveformHeight!==this.props.waveformHeight?(this.onload(),!0):t.loaded!==this.state.loaded||t.isPlaying!==this.state.isPlaying||t.theSeekToPos!==this.state.theSeekToPos}fetchAudio(e){this.audioBuffer=null,this.props.fetchAudio(e,e=>{this.containerRef.current&&this.canvasRef.current&&(this.audioBuffer=e,this.setState({loaded:!0},this.onload))})}componentDidMount(){window.addEventListener("resize",this._onResizeChange),"string"==typeof this.props.data?this.fetchAudio(this.props.data):(this.audioBuffer=this.props.data,this.setState({loaded:!0},this.onload)),this.updatePlayProgress()}componentWillUnmount(){window.removeEventListener("resize",this._onResizeChange),this.stop(),null!==this._animationId&&cancelAnimationFrame(this._animationId)}render(){return n.createElement("div",{className:s.container,ref:this.containerRef},n.createElement("div",{className:[s.waveformWrapper,this.state.loaded?"":s.loading].join(" ")},n.createElement("canvas",{style:{height:this.props.waveformHeight+"px"},ref:this.canvasRef}),n.createElement("div",{className:s.waveformMask,ref:this.waveformMaskRef,style:{left:"0",width:this.state.theSeekToPos/(this.audioBuffer?this.audioBuffer.duration:1/0)*100+"%"}})),this.state.loaded?"":n.createElement("div",{className:s.loadingIconWrapper},n.createElement("div",{className:s.loadingIcon})),this.state.loaded?n.createElement("div",{className:s.playTool},n.createElement("div",{className:[s.playButton,this.state.isPlaying?s.stop:""].join(" "),style:{position:"initial",marginTop:"13px"},onClick:()=>{this.state.isPlaying?(this.stop(),this.setState({isPlaying:!1,theSeekToPos:0},this._resetProgressUI)):this.setState({isPlaying:!0},()=>{this.play()})}},n.createElement("div",{className:[s.Icon,s.tabIcon].join(" ")})),n.createElement("div",{className:s.playtrack},n.createElement("div",{className:s.sliderWrapper,style:{marginTop:0}},n.createElement("label",null,n.createElement("div",{style:{display:"inline-block"},ref:this.currPosRef},this.state.theSeekToPos),"s"),n.createElement("span",null,this.audioBuffer?this.audioBuffer.duration.toFixed(3):0,"s"),n.createElement("input",{className:[s.small,s.input].join(" "),type:"range",min:0,max:this.audioBuffer.duration,ref:this.playerProgressRef,step:.001,value:this.state.theSeekToPos,onTouchStart:()=>{this.bindMouseEvent()},onMouseDown:()=>{this.bindMouseEvent()},onChange:e=>{this._changingSeekTime=!0;const t=Number(e.target.value);this.setState({theSeekToPos:t})}})))):null)}}class d extends n.Component{constructor(e){super(e),this.player=null,this.audioBuffer=null,this.playerProgressRef=n.createRef(),this.currPosRef=n.createRef(),this.containerRef=n.createRef(),this.containerWidth=0,this._animationId=null,this._startTime=0,this._changingSeekTime=!1,this._onResizeChange=e=>{this.containerRef.current&&this.state.loaded&&this.audioBuffer&&this.containerRef.current.clientWidth!==this.containerWidth&&(this.containerWidth=this.containerRef.current.clientWidth)},this.updatePlayProgress=()=>{if(!this._changingSeekTime){const e=this.playerProgressRef.current,t=this.now()-this._startTime+this.state.theSeekToPos;if(e&&this.state.isPlaying&&this.audioBuffer&&this.player&&"started"===this.player.state&&!1===this.player.finished){const a=this.audioBuffer.duration;e.value=(t%a).toFixed(3),this.currPosRef.current&&(this.currPosRef.current.innerText=e.value)}this.player&&this.player.finished&&this.state.isPlaying&&(this.stop(),this.setState({isPlaying:!1,theSeekToPos:0},this._resetProgressUI))}this._animationId=requestAnimationFrame(this.updatePlayProgress)},this._resetProgressUI=()=>{this.currPosRef.current&&(this.currPosRef.current.innerText="0")},this.play=()=>{if(null!==this.player||null===this.audioBuffer)return;this.player=new o(this.audioBuffer,this.props.audioContext);const e=this.now();this.player.start(e,this.state.theSeekToPos),this._startTime=e,this.props.onPlay&&this.props.onPlay()},this.stop=()=>{null!==this.player&&(this.player.stop(),this.player=null,this.setState({isPlaying:!1,theSeekToPos:0},this._resetProgressUI),this.props.onStop&&this.props.onStop())},this.getDuration=()=>this.audioBuffer?this.audioBuffer.duration.toFixed(2):"0",this.onMouseUp=()=>{if(this._changingSeekTime&&this.player&&!this.player.finished&&this.state.isPlaying){const e=this.now();this.player.seek(this.state.theSeekToPos,e),this._startTime=e}this._changingSeekTime=!1,document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchend",this.onMouseUp)},this.bindMouseEvent=()=>{document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("touchend",this.onMouseUp)},this.onPlayBtnClick=()=>{this.state.isPlaying?this.stop():this.setState({isPlaying:!0},()=>{this.play()})},this.state={loaded:!1,isPlaying:!1,theSeekToPos:0}}shouldComponentUpdate(e,t){return e.data!==this.props.data?("string"==typeof e.data?this.fetchAudio(e.data):(this.audioBuffer=e.data,this.setState({loaded:!0})),!0):t.loaded!==this.state.loaded||t.isPlaying!==this.state.isPlaying||t.theSeekToPos!==this.state.theSeekToPos}fetchAudio(e){this.audioBuffer=null,this.props.fetchAudio(e,e=>{this.audioBuffer=e,this.setState({loaded:!0})})}now(){return this.props.audioContext.currentTime}componentDidMount(){window.addEventListener("resize",this._onResizeChange),"string"==typeof this.props.data?this.fetchAudio(this.props.data):(this.audioBuffer=this.props.data,!0===this.props.autoPlay?this.setState({loaded:!0,isPlaying:!0},()=>{this.play()}):this.setState({loaded:!0})),this.updatePlayProgress()}componentWillUnmount(){window.removeEventListener("resize",this._onResizeChange),this.stop(),null!==this._animationId&&cancelAnimationFrame(this._animationId)}render(){const{loaded:e,isPlaying:t}=this.state,a=(this.audioBuffer?this.audioBuffer.duration.toFixed(3):0)+"s";return n.createElement(n.Fragment,null,e?n.createElement("div",{className:s.purePlayTool},void 0!==this.props.imageHash&&""!==this.props.imageHash?n.createElement("div",{className:s.coverImage,style:{backgroundImage:`url(${Object(r.a)(this.props.imageHash)})`},onClick:this.onPlayBtnClick},n.createElement("div",{className:s.iconWrapper},n.createElement("div",{className:t?s.pauseIcon:s.startIcon}))):n.createElement("div",{className:s.iconWrapper,onClick:this.onPlayBtnClick},n.createElement("div",{className:t?s.pauseIcon:s.startIcon})),n.createElement("div",{className:[s.audioInfo,t?s.hide:s.show].join(" ")},n.createElement("div",{className:s.audioName},this.props.name),n.createElement("div",{className:s.audioDuration},a)),n.createElement("div",{className:[s.purePlaytrack,t?s.show:s.hide].join(" ")},n.createElement("div",{className:s.sliderWrapper,style:{marginTop:0}},n.createElement("label",null,n.createElement("div",{style:{display:"inline-block"},ref:this.currPosRef},this.state.theSeekToPos),"s"),n.createElement("span",null,a),n.createElement("input",{className:[s.smallest,s.input].join(" "),type:"range",min:0,max:this.audioBuffer.duration,ref:this.playerProgressRef,step:.001,value:this.state.theSeekToPos,onTouchStart:()=>{this.bindMouseEvent()},onMouseDown:()=>{this.bindMouseEvent()},onChange:e=>{this._changingSeekTime=!0;const t=Number(e.target.value);this.setState({theSeekToPos:t})}})))):n.createElement("div",{className:s.loadingIconWrapper},n.createElement("div",{className:s.loadingIcon})))}}},991:function(e,t,a){e.exports={icon:"_3fKUTg1jXAC29DhiM8bwCi",iconSmall:"_2LFNX1mJO62gNH9OzkU9Hz",scrollbarStyle:"QhWS9Y_3pD-G2Ztnw2ANz",container:"_1LmoHbGR3glHlLF6nsLn8z",tabIcon:"_69hGfJ4Rbph0rOUfX2kRy _3fKUTg1jXAC29DhiM8bwCi",loadingIconWrapper:"_1YhTj9g6Y3B3lAHEpkzcM-",loadingIcon:"_2fBHExJ-FO3JK1ZAWzWHuw _3fKUTg1jXAC29DhiM8bwCi",rotation:"_2CE-LEpylDew_832sBICZg",playButton:"_3FNEcTA90JBpWTx8HUEVXl",Icon:"_1V4ZDQU2FmiS8HnjQNb2km",stop:"_19aRCHaDYOqfPezVg5adp9",waveformWrapper:"cr10ZLYF4qWUbMWa1igP9",loading:"_3aaHYPgE5a5qeNk1wm6gQL",waveformMask:"_2dAWsumvLn6hF5aAb0Q20U",playTool:"_1nsDAWmpuBctYPi6vM40Vn",playtrack:"_3-vwh9rs_v_9Iqjw7ZtuHA",sliderWrapper:"_2svifGlQKWHzjN7t45Bd-G",input:"_1bHj4llnAFT_BYTf5tT71x",small:"_2djehTF5Oe_NQoDqSZ-ohj",smallest:"m6X1pAAvljTcXuvDFUWsH",AudioQualityWrapper:"_3xH2YTKEuw-IwykNqnTMcB",label:"_3vja5srizuLwIP5A6-Q4zs",qualityRatioItem:"_1tOthNYq-OBW3LfiHqdZ7D",selected:"_3_iVnAq26EELiHRmyVjbFe",purePlayTool:"Oa5TYpiQs9-pW5Gbb_6pW",audioInfo:"_-Ov1jljb1ZMuVUAMqm7F",audioName:"_22oi10ohy8SUbv9VIuEwVD",audioDuration:"_3Feb_GIMgagDDrXxCC8Of3",show:"WzPYrdPWc3sHXww2iH1I8",hide:"_3cOTfTYf5L1KzUwDY_dgBc",coverImage:"_3xCEb07wwfXwPtEkDspjEa",iconWrapper:"sXjJoEEdRaucG3nv39kIf",startIcon:"_3XVP0id5K5fK4AtBa-f_FK _3fKUTg1jXAC29DhiM8bwCi",pauseIcon:"_2jBeglYR7QG_9uo9-1WAf- _3fKUTg1jXAC29DhiM8bwCi",purePlaytrack:"_1Im_4o9qW_afRHM2Hscv_z"}}}]);