phanpy-cz/assets/compose-xua1VIA2.js

27 lines
82 KiB
JavaScript
Raw Normal View History

2024-10-16 17:47:13 +00:00
var Dt=s=>{throw TypeError(s)};var mt=(s,t,n)=>t.has(s)||Dt("Cannot "+n);var B=(s,t,n)=>(mt(s,t,"read from private field"),n?n.call(s):t.get(s)),oe=(s,t,n)=>t.has(s)?Dt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),me=(s,t,n,a)=>(mt(s,t,"write to private field"),a?a.call(s,n):t.set(s,n),n),Y=(s,t,n)=>(mt(s,t,"access private method"),n);import{i as ge,z as vn,s as le,V as Jt,j as Ke,a as _t,h as q,A as V,M as bn,aD as Qt,d as Se,y as te,x as yn,aE as xn,l as je,c as e,T as K,b as wn,f as Pe,w as at,r as kn,af as En,P as Fn,u as Cn,t as $t,C as en}from"./useTitle-B8ZF9tfB.js";import{j as Fe,F as zn,_ as _n,a as $e,a8 as Ln,x as jt,u as An,k as tn,b as Sn,I as Z,z as Pt,i as Je,a9 as In,l as xt,M as Qe,s as ze,a4 as Mn,a0 as Bn,q as Tn,P as Rn,X as rt,c as Dn,d as Ot,y as $n}from"./fuse-RZOrQKm7.js";class jn{constructor(t,n,{tabInsertsSuggestions:a,defaultFirstOption:c}={}){this.input=t,this.list=n,this.tabInsertsSuggestions=a??!0,this.defaultFirstOption=c??!1,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=l=>Pn(l,this),this.compositionEventHandler=l=>Hn(l,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",n.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Ht),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Ht)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(gt)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const n=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(gt)[0],a=Array.from(this.list.querySelectorAll('[role="option"]')).filter(gt),c=a.indexOf(n);if(c===a.length-1&&t===1||c===0&&t===-1){this.clearSelection(),this.input.focus();return}let l=t===1?0:a.length-1;if(n&&c>=0){const x=c+t;x>=0&&x<a.length&&(l=x)}const o=a[l];if(o)for(const x of a)x.removeAttribute("data-combobox-option-default"),o===x?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),Nn(this.list,o)):x.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function Pn(s,t){if(!(s.shiftKey||s.metaKey||s.altKey)&&!(!t.ctrlBindings&&s.ctrlKey)&&!t.isComposing)switch(s.key){case"Enter":Nt(t.input,t.list)&&s.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&Nt(t.input,t.list)&&s.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),s.preventDefault();break;case"ArrowUp":t.navigate(-1),s.preventDefault();break;case"n":t.ctrlBindings&&s.ctrlKey&&(t.navigate(1),s.preventDefault());break;case"p":t.ctrlBindings&&s.ctrlKey&&(t.navigate(
`,n-1)>o||s.lastIndexOf(".",n-1)>o)return}else if(s.lastIndexOf(" ",n-1)>o)return;const x=s[o-1];return x&&!Kn.test(x)?void 0:{text:s.substring(o+t.length,n),position:o+t.length}}class Un extends HTMLElement{}class Vn extends Event{constructor(){super("update")}}const ft=new WeakMap;var Oe,He,Ne,xe,W,wt,Ae,Ie,Me,kt,Be,et,tt,nt,qe,_e;const At=class At extends Un{constructor(){super(...arguments);oe(this,W);oe(this,Oe,new MutationObserver(()=>Y(this,W,tt).call(this)));oe(this,He,new ResizeObserver(()=>Y(this,W,et).call(this)));oe(this,Ne);oe(this,xe);oe(this,Ie,0);oe(this,Me,0);oe(this,Be,!1);oe(this,qe,()=>Y(this,W,nt).call(this));oe(this,_e,n=>{Y(this,W,Ae).call(this,a=>{(n.target===document||n.target===window||n.target instanceof Node&&n.target.contains(a))&&Y(this,W,et).call(this)})})}static for(n){let a=ft.get(n);return a||(a=new At,a.connect(n),ft.set(n,a)),a}connect(n){me(this,Ne,new WeakRef(n)),me(this,xe,document.createElement("div")),B(this,xe).style.position="absolute",B(this,xe).style.pointerEvents="none",n.after(B(this,xe)),B(this,xe).appendChild(this)}forceUpdate(){Y(this,W,tt).call(this),Y(this,W,nt).call(this)}connectedCallback(){Y(this,W,Ae).call(this,n=>{this.style.pointerEvents="none",this.style.userSelect="none",this.style.overflow="hidden",this.style.display="block",this.style.visibility="hidden",n instanceof HTMLTextAreaElement?(this.style.whiteSpace="pre-wrap",this.style.wordWrap="break-word"):(this.style.whiteSpace="nowrap",this.style.display="table-cell",this.style.verticalAlign="middle"),this.setAttribute("aria-hidden","true"),Y(this,W,tt).call(this),Y(this,W,nt).call(this),B(this,Oe).observe(n,{attributeFilter:["style","dir"]}),B(this,He).observe(n),document.addEventListener("scroll",B(this,_e),{capture:!0}),window.addEventListener("resize",B(this,_e),{capture:!0}),n.addEventListener("input",B(this,qe),{capture:!0})})}disconnectedCallback(){var a;(a=B(this,xe))==null||a.remove(),B(this,Oe).disconnect(),B(this,He).disconnect(),document.removeEventListener("scroll",B(this,_e),{capture:!0}),window.removeEventListener("resize",B(this,_e),{capture:!0});const n=B(this,W,wt);n&&(n.removeEventListener("input",B(this,qe),{capture:!0}),ft.delete(n))}};Oe=new WeakMap,He=new WeakMap,Ne=new WeakMap,xe=new WeakMap,W=new WeakSet,wt=function(){var n;return(n=B(this,Ne))==null?void 0:n.deref()},Ae=function(n){const a=B(this,W,wt);return a?n(a):this.remove()},Ie=new WeakMap,Me=new WeakMap,kt=function(){Y(this,W,Ae).call(this,n=>{const a=window.getComputedStyle(n);this.style.height=a.height,this.style.width=a.width,n.clientHeight!==this.clientHeight&&(this.style.height=`calc(${a.height} + ${n.clientHeight-this.clientHeight}px)`),n.clientWidth!==this.clientWidth&&(this.style.width=`calc(${a.width} + ${n.clientWidth-this.clientWidth}px)`);const c=n.getBoundingClientRect(),l=this.getBoundingClientRect();me(this,Ie,B(this,Ie)+c.left-l.left),me(this,Me,B(this,Me)+c.top-l.top),this.style.transform=`translate(${B(this,Ie)}px, ${B(this,Me)}px)`,this.scrollTop=n.scrollTop,this.scrollLeft=n.scrollLeft,this.dispatchEvent(new Vn)})},Be=new WeakMap,et=function(){B(this,Be)||(me(this,Be,!0),requestAnimationFrame(()=>{Y(this,W,kt).call(this),me(this,Be,!1)}))},tt=function(){Y(this,W,Ae).call(this,n=>{const a=window.getComputedStyle(n);for(const c of Gn)this.style[c]=a[c];Y(this,W,et).call(this)})},nt=function(){Y(this,W,Ae).call(this,n=>{this.textContent=n.value,Y(this,W,kt).call(this)})},qe=new WeakMap,_e=new WeakMap;let it=At;const Gn=["direction","writingMode","unicodeBidi","textOrientation","boxSizing","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];try{customElements.define("input-style-clone",it)}catch(s){if(!(s instanceof DOMException&&s.name==="NotSupportedError"))throw s}var be,Te,Re,ce,Ft,nn,Ct,De;const st=c
`)&&(S.current.selectionStart=0,S.current.selectionEnd=0),(y=S.current)==null||y.focus())},300)};te(()=>{var r,d;if(t){const{spoilerText:y,visibility:p,language:A,sensitive:F}=t;y&&O.current&&(O.current.value=y);const b=[...new Set([t.account.acct,...t.mentions.map(E=>E.acct)])].filter(E=>E!==T.acct);b.length>0&&(S.current.value=`${b.map(E=>`@${E}`).join(" ")} `,fe()),we(),ie(p==="public"&&Q["posting:default:visibility"]?Q["posting:default:visibility"].toLowerCase():p),de(A||((r=Q["posting:default:language"])==null?void 0:r.toLowerCase())||Ce),ae(F&&!!y)}else if(n){const{visibility:y,language:p,sensitive:A,poll:F,mediaAttachments:I}=n,b=!!(F!=null&&F.options)&&{...F,options:F.options.map(E=>(E==null?void 0:E.title)||E),expiresIn:(F==null?void 0:F.expiresIn)||Gt(F.expiresAt)};M("loading"),(async()=>{var E;try{const H=await z.v1.statuses.$select(n.id).source.fetch(),{text:he,spoilerText:ve}=H;S.current.value=he,S.current.dataset.source=he,fe(),we(),O.current.value=ve,ie(y),de(p||((E=Q["posting:default:language"])==null?void 0:E.toLowerCase())||Ce),ae(A),b&&J(b),L(I),M("default")}catch(H){alert((H==null?void 0:H.reason)||H),M("error")}})()}else we(),Q["posting:default:visibility"]&&ie(Q["posting:default:visibility"].toLowerCase()),Q["posting:default:language"]&&de(Q["posting:default:language"].toLowerCase()),Q["posting:default:sensitive"]&&ae(!!Q["posting:default:sensitive"]);if(a){const{status:y,spoilerText:p,visibility:A,language:F,sensitive:I,poll:b,mediaAttachments:E}=a,H=!!(b!=null&&b.options)&&{...b,options:b.options.map(he=>(he==null?void 0:he.title)||he),expiresIn:(b==null?void 0:b.expiresIn)||Gt(b.expiresAt)};S.current.value=y,fe(),we(),p&&(O.current.value=p),A&&ie(A),de(F||((d=Q["posting:default:language"])==null?void 0:d.toLowerCase())||Ce),I!==null&&ae(I),H&&J(H),E&&L(E)}},[a,n,t]);const Le=V(),St=o._({id:"hR9gtK"}),ot=()=>{const{value:r,dataset:d}=S.current;if(g==="loading")return!1;const y=(r||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),p=v.length>0;if(!y&&!p||v.length>0&&v.every(E=>E.id))return!0;const F=(t==null?void 0:t.account.id)===T.id,I=t&&r.trim()===`@${t.account.acct}`;return!!(!F&&I||r===(d==null?void 0:d.source))},We=()=>ot()?!0:confirm(St);te(()=>{const r=d=>{ot()||(d.preventDefault(),d.returnValue=St)};return window.addEventListener("beforeunload",r,{capture:!0}),()=>window.removeEventListener("beforeunload",r,{capture:!0})},[]);const ln=()=>{const{value:r}=S.current,{value:d}=O.current;return Kt(di(r))+Kt(d)},lt=()=>{const r=ln();le.composerCharacterCount=r};te(lt,[]);const It=window.CloseWatcher,ct=V(!1);$e("esc",()=>{ct.current=!0},{enabled:!It,enableOnFormTags:!0}),$e("esc",()=>{!c&&ct.current&&We()&&s(),ct.current=!1},{enabled:!It,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:r=>{const d=document.querySelectorAll("#modal-container > *"),y=!!d,p=d.length===1&&d[0].querySelector("#compose-container");return y&&!p}}),Ln(()=>{!c&&We()&&s()},[c,We,s]);const Mt=V({}),Bt=()=>`${yn()}#${C.current}`,ut=()=>{if(n||le.composerState.minimized)return;const r=Bt(),d={key:r,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:C.current,status:S.current.value,spoilerText:O.current.value,visibility:U,language:D,sensitive:se,poll:P,mediaAttachments:v}};!xn(d,Mt.current)&&!ot()&&(jt.drafts.set(r,{...d,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(y=>{}),Mt.current=structuredClone(d))};An(ut,5e3),te(()=>(ut(),()=>{jt.drafts.del(Bt())}),[]),te(()=>{const r=y=>{const{items:p}=y.clipboardData||y.dataTransfer,A=[],F=[];for(let I=0;I<p.length;I++){const b=p[I];if(b.kind==="file"){const E=b.getAsFile();m!==void 0&&!m.includes(E.type)?F.push(E):A.push(E)}}if(F.length>0&&alert(o._({id:"rpXAF6",values:{0:F.length,1:F[0].name,2:_.format(F.map(I=>I.name))}})),A.length>0&&v.length>=u){alert(o._({id:"ctFhjs",values:{maxMediaAttachments:u}}));return}if(A.length>0){y.preventDefault(),y.stopPropagation();let I=A;if(u!==void 0){const E=u-v.length;if(I=I.slice(0,E),I.length<=0){alert(o._({id:"ctFhjs",values:{maxMediaAtta
<li role="option" data-value="${ke(S)}">
<img src="${ke(O)}" width="16" height="16" alt="" loading="lazy" />
${ke(S)}
</li>`}),X+=`<li role="option" data-value="" data-more="${k}">${ge._({id:"24misb"})}</li>`,Ee.innerHTML=X,j(Promise.resolve({matched:ue.length>0,fragment:Ee}));return}const G={"@":"accounts","#":"hashtags"}[f];j(new Promise(ue=>{x({type:G,q:k,limit:5}).then(pe=>{if(k!==M.current)return;const S=pe[G]||pe;let O="";S.forEach(U=>{var P;const{name:ie,avatarStatic:se,displayName:ae,username:D,acct:de,emojis:R,history:v}=U,L=Bn(ae,R);if(de)O+=`
<li role="option" data-value="${ke(de)}">
<span class="avatar">
<img src="${ke(se)}" width="16" height="16" alt="" loading="lazy" />
</span>
<span>
<b>${L||D}</b>
<br><span class="bidi-isolate">@${ke(de)}</span>
</span>
</li>
`;else{const J=(P=v==null?void 0:v.reduce)==null?void 0:P.call(v,(Q,fe)=>Q+ +fe.uses,0);O+=`
<li role="option" data-value="${ke(ie)}">
<span class="grow">#<b>${ke(ie)}</b></span>
${J?`<span class="count">${Tn(J)}</span>`:""}
</li>
`}}),G==="accounts"&&(O+=`<li role="option" data-value="" data-more="${k}">${ge._({id:"24misb"})}</li>`),Ee.innerHTML=O,ue({matched:S.length>0,fragment:Ee})})}))},g.current.addEventListener("text-expander-change",u),h=w=>{const{key:f,item:j}=w.detail,{value:k,more:G}=j.dataset;f===":"?(w.detail.value=k?`:${k}:`:"",G&&(w.detail.continue=!0,setTimeout(()=>{_==null||_({name:"custom-emojis",defaultSearchTerm:G})},300))):f==="@"?(w.detail.value=k?`@${k} `:"",G&&(w.detail.continue=!0,setTimeout(()=>{_==null||_({name:"mention",defaultSearchTerm:G})},300))):w.detail.value=`${f}${k}`},g.current.addEventListener("text-expander-value",h),m=w=>{const{input:f}=w.detail;if(l(f.value),t.current){const j=new Event("input",{bubbles:!0});t.current.dispatchEvent(j)}},g.current.addEventListener("text-expander-committed",m)),()=>{g.current&&(g.current.removeEventListener("text-expander-change",u),g.current.removeEventListener("text-expander-value",h),g.current.removeEventListener("text-expander-committed",m))}},[]),te(()=>{const u=t.current;if(!u)return;new ResizeObserver(()=>{if(g.current){const{height:m}=u.getBoundingClientRect();g.current.style.height=m+"px"}}).observe(u)},[]);const C=V(0),$=V(),T=Rn(u=>{var w;if(!$.current)return;if(C.current>3){$.current.innerHTML="",$.current=null,(w=T==null?void 0:T.cancel)==null||w.call(T);return}let h,m;C.current<=3&&(h=Date.now()),$.current.innerHTML=bi(u,{maxCharacters:o})+`
`,C.current<=3&&(m=Date.now()),h&&m&&m-h>50&&C.current++},500),ne=rt(()=>{var m,w;const u=(m=$.current)==null?void 0:m.cloneNode(!0);if(!u)return;u.querySelectorAll("mark").forEach(f=>{f.remove()});const h=(w=u.innerText)==null?void 0:w.trim();h&&(async()=>{const f=await ki(h);f!=null&&f.length&&(_==null||_({name:"auto-detect-language",languages:f}))})()},2e3);return e("text-expander",{ref:g,keys:"@ # :",class:"compose-field-container",children:[e("textarea",{class:"compose-field",autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",rows:"6",cols:"50",...z,ref:t,name:"status",value:c,onKeyDown:u=>{const{key:h,target:m}=u;if(h==="Enter"&&!(u.ctrlKey||u.metaKey))try{const{value:w,selectionStart:f}=m,k=w.slice(0,f).split(`
`).slice(-1)[0];if(k&&/^\s*(-|\d+\.)\s/.test(k)){const[G,re,ue,X,pe]=k.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(pe){u.preventDefault();const[S]=ue.match(/\d+/)||[],O=S?`${+S+1}.`:"-",U=`
${re}${O}${X}`;m.setRangeText(U,f,f);const ie=f+U.length;m.setSelectionRange(ie,ie)}else{const S=f-k.length;m.setRangeText("",S,f)}Yt(m),m.dispatchEvent(new Event("input"))}}catch{}$.current&&($.current.scrollTop=m.scrollTop)},onInput:u=>{var w;const{target:h}=u,m=h.value.replace(/\u200b/g,"");l(m),Yt(h),(w=s.onInput)==null||w.call(s,u),T(m),ne()},style:{width:"100%",height:"4em"},onScroll:u=>{if($.current){const{scrollTop:h}=u.target;$.current.scrollTop=h}}}),e("div",{ref:$,class:"compose-highlight","aria-hidden":"true"})]})});function Fi({maxCharacters:s=500,hidden:t}){const a=Cn(le).composerCharacterCount,c=s-a;return t?e("span",{class:"char-counter",hidden:!0}):e("span",{class:"char-counter",title:`${c}/${s}`,style:{"--percentage":a/s*100},children:[e("meter",{class:`${c<=-10?"explode":c<=0?"danger":c<=20?"warning":""}`,value:a,max:s}),e("span",{class:"counter",children:c})]})}function Zt(s,t,n,a){const c=Math.sqrt(t/s),l=Math.floor(n*c),o=Math.floor(a*c);return{newWidth:l,newHeight:o}}function Ci({attachment:s,disabled:t,lang:n,onDescriptionChange:a=()=>{},onRemove:c=()=>{}}){const{i18n:l}=Ke(),[o,x]=q("default"),_=Je("@mastodon/edit-media-attributes"),{type:z,id:N,file:g}=s,M=je(()=>g?URL.createObjectURL(g):s.url,[g,s.url]),C=!!(g!=null&&g.size),$=C?Qt():{},{mediaAttachments:{imageSizeLimit:T,imageMatrixLimit:ne,videoSizeLimit:ee,videoMatrixLimit:u,videoFrameRateLimit:h}={}}=$||{},[m,w]=q(()=>C?z.startsWith("image")&&T&&g.size>T?{type:"imageSizeLimit",details:{imageSize:g.size,imageSizeLimit:T}}:z.startsWith("video")&&ee&&g.size>ee?{type:"videoSizeLimit",details:{videoSize:g.size,videoSizeLimit:ee}}:null:null),[f,j]=q({});te(()=>{!C||!ne||(f==null?void 0:f.matrix)>ne&&w({type:"imageMatrixLimit",details:{imageMatrix:f==null?void 0:f.matrix,imageMatrixLimit:ne,width:f==null?void 0:f.width,height:f==null?void 0:f.height}})},[f,ne,C]);const[k,G]=q({});te(()=>{!C||!u||(k==null?void 0:k.matrix)>u&&w({type:"videoMatrixLimit",details:{videoMatrix:k==null?void 0:k.matrix,videoMatrixLimit:u,width:k==null?void 0:k.width,height:k==null?void 0:k.height}})},[k,u,C]);const[re,ue]=q(s.description),[X,pe]=z.split("/"),S=rt(a,250);te(()=>{S(re)},[re,S]);const[O,U]=q(!1),ie=V(null);te(()=>{let R;return O&&ie.current&&(R=setTimeout(()=>{ie.current.focus()},100)),()=>{clearTimeout(R)}},[O]);const se=e(Pe,{children:N&&!_?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(K,{id:"3wG7HI"})}),e("p",{title:re,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:ie,value:re||"",lang:n,placeholder:{image:l._({id:"Lh8B0N"}),video:l._({id:"mN4S+e"}),audio:l._({id:"ieZytw"})}[X],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||o==="loading",class:o==="loading"?"loading":"",maxlength:"1500",onInput:R=>{const{value:v}=R.target;ue(v)}})}),ae=V(null);te(()=>()=>{var R,v;(v=(R=ae.current)==null?void 0:R.hideToast)==null||v.call(R)},[]);const D=V(null),de=R=>{const{type:v,details:L}=R;switch(v){case"imageSizeLimit":{const{imageSize:P,imageSizeLimit:J}=L;return l._({id:"d83/LB",values:{0:Xe(P),1:Xe(J)}})}case"imageMatrixLimit":{const{imageMatrix:P,imageMatrixLimit:J,width:Q,height:fe}=L,{newWidth:we,newHeight:Le}=Zt(P,J,Q,fe);return l._({id:"DuvOX/",values:{0:l.number(Q),1:l.number(fe),2:l.number(we),3:l.number(Le)}})}case"videoSizeLimit":{const{videoSize:P,videoSizeLimit:J}=L;return l._({id:"d83/LB",values:{0:Xe(P),1:Xe(J)}})}case"videoMatrixLimit":{const{videoMatrix:P,videoMatrixLimit:J,width:Q,height:fe}=L,{newWidth:we,newHeight:Le}=Zt(P,J,Q,fe);return l._({id:"DuvOX/",values:{0:l.number(Q),1:l.number(fe),2:l.number(we),3:l.number(Le)}})}case"videoFrameRateLimit":return l._({id:"S1fBwy"})}};return e(Pe,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{U(!0)},children:X==="image"?e("img",{src:M,alt:"",onLoad:R=>{if(!C)return;const{naturalWidth:v,naturalHeight:L}=R.target;j({matrix:v*L,width:v,height:L})}}):X==="video"||X==="gifv"?e("video",{src:M+"#t=0.1",playsinline:!0,muted:!0,disableP
//# sourceMappingURL=compose-xua1VIA2.js.map